Index: branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/CommonDef.h
===================================================================
--- branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/CommonDef.h	(revision 167)
+++ branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/CommonDef.h	(revision 169)
@@ -139,4 +139,13 @@
 #define PDM_NO_INTER_UPDATE               1         // no update for inter (but not inter-view) predicted blocks
 #define PDM_MERGE_POS                     0         // position of pdm in merge list (0..4)
+
+#if QC_MRG_CANS_B0048
+#if OL_DISMV_POS_B0069
+#define DMV_MERGE_POS                     4
+#else
+#define DMV_MERGE_POS                     1
+#endif
+#endif
+
 #if SAIT_IMPROV_MOTION_PRED_M24829&!QC_MULTI_DIS_CAN
 #define PDM_AMVP_POS                      0         // position of pdm in amvp list  (0..3)
Index: branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp	(revision 167)
+++ branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp	(revision 169)
@@ -3500,9 +3500,22 @@
 
   //===== add merge with predicted depth maps =====
+#if QC_MRG_CANS_B0048
+  TComMv  acPdmMv       [4];
+  Int     aiPdmRefIdx   [4] = {-1, -1, -1, -1};
+  Bool    bLeftAvai         = false;
+#if OL_DISMV_POS_B0069
+  Int     iPosLeftAbove[2]  = {-1, -1};
+#endif
+#else
   TComMv  acPdmMv       [2];
   Int     aiPdmRefIdx   [2] = {-1, -1};
+#endif
 
 #if LGE_DVMCP
+#if QC_MRG_CANS_B0048
+  acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = acPdmMv[2].m_bDvMcp = acPdmMv[3].m_bDvMcp = false; 
+#else
   acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = false; 
+#endif
 #endif
 
@@ -3534,13 +3547,28 @@
     cDisInfo.m_aVIdxCan[0] = 0;
   }
-  Int     iPdmInterDir      = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo  );
+#if QC_MRG_CANS_B0048
+  Int iPdmDir[2] = {0, 0};
+#endif
+  Int     iPdmInterDir      = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo  
+#if QC_MRG_CANS_B0048
+    , iPdmDir
+#endif
+    );
 #else
   Int     iPdmInterDir      = getPdmMergeCandidate( uiPUIdx, aiPdmRefIdx, acPdmMv );
 #endif
-
+#if QC_MRG_CANS_B0048
+  if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 0 )
+#else
   if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 0 )
+#endif
   {
     abCandIsInter        [ iCount ] = true;
+#if QC_MRG_CANS_B0048
+    puhInterDirNeighbours[ iCount ] = iPdmDir[0];
+    iPdmInterDir                    = iPdmDir[0];
+#else
     puhInterDirNeighbours[ iCount ] = iPdmInterDir;
+#endif
     if( ( iPdmInterDir & 1 ) == 1 )
     {
@@ -3573,4 +3601,32 @@
 #endif
 
+#if QC_MRG_CANS_B0048
+  if(extraMergeCand)
+  {
+    if(!bNoPdmMerge && iPdmDir[1] && DMV_MERGE_POS == 1)
+    {
+      assert(iCount < MRG_MAX_NUM_CANDS_MEM);
+      abCandIsInter        [ iCount ] = true;
+      puhInterDirNeighbours[ iCount ] = iPdmDir[1];
+      if( ( iPdmDir[1] & 1 ) == 1 )
+      {
+        pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 2 ], aiPdmRefIdx[ 2 ] );
+      }
+      if( ( iPdmDir[1] & 2 ) == 2 )
+      {
+        pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 3 ], aiPdmRefIdx[ 3 ] );
+      }
+#if LGE_DVMCP
+      pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
+      pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
+#endif
+#if SIMP_MRG_PRUN
+      if ( mrgCandIdx == iCount )
+          return;
+#endif
+      iCount ++;
+    }    
+  }
+#endif
   //left
   UInt uiLeftPartIdx = 0;
@@ -3610,4 +3666,22 @@
     }
 #endif
+#if QC_MRG_CANS_B0048
+    Bool bRemoveSpa = false; //prunign to inter-view candidates
+    Int  iCnloop    = iCount - 1;
+    for(; iCnloop >= 0; iCnloop --)
+    {
+      if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
+      {
+        bRemoveSpa                      = true;
+        abCandIsInter        [ iCount ] = false;
+      }
+    }
+    if(!bRemoveSpa)
+    {
+      bLeftAvai = true;
+#if OL_DISMV_POS_B0069
+      iPosLeftAbove[0] = iCount;
+#endif
+#endif
 #if LGE_DVMCP
     pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
@@ -3621,9 +3695,16 @@
 #endif
     iCount ++;
+#if QC_MRG_CANS_B0048
+      }
+#endif
   }
   }
 
 #if HHI_INTER_VIEW_MOTION_PRED
