diff --git a/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp b/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp index 8b3b68720dbf9f5d2695e00dd5347df697019991..372d66412344ff00c62cd5e9bc3cc40585b4ba1e 100644 --- a/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp +++ b/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp @@ -571,6 +571,9 @@ uint32_t BitstreamExtractorApp::decode() } uint32_t numOlss = vps->getTotalNumOLSs(); CHECK(m_targetOlsIdx <0 || m_targetOlsIdx >= numOlss, "target Ols shall be in the range of OLSs specified by the VPS"); +#if JVET_S0158_SUB_BITSTREAM_EXT + CHECK(m_maxTemporalLayer < -1 || m_maxTemporalLayer > vps->getPtlMaxTemporalId(vps->getOlsPtlIdx(m_targetOlsIdx)), "MaxTemporalLayer shall either be equal -1 (for diabled) or in the range of 0 to vps_ptl_max_tid[ vps_ols_ptl_idx[ targetOlsIdx ] ], inclusive"); +#endif std::vector<int> layerIdInOls = vps->getLayerIdsInOls(m_targetOlsIdx); bool isIncludedInTargetOls = std::find(layerIdInOls.begin(), layerIdInOls.end(), nalu.m_nuhLayerId) != layerIdInOls.end(); writeInpuNalUnitToStream &= (isSpecialNalTypes || isIncludedInTargetOls); @@ -743,9 +746,47 @@ uint32_t BitstreamExtractorApp::decode() } writeInpuNalUnitToStream &= targetOlsIdxInNestingAppliedOls; } +#if JVET_S0158_SUB_BITSTREAM_EXT + else + { + int nestingLayerId; + bool nestingAppliedInTargetOlsLayerId = false; + std::vector<int> layerIdInOls = vps->getLayerIdsInOls(m_targetOlsIdx); + if (seiNesting->m_snAllLayersFlag) + { + int nestingNumLayers = vps->getMaxLayers() - vps->getGeneralLayerIdx(nalu.m_nuhLayerId); + for (uint32_t i = 0; i < nestingNumLayers; i++) + { + nestingLayerId = vps->getLayerId(vps->getGeneralLayerIdx(nalu.m_nuhLayerId) + i); + nestingAppliedInTargetOlsLayerId = std::find(layerIdInOls.begin(), layerIdInOls.end(), nestingLayerId) != layerIdInOls.end(); + if (nestingAppliedInTargetOlsLayerId) + { + break; + } + } + } + else + { + for (uint32_t i = 0; i <= seiNesting->m_snNumLayersMinus1; i++) + { + nestingLayerId = i == 0 ? nalu.m_nuhLayerId : seiNesting->m_snLayerId[i]; + nestingAppliedInTargetOlsLayerId = std::find(layerIdInOls.begin(), layerIdInOls.end(), nestingLayerId) != layerIdInOls.end(); + if (nestingAppliedInTargetOlsLayerId) + { + break; + } + } + } + writeInpuNalUnitToStream &= nestingAppliedInTargetOlsLayerId; + } } // remove unqualified timing related SEI + if (sei->payloadType() == SEI::BUFFERING_PERIOD || (m_removeTimingSEI && sei->payloadType() == SEI::PICTURE_TIMING) || sei->payloadType() == SEI::DECODING_UNIT_INFO || sei->payloadType() == SEI::SUBPICTURE_LEVEL_INFO) +#else + } + // remove unqualified timing related SEI if (sei->payloadType() == SEI::BUFFERING_PERIOD || (m_removeTimingSEI && sei->payloadType() == SEI::PICTURE_TIMING ) || sei->payloadType() == SEI::DECODING_UNIT_INFO) +#endif { bool targetOlsIdxGreaterThanZero = m_targetOlsIdx > 0; writeInpuNalUnitToStream &= !targetOlsIdxGreaterThanZero; diff --git a/source/App/BitstreamExtractorApp/BitstreamExtractorAppCfg.cpp b/source/App/BitstreamExtractorApp/BitstreamExtractorAppCfg.cpp index b438884f1bd4c5fc98fc043bc9f01f070daed7f4..6ab60e7033770dd5070bfa153c538ed44565c5d4 100644 --- a/source/App/BitstreamExtractorApp/BitstreamExtractorAppCfg.cpp +++ b/source/App/BitstreamExtractorApp/BitstreamExtractorAppCfg.cpp @@ -120,7 +120,10 @@ namespace po = df::program_options_lite; return false; } } + +#if !JVET_S0158_SUB_BITSTREAM_EXT CHECK(m_maxTemporalLayer < -1 || m_maxTemporalLayer > 6, "MaxTemporalLayer shall either be equal -1 (for diabled) or in the range of 0 to 6, inclusive"); +#endif if (m_bitstreamFileNameIn.empty()) { diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index b4d66160dbc9e06ff32f2d349540089b9ef94539..504d9577a03bb12f8252d3446ef306f9c79e9525 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -164,6 +164,8 @@ #define JVET_S0184_VIRTUAL_BOUNDARY_CONSTRAINT 1 // JVET-S0184: Conformance constraints regarding virtual boundary signalling when subpictures are present +#define JVET_S0158_SUB_BITSTREAM_EXT 1 // JVET-S0158: On the general sub-bitstream extraction process + //########### place macros to be be kept below this line ############### #define JVET_S0257_DUMP_360SEI_MESSAGE 1 // Software support of 360 SEI messages