Ticket #42: CTU_bit_distortion_calculation_fix.patch
File CTU_bit_distortion_calculation_fix.patch, 1.7 KB (added by FangliangSong, 7 years ago) |
---|
-
source/Lib/TLibCommon/TypeDef.h
317 317 #define FIX_TICKET37 1 ///< Fix of ticket #37 (incorrect m_pppcPredYuvBest buffer copy) 318 318 #define FIX_TICKET39 1 ///< Fix of ticket #39 (encoder bug of delta QP) 319 319 #define FIX_TICKET40 1 ///< Fix of ticket #40 (ALF crash when image height is greater than image width) 320 #define FIX_TICKET42 1 ///< Fix of ticket #42 (CTU bits/distortion calculation mistake for I slice when QTBT is enabled) 320 321 321 322 /////////////////////////////////////////////////////////// 322 323 // KTA tools section end -
source/Lib/TLibEncoder/TEncCu.cpp
880 880 } 881 881 #endif 882 882 883 #if FIX_TICKET42 884 Double dLumaCTBTotalCost = pCtu->getTotalCost(); 885 Distortion dLumaCTBTotalDistortion = pCtu->getTotalDistortion(); 886 UInt uiLumaCTBTotalBits = pCtu->getTotalBits(); 887 UInt uiLumaCTBTotalBins = pCtu->getTotalBins(); 888 #endif 883 889 xCompressCU( m_pppcBestCU[uiWidthIdx][uiHeightIdx], m_pppcTempCU[uiWidthIdx][uiHeightIdx], 0, uiCTUSize, uiCTUSize, 0 DEBUG_STRING_PASS_INTO(sDebug) ); 890 #if FIX_TICKET42 891 pCtu->getTotalCost() += dLumaCTBTotalCost; 892 pCtu->getTotalDistortion() += dLumaCTBTotalDistortion; 893 pCtu->getTotalBits() += uiLumaCTBTotalBits; 894 pCtu->getTotalBins() += uiLumaCTBTotalBins; 895 #endif 884 896 } 885 897 #endif 886 898