54 |
#define MV16_THRESHOLD 192 |
#define MV16_THRESHOLD 192 |
55 |
#define MV8_THRESHOLD 56 |
#define MV8_THRESHOLD 56 |
56 |
|
|
57 |
|
#define NEIGH_MOVE_THRESH 8 |
58 |
|
// how much a block's MV must differ from his neighbour |
59 |
|
// to be search for INTER4V. The more, the faster... |
60 |
|
|
61 |
/* sad16(0,0) bias; mpeg4 spec suggests nb/2+1 */ |
/* sad16(0,0) bias; mpeg4 spec suggests nb/2+1 */ |
62 |
/* nb = vop pixels * 2^(bpp-8) */ |
/* nb = vop pixels * 2^(bpp-8) */ |
63 |
#define MV16_00_BIAS (128+1) |
#define MV16_00_BIAS (128+1) |
332 |
&& (!(current->global_flags & XVID_LUMIMASKING) |
&& (!(current->global_flags & XVID_LUMIMASKING) |
333 |
|| pMB->dquant == NO_CHANGE) ) |
|| pMB->dquant == NO_CHANGE) ) |
334 |
{ |
{ |
335 |
|
int32_t neigh=0; |
336 |
|
|
337 |
|
if (x>0) |
338 |
|
{ neigh += abs((pMB->mv16.x)-((pMB-1)->mv16.x)); |
339 |
|
neigh += abs((pMB->mv16.y)-((pMB-1)->mv16.y)); |
340 |
|
} |
341 |
|
if (y>0) |
342 |
|
{ neigh += abs((pMB->mv16.x)-((pMB-iWcount)->mv16.x)); |
343 |
|
neigh += abs((pMB->mv16.y)-((pMB-iWcount)->mv16.y)); |
344 |
|
} |
345 |
|
if (x<(iWcount-1)) |
346 |
|
{ neigh += abs((pMB->mv16.x)-((pMB+1)->mv16.x)); |
347 |
|
neigh += abs((pMB->mv16.y)-((pMB+1)->mv16.y)); |
348 |
|
} |
349 |
|
if (y<(iHcount-1)) |
350 |
|
{ neigh += abs((pMB->mv16.x)-((pMB+iHcount)->mv16.x)); |
351 |
|
neigh += abs((pMB->mv16.y)-((pMB+iHcount)->mv16.y)); |
352 |
|
} |
353 |
|
|
354 |
|
if (neigh > NEIGH_MOVE_THRESH) |
355 |
|
{ |
356 |
int32_t sad8 = 129; //IMV16X16 * current->quant; |
int32_t sad8 = 129; //IMV16X16 * current->quant; |
357 |
|
|
358 |
if (sad8 < pMB->sad16) |
if (sad8 < pMB->sad16) |
397 |
continue; |
continue; |
398 |
} |
} |
399 |
} |
} |
400 |
|
} |
401 |
|
|
402 |
pMB->mode = MODE_INTER; |
pMB->mode = MODE_INTER; |
403 |
pMB->mvs[0] = pMB->mvs[1] = pMB->mvs[2] = pMB->mvs[3] = pMB->mv16; |
pMB->mvs[0] = pMB->mvs[1] = pMB->mvs[2] = pMB->mvs[3] = pMB->mv16; |
404 |
pMB->sad8[0] = pMB->sad8[1] = pMB->sad8[2] = pMB->sad8[3] = pMB->sad16; |
pMB->sad8[0] = pMB->sad8[1] = pMB->sad8[2] = pMB->sad8[3] = pMB->sad16; |
405 |
|
|
406 |
if (current->global_flags & XVID_INTER4V) |
pmv = get_pmv(pMBs, x, y, pParam->mb_width, 0); |
407 |
{ pmv = get_pmv(pMBs, x, y, pParam->mb_width, 0); |
// get_pmv has to be called again. |
408 |
// get_pmv has to be called again. inter4v changes predictors |
// intra-decision and inter4v change predictors |
409 |
|
|
410 |
pMB->pmvs[0].x = pMB->mv16.x - pmv.x; |
pMB->pmvs[0].x = pMB->mv16.x - pmv.x; |
411 |
pMB->pmvs[0].y = pMB->mv16.y - pmv.y; |
pMB->pmvs[0].y = pMB->mv16.y - pmv.y; |
412 |
} |
} |
413 |
} |
|
414 |
return 0; |
return 0; |
415 |
} |
} |
416 |
|
|