Index: branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 794)
+++ branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 795)
@@ -2913,4 +2913,5 @@
 #if SVC_EXTENSION
 , m_layerId                   ( 0 )
+, m_extensionFlag             ( false )
 , m_numScaledRefLayerOffsets  ( 0 )
 #if REPN_FORMAT_IN_VPS
Index: branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.h	(revision 794)
+++ branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.h	(revision 795)
@@ -1493,4 +1493,5 @@
 #if SVC_EXTENSION
   UInt        m_layerId;
+  Bool        m_extensionFlag;
   UInt        m_numScaledRefLayerOffsets;
 #if P0312_VERT_PHASE_ADJ
@@ -1651,4 +1652,6 @@
   Void     setLayerId(UInt layerId)            { m_layerId = layerId; }
   UInt     getLayerId()                        { return m_layerId;    }
+  Int      getExtensionFlag()                  { return m_extensionFlag;  }
+  Void     setExtensionFlag(Int n)             { m_extensionFlag = n;     }
   UInt     getNumScaledRefLayerOffsets()       { return m_numScaledRefLayerOffsets; }
   Void     setNumScaledRefLayerOffsets(Int x)  { m_numScaledRefLayerOffsets = x;    }
Index: branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h	(revision 794)
+++ branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h	(revision 795)
@@ -112,8 +112,5 @@
 
 #define SCALINGLIST_INFERRING            1      ///< JCTVC-N0371: inter-layer scaling list
-#define SPS_EXTENSION                    1      ///< Define sps_extension() syntax structure
-#if SPS_EXTENSION
 #define O0142_CONDITIONAL_SPS_EXTENSION  1      ///< JCTVC-O0142: Conditional SPS extension
-#endif
 #define SCALABILITY_MASK_E0104           1      ///< JCT3V-E0104: scalability mask for depth
 #if POC_RESET_FLAG
Index: branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 794)
+++ branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 795)
@@ -848,8 +848,10 @@
 
   READ_FLAG( uiCode, "sps_extension_flag");
-  if (uiCode)
-  {
-#if SPS_EXTENSION
-
+
+#if SVC_EXTENSION
+  pcSPS->setExtensionFlag( uiCode ? true : false );
+
+  if( pcSPS->getExtensionFlag() )
+  {
 #if O0142_CONDITIONAL_SPS_EXTENSION
     UInt spsExtensionTypeFlag[8];
@@ -870,17 +872,22 @@
     {
 #endif
-
-#endif
       while ( xMoreRbspData() )
       {
         READ_FLAG( uiCode, "sps_extension_data_flag");
       }
-#if SPS_EXTENSION
-    }
-#endif
-  }
-}
-
-#if SPS_EXTENSION
+    }
+  }
+#else
+  if (uiCode)
+  {
+    while ( xMoreRbspData() )
+    {
+      READ_FLAG( uiCode, "sps_extension_data_flag");
+    }
+  }
+#endif
+}
+
+#if SVC_EXTENSION
 Void TDecCavlc::parseSPSExtension( TComSPS* pcSPS )
 {
Index: branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 794)
+++ branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 795)
@@ -75,5 +75,5 @@
   Void  parseQtRootCbf      ( UInt uiAbsPartIdx, UInt& uiQtRootCbf );
   Void  parseVPS            ( TComVPS* pcVPS );
-#if SPS_EXTENSION
+#if SVC_EXTENSION
   Void  parseVPSExtension   ( TComVPS* pcVPS );
   Void  defaultVPSExtension ( TComVPS* pcVPS );
Index: branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 794)
+++ branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 795)
@@ -639,7 +639,8 @@
   }
 
-#if SPS_EXTENSION
-  WRITE_FLAG( 1, "sps_extension_flag" );
-  if( 1 )   // if( sps_extension_flag )
+#if SVC_EXTENSION
+  WRITE_FLAG( pcSPS->getExtensionFlag() ? 1 : 0, "sps_extension_flag" );
+
+  if( pcSPS->getExtensionFlag() )
   {
 #if O0142_CONDITIONAL_SPS_EXTENSION
@@ -662,5 +663,6 @@
 #endif
 }
-#if SPS_EXTENSION
+
+#if SVC_EXTENSION
 Void TEncCavlc::codeSPSExtension( TComSPS* pcSPS )
 {
@@ -689,5 +691,6 @@
   }
 }
-#endif
+#endif //SVC_EXTENSION
+
 Void TEncCavlc::codeVPS( TComVPS* pcVPS )
 {
Index: branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCavlc.h	(revision 794)
+++ branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCavlc.h	(revision 795)
@@ -159,5 +159,5 @@
   Void codeDFSvlc       ( Int   iCode, const Char *pSymbolName );
 
-#if SPS_EXTENSION
+#if SVC_EXTENSION
   Void codeSPSExtension        ( TComSPS* pcSPS );
   Void codeVPSExtension        ( TComVPS* pcVPS );
Index: branches/SHM-6-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/SHM-6-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 794)
+++ branches/SHM-6-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 795)
@@ -912,4 +912,6 @@
 {
 #if SVC_EXTENSION
+  m_cSPS.setExtensionFlag( m_layerId > 0 ? true : false );
+
 #if Q0078_ADD_LAYER_SETS
   if (getNumDirectRefLayers() == 0 && getNumAddLayerSets() > 0)
