From d1194f46e02017a9a87b43327cc277dd903e34ae Mon Sep 17 00:00:00 2001 From: Xiang Li <xlxiangli@tencent.com> Date: Fri, 26 Oct 2018 23:21:59 -0700 Subject: [PATCH] Fix conflict between MMVD and constraint on 4x4 bi-pred --- source/Lib/DecoderLib/DecCu.cpp | 21 ++++----------------- source/Lib/EncoderLib/EncCu.cpp | 17 +---------------- 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/source/Lib/DecoderLib/DecCu.cpp b/source/Lib/DecoderLib/DecCu.cpp index 591c6de3..6c88d772 100644 --- a/source/Lib/DecoderLib/DecCu.cpp +++ b/source/Lib/DecoderLib/DecCu.cpp @@ -441,6 +441,7 @@ void DecCu::xDeriveCUMV( CodingUnit &cu ) #else PU::getInterMergeCandidates(tmpPU, mrgCtx, 255); #endif + PU::restrictBiPredMergeCands(pu, mrgCtx); PU::getInterMMVDMergeCandidates(tmpPU, mrgCtx, pu.mmvdMergeIdx ); @@ -456,19 +457,13 @@ void DecCu::xDeriveCUMV( CodingUnit &cu ) #else PU::getInterMergeCandidates(pu, mrgCtx, 255); #endif + PU::restrictBiPredMergeCands(pu, mrgCtx); PU::getInterMMVDMergeCandidates(pu, mrgCtx, 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); } else @@ -526,6 +521,7 @@ void DecCu::xDeriveCUMV( CodingUnit &cu ) #else PU::getInterMergeCandidates( tmpPU, mrgCtx, pu.mergeIdx ); #endif + PU::restrictBiPredMergeCands(pu, mrgCtx); std::swap( tmpPS, cu.partSize ); mrgCtx.hasMergedCandList = true; } @@ -537,20 +533,11 @@ void DecCu::xDeriveCUMV( CodingUnit &cu ) #else PU::getInterMergeCandidates( pu, mrgCtx, pu.mergeIdx ); #endif + PU::restrictBiPredMergeCands(pu, mrgCtx); } 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 ); } } diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp index f341701b..657deac3 100644 --- a/source/Lib/EncoderLib/EncCu.cpp +++ b/source/Lib/EncoderLib/EncCu.cpp @@ -1602,22 +1602,7 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *& , 0 #endif ); -#if JVET_L0104_NO_4x4BI_INTER_CU - 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 + PU::restrictBiPredMergeCands(pu, mergeCtx); #if JVET_L0054_MMVD PU::getInterMMVDMergeCandidates(pu, mergeCtx); #endif -- GitLab