[svn] / branches / dev-api-4 / xvidcore / src / utils / mbtransquant.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/src/utils/mbtransquant.c

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

revision 984, Sun Apr 13 16:18:09 2003 UTC revision 995, Sun Apr 27 19:47:48 2003 UTC
# Line 21  Line 21 
21   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
22   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
23   *   *
24   * $Id: mbtransquant.c,v 1.21.2.8 2003-04-13 16:18:09 syskin Exp $   * $Id: mbtransquant.c,v 1.21.2.9 2003-04-27 19:47:48 chl Exp $
25   *   *
26   ****************************************************************************/   ****************************************************************************/
27    
# Line 34  Line 34 
34  #include "../global.h"  #include "../global.h"
35  #include "mem_transfer.h"  #include "mem_transfer.h"
36  #include "timer.h"  #include "timer.h"
37    #include "../bitstream/mbcoding.h"
38  #include "../dct/fdct.h"  #include "../dct/fdct.h"
39  #include "../dct/idct.h"  #include "../dct/idct.h"
40  #include "../quant/quant_mpeg4.h"  #include "../quant/quant_mpeg4.h"
# Line 115  Line 116 
116  /* Quantize all blocks -- Intra mode */  /* Quantize all blocks -- Intra mode */
117  static __inline void  static __inline void
118  MBQuantIntra(const MBParam * pParam,  MBQuantIntra(const MBParam * pParam,
119                             const FRAMEINFO * const frame,
120                           const MACROBLOCK * pMB,                           const MACROBLOCK * pMB,
121                           int16_t qcoeff[6 * 64],                           int16_t qcoeff[6 * 64],
122                           int16_t data[6*64])                           int16_t data[6*64])
# Line 126  Line 128 
128    
129                  /* Quantize the block */                  /* Quantize the block */
130                  start_timer();                  start_timer();
131                  if (!(pParam->vol_flags & XVID_VOL_MPEGQUANT))                  if (!(pParam->vol_flags & XVID_VOL_MPEGQUANT)) {
132                          quant_intra(&data[i * 64], &qcoeff[i * 64], pMB->quant, iDcScaler);                          quant_intra(&data[i * 64], &qcoeff[i * 64], pMB->quant, iDcScaler);
133                  else                  } else {
134                          quant4_intra(&data[i * 64], &qcoeff[i * 64], pMB->quant, iDcScaler);                          quant4_intra(&data[i * 64], &qcoeff[i * 64], pMB->quant, iDcScaler);
135                    }
136                  stop_quant_timer();                  stop_quant_timer();
137          }          }
138  }  }
# Line 158  Line 161 
161  /* Quantize all blocks -- Inter mode */  /* Quantize all blocks -- Inter mode */
162  static __inline uint8_t  static __inline uint8_t
163  MBQuantInter(const MBParam * pParam,  MBQuantInter(const MBParam * pParam,
164                             const FRAMEINFO * const frame,
165                           const MACROBLOCK * pMB,                           const MACROBLOCK * pMB,
166                           int16_t data[6 * 64],                           int16_t data[6 * 64],
167                           int16_t qcoeff[6 * 64],                           int16_t qcoeff[6 * 64],
# Line 174  Line 178 
178    
179                  /* Quantize the block */                  /* Quantize the block */
180                  start_timer();                  start_timer();
181                  if (!(pParam->vol_flags & XVID_VOL_MPEGQUANT))                  if (!(pParam->vol_flags & XVID_VOL_MPEGQUANT)) {
182                          sum = quant_inter(&qcoeff[i * 64], &data[i * 64], pMB->quant);                          sum = quant_inter(&qcoeff[i * 64], &data[i * 64], pMB->quant);
183                  else                          if ( (sum) && (frame->vop_flags & XVID_VOP_TRELLISQUANT) ) {
184                                    sum = dct_quantize_trellis_inter_h263_c (&qcoeff[i*64], &data[i*64], pMB->quant)+1;
185                                    limit = 1;
186                            }
187                    } else {
188                          sum = quant4_inter(&qcoeff[i * 64], &data[i * 64], pMB->quant);                          sum = quant4_inter(&qcoeff[i * 64], &data[i * 64], pMB->quant);
189    //                      if ( (sum) && (frame->vop_flags & XVID_VOP_TRELLISQUANT) )
190    //                              sum = dct_quantize_trellis_inter_mpeg_c (&qcoeff[i*64], &data[i*64], pMB->quant)+1;
191                    }
192                  stop_quant_timer();                  stop_quant_timer();
193    
194                  /*                  /*
# Line 202  Line 213 
213    
214                  /* Set the corresponding cbp bit */                  /* Set the corresponding cbp bit */
215                  cbp |= code_block << (5 - i);                  cbp |= code_block << (5 - i);
   
216          }          }
217    
218          return(cbp);          return(cbp);
# Line 374  Line 384 
384          MBfDCT(pParam, frame, pMB, x_pos, y_pos, data);          MBfDCT(pParam, frame, pMB, x_pos, y_pos, data);
385    
386          /* Quantize the block */          /* Quantize the block */
387          MBQuantIntra(pParam, pMB, data, qcoeff);          MBQuantIntra(pParam, frame, pMB, data, qcoeff);
388    
389          /* DeQuantize the block */          /* DeQuantize the block */
390          MBDeQuantIntra(pParam, pMB->quant, data, qcoeff);          MBDeQuantIntra(pParam, pMB->quant, data, qcoeff);
# Line 411  Line 421 
421          limit = PVOP_TOOSMALL_LIMIT + ((pMB->quant == 1)? 1 : 0);          limit = PVOP_TOOSMALL_LIMIT + ((pMB->quant == 1)? 1 : 0);
422    
423          /* Quantize the block */          /* Quantize the block */
424          cbp = MBQuantInter(pParam, pMB, data, qcoeff, 0, limit);          cbp = MBQuantInter(pParam, frame, pMB, data, qcoeff, 0, limit);
425    
426          /* DeQuantize the block */          /* DeQuantize the block */
427          MBDeQuantInter(pParam, pMB->quant, data, qcoeff, cbp);          MBDeQuantInter(pParam, pMB->quant, data, qcoeff, cbp);
# Line 449  Line 459 
459          limit = BVOP_TOOSMALL_LIMIT;          limit = BVOP_TOOSMALL_LIMIT;
460    
461          /* Quantize the block */          /* Quantize the block */
462          cbp = MBQuantInter(pParam, pMB, data, qcoeff, 1, limit);          cbp = MBQuantInter(pParam, frame, pMB, data, qcoeff, 1, limit);
463    
464          /*          /*
465           * History comment:           * History comment:

Legend:
Removed from v.984  
changed lines
  Added in v.995

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