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 |
|
|
912 |
sad00 = pMB->sad16; |
sad00 = 4*MAX(MAX(pMB->sad8[0], pMB->sad8[1]), MAX(pMB->sad8[2], pMB->sad8[3])); |
913 |
|
|
914 |
/* initial skip decision */ |
/* initial skip decision */ |
915 |
/* no early skip for GMC (global vector = skip vector is unknown!) */ |
/* no early skip for GMC (global vector = skip vector is unknown!) */ |
916 |
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 */ |
917 |
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) |
|
|
|
|
918 |
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)) { |
919 |
ZeroMacroblockP(pMB, sad00); |
ZeroMacroblockP(pMB, sad00); |
920 |
pMB->mode = MODE_NOT_CODED; |
pMB->mode = MODE_NOT_CODED; |
964 |
else |
else |
965 |
ModeDecision_SAD(&Data, pMB, pMBs, x, y, pParam, |
ModeDecision_SAD(&Data, pMB, pMBs, x, y, pParam, |
966 |
MotionFlags, current->vop_flags, current->vol_flags, |
MotionFlags, current->vop_flags, current->vol_flags, |
967 |
pCurrent, pRef, pGMC, current->coding_type); |
pCurrent, pRef, pGMC, current->coding_type, sad00); |
968 |
|
|
969 |
|
|
970 |
if (pMB->mode == MODE_INTRA) |
if (pMB->mode == MODE_INTRA) |