Commit 167cd192 authored by Frank Bossen's avatar Frank Bossen

Merge branch 'JVET-R0270-Rebased' into 'master'

JVET-R0270: Handling PictureOutputFlag for RASL picture

See merge request !1793
parents 6bf23e4f af7f756c
......@@ -59,6 +59,12 @@
DecApp::DecApp()
: m_iPOCLastDisplay(-MAX_INT)
{
#if JVET_R0270
for (int i = 0; i < MAX_NUM_LAYER_IDS; i++)
{
m_newCLVS[i] = true;
}
#endif
}
// ====================================================================================================================
......@@ -161,8 +167,19 @@ uint32_t DecApp::decode()
(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL ||
nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP))
{
#if JVET_R0270
m_newCLVS[nalu.m_nuhLayerId] = true; // An IDR picture starts a new CLVS
#endif
xFlushOutput(pcListPic, nalu.m_nuhLayerId);
}
#if JVET_R0270
if (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA)
{
// Once the picture has TRAIL or or STSA slice, no more special treatment for new CLVS picture for the rest of
// pictures until new CLVS picture is received.
m_newCLVS[nalu.m_nuhLayerId] = false;
}
#endif
// parse NAL unit syntax if within target decoding layer
if( ( m_iMaxTemporalLayer < 0 || nalu.m_temporalId <= m_iMaxTemporalLayer ) && xIsNaluWithinTargetDecLayerIdSet( &nalu ) )
......@@ -203,6 +220,9 @@ uint32_t DecApp::decode()
if (nalu.m_nalUnitType == NAL_UNIT_EOS)
{
isEosPresentInPu = true;
#if JVET_R0270
m_newCLVS[nalu.m_nuhLayerId] = true; //The presence of EOS means that the next picture is the beginning of new CLVS
#endif
}
// within the current PU, only EOS and EOB are allowed to be sent after an EOS nal unit
if(isEosPresentInPu)
......@@ -217,7 +237,11 @@ uint32_t DecApp::decode()
if (!loopFiltered[nalu.m_nuhLayerId] || bitstreamFile)
{
m_cDecLib.executeLoopFilters();
#if JVET_R0270
m_cDecLib.finishPicture(poc, pcListPic, INFO, m_newCLVS[nalu.m_nuhLayerId]);
#else
m_cDecLib.finishPicture( poc, pcListPic );
#endif
}
loopFiltered[nalu.m_nuhLayerId] = (nalu.m_nalUnitType == NAL_UNIT_EOS);
if (nalu.m_nalUnitType == NAL_UNIT_EOS)
......
......@@ -68,6 +68,9 @@ private:
std::ofstream m_oplFileStream; ///< Used to output log file for confomance testing
#if JVET_R0270
bool m_newCLVS[MAX_NUM_LAYER_IDS]; ///< used to record a new CLVSS
#endif
private:
......
......@@ -52,6 +52,8 @@
//########### place macros to be removed in next cycle below this line ###############
#define JVET_R0270 1 // JVET-S0270: Treating picture with mixed RASL and RADL slices as RASL picture
#define JVET_S0081_NON_REFERENCED_PIC 1 // JVET-S0081: exclude non-referenced picture to be used as prevTid0 picture
#define JVET_R0433 1 // JVET-R0433: APS signaling and semantics cleanup
......
......@@ -691,7 +691,11 @@ void DecLib::finishPictureLight(int& poc, PicList*& rpcListPic )
m_puCounter++;
}
#if JVET_R0270
void DecLib::finishPicture(int &poc, PicList *&rpcListPic, MsgLevel msgl, bool associatedWithNewClvs)
#else
void DecLib::finishPicture(int& poc, PicList*& rpcListPic, MsgLevel msgl )
#endif
{
#if RExt__DECODER_DEBUG_TOOL_STATISTICS
CodingStatistics::StatTool& s = CodingStatistics::GetStatisticTool( STATS__TOOL_TOTAL_FRAME );
......@@ -775,6 +779,30 @@ void DecLib::finishPicture(int& poc, PicList*& rpcListPic, MsgLevel msgl )
#endif
m_pcPic->neededForOutput = (pcSlice->getPicHeader()->getPicOutputFlag() ? true : false);
#if JVET_R0270
if (associatedWithNewClvs && m_pcPic->neededForOutput)
{
if (!pcSlice->getPPS()->getMixedNaluTypesInPicFlag() && pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL)
{
m_pcPic->neededForOutput = false;
}
else if (pcSlice->getPPS()->getMixedNaluTypesInPicFlag())
{
bool isRaslPic = true;
for (int i = 0; isRaslPic && i < m_pcPic->numSlices; i++)
{
if (!(pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL))
{
isRaslPic = false;
}
}
if (isRaslPic)
{
m_pcPic->neededForOutput = false;
}
}
}
#endif
m_pcPic->reconstructed = true;
......@@ -2256,6 +2284,9 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
m_firstSliceInBitstream = false;
Slice* pcSlice = m_pcPic->slices[m_uiSliceSegmentIdx];
#if JVET_R0270
m_pcPic->numSlices = m_uiSliceSegmentIdx + 1;
#endif
pcSlice->setPic( m_pcPic );
m_pcPic->poc = pcSlice->getPOC();
m_pcPic->referenced = true;
......
......@@ -216,7 +216,11 @@ public:
void deletePicBuffer();
void executeLoopFilters();
void finishPicture(int& poc, PicList*& rpcListPic, MsgLevel msgl = INFO);
#if JVET_R0270
void finishPicture(int &poc, PicList *&rpcListPic, MsgLevel msgl = INFO, bool associatedWithNewClvs = false);
#else
void finishPicture(int &poc, PicList *&rpcListPic, MsgLevel msgl = INFO);
#endif
void finishPictureLight(int& poc, PicList*& rpcListPic );
void checkNoOutputPriorPics (PicList* rpcListPic);
void checkNalUnitConstraints( uint32_t naluType );
......
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