42 |
|
|
43 |
static const int xvid_me_lambda_vec8[32] = |
static const int xvid_me_lambda_vec8[32] = |
44 |
{ 0 ,(int)(1.00235 * NEIGH_TEND_8X8 + 0.5), |
{ 0 ,(int)(1.00235 * NEIGH_TEND_8X8 + 0.5), |
45 |
(int)(1.15582 + NEIGH_TEND_8X8 + 0.5), (int)(1.31976*NEIGH_TEND_8X8 + 0.5), |
(int)(1.15582*NEIGH_TEND_8X8 + 0.5), (int)(1.31976*NEIGH_TEND_8X8 + 0.5), |
46 |
(int)(1.49591*NEIGH_TEND_8X8 + 0.5), (int)(1.68601*NEIGH_TEND_8X8 + 0.5), |
(int)(1.49591*NEIGH_TEND_8X8 + 0.5), (int)(1.68601*NEIGH_TEND_8X8 + 0.5), |
47 |
(int)(1.89187*NEIGH_TEND_8X8 + 0.5), (int)(2.11542*NEIGH_TEND_8X8 + 0.5), |
(int)(1.89187*NEIGH_TEND_8X8 + 0.5), (int)(2.11542*NEIGH_TEND_8X8 + 0.5), |
48 |
(int)(2.35878*NEIGH_TEND_8X8 + 0.5), (int)(2.62429*NEIGH_TEND_8X8 + 0.5), |
(int)(2.35878*NEIGH_TEND_8X8 + 0.5), (int)(2.62429*NEIGH_TEND_8X8 + 0.5), |
312 |
const IMAGE * const pCurrent, |
const IMAGE * const pCurrent, |
313 |
const IMAGE * const pRef, |
const IMAGE * const pRef, |
314 |
const IMAGE * const vGMC, |
const IMAGE * const vGMC, |
315 |
const int coding_type) |
const int coding_type, |
316 |
|
const int skip_sad) |
317 |
{ |
{ |
318 |
int mode = MODE_INTER; |
int mode = MODE_INTER; |
319 |
int mcsel = 0; |
int mcsel = 0; |
339 |
} |
} |
340 |
|
|
341 |
/* final skip decision, a.k.a. "the vector you found, really that good?" */ |
/* final skip decision, a.k.a. "the vector you found, really that good?" */ |
342 |
if (skip_possible && (pMB->sad16 < (int)iQuant * MAX_SAD00_FOR_SKIP)) |
if (skip_possible && (skip_sad < (int)iQuant * MAX_SAD00_FOR_SKIP)) |
343 |
if ( (100*sad)/(pMB->sad16+1) > FINAL_SKIP_THRESH) |
if ( (100*skip_sad)/(pMB->sad16+1) > FINAL_SKIP_THRESH) |
344 |
if (Data->chroma || xvid_me_SkipDecisionP(pCurrent, pRef, x, y, Data->iEdgedWidth/2, iQuant, Data->rrv)) { |
if (Data->chroma || xvid_me_SkipDecisionP(pCurrent, pRef, x, y, Data->iEdgedWidth/2, iQuant, Data->rrv)) { |
345 |
mode = MODE_NOT_CODED; |
mode = MODE_NOT_CODED; |
346 |
sad = 0; |
sad = 0; |
898 |
pRef->y + (x + y * iEdgedWidth) * 32, |
pRef->y + (x + y * iEdgedWidth) * 32, |
899 |
pParam->edged_width, pMB->sad8 ); |
pParam->edged_width, pMB->sad8 ); |
900 |
|
|
901 |
|
sad00 = 4*MAX(MAX(pMB->sad8[0], pMB->sad8[1]), MAX(pMB->sad8[2], pMB->sad8[3])); |
902 |
|
|
903 |
if (Data.chroma) { |
if (Data.chroma) { |
904 |
Data.chromaSAD = sad8(pCurrent->u + x*8 + y*(iEdgedWidth/2)*8, |
Data.chromaSAD = sad8(pCurrent->u + x*8 + y*(iEdgedWidth/2)*8, |
905 |
pRef->u + x*8 + y*(iEdgedWidth/2)*8, iEdgedWidth/2) |
pRef->u + x*8 + y*(iEdgedWidth/2)*8, iEdgedWidth/2) |
906 |
+ sad8(pCurrent->v + (x + y*(iEdgedWidth/2))*8, |
+ sad8(pCurrent->v + (x + y*(iEdgedWidth/2))*8, |
907 |
pRef->v + (x + y*(iEdgedWidth/2))*8, iEdgedWidth/2); |
pRef->v + (x + y*(iEdgedWidth/2))*8, iEdgedWidth/2); |
908 |
pMB->sad16 += Data.chromaSAD; |
pMB->sad16 += Data.chromaSAD; |
909 |
|
sad00 += Data.chromaSAD; |
910 |
} |
} |
911 |
|
|
|
sad00 = pMB->sad16; |
|
|
|
|
912 |
/* initial skip decision */ |
/* initial skip decision */ |
913 |
/* no early skip for GMC (global vector = skip vector is unknown!) */ |
/* no early skip for GMC (global vector = skip vector is unknown!) */ |
914 |
if (current->coding_type != S_VOP) { /* no fast SKIP for S(GMC)-VOPs */ |
if (current->coding_type != S_VOP) { /* no fast SKIP for S(GMC)-VOPs */ |
915 |
if (pMB->dquant == 0 |
if (pMB->dquant == 0 && sad00 < pMB->quant * skip_thresh) |
|
&& pMB->sad8[0] < pMB->quant * skip_thresh |
|
|
&& pMB->sad8[1] < pMB->quant * skip_thresh |
|
|
&& pMB->sad8[2] < pMB->quant * skip_thresh |
|
|
&& pMB->sad8[3] < pMB->quant * skip_thresh) |
|
|
|
|
916 |
if (Data.chroma || xvid_me_SkipDecisionP(pCurrent, pRef, x, y, iEdgedWidth/2, pMB->quant, Data.rrv)) { |
if (Data.chroma || xvid_me_SkipDecisionP(pCurrent, pRef, x, y, iEdgedWidth/2, pMB->quant, Data.rrv)) { |
917 |
ZeroMacroblockP(pMB, sad00); |
ZeroMacroblockP(pMB, sad00); |
918 |
pMB->mode = MODE_NOT_CODED; |
pMB->mode = MODE_NOT_CODED; |
962 |
else |
else |
963 |
ModeDecision_SAD(&Data, pMB, pMBs, x, y, pParam, |
ModeDecision_SAD(&Data, pMB, pMBs, x, y, pParam, |
964 |
MotionFlags, current->vop_flags, current->vol_flags, |
MotionFlags, current->vop_flags, current->vol_flags, |
965 |
pCurrent, pRef, pGMC, current->coding_type); |
pCurrent, pRef, pGMC, current->coding_type, sad00); |
966 |
|
|
967 |
|
|
968 |
if (pMB->mode == MODE_INTRA) |
if (pMB->mode == MODE_INTRA) |