[cvs] / xvidcore / src / prediction / mbprediction.c Repository:
ViewVC logotype

Diff of /xvidcore/src/prediction/mbprediction.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13, Sat Feb 15 15:22:19 2003 UTC revision 1.13.2.4, Thu Apr 10 13:05:54 2003 UTC
# Line 50  Line 50 
50    *                                                                            *    *                                                                            *
51    ******************************************************************************/    ******************************************************************************/
52    
53    #include <stdlib.h>
54    
55  #include "../global.h"  #include "../global.h"
56  #include "../encoder.h"  #include "../encoder.h"
57  #include "mbprediction.h"  #include "mbprediction.h"
# Line 212  Line 214 
214          //  determine ac prediction direction & ac/dc predictor          //  determine ac prediction direction & ac/dc predictor
215          //  place rescaled ac/dc predictions into predictors[] for later use          //  place rescaled ac/dc predictions into predictors[] for later use
216    
217          if (ABS(pLeft[0] - pDiag[0]) < ABS(pDiag[0] - pTop[0])) {          if (abs(pLeft[0] - pDiag[0]) < abs(pDiag[0] - pTop[0])) {
218                  *acpred_direction = 1;  // vertical                  *acpred_direction = 1;  // vertical
219                  predictors[0] = DIV_DIV(pTop[0], iDcScaler);                  predictors[0] = DIV_DIV(pTop[0], iDcScaler);
220                  for (i = 1; i < 8; i++) {                  for (i = 1; i < 8; i++) {
# Line 318  Line 320 
320                          int16_t level;                          int16_t level;
321    
322                          level = qcoeff[i];                          level = qcoeff[i];
323                          S2 += ABS(level);                          S2 += abs(level);
324                          level -= predictors[i];                          level -= predictors[i];
325                          S1 += ABS(level);                          S1 += abs(level);
326                          predictors[i] = level;                          predictors[i] = level;
327                  }                  }
328          } else                                          // acpred_direction == 2          } else                                          // acpred_direction == 2
# Line 329  Line 331 
331                          int16_t level;                          int16_t level;
332    
333                          level = qcoeff[i * 8];                          level = qcoeff[i * 8];
334                          S2 += ABS(level);                          S2 += abs(level);
335                          level -= predictors[i];                          level -= predictors[i];
336                          S1 += ABS(level);                          S1 += abs(level);
337                          predictors[i] = level;                          predictors[i] = level;
338                  }                  }
339    
# Line 438  Line 440 
440  {  {
441    
442          int32_t j;          int32_t j;
443          int32_t iDcScaler, iQuant = frame->quant;          int32_t iDcScaler, iQuant;
444          int S = 0;          int S = 0;
445          int16_t predictors[6][8];          int16_t predictors[6][8];
446    
447          MACROBLOCK *pMB = &frame->mbs[x + y * mb_width];          MACROBLOCK *pMB = &frame->mbs[x + y * mb_width];
448        iQuant = pMB->quant;
449    
450          if ((pMB->mode == MODE_INTRA) || (pMB->mode == MODE_INTRA_Q)) {          if ((pMB->mode == MODE_INTRA) || (pMB->mode == MODE_INTRA_Q)) {
451    
# Line 452  Line 455 
455                          predict_acdc(frame->mbs, x, y, mb_width, j, &qcoeff[j * 64],                          predict_acdc(frame->mbs, x, y, mb_width, j, &qcoeff[j * 64],
456                                                   iQuant, iDcScaler, predictors[j], 0);                                                   iQuant, iDcScaler, predictors[j], 0);
457    
458                          if ((frame->global_flags & XVID_HQACPRED))                          if ((frame->vop_flags & XVID_VOP_HQACPRED))
459                                  S += calc_acdc_bits(pMB, j, &qcoeff[j * 64], iDcScaler, predictors[j]);                                  S += calc_acdc_bits(pMB, j, &qcoeff[j * 64], iDcScaler, predictors[j]);
460                          else                          else
461                                  S += calc_acdc_coeff(pMB, j, &qcoeff[j * 64], iDcScaler, predictors[j]);                                  S += calc_acdc_coeff(pMB, j, &qcoeff[j * 64], iDcScaler, predictors[j]);

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.13.2.4

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4