Index: /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/CommonDef.h
===================================================================
--- /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/CommonDef.h	(revision 92)
+++ /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/CommonDef.h	(revision 93)
@@ -130,4 +130,5 @@
 #if ( HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED )
 #define DEPTH_MAP_GENERATION        1
+#define PDM_REMOVE_DEPENDENCE       1			//bug-fix for DMDV JCT2-A0095
 #else
 #define DEPTH_MAP_GENERATION        0
Index: /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
===================================================================
--- /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.cpp	(revision 92)
+++ /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.cpp	(revision 93)
@@ -167,5 +167,7 @@
   m_bPDMAvailable = false;
   m_uiCurrViewId  = pcPic->getSPS()->getViewId();
-
+#if PDM_REMOVE_DEPENDENCE
+  pcPic->setStoredPDMforV2(0);
+#endif
   // update SPS list and AU pic list and set depth map generator in SPS
 #if VIDYO_VPS_INTEGRATION
@@ -225,6 +227,10 @@
   if( m_uiCurrViewId )
   {
+#if PDM_REMOVE_DEPENDENCE
+	UInt      uiBaseVId   = m_auiBaseIdList[0];
+#else
     Bool      bCheckVId1  = ( m_uiCurrViewId > 1 && m_auiBaseIdList[0] == 0 );
     UInt      uiBaseVId   = ( bCheckVId1 ? 1 : m_auiBaseIdList[0] );
+#endif
     TComPic*  pcBasePic   = m_pcAUPicAccess->getPic( uiBaseVId );
     SliceType eSliceType  = pcBasePic->getCurrSlice()->getSliceType();
@@ -417,4 +423,7 @@
         pcBasePic->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(m_pcSPSAccess->getPdm()), PDM_SUB_SAMP_EXP_Y(m_pcSPSAccess->getPdm()) );
         xClearDepthMap( pcBasePic );
+#if PDM_REMOVE_DEPENDENCE
+		xClearDepthMap( pcBasePic, PDM_UNDEFINED_DEPTH, 1 );
+#endif
       }
 #if PDM_OUTPUT_PRED_DEPTH_MAP
@@ -461,4 +470,7 @@
   {
     xClearDepthMap( pcPic );
+#if PDM_REMOVE_DEPENDENCE
+	xClearDepthMap( pcPic, PDM_UNDEFINED_DEPTH, 1 );
+#endif
   }
   return bUndefined;
@@ -482,4 +494,14 @@
 
   // predict depth map using current coding symbols
+#if PDM_REMOVE_DEPENDENCE
+  pcPic->setStoredPDMforV2(0);
+  xPredictDepthMap( pcPic );
+  if(m_uiCurrViewId==0)
+  {
+	  pcPic->setStoredPDMforV2(1);
+	  xPredictDepthMap( pcPic );
+	  pcPic->setStoredPDMforV2(0);
+  }
+#else
   xPredictDepthMap( pcPic );
 #if PDM_OUTPUT_PRED_DEPTH_MAP
@@ -488,4 +510,5 @@
     dumpDepthMap( pcPic, acFilenameBase );
   }
+#endif
 #endif
 
@@ -500,4 +523,15 @@
 #endif
   }
+#if PDM_REMOVE_DEPENDENCE
+  if( m_uiCurrViewId == 2 )
+  {
+    TComPic* pcBasePic = m_pcAUPicAccess->getPic( 0 );
+    AOF( pcBasePic );
+    xConvertDepthMapCurr2Ref( pcBasePic, pcPic );
+#if PDM_OUTPUT_PRED_DEPTH_MAP
+    dumpDepthMap( pcBasePic, acFilenameBase );
+#endif
+  }
+#endif
 }
 
@@ -520,4 +554,8 @@
   Int         iSrcStride  = pcPicYuv->getStride   ();
   Int         iDstStride  = m_cTmpPic.getStride   ();
+#if PDM_REMOVE_DEPENDENCE
+  if(pcPic->getStoredPDMforV2())
+	   pcPicYuv    = pcPic->getPredDepthMapTemp();
+#endif
   Pel*        pSrcSamples = pcPicYuv->getLumaAddr ( 0 );
   Pel*        pDstSamples = m_cTmpPic.getLumaAddr ( 0 );
