diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index ddbdca7d0b7380f9d0614034dd67407b355c6012..aed01921d0ac3e3e53ce7761020259f2d04bc4cf 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -2606,30 +2606,34 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS) #if JVET_R0099_DPB_HRD_PARAMETERS_SIGNALLING - for (int i = 1; i < pcVPS->m_numMultiLayeredOlss; i++) - { + for( int i = 0, j=0; i < pcVPS->getTotalNumOLSs(); i++ ) #else for( int i = 0; i < pcVPS->getTotalNumOLSs(); i++ ) +#endif { if( pcVPS->m_numLayersInOls[i] > 1 ) { -#endif READ_UVLC( uiCode, "ols_dpb_pic_width[i]" ); pcVPS->setOlsDpbPicWidth( i, uiCode ); READ_UVLC( uiCode, "ols_dpb_pic_height[i]" ); pcVPS->setOlsDpbPicHeight( i, uiCode ); +#if JVET_R0099_DPB_HRD_PARAMETERS_SIGNALLING + if ((pcVPS->m_numDpbParams > 1) && (pcVPS->m_numDpbParams != pcVPS->m_numMultiLayeredOlss)) +#else if( pcVPS->m_numDpbParams > 1 ) +#endif { READ_UVLC( uiCode, "ols_dpb_params_idx[i]" ); pcVPS->setOlsDpbParamsIdx( i, uiCode ); } #if JVET_R0191_ASPECT3 #if JVET_R0099_DPB_HRD_PARAMETERS_SIGNALLING - else if (pcVPS->m_numDpbParams == 0) + else if (pcVPS->m_numDpbParams == 1) { pcVPS->setOlsDpbParamsIdx(i, 0); } else { - pcVPS->setOlsDpbParamsIdx(i, i); + pcVPS->setOlsDpbParamsIdx(i, j); } + j += 1; #else else { @@ -2638,9 +2642,7 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS) #endif isDPBParamReferred[pcVPS->getOlsDpbParamsIdx(i)] = true; #endif -#if !JVET_R0099_DPB_HRD_PARAMETERS_SIGNALLING } -#endif } #if JVET_R0191_ASPECT3 for( int i = 0; i < pcVPS->m_numDpbParams; i++ ) diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index 6fdb1a9a3cc8d8d1e038bbf2d321c2094340c7bf..60eea179df1fd838b6ff70e242380035a5cd9a41 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -1046,8 +1046,13 @@ void EncLib::xInitVPS( const SPS& sps ) { if( std::find( m_vps->m_layerIdInOls[olsIdx].begin(), m_vps->m_layerIdInOls[olsIdx].end(), m_layerId ) != m_vps->m_layerIdInOls[olsIdx].end() ) { +#if JVET_R0099_DPB_HRD_PARAMETERS_SIGNALLING + m_vps->setOlsDpbPicWidth( dpbIdx, std::max<int>(sps.getMaxPicWidthInLumaSamples(), m_vps->getOlsDpbPicSize(dpbIdx).width)); + m_vps->setOlsDpbPicHeight( dpbIdx, std::max<int>(sps.getMaxPicHeightInLumaSamples(), m_vps->getOlsDpbPicSize(dpbIdx).height)); +#else m_vps->setOlsDpbPicWidth( olsIdx, std::max<int>( sps.getMaxPicWidthInLumaSamples(), m_vps->getOlsDpbPicSize( olsIdx ).width ) ); m_vps->setOlsDpbPicHeight( olsIdx, std::max<int>( sps.getMaxPicHeightInLumaSamples(), m_vps->getOlsDpbPicSize( olsIdx ).height ) ); +#endif } m_vps->setOlsDpbParamsIdx( olsIdx, dpbIdx ); diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index e07b734b6e7ce2ceeff2497e28d20b0b1de4abef..58460ac2a860faba23e1f3ee464873fb61ab1f8b 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -1654,7 +1654,7 @@ void HLSWriter::codeVPS(const VPS* pcVPS) } #if JVET_R0099_DPB_HRD_PARAMETERS_SIGNALLING - for( int i = 1; i < pcVPS->m_numMultiLayeredOlss; i++) + for( int i = 0; i < pcVPS->m_numMultiLayeredOlss; i++) { #else for( int i = 0; i < pcVPS->getTotalNumOLSs(); i++ )