20 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 |
* |
* |
23 |
* $Id: estimation_rd_based.c,v 1.15 2010-11-28 15:18:21 Isibaar Exp $ |
* $Id: estimation_rd_based.c,v 1.16 2010-12-18 16:02:00 Isibaar Exp $ |
24 |
* |
* |
25 |
****************************************************************************/ |
****************************************************************************/ |
26 |
|
|
371 |
MACROBLOCK * const pMB, const MACROBLOCK * const pMBs, |
MACROBLOCK * const pMB, const MACROBLOCK * const pMBs, |
372 |
const int x, const int y, |
const int x, const int y, |
373 |
const MBParam * const pParam, const uint32_t MotionFlags, |
const MBParam * const pParam, const uint32_t MotionFlags, |
374 |
const VECTOR * const backup) |
const VECTOR * const backup, const int bound) |
375 |
{ |
{ |
376 |
|
|
377 |
unsigned int cbp = 0, t = 0, i; |
unsigned int cbp = 0, t = 0, i; |
400 |
Data8->rel_var8[0] = Data->rel_var8[i]; |
Data8->rel_var8[0] = Data->rel_var8[i]; |
401 |
|
|
402 |
if(Data->qpel) { |
if(Data->qpel) { |
403 |
Data8->predMV = get_qpmv2(pMBs, pParam->mb_width, 0, x, y, i); |
Data8->predMV = get_qpmv2(pMBs, pParam->mb_width, bound, x, y, i); |
404 |
if (i != 0) t = d_mv_bits( Data8->currentQMV->x, Data8->currentQMV->y, |
if (i != 0) t = d_mv_bits( Data8->currentQMV->x, Data8->currentQMV->y, |
405 |
Data8->predMV, Data8->iFcode, 0) - 2; |
Data8->predMV, Data8->iFcode, 0) - 2; |
406 |
} else { |
} else { |
407 |
Data8->predMV = get_pmv2(pMBs, pParam->mb_width, 0, x, y, i); |
Data8->predMV = get_pmv2(pMBs, pParam->mb_width, bound, x, y, i); |
408 |
if (i != 0) t = d_mv_bits( Data8->currentMV->x, Data8->currentMV->y, |
if (i != 0) t = d_mv_bits( Data8->currentMV->x, Data8->currentMV->y, |
409 |
Data8->predMV, Data8->iFcode, 0) - 2; |
Data8->predMV, Data8->iFcode, 0) - 2; |
410 |
} |
} |
645 |
const IMAGE * const pCurrent, |
const IMAGE * const pCurrent, |
646 |
const IMAGE * const pRef, |
const IMAGE * const pRef, |
647 |
const IMAGE * const vGMC, |
const IMAGE * const vGMC, |
648 |
const int coding_type) |
const int coding_type, |
649 |
|
const int bound) |
650 |
{ |
{ |
651 |
int mode = MODE_INTER; |
int mode = MODE_INTER; |
652 |
int mcsel = 0; |
int mcsel = 0; |
690 |
|
|
691 |
if (inter4v) { |
if (inter4v) { |
692 |
int v4_rd; |
int v4_rd; |
693 |
v4_rd = findRD_inter4v(Data, pMB, pMBs, x, y, pParam, MotionFlags, backup); |
v4_rd = findRD_inter4v(Data, pMB, pMBs, x, y, pParam, MotionFlags, backup, bound); |
694 |
if (v4_rd < min_rd) { |
if (v4_rd < min_rd) { |
695 |
Data->iMinSAD[0] = min_rd = v4_rd; |
Data->iMinSAD[0] = min_rd = v4_rd; |
696 |
mode = MODE_INTER4V; |
mode = MODE_INTER4V; |
754 |
const IMAGE * const pCurrent, |
const IMAGE * const pCurrent, |
755 |
const IMAGE * const pRef, |
const IMAGE * const pRef, |
756 |
const IMAGE * const vGMC, |
const IMAGE * const vGMC, |
757 |
const int coding_type) |
const int coding_type, |
758 |
|
const int bound) |
759 |
{ |
{ |
760 |
int mode = MODE_INTER; |
int mode = MODE_INTER; |
761 |
int mcsel = 0; |
int mcsel = 0; |
867 |
|
|
868 |
if (inter4v) { |
if (inter4v) { |
869 |
int v4_rd; |
int v4_rd; |
870 |
v4_rd = findRD_inter4v(Data, pMB, pMBs, x, y, pParam, MotionFlags, backup); |
v4_rd = findRD_inter4v(Data, pMB, pMBs, x, y, pParam, MotionFlags, backup, bound); |
871 |
if (v4_rd < min_rd) { |
if (v4_rd < min_rd) { |
872 |
Data->iMinSAD[0] = min_rd = v4_rd; |
Data->iMinSAD[0] = min_rd = v4_rd; |
873 |
mode = MODE_INTER4V; |
mode = MODE_INTER4V; |
943 |
|
|
944 |
if(mode == MODE_INTER4V) { |
if(mode == MODE_INTER4V) { |
945 |
int v4_rd; |
int v4_rd; |
946 |
v4_rd = findRD_inter4v(Data, pMB, pMBs, x, y, pParam, MotionFlags, backup); |
v4_rd = findRD_inter4v(Data, pMB, pMBs, x, y, pParam, MotionFlags, backup, bound); |
947 |
if (v4_rd < min_rd) { |
if (v4_rd < min_rd) { |
948 |
Data->iMinSAD[0] = min_rd = v4_rd; |
Data->iMinSAD[0] = min_rd = v4_rd; |
949 |
mode = MODE_INTER4V; |
mode = MODE_INTER4V; |