Commit 552f201a authored by Shelly Chiang's avatar Shelly Chiang

fix the interaction

parent 3f0f36f4
......@@ -1697,6 +1697,11 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
{
isIntrainterEnabled = false;
}
bool isTestSkipMerge[MRG_MAX_NUM_CANDS]; // record if the merge candidate has tried skip mode
for (uint32_t idx = 0; idx < MRG_MAX_NUM_CANDS; idx++)
{
isTestSkipMerge[idx] = false;
}
#endif
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
if( m_pcEncCfg->getUseFastMerge() || isIntrainterEnabled)
......@@ -1926,7 +1931,6 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
m_CABACEstimator->getCtx() = SubCtx(Ctx::MHIntraPredMode, ctxStartIntraMode);
uint64_t fracModeBits = m_pcIntraSearch->xFracModeBitsIntra(pu, pu.intraDir[0], CHANNEL_TYPE_LUMA);
double cost = (double)sadValue + (double)(bitsCand + 1) * sqrtLambdaForFirstPass + (double)fracModeBits * sqrtLambdaForFirstPassIntra;
cost = MAX_DOUBLE;
#if JVET_L0054_MMVD
insertPos = -1;
updateDoubleCandList(mergeCand + MRG_MAX_NUM_CANDS + MMVD_ADD_NUM, cost, RdModeList, candCostList, RdModeList2, pu.intraDir[0], uiNumMrgSATDCand, &insertPos);
......@@ -2048,6 +2052,7 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
#endif
}
#endif
// Try to limit number of candidates using SATD-costs
for( uint32_t i = 1; i < uiNumMrgSATDCand; i++ )
{
......@@ -2127,7 +2132,10 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
#else
uiMergeCand -= (MRG_MAX_NUM_CANDS + MRG_MAX_NUM_CANDS); // for skip, map back to normal merge candidate idx and try RDO
#endif
continue;
if (isTestSkipMerge[uiMergeCand])
{
continue;
}
}
#endif
......@@ -2225,7 +2233,14 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
else
{
#if JVET_L0054_MMVD
tempCS->getPredBuf().copyFrom(*acMergeTempBuffer[uiMrgHADIdx]);
if (uiNoResidualPass != 0 && uiMergeCand < mergeCtx.numValidMergeCand && RdModeList[uiMrgHADIdx] >= (MRG_MAX_NUM_CANDS + MMVD_ADD_NUM))
{
tempCS->getPredBuf().copyFrom(acMergeBuffer[uiMergeCand]);
}
else
{
tempCS->getPredBuf().copyFrom(*acMergeTempBuffer[uiMrgHADIdx]);
}
#else
tempCS->getPredBuf().copyFrom(acMergeBuffer[uiMergeCand]);
#endif
......@@ -2243,6 +2258,17 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
m_pcInterSearch->motionCompensation( pu );
}
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
#if JVET_L0054_MMVD
if (!cu.mmvdSkip && !pu.MHIntraFlag && uiNoResidualPass != 0)
#else
if (!pu.MHIntraFlag && uiNoResidualPass != 0)
#endif
{
CHECK(uiMergeCand >= mergeCtx.numValidMergeCand, "out of normal merge");
isTestSkipMerge[uiMergeCand] = true;
}
#endif
#if JVET_L0054_MMVD
xEncodeInterResidual(tempCS, bestCS, partitioner, encTestMode, uiNoResidualPass
......
......@@ -242,6 +242,8 @@ protected:
|| abs(cu.slice->getPOC() - cu.slice->getRefPOC(REF_PIC_LIST_1, cu.refIdxBi[1])) == 1))));
}
#endif
};
//! \}
......
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