Commit 48a8d410 authored by Yu Han's avatar Yu Han

Code clean and remove spsNext

parent c16d1f29
......@@ -750,7 +750,7 @@ void CodingStructure::useSubStructure( const CodingStructure& subStruct, const C
if( cpyReco ) picture->getRecoBuf( clippedArea ).copyFrom( subRecoBuf );
#if JVET_M0483_IBC
if (!subStruct.m_isTuEnc && ((!slice->isIntra() || slice->getSPS()->getSpsNext().getIBCMode()) && subStruct.chType != CHANNEL_TYPE_CHROMA))
if (!subStruct.m_isTuEnc && ((!slice->isIntra() || slice->getSPS()->getIBCFlag()) && subStruct.chType != CHANNEL_TYPE_CHROMA))
#else
if (!subStruct.m_isTuEnc && (!slice->isIntra() && subStruct.chType != CHANNEL_TYPE_CHROMA))
#endif
......@@ -934,7 +934,7 @@ void CodingStructure::copyStructure( const CodingStructure& other, const Channel
}
#if JVET_M0483_IBC
if (!other.slice->isIntra() || other.slice->getSPS()->getSpsNext().getIBCMode())
if (!other.slice->isIntra() || other.slice->getSPS()->getIBCFlag())
#else
if( !other.slice->isIntra() )
#endif
......@@ -993,7 +993,7 @@ void CodingStructure::initStructData( const int &QP, const bool &_isLosses, cons
}
#if JVET_M0483_IBC
if (!skipMotBuf && (!parent || ((!slice->isIntra() || slice->getSPS()->getSpsNext().getIBCMode()) && !m_isTuEnc)))
if (!skipMotBuf && (!parent || ((!slice->isIntra() || slice->getSPS()->getIBCFlag()) && !m_isTuEnc)))
#else
if( !skipMotBuf && ( !parent || ( ( slice->getSliceType() != I_SLICE ) && !m_isTuEnc ) ) )
#endif
......
......@@ -498,7 +498,7 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
if (CU::isIBC(*pu.cu))
{
pu.bv = pu.mv[REF_PIC_LIST_0];
pu.bv >>= (2 + MV_FRACTIONAL_BITS_DIFF); // used for only integer resolution
pu.bv.changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_INT); // used for only integer resolution
}
#else
if (interDirNeighbours[candIdx] == 1 && pu.cs->slice->getRefPic(REF_PIC_LIST_0, mvFieldNeighbours[candIdx << 1].refIdx)->getPOC() == pu.cs->slice->getPOC())
......
......@@ -576,7 +576,11 @@ int Slice::getNumRpsCurrTempList() const
numRpsCurrTempList++;
}
}
#if JVET_M0483_IBC
if (getSPS()->getIBCFlag())
#else
if (getSPS()->getSpsNext().getIBCMode())
#endif
{
return numRpsCurrTempList + 1;
}
......@@ -1785,7 +1789,7 @@ unsigned Slice::getMinPictureDistance() const
{
int minPicDist = MAX_INT;
#if JVET_M0483_IBC
if (getSPS()->getSpsNext().getIBCMode())
if (getSPS()->getIBCFlag())
{
minPicDist = 0;
}
......@@ -1972,6 +1976,9 @@ SPS::SPS()
, m_spsNextExtension (*this)
, m_wrapAroundEnabledFlag (false)
, m_wrapAroundOffset ( 0)
#if JVET_M0483_IBC
, m_IBCFlag ( 0)
#endif
{
for(int ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
{
......
......@@ -1033,6 +1033,9 @@ private:
bool m_wrapAroundEnabledFlag;
unsigned m_wrapAroundOffset;
#if JVET_M0483_IBC
unsigned m_IBCFlag;
#endif
public:
......@@ -1252,6 +1255,10 @@ public:
bool getWrapAroundEnabledFlag() const { return m_wrapAroundEnabledFlag; }
void setWrapAroundOffset(unsigned offset) { m_wrapAroundOffset = offset; }
unsigned getWrapAroundOffset() const { return m_wrapAroundOffset; }
#if JVET_M0483_IBC
void setIBCFlag(unsigned IBCFlag) { m_IBCFlag = IBCFlag; }
unsigned getIBCFlag() const { return m_IBCFlag; }
#endif
};
......
......@@ -3185,7 +3185,7 @@ void PU::addAMVPHMVPCand(const PredictionUnit &pu, const RefPicList eRefPicList,
const int neibRefIdx = neibMi.refIdx[eRefPicListIndex];
#if JVET_M0483_IBC
if (neibRefIdx >= 0 && (CU::isIBC(*pu.cu) || (CU::isIBC(*pu.cu) == false && currRefPOC == slice.getRefPOC(eRefPicListIndex, neibRefIdx))))
if (neibRefIdx >= 0 && (CU::isIBC(*pu.cu) || (currRefPOC == slice.getRefPOC(eRefPicListIndex, neibRefIdx))))
#else
if (neibRefIdx >= 0 && currRefPOC == slice.getRefPOC(eRefPicListIndex, neibRefIdx))
#endif
......
......@@ -886,7 +886,7 @@ bool CABACReader::coding_unit( CodingUnit &cu, Partitioner &partitioner, CUCtx&
// skip flag
#if JVET_M0483_IBC
if ((!cs.slice->isIntra() || cs.slice->getSPS()->getSpsNext().getIBCMode()) && cu.Y().valid())
if ((!cs.slice->isIntra() || cs.slice->getSPS()->getIBCFlag()) && cu.Y().valid())
#else
if (!cs.slice->isIntra() && cu.Y().valid())
#endif
......@@ -953,7 +953,7 @@ void CABACReader::cu_skip_flag( CodingUnit& cu )
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET( STATS__CABAC_BITS__SKIP_FLAG );
#if JVET_M0483_IBC
if (cu.slice->isIntra() && cu.cs->slice->getSPS()->getSpsNext().getIBCMode())
if (cu.slice->isIntra() && cu.cs->slice->getSPS()->getIBCFlag())
{
cu.skip = false;
cu.rootCbf = false;
......@@ -979,7 +979,7 @@ void CABACReader::cu_skip_flag( CodingUnit& cu )
DTRACE( g_trace_ctx, D_SYNTAX, "cu_skip_flag() ctx=%d skip=%d\n", ctxId, skip ? 1 : 0 );
#if JVET_M0483_IBC
if (skip && cu.cs->slice->getSPS()->getSpsNext().getIBCMode())
if (skip && cu.cs->slice->getSPS()->getIBCFlag())
{
unsigned ctxidx = DeriveCtx::CtxIBCFlag(cu);
if (m_BinDecoder.decodeBin(Ctx::IBCFlag(ctxidx)))
......@@ -995,8 +995,8 @@ void CABACReader::cu_skip_flag( CodingUnit& cu )
}
DTRACE(g_trace_ctx, D_SYNTAX, "ibc() ctx=%d cu.predMode=%d\n", ctxidx, cu.predMode);
}
if ((skip && CU::isInter(cu) && cu.cs->slice->getSPS()->getSpsNext().getIBCMode()) ||
(skip && !cu.cs->slice->getSPS()->getSpsNext().getIBCMode()))
if ((skip && CU::isInter(cu) && cu.cs->slice->getSPS()->getIBCFlag()) ||
(skip && !cu.cs->slice->getSPS()->getIBCFlag()))
#else
if( skip )
#endif
......@@ -1095,7 +1095,7 @@ void CABACReader::pred_mode( CodingUnit& cu )
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET( STATS__CABAC_BITS__PRED_MODE );
#if JVET_M0483_IBC
if (cu.cs->slice->getSPS()->getSpsNext().getIBCMode())
if (cu.cs->slice->getSPS()->getIBCFlag())
{
if (cu.cs->slice->isIntra())
{
......
......@@ -705,15 +705,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
pu.mvpNum [eRefList] = amvpInfo.numCand;
#if JVET_M0483_IBC==0
Mv mvd = pu.mvd[eRefList];
#if JVET_M0483_IBC
if (CU::isIBC(cu))
{
#if REUSE_CU_RESULTS
if (!cu.cs->pcv->isEncoder)
#endif
mvd <<= 2;
}
#else
if (eRefList == REF_PIC_LIST_0 && pu.cs->slice->getRefPic(eRefList, pu.refIdx[eRefList])->getPOC() == pu.cs->slice->getPOC())
{
pu.cu->ibc = true;
......@@ -722,7 +713,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
#endif
mvd.changePrecision(MV_PRECISION_INT, MV_PRECISION_QUARTER);
}
#endif
pu.mv [eRefList] = amvpInfo.mvCand[pu.mvpIdx[eRefList]] + mvd;
#else
pu.mv[eRefList] = amvpInfo.mvCand[pu.mvpIdx[eRefList]] + pu.mvd[eRefList];
......
......@@ -1228,7 +1228,11 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
}
#endif
#if JVET_M0483_IBC
if (pcSlice->getSPS()->getIBCFlag() && pcSlice->getEnableTMVPFlag())
#else
if (pcSlice->getSPS()->getSpsNext().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");
}
......
......@@ -811,7 +811,9 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
READ_FLAG( symbol, "affine_type_flag" ); spsNext.setUseAffineType ( symbol != 0 );
}
READ_FLAG( symbol, "gbi_flag" ); spsNext.setUseGBi ( symbol != 0 );
#if JVET_M0483_IBC==0
READ_FLAG( symbol, "ibc_flag"); spsNext.setIBCMode ( symbol != 0 );
#endif
for( int k = 0; k < SPSNext::NumReservedFlags; k++ )
{
READ_FLAG( symbol, "reserved_flag" ); if( symbol != 0 ) EXIT("Incompatible version: SPSNext reserved flag not equal to zero (bitstream was probably created with newer software version)" );
......@@ -877,6 +879,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
READ_FLAG(uiCode, "no_ladf_constraint_flag"); pcSPS->setNoLadfConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_dep_quant_constraint_flag"); pcSPS->setNoDepQuantConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_sign_data_hiding_constraint_flag"); pcSPS->setNoSignDataHidingConstraintFlag(uiCode > 0 ? true : false);
#if JVET_M0483_IBC
READ_FLAG(uiCode, "ibc_flag"); pcSPS->setIBCFlag(uiCode);
#endif
#if HEVC_VPS
READ_CODE( 4, uiCode, "sps_video_parameter_set_id"); pcSPS->setVPSId ( uiCode );
#endif
......@@ -1755,7 +1760,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
}
#if JVET_M0483_IBC
if (!pcSlice->isIntra() || sps->getSpsNext().getIBCMode())
if (!pcSlice->isIntra() || sps->getIBCFlag())
{
READ_UVLC(uiCode, "six_minus_max_num_merge_cand");
pcSlice->setMaxNumMergeCand(MRG_MAX_NUM_CANDS - uiCode);
......
......@@ -714,7 +714,7 @@ void CABACWriter::coding_unit( const CodingUnit& cu, Partitioner& partitioner, C
// skip flag
#if JVET_M0483_IBC
if ((!cs.slice->isIntra() || cs.slice->getSPS()->getSpsNext().getIBCMode()) && cu.Y().valid())
if ((!cs.slice->isIntra() || cs.slice->getSPS()->getIBCFlag()) && cu.Y().valid())
#else
if (!cs.slice->isIntra() && cu.Y().valid())
#endif
......@@ -772,7 +772,7 @@ void CABACWriter::cu_skip_flag( const CodingUnit& cu )
unsigned ctxId = DeriveCtx::CtxSkipFlag( cu );
#if JVET_M0483_IBC
if (cu.slice->isIntra() && cu.cs->slice->getSPS()->getSpsNext().getIBCMode())
if (cu.slice->isIntra() && cu.cs->slice->getSPS()->getIBCFlag())
{
m_BinEncoder.encodeBin((cu.skip), Ctx::SkipFlag(ctxId));
DTRACE(g_trace_ctx, D_SYNTAX, "cu_skip_flag() ctx=%d skip=%d\n", ctxId, cu.skip ? 1 : 0);
......@@ -784,7 +784,7 @@ void CABACWriter::cu_skip_flag( const CodingUnit& cu )
DTRACE( g_trace_ctx, D_SYNTAX, "cu_skip_flag() ctx=%d skip=%d\n", ctxId, cu.skip ? 1 : 0 );
#if JVET_M0483_IBC
if (cu.skip && cu.cs->slice->getSPS()->getSpsNext().getIBCMode())
if (cu.skip && cu.cs->slice->getSPS()->getIBCFlag())
{
unsigned ctxidx = DeriveCtx::CtxIBCFlag(cu);
m_BinEncoder.encodeBin(CU::isIBC(cu) ? 1 : 0, Ctx::IBCFlag(ctxidx));
......@@ -796,7 +796,7 @@ void CABACWriter::cu_skip_flag( const CodingUnit& cu )
DTRACE(g_trace_ctx, D_SYNTAX, "mmvd_cu_skip_flag() ctx=%d mmvd_skip=%d\n", 0, cu.mmvdSkip ? 1 : 0);
}
}
if (cu.skip && !cu.cs->slice->getSPS()->getSpsNext().getIBCMode())
if (cu.skip && !cu.cs->slice->getSPS()->getIBCFlag())
{
m_BinEncoder.encodeBin(cu.mmvdSkip, Ctx::MmvdFlag(0));
DTRACE(g_trace_ctx, D_SYNTAX, "mmvd_cu_skip_flag() ctx=%d mmvd_skip=%d\n", 0, cu.mmvdSkip ? 1 : 0);
......@@ -814,7 +814,7 @@ void CABACWriter::cu_skip_flag( const CodingUnit& cu )
void CABACWriter::pred_mode( const CodingUnit& cu )
{
#if JVET_M0483_IBC
if (cu.cs->slice->getSPS()->getSpsNext().getIBCMode())
if (cu.cs->slice->getSPS()->getIBCFlag())
{
#endif
#if JVET_M0483_IBC
......@@ -1846,7 +1846,7 @@ void CABACWriter::ref_idx( const PredictionUnit& pu, RefPicList eRefList )
int numRef = pu.cs->slice->getNumRefIdx(eRefList);
#if JVET_M0483_IBC
if (eRefList == REF_PIC_LIST_0 && pu.cs->sps->getSpsNext().getIBCMode())
if (eRefList == REF_PIC_LIST_0 && pu.cs->sps->getIBCFlag())
{
if (CU::isIBC(*pu.cu))
return;
......
......@@ -675,7 +675,7 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par
const UnitArea currCsArea = clipArea( CS::getArea( *bestCS, bestCS->area, partitioner.chType ), *tempCS->picture );
#if JVET_M0483_IBC
if (m_pImvTempCS && (!slice.isIntra() || slice.getSPS()->getSpsNext().getIBCMode()))
if (m_pImvTempCS && (!slice.isIntra() || slice.getSPS()->getIBCFlag()))
#else
if( m_pImvTempCS && !slice.isIntra() )
#endif
......@@ -704,7 +704,7 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par
return;
}
#if JVET_M0483_IBC
if ((!slice.isIntra() || slice.getSPS()->getSpsNext().getIBCMode())
if ((!slice.isIntra() || slice.getSPS()->getIBCFlag())
#else
if (!slice.isIntra()
#endif
......@@ -863,7 +863,7 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par
// QP from last processed CU for further processing
bestCS->prevQP[partitioner.chType] = bestCS->cus.back()->qp;
#if JVET_M0483_IBC
if ((!slice.isIntra() || slice.getSPS()->getSpsNext().getIBCMode())
if ((!slice.isIntra() || slice.getSPS()->getIBCFlag())
#else
if (!slice.isIntra()
#endif
......@@ -1433,7 +1433,7 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS,
m_pcInterSearch->addAffMVInfo(tmpMVInfo);
#if JVET_M0483_IBC
if ((!slice.isIntra() || slice.getSPS()->getSpsNext().getIBCMode())
if ((!slice.isIntra() || slice.getSPS()->getIBCFlag())
#else
if (!slice.isIntra()
#endif
......@@ -1557,7 +1557,7 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
}
#if JVET_M0483_IBC
if ((!cu.cs->slice->isIntra() || cu.cs->slice->getSPS()->getSpsNext().getIBCMode())
if ((!cu.cs->slice->isIntra() || cu.cs->slice->getSPS()->getIBCFlag())
#else
if( !cu.cs->slice->isIntra()
#endif
......@@ -1647,7 +1647,7 @@ void EncCu::xCheckIntraPCM(CodingStructure *&tempCS, CodingStructure *&bestCS, P
}
#if JVET_M0483_IBC
if ((!cu.cs->slice->isIntra() || cu.cs->slice->getSPS()->getSpsNext().getIBCMode())
if ((!cu.cs->slice->isIntra() || cu.cs->slice->getSPS()->getIBCFlag())
#else
if( !cu.cs->slice->isIntra()
#endif
......@@ -1876,7 +1876,11 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
if( auto blkCache = dynamic_cast< CacheBlkInfoCtrl* >( m_modeCtrl ) )
{
#if JVET_M0483_IBC
if (slice.getSPS()->getIBCFlag())
#else
if (slice.getSPS()->getSpsNext().getIBCMode())
#endif
{
ComprCUCtx cuECtx = m_modeCtrl->getComprCUCtx();
bestIsSkip = blkCache->isSkip(tempCS->area) && cuECtx.bestCU;
......
......@@ -1792,7 +1792,11 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
}
// disable TMVP when current picture is the only ref picture
#if JVET_M0483_IBC
if (pcSlice->isIRAP() && pcSlice->getSPS()->getIBCFlag())
#else
if (pcSlice->isIRAP() && pcSlice->getSPS()->getSpsNext().getIBCMode())
#endif
{
pcSlice->setEnableTMVPFlag(0);
}
......
......@@ -897,8 +897,11 @@ void EncLib::xInitSPS(SPS &sps)
#if JVET_M0246_AFFINE_AMVR
sps.setAffineAmvrEnabledFlag ( m_AffineAmvr );
#endif
sps.getSpsNext().setIBCMode ( m_IBCMode );
#if JVET_M0483_IBC
sps.setIBCFlag ( m_IBCMode);
#else
sps.getSpsNext().setIBCMode (m_IBCMode);
#endif
sps.setWrapAroundEnabledFlag ( m_wrapAround );
sps.setWrapAroundOffset ( m_wrapAroundOffset );
// ADD_NEW_TOOL : (encoder lib) set tool enabling flags and associated parameters here
......
......@@ -1126,7 +1126,11 @@ void EncModeCtrlMTnoRQT::initCULevel( Partitioner &partitioner, const CodingStru
m_ComprCUCtxList.back().testModes.push_back( { ETM_IPCM, ETO_STANDARD, qp, lossless } );
m_ComprCUCtxList.back().testModes.push_back( { ETM_INTRA, ETO_STANDARD, qp, lossless } );
// add ibc mode to intra path
#if JVET_M0483_IBC
if (cs.sps->getIBCFlag() && checkIbc)
#else
if (cs.sps->getSpsNext().getIBCMode() && checkIbc )
#endif
{
m_ComprCUCtxList.back().testModes.push_back({ ETM_IBC, ETO_STANDARD, qp, lossless });
if (cs.chType == CHANNEL_TYPE_LUMA)
......@@ -1292,7 +1296,7 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
}
#if JVET_M0483_IBC
if (m_pcEncCfg->getUsePbIntraFast() && (!cs.slice->isIntra() || cs.slice->getSPS()->getSpsNext().getIBCMode()) && !interHadActive(cuECtx) && cuECtx.bestCU && !CU::isIntra(*cuECtx.bestCU))
if (m_pcEncCfg->getUsePbIntraFast() && (!cs.slice->isIntra() || cs.slice->getSPS()->getIBCFlag()) && !interHadActive(cuECtx) && cuECtx.bestCU && !CU::isIntra(*cuECtx.bestCU))
#else
if( m_pcEncCfg->getUsePbIntraFast() && !cs.slice->isIntra() && !interHadActive( cuECtx ) && cuECtx.bestCU && CU::isInter( *cuECtx.bestCU ) )
#endif
......@@ -1301,7 +1305,11 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
}
// INTRA MODES
#if JVET_M0483_IBC
if (cs.sps->getIBCFlag() && !cuECtx.bestTU)
#else
if (cs.sps->getSpsNext().getIBCMode() && !cuECtx.bestTU)
#endif
return true;
CHECK( !slice.isIntra() && !cuECtx.bestTU, "No possible non-intra encoding for a P- or B-slice found" );
......@@ -1367,7 +1375,11 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
else if (encTestmode.type == ETM_IBC || encTestmode.type == ETM_IBC_MERGE)
{
// IBC MODES
#if JVET_M0483_IBC
return sps.getIBCFlag() && width <= IBC_MAX_CAND_SIZE && partitioner.currArea().lumaSize().height <= IBC_MAX_CAND_SIZE;
#else
return sps.getSpsNext().getIBCMode() && width <= IBC_MAX_CAND_SIZE && partitioner.currArea().lumaSize().height <= IBC_MAX_CAND_SIZE;
#endif
}
else if( isModeInter( encTestmode ) )
{
......@@ -1434,7 +1446,7 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
int skipScore = 0;
#if JVET_M0483_IBC
if ((!slice.isIntra() || slice.getSPS()->getSpsNext().getIBCMode()) && cuECtx.get<bool>(IS_BEST_NOSPLIT_SKIP))
if ((!slice.isIntra() || slice.getSPS()->getIBCFlag()) && cuECtx.get<bool>(IS_BEST_NOSPLIT_SKIP))
#else
if( !slice.isIntra() && cuECtx.get<bool>( IS_BEST_NOSPLIT_SKIP ) )
#endif
......@@ -1533,8 +1545,8 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
unsigned height = partitioner.currArea().lumaSize().height;
#if JVET_M0483_IBC
if (bestCU && ((bestCU->btDepth == 0 && maxBTD >= ((slice.isIntra() && !slice.getSPS()->getSpsNext().getIBCMode()) ? 3 : 2))
|| (bestCU->btDepth == 1 && cuBR && cuBR->btDepth == 1 && maxBTD >= ((slice.isIntra() && !slice.getSPS()->getSpsNext().getIBCMode()) ? 4 : 3)))
if (bestCU && ((bestCU->btDepth == 0 && maxBTD >= ((slice.isIntra() && !slice.getSPS()->getIBCFlag()) ? 3 : 2))
|| (bestCU->btDepth == 1 && cuBR && cuBR->btDepth == 1 && maxBTD >= ((slice.isIntra() && !slice.getSPS()->getIBCFlag()) ? 4 : 3)))
&& (width <= MAX_TU_SIZE_FOR_PROFILE && height <= MAX_TU_SIZE_FOR_PROFILE)
&& cuECtx.get<bool>(DID_HORZ_SPLIT) && cuECtx.get<bool>(DID_VERT_SPLIT))
{
......
......@@ -537,7 +537,7 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr
if(rpcSlice->getPPS()->getSliceChromaQpFlag())
{
#if JVET_M0483_IBC
const bool bUseIntraOrPeriodicOffset = (rpcSlice->isIntra() && !rpcSlice->getSPS()->getSpsNext().getIBCMode()) || (m_pcCfg->getSliceChromaOffsetQpPeriodicity() > 0 && (rpcSlice->getPOC() % m_pcCfg->getSliceChromaOffsetQpPeriodicity()) == 0);
const bool bUseIntraOrPeriodicOffset = (rpcSlice->isIntra() && !rpcSlice->getSPS()->getIBCFlag()) || (m_pcCfg->getSliceChromaOffsetQpPeriodicity() > 0 && (rpcSlice->getPOC() % m_pcCfg->getSliceChromaOffsetQpPeriodicity()) == 0);
#else
const bool bUseIntraOrPeriodicOffset = rpcSlice->isIntra() || (m_pcCfg->getSliceChromaOffsetQpPeriodicity() > 0 && (rpcSlice->getPOC() % m_pcCfg->getSliceChromaOffsetQpPeriodicity()) == 0);
#endif
......@@ -1485,7 +1485,11 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons
#endif
#if JVET_M0255_FRACMMVD_SWITCH
if ( pcSlice->getSPS()->getDisFracMmvdEnabledFlag() ||
#if JVET_M0483_IBC
(pcSlice->getSPS()->getIBCFlag() && m_pcCuEncoder->getEncCfg()->getIBCHashSearch()))
#else
( pcSlice->getSPS()->getSpsNext().getIBCMode() && m_pcCuEncoder->getEncCfg()->getIBCHashSearch() ) )
#endif
{
m_pcCuEncoder->getIbcHashMap().rebuildPicHashMap( cs.picture->getOrigBuf() );
}
......
......@@ -1013,7 +1013,7 @@ void IntraSearch::xEncIntraHeader(CodingStructure &cs, Partitioner &partitioner,
if( isFirst )
{
#if JVET_M0483_IBC
if ((!cs.slice->isIntra() || cs.slice->getSPS()->getSpsNext().getIBCMode())
if ((!cs.slice->isIntra() || cs.slice->getSPS()->getIBCFlag())
#else
if( !cs.slice->isIntra()
#endif
......
......@@ -551,7 +551,9 @@ void HLSWriter::codeSPSNext( const SPSNext& spsNext, const bool usePCM )
WRITE_FLAG( spsNext.getUseAffineType() ? 1 : 0, "affine_type_flag" );
}
WRITE_FLAG( spsNext.getUseGBi() ? 1 : 0, "gbi_flag" );
#if JVET_M0483_IBC==0
WRITE_FLAG(spsNext.getIBCMode() ? 1 : 0, "ibc_flag" );
#endif
for( int k = 0; k < SPSNext::NumReservedFlags; k++ )
{
WRITE_FLAG( 0, "reserved_flag" );
......@@ -615,6 +617,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
WRITE_FLAG(pcSPS->getNoLadfConstraintFlag() ? 1 : 0, "no_ladf_constraint_flag");
WRITE_FLAG(pcSPS->getNoDepQuantConstraintFlag() ? 1 : 0, "no_dep_quant_constraint_flag");
WRITE_FLAG(pcSPS->getNoSignDataHidingConstraintFlag() ? 1 : 0, "no_sign_data_hiding_constraint_flag");
#if JVET_M0483_IBC
WRITE_FLAG(pcSPS->getIBCFlag() ? 1 : 0, "ibc_flag");
#endif
#if ENABLE_TRACING
xTraceSPSHeader ();
#endif
......@@ -1271,7 +1276,7 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
}
}
#if JVET_M0483_IBC
if (!cs.slice->isIntra() || cs.slice->getSPS()->getSpsNext().getIBCMode())
if (!cs.slice->isIntra() || cs.slice->getSPS()->getIBCFlag())
{
CHECK(pcSlice->getMaxNumMergeCand() > MRG_MAX_NUM_CANDS, "More merge candidates signalled than supported");
WRITE_UVLC(MRG_MAX_NUM_CANDS - pcSlice->getMaxNumMergeCand(), "six_minus_max_num_merge_cand");
......
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