Commit d1194f46 authored by Xiang Li's avatar Xiang Li

Fix conflict between MMVD and constraint on 4x4 bi-pred

parent c1f99abf
Pipeline #230 passed with stage
...@@ -441,6 +441,7 @@ void DecCu::xDeriveCUMV( CodingUnit &cu ) ...@@ -441,6 +441,7 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
#else #else
PU::getInterMergeCandidates(tmpPU, mrgCtx, 255); PU::getInterMergeCandidates(tmpPU, mrgCtx, 255);
#endif #endif
PU::restrictBiPredMergeCands(pu, mrgCtx);
PU::getInterMMVDMergeCandidates(tmpPU, mrgCtx, PU::getInterMMVDMergeCandidates(tmpPU, mrgCtx,
pu.mmvdMergeIdx pu.mmvdMergeIdx
); );
...@@ -456,19 +457,13 @@ void DecCu::xDeriveCUMV( CodingUnit &cu ) ...@@ -456,19 +457,13 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
#else #else
PU::getInterMergeCandidates(pu, mrgCtx, 255); PU::getInterMergeCandidates(pu, mrgCtx, 255);
#endif #endif
PU::restrictBiPredMergeCands(pu, mrgCtx);
PU::getInterMMVDMergeCandidates(pu, mrgCtx, PU::getInterMMVDMergeCandidates(pu, mrgCtx,
pu.mmvdMergeIdx pu.mmvdMergeIdx
); );
} }
mrgCtx.setMmvdMergeCandiInfo(pu, pu.mmvdMergeIdx); mrgCtx.setMmvdMergeCandiInfo(pu, pu.mmvdMergeIdx);
if (pu.interDir == 3 /* PRED_BI */ && PU::isBipredRestriction(pu))
{
pu.mv[REF_PIC_LIST_1] = Mv(0, 0);
pu.refIdx[REF_PIC_LIST_1] = -1;
pu.interDir = 1;
}
PU::spanMotionInfo(pu, mrgCtx); PU::spanMotionInfo(pu, mrgCtx);
} }
else else
...@@ -526,6 +521,7 @@ void DecCu::xDeriveCUMV( CodingUnit &cu ) ...@@ -526,6 +521,7 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
#else #else
PU::getInterMergeCandidates( tmpPU, mrgCtx, pu.mergeIdx ); PU::getInterMergeCandidates( tmpPU, mrgCtx, pu.mergeIdx );
#endif #endif
PU::restrictBiPredMergeCands(pu, mrgCtx);
std::swap( tmpPS, cu.partSize ); std::swap( tmpPS, cu.partSize );
mrgCtx.hasMergedCandList = true; mrgCtx.hasMergedCandList = true;
} }
...@@ -537,20 +533,11 @@ void DecCu::xDeriveCUMV( CodingUnit &cu ) ...@@ -537,20 +533,11 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
#else #else
PU::getInterMergeCandidates( pu, mrgCtx, pu.mergeIdx ); PU::getInterMergeCandidates( pu, mrgCtx, pu.mergeIdx );
#endif #endif
PU::restrictBiPredMergeCands(pu, mrgCtx);
} }
mrgCtx.setMergeInfo( pu, pu.mergeIdx ); mrgCtx.setMergeInfo( pu, pu.mergeIdx );
if( pu.interDir == 3 /* PRED_BI */ && PU::isBipredRestriction(pu) )
{
pu.mv [REF_PIC_LIST_1] = Mv(0, 0);
pu.refIdx[REF_PIC_LIST_1] = -1;
pu.interDir = 1;
#if JVET_L0646_GBI
pu.cu->GBiIdx = GBI_DEFAULT;
#endif
}
PU::spanMotionInfo( pu, mrgCtx ); PU::spanMotionInfo( pu, mrgCtx );
} }
} }
......
...@@ -1602,22 +1602,7 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *& ...@@ -1602,22 +1602,7 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
, 0 , 0
#endif #endif
); );
#if JVET_L0104_NO_4x4BI_INTER_CU PU::restrictBiPredMergeCands(pu, mergeCtx);
if (PU::isBipredRestriction(pu))
{
for( uint32_t mergeCand = 0; mergeCand < mergeCtx.numValidMergeCand; ++mergeCand )
{
if( mergeCtx.interDirNeighbours[ mergeCand ] == 3 )
{
mergeCtx.interDirNeighbours[ mergeCand ] = 1;
mergeCtx.mvFieldNeighbours[( mergeCand << 1 ) + 1].setMvField( Mv( 0, 0 ), -1 );
#if JVET_L0646_GBI
mergeCtx.GBiIdx[mergeCand] = GBI_DEFAULT;
#endif
}
}
}
#endif
#if JVET_L0054_MMVD #if JVET_L0054_MMVD
PU::getInterMMVDMergeCandidates(pu, mergeCtx); PU::getInterMMVDMergeCandidates(pu, mergeCtx);
#endif #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