Index: /branches/HM-10.0-dev-SHM/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/HM-10.0-dev-SHM/source/App/TAppEncoder/TAppEncTop.cpp	(revision 114)
+++ /branches/HM-10.0-dev-SHM/source/App/TAppEncoder/TAppEncTop.cpp	(revision 115)
@@ -709,4 +709,36 @@
     }
   }
+#if VPS_EXTN_MASK_AND_DIM_INFO
+  UInt i = 0, dimIdLen = 0;
+  vps->setAvcBaseLayerFlag(false);
+  vps->setSplittingFlag(false);
+  for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++)
+  {
+    vps->setScalabilityMask(i, false);
+  }
+  if(m_numLayers > 1) 
+  {
+    vps->setScalabilityMask(1, true); // Only turn on spatial/SNR scalability
+    vps->setNumScalabilityTypes(1);
+  }
+  else
+  {
+    vps->setNumScalabilityTypes(0);
+  }
+  while((1 << dimIdLen) < m_numLayers)
+  {
+    dimIdLen++;
+  }
+  vps->setDimensionIdLen(0, dimIdLen);
+  vps->setNuhLayerIdPresentFlag(false);
+  vps->setLayerIdInNuh(0, 0);
+  vps->setLayerIdInVps(0, 0);
+  for(i = 1; i <= vps->getMaxLayerId(); i++) // TODO: we should use vps->getMaxLayers(), but currently it is always set to 1
+  {
+    vps->setLayerIdInNuh(i, i);
+    vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i);
+    vps->setDimensionId(i, 0, i);
+  }
+#endif
 #if VPS_EXTN_PROFILE_INFO
   vps->getPTLForExtnPtr()->resize(vps->getNumLayerSets());
Index: /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComSlice.cpp	(revision 114)
+++ /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComSlice.cpp	(revision 115)
@@ -1485,4 +1485,16 @@
     m_uiMaxLatencyIncrease[i] = 0;
   }
+#if VPS_EXTN_MASK_AND_DIM_INFO
+  m_avcBaseLayerFlag = false;
+  m_splittingFlag = false;
+  ::memset(m_scalabilityMask, 0, sizeof(m_scalabilityMask));
+  ::memset(m_dimensionIdLen, 0, sizeof(m_dimensionIdLen));
+  m_nuhLayerIdPresentFlag = false;
+  ::memset(m_layerIdInNuh, 0, sizeof(m_layerIdInNuh));
+  ::memset(m_dimensionId, 0, sizeof(m_dimensionId));
+
+  m_numScalabilityTypes = 0;
+  ::memset(m_layerIdInVps, 0, sizeof(m_layerIdInVps));
+#endif
 #if VPS_EXTN_PROFILE_INFO
   ::memset(m_profilePresentFlag, 0, sizeof(m_profilePresentFlag));
Index: /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComSlice.h	(revision 114)
+++ /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComSlice.h	(revision 115)
@@ -516,4 +516,17 @@
   // Variables related to VPS extensions
   // ------------------------------------------
+#if VPS_EXTN_MASK_AND_DIM_INFO
+  Bool       m_avcBaseLayerFlag;                                // For now, always set to true.
+  Bool       m_splittingFlag;
+  Bool       m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES];
+  UInt       m_dimensionIdLen[MAX_VPS_NUM_SCALABILITY_TYPES];
+  Bool       m_nuhLayerIdPresentFlag;
+  UInt       m_layerIdInNuh[MAX_VPS_LAYER_ID_PLUS1];            // Maps layer ID in the VPS with layer_id_in_nuh
+  UInt       m_dimensionId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_NUM_SCALABILITY_TYPES];
+
+  // Below are derived variables
+  UInt       m_numScalabilityTypes;
+  UInt       m_layerIdInVps[MAX_VPS_LAYER_ID_PLUS1];            // Maps layer_id_in_nuh with the layer ID in the VPS
+#endif
 #if VPS_EXTN_PROFILE_INFO
   // Profile-tier-level signalling related
@@ -594,4 +607,32 @@
 #if L0043_TIMING_INFO
   TimingInfo* getTimingInfo() { return &m_timingInfo; }
+#endif
+#if VPS_EXTN_MASK_AND_DIM_INFO
+  Bool   getAvcBaseLayerFlag()                                  { return m_avcBaseLayerFlag;       }
+  Void   setAvcBaseLayerFlag(Bool x)                            { m_avcBaseLayerFlag = x;          }
+
+  Bool   getSplittingFlag()                                     { return m_splittingFlag;          }
+  Void   setSplittingFlag(Bool x)                               { m_splittingFlag = x;             }
+
+  Bool   getScalabilityMask(Int id)                             { return m_scalabilityMask[id];    }
+  Void   setScalabilityMask(Int id, Bool x)                     { m_scalabilityMask[id] = x;       }
+
+  UInt   getDimensionIdLen(Int id)                              { return m_dimensionIdLen[id];     }
+  Void   setDimensionIdLen(Int id, UInt x)                      { m_dimensionIdLen[id] = x;        }
+
+  Bool   getNuhLayerIdPresentFlag()                             { return m_nuhLayerIdPresentFlag;  }
+  Void   setNuhLayerIdPresentFlag(Bool x)                       { m_nuhLayerIdPresentFlag = x;     }
+
+  UInt   getLayerIdInNuh(Int id)                                { return m_layerIdInNuh[id];       }
+  Void   setLayerIdInNuh(Int id, UInt x)                        { m_layerIdInNuh[id] = x;          }
+
+  UInt   getDimensionId(Int lyrId, Int id)                      { return m_dimensionId[lyrId][id]; }
+  Void   setDimensionId(Int lyrId, Int id, UInt x)              { m_dimensionId[lyrId][id] = x;    }
+
+  UInt   getNumScalabilityTypes()                               { return m_numScalabilityTypes;    }
+  Void   setNumScalabilityTypes(UInt x)                         { m_numScalabilityTypes = x;       }
+
+  UInt   getLayerIdInVps(Int id)                                { return m_layerIdInVps[id];       }
+  Void   setLayerIdInVps(Int id, UInt x)                        { m_layerIdInVps[id] = x;          }
 #endif
 #if VPS_EXTN_PROFILE_INFO
