diff --git a/source/Lib/CommonLib/CodingStructure.cpp b/source/Lib/CommonLib/CodingStructure.cpp index 3df44f2c9b3127516eaad3b4f5b483b788ec0d1a..995c1703ab036da9e5d0c26ae373692e4a82d631 100644 --- a/source/Lib/CommonLib/CodingStructure.cpp +++ b/source/Lib/CommonLib/CodingStructure.cpp @@ -731,13 +731,13 @@ void CodingStructure::resetPrevPLT(PLTBuf& prevPLT) } } -void CodingStructure::reorderPrevPLT(PLTBuf& prevPLT, uint32_t curPLTSize[MAX_NUM_COMPONENT], Pel curPLT[MAX_NUM_COMPONENT][MAXPLTSIZE], bool reuseflag[MAX_NUM_COMPONENT][MAXPLTPREDSIZE], uint32_t compBegin, uint32_t NumComp, bool jointPLT) +void CodingStructure::reorderPrevPLT(PLTBuf& prevPLT, uint32_t curPLTSize[MAX_NUM_COMPONENT], Pel curPLT[MAX_NUM_COMPONENT][MAXPLTSIZE], bool reuseflag[MAX_NUM_COMPONENT][MAXPLTPREDSIZE], uint32_t compBegin, uint32_t numComp, bool jointPLT) { Pel stuffedPLT[MAX_NUM_COMPONENT][MAXPLTPREDSIZE]; uint32_t tempCurPLTsize[MAX_NUM_COMPONENT]; uint32_t stuffPLTsize[MAX_NUM_COMPONENT]; - for (int i = compBegin; i < (compBegin + NumComp); i++) + for (int i = compBegin; i < (compBegin + numComp); i++) { ComponentID comID = jointPLT ? (ComponentID)compBegin : ((i > 0) ? COMPONENT_Cb : COMPONENT_Y); tempCurPLTsize[comID] = curPLTSize[comID]; @@ -745,7 +745,7 @@ void CodingStructure::reorderPrevPLT(PLTBuf& prevPLT, uint32_t curPLTSize[MAX_NU memcpy(stuffedPLT[i], curPLT[i], curPLTSize[comID] * sizeof(Pel)); } - for (int ch = compBegin; ch < (compBegin + NumComp); ch++) + for (int ch = compBegin; ch < (compBegin + numComp); ch++) { ComponentID comID = jointPLT ? (ComponentID)compBegin : ((ch > 0) ? COMPONENT_Cb : COMPONENT_Y); if (ch > 1) break; @@ -770,7 +770,7 @@ void CodingStructure::reorderPrevPLT(PLTBuf& prevPLT, uint32_t curPLTSize[MAX_NU } } - for (int i = compBegin; i < (compBegin + NumComp); i++) + for (int i = compBegin; i < (compBegin + numComp); i++) { ComponentID comID = jointPLT ? (ComponentID)compBegin : ((i > 0) ? COMPONENT_Cb : COMPONENT_Y); prevPLT.curPLTSize[comID] = curPLTSize[comID] + stuffPLTsize[comID]; diff --git a/source/Lib/CommonLib/CodingStructure.h b/source/Lib/CommonLib/CodingStructure.h index 1c9b86ee7169fbfac71eb72f119cb457d1054ba8..11161c9a0cd60c6b1e8759841f3299bbd11a06e2 100644 --- a/source/Lib/CommonLib/CodingStructure.h +++ b/source/Lib/CommonLib/CodingStructure.h @@ -200,7 +200,7 @@ public: #if JVET_O0119_BASE_PALETTE_444 PLTBuf prevPLT; void resetPrevPLT(PLTBuf& prevPLT); - void reorderPrevPLT(PLTBuf& prevPLT, uint32_t curPLTSize[MAX_NUM_COMPONENT], Pel curPLT[MAX_NUM_COMPONENT][MAXPLTSIZE], bool reuseflag[MAX_NUM_COMPONENT][MAXPLTPREDSIZE], uint32_t compBegin, uint32_t NumComp, bool jointPLT); + void reorderPrevPLT(PLTBuf& prevPLT, uint32_t curPLTSize[MAX_NUM_COMPONENT], Pel curPLT[MAX_NUM_COMPONENT][MAXPLTSIZE], bool reuseflag[MAX_NUM_COMPONENT][MAXPLTPREDSIZE], uint32_t compBegin, uint32_t numComp, bool jointPLT); #endif private: diff --git a/source/Lib/CommonLib/IntraPrediction.cpp b/source/Lib/CommonLib/IntraPrediction.cpp index 6185fc70caa48bad10ca61be5dbda1928acc0b5a..08eac0b91d9cb1252587b282237640b387954103 100644 --- a/source/Lib/CommonLib/IntraPrediction.cpp +++ b/source/Lib/CommonLib/IntraPrediction.cpp @@ -2009,7 +2009,7 @@ bool IntraPrediction::calIndexRun(CodingStructure &cs, Partitioner& partitioner, } return true; } -void IntraPrediction::reorderPLT(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t NumComp) +void IntraPrediction::reorderPLT(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t numComp) { CodingUnit &cu = *cs.getCU(partitioner.chType); @@ -2036,7 +2036,7 @@ void IntraPrediction::reorderPLT(CodingStructure& cs, Partitioner& partitioner, for (curidx = 0; curidx < cu.curPLTSize[compBegin]; curidx++) { bool matchTmp = true; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { matchTmp = matchTmp && (cu.curPLT[comp][curidx] == cs.prevPLT.curPLT[comp][predidx]); } @@ -2051,7 +2051,7 @@ void IntraPrediction::reorderPLT(CodingStructure& cs, Partitioner& partitioner, { cu.reuseflag[compBegin][predidx] = true; curPLTpred[curidx] = true; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { curPLTtmp[comp][reusePLTSizetmp] = cs.prevPLT.curPLT[comp][predidx]; } @@ -2064,7 +2064,7 @@ void IntraPrediction::reorderPLT(CodingStructure& cs, Partitioner& partitioner, { if (!curPLTpred[curidx]) { - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { curPLTtmp[comp][PLTSizetmp] = cu.curPLT[comp][curidx]; } @@ -2074,7 +2074,7 @@ void IntraPrediction::reorderPLT(CodingStructure& cs, Partitioner& partitioner, assert(PLTSizetmp == cu.curPLTSize[compBegin]); for (int curidx = 0; curidx < cu.curPLTSize[compBegin]; curidx++) { - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { cu.curPLT[comp][curidx] = curPLTtmp[comp][curidx]; } diff --git a/source/Lib/CommonLib/IntraPrediction.h b/source/Lib/CommonLib/IntraPrediction.h index ede6cf18a12dcc71d09654398ed628bc04a90ba3..e419eeedeb89d1a735b2cf70072b899ff60e8e68 100644 --- a/source/Lib/CommonLib/IntraPrediction.h +++ b/source/Lib/CommonLib/IntraPrediction.h @@ -175,7 +175,7 @@ public: void switchBuffer (const PredictionUnit &pu, ComponentID compID, PelBuf srcBuff, Pel *dst); void geneIntrainterPred (const CodingUnit &cu); #if JVET_O0119_BASE_PALETTE_444 - void reorderPLT(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t NumComp); + void reorderPLT(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t numComp); bool calCopyRun(CodingStructure &cs, Partitioner& partitioner, uint32_t uiStartPos, uint32_t uiTotal, uint32_t &uiRun, ComponentID compBegin); bool calIndexRun(CodingStructure &cs, Partitioner& partitioner, uint32_t uiStartPos, uint32_t uiTotal, uint32_t &uiRun, ComponentID compBegin); #endif diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 16c693db3896dcd6e513cdcc45c959d01a86cce1..e4e4498e4dcbe93997f6564c551be7ab8218796c 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -1039,24 +1039,24 @@ public: uiData[0] = uiData[1] = uiData[2] = 0; uiSumData[0] = uiSumData[1] = uiSumData[2] = 0; } - void resetAll(ComponentID compBegin, uint32_t NumComp) { + void resetAll(ComponentID compBegin, uint32_t numComp) { uiShift = uiLastCnt = 0; - for (int ch = compBegin; ch < (compBegin + NumComp); ch++) + for (int ch = compBegin; ch < (compBegin + numComp); ch++) { uiData[ch] = 0; uiSumData[ch] = 0; } } - void setAll(uint32_t* ui, ComponentID compBegin, uint32_t NumComp) { - for (int ch = compBegin; ch < (compBegin + NumComp); ch++) + void setAll(uint32_t* ui, ComponentID compBegin, uint32_t numComp) { + for (int ch = compBegin; ch < (compBegin + numComp); ch++) { uiData[ch] = ui[ch]; } } - bool almostEqualData(SortingElement sElement, int iErrorLimit, const BitDepths& bitDepths, ComponentID compBegin, uint32_t NumComp) + bool almostEqualData(SortingElement sElement, int iErrorLimit, const BitDepths& bitDepths, ComponentID compBegin, uint32_t numComp) { bool bAlmostEqual = true; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { ChannelType chType = (comp > 0) ? CHANNEL_TYPE_CHROMA : CHANNEL_TYPE_LUMA; if ((std::abs(uiData[comp] - sElement.uiData[comp]) >> (bitDepths.recon[chType] - PLT_ENCBITDEPTH)) > iErrorLimit) @@ -1067,37 +1067,37 @@ public: } return bAlmostEqual; } - uint32_t getSAD(SortingElement sElement, const BitDepths& bitDepths, ComponentID compBegin, uint32_t NumComp) + uint32_t getSAD(SortingElement sElement, const BitDepths& bitDepths, ComponentID compBegin, uint32_t numComp) { uint32_t uiSAD = 0; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { ChannelType chType = (comp > 0) ? CHANNEL_TYPE_CHROMA : CHANNEL_TYPE_LUMA; uiSAD += (std::abs(uiData[comp] - sElement.uiData[comp]) >> (bitDepths.recon[chType] - PLT_ENCBITDEPTH)); } return uiSAD; } - void copyDataFrom(SortingElement sElement, ComponentID compBegin, uint32_t NumComp) { - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + void copyDataFrom(SortingElement sElement, ComponentID compBegin, uint32_t numComp) { + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { uiData[comp] = sElement.uiData[comp]; uiSumData[comp] = uiData[comp]; } uiShift = 0; uiLastCnt = 1; } - void copyAllFrom(SortingElement sElement, ComponentID compBegin, uint32_t NumComp) { - copyDataFrom(sElement, compBegin, NumComp); + void copyAllFrom(SortingElement sElement, ComponentID compBegin, uint32_t numComp) { + copyDataFrom(sElement, compBegin, numComp); uiCnt = sElement.uiCnt; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { uiSumData[comp] = sElement.uiSumData[comp]; } uiLastCnt = sElement.uiLastCnt; uiShift = sElement.uiShift; } - void addElement(const SortingElement& sElement, ComponentID compBegin, uint32_t NumComp) + void addElement(const SortingElement& sElement, ComponentID compBegin, uint32_t numComp) { uiCnt++; - for (int i = compBegin; i<(compBegin + NumComp); i++) + for (int i = compBegin; i<(compBegin + numComp); i++) { uiSumData[i] += sElement.uiData[i]; } @@ -1105,7 +1105,7 @@ public: { uint32_t uiRnd = 1 << uiShift; uiShift++; - for (int i = compBegin; i<(compBegin + NumComp); i++) + for (int i = compBegin; i<(compBegin + numComp); i++) { uiData[i] = (uiSumData[i] + uiRnd) >> uiShift; } diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index 62467bd579ee52d6f1e51d77b2ca919e5ddb98e2..72891895ed3d31fde505d515190b3a80d3632416 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -604,30 +604,30 @@ bool CABACReader::coding_tree( CodingStructure& cs, Partitioner& partitioner, CU #if JVET_O0119_BASE_PALETTE_444 uint32_t compBegin; - uint32_t NumComp; + uint32_t numComp; bool jointPLT = false; if (CS::isDualITree(*cu.cs)) { if (isLuma(partitioner.chType)) { compBegin = COMPONENT_Y; - NumComp = 1; + numComp = 1; } else { compBegin = COMPONENT_Cb; - NumComp = 2; + numComp = 2; } } else { compBegin = COMPONENT_Y; - NumComp = 3; + numComp = 3; jointPLT = true; } if (CU::isPLT(cu)) { - cs.reorderPrevPLT(cs.prevPLT, cu.curPLTSize, cu.curPLT, cu.reuseflag, compBegin, NumComp, jointPLT); + cs.reorderPrevPLT(cs.prevPLT, cu.curPLTSize, cu.curPLT, cu.reuseflag, compBegin, numComp, jointPLT); } #endif DTRACE( g_trace_ctx, D_QP, "x=%d, y=%d, w=%d, h=%d, qp=%d\n", cu.Y().x, cu.Y().y, cu.Y().width, cu.Y().height, cu.qp ); @@ -1599,7 +1599,7 @@ bool CABACReader::end_of_ctu( CodingUnit& cu, CUCtx& cuCtx ) } #if JVET_O0119_BASE_PALETTE_444 -void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_t NumComp, CUCtx& cuCtx) +void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_t numComp, CUCtx& cuCtx) { const SPS& sps = *(cu.cs->sps); TransformUnit& tu = *cu.firstTU; @@ -1616,7 +1616,7 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_ { if (cu.reuseflag[compBegin][idx]) { - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { cu.curPLT[comp][curPLTidx] = cu.cs->prevPLT.curPLT[comp][idx]; } @@ -1632,7 +1632,7 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_ } cu.curPLTSize[compBegin] = curPLTidx + recievedPLTnum; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { for (int idx = curPLTidx; idx < cu.curPLTSize[compBegin]; idx++) { @@ -1821,7 +1821,7 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_ uint32_t scaleX = getComponentScaleX(COMPONENT_Cb, sps.getChromaFormatIdc()); uint32_t scaleY = getComponentScaleY(COMPONENT_Cb, sps.getChromaFormatIdc()); - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { ComponentID compID = (ComponentID)comp; for (strPos = 0; strPos < endPos; strPos++) @@ -1883,7 +1883,7 @@ void CABACReader::xDecodePLTPredIndicator(CodingUnit& cu, uint32_t uiMaxPLTSize, } } } -void CABACReader::xAdjustPLTIndex(CodingUnit& cu, Pel siCurLevel, uint32_t idx, PelBuf& PLTIdx, PLTtypeBuf& PLTrunType, int maxSymbol, ComponentID compBegin) +void CABACReader::xAdjustPLTIndex(CodingUnit& cu, Pel siCurLevel, uint32_t idx, PelBuf& paletteIdx, PLTtypeBuf& paletteRunType, int maxSymbol, ComponentID compBegin) { uint32_t uiSymbol; int iRefLevel = MAX_INT; @@ -1893,10 +1893,10 @@ void CABACReader::xAdjustPLTIndex(CodingUnit& cu, Pel siCurLevel, uint32_t idx, { uint32_t prevposy = m_puiScanOrder[idx - 1].y; uint32_t prevposx = m_puiScanOrder[idx - 1].x; - if (PLTrunType.at(prevposx, prevposy) == PLT_RUN_INDEX) + if (paletteRunType.at(prevposx, prevposy) == PLT_RUN_INDEX) { - iRefLevel = PLTIdx.at(prevposx, prevposy); - if (PLTIdx.at(prevposx, prevposy) == cu.curPLTSize[compBegin]) // escape + iRefLevel = paletteIdx.at(prevposx, prevposy); + if (paletteIdx.at(prevposx, prevposy) == cu.curPLTSize[compBegin]) // escape { iRefLevel = maxSymbol - 1; } @@ -1906,8 +1906,8 @@ void CABACReader::xAdjustPLTIndex(CodingUnit& cu, Pel siCurLevel, uint32_t idx, if (cu.useRotation[compBegin]) { assert(prevposx > 0); - iRefLevel = PLTIdx.at(posx - 1, posy); - if (PLTIdx.at(posx - 1, posy) == cu.curPLTSize[compBegin]) // escape mode + iRefLevel = paletteIdx.at(posx - 1, posy); + if (paletteIdx.at(posx - 1, posy) == cu.curPLTSize[compBegin]) // escape mode { iRefLevel = maxSymbol - 1; } @@ -1915,8 +1915,8 @@ void CABACReader::xAdjustPLTIndex(CodingUnit& cu, Pel siCurLevel, uint32_t idx, else { assert(prevposy > 0); - iRefLevel = PLTIdx.at(posx, posy - 1); - if (PLTIdx.at(posx, posy - 1) == cu.curPLTSize[compBegin]) // escape mode + iRefLevel = paletteIdx.at(posx, posy - 1); + if (paletteIdx.at(posx, posy - 1) == cu.curPLTSize[compBegin]) // escape mode { iRefLevel = maxSymbol - 1; } @@ -1929,7 +1929,7 @@ void CABACReader::xAdjustPLTIndex(CodingUnit& cu, Pel siCurLevel, uint32_t idx, { uiSymbol++; } - PLTIdx.at(posx, posy) = uiSymbol; + paletteIdx.at(posx, posy) = uiSymbol; } uint32_t CABACReader::cu_run_val(PLTRunMode runtype, const uint32_t uiPltIdx, const uint32_t uiMaxRun) { diff --git a/source/Lib/DecoderLib/CABACReader.h b/source/Lib/DecoderLib/CABACReader.h index 74cfd1ca73ae50eea86e33937e622ff31ebe4e49..9f41d2a78e032248e787a79b0896b562cea974b5 100644 --- a/source/Lib/DecoderLib/CABACReader.h +++ b/source/Lib/DecoderLib/CABACReader.h @@ -96,7 +96,7 @@ public: void mip_pred_modes ( CodingUnit& cu ); void mip_pred_mode ( PredictionUnit& pu ); #if JVET_O0119_BASE_PALETTE_444 - void cu_palette_info ( CodingUnit& cu, ComponentID compBegin, uint32_t NumComp, CUCtx& cuCtx); + void cu_palette_info ( CodingUnit& cu, ComponentID compBegin, uint32_t numComp, CUCtx& cuCtx); #endif // prediction unit (clause 7.3.8.6) @@ -177,7 +177,7 @@ private: #if JVET_O0119_BASE_PALETTE_444 void parseScanRotationModeFlag ( CodingUnit& cu, ComponentID compBegin); void xDecodePLTPredIndicator ( CodingUnit& cu, uint32_t uiMaxPLTSize, ComponentID compBegin); - void xAdjustPLTIndex ( CodingUnit& cu, Pel siCurLevel, uint32_t idx, PelBuf& PLTIdx, PLTtypeBuf& PLTrunType, int maxSymbol, ComponentID compBegin); + void xAdjustPLTIndex ( CodingUnit& cu, Pel siCurLevel, uint32_t idx, PelBuf& paletteIdx, PLTtypeBuf& paletteRunType, int maxSymbol, ComponentID compBegin); uint32_t cu_run_val ( PLTRunMode runtype, const uint32_t uiPltIdx, const uint32_t uiMaxRun); uint32_t xReadTruncUnarySymbol ( PLTRunMode runtype, uint32_t uiMax, uint32_t uiCtxT); uint32_t xReadTruncMsbP1RefinementBits( PLTRunMode runtype, uint32_t uiMax, uint32_t uiCtxT); diff --git a/source/Lib/DecoderLib/DecCu.cpp b/source/Lib/DecoderLib/DecCu.cpp index fcc66922703b4febdd7684b621875f0923f4877c..12184a634ba1255d932fa8aedbf590a3749e721f 100644 --- a/source/Lib/DecoderLib/DecCu.cpp +++ b/source/Lib/DecoderLib/DecCu.cpp @@ -400,7 +400,7 @@ void DecCu::xReconIntraQT( CodingUnit &cu ) } #if JVET_O0119_BASE_PALETTE_444 -void DecCu::xReconPLT(CodingUnit &cu, ComponentID compBegin, uint32_t NumComp) +void DecCu::xReconPLT(CodingUnit &cu, ComponentID compBegin, uint32_t numComp) { const SPS& sps = *(cu.cs->sps); TransformUnit& tu = *cu.firstTU; @@ -416,7 +416,7 @@ void DecCu::xReconPLT(CodingUnit &cu, ComponentID compBegin, uint32_t NumComp) { for (uint32_t uiX = 0; uiX < uiWidth; uiX++) { - for (uint32_t compID = compBegin; compID < (compBegin + NumComp); compID++) + for (uint32_t compID = compBegin; compID < (compBegin + numComp); compID++) { const int channelBitDepth = cu.cs->sps->getBitDepth(toChannelType((ComponentID)compID)); const CompArea &area = cu.blocks[compID]; @@ -468,7 +468,7 @@ void DecCu::xReconPLT(CodingUnit &cu, ComponentID compBegin, uint32_t NumComp) } } } - for (uint32_t compID = compBegin; compID < (compBegin + NumComp); compID++) + for (uint32_t compID = compBegin; compID < (compBegin + numComp); compID++) { const CompArea &area = cu.blocks[compID]; PelBuf piPicReco = cu.cs->getRecoBuf(area); diff --git a/source/Lib/DecoderLib/DecCu.h b/source/Lib/DecoderLib/DecCu.h index 4bdacd20dd312017d1b89fcd35a4d1718e52a7e1..6c7a6f83c4b80dfc79943964826a932416d02fd3 100644 --- a/source/Lib/DecoderLib/DecCu.h +++ b/source/Lib/DecoderLib/DecCu.h @@ -93,7 +93,7 @@ protected: void xDeriveCUMV ( CodingUnit& cu ); #if JVET_O0119_BASE_PALETTE_444 - void xReconPLT ( CodingUnit &cu, ComponentID compBegin, uint32_t NumComp); + void xReconPLT ( CodingUnit &cu, ComponentID compBegin, uint32_t numComp); #endif PelStorage *m_tmpStorageLCU; private: diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp index 8251289c7d39574bf406a1ce2d736aabf9622921..612960713e7527d6303938797a4a3c606a783d71 100644 --- a/source/Lib/EncoderLib/CABACWriter.cpp +++ b/source/Lib/EncoderLib/CABACWriter.cpp @@ -1454,7 +1454,7 @@ void CABACWriter::end_of_ctu( const CodingUnit& cu, CUCtx& cuCtx ) } #if JVET_O0119_BASE_PALETTE_444 -void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, uint32_t NumComp, CUCtx& cuCtx) +void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, uint32_t numComp, CUCtx& cuCtx) { const SPS& sps = *(cu.cs->sps); TransformUnit& tu = *cu.firstTU; @@ -1479,7 +1479,7 @@ void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, u exp_golomb_eqprob(cu.curPLTSize[compBegin] - reusedPLTnum, 0); } - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { for (int idx = cu.reusePLTSize[compBegin]; idx < cu.curPLTSize[compBegin]; idx++) { @@ -1628,7 +1628,7 @@ void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, u uint32_t scaleX = getComponentScaleX(COMPONENT_Cb, sps.getChromaFormatIdc()); uint32_t scaleY = getComponentScaleY(COMPONENT_Cb, sps.getChromaFormatIdc()); - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { ComponentID compID = (ComponentID)comp; for (strPos = 0; strPos < endPos; strPos++) @@ -1692,18 +1692,18 @@ void CABACWriter::xEncodePLTPredIndicator(const CodingUnit& cu, uint32_t uiMaxPL exp_golomb_eqprob(1, 0); } } -Pel CABACWriter::writePLTIndex(const CodingUnit& cu, uint32_t idx, PelBuf& PLTIdx, PLTtypeBuf& PLTrunType, int maxSymbol, ComponentID compBegin) +Pel CABACWriter::writePLTIndex(const CodingUnit& cu, uint32_t idx, PelBuf& paletteIdx, PLTtypeBuf& paletteRunType, int maxSymbol, ComponentID compBegin) { uint32_t posy = m_puiScanOrder[idx].y; uint32_t posx = m_puiScanOrder[idx].x; - Pel siCurLevel = (PLTIdx.at(posx, posy) == cu.curPLTSize[compBegin]) ? (maxSymbol - 1) : PLTIdx.at(posx, posy); + Pel siCurLevel = (paletteIdx.at(posx, posy) == cu.curPLTSize[compBegin]) ? (maxSymbol - 1) : paletteIdx.at(posx, posy); if (idx) // R0348: remove index redundancy { uint32_t prevposy = m_puiScanOrder[idx - 1].y; uint32_t prevposx = m_puiScanOrder[idx - 1].x; - if (PLTrunType.at(prevposx, prevposy) == PLT_RUN_INDEX) + if (paletteRunType.at(prevposx, prevposy) == PLT_RUN_INDEX) { - Pel siLeftLevel = PLTIdx.at(prevposx, prevposy); // left index + Pel siLeftLevel = paletteIdx.at(prevposx, prevposy); // left index if (siLeftLevel == cu.curPLTSize[compBegin]) // escape mode { siLeftLevel = maxSymbol - 1; @@ -1720,8 +1720,8 @@ Pel CABACWriter::writePLTIndex(const CodingUnit& cu, uint32_t idx, PelBuf& PLTId if (cu.useRotation[compBegin]) { assert(prevposx > 0); - siAboveLevel = PLTIdx.at(posx - 1, posy); - if (PLTIdx.at(posx - 1, posy) == cu.curPLTSize[compBegin]) // escape mode + siAboveLevel = paletteIdx.at(posx - 1, posy); + if (paletteIdx.at(posx - 1, posy) == cu.curPLTSize[compBegin]) // escape mode { siAboveLevel = maxSymbol - 1; } @@ -1729,8 +1729,8 @@ Pel CABACWriter::writePLTIndex(const CodingUnit& cu, uint32_t idx, PelBuf& PLTId else { assert(prevposy > 0); - siAboveLevel = PLTIdx.at(posx, posy - 1); - if (PLTIdx.at(posx, posy - 1) == cu.curPLTSize[compBegin]) // escape mode + siAboveLevel = paletteIdx.at(posx, posy - 1); + if (paletteIdx.at(posx, posy - 1) == cu.curPLTSize[compBegin]) // escape mode { siAboveLevel = maxSymbol - 1; } diff --git a/source/Lib/EncoderLib/CABACWriter.h b/source/Lib/EncoderLib/CABACWriter.h index 7401783f0706027d391023cbe26e480a3cd4504d..71b6d7bc42f0cc822a5293dfc3cb154ddaa62290 100644 --- a/source/Lib/EncoderLib/CABACWriter.h +++ b/source/Lib/EncoderLib/CABACWriter.h @@ -110,10 +110,10 @@ public: void mip_pred_modes ( const CodingUnit& cu ); void mip_pred_mode ( const PredictionUnit& pu ); #if JVET_O0119_BASE_PALETTE_444 - void cu_palette_info ( const CodingUnit& cu, ComponentID compBegin, uint32_t NumComp, CUCtx& cuCtx); + void cu_palette_info ( const CodingUnit& cu, ComponentID compBegin, uint32_t numComp, CUCtx& cuCtx); void cu_run_val ( uint32_t uiRun, PLTRunMode runtype, const uint32_t uiPltIdx, const uint32_t uiMaxRun); void encodeRunType ( const CodingUnit& cu, PLTtypeBuf& runType, uint32_t idx, ScanElement *refScanOrder, ComponentID compBegin); - Pel writePLTIndex ( const CodingUnit& cu, uint32_t idx, PelBuf& PLTIdx, PLTtypeBuf& PLTrunType, int maxSymbol, ComponentID compBegin); + Pel writePLTIndex ( const CodingUnit& cu, uint32_t idx, PelBuf& paletteIdx, PLTtypeBuf& paletteRunType, int maxSymbol, ComponentID compBegin); #endif // prediction unit (clause 7.3.8.6) void prediction_unit ( const PredictionUnit& pu ); diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp index f5d3d86ffad300530b62becaf97bcbfa92eed7c8..a49105a4d3deb34083e8663d1908e972ca64c280 100644 --- a/source/Lib/EncoderLib/EncCu.cpp +++ b/source/Lib/EncoderLib/EncCu.cpp @@ -601,25 +601,25 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par #endif #if JVET_O0119_BASE_PALETTE_444 uint32_t compBegin; - uint32_t NumComp; + uint32_t numComp; bool jointPLT = false; if (CS::isDualITree(*bestCS)) { if (isLuma(partitioner.chType)) { compBegin = COMPONENT_Y; - NumComp = 1; + numComp = 1; } else { compBegin = COMPONENT_Cb; - NumComp = 2; + numComp = 2; } } else { compBegin = COMPONENT_Y; - NumComp = 3; + numComp = 3; jointPLT = true; } SplitSeries splitmode = -1; @@ -627,7 +627,7 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par Pel bestLastPLT[MAX_NUM_COMPONENT][MAXPLTPREDSIZE]; // store LastPLT for partition uint32_t curLastPLTSize[MAX_NUM_COMPONENT]; Pel curLastPLT[MAX_NUM_COMPONENT][MAXPLTPREDSIZE]; // store LastPLT if no partition - for (int i = compBegin; i < (compBegin + NumComp); i++) + for (int i = compBegin; i < (compBegin + numComp); i++) { ComponentID comID = jointPLT ? (ComponentID)compBegin : ((i > 0) ? COMPONENT_Cb : COMPONENT_Y); bestLastPLTSize[comID] = 0; @@ -695,7 +695,7 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par do { #if JVET_O0119_BASE_PALETTE_444 - for (int i = compBegin; i < (compBegin + NumComp); i++) + for (int i = compBegin; i < (compBegin + numComp); i++) { ComponentID comID = jointPLT ? (ComponentID)compBegin : ((i > 0) ? COMPONENT_Cb : COMPONENT_Y); tempCS->prevPLT.curPLTSize[comID] = curLastPLTSize[comID]; @@ -817,7 +817,7 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par splitmode = bestCS->cus[0]->splitSeries; const CodingUnit& cu = *bestCS->cus.front(); cu.cs->prevPLT = bestCS->prevPLT; - for (int i = compBegin; i < (compBegin + NumComp); i++) + for (int i = compBegin; i < (compBegin + numComp); i++) { ComponentID comID = jointPLT ? (ComponentID)compBegin : ((i > 0) ? COMPONENT_Cb : COMPONENT_Y); bestLastPLTSize[comID] = bestCS->cus[0]->cs->prevPLT.curPLTSize[comID]; @@ -894,17 +894,17 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par { if (bestCS->cus[0]->predMode == MODE_PLT) { - for (int i = compBegin; i < (compBegin + NumComp); i++) + for (int i = compBegin; i < (compBegin + numComp); i++) { ComponentID comID = jointPLT ? (ComponentID)compBegin : ((i > 0) ? COMPONENT_Cb : COMPONENT_Y); bestCS->prevPLT.curPLTSize[comID] = curLastPLTSize[comID]; memcpy(bestCS->prevPLT.curPLT[i], curLastPLT[i], curLastPLTSize[comID] * sizeof(Pel)); } - bestCS->reorderPrevPLT(bestCS->prevPLT, bestCS->cus[0]->curPLTSize, bestCS->cus[0]->curPLT, bestCS->cus[0]->reuseflag, compBegin, NumComp, jointPLT); + bestCS->reorderPrevPLT(bestCS->prevPLT, bestCS->cus[0]->curPLTSize, bestCS->cus[0]->curPLT, bestCS->cus[0]->reuseflag, compBegin, numComp, jointPLT); } else { - for (int i = compBegin; i<(compBegin + NumComp); i++) + for (int i = compBegin; i<(compBegin + numComp); i++) { ComponentID comID = jointPLT ? (ComponentID)compBegin : ((i > 0) ? COMPONENT_Cb : COMPONENT_Y); bestCS->prevPLT.curPLTSize[comID] = curLastPLTSize[comID]; @@ -914,7 +914,7 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par } else { - for (int i = compBegin; i<(compBegin + NumComp); i++) + for (int i = compBegin; i<(compBegin + numComp); i++) { ComponentID comID = jointPLT ? (ComponentID)compBegin : ((i > 0) ? COMPONENT_Cb : COMPONENT_Y); bestCS->prevPLT.curPLTSize[comID] = bestLastPLTSize[comID]; diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp index 17f11a0bd86ce29430612cae7fa1f0f5b2b70228..da0973577e84428eb204b9e25d564fc416a0a1fb 100644 --- a/source/Lib/EncoderLib/IntraSearch.cpp +++ b/source/Lib/EncoderLib/IntraSearch.cpp @@ -1462,7 +1462,7 @@ void IntraSearch::xEncPCM(CodingStructure &cs, Partitioner& partitioner, const C } #if JVET_O0119_BASE_PALETTE_444 -void IntraSearch::PLTSearch(CodingStructure &cs, Partitioner& partitioner, ComponentID compBegin, uint32_t NumComp) +void IntraSearch::PLTSearch(CodingStructure &cs, Partitioner& partitioner, ComponentID compBegin, uint32_t numComp) { CodingUnit &cu = *cs.getCU(partitioner.chType); TransformUnit &tu = *cs.getTU(partitioner.chType); @@ -1480,17 +1480,17 @@ void IntraSearch::PLTSearch(CodingStructure &cs, Partitioner& partitioner, Compo bool *pRunType = tu.get_vRunType(compBegin); cu.lastPLTSize[compBegin] = cs.prevPLT.curPLTSize[compBegin]; //derive palette - derivePLTLossy(cs, partitioner, compBegin, NumComp); - reorderPLT(cs, partitioner, compBegin, NumComp); + derivePLTLossy(cs, partitioner, compBegin, numComp); + reorderPLT(cs, partitioner, compBegin, numComp); //calculate palette index - preCalcPLTIndex(cs, partitioner, compBegin, NumComp); + preCalcPLTIndex(cs, partitioner, compBegin, numComp); //derive run uint64_t uiBits = MAX_UINT; - deriveRunAndCalcBits(cs, partitioner, compBegin, NumComp, PLT_SCAN_HORTRAV, uiBits); + deriveRunAndCalcBits(cs, partitioner, compBegin, numComp, PLT_SCAN_HORTRAV, uiBits); if ((cu.curPLTSize[compBegin] + cu.useEscape[compBegin]) > 1) { - deriveRunAndCalcBits(cs, partitioner, compBegin, NumComp, PLT_SCAN_VERTRAV, uiBits); + deriveRunAndCalcBits(cs, partitioner, compBegin, numComp, PLT_SCAN_VERTRAV, uiBits); } cu.useRotation[compBegin] = m_bBestScanRotationMode; memcpy(pRunType, m_runTypeRD, sizeof(bool)*uiWidth*uiHeight); @@ -1507,7 +1507,7 @@ void IntraSearch::PLTSearch(CodingStructure &cs, Partitioner& partitioner, Compo } else { - for (uint32_t compID = compBegin; compID < (compBegin + NumComp); compID++) + for (uint32_t compID = compBegin; compID < (compBegin + numComp); compID++) { CompArea area = cu.blocks[compID]; PelBuf recBuf = cs.getRecoBuf(area); @@ -1535,7 +1535,7 @@ void IntraSearch::PLTSearch(CodingStructure &cs, Partitioner& partitioner, Compo cs.fracBits = MAX_UINT; cs.cost = MAX_DOUBLE; Distortion distortion = 0; - for (uint32_t comp = compBegin; comp < (compBegin + NumComp); comp++) + for (uint32_t comp = compBegin; comp < (compBegin + numComp); comp++) { const ComponentID compID = ComponentID(comp); CPelBuf reco = cs.getRecoBuf(compID); @@ -1570,7 +1570,7 @@ void IntraSearch::PLTSearch(CodingStructure &cs, Partitioner& partitioner, Compo cs.setDecomp(area); cs.picture->getRecoBuf(area).copyFrom(cs.getRecoBuf(area)); } -void IntraSearch::deriveRunAndCalcBits(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t NumComp, PLTScanMode pltScanMode, uint64_t& uiMinBits) +void IntraSearch::deriveRunAndCalcBits(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t numComp, PLTScanMode pltScanMode, uint64_t& uiMinBits) { CodingUnit &cu = *cs.getCU(partitioner.chType); TransformUnit &tu = *cs.getTU(partitioner.chType); @@ -1582,7 +1582,7 @@ void IntraSearch::deriveRunAndCalcBits(CodingStructure& cs, Partitioner& partiti cu.useRotation[compBegin] = (pltScanMode == PLT_SCAN_VERTRAV); // JC: rotate m_puiScanOrder = g_scanOrder[SCAN_UNGROUPED][(cu.useRotation[compBegin]) ? SCAN_TRAV_VER : SCAN_TRAV_HOR][gp_sizeIdxInfo->idxFrom(uiWidth)][gp_sizeIdxInfo->idxFrom(uiHeight)]; - deriveRun(cs, partitioner, compBegin, NumComp); + deriveRun(cs, partitioner, compBegin); m_CABACEstimator->getCtx() = PLTCtx(m_orgCtxRD); m_CABACEstimator->resetBits(); @@ -1590,7 +1590,7 @@ void IntraSearch::deriveRunAndCalcBits(CodingStructure& cs, Partitioner& partiti CUCtx cuCtx; cuCtx.isDQPCoded = true; cuCtx.isChromaQpAdjCoded = true; - m_CABACEstimator->cu_palette_info(cu, compBegin, NumComp, cuCtx); + m_CABACEstimator->cu_palette_info(cu, compBegin, numComp, cuCtx); uint64_t nBitsTemp = m_CABACEstimator->getEstFracBits(); if (uiMinBits > nBitsTemp) { @@ -1600,7 +1600,7 @@ void IntraSearch::deriveRunAndCalcBits(CodingStructure& cs, Partitioner& partiti uiMinBits = nBitsTemp; } } -void IntraSearch::deriveRun(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t NumComp) +void IntraSearch::deriveRun(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin) { CodingUnit &cu = *cs.getCU(partitioner.chType); TransformUnit &tu = *cs.getTU(partitioner.chType); @@ -1666,7 +1666,7 @@ void IntraSearch::deriveRun(CodingStructure& cs, Partitioner& partitioner, Compo } assert(uiIdx == uiTotal); } -double IntraSearch::getRunBits(const CodingUnit& cu, uint32_t run, uint32_t strPos, PLTRunMode PaletteRunMode, uint64_t* indexBits, uint64_t* runBits, ComponentID compBegin) +double IntraSearch::getRunBits(const CodingUnit& cu, uint32_t run, uint32_t strPos, PLTRunMode paletteRunMode, uint64_t* indexBits, uint64_t* runBits, ComponentID compBegin) { TransformUnit& tu = *cu.firstTU; uint32_t uiHeight = cu.block(compBegin).height; @@ -1681,7 +1681,7 @@ double IntraSearch::getRunBits(const CodingUnit& cu, uint32_t run, uint32_t str m_CABACEstimator->encodeRunType(cu, runType, strPos, m_puiScanOrder, compBegin); uint64_t RunTypeBits = m_CABACEstimator->getEstFracBits(); uint32_t curLevel = 0; - switch (PaletteRunMode) + switch (paletteRunMode) { case PLT_RUN_INDEX: curLevel = m_CABACEstimator->writePLTIndex(cu, strPos, curPLTIdx, runType, uiIndexMaxSize, compBegin); @@ -1700,7 +1700,7 @@ double IntraSearch::getRunBits(const CodingUnit& cu, uint32_t run, uint32_t str double dCostPerPixel = (double)m_CABACEstimator->getEstFracBits() / (double)run; return dCostPerPixel; } -void IntraSearch::preCalcPLTIndex(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t NumComp) +void IntraSearch::preCalcPLTIndex(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t numComp) { CodingUnit &cu = *cs.getCU(partitioner.chType); TransformUnit &tu = *cs.getTU(partitioner.chType); @@ -1713,7 +1713,7 @@ void IntraSearch::preCalcPLTIndex(CodingStructure& cs, Partitioner& partitioner, uint32_t uiWidth = cu.block(compBegin).width; CPelBuf orgBuf[3]; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { CompArea area = cu.blocks[comp]; if (m_pcEncCfg->getReshaper() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) @@ -1727,7 +1727,7 @@ void IntraSearch::preCalcPLTIndex(CodingStructure& cs, Partitioner& partitioner, } PelBuf curPLTIdx = tu.getcurPLTIdx(compBegin); - int iErrorLimit = NumComp * g_uhPLTQuant[cu.qp]; + int iErrorLimit = numComp * g_uhPLTQuant[cu.qp]; uint32_t uiBestIdx = 0; @@ -1743,7 +1743,7 @@ void IntraSearch::preCalcPLTIndex(CodingStructure& cs, Partitioner& partitioner, while (uiPLTIdx < cu.curPLTSize[compBegin]) { uint32_t uiAbsError = 0, pX, pY; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { pX = (comp > 0 && compBegin == COMPONENT_Y) ? (uiX >> scaleX) : uiX; pY = (comp > 0 && compBegin == COMPONENT_Y) ? (uiY >> scaleY) : uiY; @@ -1768,19 +1768,19 @@ void IntraSearch::preCalcPLTIndex(CodingStructure& cs, Partitioner& partitioner, { curPLTIdx.at(uiX, uiY) = cu.curPLTSize[compBegin]; cu.useEscape[compBegin] = true; - calcPixelPred(cs, partitioner, uiY, uiX, compBegin, NumComp); + calcPixelPred(cs, partitioner, uiY, uiX, compBegin, numComp); } } } } -void IntraSearch::calcPixelPred(CodingStructure& cs, Partitioner& partitioner, uint32_t uiY, uint32_t uiX, ComponentID compBegin, uint32_t NumComp) +void IntraSearch::calcPixelPred(CodingStructure& cs, Partitioner& partitioner, uint32_t uiY, uint32_t uiX, ComponentID compBegin, uint32_t numComp) { CodingUnit &cu = *cs.getCU(partitioner.chType); TransformUnit &tu = *cs.getTU(partitioner.chType); CPelBuf orgBuf[3]; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { CompArea area = cu.blocks[comp]; if (m_pcEncCfg->getReshaper() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) @@ -1801,7 +1801,7 @@ void IntraSearch::calcPixelPred(CodingStructure& cs, Partitioner& partitioner, u int rightShiftOffset[3]; int InvquantiserRightShift[3]; int iAdd[3]; - for (uint32_t ch = compBegin; ch < (compBegin + NumComp); ch++) + for (uint32_t ch = compBegin; ch < (compBegin + numComp); ch++) { QpParam cQP(tu, ComponentID(ch)); iQP[ch] = cQP.Qp; @@ -1817,7 +1817,7 @@ void IntraSearch::calcPixelPred(CodingStructure& cs, Partitioner& partitioner, u uint32_t scaleX = getComponentScaleX(COMPONENT_Cb, cs.sps->getChromaFormatIdc()); uint32_t scaleY = getComponentScaleY(COMPONENT_Cb, cs.sps->getChromaFormatIdc()); - for (uint32_t ch = compBegin; ch < (compBegin + NumComp); ch++) + for (uint32_t ch = compBegin; ch < (compBegin + numComp); ch++) { const int channelBitDepth = cu.cs->sps->getBitDepth(toChannelType((ComponentID)ch)); CompArea area = cu.blocks[ch]; @@ -1841,7 +1841,7 @@ void IntraSearch::calcPixelPred(CodingStructure& cs, Partitioner& partitioner, u } } } -void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t NumComp) +void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t numComp) { CodingUnit &cu = *cs.getCU(partitioner.chType); const int channelBitDepth_L = cs.sps->getBitDepth(CHANNEL_TYPE_LUMA); @@ -1853,7 +1853,7 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, uint32_t uiWidth = cu.block(compBegin).width; CPelBuf orgBuf[3]; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { CompArea area = cu.blocks[comp]; if (m_pcEncCfg->getReshaper() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) @@ -1883,19 +1883,19 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, for (uint32_t uiX = 0; uiX < uiWidth; uiX++) { uint32_t paOrig[3], pX, pY; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { pX = (comp > 0 && compBegin == COMPONENT_Y) ? (uiX >> scaleX) : uiX; pY = (comp > 0 && compBegin == COMPONENT_Y) ? (uiY >> scaleY) : uiY; paOrig[comp] = orgBuf[comp].at(pX, pY); } - sElement.setAll(paOrig, compBegin, NumComp); - int besti = last, bestSAD = (last == -1) ? MAX_UINT : psList[last].getSAD(sElement, cs.sps->getBitDepths(), compBegin, NumComp); + sElement.setAll(paOrig, compBegin, numComp); + int besti = last, bestSAD = (last == -1) ? MAX_UINT : psList[last].getSAD(sElement, cs.sps->getBitDepths(), compBegin, numComp); if (bestSAD) { for (int i = uiIdx - 1; i >= 0; i--) { - uint32_t sad = psList[i].getSAD(sElement, cs.sps->getBitDepths(), compBegin, NumComp); + uint32_t sad = psList[i].getSAD(sElement, cs.sps->getBitDepths(), compBegin, numComp); if (sad < bestSAD) { bestSAD = sad; @@ -1904,14 +1904,14 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, } } } - if (besti >= 0 && psList[besti].almostEqualData(sElement, iErrorLimit, cs.sps->getBitDepths(), compBegin, NumComp)) + if (besti >= 0 && psList[besti].almostEqualData(sElement, iErrorLimit, cs.sps->getBitDepths(), compBegin, numComp)) { - psList[besti].addElement(sElement, compBegin, NumComp); + psList[besti].addElement(sElement, compBegin, numComp); last = besti; } else { - psList[uiIdx].copyDataFrom(sElement, compBegin, NumComp); + psList[uiIdx].copyDataFrom(sElement, compBegin, numComp); psList[uiIdx].uiCnt = 1; last = uiIdx; uiIdx++; @@ -1922,7 +1922,7 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, for (int i = 0; i < uiDictMaxSize; i++) { pListSort[i].uiCnt = 0; - pListSort[i].resetAll(compBegin, NumComp); + pListSort[i].resetAll(compBegin, numComp); } //bubble sorting @@ -1936,7 +1936,7 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, { if (psList[i].uiCnt > pListSort[j - 1].uiCnt) { - pListSort[j].copyAllFrom(pListSort[j - 1], compBegin, NumComp); + pListSort[j].copyAllFrom(pListSort[j - 1], compBegin, numComp); uiDictMaxSize = std::min(uiDictMaxSize + 1, (uint32_t)MAXPLTSIZE); } else @@ -1944,13 +1944,13 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, break; } } - pListSort[j].copyAllFrom(psList[i], compBegin, NumComp); + pListSort[j].copyAllFrom(psList[i], compBegin, numComp); } } uint32_t uiPLTSize = 0; uint64_t numColorBits = 0; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { numColorBits += (comp > 0) ? channelBitDepth_C : channelBitDepth_L; } @@ -1961,7 +1961,7 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, if (pListSort[i].uiCnt) { int iHalf = pListSort[i].uiCnt >> 1; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { cu.curPLT[comp][uiPLTSize] = (pListSort[i].uiSumData[comp] + iHalf) / pListSort[i].uiCnt; } @@ -1970,7 +1970,7 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, if (iErrorLimit) { double pal[MAX_NUM_COMPONENT], err = 0.0, bestCost = 0.0; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { const int shift = (comp > 0) ? pcmShiftRight_C : pcmShiftRight_L; pal[comp] = pListSort[i].uiSumData[comp] / (double)pListSort[i].uiCnt; @@ -1982,7 +1982,7 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, for (int t = 0; t < cs.prevPLT.curPLTSize[compBegin]; t++) { double cost = 0.0; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { const int shift = (comp > 0) ? pcmShiftRight_C : pcmShiftRight_L; err = pal[comp] - cs.prevPLT.curPLT[comp][t]; @@ -1997,7 +1997,7 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, } if (best != -1) { - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { cu.curPLT[comp][uiPLTSize] = cs.prevPLT.curPLT[comp][best]; } @@ -2014,7 +2014,7 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, for (int t = 0; t<uiPLTSize; t++) { bool bDuplicateTmp = true; - for (int comp = compBegin; comp < (compBegin + NumComp); comp++) + for (int comp = compBegin; comp < (compBegin + numComp); comp++) { bDuplicateTmp = bDuplicateTmp && (cu.curPLT[comp][uiPLTSize] == cu.curPLT[comp][t]); } diff --git a/source/Lib/EncoderLib/IntraSearch.h b/source/Lib/EncoderLib/IntraSearch.h index 866e30969cca2a8051b12222e6bb6892e1867b7a..a810562f6bc1b1b0d30565ed367d4e1d65c3219c 100644 --- a/source/Lib/EncoderLib/IntraSearch.h +++ b/source/Lib/EncoderLib/IntraSearch.h @@ -154,8 +154,8 @@ public: void estIntraPredChromaQT ( CodingUnit &cu, Partitioner& pm, const double maxCostAllowed = MAX_DOUBLE ); void IPCMSearch (CodingStructure &cs, Partitioner& partitioner); #if JVET_O0119_BASE_PALETTE_444 - void PLTSearch ( CodingStructure &cs, Partitioner& partitioner, ComponentID compBegin, uint32_t NumComp); - void deriveRunAndCalcBits ( CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t NumComp, PLTScanMode pltScanMode, uint64_t& uiBits); + void PLTSearch ( CodingStructure &cs, Partitioner& partitioner, ComponentID compBegin, uint32_t numComp); + void deriveRunAndCalcBits ( CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t numComp, PLTScanMode pltScanMode, uint64_t& uiBits); #endif uint64_t xFracModeBitsIntra (PredictionUnit &pu, const uint32_t &uiMode, const ChannelType &compID); @@ -194,11 +194,11 @@ protected: double m_bestCostNonMip; #if JVET_O0119_BASE_PALETTE_444 - void deriveRun(CodingStructure &cs, Partitioner& partitioner, ComponentID compBegin, uint32_t NumComp); - double getRunBits(const CodingUnit& cu, uint32_t run, uint32_t strPos, PLTRunMode PaletteRunMode, uint64_t* indexBits, uint64_t* runBits, ComponentID compBegin); - void derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t NumComp); - void calcPixelPred(CodingStructure& cs, Partitioner& partitioner, uint32_t uiY, uint32_t uiX, ComponentID compBegin, uint32_t NumComp); - void preCalcPLTIndex(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t NumComp); + void deriveRun(CodingStructure &cs, Partitioner& partitioner, ComponentID compBegin); + double getRunBits(const CodingUnit& cu, uint32_t run, uint32_t strPos, PLTRunMode paletteRunMode, uint64_t* indexBits, uint64_t* runBits, ComponentID compBegin); + void derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t numComp); + void calcPixelPred(CodingStructure& cs, Partitioner& partitioner, uint32_t uiY, uint32_t uiX, ComponentID compBegin, uint32_t numComp); + void preCalcPLTIndex(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t numComp); #endif };// END CLASS DEFINITION EncSearch