Index: branches/HTM-8.2-dev2-Samsung/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-8.2-dev2-Samsung/source/Lib/TLibCommon/TComDataCU.cpp	(revision 691)
+++ branches/HTM-8.2-dev2-Samsung/source/Lib/TLibCommon/TComDataCU.cpp	(revision 696)
@@ -3522,4 +3522,7 @@
   deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT );
   deriveLeftBottomIdxGeneral  ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB );
+#if SEC_MPI_ENABLING_MERGE_F0150
+  Bool bMPIFlag   = getSlice()->getVPS()->getMPIFlag( getSlice()->getLayerIdInVps() );
+#endif
 #if QC_DEPTH_IV_MRG_F0125
   Bool bIsDepth = getSlice()->getIsDepth();
@@ -3542,5 +3545,9 @@
   /////////////////////////////////////////////
 
+#if SEC_MPI_ENABLING_MERGE_F0150
+  if( bMPIFlag)
+#else
   if( m_pcSlice->getIsDepth())
+#endif
   {
     UInt uiPartIdxCenter;
Index: branches/HTM-8.2-dev2-Samsung/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-8.2-dev2-Samsung/source/Lib/TLibCommon/TComSlice.cpp	(revision 691)
+++ branches/HTM-8.2-dev2-Samsung/source/Lib/TLibCommon/TComSlice.cpp	(revision 696)
@@ -1835,4 +1835,7 @@
 #if H_3D_INTER_SDC
     m_bInterSDCFlag        [ i ] = false;
+#endif
+#if SEC_MPI_ENABLING_MERGE_F0150
+    m_bMPIFlag             [ i ] = false;
 #endif
   }  
Index: branches/HTM-8.2-dev2-Samsung/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-8.2-dev2-Samsung/source/Lib/TLibCommon/TComSlice.h	(revision 691)
+++ branches/HTM-8.2-dev2-Samsung/source/Lib/TLibCommon/TComSlice.h	(revision 696)
@@ -619,4 +619,7 @@
   Bool        m_bInterSDCFlag[MAX_NUM_LAYERS   ];
 #endif
+#if SEC_MPI_ENABLING_MERGE_F0150
+  Bool        m_bMPIFlag[MAX_NUM_LAYERS   ];
+#endif
 
 #endif
@@ -854,5 +857,8 @@
   Void    setInterSDCFlag      ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; }
 #endif
-
+#if SEC_MPI_ENABLING_MERGE_F0150
+  Bool    getMPIFlag      ( Int layerIdInVps )           { return m_bMPIFlag[layerIdInVps]; }
+  Void    setMPIFlag      ( Int layerIdInVps, Bool bval ){ m_bMPIFlag[layerIdInVps] = bval; }
+#endif
 #endif  
 #endif
Index: branches/HTM-8.2-dev2-Samsung/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-8.2-dev2-Samsung/source/Lib/TLibCommon/TypeDef.h	(revision 691)
+++ branches/HTM-8.2-dev2-Samsung/source/Lib/TLibCommon/TypeDef.h	(revision 696)
@@ -131,5 +131,7 @@
                                               // QC_AMVP_MRG_UNIFY_IVCAN_C0051     
                                               // TEXTURE MERGING CANDIDATE     , JCT3V-C0137
-                                              // QC_INRIA_MTK_MRG_E0126            
+                                              // QC_INRIA_MTK_MRG_E0126 
+#define SEC_MPI_ENABLING_MERGE_F0150      1   // MPI flag in VPS and enabling in Merge mode
+
 #define H_3D_TMVP                         1   // QC_TMVP_C0047 
                                               // Sony_M23639
Index: branches/HTM-8.2-dev2-Samsung/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-8.2-dev2-Samsung/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 691)
+++ branches/HTM-8.2-dev2-Samsung/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 696)
@@ -1271,4 +1271,7 @@
         }
 #endif
+#if SEC_MPI_ENABLING_MERGE_F0150
+        READ_FLAG( uiCode, "mpi_flag[i]" );             pcVPS->setMPIFlag( i, uiCode == 1 ? true : false );
+#endif
         READ_FLAG( uiCode, "vps_depth_modes_flag[i]" );             pcVPS->setVpsDepthModesFlag( i, uiCode == 1 ? true : false );
         //          READ_FLAG( uiCode, "lim_qt_pred_flag[i]");                  pcVPS->setLimQtPreFlag     ( i, uiCode == 1 ? true : false ); 
@@ -1818,6 +1821,20 @@
       READ_UVLC( uiCode, "five_minus_max_num_merge_cand");
 #if H_3D_IV_MERGE
+#if SEC_MPI_ENABLING_MERGE_F0150
+      if(rpcSlice->getIsDepth())
+      {
+        Bool bMPIFlag = rpcSlice->getVPS()->getMPIFlag( rpcSlice->getLayerIdInVps() ) ;
+        Bool ivMvPredFlag = rpcSlice->getVPS()->getIvMvPredFlag( rpcSlice->getLayerIdInVps() ) ;
+        rpcSlice->setMaxNumMergeCand(( ( bMPIFlag || ivMvPredFlag ) ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS) - uiCode);
+      }
+      else
+      {
+        Bool ivMvPredFlag = rpcSlice->getVPS()->getIvMvPredFlag( rpcSlice->getLayerIdInVps() ) ;
+        rpcSlice->setMaxNumMergeCand(( ivMvPredFlag ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS) - uiCode);
+      }
+#else
       Bool ivMvPredFlag = rpcSlice->getVPS()->getIvMvPredFlag( rpcSlice->getLayerIdInVps() ) ;
       rpcSlice->setMaxNumMergeCand(( ivMvPredFlag ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS) - uiCode);
