Skip to content

Commit

Permalink
Merge pull request #116 from adamjw24/develop_fix112
Browse files Browse the repository at this point in the history
Fix issue #112
  • Loading branch information
K-os committed Sep 6, 2022
2 parents cd6d756 + c109833 commit 717090a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions source/Lib/CommonLib/UnitTools.cpp
Expand Up @@ -2398,7 +2398,6 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
if ( enableSubPuMvp && slice.getPicHeader()->getEnableTMVPFlag() )
{
MergeCtx mrgCtx = *affMrgCtx.mrgCtx;
bool tmpLICFlag = false;

CHECKD( mrgCtx.subPuMvpMiBuf.area() == 0 || !mrgCtx.subPuMvpMiBuf.buf, "Buffer not initialized" );

Expand Down Expand Up @@ -2427,7 +2426,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx

mrgCtx.numValidMergeCand = pos;

isAvailableSubPu = getInterMergeSubPuMvpCand( pu, mrgCtx, tmpLICFlag, pos );
isAvailableSubPu = getInterMergeSubPuMvpCand( pu, mrgCtx, pos );

if( isAvailableSubPu )
{
Expand Down Expand Up @@ -2912,7 +2911,7 @@ void clipColPos(int& posX, int& posY, const PredictionUnit& pu)
posY = std::min(verMax, std::max(verMin, posY));
}

bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, bool& LICFlag, const int count )
bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, const int count )
{
const Slice &slice = *pu.slice;

Expand All @@ -2936,7 +2935,6 @@ bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, b
//////// GET Initial Temporal Vector ////////
///////////////////////////////////////////////////////////////////////
Mv cTempVector = cTMv;
bool tempLICFlag = false;

// compute the location of the current PU
Position puPos = pu.lumaPos();
Expand Down Expand Up @@ -2980,7 +2978,6 @@ bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, b
// set as default, for further motion vector field spanning
mrgCtx.mvFieldNeighbours[(count << 1) + currRefListId].setMvField(cColMv, 0);
mrgCtx.interDirNeighbours[count] |= (1 << currRefListId);
LICFlag = tempLICFlag;
mrgCtx.BcwIdx[count] = BCW_DEFAULT;
found = true;
}
Expand Down Expand Up @@ -3027,6 +3024,7 @@ bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, b
const Slice* pColSlice;
const ColocatedMotionInfo&
colMi = pColPic->cs->getColInfo( colPos, pColSlice );
bool found = false;

if (colMi.isInter())
{
Expand All @@ -3037,10 +3035,12 @@ bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, b
{
mi.miRefIdx[currRefListId] = 1;
mi.mv[currRefListId] = cColMv;
found = true;
}
}
}
else

if( !found )
{
// intra coded, in this case, no motion vector is available for list 0 or list 1, so use default
mi.mv[0] = mrgCtx.mvFieldNeighbours[(count << 1) + 0].mv;
Expand Down
2 changes: 1 addition & 1 deletion source/Lib/CommonLib/UnitTools.h
Expand Up @@ -151,7 +151,7 @@ namespace PU
void getAffineMergeCand (const PredictionUnit &pu, AffineMergeCtx& affMrgCtx, const int mrgCandIdx = -1 );
void setAllAffineMvField ( PredictionUnit &pu, MvField *mvField, RefPicList eRefList );
void setAllAffineMv ( PredictionUnit &pu, Mv affLT, Mv affRT, Mv affLB, RefPicList eRefList, bool clipCPMVs = false );
bool getInterMergeSubPuMvpCand (const PredictionUnit &pu, MergeCtx &mrgCtx, bool& LICFlag, const int count);
bool getInterMergeSubPuMvpCand (const PredictionUnit &pu, MergeCtx &mrgCtx, const int count);
bool isBiPredFromDifferentDirEqDistPoc(const PredictionUnit &pu);
void restrictBiPredMergeCandsOne ( PredictionUnit &pu);

Expand Down

0 comments on commit 717090a

Please sign in to comment.