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 */ |