From 21f0e38ad3fa89d11c9b2317bcd895728c09b8dd Mon Sep 17 00:00:00 2001 From: Frank Bossen <fbossen@gmail.com> Date: Fri, 7 Oct 2022 18:42:55 -0400 Subject: [PATCH] Fix variable names --- source/App/EncoderApp/EncAppCfg.cpp | 15 +- source/Lib/CommonLib/Slice.cpp | 278 ++++++++++++++-------------- source/Lib/CommonLib/Slice.h | 152 +++++++++------ source/Lib/EncoderLib/EncCfg.h | 40 ++-- source/Lib/EncoderLib/EncGOP.cpp | 46 ++--- source/Lib/EncoderLib/EncGOP.h | 24 +-- source/Lib/EncoderLib/EncLib.cpp | 9 +- source/Lib/EncoderLib/VLCWriter.cpp | 9 +- 8 files changed, 304 insertions(+), 269 deletions(-) diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index f50d2473ee..1ff65e61a7 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -2024,8 +2024,8 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) m_RPLList1[i].m_numRefPicsActive = m_GOPList[i].m_numRefPicsActive1; m_RPLList0[i].m_numRefPics = m_GOPList[i].m_numRefPics0; m_RPLList1[i].m_numRefPics = m_GOPList[i].m_numRefPics1; - m_RPLList0[i].m_ltrp_in_slice_header_flag = m_GOPList[i].m_ltrp_in_slice_header_flag; - m_RPLList1[i].m_ltrp_in_slice_header_flag = m_GOPList[i].m_ltrp_in_slice_header_flag; + m_RPLList0[i].m_ltrpInSliceHeaderFlag = m_GOPList[i].m_ltrpInSliceHeaderFlag; + m_RPLList1[i].m_ltrpInSliceHeaderFlag = m_GOPList[i].m_ltrpInSliceHeaderFlag; for (int j = 0; j < m_GOPList[i].m_numRefPics0; j++) m_RPLList0[i].m_deltaRefPics[j] = m_GOPList[i].m_deltaRefPics0[j]; for (int j = 0; j < m_GOPList[i].m_numRefPics1; j++) @@ -2709,9 +2709,10 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) m_cuChromaQpOffsetList.resize(cfg_cbQpOffsetList.values.size()); for (int i=0; i < cfg_cbQpOffsetList.values.size(); i++) { - m_cuChromaQpOffsetList[i].u.comp.CbOffset = cfg_cbQpOffsetList.values[i]; - m_cuChromaQpOffsetList[i].u.comp.CrOffset = cfg_crQpOffsetList.values[i]; - m_cuChromaQpOffsetList[i].u.comp.JointCbCrOffset = cfg_cbCrQpOffsetList.values.size() ? cfg_cbCrQpOffsetList.values[i] : 0; + m_cuChromaQpOffsetList[i].u.comp.cbOffset = cfg_cbQpOffsetList.values[i]; + m_cuChromaQpOffsetList[i].u.comp.crOffset = cfg_crQpOffsetList.values[i]; + m_cuChromaQpOffsetList[i].u.comp.jointCbCrOffset = + cfg_cbCrQpOffsetList.values.size() ? cfg_cbCrQpOffsetList.values[i] : 0; } #if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET @@ -4950,8 +4951,8 @@ void EncAppCfg::xPrintParameter() msg( DETAILS, "Chroma QP offset list : (" ); for (int i=0; i < m_cuChromaQpOffsetList.size(); i++) { - msg( DETAILS, "%d %d %d%s", m_cuChromaQpOffsetList[i].u.comp.CbOffset, m_cuChromaQpOffsetList[i].u.comp.CrOffset, m_cuChromaQpOffsetList[i].u.comp.JointCbCrOffset, - (i+1 < m_cuChromaQpOffsetList.size() ? ", " : ")\n") ); + msg(DETAILS, "%d %d %d%s", m_cuChromaQpOffsetList[i].u.comp.cbOffset, m_cuChromaQpOffsetList[i].u.comp.crOffset, + m_cuChromaQpOffsetList[i].u.comp.jointCbCrOffset, (i + 1 < m_cuChromaQpOffsetList.size() ? ", " : ")\n")); } msg( DETAILS, "cu_chroma_qp_offset_subdiv : %d\n", m_cuChromaQpOffsetSubdiv); msg( DETAILS, "cu_chroma_qp_offset_enabled_flag : %s\n", (m_cuChromaQpOffsetEnabled ? "Enabled" : "Disabled") ); diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index f78f725ccd..49f7d5de7f 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -47,7 +47,7 @@ //! \{ Slice::Slice() - : m_iPOC(0) + : m_poc(0) , m_iLastIDR(0) , m_prevGDRInSameLayerPOC(-MAX_INT) , m_iAssociatedIRAP(0) @@ -78,7 +78,7 @@ Slice::Slice() , m_signDataHidingEnabledFlag(false) , m_tsResidualCodingDisabledFlag(false) , m_pendingRasInit(false) - , m_bCheckLDC(false) + , m_checkLdc(false) , m_biDirPred(false) , m_lmChromaCheckDisable(false) , m_iSliceQpDelta(0) @@ -94,7 +94,7 @@ Slice::Slice() , m_independentSliceIdx(0) , m_nextSlice(false) , m_sliceBits(0) - , m_bFinalized(false) + , m_finalized(false) , m_bTestWeightPred(false) , m_bTestWeightBiPred(false) , m_substreamSizes() @@ -111,7 +111,7 @@ Slice::Slice() m_riceBit[i] = 0; } - m_cnt_right_bottom = 0; + m_cntRightBottom = 0; for(uint32_t i=0; i<NUM_REF_PIC_LIST_01; i++) { @@ -178,7 +178,7 @@ void Slice::initSlice() m_noOutputOfPriorPicsFlag = 0; - m_bCheckLDC = false; + m_checkLdc = false; m_biDirPred = false; m_lmChromaCheckDisable = false; @@ -191,8 +191,7 @@ void Slice::initSlice() } m_iSliceChromaQpDelta[JOINT_CbCr] = 0; - - m_bFinalized=false; + m_finalized = false; m_substreamSizes.clear(); m_cabacInitFlag = false; @@ -789,7 +788,7 @@ void Slice::checkSTSA(PicList& rcListPic) while (iterPic != rcListPic.end()) { pcRefPic = *(iterPic++); - if (!pcRefPic->referenced || pcRefPic->getPOC() == m_iPOC) + if (!pcRefPic->referenced || pcRefPic->getPOC() == m_poc) { continue; } @@ -898,7 +897,7 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll) int i, j, k; - m_iPOC = pSrc->m_iPOC; + m_poc = pSrc->m_poc; m_eNalUnitType = pSrc->m_eNalUnitType; m_eSliceType = pSrc->m_eSliceType; m_iSliceQp = pSrc->m_iSliceQp; @@ -922,7 +921,7 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll) m_riceBit[i] = pSrc->m_riceBit[i]; } m_reverseLastSigCoeffFlag = pSrc->m_reverseLastSigCoeffFlag; - m_cnt_right_bottom = pSrc->m_cnt_right_bottom; + m_cntRightBottom = pSrc->m_cntRightBottom; for (i = 0; i < NUM_REF_PIC_LIST_01; i++) { @@ -934,7 +933,7 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll) m_list1IdxToList0Idx[i] = pSrc->m_list1IdxToList0Idx[i]; } - m_bCheckLDC = pSrc->m_bCheckLDC; + m_checkLdc = pSrc->m_checkLdc; m_iSliceQpDelta = pSrc->m_iSliceQpDelta; m_biDirPred = pSrc->m_biDirPred; @@ -1697,7 +1696,7 @@ void Slice::applyReferencePictureListBasedMarking( PicList& rcListPic, const Ref // Diagonal inter-layer prediction is not allowed CHECK( pRPL0->getRefPicIdentifier( i ), "ILRP identifier should be 0" ); - if( pcPic->poc == m_iPOC ) + if (pcPic->poc == m_poc) { isReference = 1; pcPic->longTerm = true; @@ -1742,7 +1741,7 @@ void Slice::applyReferencePictureListBasedMarking( PicList& rcListPic, const Ref // Diagonal inter-layer prediction is not allowed CHECK( pRPL1->getRefPicIdentifier( i ), "ILRP identifier should be 0" ); - if( pcPic->poc == m_iPOC ) + if (pcPic->poc == m_poc) { isReference = 1; pcPic->longTerm = true; @@ -1781,7 +1780,7 @@ void Slice::applyReferencePictureListBasedMarking( PicList& rcListPic, const Ref } // mark the picture as "unused for reference" if it is not in // the Reference Picture List - if( pcPic->layerId == layerId && pcPic->poc != m_iPOC && isReference == 0 ) + if (pcPic->layerId == layerId && pcPic->poc != m_poc && isReference == 0) { pcPic->referenced = false; pcPic->longTerm = false; @@ -2033,7 +2032,7 @@ bool Slice::isPOCInRefPicList(const ReferencePictureList *rpl, int poc ) // Diagonal inter-layer prediction is not allowed CHECK( rpl->getRefPicIdentifier( i ), "ILRP identifier should be 0" ); - if( poc == m_iPOC ) + if (poc == m_poc) { return true; } @@ -2331,24 +2330,24 @@ unsigned Slice::getMinPictureDistance() const // Video parameter set (VPS) // ------------------------------------------------------------------------------------------------ VPS::VPS() - : m_VPSId(0) + : m_vpsId(0) , m_maxLayers(1) , m_vpsMaxSubLayers(7) - , m_vpsDefaultPtlDpbHrdMaxTidFlag (true) + , m_vpsDefaultPtlDpbHrdMaxTidFlag(true) , m_vpsAllIndependentLayersFlag(true) - , m_vpsEachLayerIsAnOlsFlag (1) - , m_vpsOlsModeIdc (0) - , m_vpsNumOutputLayerSets (1) - , m_vpsNumPtls (1) + , m_vpsEachLayerIsAnOlsFlag(1) + , m_vpsOlsModeIdc(0) + , m_vpsNumOutputLayerSets(1) + , m_vpsNumPtls(1) , m_vpsExtensionFlag(false) , m_vpsGeneralHrdParamsPresentFlag(false) , m_vpsSublayerCpbParamsPresentFlag(false) , m_numOlsTimingHrdParamsMinus1(0) - , m_totalNumOLSs( 1 ) - , m_numMultiLayeredOlss( 0 ) - , m_numDpbParams( 0 ) - , m_sublayerDpbParamsPresentFlag( false ) - , m_targetOlsIdx( 0 ) + , m_totalNumOLSs(1) + , m_numMultiLayeredOlss(0) + , m_numDpbParams(0) + , m_sublayerDpbParamsPresentFlag(false) + , m_targetOlsIdx(0) { for (int i = 0; i < MAX_VPS_SUBLAYERS; i++) { @@ -2889,113 +2888,112 @@ SPSRExt::SPSRExt() { } - SPS::SPS() -: m_SPSId ( 0) -, m_VPSId ( 0 ) -, m_layerId ( 0 ) -, m_affineAmvrEnabledFlag ( false ) -, m_DMVR ( false ) -, m_MMVD ( false ) -, m_SBT ( false ) -, m_ISP ( false ) -, m_chromaFormatIdc (CHROMA_420) -, m_uiMaxTLayers ( 1) -, m_ptlDpbHrdParamsPresentFlag (1) -, m_SubLayerDpbParamsFlag (0) -// Structure -, m_maxWidthInLumaSamples (352) -, m_maxHeightInLumaSamples (288) -, m_subPicInfoPresentFlag (false) -, m_numSubPics(1) -, m_independentSubPicsFlag (false) -, m_subPicSameSizeFlag (false) -, m_subPicIdMappingExplicitlySignalledFlag ( false ) -, m_subPicIdMappingPresentFlag ( false ) -, m_subPicIdLen(16) -, m_log2MinCodingBlockSize ( 2) -, m_CTUSize(0) -, m_minQT{ 0, 0, 0 } -, m_maxMTTHierarchyDepth{ MAX_BT_DEPTH, MAX_BT_DEPTH_INTER, MAX_BT_DEPTH_C } -, m_maxBTSize{ 0, 0, 0 } -, m_maxTTSize{ 0, 0, 0 } -, m_uiMaxCUWidth ( 32) -, m_uiMaxCUHeight ( 32) -, m_numRPL0 ( 0 ) -, m_numRPL1 ( 0 ) -, m_rpl1CopyFromRpl0Flag ( false ) -, m_rpl1IdxPresentFlag ( false ) -, m_allRplEntriesHasSameSignFlag ( true ) -, m_bLongTermRefsPresent (false) -// Tool list -, m_transformSkipEnabledFlag (false) -, m_log2MaxTransformSkipBlockSize (2) -, m_BDPCMEnabledFlag (false) -, m_JointCbCrEnabledFlag (false) -, m_entropyCodingSyncEnabledFlag(false) -, m_entryPointPresentFlag(false) -, m_internalMinusInputBitDepth{ 0, 0 } -, m_sbtmvpEnabledFlag (false) -, m_bdofEnabledFlag (false) -, m_fpelMmvdEnabledFlag ( false ) -, m_BdofControlPresentInPhFlag( false ) -, m_DmvrControlPresentInPhFlag( false ) -, m_ProfControlPresentInPhFlag( false ) -, m_uiBitsForPOC ( 8) -, m_pocMsbCycleFlag ( false ) -, m_pocMsbCycleLen ( 1 ) -, m_numExtraPHBytes ( 0 ) -, m_numExtraSHBytes ( 0 ) -, m_numLongTermRefPicSPS ( 0) - -, m_log2MaxTbSize ( 6) - -, m_useWeightPred (false) -, m_useWeightedBiPred (false) -, m_saoEnabledFlag (false) -, m_bTemporalIdNestingFlag (false) -, m_scalingListEnabledFlag (false) -, m_virtualBoundariesEnabledFlag( 0 ) -, m_virtualBoundariesPresentFlag( 0 ) -, m_numVerVirtualBoundaries(0) -, m_numHorVirtualBoundaries(0) -, m_generalHrdParametersPresentFlag(false) -, m_fieldSeqFlag (false) -, m_vuiParametersPresentFlag (false) -, m_vuiParameters () -, m_wrapAroundEnabledFlag (false) -, m_IBCFlag ( 0) -, m_PLTMode ( 0) -, m_lmcsEnabled (false) -, m_AMVREnabledFlag ( false ) -, m_LMChroma ( false ) -, m_horCollocatedChromaFlag ( true ) -, m_verCollocatedChromaFlag ( false ) -, m_LFNST ( false ) -, m_Affine ( false ) -, m_AffineType ( false ) -, m_PROF ( false ) -, m_ciip ( false ) -, m_Geo ( false ) + : m_spsId(0) + , m_vpsId(0) + , m_layerId(0) + , m_affineAmvrEnabledFlag(false) + , m_DMVR(false) + , m_MMVD(false) + , m_SBT(false) + , m_ISP(false) + , m_chromaFormatIdc(CHROMA_420) + , m_uiMaxTLayers(1) + , m_ptlDpbHrdParamsPresentFlag(1) + , m_subLayerDpbParamsFlag(0) + // Structure + , m_maxWidthInLumaSamples(352) + , m_maxHeightInLumaSamples(288) + , m_subPicInfoPresentFlag(false) + , m_numSubPics(1) + , m_independentSubPicsFlag(false) + , m_subPicSameSizeFlag(false) + , m_subPicIdMappingExplicitlySignalledFlag(false) + , m_subPicIdMappingPresentFlag(false) + , m_subPicIdLen(16) + , m_log2MinCodingBlockSize(2) + , m_CTUSize(0) + , m_minQT{ 0, 0, 0 } + , m_maxMTTHierarchyDepth{ MAX_BT_DEPTH, MAX_BT_DEPTH_INTER, MAX_BT_DEPTH_C } + , m_maxBTSize{ 0, 0, 0 } + , m_maxTTSize{ 0, 0, 0 } + , m_uiMaxCUWidth(32) + , m_uiMaxCUHeight(32) + , m_numRPL0(0) + , m_numRPL1(0) + , m_rpl1CopyFromRpl0Flag(false) + , m_rpl1IdxPresentFlag(false) + , m_allRplEntriesHasSameSignFlag(true) + , m_longTermRefsPresent(false) + // Tool list + , m_transformSkipEnabledFlag(false) + , m_log2MaxTransformSkipBlockSize(2) + , m_BDPCMEnabledFlag(false) + , m_jointCbCrEnabledFlag(false) + , m_entropyCodingSyncEnabledFlag(false) + , m_entryPointPresentFlag(false) + , m_internalMinusInputBitDepth{ 0, 0 } + , m_sbtmvpEnabledFlag(false) + , m_bdofEnabledFlag(false) + , m_fpelMmvdEnabledFlag(false) + , m_BdofControlPresentInPhFlag(false) + , m_DmvrControlPresentInPhFlag(false) + , m_ProfControlPresentInPhFlag(false) + , m_bitsForPoc(8) + , m_pocMsbCycleFlag(false) + , m_pocMsbCycleLen(1) + , m_numExtraPHBytes(0) + , m_numExtraSHBytes(0) + , m_numLongTermRefPicSPS(0) + + , m_log2MaxTbSize(6) + + , m_useWeightPred(false) + , m_useWeightedBiPred(false) + , m_saoEnabledFlag(false) + , m_bTemporalIdNestingFlag(false) + , m_scalingListEnabledFlag(false) + , m_virtualBoundariesEnabledFlag(0) + , m_virtualBoundariesPresentFlag(0) + , m_numVerVirtualBoundaries(0) + , m_numHorVirtualBoundaries(0) + , m_generalHrdParametersPresentFlag(false) + , m_fieldSeqFlag(false) + , m_vuiParametersPresentFlag(false) + , m_vuiParameters() + , m_wrapAroundEnabledFlag(false) + , m_IBCFlag(0) + , m_PLTMode(0) + , m_lmcsEnabled(false) + , m_AMVREnabledFlag(false) + , m_LMChroma(false) + , m_horCollocatedChromaFlag(true) + , m_verCollocatedChromaFlag(false) + , m_LFNST(false) + , m_Affine(false) + , m_AffineType(false) + , m_PROF(false) + , m_ciip(false) + , m_Geo(false) #if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET -, m_LadfEnabled ( false ) -, m_LadfNumIntervals ( 0 ) -, m_LadfQpOffset { 0 } -, m_LadfIntervalLowerBound { 0 } + , m_LadfEnabled(false) + , m_LadfNumIntervals(0) + , m_LadfQpOffset{ 0 } + , m_LadfIntervalLowerBound{ 0 } #endif -, m_MRL ( false ) -, m_MIP ( false ) -, m_GDREnabledFlag ( true ) -, m_SubLayerCbpParametersPresentFlag ( true ) -, m_rprEnabledFlag ( false ) -, m_resChangeInClvsEnabledFlag ( false ) -, m_maxNumMergeCand(MRG_MAX_NUM_CANDS) -, m_maxNumAffineMergeCand(AFFINE_MRG_MAX_NUM_CANDS) -, m_maxNumIBCMergeCand(IBC_MRG_MAX_NUM_CANDS) -, m_maxNumGeoCand(0) -, m_scalingMatrixAlternativeColourSpaceDisabledFlag( false ) -, m_scalingMatrixDesignatedColourSpaceFlag( true ) -, m_disableScalingMatrixForLfnstBlks( true) + , m_MRL(false) + , m_MIP(false) + , m_GDREnabledFlag(true) + , m_SubLayerCbpParametersPresentFlag(true) + , m_rprEnabledFlag(false) + , m_resChangeInClvsEnabledFlag(false) + , m_maxNumMergeCand(MRG_MAX_NUM_CANDS) + , m_maxNumAffineMergeCand(AFFINE_MRG_MAX_NUM_CANDS) + , m_maxNumIBCMergeCand(IBC_MRG_MAX_NUM_CANDS) + , m_maxNumGeoCand(0) + , m_scalingMatrixAlternativeColourSpaceDisabledFlag(false) + , m_scalingMatrixDesignatedColourSpaceFlag(true) + , m_disableScalingMatrixForLfnstBlks(true) { for(int ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++) { @@ -3150,8 +3148,8 @@ SubPic::~SubPic() } PPS::PPS() - : m_PPSId(0) - , m_SPSId(0) + : m_ppsId(0) + , m_spsId(0) , m_picInitQPMinus26(0) , m_useDQP(false) , m_usePPSChromaTool(false) @@ -3199,9 +3197,11 @@ PPS::PPS() , m_wrapAroundOffset(0) , pcv(nullptr) { - m_ChromaQpAdjTableIncludingNullEntry[0].u.comp.CbOffset = 0; // Array includes entry [0] for the null offset used when cu_chroma_qp_offset_flag=0. This is initialised here and never subsequently changed. - m_ChromaQpAdjTableIncludingNullEntry[0].u.comp.CrOffset = 0; - m_ChromaQpAdjTableIncludingNullEntry[0].u.comp.JointCbCrOffset = 0; + // Array includes entry [0] for the null offset used when cu_chroma_qp_offset_flag=0. This is initialised here + // and never subsequently changed. + m_ChromaQpAdjTableIncludingNullEntry[0].u.comp.cbOffset = 0; + m_ChromaQpAdjTableIncludingNullEntry[0].u.comp.crOffset = 0; + m_ChromaQpAdjTableIncludingNullEntry[0].u.comp.jointCbCrOffset = 0; m_tileColWidth.clear(); m_tileRowHeight.clear(); m_tileColBd.clear(); @@ -3744,13 +3744,13 @@ APS::~APS() { } -ReferencePictureList::ReferencePictureList( const bool interLayerPicPresentFlag ) +ReferencePictureList::ReferencePictureList(const bool interLayerPicPresentFlag) : m_numberOfShorttermPictures(0) , m_numberOfLongtermPictures(0) , m_numberOfActivePictures(MAX_INT) - , m_ltrp_in_slice_header_flag(0) - , m_interLayerPresentFlag( interLayerPicPresentFlag ) - , m_numberOfInterLayerPictures( 0 ) + , m_ltrpInSliceHeaderFlag(0) + , m_interLayerPresentFlag(interLayerPicPresentFlag) + , m_numberOfInterLayerPictures(0) { ::memset(m_isLongtermRefPic, 0, sizeof(m_isLongtermRefPic)); ::memset(m_refPicIdentifier, 0, sizeof(m_refPicIdentifier)); diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index 7a23c56d67..3e7b159a70 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -64,7 +64,6 @@ class TrQuant; // Constants // ==================================================================================================================== class PreCalcValues; -static const uint32_t REF_PIC_LIST_NUM_IDX=32; typedef std::list<Picture*> PicList; @@ -90,7 +89,7 @@ private: int m_numberOfActivePictures; bool m_deltaPocMSBPresentFlag[MAX_NUM_REF_PICS]; int m_deltaPOCMSBCycleLT[MAX_NUM_REF_PICS]; - bool m_ltrp_in_slice_header_flag; + bool m_ltrpInSliceHeaderFlag; bool m_interLayerPresentFlag; bool m_isInterLayerRefPic[MAX_NUM_REF_PICS]; int m_interLayerRefPicIdx[MAX_NUM_REF_PICS]; @@ -110,8 +109,8 @@ public: void setNumberOfLongtermPictures(int numberOfLtrp); int getNumberOfLongtermPictures() const; - void setLtrpInSliceHeaderFlag(bool flag) { m_ltrp_in_slice_header_flag = flag; } - bool getLtrpInSliceHeaderFlag() const { return m_ltrp_in_slice_header_flag; } + void setLtrpInSliceHeaderFlag(bool flag) { m_ltrpInSliceHeaderFlag = flag; } + bool getLtrpInSliceHeaderFlag() const { return m_ltrpInSliceHeaderFlag; } void setNumberOfInterLayerPictures( const int numberOfIlrp ) { m_numberOfInterLayerPictures = numberOfIlrp; } int getNumberOfInterLayerPictures() const { return m_numberOfInterLayerPictures; } @@ -687,9 +686,9 @@ struct ChromaQpAdj union { struct { - int CbOffset; - int CrOffset; - int JointCbCrOffset; + int cbOffset; + int crOffset; + int jointCbCrOffset; } comp; int offset[3]; } u; @@ -729,6 +728,7 @@ struct ChromaQpMappingTableParams { void setDeltaQpOutVal(int tableIdx, int idx, int n) { m_deltaQpOutVal[tableIdx][idx] = n; } int getDeltaQpOutVal(int tableIdx, int idx) const { return m_deltaQpOutVal[tableIdx][idx]; } }; + struct ChromaQpMappingTable : ChromaQpMappingTableParams { std::map<int, int> m_chromaQpMappingTables[MAX_NUM_CQP_MAPPING_TABLES]; @@ -976,7 +976,7 @@ public: class VPS { private: - int m_VPSId; + int m_vpsId; uint32_t m_maxLayers; uint32_t m_vpsMaxSubLayers; @@ -1039,8 +1039,8 @@ public: virtual ~VPS(); - int getVPSId() const { return m_VPSId; } - void setVPSId(int i) { m_VPSId = i; } + int getVPSId() const { return m_vpsId; } + void setVPSId(int i) { m_vpsId = i; } uint32_t getMaxLayers() const { return m_maxLayers; } void setMaxLayers(uint32_t l) { m_maxLayers = l; } @@ -1381,8 +1381,8 @@ public: class SPS { private: - int m_SPSId; - int m_VPSId; + int m_spsId; + int m_vpsId; int m_layerId; bool m_affineAmvrEnabledFlag; bool m_DMVR; @@ -1394,7 +1394,7 @@ private: uint32_t m_uiMaxTLayers; // maximum number of temporal layers bool m_ptlDpbHrdParamsPresentFlag; - bool m_SubLayerDpbParamsFlag; + bool m_subLayerDpbParamsFlag; // Structure uint32_t m_maxWidthInLumaSamples; @@ -1435,8 +1435,8 @@ private: bool m_rpl1CopyFromRpl0Flag; bool m_rpl1IdxPresentFlag; bool m_allRplEntriesHasSameSignFlag; - bool m_bLongTermRefsPresent; - bool m_SPSTemporalMVPEnabledFlag; + bool m_longTermRefsPresent; + bool m_temporalMvpEnabledFlag; int m_maxNumReorderPics[MAX_TLAYER]; // Tool list @@ -1444,7 +1444,7 @@ private: bool m_transformSkipEnabledFlag; int m_log2MaxTransformSkipBlockSize; bool m_BDPCMEnabledFlag; - bool m_JointCbCrEnabledFlag; + bool m_jointCbCrEnabledFlag; // Parameter BitDepths m_bitDepths; bool m_entropyCodingSyncEnabledFlag; //!< Flag for enabling WPP @@ -1458,7 +1458,7 @@ private: bool m_BdofControlPresentInPhFlag; bool m_DmvrControlPresentInPhFlag; bool m_ProfControlPresentInPhFlag; - uint32_t m_uiBitsForPOC; + uint32_t m_bitsForPoc; bool m_pocMsbCycleFlag; uint32_t m_pocMsbCycleLen; int m_numExtraPHBytes; @@ -1560,10 +1560,14 @@ public: SPS(); virtual ~SPS(); - int getSPSId() const { return m_SPSId; } - void setSPSId(int i) { m_SPSId = i; } - int getVPSId() const { return m_VPSId; } - void setVPSId(int i) { m_VPSId = i; } + // clang-format off + int getSPSId() const { return m_spsId; } + void setSPSId(int val) { m_spsId = val; } + + int getVPSId() const { return m_vpsId; } + void setVPSId(int val) { m_vpsId = val; } + // clang-format on + void setLayerId( int i ) { m_layerId = i; } int getLayerId() const { return m_layerId; } ChromaFormat getChromaFormatIdc () const { return m_chromaFormatIdc; } @@ -1692,8 +1696,11 @@ public: void setLog2MaxTransformSkipBlockSize(uint32_t u) { m_log2MaxTransformSkipBlockSize = u; } bool getBDPCMEnabledFlag() const { return m_BDPCMEnabledFlag; } void setBDPCMEnabledFlag( bool b ) { m_BDPCMEnabledFlag = b; } - void setBitsForPOC( uint32_t u ) { m_uiBitsForPOC = u; } - uint32_t getBitsForPOC() const { return m_uiBitsForPOC; } + // clang-format off + void setBitsForPOC(uint32_t val) { m_bitsForPoc = val; } + uint32_t getBitsForPOC() const { return m_bitsForPoc; } + // clang-format on + void setPocMsbCycleFlag(bool b) { m_pocMsbCycleFlag = b; } bool getPocMsbCycleFlag() const { return m_pocMsbCycleFlag; } void setPocMsbCycleLen(uint32_t u) { m_pocMsbCycleLen = u; } @@ -1724,10 +1731,15 @@ public: bool getRPL1IdxPresentFlag() const { return m_rpl1IdxPresentFlag; } void setAllActiveRplEntriesHasSameSignFlag(bool isAllSame) { m_allRplEntriesHasSameSignFlag = isAllSame; } bool getAllActiveRplEntriesHasSameSignFlag() const { return m_allRplEntriesHasSameSignFlag; } - bool getLongTermRefsPresent() const { return m_bLongTermRefsPresent; } - void setLongTermRefsPresent(bool b) { m_bLongTermRefsPresent=b; } - bool getSPSTemporalMVPEnabledFlag() const { return m_SPSTemporalMVPEnabledFlag; } - void setSPSTemporalMVPEnabledFlag(bool b) { m_SPSTemporalMVPEnabledFlag=b; } + + // clang-format off + void setLongTermRefsPresent(bool val) { m_longTermRefsPresent = val; } + bool getLongTermRefsPresent() const { return m_longTermRefsPresent; } + + void setSPSTemporalMVPEnabledFlag(bool val) { m_temporalMvpEnabledFlag = val; } + bool getSPSTemporalMVPEnabledFlag() const { return m_temporalMvpEnabledFlag; } + // clang-format on + void setLog2MaxTbSize( uint32_t u ) { m_log2MaxTbSize = u; } uint32_t getLog2MaxTbSize() const { return m_log2MaxTbSize; } uint32_t getMaxTbSize() const { return 1 << m_log2MaxTbSize; } @@ -1750,15 +1762,19 @@ public: void setSAOEnabledFlag(bool bVal) { m_saoEnabledFlag = bVal; } bool getSAOEnabledFlag() const { return m_saoEnabledFlag; } - bool getALFEnabledFlag() const { return m_alfEnabledFlag; } - void setALFEnabledFlag( bool b ) { m_alfEnabledFlag = b; } -bool getCCALFEnabledFlag() const { return m_ccalfEnabledFlag; } -void setCCALFEnabledFlag( bool b ) { m_ccalfEnabledFlag = b; } - void setJointCbCrEnabledFlag(bool bVal) { m_JointCbCrEnabledFlag = bVal; } - bool getJointCbCrEnabledFlag() const { return m_JointCbCrEnabledFlag; } + // clang-format off + void setALFEnabledFlag(bool val) { m_alfEnabledFlag = val; } + bool getALFEnabledFlag() const { return m_alfEnabledFlag; } + + void setCCALFEnabledFlag(bool val) { m_ccalfEnabledFlag = val; } + bool getCCALFEnabledFlag() const { return m_ccalfEnabledFlag; } + + void setJointCbCrEnabledFlag(bool val) { m_jointCbCrEnabledFlag = val; } + bool getJointCbCrEnabledFlag() const { return m_jointCbCrEnabledFlag; } + void setSbTMVPEnabledFlag(bool val) { m_sbtmvpEnabledFlag = val; } bool getSbTMVPEnabledFlag() const { return m_sbtmvpEnabledFlag; } - void setSbTMVPEnabledFlag(bool b) { m_sbtmvpEnabledFlag = b; } + // clang-format on void setBDOFEnabledFlag(bool b) { m_bdofEnabledFlag = b; } bool getBDOFEnabledFlag() const { return m_bdofEnabledFlag; } @@ -1782,8 +1798,12 @@ void setCCALFEnabledFlag( bool b ) bool getPtlDpbHrdParamsPresentFlag() const { return m_ptlDpbHrdParamsPresentFlag; } void setPtlDpbHrdParamsPresentFlag(bool b) { m_ptlDpbHrdParamsPresentFlag = b; } - bool getSubLayerDpbParamsFlag() const { return m_SubLayerDpbParamsFlag; } - void setSubLayerDpbParamsFlag(bool b) { m_SubLayerDpbParamsFlag = b; } + + // clang-format off + void setSubLayerDpbParamsFlag(bool val) { m_subLayerDpbParamsFlag = val; } + bool getSubLayerDpbParamsFlag() const { return m_subLayerDpbParamsFlag; } + // clang-format on + bool getTemporalIdNestingFlag() const { return m_bTemporalIdNestingFlag; } void setTemporalIdNestingFlag(bool value) { m_bTemporalIdNestingFlag = value; } @@ -1958,8 +1978,8 @@ void setCCALFEnabledFlag( bool b ) class PPS { private: - int m_PPSId; // pic_parameter_set_id - int m_SPSId; // seq_parameter_set_id + int m_ppsId; // pic_parameter_set_id + int m_spsId; // seq_parameter_set_id int m_picInitQPMinus26; bool m_useDQP; bool m_usePPSChromaTool; @@ -1985,12 +2005,13 @@ private: bool m_rpl1IdxPresentFlag; - bool m_bUseWeightPred; //!< Use of Weighting Prediction (P_SLICE) + bool m_useWeightedPred; //!< Use of Weighting Prediction (P_SLICE) bool m_useWeightedBiPred; //!< Use of Weighting Bi-Prediction (B_SLICE) bool m_OutputFlagPresentFlag; //!< Indicates the presence of output_flag in slice header uint32_t m_numSubPics; //!< number of sub-pictures used - must match SPS bool m_subPicIdMappingInPpsFlag; uint32_t m_subPicIdLen; //!< sub-picture ID length in bits + std::vector<uint16_t> m_subPicId; //!< sub-picture ID for each sub-picture in the sequence bool m_noPicPartitionFlag; //!< no picture partitioning flag - single slice, single tile uint8_t m_log2CtuSize; //!< log2 of the CTU size - required to match corresponding value in SPS @@ -2060,10 +2081,10 @@ public: PPS(); virtual ~PPS(); - int getPPSId() const { return m_PPSId; } - void setPPSId(int i) { m_PPSId = i; } - int getSPSId() const { return m_SPSId; } - void setSPSId(int i) { m_SPSId = i; } + int getPPSId() const { return m_ppsId; } + void setPPSId(int i) { m_ppsId = i; } + int getSPSId() const { return m_spsId; } + void setSPSId(int i) { m_spsId = i; } void setTemporalId( int i ) { m_temporalId = i; } int getTemporalId() const { return m_temporalId; } @@ -2121,10 +2142,12 @@ public: void setChromaQpOffsetListEntry( int cuChromaQpOffsetIdxPlus1, int cbOffset, int crOffset, int jointCbCrOffset ) { + // Array includes entry [0] for the null offset used when cu_chroma_qp_offset_flag=0, and entries + // [cu_chroma_qp_offset_idx+1...] otherwise CHECK(cuChromaQpOffsetIdxPlus1 == 0 || cuChromaQpOffsetIdxPlus1 > MAX_QP_OFFSET_LIST_SIZE, "Invalid chroma QP offset"); - m_ChromaQpAdjTableIncludingNullEntry[cuChromaQpOffsetIdxPlus1].u.comp.CbOffset = cbOffset; // Array includes entry [0] for the null offset used when cu_chroma_qp_offset_flag=0, and entries [cu_chroma_qp_offset_idx+1...] otherwise - m_ChromaQpAdjTableIncludingNullEntry[cuChromaQpOffsetIdxPlus1].u.comp.CrOffset = crOffset; - m_ChromaQpAdjTableIncludingNullEntry[cuChromaQpOffsetIdxPlus1].u.comp.JointCbCrOffset = jointCbCrOffset; + m_ChromaQpAdjTableIncludingNullEntry[cuChromaQpOffsetIdxPlus1].u.comp.cbOffset = cbOffset; + m_ChromaQpAdjTableIncludingNullEntry[cuChromaQpOffsetIdxPlus1].u.comp.crOffset = crOffset; + m_ChromaQpAdjTableIncludingNullEntry[cuChromaQpOffsetIdxPlus1].u.comp.jointCbCrOffset = jointCbCrOffset; m_chromaQpOffsetListLen = std::max(m_chromaQpOffsetListLen, cuChromaQpOffsetIdxPlus1); } @@ -2136,9 +2159,9 @@ public: void setRpl1IdxPresentFlag(bool isPresent) { m_rpl1IdxPresentFlag = isPresent; } uint32_t getRpl1IdxPresentFlag() const { return m_rpl1IdxPresentFlag; } - bool getUseWP() const { return m_bUseWeightPred; } + bool getUseWP() const { return m_useWeightedPred; } bool getWPBiPred() const { return m_useWeightedBiPred; } - void setUseWP( bool b ) { m_bUseWeightPred = b; } + void setUseWP(bool b) { m_useWeightedPred = b; } void setWPBiPred( bool b ) { m_useWeightedBiPred = b; } void setWrapAroundEnabledFlag(bool b) { m_wrapAroundEnabledFlag = b; } @@ -2653,7 +2676,7 @@ class Slice private: // Bitstream writing bool m_saoEnabledFlag[MAX_NUM_CHANNEL_TYPE]; - int m_iPOC; + int m_poc; int m_iLastIDR; int m_prevGDRInSameLayerPOC; //< the previous GDR in the same layer int m_iAssociatedIRAP; @@ -2703,7 +2726,7 @@ private: int m_aiNumRefIdx [NUM_REF_PIC_LIST_01]; // for multiple reference of current slice bool m_pendingRasInit; - bool m_bCheckLDC; + bool m_checkLdc; bool m_biDirPred; bool m_lmChromaCheckDisable; @@ -2742,8 +2765,7 @@ private: uint32_t m_independentSliceIdx; bool m_nextSlice; uint32_t m_sliceBits; - bool m_bFinalized; - + bool m_finalized; bool m_bTestWeightPred; bool m_bTestWeightBiPred; @@ -2778,7 +2800,8 @@ private: bool m_isLossless{ false }; int m_tsrc_index; unsigned m_riceBit[8]; - int m_cnt_right_bottom; + int m_cntRightBottom; + public: Slice(); virtual ~Slice(); @@ -2825,7 +2848,7 @@ public: SliceType getSliceType() const { return m_eSliceType; } void setNoOutputOfPriorPicsFlag(bool b) { m_noOutputOfPriorPicsFlag = b; } bool getNoOutputOfPriorPicsFlag() const { return m_noOutputOfPriorPicsFlag; } - int getPOC() const { return m_iPOC; } + int getPOC() const { return m_poc; } int getSliceQp() const { return m_iSliceQp; } bool getUseWeightedPrediction() const { return( (m_eSliceType==P_SLICE && testWeightPred()) || (m_eSliceType==B_SLICE && testWeightBiPred()) ); } int getSliceQpDelta() const { return m_iSliceQpDelta; } @@ -2860,9 +2883,9 @@ public: void checkColRefIdx(uint32_t curSliceSegmentIdx, const Picture* pic); bool getIsUsedAsLongTerm(int i, int j) const { return m_bIsUsedAsLongTerm[i][j]; } void setIsUsedAsLongTerm(int i, int j, bool value) { m_bIsUsedAsLongTerm[i][j] = value; } - bool getCheckLDC() const { return m_bCheckLDC; } + bool getCheckLDC() const { return m_checkLdc; } int getList1IdxToList0Idx( int list1Idx ) const { return m_list1IdxToList0Idx[list1Idx]; } - void setPOC( int i ) { m_iPOC = i; } + void setPOC(int i) { m_poc = i; } bool getPictureHeaderInSliceHeader() const { return m_pictureHeaderInSliceHeader; } void setPictureHeaderInSliceHeader( bool e ) { m_pictureHeaderInSliceHeader = e; } void setNalUnitType( NalUnitType e ) { m_eNalUnitType = e; } @@ -2912,7 +2935,7 @@ public: void setColFromL0Flag( bool colFromL0 ) { m_colFromL0Flag = colFromL0; } void setColRefIdx( uint32_t refIdx) { m_colRefIdx = refIdx; } - void setCheckLDC( bool b ) { m_bCheckLDC = b; } + void setCheckLDC(bool b) { m_checkLdc = b; } void setBiDirPred( bool b, int refIdx0, int refIdx1 ) { m_biDirPred = b; m_symRefIdx[0] = refIdx0; m_symRefIdx[1] = refIdx1; } bool getBiDirPred() const { return m_biDirPred; } @@ -3018,8 +3041,12 @@ public: void copySliceInfo(Slice *pcSliceSrc, bool cpyAlmostAll = true); void setSliceBits( uint32_t uiVal ) { m_sliceBits = uiVal; } uint32_t getSliceBits() const { return m_sliceBits; } - void setFinalized( bool uiVal ) { m_bFinalized = uiVal; } - bool getFinalized() const { return m_bFinalized; } + + // clang-format off + void setFinalized(bool val) { m_finalized = val; } + bool getFinalized() const { return m_finalized; } + // clang-format on + bool testWeightPred( ) const { return m_bTestWeightPred; } void setTestWeightPred(bool value) { m_bTestWeightPred = value; } bool testWeightBiPred( ) const { return m_bTestWeightBiPred; } @@ -3119,8 +3146,11 @@ public: int get_tsrc_index() const { return m_tsrc_index; } void setRiceBit(int idx, int i) { m_riceBit[idx] = i; } unsigned getRiceBit(int idx) const { return m_riceBit[idx]; } - void updateCntRightBottom(int v) { m_cnt_right_bottom += v; } - int getCntRightBottom() { return m_cnt_right_bottom; } + + // clang-format off + void updateCntRightBottom(int val) { m_cntRightBottom += val; } + int getCntRightBottom() const { return m_cntRightBottom; } + // clang-format on protected: Picture* xGetRefPic( PicList& rcListPic, const int poc, const int layerId ); diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index 3ed39d3892..08c039e201 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -82,34 +82,34 @@ struct GOPEntry int m_numRefPics1; int m_deltaRefPics1[MAX_NUM_REF_PICS]; bool m_isEncoded; - bool m_ltrp_in_slice_header_flag; + bool m_ltrpInSliceHeaderFlag; GOPEntry() - : m_POC(-1) - , m_QPOffset(0) + : m_POC(-1) + , m_QPOffset(0) #if X0038_LAMBDA_FROM_QP_CAPABILITY - , m_QPOffsetModelOffset(0) - , m_QPOffsetModelScale(0) + , m_QPOffsetModelOffset(0) + , m_QPOffsetModelScale(0) #endif #if W0038_CQP_ADJ - , m_CbQPoffset(0) - , m_CrQPoffset(0) + , m_CbQPoffset(0) + , m_CrQPoffset(0) #endif - , m_QPFactor(0) - , m_tcOffsetDiv2(0) - , m_betaOffsetDiv2(0) - , m_CbTcOffsetDiv2(0) - , m_CbBetaOffsetDiv2(0) - , m_CrTcOffsetDiv2(0) - , m_CrBetaOffsetDiv2(0) - , m_temporalId(0) - , m_refPic(false) - , m_sliceType('P') + , m_QPFactor(0) + , m_tcOffsetDiv2(0) + , m_betaOffsetDiv2(0) + , m_CbTcOffsetDiv2(0) + , m_CbBetaOffsetDiv2(0) + , m_CrTcOffsetDiv2(0) + , m_CrBetaOffsetDiv2(0) + , m_temporalId(0) + , m_refPic(false) + , m_sliceType('P') , m_numRefPicsActive0(0) , m_numRefPics0(0) , m_numRefPicsActive1(0) , m_numRefPics1(0) , m_isEncoded(false) - , m_ltrp_in_slice_header_flag(false) + , m_ltrpInSliceHeaderFlag(false) { ::memset(m_deltaRefPics0, 0, sizeof(m_deltaRefPics0)); ::memset(m_deltaRefPics1, 0, sizeof(m_deltaRefPics1)); @@ -126,7 +126,7 @@ struct RPLEntry int m_numRefPics; int m_deltaRefPics[MAX_NUM_REF_PICS]; bool m_isEncoded; - bool m_ltrp_in_slice_header_flag; + bool m_ltrpInSliceHeaderFlag; RPLEntry() : m_POC(-1) , m_temporalId(0) @@ -135,7 +135,7 @@ struct RPLEntry , m_sliceType('P') , m_numRefPics(0) , m_isEncoded(false) - , m_ltrp_in_slice_header_flag(false) + , m_ltrpInSliceHeaderFlag(false) { ::memset(m_deltaRefPics, 0, sizeof(m_deltaRefPics)); } diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp index 73a66cfbc1..4dc71b80cc 100644 --- a/source/Lib/EncoderLib/EncGOP.cpp +++ b/source/Lib/EncoderLib/EncGOP.cpp @@ -134,7 +134,7 @@ EncGOP::EncGOP() m_metricTime = std::chrono::milliseconds(0); #endif - m_bInitAMaxBT = true; + m_initAMaxBt = true; m_bgPOC = -1; m_picBg = nullptr; @@ -144,8 +144,8 @@ EncGOP::EncGOP() m_isUseLTRef = false; m_isPrepareLTRef = true; m_lastLTRefPoc = 0; - m_cnt_right_bottom = 0; - m_cnt_right_bottom_i = 0; + m_cntRightBottom = 0; + m_cntRightBottomIntra = 0; } EncGOP::~EncGOP() @@ -2753,17 +2753,17 @@ void EncGOP::compressGOP(int pocLast, int numPicRcvd, PicList &rcListPic, std::l refLayer = 9; // Max layer is 10 } - if( m_bInitAMaxBT && pcSlice->getPOC() > m_uiPrevISlicePOC ) + if (m_initAMaxBt && pcSlice->getPOC() > m_prevISlicePoc) { - ::memset( m_uiBlkSize, 0, sizeof( m_uiBlkSize ) ); - ::memset( m_uiNumBlk, 0, sizeof( m_uiNumBlk ) ); - m_bInitAMaxBT = false; + m_blkSize.fill(0); + m_numBlks.fill(0); + m_initAMaxBt = false; } - if( refLayer >= 0 && m_uiNumBlk[refLayer] != 0 ) + if (refLayer >= 0 && m_numBlks[refLayer] != 0) { picHeader->setSplitConsOverrideFlag(true); - double dBlkSize = sqrt( ( double ) m_uiBlkSize[refLayer] / m_uiNumBlk[refLayer] ); + double dBlkSize = sqrt((double) m_blkSize[refLayer] / m_numBlks[refLayer]); unsigned int newMaxBtSize = picHeader->getMaxBTSize(pcSlice->getSliceType(), CHANNEL_TYPE_LUMA); if( dBlkSize < AMAXBT_TH32 ) { @@ -2780,20 +2780,20 @@ void EncGOP::compressGOP(int pocLast, int numPicRcvd, PicList &rcListPic, std::l newMaxBtSize = Clip3(picHeader->getMinQTSize(pcSlice->getSliceType()), pcPic->cs->sps->getCTUSize(), newMaxBtSize); picHeader->setMaxBTSize(1, newMaxBtSize); - m_uiBlkSize[refLayer] = 0; - m_uiNumBlk [refLayer] = 0; + m_blkSize[refLayer] = 0; + m_numBlks[refLayer] = 0; } } else { - if( m_bInitAMaxBT ) + if (m_initAMaxBt) { - ::memset( m_uiBlkSize, 0, sizeof( m_uiBlkSize ) ); - ::memset( m_uiNumBlk, 0, sizeof( m_uiNumBlk ) ); + m_blkSize.fill(0); + m_numBlks.fill(0); } - m_uiPrevISlicePOC = pcSlice->getPOC(); - m_bInitAMaxBT = true; + m_prevISlicePoc = pcSlice->getPOC(); + m_initAMaxBt = true; } bool identicalToSPS=true; const SPS* sps =pcSlice->getSPS(); @@ -3237,15 +3237,15 @@ void EncGOP::compressGOP(int pocLast, int numPicRcvd, PicList &rcListPic, std::l { if (pcSlice->isIntra()) { - m_cnt_right_bottom = 0; + m_cntRightBottom = 0; } if ((pocCurr % m_pcCfg->getIntraPeriod()) <= m_pcCfg->getGOPSize() && gopId == 0 && !pcSlice->isIntra()) { - m_cnt_right_bottom = m_cnt_right_bottom_i; + m_cntRightBottom = m_cntRightBottomIntra; } } /*for RA serial and parallel alignment end*/ - pcSlice->setReverseLastSigCoeffFlag(m_cnt_right_bottom >= 0); + pcSlice->setReverseLastSigCoeffFlag(m_cntRightBottom >= 0); } if( encPic ) @@ -3702,8 +3702,8 @@ void EncGOP::compressGOP(int pocLast, int numPicRcvd, PicList &rcListPic, std::l { if( !pcSlice->isIntra() ) { - m_uiBlkSize[pcSlice->getDepth()] += cu->Y().area(); - m_uiNumBlk [pcSlice->getDepth()]++; + m_blkSize[pcSlice->getDepth()] += cu->Y().area(); + m_numBlks[pcSlice->getDepth()]++; } } } @@ -4232,10 +4232,10 @@ void EncGOP::compressGOP(int pocLast, int numPicRcvd, PicList &rcListPic, std::l fflush( stdout ); } - m_cnt_right_bottom = pcSlice->getCntRightBottom(); + m_cntRightBottom = pcSlice->getCntRightBottom(); if (m_pcCfg->getIntraPeriod() > 1 && pcSlice->isIntra()) { - m_cnt_right_bottom_i = m_cnt_right_bottom; + m_cntRightBottomIntra = m_cntRightBottom; } DTRACE_UPDATE( g_trace_ctx, ( std::make_pair( "final", 0 ) ) ); diff --git a/source/Lib/EncoderLib/EncGOP.h b/source/Lib/EncoderLib/EncGOP.h index 6a1e071694..a8f24c98f5 100644 --- a/source/Lib/EncoderLib/EncGOP.h +++ b/source/Lib/EncoderLib/EncGOP.h @@ -120,8 +120,8 @@ private: // Data bool m_bLongtermTestPictureHasBeenCoded; bool m_bLongtermTestPictureHasBeenCoded2; - uint32_t m_numLongTermRefPicSPS; - uint32_t m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS]; + uint32_t m_numLongTermRefPicSPS; + uint32_t m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS]; bool m_ltRefPicUsedByCurrPicFlag[MAX_NUM_LONG_TERM_REF_PICS]; int m_iLastIDR; int m_iGopSize; @@ -135,8 +135,8 @@ private: unsigned m_riceBit[8][2]; int m_preQP[2]; int m_preIPOC; - int m_cnt_right_bottom; - int m_cnt_right_bottom_i; + int m_cntRightBottom; + int m_cntRightBottomIntra; // Access channel EncLib* m_pcEncLib; @@ -145,7 +145,7 @@ private: PicList* m_pcListPic; HLSWriter* m_HLSWriter; - DeblockingFilter* m_pcLoopFilter; + DeblockingFilter *m_pcLoopFilter; SEIWriter m_seiWriter; @@ -176,9 +176,9 @@ private: int m_associatedIRAPPOC[MAX_VPS_LAYERS]; std::vector<int> m_vRVM_RP; - uint32_t m_lastBPSEI[MAX_TLAYER]; - uint32_t m_totalCoded[MAX_TLAYER]; - bool m_rapWithLeading; + uint32_t m_lastBPSEI[MAX_TLAYER]; + uint32_t m_totalCoded[MAX_TLAYER]; + bool m_rapWithLeading; bool m_bufferingPeriodSEIPresentInAU; SEIEncoder m_seiEncoder; #if W0038_DB_OPT @@ -187,10 +187,10 @@ private: #endif // members needed for adaptive max BT size - uint32_t m_uiBlkSize[10]; - uint32_t m_uiNumBlk[10]; - uint32_t m_uiPrevISlicePOC; - bool m_bInitAMaxBT; + std::array<uint32_t, 8> m_blkSize; + std::array<uint32_t, 8> m_numBlks; + uint32_t m_prevISlicePoc; + bool m_initAMaxBt; AUWriterIf* m_AUWriterIf; #if GDR_ENABLED diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index b89ba1fd59..bc535bc827 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -1584,8 +1584,9 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps) pps.clearChromaQpOffsetList(); for (int i=0; i < m_cuChromaQpOffsetList.size(); i++) { - pps.setChromaQpOffsetListEntry(i + 1, m_cuChromaQpOffsetList[i].u.comp.CbOffset, - m_cuChromaQpOffsetList[i].u.comp.CrOffset, m_cuChromaQpOffsetList[i].u.comp.JointCbCrOffset); + pps.setChromaQpOffsetListEntry(i + 1, m_cuChromaQpOffsetList[i].u.comp.cbOffset, + m_cuChromaQpOffsetList[i].u.comp.crOffset, + m_cuChromaQpOffsetList[i].u.comp.jointCbCrOffset); } } else @@ -1617,7 +1618,7 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps) bool enable = (m_chromaCbCrQpOffset != 0); for (int i=0; i < m_cuChromaQpOffsetList.size(); i++) { - enable |= (m_cuChromaQpOffsetList[i].u.comp.JointCbCrOffset != 0); + enable |= (m_cuChromaQpOffsetList[i].u.comp.jointCbCrOffset != 0); } pps.setJointCbCrQpOffsetPresentFlag(enable); } @@ -1972,7 +1973,7 @@ void EncLib::xInitRPL(SPS &sps) rpl->setNumberOfShorttermPictures(ge.m_numRefPics); rpl->setNumberOfLongtermPictures(0); //Hardcoded as 0 for now. need to update this when implementing LTRP rpl->setNumberOfActivePictures(ge.m_numRefPicsActive); - rpl->setLtrpInSliceHeaderFlag(ge.m_ltrp_in_slice_header_flag); + rpl->setLtrpInSliceHeaderFlag(ge.m_ltrpInSliceHeaderFlag); rpl->setInterLayerPresentFlag( sps.getInterLayerPresentFlag() ); // inter-layer reference picture is not signaled in SPS RPL, SPS is shared currently rpl->setNumberOfInterLayerPictures( 0 ); diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index 78ed0648c3..96424cd651 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -468,11 +468,14 @@ void HLSWriter::codePPS( const PPS* pcPPS ) /* skip zero index */ for (int cuChromaQpOffsetIdx = 0; cuChromaQpOffsetIdx < pcPPS->getChromaQpOffsetListLen(); cuChromaQpOffsetIdx++) { - WRITE_SVLC(pcPPS->getChromaQpOffsetListEntry(cuChromaQpOffsetIdx+1).u.comp.CbOffset, "pps_cb_qp_offset_list[i]"); - WRITE_SVLC(pcPPS->getChromaQpOffsetListEntry(cuChromaQpOffsetIdx+1).u.comp.CrOffset, "pps_cr_qp_offset_list[i]"); + WRITE_SVLC(pcPPS->getChromaQpOffsetListEntry(cuChromaQpOffsetIdx + 1).u.comp.cbOffset, + "pps_cb_qp_offset_list[i]"); + WRITE_SVLC(pcPPS->getChromaQpOffsetListEntry(cuChromaQpOffsetIdx + 1).u.comp.crOffset, + "pps_cr_qp_offset_list[i]"); if (pcPPS->getJointCbCrQpOffsetPresentFlag()) { - WRITE_SVLC(pcPPS->getChromaQpOffsetListEntry(cuChromaQpOffsetIdx + 1).u.comp.JointCbCrOffset, "pps_joint_cbcr_qp_offset_list[i]"); + WRITE_SVLC(pcPPS->getChromaQpOffsetListEntry(cuChromaQpOffsetIdx + 1).u.comp.jointCbCrOffset, + "pps_joint_cbcr_qp_offset_list[i]"); } } } -- GitLab