--- trunk/xvidcore/src/prediction/mbprediction.c 2002/06/12 20:38:41 195 +++ trunk/xvidcore/src/prediction/mbprediction.c 2002/06/28 15:14:40 248 @@ -42,6 +42,7 @@ * * * Revision history: * * * + * 29.06.2002 predict_acdc() bounding * * 12.12.2001 improved calc_acdc_prediction; removed need for memcpy * * 15.12.2001 moved pmv displacement to motion estimation * * 30.11.2001 mmx cbp support * @@ -90,8 +91,13 @@ int16_t qcoeff[64], uint32_t current_quant, int32_t iDcScaler, - int16_t predictors[8]) + int16_t predictors[8], + const unsigned int bound_x, + const unsigned int bound_y) + { + const unsigned bound = (bound_y * mb_width) + bound_x; + const unsigned mbpos = (y * mb_width) + x; int16_t *left, *top, *diag, *current; int32_t left_quant = current_quant; @@ -111,7 +117,7 @@ // left macroblock - if (x && + if (x && mbpos >= bound + 1 && (pMBs[index - 1].mode == MODE_INTRA || pMBs[index - 1].mode == MODE_INTRA_Q)) { @@ -121,7 +127,7 @@ } // top macroblock - if (y && + if (mbpos >= bound + mb_width && (pMBs[index - mb_width].mode == MODE_INTRA || pMBs[index - mb_width].mode == MODE_INTRA_Q)) { @@ -130,7 +136,7 @@ } // diag macroblock - if (x && y && + if (x && mbpos >= bound + mb_width + 1 && (pMBs[index - 1 - mb_width].mode == MODE_INTRA || pMBs[index - 1 - mb_width].mode == MODE_INTRA_Q)) { @@ -379,7 +385,7 @@ iDcScaler = get_dc_scaler(iQuant, (j < 4) ? 1 : 0); predict_acdc(frame->mbs, x, y, mb_width, j, &qcoeff[j * 64], - iQuant, iDcScaler, predictors[j]); + iQuant, iDcScaler, predictors[j], 0, 0); S += calc_acdc(pMB, j, &qcoeff[j * 64], iDcScaler, predictors[j]);