Ticket #700: BugFix_ChromaOffset.patch
File BugFix_ChromaOffset.patch, 2.4 KB (added by Tanizawa, 11 years ago) |
---|
-
source/Lib/TLibCommon/TypeDef.h
43 43 //! \ingroup TLibCommon 44 44 //! \{ 45 45 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. 46 47 #define SAO_LUM_CHROMA_ONOFF_FLAGS 1 ///< J0087: slice-level independent luma/chroma SAO on/off flag 47 48 #define LTRP_IN_SPS 1 ///< J0116: Include support for signalling LTRP LSBs in the SPS, and index them in the slice header. 48 49 #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
1887 1887 1888 1888 Int iDeltaChroma; 1889 1889 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 1890 1893 Int shift = ((1<<(g_uiBitDepth+g_uiBitIncrement-1))); 1894 #endif 1891 1895 Int pred = ( shift - ( ( shift*wp[j].iWeight)>>(wp[j].uiLog2WeightDenom) ) ); 1892 1896 #if WP_PARAM_RANGE_LIMIT 1893 1897 wp[j].iOffset = Clip3(-128, 127, (iDeltaChroma + pred) ); -
source/Lib/TLibEncoder/TEncCavlc.cpp
1477 1477 { 1478 1478 Int iDeltaWeight = (wp[j].iWeight - (1<<wp[1].uiLog2WeightDenom)); 1479 1479 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 1481 1483 Int shift = ((1<<(g_uiBitDepth+g_uiBitIncrement-1))); 1484 #endif 1482 1485 Int pred = ( shift - ( ( shift*wp[j].iWeight)>>(wp[j].uiLog2WeightDenom) ) ); 1483 1486 Int iDeltaChroma = (wp[j].iOffset - pred); 1484 1487 WRITE_SVLC( iDeltaChroma, "delta_chroma_offset_lX" ); // se(v): delta_chroma_offset_lX