diff --git a/source/Lib/CommonLib/CodingStructure.cpp b/source/Lib/CommonLib/CodingStructure.cpp index 69f028b477a03e4b21e5488af06512bb24e98c46..84ffabcac71ccc790cabb5ff1ee995b20724ffe9 100644 --- a/source/Lib/CommonLib/CodingStructure.cpp +++ b/source/Lib/CommonLib/CodingStructure.cpp @@ -1407,6 +1407,7 @@ const TransformUnit* CodingStructure::getTURestricted( const Position &pos, cons } } +#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE IbcLumaCoverage CodingStructure::getIbcLumaCoverage(const CompArea& chromaArea) const { const unsigned int unitAreaSubBlock = MIN_PU_SIZE * MIN_PU_SIZE; @@ -1438,3 +1439,4 @@ IbcLumaCoverage CodingStructure::getIbcLumaCoverage(const CompArea& chromaArea) return coverage; } +#endif \ No newline at end of file diff --git a/source/Lib/CommonLib/CodingStructure.h b/source/Lib/CommonLib/CodingStructure.h index 5f96ce920ae6e4625f4ed011b1fb96866c59a175..aa41d96111a05bcd4ef733a685e2dc232ec67569 100644 --- a/source/Lib/CommonLib/CodingStructure.h +++ b/source/Lib/CommonLib/CodingStructure.h @@ -60,6 +60,7 @@ enum PictureType PIC_RECON_WRAP, NUM_PIC_TYPES }; +#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE enum IbcLumaCoverage { IBC_LUMA_COVERAGE_FULL = 0, @@ -67,6 +68,7 @@ enum IbcLumaCoverage IBC_LUMA_COVERAGE_NONE, NUM_IBC_LUMA_COVERAGE, }; +#endif extern XUCache g_globalUnitCache; // --------------------------------------------------------------------------- @@ -153,7 +155,9 @@ public: cCUTraverser traverseCUs(const UnitArea& _unit, const ChannelType _chType) const; cPUTraverser traversePUs(const UnitArea& _unit, const ChannelType _chType) const; cTUTraverser traverseTUs(const UnitArea& _unit, const ChannelType _chType) const; +#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE IbcLumaCoverage getIbcLumaCoverage(const CompArea& chromaArea) const; +#endif // --------------------------------------------------------------------------- // encoding search utilities // --------------------------------------------------------------------------- diff --git a/source/Lib/CommonLib/InterPrediction.cpp b/source/Lib/CommonLib/InterPrediction.cpp index 6b8f41dd6578afc3a285b1fd11fcfa1449a4a8a3..f192cdbc390515bdefd9a8065b226bc0b056ba06 100644 --- a/source/Lib/CommonLib/InterPrediction.cpp +++ b/source/Lib/CommonLib/InterPrediction.cpp @@ -387,6 +387,7 @@ void InterPrediction::xSubPuBio(PredictionUnit& pu, PelUnitBuf& predBuf, const R } } } +#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE void InterPrediction::xChromaMC(PredictionUnit &pu, PelUnitBuf& pcYuvPred) { // separated tree, chroma @@ -414,7 +415,7 @@ void InterPrediction::xChromaMC(PredictionUnit &pu, PelUnitBuf& pcYuvPred) } } } - +#endif void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList& eRefPicList, PelUnitBuf& pcYuvPred, const bool& bi , const bool& bioApplied @@ -1294,6 +1295,7 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu // dual tree handling for IBC as the only ref if ((!luma || !chroma) && eRefPicList == REF_PIC_LIST_0) { +#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE if (!luma && chroma) { xChromaMC(pu, predBuf); @@ -1301,11 +1303,14 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu } else // (luma && !chroma) { +#endif xPredInterUni(pu, eRefPicList, predBuf, false , false , luma, chroma); return; +#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE } +#endif } // else, go with regular MC below CodingStructure &cs = *pu.cs; diff --git a/source/Lib/CommonLib/InterPrediction.h b/source/Lib/CommonLib/InterPrediction.h index 3f22258b7012b6067cde1325de6c7bf922d38e11..3e1e7d2bae98a8f9954968cf8b7b7aba1133565e 100644 --- a/source/Lib/CommonLib/InterPrediction.h +++ b/source/Lib/CommonLib/InterPrediction.h @@ -161,7 +161,9 @@ protected: MotionInfo m_SubPuMiBuf[(MAX_CU_SIZE * MAX_CU_SIZE) >> (MIN_CU_LOG2 << 1)]; +#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE void xChromaMC(PredictionUnit &pu, PelUnitBuf& pcYuvPred); +#endif #if JVET_J0090_MEMORY_BANDWITH_MEASURE CacheModel *m_cacheModel; #endif diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 3d387b7d0aa5ecd12b1864122ae6abdace94d645..51316ba78bf2ea08425a1c6036bb42d70d6f9bb1 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -50,6 +50,8 @@ #include <assert.h> #include <cassert> +#define JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE 1 // JVET-O0258 Remove chroma IBC when dualtree is used + #define JVET_O1161_IBC_MAX_SIZE 1 // Limit largest IBC luma CU size to 64x64 per discussion of JVET-O1161 #define JVET_O0315_RDPCM_INTRAMODE_ALIGN 1 // JVET-O0200/O0205/O0296/O0342/O0463/O0542: Intra prediction mode alignment for BDPCM diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index 5e92a62406d08232eedfbb695fdf97e5cbddc203..3f56195fa7e00ef08b69b08433c9b3934d51dee3 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -955,8 +955,11 @@ void CABACReader::affine_amvr_mode( CodingUnit& cu, MergeCtx& mrgCtx ) void CABACReader::pred_mode( CodingUnit& cu ) { RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET( STATS__CABAC_BITS__PRED_MODE ); - +#if JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE + if (cu.cs->slice->getSPS()->getIBCFlag() && cu.chType != CHANNEL_TYPE_CHROMA) +#else if (cu.cs->slice->getSPS()->getIBCFlag()) +#endif { if ( cu.cs->slice->isIntra() || ( cu.lwidth() == 4 && cu.lheight() == 4 ) ) { diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp index e70564ea024068adadfb929a3c19734e0f9b7ff5..37ae687126e5b52072dd1216439e0a748f8ab081 100644 --- a/source/Lib/EncoderLib/CABACWriter.cpp +++ b/source/Lib/EncoderLib/CABACWriter.cpp @@ -730,7 +730,11 @@ void CABACWriter::cu_skip_flag( const CodingUnit& cu ) void CABACWriter::pred_mode( const CodingUnit& cu ) { +#if JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE + if (cu.cs->slice->getSPS()->getIBCFlag() && cu.chType != CHANNEL_TYPE_CHROMA) +#else if (cu.cs->slice->getSPS()->getIBCFlag()) +#endif { if ( cu.cs->slice->isIntra() || ( cu.lwidth() == 4 && cu.lheight() == 4 ) ) { diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp index f71b0ca6a3443dc13034d6d2e362cb78fa397ff7..a550419d3865d48c2ba27be781556951ceeb2b11 100644 --- a/source/Lib/EncoderLib/EncCu.cpp +++ b/source/Lib/EncoderLib/EncCu.cpp @@ -3258,9 +3258,10 @@ void EncCu::xCheckRDCostIBCMode(CodingStructure *&tempCS, CodingStructure *&best pu.interDir = 1; // use list 0 for IBC mode pu.refIdx[REF_PIC_LIST_0] = MAX_NUM_REF; // last idx in the list - +#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE if (partitioner.chType == CHANNEL_TYPE_LUMA) { +#endif bool bValid = m_pcInterSearch->predIBCSearch(cu, partitioner, m_ctuIbcSearchRangeX, m_ctuIbcSearchRangeY, m_ibcHashMap); if (bValid) @@ -3305,6 +3306,7 @@ void EncCu::xCheckRDCostIBCMode(CodingStructure *&tempCS, CodingStructure *&best tempCS->cost = MAX_DOUBLE; tempCS->costDbOffset = 0; } +#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE } // chroma CU ibc comp else @@ -3372,7 +3374,8 @@ void EncCu::xCheckRDCostIBCMode(CodingStructure *&tempCS, CodingStructure *&best tempCS->costDbOffset = 0; } } - } +#endif +} // check ibc mode in encoder RD ////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/Lib/EncoderLib/EncModeCtrl.cpp b/source/Lib/EncoderLib/EncModeCtrl.cpp index 035242ea07184c7dc4d0b630c052e99f542afe69..e59cca54ea2c5c10aaeff097391aad3904be5e53 100644 --- a/source/Lib/EncoderLib/EncModeCtrl.cpp +++ b/source/Lib/EncoderLib/EncModeCtrl.cpp @@ -1183,6 +1183,9 @@ void EncModeCtrlMTnoRQT::initCULevel( Partitioner &partitioner, const CodingStru bool checkIbc = true; if (partitioner.chType == CHANNEL_TYPE_CHROMA) { +#if JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE + checkIbc = false; +#else IbcLumaCoverage ibcLumaCoverage = cs.getIbcLumaCoverage(cs.area.Cb()); switch (ibcLumaCoverage) { @@ -1200,6 +1203,7 @@ void EncModeCtrlMTnoRQT::initCULevel( Partitioner &partitioner, const CodingStru default: THROW("Unknown IBC luma coverage type"); } +#endif } // Add coding modes here // NOTE: Working back to front, as a stack, which is more efficient with the container