Index: branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 405)
+++ branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 407)
@@ -1755,4 +1755,7 @@
 , m_vpsNumRepFormats          (1)
 #endif
+#if VIEW_ID_RELATED_SIGNALING 
+, m_viewIdLenMinus1           (0)
+#endif
 {
   for( Int i = 0; i < MAX_TLAYER; i++)
@@ -1832,4 +1835,7 @@
   ::memset( m_vpsRepFormatIdx, 0, sizeof(m_vpsRepFormatIdx) );
 #endif
+#if VIEW_ID_RELATED_SIGNALING 
+  ::memset(m_viewIdVal, 0, sizeof(m_viewIdVal));
+#endif
 }
 
@@ -1862,4 +1868,37 @@
     setNumLayersInIdList(i, n);
   }
+}
+#endif
+#if VIEW_ID_RELATED_SIGNALING 
+Int TComVPS::getNumViews()
+{
+  Int numViews = 1; 
+  for( Int i = 0; i <= getMaxLayers() - 1; i++ )
+  {
+    Int lId = getLayerIdInNuh( i ); 
+    if ( i > 0 && ( getViewIndex( lId ) != getScalabilityId( i - 1, VIEW_ORDER_INDEX ) ) )
+    {
+      numViews++; 
+    }    
+  }
+
+  return numViews;
+}
+Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType )
+{
+  return getScalabilityMask( scalType ) ? getDimensionId( layerIdInVps, scalTypeToScalIdx( scalType ) ) : 0;
+}  
+Int TComVPS::scalTypeToScalIdx( ScalabilityType scalType )
+{
+  assert( scalType >= 0 && scalType <= MAX_VPS_NUM_SCALABILITY_TYPES ); 
+  assert( scalType == MAX_VPS_NUM_SCALABILITY_TYPES || getScalabilityMask( scalType ) );
+  Int scalIdx = 0; 
+  for( Int curScalType = 0; curScalType < scalType; curScalType++ )
+  {
+    scalIdx += ( getScalabilityMask( curScalType ) ? 1 : 0 );
+
+  }
+
+  return scalIdx; 
 }
 #endif
Index: branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.h	(revision 405)
+++ branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.h	(revision 407)
@@ -557,4 +557,8 @@
   Int        m_vpsRepFormatIdx[16];
 #endif
+#if VIEW_ID_RELATED_SIGNALING 
+  Int         m_viewIdLenMinus1;
+  Int         m_viewIdVal                [MAX_LAYERS];
+#endif
 public:
   TComVPS();
@@ -778,4 +782,17 @@
   Int    getVpsRepFormatIdx(Int idx)        { return m_vpsRepFormatIdx[idx];   }
   Void   setVpsRepFormatIdx(Int idx, Int x) { m_vpsRepFormatIdx[idx] = x;      }         
+#endif
+#if VIEW_ID_RELATED_SIGNALING
+  Void    setViewIdLenMinus1( Int  val )                                   { m_viewIdLenMinus1 = val; } 
+  Int     getViewIdLenMinus1(  )                                           { return m_viewIdLenMinus1; } 
+
+  Void    setViewIdVal( Int viewOrderIndex, Int  val )                     { m_viewIdVal[viewOrderIndex] = val; } 
+  Int     getViewIdVal( Int viewOrderIndex )                               { return m_viewIdVal[viewOrderIndex]; } 
+  Int     getScalabilityId(Int, ScalabilityType scalType );
+
+  Int     getViewIndex    ( Int layerIdInNuh )                             { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX  ); }    
+
+  Int     getNumViews();
+  Int     scalTypeToScalIdx( ScalabilityType scalType );
 #endif
 };
Index: branches/SHM-3.1-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/SHM-3.1-dev/source/Lib/TLibCommon/TypeDef.h	(revision 405)
+++ branches/SHM-3.1-dev/source/Lib/TLibCommon/TypeDef.h	(revision 407)
@@ -159,4 +159,5 @@
 
 #define FIX1071 1 ///< fix for issue #1071
+#define VIEW_ID_RELATED_SIGNALING        1 ///< Introduce syntax elements view_id_len_minus1 and view_id_val
 #define M0043_LAYERS_PRESENT_SEI         0 ///< M0043: add layers present SEI. Macro shall be equal to 0 according to the JCTVC-N0174 discussion. The code is to be removed.
 
@@ -622,4 +623,12 @@
   };
 }
+#if VIEW_ID_RELATED_SIGNALING
+/// scalability types
+  enum ScalabilityType
+  {
+    VIEW_ORDER_INDEX  = 1,
+    SCALABILITY_ID = 2,
+  };
+#endif
 //! \}
 
Index: branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 405)
+++ branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 407)
@@ -975,4 +975,16 @@
   }
 #endif
+#if VIEW_ID_RELATED_SIGNALING 
+  // if ( pcVPS->getNumViews() > 1 )  
+  //   However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val. 
+  {
+    READ_CODE( 4, uiCode, "view_id_len_minus1" ); vps->setViewIdLenMinus1( uiCode );
+  }
+
+  for( Int i = 0; i < vps->getNumViews(); i++ )
+  {
+    READ_CODE( vps->getViewIdLenMinus1( ) + 1, uiCode, "view_id_val[i]" ); vps->setViewIdVal( i, uiCode );
+  }
+#endif
 #if VPS_MOVE_DIR_DEPENDENCY_FLAG
 #if VPS_EXTN_DIRECT_REF_LAYERS
Index: branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 405)
+++ branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 407)
@@ -770,4 +770,16 @@
   }
 #endif
+#if VIEW_ID_RELATED_SIGNALING
+  // if ( pcVPS->getNumViews() > 1 )  
+  //   However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val. 
+  {
+    WRITE_CODE( vps->getViewIdLenMinus1( ), 4, "view_id_len_minus1" );
+  }
+
+  for( Int i = 0; i < vps->getNumViews(); i++ )
+  {
+    WRITE_CODE( vps->getViewIdVal( i ), vps->getViewIdLenMinus1( ) + 1, "view_id_val[i]" );
+  }
+#endif
 #if VPS_MOVE_DIR_DEPENDENCY_FLAG
 #if VPS_EXTN_DIRECT_REF_LAYERS
