diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp index 0e41088997671c9a48f5248e2658bb1abaf59e50..0a4b4324270044adae0c6fd201eeaf3320b7f633 100644 --- a/source/Lib/EncoderLib/EncCu.cpp +++ b/source/Lib/EncoderLib/EncCu.cpp @@ -165,10 +165,8 @@ void EncCu::create( EncCfg* encCfg ) m_modeCtrl = new EncModeCtrlMTnoRQT(); -#if REUSE_CU_RESULTS m_modeCtrl->create( *encCfg ); -#endif for (unsigned ui = 0; ui < MMVD_MRG_MAX_RD_BUF_NUM; ui++) { m_acMergeBuffer[ui].create( chromaFormat, Area( 0, 0, uiMaxWidth, uiMaxHeight ) ); @@ -333,7 +331,7 @@ void EncCu::init( EncLib* pcEncLib, const SPS& sps PARL_PARAM( const int tId ) ) m_shareBndSizeH = 0; #endif -#if REUSE_CU_RESULTS +#if REUSE_CU_RESULTS || JVET_M0170_MRG_SHARELIST || JVET_M0427_INLOOP_RESHAPER DecCu::init( m_pcTrQuant, m_pcIntraSearch, m_pcInterSearch ); #endif diff --git a/source/Lib/EncoderLib/EncCu.h b/source/Lib/EncoderLib/EncCu.h index 89760c8491b9caaee20b70da692b5d4fdea5b113..32392e806ceb1ed7ac0f2942b65e19a004e65a4a 100644 --- a/source/Lib/EncoderLib/EncCu.h +++ b/source/Lib/EncoderLib/EncCu.h @@ -47,7 +47,7 @@ #include "CommonLib/UnitPartitioner.h" #include "CommonLib/IbcHashMap.h" -#if REUSE_CU_RESULTS +#if REUSE_CU_RESULTS || JVET_M0170_MRG_SHARELIST #include "DecoderLib/DecCu.h" #endif @@ -79,7 +79,7 @@ struct TriangleMotionInfo }; #endif class EncCu -#if REUSE_CU_RESULTS +#if REUSE_CU_RESULTS || JVET_M0170_MRG_SHARELIST || JVET_M0427_INLOOP_RESHAPER : DecCu #endif { @@ -159,7 +159,7 @@ private: public: /// copy parameters from encoder class void init ( EncLib* pcEncLib, const SPS& sps PARL_PARAM( const int jId = 0 ) ); -#if JVET_M0427_INLOOP_RESHAPER && REUSE_CU_RESULTS +#if JVET_M0427_INLOOP_RESHAPER void setDecCuReshaperInEncCU(EncReshape* pcReshape, ChromaFormat chromaFormatIDC) { initDecCuReshaper((Reshape*) pcReshape, chromaFormatIDC); } #endif /// create internal buffers diff --git a/source/Lib/EncoderLib/EncModeCtrl.cpp b/source/Lib/EncoderLib/EncModeCtrl.cpp index e9f99b29cc123f72269f734404aaf9f8b2782e9d..d95114f9ed816b2895ec4971a27e07b5e4e89d5b 100644 --- a/source/Lib/EncoderLib/EncModeCtrl.cpp +++ b/source/Lib/EncoderLib/EncModeCtrl.cpp @@ -1036,25 +1036,12 @@ static bool interHadActive( const ComprCUCtx& ctx ) // EncModeCtrlQTBT ////////////////////////////////////////////////////////////////////////// -EncModeCtrlMTnoRQT::EncModeCtrlMTnoRQT() -{ -#if !REUSE_CU_RESULTS - CacheBlkInfoCtrl::create(); -#endif -} - -EncModeCtrlMTnoRQT::~EncModeCtrlMTnoRQT() -{ -#if !REUSE_CU_RESULTS - CacheBlkInfoCtrl::destroy(); -#endif -} - -#if REUSE_CU_RESULTS void EncModeCtrlMTnoRQT::create( const EncCfg& cfg ) { CacheBlkInfoCtrl::create(); +#if REUSE_CU_RESULTS BestEncInfoCache::create( cfg.getChromaFormatIdc() ); +#endif #if JVET_M0140_SBT SaveLoadEncInfoSbt::create(); #endif @@ -1063,13 +1050,14 @@ void EncModeCtrlMTnoRQT::create( const EncCfg& cfg ) void EncModeCtrlMTnoRQT::destroy() { CacheBlkInfoCtrl::destroy(); +#if REUSE_CU_RESULTS BestEncInfoCache::destroy(); +#endif #if JVET_M0140_SBT SaveLoadEncInfoSbt::destroy(); #endif } -#endif void EncModeCtrlMTnoRQT::initCTUEncoding( const Slice &slice ) { CacheBlkInfoCtrl::init( slice ); diff --git a/source/Lib/EncoderLib/EncModeCtrl.h b/source/Lib/EncoderLib/EncModeCtrl.h index bda381a20add28a2700b6d833f3939c0c24fc4df..505717ff3ea6ceb205318801712e3a3f9e5c5d20 100644 --- a/source/Lib/EncoderLib/EncModeCtrl.h +++ b/source/Lib/EncoderLib/EncModeCtrl.h @@ -283,10 +283,8 @@ public: virtual ~EncModeCtrl () {} -#if REUSE_CU_RESULTS virtual void create ( const EncCfg& cfg ) = 0; virtual void destroy () = 0; -#endif virtual void initCTUEncoding ( const Slice &slice ) = 0; virtual void initCULevel ( Partitioner &partitioner, const CodingStructure& cs ) = 0; virtual void finishCULevel ( Partitioner &partitioner ) = 0; @@ -539,13 +537,8 @@ class EncModeCtrlMTnoRQT : public EncModeCtrl, public CacheBlkInfoCtrl public: - EncModeCtrlMTnoRQT (); - ~EncModeCtrlMTnoRQT(); - -#if REUSE_CU_RESULTS virtual void create ( const EncCfg& cfg ); virtual void destroy (); -#endif virtual void initCTUEncoding ( const Slice &slice ); virtual void initCULevel ( Partitioner &partitioner, const CodingStructure& cs ); virtual void finishCULevel ( Partitioner &partitioner ); diff --git a/source/Lib/EncoderLib/EncSlice.cpp b/source/Lib/EncoderLib/EncSlice.cpp index 52ebcfda60574e6c3e1571acb815bce56b5ad842..5eaa68ab485f9056919bb11ef613c875bb8a29e3 100644 --- a/source/Lib/EncoderLib/EncSlice.cpp +++ b/source/Lib/EncoderLib/EncSlice.cpp @@ -1657,7 +1657,7 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons resetGbiCodingOrder(false, cs); m_pcInterSearch->initWeightIdxBits(); } -#if JVET_M0427_INLOOP_RESHAPER && REUSE_CU_RESULTS +#if JVET_M0427_INLOOP_RESHAPER if (pcSlice->getSPS()->getUseReshaper()) { m_pcCuEncoder->setDecCuReshaperInEncCU(m_pcLib->getReshaper(), pcSlice->getSPS()->getChromaFormatIdc());