436 |
else |
else |
437 |
iLimit = pEnc->mbParam.mb_width * pEnc->mbParam.mb_height + 1; |
iLimit = pEnc->mbParam.mb_width * pEnc->mbParam.mb_height + 1; |
438 |
|
|
439 |
if ((pEnc->mbParam.global_flags & XVID_HALFPEL) > 0) |
if ((pEnc->mbParam.global_flags & XVID_HALFPEL) > 0) { |
|
{ |
|
|
IMAGE *vInterV = NULL; |
|
|
IMAGE *vInterVf = NULL; |
|
|
IMAGE *vInterHV = NULL; |
|
|
IMAGE *vInterHVf = NULL; |
|
|
|
|
|
// interpolate fields together if field ME is used |
|
|
if (pEnc->mbParam.global_flags & XVID_INTERLACING && |
|
|
pEnc->mbParam.global_flags & XVID_FIELDME) |
|
|
{ |
|
|
vInterVf = &pEnc->vInterVf; |
|
|
vInterHVf = &pEnc->vInterHVf; |
|
|
} |
|
|
|
|
|
// perform normal interpolation, unless only field-based ME is allowed |
|
|
if (!(pEnc->mbParam.global_flags & XVID_INTERLACING) || |
|
|
!(pEnc->mbParam.global_flags & XVID_FIELDMEONLY)) |
|
|
{ |
|
|
vInterV = &pEnc->vInterV; |
|
|
vInterHV = &pEnc->vInterHV; |
|
|
} |
|
|
|
|
440 |
start_timer(); |
start_timer(); |
441 |
image_interpolate(pRef, |
image_interpolate(pRef, &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV, |
442 |
&pEnc->vInterH, |
pEnc->mbParam.edged_width, pEnc->mbParam.edged_height, |
|
vInterV, vInterVf, |
|
|
vInterHV, vInterHVf, |
|
|
pEnc->mbParam.edged_width, |
|
|
pEnc->mbParam.edged_height, |
|
443 |
pEnc->mbParam.rounding_type); |
pEnc->mbParam.rounding_type); |
444 |
stop_inter_timer(); |
stop_inter_timer(); |
445 |
} |
} |
446 |
|
|
447 |
start_timer(); |
start_timer(); |
448 |
bIntra = MotionEstimation(pEnc->pMBs, |
bIntra = MotionEstimation(pEnc->pMBs, &pEnc->mbParam, &pEnc->sReference, |
449 |
&pEnc->mbParam, |
&pEnc->vInterH, &pEnc->vInterV, |
450 |
&pEnc->sReference, |
&pEnc->vInterHV, &pEnc->sCurrent, iLimit); |
|
&pEnc->vInterH, |
|
|
&pEnc->vInterV, &pEnc->vInterVf, |
|
|
&pEnc->vInterHV, &pEnc->vInterHVf, |
|
|
&pEnc->sCurrent, |
|
|
iLimit); |
|
451 |
stop_motion_timer(); |
stop_motion_timer(); |
452 |
|
|
453 |
if (bIntra == 1) |
if (bIntra == 1) |
482 |
x, y, |
x, y, |
483 |
&pEnc->sReference, |
&pEnc->sReference, |
484 |
&pEnc->vInterH, |
&pEnc->vInterH, |
485 |
&pEnc->vInterV, &pEnc->vInterVf, |
&pEnc->vInterV, |
486 |
&pEnc->vInterHV, &pEnc->vInterHVf, |
&pEnc->vInterHV, |
487 |
&pEnc->sCurrent, |
&pEnc->sCurrent, |
488 |
dct_codes, |
dct_codes, |
489 |
pEnc->mbParam.width, |
pEnc->mbParam.width, |