21 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
22 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 |
* |
* |
24 |
* $Id: estimation_common.c,v 1.6 2004-10-03 14:25:01 syskin Exp $ |
* $Id: estimation_common.c,v 1.8 2004-10-03 14:49:34 chl Exp $ |
25 |
* |
* |
26 |
****************************************************************************/ |
****************************************************************************/ |
27 |
|
|
323 |
|
|
324 |
unsigned int * const iDirection = &data->dir; |
unsigned int * const iDirection = &data->dir; |
325 |
|
|
326 |
do { |
for (;;) { |
327 |
*iDirection = 0; |
*iDirection = 0; |
328 |
if (bDirection & 1) CHECK_CANDIDATE(x - iDiamondSize, y, 1); |
if (bDirection & 1) CHECK_CANDIDATE(x - iDiamondSize, y, 1); |
329 |
if (bDirection & 2) CHECK_CANDIDATE(x + iDiamondSize, y, 2); |
if (bDirection & 2) CHECK_CANDIDATE(x + iDiamondSize, y, 2); |
330 |
if (bDirection & 4) CHECK_CANDIDATE(x, y - iDiamondSize, 4); |
if (bDirection & 4) CHECK_CANDIDATE(x, y - iDiamondSize, 4); |
331 |
if (bDirection & 8) CHECK_CANDIDATE(x, y + iDiamondSize, 8); |
if (bDirection & 8) CHECK_CANDIDATE(x, y + iDiamondSize, 8); |
332 |
|
|
333 |
|
if (*iDirection == 0) |
334 |
|
break; |
335 |
|
|
336 |
/* now we're doing diagonal checks near our candidate */ |
/* now we're doing diagonal checks near our candidate */ |
337 |
bDirection = *iDirection; |
bDirection = *iDirection; |
|
if (*iDirection) { /* checking if anything found */ |
|
|
*iDirection = 0; |
|
338 |
x = data->currentMV->x; y = data->currentMV->y; |
x = data->currentMV->x; y = data->currentMV->y; |
339 |
if (bDirection & 3) { /* our candidate is left or right */ |
if (bDirection & 3) { /* our candidate is left or right */ |
340 |
CHECK_CANDIDATE(x, y + iDiamondSize, 8); |
CHECK_CANDIDATE(x, y + iDiamondSize, 8); |
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 |
} |
} |
346 |
bDirection += *iDirection; |
bDirection |= *iDirection; |
347 |
x = data->currentMV->x; y = data->currentMV->y; |
x = data->currentMV->x; y = data->currentMV->y; |
348 |
} |
} |
349 |
} |
} |
|
while (bDirection); |
|
|
} |
|
350 |
|
|
351 |
void |
void |
352 |
xvid_me_SubpelRefine(VECTOR centerMV, SearchData * const data, CheckFunc * const CheckCandidate, int dir) |
xvid_me_SubpelRefine(VECTOR centerMV, SearchData * const data, CheckFunc * const CheckCandidate, int dir) |