Index: /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TypeDef.h	(revision 114)
+++ /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TypeDef.h	(revision 115)
@@ -47,4 +47,5 @@
 #define VPS_EXTNS                        1      ///< Include function structure for VPS extensions
 #if VPS_EXTNS
+#define VPS_EXTN_MASK_AND_DIM_INFO       0      ///< Include avc_base_layer_flag, splitting_flag, scalability mask and dimension related info
 #define VPS_EXTN_OP_LAYER_SETS           1      ///< Include output layer sets in VPS extension
 #define VPS_EXTN_PROFILE_INFO            1      ///< Include profile information for layer sets in VPS extension
@@ -137,4 +138,7 @@
 #define L0232_RD_PENALTY           1  ///< L0232: RD-penalty for 32x32 TU for intra in non-intra slices
 
+#if VPS_EXTN_MASK_AND_DIM_INFO
+#define MAX_VPS_NUM_SCALABILITY_TYPES             16
+#endif
 #if VPS_RENAME
 #define MAX_VPS_LAYER_SETS_PLUS1                  1024
Index: /branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 114)
+++ /branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 115)
@@ -845,4 +845,60 @@
   UInt uiCode;
   // ... More syntax elements to be parsed here
+#if VPS_EXTN_MASK_AND_DIM_INFO
+  UInt numScalabilityTypes = 0, i = 0, j = 0;
+
+  READ_FLAG( uiCode, "avc_base_layer_flag" ); vps->setAvcBaseLayerFlag(uiCode ? true : false);
+  READ_FLAG( uiCode, "splitting_flag" ); vps->setSplittingFlag(uiCode ? true : false);
+
+  for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++)
+  {
+    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);
+
+  for(j = 0; j < numScalabilityTypes; j++)
+  {
+    READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); vps->setDimensionIdLen(j, uiCode + 1);
+  }
+  if(vps->getSplittingFlag())
+  {
+    UInt numBits = 0;
+    for(j = 0; j < numScalabilityTypes; j++)
+    {
+      numBits += vps->getDimensionIdLen(j);
+    }
+    assert( numBits <= 6 );
+  }
+
+  READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); vps->setNuhLayerIdPresentFlag(uiCode ? true : false);
+  vps->setLayerIdInNuh(0, 0);
+  vps->setLayerIdInVps(0, 0);
+  for(i = 1; i <= vps->getMaxLayerId(); i++) // TODO: we should use vps->getMaxLayers(), but currently it is always set to 1
+  {
+    if( vps->getNuhLayerIdPresentFlag() )
+    {
+      READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" ); vps->setLayerIdInNuh(i, uiCode);
+      assert( uiCode > vps->getLayerIdInNuh(i-1) );
+    }
+    else
+    {
+      vps->setLayerIdInNuh(i, i);
+    }
+    vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i);
+
+    for(j = 0; j < numScalabilityTypes; j++)
+    {
+      READ_CODE( vps->getDimensionIdLen(j), uiCode, "dimension_id[i][j]" ); vps->setDimensionId(i, j, uiCode);
+      assert( uiCode <= vps->getMaxLayerId() );
+    }
+  }
+#endif
+
 #if VPS_EXTN_PROFILE_INFO
   // Profile-tier-level signalling
Index: /branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 114)
+++ /branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 115)
@@ -673,4 +673,34 @@
 {
   // ... More syntax elements to be written here
+#if VPS_EXTN_MASK_AND_DIM_INFO
+  UInt i = 0, j = 0;
+
+  WRITE_FLAG( vps->getAvcBaseLayerFlag(),              "avc_base_layer_flag" );
+  WRITE_FLAG( vps->getSplittingFlag(),                 "splitting_flag" );
+
+  for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++)
+  {
+    WRITE_FLAG( vps->getScalabilityMask(i),            "scalability_mask[i]" );
+  }
+
+  for(j = 0; j < vps->getNumScalabilityTypes(); j++)
+  {
+    WRITE_CODE( vps->getDimensionIdLen(j) - 1, 3,      "dimension_id_len_minus1[j]" );
+  }
+
+  WRITE_FLAG( vps->getNuhLayerIdPresentFlag(),         "vps_nuh_layer_id_present_flag" );
+  for(i = 1; i <= vps->getMaxLayerId(); i++) // TODO: we should use vps->getMaxLayers(), but currently it is always set to 1
+  {
+    if( vps->getNuhLayerIdPresentFlag() )
+    {
+      WRITE_CODE( vps->getLayerIdInNuh(i),     6,      "layer_id_in_nuh[i]" );
+    }
+    for(j = 0; j < vps->getNumScalabilityTypes(); j++)
+    {
+      UInt bits = vps->getDimensionIdLen(j);
+      WRITE_CODE( vps->getDimensionId(i, j),   bits,   "dimension_id[i][j]" );
+    }
+  }
+#endif
 #if VPS_EXTN_PROFILE_INFO
   // Profile-tier-level signalling
