331 |
if (bDirection & 8) CHECK_CANDIDATE(x, y + iDiamondSize, 8); |
if (bDirection & 8) CHECK_CANDIDATE(x, y + iDiamondSize, 8); |
332 |
|
|
333 |
/* now we're doing diagonal checks near our candidate */ |
/* now we're doing diagonal checks near our candidate */ |
|
|
|
|
if (*iDirection) { /* checking if anything found */ |
|
334 |
bDirection = *iDirection; |
bDirection = *iDirection; |
335 |
*iDirection = 0; |
if (*iDirection) { /* checking if anything found */ |
336 |
x = data->currentMV->x; y = data->currentMV->y; |
x = data->currentMV->x; y = data->currentMV->y; |
337 |
if (bDirection & 3) { /* our candidate is left or right */ |
if (bDirection & 3) { /* our candidate is left or right */ |
338 |
|
*iDirection=4+8; |
339 |
CHECK_CANDIDATE(x, y + iDiamondSize, 8); |
CHECK_CANDIDATE(x, y + iDiamondSize, 8); |
340 |
CHECK_CANDIDATE(x, y - iDiamondSize, 4); |
CHECK_CANDIDATE(x, y - iDiamondSize, 4); |
341 |
} else { /* what remains here is up or down */ |
} else { /* what remains here is up or down */ |
342 |
|
*iDirection=1+2; |
343 |
CHECK_CANDIDATE(x + iDiamondSize, y, 2); |
CHECK_CANDIDATE(x + iDiamondSize, y, 2); |
344 |
CHECK_CANDIDATE(x - iDiamondSize, y, 1); |
CHECK_CANDIDATE(x - iDiamondSize, y, 1); |
345 |
} |
} |
347 |
x = data->currentMV->x; y = data->currentMV->y; |
x = data->currentMV->x; y = data->currentMV->y; |
348 |
} |
} |
349 |
} |
} |
350 |
while (*iDirection); |
while (bDirection); |
351 |
} |
} |
352 |
|
|
353 |
void |
void |
354 |
xvid_me_SubpelRefine(SearchData * const data, CheckFunc * const CheckCandidate, int dir) |
xvid_me_SubpelRefine(VECTOR centerMV, SearchData * const data, CheckFunc * const CheckCandidate, int dir) |
355 |
{ |
{ |
356 |
/* Do a half-pel or q-pel refinement */ |
/* Do a half-pel or q-pel refinement */ |
|
const VECTOR centerMV = data->qpel_precision ? *data->currentQMV : *data->currentMV; |
|
357 |
|
|
358 |
CHECK_CANDIDATE(centerMV.x, centerMV.y - 1, dir); |
CHECK_CANDIDATE(centerMV.x, centerMV.y - 1, dir); |
359 |
CHECK_CANDIDATE(centerMV.x + 1, centerMV.y - 1, dir); |
CHECK_CANDIDATE(centerMV.x + 1, centerMV.y - 1, dir); |