diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 44aa44e3ec759f0f138a27e03a423f42c41b05f5..db84ffc7bd09f81bc4c0b8d00f7e5d62dbaf242e 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -50,6 +50,8 @@ #include <assert.h> #include <cassert> +#define JVET_O0245_VPS_DPS_APS 1 // JVET-O0245: constraints for VPS, DPS, and APS + #define JVET_O0143_BOTTOM_RIGHT_BRICK_IDX_DELTA 1 // JVET-O0143: Remove signaling of top_right_brick_idx #define JVET_O0236_PPS_PARSING_DEPENDENCY 1 // JVET-O0236: Resolves a PPS parsing dependency diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp index 6fefef22ff57d5ddedb723d87a3c1d53ee708df3..8224c3413e90245308255ab562f5046dc2463cbd 100644 --- a/source/Lib/DecoderLib/DecLib.cpp +++ b/source/Lib/DecoderLib/DecLib.cpp @@ -1725,6 +1725,11 @@ void DecLib::xDecodeVPS( InputNALUnit& nalu ) { VPS* vps = new VPS(); m_HLSReader.setBitstream( &nalu.getBitstream() ); + +#if JVET_O0245_VPS_DPS_APS + CHECK( nalu.m_temporalId, "The value of TemporalId of VPS NAL units shall be equal to 0" ); +#endif + m_HLSReader.parseVPS( vps ); delete vps; } @@ -1733,6 +1738,11 @@ void DecLib::xDecodeDPS( InputNALUnit& nalu ) { DPS* dps = new DPS(); m_HLSReader.setBitstream( &nalu.getBitstream() ); + +#if JVET_O0245_VPS_DPS_APS + CHECK( nalu.m_temporalId, "The value of TemporalId of DPS NAL units shall be equal to 0" ); +#endif + m_HLSReader.parseDPS( dps ); m_parameterSetManager.storeDPS( dps, nalu.getBitstream().getFifo() ); } diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp index c3c1348c62af595cede8e2ce8609ecd59cc89655..5a16ae9b397ef77c53b7cf79346e2c89723ff143 100644 --- a/source/Lib/EncoderLib/EncGOP.cpp +++ b/source/Lib/EncoderLib/EncGOP.cpp @@ -313,6 +313,11 @@ int EncGOP::xWriteVPS (AccessUnit &accessUnit, const VPS *vps) { OutputNALUnit nalu(NAL_UNIT_VPS); m_HLSWriter->setBitstream( &nalu.m_Bitstream ); + +#if JVET_O0245_VPS_DPS_APS + CHECK( nalu.m_temporalId, "The value of TemporalId of VPS NAL units shall be equal to 0" ); +#endif + m_HLSWriter->codeVPS( vps ); accessUnit.push_back(new NALUnitEBSP(nalu)); return (int)(accessUnit.back()->m_nalUnitData.str().size()) * 8; @@ -324,6 +329,11 @@ int EncGOP::xWriteDPS (AccessUnit &accessUnit, const DPS *dps) { OutputNALUnit nalu(NAL_UNIT_DPS); m_HLSWriter->setBitstream( &nalu.m_Bitstream ); + +#if JVET_O0245_VPS_DPS_APS + CHECK( nalu.m_temporalId, "The value of TemporalId of DPS NAL units shall be equal to 0" ); +#endif + m_HLSWriter->codeDPS( dps ); accessUnit.push_back(new NALUnitEBSP(nalu)); return (int)(accessUnit.back()->m_nalUnitData.str().size()) * 8;