diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 97ab0f5e6151a149c5d8f91f0f4e21927b9c6a80..ee3c377044bfca3255b7a4aa5f7cb5336f846297 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -2519,11 +2519,15 @@ VPS::~VPS() void VPS::deriveOutputLayerSets() { +#if JVET_S0208_ASPECT6 + if( m_vpsEachLayerIsAnOlsFlag || m_vpsOlsModeIdc < 2 ) +#else if( m_maxLayers == 1 ) { m_totalNumOLSs = 1; } else if( m_vpsEachLayerIsAnOlsFlag || m_vpsOlsModeIdc < 2 ) +#endif { m_totalNumOLSs = m_maxLayers; } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index b920e0c03b3e6295707c719b080460b3d5f2ee52..77dca7c22ebd92831f6bb0d649b6519802c43f49 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -56,6 +56,10 @@ #define JVET_R0341_GCI 1 // JVET-R0341: on constraint flag for local chroma QP control +#define JVET_S0208_ASPECT1 1 // JVET-S0208 aspect 1: Remove the extra_sh_bits_struct( ) and extra_ph_bits_struct( ) structures and put their content directly in the SPS. + +#define JVET_S0208_ASPECT6 1 // JVET-S0208 aspect 6: Modify the derivation process for the variable TotalNumOlss by removing unnecessary text. + #define JVET_S0212_BITDEPTH_RANGE 1 // JVET-S0212 aspect 2: Specify a value range of 0..2 for vps_ols_dpb_bitdepth_minus8[ i ]. Also for sps_bitdepth_minus8[ i ] #define JVET_S0047_MINUS1_FOR_VB_POS 1 // JVET-S0047: Add "_minus1" to sps_virtual_boundary_pos_x, sps_virtual_boundary_pos_y, ph_virtual_boundary_pos_x and ph_virtual_boundary_pos_y diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 6a0c80fbae85bc259ddfc22d6a5139211307b7e9..33a25a18884c5519ef8ddf4ebfd51fe904cae4c4 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -1384,6 +1384,7 @@ void HLSyntaxReader::dpb_parameters(int maxSubLayersMinus1, bool subLayerInfoFla } } +#if !JVET_S0208_ASPECT1 void HLSyntaxReader::parseExtraPHBitsStruct( SPS *sps, int numBytes ) { uint32_t symbol; @@ -1413,6 +1414,7 @@ void HLSyntaxReader::parseExtraSHBitsStruct( SPS *sps, int numBytes ) sps->setExtraSHBitPresentFlags(presentFlags); } +#endif void HLSyntaxReader::parseSPS(SPS* pcSPS) { @@ -1730,9 +1732,33 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) // extra bits are for future extensions, we will read, but ignore them, // unless a meaning is specified in the spec READ_CODE(2, uiCode, "sps_num_extra_ph_bytes"); pcSPS->setNumExtraPHBytes(uiCode); +#if JVET_S0208_ASPECT1 + int numExtraPhBytes = uiCode; + std::vector<bool> extraPhBitPresentFlags; + extraPhBitPresentFlags.resize ( 8 * numExtraPhBytes ); + for (int i=0; i < 8*numExtraPhBytes; i++) + { + READ_FLAG(uiCode, "sps_extra_ph_bit_present_flag[ i ]"); + extraPhBitPresentFlags[i] = uiCode; + } + pcSPS->setExtraPHBitPresentFlags(extraPhBitPresentFlags); +#else parseExtraPHBitsStruct( pcSPS, uiCode ); +#endif READ_CODE(2, uiCode, "sps_num_extra_sh_bytes"); pcSPS->setNumExtraSHBytes(uiCode); +#if JVET_S0208_ASPECT1 + int numExtraShBytes = uiCode; + std::vector<bool> extraShBitPresentFlags; + extraShBitPresentFlags.resize ( 8 * numExtraShBytes ); + for (int i=0; i < 8*numExtraShBytes; i++) + { + READ_FLAG(uiCode, "sps_extra_sh_bit_present_flag[ i ]"); + extraShBitPresentFlags[i] = uiCode; + } + pcSPS->setExtraSHBitPresentFlags(extraShBitPresentFlags); +#else parseExtraSHBitsStruct( pcSPS, uiCode ); +#endif if (pcSPS->getPtlDpbHrdParamsPresentFlag()) { diff --git a/source/Lib/DecoderLib/VLCReader.h b/source/Lib/DecoderLib/VLCReader.h index 091749fc79a6e9004e6febb635df6cedad106b6f..001aff92d91221f7efee0beaf1673cf8dbcfe6d3 100644 --- a/source/Lib/DecoderLib/VLCReader.h +++ b/source/Lib/DecoderLib/VLCReader.h @@ -188,8 +188,10 @@ public: void alfFilter( AlfParam& alfParam, const bool isChroma, const int altIdx ); void ccAlfFilter( Slice *pcSlice ); void dpb_parameters(int maxSubLayersMinus1, bool subLayerInfoFlag, SPS *pcSPS); +#if !JVET_S0208_ASPECT1 void parseExtraPHBitsStruct( SPS *sps, int numBytes ); void parseExtraSHBitsStruct( SPS *sps, int numBytes ); +#endif private: protected: diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index cd7abe31103ec258fe61a485092507c1385f26e2..34d6fa228231ab9f419ae1de2f55c6d9a5a0cd37 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -1015,9 +1015,19 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) } // extra bits are for future extensions, so these are currently hard coded to not being sent WRITE_CODE(0, 2, "sps_num_extra_ph_bytes"); +#if JVET_S0208_ASPECT1 + // for( i = 0; i < (sps_num_extra_ph_bytes * 8 ); i++ ) + // sps_extra_ph_bit_present_flag[ i ] +#else // extra_ph_bits_struct( sps_num_extra_ph_bytes ) +#endif WRITE_CODE(0, 2, "sps_num_extra_sh_bytes"); +#if JVET_S0208_ASPECT1 + // for( i = 0; i < (sps_num_extra_sh_bytes * 8 ); i++ ) + // sps_extra_sh_bit_present_flag[ i ] +#else // extra_sh_bits_struct( sps_num_extra_sh_bytes ) +#endif if (pcSPS->getPtlDpbHrdParamsPresentFlag()) {