Index: branches/HTM-5.0-Qualcomm/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/HTM-5.0-Qualcomm/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 192)
+++ branches/HTM-5.0-Qualcomm/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 194)
@@ -329,4 +329,7 @@
   /* Camera Paremetes */
   ("CameraParameterFile,cpf", m_pchCameraParameterFile,    (Char *) 0, "Camera Parameter File Name")
+#if MVHEVC
+  ("BaseViewCameraNumbers" ,  m_aiVId,     std::vector<Int>(1, MAX_VIEW_NUM), "Numbers of base views")
+#endif
   ("BaseViewCameraNumbers" ,  m_pchBaseViewCameraNumbers,  (Char *) 0, "Numbers of base views")
 
@@ -786,4 +789,5 @@
 }
 #else
+#if !MVHEVC
   m_cCameraData     .init     ( (UInt)m_iNumberOfViews,
     m_uiInputBitDepth,
@@ -797,10 +801,12 @@
     LOG2_DISP_PREC_LUT );
 #endif
+#endif
 
 
   // check validity of input parameters
   xCheckParameter();
+#if !MVHEVC
   m_cCameraData.check( false, true );
-  
+#endif
   // print-out parameters
   xPrintParameter();
Index: branches/HTM-5.0-Qualcomm/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- branches/HTM-5.0-Qualcomm/source/App/TAppEncoder/TAppEncCfg.h	(revision 192)
+++ branches/HTM-5.0-Qualcomm/source/App/TAppEncoder/TAppEncCfg.h	(revision 194)
@@ -109,4 +109,7 @@
   std::vector<Double>  m_adQP;                                ///< QP value of key-picture (floating point) [0] video, [1] depth
   std::vector<Int>     m_aiQP;                                ///< QP value of key-picture (integer) [0] video, [1] depth
+#if MVHEVC
+  std::vector<Int>     m_aiVId;                                ///< view id
+#endif
   Int       m_aiTLayerQPOffset[MAX_TLAYER];                   ///< QP offset corresponding to temporal layer depth
   char*     m_pchdQPFile;                                     ///< QP offset for each slice (initialized from external file)
@@ -285,6 +288,7 @@
   Char*     m_pchCameraParameterFile;                         ///< camera parameter file
   Char*     m_pchBaseViewCameraNumbers;
+#if !MVHEVC
   TAppComCamPara m_cCameraData;
-
+#endif
   Int       m_iCodedCamParPrecision;                          ///< precision for coding of camera parameters
 
Index: branches/HTM-5.0-Qualcomm/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/HTM-5.0-Qualcomm/source/App/TAppEncoder/TAppEncTop.cpp	(revision 192)
+++ branches/HTM-5.0-Qualcomm/source/App/TAppEncoder/TAppEncTop.cpp	(revision 194)
@@ -67,9 +67,15 @@
 Void TAppEncTop::xInitLibCfg()
 {
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|MVHEVC
+#if !MVHEVC
   UInt layerId = 0;
+#endif
   // TODO: fix the assumption here that the temporal structures are all equal across all layers???
   m_cVPS.setMaxTLayers( m_maxTempLayer[0] );
+#if MVHEVC
+  m_cVPS.setMaxLayers( m_iNumberOfViews );
+#else
   m_cVPS.setMaxLayers( m_iNumberOfViews * (m_bUsingDepthMaps ? 2:1) );
+#endif
   for(Int i = 0; i < MAX_TLAYER; i++)
   {
@@ -101,4 +107,8 @@
     m_acTEncTopList[iViewIdx]->setViewId                       ( iViewIdx );
     m_acTEncTopList[iViewIdx]->setIsDepth                      ( false );
+#if MVHEVC
+    m_acTEncTopList[iViewIdx]->setLayerId                      ( iViewIdx );
+    m_cVPS.setViewId                                           ( m_aiVId[ iViewIdx ], iViewIdx );
+#else
     m_acTEncTopList[iViewIdx]->setViewOrderIdx                 ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] );
 #if VIDYO_VPS_INTEGRATION
@@ -117,4 +127,5 @@
     m_acTEncTopList[iViewIdx]->setCodedScale                   ( m_cCameraData.getCodedScale             () );
     m_acTEncTopList[iViewIdx]->setCodedOffset                  ( m_cCameraData.getCodedOffset            () );
