Commit a7f149c0 authored by Tung Nguyen's avatar Tung Nguyen Committed by Frank Bossen
Browse files

M0464: UniMTS

parent 1090b2ce
...@@ -51,6 +51,7 @@ SAO : 1 # Sample adaptive offset (0: OFF, 1 ...@@ -51,6 +51,7 @@ SAO : 1 # Sample adaptive offset (0: OFF, 1
AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON) AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON)
TransformSkip : 1 # Transform skipping (0: OFF, 1: ON) TransformSkip : 1 # Transform skipping (0: OFF, 1: ON)
TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON) TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON)
TransformSkipLog2MaxSize : 5
SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON) SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON)
#============ Slices ================ #============ Slices ================
...@@ -101,8 +102,9 @@ MaxBTDepthISliceL : 3 ...@@ -101,8 +102,9 @@ MaxBTDepthISliceL : 3
MaxBTDepthISliceC : 3 MaxBTDepthISliceC : 3
MTT : 1 MTT : 1
EMT : 1 MTS : 1
EMTFast : 1 MTSIntraMaxCand : 3
MTSInterMaxCand : 4
Affine : 1 Affine : 1
SubPuMvp : 1 SubPuMvp : 1
MaxNumMergeCand : 6 MaxNumMergeCand : 6
......
...@@ -59,6 +59,7 @@ SAO : 1 # Sample adaptive offset (0: OFF, 1 ...@@ -59,6 +59,7 @@ SAO : 1 # Sample adaptive offset (0: OFF, 1
AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON) AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON)
TransformSkip : 1 # Transform skipping (0: OFF, 1: ON) TransformSkip : 1 # Transform skipping (0: OFF, 1: ON)
TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON) TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON)
TransformSkipLog2MaxSize : 5
SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON) SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON)
#============ Slices ================ #============ Slices ================
...@@ -117,8 +118,9 @@ MaxBTDepthISliceL : 3 ...@@ -117,8 +118,9 @@ MaxBTDepthISliceL : 3
MaxBTDepthISliceC : 3 MaxBTDepthISliceC : 3
MTT : 1 MTT : 1
EMT : 1 MTS : 1
EMTFast : 1 MTSIntraMaxCand : 3
MTSInterMaxCand : 4
Affine : 1 Affine : 1
SubPuMvp : 1 SubPuMvp : 1
MaxNumMergeCand : 6 MaxNumMergeCand : 6
......
...@@ -59,6 +59,7 @@ SAO : 1 # Sample adaptive offset (0: OFF, 1 ...@@ -59,6 +59,7 @@ SAO : 1 # Sample adaptive offset (0: OFF, 1
AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON) AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON)
TransformSkip : 1 # Transform skipping (0: OFF, 1: ON) TransformSkip : 1 # Transform skipping (0: OFF, 1: ON)
TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON) TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON)
TransformSkipLog2MaxSize : 5
SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON) SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON)
#============ Slices ================ #============ Slices ================
...@@ -117,8 +118,9 @@ MaxBTDepthISliceL : 3 ...@@ -117,8 +118,9 @@ MaxBTDepthISliceL : 3
MaxBTDepthISliceC : 3 MaxBTDepthISliceC : 3
MTT : 1 MTT : 1
EMT : 1 MTS : 1
EMTFast : 1 MTSIntraMaxCand : 3
MTSInterMaxCand : 4
Affine : 1 Affine : 1
SubPuMvp : 1 SubPuMvp : 1
MaxNumMergeCand : 6 MaxNumMergeCand : 6
......
...@@ -73,6 +73,7 @@ SAO : 1 # Sample adaptive offset (0: OFF, 1 ...@@ -73,6 +73,7 @@ SAO : 1 # Sample adaptive offset (0: OFF, 1
AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON) AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON)
TransformSkip : 1 # Transform skipping (0: OFF, 1: ON) TransformSkip : 1 # Transform skipping (0: OFF, 1: ON)
TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON) TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON)
TransformSkipLog2MaxSize : 5
SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON) SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON)
#============ Slices ================ #============ Slices ================
...@@ -131,8 +132,9 @@ MaxBTDepthISliceL : 3 ...@@ -131,8 +132,9 @@ MaxBTDepthISliceL : 3
MaxBTDepthISliceC : 3 MaxBTDepthISliceC : 3
MTT : 1 MTT : 1
EMT : 1 MTS : 1
EMTFast : 1 MTSIntraMaxCand : 3
MTSInterMaxCand : 4
Affine : 1 Affine : 1
SubPuMvp : 1 SubPuMvp : 1
MaxNumMergeCand : 6 MaxNumMergeCand : 6
......
...@@ -227,10 +227,17 @@ void EncApp::xInitLibCfg() ...@@ -227,10 +227,17 @@ void EncApp::xInitLibCfg()
#if ENABLE_WPP_PARALLELISM #if ENABLE_WPP_PARALLELISM
m_cEncLib.setUseAltDQPCoding ( m_AltDQPCoding ); m_cEncLib.setUseAltDQPCoding ( m_AltDQPCoding );
#endif #endif
#if JVET_M0464_UNI_MTS
m_cEncLib.setIntraMTS ( m_MTS & 1 );
m_cEncLib.setIntraMTSMaxCand ( m_MTSIntraMaxCand );
m_cEncLib.setInterMTS ( ( m_MTS >> 1 ) & 1 );
m_cEncLib.setInterMTSMaxCand ( m_MTSInterMaxCand );
#else
m_cEncLib.setIntraEMT ( m_EMT & 1 ); m_cEncLib.setIntraEMT ( m_EMT & 1 );
m_cEncLib.setFastIntraEMT ( m_FastEMT & m_EMT & 1 ); m_cEncLib.setFastIntraEMT ( m_FastEMT & m_EMT & 1 );
m_cEncLib.setInterEMT ( ( m_EMT >> 1 ) & 1 ); m_cEncLib.setInterEMT ( ( m_EMT >> 1 ) & 1 );
m_cEncLib.setFastInterEMT ( ( m_FastEMT >> 1 ) & ( m_EMT >> 1 ) & 1 ); m_cEncLib.setFastInterEMT ( ( m_FastEMT >> 1 ) & ( m_EMT >> 1 ) & 1 );
#endif
m_cEncLib.setUseCompositeRef ( m_compositeRefEnabled ); m_cEncLib.setUseCompositeRef ( m_compositeRefEnabled );
m_cEncLib.setUseGBi ( m_GBi ); m_cEncLib.setUseGBi ( m_GBi );
m_cEncLib.setUseGBiFast ( m_GBiFast ); m_cEncLib.setUseGBiFast ( m_GBiFast );
......
...@@ -828,6 +828,15 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ...@@ -828,6 +828,15 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("LMChroma", m_LMChroma, 1, " LMChroma prediction " ("LMChroma", m_LMChroma, 1, " LMChroma prediction "
"\t0: Disable LMChroma\n" "\t0: Disable LMChroma\n"
"\t1: Enable LMChroma\n") "\t1: Enable LMChroma\n")
#if JVET_M0464_UNI_MTS
("MTS", m_MTS, 0, "Multiple Transform Set (MTS)\n"
"\t0: Disable MTS\n"
"\t1: Enable only Intra MTS\n"
"\t2: Enable only Inter MTS\n"
"\t3: Enable both Intra & Inter MTS\n")
("MTSIntraMaxCand", m_MTSIntraMaxCand, 3, "Number of additional candidates to test in encoder search for MTS in intra slices\n")
("MTSInterMaxCand", m_MTSInterMaxCand, 4, "Number of additional candidates to test in encoder search for MTS in inter slices\n")
#else
("EMT,-emt", m_EMT, 0, "Enhanced Multiple Transform (EMT)\n" ("EMT,-emt", m_EMT, 0, "Enhanced Multiple Transform (EMT)\n"
"\t0: Disable EMT\n" "\t0: Disable EMT\n"
"\t1: Enable only Intra EMT\n" "\t1: Enable only Intra EMT\n"
...@@ -838,6 +847,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ...@@ -838,6 +847,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
"\t1: Enable fast methods only for Intra EMT\n" "\t1: Enable fast methods only for Intra EMT\n"
"\t2: Enable fast methods only for Inter EMT\n" "\t2: Enable fast methods only for Inter EMT\n"
"\t3: Enable fast methods for both Intra & Inter EMT\n") "\t3: Enable fast methods for both Intra & Inter EMT\n")
#endif
("CompositeLTReference", m_compositeRefEnabled, false, "Enable Composite Long Term Reference Frame") ("CompositeLTReference", m_compositeRefEnabled, false, "Enable Composite Long Term Reference Frame")
("GBi", m_GBi, false, "Enable Generalized Bi-prediction(GBi)") ("GBi", m_GBi, false, "Enable Generalized Bi-prediction(GBi)")
("GBiFast", m_GBiFast, false, "Fast methods for Generalized Bi-prediction(GBi)\n") ("GBiFast", m_GBiFast, false, "Fast methods for Generalized Bi-prediction(GBi)\n")
...@@ -989,8 +999,13 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ...@@ -989,8 +999,13 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("SaoLumaOffsetBitShift", saoOffsetBitShift[CHANNEL_TYPE_LUMA], 0, "Specify the luma SAO bit-shift. If negative, automatically calculate a suitable value based upon bit depth and initial QP") ("SaoLumaOffsetBitShift", saoOffsetBitShift[CHANNEL_TYPE_LUMA], 0, "Specify the luma SAO bit-shift. If negative, automatically calculate a suitable value based upon bit depth and initial QP")
("SaoChromaOffsetBitShift", saoOffsetBitShift[CHANNEL_TYPE_CHROMA], 0, "Specify the chroma SAO bit-shift. If negative, automatically calculate a suitable value based upon bit depth and initial QP") ("SaoChromaOffsetBitShift", saoOffsetBitShift[CHANNEL_TYPE_CHROMA], 0, "Specify the chroma SAO bit-shift. If negative, automatically calculate a suitable value based upon bit depth and initial QP")
("TransformSkip", m_useTransformSkip, false, "Intra transform skipping") ("TransformSkip", m_useTransformSkip, false, "Intra transform skipping")
#if JVET_M0464_UNI_MTS
("TransformSkipFast", m_useTransformSkipFast, false, "Fast encoder search for transform skipping, winner takes it all mode.")
("TransformSkipLog2MaxSize", m_log2MaxTransformSkipBlockSize, 5U, "Specify transform-skip maximum size. Minimum 2, Maximum 5. (not valid in V1 profiles)")
#else
("TransformSkipFast", m_useTransformSkipFast, false, "Fast intra transform skipping") ("TransformSkipFast", m_useTransformSkipFast, false, "Fast intra transform skipping")
("TransformSkipLog2MaxSize", m_log2MaxTransformSkipBlockSize, 2U, "Specify transform-skip maximum size. Minimum 2. (not valid in V1 profiles)") ("TransformSkipLog2MaxSize", m_log2MaxTransformSkipBlockSize, 2U, "Specify transform-skip maximum size. Minimum 2. (not valid in V1 profiles)")
#endif
("ImplicitResidualDPCM", m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT], false, "Enable implicitly signalled residual DPCM for intra (also known as sample-adaptive intra predict) (not valid in V1 profiles)") ("ImplicitResidualDPCM", m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT], false, "Enable implicitly signalled residual DPCM for intra (also known as sample-adaptive intra predict) (not valid in V1 profiles)")
("ExplicitResidualDPCM", m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT], false, "Enable explicitly signalled residual DPCM for inter (not valid in V1 profiles)") ("ExplicitResidualDPCM", m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT], false, "Enable explicitly signalled residual DPCM for inter (not valid in V1 profiles)")
("ResidualRotation", m_transformSkipRotationEnabledFlag, false, "Enable rotation of transform-skipped and transquant-bypassed TUs through 180 degrees prior to entropy coding (not valid in V1 profiles)") ("ResidualRotation", m_transformSkipRotationEnabledFlag, false, "Enable rotation of transform-skipped and transquant-bypassed TUs through 180 degrees prior to entropy coding (not valid in V1 profiles)")
...@@ -1919,8 +1934,14 @@ bool EncAppCfg::xCheckParameter() ...@@ -1919,8 +1934,14 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( m_ImvMode, "IMV is only allowed with NEXT profile" ); xConfirmPara( m_ImvMode, "IMV is only allowed with NEXT profile" );
xConfirmPara(m_CPRMode, "CPR Mode only allowed with NEXT profile"); xConfirmPara(m_CPRMode, "CPR Mode only allowed with NEXT profile");
xConfirmPara( m_useFastLCTU, "Fast large CTU can only be applied when encoding with NEXT profile" ); xConfirmPara( m_useFastLCTU, "Fast large CTU can only be applied when encoding with NEXT profile" );
#if JVET_M0464_UNI_MTS
xConfirmPara( m_MTS, "MTS only allowed with NEXT profile" );
xConfirmPara( m_MTSIntraMaxCand, "MTS only allowed with NEXT profile" );
xConfirmPara( m_MTSInterMaxCand, "MTS only allowed with NEXT profile" );
#else
xConfirmPara( m_EMT, "EMT only allowed with NEXT profile" ); xConfirmPara( m_EMT, "EMT only allowed with NEXT profile" );
xConfirmPara( m_FastEMT, "EMT only allowed with NEXT profile" ); xConfirmPara( m_FastEMT, "EMT only allowed with NEXT profile" );
#endif
xConfirmPara( m_compositeRefEnabled, "Composite Reference Frame is only allowed with NEXT profile" ); xConfirmPara( m_compositeRefEnabled, "Composite Reference Frame is only allowed with NEXT profile" );
xConfirmPara( m_GBi, "GBi is only allowed with NEXT profile" ); xConfirmPara( m_GBi, "GBi is only allowed with NEXT profile" );
xConfirmPara( m_GBiFast, "GBiFast is only allowed with NEXT profile" ); xConfirmPara( m_GBiFast, "GBiFast is only allowed with NEXT profile" );
...@@ -2049,7 +2070,11 @@ bool EncAppCfg::xCheckParameter() ...@@ -2049,7 +2070,11 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara(m_profile == Profile::MAINSTILLPICTURE && m_framesToBeEncoded > 1, "Number of frames to be encoded must be 1 when main still picture profile is used."); xConfirmPara(m_profile == Profile::MAINSTILLPICTURE && m_framesToBeEncoded > 1, "Number of frames to be encoded must be 1 when main still picture profile is used.");
xConfirmPara(m_crossComponentPredictionEnabledFlag==true, "CrossComponentPrediction must not be used for non main-RExt profiles."); xConfirmPara(m_crossComponentPredictionEnabledFlag==true, "CrossComponentPrediction must not be used for non main-RExt profiles.");
#if JVET_M0464_UNI_MTS
xConfirmPara(m_log2MaxTransformSkipBlockSize>=6, "Transform Skip Log2 Max Size must be less or equal to 5.");
#else
xConfirmPara(m_log2MaxTransformSkipBlockSize!=2, "Transform Skip Log2 Max Size must be 2 for V1 profiles."); xConfirmPara(m_log2MaxTransformSkipBlockSize!=2, "Transform Skip Log2 Max Size must be 2 for V1 profiles.");
#endif
xConfirmPara(m_transformSkipRotationEnabledFlag==true, "UseResidualRotation must not be enabled for non main-RExt profiles."); xConfirmPara(m_transformSkipRotationEnabledFlag==true, "UseResidualRotation must not be enabled for non main-RExt profiles.");
xConfirmPara(m_transformSkipContextEnabledFlag==true, "UseSingleSignificanceMapContext must not be enabled for non main-RExt profiles."); xConfirmPara(m_transformSkipContextEnabledFlag==true, "UseSingleSignificanceMapContext must not be enabled for non main-RExt profiles.");
xConfirmPara(m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT]==true, "ImplicitResidualDPCM must not be enabled for non main-RExt profiles."); xConfirmPara(m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT]==true, "ImplicitResidualDPCM must not be enabled for non main-RExt profiles.");
...@@ -2138,6 +2163,7 @@ bool EncAppCfg::xCheckParameter() ...@@ -2138,6 +2163,7 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara (m_log2MaxTransformSkipBlockSize < 2, "Transform Skip Log2 Max Size must be at least 2 (4x4)"); xConfirmPara (m_log2MaxTransformSkipBlockSize < 2, "Transform Skip Log2 Max Size must be at least 2 (4x4)");
#if !JVET_M0464_UNI_MTS
if (m_log2MaxTransformSkipBlockSize!=2 && m_useTransformSkipFast) if (m_log2MaxTransformSkipBlockSize!=2 && m_useTransformSkipFast)
{ {
msg( WARNING, "***************************************************************************\n"); msg( WARNING, "***************************************************************************\n");
...@@ -2146,6 +2172,7 @@ bool EncAppCfg::xCheckParameter() ...@@ -2146,6 +2172,7 @@ bool EncAppCfg::xCheckParameter()
msg( WARNING, "** It may be better to disable transform skip fast mode **\n"); msg( WARNING, "** It may be better to disable transform skip fast mode **\n");
msg( WARNING, "***************************************************************************\n"); msg( WARNING, "***************************************************************************\n");
} }
#endif
xConfirmPara( m_quadtreeTULog2MaxSize * m_tuLog2MaxSize >= 0, "Setting of TULog2MaxSize and QuadtreeTULog2MaxSize is mutually exclusive - use only one of the parameters" ); xConfirmPara( m_quadtreeTULog2MaxSize * m_tuLog2MaxSize >= 0, "Setting of TULog2MaxSize and QuadtreeTULog2MaxSize is mutually exclusive - use only one of the parameters" );
...@@ -2258,8 +2285,14 @@ bool EncAppCfg::xCheckParameter() ...@@ -2258,8 +2285,14 @@ bool EncAppCfg::xCheckParameter()
m_maxNumAffineMergeCand = m_SubPuMvpMode; m_maxNumAffineMergeCand = m_SubPuMvpMode;
} }
#if JVET_M0464_UNI_MTS
xConfirmPara( m_MTS < 0 || m_MTS > 3, "MTS must be greater than 0 smaller than 4" );
xConfirmPara( m_MTSIntraMaxCand < 0 || m_MTSIntraMaxCand > 5, "m_MTSIntraMaxCand must be greater than 0 and smaller than 6" );
xConfirmPara( m_MTSInterMaxCand < 0 || m_MTSInterMaxCand > 5, "m_MTSInterMaxCand must be greater than 0 and smaller than 6" );
#else
xConfirmPara( m_EMT < 0 || m_EMT >3, "EMT must be 0, 1, 2 or 3" ); xConfirmPara( m_EMT < 0 || m_EMT >3, "EMT must be 0, 1, 2 or 3" );
xConfirmPara( m_FastEMT < 0 || m_FastEMT >3, "FEMT must be 0, 1, 2 or 3" ); xConfirmPara( m_FastEMT < 0 || m_FastEMT >3, "FEMT must be 0, 1, 2 or 3" );
#endif
if( m_usePCM) if( m_usePCM)
{ {
for (uint32_t channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++) for (uint32_t channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
...@@ -3091,8 +3124,12 @@ void EncAppCfg::xPrintParameter() ...@@ -3091,8 +3124,12 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "AltDQPCoding:%d ", m_AltDQPCoding ); msg( VERBOSE, "AltDQPCoding:%d ", m_AltDQPCoding );
#endif #endif
msg( VERBOSE, "LMChroma:%d ", m_LMChroma ); msg( VERBOSE, "LMChroma:%d ", m_LMChroma );
#if JVET_M0464_UNI_MTS
msg( VERBOSE, "MTS: %1d(intra) %1d(inter) ", m_MTS & 1, ( m_MTS >> 1 ) & 1 );
#else
msg( VERBOSE, "EMT: %1d(intra) %1d(inter) ", m_EMT & 1, ( m_EMT >> 1 ) & 1 ); msg( VERBOSE, "EMT: %1d(intra) %1d(inter) ", m_EMT & 1, ( m_EMT >> 1 ) & 1 );
msg(VERBOSE, "CompositeLTReference:%d ", m_compositeRefEnabled); #endif
msg( VERBOSE, "CompositeLTReference:%d ", m_compositeRefEnabled);
msg( VERBOSE, "GBi:%d ", m_GBi ); msg( VERBOSE, "GBi:%d ", m_GBi );
msg( VERBOSE, "GBiFast:%d ", m_GBiFast ); msg( VERBOSE, "GBiFast:%d ", m_GBiFast );
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET #if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
...@@ -3117,7 +3154,11 @@ void EncAppCfg::xPrintParameter() ...@@ -3117,7 +3154,11 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "FastMrg:%d ", m_useFastMrg ); msg( VERBOSE, "FastMrg:%d ", m_useFastMrg );
msg( VERBOSE, "PBIntraFast:%d ", m_usePbIntraFast ); msg( VERBOSE, "PBIntraFast:%d ", m_usePbIntraFast );
if( m_ImvMode == 2 ) msg( VERBOSE, "IMV4PelFast:%d ", m_Imv4PelFast ); if( m_ImvMode == 2 ) msg( VERBOSE, "IMV4PelFast:%d ", m_Imv4PelFast );
#if JVET_M0464_UNI_MTS
if( m_MTS ) msg( VERBOSE, "MTSMaxCand: %1d(intra) %1d(inter) ", m_MTSIntraMaxCand, m_MTSInterMaxCand );
#else
if( m_EMT ) msg( VERBOSE, "EMTFast: %1d(intra) %1d(inter) ", ( m_FastEMT & m_EMT & 1 ), ( m_FastEMT >> 1 ) & ( m_EMT >> 1 ) & 1 ); if( m_EMT ) msg( VERBOSE, "EMTFast: %1d(intra) %1d(inter) ", ( m_FastEMT & m_EMT & 1 ), ( m_FastEMT >> 1 ) & ( m_EMT >> 1 ) & 1 );
#endif
msg( VERBOSE, "AMaxBT:%d ", m_useAMaxBT ); msg( VERBOSE, "AMaxBT:%d ", m_useAMaxBT );
msg( VERBOSE, "E0023FastEnc:%d ", m_e0023FastEnc ); msg( VERBOSE, "E0023FastEnc:%d ", m_e0023FastEnc );
msg( VERBOSE, "ContentBasedFastQtbt:%d ", m_contentBasedFastQtbt ); msg( VERBOSE, "ContentBasedFastQtbt:%d ", m_contentBasedFastQtbt );
......
...@@ -214,8 +214,14 @@ protected: ...@@ -214,8 +214,14 @@ protected:
bool m_AltDQPCoding; bool m_AltDQPCoding;
#endif #endif
int m_LMChroma; int m_LMChroma;
#if JVET_M0464_UNI_MTS
int m_MTS; ///< XZ: Multiple Transform Set
int m_MTSIntraMaxCand; ///< XZ: Number of additional candidates to test
int m_MTSInterMaxCand; ///< XZ: Number of additional candidates to test
#else
int m_EMT; ///< XZ: Enhanced Multiple Transform int m_EMT; ///< XZ: Enhanced Multiple Transform
int m_FastEMT; ///< XZ: Fast Methods of Enhanced Multiple Transform int m_FastEMT; ///< XZ: Fast Methods of Enhanced Multiple Transform
#endif
bool m_compositeRefEnabled; bool m_compositeRefEnabled;
bool m_GBi; bool m_GBi;
......
...@@ -211,8 +211,14 @@ static const int DM_CHROMA_IDX = NUM_INTRA_MODE; ///< chro ...@@ -211,8 +211,14 @@ static const int DM_CHROMA_IDX = NUM_INTRA_MODE; ///< chro
static const uint8_t INTER_MODE_IDX = 255; ///< index for inter modes static const uint8_t INTER_MODE_IDX = 255; ///< index for inter modes
#if JVET_M0464_UNI_MTS
static const uint32_t NUM_TRAFO_MODES_MTS = 6; ///< Max Intra CU size applying EMT, supported values: 8, 16, 32, 64, 128
static const uint32_t MTS_INTRA_MAX_CU_SIZE = 32; ///< Max Intra CU size applying EMT, supported values: 8, 16, 32, 64, 128
static const uint32_t MTS_INTER_MAX_CU_SIZE = 32; ///< Max Inter CU size applying EMT, supported values: 8, 16, 32, 64, 128
#else
static const uint32_t EMT_INTRA_MAX_CU_WITH_QTBT = 32; ///< Max Intra CU size applying EMT, supported values: 8, 16, 32, 64, 128 static const uint32_t EMT_INTRA_MAX_CU_WITH_QTBT = 32; ///< Max Intra CU size applying EMT, supported values: 8, 16, 32, 64, 128
static const uint32_t EMT_INTER_MAX_CU_WITH_QTBT = 32; ///< Max Inter CU size applying EMT, supported values: 8, 16, 32, 64, 128 static const uint32_t EMT_INTER_MAX_CU_WITH_QTBT = 32; ///< Max Inter CU size applying EMT, supported values: 8, 16, 32, 64, 128
#endif
static const int NUM_MOST_PROBABLE_MODES = 6; static const int NUM_MOST_PROBABLE_MODES = 6;
static const int LM_SYMBOL_NUM = (1 + NUM_LMC_MODE); static const int LM_SYMBOL_NUM = (1 + NUM_LMC_MODE);
...@@ -321,7 +327,9 @@ static const int MAX_ENCODER_DEBLOCKING_QUALITY_LAYERS = 8 ; ...@@ -321,7 +327,9 @@ static const int MAX_ENCODER_DEBLOCKING_QUALITY_LAYERS = 8 ;
static const uint32_t LUMA_LEVEL_TO_DQP_LUT_MAXSIZE = 1024; ///< max LUT size for QP offset based on luma static const uint32_t LUMA_LEVEL_TO_DQP_LUT_MAXSIZE = 1024; ///< max LUT size for QP offset based on luma
#endif #endif
#if !JVET_M0464_UNI_MTS
static const int NUM_EMT_CU_FLAG_CTX = 6; ///< number of context models for EMT CU-level flag static const int NUM_EMT_CU_FLAG_CTX = 6; ///< number of context models for EMT CU-level flag
#endif
//QTBT high level parameters //QTBT high level parameters
//for I slice luma CTB configuration para. //for I slice luma CTB configuration para.
......
...@@ -81,7 +81,11 @@ CoeffCodingContext::CoeffCodingContext(const TransformUnit& tu, ComponentID comp ...@@ -81,7 +81,11 @@ CoeffCodingContext::CoeffCodingContext(const TransformUnit& tu, ComponentID comp
, m_lastOffsetY (0) , m_lastOffsetY (0)
, m_lastShiftX (0) , m_lastShiftX (0)
, m_lastShiftY (0) , m_lastShiftY (0)
#if JVET_M0464_UNI_MTS
, m_TrafoBypass (tu.cs->sps->getSpsRangeExtension().getTransformSkipContextEnabledFlag() && (tu.cu->transQuantBypass || tu.mtsIdx==1))
#else
, m_TrafoBypass (tu.cs->sps->getSpsRangeExtension().getTransformSkipContextEnabledFlag() && (tu.cu->transQuantBypass || tu.transformSkip[m_compID])) , m_TrafoBypass (tu.cs->sps->getSpsRangeExtension().getTransformSkipContextEnabledFlag() && (tu.cu->transQuantBypass || tu.transformSkip[m_compID]))
#endif
, m_scanPosLast (-1) , m_scanPosLast (-1)
, m_subSetId (-1) , m_subSetId (-1)
, m_subSetPos (-1) , m_subSetPos (-1)
...@@ -96,7 +100,9 @@ CoeffCodingContext::CoeffCodingContext(const TransformUnit& tu, ComponentID comp ...@@ -96,7 +100,9 @@ CoeffCodingContext::CoeffCodingContext(const TransformUnit& tu, ComponentID comp
, m_parFlagCtxSet ( Ctx::ParFlag[m_chType] ) , m_parFlagCtxSet ( Ctx::ParFlag[m_chType] )
, m_gtxFlagCtxSet { Ctx::GtxFlag[m_chType], Ctx::GtxFlag[m_chType+2] } , m_gtxFlagCtxSet { Ctx::GtxFlag[m_chType], Ctx::GtxFlag[m_chType+2] }
, m_sigCoeffGroupFlag () , m_sigCoeffGroupFlag ()
#if !JVET_M0464_UNI_MTS
, m_emtNumSigCoeff (0) , m_emtNumSigCoeff (0)
#endif
{ {
// LOGTODO // LOGTODO
unsigned log2sizeX = m_log2BlockWidth; unsigned log2sizeX = m_log2BlockWidth;
......
...@@ -183,8 +183,10 @@ public: ...@@ -183,8 +183,10 @@ public:
return std::min(sum, 31); return std::min(sum, 31);
} }
#if !JVET_M0464_UNI_MTS
unsigned emtNumSigCoeff() const { return m_emtNumSigCoeff; } unsigned emtNumSigCoeff() const { return m_emtNumSigCoeff; }
void setEmtNumSigCoeff( unsigned val ) { m_emtNumSigCoeff = val; } void setEmtNumSigCoeff( unsigned val ) { m_emtNumSigCoeff = val; }
#endif
private: private:
// constant // constant
...@@ -235,7 +237,9 @@ private: ...@@ -235,7 +237,9 @@ private:
CtxSet m_parFlagCtxSet; CtxSet m_parFlagCtxSet;
CtxSet m_gtxFlagCtxSet[2]; CtxSet m_gtxFlagCtxSet[2];
std::bitset<MLS_GRP_NUM> m_sigCoeffGroupFlag; std::bitset<MLS_GRP_NUM> m_sigCoeffGroupFlag;
#if !JVET_M0464_UNI_MTS
unsigned m_emtNumSigCoeff; unsigned m_emtNumSigCoeff;
#endif
}; };
......
...@@ -1080,6 +1080,7 @@ const CtxSet ContextSetCfg::SaoTypeIdx = ContextSetCfg::addCtxSet ...@@ -1080,6 +1080,7 @@ const CtxSet ContextSetCfg::SaoTypeIdx = ContextSetCfg::addCtxSet
#endif #endif
}); });
#if !JVET_M0464_UNI_MTS
const CtxSet ContextSetCfg::TransformSkipFlag = ContextSetCfg::addCtxSet const CtxSet ContextSetCfg::TransformSkipFlag = ContextSetCfg::addCtxSet
({ ({
#if JVET_M0453_CABAC_ENGINE #if JVET_M0453_CABAC_ENGINE
...@@ -1093,6 +1094,7 @@ const CtxSet ContextSetCfg::TransformSkipFlag = ContextSetCfg::addCtxSet ...@@ -1093,6 +1094,7 @@ const CtxSet ContextSetCfg::TransformSkipFlag = ContextSetCfg::addCtxSet
{ 109, 42, }, { 109, 42, },
#endif #endif
}); });
#endif
const CtxSet ContextSetCfg::TransquantBypassFlag = ContextSetCfg::addCtxSet const CtxSet ContextSetCfg::TransquantBypassFlag = ContextSetCfg::addCtxSet
({ ({
...@@ -1124,6 +1126,21 @@ const CtxSet ContextSetCfg::RdpcmDir = ContextSetCfg::addCtxSet ...@@ -1124,6 +1126,21 @@ const CtxSet ContextSetCfg::RdpcmDir = ContextSetCfg::addCtxSet
#endif #endif
}); });
#if JVET_M0464_UNI_MTS
const CtxSet ContextSetCfg::MTSIndex = ContextSetCfg::addCtxSet
({
#if JVET_M0453_CABAC_ENGINE
{ CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, },
{ CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, },
{ CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, },
{ DWS, DWS, DWS, DWS, DWS, DWS, DWS, DWS, DWS, DWS, DWS, },
#else
{ CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, },
{ CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, },
{ CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, },
#endif
});
#else
const CtxSet ContextSetCfg::EMTTuIndex = ContextSetCfg::addCtxSet const CtxSet ContextSetCfg::EMTTuIndex = ContextSetCfg::addCtxSet
({ ({
#if JVET_M0453_CABAC_ENGINE #if JVET_M0453_CABAC_ENGINE
...@@ -1151,6 +1168,7 @@ const CtxSet ContextSetCfg::EMTCuFlag = ContextSetCfg::addCtxSet ...@@ -1151,6 +1168,7 @@ const CtxSet ContextSetCfg::EMTCuFlag = ContextSetCfg::addCtxSet
{ CNU, CNU, 140, 155, 155, CNU, }, { CNU, CNU, 140, 155, 155, CNU, },
#endif #endif
}); });
#endif
const CtxSet ContextSetCfg::CrossCompPred = ContextSetCfg::addCtxSet const CtxSet ContextSetCfg::CrossCompPred = ContextSetCfg::addCtxSet
({ ({
......
...@@ -282,12 +282,18 @@ public: ...@@ -282,12 +282,18 @@ public:
static const CtxSet MVPIdx; static const CtxSet MVPIdx;
static const CtxSet SaoMergeFlag; static const CtxSet SaoMergeFlag;
static const CtxSet SaoTypeIdx; static const CtxSet SaoTypeIdx;
#if JVET_M0464_UNI_MTS
static const CtxSet MTSIndex;
#else
static const CtxSet TransformSkipFlag; static const CtxSet TransformSkipFlag;
#endif
static const CtxSet TransquantBypassFlag; static const CtxSet TransquantBypassFlag;
static const CtxSet RdpcmFlag; static const CtxSet RdpcmFlag;
static const CtxSet RdpcmDir; static const CtxSet RdpcmDir;
#if !JVET_M0464_UNI_MTS
static const CtxSet EMTTuIndex; static const CtxSet EMTTuIndex;
static const CtxSet EMTCuFlag; static const CtxSet EMTCuFlag;
#endif
static const CtxSet CrossCompPred; static const CtxSet CrossCompPred;
static const CtxSet ChromaQpAdjFlag; static const CtxSet ChromaQpAdjFlag;
static const CtxSet ChromaQpAdjIdc; static const CtxSet ChromaQpAdjIdc;
......
...@@ -642,7 +642,11 @@ namespace DQIntern ...@@ -642,7 +642,11 @@ namespace DQIntern
const int channelBitDepth = sps.getBitDepth( chType ); const int channelBitDepth = sps.getBitDepth( chType );
const int maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange( chType ); const int maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange( chType );
const int nomTransformShift = getTransformShift( channelBitDepth, area.size(), maxLog2TrDynamicRange ); const int nomTransformShift = getTransformShift( channelBitDepth, area.size(), maxLog2TrDynamicRange );
#if JVET_M0464_UNI_MTS
const bool clipTransformShift = ( tu.mtsIdx==1 && sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag() );
#else
const bool clipTransformShift = ( tu.transformSkip[ compID ] && sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag() ); const bool clipTransformShift = ( tu.transformSkip[ compID ] && sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag() );
#endif
const int transformShift = ( clipTransformShift ? std::max<int>( 0, nomTransformShift ) : nomTransformShift ); const int transformShift = ( clipTransformShift ? std::max<int>( 0, nomTransformShift ) : nomTransformShift );
// quant parameters // quant parameters
...@@ -726,7 +730,11 @@ namespace DQIntern ...@@ -726,7 +730,11 @@ namespace DQIntern
const TCoeff minTCoeff = -( 1 << maxLog2TrDynamicRange ); const TCoeff minTCoeff = -( 1 << maxLog2TrDynamicRange );
const TCoeff maxTCoeff = ( 1 << maxLog2TrDynamicRange ) - 1; const TCoeff maxTCoeff = ( 1 << maxLog2TrDynamicRange ) - 1;
const int nomTransformShift = getTransformShift( channelBitDepth, area.size(), maxLog2TrDynamicRange ); const int nomTransformShift = getTransformShift( channelBitDepth, area.size(), maxLog2TrDynamicRange );
#if JVET_M0464_UNI_MTS
const bool clipTransformShift = ( tu.mtsIdx==1 && sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag() );
#else
const bool clipTransformShift = ( tu.transformSkip[ compID ] && sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag() ); const bool clipTransformShift = ( tu.transformSkip[ compID ] && sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag() );
#endif
const int transformShift = ( clipTransformShift ? std::max<int>( 0, nomTransformShift ) : nomTransformShift ); const int transformShift = ( clipTransformShift ? std::max<int>( 0, nomTransformShift ) : nomTransformShift );
#if HM_QTBT_AS_IN_JEM_QUANT #if HM_QTBT_AS_IN_JEM_QUANT
Intermediate_Int shift = IQUANT_SHIFT + 1 - qpPer - transformShift + ( TU::needsBlockSizeTrafoScale( area ) ? ADJ_DEQUANT_SHIFT : 0 ); Intermediate_Int shift = IQUANT_SHIFT + 1 - qpPer - transformShift + ( TU::needsBlockSizeTrafoScale( area ) ? ADJ_DEQUANT_SHIFT : 0 );
......
...@@ -301,7 +301,11 @@ void Quant::dequant(const TransformUnit &tu, ...@@ -301,7 +301,11 @@ void Quant::dequant(const TransformUnit &tu,
CHECK(uiWidth > m_uiMaxTrSize, "Unsupported transformation size"); CHECK(uiWidth > m_uiMaxTrSize, "Unsupported transformation size");