Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 483)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 488)
@@ -1421,5 +1421,5 @@
 , m_numHrdParameters          (  0)
 #if H_MV
-, m_maxNuhLayerId             (  0)
+, m_maxLayerId             (  0)
 #else
 , m_maxNuhReservedZeroLayerId (  0)
@@ -1456,5 +1456,5 @@
     m_vpsProfilePresentFlag   [i] = false;
     m_profileLayerSetRefMinus1[i] = 0;
-    m_outputLayerSetIdx       [i] = 0;
+    m_outputLayerSetIdxMinus1       [i] = 0;
     for( Int j = 0; j < MAX_VPS_NUH_LAYER_ID_PLUS1; j++ )
     {
@@ -1629,4 +1629,5 @@
   return getLayerIdInNuh( foundlayerId );
 }
+
 #endif // H_3D
 #endif // H_MV
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 483)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 488)
@@ -487,5 +487,5 @@
   UInt        m_numHrdParameters;
 #if H_MV
-  UInt        m_maxNuhLayerId;
+  UInt        m_maxLayerId;
 #else
   UInt        m_maxNuhReservedZeroLayerId;
@@ -512,4 +512,19 @@
   TimingInfo  m_timingInfo;
 #endif
+
+
+
+Int  m_maxTidIlRefPicPlus1            [ MAX_NUM_LAYERS ];
+Int  m_vpsNumberLayerSetsMinus1;       
+Int  m_vpsNumProfileTierLevelMinus1;   
+Int  m_profileRefMinus1               [ MAX_VPS_PROFILE_TIER_LEVEL ];
+Bool m_vpsMoreOutputLayerSetsThanDefaultFlag;
+Int  m_numAddOutputLayerSetsMinus1;    
+Bool m_defaultOneTargetOutputLayerFlag;
+Int  m_outputLayerSetIdxMinus1        [ MAX_VPS_OUTPUTLAYER_SETS ];  
+Int  m_profileLevelTierIdx            [ MAX_VPS_OUTPUTLAYER_SETS ];
+Bool m_maxOneActiveRefLayerFlag;       
+Int  m_directDepTypeLenMinus2;         
+Int  m_directDependencyType           [ MAX_NUM_LAYERS ] [ MAX_NUM_LAYERS ];
 
 #if H_MV
@@ -529,11 +544,18 @@
   Bool        m_vpsProfilePresentFlag    [MAX_VPS_OP_SETS_PLUS1];
   Int         m_profileLayerSetRefMinus1 [MAX_VPS_OP_SETS_PLUS1];
-  Int         m_numOutputLayerSets;
-  Int         m_outputLayerSetIdx        [MAX_VPS_OP_SETS_PLUS1];
-  Bool        m_outputLayerFlag          [MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_LAYER_ID_PLUS1];
+  Int         m_numOutputLayerSets;  
+  Bool        m_outputLayerFlag          [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1];
   Bool        m_directDependencyFlag     [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];
 
   Int         m_numDirectRefLayers       [ MAX_NUM_LAYERS ];
   Int         m_refLayerId               [ MAX_NUM_LAYERS ][MAX_NUM_LAYERS];  
+  
+  Int xCeilLog2( Int val )
+  { 
+    assert( val > 0 ); 
+    Int ceilLog2 = 0;
+    while( val > ( 1 << ceilLog2 ) ) ceilLog2++;
+    return ceilLog2; 
+  }
 
 #endif
@@ -580,6 +602,6 @@
 
 #if H_MV
-  UInt    getMaxNuhLayerId()                                    { return m_maxNuhLayerId; }
-  Void    setMaxNuhLayerId(UInt v)                              { m_maxNuhLayerId = v;    }
+  UInt    getVpsMaxLayerId()                                    { return m_maxLayerId; }
+  Void    setVpsMaxLayerId(UInt v)                              { m_maxLayerId = v;    }
 #else
   UInt    getMaxNuhReservedZeroLayerId()                        { return m_maxNuhReservedZeroLayerId; }
@@ -654,12 +676,6 @@
   Int     getNumOutputLayerSets()                                          { return m_numOutputLayerSets; }
 
