Commit f09cb277 authored by Frank Bossen's avatar Frank Bossen

Merge branch 'jvet-m0101' into 'master'

JVET-M0101: On VVC HLS

See merge request !388
parents 2b20df8a bcb915cf
Pipeline #1119 passed with stage
......@@ -233,11 +233,16 @@ uint32_t DecApp::decode()
m_cDecLib.setNoOutputPriorPicsFlag (false);
}
if ( bNewPicture &&
#if !JVET_M0101_HLS
( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP ) )
#else
( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP) )
#endif
{
xFlushOutput( pcListPic );
}
......@@ -247,7 +252,11 @@ uint32_t DecApp::decode()
m_cDecLib.setFirstSliceInPicture (false);
}
// write reconstruction to file -- for additional bumping as defined in C.5.2.3
#if !JVET_M0101_HLS
if(!bNewPicture && nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL_N && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL31)
#else
if (!bNewPicture && nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL15)
#endif
{
xWriteOutput( pcListPic, nalu.m_temporalId );
}
......
......@@ -888,6 +888,7 @@ void EncApp::rateStatsAccum(const AccessUnit& au, const std::vector<uint32_t>& a
{
switch ((*it_au)->m_nalUnitType)
{
#if !JVET_M0101_HLS
case NAL_UNIT_CODED_SLICE_TRAIL_R:
case NAL_UNIT_CODED_SLICE_TRAIL_N:
case NAL_UNIT_CODED_SLICE_TSA_R:
......@@ -904,6 +905,15 @@ void EncApp::rateStatsAccum(const AccessUnit& au, const std::vector<uint32_t>& a
case NAL_UNIT_CODED_SLICE_RADL_R:
case NAL_UNIT_CODED_SLICE_RASL_N:
case NAL_UNIT_CODED_SLICE_RASL_R:
#else
case NAL_UNIT_CODED_SLICE_TRAIL:
case NAL_UNIT_CODED_SLICE_STSA:
case NAL_UNIT_CODED_SLICE_IDR_W_RADL:
case NAL_UNIT_CODED_SLICE_IDR_N_LP:
case NAL_UNIT_CODED_SLICE_CRA:
case NAL_UNIT_CODED_SLICE_RADL:
case NAL_UNIT_CODED_SLICE_RASL:
#endif
#if HEVC_VPS
case NAL_UNIT_VPS:
#endif
......
......@@ -102,6 +102,7 @@ const bool verbose = false;
const char * NALU_TYPE[] =
{
#if !JVET_M0101_HLS
"TRAIL_N",
"TRAIL_R",
"TSA_N",
......@@ -150,6 +151,53 @@ const char * NALU_TYPE[] =
"FD_NUT",
"PREFIX_SEI_NUT",
"SUFFIX_SEI_NUT",
#else
"NAL_UNIT_CODED_SLICE_TRAIL",
"NAL_UNIT_CODED_SLICE_STSA",
"NAL_UNIT_CODED_SLICE_RADL",
"NAL_UNIT_CODED_SLICE_RASL",
"NAL_UNIT_RESERVED_VCL_4",
"NAL_UNIT_RESERVED_VCL_5",
"NAL_UNIT_RESERVED_VCL_6",
"NAL_UNIT_RESERVED_VCL_7",
"NAL_UNIT_CODED_SLICE_IDR_W_RADL",
"NAL_UNIT_CODED_SLICE_IDR_N_LP",
"NAL_UNIT_CODED_SLICE_CRA",
"NAL_UNIT_RESERVED_IRAP_VCL11",
"NAL_UNIT_RESERVED_IRAP_VCL12",
"NAL_UNIT_RESERVED_IRAP_VCL13",
"NAL_UNIT_RESERVED_VCL14",
#if HEVC_VPS
"NAL_UNIT_VPS",
#else
"NAL_UNIT_RESERVED_VCL15",
#endif
"NAL_UNIT_RESERVED_NVCL16",
"NAL_UNIT_SPS",
"NAL_UNIT_PPS",
#if JVET_M0132_APS
"NAL_UNIT_APS",
#endif
"NAL_UNIT_ACCESS_UNIT_DELIMITER",
"NAL_UNIT_EOS",
"NAL_UNIT_EOB",
"NAL_UNIT_PREFIX_SEI",
"NAL_UNIT_SUFFIX_SEI",
"NAL_UNIT_FILLER_DATA",
"NAL_UNIT_RESERVED_NVCL26",
"NAL_UNIT_RESERVED_NVCL27",
"NAL_UNIT_UNSPECIFIED_28",
"NAL_UNIT_UNSPECIFIED_29",
"NAL_UNIT_UNSPECIFIED_30",
"NAL_UNIT_UNSPECIFIED_31"
#endif
};
int calc_poc(int iPOClsb, int prevTid0POC, int getBitsForPOC, int nalu_type)
......@@ -171,6 +219,7 @@ int calc_poc(int iPOClsb, int prevTid0POC, int getBitsForPOC, int nalu_type)
{
iPOCmsb = iPrevPOCmsb;
}
#if !JVET_M0101_HLS
if ( nalu_type == NAL_UNIT_CODED_SLICE_BLA_W_LP
|| nalu_type == NAL_UNIT_CODED_SLICE_BLA_W_RADL
|| nalu_type == NAL_UNIT_CODED_SLICE_BLA_N_LP )
......@@ -178,6 +227,7 @@ int calc_poc(int iPOClsb, int prevTid0POC, int getBitsForPOC, int nalu_type)
// For BLA picture types, POCmsb is set to 0.
iPOCmsb = 0;
}
#endif
return iPOCmsb + iPOClsb;
}
......@@ -228,7 +278,11 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
int offset = 16;
offset += 1; //first_slice_segment_in_pic_flag
#if !JVET_M0101_HLS
if (nalu_type >= NAL_UNIT_CODED_SLICE_BLA_W_LP && nalu_type <= NAL_UNIT_RESERVED_IRAP_VCL23)
#else
if (nalu_type >= NAL_UNIT_CODED_SLICE_IDR_W_RADL && nalu_type <= NAL_UNIT_RESERVED_IRAP_VCL13)
#endif
{
offset += 1; //no_output_of_prior_pics_flag
}
......
......@@ -74,6 +74,15 @@ struct NALUnit
/** returns true if the NALunit is a slice NALunit */
bool isSlice()
{
#if JVET_M0101_HLS
return m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL
|| m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA
|| m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
|| m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
|| m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA
|| m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL
|| m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL;
#else
return m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R
|| m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N
|| m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_R
......@@ -90,6 +99,7 @@ struct NALUnit
|| m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R
|| m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N
|| m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R;
#endif
}
bool isSei()
{
......
......@@ -553,7 +553,11 @@ void TileMap::initTileMap( const SPS& sps, const PPS& pps )
// Tile size check
int minWidth = 1;
int minHeight = 1;
#if !JVET_M0101_HLS
const int profileIdc = sps.getPTL()->getGeneralPTL()->getProfileIdc();
#else
const int profileIdc = sps.getProfileTierLevel()->getProfileIdc();
#endif
if ( profileIdc == Profile::MAIN || profileIdc == Profile::MAIN10)
{
if (pps.getTilesEnabledFlag())
......
......@@ -65,6 +65,30 @@ const char* nalUnitTypeToString(NalUnitType type)
{
switch (type)
{
#if JVET_M0101_HLS
case NAL_UNIT_CODED_SLICE_TRAIL: return "TRAIL";
case NAL_UNIT_CODED_SLICE_STSA: return "STSA";
case NAL_UNIT_CODED_SLICE_IDR_W_RADL: return "IDR_W_RADL";
case NAL_UNIT_CODED_SLICE_IDR_N_LP: return "IDR_N_LP";
case NAL_UNIT_CODED_SLICE_CRA: return "CRA";
case NAL_UNIT_CODED_SLICE_RADL: return "RADL";
case NAL_UNIT_CODED_SLICE_RASL: return "RASL";
#if HEVC_VPS
case NAL_UNIT_VPS: return "VPS";
#endif
case NAL_UNIT_SPS: return "SPS";
case NAL_UNIT_PPS: return "PPS";
#if JVET_M0132_APS
case NAL_UNIT_APS: return "APS";
#endif
case NAL_UNIT_ACCESS_UNIT_DELIMITER: return "AUD";
case NAL_UNIT_EOS: return "EOS";
case NAL_UNIT_EOB: return "EOB";
case NAL_UNIT_FILLER_DATA: return "FILLER";
case NAL_UNIT_PREFIX_SEI: return "Prefix SEI";
case NAL_UNIT_SUFFIX_SEI: return "Suffix SEI";
default: return "UNK";
#else
case NAL_UNIT_CODED_SLICE_TRAIL_R: return "TRAIL_R";
case NAL_UNIT_CODED_SLICE_TRAIL_N: return "TRAIL_N";
case NAL_UNIT_CODED_SLICE_TSA_R: return "TSA_R";
......@@ -96,6 +120,7 @@ const char* nalUnitTypeToString(NalUnitType type)
case NAL_UNIT_PREFIX_SEI: return "Prefix SEI";
case NAL_UNIT_SUFFIX_SEI: return "Suffix SEI";
default: return "UNK";
#endif
}
}
......
......@@ -88,7 +88,7 @@ Slice::Slice()
, m_colFromL0Flag ( true )
, m_noOutputPriorPicsFlag ( false )
, m_noRaslOutputFlag ( false )
, m_handleCraAsBlaFlag ( false )
, m_handleCraAsCvsStartFlag ( false )
, m_colRefIdx ( 0 )
, m_maxNumMergeCand ( 0 )
, m_maxNumAffineMergeCand ( 0 )
......@@ -123,7 +123,9 @@ Slice::Slice()
, m_substreamSizes ( )
, m_cabacInitFlag ( false )
, m_bLMvdL1Zero ( false )
#if !JVET_M0101_HLS
, m_temporalLayerNonReferenceFlag ( false )
#endif
, m_LFCrossSliceBoundaryFlag ( false )
, m_enableTMVPFlag ( true )
, m_encCABACTableIdx (I_SLICE)
......@@ -247,10 +249,12 @@ bool Slice::getRapPicFlag() const
{
return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
#if !JVET_M0101_HLS
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA;
#endif
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA;
}
......@@ -660,6 +664,7 @@ void Slice::checkCRA(const ReferencePictureSet *pReferencePictureSet, int& pocCR
pocCRA = getPOC();
associatedIRAPType = getNalUnitType();
}
#if !JVET_M0101_HLS
else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) // BLA picture found
......@@ -667,6 +672,7 @@ void Slice::checkCRA(const ReferencePictureSet *pReferencePictureSet, int& pocCR
pocCRA = getPOC();
associatedIRAPType = getNalUnitType();
}
#endif
}
/** Function for marking the reference pictures when an IDR/CRA/CRANT/BLA/BLANT is encountered.
......@@ -692,11 +698,16 @@ void Slice::decodingRefreshMarking(int& pocCRA, bool& bRefreshPending, PicList&
Picture* rpcPic;
int pocCurr = getPOC();
#if !JVET_M0101_HLS
if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR or BLA picture
#else
if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP) // IDR picture
#endif
{
// mark all pictures as not used for reference
PicList::iterator iterPic = rcListPic.begin();
......@@ -712,12 +723,14 @@ void Slice::decodingRefreshMarking(int& pocCRA, bool& bRefreshPending, PicList&
}
iterPic++;
}
#if !JVET_M0101_HLS
if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
|| getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP )
{
pocCRA = pocCurr;
}
#endif
if (bEfficientFieldIRAPEnabled)
{
bRefreshPending = true;
......@@ -960,25 +973,41 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic) const
if(this->getAssociatedIRAPPOC() > this->getPOC())
{
// Do not check IRAP pictures since they may get a POC lower than their associated IRAP
#if !JVET_M0101_HLS
if(nalUnitType < NAL_UNIT_CODED_SLICE_BLA_W_LP ||
nalUnitType > NAL_UNIT_RESERVED_IRAP_VCL23)
#else
if (nalUnitType < NAL_UNIT_CODED_SLICE_IDR_W_RADL ||
nalUnitType > NAL_UNIT_RESERVED_IRAP_VCL13)
#endif
{
#if !JVET_M0101_HLS
CHECK( nalUnitType != NAL_UNIT_CODED_SLICE_RASL_N &&
nalUnitType != NAL_UNIT_CODED_SLICE_RASL_R &&
nalUnitType != NAL_UNIT_CODED_SLICE_RADL_N &&
nalUnitType != NAL_UNIT_CODED_SLICE_RADL_R, "Invalid NAL unit type");
#else
CHECK(nalUnitType != NAL_UNIT_CODED_SLICE_RASL &&
nalUnitType != NAL_UNIT_CODED_SLICE_RADL, "Invalid NAL unit type");
#endif
}
}
// When a picture is a trailing picture, it shall not be a RADL or RASL picture.
if(this->getAssociatedIRAPPOC() < this->getPOC())
{
#if !JVET_M0101_HLS
CHECK( nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R ||
nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R, "Invalid NAL unit type" );
#else
CHECK(nalUnitType == NAL_UNIT_CODED_SLICE_RASL ||
nalUnitType == NAL_UNIT_CODED_SLICE_RADL, "Invalid NAL unit type");
#endif
}
#if !JVET_M0101_HLS
// No RASL pictures shall be present in the bitstream that are associated
// with a BLA picture having nal_unit_type equal to BLA_W_RADL or BLA_N_LP.
if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
......@@ -987,11 +1016,16 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic) const
CHECK (this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ||
this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_N_LP, "Invalid NAL unit type");
}
#endif
// No RASL pictures shall be present in the bitstream that are associated with
// an IDR picture.
#if !JVET_M0101_HLS
if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
#else
if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL)
#endif
{
CHECK( this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ||
this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL, "Invalid NAL unit type");
......@@ -1000,11 +1034,19 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic) const
// No RADL pictures shall be present in the bitstream that are associated with
// a BLA picture having nal_unit_type equal to BLA_N_LP or that are associated
// with an IDR picture having nal_unit_type equal to IDR_N_LP.
#if !JVET_M0101_HLS
if(nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R)
#else
if (nalUnitType == NAL_UNIT_CODED_SLICE_RADL)
#endif
{
#if !JVET_M0101_HLS
CHECK (this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ||
this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP, "Invalid NAL unit type");
#else
CHECK (this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP, "Invalid NAL unit type");
#endif
}
// loop through all pictures in the reference picture buffer
......@@ -1027,12 +1069,18 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic) const
// (Note that any picture following in output order would be present in the DPB)
if(pcSlice->getPicOutputFlag() == 1 && !this->getNoOutputPriorPicsFlag())
{
#if !JVET_M0101_HLS
if(nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP ||
nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP ||
nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL ||
nalUnitType == NAL_UNIT_CODED_SLICE_CRA ||
nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP ||
nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL)
#else
if (nalUnitType == NAL_UNIT_CODED_SLICE_CRA ||
nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP ||
nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL)
#endif
{
CHECK(pcPic->poc >= this->getPOC(), "Invalid POC");
}
......@@ -1043,8 +1091,12 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic) const
// picture in output order.
if(pcSlice->getPicOutputFlag() == 1)
{
#if !JVET_M0101_HLS
if((nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R))
#else
if (nalUnitType == NAL_UNIT_CODED_SLICE_RADL)
#endif
{
// rpcPic precedes the IRAP in decoding order
if(this->getAssociatedIRAPPOC() > pcSlice->getAssociatedIRAPPOC())
......@@ -1060,10 +1112,15 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic) const
// When a picture is a leading picture, it shall precede, in decoding order,
// all trailing pictures that are associated with the same IRAP picture.
if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
#if !JVET_M0101_HLS
if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R ||
nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R)
#else
if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL ||
nalUnitType == NAL_UNIT_CODED_SLICE_RADL )
#endif
{
if(pcSlice->getAssociatedIRAPPOC() == this->getAssociatedIRAPPOC())
{
......@@ -1075,17 +1132,29 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic) const
// Any RASL picture associated with a CRA or BLA picture shall precede any
// RADL picture associated with the CRA or BLA picture in output order
#if !JVET_M0101_HLS
if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
#else
if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL)
#endif
{
#if !JVET_M0101_HLS
if((this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ||
this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_LP ||
this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ||
this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA) &&
this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA) &&
#else
if ((this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA) &&
#endif
this->getAssociatedIRAPPOC() == pcSlice->getAssociatedIRAPPOC())
{
#if !JVET_M0101_HLS
if(pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N ||
pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R)
#else
if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL)
#endif
{
CHECK( pcPic->poc <= this->getPOC(), "Invalid POC");
}
......@@ -1094,15 +1163,22 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic) const
// Any RASL picture associated with a CRA picture shall follow, in output
// order, any IRAP picture that precedes the CRA picture in decoding order.
#if !JVET_M0101_HLS
if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
#else
if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL)
#endif
{
if(this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA)
{
if(pcSlice->getPOC() < this->getAssociatedIRAPPOC() &&
(pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ||
if(pcSlice->getPOC() < this->getAssociatedIRAPPOC() &&
(
#if !JVET_M0101_HLS
pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ||
pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP ||
pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ||
#endif
pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ||
pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL ||
pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA))
......@@ -1187,15 +1263,19 @@ void Slice::applyReferencePictureSet( PicList& rcListPic, const ReferencePicture
//check that pictures of higher temporal layers are not used
CHECK( pcPic->usedByCurr && !(pcPic->layer<=this->getTLayer()), "Invalid state");
//check that pictures of higher or equal temporal layer are not in the RPS if the current picture is a TSA picture
#if !JVET_M0101_HLS
if( this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_R || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)
{
CHECK( !(pcPic->layer<this->getTLayer()), "Invalid state");
}
#endif
#if !JVET_M0101_HLS
//check that pictures marked as temporal layer non-reference pictures are not used for reference
if( pcPic->poc != this->getPOC() && (pcPic->layer == this->getTLayer()))
{
CHECK( pcPic->usedByCurr && pcPic->slices[0]->getTemporalLayerNonReferenceFlag(), "Invalid state");
}
#endif
}
}
}
......@@ -1726,6 +1806,7 @@ SPSRExt::SPSRExt()
SPS::SPS()
: m_SPSId ( 0)
#if !JVET_M0101_HLS
, m_bIntraOnlyConstraintFlag (false)
, m_maxBitDepthConstraintIdc ( 0)
, m_maxChromaFormatConstraintIdc(CHROMA_420)
......@@ -1758,6 +1839,7 @@ SPS::SPS()
#endif
, m_bNoDepQuantConstraintFlag (false)
, m_bNoSignDataHidingConstraintFlag(false)
#endif
#if JVET_M0246_AFFINE_AMVR
, m_affineAmvrEnabledFlag ( false )
#endif
......@@ -2579,6 +2661,7 @@ void ParameterSetMap<SPS>::setID(SPS* parameterSet, const int psId)
parameterSet->setSPSId(psId);
}
#if !JVET_M0101_HLS
ProfileTierLevel::ProfileTierLevel()
: m_profileSpace (0)
, m_tierFlag (Level::MAIN)
......@@ -2597,6 +2680,16 @@ PTL::PTL()
::memset(m_subLayerProfilePresentFlag, 0, sizeof(m_subLayerProfilePresentFlag));
::memset(m_subLayerLevelPresentFlag, 0, sizeof(m_subLayerLevelPresentFlag ));
}
#else
ProfileTierLevel::ProfileTierLevel()
: m_tierFlag (Level::MAIN)
, m_profileIdc (Profile::NONE)
, m_levelIdc (Level::NONE)
{
::memset(m_subLayerLevelPresentFlag, 0, sizeof(m_subLayerLevelPresentFlag ));
::memset(m_subLayerLevelIdc, Level::NONE, sizeof(m_subLayerLevelIdc ));
}
#endif
void calculateParameterSetChangedFlag(bool &bChanged, const std::vector<uint8_t> *pOldData, const std::vector<uint8_t> *pNewData)
{
......
This diff is collapsed.
......@@ -282,6 +282,8 @@ typedef std::pair<int, int> TrCost;
#define JVET_M0132_APS 1 // APS
#define JVET_M0101_HLS 1 // joint HLS syntax
#define KEEP_PRED_AND_RESI_SIGNALS 0
......@@ -935,6 +937,57 @@ enum PPSExtensionFlagIndex
// effort can be done without use of macros to alter the names used to indicate the different NAL unit types.
enum NalUnitType
{
#if JVET_M0101_HLS
NAL_UNIT_CODED_SLICE_TRAIL = 0, // 0
NAL_UNIT_CODED_SLICE_STSA, // 1
//KJS: keep RADL/RASL since there is no real decision on these types yet
NAL_UNIT_CODED_SLICE_RADL, // 2 should be NAL_UNIT_RESERVED_VCL_2,
NAL_UNIT_CODED_SLICE_RASL, // 3 should be NAL_UNIT_RESERVED_VCL_3,
NAL_UNIT_RESERVED_VCL_4,
NAL_UNIT_RESERVED_VCL_5,
NAL_UNIT_RESERVED_VCL_6,
NAL_UNIT_RESERVED_VCL_7,
NAL_UNIT_CODED_SLICE_IDR_W_RADL, // 8
NAL_UNIT_CODED_SLICE_IDR_N_LP, // 9
NAL_UNIT_CODED_SLICE_CRA, // 10
NAL_UNIT_RESERVED_IRAP_VCL11,
NAL_UNIT_RESERVED_IRAP_VCL12,
NAL_UNIT_RESERVED_IRAP_VCL13,
NAL_UNIT_RESERVED_VCL14,
#if HEVC_VPS
NAL_UNIT_VPS, // probably not coming back
#else
NAL_UNIT_RESERVED_VCL15,
#endif
NAL_UNIT_RESERVED_NVCL16, // probably DPS
NAL_UNIT_SPS, // 17
NAL_UNIT_PPS, // 18
#if JVET_M0132_APS
NAL_UNIT_APS, // 19 NAL unit type number needs to be reaaranged.
#endif
NAL_UNIT_ACCESS_UNIT_DELIMITER, // 20
NAL_UNIT_EOS, // 21
NAL_UNIT_EOB, // 22
NAL_UNIT_PREFIX_SEI, // 23
NAL_UNIT_SUFFIX_SEI, // 24
NAL_UNIT_FILLER_DATA, // 25 keep: may be added with HRD
NAL_UNIT_RESERVED_NVCL26,
NAL_UNIT_RESERVED_NVCL27,
NAL_UNIT_UNSPECIFIED_28,
NAL_UNIT_UNSPECIFIED_29,
NAL_UNIT_UNSPECIFIED_30,
NAL_UNIT_UNSPECIFIED_31,
NAL_UNIT_INVALID,
#else
NAL_UNIT_CODED_SLICE_TRAIL_N = 0, // 0
NAL_UNIT_CODED_SLICE_TRAIL_R, // 1
......@@ -1016,6 +1069,7 @@ enum NalUnitType
NAL_UNIT_UNSPECIFIED_62,
NAL_UNIT_UNSPECIFIED_63,
NAL_UNIT_INVALID,
#endif
};
#if SHARP_LUMA_DELTA_QP
......
......@@ -1001,12 +1001,14 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
#endif
m_apcSlicePilot->setNalUnitType(nalu.m_nalUnitType);
#if !JVET_M0101_HLS
bool nonReferenceFlag = (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N ||
m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N ||
m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N ||