00001 00002 /*! 00003 ************************************************************************************* 00004 * \file quant8x8.c 00005 * 00006 * \brief 00007 * Quantization process for a 8x8 block 00008 * 00009 * \author 00010 * Main contributors (see contributors.h for copyright, address and affiliation details) 00011 * - Alexis Michael Tourapis <alexismt@ieee.org> 00012 * 00013 ************************************************************************************* 00014 */ 00015 00016 #include "contributors.h" 00017 00018 #include <math.h> 00019 00020 #include "global.h" 00021 #include "quant8x8.h" 00022 00023 00024 /*! 00025 ************************************************************************ 00026 * \brief 00027 * Quantization initialization function 00028 * 00029 ************************************************************************ 00030 */ 00031 void init_quant_8x8(Slice *currSlice) 00032 { 00033 ImageParameters *p_Img = currSlice->p_Img; 00034 // We may wish to have all these parameters switched at the slice level for speed up. 00035 if (currSlice->UseRDOQuant == 1) 00036 { 00037 currSlice->quant_8x8 = quant_8x8_trellis; 00038 currSlice->quant_8x8cavlc = quant_8x8cavlc_trellis; 00039 } 00040 else if (p_Img->AdaptiveRounding) 00041 { 00042 currSlice->quant_8x8 = quant_8x8_around; 00043 currSlice->quant_8x8cavlc = quant_8x8cavlc_around; 00044 } 00045 else 00046 { 00047 currSlice->quant_8x8 = quant_8x8_normal; 00048 currSlice->quant_8x8cavlc = quant_8x8cavlc_normal; 00049 } 00050 } 00051