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(InputParameters *params, ImageParameters *img, Slice *currSlice) 00032 { 00033 // We may wish to have all these parameters switched at the slice level for speed up. 00034 if (params->UseRDOQuant == 1) 00035 { 00036 quant_8x8 = quant_8x8_trellis; 00037 quant_8x8cavlc = quant_8x8cavlc_trellis; 00038 } 00039 else if (img->AdaptiveRounding) 00040 { 00041 quant_8x8 = quant_8x8_around; 00042 quant_8x8cavlc = quant_8x8cavlc_around; 00043 } 00044 else 00045 { 00046 quant_8x8 = quant_8x8_normal; 00047 quant_8x8cavlc = quant_8x8cavlc_normal; 00048 } 00049 } 00050