Index: branches/HTM-DEV-0.3-dev0/source/Lib/TAppCommon/program_options_lite.h
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TAppCommon/program_options_lite.h	(revision 493)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TAppCommon/program_options_lite.h	(revision 495)
@@ -375,17 +375,26 @@
       {
         std::string cNameBuffer;
-        std::string cDescriptionBuffer;
-
-        cNameBuffer       .resize( name.size() + 10 );
-        cDescriptionBuffer.resize( desc.size() + 10 );
+        std::string cDescBuffer;
+
+        cNameBuffer.resize( name.size() + 10 );
+        cDescBuffer.resize( desc.size() + 10 );
 
         storage.resize(uiMaxNum);
         for ( unsigned int uiK = 0; uiK < uiMaxNum; uiK++ )
         {
+          Bool duplicate = (uiK != 0); 
           // isn't there are sprintf function for string??
-          sprintf((char*) cNameBuffer.c_str()       ,name.c_str(),uiK,uiK);
-          sprintf((char*) cDescriptionBuffer.c_str(),desc.c_str(),uiK,uiK);
-
-          parent.addOption(new Option<T>( cNameBuffer, (storage[uiK]), default_val, cDescriptionBuffer, uiK != 0 ));
+          sprintf((char*) cNameBuffer.c_str(),name.c_str(),uiK,uiK);
+
+          if ( !duplicate )
+          {          
+            sprintf((char*) cDescBuffer.c_str(),desc.c_str(),uiK,uiK);
+          }
+
+          cNameBuffer.resize( std::strlen(cNameBuffer.c_str()) );  
+          cDescBuffer.resize( std::strlen(cDescBuffer.c_str()) ); 
+          
+
+          parent.addOption(new Option<T>( cNameBuffer, (storage[uiK]), default_val, cDescBuffer, duplicate ));
         }
 
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComRom.h
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComRom.h	(revision 493)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComRom.h	(revision 495)
@@ -162,5 +162,5 @@
 
 #ifndef ENC_DEC_TRACE
-# define ENC_DEC_TRACE 0
+# define ENC_DEC_TRACE 1
 #endif
 
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 493)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 495)
@@ -1457,4 +1457,12 @@
   }
 #if H_MV
+  for (Int lsIdx = 0; lsIdx < MAX_VPS_OP_SETS_PLUS1; lsIdx++ )
+  {  
+    for( Int layerId = 0; layerId < MAX_VPS_NUH_LAYER_ID_PLUS1; layerId++ )
+    {
+      m_layerIdIncludedFlag[lsIdx][layerId] = false; 
+    }
+  } 
+
   m_vpsNumberLayerSetsMinus1     = -1; 
   m_vpsNumProfileTierLevelMinus1 = -1; 
@@ -1472,5 +1480,5 @@
   {
     m_outputLayerSetIdxMinus1[i]  = -1; 
-    m_profileLevelTierIdx[i]      = -1; 
+    m_profileLevelTierIdx[i]      = 0; 
     for ( Int j = 0; j < MAX_VPS_NUH_LAYER_ID_PLUS1; j++)
     {
@@ -1480,5 +1488,5 @@
   
   m_maxOneActiveRefLayerFlag = false; 
-  m_directDepTypeLenMinus2   = -1;         
+  m_directDepTypeLenMinus2   = 0;         
   
 
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 493)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 495)
@@ -674,6 +674,6 @@
   Int     getVpsNumProfileTierLevelMinus1( )                               { return m_vpsNumProfileTierLevelMinus1; } 
   
-  Void    setVpsProfilePresentFlag( Int layerSet, Bool val )               { m_vpsProfilePresentFlag[layerSet] = val;  }
-  Bool    getVpsProfilePresentFlag( Int layerSet )                         { return m_vpsProfilePresentFlag[layerSet]; }
+  Void    setVpsProfilePresentFlag( Int idx, Bool val )                    { m_vpsProfilePresentFlag[idx] = val;  }
+  Bool    getVpsProfilePresentFlag( Int idx )                              { return m_vpsProfilePresentFlag[idx]; }
 
   Void    setProfileRefMinus1( Int profileTierLevelIdx, Int val )          { m_profileRefMinus1[ profileTierLevelIdx ] = val;  } 
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 493)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 495)
@@ -57,5 +57,5 @@
 
 #ifndef HEVC_EXT
-#define HEVC_EXT                    2
+#define HEVC_EXT                    1
 #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 493)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 495)
@@ -560,4 +560,8 @@
   UInt  uiCode;
   READ_CODE( 4,  uiCode, "sps_video_parameter_set_id");          pcSPS->setVPSId        ( uiCode );
+#if H_MV
+  if ( pcSPS->getLayerId() == 0 )
+  {
+#endif
   READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
   READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
@@ -566,7 +570,9 @@
     // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0
     assert( uiCode == 1 );
-  }
-  
+  }  
   parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
+#if H_MV
+  }
+#endif
   READ_UVLC(     uiCode, "sps_seq_parameter_set_id" );           pcSPS->setSPSId( uiCode );
   READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( uiCode );
@@ -726,5 +732,4 @@
 #else
     READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" );    pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false);
-    READ_FLAG( uiCode, "sps_extension2_flag");
     ////   sps_extension_vui_parameters( )
     if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() )
@@ -747,5 +752,5 @@
     ////   sps_extension_vui_parameters( ) END
     READ_UVLC( uiCode, "sps_shvc_reserved_zero_idc" ); 
