diff --git a/source/App/DecoderApp/DecApp.cpp b/source/App/DecoderApp/DecApp.cpp index 629b23511b892ff9d5601b501b3d368b55daa73b..0700e796b3ce4775a922f27154d7569f9b761006 100644 --- a/source/App/DecoderApp/DecApp.cpp +++ b/source/App/DecoderApp/DecApp.cpp @@ -248,7 +248,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_P0363_CLEANUP_NUT_TABLE + if (!bNewPicture && ((nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_IRAP_VCL_12) +#else if (!bNewPicture && ((nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL_15) +#endif || (nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_IDR_W_RADL && nalu.m_nalUnitType <= NAL_UNIT_CODED_SLICE_GDR))) { xWriteOutput( pcListPic, nalu.m_temporalId ); diff --git a/source/App/Parcat/parcat.cpp b/source/App/Parcat/parcat.cpp index 1020c559ce8fbd0f955d4f3acc85d93644dac729..470e4f69693d762e5fc0f3328075d7655bfe54b2 100644 --- a/source/App/Parcat/parcat.cpp +++ b/source/App/Parcat/parcat.cpp @@ -180,6 +180,42 @@ int find_nal_unit(const uint8_t* buf, int size, int* nal_start, int* nal_end) const bool verbose = false; +#if JVET_P0363_CLEANUP_NUT_TABLE +const char * NALU_TYPE[] = +{ + "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_CODED_SLICE_IDR_W_RADL", + "NAL_UNIT_CODED_SLICE_IDR_N_LP", + "NAL_UNIT_CODED_SLICE_CRA", + "NAL_UNIT_CODED_SLICE_GDR", + "NAL_UNIT_RESERVED_IRAP_VCL11", + "NAL_UNIT_RESERVED_IRAP_VCL12", + "NAL_UNIT_DPS", + "NAL_UNIT_VPS", + "NAL_UNIT_SPS", + "NAL_UNIT_PPS", + "NAL_UNIT_APS", + "NAL_UNIT_PH", + "NAL_UNIT_ACCESS_UNIT_DELIMITER", + "NAL_UNIT_EOS", + "NAL_UNIT_EOB", + "NAL_UNIT_PREFIX_SEI", + "NAL_UNIT_SUFFIX_SEI", + "NAL_UNIT_FD", + "NAL_UNIT_RESERVED_NVCL26", + "NAL_UNIT_RESERVED_NVCL27", + "NAL_UNIT_UNSPECIFIED_28", + "NAL_UNIT_UNSPECIFIED_29", + "NAL_UNIT_UNSPECIFIED_30", + "NAL_UNIT_UNSPECIFIED_31" +}; +#else const char * NALU_TYPE[] = { "NAL_UNIT_CODED_SLICE_TRAIL", @@ -215,6 +251,7 @@ const char * NALU_TYPE[] = "NAL_UNIT_UNSPECIFIED_30", "NAL_UNIT_UNSPECIFIED_31" }; +#endif int calc_poc(int iPOClsb, int prevTid0POC, int getBitsForPOC, int nalu_type) { @@ -306,7 +343,11 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int poc = 0; new_poc = *poc_base + poc; } +#if JVET_P0363_CLEANUP_NUT_TABLE + if((nalu_type < NAL_UNIT_CODED_SLICE_IDR_W_RADL) || (nalu_type > NAL_UNIT_CODED_SLICE_IDR_N_LP && nalu_type < NAL_UNIT_RESERVED_IRAP_VCL_12) ) +#else if((nalu_type < 7) || (nalu_type > 9 && nalu_type < 15) ) +#endif { parcatHLSReader.setBitstream( &inp_nalu.getBitstream() ); bool isRapPic = diff --git a/source/Lib/CommonLib/Rom.cpp b/source/Lib/CommonLib/Rom.cpp index 59e5c0d496d1b181ab422f2312374b940f491051..4762f063b9f907880d3691b4aa68a53b9db57f4e 100644 --- a/source/Lib/CommonLib/Rom.cpp +++ b/source/Lib/CommonLib/Rom.cpp @@ -62,6 +62,30 @@ const char* nalUnitTypeToString(NalUnitType type) { switch (type) { +#if JVET_P0363_CLEANUP_NUT_TABLE + case NAL_UNIT_CODED_SLICE_TRAIL: return "TRAIL"; + case NAL_UNIT_CODED_SLICE_STSA: return "STSA"; + case NAL_UNIT_CODED_SLICE_RADL: return "RADL"; + case NAL_UNIT_CODED_SLICE_RASL: return "RASL"; + 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_GDR: return "GDR"; + case NAL_UNIT_DPS: return "DPS"; + case NAL_UNIT_VPS: return "VPS"; + case NAL_UNIT_SPS: return "SPS"; + case NAL_UNIT_PPS: return "PPS"; + case NAL_UNIT_APS: return "APS"; + case NAL_UNIT_PH: return "PH"; + case NAL_UNIT_ACCESS_UNIT_DELIMITER: return "AUD"; + case NAL_UNIT_EOS: return "EOS"; + case NAL_UNIT_EOB: return "EOB"; + case NAL_UNIT_PREFIX_SEI: return "Prefix SEI"; + case NAL_UNIT_SUFFIX_SEI: return "Suffix SEI"; + case NAL_UNIT_FD: return "FD"; + default: return "UNK"; + +#else case NAL_UNIT_PPS: return "PPS"; case NAL_UNIT_ACCESS_UNIT_DELIMITER: return "AUD"; case NAL_UNIT_PREFIX_SEI: return "Prefix SEI"; @@ -81,6 +105,7 @@ const char* nalUnitTypeToString(NalUnitType type) case NAL_UNIT_CODED_SLICE_CRA: return "CRA"; case NAL_UNIT_CODED_SLICE_GDR: return "GDR"; default: return "UNK"; +#endif } } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 7f9d44ca263e9ca06dd0d03581e7fed7d390dab4..06ae1f368dc7fe8052fda404d3779889eaaa5a38 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -49,6 +49,9 @@ #include <cstring> #include <assert.h> #include <cassert> + +#define JVET_P0363_CLEANUP_NUT_TABLE 1 // JVET-P0363: Clean-up of NAL unit type table + #define JVET_P01034_PRED_1D_SCALING_LIST 1 // JVET-P1034: 1D Scaling list index and add predictor mode #define JVET_P0345_LD_GOP_8 1 // JVET-P0345: low-delay gop size 8 @@ -926,6 +929,51 @@ enum PPSExtensionFlagIndex // TODO: Existing names used for the different NAL unit types can be altered to better reflect the names in the spec. // However, the names in the spec are not yet stable at this point. Once the names are stable, a cleanup // effort can be done without use of macros to alter the names used to indicate the different NAL unit types. +#if JVET_P0363_CLEANUP_NUT_TABLE +enum NalUnitType +{ + NAL_UNIT_CODED_SLICE_TRAIL = 0, // 0 + NAL_UNIT_CODED_SLICE_STSA, // 1 + NAL_UNIT_CODED_SLICE_RADL, // 2 + NAL_UNIT_CODED_SLICE_RASL, // 3 + + NAL_UNIT_RESERVED_VCL_4, + NAL_UNIT_RESERVED_VCL_5, + NAL_UNIT_RESERVED_VCL_6, + + NAL_UNIT_CODED_SLICE_IDR_W_RADL, // 7 + NAL_UNIT_CODED_SLICE_IDR_N_LP, // 8 + NAL_UNIT_CODED_SLICE_CRA, // 9 + NAL_UNIT_CODED_SLICE_GDR, // 10 + + NAL_UNIT_RESERVED_IRAP_VCL_11, + NAL_UNIT_RESERVED_IRAP_VCL_12, + + NAL_UNIT_DPS, // 13 + NAL_UNIT_VPS, // 14 + NAL_UNIT_SPS, // 15 + NAL_UNIT_PPS, // 16 + NAL_UNIT_APS, // Todo: Remove this line after prefix and suffix APS have been implemented + //NAL_UNIT_PREFIX_APS, // 17 + //NAL_UNIT_SUFFIX_APS, // 18 + NAL_UNIT_PH, // 19 + 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_FD, // 25 + + NAL_UNIT_RESERVED_NVCL_26, + NAL_UNIT_RESERVED_NVCL_27, + + NAL_UNIT_UNSPECIFIED_28, + NAL_UNIT_UNSPECIFIED_29, + NAL_UNIT_UNSPECIFIED_30, + NAL_UNIT_UNSPECIFIED_31, + NAL_UNIT_INVALID +}; +#else enum NalUnitType { NAL_UNIT_CODED_SLICE_TRAIL = 0, // 0 @@ -969,6 +1017,7 @@ enum NalUnitType NAL_UNIT_UNSPECIFIED_31, NAL_UNIT_INVALID }; +#endif #if SHARP_LUMA_DELTA_QP enum LumaLevelToDQPMode diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp index 051d1d161dfe181542067fcf0d5c8ce93a3159ad..343f33bd056657a9d24763b36f4a5335a9415cc3 100644 --- a/source/Lib/DecoderLib/DecLib.cpp +++ b/source/Lib/DecoderLib/DecLib.cpp @@ -1739,17 +1739,24 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay) case NAL_UNIT_EOB: return false; +#if JVET_P0363_CLEANUP_NUT_TABLE + case NAL_UNIT_RESERVED_IRAP_VCL_11: + case NAL_UNIT_RESERVED_IRAP_VCL_12: +#else case NAL_UNIT_RESERVED_IRAP_VCL_12: case NAL_UNIT_RESERVED_IRAP_VCL_13: case NAL_UNIT_RESERVED_VCL_14: case NAL_UNIT_RESERVED_VCL_15: +#endif msg( NOTICE, "Note: found reserved VCL NAL unit.\n"); xParsePrefixSEIsForUnknownVCLNal(); return false; case NAL_UNIT_RESERVED_VCL_4: case NAL_UNIT_RESERVED_VCL_5: case NAL_UNIT_RESERVED_VCL_6: +#if !JVET_P0363_CLEANUP_NUT_TABLE case NAL_UNIT_RESERVED_VCL_7: +#endif case NAL_UNIT_RESERVED_NVCL_26: case NAL_UNIT_RESERVED_NVCL_27: msg( NOTICE, "Note: found reserved NAL unit.\n");