diff --git a/source/Lib/CommonLib/Rom.cpp b/source/Lib/CommonLib/Rom.cpp index aadd7d88d95c41a86fef393ac7acfbbc5b7fdd99..e9972bf93357d10e5c46ee4c78d857561c3b3a3b 100644 --- a/source/Lib/CommonLib/Rom.cpp +++ b/source/Lib/CommonLib/Rom.cpp @@ -621,7 +621,9 @@ const uint8_t g_aucTrSetHorz35[35] = }; //EMT threshold +#if !JVET_L0059_MTS_SIMP const uint32_t g_EmtSigNumThr = 2; +#endif #if !JVET_L0285_8BIT_TRANSFORM_CORE //EMT transform coeficient variable diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 61f67ef29d25ce1c5ee3b17a31e736b9ce3fd852..918a63e9e0212381a7e7af94aa74fb2eb54b939b 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -50,6 +50,8 @@ #include <assert.h> #include <cassert> +#define JVET_L0059_MTS_SIMP 1 // Simpification on MTS signaling + #define JVET_L0118_ALIGN_MTS_INDEX 1 // Align mts_index on intra and inter #define JVET_L0377_AMVR_ROUNDING_ALIGN 1 // Align AMVR rounding for AMVP candidate diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index b58966e8de83e770f99d1db2bf36c9c2bbb01419..704ae08ed937f4b7afce0990421056e8e8d72f9a 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -2081,14 +2081,18 @@ void CABACReader::residual_coding( TransformUnit& tu, ComponentID compID ) { if( CU::isIntra( *tu.cu ) ) { - if( numSig > g_EmtSigNumThr ) +#if JVET_L0059_MTS_SIMP + emt_tu_index(tu); +#else + if (numSig > g_EmtSigNumThr) { - emt_tu_index( tu ); + emt_tu_index(tu); } else { tu.emtIdx = 0; //default transform } +#endif } else { diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp index 7636c2b34f332af8b0c695fa3854eb66ccde4002..609819ef1ac8211e54c03c37111e04b641782e65 100644 --- a/source/Lib/EncoderLib/CABACWriter.cpp +++ b/source/Lib/EncoderLib/CABACWriter.cpp @@ -1997,6 +1997,9 @@ void CABACWriter::residual_coding( const TransformUnit& tu, ComponentID compID ) { if( CU::isIntra( *tu.cu ) ) { +#if JVET_L0059_MTS_SIMP + emt_tu_index(tu); +#else if( numSig > g_EmtSigNumThr ) { emt_tu_index( tu ); @@ -2005,6 +2008,7 @@ void CABACWriter::residual_coding( const TransformUnit& tu, ComponentID compID ) { CHECK( tu.emtIdx != 0, "If the number of significant coefficients is <= g_EmtSigNumThr, then the tu index must be 0" ); } +#endif } else { diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp index bf411cceeaaff6e12c6699c63a1c11338a54e0b2..14486bfc32876e652b71d46d9bae7b3b0268d2db 100644 --- a/source/Lib/EncoderLib/IntraSearch.cpp +++ b/source/Lib/EncoderLib/IntraSearch.cpp @@ -1217,7 +1217,9 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp const bool bUseCrossCPrediction = pps.getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() && isChroma( compID ) && PU::isChromaIntraModeCrossCheckMode( pu ) && checkCrossCPrediction; const bool ccUseRecoResi = m_pcEncCfg->getUseReconBasedCrossCPredictionEstimate(); +#if !JVET_L0059_MTS_SIMP const uint8_t transformIndex = tu.cu->emtFlag && compID == COMPONENT_Y ? tu.emtIdx : DCT2_EMT ; +#endif //===== init availability pattern ===== PelBuf sharedPredTS( m_pSharedPredTransformSkip[compID], area ); @@ -1291,6 +1293,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp m_pcTrQuant->transformNxN(tu, compID, cQP, uiAbsSum, m_CABACEstimator->getCtx()); +#if !JVET_L0059_MTS_SIMP if( transformIndex != DCT2_EMT && ( !tu.transformSkip[COMPONENT_Y] ) ) //this can only be true if compID is luma { *numSig = 0; @@ -1312,6 +1315,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp return; } } +#endif DTRACE( g_trace_ctx, D_TU_ABS_SUM, "%d: comp=%d, abssum=%d\n", DTRACE_GET_COUNTER( g_trace_ctx, D_TU_ABS_SUM ), compID, uiAbsSum ); @@ -1504,12 +1508,20 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par //----- determine rate and r-d cost ----- //the condition (transformIndex != DCT2_EMT) seems to be irrelevant, since DCT2_EMT=7 and the highest value of transformIndex is 4 +#if JVET_L0059_MTS_SIMP +#if ENABLE_BMS + if( ( modeId == lastCheckId && checkTransformSkip && !TU::getCbfAtDepth( tu, COMPONENT_Y, currDepth ) ) ) +#else + if( ( modeId == lastCheckId && checkTransformSkip && !TU::getCbf( tu, COMPONENT_Y ) ) ) +#endif +#else #if ENABLE_BMS if( ( modeId == lastCheckId && checkTransformSkip && !TU::getCbfAtDepth( tu, COMPONENT_Y, currDepth ) ) || ( tu.emtIdx > 0 && ( checkTransformSkip ? transformIndex != lastCheckId : true ) && tu.emtIdx != DCT2_EMT && numSig <= g_EmtSigNumThr ) ) #else if( ( modeId == lastCheckId && checkTransformSkip && !TU::getCbf( tu, COMPONENT_Y ) ) || ( tu.emtIdx > 0 && ( checkTransformSkip ? transformIndex != lastCheckId : true ) && tu.emtIdx != DCT2_EMT && numSig <= g_EmtSigNumThr ) ) +#endif #endif { //In order not to code TS flag when cbf is zero, the case for TS with cbf being zero is forbidden.