diff --git a/source/Lib/CommonLib/SEI.cpp b/source/Lib/CommonLib/SEI.cpp index 3f8fc78bc3dd150a9525720c2888e6d7f50c3ac7..b467b2bb79c2c1abecd9dd0575d90c11c511d796 100644 --- a/source/Lib/CommonLib/SEI.cpp +++ b/source/Lib/CommonLib/SEI.cpp @@ -834,7 +834,7 @@ SEIMasteringDisplayColourVolume::SEIMasteringDisplayColourVolume(const SEIMaster SEIScalableNesting::SEIScalableNesting(const SEIScalableNesting& sei) { olsIdx = sei.olsIdx; - m_snAllLayersFlag = sei.m_snAllLayersFlag; + allLayersFlag = sei.allLayersFlag; m_snNumLayersMinus1 = sei.m_snNumLayersMinus1; std::memcpy(m_snLayerId, sei.m_snLayerId, sizeof(sei.m_snLayerId)); subpicIdLen = sei.subpicIdLen; diff --git a/source/Lib/CommonLib/SEI.h b/source/Lib/CommonLib/SEI.h index 34821e88788116ac5e08d65ef3fd384184851d23..b570341e2ecd70f239e046b2536afe82490981d7 100644 --- a/source/Lib/CommonLib/SEI.h +++ b/source/Lib/CommonLib/SEI.h @@ -894,7 +894,7 @@ class SEIScalableNesting : public SEI public: PayloadType payloadType() const { return PayloadType::SCALABLE_NESTING; } - SEIScalableNesting() : m_snAllLayersFlag(false), m_snNumLayersMinus1(0) + SEIScalableNesting() : m_snNumLayersMinus1(0) { olsIdx.clear(); subpicId.clear(); @@ -910,7 +910,7 @@ public: std::vector<uint16_t> subpicId; - bool m_snAllLayersFlag; //value valid if m_nestingOlsFlag == 0 + bool allLayersFlag = false; // value valid if m_nestingOlsFlag == 0 uint32_t m_snNumLayersMinus1; //value valid if m_nestingOlsFlag == 0 and m_nestingAllLayersFlag == 0 uint8_t m_snLayerId[MAX_NESTING_NUM_LAYER]; // value valid if m_nestingOlsFlag == 0 and m_nestingAllLayersFlag == 0. // This can e.g. be a static array of 64 uint8_t values diff --git a/source/Lib/DecoderLib/SEIread.cpp b/source/Lib/DecoderLib/SEIread.cpp index 0dbcd945bfdb6471b73a51eefae0631a8fcd4768..8360e98cfe8fba6b659626de953e5ab14144fbfa 100644 --- a/source/Lib/DecoderLib/SEIread.cpp +++ b/source/Lib/DecoderLib/SEIread.cpp @@ -992,8 +992,9 @@ void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitT } else { - sei_read_flag(decodedMessageOutputStream, symbol, "sn_all_layers_flag"); sei.m_snAllLayersFlag = symbol; - if (!sei.m_snAllLayersFlag) + sei_read_flag(decodedMessageOutputStream, symbol, "sn_all_layers_flag"); + sei.allLayersFlag = symbol != 0; + if (!sei.allLayersFlag) { sei_read_uvlc(decodedMessageOutputStream, symbol, "sn_num_layers_minus1"); sei.m_snNumLayersMinus1 = symbol; sei.m_snLayerId[0] = nuhLayerId; @@ -1251,8 +1252,9 @@ void SEIReader::xParseSEIScalableNestingBinary(SEIScalableNesting &sei, const Na } else { - sei_read_flag(decodedMessageOutputStream, symbol, "sn_all_layers_flag"); sei.m_snAllLayersFlag = symbol; - if (!sei.m_snAllLayersFlag) + sei_read_flag(decodedMessageOutputStream, symbol, "sn_all_layers_flag"); + sei.allLayersFlag = symbol != 0; + if (!sei.allLayersFlag) { sei_read_uvlc(decodedMessageOutputStream, symbol, "sn_num_layers_minus1"); sei.m_snNumLayersMinus1 = symbol; sei.m_snLayerId[0] = nuhLayerId; @@ -1358,7 +1360,7 @@ void SEIReader::xParseSEIScalableNestingBinary(SEIScalableNesting &sei, const Na } } } - else if (sei.m_snAllLayersFlag) + else if (sei.allLayersFlag) { for (uint32_t k = 0; k < numSubPics; k++) { diff --git a/source/Lib/EncoderLib/SEIEncoder.cpp b/source/Lib/EncoderLib/SEIEncoder.cpp index fe28d2a81df3aee18afeb4c9bcdcffceb62d91f4..9581bf39645070eb3a15d01f170a758fae064f7e 100644 --- a/source/Lib/EncoderLib/SEIEncoder.cpp +++ b/source/Lib/EncoderLib/SEIEncoder.cpp @@ -476,7 +476,7 @@ void SEIEncoder::initSEIScalableNesting(SEIScalableNesting *scalableNestingSEI, } else { - scalableNestingSEI->m_snAllLayersFlag = 0; // nesting is not applied to all layers + scalableNestingSEI->allLayersFlag = false; // nesting is not applied to all layers scalableNestingSEI->m_snNumLayersMinus1 = (uint32_t) targetLayers.size() - 1; //nesting_num_layers_minus1 for (int i=0; i <= scalableNestingSEI->m_snNumLayersMinus1; i++ ) { diff --git a/source/Lib/EncoderLib/SEIwrite.cpp b/source/Lib/EncoderLib/SEIwrite.cpp index 31fa9f836740256b082742b6054151a272f1e8ae..bea5c07092f06cedc6f7ef4f603c3868d45d178d 100644 --- a/source/Lib/EncoderLib/SEIwrite.cpp +++ b/source/Lib/EncoderLib/SEIwrite.cpp @@ -628,8 +628,8 @@ void SEIWriter::xWriteSEIScalableNesting(OutputBitstream& bs, const SEIScalableN } else { - xWriteFlag(sei.m_snAllLayersFlag, "sn_all_layers_flag"); - if (!sei.m_snAllLayersFlag) + xWriteFlag(sei.allLayersFlag ? 1 : 0, "sn_all_layers_flag"); + if (!sei.allLayersFlag) { xWriteUvlc(sei.m_snNumLayersMinus1, "sn_num_layers_minus1"); for (uint32_t i = 1; i <= sei.m_snNumLayersMinus1; i++)