-  Void    setOutputLayerSetIdx( Int layerSet, Int val )                    { m_outputLayerSetIdx[layerSet] = val;  }
-  Int     getOutputLayerSetIdx( Int layerSet )                             { return m_outputLayerSetIdx[layerSet]; }
-
-  Void    setOutputLayerFlag( Int layerSet, Int layer, Bool val )          { m_outputLayerFlag[layerSet][layer] = val;  }
-  Bool    getOutputLayerFlag( Int layerSet, Int layer )                    { return m_outputLayerFlag[layerSet][layer]; }
-
-  Void    setDirectDependencyFlag( Int layerHigh, Int layerLow, Bool val ) { m_directDependencyFlag[layerHigh][layerLow] = val;  }
-  Bool    getDirectDependencyFlag( Int layerHigh, Int layerLow )           { return m_directDependencyFlag[layerHigh][layerLow]; }
+  Void    setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val;  }
+  Bool    getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps )           { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; }
 
   Void    calcIvRefLayers(); 
@@ -670,4 +686,59 @@
   Bool    checkVPSExtensionSyntax(); 
   Int     scalTypeToScalIdx   ( ScalabilityType scalType );
+  
+  
+  Int  getMaxTidIlRefPicPlus1                  ( Int layerIdInVps )                          { return m_maxTidIlRefPicPlus1          [ layerIdInVps        ]; } 
+  Void setMaxTidIlRefPicPlus1                  ( Int layerIdInVps, Int val )                 { m_maxTidIlRefPicPlus1          [ layerIdInVps        ] = val;  } 
+  
+  Int  getVpsNumberLayerSetsMinus1             ()                                            { return m_vpsNumberLayerSetsMinus1                            ; } 
+  Void setVpsNumberLayerSetsMinus1             ( Int val )                                   { m_vpsNumberLayerSetsMinus1                             = val;  } 
+  
+  Int  getVpsNumProfileTierLevelMinus1         ()                                            { return m_vpsNumProfileTierLevelMinus1                        ; } 
+  Void setVpsNumProfileTierLevelMinus1         ( Int val )                                   { m_vpsNumProfileTierLevelMinus1                         = val;  } 
+
+  Void setProfileRefMinus1                     ( Int profileTierLevelIdx, Int val )          { m_profileRefMinus1             [ profileTierLevelIdx ] = val;  } 
+  Int  getProfileRefMinus1                     ( Int profileTierLevelIdx )                   { return m_profileRefMinus1             [ profileTierLevelIdx ]; } 
+  
+  Bool getVpsMoreOutputLayerSetsThanDefaultFlag()                                            { return m_vpsMoreOutputLayerSetsThanDefaultFlag               ; } 
+  Void setVpsMoreOutputLayerSetsThanDefaultFlag( Bool flag )                                 { m_vpsMoreOutputLayerSetsThanDefaultFlag                = flag; } 
+
+  Int  getNumAddOutputLayerSetsMinus1          ()                                            { return m_numAddOutputLayerSetsMinus1                         ; } 
+  Void setNumAddOutputLayerSetsMinus1          ( Int val )                                   { m_numAddOutputLayerSetsMinus1                          = val;  } 
+  
+  Bool getDefaultOneTargetOutputLayerFlag      ()                                            { return m_defaultOneTargetOutputLayerFlag                     ; } 
+  Void setDefaultOneTargetOutputLayerFlag      ( Bool flag )                                 { m_defaultOneTargetOutputLayerFlag                      = flag; } 
+  
+  Int  getOutputLayerSetIdxMinus1              ( Int outLayerSetIdx )                        { return m_outputLayerSetIdxMinus1      [ outLayerSetIdx ]     ; } 
+  Void setOutputLayerSetIdxMinus1              ( Int outLayerSetIdx, Int val )               { m_outputLayerSetIdxMinus1      [ outLayerSetIdx ]      = val;  } 
+  
+  Int  getProfileLevelTierIdx                  ( Int outLayerSetIdx )                        { return m_profileLevelTierIdx          [ outLayerSetIdx ]     ; } 
+  Void setProfileLevelTierIdx                  ( Int outLayerSetIdx, Int val )               { m_profileLevelTierIdx          [ outLayerSetIdx ]      = val;  } 
+  
+  Bool getMaxOneActiveRefLayerFlag()                                                         { return m_maxOneActiveRefLayerFlag                            ; } 
+  Void setMaxOneActiveRefLayerFlag             ( Bool flag)                                  { m_maxOneActiveRefLayerFlag                             = flag; } 
+  
+  Int  getDirectDepTypeLenMinus2()                                                           { return m_directDepTypeLenMinus2                              ; } 
+  Void setDirectDepTypeLenMinus2               ( Int val)                                    { m_directDepTypeLenMinus2                               = val;  } 
+  
+  Int  getDirectDependencyType                 ( Int depLayeridInVps, Int refLayeridInVps)   { return m_directDependencyType         [ depLayeridInVps ][ refLayeridInVps ]; } 
+  Void setDirectDependencyType                 ( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType         [ depLayeridInVps ][ refLayeridInVps ] = val ; } 
+
+  Int  getProfileLevelTierIdxLen() 
+  { 
+    return xCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 );     
+  };
+
+  Int  getNumLayersInIdList              ( Int lsIdx )
+  {
+    assert( lsIdx > 0 ); 
+    assert( lsIdx <= getMaxOpSets() ); 
+    Int numLayersInIdList = 0; 
+    for (Int layerId = 0; layerId < getVpsMaxLayerId(); layerId++ )
+    {
+      numLayersInIdList += ( getLayerIdIncludedFlag( lsIdx, layerId ) ); 
+    }
+    return numLayersInIdList; 
+  }; 
+  
 #endif
 };
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 483)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 488)
@@ -155,4 +155,7 @@
 #if H_MV
 #define MAX_NUM_LAYERS                  64
