From a4f4a0c98070b5f8e68e368da0a8afd33e0f43f0 Mon Sep 17 00:00:00 2001 From: Frank Bossen <fbossen@gmail.com> Date: Mon, 22 Mar 2021 16:19:45 -0400 Subject: [PATCH] Remove trailing spaces --- .../BitstreamExtractorApp.cpp | 2 +- source/App/DecoderApp/DecApp.cpp | 10 ++-- source/App/EncoderApp/EncAppCfg.cpp | 6 +- source/App/Parcat/parcat.cpp | 4 +- source/App/StreamMergeApp/StreamMergeApp.cpp | 4 +- source/App/SubpicMergeApp/SubpicMergeApp.cpp | 14 ++--- source/Lib/CommonLib/InterPrediction.cpp | 2 +- source/Lib/CommonLib/IntraPrediction.cpp | 4 +- source/Lib/CommonLib/Picture.cpp | 6 +- source/Lib/CommonLib/Quant.cpp | 2 +- source/Lib/CommonLib/QuantRDOQ.cpp | 2 +- source/Lib/CommonLib/Slice.cpp | 8 +-- source/Lib/CommonLib/UnitTools.cpp | 4 +- .../Lib/CommonLib/dtrace_blockstatistics.cpp | 20 +++---- source/Lib/DecoderLib/DecLib.cpp | 48 +++++++-------- source/Lib/DecoderLib/SEIread.cpp | 6 +- source/Lib/DecoderLib/VLCReader.cpp | 16 ++--- .../Lib/EncoderLib/EncAdaptiveLoopFilter.cpp | 2 +- source/Lib/EncoderLib/EncCu.cpp | 2 +- source/Lib/EncoderLib/EncGOP.cpp | 60 +++++++++---------- source/Lib/EncoderLib/EncLib.cpp | 24 ++++---- source/Lib/EncoderLib/EncModeCtrl.cpp | 6 +- source/Lib/EncoderLib/EncSlice.cpp | 4 +- source/Lib/EncoderLib/InterSearch.cpp | 2 +- source/Lib/EncoderLib/IntraSearch.cpp | 4 +- source/Lib/EncoderLib/SEIwrite.cpp | 2 +- source/Lib/EncoderLib/VLCWriter.cpp | 18 +++--- 27 files changed, 141 insertions(+), 141 deletions(-) diff --git a/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp b/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp index fdc5a03e5..c31a7a5a7 100644 --- a/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp +++ b/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp @@ -116,7 +116,7 @@ Slice BitstreamExtractorApp::xParseSliceHeader(InputNALUnit &nalu) slice.setTLayer(nalu.m_temporalId); m_hlSynaxReader.parseSliceHeader(&slice, &m_picHeader, &m_parameterSetManager, m_prevTid0Poc, m_prevPicPOC); - + return slice; } diff --git a/source/App/DecoderApp/DecApp.cpp b/source/App/DecoderApp/DecApp.cpp index 923753891..d3bb0c735 100644 --- a/source/App/DecoderApp/DecApp.cpp +++ b/source/App/DecoderApp/DecApp.cpp @@ -974,7 +974,7 @@ void DecApp::xOutputAnnotatedRegions(PicList* pcListPic) for(auto it=annotatedRegionSEIs.begin(); it!=annotatedRegionSEIs.end(); it++) { const SEIAnnotatedRegions &seiAnnotatedRegions = *(SEIAnnotatedRegions*)(*it); - + if (seiAnnotatedRegions.m_hdr.m_cancelFlag) { m_arObjects.clear(); @@ -1011,13 +1011,13 @@ void DecApp::xOutputAnnotatedRegions(PicList* pcListPic) } } } - + // Process object updates for(auto srcIt=seiAnnotatedRegions.m_annotatedRegions.begin(); srcIt!=seiAnnotatedRegions.m_annotatedRegions.end(); srcIt++) { uint32_t objIdx = srcIt->first; const SEIAnnotatedRegions::AnnotatedRegionObject &src =srcIt->second; - + if (src.objectCancelFlag) { m_arObjects.erase(objIdx); @@ -1025,7 +1025,7 @@ void DecApp::xOutputAnnotatedRegions(PicList* pcListPic) else { auto destIt = m_arObjects.find(objIdx); - + if (destIt == m_arObjects.end()) { //New object arrived, needs to be appended to the map of tracked objects @@ -1034,7 +1034,7 @@ void DecApp::xOutputAnnotatedRegions(PicList* pcListPic) else //Existing object, modifications to be done { SEIAnnotatedRegions::AnnotatedRegionObject &dst=destIt->second; - + if (seiAnnotatedRegions.m_hdr.m_objectLabelPresentFlag && src.objectLabelValid) { dst.objectLabelValid=true; diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 7b87ededf..df158d387 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -1392,7 +1392,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("StopAfterFFtoPOC", m_stopAfterFFtoPOC, false, "If using fast forward to POC, after the POC of interest has been hit, stop further encoding.") ("ForceDecodeBitstream1", m_forceDecodeBitstream1, false, "force decoding of bitstream 1 - use this only if you are realy sure about what you are doing ") ("DecodeBitstream2ModPOCAndType", m_bs2ModPOCAndType, false, "Modify POC and NALU-type of second input bitstream, to use second BS as closing I-slice") - + ("DebugCTU", m_debugCTU, -1, "If DebugBitstream is present, load frames up to this POC from this bitstream. Starting with DebugPOC-frame at CTUline containin debug CTU.") ( "ALF", m_alf, true, "Adaptive Loop Filter\n" ) #if JVET_U0081 @@ -2471,7 +2471,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) { firstSliceLossless = true; } - if (firstSliceLossless) // if first slice is lossless + if (firstSliceLossless) // if first slice is lossless m_iQP = LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP - ( ( m_internalBitDepth[CHANNEL_TYPE_LUMA] - 8 ) * 6 ); } @@ -2779,7 +2779,7 @@ bool EncAppCfg::xCheckParameter() { xConfirmPara(m_ccalfStrength < 0.0, "CCALFStrength is less than 0. Valid range is 0.0 <= CCALFStrength <= 1.0"); xConfirmPara(m_ccalfStrength > 1.0, "CCALFStrength is greater than 1. Valid range is 0.0 <= CCALFStrength <= 1.0"); - } + } #if JVET_U0081 if (m_alf) { diff --git a/source/App/Parcat/parcat.cpp b/source/App/Parcat/parcat.cpp index cf1318233..d23035edf 100644 --- a/source/App/Parcat/parcat.cpp +++ b/source/App/Parcat/parcat.cpp @@ -65,7 +65,7 @@ void ParcatHLSyntaxReader::parsePictureHeaderUpToPoc ( ParameterSetManager *para uint32_t uiCode; PPS* pps = NULL; SPS* sps = NULL; - + uint32_t uiTmp; READ_FLAG(uiTmp, "ph_gdr_or_irap_pic_flag"); READ_FLAG(uiCode, "ph_non_ref_pic_flag"); @@ -329,7 +329,7 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int skip_next_sei = true; idr_found = true; } - if ((idx > 1 && (nalu_type == NAL_UNIT_CODED_SLICE_IDR_W_RADL || nalu_type == NAL_UNIT_CODED_SLICE_IDR_N_LP)) + if ((idx > 1 && (nalu_type == NAL_UNIT_CODED_SLICE_IDR_W_RADL || nalu_type == NAL_UNIT_CODED_SLICE_IDR_N_LP)) || ((idx > 1 && !idr_found) && (nalu_type == NAL_UNIT_OPI || nalu_type == NAL_UNIT_DCI || nalu_type == NAL_UNIT_VPS || nalu_type == NAL_UNIT_SPS || nalu_type == NAL_UNIT_PPS || nalu_type == NAL_UNIT_PREFIX_APS || nalu_type == NAL_UNIT_SUFFIX_APS || nalu_type == NAL_UNIT_PH || nalu_type == NAL_UNIT_ACCESS_UNIT_DELIMITER || nalu_type == NAL_UNIT_PREFIX_SEI)) || (nalu_type == NAL_UNIT_SUFFIX_SEI && skip_next_sei)) { diff --git a/source/App/StreamMergeApp/StreamMergeApp.cpp b/source/App/StreamMergeApp/StreamMergeApp.cpp index f7b6acf10..2f813eff7 100644 --- a/source/App/StreamMergeApp/StreamMergeApp.cpp +++ b/source/App/StreamMergeApp/StreamMergeApp.cpp @@ -535,13 +535,13 @@ uint32_t StreamMergeApp::mergeStreams() vector<MergeLayer> *layers = new vector<MergeLayer>; layers->resize(m_numInputStreams); - + // Prepare merge layers. for (int i = 0; i < layers->size(); i++) { MergeLayer &layer = layers->at(i); layer.id = i; - + // Open input file. layer.fp = new ifstream(); layer.fp->open(m_bitstreamFileNameIn[i], ifstream::in | ifstream::binary); diff --git a/source/App/SubpicMergeApp/SubpicMergeApp.cpp b/source/App/SubpicMergeApp/SubpicMergeApp.cpp index d4d1a7d4a..c5903447a 100644 --- a/source/App/SubpicMergeApp/SubpicMergeApp.cpp +++ b/source/App/SubpicMergeApp/SubpicMergeApp.cpp @@ -179,7 +179,7 @@ bool SubpicMergeApp::isNewPicture(std::ifstream *bitstreamFile, InputByteStream ret = true; finished = true; break; - + // NUT that are not the start of a new picture case NAL_UNIT_CODED_SLICE_TRAIL: case NAL_UNIT_CODED_SLICE_STSA: @@ -206,7 +206,7 @@ bool SubpicMergeApp::isNewPicture(std::ifstream *bitstreamFile, InputByteStream ret = false; finished = true; break; - + // NUT that might indicate the start of a new picture - keep looking case NAL_UNIT_PREFIX_APS: case NAL_UNIT_PREFIX_SEI: @@ -221,7 +221,7 @@ bool SubpicMergeApp::isNewPicture(std::ifstream *bitstreamFile, InputByteStream } } } - + // restore previous stream location - minus 3 due to the need for the annexB parser to read three extra bytes #if RExt__DECODER_DEBUG_BIT_STATISTICS bitstreamFile->clear(); @@ -482,7 +482,7 @@ void SubpicMergeApp::generateMergedStreamVPSes(std::vector<VPS*> &vpsList) { for (auto vpsId : m_subpics->at(0).vpsIds) { - // Create new SPS based on the SPS from the first subpicture + // Create new SPS based on the SPS from the first subpicture vpsList.push_back(new VPS(*m_subpics->at(0).psManager.getVPS(vpsId))); VPS &vps = *vpsList.back(); @@ -527,7 +527,7 @@ void SubpicMergeApp::generateMergedStreamSPSes(std::vector<SPS*> &spsList) for (auto spsId : m_subpics->at(0).spsIds) { - // Create new SPS based on the SPS from the first subpicture + // Create new SPS based on the SPS from the first subpicture spsList.push_back(new SPS(*m_subpics->at(0).psManager.getSPS(spsId))); SPS &sps = *spsList.back(); @@ -669,7 +669,7 @@ void SubpicMergeApp::generateMergedStreamPPSes(ParameterSetManager &psManager, s for (auto ppsId : m_subpics->at(0).ppsIds) { - // Create new PPS based on the PPS from the first subpicture + // Create new PPS based on the PPS from the first subpicture ppsList.push_back(new PPS(*m_subpics->at(0).psManager.getPPS(ppsId))); PPS &pps = *ppsList.back(); SPS &sps = *psManager.getSPS(pps.getSPSId()); @@ -899,7 +899,7 @@ Subpicture &SubpicMergeApp::selectSubpicForPicHeader(bool isMixedNaluPic) Subpicture *subpicToReturn = NULL; bool IRAPFound = false; - // Find first non-IRAP subpicture + // Find first non-IRAP subpicture for (auto &subpic : *m_subpics) { if (subpic.slices[0].isIRAP()) diff --git a/source/Lib/CommonLib/InterPrediction.cpp b/source/Lib/CommonLib/InterPrediction.cpp index 11275c32d..a6d47243d 100644 --- a/source/Lib/CommonLib/InterPrediction.cpp +++ b/source/Lib/CommonLib/InterPrediction.cpp @@ -2413,7 +2413,7 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio, int addX = isLuma( compID ) ? 0 : int( 1 - refPic->cs->sps->getHorCollocatedChromaFlag() ) * 8 * ( scalingRatio.first - SCALE_1X.first ); int addY = isLuma( compID ) ? 0 : int( 1 - refPic->cs->sps->getVerCollocatedChromaFlag() ) * 8 * ( scalingRatio.second - SCALE_1X.second ); - + int boundLeft = 0; int boundRight = refPicWidth >> ::getComponentScaleX( compID, chFmt ); int boundTop = 0; diff --git a/source/Lib/CommonLib/IntraPrediction.cpp b/source/Lib/CommonLib/IntraPrediction.cpp index a195c476c..9a1670748 100644 --- a/source/Lib/CommonLib/IntraPrediction.cpp +++ b/source/Lib/CommonLib/IntraPrediction.cpp @@ -182,7 +182,7 @@ Pel IntraPrediction::xGetPredValDc( const CPelBuf &pSrc, const Size &dstSize ) int IntraPrediction::getModifiedWideAngle( int width, int height, int predMode ) { - //The function returns a 'modified' wide angle index, given that it is not necessary + //The function returns a 'modified' wide angle index, given that it is not necessary //in this software implementation to reserve the values 0 and 1 for Planar and DC to generate the prediction signal. //It should only be used to obtain the intraPredAngle parameter. //To simply obtain the wide angle index, the function PU::getWideAngle should be used instead. @@ -196,7 +196,7 @@ int IntraPrediction::getModifiedWideAngle( int width, int height, int predMode ) } else if (height > width && predMode > VDIA_IDX - modeShift[deltaSize]) { - predMode -= (VDIA_IDX - 1); + predMode -= (VDIA_IDX - 1); } } return predMode; diff --git a/source/Lib/CommonLib/Picture.cpp b/source/Lib/CommonLib/Picture.cpp index 1d4ff4909..892477ec5 100644 --- a/source/Lib/CommonLib/Picture.cpp +++ b/source/Lib/CommonLib/Picture.cpp @@ -273,10 +273,10 @@ void Picture::fillSliceLossyLosslessArray(std::vector<uint16_t> sliceLosslessInd { uint16_t numElementsinsliceLosslessIndexArray = (uint16_t)sliceLosslessIndexArray.size(); uint32_t numSlices = this->cs->pps->getNumSlicesInPic(); - m_lossylosslessSliceArray.assign(numSlices, true); // initialize to all slices are lossless + m_lossylosslessSliceArray.assign(numSlices, true); // initialize to all slices are lossless if (mixedLossyLossless) { - m_lossylosslessSliceArray.assign(numSlices, false); // initialize to all slices are lossless + m_lossylosslessSliceArray.assign(numSlices, false); // initialize to all slices are lossless CHECK(numElementsinsliceLosslessIndexArray == 0 , "sliceLosslessArray is empty, must need to configure for mixed lossy/lossless"); // mixed lossy/lossless slices, set only lossless slices; @@ -285,7 +285,7 @@ void Picture::fillSliceLossyLosslessArray(std::vector<uint16_t> sliceLosslessInd CHECK(sliceLosslessIndexArray[i] >= numSlices || sliceLosslessIndexArray[i] < 0, "index of lossless slice is out of slice index bound"); m_lossylosslessSliceArray[sliceLosslessIndexArray[i]] = true; } - } + } CHECK(m_lossylosslessSliceArray.size() < numSlices, "sliceLosslessArray size is less than number of slices"); } diff --git a/source/Lib/CommonLib/Quant.cpp b/source/Lib/CommonLib/Quant.cpp index ce9f46528..509d388f1 100644 --- a/source/Lib/CommonLib/Quant.cpp +++ b/source/Lib/CommonLib/Quant.cpp @@ -1162,7 +1162,7 @@ void Quant::invTrSkipDeQuantOneSample(TransformUnit &tu, const ComponentID &comp const int channelBitDepth = sps.getBitDepth(toChannelType(compID)); const int iTransformShift = getTransformShift(channelBitDepth, rect.size(), maxLog2TrDynamicRange); const int scalingListType = getScalingListType(tu.cu->predMode, compID); - + const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->slice->getSPS()->getDisableScalingMatrixForLfnstBlks() : false; const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID)); const bool disableSMForACT = tu.cs->slice->getSPS()->getScalingMatrixForAlternativeColourSpaceDisabledFlag() && (tu.cs->slice->getSPS()->getScalingMatrixDesignatedColourSpaceFlag() == tu.cu->colorTransform); diff --git a/source/Lib/CommonLib/QuantRDOQ.cpp b/source/Lib/CommonLib/QuantRDOQ.cpp index 883b95066..b63dfbf3b 100644 --- a/source/Lib/CommonLib/QuantRDOQ.cpp +++ b/source/Lib/CommonLib/QuantRDOQ.cpp @@ -643,7 +643,7 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID, const TCoeff entropyCodingMinimum = -(1 << maxLog2TrDynamicRange); const TCoeff entropyCodingMaximum = (1 << maxLog2TrDynamicRange) - 1; - + CoeffCodingContext cctx(tu, compID, tu.cs->slice->getSignDataHidingEnabledFlag()); const int iCGSizeM1 = (1 << cctx.log2CGSize()) - 1; diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 5a4c3cd85..3ff8174ee 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -690,7 +690,7 @@ void Slice::checkRPL(const ReferencePictureList* pRPL0, const ReferencePictureLi if( m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL ) { CHECK( refPicDecodingOrderNumber < associatedIRAPDecodingOrderNumber, "RADL picture detected that violate the rule that no active entry in RefPicList[] shall precede the associated IRAP picture in decoding order" ); - // Checking this: "When the current picture is a RADL picture, there shall be no active entry in RefPicList[ 0 ] or + // Checking this: "When the current picture is a RADL picture, there shall be no active entry in RefPicList[ 0 ] or // RefPicList[ 1 ] that is any of the following: A RASL picture with pps_mixed_nalu_types_in_pic_flag is equal to 0 for (int i = 0; i < pcRefPic->numSlices; i++) { @@ -712,7 +712,7 @@ void Slice::checkRPL(const ReferencePictureList* pRPL0, const ReferencePictureLi bool cond1 = (pcRefPic->getPictureType() == NAL_UNIT_CODED_SLICE_GDR); bool cond2 = (pcRefPic->slices[0]->getPicHeader()->getRecoveryPocCnt() == 0); bool cond3 = (pcRefPic->cs->slice->isIRAP()); - + const VPS *vps = pcRefPic->cs->vps; const int maxTidILRefPicsPlus1 = vps->getMaxTidIlRefPicsPlus1(layerIdx, vps->getGeneralLayerIdx(pcRefPic->layerId)); @@ -1152,7 +1152,7 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic, const PPS& pps) } } - if ((nalUnitType == NAL_UNIT_CODED_SLICE_RASL || nalUnitType == NAL_UNIT_CODED_SLICE_RADL) && + if ((nalUnitType == NAL_UNIT_CODED_SLICE_RASL || nalUnitType == NAL_UNIT_CODED_SLICE_RADL) && (pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_RASL && pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_RADL) && !pps.getMixedNaluTypesInPicFlag()) { if (pcSlice->getAssociatedIRAPPOC() == this->getAssociatedIRAPPOC() && pcPic->layerId == this->m_nuhLayerId) @@ -3476,7 +3476,7 @@ void PPS::initSubPic(const SPS &sps) m_subPics[i].setSubPicWidthInCTUs(sps.getSubPicWidth(i)); m_subPics[i].setSubPicHeightInCTUs(sps.getSubPicHeight(i)); - uint32_t firstCTU = sps.getSubPicCtuTopLeftY(i) * m_picWidthInCtu + sps.getSubPicCtuTopLeftX(i); + uint32_t firstCTU = sps.getSubPicCtuTopLeftY(i) * m_picWidthInCtu + sps.getSubPicCtuTopLeftX(i); m_subPics[i].setFirstCTUInSubPic(firstCTU); uint32_t lastCTU = (sps.getSubPicCtuTopLeftY(i) + sps.getSubPicHeight(i) - 1) * m_picWidthInCtu + sps.getSubPicCtuTopLeftX(i) + sps.getSubPicWidth(i) - 1; m_subPics[i].setLastCTUInSubPic(lastCTU); diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp index b3b46dd26..a9251d444 100644 --- a/source/Lib/CommonLib/UnitTools.cpp +++ b/source/Lib/CommonLib/UnitTools.cpp @@ -208,7 +208,7 @@ void CU::checkConformanceILRP(Slice *slice) return; } - //constraint 1: The picture referred to by each active entry in RefPicList[ 0 ] or RefPicList[ 1 ] has the same subpicture layout as the current picture + //constraint 1: The picture referred to by each active entry in RefPicList[ 0 ] or RefPicList[ 1 ] has the same subpicture layout as the current picture bool isAllRefSameSubpicLayout = true; for (int refList = 0; refList < numRefList; refList++) // loop over l0 and l1 { @@ -826,7 +826,7 @@ uint32_t PU::getCoLocatedIntraLumaMode(const PredictionUnit &pu) int PU::getWideAngle( const TransformUnit &tu, const uint32_t dirMode, const ComponentID compID ) { - //This function returns a wide angle index taking into account that the values 0 and 1 are reserved + //This function returns a wide angle index taking into account that the values 0 and 1 are reserved //for Planar and DC respectively, as defined in the Spec. Text. if( dirMode < 2 ) { diff --git a/source/Lib/CommonLib/dtrace_blockstatistics.cpp b/source/Lib/CommonLib/dtrace_blockstatistics.cpp index 0689b3cd1..a5e061339 100644 --- a/source/Lib/CommonLib/dtrace_blockstatistics.cpp +++ b/source/Lib/CommonLib/dtrace_blockstatistics.cpp @@ -684,8 +684,8 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea) { const Mv mv = pixMi.mv[REF_PIC_LIST_0]; #if BLOCK_STATS_AS_CSV - g_trace_ctx->dtrace<false>( - D_BLOCK_STATISTICS_ALL, + g_trace_ctx->dtrace<false>( + D_BLOCK_STATISTICS_ALL, "BlockStat;%d;%4d;%4d;%2d;%2d;%s;%4d;%4d\n", cs.picture->poc, pu.lx() + 4*x, @@ -713,8 +713,8 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea) { const Mv mv = pixMi.mv[REF_PIC_LIST_1]; #if BLOCK_STATS_AS_CSV - g_trace_ctx->dtrace<false>( - D_BLOCK_STATISTICS_ALL, + g_trace_ctx->dtrace<false>( + D_BLOCK_STATISTICS_ALL, "BlockStat;%d;%4d;%4d;%2d;%2d;%s;%4d;%4d\n", cs.picture->poc, pu.lx() + 4*x, @@ -743,8 +743,8 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea) { const Mv mv = pixMi.mv[REF_PIC_LIST_0]; #if BLOCK_STATS_AS_CSV - g_trace_ctx->dtrace<false>( - D_BLOCK_STATISTICS_ALL, + g_trace_ctx->dtrace<false>( + D_BLOCK_STATISTICS_ALL, "BlockStat;%d;%4d;%4d;%2d;%2d;%s;%4d;%4d\n", cs.picture->poc, pu.lx() + 4*x, @@ -767,12 +767,12 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea) mv.hor, mv.ver); #endif - } + } { const Mv mv = pixMi.mv[REF_PIC_LIST_1]; #if BLOCK_STATS_AS_CSV - g_trace_ctx->dtrace<false>( - D_BLOCK_STATISTICS_ALL, + g_trace_ctx->dtrace<false>( + D_BLOCK_STATISTICS_ALL, "BlockStat;%d;%4d;%4d;%2d;%2d;%s;%4d;%4d\n", cs.picture->poc, pu.lx() + 4*x, @@ -795,7 +795,7 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea) mv.hor, mv.ver); #endif - } + } } } } diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp index d2fb0fa55..67132dbe0 100644 --- a/source/Lib/DecoderLib/DecLib.cpp +++ b/source/Lib/DecoderLib/DecLib.cpp @@ -809,7 +809,7 @@ void DecLib::finishPicture(int &poc, PicList *&rpcListPic, MsgLevel msgl, bool a else if (pcSlice->getPPS()->getMixedNaluTypesInPicFlag()) { bool isRaslPic = true; - for (int i = 0; isRaslPic && i < m_pcPic->numSlices; i++) + for (int i = 0; isRaslPic && i < m_pcPic->numSlices; i++) { if (!(pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL)) { @@ -923,7 +923,7 @@ void DecLib::xCreateUnavailablePicture( const PPS *pps, const int iUnavailableP msg(INFO, "Note: Inserting unavailable POC : %d\n", iUnavailablePoc); Picture* cFillPic = xGetNewPicBuffer( *( m_parameterSetManager.getFirstSPS() ), *( m_parameterSetManager.getFirstPPS() ), 0, layerId ); - cFillPic->cs = new CodingStructure( g_globalUnitCache.cuCache, g_globalUnitCache.puCache, g_globalUnitCache.tuCache ); + cFillPic->cs = new CodingStructure( g_globalUnitCache.cuCache, g_globalUnitCache.puCache, g_globalUnitCache.tuCache ); cFillPic->cs->sps = m_parameterSetManager.getFirstSPS(); cFillPic->cs->pps = m_parameterSetManager.getFirstPPS(); cFillPic->cs->vps = m_parameterSetManager.getVPS(0); @@ -949,9 +949,9 @@ void DecLib::xCreateUnavailablePicture( const PPS *pps, const int iUnavailableP cFillPic->slices[0]->setPOC(iUnavailablePoc); cFillPic->poc = iUnavailablePoc; if( (cFillPic->slices[0]->getTLayer() == 0) && (cFillPic->slices[0]->getNalUnitType() != NAL_UNIT_CODED_SLICE_RASL) && (cFillPic->slices[0]->getNalUnitType() != NAL_UNIT_CODED_SLICE_RADL) ) - { - m_prevTid0POC = cFillPic->slices[0]->getPOC(); - } + { + m_prevTid0POC = cFillPic->slices[0]->getPOC(); + } cFillPic->reconstructed = true; cFillPic->neededForOutput = false; @@ -1143,7 +1143,7 @@ void DecLib::checkSEIInAccessUnit() - Count the number of identical SEI messages in the current picture */ void DecLib::checkSeiInPictureUnit() -{ +{ std::vector<std::tuple<int, uint32_t, uint8_t*>> seiList; // payload types subject to constrained SEI repetition @@ -1155,7 +1155,7 @@ void DecLib::checkSeiInPictureUnit() InputBitstream bs = sei->getBitstream(); do - { + { int payloadType = 0; uint32_t val = 0; @@ -1171,7 +1171,7 @@ void DecLib::checkSeiInPictureUnit() bs.readByte(val); payloadSize += val; } while (val==0xFF); - + uint8_t *payload = new uint8_t[payloadSize]; for (uint32_t i = 0; i < payloadSize; i++) { @@ -1186,7 +1186,7 @@ void DecLib::checkSeiInPictureUnit() // count repeated messages in list for (uint32_t i = 0; i < seiList.size(); i++) { - int k, count = 1; + int k, count = 1; int payloadType1 = std::get<0>(seiList[i]); uint32_t payloadSize1 = std::get<1>(seiList[i]); uint8_t *payload1 = std::get<2>(seiList[i]); @@ -1210,7 +1210,7 @@ void DecLib::checkSeiInPictureUnit() int payloadType2 = std::get<0>(seiList[j]); uint32_t payloadSize2 = std::get<1>(seiList[j]); uint8_t *payload2 = std::get<2>(seiList[j]); - + // check for identical SEI type, size, and payload if(payloadType1 == payloadType2 && payloadSize1 == payloadSize2) { @@ -1219,7 +1219,7 @@ void DecLib::checkSeiInPictureUnit() count++; } } - } + } CHECK(count > 4, "There shall be less than or equal to 4 identical sei_payload( ) syntax structures within a picture unit."); } @@ -1235,7 +1235,7 @@ void DecLib::checkSeiInPictureUnit() /** - Reset list of SEI NAL units from the current picture */ -void DecLib::resetPictureSeiNalus() +void DecLib::resetPictureSeiNalus() { while (!m_pictureSeiNalus.empty()) { @@ -1247,7 +1247,7 @@ void DecLib::resetPictureSeiNalus() /** - Process buffered list of suffix APS NALUs */ -void DecLib::processSuffixApsNalus() +void DecLib::processSuffixApsNalus() { while (!m_suffixApsNalus.empty()) { @@ -1548,7 +1548,7 @@ void DecLib::xActivateParameterSets( const InputNALUnit nalu ) //No VPS in bitstream: set defaults values of variables in VPS to the ones signalled in SPS m_vps->setMaxSubLayers( sps->getMaxTLayers() ); m_vps->setLayerId( 0, sps->getLayerId() ); - m_vps->deriveOutputLayerSets(); + m_vps->deriveOutputLayerSets(); } else { @@ -1764,7 +1764,7 @@ void DecLib::xCheckParameterSetConstraints(const int layerId) const SPS *sps = slice->getSPS(); const PPS *pps = slice->getPPS(); const VPS *vps = slice->getVPS(); - + if (sps->getVPSId() && (vps != nullptr)) { if ((layerId == vps->getLayerId(0)) && m_firstSliceInSequence[layerId]) @@ -1976,7 +1976,7 @@ void DecLib::xCheckParameterSetConstraints(const int layerId) } if( sps->getVPSId() && vps->m_numLayersInOls[vps->m_targetOlsIdx] == 1 ) - { + { CHECK( !sps->getPtlDpbHrdParamsPresentFlag(), "When sps_video_parameter_set_id is greater than 0 and there is an OLS that contains only one layer with nuh_layer_id equal to the nuh_layer_id of the SPS, the value of sps_ptl_dpb_hrd_params_present_flag shall be equal to 1" ); } @@ -2377,9 +2377,9 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl int refPicIndex; while ((lostPoc = m_apcSlicePilot->checkThatAllRefPicsAreAvailable(m_cListPic, m_apcSlicePilot->getRPL0(), 0, true, &refPicIndex, m_apcSlicePilot->getNumRefIdx(REF_PIC_LIST_0))) > 0) { - if( !pps->getMixedNaluTypesInPicFlag() && ( + if( !pps->getMixedNaluTypesInPicFlag() && ( ( ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) && ( sps->getIDRRefParamListPresent() || pps->getRplInfoInPhFlag() ) ) || - ( ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_GDR || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) && m_picHeader.getNoOutputBeforeRecoveryFlag() ) ) ) + ( ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_GDR || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) && m_picHeader.getNoOutputBeforeRecoveryFlag() ) ) ) { if (m_apcSlicePilot->getRPL0()->isInterLayerRefPic(refPicIndex) == 0) { @@ -2393,7 +2393,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl } while ((lostPoc = m_apcSlicePilot->checkThatAllRefPicsAreAvailable(m_cListPic, m_apcSlicePilot->getRPL1(), 0, true, &refPicIndex, m_apcSlicePilot->getNumRefIdx(REF_PIC_LIST_1))) > 0) { - if( !pps->getMixedNaluTypesInPicFlag() && ( + if( !pps->getMixedNaluTypesInPicFlag() && ( ( ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) && ( sps->getIDRRefParamListPresent() || pps->getRplInfoInPhFlag() ) ) || ( ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_GDR || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) && m_picHeader.getNoOutputBeforeRecoveryFlag() ) ) ) { @@ -2912,7 +2912,7 @@ void DecLib::xDecodeAPS(InputNALUnit& nalu) { APS* apsEnc = new APS(); *apsEnc = *aps; - m_apsMapEnc->storePS( ( apsEnc->getAPSId() << NUM_APS_TYPE_LEN ) + apsEnc->getAPSType(), apsEnc ); + m_apsMapEnc->storePS( ( apsEnc->getAPSId() << NUM_APS_TYPE_LEN ) + apsEnc->getAPSType(), apsEnc ); } if( nalu.m_nalUnitType == NAL_UNIT_SUFFIX_APS && m_prevSliceSkipped ) @@ -2928,14 +2928,14 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay, i { bool ret; // ignore all NAL units of layers > 0 - if( (nalu.m_nalUnitType != NAL_UNIT_SUFFIX_APS && + if( (nalu.m_nalUnitType != NAL_UNIT_SUFFIX_APS && nalu.m_nalUnitType != NAL_UNIT_EOS && nalu.m_nalUnitType != NAL_UNIT_EOB && nalu.m_nalUnitType != NAL_UNIT_SUFFIX_SEI && nalu.m_nalUnitType != NAL_UNIT_FD && nalu.m_nalUnitType != NAL_UNIT_RESERVED_NVCL_27 && nalu.m_nalUnitType != NAL_UNIT_UNSPECIFIED_30 && - nalu.m_nalUnitType != NAL_UNIT_UNSPECIFIED_31) || + nalu.m_nalUnitType != NAL_UNIT_UNSPECIFIED_31) || !m_prevSliceSkipped ) { AccessUnitInfo auInfo; @@ -2985,11 +2985,11 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay, i return false; case NAL_UNIT_SUFFIX_APS: - if( m_prevSliceSkipped ) + if( m_prevSliceSkipped ) { xDecodeAPS(nalu); } - else + else { m_suffixApsNalus.push_back(new InputNALUnit(nalu)); } diff --git a/source/Lib/DecoderLib/SEIread.cpp b/source/Lib/DecoderLib/SEIread.cpp index d33253713..25fc7cbbf 100644 --- a/source/Lib/DecoderLib/SEIread.cpp +++ b/source/Lib/DecoderLib/SEIread.cpp @@ -765,10 +765,10 @@ void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, uint32_t paylo } } } - if (sei.m_bpMaxSubLayers-1 > 0) + if (sei.m_bpMaxSubLayers-1 > 0) { sei_read_flag(pDecodedMessageOutputStream, code, "bp_sublayer_dpb_output_offsets_present_flag"); - sei.m_sublayerDpbOutputOffsetsPresentFlag = code; + sei.m_sublayerDpbOutputOffsetsPresentFlag = code; } else { @@ -1661,7 +1661,7 @@ void SeiCfgFileDump::write360SeiDump (std::string decoded360MessageFileName, SEI { SEIGeneralizedCubemapProjection* sei = (SEIGeneralizedCubemapProjection*)generalizedCubemapProjectionSEIs.front(); xDumpSEIGeneralizedCubemapProjection(*sei, sps, decoded360MessageFileName); - m_360SEIMessageDumped = true; + m_360SEIMessageDumped = true; } } } diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 16d8b49e2..aa9688a2f 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -563,7 +563,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS ) } if( tileIdx / pcPPS->getNumTileColumns() != pcPPS->getNumTileRows() - 1 && - ( pcPPS->getTileIdxDeltaPresentFlag() || tileIdx % pcPPS->getNumTileColumns() == 0 ) ) + ( pcPPS->getTileIdxDeltaPresentFlag() || tileIdx % pcPPS->getNumTileColumns() == 0 ) ) { READ_UVLC( uiCode, "pps_slice_height_in_tiles_minus1[i]" ); pcPPS->setSliceHeightInTiles( i, uiCode + 1 ); @@ -689,7 +689,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS ) READ_FLAG(uiCode, "pps_ref_wraparound_enabled_flag"); pcPPS->setWrapAroundEnabledFlag( uiCode ? true : false ); if (pcPPS->getWrapAroundEnabledFlag()) { - READ_UVLC(uiCode, "pps_ref_wraparound_offset"); + READ_UVLC(uiCode, "pps_ref_wraparound_offset"); pcPPS->setPicWidthMinusWrapAroundOffset(uiCode); } else @@ -1544,7 +1544,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) READ_FLAG( uiCode, "sps_entry_point_offsets_present_flag"); pcSPS->setEntryPointsPresentFlag(uiCode == 1); READ_CODE(4, uiCode, "sps_log2_max_pic_order_cnt_lsb_minus4"); pcSPS->setBitsForPOC( 4 + uiCode ); CHECK(uiCode > 12, "sps_log2_max_pic_order_cnt_lsb_minus4 shall be in the range of 0 to 12"); - + READ_FLAG(uiCode, "sps_poc_msb_cycle_flag"); pcSPS->setPocMsbCycleFlag(uiCode ? true : false); if (pcSPS->getPocMsbCycleFlag()) { @@ -1784,7 +1784,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) for (uint32_t ii = 0; ii < numberOfRPL; ii++) copyRefPicList(pcSPS, rplListSource->getReferencePictureList(ii), rplListDest->getReferencePictureList(ii)); } - + READ_FLAG(uiCode, "sps_ref_wraparound_enabled_flag"); pcSPS->setWrapAroundEnabledFlag( uiCode ? true : false ); @@ -2143,13 +2143,13 @@ void HLSyntaxReader::parseOPI(OPI* opi) READ_FLAG(symbol, "opi_htid_info_present_flag"); opi->setHtidInfoPresentFlag(symbol); - if (opi->getOlsInfoPresentFlag()) + if (opi->getOlsInfoPresentFlag()) { - READ_UVLC(symbol, "opi_ols_idx"); + READ_UVLC(symbol, "opi_ols_idx"); opi->setOpiOlsIdx(symbol); } - if (opi->getHtidInfoPresentFlag()) + if (opi->getHtidInfoPresentFlag()) { READ_CODE(3, symbol, "opi_htid_plus1"); opi->setOpiHtidPlus1(symbol); @@ -4424,7 +4424,7 @@ void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo) /* general */ READ_FLAG(symbol, "gci_intra_only_constraint_flag"); cinfo->setIntraOnlyConstraintFlag(symbol ? true : false); READ_FLAG(symbol, "gci_all_layers_independent_constraint_flag"); cinfo->setAllLayersIndependentConstraintFlag(symbol ? true : false); - READ_FLAG(symbol, "gci_one_au_only_constraint_flag"); cinfo->setOnePictureOnlyConstraintFlag(symbol ? true : false); + READ_FLAG(symbol, "gci_one_au_only_constraint_flag"); cinfo->setOnePictureOnlyConstraintFlag(symbol ? true : false); /* picture format */ READ_CODE(4, symbol, "gci_sixteen_minus_max_bitdepth_constraint_idc"); cinfo->setMaxBitDepthConstraintIdc(symbol>8 ? 16 : (16 - symbol)); diff --git a/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp b/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp index e60b9d0dc..f10bc283d 100644 --- a/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp +++ b/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp @@ -1084,7 +1084,7 @@ void EncAdaptiveLoopFilter::ALFProcess(CodingStructure& cs, const double *lambda m_tempBuf.get(COMPONENT_Cr).copyFrom(cs.getRecoBuf().get(COMPONENT_Cr)); recYuv = m_tempBuf.getBuf(cs.area); recYuv.extendBorderPel(MAX_ALF_FILTER_LENGTH >> 1); - + deriveStatsForCcAlfFiltering(orgYuv, recYuv, COMPONENT_Cb, m_numCTUsInWidth, (0 + 1), cs); deriveStatsForCcAlfFiltering(orgYuv, recYuv, COMPONENT_Cr, m_numCTUsInWidth, (0 + 1), cs); initDistortionCcalf(); diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp index cac2ed29f..bbfa1e7fc 100644 --- a/source/Lib/EncoderLib/EncCu.cpp +++ b/source/Lib/EncoderLib/EncCu.cpp @@ -1734,7 +1734,7 @@ bool EncCu::xCheckRDCostIntra(CodingStructure *&tempCS, CodingStructure *&bestCS void EncCu::xCheckPLT(CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner, const EncTestMode& encTestMode) { if (((partitioner.currArea().lumaSize().width * partitioner.currArea().lumaSize().height <= 16) && (isLuma(partitioner.chType)) ) - || ((partitioner.currArea().chromaSize().width * partitioner.currArea().chromaSize().height <= 16) && (!isLuma(partitioner.chType)) && partitioner.isSepTree(*tempCS) ) + || ((partitioner.currArea().chromaSize().width * partitioner.currArea().chromaSize().height <= 16) && (!isLuma(partitioner.chType)) && partitioner.isSepTree(*tempCS) ) || (partitioner.isLocalSepTree(*tempCS) && (!isLuma(partitioner.chType)) ) ) { return; diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp index 81f350b69..69368d153 100644 --- a/source/Lib/EncoderLib/EncGOP.cpp +++ b/source/Lib/EncoderLib/EncGOP.cpp @@ -1982,7 +1982,7 @@ void EncGOP::xPicInitLMCS(Picture *pic, PicHeader *picHeader, Slice *slice) // ==================================================================================================================== void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, std::list<PelUnitBuf*>& rcListPicYuvRecOut, - bool isField, bool isTff, const InputColourSpaceConversion snr_conversion, + bool isField, bool isTff, const InputColourSpaceConversion snr_conversion, const bool printFrameMSE, const bool printMSSSIM, bool isEncodeLtRef, const int picIdInGOP) { // TODO: Split this function up. @@ -2852,7 +2852,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, else { pcPic->getOrigBuf().copyFrom(pcPic->getTrueOrigBuf()); - } + } if (pcSlice->getLmcsEnabledFlag()) { @@ -2940,7 +2940,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, else { pcPic->getOrigBuf().copyFrom(pcPic->getTrueOrigBuf()); - } + } } // create SAO object based on the picture size @@ -2986,7 +2986,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, applyDeblockingFilterMetric(pcPic, uiNumSliceSegments); } } - if (m_pcCfg->getCostMode() == COST_LOSSLESS_CODING) + if (m_pcCfg->getCostMode() == COST_LOSSLESS_CODING) { for (int s = 0; s < uiNumSliceSegments; s++) { @@ -3047,9 +3047,9 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, //assign ALF slice header for (int s = 0; s < uiNumSliceSegments; s++) { - //For the first slice, even if it is lossless, slice level ALF is not disabled and ALF-APS is signaled so that the later lossy slices can use APS of the first slice. - //However, if the first slice is lossless, the ALF process is disabled for all of the CTUs ( m_ctuEnableFlag == 0) of that slice which is implemented in the function void EncAdaptiveLoopFilter::ALFProcess. - + //For the first slice, even if it is lossless, slice level ALF is not disabled and ALF-APS is signaled so that the later lossy slices can use APS of the first slice. + //However, if the first slice is lossless, the ALF process is disabled for all of the CTUs ( m_ctuEnableFlag == 0) of that slice which is implemented in the function void EncAdaptiveLoopFilter::ALFProcess. + if (pcPic->slices[s]->isLossless() && s && m_pcCfg->getCostMode() == COST_LOSSLESS_CODING) { pcPic->slices[s]->setAlfEnabledFlag(COMPONENT_Y, false); @@ -3562,7 +3562,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, m_pcCfg->setEncodedFlag(iGOPid, true); double PSNR_Y; - xCalculateAddPSNRs(isField, isTff, iGOPid, pcPic, accessUnit, rcListPic, encTime, snr_conversion, + xCalculateAddPSNRs(isField, isTff, iGOPid, pcPic, accessUnit, rcListPic, encTime, snr_conversion, printFrameMSE, printMSSSIM, &PSNR_Y, isEncodeLtRef ); @@ -3656,8 +3656,8 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, CHECK( m_iNumPicCoded > 1, "Unspecified error" ); } -void EncGOP::printOutSummary( uint32_t uiNumAllPicCoded, bool isField, const bool printMSEBasedSNR, - const bool printSequenceMSE, const bool printMSSSIM, const bool printHexPsnr, const bool printRprPSNR, +void EncGOP::printOutSummary( uint32_t uiNumAllPicCoded, bool isField, const bool printMSEBasedSNR, + const bool printSequenceMSE, const bool printMSSSIM, const bool printHexPsnr, const bool printRprPSNR, const BitDepths &bitDepths ) { #if ENABLE_QPA @@ -3698,7 +3698,7 @@ void EncGOP::printOutSummary( uint32_t uiNumAllPicCoded, bool isField, const boo const bool calculateHdrMetrics = m_pcEncLib->getCalcluateHdrMetrics(); #endif #if ENABLE_QPA - m_gcAnalyzeAll.printOut( 'a', chFmt, printMSEBasedSNR, printSequenceMSE, printMSSSIM, printHexPsnr, + m_gcAnalyzeAll.printOut( 'a', chFmt, printMSEBasedSNR, printSequenceMSE, printMSSSIM, printHexPsnr, printRprPSNR, bitDepths, useWPSNR #if JVET_O0756_CALCULATE_HDRMETRICS , calculateHdrMetrics @@ -3712,7 +3712,7 @@ void EncGOP::printOutSummary( uint32_t uiNumAllPicCoded, bool isField, const boo ); #endif msg( DETAILS, "\n\nI Slices--------------------------------------------------------\n" ); - m_gcAnalyzeI.printOut( 'i', chFmt, printMSEBasedSNR, printSequenceMSE, printMSSSIM, + m_gcAnalyzeI.printOut( 'i', chFmt, printMSEBasedSNR, printSequenceMSE, printMSSSIM, printHexPsnr, printRprPSNR, bitDepths ); msg( DETAILS, "\n\nP Slices--------------------------------------------------------\n" ); @@ -3720,7 +3720,7 @@ void EncGOP::printOutSummary( uint32_t uiNumAllPicCoded, bool isField, const boo printHexPsnr, printRprPSNR, bitDepths ); msg( DETAILS, "\n\nB Slices--------------------------------------------------------\n" ); - m_gcAnalyzeB.printOut( 'b', chFmt, printMSEBasedSNR, printSequenceMSE, printMSSSIM, + m_gcAnalyzeB.printOut( 'b', chFmt, printMSEBasedSNR, printSequenceMSE, printMSSSIM, printHexPsnr, printRprPSNR, bitDepths ); #if WCG_WPSNR @@ -4111,12 +4111,12 @@ double EncGOP::xFindDistortionPlaneWPSNR(const CPelBuf& pic0, const CPelBuf& pic } #endif -void EncGOP::xCalculateAddPSNRs( const bool isField, const bool isFieldTopFieldFirst, - const int iGOPid, Picture* pcPic, const AccessUnit&accessUnit, PicList &rcListPic, - const int64_t dEncTime, const InputColourSpaceConversion snr_conversion, +void EncGOP::xCalculateAddPSNRs( const bool isField, const bool isFieldTopFieldFirst, + const int iGOPid, Picture* pcPic, const AccessUnit&accessUnit, PicList &rcListPic, + const int64_t dEncTime, const InputColourSpaceConversion snr_conversion, const bool printFrameMSE, const bool printMSSSIM, double* PSNR_Y, bool isEncodeLtRef) { - xCalculateAddPSNR(pcPic, pcPic->getRecoBuf(), accessUnit, (double)dEncTime, snr_conversion, + xCalculateAddPSNR(pcPic, pcPic->getRecoBuf(), accessUnit, (double)dEncTime, snr_conversion, printFrameMSE, printMSSSIM, PSNR_Y, isEncodeLtRef); //In case of field coding, compute the interlaced PSNR for both fields @@ -4172,20 +4172,20 @@ void EncGOP::xCalculateAddPSNRs( const bool isField, const bool isFieldTopFieldF if ((pcPic->topField && isFieldTopFieldFirst) || (!pcPic->topField && !isFieldTopFieldFirst)) { - xCalculateInterlacedAddPSNR(pcPic, correspondingFieldPic, pcPic->getRecoBuf(), - correspondingFieldPic->getRecoBuf(), snr_conversion, printFrameMSE, printMSSSIM, + xCalculateInterlacedAddPSNR(pcPic, correspondingFieldPic, pcPic->getRecoBuf(), + correspondingFieldPic->getRecoBuf(), snr_conversion, printFrameMSE, printMSSSIM, PSNR_Y, isEncodeLtRef); } else { - xCalculateInterlacedAddPSNR(correspondingFieldPic, pcPic, correspondingFieldPic->getRecoBuf(), + xCalculateInterlacedAddPSNR(correspondingFieldPic, pcPic, correspondingFieldPic->getRecoBuf(), pcPic->getRecoBuf(), snr_conversion, printFrameMSE, printMSSSIM, PSNR_Y, isEncodeLtRef); } } } } -void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUnit& accessUnit, +void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUnit& accessUnit, double dEncTime, const InputColourSpaceConversion conversion, const bool printFrameMSE, const bool printMSSSIM, double* PSNR_Y, bool isEncodeLtRef) { @@ -4484,7 +4484,7 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni if (printMSSSIM) { msg( NOTICE, " [MS-SSIM Y %1.6lf U %1.6lf V %1.6lf]", msssim[COMPONENT_Y], msssim[COMPONENT_Cb], msssim[COMPONENT_Cr] ); - } + } if( printFrameMSE ) { @@ -4606,22 +4606,22 @@ double EncGOP::xCalculateMSSSIM (const Pel* org, const int orgStride, const Pel* uint32_t maxScale; - // For low resolution videos determine number of scales + // For low resolution videos determine number of scales if (width < 22 || height < 22) { - maxScale = 1; + maxScale = 1; } else if (width < 44 || height < 44) { - maxScale = 2; + maxScale = 2; } else if (width < 88 || height < 88) { - maxScale = 3; + maxScale = 3; } else if (width < 176 || height < 176) { - maxScale = 4; + maxScale = 4; } else { @@ -4701,12 +4701,12 @@ double EncGOP::xCalculateMSSSIM (const Pel* org, const int orgStride, const Pel* } } } - + // Calculate MS-SSIM: const uint32_t maxValue = (1<<bitDepth)-1; const double c1 = (0.01*maxValue)*(0.01*maxValue); const double c2 = (0.03*maxValue)*(0.03*maxValue); - + double finalMSSSIM = 1.0; for(uint32_t scale=0; scale<maxScale; scale++) @@ -4874,7 +4874,7 @@ void EncGOP::copyBuftoFrame( Picture* pcPic ) void EncGOP::xCalculateInterlacedAddPSNR( Picture* pcPicOrgFirstField, Picture* pcPicOrgSecondField, PelUnitBuf cPicRecFirstField, PelUnitBuf cPicRecSecondField, - const InputColourSpaceConversion conversion, const bool printFrameMSE, + const InputColourSpaceConversion conversion, const bool printFrameMSE, const bool printMSSSIM, double* PSNR_Y, bool isEncodeLtRef) { const SPS &sps = *pcPicOrgFirstField->cs->sps; diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index 72eb14452..7355d8e3d 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -260,7 +260,7 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf ) m_noPicPartitionFlag = true; xInitPPS( pps, sps0 ); // will allocate memory for and initialize pps.pcv inside - + if( pps.getWrapAroundEnabledFlag() ) { int minCbSizeY = (1 << sps0.getLog2MinCodingBlockSize()); @@ -268,10 +268,10 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf ) pps.setWrapAroundOffset (minCbSizeY * (pps.getPicWidthInLumaSamples() / minCbSizeY - pps.getPicWidthMinusWrapAroundOffset())); } - else + else { pps.setPicWidthMinusWrapAroundOffset (0); - pps.setWrapAroundOffset ( 0 ); + pps.setWrapAroundOffset ( 0 ); } } @@ -475,7 +475,7 @@ bool EncLib::encodePrep( bool flush, PelStorage* pcPicYuvOrg, PelStorage* cPicYu m_cRateCtrl.initRCGOP( m_iNumPicRcvd ); } - m_cGOPEncoder.compressGOP( m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, false, false, + m_cGOPEncoder.compressGOP( m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, false, false, snrCSC, m_printFrameMSE, m_printMSSSIM, true, 0 ); #if JVET_O0756_CALCULATE_HDRMETRICS @@ -763,7 +763,7 @@ bool EncLib::encode( const InputColourSpaceConversion snrCSC, std::list<PelUnitB m_iPOCLast = m_iPOCLast < 2 ? fieldNum : m_iPOCLast; // compress GOP - m_cGOPEncoder.compressGOP( m_iPOCLast, m_iPOCLast < 2 ? m_iPOCLast + 1 : m_iNumPicRcvd, m_cListPic, + m_cGOPEncoder.compressGOP( m_iPOCLast, m_iPOCLast < 2 ? m_iPOCLast + 1 : m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, true, isTff, snrCSC, m_printFrameMSE, m_printMSSSIM, false, m_picIdInGOP ); #if JVET_O0756_CALCULATE_HDRMETRICS m_metricTime = m_cGOPEncoder.getMetricTime(); @@ -859,7 +859,7 @@ void EncLib::xGetNewPicBuffer ( std::list<PelUnitBuf*>& rcListPicYuvRecOut, Pict if(m_gopBasedTemporalFilterEnabled) { rpcPic->M_BUFS(0, PIC_FILTERED_ORIGINAL_INPUT).create(sps.getChromaFormatIdc(), Area(Position(), Size(pps0.getPicWidthInLumaSamples(), pps0.getPicHeightInLumaSamples()))); - } + } } if ( getUseAdaptiveQP() ) { @@ -916,7 +916,7 @@ void EncLib::xInitVPS( const SPS& sps ) for( int olsIdx = 0, dpbIdx = 0; olsIdx < m_vps->m_numOutputLayersInOls.size(); olsIdx++ ) { if ( m_vps->getNumLayersInOls(olsIdx) > 1 ) - { + { if( std::find( m_vps->m_layerIdInOls[olsIdx].begin(), m_vps->m_layerIdInOls[olsIdx].end(), m_layerId ) != m_vps->m_layerIdInOls[olsIdx].end() ) { m_vps->setOlsDpbPicWidth( olsIdx, std::max<int>( sps.getMaxPicWidthInLumaSamples(), m_vps->getOlsDpbPicSize( olsIdx ).width ) ); @@ -934,7 +934,7 @@ void EncLib::xInitVPS( const SPS& sps ) for( int i = 0; i < m_vps->m_numOutputLayersInOls.size(); i++ ) { if ( m_vps->getNumLayersInOls(i) > 1 ) - { + { int dpbIdx = m_vps->getOlsDpbParamsIdx( i ); if( m_vps->getMaxSubLayers() == 1 ) @@ -964,7 +964,7 @@ void EncLib::xInitVPS( const SPS& sps ) decPicBuffering[tId] += m_layerDecPicBuffering[m_vps->getLayerIdInOls( i, lIdx ) * MAX_TLAYER + tId]; } } - + for( int j = ( m_vps->m_sublayerDpbParamsPresentFlag ? 0 : m_vps->m_dpbMaxTemporalId[dpbIdx] ); j <= m_vps->m_dpbMaxTemporalId[dpbIdx]; j++ ) { m_vps->m_dpbParameters[dpbIdx].m_maxDecPicBuffering[j] = decPicBuffering[j] > 0 ? decPicBuffering[j] : profileLevelTierFeatures.getMaxDpbSize( m_vps->getOlsDpbPicSize( i ).width * m_vps->getOlsDpbPicSize( i ).height ); @@ -1002,7 +1002,7 @@ void EncLib::xInitOPI(OPI& opi) if (!opi.getOlsInfoPresentFlag()) { opi.setOpiOlsIdx(m_vps->deriveTargetOLSIdx()); - opi.setOlsInfoPresentFlag(true); + opi.setOlsInfoPresentFlag(true); } if (!opi.getHtidInfoPresentFlag()) { @@ -1570,10 +1570,10 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps) pps.setPicWidthMinusWrapAroundOffset ((pps.getPicWidthInLumaSamples()/minCbSizeY) - (m_wrapAroundOffset / minCbSizeY)); pps.setWrapAroundOffset (minCbSizeY *(pps.getPicWidthInLumaSamples() / minCbSizeY- pps.getPicWidthMinusWrapAroundOffset())); } - else + else { pps.setPicWidthMinusWrapAroundOffset ( 0 ); - pps.setWrapAroundOffset ( 0 ); + pps.setWrapAroundOffset ( 0 ); } CHECK( !sps.getWrapAroundEnabledFlag() && pps.getWrapAroundEnabledFlag(), "When sps_ref_wraparound_enabled_flag is equal to 0, the value of pps_ref_wraparound_enabled_flag shall be equal to 0."); CHECK( (((sps.getCTUSize() / minCbSizeY) + 1) > ((pps.getPicWidthInLumaSamples() / minCbSizeY) - 1)) && pps.getWrapAroundEnabledFlag(), "When the value of CtbSizeY / MinCbSizeY + 1 is greater than pps_pic_width_in_luma_samples / MinCbSizeY - 1, the value of pps_ref_wraparound_enabled_flag shall be equal to 0."); diff --git a/source/Lib/EncoderLib/EncModeCtrl.cpp b/source/Lib/EncoderLib/EncModeCtrl.cpp index 97937209a..bd2f9d807 100644 --- a/source/Lib/EncoderLib/EncModeCtrl.cpp +++ b/source/Lib/EncoderLib/EncModeCtrl.cpp @@ -279,7 +279,7 @@ void CacheBlkInfoCtrl::create() m_codedCUInfo[x][y][wIdx][hIdx] = nullptr; continue; } - + const int hLog2 = floorLog2( gp_sizeIdxInfo->sizeFrom( hIdx ) ); if( isLog2MttPartitioning && ( ( ( y << MIN_CU_LOG2 ) & ( ( 1 << ( hLog2 - 1 ) ) - 1 ) ) != 0 ) ) @@ -606,7 +606,7 @@ void BestEncInfoCache::create( const ChromaFormat chFmt ) m_bestEncInfo[x][y][wIdx][hIdx] = nullptr; continue; } - + const int hLog2 = floorLog2( gp_sizeIdxInfo->sizeFrom( hIdx ) ); if( isLog2MttPartitioning && ( ( ( y << MIN_CU_LOG2 ) & ( ( 1 << ( hLog2 - 1 ) ) - 1 ) ) != 0 ) ) @@ -1417,7 +1417,7 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt { if (partitioner.currArea().lumaSize().width > 64 || partitioner.currArea().lumaSize().height > 64 || ((partitioner.currArea().lumaSize().width * partitioner.currArea().lumaSize().height <= 16) && (isLuma(partitioner.chType)) ) - || ((partitioner.currArea().chromaSize().width * partitioner.currArea().chromaSize().height <= 16) && (!isLuma(partitioner.chType)) && partitioner.isSepTree(cs) ) + || ((partitioner.currArea().chromaSize().width * partitioner.currArea().chromaSize().height <= 16) && (!isLuma(partitioner.chType)) && partitioner.isSepTree(cs) ) || (partitioner.isLocalSepTree(cs) && (!isLuma(partitioner.chType)) ) ) { return false; diff --git a/source/Lib/EncoderLib/EncSlice.cpp b/source/Lib/EncoderLib/EncSlice.cpp index 4916122eb..bbf3fe06a 100644 --- a/source/Lib/EncoderLib/EncSlice.cpp +++ b/source/Lib/EncoderLib/EncSlice.cpp @@ -359,7 +359,7 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr rpcSlice->setSignDataHidingEnabledFlag( m_pcCfg->getSignDataHidingEnabledFlag() ); rpcSlice->setTSResidualCodingDisabledFlag( false ); - CHECK( (m_pcCfg->getDepQuantEnabledFlag() || m_pcCfg->getSignDataHidingEnabledFlag() ) + CHECK( (m_pcCfg->getDepQuantEnabledFlag() || m_pcCfg->getSignDataHidingEnabledFlag() ) && rpcSlice->getTSResidualCodingDisabledFlag() , "TSRC cannot be bypassed if either DQ or SDH are enabled at slice level."); } else @@ -1163,7 +1163,7 @@ void EncSlice::setSearchRange( Slice* pcSlice ) } } -void EncSlice::setLosslessSlice(Picture* pcPic, bool islossless) +void EncSlice::setLosslessSlice(Picture* pcPic, bool islossless) { Slice* slice = pcPic->slices[getSliceSegmentIdx()]; slice->setLossless(islossless); diff --git a/source/Lib/EncoderLib/InterSearch.cpp b/source/Lib/EncoderLib/InterSearch.cpp index e625a05db..07e7e2375 100644 --- a/source/Lib/EncoderLib/InterSearch.cpp +++ b/source/Lib/EncoderLib/InterSearch.cpp @@ -3536,7 +3536,7 @@ void InterSearch::xSetSearchRange ( const PredictionUnit& pu, const int iMvShift = MV_FRACTIONAL_BITS_INTERNAL; Mv cFPMvPred = cMvPred; clipMv( cFPMvPred, pu.cu->lumaPos(), pu.cu->lumaSize(), *pu.cs->sps, *pu.cs->pps ); - + Mv mvTL(cFPMvPred.getHor() - (iSrchRng << iMvShift), cFPMvPred.getVer() - (iSrchRng << iMvShift)); Mv mvBR(cFPMvPred.getHor() + (iSrchRng << iMvShift), cFPMvPred.getVer() + (iSrchRng << iMvShift)); diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp index bad0f5012..2422bac9e 100644 --- a/source/Lib/EncoderLib/IntraSearch.cpp +++ b/source/Lib/EncoderLib/IntraSearch.cpp @@ -435,7 +435,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c //reset the variables used for the tests m_regIntraRDListWithCosts.clear(); int numTotalPartsHor = (int)height >> floorLog2(CU::getISPSplitDim(width, height, TU_1D_HORZ_SPLIT)); - int numTotalPartsVer = (int)width >> floorLog2(CU::getISPSplitDim(width, height, TU_1D_VERT_SPLIT)); + int numTotalPartsVer = (int)width >> floorLog2(CU::getISPSplitDim(width, height, TU_1D_VERT_SPLIT)); m_ispTestedModes[0].init( numTotalPartsHor, numTotalPartsVer ); //the total number of subpartitions is modified to take into account the cases where LFNST cannot be combined with ISP due to size restrictions numTotalPartsHor = sps.getUseLFNST() && CU::canUseLfnstWithISP(cu.Y(), HOR_INTRA_SUBPARTITIONS) ? numTotalPartsHor : 0; @@ -4017,7 +4017,7 @@ bool IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par } csSplit->setDecomp(partitioner.currArea().Y()); - + uiSplitCbfLuma |= TU::getCbfAtDepth(*csSplit->getTU(partitioner.currArea().lumaPos(), partitioner.chType, -1), COMPONENT_Y, partitioner.currTrDepth); } while( partitioner.nextPart( *csSplit ) ); diff --git a/source/Lib/EncoderLib/SEIwrite.cpp b/source/Lib/EncoderLib/SEIwrite.cpp index da182af0c..c4368b4ce 100644 --- a/source/Lib/EncoderLib/SEIwrite.cpp +++ b/source/Lib/EncoderLib/SEIwrite.cpp @@ -335,7 +335,7 @@ void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei) } } } - if (sei.m_bpMaxSubLayers-1 > 0) + if (sei.m_bpMaxSubLayers-1 > 0) { WRITE_FLAG(sei.m_sublayerDpbOutputOffsetsPresentFlag, "bp_sublayer_dpb_output_offsets_present_flag"); } diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index 6920137c1..8e8ded971 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -897,7 +897,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) WRITE_FLAG( pcSPS->getEntropyCodingSyncEnabledFlag() ? 1 : 0, "sps_entropy_coding_sync_enabled_flag" ); WRITE_FLAG( pcSPS->getEntryPointsPresentFlag() ? 1 : 0, "sps_entry_point_offsets_present_flag" ); WRITE_CODE(pcSPS->getBitsForPOC()-4, 4, "sps_log2_max_pic_order_cnt_lsb_minus4"); - + WRITE_FLAG(pcSPS->getPocMsbCycleFlag() ? 1 : 0, "sps_poc_msb_cycle_flag"); if (pcSPS->getPocMsbCycleFlag()) { @@ -1335,14 +1335,14 @@ void HLSWriter::codeOPI(const OPI *opi) WRITE_FLAG(opi->getOlsInfoPresentFlag(), "opi_ols_info_present_flag"); WRITE_FLAG(opi->getHtidInfoPresentFlag(), "opi_htid_info_present_flag"); - if (opi->getOlsInfoPresentFlag()) + if (opi->getOlsInfoPresentFlag()) { - WRITE_UVLC(opi->getOpiOlsIdx(), "opi_ols_idx"); + WRITE_UVLC(opi->getOpiOlsIdx(), "opi_ols_idx"); } - if (opi->getHtidInfoPresentFlag()) + if (opi->getHtidInfoPresentFlag()) { - WRITE_CODE(opi->getOpiHtidPlus1(), 3, "opi_htid_plus1"); + WRITE_CODE(opi->getOpiHtidPlus1(), 3, "opi_htid_plus1"); } WRITE_FLAG(0, "opi_extension_flag"); xWriteRbspTrailingBits(); @@ -1421,11 +1421,11 @@ void HLSWriter::codeVPS(const VPS* pcVPS) { if(i > 0) WRITE_FLAG(pcVPS->getPtPresentFlag(i), "vps_pt_present_flag"); - if (!pcVPS->getDefaultPtlDpbHrdMaxTidFlag()) + if (!pcVPS->getDefaultPtlDpbHrdMaxTidFlag()) { WRITE_CODE(pcVPS->getPtlMaxTemporalId(i), 3, "vps_ptl_max_tid"); } - else + else { CHECK(pcVPS->getPtlMaxTemporalId(i) != pcVPS->getMaxSubLayers() - 1, "When vps_default_ptl_dpb_hrd_max_tid_flag is equal to 1, the value of vps_ptl_max_tid[ i ] is inferred to be equal to vps_max_sublayers_minus1"); } @@ -1514,7 +1514,7 @@ void HLSWriter::codeVPS(const VPS* pcVPS) { WRITE_CODE(pcVPS->getHrdMaxTid(i), 3, "vps_hrd_max_tid[i]"); } - else + else { CHECK(pcVPS->getHrdMaxTid(i) != pcVPS->getMaxSubLayers() - 1, "When vps_default_ptl_dpb_hrd_max_tid_flag is equal to 1, the value of vps_hrd_max_tid[ i ] is inferred to be equal to vps_max_sublayers_minus1"); } @@ -2896,7 +2896,7 @@ void HLSWriter::xCodePredWeightTable(PicHeader *picHeader, const PPS *pps, const if (numRef == 0) { numLxWeights = picHeader->getNumL1Weights(); - if (pps->getWPBiPred() == 0) + if (pps->getWPBiPred() == 0) { numLxWeights = 0; } -- GitLab