Commit 45a53f22 authored by Karsten Suehring's avatar Karsten Suehring

remove SPSNext extension and sort SPS

- all elements of SPSNext are moved into SPS
- syntax elements of SPS are sorted according to draft (as far as possible)
- comments were added where software and draft diverge
parent afd7ed42
......@@ -349,7 +349,7 @@ unsigned DeriveCtx::CtxQtCbf( const ComponentID compID, const unsigned trDepth,
unsigned DeriveCtx::CtxInterDir( const PredictionUnit& pu )
{
if( pu.cs->sps->getSpsNext().getUseLargeCTU() )
if( pu.cs->sps->getUseLargeCTU() )
{
return Clip3( 0, 3, 7 - ( ( g_aucLog2[pu.lumaSize().width] + g_aucLog2[pu.lumaSize().height] + 1 ) >> 1 ) ); // VG-ASYMM DONE
}
......
......@@ -516,7 +516,7 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
}
#endif
if (pu.cu->cs->sps->getSpsNext().getUseGBi() && bioApplied && pu.cu->GBiIdx != GBI_DEFAULT)
if (pu.cu->cs->sps->getUseGBi() && bioApplied && pu.cu->GBiIdx != GBI_DEFAULT)
{
bioApplied = false;
}
......
......@@ -1639,7 +1639,7 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
}
}
#if JVET_M0142_CCLM_COLLOCATED_CHROMA
else if( pu.cs->sps->getSpsNext().getCclmCollocatedChromaFlag() )
else if( pu.cs->sps->getCclmCollocatedChromaFlag() )
{
piSrc = pRecSrc0 - iRecStride2;
......@@ -1686,7 +1686,7 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
for (int j = 0; j < uiCHeight + addedLeftBelow; j++)
{
#if JVET_M0142_CCLM_COLLOCATED_CHROMA
if( pu.cs->sps->getSpsNext().getCclmCollocatedChromaFlag() )
if( pu.cs->sps->getCclmCollocatedChromaFlag() )
{
if( j == 0 && !bAboveAvaillable )
{
......@@ -1722,7 +1722,7 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
for( int i = 0; i < uiCWidth; i++ )
{
#if JVET_M0142_CCLM_COLLOCATED_CHROMA
if( pu.cs->sps->getSpsNext().getCclmCollocatedChromaFlag() )
if( pu.cs->sps->getCclmCollocatedChromaFlag() )
{
if( i == 0 && !bLeftAvaillable )
{
......
......@@ -696,7 +696,7 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
void LoopFilter::deriveLADFShift( const Pel* src, const int stride, int& shift, const DeblockEdgeDir edgeDir, const SPS sps )
{
uint32_t lumaLevel = 0;
shift = sps.getSpsNext().getLadfQpOffset(0);
shift = sps.getLadfQpOffset(0);
if (edgeDir == EDGE_VER)
{
......@@ -707,12 +707,12 @@ void LoopFilter::deriveLADFShift( const Pel* src, const int stride, int& shift,
lumaLevel = (src[0] + src[3] + src[-stride] + src[-stride + 3]) >> 2;
}
for ( int k = 1; k < sps.getSpsNext().getLadfNumIntervals(); k++ )
for ( int k = 1; k < sps.getLadfNumIntervals(); k++ )
{
const int th = sps.getSpsNext().getLadfIntervalLowerBound( k );
const int th = sps.getLadfIntervalLowerBound( k );
if ( lumaLevel > th )
{
shift = sps.getSpsNext().getLadfQpOffset( k );
shift = sps.getLadfQpOffset( k );
}
else
{
......@@ -816,7 +816,7 @@ void LoopFilter::xEdgeFilterLuma(const CodingUnit& cu, const DeblockEdgeDir edge
iQP = (cuP.qp + cuQ.qp + 1) >> 1;
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
if ( sps.getSpsNext().getLadfEnabled() )
if ( sps.getLadfEnabled() )
{
int iShift = 0;
deriveLADFShift( piTmpSrc + iSrcStep * (iIdx*pelsInPart), iStride, iShift, edgeDir, sps );
......
......@@ -451,7 +451,7 @@ void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool b
}
}
#if JVET_M0483_IBC==0
if (getSPS()->getSpsNext().getIBCMode())
if (getSPS()->getIBCMode())
{
RefPicSetLtCurr[NumPicLtCurr] = getPic();
//getPic()->setIsLongTerm(true);
......@@ -472,7 +472,7 @@ void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool b
if (getRapPicFlag())
{
#if JVET_M0483_IBC==0
if (getSPS()->getSpsNext().getIBCMode())
if (getSPS()->getIBCMode())
{
CHECK(numPicTotalCurr != 1, "Invalid state");
}
......@@ -549,7 +549,7 @@ void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool b
}
}
#if JVET_M0483_IBC==0
if (getSPS()->getSpsNext().getIBCMode())
if (getSPS()->getIBCMode())
{
m_apcRefPicList[REF_PIC_LIST_0][m_aiNumRefIdx[REF_PIC_LIST_0] - 1] = getPic();
m_bIsUsedAsLongTerm[REF_PIC_LIST_0][m_aiNumRefIdx[REF_PIC_LIST_0] - 1] = true;
......@@ -588,7 +588,7 @@ int Slice::getNumRpsCurrTempList() const
#if JVET_M0483_IBC
if (getSPS()->getIBCFlag())
#else
if (getSPS()->getSpsNext().getIBCMode())
if (getSPS()->getIBCMode())
#endif
{
return numRpsCurrTempList + 1;
......@@ -1883,51 +1883,6 @@ SPSRExt::SPSRExt()
}
SPSNext::SPSNext( SPS& sps )
: m_SPS ( sps )
, m_NextEnabled ( false )
// disable all tool enabling flags by default
, m_LargeCTU ( false )
, m_IMV ( false )
, m_DisableMotionCompression ( false )
, m_LMChroma ( false )
#if JVET_M0142_CCLM_COLLOCATED_CHROMA
, m_cclmCollocatedChromaFlag ( false )
#endif
#if JVET_M0464_UNI_MTS
, m_IntraMTS ( false )
, m_InterMTS ( false )
#else
, m_IntraEMT ( false )
, m_InterEMT ( false )
#endif
, m_Affine ( false )
, m_AffineType ( false )
, m_MTTEnabled ( false )
, m_MHIntra ( false )
, m_Triangle ( false )
#if ENABLE_WPP_PARALLELISM
, m_NextDQP ( false )
#endif
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
, m_LadfEnabled ( false )
, m_LadfNumIntervals ( 0 )
, m_LadfQpOffset { 0 }
, m_LadfIntervalLowerBound { 0 }
#endif
// default values for additional parameters
, m_ImvMode ( IMV_OFF )
, m_MTTMode ( 0 )
, m_compositeRefEnabled ( false )
#if !JVET_M0483_IBC
, m_IBCMode ( 0 )
#endif
// ADD_NEW_TOOL : (sps extension) add tool enabling flags here (with "false" as default values)
{
}
SPS::SPS()
: m_SPSId ( 0)
, m_bIntraOnlyConstraintFlag (false)
......@@ -2003,7 +1958,6 @@ SPS::SPS()
#endif
, m_vuiParametersPresentFlag (false)
, m_vuiParameters ()
, m_spsNextExtension (*this)
, m_wrapAroundEnabledFlag (false)
, m_wrapAroundOffset ( 0)
#if JVET_M0483_IBC
......@@ -2012,6 +1966,44 @@ SPS::SPS()
#if JVET_M0427_INLOOP_RESHAPER
, m_lumaReshapeEnable (false)
#endif
// KJS: BEGIN former SPSNext parameters
, m_LargeCTU ( false )
, m_IMV ( false )
, m_DisableMotionCompression ( false )
, m_LMChroma ( false )
#if JVET_M0142_CCLM_COLLOCATED_CHROMA
, m_cclmCollocatedChromaFlag ( false )
#endif
#if JVET_M0464_UNI_MTS
, m_IntraMTS ( false )
, m_InterMTS ( false )
#else
, m_IntraEMT ( false )
, m_InterEMT ( false )
#endif
, m_Affine ( false )
, m_AffineType ( false )
, m_MTTEnabled ( false )
, m_MHIntra ( false )
, m_Triangle ( false )
#if ENABLE_WPP_PARALLELISM
, m_NextDQP ( false )
#endif
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
, m_LadfEnabled ( false )
, m_LadfNumIntervals ( 0 )
, m_LadfQpOffset { 0 }
, m_LadfIntervalLowerBound { 0 }
#endif
// default values for additional parameters
, m_ImvMode ( IMV_OFF )
, m_MTTMode ( 0 )
, m_compositeRefEnabled ( false )
#if !JVET_M0483_IBC
, m_IBCMode ( 0 )
#endif
// KJS: END former SPSNext parameters
{
for(int ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
{
......
This diff is collapsed.
......@@ -293,13 +293,13 @@ void TrQuant::invRdpcmNxN(TransformUnit& tu, const ComponentID &compID, PelBuf &
void TrQuant::getTrTypes ( TransformUnit tu, const ComponentID compID, int &trTypeHor, int &trTypeVer )
{
#if JVET_M0464_UNI_MTS
bool mtsActivated = CU::isIntra( *tu.cu ) ? tu.cs->sps->getSpsNext().getUseIntraMTS() : tu.cs->sps->getSpsNext().getUseInterMTS();
bool mtsActivated = CU::isIntra( *tu.cu ) ? tu.cs->sps->getUseIntraMTS() : tu.cs->sps->getUseInterMTS();
#else
bool emtActivated = CU::isIntra( *tu.cu ) ? tu.cs->sps->getSpsNext().getUseIntraEMT() : tu.cs->sps->getSpsNext().getUseInterEMT();
bool emtActivated = CU::isIntra( *tu.cu ) ? tu.cs->sps->getUseIntraEMT() : tu.cs->sps->getUseInterEMT();
#endif
#if JVET_M0303_IMPLICIT_MTS
bool mtsImplicit = CU::isIntra( *tu.cu ) && tu.cs->sps->getSpsNext().getUseImplicitMTS() && compID == COMPONENT_Y;
bool mtsImplicit = CU::isIntra( *tu.cu ) && tu.cs->sps->getUseImplicitMTS() && compID == COMPONENT_Y;
#endif
trTypeHor = DCT2;
......
......@@ -249,7 +249,7 @@ void QTBTPartitioner::splitCurrArea( const PartSplit split, const CodingStructur
break;
case CU_TRIH_SPLIT:
case CU_TRIV_SPLIT:
CHECK( ( cs.sps->getSpsNext().getMTTMode() & 1 ) != 1, "Triple splits are not allowed" );
CHECK( ( cs.sps->getMTTMode() & 1 ) != 1, "Triple splits are not allowed" );
m_partStack.push_back( PartLevel( split, PartitionerImpl::getCUSubPartitions( currArea(), cs, split ) ) );
break;
case TU_MAX_TR_SPLIT:
......@@ -359,13 +359,13 @@ void QTBTPartitioner::canSplit( const CodingStructure &cs, bool& canNo, bool& ca
if( canBtt && ( area.width <= minBtSize && area.height <= minBtSize )
&& ( ( area.width <= minTtSize && area.height <= minTtSize )
|| cs.sps->getSpsNext().getMTTMode() == 0 ) )
|| cs.sps->getMTTMode() == 0 ) )
{
canBtt = false;
}
if( canBtt && ( area.width > maxBtSize || area.height > maxBtSize )
&& ( ( area.width > maxTtSize || area.height > maxTtSize )
|| cs.sps->getSpsNext().getMTTMode() == 0 ) )
|| cs.sps->getMTTMode() == 0 ) )
{
canBtt = false;
}
......@@ -384,12 +384,12 @@ void QTBTPartitioner::canSplit( const CodingStructure &cs, bool& canNo, bool& ca
if( area.width <= minBtSize || area.width > maxBtSize ) canBv = false;
if( area.width <= MAX_TU_SIZE_FOR_PROFILE && area.height > MAX_TU_SIZE_FOR_PROFILE ) canBv = false;
if( ( cs.sps->getSpsNext().getMTTMode() & 1 ) != 1 ) canTh = false;
if( ( cs.sps->getMTTMode() & 1 ) != 1 ) canTh = false;
if( area.height <= 2 * minTtSize || area.height > maxTtSize || area.width > maxTtSize )
canTh = false;
if( area.width > MAX_TU_SIZE_FOR_PROFILE || area.height > MAX_TU_SIZE_FOR_PROFILE ) canTh = false;
if( ( cs.sps->getSpsNext().getMTTMode() & 1 ) != 1 ) canTv = false;
if( ( cs.sps->getMTTMode() & 1 ) != 1 ) canTv = false;
if( area.width <= 2 * minTtSize || area.width > maxTtSize || area.height > maxTtSize )
canTv = false;
if( area.width > MAX_TU_SIZE_FOR_PROFILE || area.height > MAX_TU_SIZE_FOR_PROFILE ) canTv = false;
......@@ -515,9 +515,9 @@ bool QTBTPartitioner::canSplit( const PartSplit split, const CodingStructure &cs
{
if( currMtDepth >= maxBTD ) return false;
if( ( area.width <= minBtSize && area.height <= minBtSize )
&& ( ( area.width <= minTtSize && area.height <= minTtSize ) || cs.sps->getSpsNext().getMTTMode() == 0 ) ) return false;
&& ( ( area.width <= minTtSize && area.height <= minTtSize ) || cs.sps->getMTTMode() == 0 ) ) return false;
if( ( area.width > maxBtSize || area.height > maxBtSize )
&& ( ( area.width > maxTtSize || area.height > maxTtSize ) || cs.sps->getSpsNext().getMTTMode() == 0 ) ) return false;
&& ( ( area.width > maxTtSize || area.height > maxTtSize ) || cs.sps->getMTTMode() == 0 ) ) return false;
if (CS::isDualITree(cs) && (area.width > 64 || area.height > 64))
{
return false;
......@@ -543,12 +543,12 @@ bool QTBTPartitioner::canSplit( const PartSplit split, const CodingStructure &cs
if( area.width <= MAX_TU_SIZE_FOR_PROFILE && area.height > MAX_TU_SIZE_FOR_PROFILE ) return false;
break;
case CU_TRIH_SPLIT:
if( ( cs.sps->getSpsNext().getMTTMode() & 1 ) != 1 ) return false;
if( ( cs.sps->getMTTMode() & 1 ) != 1 ) return false;
if( area.height <= 2 * minTtSize || area.height > maxTtSize || area.width > maxTtSize) return false;
if( area.width > MAX_TU_SIZE_FOR_PROFILE || area.height > MAX_TU_SIZE_FOR_PROFILE ) return false;
break;
case CU_TRIV_SPLIT:
if( ( cs.sps->getSpsNext().getMTTMode() & 1 ) != 1 ) return false;
if( ( cs.sps->getMTTMode() & 1 ) != 1 ) return false;
if( area.width <= 2 * minTtSize || area.width > maxTtSize || area.height > maxTtSize) return false;
if( area.width > MAX_TU_SIZE_FOR_PROFILE || area.height > MAX_TU_SIZE_FOR_PROFILE ) return false;
break;
......@@ -1208,4 +1208,4 @@ Partitioning PartitionerImpl::getSbtTuTiling( const UnitArea& cuArea, const Codi
return ret;
}
#endif
\ No newline at end of file
#endif
......@@ -190,7 +190,7 @@ int CU::predictQP( const CodingUnit& cu, const int prevQP )
const CodingStructure &cs = *cu.cs;
#if ENABLE_WPP_PARALLELISM
if( cs.sps->getSpsNext().getUseNextDQP() )
if( cs.sps->getUseNextDQP() )
{
// Inter-CTU 2D "planar" c(orner) a(bove)
// predictor arrangement: b(efore) p(rediction)
......@@ -799,7 +799,7 @@ bool PU::isLMCMode(unsigned mode)
}
bool PU::isLMCModeEnabled(const PredictionUnit &pu, unsigned mode)
{
if ( pu.cs->sps->getSpsNext().getUseLMChroma() )
if ( pu.cs->sps->getUseLMChroma() )
{
return true;
}
......@@ -1915,7 +1915,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
if (cnt > 1 && cnt < maxNumMergeCand)
#else
// skip when only 1 candidate is added so far or one is BV and one is MV
if( cnt > 1 && cnt < maxNumMergeCand && !(mrgCtx.mrgTypeNeighbours[0] != mrgCtx.mrgTypeNeighbours[1] && pu.cs->sps->getSpsNext().getIBCMode()))
if( cnt > 1 && cnt < maxNumMergeCand && !(mrgCtx.mrgTypeNeighbours[0] != mrgCtx.mrgTypeNeighbours[1] && pu.cs->sps->getIBCMode()))
#endif
#else
for( int idx = 0; idx < end && cnt != maxNumMergeCand; idx++ )
......@@ -1934,7 +1934,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
#if !JVET_M0193_PAIR_AVG_REDUCTION && JVET_M0483_IBC==0
// skip when one is BV and one is MV
if (mrgCtx.mrgTypeNeighbours[i] != mrgCtx.mrgTypeNeighbours[j] && pu.cs->sps->getSpsNext().getIBCMode())
if (mrgCtx.mrgTypeNeighbours[i] != mrgCtx.mrgTypeNeighbours[j] && pu.cs->sps->getIBCMode())
{
continue;
}
......@@ -1979,9 +1979,9 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
#if JVET_M0483_IBC==0
#if JVET_M0193_PAIR_AVG_REDUCTION
if (mrgCtx.mrgTypeNeighbours[0] == MRG_TYPE_IBC && mrgCtx.mrgTypeNeighbours[1] == MRG_TYPE_IBC && pu.cs->sps->getSpsNext().getIBCMode())
if (mrgCtx.mrgTypeNeighbours[0] == MRG_TYPE_IBC && mrgCtx.mrgTypeNeighbours[1] == MRG_TYPE_IBC && pu.cs->sps->getIBCMode())
#else
if (mrgCtx.mrgTypeNeighbours[i] == MRG_TYPE_IBC && mrgCtx.mrgTypeNeighbours[j] == MRG_TYPE_IBC && pu.cs->sps->getSpsNext().getIBCMode())
if (mrgCtx.mrgTypeNeighbours[i] == MRG_TYPE_IBC && mrgCtx.mrgTypeNeighbours[j] == MRG_TYPE_IBC && pu.cs->sps->getIBCMode())
#endif
{
mrgCtx.mrgTypeNeighbours[cnt] = MRG_TYPE_IBC;
......@@ -4003,7 +4003,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
}
}
if ( slice.getSPS()->getSpsNext().getUseAffine() )
if ( slice.getSPS()->getUseAffine() )
{
///> Start: inherited affine candidates
const PredictionUnit* npu[5];
......@@ -4189,7 +4189,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
};
int verNum[6] = { 3, 3, 3, 3, 2, 2 };
int startIdx = pu.cs->sps->getSpsNext().getUseAffineType() ? 0 : 4;
int startIdx = pu.cs->sps->getUseAffineType() ? 0 : 4;
for ( int idx = startIdx; idx < modelNum; idx++ )
{
int modelIdx = order[idx];
......@@ -4422,7 +4422,7 @@ bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, b
)
{
#if !JVET_M0409_ATMVP_FIX && JVET_M0483_IBC==0
if (count == countIBC && pu.cs->slice->getSPS()->getSpsNext().getIBCMode())
if (count == countIBC && pu.cs->slice->getSPS()->getIBCMode())
return false;
#endif
const Slice &slice = *pu.cs->slice;
......@@ -4547,7 +4547,7 @@ bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, b
mi.isIBCmot = false;
if (colMi.isInter && colMi.isIBCmot == false)
#else
if (colMi.isInter && !((colMi.interDir == 1 || colMi.interDir == 3) && (pColPic->cs->slice->getRefPOC(REF_PIC_LIST_0, colMi.refIdx[0]) == pColPic->cs->slice->getPOC()) && pu.cs->sps->getSpsNext().getIBCMode()))
if (colMi.isInter && !((colMi.interDir == 1 || colMi.interDir == 3) && (pColPic->cs->slice->getRefPOC(REF_PIC_LIST_0, colMi.refIdx[0]) == pColPic->cs->slice->getPOC()) && pu.cs->sps->getIBCMode()))
#endif
{
for (unsigned currRefListId = 0; currRefListId < (bBSlice ? 2 : 1); currRefListId++)
......@@ -5619,7 +5619,7 @@ bool CU::isSameSbtSize( const uint8_t sbtInfo1, const uint8_t sbtInfo2 )
bool CU::isGBiIdxCoded( const CodingUnit &cu )
{
if( cu.cs->sps->getSpsNext().getUseGBi() == false )
if( cu.cs->sps->getUseGBi() == false )
{
CHECK(cu.GBiIdx != GBI_DEFAULT, "Error: cu.GBiIdx != GBI_DEFAULT");
return false;
......@@ -5776,7 +5776,7 @@ bool TU::isMTSAllowed(const TransformUnit &tu, const ComponentID compID)
bool mtsAllowed = compID == COMPONENT_Y;
const int maxSize = CU::isIntra( *tu.cu ) ? MTS_INTRA_MAX_CU_SIZE : MTS_INTER_MAX_CU_SIZE;
mtsAllowed &= CU::isIntra( *tu.cu ) ? tu.cs->sps->getSpsNext().getUseIntraMTS() : tu.cs->sps->getSpsNext().getUseInterMTS();
mtsAllowed &= CU::isIntra( *tu.cu ) ? tu.cs->sps->getUseIntraMTS() : tu.cs->sps->getUseInterMTS();
mtsAllowed &= ( tu.lwidth() <= maxSize && tu.lheight() <= maxSize );
#if JVET_M0102_INTRA_SUBPARTITIONS
mtsAllowed &= !tu.cu->ispMode;
......
......@@ -446,7 +446,7 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
}
#if !JVET_M0464_UNI_MTS
if (!(!((cs.sps->getSpsNext().getUseIntraEMT() && CU::isIntra(cu)) || (cs.sps->getSpsNext().getUseInterEMT() && CU::isInter(cu))) || isChroma(cu.chType)))
if (!(!((cs.sps->getUseIntraEMT() && CU::isIntra(cu)) || (cs.sps->getUseInterEMT() && CU::isInter(cu))) || isChroma(cu.chType)))
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::EMTFlag), cu.emtFlag);
}
......@@ -469,7 +469,7 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
}
#if !JVET_M0464_UNI_MTS
if (!(!((cs.sps->getSpsNext().getUseIntraEMT() && CU::isIntra(cu)) || (cs.sps->getSpsNext().getUseInterEMT() && CU::isInter(cu))) || isChroma(cu.chType)))
if (!(!((cs.sps->getUseIntraEMT() && CU::isIntra(cu)) || (cs.sps->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);
}
......@@ -863,13 +863,13 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::MMVDMergeIdx), pu.mmvdMergeIdx);
}
if (!cu.cs->slice->isIntra() && cu.cs->sps->getSpsNext().getUseAffine() && cu.lumaSize().width >= 8 && cu.lumaSize().height >= 8
if (!cu.cs->slice->isIntra() && cu.cs->sps->getUseAffine() && cu.lumaSize().width >= 8 && cu.lumaSize().height >= 8
&& !pu.mmvdMergeFlag && !cu.mmvdSkip
)
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::AffineFlag), pu.cu->affine);
}
if (pu.cs->sps->getSpsNext().getUseMHIntra() && !pu.cu->skip && !pu.cu->affine && !(pu.cu->lwidth() * pu.cu->lheight() < 64 || pu.cu->lwidth() >= MAX_CU_SIZE || pu.cu->lheight() >= MAX_CU_SIZE)
if (pu.cs->sps->getUseMHIntra() && !pu.cu->skip && !pu.cu->affine && !(pu.cu->lwidth() * pu.cu->lheight() < 64 || pu.cu->lwidth() >= MAX_CU_SIZE || pu.cu->lheight() >= MAX_CU_SIZE)
&& !pu.mmvdMergeFlag
)
{
......@@ -883,7 +883,7 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
}
}
}
if (cu.cs->slice->getSPS()->getSpsNext().getUseTriangle() && cu.cs->slice->isInterB() && cu.lwidth() * cu.lheight() >= TRIANGLE_MIN_SIZE && !cu.affine)
if (cu.cs->slice->getSPS()->getUseTriangle() && cu.cs->slice->isInterB() && cu.lwidth() * cu.lheight() >= TRIANGLE_MIN_SIZE && !cu.affine)
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, cu, GetBlockStatisticName(BlockStatistic::TriangleFlag), cu.triangle);
......@@ -895,10 +895,10 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::InterDir), pu.interDir);
}
if (!cu.cs->slice->isIntra() && cu.cs->sps->getSpsNext().getUseAffine() && cu.lumaSize().width > 8 && cu.lumaSize().height > 8)
if (!cu.cs->slice->isIntra() && cu.cs->sps->getUseAffine() && cu.lumaSize().width > 8 && cu.lumaSize().height > 8)
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::AffineFlag), pu.cu->affine);
if (cu.affine && !cu.firstPU->mergeFlag && cu.cs->sps->getSpsNext().getUseAffineType())
if (cu.affine && !cu.firstPU->mergeFlag && cu.cs->sps->getUseAffineType())
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::AffineType), pu.cu->affineType);
}
......@@ -995,7 +995,7 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
DTRACE_BLOCK_AFFINETF(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::AffineMVL1), mv[0].hor, mv[0].ver, mv[1].hor, mv[1].ver, mv[2].hor, mv[2].ver);
}
}
if (cu.cs->sps->getSpsNext().getUseIMV() && CU::hasSubCUNonZeroMVd(cu))
if (cu.cs->sps->getUseIMV() && CU::hasSubCUNonZeroMVd(cu))
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, cu, GetBlockStatisticName(BlockStatistic::IMVMode), cu.imv);
}
......@@ -1054,7 +1054,7 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
}
}
#if !JVET_M0464_UNI_MTS
if (!(!((cs.sps->getSpsNext().getUseIntraEMT() && CU::isIntra(cu)) || (cs.sps->getSpsNext().getUseInterEMT() && CU::isInter(cu))) || isChroma(cu.chType)))
if (!(!((cs.sps->getUseIntraEMT() && CU::isIntra(cu)) || (cs.sps->getUseInterEMT() && CU::isInter(cu))) || isChroma(cu.chType)))
{
if( isLuma( ChannelType( chType ) ) )
{
......
......@@ -1006,7 +1006,7 @@ void CABACReader::imv_mode( CodingUnit& cu, MergeCtx& mrgCtx )
{
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET( STATS__CABAC_BITS__OTHER );
if( !cu.cs->sps->getSpsNext().getUseIMV() )
if( !cu.cs->sps->getUseIMV() )
{
return;
}
......@@ -1024,7 +1024,7 @@ void CABACReader::imv_mode( CodingUnit& cu, MergeCtx& mrgCtx )
}
#endif
const SPSNext& spsNext = cu.cs->sps->getSpsNext();
const SPS *sps = cu.cs->sps;
unsigned value = 0;
unsigned ctxId = DeriveCtx::CtxIMVFlag( cu );
......@@ -1038,7 +1038,7 @@ void CABACReader::imv_mode( CodingUnit& cu, MergeCtx& mrgCtx )
value = m_BinDecoder.decodeBin( Ctx::ImvFlag( ctxId ) );
DTRACE( g_trace_ctx, D_SYNTAX, "imv_mode() value=%d ctx=%d\n", value, ctxId );
if( spsNext.getImvMode() == IMV_4PEL && value )
if( sps->getImvMode() == IMV_4PEL && value )
{
value = m_BinDecoder.decodeBin( Ctx::ImvFlag( 3 ) );
DTRACE( g_trace_ctx, D_SYNTAX, "imv_mode() value=%d ctx=%d\n", value, 3 );
......@@ -1443,7 +1443,7 @@ void CABACReader::intra_chroma_pred_mode( PredictionUnit& pu )
}
// LM chroma mode
if( pu.cs->sps->getSpsNext().getUseLMChroma() )
if( pu.cs->sps->getUseLMChroma() )
{
if( intra_chroma_lmc_mode( pu ) )
{
......@@ -1771,7 +1771,7 @@ void CABACReader::subblock_merge_flag( CodingUnit& cu )
return;
}
if ( !cu.cs->slice->isIntra() && (cu.cs->sps->getSpsNext().getUseAffine() || cu.cs->sps->getSBTMVPEnabledFlag()) && cu.lumaSize().width >= 8 && cu.lumaSize().height >= 8 )
if ( !cu.cs->slice->isIntra() && (cu.cs->sps->getUseAffine() || cu.cs->sps->getSBTMVPEnabledFlag()) && cu.lumaSize().width >= 8 && cu.lumaSize().height >= 8 )
{
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET( STATS__CABAC_BITS__AFFINE_FLAG );
......@@ -1783,7 +1783,7 @@ void CABACReader::subblock_merge_flag( CodingUnit& cu )
void CABACReader::affine_flag( CodingUnit& cu )
{
if ( !cu.cs->slice->isIntra() && cu.cs->sps->getSpsNext().getUseAffine() && cu.lumaSize().width > 8 && cu.lumaSize().height > 8 )
if ( !cu.cs->slice->isIntra() && cu.cs->sps->getUseAffine() && cu.lumaSize().width > 8 && cu.lumaSize().height > 8 )
{
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET( STATS__CABAC_BITS__AFFINE_FLAG );
......@@ -1791,7 +1791,7 @@ void CABACReader::affine_flag( CodingUnit& cu )
cu.affine = m_BinDecoder.decodeBin( Ctx::AffineFlag( ctxId ) );
DTRACE( g_trace_ctx, D_SYNTAX, "affine_flag() affine=%d ctx=%d pos=(%d,%d)\n", cu.affine ? 1 : 0, ctxId, cu.Y().x, cu.Y().y );
if ( cu.affine && cu.cs->sps->getSpsNext().getUseAffineType() )
if ( cu.affine && cu.cs->sps->getUseAffineType() )
{
ctxId = 0;
cu.affineType = m_BinDecoder.decodeBin( Ctx::AffineType( ctxId ) );
......@@ -2109,7 +2109,7 @@ void CABACReader::mvp_flag( PredictionUnit& pu, RefPicList eRefList )
void CABACReader::MHIntra_flag(PredictionUnit& pu)
{
if (!pu.cs->sps->getSpsNext().getUseMHIntra())
if (!pu.cs->sps->getUseMHIntra())
{
pu.mhIntraFlag = false;
return;
......@@ -2239,7 +2239,7 @@ void CABACReader::triangle_mode( CodingUnit& cu )
{
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET( STATS__CABAC_BITS__TRIANGLE_FLAG );
if( !cu.cs->slice->getSPS()->getSpsNext().getUseTriangle() || !cu.cs->slice->isInterB() || cu.lwidth() * cu.lheight() < TRIANGLE_MIN_SIZE || cu.affine )
if( !cu.cs->slice->getSPS()->getUseTriangle() || !cu.cs->slice->isInterB() || cu.lwidth() * cu.lheight() < TRIANGLE_MIN_SIZE || cu.affine )
{
return;
}
......@@ -2799,7 +2799,7 @@ void CABACReader::residual_coding( TransformUnit& tu, ComponentID compID )
int state = 0;
#if !JVET_M0464_UNI_MTS
bool useEmt = ( cu.cs->sps->getSpsNext().getUseIntraEMT() && cu.predMode == MODE_INTRA ) || ( cu.cs->sps->getSpsNext().getUseInterEMT() && cu.predMode != MODE_INTRA );
bool useEmt = ( cu.cs->sps->getUseIntraEMT() && cu.predMode == MODE_INTRA ) || ( cu.cs->sps->getUseInterEMT() && cu.predMode != MODE_INTRA );
useEmt = useEmt && isLuma(compID);
#if JVET_M0102_INTRA_SUBPARTITIONS
useEmt = useEmt && !cu.ispMode;
......@@ -2945,9 +2945,9 @@ void CABACReader::emt_cu_flag( CodingUnit& cu )
const CodingStructure &cs = *cu.cs;
#if JVET_M0483_IBC
if (!((cs.sps->getSpsNext().getUseIntraEMT() && CU::isIntra(cu)) || (cs.sps->getSpsNext().getUseInterEMT() && !CU::isIntra(cu))) || isChroma(cu.chType))
if (!((cs.sps->getUseIntraEMT() && CU::isIntra(cu)) || (cs.sps->getUseInterEMT() && !CU::isIntra(cu))) || isChroma(cu.chType))
#else
if( !( ( cs.sps->getSpsNext().getUseIntraEMT() && CU::isIntra( cu ) ) || ( cs.sps->getSpsNext().getUseInterEMT() && CU::isInter( cu ) ) ) || isChroma( cu.chType ) )
if( !( ( cs.sps->getUseIntraEMT() && CU::isIntra( cu ) ) || ( cs.sps->getUseInterEMT() && CU::isInter( cu ) ) ) || isChroma( cu.chType ) )
#endif
{
return;
......
......@@ -217,7 +217,7 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
#if JVET_M0483_IBC
bool flag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()));
#else
bool flag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()) || (slice.getSliceType() == P_SLICE && slice.getSPS()->getSpsNext().getIBCMode()));
bool flag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()) || (slice.getSliceType() == P_SLICE && slice.getSPS()->getIBCMode()));
#endif
if (flag && slice.getReshapeInfo().getSliceReshapeChromaAdj() && (compID != COMPONENT_Y))
{
......@@ -280,7 +280,7 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
#if JVET_M0483_IBC
if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y)
#else
if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra() || (slice.getSliceType() == P_SLICE && slice.getSPS()->getSpsNext().getIBCMode())) && compID == COMPONENT_Y)
if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra() || (slice.getSliceType() == P_SLICE && slice.getSPS()->getIBCMode())) && compID == COMPONENT_Y)
#endif
{
#if REUSE_CU_RESULTS
......@@ -303,7 +303,7 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
#if JVET_M0483_IBC
if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y)
#else
if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra() || (slice.getSliceType() == P_SLICE && slice.getSPS()->getSpsNext().getIBCMode())) && compID == COMPONENT_Y)
if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra() || (slice.getSliceType() == P_SLICE && slice.getSPS()->getIBCMode())) && compID == COMPONENT_Y)
#endif
{
#if REUSE_CU_RESULTS
......
......@@ -1302,7 +1302,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
#if JVET_M0483_IBC
if (pcSlice->getSPS()->getIBCFlag() && pcSlice->getEnableTMVPFlag())
#else
if (pcSlice->getSPS()->getSpsNext().getIBCMode() && pcSlice->getEnableTMVPFlag())
if (pcSlice->getSPS()->getIBCMode() && pcSlice->getEnableTMVPFlag())
#endif
{
CHECK(pcSlice->getRefPic(RefPicList(pcSlice->isInterB() ? 1 - pcSlice->getColFromL0Flag() : 0), pcSlice->getColRefIdx())->getPOC() == pcSlice->getPOC(), "curr ref picture cannot be collocated picture");
......@@ -1323,7 +1323,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
#if JVET_M0483_IBC
if ((pcSlice->getSliceType() == I_SLICE) && m_cReshaper.getSliceReshaperInfo().getUseSliceReshaper())
#else
if ((pcSlice->getSliceType() == I_SLICE || (pcSlice->getSliceType() == P_SLICE && pcSlice->getSPS()->getSpsNext().getIBCMode())) && m_cReshaper.getSliceReshaperInfo().getUseSliceReshaper())
if ((pcSlice->getSliceType() == I_SLICE || (pcSlice->getSliceType() == P_SLICE && pcSlice->getSPS()->getIBCMode())) && m_cReshaper.getSliceReshaperInfo().getUseSliceReshaper())
#endif