--- estimation_bvop.c 2004/07/08 07:12:54 1.7 +++ estimation_bvop.c 2004/07/10 17:42:18 1.9 @@ -21,7 +21,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: estimation_bvop.c,v 1.7 2004/07/08 07:12:54 syskin Exp $ + * $Id: estimation_bvop.c,v 1.9 2004/07/10 17:42:18 edgomez Exp $ * ****************************************************************************/ @@ -525,6 +525,8 @@ { int k; + pMB->mode = MODE_DIRECT; /* just to initialize it */ + if (!Data->chroma) { int dx = 0, dy = 0, b_dx = 0, b_dy = 0; int32_t sum; @@ -554,7 +556,11 @@ Data->RefP[5] + (dy/2) * stride + dx/2, Data->b_RefP[5] + (b_dy/2) * stride + b_dx/2, stride); - + + if (sum >= MAX_CHROMA_SAD_FOR_SKIP * (int)Data->iQuant) return; /* no skip */ + } else { + int sum = Data->chromaSAD; /* chroma-sad SAD caching keeps it there */ + if (sum >= MAX_CHROMA_SAD_FOR_SKIP * (int)Data->iQuant) return; /* no skip */ } @@ -966,9 +972,6 @@ for (i = 0; i < pParam->mb_width; i++) { MACROBLOCK * const pMB = frame->mbs + i + j * pParam->mb_width; const MACROBLOCK * const b_mb = b_mbs + i + j * pParam->mb_width; - int interpol_search = 0; - int bf_search = 0; - int bf_thresh = 0; pMB->mode = -1; initialize_searchData(&Data_d, &Data_f, &Data_b, &Data_i, @@ -1012,8 +1015,8 @@ SearchInterpolate_initial(i, j, frame->motion_flags, pParam, &f_predMV, &b_predMV, &best_sad, &Data_i, Data_f.currentMV[0], Data_b.currentMV[0]); - if (((Data_i.iMinSAD[0] < 2*best_sad+2000) && (!(frame->motion_flags&XVID_ME_FAST_MODEINTERPOLATE)) - || Data_i.iMinSAD[0] <= best_sad)) + if (((Data_i.iMinSAD[0] < 2*best_sad+2000) && !(frame->motion_flags&XVID_ME_FAST_MODEINTERPOLATE)) + || Data_i.iMinSAD[0] <= best_sad) SearchInterpolate_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_i);