[svn] / trunk / xvidcore / src / quant / quant_mpeg4.c Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/quant/quant_mpeg4.c

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

revision 676, Mon Nov 25 13:38:56 2002 UTC revision 677, Tue Nov 26 23:44:11 2002 UTC
# Line 50  Line 50 
50   *  exception also makes it possible to release a modified version which   *  exception also makes it possible to release a modified version which
51   *  carries forward this exception.   *  carries forward this exception.
52   *   *
53   * $Id: quant_mpeg4.c,v 1.6 2002-11-17 00:41:19 edgomez Exp $   * $Id: quant_mpeg4.c,v 1.7 2002-11-26 23:44:11 edgomez Exp $
54   *   *
55   ****************************************************************************/   ****************************************************************************/
56    
# Line 100  Line 100 
100   * Functions   * Functions
101   ****************************************************************************/   ****************************************************************************/
102    
103  /*    quantize intra-block  #if     0
104    /*    quantize intra-block      */
105    
106      // const int32_t quantd = DIV_DIV(VM18P*quant, VM18Q);      // const int32_t quantd = DIV_DIV(VM18P*quant, VM18Q);
107      //      //
108      // level = DIV_DIV(16 * data[i], default_intra_matrix[i]);      // level = DIV_DIV(16 * data[i], default_intra_matrix[i]);
109      // coeff[i] = (level + quantd) / quant2;      // coeff[i] = (level + quantd) / quant2;
110  */  #endif
111    
112  void  void
113  quant4_intra_c(int16_t * coeff,  quant4_intra_c(int16_t * coeff,
# Line 144  Line 145 
145    
146    
147    
148  /*    dequantize intra-block & clamp to [-2048,2047]  /*    dequantize intra-block & clamp to [-2048,2047]    */
149      // data[i] = (coeff[i] * default_intra_matrix[i] * quant2) >> 4;      /* data[i] = (coeff[i] * default_intra_matrix[i] * quant2) >> 4; */
150  */  
151    
152  void  void
153  dequant4_intra_c(int16_t * data,  dequant4_intra_c(int16_t * data,
# Line 174  Line 175 
175    
176                          level = (level * intra_matrix[i] * quant) >> 3;                          level = (level * intra_matrix[i] * quant) >> 3;
177                          data[i] = (level <= 2048 ? -(int16_t) level : -2048);                          data[i] = (level <= 2048 ? -(int16_t) level : -2048);
178                  } else                                  // if (coeff[i] > 0)                  } else                                  /* if (coeff[i] > 0) */
179                  {                  {
180                          uint32_t level = coeff[i];                          uint32_t level = coeff[i];
181    
# Line 186  Line 187 
187    
188    
189    
190  /*    quantize inter-block  #if     0
191    /*    quantize inter-block      */
192    
193      // level = DIV_DIV(16 * data[i], default_intra_matrix[i]);      // level = DIV_DIV(16 * data[i], default_intra_matrix[i]);
194      // coeff[i] = (level + quantd) / quant2;      // coeff[i] = (level + quantd) / quant2;
195      // sum += abs(level);      // sum += abs(level);
196  */  #endif
197    
198  uint32_t  uint32_t
199  quant4_inter_c(int16_t * coeff,  quant4_inter_c(int16_t * coeff,
# Line 252  Line 254 
254    
255                          level = ((2 * level + 1) * inter_matrix[i] * quant) >> 4;                          level = ((2 * level + 1) * inter_matrix[i] * quant) >> 4;
256                          data[i] = (level <= 2048 ? -level : -2048);                          data[i] = (level <= 2048 ? -level : -2048);
257                  } else                                  // if (coeff[i] > 0)                  } else                                  /* if (coeff[i] > 0) */
258                  {                  {
259                          uint32_t level = coeff[i];                          uint32_t level = coeff[i];
260    
# Line 263  Line 265 
265                  sum ^= data[i];                  sum ^= data[i];
266          }          }
267    
268          // mismatch control          /* mismatch control */
269    
270          if ((sum & 1) == 0) {          if ((sum & 1) == 0) {
271                  data[63] ^= 1;                  data[63] ^= 1;

Legend:
Removed from v.676  
changed lines
  Added in v.677

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