diff --git a/source/Lib/CommonLib/CodingStructure.cpp b/source/Lib/CommonLib/CodingStructure.cpp index adbec8ed09fddb2f5ea4241cf9c9a2aae5312b49..1ce918f7872f4abf3030b1fde7c9a00ee420ecf5 100644 --- a/source/Lib/CommonLib/CodingStructure.cpp +++ b/source/Lib/CommonLib/CodingStructure.cpp @@ -900,9 +900,7 @@ void CodingStructure::reorderPrevPLT(PLTBuf& prevPLT, uint8_t curPLTSize[MAX_NUM uint8_t tempCurPLTsize[MAX_NUM_CHANNEL_TYPE]; uint8_t stuffPLTsize[MAX_NUM_COMPONENT]; -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE uint32_t maxPredPltSize = jointPLT ? MAXPLTPREDSIZE : MAXPLTPREDSIZE_DUALTREE; -#endif for (int i = compBegin; i < (compBegin + numComp); i++) { @@ -918,11 +916,7 @@ void CodingStructure::reorderPrevPLT(PLTBuf& prevPLT, uint8_t curPLTSize[MAX_NUM if (ch > 1) break; for (int i = 0; i < prevPLT.curPLTSize[comID]; i++) { -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE if (tempCurPLTsize[comID] + stuffPLTsize[ch] >= maxPredPltSize) -#else - if (tempCurPLTsize[comID] + stuffPLTsize[ch] >= MAXPLTPREDSIZE) -#endif break; if (!reuseflag[comID][i]) @@ -946,9 +940,7 @@ void CodingStructure::reorderPrevPLT(PLTBuf& prevPLT, uint8_t curPLTSize[MAX_NUM ComponentID comID = jointPLT ? (ComponentID)compBegin : ((i > 0) ? COMPONENT_Cb : COMPONENT_Y); prevPLT.curPLTSize[comID] = curPLTSize[comID] + stuffPLTsize[comID]; memcpy(prevPLT.curPLT[i], stuffedPLT[i], prevPLT.curPLTSize[comID] * sizeof(Pel)); -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE CHECK(prevPLT.curPLTSize[comID] > maxPredPltSize, " Maximum palette predictor size exceed limit"); -#endif } } diff --git a/source/Lib/CommonLib/CommonDef.h b/source/Lib/CommonLib/CommonDef.h index 834705078ac5f97fcaa95219e6b8a6faabcca3d5..17ed18d9bb2dca1f5a89902f0a3efd1f681f5ebd 100644 --- a/source/Lib/CommonLib/CommonDef.h +++ b/source/Lib/CommonLib/CommonDef.h @@ -500,10 +500,8 @@ static const int NUM_TRELLIS_STATE = 3; static const double ENC_CHROMA_WEIGHTING = 0.8; static const int MAXPLTPREDSIZE = 63; static const int MAXPLTSIZE = 31; -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE static const int MAXPLTPREDSIZE_DUALTREE = 31; static const int MAXPLTSIZE_DUALTREE = 15; -#endif static const double PLT_CHROMA_WEIGHTING = 0.8; static const int PLT_ENCBITDEPTH = 8; static const int PLT_FAST_RATIO = 100; diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 89644884938fafddbae93e715d8ee29113a5cbf8..95b89cdf72c9187e484fdc5a0713c76206ad5074 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -85,7 +85,6 @@ -#define JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE 1 // JVET-Q0291: reduce palette size of dual tree from 31 to 15 and palette predictor size of dual tree from 63 to 31 #define JVET_Q0330_BLOCK_PARTITION 1 // JVET-Q0330: fix the block partitioning at picture boundary diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index fd317978f308c706e584207e0802091c11c938e0..96deabca335899ac0d3478f385b2e92da0eba345 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -1708,17 +1708,11 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_ #endif cu.lastPLTSize[compBegin] = cu.cs->prevPLT.curPLTSize[compBegin]; -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE int maxPltSize = cu.isSepTree() ? MAXPLTSIZE_DUALTREE : MAXPLTSIZE; -#endif if (cu.lastPLTSize[compBegin]) { -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE xDecodePLTPredIndicator(cu, maxPltSize, compBegin); -#else - xDecodePLTPredIndicator(cu, MAXPLTSIZE, compBegin); -#endif } for (int idx = 0; idx < cu.lastPLTSize[compBegin]; idx++) @@ -1748,11 +1742,7 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_ } uint32_t recievedPLTnum = 0; -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE if (curPLTidx < maxPltSize) -#else - if (curPLTidx < MAXPLTSIZE) -#endif { recievedPLTnum = exp_golomb_eqprob(0); } @@ -1828,9 +1818,7 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_ { cuPaletteSubblockInfo(cu, compBegin, numComp, subSetId, prevRunPos, prevRunType); } -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE CHECK(cu.curPLTSize[compBegin] > maxPltSize, " Current palette size is larger than maximum palette size"); -#endif } void CABACReader::cuPaletteSubblockInfo(CodingUnit& cu, ComponentID compBegin, uint32_t numComp, int subSetId, uint32_t& prevRunPos, unsigned& prevRunType) { diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp index de52d347776178ef2d92876fac1ac98b77a5209c..914eee1c550ef545a11b55fb286e92d21e5d445d 100644 --- a/source/Lib/EncoderLib/CABACWriter.cpp +++ b/source/Lib/EncoderLib/CABACWriter.cpp @@ -1494,18 +1494,12 @@ void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, u TransformUnit& tu = *cu.firstTU; uint32_t indexMaxSize = cu.useEscape[compBegin] ? (cu.curPLTSize[compBegin] + 1) : cu.curPLTSize[compBegin]; -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE int maxPltSize = cu.isSepTree() ? MAXPLTSIZE_DUALTREE : MAXPLTSIZE; -#endif if (cu.lastPLTSize[compBegin]) { -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE xEncodePLTPredIndicator(cu, maxPltSize, compBegin); -#else - xEncodePLTPredIndicator(cu, MAXPLTSIZE, compBegin); -#endif } uint32_t reusedPLTnum = 0; @@ -1514,11 +1508,7 @@ void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, u if (cu.reuseflag[compBegin][idx]) reusedPLTnum++; } -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE if (reusedPLTnum < maxPltSize) -#else - if (reusedPLTnum < MAXPLTSIZE) -#endif { exp_golomb_eqprob(cu.curPLTSize[compBegin] - reusedPLTnum, 0); } @@ -1572,9 +1562,7 @@ void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, u { cuPaletteSubblockInfo(cu, compBegin, numComp, subSetId, prevRunPos, prevRunType); } -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE CHECK(cu.curPLTSize[compBegin] > maxPltSize, " Current palette size is larger than maximum palette size"); -#endif } void CABACWriter::cuPaletteSubblockInfo(const CodingUnit& cu, ComponentID compBegin, uint32_t numComp, int subSetId, uint32_t& prevRunPos, unsigned& prevRunType) { diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp index f11baf4af3f429d392d4dc979fdda89a8fcb39db..84e066c76fa71b64cdf4715ad81929ef46dd0648 100644 --- a/source/Lib/EncoderLib/IntraSearch.cpp +++ b/source/Lib/EncoderLib/IntraSearch.cpp @@ -2463,9 +2463,7 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, pcmShiftRight_C = 0; } -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE int maxPltSize = cu.isSepTree() ? MAXPLTSIZE_DUALTREE : MAXPLTSIZE; -#endif uint32_t height = cu.block(compBegin).height; uint32_t width = cu.block(compBegin).width; @@ -2505,11 +2503,7 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, SortingElement *pelList = new SortingElement[totalSize]; SortingElement element; SortingElement *pelListSort = new SortingElement[MAXPLTSIZE + 1]; -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE uint32_t dictMaxSize = maxPltSize; -#else - uint32_t dictMaxSize = MAXPLTSIZE; -#endif uint32_t idx = 0; int last = -1; @@ -2709,11 +2703,7 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, #endif { pelListSort[j].copyAllFrom(pelListSort[j - 1], compBegin, numComp); -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE dictMaxSize = std::min(dictMaxSize + 1, (uint32_t)maxPltSize); -#else - dictMaxSize = std::min(dictMaxSize + 1, (uint32_t)MAXPLTSIZE); -#endif } else { @@ -2738,11 +2728,7 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, double reuseflagCost; #endif #if JVET_Q0504_PLT_NON444 -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE for (int i = 0; i < maxPltSize; i++) -#else - for( int i = 0; i < MAXPLTSIZE; i++ ) -#endif { if( pelListSort[i].getCnt(MAX_NUM_COMPONENT) ) { @@ -2875,11 +2861,7 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, } } #else -#if JVET_Q0291_REDUCE_DUALTREE_PLT_SIZE for (int i = 0; i < maxPltSize; i++) -#else - for (int i = 0; i < MAXPLTSIZE; i++) -#endif { if (pelListSort[i].getCnt()) {