@@ -767,4 +805,8 @@
     //--- get base CU/PU and check prediction mode ---
     UInt        uiBaseId    = m_auiBaseIdList[ uiBId ];
+#if PDM_REMOVE_DEPENDENCE
+	if( uiBaseId != 0)
+		continue;
+#endif
     TComPic*    pcBasePic   = m_pcAUPicAccess->getPic( uiBaseId );
     TComPicYuv* pcBasePdm   = pcBasePic->getPredDepthMap();
@@ -864,6 +906,12 @@
   AOF( pcRef->getPredDepthMap()->getWidth () == pcCur->getPredDepthMap()->getWidth () );
   AOF( pcRef->getPredDepthMap()->getHeight() == pcCur->getPredDepthMap()->getHeight() );
-
+#if PDM_REMOVE_DEPENDENCE
+  if( pcCur->getViewId() == 1)
+	  xClearDepthMap( pcRef );
+  else if (pcCur->getViewId() == 2)
+	   xClearDepthMap( pcRef, PDM_UNDEFINED_DEPTH, 1 );
+#else
   xClearDepthMap( pcRef );
+#endif
   TComPicYuv* pcCurDepthMap =  pcCur->getPredDepthMap    ();
   TComPicYuv* pcRefDepthMap =  pcRef->getPredDepthMap    ();
@@ -875,4 +923,11 @@
   Pel*        pRefSamples   =  pcRefDepthMap->getLumaAddr( 0 );
   Int         iRefViewIdx   =  pcRef->getViewId();
+#if PDM_REMOVE_DEPENDENCE
+  if( pcCur->getViewId() == 2)
+  {
+	  pcRefDepthMap =  pcRef->getPredDepthMapTemp();
+	  pRefSamples   =  pcRefDepthMap->getLumaAddr( 0 );
+  }
+#endif 
   Int         iShiftX       = m_uiSubSampExpX + 2;
   Int         iAddX         = ( 1 << iShiftX ) >> 1;
@@ -903,5 +958,15 @@
   AOF( pcCur->getSPS()->getViewId()  > pcRef->getSPS()->getViewId() );
   AOF( pcCur->getPredDepthMap() );
+#if PDM_REMOVE_DEPENDENCE
+  if(pcCur->getViewId() == 1)
+  {
+	  AOF( pcRef->getPredDepthMap() );
+  }else
+  {
+	  AOF( pcRef->getPredDepthMapTemp() );
+  }
+#else
   AOF( pcRef->getPredDepthMap() );
+#endif
   AOF( pcRef->getPredDepthMap()->getWidth () == pcCur->getPredDepthMap()->getWidth () );
   AOF( pcRef->getPredDepthMap()->getHeight() == pcCur->getPredDepthMap()->getHeight() );
@@ -909,4 +974,8 @@
   xClearDepthMap( pcCur );
   TComPicYuv* pcRefDepthMap =  pcRef->getPredDepthMap    ();
+#if PDM_REMOVE_DEPENDENCE
+  if(pcCur->getViewId() == 2)
+	  pcRefDepthMap =  pcRef->getPredDepthMapTemp        ();
+#endif
   TComPicYuv* pcCurDepthMap =  pcCur->getPredDepthMap    ();
   Int         iWidth        =  pcRefDepthMap->getWidth   ();
@@ -948,6 +1017,15 @@
   }
   Bool    bUndefined = xFillDepthMapHoles( pcPic );
+#if PDM_REMOVE_DEPENDENCE
+  if(pcPic->getStoredPDMforV2() == 1){
+  pcPic->getPredDepthMapTemp()->setBorderExtension( false );
+  pcPic->getPredDepthMapTemp()->extendPicBorder   ();
+  }else{
+#endif
   pcPic->getPredDepthMap()->setBorderExtension( false );
   pcPic->getPredDepthMap()->extendPicBorder   ();
+#if PDM_REMOVE_DEPENDENCE
+  }
+#endif
   return  bUndefined;
 }
