Commit e91a7518 authored by Hendry's avatar Hendry

Guard all changes under macro JVET_S0078_NOOUTPUTPRIORPICFLAG

parent f63cb8c5
Pipeline #5893 passed with stage
in 14 minutes and 46 seconds
......@@ -434,7 +434,11 @@ uint32_t DecApp::decode()
setOutputPicturePresentInStream();
CHECK(!outputPicturePresentInBitstream, "It is required that there shall be at least one picture with PictureOutputFlag equal to 1 in the bitstream")
#if JVET_S0078_NOOUTPUTPRIORPICFLAG
xFlushOutput( pcListPic, NOT_VALID, false, true );
#else
xFlushOutput( pcListPic );
#endif
// get the number of checksum errors
uint32_t nRet = m_cDecLib.getNumberOfChecksumErrorsDetected();
......@@ -727,7 +731,11 @@ void DecApp::xFlushOutput( PicList* pcListPic, const int layerId )
iterPic++;
pcPicBottom = *(iterPic);
#if JVET_S0078_NOOUTPUTPRIORPICFLAG
if( (pcPicTop->layerId != layerId && layerId != NOT_VALID) || (!isEndOfDecoding && pcPicTop->getPOC() == m_cDecLib.getLatestPicture()->getPOC()) )
#else
if( pcPicTop->layerId != layerId && layerId != NOT_VALID )
#endif
{
continue;
}
......@@ -794,7 +802,11 @@ void DecApp::xFlushOutput( PicList* pcListPic, const int layerId )
{
pcPic = *(iterPic);
#if JVET_S0078_NOOUTPUTPRIORPICFLAG
if( (pcPic->layerId != layerId && layerId != NOT_VALID) || (!isEndOfDecoding && pcPic->getPOC() == m_cDecLib.getLatestPicture()->getPOC()) )
#else
if( pcPic->layerId != layerId && layerId != NOT_VALID )
#endif
{
iterPic++;
continue;
......@@ -861,10 +873,12 @@ void DecApp::xFlushOutput( PicList* pcListPic, const int layerId )
pcListPic->clear();
m_iPOCLastDisplay = -MAX_INT;
#if JVET_S0078_NOOUTPUTPRIORPICFLAG
if( !isEndOfDecoding )
{
pcListPic->push_back(m_cDecLib.getLatestPicture());
}
#endif
}
/** \param nalu Input nalu to check whether its LayerId is within targetDecLayerIdSet
......
......@@ -1089,6 +1089,7 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic, const PPS& pps)
}
const Slice* pcSlice = pcPic->slices[0];
#if JVET_S0078_NOOUTPUTPRIORPICFLAG
if( this->getPicHeader()->getPicOutputFlag() == 1 && pcSlice->m_nuhLayerId == this->m_nuhLayerId && (this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA ) )
{
if( (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL) && !pcSlice->getPPS()->getMixedNaluTypesInPicFlag())
......@@ -1097,6 +1098,16 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic, const PPS& pps)
"equal to layerId in decoding order shall precede the IRAP picture in output order.");
}
}
#else
if( pcSlice->getPicHeader()->getPicOutputFlag() == 1 && !this->getNoOutputOfPriorPicsFlag() && pcPic->layerId == this->m_nuhLayerId )
{
if( (nalUnitType == NAL_UNIT_CODED_SLICE_CRA || nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP || nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL) && !pps.getMixedNaluTypesInPicFlag() )
{
CHECK(pcPic->poc >= this->getPOC(), "Any picture, with nuh_layer_id equal to a particular value layerId, that precedes an IRAP picture with nuh_layer_id "
"equal to layerId in decoding order shall precede the IRAP picture in output order.");
}
}
#endif
if (pcSlice->getPicHeader()->getPicOutputFlag() == 1 && pcPic->layerId == this->m_nuhLayerId)
{
......@@ -1241,6 +1252,7 @@ void Slice::checkSubpicTypeConstraints(PicList& rcListPic, const ReferencePictur
}
}
#if JVET_S0078_NOOUTPUTPRIORPICFLAG
if (isBufPicOutput == 1 && bufPic->layerId == m_nuhLayerId && (this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA) )
{
if( (bufSubpicType == NAL_UNIT_CODED_SLICE_CRA || bufSubpicType == NAL_UNIT_CODED_SLICE_IDR_N_LP || bufSubpicType == NAL_UNIT_CODED_SLICE_IDR_W_RADL) && !bufPic->slices[0]->getPPS()->getMixedNaluTypesInPicFlag())
......@@ -1248,6 +1260,15 @@ void Slice::checkSubpicTypeConstraints(PicList& rcListPic, const ReferencePictur
CHECK(bufPic->poc >= this->getPOC(), "Any subpicture, with nuh_layer_id equal to a particular value layerId and subpicture index equal to a particular value subpicIdx, that precedes, in decoding order, an IRAP subpicture with nuh_layer_id equal to layerId and subpicture index equal to subpicIdx shall precede, in output order, the IRAP subpicture");
}
}
#else
if( (nalUnitType == NAL_UNIT_CODED_SLICE_CRA || nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP || nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL) &&
!this->getNoOutputOfPriorPicsFlag() && isBufPicOutput == 1 && bufPic->layerId == m_nuhLayerId )
{
CHECK(bufPic->poc >= getPOC(), "Any subpicture, with nuh_layer_id equal to a particular value layerId and subpicture index equal to a particular value subpicIdx, that "
"precedes, in decoding order, an IRAP subpicture with nuh_layer_id equal to layerId and subpicture index equal to subpicIdx shall precede, in output order, the "
"IRAP subpicture");
}
#endif
if (nalUnitType == NAL_UNIT_CODED_SLICE_RADL && isBufPicOutput == 1 && bufPic->layerId == m_nuhLayerId &&
prevIRAPSubpicPOC > bufSubpicPrevIRAPSubpicPOC && prevIRAPSubpicPOC != bufPic->poc)
......
......@@ -2118,17 +2118,16 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
DTRACE_UPDATE( g_trace_ctx, std::make_pair( "poc", m_apcSlicePilot->getPOC() ) );
//This should be removed since this is not needed. Even before implementation of JVET-S0078, this codes never has effect since xFlushOutput has been called before this codes are executed.
/*
#if !JVET_S0078_NOOUTPUTPRIORPICFLAG //This code is not actually not needed since it is called after xFlushOutput has been called
if ((m_bFirstSliceInPicture ||
m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ||
m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_GDR) &&
getNoOutputPriorPicsFlag())
{
{
checkNoOutputPriorPics(&m_cListPic);
setNoOutputPriorPicsFlag (false);
}
*/
}
#endif
xUpdatePreviousTid0POC(m_apcSlicePilot);
m_apcSlicePilot->setPrevGDRInSameLayerPOC(m_prevGDRInSameLayerPOC[nalu.m_nuhLayerId]);
......@@ -2138,7 +2137,9 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
if( m_apcSlicePilot->getRapPicFlag() || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_GDR )
{
// Derive NoOutputBeforeRecoveryFlag
#if JVET_S0078_NOOUTPUTPRIORPICFLAG
m_picHeader.setNoOutputBeforeRecoveryFlag(false);
#endif
if( !pps->getMixedNaluTypesInPicFlag() )
{
if( m_firstSliceInSequence[nalu.m_nuhLayerId] )
......@@ -2164,6 +2165,12 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
{
m_apcSlicePilot->setNoOutputOfPriorPicsFlag(true);
}
#if !JVET_S0078_NOOUTPUTPRIORPICFLAG
else
{
m_apcSlicePilot->setNoOutputOfPriorPicsFlag(false);
}
#endif
if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_GDR)
{
......
......@@ -220,7 +220,9 @@ public:
bool decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay, int iTargetOlsIdx);
void deletePicBuffer();
#if JVET_S0078_NOOUTPUTPRIORPICFLAG
Picture *getLatestPicture() { return m_pcPic; }
#endif
void executeLoopFilters();
void finishPicture(int &poc, PicList *&rpcListPic, MsgLevel msgl = INFO, bool associatedWithNewClvs = false);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment