Index: trunk/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- trunk/source/App/TAppEncoder/TAppEncTop.cpp	(revision 58)
+++ trunk/source/App/TAppEncoder/TAppEncTop.cpp	(revision 77)
@@ -67,4 +67,16 @@
 Void TAppEncTop::xInitLibCfg()
 {
+#if VIDYO_VPS_INTEGRATION
+  UInt layerId = 0;
+  // TODO: fix the assumption here that the temporal structures are all equal across all layers???
+  m_cVPS.setMaxTLayers( m_maxTempLayer[0] );
+  m_cVPS.setMaxLayers( m_iNumberOfViews * (m_bUsingDepthMaps ? 2:1) );
+  for(Int i = 0; i < MAX_TLAYER; i++)
+  {
+    m_cVPS.setNumReorderPics( m_numReorderPics[0][i], i );
+    m_cVPS.setMaxDecPicBuffering( m_maxDecPicBuffering[0][i], i );
+  }
+#endif
+  
   for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
   {
@@ -90,4 +102,15 @@
     m_acTEncTopList[iViewIdx]->setIsDepth                      ( false );
     m_acTEncTopList[iViewIdx]->setViewOrderIdx                 ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] );
+#if VIDYO_VPS_INTEGRATION
+    layerId = iViewIdx * (m_bUsingDepthMaps ? 2:1);
+    m_acTEncTopList[iViewIdx]->setLayerId                      ( layerId );
+    m_cVPS.setDepthFlag                                        ( false, layerId );
+    m_cVPS.setViewId                                           ( iViewIdx, layerId );
+    m_cVPS.setViewOrderIdx                                     ( m_cCameraData.getViewOrderIndex()[ iViewIdx ], layerId );
+    // TODO: set correct dependentFlag and dependentLayer
+    m_cVPS.setDependentFlag                                    ( iViewIdx ? true:false, layerId );
+    m_cVPS.setDependentLayer                                   ( layerId - (m_bUsingDepthMaps ? 2:1), layerId );
+#endif
+    
     m_acTEncTopList[iViewIdx]->setCamParPrecision              ( m_cCameraData.getCamParsCodedPrecision  () );
     m_acTEncTopList[iViewIdx]->setCamParInSliceHeader          ( m_cCameraData.getVaryingCameraParameters() );
@@ -364,4 +387,13 @@
       m_acTEncDepthTopList[iViewIdx]->setIsDepth                      ( true );
       m_acTEncDepthTopList[iViewIdx]->setViewOrderIdx                 ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] );
+#if VIDYO_VPS_INTEGRATION
+      layerId = iViewIdx * 2 + 1;
+      m_acTEncDepthTopList[iViewIdx]->setLayerId                      ( layerId );
+      m_cVPS.setDepthFlag                                             ( true, layerId );
+      m_cVPS.setViewId                                                ( iViewIdx, layerId );
+      m_cVPS.setViewOrderIdx                                          ( m_cCameraData.getViewOrderIndex()[ iViewIdx ], layerId );
+      m_cVPS.setDependentFlag                                         ( true, layerId );
+      m_cVPS.setDependentLayer                                        ( layerId-1, layerId);
+#endif
       m_acTEncDepthTopList[iViewIdx]->setCamParPrecision              ( 0 );
       m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader          ( false );
@@ -1134,4 +1166,7 @@
     case NAL_UNIT_SPS:
     case NAL_UNIT_PPS:
+#if VIDYO_VPS_INTEGRATION
+    case NAL_UNIT_VPS:
+#endif
       m_essentialBytes += *it_stats;
       break;
Index: trunk/source/App/TAppEncoder/TAppEncTop.h
===================================================================
--- trunk/source/App/TAppEncoder/TAppEncTop.h	(revision 58)
+++ trunk/source/App/TAppEncoder/TAppEncTop.h	(revision 77)
@@ -80,8 +80,15 @@
 
 #if DEPTH_MAP_GENERATION
+#if VIDYO_VPS_INTEGRATION
+  TComVPSAccess               m_cVPSAccess;
+#endif
   TComSPSAccess               m_cSPSAccess;
   TComAUPicAccess             m_cAUPicAccess;
 #endif
 
+#if VIDYO_VPS_INTEGRATION
+  TComVPS                     m_cVPS;
+#endif
+  
 #if HHI_VSO
   TRenTop                     m_cRendererTop; 
@@ -131,4 +138,9 @@
 #endif
   
+#if VIDYO_VPS_INTEGRATION
+  TComVPS*          getVPS()  { return &m_cVPS; }
+  TComVPSAccess*    getVPSAccess  () { return &m_cVPSAccess;   }
+#endif
+  
 #if DEPTH_MAP_GENERATION
   TComSPSAccess*    getSPSAccess  () { return &m_cSPSAccess;   }