@@ -959,4 +1037,8 @@
   Bool        bUndefined  = false;      
   TComPicYuv* pcDepthMap  = pcPic->getPredDepthMap  ();
+#if PDM_REMOVE_DEPENDENCE
+  if(pcPic->getViewId()==0 && pcPic->getStoredPDMforV2()==1)
+	  pcDepthMap  = pcPic->getPredDepthMapTemp  ();
+#endif
   Int         iWidth      = pcDepthMap->getWidth    ();
   Int         iHeight     = pcDepthMap->getHeight   ();
@@ -1017,5 +1099,10 @@
 
 Void
-TComDepthMapGenerator::xClearDepthMap( TComPic* pcPic, Int iVal )
+TComDepthMapGenerator::xClearDepthMap( TComPic* pcPic, Int iVal 
+#if PDM_REMOVE_DEPENDENCE
+,
+Int forFirstNonBaseView
+#endif
+)
 {
   TComPicYuv* pcDepthMap  = pcPic->getPredDepthMap  ();
@@ -1024,4 +1111,11 @@
   Int         iStride     = pcDepthMap->getStride   ();
   Pel*        pDMSamples  = pcDepthMap->getLumaAddr ( 0 );
+#if PDM_REMOVE_DEPENDENCE
+  if( forFirstNonBaseView == 1)
+  {
+	  pcDepthMap  = pcPic->getPredDepthMapTemp  ();
+	  pDMSamples  = pcDepthMap->getLumaAddr ( 0 );
+  }
+#endif
   for( Int iY = 0; iY < iHeight; iY++, pDMSamples += iStride )
   {
@@ -1093,4 +1187,8 @@
   TComYuv*    pcSubDM   = m_ppcYuv[ uiDepth ];
   TComPicYuv* pcPicDM   = pcCU->getPic()->getPredDepthMap();
+#if PDM_REMOVE_DEPENDENCE
+  if( pcCU->getPic()->getStoredPDMforV2() == 1)
+	  pcPicDM   = pcCU->getPic()->getPredDepthMapTemp();
+#endif
   UInt        uiCUAddr  = pcCU->getAddr();
   pcSubCU->copySubCU( pcCU, uiAbsPartIdx, uiDepth );
@@ -1179,4 +1277,8 @@
     UInt  uiZOrderIdx     = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     Pel*  pPicDepthMap    = pcCU->getPic()->getPredDepthMap()->getLumaAddr( pcCU->getAddr(), uiZOrderIdx );
+#if PDM_REMOVE_DEPENDENCE
+	if(pcCU->getPic()->getStoredPDMforV2()==1)
+		pPicDepthMap    = pcCU->getPic()->getPredDepthMapTemp()->getLumaAddr( pcCU->getAddr(), uiZOrderIdx );
+#endif
     Int   iPicStride      = pcCU->getPic()->getPredDepthMap()->getStride  ();
     for( UInt uiY = 0; uiY < uiHeight; uiY++, pDepthMap += uiStride, pPicDepthMap += iPicStride )
Index: /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.h
===================================================================
--- /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.h	(revision 92)
+++ /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.h	(revision 93)
@@ -176,5 +176,10 @@
   Bool  xPredictDepthMap          ( TComPic*    pcPic );
   Bool  xFillDepthMapHoles        ( TComPic*    pcPic );
-  Void  xClearDepthMap            ( TComPic*    pcPic, Int      iVal  = PDM_UNDEFINED_DEPTH );
+  Void  xClearDepthMap            ( TComPic*    pcPic, Int      iVal  = PDM_UNDEFINED_DEPTH
+#if PDM_REMOVE_DEPENDENCE
+  ,
+  Int forFirstNonBaseView = 0
+#endif
+  );
   Void  xSetChroma                ( TComPicYuv* pcPic, Int      iVal  );
 
Index: /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComPic.cpp	(revision 92)
+++ /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComPic.cpp	(revision 93)
@@ -55,4 +55,7 @@
 #if DEPTH_MAP_GENERATION
   m_pcPredDepthMap    = NULL;
+#if PDM_REMOVE_DEPENDENCE
+  m_pcPredDepthMap_temp    = NULL;
+#endif
 #endif
 #if HHI_INTER_VIEW_MOTION_PRED
@@ -136,4 +139,12 @@
     m_pcPredDepthMap = NULL;
   }
+#if PDM_REMOVE_DEPENDENCE
+  if( m_pcPredDepthMap_temp )         //  estimated depth map
+  {
+    m_pcPredDepthMap_temp->destroy();
+    delete m_pcPredDepthMap_temp;
+    m_pcPredDepthMap_temp = NULL;
+  }                     
+#endif
 #endif
 #if HHI_INTER_VIEW_MOTION_PRED
@@ -179,4 +190,8 @@
   m_pcPredDepthMap    = new TComPicYuv;
   m_pcPredDepthMap    ->create( iWidth >> uiSubSampExpX, iHeight >> uiSubSampExpY, uiMaxCuWidth >> uiSubSampExpX, uiMaxCuHeight >> uiSubSampExpY, uiMaxCuDepth );
+#if PDM_REMOVE_DEPENDENCE
+  m_pcPredDepthMap_temp    = new TComPicYuv;
+  m_pcPredDepthMap_temp    ->create( iWidth >> uiSubSampExpX, iHeight >> uiSubSampExpY, uiMaxCuWidth >> uiSubSampExpX, uiMaxCuHeight >> uiSubSampExpY, uiMaxCuDepth );
+#endif
 }
 #endif
