00001 00002 /*! 00003 ************************************************************************************* 00004 * \file quant4x4.c 00005 * 00006 * \brief 00007 * Quantization process for a 4x4 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 #include "global.h" 00018 #include "quant4x4.h" 00019 00020 /*! 00021 ************************************************************************ 00022 * \brief 00023 * Quantization initialization function 00024 * 00025 ************************************************************************ 00026 */ 00027 void init_quant_4x4(InputParameters *params, ImageParameters *img, Slice *currSlice) 00028 { 00029 if (params->UseRDOQuant == 1) 00030 { 00031 quant_4x4 = quant_4x4_trellis; 00032 if (params->RDOQ_DC == 1) 00033 quant_dc4x4 = quant_dc4x4_trellis; 00034 else 00035 quant_dc4x4 = quant_dc4x4_normal; 00036 quant_ac4x4 = quant_ac4x4_trellis; 00037 if (currSlice->symbol_mode == CAVLC) 00038 { 00039 rdoq_4x4 = rdoq_4x4_CAVLC; 00040 rdoq_dc = rdoq_dc_CAVLC; 00041 rdoq_ac4x4 = rdoq_ac4x4_CAVLC; 00042 } 00043 else 00044 { 00045 rdoq_4x4 = rdoq_4x4_CABAC; 00046 rdoq_dc = rdoq_dc_CABAC; 00047 rdoq_ac4x4 = rdoq_ac4x4_CABAC; 00048 } 00049 } 00050 else if (img->AdaptiveRounding) 00051 { 00052 quant_4x4 = quant_4x4_around; 00053 quant_dc4x4 = quant_dc4x4_normal; 00054 quant_ac4x4 = quant_ac4x4_around; 00055 } 00056 else 00057 { 00058 quant_4x4 = quant_4x4_normal; 00059 quant_dc4x4 = quant_dc4x4_normal; 00060 quant_ac4x4 = quant_ac4x4_normal; 00061 } 00062 } 00063