[cvs] / xvidcore / src / quant / quant_mpeg.c Repository:
ViewVC logotype

Diff of /xvidcore/src/quant/quant_mpeg.c

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

revision 1.1.2.1, Tue Oct 7 13:02:35 2003 UTC revision 1.1.2.2, Thu Oct 9 18:50:22 2003 UTC
# Line 84  Line 84 
84          const uint32_t quantd = ((VM18P * quant) + (VM18Q / 2)) / VM18Q;          const uint32_t quantd = ((VM18P * quant) + (VM18Q / 2)) / VM18Q;
85          const uint32_t mult = multipliers[quant];          const uint32_t mult = multipliers[quant];
86          const int16_t *intra_matrix = get_intra_matrix();          const int16_t *intra_matrix = get_intra_matrix();
         uint32_t sum = 0;  
87          int i;          int i;
88    
89          coeff[0] = DIV_DIV(data[0], (int32_t) dcscalar);          coeff[0] = DIV_DIV(data[0], (int32_t) dcscalar);
         sum += coeff[0];  
90    
91          for (i = 1; i < 64; i++) {          for (i = 1; i < 64; i++) {
92                  if (data[i] < 0) {                  if (data[i] < 0) {
# Line 96  Line 94 
94    
95                          level = ((level << 4) + (intra_matrix[i] >> 1)) / intra_matrix[i];                          level = ((level << 4) + (intra_matrix[i] >> 1)) / intra_matrix[i];
96                          level = ((level + quantd) * mult) >> SCALEBITS;                          level = ((level + quantd) * mult) >> SCALEBITS;
                         sum += level;  
97                          coeff[i] = -(int16_t) level;                          coeff[i] = -(int16_t) level;
98                  } else if (data[i] > 0) {                  } else if (data[i] > 0) {
99                          uint32_t level = data[i];                          uint32_t level = data[i];
100    
101                          level = ((level << 4) + (intra_matrix[i] >> 1)) / intra_matrix[i];                          level = ((level << 4) + (intra_matrix[i] >> 1)) / intra_matrix[i];
102                          level = ((level + quantd) * mult) >> SCALEBITS;                          level = ((level + quantd) * mult) >> SCALEBITS;
                         sum += level;  
103                          coeff[i] = level;                          coeff[i] = level;
104                  } else {                  } else {
105                          coeff[i] = 0;                          coeff[i] = 0;
106                  }                  }
107          }          }
108    
109          return(sum);          return(0);
110  }  }
111    
112  /* quantize inter-block  /* quantize inter-block

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

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