Commit 2fd78e40 authored by Xiang Li's avatar Xiang Li

Merge branch 'M0126-HMVP-MRG-PRUNING' into 'master'

M0126 HMVP merge pruing

See merge request !223
parents 7a43a1ed bf17aafa
Pipeline #717 passed with stage
......@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_M0126_HMVP_MRG_PRUNING 1 // HMVP merge candidates pruning simplification
#define JVET_M0483_IBC 1 // Block level flag signaling and independent IBC mode
#define JVET_M0102_INTRA_SUBPARTITIONS 1
......
......@@ -1100,7 +1100,11 @@ bool PU::addMergeHMVPCand(const Slice &slice, MergeCtx& mrgCtx, bool isCandInter
{
mrgCtx.mvFieldNeighbours[(cnt << 1) + 1].setMvField(miNeighbor.mv[1], miNeighbor.refIdx[1]);
}
#if JVET_M0126_HMVP_MRG_PRUNING
if (mrgIdx > 2 || !xCheckSimilarMotion(cnt, prevCnt, mrgCtx, hasPruned))
#else
if (!xCheckSimilarMotion(cnt, prevCnt, mrgCtx, hasPruned))
#endif
{
#if !JVET_L0090_PAIR_AVG
isCandInter[cnt] = true;
......@@ -1210,6 +1214,10 @@ void PU::getIBCMergeCandidates(const PredictionUnit &pu, MergeCtx& mrgCtx, const
return;
}
#if JVET_M0126_HMVP_MRG_PRUNING
int spatialCandPos = cnt;
#endif
// above right
const PredictionUnit *puAboveRight = cs.getPURestricted(posRT.offset(1, -1), pu, pu.chType);
bool isAvailableB0 = puAboveRight && isDiffMER(pu, *puAboveRight) && CU::isIBC(*puAboveRight->cu);
......@@ -1314,7 +1322,13 @@ void PU::getIBCMergeCandidates(const PredictionUnit &pu, MergeCtx& mrgCtx, const
#if JVET_L0090_PAIR_AVG
bool bFound = addMergeHMVPCand(slice, mrgCtx, canFastExit
, mrgCandIdx
, maxNumMergeCandMin1, cnt, cnt, isAvailableSubPu, subPuMvpPos
, maxNumMergeCandMin1, cnt
#if JVET_M0126_HMVP_MRG_PRUNING
, spatialCandPos
#else
, cnt
#endif
, isAvailableSubPu, subPuMvpPos
#if JVET_M0483_IBC
, true
#endif
......@@ -1536,6 +1550,10 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
return;
}
#if JVET_M0126_HMVP_MRG_PRUNING
int spatialCandPos = cnt;
#endif
// above right
const PredictionUnit *puAboveRight = cs.getPURestricted( posRT.offset( 1, -1 ), pu, pu.chType );
......@@ -1849,7 +1867,13 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
#else
, mrgCandIdx
#endif
, maxNumMergeCandMin1, cnt, cnt, isAvailableSubPu, subPuMvpPos
, maxNumMergeCandMin1, cnt
#if JVET_M0126_HMVP_MRG_PRUNING
, spatialCandPos
#else
, cnt
#endif
, isAvailableSubPu, subPuMvpPos
#if JVET_M0483_IBC==0
, mmvdList
#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