+#define MAX_VPS_PROFILE_TIER_LEVEL      64
+#define MAX_VPS_ADD_OUTPUT_LAYER_SETS   1024
+#define MAX_VPS_OUTPUTLAYER_SETS        ( MAX_VPS_ADD_OUTPUT_LAYER_SETS + MAX_VPS_OP_SETS_PLUS1 )
 #endif
 
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 483)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 488)
@@ -811,6 +811,6 @@
   assert( pcVPS->getNumHrdParameters() < MAX_VPS_OP_SETS_PLUS1 );
 #if H_MV
-  assert( pcVPS->getMaxNuhLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );
-  READ_CODE( 6, uiCode, "vps_max_nuh_layer_id" );   pcVPS->setMaxNuhLayerId( uiCode );
+  assert( pcVPS->getVpsMaxLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );
+  READ_CODE( 6, uiCode, "vps_max_nuh_layer_id" );   pcVPS->setVpsMaxLayerId( uiCode );
 #else
   assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 );
@@ -822,5 +822,5 @@
     // Operation point set
 #if H_MV
-    for( UInt i = 0; i <= pcVPS->getMaxNuhLayerId(); i ++ )
+    for( UInt i = 0; i <= pcVPS->getVpsMaxLayerId(); i ++ )
 #else
     for( UInt i = 0; i <= pcVPS->getMaxNuhReservedZeroLayerId(); i ++ )
@@ -932,10 +932,10 @@
     for( Int layerSet = 0; layerSet < pcVPS->getNumOutputLayerSets(); layerSet++ )
     {
-      READ_UVLC( uiCode, "output_layer_set_idx[i]" );              pcVPS->setOutputLayerSetIdx( layerSet, uiCode );
-      for( Int layer = 0; layer <= pcVPS->getMaxNuhLayerId(); layer++ )
-      {
-        if( pcVPS->getLayerIdIncludedFlag( pcVPS->getOutputLayerSetIdx( layerSet ), layer ) == true )
-        {
-          READ_FLAG( uiCode, "output_layer_flag" );                 pcVPS->setOutputLayerFlag( layerSet, layer, uiCode == 1 ? true : false );
+      READ_UVLC( uiCode, "output_layer_set_idx[i]" );              pcVPS->setOutputLayerSetIdxMinus1( layerSet, uiCode );
+      for( Int layer = 0; layer <= pcVPS->getVpsMaxLayerId(); layer++ )
+      {
+        if( pcVPS->getLayerIdIncludedFlag( pcVPS->getOutputLayerSetIdxMinus1( layerSet ), layer ) == true )
+        {
+//          READ_FLAG( uiCode, "output_layer_flag" );                 pcVPS->setOutputLayerFlag( layerSet, layer, uiCode == 1 ? true : false );
         }
       }
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 483)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 488)
@@ -623,6 +623,6 @@
   assert( pcVPS->getNumHrdParameters() <= MAX_VPS_NUM_HRD_PARAMETERS );
 #if H_MV
-  assert( pcVPS->getMaxNuhLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );
-  WRITE_CODE( pcVPS->getMaxNuhLayerId(), 6,                 "vps_max_nuh_layer_id" );
+  assert( pcVPS->getVpsMaxLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );
+  WRITE_CODE( pcVPS->getVpsMaxLayerId(), 6,                 "vps_max_layer_id" );
 #else
   assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 );
