Commit 91827c4b authored by Zhipin Deng's avatar Zhipin Deng

JVET-R0059 aspect 2: Skip the signalling of the ltrp_in_header_flag[ listIdx...

JVET-R0059 aspect 2: Skip the signalling of the ltrp_in_header_flag[ listIdx ][ rplsIdx ] syntax element when the syntax strucure is directly included in the PH or SH instead of in the SPS
parent 1278fe02
......@@ -338,9 +338,9 @@ void HLSyntaxReader::parseRefPicList(SPS* sps, ReferencePictureList* rpl
rpl->setLtrpInSliceHeaderFlag(code);
}
#if JVET_R0059_RPL_CLEANUP
else
else if(sps->getLongTermRefsPresent())
{
rpl->setLtrpInSliceHeaderFlag(1);
rpl->setLtrpInSliceHeaderFlag( 1 );
}
#endif
......
......@@ -152,7 +152,11 @@ public:
protected:
void copyRefPicList(SPS* pcSPS, ReferencePictureList* source_rpl, ReferencePictureList* dest_rpl);
void parseRefPicList(SPS* pcSPS, ReferencePictureList* rpl);
void parseRefPicList(SPS* pcSPS, ReferencePictureList* rpl
#if JVET_R0059_RPL_CLEANUP
, int rplIdx
#endif
);
public:
void setBitstream ( InputBitstream* p ) { m_pcBitstream = p; }
......
......@@ -5219,7 +5219,11 @@ void EncGOP::xCreateExplicitReferencePictureSetFromReference( Slice* slice, PicL
int numPics = numOfLTRPL0 + numOfSTRPL0;
pLocalRPL0->setNumberOfActivePictures( ( numPics < rpl0->getNumberOfActivePictures() ? numPics : rpl0->getNumberOfActivePictures() ) + numOfILRPL0 );
#if JVET_R0059_RPL_CLEANUP
pLocalRPL0->setLtrpInSliceHeaderFlag( 1 );
#else
pLocalRPL0->setLtrpInSliceHeaderFlag( rpl0->getLtrpInSliceHeaderFlag() );
#endif
slice->setRPL0idx( -1 );
slice->setRPL0( pLocalRPL0 );
......@@ -5263,7 +5267,11 @@ void EncGOP::xCreateExplicitReferencePictureSetFromReference( Slice* slice, PicL
numPics = numOfLTRPL1 + numOfSTRPL1;
pLocalRPL1->setNumberOfActivePictures( ( isDisallowMixedRefPic ? numPics : ( numPics < rpl1->getNumberOfActivePictures() ? numPics : rpl1->getNumberOfActivePictures() ) ) + numOfILRPL1 );
#if JVET_R0059_RPL_CLEANUP
pLocalRPL1->setLtrpInSliceHeaderFlag( 1 );
#else
pLocalRPL1->setLtrpInSliceHeaderFlag( rpl1->getLtrpInSliceHeaderFlag() );
#endif
slice->setRPL1idx( -1 );
slice->setRPL1( pLocalRPL1 );
}
......
......@@ -179,12 +179,20 @@ void AUDWriter::codeAUD(OutputBitstream& bs, const int pictureType)
xWriteRbspTrailingBits();
}
void HLSWriter::xCodeRefPicList( const ReferencePictureList* rpl, bool isLongTermPresent, uint32_t ltLsbBitsCount, const bool isForbiddenZeroDeltaPoc )
void HLSWriter::xCodeRefPicList( const ReferencePictureList* rpl, bool isLongTermPresent, uint32_t ltLsbBitsCount, const bool isForbiddenZeroDeltaPoc
#if JVET_R0059_RPL_CLEANUP
, int rplIdx
#endif
)
{
uint32_t numRefPic = rpl->getNumberOfShorttermPictures() + rpl->getNumberOfLongtermPictures() + rpl->getNumberOfInterLayerPictures();
WRITE_UVLC( numRefPic, "num_ref_entries[ listIdx ][ rplsIdx ]" );
if (isLongTermPresent)
if (isLongTermPresent
#if JVET_R0059_RPL_CLEANUP
&& rplIdx != -1
#endif
)
{
WRITE_FLAG(rpl->getLtrpInSliceHeaderFlag(), "ltrp_in_slice_header_flag[ listIdx ][ rplsIdx ]");
}
......@@ -893,7 +901,11 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
for (int ii = 0; ii < numberOfRPL; ii++)
{
const ReferencePictureList* rpl = rplList0->getReferencePictureList(ii);
xCodeRefPicList( rpl, pcSPS->getLongTermRefsPresent(), pcSPS->getBitsForPOC(), !pcSPS->getUseWP() && !pcSPS->getUseWPBiPred() );
xCodeRefPicList( rpl, pcSPS->getLongTermRefsPresent(), pcSPS->getBitsForPOC(), !pcSPS->getUseWP() && !pcSPS->getUseWPBiPred()
#if JVET_R0059_RPL_CLEANUP
, ii
#endif
);
}
//Write candidate for List1
......@@ -904,7 +916,11 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
for (int ii = 0; ii < numberOfRPL; ii++)
{
const ReferencePictureList* rpl = rplList1->getReferencePictureList(ii);
xCodeRefPicList( rpl, pcSPS->getLongTermRefsPresent(), pcSPS->getBitsForPOC(), !pcSPS->getUseWP() && !pcSPS->getUseWPBiPred() );
xCodeRefPicList( rpl, pcSPS->getLongTermRefsPresent(), pcSPS->getBitsForPOC(), !pcSPS->getUseWP() && !pcSPS->getUseWPBiPred()
#if JVET_R0059_RPL_CLEANUP
, ii
#endif
);
}
}
if( pcSPS->getChromaFormatIdc() != CHROMA_400 )
......@@ -1642,7 +1658,11 @@ void HLSWriter::codePictureHeader( PicHeader* picHeader, bool writeRbspTrailingB
// explicit RPL in picture header
else
{
xCodeRefPicList( picHeader->getRPL(listIdx), sps->getLongTermRefsPresent(), sps->getBitsForPOC(), !sps->getUseWP() && !sps->getUseWPBiPred() );
xCodeRefPicList( picHeader->getRPL(listIdx), sps->getLongTermRefsPresent(), sps->getBitsForPOC(), !sps->getUseWP() && !sps->getUseWPBiPred()
#if JVET_R0059_RPL_CLEANUP
, -1
#endif
);
}
// POC MSB cycle signalling for LTRP
......@@ -2127,7 +2147,11 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
}
else
{ //write local RPL0
xCodeRefPicList( pcSlice->getRPL0(), pcSlice->getSPS()->getLongTermRefsPresent(), pcSlice->getSPS()->getBitsForPOC(), !pcSlice->getSPS()->getUseWP() && !pcSlice->getSPS()->getUseWPBiPred() );
xCodeRefPicList( pcSlice->getRPL0(), pcSlice->getSPS()->getLongTermRefsPresent(), pcSlice->getSPS()->getBitsForPOC(), !pcSlice->getSPS()->getUseWP() && !pcSlice->getSPS()->getUseWPBiPred()
#if JVET_R0059_RPL_CLEANUP
, -1
#endif
);
}
//Deal POC Msb cycle signalling for LTRP
if (pcSlice->getRPL0()->getNumberOfLongtermPictures())
......@@ -2188,7 +2212,11 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
}
else
{ //write local RPL1
xCodeRefPicList( pcSlice->getRPL1(), pcSlice->getSPS()->getLongTermRefsPresent(), pcSlice->getSPS()->getBitsForPOC(), !pcSlice->getSPS()->getUseWP() && !pcSlice->getSPS()->getUseWPBiPred() );
xCodeRefPicList( pcSlice->getRPL1(), pcSlice->getSPS()->getLongTermRefsPresent(), pcSlice->getSPS()->getBitsForPOC(), !pcSlice->getSPS()->getUseWP() && !pcSlice->getSPS()->getUseWPBiPred()
#if JVET_R0059_RPL_CLEANUP
, -1
#endif
);
}
//Deal POC Msb cycle signalling for LTRP
if (pcSlice->getRPL1()->getNumberOfLongtermPictures())
......
......@@ -113,7 +113,11 @@ public:
virtual ~HLSWriter() {}
private:
void xCodeRefPicList( const ReferencePictureList* rpl, bool isLongTermPresent, uint32_t ltLsbBitsCount, const bool isForbiddenZeroDeltaPoc );
void xCodeRefPicList( const ReferencePictureList* rpl, bool isLongTermPresent, uint32_t ltLsbBitsCount, const bool isForbiddenZeroDeltaPoc
#if JVET_R0059_RPL_CLEANUP
, int rplIdx
#endif
);
bool xFindMatchingLTRP ( Slice* pcSlice, uint32_t *ltrpsIndex, int ltrpPOC, bool usedFlag );
void xCodePredWeightTable ( Slice* pcSlice );
void xCodePredWeightTable ( PicHeader *picHeader, const SPS *sps );
......
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