From 695ba11bbdbe0acbe8b6286be5eb95d7a820a6c3 Mon Sep 17 00:00:00 2001 From: Frank Bossen <fbossen@gmail.com> Date: Mon, 19 Apr 2021 21:50:47 -0400 Subject: [PATCH] Fix variable naming --- source/Lib/CommonLib/ContextModelling.cpp | 102 ++++--- source/Lib/CommonLib/DepQuant.cpp | 10 +- source/Lib/CommonLib/QuantRDOQ.cpp | 26 +- source/Lib/CommonLib/Rom.cpp | 51 +--- source/Lib/CommonLib/Rom.h | 12 +- source/Lib/CommonLib/UnitTools.h | 8 +- source/Lib/DecoderLib/CABACReader.cpp | 22 +- source/Lib/EncoderLib/CABACWriter.cpp | 18 +- .../EncoderLib/EncSampleAdaptiveOffset.cpp | 20 +- source/Lib/EncoderLib/IntraSearch.cpp | 289 +++++++++--------- source/Lib/EncoderLib/IntraSearch.h | 8 +- source/Lib/EncoderLib/VLCWriter.cpp | 8 +- 12 files changed, 276 insertions(+), 298 deletions(-) diff --git a/source/Lib/CommonLib/ContextModelling.cpp b/source/Lib/CommonLib/ContextModelling.cpp index 07401019b..c565ba25a 100644 --- a/source/Lib/CommonLib/ContextModelling.cpp +++ b/source/Lib/CommonLib/ContextModelling.cpp @@ -40,58 +40,60 @@ #include "CodingStructure.h" #include "Picture.h" - -CoeffCodingContext::CoeffCodingContext( const TransformUnit& tu, ComponentID component, bool signHide, bool bdpcm ) - : m_compID (component) - , m_chType (toChannelType(m_compID)) - , m_width (tu.block(m_compID).width) - , m_height (tu.block(m_compID).height) - , m_log2CGWidth ( g_log2SbbSize[ floorLog2(m_width) ][ floorLog2(m_height) ][0] ) - , m_log2CGHeight ( g_log2SbbSize[ floorLog2(m_width) ][ floorLog2(m_height) ][1] ) - , m_log2CGSize (m_log2CGWidth + m_log2CGHeight) +CoeffCodingContext::CoeffCodingContext(const TransformUnit &tu, ComponentID component, bool signHide, bool bdpcm) + : m_compID(component) + , m_chType(toChannelType(m_compID)) + , m_width(tu.block(m_compID).width) + , m_height(tu.block(m_compID).height) + , m_log2CGWidth(g_log2SbbSize[floorLog2(m_width)][floorLog2(m_height)][0]) + , m_log2CGHeight(g_log2SbbSize[floorLog2(m_width)][floorLog2(m_height)][1]) + , m_log2CGSize(m_log2CGWidth + m_log2CGHeight) , m_widthInGroups(std::min<unsigned>(JVET_C0024_ZERO_OUT_TH, m_width) >> m_log2CGWidth) , m_heightInGroups(std::min<unsigned>(JVET_C0024_ZERO_OUT_TH, m_height) >> m_log2CGHeight) - , m_log2BlockWidth ((unsigned)floorLog2(m_width)) - , m_log2BlockHeight ((unsigned)floorLog2(m_height)) - , m_maxNumCoeff (m_width * m_height) - , m_signHiding (signHide) - , m_extendedPrecision (tu.cs->sps->getSpsRangeExtension().getExtendedPrecisionProcessingFlag()) - , m_maxLog2TrDynamicRange (tu.cs->sps->getMaxLog2TrDynamicRange(m_chType)) - , m_scanType (SCAN_DIAG) - , m_scan (g_scanOrder [SCAN_GROUPED_4x4][m_scanType][gp_sizeIdxInfo->idxFrom(m_width )][gp_sizeIdxInfo->idxFrom(m_height )]) - , m_scanCG (g_scanOrder [SCAN_UNGROUPED ][m_scanType][gp_sizeIdxInfo->idxFrom(m_widthInGroups)][gp_sizeIdxInfo->idxFrom(m_heightInGroups)]) - , m_CtxSetLastX (Ctx::LastX[m_chType]) - , m_CtxSetLastY (Ctx::LastY[m_chType]) - , m_maxLastPosX(g_uiGroupIdx[std::min<unsigned>(JVET_C0024_ZERO_OUT_TH, m_width) - 1]) - , m_maxLastPosY(g_uiGroupIdx[std::min<unsigned>(JVET_C0024_ZERO_OUT_TH, m_height) - 1]) - , m_lastOffsetX (0) - , m_lastOffsetY (0) - , m_lastShiftX (0) - , m_lastShiftY (0) - , m_TrafoBypass (tu.cs->sps->getSpsRangeExtension().getTransformSkipContextEnabledFlag() && (tu.mtsIdx[m_compID] == MTS_SKIP)) - , m_minCoeff (-(1 << tu.cs->sps->getMaxLog2TrDynamicRange(m_chType))) - , m_maxCoeff ((1 << tu.cs->sps->getMaxLog2TrDynamicRange(m_chType)) - 1) - , m_scanPosLast (-1) - , m_subSetId (-1) - , m_subSetPos (-1) - , m_subSetPosX (-1) - , m_subSetPosY (-1) - , m_minSubPos (-1) - , m_maxSubPos (-1) - , m_sigGroupCtxId (-1) - , m_tmplCpSum1 (-1) - , m_tmplCpDiag (-1) - , m_sigFlagCtxSet { Ctx::SigFlag[m_chType], Ctx::SigFlag[m_chType+2], Ctx::SigFlag[m_chType+4] } - , m_parFlagCtxSet ( Ctx::ParFlag[m_chType] ) - , m_gtxFlagCtxSet { Ctx::GtxFlag[m_chType], Ctx::GtxFlag[m_chType+2] } - , m_sigGroupCtxIdTS (-1) - , m_tsSigFlagCtxSet ( Ctx::TsSigFlag ) - , m_tsParFlagCtxSet ( Ctx::TsParFlag ) - , m_tsGtxFlagCtxSet ( Ctx::TsGtxFlag ) - , m_tsLrg1FlagCtxSet (Ctx::TsLrg1Flag) - , m_tsSignFlagCtxSet (Ctx::TsResidualSign) - , m_sigCoeffGroupFlag () - , m_bdpcm (bdpcm) + , m_log2BlockWidth((unsigned) floorLog2(m_width)) + , m_log2BlockHeight((unsigned) floorLog2(m_height)) + , m_maxNumCoeff(m_width * m_height) + , m_signHiding(signHide) + , m_extendedPrecision(tu.cs->sps->getSpsRangeExtension().getExtendedPrecisionProcessingFlag()) + , m_maxLog2TrDynamicRange(tu.cs->sps->getMaxLog2TrDynamicRange(m_chType)) + , m_scanType(SCAN_DIAG) + , m_scan( + g_scanOrder[SCAN_GROUPED_4x4][m_scanType][gp_sizeIdxInfo->idxFrom(m_width)][gp_sizeIdxInfo->idxFrom(m_height)]) + , m_scanCG(g_scanOrder[SCAN_UNGROUPED][m_scanType][gp_sizeIdxInfo->idxFrom(m_widthInGroups)] + [gp_sizeIdxInfo->idxFrom(m_heightInGroups)]) + , m_CtxSetLastX(Ctx::LastX[m_chType]) + , m_CtxSetLastY(Ctx::LastY[m_chType]) + , m_maxLastPosX(g_groupIdx[std::min<unsigned>(JVET_C0024_ZERO_OUT_TH, m_width) - 1]) + , m_maxLastPosY(g_groupIdx[std::min<unsigned>(JVET_C0024_ZERO_OUT_TH, m_height) - 1]) + , m_lastOffsetX(0) + , m_lastOffsetY(0) + , m_lastShiftX(0) + , m_lastShiftY(0) + , m_TrafoBypass(tu.cs->sps->getSpsRangeExtension().getTransformSkipContextEnabledFlag() + && (tu.mtsIdx[m_compID] == MTS_SKIP)) + , m_minCoeff(-(1 << tu.cs->sps->getMaxLog2TrDynamicRange(m_chType))) + , m_maxCoeff((1 << tu.cs->sps->getMaxLog2TrDynamicRange(m_chType)) - 1) + , m_scanPosLast(-1) + , m_subSetId(-1) + , m_subSetPos(-1) + , m_subSetPosX(-1) + , m_subSetPosY(-1) + , m_minSubPos(-1) + , m_maxSubPos(-1) + , m_sigGroupCtxId(-1) + , m_tmplCpSum1(-1) + , m_tmplCpDiag(-1) + , m_sigFlagCtxSet{ Ctx::SigFlag[m_chType], Ctx::SigFlag[m_chType + 2], Ctx::SigFlag[m_chType + 4] } + , m_parFlagCtxSet(Ctx::ParFlag[m_chType]) + , m_gtxFlagCtxSet{ Ctx::GtxFlag[m_chType], Ctx::GtxFlag[m_chType + 2] } + , m_sigGroupCtxIdTS(-1) + , m_tsSigFlagCtxSet(Ctx::TsSigFlag) + , m_tsParFlagCtxSet(Ctx::TsParFlag) + , m_tsGtxFlagCtxSet(Ctx::TsGtxFlag) + , m_tsLrg1FlagCtxSet(Ctx::TsLrg1Flag) + , m_tsSignFlagCtxSet(Ctx::TsResidualSign) + , m_sigCoeffGroupFlag() + , m_bdpcm(bdpcm) { // LOGTODO unsigned log2sizeX = m_log2BlockWidth; diff --git a/source/Lib/CommonLib/DepQuant.cpp b/source/Lib/CommonLib/DepQuant.cpp index 2e914d0bc..a983b6c48 100644 --- a/source/Lib/CommonLib/DepQuant.cpp +++ b/source/Lib/CommonLib/DepQuant.cpp @@ -532,7 +532,7 @@ namespace DQIntern const unsigned lastShift = ( compID == COMPONENT_Y ? (log2Size+1)>>2 : Clip3<unsigned>(0,2,size>>3) ); const unsigned lastOffset = ( compID == COMPONENT_Y ? ( prefixCtx[log2Size] ) : 0 ); uint32_t sumFBits = 0; - unsigned maxCtxId = g_uiGroupIdx[std::min<unsigned>(JVET_C0024_ZERO_OUT_TH, size) - 1]; + unsigned maxCtxId = g_groupIdx[std::min<unsigned>(JVET_C0024_ZERO_OUT_TH, size) - 1]; for( unsigned ctxId = 0; ctxId < maxCtxId; ctxId++ ) { const BinFracBits bits = fracBitsAccess.getFracBitsArray( ctxSetLast( lastOffset + ( ctxId >> lastShift ) ) ); @@ -542,7 +542,7 @@ namespace DQIntern ctxBits [ maxCtxId ] = sumFBits + ( maxCtxId>3 ? ((maxCtxId-2)>>1)<<SCALE_BITS : 0 ) + bitOffset; for (unsigned pos = 0; pos < std::min<unsigned>(JVET_C0024_ZERO_OUT_TH, size); pos++) { - lastBits[ pos ] = ctxBits[ g_uiGroupIdx[ pos ] ]; + lastBits[pos] = ctxBits[g_groupIdx[pos]]; } } } @@ -1139,7 +1139,7 @@ namespace DQIntern } #undef UPDATE int sumAll = std::max(std::min(31, (int)sumAbs - 4 * 5), 0); - m_goRicePar = g_auiGoRiceParsCoeff[sumAll]; + m_goRicePar = g_goRiceParsCoeff[sumAll]; } else { @@ -1177,8 +1177,8 @@ namespace DQIntern } #undef UPDATE sumAbs = std::min<TCoeff>(31, sumAbs); - m_goRicePar = g_auiGoRiceParsCoeff[sumAbs]; - m_goRiceZero = g_auiGoRicePosCoeff0(m_stateId, m_goRicePar); + m_goRicePar = g_goRiceParsCoeff[sumAbs]; + m_goRiceZero = g_goRicePosCoeff0(m_stateId, m_goRicePar); } } } diff --git a/source/Lib/CommonLib/QuantRDOQ.cpp b/source/Lib/CommonLib/QuantRDOQ.cpp index b63dfbf3b..a21660487 100644 --- a/source/Lib/CommonLib/QuantRDOQ.cpp +++ b/source/Lib/CommonLib/QuantRDOQ.cpp @@ -302,18 +302,18 @@ inline double QuantRDOQ::xGetRateSigCoeffGroup( const BinFracBits& fracBitsSigCG */ inline double QuantRDOQ::xGetRateLast( const int* lastBitsX, const int* lastBitsY, unsigned PosX, unsigned PosY ) const { - uint32_t CtxX = g_uiGroupIdx[PosX]; - uint32_t CtxY = g_uiGroupIdx[PosY]; - double Cost = lastBitsX[ CtxX ] + lastBitsY[ CtxY ]; - if( CtxX > 3 ) + uint32_t ctxX = g_groupIdx[PosX]; + uint32_t ctxY = g_groupIdx[PosY]; + double cost = lastBitsX[ctxX] + lastBitsY[ctxY]; + if (ctxX > 3) { - Cost += xGetIEPRate() * ((CtxX-2)>>1); + cost += xGetIEPRate() * ((ctxX - 2) >> 1); } - if( CtxY > 3 ) + if (ctxY > 3) { - Cost += xGetIEPRate() * ((CtxY-2)>>1); + cost += xGetIEPRate() * ((ctxY - 2) >> 1); } - return xGetICost( Cost ); + return xGetICost(cost); } @@ -737,8 +737,8 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID, if( remRegBins < 4 ) { unsigned sumAbs = cctx.templateAbsSum( iScanPos, piDstCoeff, 0 ); - goRiceParam = g_auiGoRiceParsCoeff [ sumAbs ]; - goRiceZero = g_auiGoRicePosCoeff0(0, goRiceParam); + goRiceParam = g_goRiceParsCoeff[sumAbs]; + goRiceZero = g_goRicePosCoeff0(0, goRiceParam); } const BinFracBits fracBitsPar = fracBits.getFracBitsArray( uiParCtx ); @@ -794,7 +794,7 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID, else if( remRegBins >= 4 ) { int sumAll = cctx.templateAbsSum(iScanPos, piDstCoeff, 4); - goRiceParam = g_auiGoRiceParsCoeff[sumAll]; + goRiceParam = g_goRiceParsCoeff[sumAll]; remRegBins -= (uiLevel < 2 ? uiLevel : 3) + (iScanPos != iLastScanPos); } } @@ -954,7 +954,7 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID, int bitsY = 0; int ctxId; //X-coordinate - for ( ctxId = 0; ctxId < g_uiGroupIdx[dim1-1]; ctxId++) + for (ctxId = 0; ctxId < g_groupIdx[dim1 - 1]; ctxId++) { const BinFracBits fB = fracBits.getFracBitsArray( cctx.lastXCtxId(ctxId) ); lastBitsX[ ctxId ] = bitsX + fB.intBits[ 0 ]; @@ -962,7 +962,7 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID, } lastBitsX[ctxId] = bitsX; //Y-coordinate - for ( ctxId = 0; ctxId < g_uiGroupIdx[dim2-1]; ctxId++) + for (ctxId = 0; ctxId < g_groupIdx[dim2 - 1]; ctxId++) { const BinFracBits fB = fracBits.getFracBitsArray( cctx.lastYCtxId(ctxId) ); lastBitsY[ ctxId ] = bitsY + fB.intBits[ 0 ]; diff --git a/source/Lib/CommonLib/Rom.cpp b/source/Lib/CommonLib/Rom.cpp index c2f196d0b..5e6f5bdf4 100644 --- a/source/Lib/CommonLib/Rom.cpp +++ b/source/Lib/CommonLib/Rom.cpp @@ -494,35 +494,13 @@ const int g_invQuantScales[2][SCALING_LIST_REM_NUM] = // can be represented as a // Intra prediction // ==================================================================================================================== -const uint8_t g_aucIntraModeNumFast_UseMPM_2D[7 - MIN_CU_LOG2 + 1][7 - MIN_CU_LOG2 + 1] = -{ - {3, 3, 3, 3, 2, 2}, // 4x4, 4x8, 4x16, 4x32, 4x64, 4x128, - {3, 3, 3, 3, 3, 2}, // 8x4, 8x8, 8x16, 8x32, 8x64, 8x128, - {3, 3, 3, 3, 3, 2}, // 16x4, 16x8, 16x16, 16x32, 16x64, 16x128, - {3, 3, 3, 3, 3, 2}, // 32x4, 32x8, 32x16, 32x32, 32x64, 32x128, - {2, 3, 3, 3, 3, 2}, // 64x4, 64x8, 64x16, 64x32, 64x64, 64x128, - {2, 2, 2, 2, 2, 3}, // 128x4, 128x8, 128x16, 128x32, 128x64, 128x128, -}; - -const uint8_t g_aucIntraModeNumFast_UseMPM[MAX_CU_DEPTH] = -{ - 3, // 2x2 - 8, // 4x4 - 8, // 8x8 - 3, // 16x16 - 3, // 32x32 - 3, // 64x64 - 3 // 128x128 -}; -const uint8_t g_aucIntraModeNumFast_NotUseMPM[MAX_CU_DEPTH] = -{ - 3, // 2x2 - 9, // 4x4 - 9, // 8x8 - 4, // 16x16 33 - 4, // 32x32 33 - 5, // 64x64 33 - 5 // 128x128 +const uint8_t g_intraModeNumFastUseMPM2D[7 - MIN_CU_LOG2 + 1][7 - MIN_CU_LOG2 + 1] = { + { 3, 3, 3, 3, 2, 2 }, // 4x4, 4x8, 4x16, 4x32, 4x64, 4x128, + { 3, 3, 3, 3, 3, 2 }, // 8x4, 8x8, 8x16, 8x32, 8x64, 8x128, + { 3, 3, 3, 3, 3, 2 }, // 16x4, 16x8, 16x16, 16x32, 16x64, 16x128, + { 3, 3, 3, 3, 3, 2 }, // 32x4, 32x8, 32x16, 32x32, 32x64, 32x128, + { 2, 3, 3, 3, 3, 2 }, // 64x4, 64x8, 64x16, 64x32, 64x64, 64x128, + { 2, 2, 2, 2, 2, 3 }, // 128x4, 128x8, 128x16, 128x32, 128x64, 128x128, }; const uint8_t g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE] = @@ -550,12 +528,15 @@ UnitScale g_miScaling( MIN_CU_LOG2, MIN_CU_LOG2 ); ScanElement *g_scanOrder[SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][MAX_CU_SIZE / 2 + 1][MAX_CU_SIZE / 2 + 1]; ScanElement g_coefTopLeftDiagScan8x8[ MAX_CU_SIZE / 2 + 1 ][ 64 ]; -const uint32_t g_uiMinInGroup[LAST_SIGNIFICANT_GROUPS] = { 0,1,2,3,4,6,8,12,16,24,32,48,64,96 }; -const uint32_t g_uiGroupIdx[MAX_TB_SIZEY] = { 0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9, 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11 }; -const uint32_t g_auiGoRiceParsCoeff[32] = -{ - 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3 -}; +const uint32_t g_minInGroup[LAST_SIGNIFICANT_GROUPS] = { 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96 }; + +const uint32_t g_groupIdx[MAX_TB_SIZEY] = { 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, + 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11 }; + +const uint32_t g_goRiceParsCoeff[32] = { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3 }; const char *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] = { { diff --git a/source/Lib/CommonLib/Rom.h b/source/Lib/CommonLib/Rom.h index 1e12f6a87..1a9b20d26 100644 --- a/source/Lib/CommonLib/Rom.h +++ b/source/Lib/CommonLib/Rom.h @@ -88,10 +88,10 @@ static const int g_transformMatrixShift[TRANSFORM_NUMBER_OF_DIRECTIONS] = { 6, // Scanning order & context mapping table // ==================================================================================================================== -extern const uint32_t g_uiGroupIdx[ MAX_TB_SIZEY ]; -extern const uint32_t g_uiMinInGroup[ LAST_SIGNIFICANT_GROUPS ]; -extern const uint32_t g_auiGoRiceParsCoeff [ 32 ]; -inline uint32_t g_auiGoRicePosCoeff0(int st, uint32_t ricePar) +extern const uint32_t g_groupIdx[MAX_TB_SIZEY]; +extern const uint32_t g_minInGroup[LAST_SIGNIFICANT_GROUPS]; +extern const uint32_t g_goRiceParsCoeff[32]; +inline uint32_t g_goRicePosCoeff0(int st, uint32_t ricePar) { return (st < 2 ? 1 : 2) << ricePar; } @@ -100,9 +100,7 @@ inline uint32_t g_auiGoRicePosCoeff0(int st, uint32_t ricePar) // Intra prediction table // ==================================================================================================================== -extern const uint8_t g_aucIntraModeNumFast_UseMPM_2D[7 - MIN_CU_LOG2 + 1][7 - MIN_CU_LOG2 + 1]; -extern const uint8_t g_aucIntraModeNumFast_UseMPM [MAX_CU_DEPTH]; -extern const uint8_t g_aucIntraModeNumFast_NotUseMPM[MAX_CU_DEPTH]; +extern const uint8_t g_intraModeNumFastUseMPM2D[7 - MIN_CU_LOG2 + 1][7 - MIN_CU_LOG2 + 1]; extern const uint8_t g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE]; diff --git a/source/Lib/CommonLib/UnitTools.h b/source/Lib/CommonLib/UnitTools.h index 57f398d31..5b5e0ddc2 100644 --- a/source/Lib/CommonLib/UnitTools.h +++ b/source/Lib/CommonLib/UnitTools.h @@ -210,8 +210,8 @@ int getMipSizeId (const Size& block); bool allowLfnstWithMip(const Size& block); template<typename T, size_t N> -uint32_t updateCandList(T uiMode, double uiCost, static_vector<T, N>& candModeList, static_vector<double, N>& candCostList - , size_t uiFastCandNum = N, int* iserttPos = nullptr) +uint32_t updateCandList(T mode, double uiCost, static_vector<T, N> &candModeList, + static_vector<double, N> &candCostList, size_t uiFastCandNum = N, int *iserttPos = nullptr) { CHECK( std::min( uiFastCandNum, candModeList.size() ) != std::min( uiFastCandNum, candCostList.size() ), "Sizes do not match!" ); CHECK( uiFastCandNum > candModeList.capacity(), "The vector is to small to hold all the candidates!" ); @@ -232,7 +232,7 @@ uint32_t updateCandList(T uiMode, double uiCost, static_vector<T, N>& candModeLi candModeList[currSize - i] = candModeList[currSize - 1 - i]; candCostList[currSize - i] = candCostList[currSize - 1 - i]; } - candModeList[currSize - shift] = uiMode; + candModeList[currSize - shift] = mode; candCostList[currSize - shift] = uiCost; if (iserttPos != nullptr) { @@ -242,7 +242,7 @@ uint32_t updateCandList(T uiMode, double uiCost, static_vector<T, N>& candModeLi } else if( currSize < uiFastCandNum ) { - candModeList.insert( candModeList.end() - shift, uiMode ); + candModeList.insert(candModeList.end() - shift, mode); candCostList.insert( candCostList.end() - shift, uiCost ); if (iserttPos != nullptr) { diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index a86909a54..a739c03d5 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -3120,8 +3120,8 @@ int CABACReader::last_sig_coeff( CoeffCodingContext& cctx, TransformUnit& tu, Co if( tu.cs->sps->getUseMTS() && tu.cu->sbtInfo != 0 && tu.blocks[ compID ].width <= 32 && tu.blocks[ compID ].height <= 32 && compID == COMPONENT_Y ) { - maxLastPosX = ( tu.blocks[ compID ].width == 32 ) ? g_uiGroupIdx[ 15 ] : maxLastPosX; - maxLastPosY = ( tu.blocks[ compID ].height == 32 ) ? g_uiGroupIdx[ 15 ] : maxLastPosY; + maxLastPosX = (tu.blocks[compID].width == 32) ? g_groupIdx[15] : maxLastPosX; + maxLastPosY = (tu.blocks[compID].height == 32) ? g_groupIdx[15] : maxLastPosY; } for( ; PosLastX < maxLastPosX; PosLastX++ ) @@ -3140,23 +3140,23 @@ int CABACReader::last_sig_coeff( CoeffCodingContext& cctx, TransformUnit& tu, Co } if( PosLastX > 3 ) { - uint32_t uiTemp = 0; + uint32_t temp = 0; uint32_t uiCount = ( PosLastX - 2 ) >> 1; for ( int i = uiCount - 1; i >= 0; i-- ) { - uiTemp += m_BinDecoder.decodeBinEP( ) << i; + temp += m_BinDecoder.decodeBinEP() << i; } - PosLastX = g_uiMinInGroup[ PosLastX ] + uiTemp; + PosLastX = g_minInGroup[PosLastX] + temp; } if( PosLastY > 3 ) { - uint32_t uiTemp = 0; + uint32_t temp = 0; uint32_t uiCount = ( PosLastY - 2 ) >> 1; for ( int i = uiCount - 1; i >= 0; i-- ) { - uiTemp += m_BinDecoder.decodeBinEP( ) << i; + temp += m_BinDecoder.decodeBinEP() << i; } - PosLastY = g_uiMinInGroup[ PosLastY ] + uiTemp; + PosLastY = g_minInGroup[PosLastY] + temp; } int blkPos; @@ -3282,7 +3282,7 @@ void CABACReader::residual_coding_subblock( CoeffCodingContext& cctx, TCoeff* co for( int scanPos = firstSigPos; scanPos > firstPosMode2; scanPos-- ) { int sumAll = cctx.templateAbsSum(scanPos, coeff, 4); - ricePar = g_auiGoRiceParsCoeff[sumAll]; + ricePar = g_goRiceParsCoeff[sumAll]; TCoeff& tcoeff = coeff[ cctx.blockPos( scanPos ) ]; if( tcoeff >= 4 ) { @@ -3297,8 +3297,8 @@ void CABACReader::residual_coding_subblock( CoeffCodingContext& cctx, TCoeff* co for( int scanPos = firstPosMode2; scanPos >= minSubPos; scanPos-- ) { int sumAll = cctx.templateAbsSum(scanPos, coeff, 0); - int rice = g_auiGoRiceParsCoeff [sumAll]; - int pos0 = g_auiGoRicePosCoeff0(state, rice); + int rice = g_goRiceParsCoeff[sumAll]; + int pos0 = g_goRicePosCoeff0(state, rice); RExt__DECODER_DEBUG_BIT_STATISTICS_SET(ctype_escs); int rem = m_BinDecoder.decodeRemAbsEP( rice, COEF_REMAIN_BIN_REDUCTION, cctx.maxLog2TrDRange() ); DTRACE( g_trace_ctx, D_SYNTAX_RESI, "rem_val() bin=%d ctx=%d\n", rem, rice ); diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp index 1b827be85..25d0d1214 100644 --- a/source/Lib/EncoderLib/CABACWriter.cpp +++ b/source/Lib/EncoderLib/CABACWriter.cpp @@ -2855,16 +2855,16 @@ void CABACWriter::last_sig_coeff( CoeffCodingContext& cctx, const TransformUnit& } unsigned CtxLast; - unsigned GroupIdxX = g_uiGroupIdx[ posX ]; - unsigned GroupIdxY = g_uiGroupIdx[ posY ]; + unsigned GroupIdxX = g_groupIdx[posX]; + unsigned GroupIdxY = g_groupIdx[posY]; unsigned maxLastPosX = cctx.maxLastPosX(); unsigned maxLastPosY = cctx.maxLastPosY(); if( tu.cs->sps->getUseMTS() && tu.cu->sbtInfo != 0 && tu.blocks[ compID ].width <= 32 && tu.blocks[ compID ].height <= 32 && compID == COMPONENT_Y ) { - maxLastPosX = ( tu.blocks[compID].width == 32 ) ? g_uiGroupIdx[ 15 ] : maxLastPosX; - maxLastPosY = ( tu.blocks[compID].height == 32 ) ? g_uiGroupIdx[ 15 ] : maxLastPosY; + maxLastPosX = (tu.blocks[compID].width == 32) ? g_groupIdx[15] : maxLastPosX; + maxLastPosY = (tu.blocks[compID].height == 32) ? g_groupIdx[15] : maxLastPosY; } for( CtxLast = 0; CtxLast < GroupIdxX; CtxLast++ ) @@ -2885,7 +2885,7 @@ void CABACWriter::last_sig_coeff( CoeffCodingContext& cctx, const TransformUnit& } if( GroupIdxX > 3 ) { - posX -= g_uiMinInGroup[ GroupIdxX ]; + posX -= g_minInGroup[GroupIdxX]; for (int i = ( ( GroupIdxX - 2 ) >> 1 ) - 1 ; i >= 0; i-- ) { m_BinEncoder.encodeBinEP( ( posX >> i ) & 1 ); @@ -2893,7 +2893,7 @@ void CABACWriter::last_sig_coeff( CoeffCodingContext& cctx, const TransformUnit& } if( GroupIdxY > 3 ) { - posY -= g_uiMinInGroup[ GroupIdxY ]; + posY -= g_minInGroup[GroupIdxY]; for ( int i = ( ( GroupIdxY - 2 ) >> 1 ) - 1 ; i >= 0; i-- ) { m_BinEncoder.encodeBinEP( ( posY >> i ) & 1 ); @@ -2994,7 +2994,7 @@ void CABACWriter::residual_coding_subblock( CoeffCodingContext& cctx, const TCoe for( int scanPos = firstSigPos; scanPos > firstPosMode2; scanPos-- ) { int sumAll = cctx.templateAbsSum(scanPos, coeff, 4); - ricePar = g_auiGoRiceParsCoeff[sumAll]; + ricePar = g_goRiceParsCoeff[sumAll]; unsigned absLevel = (unsigned) abs( coeff[ cctx.blockPos( scanPos ) ] ); if( absLevel >= 4 ) { @@ -3010,8 +3010,8 @@ void CABACWriter::residual_coding_subblock( CoeffCodingContext& cctx, const TCoe TCoeff Coeff = coeff[ cctx.blockPos( scanPos ) ]; unsigned absLevel = (unsigned) abs( Coeff ); int sumAll = cctx.templateAbsSum(scanPos, coeff, 0); - int rice = g_auiGoRiceParsCoeff [sumAll]; - int pos0 = g_auiGoRicePosCoeff0(state, rice); + int rice = g_goRiceParsCoeff[sumAll]; + int pos0 = g_goRicePosCoeff0(state, rice); unsigned rem = ( absLevel == 0 ? pos0 : absLevel <= pos0 ? absLevel-1 : absLevel ); m_BinEncoder.encodeRemAbsEP( rem, rice, COEF_REMAIN_BIN_REDUCTION, cctx.maxLog2TrDRange() ); DTRACE( g_trace_ctx, D_SYNTAX_RESI, "rem_val() bin=%d ctx=%d\n", rem, rice ); diff --git a/source/Lib/EncoderLib/EncSampleAdaptiveOffset.cpp b/source/Lib/EncoderLib/EncSampleAdaptiveOffset.cpp index be2520e83..8079e9186 100644 --- a/source/Lib/EncoderLib/EncSampleAdaptiveOffset.cpp +++ b/source/Lib/EncoderLib/EncSampleAdaptiveOffset.cpp @@ -825,7 +825,7 @@ void EncSampleAdaptiveOffset::decideBlkParams(CodingStructure& cs, bool* sliceEn int mergeCtuAddr = 1; //Ctu to be merged int groupSize = 1; - double Cost[2] = { 0, 0 }; + double cost[2] = { 0, 0 }; TempCtx ctxBeforeMerge(m_CtxCache); TempCtx ctxAfterMerge(m_CtxCache); @@ -920,13 +920,13 @@ void EncSampleAdaptiveOffset::decideBlkParams(CodingStructure& cs, bool* sliceEn { if (ctuRsAddr == (mergeCtuAddr - 1)) { - Cost[0] = minCost; //previous + cost[0] = minCost; // previous groupSize = 1; getMergeList(cs, ctuRsAddr, reconParams, startingMergeList); } else if (ctuRsAddr == mergeCtuAddr) { - Cost[1] = minCost; + cost[1] = minCost; minCost2 = MAX_DOUBLE; for (int tmp = groupSize; tmp >= 0; tmp--) { @@ -980,13 +980,13 @@ void EncSampleAdaptiveOffset::decideBlkParams(CodingStructure& cs, bool* sliceEn ctxAfterMerge = SAOCtx(m_CABACEstimator->getCtx()); } - totalCost += Cost[0]; - totalCost += Cost[1]; + totalCost += cost[0]; + totalCost += cost[1]; - if ((Cost[0] + Cost[1]) > minCost2) //merge current CTU + if ((cost[0] + cost[1]) > minCost2) // merge current CTU { //original merge all - totalCost = totalCost - Cost[0] - Cost[1] + minCost2; + totalCost = totalCost - cost[0] - cost[1] + minCost2; codedParams[ctuRsAddr - groupSize] = groupParam; for (int compIdx = 0; compIdx < MAX_NUM_COMPONENT; compIdx++) { @@ -1007,7 +1007,7 @@ void EncSampleAdaptiveOffset::decideBlkParams(CodingStructure& cs, bool* sliceEn } else //next CTU can be merged with current group { - Cost[0] = minCost2; + cost[0] = minCost2; groupSize += 1; } m_CABACEstimator->getCtx() = SAOCtx(ctxAfterMerge); @@ -1016,7 +1016,7 @@ void EncSampleAdaptiveOffset::decideBlkParams(CodingStructure& cs, bool* sliceEn { mergeCtuAddr += 1; // Current block will be the starting block for successive operations - Cost[0] = Cost[1]; + cost[0] = cost[1]; getMergeList(cs, ctuRsAddr, reconParams, startingMergeList); groupSize = 1; m_CABACEstimator->getCtx() = SAOCtx(ctxStart); @@ -1026,7 +1026,7 @@ void EncSampleAdaptiveOffset::decideBlkParams(CodingStructure& cs, bool* sliceEn { mergeCtuAddr += 1; } - } //else, if(Cost[0] + Cost[1] > minCost2) + } // else, if(cost[0] + cost[1] > minCost2) }//else if (ctuRsAddr == mergeCtuAddr) } else diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp index 75ee1913d..b2895310d 100644 --- a/source/Lib/EncoderLib/IntraSearch.cpp +++ b/source/Lib/EncoderLib/IntraSearch.cpp @@ -556,8 +556,8 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c { CodingStructure &cs = *cu.cs; const SPS &sps = *cs.sps; - const uint32_t uiWidthBit = floorLog2(partitioner.currArea().lwidth() ); - const uint32_t uiHeightBit = floorLog2(partitioner.currArea().lheight()); + const uint32_t logWidth = floorLog2(partitioner.currArea().lwidth()); + const uint32_t logHeight = floorLog2(partitioner.currArea().lheight()); // Lambda calculation at equivalent Qp of 4 is recommended because at that Qp, the quantization divisor is 1. const double sqrtLambdaForFirstPass = m_pcRdCost->getMotionLambda( ) * FRAC_BITS_SCALE; @@ -632,9 +632,9 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c } const bool testBDPCM = sps.getBDPCMEnabledFlag() && CU::bdpcmAllowed(cu, ComponentID(partitioner.chType)) && cu.mtsFlag == 0 && cu.lfnstIdx == 0; - static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> uiHadModeList; - static_vector<double, FAST_UDI_MAX_RDMODE_NUM> CandCostList; - static_vector<double, FAST_UDI_MAX_RDMODE_NUM> CandHadList; + static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> hadModeList; + static_vector<double, FAST_UDI_MAX_RDMODE_NUM> candCostList; + static_vector<double, FAST_UDI_MAX_RDMODE_NUM> candHadList; auto &pu = *cu.firstPU; #if GDR_ENABLED @@ -642,9 +642,9 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c #endif bool validReturn = false; { - CandHadList.clear(); - CandCostList.clear(); - uiHadModeList.clear(); + candHadList.clear(); + candCostList.clear(); + hadModeList.clear(); CHECK(pu.cu != &cu, "PU is not contained in the CU"); @@ -655,10 +655,9 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c const bool testMip = mipAllowed && !(cu.lwidth() > (8 * cu.lheight()) || cu.lheight() > (8 * cu.lwidth())); const bool supportedMipBlkSize = pu.lwidth() <= MIP_MAX_WIDTH && pu.lheight() <= MIP_MAX_HEIGHT; - static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> uiRdModeList; + static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> rdModeList; - int numModesForFullRD = 3; - numModesForFullRD = g_aucIntraModeNumFast_UseMPM_2D[uiWidthBit - MIN_CU_LOG2][uiHeightBit - MIN_CU_LOG2]; + int numModesForFullRD = g_intraModeNumFastUseMPM2D[logWidth - MIN_CU_LOG2][logHeight - MIN_CU_LOG2]; #if INTRA_FULL_SEARCH numModesForFullRD = numModesAvailable; @@ -666,12 +665,12 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c if (isSecondColorSpace) { - uiRdModeList.clear(); + rdModeList.clear(); if (m_numSavedRdModeFirstColorSpace[m_savedRdModeIdx] > 0) { for (int i = 0; i < m_numSavedRdModeFirstColorSpace[m_savedRdModeIdx]; i++) { - uiRdModeList.push_back(m_savedRdModeFirstColorSpace[m_savedRdModeIdx][i]); + rdModeList.push_back(m_savedRdModeFirstColorSpace[m_savedRdModeIdx][i]); } } else @@ -735,23 +734,23 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c //===== init pattern for luma prediction ===== initIntraPatternChType(cu, pu.Y(), true); - bool bSatdChecked[NUM_INTRA_MODE]; - memset(bSatdChecked, 0, sizeof(bSatdChecked)); + bool satdChecked[NUM_INTRA_MODE]; + std::fill_n(satdChecked, NUM_INTRA_MODE, false); if (!LFNSTLoadFlag) { for (int modeIdx = 0; modeIdx < numModesAvailable; modeIdx++) { - uint32_t uiMode = modeIdx; + uint32_t mode = modeIdx; Distortion minSadHad = 0; // Skip checking extended Angular modes in the first round of SATD - if (uiMode > DC_IDX && (uiMode & 1)) + if (mode > DC_IDX && (mode & 1)) { continue; } - bSatdChecked[uiMode] = true; + satdChecked[mode] = true; pu.intraDir[0] = modeIdx; @@ -768,63 +767,63 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaMpmFlag, ctxStartIntraMode); m_CABACEstimator->getCtx() = SubCtx( Ctx::MultiRefLineIdx, ctxStartMrlIdx ); - uint64_t fracModeBits = xFracModeBitsIntra(pu, uiMode, CHANNEL_TYPE_LUMA); + uint64_t fracModeBits = xFracModeBitsIntra(pu, mode, CHANNEL_TYPE_LUMA); double cost = (double) minSadHad + (double) fracModeBits * sqrtLambdaForFirstPass; - DTRACE(g_trace_ctx, D_INTRA_COST, "IntraHAD: %u, %llu, %f (%d)\n", minSadHad, fracModeBits, cost, uiMode); + DTRACE(g_trace_ctx, D_INTRA_COST, "IntraHAD: %u, %llu, %f (%d)\n", minSadHad, fracModeBits, cost, mode); #if GDR_ENABLED if (isEncodeGdrClean) { - if (isValidIntraPredLuma(pu, uiMode)) + if (isValidIntraPredLuma(pu, mode)) { - updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, uiMode), cost, uiRdModeList, - CandCostList, numModesForFullRD); - updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, uiMode), double(minSadHad), uiHadModeList, - CandHadList, numHadCand); + updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), cost, rdModeList, + candCostList, numModesForFullRD); + updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), double(minSadHad), + hadModeList, candHadList, numHadCand); } } else { - updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, uiMode), cost, uiRdModeList, - CandCostList, numModesForFullRD); - updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, uiMode), double(minSadHad), - uiHadModeList, CandHadList, numHadCand); + updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), cost, rdModeList, candCostList, + numModesForFullRD); + updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), double(minSadHad), hadModeList, + candHadList, numHadCand); } #else - updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, uiMode), cost, uiRdModeList, - CandCostList, numModesForFullRD); - updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, uiMode), double(minSadHad), - uiHadModeList, CandHadList, numHadCand); + updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), cost, rdModeList, candCostList, + numModesForFullRD); + updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), double(minSadHad), hadModeList, + candHadList, numHadCand); #endif } if (!sps.getUseMIP() && LFNSTSaveFlag) { // save found best modes - m_uiSavedNumRdModesLFNST = numModesForFullRD; - m_uiSavedRdModeListLFNST = uiRdModeList; - m_dSavedModeCostLFNST = CandCostList; + m_savedNumRdModesLFNST = numModesForFullRD; + m_savedRdModeListLFNST = rdModeList; + m_savedModeCostLFNST = candCostList; // PBINTRA fast - m_uiSavedHadModeListLFNST = uiHadModeList; - m_dSavedHadListLFNST = CandHadList; + m_uiSavedHadModeListLFNST = hadModeList; + m_dSavedHadListLFNST = candHadList; LFNSTSaveFlag = false; } } // NSSTFlag if (!sps.getUseMIP() && LFNSTLoadFlag) { // restore saved modes - numModesForFullRD = m_uiSavedNumRdModesLFNST; - uiRdModeList = m_uiSavedRdModeListLFNST; - CandCostList = m_dSavedModeCostLFNST; + numModesForFullRD = m_savedNumRdModesLFNST; + rdModeList = m_savedRdModeListLFNST; + candCostList = m_savedModeCostLFNST; // PBINTRA fast - uiHadModeList = m_uiSavedHadModeListLFNST; - CandHadList = m_dSavedHadListLFNST; + hadModeList = m_uiSavedHadModeListLFNST; + candHadList = m_dSavedHadListLFNST; } // !LFNSTFlag if (!(sps.getUseMIP() && LFNSTLoadFlag)) { - static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> parentCandList = uiRdModeList; + static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> parentCandList = rdModeList; // Second round of SATD for extended Angular modes #if GDR_ENABLED @@ -846,7 +845,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c { unsigned mode = parentMode + subModeIdx; - if (!bSatdChecked[mode]) + if (!satdChecked[mode]) { pu.intraDir[0] = mode; @@ -875,27 +874,27 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c { if (isValidIntraPredLuma(pu, mode)) { - updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), cost, uiRdModeList, - CandCostList, numModesForFullRD); + updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), cost, rdModeList, + candCostList, numModesForFullRD); updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), double(minSadHad), - uiHadModeList, CandHadList, numHadCand); + hadModeList, candHadList, numHadCand); } } else { - updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), cost, uiRdModeList, - CandCostList, numModesForFullRD); + updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), cost, rdModeList, + candCostList, numModesForFullRD); updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), double(minSadHad), - uiHadModeList, CandHadList, numHadCand); + hadModeList, candHadList, numHadCand); } #else - updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), cost, uiRdModeList, - CandCostList, numModesForFullRD); + updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), cost, rdModeList, + candCostList, numModesForFullRD); updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, mode), double(minSadHad), - uiHadModeList, CandHadList, numHadCand); + hadModeList, candHadList, numHadCand); #endif - bSatdChecked[mode] = true; + satdChecked[mode] = true; } } } @@ -903,7 +902,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c if (saveDataForISP) { // we save the regular intra modes list - m_ispCandListHor = uiRdModeList; + m_ispCandListHor = rdModeList; } pu.multiRefIdx = 1; const int numMPMs = NUM_MOST_PROBABLE_MODES; @@ -946,24 +945,24 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c { if (isValidIntraPredLuma(pu, mode)) { - updateCandList(ModeInfo(false, false, multiRefIdx, NOT_INTRA_SUBPARTITIONS, mode), cost, uiRdModeList, - CandCostList, numModesForFullRD); - updateCandList(ModeInfo(false, false, multiRefIdx, NOT_INTRA_SUBPARTITIONS, mode), double(minSadHad), - uiHadModeList, CandHadList, numHadCand); + updateCandList(ModeInfo(false, false, multiRefIdx, NOT_INTRA_SUBPARTITIONS, mode), cost, + rdModeList, candCostList, numModesForFullRD); + updateCandList(ModeInfo(false, false, multiRefIdx, NOT_INTRA_SUBPARTITIONS, mode), + double(minSadHad), hadModeList, candHadList, numHadCand); } } else { - updateCandList(ModeInfo(false, false, multiRefIdx, NOT_INTRA_SUBPARTITIONS, mode), cost, uiRdModeList, - CandCostList, numModesForFullRD); - updateCandList(ModeInfo(false, false, multiRefIdx, NOT_INTRA_SUBPARTITIONS, mode), double(minSadHad), - uiHadModeList, CandHadList, numHadCand); + updateCandList(ModeInfo(false, false, multiRefIdx, NOT_INTRA_SUBPARTITIONS, mode), cost, rdModeList, + candCostList, numModesForFullRD); + updateCandList(ModeInfo(false, false, multiRefIdx, NOT_INTRA_SUBPARTITIONS, mode), + double(minSadHad), hadModeList, candHadList, numHadCand); } #else - updateCandList(ModeInfo(false, false, multiRefIdx, NOT_INTRA_SUBPARTITIONS, mode), cost, uiRdModeList, - CandCostList, numModesForFullRD); + updateCandList(ModeInfo(false, false, multiRefIdx, NOT_INTRA_SUBPARTITIONS, mode), cost, rdModeList, + candCostList, numModesForFullRD); updateCandList(ModeInfo(false, false, multiRefIdx, NOT_INTRA_SUBPARTITIONS, mode), double(minSadHad), - uiHadModeList, CandHadList, numHadCand); + hadModeList, candHadList, numHadCand); #endif } } @@ -971,25 +970,24 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c #if GDR_ENABLED if (!isEncodeGdrClean) { - CHECKD(uiRdModeList.size() != numModesForFullRD, "Error: RD mode list size"); + CHECKD(rdModeList.size() != numModesForFullRD, "Error: RD mode list size"); } #else - CHECKD(uiRdModeList.size() != numModesForFullRD, "Error: RD mode list size"); + CHECKD(rdModeList.size() != numModesForFullRD, "Error: RD mode list size"); #endif if (LFNSTSaveFlag && testMip && !allowLfnstWithMip(cu.firstPU->lumaSize())) // save a different set for the next run { // save found best modes - m_uiSavedRdModeListLFNST = uiRdModeList; - m_dSavedModeCostLFNST = CandCostList; + m_savedRdModeListLFNST = rdModeList; + m_savedModeCostLFNST = candCostList; // PBINTRA fast - m_uiSavedHadModeListLFNST = uiHadModeList; - m_dSavedHadListLFNST = CandHadList; - m_uiSavedNumRdModesLFNST = - g_aucIntraModeNumFast_UseMPM_2D[uiWidthBit - MIN_CU_LOG2][uiHeightBit - MIN_CU_LOG2]; - m_uiSavedRdModeListLFNST.resize(m_uiSavedNumRdModesLFNST); - m_dSavedModeCostLFNST.resize(m_uiSavedNumRdModesLFNST); + m_uiSavedHadModeListLFNST = hadModeList; + m_dSavedHadListLFNST = candHadList; + m_savedNumRdModesLFNST = g_intraModeNumFastUseMPM2D[logWidth - MIN_CU_LOG2][logHeight - MIN_CU_LOG2]; + m_savedRdModeListLFNST.resize(m_savedNumRdModesLFNST); + m_savedModeCostLFNST.resize(m_savedNumRdModesLFNST); // PBINTRA fast m_uiSavedHadModeListLFNST.resize(3); m_dSavedHadListLFNST.resize(3); @@ -1004,11 +1002,11 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c for (uint32_t uiModeFull = 0; uiModeFull < numModesFull; uiModeFull++) { const bool isTransposed = (uiModeFull >= transpOff ? true : false); - const uint32_t uiMode = (isTransposed ? uiModeFull - transpOff : uiModeFull); + const uint32_t mode = (isTransposed ? uiModeFull - transpOff : uiModeFull); numModesForFullRD++; - uiRdModeList.push_back(ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, uiMode)); - CandCostList.push_back(0); + rdModeList.push_back(ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, mode)); + candCostList.push_back(0); } } else if (testMip) @@ -1026,10 +1024,10 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c for (uint32_t uiModeFull = 0; uiModeFull < numModesFull; uiModeFull++) { const bool isTransposed = (uiModeFull >= transpOff ? true : false); - const uint32_t uiMode = (isTransposed ? uiModeFull - transpOff : uiModeFull); + const uint32_t mode = (isTransposed ? uiModeFull - transpOff : uiModeFull); pu.mipTransposedFlag = isTransposed; - pu.intraDir[CHANNEL_TYPE_LUMA] = uiMode; + pu.intraDir[CHANNEL_TYPE_LUMA] = mode; predIntraMip(COMPONENT_Y, piPred, pu); // Use the min between SAD and HAD as the cost criterion @@ -1039,7 +1037,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c m_CABACEstimator->getCtx() = SubCtx(Ctx::MipFlag, ctxStartMipFlag); - uint64_t fracModeBits = xFracModeBitsIntra(pu, uiMode, CHANNEL_TYPE_LUMA); + uint64_t fracModeBits = xFracModeBitsIntra(pu, mode, CHANNEL_TYPE_LUMA); double cost = double(minSadHad) + double(fracModeBits) * sqrtLambdaForFirstPass; mipHadCost[uiModeFull] = cost; @@ -1049,54 +1047,53 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c #if GDR_ENABLED if (isEncodeGdrClean) { - if (isValidIntraPredLuma(pu, uiMode)) + if (isValidIntraPredLuma(pu, mode)) { - updateCandList(ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, uiMode), cost, uiRdModeList, - CandCostList, numModesForFullRD + 1); - updateCandList(ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, uiMode), - 0.8 * double(minSadHad), uiHadModeList, CandHadList, numHadCand); + updateCandList(ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, mode), cost, rdModeList, + candCostList, numModesForFullRD + 1); + updateCandList(ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, mode), + 0.8 * double(minSadHad), hadModeList, candHadList, numHadCand); } } else { - updateCandList(ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, uiMode), cost, uiRdModeList, - CandCostList, numModesForFullRD + 1); - updateCandList(ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, uiMode), - 0.8 * double(minSadHad), uiHadModeList, CandHadList, numHadCand); + updateCandList(ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, mode), cost, rdModeList, + candCostList, numModesForFullRD + 1); + updateCandList(ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, mode), + 0.8 * double(minSadHad), hadModeList, candHadList, numHadCand); } #else - updateCandList(ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, uiMode), cost, uiRdModeList, - CandCostList, numModesForFullRD + 1); - updateCandList(ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, uiMode), - 0.8 * double(minSadHad), uiHadModeList, CandHadList, numHadCand); + updateCandList(ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, mode), cost, rdModeList, + candCostList, numModesForFullRD + 1); + updateCandList(ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, mode), 0.8 * double(minSadHad), + hadModeList, candHadList, numHadCand); #endif } const double thresholdHadCost = 1.0 + 1.4 / sqrt((double) (pu.lwidth() * pu.lheight())); - reduceHadCandList(uiRdModeList, CandCostList, numModesForFullRD, thresholdHadCost, mipHadCost, pu, - fastMip); + reduceHadCandList(rdModeList, candCostList, numModesForFullRD, thresholdHadCost, mipHadCost, pu, fastMip); } if (sps.getUseMIP() && LFNSTSaveFlag) { // save found best modes - m_uiSavedNumRdModesLFNST = numModesForFullRD; - m_uiSavedRdModeListLFNST = uiRdModeList; - m_dSavedModeCostLFNST = CandCostList; + m_savedNumRdModesLFNST = numModesForFullRD; + m_savedRdModeListLFNST = rdModeList; + m_savedModeCostLFNST = candCostList; // PBINTRA fast - m_uiSavedHadModeListLFNST = uiHadModeList; - m_dSavedHadListLFNST = CandHadList; + m_uiSavedHadModeListLFNST = hadModeList; + m_dSavedHadListLFNST = candHadList; LFNSTSaveFlag = false; } } else // if( sps.getUseMIP() && LFNSTLoadFlag) { // restore saved modes - numModesForFullRD = m_uiSavedNumRdModesLFNST; - uiRdModeList = m_uiSavedRdModeListLFNST; - CandCostList = m_dSavedModeCostLFNST; + numModesForFullRD = m_savedNumRdModesLFNST; + rdModeList = m_savedRdModeListLFNST; + candCostList = m_savedModeCostLFNST; // PBINTRA fast - uiHadModeList = m_uiSavedHadModeListLFNST; - CandHadList = m_dSavedHadListLFNST; + hadModeList = m_uiSavedHadModeListLFNST; + candHadList = m_dSavedHadListLFNST; } if (m_pcEncCfg->getFastUDIUseMPMEnabled()) @@ -1117,7 +1114,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c int nn = numModesForFullRD; if (isEncodeGdrClean) { - nn = std::min((int)numModesForFullRD, (int)uiRdModeList.size()); + nn = std::min((int) numModesForFullRD, (int) rdModeList.size()); } for (int i = 0; i < nn; i++) @@ -1125,7 +1122,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c for (int i = 0; i < numModesForFullRD; i++) #endif { - mostProbableModeIncluded |= (mostProbableMode == uiRdModeList[i]); + mostProbableModeIncluded |= (mostProbableMode == rdModeList[i]); } #if GDR_ENABLED if (!isEncodeGdrClean) @@ -1133,16 +1130,16 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c if (!mostProbableModeIncluded) { numModesForFullRD++; - uiRdModeList.push_back(mostProbableMode); - CandCostList.push_back(0); + rdModeList.push_back(mostProbableMode); + candCostList.push_back(0); } } #else if (!mostProbableModeIncluded) { numModesForFullRD++; - uiRdModeList.push_back(mostProbableMode); - CandCostList.push_back(0); + rdModeList.push_back(mostProbableMode); + candCostList.push_back(0); } #endif } @@ -1184,7 +1181,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c { // Store the modes to be checked with RD m_savedNumRdModes[lfnstIdx] = numModesForFullRD; - std::copy_n(uiRdModeList.begin(), numModesForFullRD, m_savedRdModeList[lfnstIdx]); + std::copy_n(rdModeList.begin(), numModesForFullRD, m_savedRdModeList[lfnstIdx]); } } else // mtsUsage = 2 (here we potentially reduce the number of modes that will be full-RD checked) @@ -1200,7 +1197,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c { if (m_modeCostStore[lfnstIdx][i] <= thresholdSkipMode * m_bestModeCostStore[lfnstIdx]) { - uiRdModeList.push_back(m_savedRdModeList[lfnstIdx][i]); + rdModeList.push_back(m_savedRdModeList[lfnstIdx][i]); numModesForFullRD++; } } @@ -1210,36 +1207,36 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c { // Restore the modes to be checked with RD numModesForFullRD = m_savedNumRdModes[lfnstIdx]; - uiRdModeList.resize(numModesForFullRD); - std::copy_n(m_savedRdModeList[lfnstIdx], m_savedNumRdModes[lfnstIdx], uiRdModeList.begin()); - CandCostList.resize(numModesForFullRD); + rdModeList.resize(numModesForFullRD); + std::copy_n(m_savedRdModeList[lfnstIdx], m_savedNumRdModes[lfnstIdx], rdModeList.begin()); + candCostList.resize(numModesForFullRD); } } #if GDR_ENABLED if (!isEncodeGdrClean) { - CHECK(numModesForFullRD != uiRdModeList.size(), "Inconsistent state!"); + CHECK(numModesForFullRD != rdModeList.size(), "Inconsistent state!"); } #else - CHECK(numModesForFullRD != uiRdModeList.size(), "Inconsistent state!"); + CHECK(numModesForFullRD != rdModeList.size(), "Inconsistent state!"); #endif // after this point, don't use numModesForFullRD // PBINTRA fast - if (m_pcEncCfg->getUsePbIntraFast() && !cs.slice->isIntra() && uiRdModeList.size() < numModesAvailable + if (m_pcEncCfg->getUsePbIntraFast() && !cs.slice->isIntra() && rdModeList.size() < numModesAvailable && !cs.slice->getDisableSATDForRD() && (mtsUsageFlag != 2 || lfnstIdx > 0)) { double pbintraRatio = (lfnstIdx > 0) ? 1.25 : PBINTRA_RATIO; int maxSize = -1; ModeInfo bestMipMode; int bestMipIdx = -1; - for (int idx = 0; idx < uiRdModeList.size(); idx++) + for (int idx = 0; idx < rdModeList.size(); idx++) { - if (uiRdModeList[idx].mipFlg) + if (rdModeList[idx].mipFlg) { - bestMipMode = uiRdModeList[idx]; + bestMipMode = rdModeList[idx]; bestMipIdx = idx; break; } @@ -1247,19 +1244,19 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c const int numHadCand = 3; for (int k = numHadCand - 1; k >= 0; k--) { - if (CandHadList.size() < (k + 1) || CandHadList[k] > cs.interHad * pbintraRatio) + if (candHadList.size() < (k + 1) || candHadList[k] > cs.interHad * pbintraRatio) { maxSize = k; } } if (maxSize > 0) { - uiRdModeList.resize(std::min<size_t>(uiRdModeList.size(), maxSize)); + rdModeList.resize(std::min<size_t>(rdModeList.size(), maxSize)); if (bestMipIdx >= 0) { - if (uiRdModeList.size() <= bestMipIdx) + if (rdModeList.size() <= bestMipIdx) { - uiRdModeList.push_back(bestMipMode); + rdModeList.push_back(bestMipMode); } } if (saveDataForISP) @@ -1284,7 +1281,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c } } - int numNonISPModes = (int)uiRdModeList.size(); + int numNonISPModes = (int) rdModeList.size(); if ( testISP ) { @@ -1296,7 +1293,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c m_curIspLfnstIdx = 0; for (int i = 0; i < maxNumRDModesISP; i++) { - uiRdModeList.push_back(ModeInfo(false, false, 0, INTRA_SUBPARTITIONS_RESERVED, 0)); + rdModeList.push_back(ModeInfo(false, false, 0, INTRA_SUBPARTITIONS_RESERVED, 0)); } } #else @@ -1304,7 +1301,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c m_curIspLfnstIdx = 0; for (int i = 0; i < maxNumRDModesISP; i++) { - uiRdModeList.push_back( ModeInfo( false, false, 0, INTRA_SUBPARTITIONS_RESERVED, 0 ) ); + rdModeList.push_back(ModeInfo(false, false, 0, INTRA_SUBPARTITIONS_RESERVED, 0)); } #endif } @@ -1325,7 +1322,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c csBest->picture = cs.picture; // just to be sure - numModesForFullRD = ( int ) uiRdModeList.size(); + numModesForFullRD = (int) rdModeList.size(); TUIntraSubPartitioner subTuPartitioner( partitioner ); if ( testISP ) { @@ -1334,7 +1331,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c } int bestLfnstIdx = cu.lfnstIdx; - for (int mode = isSecondColorSpace ? 0 : -2 * int(testBDPCM); mode < (int)uiRdModeList.size(); mode++) + for (int mode = isSecondColorSpace ? 0 : -2 * int(testBDPCM); mode < (int) rdModeList.size(); mode++) { // set CU/PU to luma prediction mode ModeInfo uiOrgMode; @@ -1351,9 +1348,9 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c else { cu.bdpcmMode = 0; - uiOrgMode = uiRdModeList[mode]; + uiOrgMode = rdModeList[mode]; } - if (!cu.bdpcmMode && uiRdModeList[mode].ispMod == INTRA_SUBPARTITIONS_RESERVED) + if (!cu.bdpcmMode && rdModeList[mode].ispMod == INTRA_SUBPARTITIONS_RESERVED) { if (mode == numNonISPModes) // the list needs to be sorted only once { @@ -1366,13 +1363,13 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c break; } } - xGetNextISPMode(uiRdModeList[mode], (mode > 0 ? &uiRdModeList[mode - 1] : nullptr), Size(width, height)); - if (uiRdModeList[mode].ispMod == INTRA_SUBPARTITIONS_RESERVED) + xGetNextISPMode(rdModeList[mode], (mode > 0 ? &rdModeList[mode - 1] : nullptr), Size(width, height)); + if (rdModeList[mode].ispMod == INTRA_SUBPARTITIONS_RESERVED) { continue; } cu.lfnstIdx = m_curIspLfnstIdx; - uiOrgMode = uiRdModeList[mode]; + uiOrgMode = rdModeList[mode]; } cu.mipFlag = uiOrgMode.mipFlg; pu.mipTransposedFlag = uiOrgMode.mipTrFlg; @@ -1751,18 +1748,18 @@ void IntraSearch::estIntraPredChromaQT( CodingUnit &cu, Partitioner &partitioner Distortion baseDist = cs.dist; bool testBDPCM = true; testBDPCM = testBDPCM && CU::bdpcmAllowed(cu, COMPONENT_Cb) && cu.ispMode == 0 && cu.mtsFlag == 0 && cu.lfnstIdx == 0; - for (int32_t uiMode = uiMinMode - (2 * int(testBDPCM)); uiMode < uiMaxMode; uiMode++) + for (int32_t mode = uiMinMode - (2 * int(testBDPCM)); mode < uiMaxMode; mode++) { int chromaIntraMode; - if (uiMode < 0) + if (mode < 0) { - cu.bdpcmModeChroma = -uiMode; - chromaIntraMode = cu.bdpcmModeChroma == 2 ? chromaCandModes[1] : chromaCandModes[2]; + cu.bdpcmModeChroma = -mode; + chromaIntraMode = cu.bdpcmModeChroma == 2 ? chromaCandModes[1] : chromaCandModes[2]; } else { - chromaIntraMode = chromaCandModes[uiMode]; + chromaIntraMode = chromaCandModes[mode]; cu.bdpcmModeChroma = 0; if( PU::isLMCMode( chromaIntraMode ) && ! PU::isLMCModeEnabled( pu, chromaIntraMode ) ) @@ -5710,9 +5707,9 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio return cbfs; } -uint64_t IntraSearch::xFracModeBitsIntra(PredictionUnit &pu, const uint32_t &uiMode, const ChannelType &chType) +uint64_t IntraSearch::xFracModeBitsIntra(PredictionUnit &pu, const uint32_t &mode, const ChannelType &chType) { - uint32_t orgMode = uiMode; + uint32_t orgMode = mode; if (!pu.ciipFlag) std::swap(orgMode, pu.intraDir[chType]); diff --git a/source/Lib/EncoderLib/IntraSearch.h b/source/Lib/EncoderLib/IntraSearch.h index a1feb824c..b9d166011 100644 --- a/source/Lib/EncoderLib/IntraSearch.h +++ b/source/Lib/EncoderLib/IntraSearch.h @@ -363,10 +363,10 @@ private: int m_numSavedRdModeFirstColorSpace[4 * NUM_LFNST_NUM_PER_SET * 2]; int m_savedRdModeIdx; - static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> m_uiSavedRdModeListLFNST; + static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> m_savedRdModeListLFNST; static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> m_uiSavedHadModeListLFNST; - uint32_t m_uiSavedNumRdModesLFNST; - static_vector<double, FAST_UDI_MAX_RDMODE_NUM> m_dSavedModeCostLFNST; + uint32_t m_savedNumRdModesLFNST; + static_vector<double, FAST_UDI_MAX_RDMODE_NUM> m_savedModeCostLFNST; static_vector<double, FAST_UDI_MAX_RDMODE_NUM> m_dSavedHadListLFNST; PelStorage m_tmpStorageLCU; @@ -433,7 +433,7 @@ public: bool estIntraPredLumaQT(CodingUnit &cu, Partitioner& pm, const double bestCostSoFar = MAX_DOUBLE, bool mtsCheckRangeFlag = false, int mtsFirstCheckId = 0, int mtsLastCheckId = 0, bool moreProbMTSIdxFirst = false, CodingStructure* bestCS = NULL); void estIntraPredChromaQT ( CodingUnit &cu, Partitioner& pm, const double maxCostAllowed = MAX_DOUBLE ); void PLTSearch ( CodingStructure &cs, Partitioner& partitioner, ComponentID compBegin, uint32_t numComp); - uint64_t xFracModeBitsIntra (PredictionUnit &pu, const uint32_t &uiMode, const ChannelType &compID); + uint64_t xFracModeBitsIntra(PredictionUnit &pu, const uint32_t &mode, const ChannelType &compID); void invalidateBestModeCost () { for( int i = 0; i < NUM_LFNST_NUM_PER_SET; i++ ) m_bestModeCostValid[ i ] = false; }; void sortRdModeListFirstColorSpace(ModeInfo mode, double cost, char bdpcmMode, ModeInfo* rdModeList, double* rdCostList, char* bdpcmModeList, int& candNum); diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index b13126437..f141c4b72 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -131,13 +131,13 @@ void VLCWriter::xWriteCode ( uint32_t uiCode, uint32_t uiLength ) void VLCWriter::xWriteUvlc ( uint32_t uiCode ) { uint32_t uiLength = 1; - uint32_t uiTemp = ++uiCode; + uint32_t temp = ++uiCode; - CHECK( !uiTemp, "Integer overflow" ); + CHECK(!temp, "Integer overflow"); - while( 1 != uiTemp ) + while (1 != temp) { - uiTemp >>= 1; + temp >>= 1; uiLength += 2; } // Take care of cases where uiLength > 32 -- GitLab