From c0ecb772c819e225aa9696dbacb7718ce81d3bf0 Mon Sep 17 00:00:00 2001 From: Suhong Wang <suhong.wang@pku.edu.cn> Date: Sun, 21 Jul 2019 18:36:47 +0200 Subject: [PATCH] JVET_O0078_SINGLE_HMVPLUT: Single HMVP table for all CUs inside the shared merge list region for IBC --- source/Lib/CommonLib/MotionInfo.h | 2 ++ source/Lib/CommonLib/TypeDef.h | 2 ++ source/Lib/CommonLib/UnitTools.cpp | 4 ++++ source/Lib/DecoderLib/DecCu.cpp | 7 +++++++ source/Lib/DecoderLib/DecSlice.cpp | 2 ++ source/Lib/EncoderLib/EncCu.cpp | 7 +++++++ source/Lib/EncoderLib/EncSlice.cpp | 2 ++ 7 files changed, 26 insertions(+) diff --git a/source/Lib/CommonLib/MotionInfo.h b/source/Lib/CommonLib/MotionInfo.h index 83bb07cff..4ebd998dd 100644 --- a/source/Lib/CommonLib/MotionInfo.h +++ b/source/Lib/CommonLib/MotionInfo.h @@ -221,7 +221,9 @@ struct LutMotionCand { static_vector<MotionInfo, MAX_NUM_HMVP_CANDS> lut; static_vector<MotionInfo, MAX_NUM_HMVP_CANDS> lutIbc; +#if !JVET_O0078_SINGLE_HMVPLUT static_vector<MotionInfo, MAX_NUM_HMVP_CANDS> lutShareIbc; +#endif }; struct PatentBvCand { diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index aa7aeee70..e4d9810db 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -91,6 +91,8 @@ #define JVET_O1124_ALLOW_CCLM_COND 1 // JVET-O1124/JVET-O0196: CCLM restriction to reduce luma-chroma latency for chroma separate tree +#define JVET_O0078_SINGLE_HMVPLUT 1 // JVET-O0078:Single HMVP table for all CUs inside the shared merge list region for IBC + #define FIX_DB_MAX_TRANSFORM_SIZE 1 #define MRG_SHARELIST_SHARSIZE 32 diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp index 3fbe03411..ac2bc0d32 100644 --- a/source/Lib/CommonLib/UnitTools.cpp +++ b/source/Lib/CommonLib/UnitTools.cpp @@ -943,7 +943,11 @@ bool PU::addMergeHMVPCand(const CodingStructure &cs, MergeCtx& mrgCtx, bool isCa { hasPruned[subPuMvpPos] = true; } +#if JVET_O0078_SINGLE_HMVPLUT + auto &lut = ibcFlag ? cs.motionLut.lutIbc : cs.motionLut.lut; +#else auto &lut = ibcFlag ? ( isShared ? cs.motionLut.lutShareIbc : cs.motionLut.lutIbc ) : cs.motionLut.lut; +#endif int num_avai_candInLUT = (int) lut.size(); for (int mrgIdx = 1; mrgIdx <= num_avai_candInLUT; mrgIdx++) diff --git a/source/Lib/DecoderLib/DecCu.cpp b/source/Lib/DecoderLib/DecCu.cpp index 9be9b7a89..c3c84a4b0 100644 --- a/source/Lib/DecoderLib/DecCu.cpp +++ b/source/Lib/DecoderLib/DecCu.cpp @@ -122,7 +122,9 @@ void DecCu::decompressCtu( CodingStructure& cs, const UnitArea& ctuArea ) if ((currCU.shareParentPos.x >= 0) && (!(currCU.shareParentPos.x == prevTmpPos.x && currCU.shareParentPos.y == prevTmpPos.y))) { m_shareStateDec = GEN_ON_SHARED_BOUND; +#if !JVET_O0078_SINGLE_HMVPLUT cs.motionLut.lutShareIbc = cs.motionLut.lutIbc; +#endif } if (currCU.shareParentPos.x < 0) @@ -455,7 +457,12 @@ void DecCu::xReconInter(CodingUnit &cu) if (cu.Y().valid()) { const PredictionUnit &pu = *cu.firstPU; +#if JVET_O0078_SINGLE_HMVPLUT + bool isShare = ((CU::isIBC(cu) && (cu.shareParentSize.width != cu.Y().lumaSize().width || cu.shareParentSize.height != cu.Y().lumaSize().height)) ? true : false); + if (!cu.affine && !cu.triangle && !isShare) +#else if (!cu.affine && !cu.triangle) +#endif { MotionInfo mi = pu.getMotionInfo(); mi.GBiIdx = (mi.interDir == 3) ? cu.GBiIdx : GBI_DEFAULT; diff --git a/source/Lib/DecoderLib/DecSlice.cpp b/source/Lib/DecoderLib/DecSlice.cpp index 7a2ade95b..b6a368804 100644 --- a/source/Lib/DecoderLib/DecSlice.cpp +++ b/source/Lib/DecoderLib/DecSlice.cpp @@ -188,7 +188,9 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb { cs.motionLut.lut.resize(0); cs.motionLut.lutIbc.resize(0); +#if !JVET_O0078_SINGLE_HMVPLUT cs.motionLut.lutShareIbc.resize(0); +#endif } if( !cs.slice->isIntra() ) diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp index d72f65eec..2ae45ae5a 100644 --- a/source/Lib/EncoderLib/EncCu.cpp +++ b/source/Lib/EncoderLib/EncCu.cpp @@ -786,7 +786,12 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par const CodingUnit& cu = *bestCS->cus.front(); const PredictionUnit& pu = *cu.firstPU; +#if JVET_O0078_SINGLE_HMVPLUT + bool isShare = ((CU::isIBC(cu) && m_shareState == 2) ? true : false); + if (!cu.affine && !cu.triangle && !isShare) +#else if (!cu.affine && !cu.triangle) +#endif { MotionInfo mi = pu.getMotionInfo(); mi.GBiIdx = (mi.interDir == 3) ? cu.GBiIdx : GBI_DEFAULT; @@ -1158,7 +1163,9 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS, } if ( m_shareState == GEN_ON_SHARED_BOUND && slice.getSPS()->getIBCFlag() ) { +#if !JVET_O0078_SINGLE_HMVPLUT tempCS->motionLut.lutShareIbc = tempCS->motionLut.lutIbc; +#endif m_shareBndPosX = uiLPelX; m_shareBndPosY = uiTPelY; m_shareBndSizeW = tempCS->area.lwidth(); diff --git a/source/Lib/EncoderLib/EncSlice.cpp b/source/Lib/EncoderLib/EncSlice.cpp index d184ab065..01f99ec69 100644 --- a/source/Lib/EncoderLib/EncSlice.cpp +++ b/source/Lib/EncoderLib/EncSlice.cpp @@ -1536,7 +1536,9 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons { cs.motionLut.lut.resize(0); cs.motionLut.lutIbc.resize(0); +#if !JVET_O0078_SINGLE_HMVPLUT cs.motionLut.lutShareIbc.resize(0); +#endif } #if ENABLE_WPP_PARALLELISM -- GitLab