Commit 7383bae4 authored by Li's avatar Li

JVET-M0264: Harmonization between HMVP and GBi

parent 818a0736
......@@ -107,9 +107,20 @@ struct MotionInfo
Mv mv [ NUM_REF_PIC_LIST_01 ];
int16_t refIdx [ NUM_REF_PIC_LIST_01 ];
Mv bv;
#if JVET_M0264_HMVP_WITH_GBIIDX
uint8_t GBiIdx;
#endif
#if JVET_M0264_HMVP_WITH_GBIIDX
MotionInfo() : isInter( false ), interDir( 0 ), sliceIdx( 0 ), refIdx{ NOT_VALID, NOT_VALID }, GBiIdx( 0 ) { }
#else
MotionInfo() : isInter( false ), interDir( 0 ), sliceIdx( 0 ), refIdx{ NOT_VALID, NOT_VALID } { }
#endif
// ensure that MotionInfo(0) produces '\x000....' bit pattern - needed to work with AreaBuf - don't use this constructor for anything else
#if JVET_M0264_HMVP_WITH_GBIIDX
MotionInfo( int i ) : isInter( i != 0 ), interDir( 0 ), sliceIdx( 0 ), refIdx{ 0, 0 }, GBiIdx( 0 ) { CHECKD( i != 0, "The argument for this constructor has to be '0'" ); }
#else
MotionInfo( int i ) : isInter( i != 0 ), interDir( 0 ), sliceIdx( 0 ), refIdx{ 0, 0 } { CHECKD( i != 0, "The argument for this constructor has to be '0'" ); }
#endif
bool operator==( const MotionInfo& mi ) const
{
......
......@@ -1687,6 +1687,9 @@ void Slice::updateMotionLUTs(LutMotionCand* lutMC, CodingUnit & cu)
if (cu.triangle) { return; }
MotionInfo newMi = selectedPU->getMotionInfo();
#if JVET_M0264_HMVP_WITH_GBIIDX
newMi.GBiIdx = (newMi.interDir == 3) ? cu.GBiIdx : GBI_DEFAULT;
#endif
addMotionInfoToLUTs(lutMC, newMi);
}
......
......@@ -52,6 +52,8 @@
#define JVET_M0145_AFFINE_MV_CLIP 1 // Missing clipping for MV storage in affine
#define JVET_M0264_HMVP_WITH_GBIIDX 1 // Harmonization between HMVP and GBi
#define JVET_M0381_ONE_CTX_FOR_SUBBLOCK_MRG_IDX 1 // CE2.2.2 a: one context for subblock Merge index
#define JVET_M0118_M0185_TRIANGLE_FLAG_FIX 1 // Avoid signaling triangle flag if a CU uses MMVD or CIIP
......
......@@ -745,6 +745,9 @@ bool PU::addMergeHMVPCand(const Slice &slice, MergeCtx& mrgCtx, bool isCandInter
miNeighbor = slice.getMotionInfoFromLUTs(num_avai_candInLUT - mrgIdx);
#endif
mrgCtx.interDirNeighbours[cnt] = miNeighbor.interDir;
#if JVET_M0264_HMVP_WITH_GBIIDX
mrgCtx.GBiIdx[cnt] = (mrgCtx.interDirNeighbours[cnt] == 3) ? miNeighbor.GBiIdx: GBI_DEFAULT;
#endif
mrgCtx.mvFieldNeighbours[cnt << 1].setMvField(miNeighbor.mv[0], miNeighbor.refIdx[0]);
if (slice.isInterB())
{
......
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