Commit 8f80979a authored by Karsten Suehring's avatar Karsten Suehring
Browse files

remove unused code

- remove alternative code path for HM_EMT_NSST_AS_IN_JEM
- remove code in DMVR_JVET_LOW_LATENCY_K0217 (was not defined)
parent 016e68f1
......@@ -226,7 +226,6 @@
#endif
#define HM_CODED_CU_INFO 1 // like in JEM, when related CU is skipped, it stays like this even if a non skip mode wins...
#define HM_4TAPIF_AS_IN_JEM 1 // *** - PM: condition not well suited for 4-tap interpolation filters
#define HM_EMT_NSST_AS_IN_JEM 1 //
#define HM_MDIS_AS_IN_JEM 1 // *** - PM: not filtering ref. samples for 64xn case and using Planar MDIS condition at encoder
#define HM_JEM_CLIP_PEL 1 // ***
#if JVET_L0093_SIMP_PRUNE
......
......@@ -66,30 +66,6 @@ UnitArea CS::getArea( const CodingStructure &cs, const UnitArea &area, const Cha
return isDualITree( cs ) ? area.singleChan( chType ) : area;
}
#if DMVR_JVET_LOW_LATENCY_K0217
void CS::setRefinedMotionField(CodingStructure &cs)
{
for (CodingUnit *cu : cs.cus)
{
for (auto &pu : CU::traversePUs(*cu))
{
if (pu.cs->sps->getSpsNext().getUseDMVR()
&& pu.mergeFlag
&& pu.mergeType == MRG_TYPE_DEFAULT_N
&& !pu.frucMrgMode
&& !pu.cu->LICFlag
&& !pu.cu->affine
&& PU::isBiPredFromDifferentDir(pu))
{
pu.mv[REF_PIC_LIST_0] += pu.mvd[REF_PIC_LIST_0];
pu.mv[REF_PIC_LIST_1] -= pu.mvd[REF_PIC_LIST_0];
pu.mvd[REF_PIC_LIST_0].setZero();
PU::spanMotionInfo(pu);
}
}
}
}
#endif
// CU tools
bool CU::isIntra(const CodingUnit &cu)
......
......@@ -49,9 +49,6 @@ namespace CS
uint64_t getEstBits ( const CodingStructure &cs );
UnitArea getArea ( const CodingStructure &cs, const UnitArea &area, const ChannelType chType );
bool isDualITree ( const CodingStructure &cs );
#if DMVR_JVET_LOW_LATENCY_K0217
void setRefinedMotionField ( CodingStructure &cs );
#endif
}
......@@ -373,4 +370,4 @@ uint32_t updateDoubleCandList(T mode, double cost, static_vector<T, N>& candMode
#endif
#endif
\ No newline at end of file
#endif
......@@ -311,12 +311,10 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::SkipFlag), cu.skip);
}
#if HM_EMT_NSST_AS_IN_JEM
if (!(!((cs.sps->getSpsNext().getUseIntraEMT() && CU::isIntra(cu)) || (cs.sps->getSpsNext().getUseInterEMT() && CU::isInter(cu))) || isChroma(cu.chType)))
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::EMTFlag), cu.emtFlag);
}
#endif
}
else if( chType == CHANNEL_TYPE_CHROMA )
{
......@@ -334,12 +332,10 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::TransQuantBypassFlag_Chroma), cu.transQuantBypass);
}
#if HM_EMT_NSST_AS_IN_JEM
if (!(!((cs.sps->getSpsNext().getUseIntraEMT() && CU::isIntra(cu)) || (cs.sps->getSpsNext().getUseInterEMT() && CU::isInter(cu))) || isChroma(cu.chType)))
{
DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::EMTFlag_Chroma), cu.emtFlag);
}
#endif
}
......@@ -785,11 +781,7 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
if (tu.Y().valid())
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, tu, GetBlockStatisticName(BlockStatistic::Cbf_Y), tu.cbf[COMPONENT_Y]);
#if HM_EMT_NSST_AS_IN_JEM
if (!(!tu.cu->cs->pps->getUseTransformSkip() || tu.cu->transQuantBypass || !TU::hasTransformSkipFlag(*tu.cs, tu.blocks[COMPONENT_Y]) || (isLuma(COMPONENT_Y) && tu.cu->emtFlag)))
#else
if (!(!tu.cu->cs->pps->getUseTransformSkip() || tu.cu->transQuantBypass || !TU::hasTransformSkipFlag(*tu.cs, tu.blocks[COMPONENT_Y])))
#endif
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, tu, GetBlockStatisticName(BlockStatistic::TransformSkipFlag_Y), tu.transformSkip[COMPONENT_Y]);
}
......@@ -798,26 +790,17 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
{
DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, tu, GetBlockStatisticName(BlockStatistic::Cbf_Cb), tu.cbf[COMPONENT_Cb]);
DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, tu, GetBlockStatisticName(BlockStatistic::Cbf_Cr), tu.cbf[COMPONENT_Cr]);
#if HM_EMT_NSST_AS_IN_JEM
if (!(!tu.cu->cs->pps->getUseTransformSkip() || tu.cu->transQuantBypass || !TU::hasTransformSkipFlag(*tu.cs, tu.blocks[COMPONENT_Cb]) || (isLuma(COMPONENT_Cb) && tu.cu->emtFlag)))
#else
if (!(!tu.cu->cs->pps->getUseTransformSkip() || tu.cu->transQuantBypass || !TU::hasTransformSkipFlag(*tu.cs, tu.blocks[COMPONENT_Cb])))
#endif
{
DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, tu, GetBlockStatisticName(BlockStatistic::TransformSkipFlag_Cb), tu.transformSkip[COMPONENT_Cb]);
}
#if HM_EMT_NSST_AS_IN_JEM
if (!(!tu.cu->cs->pps->getUseTransformSkip() || tu.cu->transQuantBypass || !TU::hasTransformSkipFlag(*tu.cs, tu.blocks[COMPONENT_Cr]) || (isLuma(COMPONENT_Cr) && tu.cu->emtFlag)))
#else
if (!(!tu.cu->cs->pps->getUseTransformSkip() || tu.cu->transQuantBypass || !TU::hasTransformSkipFlag(*tu.cs, tu.blocks[COMPONENT_Cr])))
#endif
{
DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, tu, GetBlockStatisticName(BlockStatistic::TransformSkipFlag_Cr), tu.transformSkip[COMPONENT_Cr]);
}
}
}
}
#if HM_EMT_NSST_AS_IN_JEM
if (!(!((cs.sps->getSpsNext().getUseIntraEMT() && CU::isIntra(cu)) || (cs.sps->getSpsNext().getUseInterEMT() && CU::isInter(cu))) || isChroma(cu.chType)))
{
if( isLuma( ChannelType( chType ) ) )
......@@ -829,7 +812,6 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, cu, GetBlockStatisticName(BlockStatistic::EMTFlag_Chroma), cu.emtFlag);
}
}
#endif
}
}
}
......
......@@ -1182,55 +1182,8 @@ void CABACReader::cu_residual( CodingUnit& cu, Partitioner &partitioner, CUCtx&
ChromaCbfs chromaCbfs;
transform_tree( *cu.cs, partitioner, cuCtx, chromaCbfs );
#if !HM_EMT_NSST_AS_IN_JEM
cu_emt_pertu_idx( cu );
#endif
}
#if !HM_EMT_NSST_AS_IN_JEM
void CABACReader::cu_emt_pertu_idx( CodingUnit& cu )
{
bool anyCbf = false, anyNonTs = false;
for( const auto &tu : CU::traverseTUs( cu ) )
{
anyCbf |= tu.cbf[0] != 0;
anyNonTs |= !tu.transformSkip[0];
}
if( !isLuma( cu.chType ) || cu.nsstIdx != 0 || !( cu.cs->sps->getSpsNext().getUseIntraEMT() || cu.cs->sps->getSpsNext().getUseInterEMT() ) || !anyCbf || !anyNonTs )
{
return;
}
emt_cu_flag( cu );
if( cu.emtFlag )
{
for( auto &tu : CU::traverseTUs( cu ) )
{
if( CU::isIntra( cu ) )
{
if( TU::getNumNonZeroCoeffsNonTS( tu, true, false ) > g_EmtSigNumThr )
{
emt_tu_index( tu );
}
else
{
CHECK( tu.emtIdx != 0, "If the number of significant coefficients is <= g_EmtSigNumThr, then the tu index must be 0" );
}
}
else
{
emt_tu_index( tu );
}
}
}
}
#endif
void CABACReader::rqt_root_cbf( CodingUnit& cu )
{
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET( STATS__CABAC_BITS__QT_ROOT_CBF );
......@@ -1986,9 +1939,7 @@ void CABACReader::transform_tree( CodingStructure &cs, Partitioner &partitioner,
if( split )
{
{
#if HM_EMT_NSST_AS_IN_JEM
if( trDepth == 0 ) emt_cu_flag( cu );
#endif
if( partitioner.canSplit( TU_MAX_TR_SPLIT, cs ) )
{
......@@ -2072,9 +2023,7 @@ void CABACReader::transform_tree( CodingStructure &cs, Partitioner &partitioner,
TU::setCbfAtDepth( tu, COMPONENT_Cr, trDepth, ( chromaCbfs.Cr ? 1 : 0 ) );
}
#if HM_EMT_NSST_AS_IN_JEM
if( trDepth == 0 && TU::getCbfAtDepth( tu, COMPONENT_Y, 0 ) ) emt_cu_flag( cu );
#endif
transform_unit( tu, cuCtx, chromaCbfs );
}
......@@ -2319,7 +2268,6 @@ void CABACReader::residual_coding( TransformUnit& tu, ComponentID compID )
}
#if HM_EMT_NSST_AS_IN_JEM
if( useEmt && !tu.transformSkip[compID] && compID == COMPONENT_Y && tu.cu->emtFlag )
{
if( CU::isIntra( *tu.cu ) )
......@@ -2342,19 +2290,13 @@ void CABACReader::residual_coding( TransformUnit& tu, ComponentID compID )
emt_tu_index( tu );
}
}
#endif
}
void CABACReader::transform_skip_flag( TransformUnit& tu, ComponentID compID )
{
#if HM_EMT_NSST_AS_IN_JEM
if( !tu.cu->cs->pps->getUseTransformSkip() || tu.cu->transQuantBypass || !TU::hasTransformSkipFlag( *tu.cs, tu.blocks[compID] ) || ( isLuma( compID ) && tu.cu->emtFlag ) )
#else
if( !tu.cu->cs->pps->getUseTransformSkip() || tu.cu->transQuantBypass || !TU::hasTransformSkipFlag( *tu.cs, tu.blocks[compID] ) )
#endif
{
tu.transformSkip[compID] = false;
return;
......
......@@ -136,9 +136,6 @@ public:
void transform_unit ( TransformUnit& tu, CUCtx& cuCtx, ChromaCbfs& chromaCbfs );
void cu_qp_delta ( CodingUnit& cu, int predQP, int8_t& qp );
void cu_chroma_qp_offset ( CodingUnit& cu );
#if !HM_EMT_NSST_AS_IN_JEM
void cu_emt_pertu_idx ( CodingUnit& cu );
#endif
// residual coding (clause 7.3.8.11)
void residual_coding ( TransformUnit& tu, ComponentID compID );
......
......@@ -511,10 +511,6 @@ void DecLib::executeLoopFilters()
// deblocking filter
m_cLoopFilter.loopFilterPic( cs );
#if DMVR_JVET_LOW_LATENCY_K0217
CS::setRefinedMotionField(cs);
#endif
if( cs.sps->getUseSAO() )
{
m_cSAO.SAOProcess( cs, cs.picture->getSAO() );
......
......@@ -1194,55 +1194,8 @@ void CABACWriter::cu_residual( const CodingUnit& cu, Partitioner& partitioner, C
ChromaCbfs chromaCbfs;
transform_tree( *cu.cs, partitioner, cuCtx, chromaCbfs );
#if !HM_EMT_NSST_AS_IN_JEM
cu_emt_pertu_idx( cu );
#endif
}
#if !HM_EMT_NSST_AS_IN_JEM
void CABACWriter::cu_emt_pertu_idx( const CodingUnit& cu )
{
bool anyCbf = false, anyNonTs = false;
for( const auto &tu : CU::traverseTUs( cu ) )
{
anyCbf |= tu.cbf[0] != 0;
anyNonTs |= !tu.transformSkip[0];
}
if( !isLuma( cu.chType ) || cu.nsstIdx != 0 ||
!( cu.cs->sps->getSpsNext().getUseIntraEMT() || cu.cs->sps->getSpsNext().getUseInterEMT() ) || !anyCbf || !anyNonTs )
{
return;
}
emt_cu_flag( cu );
if( cu.emtFlag )
{
for( const auto &tu : CU::traverseTUs( cu ) )
{
if( CU::isIntra( cu ) )
{
if( TU::getNumNonZeroCoeffsNonTS( tu, true, false ) > g_EmtSigNumThr )
{
emt_tu_index( tu );
}
else
{
CHECK( tu.emtIdx != 0, "If the number of significant coefficients is <= g_EmtSigNumThr, then the tu index must be 0" );
}
}
else
{
emt_tu_index( *cu.firstTU );
}
}
}
}
#endif
void CABACWriter::rqt_root_cbf( const CodingUnit& cu )
{
m_BinEncoder.encodeBin( cu.rootCbf, Ctx::QtRootCbf() );
......@@ -1953,9 +1906,7 @@ void CABACWriter::transform_tree( const CodingStructure& cs, Partitioner& partit
chromaCbfs.Cb = TU::getCbfAtDepth( tu, COMPONENT_Cb, trDepth );
chromaCbfs.Cr = TU::getCbfAtDepth( tu, COMPONENT_Cr, trDepth );
}
#if HM_EMT_NSST_AS_IN_JEM
if( trDepth == 0 ) emt_cu_flag( cu );
#endif
if( partitioner.canSplit( TU_MAX_TR_SPLIT, cs ) )
{
......@@ -1993,9 +1944,7 @@ void CABACWriter::transform_tree( const CodingStructure& cs, Partitioner& partit
}
}
#if HM_EMT_NSST_AS_IN_JEM
if( trDepth == 0 && TU::getCbfAtDepth( tu, COMPONENT_Y, 0 ) ) emt_cu_flag( cu );
#endif
transform_unit( tu, cuCtx, chromaCbfs );
}
......@@ -2270,7 +2219,6 @@ void CABACWriter::residual_coding( const TransformUnit& tu, ComponentID compID )
}
#if HM_EMT_NSST_AS_IN_JEM
if( useEmt && !tu.transformSkip[compID] && compID == COMPONENT_Y && tu.cu->emtFlag )
{
if( CU::isIntra( *tu.cu ) )
......@@ -2293,17 +2241,12 @@ void CABACWriter::residual_coding( const TransformUnit& tu, ComponentID compID )
emt_tu_index( tu );
}
}
#endif
}
void CABACWriter::transform_skip_flag( const TransformUnit& tu, ComponentID compID )
{
#if HM_EMT_NSST_AS_IN_JEM
if( !tu.cu->cs->pps->getUseTransformSkip() || tu.cu->transQuantBypass || !TU::hasTransformSkipFlag( *tu.cs, tu.blocks[compID] ) || ( isLuma( compID ) && tu.cu->emtFlag ) )
#else
if( !tu.cu->cs->pps->getUseTransformSkip() || tu.cu->transQuantBypass || !TU::hasTransformSkipFlag( *tu.cs, tu.blocks[compID] ) )
#endif
{
return;
}
......
......@@ -152,9 +152,6 @@ public:
void transform_unit ( const TransformUnit& tu, CUCtx& cuCtx, ChromaCbfs& chromaCbfs );
void cu_qp_delta ( const CodingUnit& cu, int predQP, const int8_t qp );
void cu_chroma_qp_offset ( const CodingUnit& cu );
#if !HM_EMT_NSST_AS_IN_JEM
void cu_emt_pertu_idx ( const CodingUnit& cu );
#endif
// residual coding (clause 7.3.8.11)
void residual_coding ( const TransformUnit& tu, ComponentID compID );
......
......@@ -1353,11 +1353,7 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
const PPS &pps = *tempCS->pps;
const CodingUnit *bestCU = bestCS->getCU( partitioner.chType );
const int maxSizeEMT = EMT_INTRA_MAX_CU_WITH_QTBT;
#if HM_EMT_NSST_AS_IN_JEM
uint8_t considerEmtSecondPass = ( sps.getSpsNext().getUseIntraEMT() && isLuma( partitioner.chType ) && partitioner.currArea().lwidth() <= maxSizeEMT && partitioner.currArea().lheight() <= maxSizeEMT ) ? 1 : 0;
#else
uint8_t considerEmtSecondPass = ( sps.getSpsNext().getUseIntraEMT() && isLuma( partitioner.chType ) && partitioner.currArea().lwidth() <= maxSizeEMT && partitioner.currArea().lheight() <= maxSizeEMT && nsstIdx == 0 ) ? 1 : 0;
#endif
Distortion interHad = m_modeCtrl->getInterHad();
......@@ -1764,10 +1760,6 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
static_vector<unsigned, MRG_MAX_NUM_CANDS> RdModeList;
bool mrgTempBufSet = false;
#if DMVR_JVET_LOW_LATENCY_K0217
Mv refinedMvdL0[MRG_MAX_NUM_CANDS];
#endif
for( unsigned i = 0; i < MRG_MAX_NUM_CANDS; i++ )
{
RdModeList.push_back( i );
......@@ -1911,9 +1903,6 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
{
mergeCtx.mvFieldNeighbours[2*uiMergeCand].mv = pu.mv[0];
mergeCtx.mvFieldNeighbours[2*uiMergeCand+1].mv = pu.mv[1];
#if DMVR_JVET_LOW_LATENCY_K0217
refinedMvdL0[uiMergeCand] = pu.mvd[0];
#endif
}
Distortion uiSad = distParam.distFunc(distParam);
......@@ -2370,9 +2359,6 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
if( mrgTempBufSet )
{
#if DMVR_JVET_LOW_LATENCY_K0217
pu.mvd[0] = refinedMvdL0[uiMergeCand];
#endif
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
if (pu.mhIntraFlag)
{
......
......@@ -2113,10 +2113,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
m_pcLoopFilter->loopFilterPic( cs );
#if DMVR_JVET_LOW_LATENCY_K0217
CS::setRefinedMotionField(cs);
#endif
DTRACE_UPDATE( g_trace_ctx, ( std::make_pair( "final", 1 ) ) );
if( pcSlice->getSPS()->getUseSAO() )
......
......@@ -1132,9 +1132,7 @@ void IntraSearch::xEncSubdivCbfQT(CodingStructure &cs, Partitioner &partitioner,
{
const UnitArea &currArea = partitioner.currArea();
TransformUnit &currTU = *cs.getTU( currArea.blocks[partitioner.chType], partitioner.chType );
#if HM_EMT_NSST_AS_IN_JEM
CodingUnit &currCU = *currTU.cu;
#endif
uint32_t currDepth = partitioner.currTrDepth;
const bool subdiv = currTU.depth > currDepth;
......@@ -1167,9 +1165,7 @@ void IntraSearch::xEncSubdivCbfQT(CodingStructure &cs, Partitioner &partitioner,
if (subdiv)
{
#if HM_EMT_NSST_AS_IN_JEM
if( currDepth == 0 && bLuma ) m_CABACEstimator->emt_cu_flag( currCU );
#endif
if( partitioner.canSplit( TU_MAX_TR_SPLIT, cs ) )
{
......@@ -1187,10 +1183,8 @@ void IntraSearch::xEncSubdivCbfQT(CodingStructure &cs, Partitioner &partitioner,
}
else
{
#if HM_EMT_NSST_AS_IN_JEM
if( currDepth == 0 && bLuma && TU::getCbfAtDepth( currTU, COMPONENT_Y, 0 ) ) m_CABACEstimator->emt_cu_flag( currCU );
#endif
//===== Cbfs =====
if (bLuma)
{
......
Supports Markdown
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