@@ -635,5 +635,5 @@
     // Operation point set
 #if H_MV
-    for( UInt i = 0; i <= pcVPS->getMaxNuhLayerId(); i ++ )
+    for( UInt i = 0; i <= pcVPS->getVpsMaxLayerId(); i ++ )
 #else
     for( UInt i = 0; i <= pcVPS->getMaxNuhReservedZeroLayerId(); i ++ )
@@ -685,49 +685,30 @@
 
   WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0,          "avc_base_layer_flag" );
-  WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0,             "splitting_flag" );
+  WRITE_FLAG( pcVPS->getSplittingFlag()    ? 1 : 0,          "splitting_flag" );
+
+  for( Int type = 0; type < MAX_NUM_SCALABILITY_TYPES; type++ )
+  {
+    WRITE_FLAG( pcVPS->getScalabilityMask( type ) ? 1 : 0,   "scalability_mask[i]" );
+  }
+
+  for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ) - ( pcVPS->getSplittingFlag() ? 1 : 0 ); sIdx++ )
+  {
+    WRITE_CODE( pcVPS->getDimensionIdLen( sIdx ) - 1 , 3,    "dimension_id_len_minus1[j]");    
+  }
+
+  WRITE_FLAG( pcVPS->getVpsNuhLayerIdPresentFlag() ? 1 : 0,  "vps_nuh_layer_id_present_flag");
   
-  for( Int type = 0; type < MAX_NUM_SCALABILITY_TYPES; type++ )
-  {
-    WRITE_FLAG( pcVPS->getScalabilityMask( type ) ? 1 : 0,   "scalability_mask[i]" );
-  }
-
-  for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ); sIdx++ )
-  {
-    WRITE_CODE( pcVPS->getDimensionIdLen( sIdx ) - 1 , 3,    "dimension_id_len_minus1[j]");    
-  }
-
-  WRITE_FLAG( pcVPS->getVpsNuhLayerIdPresentFlag() ? 1 : 0,  "vps_nuh_layer_id_present_flag");
-
-  // already updated to JCT3V-D0220
-  for( Int layer = 0; layer <= pcVPS->getMaxLayers() - 1; layer++ )
-  {
-    if ( ( layer != 0 ) && pcVPS->getVpsNuhLayerIdPresentFlag() )
-      WRITE_CODE( pcVPS->getLayerIdInNuh( layer ), 6,          "layer_id_in_nuh[i]");
-    for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes() ; sIdx++ )
-    {      
-      WRITE_CODE( pcVPS->getDimensionId( layer, sIdx ), pcVPS->getDimensionIdLen( sIdx ), "dimension_id[i][j]");      
-    }
-  }
-
-  for( Int layerSet = 1; layerSet <= pcVPS->getMaxOpSets() - 1; layerSet++ )
-  {
-    WRITE_FLAG( pcVPS->getVpsProfilePresentFlag( layerSet ) ? 1 : 0, "vps_profile_present_flag[lsIdx]" );
-    if( pcVPS->getVpsProfilePresentFlag( layerSet ) == false )
-    {
-      WRITE_UVLC( pcVPS->getProfileLayerSetRefMinus1( layerSet ), "profile_layer_set_ref_minus1[lsIdx]" );
-    }
-    codePTL( pcVPS->getPTL( layerSet ), pcVPS->getVpsProfilePresentFlag( layerSet ), pcVPS->getMaxTLayers() - 1 );
-  }
-
-  WRITE_UVLC( pcVPS->getNumOutputLayerSets(),                "num_output_layer_sets" );
-
-  for( Int layerSet = 0; layerSet < pcVPS->getNumOutputLayerSets(); layerSet++ )
-  {
-    WRITE_UVLC( pcVPS->getOutputLayerSetIdx( layerSet ),      "output_layer_set_idx[i]" );
-    for( Int layer = 0; layer <= pcVPS->getMaxNuhLayerId(); layer++ )
-    {
-      if( pcVPS->getLayerIdIncludedFlag( pcVPS->getOutputLayerSetIdx( layerSet ), layer ) == true )
-      {
-        WRITE_FLAG( pcVPS->getOutputLayerFlag( layerSet, layer ) ? 1 : 0, "output_layer_flag" );
+  for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ )
+  {
+    if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( i > 0 ) )
+    {
+      WRITE_CODE( pcVPS->getLayerIdInNuh( i ), 6,          "layer_id_in_nuh[i]");
+    }
+
+    if ( !pcVPS->getSplittingFlag() )
+    {    
+      for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ )
+      {      
+        WRITE_CODE( pcVPS->getDimensionId( i, j ), pcVPS->getDimensionIdLen( j ), "dimension_id[i][j]");      
       }
     }
@@ -741,11 +722,76 @@
     }
   }
