Commit cb812080 authored by Xiang Li's avatar Xiang Li
Browse files

Merge branch 'guichunli/VVCSoftware_VTM-N0448-N0380-MMVD-fix'

parents 8896c114 81cc3a20
......@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_N0448_N0380 1 // When MaxNumMergeCand is 1, MMVD_BASE_MV_NUM is inferred to be 1.
#define JVET_N0054_JOINT_CHROMA 1 // Joint chroma residual coding mode
#define JVET_N0317_ADD_ZERO_BV 1
......
......@@ -2077,7 +2077,7 @@ void PU::getInterMMVDMergeCandidates(const PredictionUnit &pu, MergeCtx& mrgCtx,
break;
}
}
#if !JVET_N0448_N0380
if (currBaseNum < MMVD_BASE_MV_NUM)
{
for (k = currBaseNum; k < MMVD_BASE_MV_NUM; k++)
......@@ -2089,6 +2089,7 @@ void PU::getInterMMVDMergeCandidates(const PredictionUnit &pu, MergeCtx& mrgCtx,
mrgCtx.interDirNeighbours[k] = (mrgCtx.mmvdBaseMv[k][0].refIdx >= 0) + (mrgCtx.mmvdBaseMv[k][1].refIdx >= 0) * 2;
}
}
#endif
}
bool PU::getColocatedMVP(const PredictionUnit &pu, const RefPicList &eRefPicList, const Position &_pos, Mv& rcMv, const int &refIdx )
{
......
......@@ -1709,7 +1709,12 @@ void CABACReader::mmvd_merge_idx(PredictionUnit& pu)
mvpIdx = (var + dir0)*(MMVD_MAX_REFINE_NUM*MMVD_BASE_MV_NUM);
#if JVET_N0448_N0380
int numCand = int(pu.cs->slice->getMaxNumMergeCand());
int numCandminus1_base = (numCand > 1) ? MMVD_BASE_MV_NUM - 1 : 0;
#else
int numCandminus1_base = MMVD_BASE_MV_NUM - 1;
#endif
var0 = 0;
if (numCandminus1_base > 0)
{
......
......@@ -1662,7 +1662,12 @@ void CABACWriter::mmvd_merge_idx(const PredictionUnit& pu)
var1 = (mvpIdx - (var0 * MMVD_MAX_REFINE_NUM)) / 4;
var2 = mvpIdx - (var0 * MMVD_MAX_REFINE_NUM) - var1 * 4;
#if JVET_N0448_N0380
int numCand = int(pu.cs->slice->getMaxNumMergeCand());
int numCandminus1_base = (numCand > 1) ? MMVD_BASE_MV_NUM - 1 : 0;
#else
int numCandminus1_base = MMVD_BASE_MV_NUM - 1;
#endif
if (numCandminus1_base > 0)
{
if (var0 == 0)
......
......@@ -1977,7 +1977,11 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
#if !JVET_MMVD_OFF_MACRO
cu.mmvdSkip = true;
int tempNum = 0;
#if JVET_N0448_N0380
tempNum = (mergeCtx.numValidMergeCand > 1) ? MMVD_ADD_NUM : MMVD_ADD_NUM >> 1;
#else
tempNum = MMVD_ADD_NUM;
#endif
for (uint32_t mergeCand = mergeCtx.numValidMergeCand; mergeCand < mergeCtx.numValidMergeCand + tempNum; mergeCand++)
{
const int mmvdMergeCand = mergeCand - mergeCtx.numValidMergeCand;
......@@ -2076,7 +2080,11 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
{
if (bestIsMMVDSkip)
{
#if JVET_N0448_N0380
uiNumMrgSATDCand = mergeCtx.numValidMergeCand + ((mergeCtx.numValidMergeCand > 1) ? MMVD_ADD_NUM : MMVD_ADD_NUM >> 1);
#else
uiNumMrgSATDCand = mergeCtx.numValidMergeCand + MMVD_ADD_NUM;
#endif
}
else
{
......
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