Ticket #700: BugFix_ChromaOffsetR1.patch

File BugFix_ChromaOffsetR1.patch, 2.5 KB (added by Tanizawa, 12 years ago)
  • 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
    18901891              Int pred = ( 128 - ( ( 128*wp[j].iWeight)>>(wp[j].uiLog2WeightDenom) ) );
     1892#else
    18911893              Int shift = ((1<<(g_uiBitDepth+g_uiBitIncrement-1)));
    18921894              Int pred = ( shift - ( ( shift*wp[j].iWeight)>>(wp[j].uiLog2WeightDenom) ) );
     1895#endif
    18931896#if WP_PARAM_RANGE_LIMIT
    18941897              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
    14811481              Int pred = ( 128 - ( ( 128*wp[j].iWeight)>>(wp[j].uiLog2WeightDenom) ) );
     1482#else
    14821483              Int shift = ((1<<(g_uiBitDepth+g_uiBitIncrement-1)));
    14831484              Int pred = ( shift - ( ( shift*wp[j].iWeight)>>(wp[j].uiLog2WeightDenom) ) );
     1485#endif
    14841486              Int iDeltaChroma = (wp[j].iOffset - pred);
    14851487              WRITE_SVLC( iDeltaChroma, "delta_chroma_offset_lX" );            // se(v): delta_chroma_offset_lX