diff --git a/source/Lib/CommonLib/Contexts.cpp b/source/Lib/CommonLib/Contexts.cpp index aa08f20a330d9509ab2eda3a4a9f7a1df9ab0bfa..a1037dbdc891af452afd4086058d72bc4780632d 100755 --- a/source/Lib/CommonLib/Contexts.cpp +++ b/source/Lib/CommonLib/Contexts.cpp @@ -321,6 +321,23 @@ const CtxSet ContextSetCfg::CclmModeFlag = ContextSetCfg::addCtxSet { 4, }, }); +#if JVET_P0615_CHROMAMODE_CLEANUP +const CtxSet ContextSetCfg::CclmModeIdx = ContextSetCfg::addCtxSet +({ + { 27, }, + { 27, }, + { 27, }, + { 9, }, + }); + +const CtxSet ContextSetCfg::IntraChromaPredMode = ContextSetCfg::addCtxSet +({ + { 25, }, + { 18, }, + { 34, }, + { 5, }, + }); +#else const CtxSet ContextSetCfg::IntraChromaPredMode = ContextSetCfg::addCtxSet ({ { 25, }, @@ -328,6 +345,7 @@ const CtxSet ContextSetCfg::IntraChromaPredMode = ContextSetCfg::addCtxSet { 19, }, { 6, }, }); +#endif const CtxSet ContextSetCfg::MipFlag = ContextSetCfg::addCtxSet ({ diff --git a/source/Lib/CommonLib/Contexts.h b/source/Lib/CommonLib/Contexts.h index c221037fc1e932468d05f61ec64255a1bc038dc3..519f6ac646ccd1f02df8fdb9aeae26c648f20a15 100644 --- a/source/Lib/CommonLib/Contexts.h +++ b/source/Lib/CommonLib/Contexts.h @@ -208,6 +208,9 @@ public: static const CtxSet IntraLumaMpmFlag; static const CtxSet IntraLumaPlanarFlag; static const CtxSet CclmModeFlag; +#if JVET_P0615_CHROMAMODE_CLEANUP + static const CtxSet CclmModeIdx; +#endif static const CtxSet IntraChromaPredMode; static const CtxSet MipFlag; static const CtxSet DeltaQP; diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 2351ba30dd3a2375e8cea2b05e2a97ae54353d2e..7511f9a15735876c252724db29d90317c4c0f152 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -50,6 +50,8 @@ #include <assert.h> #include <cassert> +#define JVET_P0615_CHROMAMODE_CLEANUP 1 // JVET-P0615: intra chroma mode coding cleanup + #define JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR 1 // JVET-P0667: removing signaling of qp offset table for JCCR, at SPS and PPS, when JCCR is disabled. #define JVET_P0298_DISABLE_LEVELMAPPING_IN_BYPASS 1 // JVET-P0298: Disable level mapping in bypass mode diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index 260c5751ff7efb6e827f63545d370e7a20bbb8e7..db62d52ddc215410ca27e6470c60f7e4862b373c 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -1427,7 +1427,11 @@ bool CABACReader::intra_chroma_lmc_mode(PredictionUnit& pu) int lmModeList[10]; PU::getLMSymbolList(pu, lmModeList); +#if JVET_P0615_CHROMAMODE_CLEANUP + int symbol = m_BinDecoder.decodeBin(Ctx::CclmModeIdx(0)); +#else int symbol = m_BinDecoder.decodeBin(Ctx::IntraChromaPredMode(0)); +#endif if (symbol == 0) { diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp index 6d9ab1d4a2f624f10b31b4f0cc32f8e4f9c40544..d45a177a094ccd0c45566204ef486cc12eb8c5fe 100644 --- a/source/Lib/EncoderLib/CABACWriter.cpp +++ b/source/Lib/EncoderLib/CABACWriter.cpp @@ -1198,7 +1198,11 @@ void CABACWriter::intra_chroma_lmc_mode(const PredictionUnit& pu) } CHECK(symbol < 0, "invalid symbol found"); +#if JVET_P0615_CHROMAMODE_CLEANUP + m_BinEncoder.encodeBin(symbol == 0 ? 0 : 1, Ctx::CclmModeIdx(0)); +#else m_BinEncoder.encodeBin(symbol == 0 ? 0 : 1, Ctx::IntraChromaPredMode(0)); +#endif if (symbol > 0) {