Ticket #700: BugFix_ChromaOffset.patch

File BugFix_ChromaOffset.patch, 2.4 KB (added by Tanizawa, 12 years ago)

Patch file for chroma offset

  • source/Lib/TLibCommon/TypeDef.h

     
    4343//! \ingroup TLibCommon
    4444//! \{
    4545
     46#define BUGFIX_CHROMA_OFFSET             1  ///< Bug fix of the predicted value of chroma offset in WP when the input bit depth is beyond 8bit.
    4647#define SAO_LUM_CHROMA_ONOFF_FLAGS       1  ///< J0087: slice-level independent luma/chroma SAO on/off flag
    4748#define LTRP_IN_SPS                      1  ///< J0116: Include support for signalling LTRP LSBs in the SPS, and index them in the slice header.
    4849#define CHROMA_QP_EXTENSION              1  ///< J0342: Extend mapping table from luma QP to chroma QP, introduce slice-level chroma offsets, apply limits on offset values
  • source/Lib/TLibDecoder/TDecCAVLC.cpp

     
    18871887
    18881888              Int iDeltaChroma;
    18891889              READ_SVLC( iDeltaChroma, "delta_chroma_offset_lX" );  // se(v): delta_chroma_offset_l0[i][j]
     1890#if BUGFIX_CHROMA_OFFSET
     1891              Int shift = 128;
     1892#else
    18901893              Int shift = ((1<<(g_uiBitDepth+g_uiBitIncrement-1)));
     1894#endif
    18911895              Int pred = ( shift - ( ( shift*wp[j].iWeight)>>(wp[j].uiLog2WeightDenom) ) );
    18921896#if WP_PARAM_RANGE_LIMIT
    18931897              wp[j].iOffset = Clip3(-128, 127, (iDeltaChroma + pred) );
  • source/Lib/TLibEncoder/TEncCavlc.cpp

     
    14771477            {
    14781478              Int iDeltaWeight = (wp[j].iWeight - (1<<wp[1].uiLog2WeightDenom));
    14791479              WRITE_SVLC( iDeltaWeight, "delta_chroma_weight_lX" );            // se(v): delta_chroma_weight_lX
    1480 
     1480#if BUGFIX_CHROMA_OFFSET
     1481              Int shift = 128;
     1482#else
    14811483              Int shift = ((1<<(g_uiBitDepth+g_uiBitIncrement-1)));
     1484#endif
    14821485              Int pred = ( shift - ( ( shift*wp[j].iWeight)>>(wp[j].uiLog2WeightDenom) ) );
    14831486              Int iDeltaChroma = (wp[j].iOffset - pred);
    14841487              WRITE_SVLC( iDeltaChroma, "delta_chroma_offset_lX" );            // se(v): delta_chroma_offset_lX