Index: /branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 244)
+++ /branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 245)
@@ -80,4 +80,5 @@
     m_acLayerCfg[layer].setAppEncCfg(this);
   }
+  memset( m_scalabilityMask, 0, sizeof(m_scalabilityMask) );
 }
 #else
@@ -424,13 +425,14 @@
   ("NumLayers",               m_numLayers, 1, "Number of layers to code")
   ("ConformanceMode%d",       cfg_conformanceMode,0, MAX_LAYERS, "Window conformance mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping")
-  ("ScalabilityMask",       m_scalabilityMask, 1, "scalability_mask")
-  ("BitstreamFile,b",       cfg_BitstreamFile, string(""), "Bitstream output file name")
-  ("InputBitDepth",         m_inputBitDepthY,    8, "Bit-depth of input file")
-  ("OutputBitDepth",        m_outputBitDepthY,   0, "Bit-depth of output file (default:InternalBitDepth)")
-  ("InternalBitDepth",      m_internalBitDepthY, 0, "Bit-depth the codec operates at. (default:InputBitDepth)"
+  ("ScalabilityMask0",        m_scalabilityMask[0], 0, "scalability_mask[0] (multiview)")
+  ("ScalabilityMask1",        m_scalabilityMask[1], 1, "scalability_mask[1] (scalable)" )
+  ("BitstreamFile,b",         cfg_BitstreamFile, string(""), "Bitstream output file name")
+  ("InputBitDepth",           m_inputBitDepthY,    8, "Bit-depth of input file")
+  ("OutputBitDepth",          m_outputBitDepthY,   0, "Bit-depth of output file (default:InternalBitDepth)")
+  ("InternalBitDepth",        m_internalBitDepthY, 0, "Bit-depth the codec operates at. (default:InputBitDepth)"
                                                        "If different to InputBitDepth, source data will be converted")
-  ("InputBitDepthC",        m_inputBitDepthC,    0, "As per InputBitDepth but for chroma component. (default:InputBitDepth)")
-  ("OutputBitDepthC",       m_outputBitDepthC,   0, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)")
-  ("InternalBitDepthC",     m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)")
+  ("InputBitDepthC",          m_inputBitDepthC,    0, "As per InputBitDepth but for chroma component. (default:InputBitDepth)")
+  ("OutputBitDepthC",         m_outputBitDepthC,   0, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)")
+  ("InternalBitDepthC",       m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)")
 #if SCALED_REF_LAYER_OFFSETS
   ("ScaledRefLayerLeftOffset%d",   cfg_scaledRefLayerLeftOffset,  0, MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to"
@@ -1874,5 +1876,7 @@
   printf("\n");
 #if SVC_EXTENSION  
-  printf("Total number of layers        : %d\n", m_numLayers            );
+  printf("Total number of layers        : %d\n", m_numLayers       );
+  printf("Multiview                     : %d\n", m_scalabilityMask[0] );
+  printf("Scalable                      : %d\n", m_scalabilityMask[1] );
   for(UInt layer=0; layer<m_numLayers; layer++)
   {
Index: /branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 244)
+++ /branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 245)
@@ -61,5 +61,5 @@
   TAppEncLayerCfg m_acLayerCfg [MAX_LAYERS]; 
   Int       m_numLayers;                                      ///< number of layers
-  Int       m_scalabilityMask;                                ///< scalability_mask
+  Int       m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; ///< scalability_mask
   Char*     m_pBitstreamFile;                                 ///< output bitstream file
   Double    m_adLambdaModifier[ MAX_TLAYER ];                 ///< Lambda modifier array for each temporal layer
Index: /branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 244)
+++ /branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 245)
@@ -844,6 +844,12 @@
   if(m_numLayers > 1) 
   {
-    vps->setScalabilityMask(m_scalabilityMask, true);
-    vps->setNumScalabilityTypes(1);
+    Int scalabilityTypes = 0;
+    for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++)
+    {
+      vps->setScalabilityMask(i, m_scalabilityMask[i]);
+      scalabilityTypes += m_scalabilityMask[i];
+    }
+    assert( scalabilityTypes == 1 );
+    vps->setNumScalabilityTypes(scalabilityTypes);
   }
   else
Index: /branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 244)
+++ /branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 245)
@@ -913,9 +913,4 @@
     READ_FLAG( uiCode, "scalability_mask[i]" ); vps->setScalabilityMask(i, uiCode ? true : false);
     numScalabilityTypes += uiCode;
-    if( i != 1 )
-    {
-      // Multiview and reserved masks are not used in this version of software
-      assert( uiCode == 0 );
-    }
   }
   vps->setNumScalabilityTypes(numScalabilityTypes);
Index: /branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 244)
+++ /branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 245)
@@ -258,4 +258,7 @@
       {
         rpcPic->setSpatialEnhLayerFlag( true );
+
+        //only for scalable extension
+        assert( pcSlice->getVPS()->getScalabilityMask(1) == true );
       }
     }
Index: /branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 244)
+++ /branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 245)
@@ -515,4 +515,7 @@
         {
           pcEPic->setSpatialEnhLayerFlag( true );
+
+          //only for scalable extension
+          assert( m_cVPS.getScalabilityMask(1) == true );
         }
       }
@@ -543,4 +546,7 @@
         {
           rpcPic->setSpatialEnhLayerFlag( true );
+
+          //only for scalable extension
+          assert( m_cVPS.getScalabilityMask(1) == true );
         }
       }
