Skip to content
Snippets Groups Projects
Commit bccd7280 authored by Zhipin Deng's avatar Zhipin Deng
Browse files

JVET-S0158: On the general sub-bitstream extraction process

parent 308b58a3
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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())
{
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment