quant4x4.c
上传用户:hjq518
上传日期:2021-12-09
资源大小:5084k
文件大小:2k
源码类别:

Audio

开发平台:

Visual C++

  1. /*!
  2.  *************************************************************************************
  3.  * file quant4x4.c
  4.  *
  5.  * brief
  6.  *    Quantization process for a 4x4 block
  7.  *
  8.  * author
  9.  *    Main contributors (see contributors.h for copyright, address and affiliation details)
  10.  *    - Alexis Michael Tourapis                  <alexismt@ieee.org>
  11.  *
  12.  *************************************************************************************
  13.  */
  14. #include "contributors.h"
  15. #include "global.h"
  16. #include "quant4x4.h"
  17. /*!
  18. ************************************************************************
  19. * brief
  20. *    Quantization initialization function
  21. *
  22. ************************************************************************
  23. */
  24. void init_quant_4x4(InputParameters *params, ImageParameters *img, Slice *currSlice)
  25. {
  26.   if (params->UseRDOQuant == 1)
  27.   {
  28.     quant_4x4     = quant_4x4_trellis;
  29.     if (params->RDOQ_DC == 1)
  30.       quant_dc4x4 = quant_dc4x4_trellis;
  31.     else
  32.       quant_dc4x4 = quant_dc4x4_normal;
  33.     quant_ac4x4   = quant_ac4x4_trellis;
  34.     if (currSlice->symbol_mode == CAVLC)
  35.     {
  36.       rdoq_4x4   = rdoq_4x4_CAVLC;
  37.       rdoq_dc    = rdoq_dc_CAVLC;
  38.       rdoq_ac4x4 = rdoq_ac4x4_CAVLC;
  39.     }
  40.     else
  41.     {
  42.       rdoq_4x4   = rdoq_4x4_CABAC;
  43.       rdoq_dc    = rdoq_dc_CABAC;
  44.       rdoq_ac4x4 = rdoq_ac4x4_CABAC;
  45.     }
  46.   }
  47.   else if (img->AdaptiveRounding)
  48.   {
  49.     quant_4x4     = quant_4x4_around;
  50.     quant_dc4x4   = quant_dc4x4_normal;
  51.     quant_ac4x4   = quant_ac4x4_around;
  52.   }
  53.   else
  54.   {
  55.     quant_4x4   = quant_4x4_normal;
  56.     quant_dc4x4 = quant_dc4x4_normal;
  57.     quant_ac4x4 = quant_ac4x4_normal;
  58.   }
  59. }