-
+    READ_FLAG( uiCode, "sps_extension2_flag");
     if ( uiCode )
     {
@@ -756,4 +761,5 @@
       }
 #else
+      
       UInt uiCamParPrecision = 0; 
       Bool bCamParSlice      = false; 
@@ -839,5 +845,5 @@
 #if H_MV
   assert( pcVPS->getVpsMaxLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );
-  READ_CODE( 6, uiCode, "vps_max_nuh_layer_id" );   pcVPS->setVpsMaxLayerId( uiCode );
+  READ_CODE( 6, uiCode, "vps_max_layer_id" );   pcVPS->setVpsMaxLayerId( uiCode );
 
   READ_UVLC(    uiCode, "vps_max_num_layer_sets_minus1" );               pcVPS->setVpsNumLayerSetsMinus1( uiCode );
@@ -950,5 +956,5 @@
     READ_CODE( 6,  uiCode, "vps_num_profile_tier_level_minus1" );  pcVPS->setVpsNumProfileTierLevelMinus1( uiCode );
 
-    for( Int i = 1; i <= pcVPS->getVpsNumberLayerSetsMinus1(); i++ )
+    for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
     {
       READ_FLAG(  uiCode, "vps_profile_present_flag[i]" );    pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 );
@@ -986,8 +992,11 @@
       {        
         READ_UVLC( uiCode,      "output_layer_set_idx_minus1[i]" ); pcVPS->setOutputLayerSetIdxMinus1( i, uiCode ); 
-        for( Int j = 0; j <= pcVPS->getNumLayersInIdList( j ); j++ )
+        for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ )
         {
           READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( i, j, uiCode == 1 ); 
-        }
+        }        
+      }
+      if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
+      {      
         READ_CODE( pcVPS->getProfileLevelTierIdxLen(), uiCode,"profile_level_tier_idx[ i ]" );   pcVPS->setProfileLevelTierIdx( i , uiCode ); 
       }
@@ -1001,5 +1010,8 @@
       for( Int j = 0; j < i; j++ )
       {
-        READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2,  uiCode, "direct_dependency_type[i][j]" ); pcVPS->setDirectDependencyType( i, j , uiCode);
+        if (pcVPS->getDirectDependencyFlag( i, j) )
+        {        
+          READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2,  uiCode, "direct_dependency_type[i][j]" ); pcVPS->setDirectDependencyType( i, j , uiCode);
+        }
       }
     }
@@ -1156,4 +1168,7 @@
       rps->setNumberOfPictures(0);
       rpcSlice->setRPS(rps);
+#if H_MV
+      rpcSlice->setEnableTMVPFlag(false);
+#endif
     }
     else
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 493)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 495)
@@ -449,7 +449,14 @@
 #endif
   WRITE_CODE( pcSPS->getVPSId (),          4,       "sps_video_parameter_set_id" );
+#if H_MV
+  if ( pcSPS->getLayerId() == 0 )
+  {
+#endif
   WRITE_CODE( pcSPS->getMaxTLayers() - 1,  3,       "sps_max_sub_layers_minus1" );
   WRITE_FLAG( pcSPS->getTemporalIdNestingFlag() ? 1 : 0,                             "sps_temporal_id_nesting_flag" );
   codePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
+#if H_MV
+}
+#endif
   WRITE_UVLC( pcSPS->getSPSId (),                   "sps_seq_parameter_set_id" );
   WRITE_UVLC( pcSPS->getChromaFormatIdc (),         "chroma_format_idc" );
@@ -795,8 +802,11 @@
     {      
       WRITE_UVLC( pcVPS->getOutputLayerSetIdxMinus1( i ),      "output_layer_set_idx_minus1[i]" );
-      for( Int j = 0; j <= pcVPS->getNumLayersInIdList( j ); j++ )
+      for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1 ; j++ )
       {
         WRITE_FLAG( pcVPS->getOutputLayerFlag( i, j) ? 1 : 0, "output_layer_flag" );
-      }
+      }      
+    }
+    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
+    {      
       WRITE_CODE( pcVPS->getProfileLevelTierIdx( i ), pcVPS->getProfileLevelTierIdxLen() ,"profile_level_tier_idx[ i ]" );   
     }
@@ -810,5 +820,9 @@
       for( Int j = 0; j < i; j++ )
       {
-        WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2,  "direct_dependency_type[i][j]" );
+        if (pcVPS->getDirectDependencyFlag( i, j) )
+        {        
+          assert ( pcVPS->getDirectDependencyType( i, j ) != -1 ); 
+          WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2,  "direct_dependency_type[i][j]" );
+        }
       }
     }
@@ -1171,5 +1185,4 @@
       {
         WRITE_FLAG( pcSlice->getAltCollocatedIndicationFlag( ) ? 1 : 0 , "alt_collocated_indication_flag" );
-
         if( pcSlice->getAltCollocatedIndicationFlag() && pcSlice->getNumActiveMotionPredRefLayers() > 1 ) 
         {          
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 493)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 495)
@@ -835,4 +835,10 @@
       pcSlice->setEnableTMVPFlag(0);
     }
+#if H_MV
+    if( pcSlice->getIdrPicFlag() )
+    {
+      pcSlice->setEnableTMVPFlag(0);
+    }
+#endif
 
 #if H_3D_VSO