@@ -224,4 +239,12 @@
     m_pcPredDepthMap = NULL;
   }
+#if PDM_REMOVE_DEPENDENCE
+  if(m_pcPredDepthMap_temp)
+  {
+    m_pcPredDepthMap_temp->destroy();
+    delete m_pcPredDepthMap_temp;
+    m_pcPredDepthMap_temp = NULL;
+  }
+#endif
 }
 #endif
Index: /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComPic.h
===================================================================
--- /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComPic.h	(revision 92)
+++ /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComPic.h	(revision 93)
@@ -67,4 +67,8 @@
 #if DEPTH_MAP_GENERATION
   TComPicYuv*           m_pcPredDepthMap;         //  estimated depth map
+#if PDM_REMOVE_DEPENDENCE
+  TComPicYuv*           m_pcPredDepthMap_temp;         //  estimated depth map
+  Bool                  m_bPDMV2;                       
+#endif
 #endif
 
@@ -139,6 +143,11 @@
 #if DEPTH_MAP_GENERATION
   TComPicYuv*   getPredDepthMap()     { return  m_pcPredDepthMap; }
-#endif
-
+#if PDM_REMOVE_DEPENDENCE
+  TComPicYuv*   getPredDepthMapTemp()         { return  m_pcPredDepthMap_temp; }
+  Void          setStoredPDMforV2(Bool flag)  { m_bPDMV2 = flag;}
+  Bool          getStoredPDMforV2()           { return m_bPDMV2;}
+#endif
+
+#endif
 #if HHI_INTER_VIEW_MOTION_PRED
   TComPicYuv*   getOrgDepthMap()      { return  m_pcOrgDepthMap; }
Index: /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComPrediction.cpp	(revision 92)
+++ /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComPrediction.cpp	(revision 93)
@@ -569,4 +569,9 @@
   {
     UInt uiRShift = 0;
+#if PDM_REMOVE_DEPENDENCE
+	if(pcCU->getPic()->getStoredPDMforV2()==1)
+	    xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMapTemp(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift, 0 );
+	else
+#endif
     xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift, 0 );
     return;
Index: /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TypeDef.h	(revision 92)
+++ /branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TypeDef.h	(revision 93)
@@ -47,5 +47,5 @@
 #define HHI_INTER_VIEW_RESIDUAL_PRED      1   // inter-view residual prediction
 #define HHI_FIX                           1   // inter-view prediction and other fixes
-#define QC_MULTI_DIS_CAN			1
+#define QC_MULTI_DIS_CAN			1         // JCT2-A0097
 #if QC_MULTI_DIS_CAN
     #define DIS_CANS				1
