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

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

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

revision 1.3, Wed Jun 12 20:38:41 2002 UTC revision 1.4, Sat Sep 7 11:21:10 2002 UTC
# Line 1  Line 1 
1  /**************************************************************************  /*****************************************************************************
2   *   *
3   *    XVID MPEG-4 VIDEO CODEC   *    XVID MPEG-4 VIDEO CODEC
4   *    mpeg-4 quantization/dequantization   *  - Mpeg4 quantization/dequantization functions -
5     *
6     *  Copyright(C) 2002 Peter Ross
7   *   *
8   *    This program is an implementation of a part of one or more MPEG-4   *    This program is an implementation of a part of one or more MPEG-4
9   *    Video tools as specified in ISO/IEC 14496-2 standard.  Those intending   *    Video tools as specified in ISO/IEC 14496-2 standard.  Those intending
# Line 24  Line 26 
26   *   *
27   *    You should have received a copy of the GNU General Public License   *    You should have received a copy of the GNU General Public License
28   *    along with this program; if not, write to the Free Software   *    along with this program; if not, write to the Free Software
29   *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  *  
  *************************************************************************/  
   
 /**************************************************************************  
30   *   *
31   *    History:   *  $Id$
32   *   *
33   *      26.01.2002    fixed  quant4_intra dcscalar signed/unsigned error   ****************************************************************************/
  *  20.01.2002    increased accuracy of >> divide  
  *  26.12.2001    divide-by-multiplication optimization  
  *  22.12.2001    [-127,127] clamping removed; minor tweaks  
  *      19.11.2001    inital version <pross@cs.rmit.edu.au>  
  *  
  *************************************************************************/  
   
34    
35  #include "quant_mpeg4.h"  #include "quant_mpeg4.h"
36  #include "quant_matrix.h"  #include "quant_matrix.h"
37    
38  // function pointers  /*****************************************************************************
39     * Function pointers
40     ****************************************************************************/
41    
42  quant_intraFuncPtr quant4_intra;  quant_intraFuncPtr quant4_intra;
43  quant_intraFuncPtr dequant4_intra;  quant_intraFuncPtr dequant4_intra;
44  dequant_interFuncPtr dequant4_inter;  dequant_interFuncPtr dequant4_inter;
45  quant_interFuncPtr quant4_inter;  quant_interFuncPtr quant4_inter;
46    
47    
48    /*****************************************************************************
49     * Local data
50     ****************************************************************************/
51    
52  #define DIV_DIV(A,B)    ( (A) > 0 ? ((A)+((B)>>1))/(B) : ((A)-((B)>>1))/(B) )  #define DIV_DIV(A,B)    ( (A) > 0 ? ((A)+((B)>>1))/(B) : ((A)-((B)>>1))/(B) )
53  #define SIGN(A)  ((A)>0?1:-1)  #define SIGN(A)  ((A)>0?1:-1)
54  #define VM18P    3  #define VM18P    3
55  #define VM18Q    4  #define VM18Q    4
56    
57    
58  // divide-by-multiply table  /*
59  // need 17 bit shift (16 causes slight errors when q > 19)   * divide-by-multiply table
60     * need 17 bit shift (16 causes slight errors when q > 19)
61     */
62    
63  #define SCALEBITS    17  #define SCALEBITS    17
64  #define FIX(X)        ((1UL << SCALEBITS) / (X) + 1)  #define FIX(X)        ((1UL << SCALEBITS) / (X) + 1)
# Line 74  Line 74 
74          FIX(56), FIX(58), FIX(60), FIX(62)          FIX(56), FIX(58), FIX(60), FIX(62)
75  };  };
76    
77    /*****************************************************************************
78     * Functions
79     ****************************************************************************/
80    
81  /*    quantize intra-block  /*    quantize intra-block
82    
83      // const int32_t quantd = DIV_DIV(VM18P*quant, VM18Q);      // const int32_t quantd = DIV_DIV(VM18P*quant, VM18Q);

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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