diff --git a/source/Lib/CommonLib/LoopFilter.cpp b/source/Lib/CommonLib/LoopFilter.cpp index 8033d2357335090d91ea5522b7d2c322a65fa333..3fae400bb108767f30f86d0788b076e5ac9fb2f3 100644 --- a/source/Lib/CommonLib/LoopFilter.cpp +++ b/source/Lib/CommonLib/LoopFilter.cpp @@ -1041,7 +1041,12 @@ void LoopFilter::xEdgeFilterLuma( const CodingUnit& cu, const DeblockEdgeDir edg const int iIndexTC = Clip3(0, MAX_QP + DEFAULT_INTRA_TC_OFFSET, int(iQP + DEFAULT_INTRA_TC_OFFSET*(uiBs - 1) + (tcOffsetDiv2 << 1))); const int iIndexB = Clip3(0, MAX_QP, iQP + (betaOffsetDiv2 << 1)); +#if JVET_R0130_TC_DERIVATION_BUGFIX + const int roundOffset = 1 << (9 - bitDepthLuma); + const int iTc = bitDepthLuma < 10 ? ((sm_tcTable[iIndexTC] + roundOffset) >> (10 - bitDepthLuma)) : ((sm_tcTable[iIndexTC]) << (bitDepthLuma - 10)); +#else const int iTc = bitDepthLuma < 10 ? ((sm_tcTable[iIndexTC] + 2) >> (10 - bitDepthLuma)) : ((sm_tcTable[iIndexTC]) << (bitDepthLuma - 10)); +#endif const int iBeta = sm_betaTable[iIndexB ] * iBitdepthScale; const int iSideThreshold = ( iBeta + ( iBeta >> 1 ) ) >> 3; const int iThrCut = iTc * 10; diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index c1bb5cd0abf10d4d123cafa7d1952da5d60145fa..65294eba807ce2e99fa8b90076bcec93e5cb7aad 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -51,6 +51,8 @@ #include <cassert> //########### place macros to be removed in next cycle below this line ############### +#define JVET_R0130_TC_DERIVATION_BUGFIX 1 // JVET-R0130: Cleanup of tC derivation for deblocking filter + #define JVET_R0205 1 // JVET-R0205: Condition presence of inter_layer_ref_pics_present_flag on sps_video_parameter_set_id #define JVET_R0186_CLEANUP 1 // JVET-R0186 aspect 1: Signal the pps_no_pic_partition_flag ahead in the PPS.