Index: /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/baseCfg_3view.cfg
===================================================================
--- /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/baseCfg_3view.cfg	(revision 480)
+++ /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/baseCfg_3view.cfg	(revision 481)
@@ -160,4 +160,5 @@
 
 #========== multiview coding tools ==========
-IvMvPred           : 1                                 # Inter-view motion prediction### DO NOT ADD ANYTHING BELOW THIS LINE ###
+IvMvPred           : 1                                 # Inter-view motion prediction
+### DO NOT ADD ANYTHING BELOW THIS LINE ###
 ### DO NOT DELETE THE EMPTY LINE BELOW ###
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.cpp	(revision 480)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.cpp	(revision 481)
@@ -2553,7 +2553,11 @@
 
   Int iPdmDir[2] = {0, 0};
-  getInterViewMergeCands(uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo, iPdmDir );
+  
+  if ( ivMvPredFlag )
+  {
+    getInterViewMergeCands(uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo, iPdmDir );
+  }  
+    
   Int iPdmInterDir;
-
   if( iPdmDir[0] && ivMvPredFlag )
   {
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 480)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 481)
@@ -741,5 +741,5 @@
     }
   }
-#if H_3D_GEN
+#if H_3D_GEN  
   WRITE_FLAG( 1,                                             "vps_extension2_flag" );
   for( Int layer = 0; layer <= pcVPS->getMaxLayers() - 1; layer++ )
@@ -754,5 +754,5 @@
       }          
     }        
-  }
+  }  
 #else
   WRITE_FLAG( 0,                                             "vps_extension2_flag" );
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 480)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 481)
@@ -495,5 +495,5 @@
 
 #if H_3D_GEN
-    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS() );     
+    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), getLayerId() );     
 #else
     m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS() );
@@ -504,7 +504,7 @@
     pcPic  ->setLayerId     ( getLayerId()   );
     pcPic  ->setViewId      ( getViewId()    );    
+#if !H_3D_GEN    
     pcSlice->setLayerId     ( getLayerId() );
     pcSlice->setViewId      ( getViewId()  );    
-#if !H_3D_GEN
     pcSlice->setVPS         ( m_pcEncTop->getVPS() );
 #endif
@@ -512,6 +512,8 @@
     pcPic  ->setViewIndex   ( getViewIndex() ); 
     pcPic  ->setIsDepth( getIsDepth() );
+#if !H_3D_GEN
     pcSlice->setViewIndex   ( getViewIndex()  );
     pcSlice->setIsDepth( getIsDepth() );    
+#endif
     pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );    
 #endif
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 480)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 481)
@@ -177,5 +177,5 @@
  */
 #if H_3D_GEN
-Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS )
+Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, Int layerId )
 #else
 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS )
@@ -186,6 +186,13 @@
   
   rpcSlice = pcPic->getSlice(0);
-#if H_3D_GEN
+#if H_3D_GEN 
+  // GT: Should also be activated for MV-HEVC at some stage
   rpcSlice->setVPS( pVPS );
+  Int vpsLayerId = pVPS->getLayerIdInNuh( layerId ); 
+
+  rpcSlice->setLayerId     ( layerId );
+  rpcSlice->setViewId      ( pVPS->getViewId      ( vpsLayerId ) );    
+  rpcSlice->setViewIndex   ( pVPS->getViewIndex   ( vpsLayerId ) );
+  rpcSlice->setIsDepth     ( pVPS->getDepthId     ( vpsLayerId ) != 0 );    
 #endif
   rpcSlice->setSPS( pSPS );
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.h
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.h	(revision 480)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.h	(revision 481)
@@ -118,5 +118,5 @@
 #if H_3D_GEN
   Void    initEncSlice        ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 
-                                Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS ); 
+                                Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, Int layerId ); 
 #else
   Void    initEncSlice        ( TComPic*  pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd,