+#endif
 #else
       rpcSlice->setMaxNumMergeCand(MRG_MAX_NUM_CANDS - uiCode);
Index: branches/HTM-8.2-dev2-Samsung/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-8.2-dev2-Samsung/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 691)
+++ branches/HTM-8.2-dev2-Samsung/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 696)
@@ -1025,4 +1025,7 @@
         }
 #endif
+#if SEC_MPI_ENABLING_MERGE_F0150
+        WRITE_FLAG( pcVPS->getMPIFlag( i ) ? 1 : 0 ,          "mpi_flag[i]" );
+#endif
         WRITE_FLAG( pcVPS->getVpsDepthModesFlag( i ) ? 1 : 0 ,          "vps_depth_modes_flag[i]" );
         //WRITE_FLAG( pcVPS->getLimQtPredFlag    ( i ) ? 1 : 0 ,          "lim_qt_pred_flag[i]"     ); 
@@ -1411,6 +1414,20 @@
     {
 #if H_3D_IV_MERGE
+#if SEC_MPI_ENABLING_MERGE_F0150
+      if(pcSlice->getIsDepth())
+      {
+        Bool bMPIFlag = pcSlice->getVPS()->getMPIFlag( pcSlice->getLayerIdInVps() ) ;
+        Bool ivMvPredFlag = pcSlice->getVPS()->getIvMvPredFlag( pcSlice->getLayerIdInVps() ) ;
+        WRITE_UVLC( ( ( bMPIFlag || ivMvPredFlag ) ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS ) - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand");
+      }
+      else
+      {
+        Bool ivMvPredFlag = pcSlice->getVPS()->getIvMvPredFlag( pcSlice->getLayerIdInVps() ) ;
+        WRITE_UVLC( ( ivMvPredFlag ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS ) - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand");
+      }
+#else
       Bool ivMvPredFlag = pcSlice->getVPS()->getIvMvPredFlag( pcSlice->getLayerIdInVps() ) ;
       WRITE_UVLC( ( ivMvPredFlag ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS ) - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand");
+#endif
 #else
       WRITE_UVLC(MRG_MAX_NUM_CANDS - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand");
Index: branches/HTM-8.2-dev2-Samsung/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- branches/HTM-8.2-dev2-Samsung/source/Lib/TLibEncoder/TEncCfg.h	(revision 691)
+++ branches/HTM-8.2-dev2-Samsung/source/Lib/TLibEncoder/TEncCfg.h	(revision 696)
@@ -415,4 +415,7 @@
   Bool      m_useSDC;
   Bool      m_useDLT;
+#endif
+#if SEC_MPI_ENABLING_MERGE_F0150
+  Bool      m_useMPI;
 #endif
 #if H_3D_QTLPC
@@ -993,4 +996,8 @@
   Bool      getUsePC                        ()         { return m_bUsePC;  }
 #endif
+#if SEC_MPI_ENABLING_MERGE_F0150
+  Void      setUseMPI                       ( Bool b ) { m_useMPI = b;    }
+  Bool      getUseMPI                       ()         { return m_useMPI; }
+#endif
 #endif // H_3D
 };
Index: branches/HTM-8.2-dev2-Samsung/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- branches/HTM-8.2-dev2-Samsung/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 691)
+++ branches/HTM-8.2-dev2-Samsung/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 696)
@@ -556,5 +556,16 @@
   rpcSlice->setSliceSegmentArgument ( m_pcCfg->getSliceSegmentArgument() );
 #if H_3D_IV_MERGE
+#if SEC_MPI_ENABLING_MERGE_F0150
+  if(rpcSlice->getIsDepth())
+  {
+    rpcSlice->setMaxNumMergeCand      ( m_pcCfg->getMaxNumMergeCand()   + ( ( rpcSlice->getVPS()->getMPIFlag( rpcSlice->getLayerIdInVps() ) || rpcSlice->getVPS()->getIvMvPredFlag( rpcSlice->getLayerIdInVps() ) ) ? 1 : 0 ) );
+  }
+  else
+  {
+    rpcSlice->setMaxNumMergeCand      ( m_pcCfg->getMaxNumMergeCand()   + ( rpcSlice->getVPS()->getIvMvPredFlag( rpcSlice->getLayerIdInVps() ) ? 1 : 0 ) );
+  }
+#else
    rpcSlice->setMaxNumMergeCand      ( m_pcCfg->getMaxNumMergeCand()   + ( rpcSlice->getVPS()->getIvMvPredFlag( rpcSlice->getLayerIdInVps() ) ? 1 : 0 ) );
+#endif
 #else
   rpcSlice->setMaxNumMergeCand        ( m_pcCfg->getMaxNumMergeCand()        );
