Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 833)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 834)
@@ -47,4 +47,6 @@
 #if SVC_EXTENSION
 ParameterSetMap<TComVPS> ParameterSetManager::m_vpsMap(MAX_NUM_VPS);
+ParameterSetMap<TComSPS> ParameterSetManager::m_spsMap(MAX_NUM_SPS);
+ParameterSetMap<TComPPS> ParameterSetManager::m_ppsMap(MAX_NUM_PPS);
 Int ParameterSetManager::m_activeVPSId = -1;
 #endif
@@ -3679,7 +3681,5 @@
 ParameterSetManager::ParameterSetManager()
 #if SVC_EXTENSION
-: m_spsMap(MAX_NUM_SPS)
-, m_ppsMap(MAX_NUM_PPS)
-, m_activeSPSId(-1)
+: m_activeSPSId(-1)
 , m_activePPSId(-1)
 #else
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 833)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 834)
@@ -2514,7 +2514,4 @@
     if ( m_paramsetMap.find(psId) != m_paramsetMap.end() )
     {
-#if Q0078_ADD_LAYER_SETS
-      m_paramsetMap.erase(psId);
-#endif
       delete m_paramsetMap[psId];
     }
@@ -2542,19 +2539,4 @@
   }
 
-#if Q0078_ADD_LAYER_SETS
-  Void removePS(Int psId)
-  {
-    assert(psId < m_maxId);
-    if (m_paramsetMap.find(psId) != m_paramsetMap.end())
-    {
-      m_paramsetMap.erase(psId);
-#if Q0078_ADD_LAYER_SETS
-      delete m_paramsetMap[psId];
-#endif
-    }
-  }
-#endif
-
-
 private:
   std::map<Int,T *> m_paramsetMap;
@@ -2579,7 +2561,4 @@
   TComSPS* getSPS(Int spsId)  { return m_spsMap.getPS(spsId); };
   TComSPS* getFirstSPS()      { return m_spsMap.getFirstPS(); };
-#if Q0078_ADD_LAYER_SETS
-  Void     removeSPS(Int spsId) { m_spsMap.removePS(spsId); };
-#endif
 
   //! store picture parameter set and take ownership of it 
@@ -2588,7 +2567,4 @@
   TComPPS* getPPS(Int ppsId)  { return m_ppsMap.getPS(ppsId); };
   TComPPS* getFirstPPS()      { return m_ppsMap.getFirstPS(); };
-#if Q0078_ADD_LAYER_SETS
-  Void     removePPS(Int ppsId) { m_ppsMap.removePS(ppsId); };
-#endif
 
   //! activate a SPS from a active parameter sets SEI message
@@ -2608,9 +2584,11 @@
 #if SVC_EXTENSION
   static ParameterSetMap<TComVPS> m_vpsMap;
+  static ParameterSetMap<TComSPS> m_spsMap; 
+  static ParameterSetMap<TComPPS> m_ppsMap;
 #else
   ParameterSetMap<TComVPS> m_vpsMap;
-#endif
   ParameterSetMap<TComSPS> m_spsMap; 
   ParameterSetMap<TComPPS> m_ppsMap;
+#endif
 
 #if SVC_EXTENSION
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 833)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 834)
@@ -42,5 +42,7 @@
 
 #if SVC_EXTENSION
-  ParameterSetMap<TComVPS> ParameterSetManagerDecoder::m_vpsBuffer(MAX_NUM_VPS);
+ParameterSetMap<TComVPS> ParameterSetManagerDecoder::m_vpsBuffer(MAX_NUM_VPS);
+ParameterSetMap<TComSPS> ParameterSetManagerDecoder::m_spsBuffer(MAX_NUM_SPS);
+ParameterSetMap<TComPPS> ParameterSetManagerDecoder::m_ppsBuffer(MAX_NUM_PPS);
 #endif
 
@@ -397,8 +399,5 @@
 
 ParameterSetManagerDecoder::ParameterSetManagerDecoder()
-#if SVC_EXTENSION
-: m_spsBuffer(MAX_NUM_SPS)
-, m_ppsBuffer(MAX_NUM_PPS)
-#else
+#if !SVC_EXTENSION
 : m_vpsBuffer(MAX_NUM_VPS)
 , m_spsBuffer(MAX_NUM_SPS)
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.h	(revision 833)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.h	(revision 834)
@@ -110,9 +110,11 @@
 #if SVC_EXTENSION
   static ParameterSetMap<TComVPS> m_vpsBuffer;
+  static ParameterSetMap<TComSPS> m_spsBuffer; 
+  static ParameterSetMap<TComPPS> m_ppsBuffer;
 #else
   ParameterSetMap<TComVPS> m_vpsBuffer;
-#endif
   ParameterSetMap<TComSPS> m_spsBuffer; 
   ParameterSetMap<TComPPS> m_ppsBuffer;
+#endif
 };
 
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 833)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 834)
@@ -109,36 +109,4 @@
 TDecTop::~TDecTop()
 {
-#if Q0078_ADD_LAYER_SETS
-  for (Int psId = 0; psId < MAX_NUM_SPS; psId++)
-  {
-    TComSPS* sps = m_parameterSetManagerDecoder.getSPS(psId);
-    if (sps != NULL)
-    {
-      // Remove parameter set from other layers to prevent multiple deletes of the same object
-      for (Int lId = 0; lId < m_numLayer; lId++)
-      {
-        if (m_ppcTDecTop[lId] != this)
-        {
-          m_parameterSetManagerDecoder.removeSPS(psId);
-        }
-      }
-    }
-  }
-  for (Int psId = 0; psId < MAX_NUM_PPS; psId++)
-  {
-    TComPPS* pps = m_parameterSetManagerDecoder.getPPS(psId);
-    if (pps != NULL)
-    {
-      // Remove parameter set from other layers to prevent multiple deletes of the same object
-      for (Int lId = 0; lId < m_numLayer; lId++)
-      {
-        if (m_ppcTDecTop[lId] != this)
-        {
-          m_parameterSetManagerDecoder.removePPS(psId);
-        }
-      }
-    }
-  }
-#endif
 #if ENC_DEC_TRACE
   fclose( g_hTrace );
@@ -153,5 +121,9 @@
 #endif
 #if Q0074_SEI_COLOR_MAPPING
-  if ( m_ColorMapping )  delete m_ColorMapping;
+  if ( m_ColorMapping )
+  {
+    delete m_ColorMapping;
+    m_ColorMapping = NULL;
+  }
 #endif
 }
@@ -2033,14 +2005,4 @@
 #endif
   m_parameterSetManagerDecoder.storePrefetchedSPS(sps);
-#if Q0078_ADD_LAYER_SETS
-  // Store SPS for all layers
-  for (Int lId = 0; lId < m_numLayer; lId++)
-  {
-    if (m_ppcTDecTop[lId] != this)
-    {
-      m_ppcTDecTop[lId]->getParameterSetManager()->storePrefetchedSPS(sps);
-    }
-  }
-#endif
 #if !REPN_FORMAT_IN_VPS   // ILRP can only be initialized at activation  
   if(m_numLayer>0)
@@ -2069,14 +2031,4 @@
     );
   m_parameterSetManagerDecoder.storePrefetchedPPS( pps );
-#if Q0078_ADD_LAYER_SETS
-  // Store PPS for all layers
-  for (Int lId = 0; lId < m_numLayer; lId++)
-  {
-    if (m_ppcTDecTop[lId] != this)
-    {
-      m_ppcTDecTop[lId]->getParameterSetManager()->storePrefetchedPPS(pps);
-    }
-  }
-#endif
 }
 #else