+#endif   
 
   //====== Coding Structure ========
@@ -406,5 +417,9 @@
       m_acTEncDepthTopList[iViewIdx]->setViewId                       ( iViewIdx );
       m_acTEncDepthTopList[iViewIdx]->setIsDepth                      ( true );
+#if MVHEVC
+      m_acTEncDepthTopList[iViewIdx]->setLayerId                      ( iViewIdx );
+#else
       m_acTEncDepthTopList[iViewIdx]->setViewOrderIdx                 ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] );
+#endif
 #if VIDYO_VPS_INTEGRATION
       layerId = iViewIdx * 2 + 1;
@@ -821,4 +836,14 @@
   {
     m_acTEncTopList[iViewIdx]->init( this );
+#if MVHEVC
+  //set setNumDirectRefLayer
+  Int iNumDirectRef = m_acTEncTopList[iViewIdx]->getSPS()->getNumberOfUsableInterViewRefs();
+  m_acTEncTopList[iViewIdx]->getEncTop()->getVPS()->setNumDirectRefLayer(iNumDirectRef, iViewIdx);
+  for(Int iNumIvRef = 0; iNumIvRef < iNumDirectRef; iNumIvRef ++)
+  {
+    Int iLayerId = m_acTEncTopList[iViewIdx]->getSPS()->getUsableInterViewRef(iNumIvRef);
+    m_acTEncTopList[iViewIdx]->getEncTop()->getVPS()->setDirectRefLayerId( iLayerId + iViewIdx, iViewIdx, iNumIvRef);
+  }
+#endif
   }
   for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
@@ -862,5 +887,7 @@
   TComPicYuv*       pcPicYuvOrg = new TComPicYuv;
   TComPicYuv*       pcDepthPicYuvOrg = new TComPicYuv;
+#if !MVHEVC
   TComPicYuv*       pcPdmDepthOrg    = new TComPicYuv;
+#endif
   TComPicYuv*       pcPicYuvRec = NULL;
   TComPicYuv*       pcDepthPicYuvRec = NULL;
@@ -963,4 +990,5 @@
     {
       Int  iNumEncoded = 0;
+#if !MVHEVC
       UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId );
       if ( iNextPoc < m_iFrameToBeEncoded )
@@ -968,4 +996,5 @@
       m_cCameraData.update( iNextPoc );
       }
+#endif
       for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
       {
@@ -1022,6 +1051,11 @@
   delete pcDepthPicYuvOrg;
   pcDepthPicYuvOrg = NULL;
-  
+
+#if !MVHEVC
+#if BUG_FIX_HTM
+  if ( pcPdmDepthOrg != NULL && m_uiMultiviewMvRegMode )
+#else
   if ( pcPdmDepthOrg != NULL )
+#endif
   {
     pcPdmDepthOrg->destroy();
@@ -1029,5 +1063,5 @@
     pcPdmDepthOrg = NULL; 
   };
-
+#endif
   
   for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
@@ -1233,5 +1267,7 @@
     case NAL_UNIT_CODED_SLICE:
 #if H0566_TLA
+#if !QC_REM_IDV
     case NAL_UNIT_CODED_SLICE_IDV:
+#endif
     case NAL_UNIT_CODED_SLICE_TLA:
     case NAL_UNIT_CODED_SLICE_CRA:
Index: branches/HTM-5.0-Qualcomm/source/App/TAppEncoder/TAppEncTop.h
===================================================================
--- branches/HTM-5.0-Qualcomm/source/App/TAppEncoder/TAppEncTop.h	(revision 192)
+++ branches/HTM-5.0-Qualcomm/source/App/TAppEncoder/TAppEncTop.h	(revision 194)
@@ -87,5 +87,5 @@
 #endif
 
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|MVHEVC
   TComVPS                     m_cVPS;
 #endif
@@ -139,4 +139,7 @@
 #endif
   
+#if MVHEVC
+  TComVPS*          getVPS()  { return &m_cVPS; }
+#endif
 #if VIDYO_VPS_INTEGRATION
   TComVPS*          getVPS()  { return &m_cVPS; }
