Commit bcb915cf authored by Karsten Suehring's avatar Karsten Suehring

implement JVET-M0101: On VVC HLS

includes:
- rename flag HandleCraAsBlaFlag to HandleCraAsCvsStartFlag
- changes of NAL unit types (reduced number)
- profile_tier_level and general_constraint_info structures
parent 04aeeec8
......@@ -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
}
}
......
This diff is collapsed.
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 ||
m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N ||
m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N);
m_apcSlicePilot->setTemporalLayerNonReferenceFlag(nonReferenceFlag);
#endif
m_apcSlicePilot->setTLayer(nalu.m_temporalId);
m_HLSReader.setBitstream( &nalu.getBitstream() );
......@@ -1055,9 +1057,14 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
//For inference of NoOutputOfPriorPicsFlag
if (m_apcSlicePilot->getRapPicFlag())
{
#if !JVET_M0101_HLS
if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) ||
(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) ||
(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag()))
(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsCvsStartFlag()))
#else
if ((m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) ||
(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsCvsStartFlag()))
#endif
{
m_apcSlicePilot->setNoRaslOutputFlag(true);
}
......@@ -1090,7 +1097,11 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
}
//For inference of PicOutputFlag
#if !JVET_M0101_HLS
if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R)
#else
if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL)
#endif
{
if ( m_craNoRaslOutputFlag )
{
......@@ -1125,12 +1136,14 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
return false;
}
// Skip TFD pictures associated with BLA/BLANT pictures
#if !JVET_M0101_HLS
if (isSkipPictureForBLA(iPOCLastDisplay))
{
m_prevSliceSkipped = true;
m_skippedPOC = m_apcSlicePilot->getPOC();
return false;
}
#endif
// clear previous slice skipped flag
m_prevSliceSkipped = false;
......@@ -1524,6 +1537,7 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay)
}
return false;
#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:
......@@ -1540,6 +1554,15 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay)
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
ret = xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay);
#if JVET_J0090_MEMORY_BANDWITH_MEASURE
if ( ret )
......@@ -1580,7 +1603,7 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay)
msg( NOTICE, "Note: found NAL_UNIT_FILLER_DATA with %u bytes payload.\n", size);
return false;
}
#if !JVET_M0101_HLS
case NAL_UNIT_RESERVED_VCL_N10:
case NAL_UNIT_RESERVED_VCL_R11:
case NAL_UNIT_RESERVED_VCL_N12:
......@@ -1601,11 +1624,26 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay)
case NAL_UNIT_RESERVED_VCL31:
#if !HEVC_VPS
case NAL_UNIT_RESERVED_32:
#endif
#else
case NAL_UNIT_RESERVED_VCL_4:
case NAL_UNIT_RESERVED_VCL_5:
case NAL_UNIT_RESERVED_VCL_6:
case NAL_UNIT_RESERVED_VCL_7:
case NAL_UNIT_RESERVED_IRAP_VCL11:
case NAL_UNIT_RESERVED_IRAP_VCL12:
case NAL_UNIT_RESERVED_IRAP_VCL13:
case NAL_UNIT_RESERVED_VCL14:
#if !HEVC_VPS
case NAL_UNIT_RESERVED_VCL15:
#endif
#endif
msg( NOTICE, "Note: found reserved VCL NAL unit.\n");
xParsePrefixSEIsForUnknownVCLNal();
return false;
#if !JVET_M0101_HLS
case NAL_UNIT_RESERVED_NVCL41:
case NAL_UNIT_RESERVED_NVCL42:
case NAL_UNIT_RESERVED_NVCL43:
......@@ -1613,8 +1651,14 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay)
case NAL_UNIT_RESERVED_NVCL45:
case NAL_UNIT_RESERVED_NVCL46:
case NAL_UNIT_RESERVED_NVCL47:
#else
case NAL_UNIT_RESERVED_NVCL16:
case NAL_UNIT_RESERVED_NVCL26:
case NAL_UNIT_RESERVED_NVCL27:
#endif
msg( NOTICE, "Note: found reserved NAL unit.\n");
return false;
#if !JVET_M0101_HLS
case NAL_UNIT_UNSPECIFIED_48:
case NAL_UNIT_UNSPECIFIED_49:
case NAL_UNIT_UNSPECIFIED_50:
......@@ -1631,6 +1675,12 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay)
case NAL_UNIT_UNSPECIFIED_61:
case NAL_UNIT_UNSPECIFIED_62:
case NAL_UNIT_UNSPECIFIED_63:
#else
case NAL_UNIT_UNSPECIFIED_28:
case NAL_UNIT_UNSPECIFIED_29:
case NAL_UNIT_UNSPECIFIED_30:
case NAL_UNIT_UNSPECIFIED_31:
#endif
msg( NOTICE, "Note: found unspecified NAL unit.\n");
return false;
default:
......@@ -1641,6 +1691,7 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay)
return false;
}
#if !JVET_M0101_HLS
/** Function for checking if picture should be skipped because of association with a previous BLA picture
* This function skips all TFD pictures that follow a BLA picture in decoding order and precede it in output order.
*/
......@@ -1654,6 +1705,7 @@ bool DecLib::isSkipPictureForBLA( int& iPOCLastDisplay )
}
return false;
}
#endif
/** Function for checking if picture should be skipped because of random access. This function checks the skipping of pictures in the case of -s option random access.
* All pictures prior to the random access point indicated by the counter iSkipFrame are skipped.
......@@ -1673,10 +1725,14 @@ bool DecLib::isRandomAccessSkipPicture( int& iSkipFrame, int& iPOCLastDisplay )
}
else if (m_pocRandomAccess == MAX_INT) // start of random access point, m_pocRandomAccess has not been set yet.
{
#if !JVET_M0101_HLS
if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA
|| m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
|| m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
|| m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL )
#else
if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )
#endif
{
// set the POC random access since we need to skip the reordered pictures in the case of CRA/CRANT/BLA/BLANT.
m_pocRandomAccess = m_apcSlicePilot->getPOC();
......@@ -1696,7 +1752,11 @@ bool DecLib::isRandomAccessSkipPicture( int& iSkipFrame, int& iPOCLastDisplay )
}
}
// skip the reordered pictures, if necessary
#if !JVET_M0101_HLS
else if (m_apcSlicePilot->getPOC() < m_pocRandomAccess && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N))
#else
else if (m_apcSlicePilot->getPOC() < m_pocRandomAccess && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL))
#endif
{
iPOCLastDisplay++;
return true;
......
......@@ -108,8 +108,9 @@ private:
#if JVET_J0090_MEMORY_BANDWITH_MEASURE
CacheModel m_cacheModel;
#endif
#if !JVET_M0101_HLS
bool isSkipPictureForBLA(int& iPOCLastDisplay);
#endif
bool isRandomAccessSkipPicture(int& iSkipFrame, int& iPOCLastDisplay);
Picture* m_pcPic;
uint32_t m_uiSliceSegmentIdx;
......@@ -187,7 +188,11 @@ protected:
#if JVET_M0132_APS
void xDecodeAPS(InputNALUnit& nalu);
#endif
#if !JVET_M0101_HLS
void xUpdatePreviousTid0POC( Slice *pSlice ) { if ((pSlice->getTLayer()==0) && (pSlice->isReferenceNalu() && (pSlice->getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (pSlice->getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) { m_prevTid0POC=pSlice->getPOC(); } }
#else
void xUpdatePreviousTid0POC(Slice *pSlice) { if ((pSlice->getTLayer() == 0) && (pSlice->getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL) && (pSlice->getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL)) { m_prevTid0POC = pSlice->getPOC(); } }
#endif
void xParsePrefixSEImessages();
void xParsePrefixSEIsForUnknownVCLNal();
......
......@@ -141,6 +141,7 @@ void readNalUnitHeader(InputNALUnit& nalu)
if ( nalu.m_temporalId )
{
#if HEVC_VPS
#if !JVET_M0101_HLS
CHECK( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
......@@ -153,6 +154,17 @@ void readNalUnitHeader(InputNALUnit& nalu)
|| nalu.m_nalUnitType == NAL_UNIT_EOB
, "Invalid NAL type" );
#else
CHECK( 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_CRA
|| nalu.m_nalUnitType == NAL_UNIT_VPS
|| nalu.m_nalUnitType == NAL_UNIT_SPS
|| nalu.m_nalUnitType == NAL_UNIT_EOS
|| nalu.m_nalUnitType == NAL_UNIT_EOB
, "Invalid NAL type" );
#endif
#else
#if !JVET_M0101_HLS
CHECK(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
......@@ -163,15 +175,30 @@ void readNalUnitHeader(InputNALUnit& nalu)
|| nalu.m_nalUnitType == NAL_UNIT_EOS
|| nalu.m_nalUnitType == NAL_UNIT_EOB
, "Invalid NAL type");
#else
CHECK(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_CRA
|| nalu.m_nalUnitType == NAL_UNIT_SPS
|| nalu.m_nalUnitType == NAL_UNIT_EOS
|| nalu.m_nalUnitType == NAL_UNIT_EOB
, "Invalid NAL type");
#endif
#endif
}
else
{
#if !JVET_M0101_HLS
CHECK( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_R
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N
, "Invalid NAL type" );
#else
CHECK(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA
, "Invalid NAL type");
#endif
}
}
}
......
......@@ -893,6 +893,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
#if HEVC_VPS
READ_CODE( 4, uiCode, "sps_video_parameter_set_id"); pcSPS->setVPSId ( uiCode );
#endif
#if !JVET_M0101_HLS
READ_UVLC( uiCode, "sps_seq_parameter_set_id" ); pcSPS->setSPSId( uiCode );
CHECK(uiCode > 15, "Invalid SPS id signalled");
......@@ -938,7 +939,17 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
// sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0
CHECK( uiCode != 1, "Invalid maximum number of T-layers" );
}
parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
parsePTL(pcSPS->getPTL(), true, pcSPS->getMaxTLayers() - 1);
#else
READ_CODE(3, uiCode, "sps_max_sub_layers_minus1"); pcSPS->setMaxTLayers (uiCode + 1);
CHECK(uiCode > 6, "Invalid maximum number of T-layer signalled");
READ_CODE(5, uiCode, "sps_reserved_zero_5bits");
CHECK(uiCode != 0, "sps_reserved_zero_5bits not equal to zero");
parseProfileTierLevel(pcSPS->getProfileTierLevel(), pcSPS->getMaxTLayers() - 1);
READ_UVLC(uiCode, "sps_seq_parameter_set_id"); pcSPS->setSPSId(uiCode);
#endif
READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( ChromaFormat(uiCode) );
CHECK(uiCode > 3, "Invalid chroma format signalled");
......@@ -1058,10 +1069,12 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
pcSPS->setMaxBTSize(maxBTSize[1], maxBTSize[0], maxBTSize[2]);
pcSPS->setMaxTTSize(maxTTSize[1], maxTTSize[0], maxTTSize[2]);
#if !JVET_M0101_HLS
if (pcSPS->getPTL()->getGeneralPTL()->getLevelIdc() >= Level::LEVEL5)
{
CHECK(log2MinCUSize + pcSPS->getLog2DiffMaxMinCodingBlockSize() < 5, "Invalid code");
}
#endif
#if MAX_TB_SIZE_SIGNALLING
// KJS: Not in syntax
......@@ -1511,6 +1524,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
{
iPOCmsb = iPrevPOCmsb;
}
#if !JVET_M0101_HLS
if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
|| pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
|| pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP )
......@@ -1518,6 +1532,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
// For BLA picture types, POCmsb is set to 0.
iPOCmsb = 0;
}
#endif
pcSlice->setPOC (iPOCmsb+iPOClsb);
ReferencePictureSet* rps;
......@@ -1633,6 +1648,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
offset += rps->getNumberOfLongtermPictures();
rps->setNumberOfPictures(offset);
}
#if !JVET_M0101_HLS
if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
|| pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
|| pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP )
......@@ -1642,6 +1658,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
(*rps)=ReferencePictureSet();
pcSlice->setRPS(rps);
}
#endif
if (sps->getSPSTemporalMVPEnabledFlag())
{
READ_FLAG( uiCode, "slice_temporal_mvp_enabled_flag" );
......@@ -2119,8 +2136,81 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
return;
}
#if JVET_M0101_HLS
void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo)
{
uint32_t symbol;
READ_FLAG(symbol, "general_progressive_source_flag" ); cinfo->setProgressiveSourceFlag(symbol ? true : false);
READ_FLAG(symbol, "general_interlaced_source_flag" ); cinfo->setInterlacedSourceFlag(symbol ? true : false);
READ_FLAG(symbol, "general_non_packed_constraint_flag" ); cinfo->setNonPackedConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "general_frame_only_constraint_flag" ); cinfo->setFrameOnlyConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "intra_only_constraint_flag" ); cinfo->setIntraOnlyConstraintFlag(symbol ? true : false);
READ_CODE(4, symbol, "max_bitdepth_constraint_idc" ); cinfo->setMaxBitDepthConstraintIdc(symbol);
READ_CODE(2, symbol, "max_chroma_format_constraint_idc" ); cinfo->setMaxChromaFormatConstraintIdc((ChromaFormat)symbol);
READ_FLAG(symbol, "no_qtbtt_dual_tree_intra_constraint_flag" ); cinfo->setNoQtbttDualTreeIntraConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_sao_constraint_flag"); cinfo->setNoSaoConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_alf_constraint_flag"); cinfo->setNoAlfConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_pcm_constraint_flag"); cinfo->setNoPcmConstraintFlag(symbol > 0 ? true : false);
#if JVET_M0451_INTEROPERABILITY_POINT_SYNTAX
READ_FLAG(symbol, "no_ref_wraparound_constraint_flag"); cinfo->setNoRefWraparoundConstraintFlag(symbol > 0 ? true : false);
#endif
READ_FLAG(symbol, "no_temporal_mvp_constraint_flag"); cinfo->setNoTemporalMvpConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_sbtmvp_constraint_flag"); cinfo->setNoSbtmvpConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_amvr_constraint_flag"); cinfo->setNoAmvrConstraintFlag(symbol > 0 ? true : false);
#if JVET_M0451_INTEROPERABILITY_POINT_SYNTAX
READ_FLAG(symbol, "no_bdof_constraint_flag"); cinfo->setNoBdofConstraintFlag(symbol > 0 ? true : false);
#endif
READ_FLAG(symbol, "no_cclm_constraint_flag"); cinfo->setNoCclmConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_mts_constraint_flag"); cinfo->setNoMtsConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_affine_motion_constraint_flag"); cinfo->setNoAffineMotionConstraintFlag(symbol > 0 ? true : false);
#if JVET_M0451_INTEROPERABILITY_POINT_SYNTAX
READ_FLAG(symbol, "no_gbi_constraint_flag"); cinfo->setNoGbiConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_mh_intra_constraint_flag"); cinfo->setNoMhIntraConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_triangle_constraint_flag"); cinfo->setNoTriangleConstraintFlag(symbol > 0 ? true : false);
#endif
READ_FLAG(symbol, "no_ladf_constraint_flag"); cinfo->setNoLadfConstraintFlag(symbol > 0 ? true : false);
#if JVET_M0451_INTEROPERABILITY_POINT_SYNTAX
READ_FLAG(symbol, "no_curr_pic_ref_constraint_flag"); cinfo->setNoCurrPicRefConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_qp_delta_constraint_flag"); cinfo->setNoQpDeltaConstraintFlag(symbol > 0 ? true : false);
#endif
READ_FLAG(symbol, "no_dep_quant_constraint_flag"); cinfo->setNoDepQuantConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_sign_data_hiding_constraint_flag"); cinfo->setNoSignDataHidingConstraintFlag(symbol > 0 ? true : false);
}
void HLSyntaxReader::parseProfileTierLevel(ProfileTierLevel *ptl, int maxNumSubLayersMinus1)
{
uint32_t symbol;
READ_CODE(7 , symbol, "general_profile_idc" ); ptl->setProfileIdc (Profile::Name(symbol));
READ_FLAG( symbol, "general_tier_flag" ); ptl->setTierFlag (symbol ? Level::HIGH :