diff --git a/source/App/DecoderApp/DecApp.cpp b/source/App/DecoderApp/DecApp.cpp index 7e780ce8e41cd190d10fe1a684272bf11c6362f2..d583d8d926740ea81a1042daddcd7b89c9e8894b 100644 --- a/source/App/DecoderApp/DecApp.cpp +++ b/source/App/DecoderApp/DecApp.cpp @@ -462,7 +462,7 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId ) int numPicsNotYetDisplayed = 0; int dpbFullness = 0; const SPS* activeSPS = (pcListPic->front()->cs->sps); - uint32_t numReorderPicsHighestTid; + uint32_t maxNumReorderPicsHighestTid; uint32_t maxDecPicBufferingHighestTid; uint32_t maxNrSublayers = activeSPS->getMaxTLayers(); @@ -471,12 +471,12 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId ) if( referredVPS == nullptr || referredVPS->m_numLayersInOls[referredVPS->m_targetOlsIdx] == 1 ) { - numReorderPicsHighestTid = activeSPS->getNumReorderPics( temporalId ); + maxNumReorderPicsHighestTid = activeSPS->getMaxNumReorderPics( temporalId ); maxDecPicBufferingHighestTid = activeSPS->getMaxDecPicBuffering( temporalId ); } else { - numReorderPicsHighestTid = referredVPS->getNumReorderPics( temporalId ); + maxNumReorderPicsHighestTid = referredVPS->getMaxNumReorderPics( temporalId ); maxDecPicBufferingHighestTid = referredVPS->getMaxDecPicBuffering( temporalId ); } @@ -515,7 +515,7 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId ) Picture* pcPicBottom = *(iterPic); if ( pcPicTop->neededForOutput && pcPicBottom->neededForOutput && - (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) && + (numPicsNotYetDisplayed > maxNumReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) && (!(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) && (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay < 0)) { @@ -569,7 +569,7 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId ) pcPic = *(iterPic); if(pcPic->neededForOutput && pcPic->getPOC() > m_iPOCLastDisplay && - (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid)) + (numPicsNotYetDisplayed > maxNumReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid)) { // write to file numPicsNotYetDisplayed--; diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index bf19a9bcb73a7c90d5973ef7c288b050c75248c0..a8e6f25ff1ec569683a3c5daadf6a6fd27d5dae3 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -571,7 +571,7 @@ void EncApp::xInitLibCfg() for(int i = 0; i < MAX_TLAYER; i++) { - m_cEncLib.setNumReorderPics ( m_numReorderPics[i], i ); + m_cEncLib.setMaxNumReorderPics ( m_maxNumReorderPics[i], i ); m_cEncLib.setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i ); } for( uint32_t uiLoop = 0; uiLoop < MAX_TLAYER; ++uiLoop ) diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 90f5d47a14567373b9a1880ac3da4d135e32e061..090284765266200d69818bb11bf2d3381d6abda0 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -3383,7 +3383,7 @@ bool EncAppCfg::xCheckParameter() } for(int i=0; i<MAX_TLAYER; i++) { - m_numReorderPics[i] = 0; + m_maxNumReorderPics[i] = 0; m_maxDecPicBuffering[i] = 1; } for(int i=0; i<m_iGOPSize; i++) @@ -3419,23 +3419,23 @@ bool EncAppCfg::xCheckParameter() numReorder++; } } - if(numReorder > m_numReorderPics[m_GOPList[i].m_temporalId]) + if(numReorder > m_maxNumReorderPics[m_GOPList[i].m_temporalId]) { - m_numReorderPics[m_GOPList[i].m_temporalId] = numReorder; + m_maxNumReorderPics[m_GOPList[i].m_temporalId] = numReorder; } } for(int i=0; i<MAX_TLAYER-1; i++) { - // a lower layer can not have higher value of m_numReorderPics than a higher layer - if(m_numReorderPics[i+1] < m_numReorderPics[i]) + // a lower layer can not have higher value of m_maxNumReorderPics than a higher layer + if(m_maxNumReorderPics[i+1] < m_maxNumReorderPics[i]) { - m_numReorderPics[i+1] = m_numReorderPics[i]; + m_maxNumReorderPics[i+1] = m_maxNumReorderPics[i]; } - // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive - if(m_numReorderPics[i] > m_maxDecPicBuffering[i] - 1) + // the value of dpb_max_num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive + if(m_maxNumReorderPics[i] > m_maxDecPicBuffering[i] - 1) { - m_maxDecPicBuffering[i] = m_numReorderPics[i] + 1; + m_maxDecPicBuffering[i] = m_maxNumReorderPics[i] + 1; } // a lower layer can not have higher value of m_uiMaxDecPicBuffering than a higher layer if(m_maxDecPicBuffering[i+1] < m_maxDecPicBuffering[i]) @@ -3444,10 +3444,10 @@ bool EncAppCfg::xCheckParameter() } } - // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive - if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1) + // the value of dpb_max_num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive + if(m_maxNumReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1) { - m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1; + m_maxDecPicBuffering[MAX_TLAYER-1] = m_maxNumReorderPics[MAX_TLAYER-1] + 1; } if( m_picPartitionFlag ) diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index 56b84ac4185af9195669a8c3ff90683e27061012..8337d391e7a9d3cd511ff01a29411c795a2297f1 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -254,7 +254,7 @@ protected: RPLEntry m_RPLList1[MAX_GOP]; ///< the RPL entries from the config file bool m_idrRefParamList; ///< indicates if reference picture list syntax elements are present in slice headers of IDR pictures GOPEntry m_GOPList[MAX_GOP]; ///< the coding structure entries from the config file - int m_numReorderPics[MAX_TLAYER]; ///< total number of reorder pictures + int m_maxNumReorderPics[MAX_TLAYER]; ///< total number of reorder pictures int m_maxDecPicBuffering[MAX_TLAYER]; ///< total number of pictures in the decoded picture buffer bool m_reconBasedCrossCPredictionEstimate; ///< causes the alpha calculation in encoder search to be based on the decoded residual rather than the pre-transform encoder-side residual bool m_useTransformSkip; ///< flag for enabling intra transform skipping diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 1c525b48d5a9c67a6093c53875574bf951dbcc3e..a55f6531d0e30e3eed85c25bb18dc88346d48598 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -3099,7 +3099,7 @@ SPS::SPS() { m_uiMaxLatencyIncreasePlus1[i] = 0; m_uiMaxDecPicBuffering[i] = 1; - m_numReorderPics[i] = 0; + m_maxNumReorderPics[i] = 0; } ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index c5a3377a53dab1989b41f615192a5bf024524f21..fc5c2d30c4f7b9d2b7151b3636e549d381960a37 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -74,7 +74,7 @@ typedef std::list<Picture*> PicList; struct DpbParameters { int m_maxDecPicBuffering[MAX_TLAYER] = { 0 }; - int m_numReorderPics[MAX_TLAYER] = { 0 }; + int m_maxNumReorderPics[MAX_TLAYER] = { 0 }; int m_maxLatencyIncreasePlus1[MAX_TLAYER] = { 0 }; }; @@ -1201,7 +1201,7 @@ public: void setTargetOlsIdx(uint32_t t) { m_targetOlsIdx = t; } int getMaxDecPicBuffering( int temporalId ) const { return m_dpbParameters[m_olsDpbParamsIdx[m_targetOlsIdx]].m_maxDecPicBuffering[temporalId]; } - int getNumReorderPics( int temporalId ) const { return m_dpbParameters[m_olsDpbParamsIdx[m_targetOlsIdx]].m_numReorderPics[temporalId]; } + int getMaxNumReorderPics( int temporalId ) const { return m_dpbParameters[m_olsDpbParamsIdx[m_targetOlsIdx]].m_maxNumReorderPics[temporalId]; } int getTotalNumOLSs() const { return m_totalNumOLSs; } int getNumMultiLayeredOlss() const { return m_numMultiLayeredOlss; } Size getOlsDpbPicSize( int olsIdx ) const { return m_olsDpbPicSize[olsIdx]; } @@ -1541,7 +1541,7 @@ private: bool m_allRplEntriesHasSameSignFlag; bool m_bLongTermRefsPresent; bool m_SPSTemporalMVPEnabledFlag; - int m_numReorderPics[MAX_TLAYER]; + int m_maxNumReorderPics[MAX_TLAYER]; // Tool list @@ -1819,8 +1819,8 @@ public: const std::vector<bool> getExtraPHBitPresentFlags() const { return m_extraPHBitPresentFlag; } void setExtraSHBitPresentFlags(const std::vector<bool> &b) { m_extraSHBitPresentFlag = b; } const std::vector<bool> getExtraSHBitPresentFlags() const { return m_extraSHBitPresentFlag; } - void setNumReorderPics(int i, uint32_t tlayer) { m_numReorderPics[tlayer] = i; } - int getNumReorderPics(uint32_t tlayer) const { return m_numReorderPics[tlayer]; } + void setMaxNumReorderPics(int i, uint32_t tlayer) { m_maxNumReorderPics[tlayer] = i; } + int getMaxNumReorderPics(uint32_t tlayer) const { return m_maxNumReorderPics[tlayer]; } void createRPLList0(int numRPL); void createRPLList1(int numRPL); const RPLList* getRPLList( bool b ) const { return b==1 ? &m_RPLList1 : &m_RPLList0; } diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp index 7b49ca3836798b2345576c24c6a8393d8c299a91..a798a4ef981f276b1eeb0177bf603065082b0ee6 100644 --- a/source/Lib/DecoderLib/DecLib.cpp +++ b/source/Lib/DecoderLib/DecLib.cpp @@ -261,13 +261,13 @@ bool tryDecodePicture( Picture* pcEncPic, const int expectedPoc, const std::stri int dpbFullness = 0; const SPS* activeSPS = (pcListPic->front()->cs->sps); uint32_t maxNrSublayers = activeSPS->getMaxTLayers(); - uint32_t numReorderPicsHighestTid = activeSPS->getNumReorderPics(maxNrSublayers-1); + uint32_t maxNumReorderPicsHighestTid = activeSPS->getMaxNumReorderPics(maxNrSublayers-1); uint32_t maxDecPicBufferingHighestTid = activeSPS->getMaxDecPicBuffering(maxNrSublayers-1); const VPS* referredVPS = pcListPic->front()->cs->vps; if( referredVPS != nullptr && referredVPS->m_numLayersInOls[referredVPS->m_targetOlsIdx] > 1 ) { - numReorderPicsHighestTid = referredVPS->getNumReorderPics( maxNrSublayers - 1 ); + maxNumReorderPicsHighestTid = referredVPS->getMaxNumReorderPics( maxNrSublayers - 1 ); maxDecPicBufferingHighestTid = referredVPS->getMaxDecPicBuffering( maxNrSublayers - 1 ); } @@ -307,7 +307,7 @@ bool tryDecodePicture( Picture* pcEncPic, const int expectedPoc, const std::stri pcCurPic = *(iterPic); if(pcCurPic->neededForOutput && pcCurPic->getPOC() > iPOCLastDisplay && - (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid)) + (numPicsNotYetDisplayed > maxNumReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid)) { numPicsNotYetDisplayed--; if( ! pcCurPic->referenced ) diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 02318c4800f08044b9a421932a800c51fe272a3a..6a0c80fbae85bc259ddfc22d6a5139211307b7e9 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -1375,11 +1375,11 @@ void HLSyntaxReader::dpb_parameters(int maxSubLayersMinus1, bool subLayerInfoFla uint32_t code; for (int i = (subLayerInfoFlag ? 0 : maxSubLayersMinus1); i <= maxSubLayersMinus1; i++) { - READ_UVLC(code, "max_dec_pic_buffering_minus1[i]"); + READ_UVLC(code, "dpb_max_dec_pic_buffering_minus1[i]"); pcSPS->setMaxDecPicBuffering(code + 1, i); - READ_UVLC(code, "max_num_reorder_pics[i]"); - pcSPS->setNumReorderPics(code, i); - READ_UVLC(code, "max_latency_increase_plus1[i]"); + READ_UVLC(code, "dpb_max_num_reorder_pics[i]"); + pcSPS->setMaxNumReorderPics(code, i); + READ_UVLC(code, "dpb_max_latency_increase_plus1[i]"); pcSPS->setMaxLatencyIncreasePlus1(code, i); } } @@ -2625,21 +2625,21 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS) for( int j = ( pcVPS->m_sublayerDpbParamsPresentFlag ? 0 : pcVPS->m_dpbMaxTemporalId[i] ); j <= pcVPS->m_dpbMaxTemporalId[i]; j++ ) { - READ_UVLC(uiCode, "max_dec_pic_buffering_minus1[i]"); + READ_UVLC(uiCode, "dpb_max_dec_pic_buffering_minus1[i]"); pcVPS->m_dpbParameters[i].m_maxDecPicBuffering[j] = uiCode + 1; - READ_UVLC( uiCode, "max_num_reorder_pics[i]" ); pcVPS->m_dpbParameters[i].m_numReorderPics[j] = uiCode; - READ_UVLC( uiCode, "max_latency_increase_plus1[i]" ); pcVPS->m_dpbParameters[i].m_maxLatencyIncreasePlus1[j] = uiCode; + READ_UVLC( uiCode, "dpb_max_num_reorder_pics[i]" ); pcVPS->m_dpbParameters[i].m_maxNumReorderPics[j] = uiCode; + READ_UVLC( uiCode, "dpb_max_latency_increase_plus1[i]" ); pcVPS->m_dpbParameters[i].m_maxLatencyIncreasePlus1[j] = uiCode; } for( int j = ( pcVPS->m_sublayerDpbParamsPresentFlag ? pcVPS->m_dpbMaxTemporalId[i] : 0 ); j < pcVPS->m_dpbMaxTemporalId[i]; j++ ) { - // When max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to maxSubLayersMinus1 - 1, inclusive, due to subLayerInfoFlag being equal to 0, it is inferred to be equal to max_dec_pic_buffering_minus1[ maxSubLayersMinus1 ]. + // When dpb_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to maxSubLayersMinus1 - 1, inclusive, due to subLayerInfoFlag being equal to 0, it is inferred to be equal to dpb_max_dec_pic_buffering_minus1[ maxSubLayersMinus1 ]. pcVPS->m_dpbParameters[i].m_maxDecPicBuffering[j] = pcVPS->m_dpbParameters[i].m_maxDecPicBuffering[pcVPS->m_dpbMaxTemporalId[i]]; - // When max_num_reorder_pics[ i ] is not present for i in the range of 0 to maxSubLayersMinus1 - 1, inclusive, due to subLayerInfoFlag being equal to 0, it is inferred to be equal to max_num_reorder_pics[ maxSubLayersMinus1 ]. - pcVPS->m_dpbParameters[i].m_numReorderPics[j] = pcVPS->m_dpbParameters[i].m_numReorderPics[pcVPS->m_dpbMaxTemporalId[i]]; + // When dpb_max_num_reorder_pics[ i ] is not present for i in the range of 0 to maxSubLayersMinus1 - 1, inclusive, due to subLayerInfoFlag being equal to 0, it is inferred to be equal to dpb_max_num_reorder_pics[ maxSubLayersMinus1 ]. + pcVPS->m_dpbParameters[i].m_maxNumReorderPics[j] = pcVPS->m_dpbParameters[i].m_maxNumReorderPics[pcVPS->m_dpbMaxTemporalId[i]]; - // When max_latency_increase_plus1[ i ] is not present for i in the range of 0 to maxSubLayersMinus1 - 1, inclusive, due to subLayerInfoFlag being equal to 0, it is inferred to be equal to max_latency_increase_plus1[ maxSubLayersMinus1 ]. + // When dpb_max_latency_increase_plus1[ i ] is not present for i in the range of 0 to maxSubLayersMinus1 - 1, inclusive, due to subLayerInfoFlag being equal to 0, it is inferred to be equal to dpb_max_latency_increase_plus1[ maxSubLayersMinus1 ]. pcVPS->m_dpbParameters[i].m_maxLatencyIncreasePlus1[j] = pcVPS->m_dpbParameters[i].m_maxLatencyIncreasePlus1[pcVPS->m_dpbMaxTemporalId[i]]; } } diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index 381c231b807d88efc781a1a3a35d6000f1b28715..378e6c6a95edbb190572a88890fdfe3be98e4448 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -298,7 +298,7 @@ protected: int m_numRPLList1; GOPEntry m_GOPList[MAX_GOP]; int m_maxDecPicBuffering[MAX_TLAYER]; - int m_numReorderPics[MAX_TLAYER]; + int m_maxNumReorderPics[MAX_TLAYER]; int m_drapPeriod; int m_iQP; // if (AdaptiveQP == OFF) @@ -1011,7 +1011,7 @@ public: int getRPLCandidateSize(int L01) const { return (L01 == 0) ? m_numRPLList0 : m_numRPLList1; } void setEncodedFlag(uint32_t i, bool value) { m_RPLList0[i].m_isEncoded = value; m_RPLList1[i].m_isEncoded = value; m_GOPList[i].m_isEncoded = value; } void setMaxDecPicBuffering ( uint32_t u, uint32_t tlayer ) { m_maxDecPicBuffering[tlayer] = u; } - void setNumReorderPics ( int i, uint32_t tlayer ) { m_numReorderPics[tlayer] = i; } + void setMaxNumReorderPics ( int i, uint32_t tlayer ) { m_maxNumReorderPics[tlayer] = i; } void setDrapPeriod (int drapPeriod) { m_drapPeriod = drapPeriod; } void setBaseQP ( int i ) { m_iQP = i; } @@ -1364,7 +1364,7 @@ public: bool getReWriteParamSets () const { return m_rewriteParamSets; } int getGOPSize () const { return m_iGOPSize; } int getMaxDecPicBuffering (uint32_t tlayer) { return m_maxDecPicBuffering[tlayer]; } - int getNumReorderPics (uint32_t tlayer) { return m_numReorderPics[tlayer]; } + int getMaxNumReorderPics (uint32_t tlayer) { return m_maxNumReorderPics[tlayer]; } int getDrapPeriod () { return m_drapPeriod; } #if X0038_LAMBDA_FROM_QP_CAPABILITY int getIntraQPOffset () const { return m_intraQPOffset; } diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp index d7a0b9b8ce5acc811fdde1d986c254c6c1c0fa14..d7661f79c32aebcb5341900601932407cf3321e0 100644 --- a/source/Lib/EncoderLib/EncGOP.cpp +++ b/source/Lib/EncoderLib/EncGOP.cpp @@ -1017,7 +1017,7 @@ void EncGOP::xCreatePictureTimingSEI (int IRAPGOPid, SEIMessages& seiMessages, CHECK( (scaledDistToBuffPeriod) > pow(2, static_cast<double>(cpbRemovalDelayLegth)), " cpbRemovalDelayLegth too small for m_auCpbRemovalDelay[i] at picture timing SEI " ); } } - pictureTimingSEI->m_picDpbOutputDelay = slice->getSPS()->getNumReorderPics(slice->getSPS()->getMaxTLayers()-1) + slice->getPOC() - m_totalCoded[maxNumSubLayers-1]; + pictureTimingSEI->m_picDpbOutputDelay = slice->getSPS()->getMaxNumReorderPics(slice->getSPS()->getMaxTLayers()-1) + slice->getPOC() - m_totalCoded[maxNumSubLayers-1]; if(m_pcCfg->getEfficientFieldIRAPEnabled() && IRAPGOPid > 0 && IRAPGOPid < m_iGopSize) { // if pictures have been swapped there is likely one more picture delay on their tid. Very rough approximation diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index e9872b628c63c28816fe6eeb22c2308002b254ae..2d5f26806c8035ce27b2395a20904d2327887b3e 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -1079,19 +1079,19 @@ void EncLib::xInitVPS( const SPS& sps ) 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] = profileLevelTierFeatures.getMaxDpbSize( m_vps->getOlsDpbPicSize( i ).width * m_vps->getOlsDpbPicSize( i ).height ); - m_vps->m_dpbParameters[dpbIdx].m_numReorderPics[j] = m_vps->m_dpbParameters[dpbIdx].m_maxDecPicBuffering[j]; + m_vps->m_dpbParameters[dpbIdx].m_maxNumReorderPics[j] = m_vps->m_dpbParameters[dpbIdx].m_maxDecPicBuffering[j]; m_vps->m_dpbParameters[dpbIdx].m_maxLatencyIncreasePlus1[j] = 0; } for( int j = ( m_vps->m_sublayerDpbParamsPresentFlag ? m_vps->m_dpbMaxTemporalId[dpbIdx] : 0 ); j < m_vps->m_dpbMaxTemporalId[dpbIdx]; j++ ) { - // When max_dec_pic_buffering_minus1[ dpbIdx ] is not present for dpbIdx in the range of 0 to maxSubLayersMinus1 - 1, inclusive, due to subLayerInfoFlag being equal to 0, it is inferred to be equal to max_dec_pic_buffering_minus1[ maxSubLayersMinus1 ]. + // When dpb_max_dec_pic_buffering_minus1[ dpbIdx ] is not present for dpbIdx in the range of 0 to maxSubLayersMinus1 - 1, inclusive, due to subLayerInfoFlag being equal to 0, it is inferred to be equal to dpb_max_dec_pic_buffering_minus1[ maxSubLayersMinus1 ]. m_vps->m_dpbParameters[dpbIdx].m_maxDecPicBuffering[j] = m_vps->m_dpbParameters[dpbIdx].m_maxDecPicBuffering[m_vps->m_dpbMaxTemporalId[dpbIdx]]; - // When max_num_reorder_pics[ dpbIdx ] is not present for dpbIdx in the range of 0 to maxSubLayersMinus1 - 1, inclusive, due to subLayerInfoFlag being equal to 0, it is inferred to be equal to max_num_reorder_pics[ maxSubLayersMinus1 ]. - m_vps->m_dpbParameters[dpbIdx].m_numReorderPics[j] = m_vps->m_dpbParameters[dpbIdx].m_numReorderPics[m_vps->m_dpbMaxTemporalId[dpbIdx]]; + // When dpb_max_num_reorder_pics[ dpbIdx ] is not present for dpbIdx in the range of 0 to maxSubLayersMinus1 - 1, inclusive, due to subLayerInfoFlag being equal to 0, it is inferred to be equal to dpb_max_num_reorder_pics[ maxSubLayersMinus1 ]. + m_vps->m_dpbParameters[dpbIdx].m_maxNumReorderPics[j] = m_vps->m_dpbParameters[dpbIdx].m_maxNumReorderPics[m_vps->m_dpbMaxTemporalId[dpbIdx]]; - // When max_latency_increase_plus1[ dpbIdx ] is not present for dpbIdx in the range of 0 to maxSubLayersMinus1 - 1, inclusive, due to subLayerInfoFlag being equal to 0, it is inferred to be equal to max_latency_increase_plus1[ maxSubLayersMinus1 ]. + // When dpb_max_latency_increase_plus1[ dpbIdx ] is not present for dpbIdx in the range of 0 to maxSubLayersMinus1 - 1, inclusive, due to subLayerInfoFlag being equal to 0, it is inferred to be equal to dpb_max_latency_increase_plus1[ maxSubLayersMinus1 ]. m_vps->m_dpbParameters[dpbIdx].m_maxLatencyIncreasePlus1[j] = m_vps->m_dpbParameters[dpbIdx].m_maxLatencyIncreasePlus1[m_vps->m_dpbMaxTemporalId[dpbIdx]]; } } @@ -1359,7 +1359,7 @@ void EncLib::xInitSPS( SPS& sps ) for (int i = 0; i < std::min(sps.getMaxTLayers(), (uint32_t) MAX_TLAYER); i++ ) { sps.setMaxDecPicBuffering(m_maxDecPicBuffering[i], i); - sps.setNumReorderPics(m_numReorderPics[i], i); + sps.setMaxNumReorderPics(m_maxNumReorderPics[i], i); } sps.setScalingListFlag ( (m_useScalingListId == SCALING_LIST_OFF) ? 0 : 1 ); diff --git a/source/Lib/EncoderLib/SEIEncoder.cpp b/source/Lib/EncoderLib/SEIEncoder.cpp index 7aec5025a849d66b2ff3f3239e772b5e235e23d0..e14d07327f0118f9a27ece6dda702756b2d3d5d4 100644 --- a/source/Lib/EncoderLib/SEIEncoder.cpp +++ b/source/Lib/EncoderLib/SEIEncoder.cpp @@ -191,10 +191,10 @@ void SEIEncoder::initSEIBufferingPeriod(SEIBufferingPeriod *bufferingPeriodSEI, bufferingPeriodSEI->m_sublayerDpbOutputOffsetsPresentFlag = true; for(int i = 0; i < bufferingPeriodSEI->m_bpMaxSubLayers; i++) { - bufferingPeriodSEI->m_dpbOutputTidOffset[i] = m_pcCfg->getNumReorderPics(i) * static_cast<int>(pow(2, static_cast<double>(bufferingPeriodSEI->m_bpMaxSubLayers-1-i))); - if(bufferingPeriodSEI->m_dpbOutputTidOffset[i] >= m_pcCfg->getNumReorderPics(bufferingPeriodSEI->m_bpMaxSubLayers-1)) + bufferingPeriodSEI->m_dpbOutputTidOffset[i] = m_pcCfg->getMaxNumReorderPics(i) * static_cast<int>(pow(2, static_cast<double>(bufferingPeriodSEI->m_bpMaxSubLayers-1-i))); + if(bufferingPeriodSEI->m_dpbOutputTidOffset[i] >= m_pcCfg->getMaxNumReorderPics(bufferingPeriodSEI->m_bpMaxSubLayers-1)) { - bufferingPeriodSEI->m_dpbOutputTidOffset[i] -= m_pcCfg->getNumReorderPics(bufferingPeriodSEI->m_bpMaxSubLayers-1); + bufferingPeriodSEI->m_dpbOutputTidOffset[i] -= m_pcCfg->getMaxNumReorderPics(bufferingPeriodSEI->m_bpMaxSubLayers-1); } else { diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index c3cdb4906bb275ac8256aaf80434519c77c1b40b..1864ccd707f55d314a9f2938e82dda5344bd984d 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -834,10 +834,10 @@ void HLSWriter::dpb_parameters(int maxSubLayersMinus1, bool subLayerInfoFlag, co { for (uint32_t i = (subLayerInfoFlag ? 0 : maxSubLayersMinus1); i <= maxSubLayersMinus1; i++) { - CHECK(pcSPS->getMaxDecPicBuffering(i) < 1, "max_dec_pic_buffering must be greater than 0"); - WRITE_UVLC(pcSPS->getMaxDecPicBuffering(i) - 1, "max_dec_pic_buffering_minus1[i]"); - WRITE_UVLC(pcSPS->getNumReorderPics(i), "max_num_reorder_pics[i]"); - WRITE_UVLC(pcSPS->getMaxLatencyIncreasePlus1(i), "max_latency_increase_plus1[i]"); + CHECK(pcSPS->getMaxDecPicBuffering(i) < 1, "MaxDecPicBuffering must be greater than 0"); + WRITE_UVLC(pcSPS->getMaxDecPicBuffering(i) - 1, "dpb_max_dec_pic_buffering_minus1[i]"); + WRITE_UVLC(pcSPS->getMaxNumReorderPics(i), "dpb_max_num_reorder_pics[i]"); + WRITE_UVLC(pcSPS->getMaxLatencyIncreasePlus1(i), "dpb_max_latency_increase_plus1[i]"); } } @@ -1635,10 +1635,10 @@ void HLSWriter::codeVPS(const VPS* pcVPS) for( int j = ( pcVPS->m_sublayerDpbParamsPresentFlag ? 0 : pcVPS->m_dpbMaxTemporalId[i] ); j <= pcVPS->m_dpbMaxTemporalId[i]; j++ ) { - CHECK(pcVPS->m_dpbParameters[i].m_maxDecPicBuffering[j] < 1, "max_dec_pic_buffering must be greater than 0"); - WRITE_UVLC(pcVPS->m_dpbParameters[i].m_maxDecPicBuffering[j] - 1, "max_dec_pic_buffering_minus1[i]"); - WRITE_UVLC( pcVPS->m_dpbParameters[i].m_numReorderPics[j], "max_num_reorder_pics[i]" ); - WRITE_UVLC( pcVPS->m_dpbParameters[i].m_maxLatencyIncreasePlus1[j], "max_latency_increase_plus1[i]" ); + CHECK(pcVPS->m_dpbParameters[i].m_maxDecPicBuffering[j] < 1, "MaxDecPicBuffering must be greater than 0"); + WRITE_UVLC(pcVPS->m_dpbParameters[i].m_maxDecPicBuffering[j] - 1, "dpb_max_dec_pic_buffering_minus1[i]"); + WRITE_UVLC( pcVPS->m_dpbParameters[i].m_maxNumReorderPics[j], "dpb_max_num_reorder_pics[i]" ); + WRITE_UVLC( pcVPS->m_dpbParameters[i].m_maxLatencyIncreasePlus1[j], "dpb_max_latency_increase_plus1[i]" ); } }