-  WRITE_FLAG( 0,                                             "vps_extension2_flag" );
+
+  for( Int i = 0; i < pcVPS->getMaxLayers() - 1; i++ )
+  {
+    WRITE_CODE( pcVPS->getMaxTidIlRefPicPlus1( i ), 3,       "max_tid_il_ref_pics_plus1[i]" );
+  }
+
+  WRITE_CODE( pcVPS->getVpsNumberLayerSetsMinus1( )    , 10,    "vps_number_layer_sets_minus1"      );
+  WRITE_CODE( pcVPS->getVpsNumProfileTierLevelMinus1( ), 6,     "vps_num_profile_tier_level_minus1" );
+
+  for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
+  {
+    WRITE_FLAG( pcVPS->getVpsProfilePresentFlag( i ) ? 1 : 0, "vps_profile_present_flag[i]" );
+    if( !pcVPS->getVpsProfilePresentFlag( i ) )
+    {    
+      WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" );
+    }
+
+    codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 );
+  }
+
+  Int numOutputLayerSets = pcVPS->getNumOutputLayerSets(); 
+
+  WRITE_FLAG( pcVPS->getVpsMoreOutputLayerSetsThanDefaultFlag( ) ? 1 : 0, "more_output_layer_sets_than_default_flag" );
+
+  if ( pcVPS->getVpsMoreOutputLayerSetsThanDefaultFlag( ) )
+  {
+    WRITE_CODE( pcVPS->getNumAddOutputLayerSetsMinus1( )    , 10,    "num_add_output_layer_sets_minus1"      );
+    numOutputLayerSets += pcVPS->getNumAddOutputLayerSetsMinus1( ); 
+  }
+
+  if( numOutputLayerSets > 1)
+  {
+    WRITE_FLAG( pcVPS->getDefaultOneTargetOutputLayerFlag( ) ? 1 : 0, "default_one_target_output_layer_flag" );
+  }  
+
+  for( Int i = 1; i < numOutputLayerSets; i++ )
+  {
+    if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) )
+    {
+      Int lsIdx = pcVPS->getOutputLayerSetIdxMinus1( i ) + 1; 
+      WRITE_UVLC( lsIdx,      "output_layer_set_idx[i]" );
+
+      for( Int j = 0; j <= pcVPS->getNumLayersInIdList( j ); j++ )
+      {
+        //WRITE_FLAG( pcVPS->getOutputLayerFlag( i, j) ? 1 : 0, "output_layer_flag" );
+      }
+
+      WRITE_CODE( pcVPS->getProfileLevelTierIdx( i ), pcVPS->getProfileLevelTierIdxLen() ,"profile_level_tier_idx[ i ]" );   
+    }
+  }
+
+  WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" );
+  WRITE_UVLC( pcVPS->getDirectDepTypeLenMinus2 ( ),         "direct_dep_type_len_minus2"); 
+
+    for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )
+    {
+      for( Int j = 0; j < i; j++ )
+      {
+        WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2,  "direct_dependency_type[i][j]" );
+      }
+    }
+
+    WRITE_FLAG ( 0,                    "vps_shvc_reserved_zero_flag" ); 
+#if H_3D
+    WRITE_FLAG( 0,                     "vps_extension2_flag" );
+#endif
 #else
   WRITE_FLAG( 0,                     "vps_extension_flag" );
 #endif
-  
+
   //future extensions here..
-  
+
   return;
 }
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibExtractor/TExtrTop.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibExtractor/TExtrTop.cpp	(revision 483)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibExtractor/TExtrTop.cpp	(revision 488)
@@ -101,5 +101,5 @@
 { 
   rcVpsInfoHandle << "MaxLayers = "     << m_cVPS.getMaxLayers()     << std::endl; 
-  rcVpsInfoHandle << "MaxNuhLayerId = " << m_cVPS.getMaxNuhLayerId() << std::endl; 
+  rcVpsInfoHandle << "MaxNuhLayerId = " << m_cVPS.getVpsMaxLayerId() << std::endl; 
   
   for ( Int layerIdxInVps = 0; layerIdxInVps < m_cVPS.getMaxLayers(); layerIdxInVps++ )
