From f96510b7376c891b0ac10ca8a304ddb4f0d10e63 Mon Sep 17 00:00:00 2001
From: Vadim Seregin <vseregin@qti.qualcomm.com>
Date: Fri, 7 Feb 2020 08:29:42 -0800
Subject: [PATCH 1/2] add GDR NUT to CLVSS PU

---
 source/Lib/CommonLib/Slice.h     | 3 +++
 source/Lib/DecoderLib/DecLib.cpp | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h
index 374d6be311..4d0f4aac33 100644
--- a/source/Lib/CommonLib/Slice.h
+++ b/source/Lib/CommonLib/Slice.h
@@ -2733,6 +2733,9 @@ public:
   bool                        getRapPicFlag() const;
   bool                        getIdrPicFlag() const                                  { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
   bool                        isIRAP() const { return (getNalUnitType() >= NAL_UNIT_CODED_SLICE_IDR_W_RADL) && (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA); }
+#if SPS_ID_CHECK
+  bool                        isClvssPu( const bool mixedNaluTypesInPicFlag ) const  { return m_eNalUnitType >= NAL_UNIT_CODED_SLICE_IDR_W_RADL && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_GDR && !mixedNaluTypesInPicFlag; }
+#endif
   bool                        isIDRorBLA() const { return (getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL) || (getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP); }
   void                        checkCRA(const ReferencePictureList *pRPL0, const ReferencePictureList *pRPL1, int& pocCRA, NalUnitType& associatedIRAPType, PicList& rcListPic);
   void                        checkSTSA(PicList& rcListPic);
diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp
index 2fc546880a..2bbf5b6c33 100644
--- a/source/Lib/DecoderLib/DecLib.cpp
+++ b/source/Lib/DecoderLib/DecLib.cpp
@@ -1254,7 +1254,7 @@ void DecLib::xActivateParameterSets( const int layerId )
 #if SPS_ID_CHECK
   static std::unordered_map<int, int> m_clvssSPSid;
 
-  if( slice->isIRAP() && m_bFirstSliceInPicture && !pps->getMixedNaluTypesInPicFlag() )
+  if( slice->isClvssPu( pps->getMixedNaluTypesInPicFlag() ) && m_bFirstSliceInPicture )
   {
     m_clvssSPSid[layerId] = pps->getSPSId();
   }
-- 
GitLab


From 8ad92612ef44df13125eb266cba8111ed759fd28 Mon Sep 17 00:00:00 2001
From: Vadim Seregin <vseregin@qti.qualcomm.com>
Date: Fri, 7 Feb 2020 08:36:43 -0800
Subject: [PATCH 2/2] clean up

---
 source/Lib/CommonLib/Slice.h     | 2 +-
 source/Lib/DecoderLib/DecLib.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h
index 4d0f4aac33..810e0a32d3 100644
--- a/source/Lib/CommonLib/Slice.h
+++ b/source/Lib/CommonLib/Slice.h
@@ -2734,7 +2734,7 @@ public:
   bool                        getIdrPicFlag() const                                  { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
   bool                        isIRAP() const { return (getNalUnitType() >= NAL_UNIT_CODED_SLICE_IDR_W_RADL) && (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA); }
 #if SPS_ID_CHECK
-  bool                        isClvssPu( const bool mixedNaluTypesInPicFlag ) const  { return m_eNalUnitType >= NAL_UNIT_CODED_SLICE_IDR_W_RADL && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_GDR && !mixedNaluTypesInPicFlag; }
+  bool                        isClvssPu() const                                      { return m_eNalUnitType >= NAL_UNIT_CODED_SLICE_IDR_W_RADL && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_GDR && !m_pcPPS->getMixedNaluTypesInPicFlag(); }
 #endif
   bool                        isIDRorBLA() const { return (getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL) || (getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP); }
   void                        checkCRA(const ReferencePictureList *pRPL0, const ReferencePictureList *pRPL1, int& pocCRA, NalUnitType& associatedIRAPType, PicList& rcListPic);
diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp
index 2bbf5b6c33..4a304faa41 100644
--- a/source/Lib/DecoderLib/DecLib.cpp
+++ b/source/Lib/DecoderLib/DecLib.cpp
@@ -1254,7 +1254,7 @@ void DecLib::xActivateParameterSets( const int layerId )
 #if SPS_ID_CHECK
   static std::unordered_map<int, int> m_clvssSPSid;
 
-  if( slice->isClvssPu( pps->getMixedNaluTypesInPicFlag() ) && m_bFirstSliceInPicture )
+  if( slice->isClvssPu() && m_bFirstSliceInPicture )
   {
     m_clvssSPSid[layerId] = pps->getSPSId();
   }
-- 
GitLab