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(Slice *currSlice) 00028 { 00029 ImageParameters *p_Img = currSlice->p_Img; 00030 InputParameters *p_Inp = currSlice->p_Inp; 00031 00032 if (currSlice->UseRDOQuant == 1) 00033 { 00034 currSlice->quant_4x4 = quant_4x4_trellis; 00035 if (p_Inp->RDOQ_DC == 1) 00036 currSlice->quant_dc4x4 = quant_dc4x4_trellis; 00037 else 00038 currSlice->quant_dc4x4 = quant_dc4x4_normal; 00039 currSlice->quant_ac4x4 = quant_ac4x4_trellis; 00040 if (currSlice->symbol_mode == CAVLC) 00041 { 00042 currSlice->rdoq_4x4 = rdoq_4x4_CAVLC; 00043 currSlice->rdoq_dc = rdoq_dc_CAVLC; 00044 currSlice->rdoq_ac4x4 = rdoq_ac4x4_CAVLC; 00045 } 00046 else 00047 { 00048 currSlice->rdoq_4x4 = rdoq_4x4_CABAC; 00049 currSlice->rdoq_dc = rdoq_dc_CABAC; 00050 currSlice->rdoq_ac4x4 = rdoq_ac4x4_CABAC; 00051 } 00052 } 00053 else if (p_Img->AdaptiveRounding) 00054 { 00055 currSlice->quant_4x4 = quant_4x4_around; 00056 currSlice->quant_dc4x4 = quant_dc4x4_normal; 00057 currSlice->quant_ac4x4 = quant_ac4x4_around; 00058 } 00059 else 00060 { 00061 currSlice->quant_4x4 = quant_4x4_normal; 00062 currSlice->quant_dc4x4 = quant_dc4x4_normal; 00063 currSlice->quant_ac4x4 = quant_ac4x4_normal; 00064 } 00065 } 00066