--- trunk/xvidcore/src/motion/motion_est.c 2002/06/21 16:12:48 232 +++ trunk/xvidcore/src/motion/motion_est.c 2002/06/28 15:14:40 248 @@ -1280,7 +1280,7 @@ } /* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */ - bPredEq = get_pmvdata(pMBs, x, y, iWcount, 0, pmv, psad); + bPredEq = get_pmvdata(pMBs, x, y, iWcount, 0, pmv, psad, 0, 0); if ((x == 0) && (y == 0)) { threshA = 512; @@ -1699,7 +1699,7 @@ /* because we might use IF (dx>max_dx) THEN dx=max_dx; */ bPredEq = - get_pmvdata(pMBs, (x >> 1), (y >> 1), iWcount, iSubBlock, pmv, psad); + get_pmvdata(pMBs, (x >> 1), (y >> 1), iWcount, iSubBlock, pmv, psad, 0, 0); if ((x == 0) && (y == 0)) { threshA = 512 / 4; @@ -2009,7 +2009,7 @@ max_dy = EVEN(max_dy); } /* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */ - bPredEq = get_pmvdata(pMBs, x, y, iWcount, 0, pmv, psad); + bPredEq = get_pmvdata(pMBs, x, y, iWcount, 0, pmv, psad, 0, 0); /* Step 4: Calculate SAD around the Median prediction. MinSAD=SAD @@ -2287,7 +2287,7 @@ max_dy = EVEN(max_dy); } /* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */ - bPredEq = get_pmvdata(pMBs, x >> 1, y >> 1, iWcount, iSubBlock, pmv, psad); + bPredEq = get_pmvdata(pMBs, x >> 1, y >> 1, iWcount, iSubBlock, pmv, psad, 0, 0); /* Step 4: Calculate SAD around the Median prediction. @@ -2521,18 +2521,33 @@ mb->b_mvs[0].y = 0; continue; } + /* force F_SAD16 + f_sad16 = 100; + b_sad16 = 65535; + + mb->mode = MODE_FORWARD; + mb->mvs[0].x = 1; + mb->mvs[0].y = 1; + mb->b_mvs[0].x = 1; + mb->b_mvs[0].y = 1; + continue; + ^^ force F_SAD16 */ + // forward search f_sad16 = SEARCH16(f_ref->y, f_refH->y, f_refV->y, f_refHV->y, &frame->image, i, j, frame->motion_flags, - frame->quant, frame->fcode, pParam, f_mbs, - f_mbs /* todo */ , + frame->quant, frame->fcode, pParam, + f_mbs, f_mbs, /* todo */ &mb->mvs[0], &pmv_dontcare); // ignore pmv // backward search - b_sad16 = SEARCH16(b_ref->y, b_refH->y, b_refV->y, b_refHV->y, &frame->image, i, j, frame->motion_flags, frame->quant, frame->bcode, pParam, b_mbs, b_mbs, /* todo */ - &mb->b_mvs[0], &pmv_dontcare); // ignore pmv + b_sad16 = SEARCH16(b_ref->y, b_refH->y, b_refV->y, b_refHV->y, + &frame->image, i, j, frame->motion_flags, + frame->quant, frame->bcode, pParam, + b_mbs, b_mbs, /* todo */ + &mb->b_mvs[0], &pmv_dontcare); // ignore pmv // interpolate search (simple, but effective) i_sad16 = 65535;