00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "contributors.h"
00017
00018 #include "global.h"
00019 #include "quant4x4.h"
00020 #include "quantChroma.h"
00021
00022
00023
00024
00025
00026
00027
00028
00029 void init_quant_Chroma(Slice *currSlice)
00030 {
00031 ImageParameters *p_Img = currSlice->p_Img;
00032 InputParameters *p_Inp = currSlice->p_Inp;
00033
00034 if (p_Inp->UseRDOQuant == 1 && p_Inp->RDOQ_CR == 1)
00035 {
00036 currSlice->quant_ac4x4cr = quant_ac4x4_trellis;
00037 if (p_Inp->RDOQ_DC_CR)
00038 {
00039 if (p_Img->yuv_format == YUV422)
00040 currSlice->quant_dc_cr = quant_dc4x2_trellis;
00041 else
00042 currSlice->quant_dc_cr = quant_dc2x2_trellis;
00043 }
00044 else
00045 {
00046 if (p_Img->yuv_format == YUV422)
00047 currSlice->quant_dc_cr = quant_dc4x2_normal;
00048 else
00049 currSlice->quant_dc_cr = quant_dc2x2_normal;
00050 }
00051 if (currSlice->symbol_mode == CABAC)
00052 currSlice->rdoq_dc_cr = rdoq_dc_cr_CABAC;
00053 else
00054 currSlice->rdoq_dc_cr = rdoq_dc_cr_CAVLC;
00055 }
00056 else if (p_Inp->UseRDOQuant == 1 || (!(currSlice->p_Img)->AdaptiveRounding))
00057 {
00058 currSlice->quant_ac4x4cr = quant_ac4x4_normal;
00059 if (p_Img->yuv_format == YUV422)
00060 currSlice->quant_dc_cr = quant_dc4x2_normal;
00061 else
00062 currSlice->quant_dc_cr = quant_dc2x2_normal;
00063 }
00064 else
00065 {
00066 currSlice->quant_ac4x4cr = quant_ac4x4_around;
00067 if (p_Img->yuv_format == YUV422)
00068 currSlice->quant_dc_cr = quant_dc4x2_around;
00069 else
00070 currSlice->quant_dc_cr = quant_dc2x2_around;
00071 }
00072 }
00073
00074