+#if QC_MRG_CANS_B0048
+  if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 1 )
+#else
   if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 1 )
+#endif
   {
     abCandIsInter        [ iCount ] = true;
@@ -3704,4 +3785,21 @@
     }
 #endif
+#if QC_MRG_CANS_B0048
+    Bool bRemoveSpa = false; //prunign to inter-view candidates
+    Int  iCnloop    = bLeftAvai? (iCount-2): (iCount-1);
+    for(; iCnloop >= 0; iCnloop --)
+    {
+      if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
+      {
+        bRemoveSpa                      = true;
+        abCandIsInter        [ iCount ] = false;
+      }
+    }
+    if(!bRemoveSpa)
+    {
+#if OL_DISMV_POS_B0069
+      iPosLeftAbove[1] = iCount;
+#endif
+#endif
 #if LGE_DVMCP
     pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
@@ -3715,4 +3813,7 @@
 #endif
     iCount ++;
+#if QC_MRG_CANS_B0048
+    }
+#endif
   }
 #if !SIMP_MRG_PRUN
@@ -3721,5 +3822,9 @@
 
 #if HHI_INTER_VIEW_MOTION_PRED
+#if QC_MRG_CANS_B0048
+  if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 2 )
+#else
   if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 2 )
+#endif
   {
     abCandIsInter        [ iCount ] = true;
@@ -3807,5 +3912,9 @@
 
 #if HHI_INTER_VIEW_MOTION_PRED
+#if QC_MRG_CANS_B0048
+  if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 3 )
+#else
   if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 3 )
+#endif
   {
     abCandIsInter        [ iCount ] = true;
@@ -3841,4 +3950,47 @@
 #endif
 
+#if OL_DISMV_POS_B0069
+  if(extraMergeCand)
+  {
+    if(!bNoPdmMerge && iPdmDir[1] && DMV_MERGE_POS == 4)
+    {
+      assert(iCount < MRG_MAX_NUM_CANDS_MEM);
+      Bool bRemoveSpa = false; //prunign to A1, B1
+      abCandIsInter        [ iCount ] = true;
+      puhInterDirNeighbours[ iCount ] = iPdmDir[1];
+      if( ( iPdmDir[1] & 1 ) == 1 )
+      {
+        pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 2 ], aiPdmRefIdx[ 2 ] );
+      }
+      if( ( iPdmDir[1] & 2 ) == 2 )
+      {
+        pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 3 ], aiPdmRefIdx[ 3 ] );
+      }
+      for(Int i = 0; i < 2; i ++)
+      {
+        Int iCnloop = iPosLeftAbove[i];
+        if(iCnloop == -1) 
+          continue;
+        if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
+        {
+          bRemoveSpa                      = true;
+          abCandIsInter        [ iCount ] = false;
+        }
+      }
+      if(!bRemoveSpa)
+      {
+#if LGE_DVMCP
+        pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
+        pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
+#endif
+#if SIMP_MRG_PRUN
+        if ( mrgCandIdx == iCount )
+          return;
+#endif
+        iCount ++;
+      }
+    }    
+  }
+#endif
   //left bottom
   UInt uiLeftBottomPartIdx = 0;
@@ -3893,5 +4045,9 @@
 
 #if HHI_INTER_VIEW_MOTION_PRED
+#if QC_MRG_CANS_B0048
+  if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 4 )
+#else
   if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 4 )
+#endif
   {
     abCandIsInter        [ iCount ] = true;
@@ -3988,5 +4144,9 @@
   }
 
-  if ( getSlice()->getPPS()->getEnableTMVPFlag() )
+  if ( getSlice()->getPPS()->getEnableTMVPFlag() 
+#if QC_MRG_CANS_B0048
+       && iCount < (MRG_MAX_NUM_CANDS_SIGNALED + extraMergeCand)
+#endif
+  )
   {
     // col [2]
@@ -7441,9 +7601,17 @@
 #else
 Int
-TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo )
+TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 
+#if QC_MRG_CANS_B0048
+  , Int* iPdm
+#endif
+)
 {
   TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator();
   ROFRS( pcDepthMapGenerator, 0 );
-  return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo );
+  return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo 
+#if QC_MRG_CANS_B0048
+    , iPdm
+#endif
+    );
 }
 Bool
Index: branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDataCU.h	(revision 167)
+++ branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDataCU.h	(revision 169)
@@ -535,5 +535,9 @@
 #else
   Bool          getPdmMvPredDisCan( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge = false );
