年前提交了H.266参考软件JEM的bug报告: CTU bits/distortion calculation mistake for I slice when QTBT is enabled
报告的地址:https://hevc.hhi.fraunhofer.de/trac/jem/ticket/42#no2
报告的主要内容:
ticket42的修复代码已经集成在/tags/HM-16.6-JEM-4.2及之后的软件版本里了,相关的代码如下:
1、在TLibCommon/TypeDef.h中添加FIX_TICKET42条件编译标签:
#define FIX_TICKET42 1 ///< Fix of ticket #42 (CTU bits/distortion calculation mistake for I slice when QTBT is enabled)
2、在TLibEncoder/TEncCu.cpp的TEncCu::compressCtu的函数体中第二次调用xCompressCU的前后添加代码:
#if FIX_TICKET42
Double lumaCTBTotalCost = pCtu->getTotalCost();
Distortion lumaCTBTotalDistortion = pCtu->getTotalDistortion();
UInt lumaCTBTotalBits = pCtu->getTotalBits();
UInt lumaCTBTotalBins = pCtu->getTotalBins();
#endif
xCompressCU(m_pppcBestCU[uiWidthIdx][uiHeightIdx], m_pppcTempCU[uiWidthIdx][uiHeightIdx], 0, uiCTUSize, uiCTUSize, 0 DEBUG_STRING_PASS_INTO(sDebug));
#if FIX_TICKET42
pCtu->getTotalCost() += lumaCTBTotalCost;
pCtu->getTotalDistortion() += lumaCTBTotalDistortion;
pCtu->getTotalBits() += lumaCTBTotalBits;
pCtu->getTotalBins() += lumaCTBTotalBins;
#endif
修复此bug的更好的方法可能是在TComDataCU::copyToPic进行修改。
JEM-4.2的下载地址:https://jvet.hhi.fraunhofer.de/svn/svn_HMJEMSoftware/tags/HM-16.6-JEM-4.2/