--- branches/dev-api-4/xvidcore/src/prediction/mbprediction.c 2003/02/21 14:49:29 886 +++ branches/dev-api-4/xvidcore/src/prediction/mbprediction.c 2003/04/10 13:05:54 982 @@ -50,6 +50,8 @@ * * ******************************************************************************/ +#include + #include "../global.h" #include "../encoder.h" #include "mbprediction.h" @@ -212,7 +214,7 @@ // determine ac prediction direction & ac/dc predictor // place rescaled ac/dc predictions into predictors[] for later use - if (ABS(pLeft[0] - pDiag[0]) < ABS(pDiag[0] - pTop[0])) { + if (abs(pLeft[0] - pDiag[0]) < abs(pDiag[0] - pTop[0])) { *acpred_direction = 1; // vertical predictors[0] = DIV_DIV(pTop[0], iDcScaler); for (i = 1; i < 8; i++) { @@ -318,9 +320,9 @@ int16_t level; level = qcoeff[i]; - S2 += ABS(level); + S2 += abs(level); level -= predictors[i]; - S1 += ABS(level); + S1 += abs(level); predictors[i] = level; } } else // acpred_direction == 2 @@ -329,9 +331,9 @@ int16_t level; level = qcoeff[i * 8]; - S2 += ABS(level); + S2 += abs(level); level -= predictors[i]; - S1 += ABS(level); + S1 += abs(level); predictors[i] = level; } @@ -438,11 +440,12 @@ { int32_t j; - int32_t iDcScaler, iQuant = frame->quant; + int32_t iDcScaler, iQuant; int S = 0; int16_t predictors[6][8]; MACROBLOCK *pMB = &frame->mbs[x + y * mb_width]; + iQuant = pMB->quant; if ((pMB->mode == MODE_INTRA) || (pMB->mode == MODE_INTRA_Q)) { @@ -452,7 +455,7 @@ predict_acdc(frame->mbs, x, y, mb_width, j, &qcoeff[j * 64], iQuant, iDcScaler, predictors[j], 0); - if ((frame->global_flags & XVID_HQACPRED)) + if ((frame->vop_flags & XVID_VOP_HQACPRED)) S += calc_acdc_bits(pMB, j, &qcoeff[j * 64], iDcScaler, predictors[j]); else S += calc_acdc_coeff(pMB, j, &qcoeff[j * 64], iDcScaler, predictors[j]);