-  Int           getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo );
+  Int           getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 
+#if QC_MRG_CANS_B0048
+    , Int* iPdm
+#endif
+  );
   Void          getDisMvpCand        ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo );
 #if LGE_DVMCP
Index: branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
===================================================================
--- branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.cpp	(revision 167)
+++ branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.cpp	(revision 169)
@@ -607,5 +607,9 @@
 #if QC_MULTI_DIS_CAN
 Int
-TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo )
+TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 
+#if QC_MRG_CANS_B0048
+  , Int* iPdm
+#endif
+)
 #else
 Int
@@ -626,5 +630,9 @@
   ROTRS( !bPdmMerge, 0 );
 
+#if QC_MRG_CANS_B0048
+  Bool abPdmAvailable[4] = {false, false, false, false};
+#else
   Bool abPdmAvailable[2] = {false,false};
+#endif
 
   Int iValid = 0;
@@ -725,7 +733,10 @@
   }
   Int iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 );
-
+#if QC_MRG_CANS_B0048
+  iPdm[0] = iPdmInterDir;
+#else
   if (iPdmInterDir == 0)
   {
+#endif
     for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ )
     {
@@ -736,6 +747,11 @@
         if( pcSlice->getRefPOC( eRefPicList, iPdmRefIdx ) == pcSlice->getPOC())
         {
+#if QC_MRG_CANS_B0048
+          abPdmAvailable[ iRefListId+2 ] = true;
+          paiPdmRefIdx  [ iRefListId+2 ] = iPdmRefIdx;
+#else
           abPdmAvailable[ iRefListId ] = true;
           paiPdmRefIdx  [ iRefListId ] = iPdmRefIdx;
+#endif
 #if QC_MULTI_DIS_CAN
           TComMv cMv = pDInfo->m_acMvCand[0]; 
@@ -745,11 +761,20 @@
 #endif
           pcCU->clipMv( cMv );
+#if QC_MRG_CANS_B0048
+          pacPdmMv      [ iRefListId + 2] = cMv;
+#else
           pacPdmMv      [ iRefListId ] = cMv;
+#endif
           break;
         }
       }
     }
+#if QC_MRG_CANS_B0048
+    iPdmInterDir = ( abPdmAvailable[2] ? 1 : 0 ) + ( abPdmAvailable[3] ? 2 : 0 ) ;
+    iPdm[1] = iPdmInterDir;
+#else
     iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ) ;
   }
+#endif
 
   return iPdmInterDir;
Index: branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.h
===================================================================
--- branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.h	(revision 167)
+++ branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.h	(revision 169)
@@ -152,5 +152,10 @@
 #if HHI_INTER_VIEW_MOTION_PRED
 #if QC_MULTI_DIS_CAN
-  Int   getPdmMergeCandidate ( TComDataCU*   pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo );
+  Int   getPdmMergeCandidate ( TComDataCU*   pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 
+#if QC_MRG_CANS_B0048
+    , Int* iPdm
+#endif
+    );
+
   Bool  getPdmMvPredDisCan    ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge );
   Bool  getDisCanPdmMvPred    ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge );
Index: branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComMotionInfo.h
===================================================================
--- branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComMotionInfo.h	(revision 167)
+++ branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComMotionInfo.h	(revision 169)
@@ -94,4 +94,10 @@
   Int getHor   () const { return  m_acMv.getHor(); }
   Int getVer   () const { return  m_acMv.getVer(); }
+#if QC_MRG_CANS_B0048
+  Bool operator== ( const TComMvField& rcMv ) const
+  {
+    return (m_acMv.getHor()==rcMv.getHor() && m_acMv.getVer()==rcMv.getVer() && m_iRefIdx == rcMv.getRefIdx());
+  }
+#endif
 };
 
Index: branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TypeDef.h	(revision 167)
+++ branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TypeDef.h	(revision 169)
@@ -75,7 +75,11 @@
 #define QC_MULTI_DIS_CAN                  1   // JCT2-A0097
 #if QC_MULTI_DIS_CAN                    
-    #define DIS_CANS                      1
+#define DIS_CANS                          1
 #endif                                  
 #define QC_SIMPLE_NBDV_B0047              1   //JCT2-B0047
+#define QC_MRG_CANS_B0048                 1   //JCT2-B0048, B0086, B0069
+#if     QC_MRG_CANS_B0048
+#define OL_DISMV_POS_B0069                1   //different pos for dispairty MV candidate, B0069
+#endif
 #define MTK_INTERVIEW_MERGE_A0049         1   //  JCT2-A0049 second part
 #define SHARP_INTERVIEW_DECOUPLE_B0111    1   //  JCT3V-B0111 decoupling inter-view candidate
