From 6b23ac24f836d4cadebaef51d8824351d8a0dc10 Mon Sep 17 00:00:00 2001 From: Yin Zhao <yin.zhao@huawei.com> Date: Thu, 8 Aug 2019 17:39:38 +0800 Subject: [PATCH] remove unnecessary changes compared with 9fc63d265fdfff482926590c4271b5d4d19404e7 --- source/Lib/CommonLib/ContextModelling.cpp | 3 --- source/Lib/DecoderLib/CABACReader.cpp | 22 +++++++++++----------- source/Lib/EncoderLib/CABACWriter.cpp | 20 ++++++++++---------- source/Lib/EncoderLib/EncCu.cpp | 6 +++--- source/Lib/EncoderLib/InterSearch.cpp | 1 + source/Lib/EncoderLib/IntraSearch.cpp | 14 +++++++------- 6 files changed, 32 insertions(+), 34 deletions(-) diff --git a/source/Lib/CommonLib/ContextModelling.cpp b/source/Lib/CommonLib/ContextModelling.cpp index da1e75fcc..f15da5275 100644 --- a/source/Lib/CommonLib/ContextModelling.cpp +++ b/source/Lib/CommonLib/ContextModelling.cpp @@ -142,10 +142,7 @@ unsigned DeriveCtx::CtxModeConsFlag( const CodingStructure& cs, Partitioner& par const unsigned curSliceIdx = cs.slice->getIndependentSliceIdx(); const unsigned curTileIdx = cs.picture->brickMap->getBrickIdxRsMap( partitioner.currArea().lumaPos() ); - // get left depth const CodingUnit* cuLeft = cs.getCURestricted( pos.offset( -1, 0 ), pos, curSliceIdx, curTileIdx, partitioner.chType ); - - // get above depth const CodingUnit* cuAbove = cs.getCURestricted( pos.offset( 0, -1 ), pos, curSliceIdx, curTileIdx, partitioner.chType ); unsigned ctxId = ((cuAbove && cuAbove->predMode == MODE_INTRA) || (cuLeft && cuLeft->predMode == MODE_INTRA)) ? 1 : 0; diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index 18c0c2d43..c3811d8b8 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -1843,14 +1843,14 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_ const SPS& sps = *(cu.cs->sps); TransformUnit& tu = *cu.firstTU; int curPLTidx = 0; -//================================================================================ + cu.lastPLTSize[compBegin] = cu.cs->prevPLT.curPLTSize[compBegin]; -// clause 7.3.8.6 + if (cu.lastPLTSize[compBegin]) { xDecodePLTPredIndicator(cu, MAXPLTSIZE, compBegin); } -//-------------------------------------------------------------------------------- + for (int idx = 0; idx < cu.lastPLTSize[compBegin]; idx++) { if (cu.reuseflag[compBegin][idx]) @@ -1862,14 +1862,14 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_ curPLTidx++; } } -// void prediction_unit ( pu, mrgCtx ); + uint32_t recievedPLTnum = 0; -// void merge_flag ( pu ); + if (curPLTidx < MAXPLTSIZE) { recievedPLTnum = exp_golomb_eqprob(0); } -// void merge_data ( pu, mrgCtx ); + cu.curPLTSize[compBegin] = curPLTidx + recievedPLTnum; for (int comp = compBegin; comp < (compBegin + numComp); comp++) { @@ -1894,7 +1894,7 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_ PelBuf curPLTIdx = tu.getcurPLTIdx(compBegin); uint32_t height = cu.block(compBegin).height; uint32_t width = cu.block(compBegin).width; -// void merge_idx ( pu ); + int numCopyIndexRuns = -1; bool lastRunType = 0; uint32_t numIndices = 0; @@ -1921,7 +1921,7 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_ { cu.useRotation[compBegin] = false; } -// void inter_pred_idc ( pu ); + if (cu.useEscape[compBegin] && cu.cs->pps->getUseDQP() && !cuCtx.isDQPCoded) { #if JVET_O0050_LOCAL_DUAL_TREE @@ -1951,8 +1951,8 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_ cuCtx.isChromaQpAdjCoded = true; } } -// void ref_idx ( pu, refList ); -// void mvp_flag ( pu, refList ); + + m_scanOrder = g_scanOrder[SCAN_UNGROUPED][(cu.useRotation[compBegin]) ? SCAN_TRAV_VER : SCAN_TRAV_HOR][gp_sizeIdxInfo->idxFrom(width)][gp_sizeIdxInfo->idxFrom(height)]; uint32_t strPos = 0; uint32_t endPos = height * width; @@ -1962,7 +1962,7 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_ uint32_t posx = m_scanOrder[strPos].x; uint32_t posyprev = strPos == 0 ? 0 : m_scanOrder[strPos - 1].y; uint32_t posxprev = strPos == 0 ? 0 : m_scanOrder[strPos - 1].x; -//================================================================================ + if (indexMaxSize > 1) { if (((posy == 0) && !cu.useRotation[compBegin]) || ((posx == 0) && cu.useRotation[compBegin])) diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp index 10c7acdb5..89eed95c7 100644 --- a/source/Lib/EncoderLib/CABACWriter.cpp +++ b/source/Lib/EncoderLib/CABACWriter.cpp @@ -1718,7 +1718,7 @@ void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, u PelBuf curPLTIdx = tu.getcurPLTIdx(compBegin); uint32_t height = cu.block(compBegin).height; uint32_t width = cu.block(compBegin).width; -//================================================================================ + m_scanOrder = g_scanOrder[SCAN_UNGROUPED][(cu.useRotation[compBegin]) ? SCAN_TRAV_VER : SCAN_TRAV_HOR][gp_sizeIdxInfo->idxFrom(width)][gp_sizeIdxInfo->idxFrom(height)]; uint32_t total = height * width; int lastRunPos = -1; @@ -1762,7 +1762,7 @@ void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, u { assert(!cu.useRotation[compBegin]); } -// clause 7.3.8.6 + if (cu.useEscape[compBegin] && cu.cs->pps->getUseDQP() && !cuCtx.isDQPCoded) { if (!CS::isDualITree(*tu.cs) || isLuma(tu.chType)) @@ -1784,7 +1784,7 @@ void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, u cuCtx.isChromaQpAdjCoded = true; } } -//-------------------------------------------------------------------------------- + uint32_t strPos = 0; uint32_t endPos = height * width; auto parsedIdxEnd = parsedIdx.end(); @@ -1795,11 +1795,11 @@ void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, u uint32_t posx = m_scanOrder[strPos].x; uint32_t posyprev = strPos == 0 ? 0 : m_scanOrder[strPos - 1].y; uint32_t posxprev = strPos == 0 ? 0 : m_scanOrder[strPos - 1].x; -// void prediction_unit ( pu ); + if (indexMaxSize > 1) { if (((posy == 0) && !cu.useRotation[compBegin]) || ((posx == 0) && cu.useRotation[compBegin])) -// void merge_flag ( pu ); + { assert(runType.at(posx, posy) == PLT_RUN_INDEX); } @@ -1815,7 +1815,7 @@ void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, u } } } -// void merge_idx ( pu ); + Pel curLevel = 0; if (runType.at(posx, posy) == PLT_RUN_INDEX) { @@ -1828,7 +1828,7 @@ void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, u curLevel = 0; } } -// void inter_pred_idc ( pu ); + if (indexMaxSize > 1) { if (lastRunPos != strPos) @@ -1836,13 +1836,13 @@ void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, u numIndices -= (runType.at(posx, posy) == PLT_RUN_INDEX); cu_run_val(runLength.at(posx, posy) - 1, (PLTRunMode)runType.at(posx, posy), curLevel, endPos - strPos - numIndices - 1 - lastRunType); } -// void ref_idx ( pu, refList ); + } -// void mvp_flag ( pu, refList ); + strPos += (runLength.at(posx, posy)); } assert(strPos == endPos); -//================================================================================ + uint32_t scaleX = getComponentScaleX(COMPONENT_Cb, sps.getChromaFormatIdc()); uint32_t scaleY = getComponentScaleY(COMPONENT_Cb, sps.getChromaFormatIdc()); for (int comp = compBegin; comp < (compBegin + numComp); comp++) diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp index 2f44ae35f..ab2986431 100644 --- a/source/Lib/EncoderLib/EncCu.cpp +++ b/source/Lib/EncoderLib/EncCu.cpp @@ -1870,7 +1870,7 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC if( isLuma( partitioner.chType ) ) { #if JVET_O0502_ISP_CLEANUP - //the Intra SubPartitions mode uses the value of the best cost so far (luma if it is the fast version) to avoid test non-necessary lines + //ISP uses the value of the best cost so far (luma if it is the fast version) to avoid test non-necessary subpartitions #if JVET_O0050_LOCAL_DUAL_TREE double bestCostSoFar = partitioner.isSepTree(*tempCS) ? m_modeCtrl->getBestCostWithoutSplitFlags() : bestCU && bestCU->predMode == MODE_INTRA ? bestCS->lumaCost : bestCS->cost; if (partitioner.isSepTree(*tempCS) && encTestMode.maxCostAllowed < bestCostSoFar) @@ -2076,7 +2076,7 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC } #if JVET_O0502_ISP_CLEANUP - //we decide to skip the second emt pass or not according to the ISP results + //we decide to skip the non-DCT-II transforms and LFNST according to the ISP results if ((endMtsFlag > 0 || endLfnstIdx > 0) && cu.ispMode && !mtsFlag && !lfnstIdx && tempCS->slice->isIntra() && m_pcEncCfg->getUseFastISP()) #else //we decide to skip the second emt pass or not according to the ISP results @@ -4162,7 +4162,7 @@ bool EncCu::xCheckRDCostInterIMV( CodingStructure *&tempCS, CodingStructure *&be int iIMV = int( ( encTestMode.opts & ETO_IMV ) >> ETO_IMV_SHIFT ); m_pcInterSearch->setAffineModeSelected(false); #if JVET_O0057_ALTHPELIF - // Only int-Pel, 4-Pel and fast 4-Pel allowed + // Only Half-Pel, int-Pel, 4-Pel and fast 4-Pel allowed CHECK(iIMV < 1 || iIMV > 4, "Unsupported IMV Mode"); const bool testAltHpelFilter = iIMV == 4; #else diff --git a/source/Lib/EncoderLib/InterSearch.cpp b/source/Lib/EncoderLib/InterSearch.cpp index 8fe16e15c..6e7aeeaae 100644 --- a/source/Lib/EncoderLib/InterSearch.cpp +++ b/source/Lib/EncoderLib/InterSearch.cpp @@ -8169,3 +8169,4 @@ bool InterSearch::searchBv(PredictionUnit& pu, int xPos, int yPos, int width, in } #endif +//! \} \ No newline at end of file diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp index 7d8020f77..6d6904e94 100644 --- a/source/Lib/EncoderLib/IntraSearch.cpp +++ b/source/Lib/EncoderLib/IntraSearch.cpp @@ -358,7 +358,7 @@ bool IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner, if( testISP ) { #if JVET_O0502_ISP_CLEANUP - //variables for the full RD list without MRL modes + //reset the variables used for the tests m_ispCandListHor.clear(); m_ispCandListVer.clear(); m_regIntraRDListWithCosts.clear(); @@ -622,7 +622,7 @@ bool IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner, if ( testISP ) { #if JVET_O0502_ISP_CLEANUP - //we save the list with no mrl modes to keep only the Hadamard selected modes (no mpms) + // we save the regular intra modes list m_ispCandListHor = uiRdModeList; #else //we save the list with no mrl modes to keep only the Hadamard selected modes (no mpms) @@ -683,7 +683,7 @@ bool IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner, #if JVET_O0925_MIP_SIMPLIFICATIONS if (LFNSTSaveFlag && testMip && !allowLfnstWithMip(cu.firstPU->lumaSize())) // save a different set for the next run { - //*** Derive MIP candidates using Hadamard + // save found best modes m_uiSavedRdModeListLFNST = uiRdModeList; m_dSavedModeCostLFNST = CandCostList; // PBINTRA fast @@ -799,7 +799,7 @@ bool IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner, if ( testISP ) { #if JVET_O0502_ISP_CLEANUP - //we add the ISP MPMs to the list without mrl modes + // we add the MPMs to the list that contains only regular intra modes for (int j = 0; j < numCand; j++) { bool mostProbableModeIncluded = false; @@ -1026,7 +1026,7 @@ bool IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner, if ( testISP ) { #if JVET_O0502_ISP_CLEANUP - //we create a single full RD list that includes all intra modes using regular intra, MRL and ISP + // we reserve positions for ISP in the common full RD list const int maxNumRDModesISP = 16; for (int i = 0; i < maxNumRDModesISP; i++) uiRdModeList.push_back(ModeInfo(false, 0, INTRA_SUBPARTITIONS_RESERVED, 0)); @@ -1779,7 +1779,7 @@ void IntraSearch::PLTSearch(CodingStructure &cs, Partitioner& partitioner, Compo //derive palette derivePLTLossy(cs, partitioner, compBegin, numComp); reorderPLT(cs, partitioner, compBegin, numComp); -// ------------------------------------------------------------------------------------------------------------------- + //calculate palette index preCalcPLTIndex(cs, partitioner, compBegin, numComp); //derive run @@ -1800,7 +1800,7 @@ void IntraSearch::PLTSearch(CodingStructure &cs, Partitioner& partitioner, Compo { if (curPLTIdx.at(x, y) == cu.curPLTSize[compBegin]) { -// Intra search + } else { -- GitLab