Commit 8c6a3506 authored by Kiho Choi's avatar Kiho Choi

Upload codes for L0059 - Simplification on MTS signaling

parent 5c46b9be
Pipeline #252 passed with stage
......@@ -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
......
......@@ -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
......
......@@ -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
{
......
......@@ -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
{
......
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment