Commit 3fa69ee2 authored by Xiang Li's avatar Xiang Li

Merge branch 'fixTicket252' into 'master'

Fix for ticket #252: MIP tool off test difference

See merge request jvet/VVCSoftware_VTM!531
parents 5900c435 4d8c5dbe
Pipeline #1500 passed with stage
......@@ -304,15 +304,9 @@ const CtxSet ContextSetCfg::PredMode = ContextSetCfg::addCtxSet
const CtxSet ContextSetCfg::MultiRefLineIdx = ContextSetCfg::addCtxSet
({
#if JVET_N0217_MATRIX_INTRAPRED
{ 105, 212, CNU, },
{ 133, 212, CNU, },
{ 134, 169, CNU, },
#else
{ 90, 212, CNU, },
{ 118, 212, CNU, },
{ 119, 169, CNU, },
#endif
{ 8, 8, DWS, },
});
......@@ -736,17 +730,10 @@ const CtxSet ContextSetCfg::MTSIndex = ContextSetCfg::addCtxSet
const CtxSet ContextSetCfg::ISPMode = ContextSetCfg::addCtxSet
({
#if JVET_N0217_MATRIX_INTRAPRED
{ 151, 154, },
{ 165, 169, },
{ 166, 169, },
{ 9, 4, },
#else
{ 152, 154, },
{ 166, 154, },
{ 152, 154, },
{ 8, 5, },
#endif
});
const CtxSet ContextSetCfg::SbtFlag = ContextSetCfg::addCtxSet
......
......@@ -287,10 +287,10 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
#if JVET_N0217_MATRIX_INTRAPRED
const TempCtx ctxStartMipFlag ( m_CtxCache, SubCtx( Ctx::MipFlag, m_CABACEstimator->getCtx() ) );
const TempCtx ctxStartMipMode ( m_CtxCache, SubCtx( Ctx::MipMode, m_CABACEstimator->getCtx() ) );
#endif
const TempCtx ctxStartIspMode ( m_CtxCache, SubCtx( Ctx::ISPMode, m_CABACEstimator->getCtx() ) );
#if JVET_N0185_UNIFIED_MPM
const TempCtx ctxStartPlanarFlag ( m_CtxCache, SubCtx( Ctx::IntraLumaPlanarFlag, m_CABACEstimator->getCtx() ) );
#endif
#endif
const TempCtx ctxStartIntraMode(m_CtxCache, SubCtx(Ctx::IntraLumaMpmFlag, m_CABACEstimator->getCtx()));
#if !JVET_N0302_SIMPLFIED_CIIP
......@@ -584,10 +584,10 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
// NB xFracModeBitsIntra will not affect the mode for chroma that may have already been pre-estimated.
#if JVET_N0217_MATRIX_INTRAPRED
m_CABACEstimator->getCtx() = SubCtx( Ctx::MipFlag, ctxStartMipFlag );
#endif
m_CABACEstimator->getCtx() = SubCtx( Ctx::ISPMode, ctxStartIspMode );
#if JVET_N0185_UNIFIED_MPM
m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaPlanarFlag, ctxStartPlanarFlag);
#endif
#endif
m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaMpmFlag, ctxStartIntraMode);
#if !JVET_N0302_SIMPLFIED_CIIP
......@@ -717,10 +717,10 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
// NB xFracModeBitsIntra will not affect the mode for chroma that may have already been pre-estimated.
#if JVET_N0217_MATRIX_INTRAPRED
m_CABACEstimator->getCtx() = SubCtx( Ctx::MipFlag, ctxStartMipFlag );
#endif
m_CABACEstimator->getCtx() = SubCtx( Ctx::ISPMode, ctxStartIspMode );
#if JVET_N0185_UNIFIED_MPM
m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaPlanarFlag, ctxStartPlanarFlag);
#endif
#endif
m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaMpmFlag, ctxStartIntraMode);
#if !JVET_N0302_SIMPLFIED_CIIP
......@@ -819,10 +819,10 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
// NB xFracModeBitsIntra will not affect the mode for chroma that may have already been pre-estimated.
#if JVET_N0217_MATRIX_INTRAPRED
m_CABACEstimator->getCtx() = SubCtx( Ctx::MipFlag, ctxStartMipFlag );
#endif
m_CABACEstimator->getCtx() = SubCtx( Ctx::ISPMode, ctxStartIspMode );
#if JVET_N0185_UNIFIED_MPM
m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaPlanarFlag, ctxStartPlanarFlag);
#endif
#endif
m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaMpmFlag, ctxStartIntraMode);
#if !JVET_N0302_SIMPLFIED_CIIP
......@@ -846,6 +846,11 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
#endif
#else
updateCandList(mode, cost, uiRdModeList, CandCostList, extendRefList, multiRefIdx, numModesForFullRD);
#if JVET_N0363_INTRA_COST_MOD
updateCandList(mode, (double)minSadHad, uiHadModeList, CandHadList, *nullList, -1, 3);
#else
updateCandList(mode, (double)sad, uiHadModeList, CandHadList, *nullList, -1, 3);
#endif
#endif
}
}
......@@ -1137,10 +1142,18 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
#endif
{
#if JVET_N0217_MATRIX_INTRAPRED
#if JVET_N0193_LFNST
double pbintraRatio = (lfnstIdx > 0) ? 1.25 : PBINTRA_RATIO;
#endif
int maxSize = -1;
for (int k = int(CandHadList.size()) - 1; k >= 0; k--)
const int numHadCand = (testMip ? 2 : 1) * 3;
for (int k = numHadCand - 1; k >= 0; k--)
{
if (CandHadList[k] > cs.interHad * PBINTRA_RATIO) { maxSize = k; }
#if JVET_N0193_LFNST
if (CandHadList.size() < (k + 1) || CandHadList[k] > cs.interHad * pbintraRatio) { maxSize = k; }
#else
if (CandHadList.size() < (k + 1) || CandHadList[k] > cs.interHad * PBINTRA_RATIO) { maxSize = k; }
#endif
}
if (maxSize > 0)
{
......@@ -1219,6 +1232,10 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
cs.interHad = 0;
//===== reset context models =====
m_CABACEstimator->getCtx() = SubCtx(Ctx::ISPMode, ctxStartIspMode);
#if JVET_N0185_UNIFIED_MPM
m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaPlanarFlag, ctxStartPlanarFlag);
#endif
m_CABACEstimator->getCtx() = SubCtx( Ctx::IntraLumaMpmFlag, ctxStartIntraMode );
#if !JVET_N0302_SIMPLFIED_CIIP
m_CABACEstimator->getCtx() = SubCtx( Ctx::MHIntraPredMode, ctxStartMHIntraMode );
......@@ -1323,6 +1340,8 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
#if JVET_N0217_MATRIX_INTRAPRED
m_bestCostNonMip = MAX_DOUBLE;
if (testMip)
{
static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> uiRdModeListTemp;
for( int i = 0; i < uiRdModeList.size(); i++)
{
......@@ -1342,6 +1361,7 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
{
uiRdModeList[i] = uiRdModeListTemp[i];
}
}
#endif
// just to be sure
numModesForFullRD = ( int ) uiRdModeList.size();
......@@ -3639,6 +3659,7 @@ uint64_t IntraSearch::xFracModeBitsIntra(PredictionUnit &pu, const uint32_t &uiM
{
#if !JVET_N0217_MATRIX_INTRAPRED
m_CABACEstimator->extend_ref_line(pu);
m_CABACEstimator->isp_mode(*pu.cu);
#endif
m_CABACEstimator->intra_luma_pred_mode(pu);
}
......
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