128 |
} |
} |
129 |
|
|
130 |
predict_acdc(pMB-(x+mb_width*y), x, y, mb_width, block, qcoeff, |
predict_acdc(pMB-(x+mb_width*y), x, y, mb_width, block, qcoeff, |
131 |
quant, iDcScaler, predictors, 0, 0); |
quant, iDcScaler, predictors, 0); |
132 |
|
|
133 |
direction = pMB->acpred_directions[block]; |
direction = pMB->acpred_directions[block]; |
134 |
pCurrent = pMB->pred_values[block]; |
pCurrent = pMB->pred_values[block]; |
135 |
|
|
136 |
/* store current coeffs to pred_values[] for future prediction */ |
/* store current coeffs to pred_values[] for future prediction */ |
137 |
pCurrent[0] = qcoeff[0] * iDcScaler; |
pCurrent[0] = qcoeff[0] * iDcScaler; |
138 |
|
pCurrent[0] = CLIP(pCurrent[0], -2048, 2047); |
139 |
for (i = 1; i < 8; i++) { |
for (i = 1; i < 8; i++) { |
140 |
pCurrent[i] = qcoeff[i]; |
pCurrent[i] = qcoeff[i]; |
141 |
pCurrent[i + 7] = qcoeff[i * 8]; |
pCurrent[i + 7] = qcoeff[i * 8]; |
313 |
xvid_me_SquareSearch(Data->currentMV->x, Data->currentMV->y, Data, 255, CheckCandidateRD16); |
xvid_me_SquareSearch(Data->currentMV->x, Data->currentMV->y, Data, 255, CheckCandidateRD16); |
314 |
|
|
315 |
if (MotionFlags&XVID_ME_HALFPELREFINE16_RD) |
if (MotionFlags&XVID_ME_HALFPELREFINE16_RD) |
316 |
xvid_me_SubpelRefine(Data, CheckCandidateRD16, 0); |
xvid_me_SubpelRefine(Data->currentMV[0], Data, CheckCandidateRD16, 0); |
317 |
|
|
318 |
if (Data->qpel) { |
if (Data->qpel) { |
319 |
if (MotionFlags&(XVID_ME_EXTSEARCH_RD | XVID_ME_HALFPELREFINE16_RD)) { /* there was halfpel-precision search */ |
if (MotionFlags&(XVID_ME_EXTSEARCH_RD | XVID_ME_HALFPELREFINE16_RD)) { /* there was halfpel-precision search */ |
331 |
if (MotionFlags & XVID_ME_FASTREFINE16) |
if (MotionFlags & XVID_ME_FASTREFINE16) |
332 |
FullRefine_Fast(Data, CheckCandidateRD16, 0); |
FullRefine_Fast(Data, CheckCandidateRD16, 0); |
333 |
else |
else |
334 |
xvid_me_SubpelRefine(Data, CheckCandidateRD16, 0); |
xvid_me_SubpelRefine(Data->currentQMV[0], Data, CheckCandidateRD16, 0); |
335 |
} |
} |
336 |
} |
} |
337 |
|
|
414 |
xvid_me_SquareSearch(Data8->currentMV->x, Data8->currentMV->x, Data8, 255, CheckCandidateRD8); |
xvid_me_SquareSearch(Data8->currentMV->x, Data8->currentMV->x, Data8, 255, CheckCandidateRD8); |
415 |
|
|
416 |
if (MotionFlags & XVID_ME_HALFPELREFINE8_RD) |
if (MotionFlags & XVID_ME_HALFPELREFINE8_RD) |
417 |
xvid_me_SubpelRefine(Data8, CheckCandidateRD8, 0); |
xvid_me_SubpelRefine(Data->currentMV[0], Data8, CheckCandidateRD8, 0); |
418 |
|
|
419 |
if(bsad > *Data8->iMinSAD) { /* we have found a better match */ |
if(bsad > *Data8->iMinSAD) { /* we have found a better match */ |
420 |
bx = Data8->currentQMV->x = 2*Data8->currentMV->x; |
bx = Data8->currentQMV->x = 2*Data8->currentMV->x; |
431 |
if (MotionFlags & XVID_ME_QUARTERPELREFINE8_RD) { |
if (MotionFlags & XVID_ME_QUARTERPELREFINE8_RD) { |
432 |
if (MotionFlags & XVID_ME_FASTREFINE8) |
if (MotionFlags & XVID_ME_FASTREFINE8) |
433 |
FullRefine_Fast(Data8, CheckCandidateRD8, 0); |
FullRefine_Fast(Data8, CheckCandidateRD8, 0); |
434 |
else xvid_me_SubpelRefine(Data8, CheckCandidateRD8, 0); |
else xvid_me_SubpelRefine(Data->currentQMV[0], Data8, CheckCandidateRD8, 0); |
435 |
} |
} |
436 |
|
|
437 |
if (bsad <= Data->iMinSAD[0]) { |
if (bsad <= Data->iMinSAD[0]) { |
447 |
xvid_me_SquareSearch(Data8->currentMV->x, Data8->currentMV->x, Data8, 255, CheckCandidateRD8); |
xvid_me_SquareSearch(Data8->currentMV->x, Data8->currentMV->x, Data8, 255, CheckCandidateRD8); |
448 |
|
|
449 |
if (MotionFlags & XVID_ME_HALFPELREFINE8_RD) |
if (MotionFlags & XVID_ME_HALFPELREFINE8_RD) |
450 |
xvid_me_SubpelRefine(Data8, CheckCandidateRD8, 0); /* halfpel refinement */ |
xvid_me_SubpelRefine(Data->currentMV[0], Data8, CheckCandidateRD8, 0); /* halfpel refinement */ |
451 |
} |
} |
452 |
|
|
453 |
/* checking vector equal to predicion */ |
/* checking vector equal to predicion */ |