diff --git a/doc/software-manual.tex b/doc/software-manual.tex index d971c90c62f6d778b97bdbcda3ee6f91c5495746..255e58564948ce40f71f71e8067ebd4ad9008a7e 100644 --- a/doc/software-manual.tex +++ b/doc/software-manual.tex @@ -1342,10 +1342,10 @@ candidate is not evaluated if the merge skip mode was the best merge mode for one of the previous candidates. \\ -\Option{SBT64RDO} & +\Option{SBTFast64WidthTh} & %\ShortOption{\None} & -\Default{true} & -Enables or disables the use of more than 32 SBT in encoder RDO check. When enabled, more than 32 size SBT is checked in the RDO. +\Default{1920} & +Picture width threshold for testing size-64 SBT in RDO (now for HD and above sequences). \\ \Option{RDpenalty} & diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index f79697d9a79129e2f8bd0eaaa360f841061b6f4b..3390dc92ec9b2f8318632983b38764831b42cae5 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -290,7 +290,7 @@ void EncApp::xInitLibCfg() m_cEncLib.setImplicitMTS ( m_MTSImplicit ); m_cEncLib.setUseSBT ( m_SBT ); #if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG - m_cEncLib.setUse64SBTRDOCheck (m_SBT64RDOCheck); + m_cEncLib.setSBTFast64WidthTh ( m_SBTFast64WidthTh ); #endif m_cEncLib.setUseCompositeRef ( m_compositeRefEnabled ); m_cEncLib.setUseSMVD ( m_SMVD ); diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 730d0729cb06d44c25f1a2866ede605e1b81cf71..878c48a9dad6eb4219aef9e687081dcf9498f141 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -944,7 +944,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("MTSImplicit", m_MTSImplicit, 0, "Enable implicit MTS (when explicit MTS is off)\n") ( "SBT", m_SBT, false, "Enable Sub-Block Transform for inter blocks\n" ) #if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG - ("SBT64RDO", m_SBT64RDOCheck, true, "Enable more than 32 SBT in encoder RDO check \n") + ( "SBTFast64WidthTh", m_SBTFast64WidthTh, 1920, "Picture width threshold for testing size-64 SBT in RDO (now for HD and above sequences)\n") #endif ( "ISP", m_ISP, false, "Enable Intra Sub-Partitions\n" ) ("SMVD", m_SMVD, false, "Enable Symmetric MVD\n") diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index a1bbebb3ae99d804c1f411d5fb225e29bc62d460..a4d392e3d80de25b653cff67899deb44dc064393 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -285,7 +285,7 @@ protected: int m_MTSImplicit; bool m_SBT; ///< Sub-Block Transform for inter blocks #if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG - bool m_SBT64RDOCheck; + int m_SBTFast64WidthTh; #endif bool m_SMVD; bool m_compositeRefEnabled; diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index ba0a37d35e2c0827e52d6984c327561c893e9336..9f7cbf09cacc495b769ba0169827511cfcefa259 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -286,7 +286,7 @@ protected: int m_ImplicitMTS; bool m_SBT; ///< Sub-Block Transform for inter blocks #if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG - bool m_SBT64RDOCheck; // Enable more than 32 SBT in encoder RDO check + int m_SBTFast64WidthTh; ///< Enable size-64 SBT in encoder RDO check for HD and above sequences #endif bool m_LFNST; @@ -910,8 +910,8 @@ public: bool getUseSBT () const { return m_SBT; } #if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG - void setUse64SBTRDOCheck(bool b) { m_SBT64RDOCheck = b; } - bool getUse64SBTRDOCheck () const { return m_SBT64RDOCheck; } + void setSBTFast64WidthTh ( int b ) { m_SBTFast64WidthTh = b; } + int getSBTFast64WidthTh () const { return m_SBTFast64WidthTh; } #endif void setUseCompositeRef (bool b) { m_compositeRefEnabled = b; } diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp index 02fe97c21329befd5d6ccf2cffdcb69321ca1f96..db6c3327592d09935d3f396ad6d2cf92ffd4dfe1 100644 --- a/source/Lib/EncoderLib/EncCu.cpp +++ b/source/Lib/EncoderLib/EncCu.cpp @@ -4318,7 +4318,11 @@ void EncCu::xEncodeInterResidual( CodingStructure *&tempCS const bool mtsAllowed = tempCS->sps->getUseInterMTS() && CU::isInter( *cu ) && partitioner.currArea().lwidth() <= MTS_INTER_MAX_CU_SIZE && partitioner.currArea().lheight() <= MTS_INTER_MAX_CU_SIZE; uint8_t sbtAllowed = cu->checkAllowedSbt(); #if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG - sbtAllowed = ((cu->lwidth() > 32 || cu->lheight() > 32) && !(m_pcEncCfg->getUse64SBTRDOCheck())) ? 0 : sbtAllowed; + //SBT resolution-dependent fast algorithm: not try size-64 SBT in RDO for low-resolution sequences (now resolution below HD) + if( tempCS->pps->getPicWidthInLumaSamples() < (uint32_t)m_pcEncCfg->getSBTFast64WidthTh() ) + { + sbtAllowed = ((cu->lwidth() > 32 || cu->lheight() > 32)) ? 0 : sbtAllowed; + } #endif uint8_t numRDOTried = 0; Distortion sbtOffDist = 0;