Skip to content
Snippets Groups Projects
Commit 9aff7f24 authored by Frank Bossen's avatar Frank Bossen
Browse files

Merge branch 'fix_s0202' into 'master'

Fix output picture present in bitstream checking (!1794)

See merge request !1898
parents bcfdf228 54a6569a
No related branches found
No related tags found
1 merge request!1898Fix output picture present in bitstream checking (!1794)
Pipeline #5762 failed
...@@ -136,6 +136,21 @@ uint32_t DecApp::decode() ...@@ -136,6 +136,21 @@ uint32_t DecApp::decode()
#if JVET_S0202_AT_LEAST_ONE_OUTPUT_PICTURE #if JVET_S0202_AT_LEAST_ONE_OUTPUT_PICTURE
bool outputPicturePresentInBitstream = false; bool outputPicturePresentInBitstream = false;
auto setOutputPicturePresentInStream = [&]()
{
if( !outputPicturePresentInBitstream )
{
PicList::iterator iterPic = pcListPic->begin();
while (!outputPicturePresentInBitstream && iterPic != pcListPic->end())
{
Picture *pcPic = *(iterPic++);
if (pcPic->neededForOutput)
{
outputPicturePresentInBitstream = true;
}
}
}
};
#endif #endif
while (!!bitstreamFile) while (!!bitstreamFile)
...@@ -308,23 +323,15 @@ uint32_t DecApp::decode() ...@@ -308,23 +323,15 @@ uint32_t DecApp::decode()
if( bNewPicture ) if( bNewPicture )
{ {
#if JVET_S0202_AT_LEAST_ONE_OUTPUT_PICTURE #if JVET_S0202_AT_LEAST_ONE_OUTPUT_PICTURE
if( !outputPicturePresentInBitstream ) setOutputPicturePresentInStream();
{
PicList::iterator iterPic = pcListPic->begin();
while (!outputPicturePresentInBitstream && iterPic != pcListPic->end())
{
Picture *pcPic = *(iterPic);
if( pcPic->neededForOutput )
{
outputPicturePresentInBitstream = true;
}
}
}
#endif #endif
xWriteOutput( pcListPic, nalu.m_temporalId ); xWriteOutput( pcListPic, nalu.m_temporalId );
} }
if (nalu.m_nalUnitType == NAL_UNIT_EOS) if (nalu.m_nalUnitType == NAL_UNIT_EOS)
{ {
#if JVET_S0202_AT_LEAST_ONE_OUTPUT_PICTURE
setOutputPicturePresentInStream();
#endif
xWriteOutput( pcListPic, nalu.m_temporalId ); xWriteOutput( pcListPic, nalu.m_temporalId );
m_cDecLib.setFirstSliceInPicture (false); m_cDecLib.setFirstSliceInPicture (false);
} }
...@@ -332,6 +339,9 @@ uint32_t DecApp::decode() ...@@ -332,6 +339,9 @@ uint32_t DecApp::decode()
if (!bNewPicture && ((nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_IRAP_VCL_12) if (!bNewPicture && ((nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_IRAP_VCL_12)
|| (nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_IDR_W_RADL && nalu.m_nalUnitType <= NAL_UNIT_CODED_SLICE_GDR))) || (nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_IDR_W_RADL && nalu.m_nalUnitType <= NAL_UNIT_CODED_SLICE_GDR)))
{ {
#if JVET_S0202_AT_LEAST_ONE_OUTPUT_PICTURE
setOutputPicturePresentInStream();
#endif
xWriteOutput( pcListPic, nalu.m_temporalId ); xWriteOutput( pcListPic, nalu.m_temporalId );
} }
} }
...@@ -370,18 +380,7 @@ uint32_t DecApp::decode() ...@@ -370,18 +380,7 @@ uint32_t DecApp::decode()
} }
#if JVET_S0202_AT_LEAST_ONE_OUTPUT_PICTURE #if JVET_S0202_AT_LEAST_ONE_OUTPUT_PICTURE
// May need to check again one more time as in case one the bitstream has only one picture, the first check may miss it // May need to check again one more time as in case one the bitstream has only one picture, the first check may miss it
if( !outputPicturePresentInBitstream ) setOutputPicturePresentInStream();
{
PicList::iterator iterPic = pcListPic->begin();
while (!outputPicturePresentInBitstream && iterPic != pcListPic->end())
{
Picture *pcPic = *(iterPic);
if (pcPic->neededForOutput)
{
outputPicturePresentInBitstream = true;
}
}
}
CHECK(!outputPicturePresentInBitstream, "It is required that there shall be at least one picture with PictureOutputFlag equal to 1 in the bitstream") CHECK(!outputPicturePresentInBitstream, "It is required that there shall be at least one picture with PictureOutputFlag equal to 1 in the bitstream")
#endif #endif
......
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