diff --git a/cfg/encoder_lowdelay_P_vtm.cfg b/cfg/encoder_lowdelay_P_vtm.cfg index fcc83ed92956b95f44f4996eea69342cb63737ca..465f1e9a04105139bf29a0473050b8c5b6787c04 100644 --- a/cfg/encoder_lowdelay_P_vtm.cfg +++ b/cfg/encoder_lowdelay_P_vtm.cfg @@ -141,7 +141,7 @@ ISPFast : 0 FastMrg : 1 AMaxBT : 1 FastMIP : 0 -FastLocalDualTree : 1 +FastLocalDualTreeMode : 2 # Encoder optimization tools AffineAmvrEncOpt : 0 diff --git a/cfg/encoder_lowdelay_vtm.cfg b/cfg/encoder_lowdelay_vtm.cfg index a1c98ae3c685dd7215ea4f02a514e0f797c09a3e..9377687229b6c49379b2d342e4b728eb4a633887 100644 --- a/cfg/encoder_lowdelay_vtm.cfg +++ b/cfg/encoder_lowdelay_vtm.cfg @@ -145,7 +145,7 @@ ISPFast : 0 FastMrg : 1 AMaxBT : 1 FastMIP : 0 -FastLocalDualTree : 1 +FastLocalDualTreeMode : 2 # Encoder optimization tools AffineAmvrEncOpt : 0 diff --git a/cfg/encoder_randomaccess_vtm.cfg b/cfg/encoder_randomaccess_vtm.cfg index 7c4404bdfca11c24f7cdc4619bbfe57e25084d40..0face3aa80de72245691c222885aa439224b73c1 100644 --- a/cfg/encoder_randomaccess_vtm.cfg +++ b/cfg/encoder_randomaccess_vtm.cfg @@ -164,7 +164,7 @@ FastMrg : 1 AMaxBT : 1 FastMIP : 0 FastLFNST : 0 -FastLocalDualTree : 0 +FastLocalDualTreeMode : 1 # Encoder optimization tools AffineAmvrEncOpt : 1 diff --git a/doc/software-manual.tex b/doc/software-manual.tex old mode 100644 new mode 100755 index 02dad6abe84b4df1238cc0a46393069e69b5f106..4a1f25cddcea59b8db58a8773eedeadd1ea117ac --- a/doc/software-manual.tex +++ b/doc/software-manual.tex @@ -1291,6 +1291,19 @@ Enabling this parameter can reduce the visibility of CU boundaries in the coded \end{tabular} \\ +\Option{FastLocalDualTreeMode} & +%\ShortOption{\None} & +\Default{0} & +Controls intra coding speedup introducted with local dual tree mode. +\par +\begin{tabular}{cp{0.45\textwidth}} + 0 & Disabled\\ + 1 & Stop testing intra modes in inter slices, if best cost is more that 1.5 times inter cost.\\ + 2 & Test only one intra mode in inter slices\\ +\end{tabular} +\\ + + \end{OptionTableNoShorthand} %% diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index 21c65e025833428981a3e697e79f01f9c20d0f7d..0faf620126ab7e8ab2ce7e68e1e9fced3bb87567 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -363,7 +363,7 @@ void EncApp::xInitLibCfg() m_cEncLib.setUseMIP ( m_MIP ); m_cEncLib.setUseFastMIP ( m_useFastMIP ); #if JVET_O0050_LOCAL_DUAL_TREE - m_cEncLib.setUseFastLocalDualTree ( m_useFastLocalDualTree ); + m_cEncLib.setFastLocalDualTreeMode ( m_fastLocalDualTreeMode ); #endif m_cEncLib.setCrossComponentPredictionEnabledFlag ( m_crossComponentPredictionEnabledFlag ); m_cEncLib.setUseReconBasedCrossCPredictionEstimate ( m_reconBasedCrossCPredictionEstimate ); diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 75c2ef47e2add50da3cb20575404cb2cbc032924..bcecaabe0021e998afde25257ed31d9f183d7eb0 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -992,7 +992,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("MIP", m_MIP, true, "Enable MIP (matrix-based intra prediction)") ("FastMIP", m_useFastMIP, false, "Fast encoder search for MIP (matrix-based intra prediction)") #if JVET_O0050_LOCAL_DUAL_TREE - ("FastLocalDualTree", m_useFastLocalDualTree, false, "Fast intra pass coding for local dual-tree in intra coding region (SCIPU)") + ("FastLocalDualTreeMode", m_fastLocalDualTreeMode, 0, "Fast intra pass coding for local dual-tree in intra coding region, 0: off, 1: use threshold, 2: one intra mode only") #endif // Unit definition parameters ("MaxCUWidth", m_uiMaxCUWidth, 64u) @@ -2848,6 +2848,10 @@ bool EncAppCfg::xCheckParameter() xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[1] + m_crQpOffset ) > 12, "Intra/periodic Cr QP Offset, when combined with the PPS Cr offset, exceeds supported range (-12 to 12)" ); #endif +#if JVET_O0050_LOCAL_DUAL_TREE + xConfirmPara( m_fastLocalDualTreeMode < 0 || m_fastLocalDualTreeMode > 2, "FastLocalDualTreeMode must be in range [0..2]" ); +#endif + int extraRPLs = 0; //start looping through frames in coding order until we can verify that the GOP structure is correct. while (!verifiedGOP && !errorGOP) @@ -3624,7 +3628,7 @@ void EncAppCfg::xPrintParameter() #endif if( m_MIP ) msg(VERBOSE, "FastMIP:%d ", m_useFastMIP); #if JVET_O0050_LOCAL_DUAL_TREE - msg( VERBOSE, "FastLocalDualTree:%d ", m_useFastLocalDualTree ); + msg( VERBOSE, "FastLocalDualTree:%d ", m_fastLocalDualTreeMode ); #endif msg( VERBOSE, "NumSplitThreads:%d ", m_numSplitThreads ); diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index 16d0993ce049104fdece32b202f8f273edc1794b..dd4862a0eb4ec668c9b3eabd61b9d4422540c19e 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -353,7 +353,7 @@ protected: bool m_MIP; bool m_useFastMIP; #if JVET_O0050_LOCAL_DUAL_TREE - bool m_useFastLocalDualTree; + int m_fastLocalDualTreeMode; #endif diff --git a/source/Lib/CommonLib/Contexts.cpp b/source/Lib/CommonLib/Contexts.cpp index 7fbbd59ecafbbcc6e0311ea99055271eeb0cccc4..bec85ae805f4d189b9a2a28d4b65559b1d110145 100755 --- a/source/Lib/CommonLib/Contexts.cpp +++ b/source/Lib/CommonLib/Contexts.cpp @@ -241,6 +241,7 @@ const CtxSet ContextSetCfg::Split12Flag = ContextSetCfg::addCtxSet { 12, 12, 12, 13, }, }); +#if JVET_O0050_LOCAL_DUAL_TREE const CtxSet ContextSetCfg::ModeConsFlag = ContextSetCfg::addCtxSet ({ { 40, 28, }, @@ -248,6 +249,7 @@ const CtxSet ContextSetCfg::ModeConsFlag = ContextSetCfg::addCtxSet { CNU, CNU, }, { 1, 0, }, }); +#endif const CtxSet ContextSetCfg::SkipFlag = ContextSetCfg::addCtxSet ({ diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index b2e2501e94913cb7072942fc0f93c7b26651cb8e..a256bb7329a4960bf69abaed4419c46d4a5b72b2 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -356,7 +356,7 @@ protected: bool m_MIP; bool m_useFastMIP; #if JVET_O0050_LOCAL_DUAL_TREE - bool m_useFastLocalDualTree; + int m_fastLocalDualTreeMode; #endif #if MAX_TB_SIZE_SIGNALLING uint32_t m_log2MaxTbSize; @@ -1010,8 +1010,8 @@ public: void setUseFastMIP ( bool b ) { m_useFastMIP = b; } bool getUseFastMIP () const { return m_useFastMIP; } #if JVET_O0050_LOCAL_DUAL_TREE - void setUseFastLocalDualTree ( bool b ) { m_useFastLocalDualTree = b; } - bool getUseFastLocalDualTree () const { return m_useFastLocalDualTree; } + void setFastLocalDualTreeMode ( int i ) { m_fastLocalDualTreeMode = i; } + int getFastLocalDualTreeMode () const { return m_fastLocalDualTreeMode; } #endif #if MAX_TB_SIZE_SIGNALLING diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp index d9c2b821a47bc4ded731afc8c000f1eeaa4a7474..e20e8597d9766dbc1a47c135c0fb8d2226feb2aa 100644 --- a/source/Lib/EncoderLib/IntraSearch.cpp +++ b/source/Lib/EncoderLib/IntraSearch.cpp @@ -1336,19 +1336,22 @@ bool IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner, csTemp->releaseIntermediateData(); #if JVET_O0050_LOCAL_DUAL_TREE - if( cu.isConsIntra() && !cu.slice->isIntra() && csBest->cost != MAX_DOUBLE && costInterCU != COST_UNKNOWN && mode >= 0 ) + if( m_pcEncCfg->getFastLocalDualTreeMode() ) { - if( m_pcEncCfg->getUseFastLocalDualTree() ) + if( cu.isConsIntra() && !cu.slice->isIntra() && csBest->cost != MAX_DOUBLE && costInterCU != COST_UNKNOWN && mode >= 0 ) { - //Note: only try one intra mode, which is especially useful to reduce EncT for LDB case (around 4%) - break; - } - else - { - if( csBest->cost > costInterCU * 1.5 ) + if( m_pcEncCfg->getFastLocalDualTreeMode() == 2 ) { + //Note: only try one intra mode, which is especially useful to reduce EncT for LDB case (around 4%) break; } + else + { + if( csBest->cost > costInterCU * 1.5 ) + { + break; + } + } } } #endif