Index: branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComDataCU.cpp	(revision 302)
+++ branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComDataCU.cpp	(revision 303)
@@ -3596,5 +3596,9 @@
 #if H3D_IVMP
 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
+#if FCO_FIX
+  const Int extraMergeCand = ( ( ( getSlice()->getIsDepth() && m_pcSlice->getTexturePic() ) || getSlice()->getSPS()->getMultiviewMvPredMode() )? 1 : 0 );
+#else
   const Int extraMergeCand = ( ( getSlice()->getIsDepth() || getSlice()->getSPS()->getMultiviewMvPredMode() )? 1 : 0 );
+#endif
 #else
   const Int extraMergeCand = ( getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
@@ -3651,4 +3655,7 @@
   if(!bNoPdmMerge)
   {
+#if FCO_DVP_REFINE_C0132_C0170
+    if( !getPic()->getDepthCoded() )
+#endif
     getDisMvpCandNBDV(uiPUIdx, uiAbsPartIdx, &cDisInfo , true
 #if MERL_VSP_C0152
@@ -3657,4 +3664,20 @@
 );
   }
+#if FCO_DVP_REFINE_C0132_C0170
+  if(getPic()->getDepthCoded() )
+  {
+    TComPic*      pcCodedDepthMap = getPic()->getRecDepthMap();
+    TComMv        cColMv;
+
+    cColMv.setZero();
+    estimateDVFromDM(uiPUIdx, pcCodedDepthMap, uiAbsPartIdx, &cColMv, false);
+
+    cDisInfo.iN = 1;
+    cDisInfo.m_acMvCand[0].setHor( cColMv.getHor() );
+    cDisInfo.m_acMvCand[0].setVer( cColMv.getVer() );
+    cDisInfo.m_aVIdxCan[0] = 0;
+
+  }
+#endif
   if(cDisInfo.iN==0)
   {
@@ -3669,5 +3692,9 @@
 
 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
+#if FCO_FIX
+  if( m_pcSlice->getIsDepth() && m_pcSlice->getTexturePic() )
+#else
   if( m_pcSlice->getIsDepth())
+#endif
   {
     UInt uiPartIdxCenter;
@@ -6079,4 +6106,7 @@
       DisInfo cDisInfo;
       cDisInfo.iN = 0;
+#if FCO_DVP_REFINE_C0132_C0170
+      if( !getPic()->getDepthCoded() )
+#endif
       getDisMvpCandNBDV(uiPartIdx, uiPartAddr, &cDisInfo, false
 #if MERL_VSP_C0152
@@ -6084,4 +6114,19 @@
 #endif
               ); 
+#if FCO_DVP_REFINE_C0132_C0170
+      if(getPic()->getDepthCoded() )
+      {
+        TComPic*      pcCodedDepthMap = getPic()->getRecDepthMap();
+        TComMv        cColMv;
+
+        cColMv.setZero();
+        estimateDVFromDM(uiPartIdx, pcCodedDepthMap, uiPartAddr, &cColMv, false);
+
+        cDisInfo.iN = 1;
+        cDisInfo.m_acMvCand[0].setHor( cColMv.getHor() );
+        cDisInfo.m_acMvCand[0].setVer( cColMv.getVer() );
+        cDisInfo.m_aVIdxCan[0] = 0;
+      }
+#endif
       if(cDisInfo.iN==0)
       {
@@ -7921,4 +7966,21 @@
   PartSize m_peSaved =  getPartitionSize( 0 );
   m_pePartSize[0] =  SIZE_2Nx2N;
+#if FCO_DVP_REFINE_C0132_C0170
+  if(getPic()->getDepthCoded() )
+  {
+    TComPic*      pcCodedDepthMap = getPic()->getRecDepthMap();
+    TComMv        cColMv;
+
+    cColMv.setZero();
+    estimateDVFromDM(0, pcCodedDepthMap, 0, &cColMv, false);
+
+    cDisInfo.iN = 1;
+    cDisInfo.m_acMvCand[0].setHor( cColMv.getHor() );
+    cDisInfo.m_acMvCand[0].setVer( cColMv.getVer() );
+    cDisInfo.m_aVIdxCan[0] = 0;
+
+  }
+  else
+#endif
   getDisMvpCandNBDV( 0, 0,  &cDisInfo, false );
   if( cDisInfo.iN == 0)
Index: branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComPic.cpp	(revision 302)
+++ branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComPic.cpp	(revision 303)
@@ -59,4 +59,8 @@
 #endif
 #endif
+#if FCO_DVP_REFINE_C0132_C0170
+  m_bDepthCoded       = false;
+  m_pcRecDepthMap     = NULL;
+#endif
 #if H3D_IVMP
   m_pcOrgDepthMap     = NULL;
Index: branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComPic.h
===================================================================
--- branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComPic.h	(revision 302)
+++ branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComPic.h	(revision 303)
@@ -73,4 +73,9 @@
 #endif
 
+#if FCO_DVP_REFINE_C0132_C0170
+  Bool                  m_bDepthCoded;
+  TComPic*              m_pcRecDepthMap;   
+#endif
+
 #if LG_ZEROINTRADEPTHRESI_A0087
   Int                   m_uiIntraPeriod;
@@ -171,4 +176,11 @@
   Bool          getCandPicCheckedFlag ()                { return m_checked;}
 #endif
+#endif
+
+#if FCO_DVP_REFINE_C0132_C0170
+  void setRecDepthMap(TComPic * pRecPic)                { m_pcRecDepthMap = pRecPic; }
+  TComPic * getRecDepthMap()                            { return m_pcRecDepthMap; }
+  void setDepthCoded(Bool flag)                         { m_bDepthCoded = flag; }
+  Bool getDepthCoded()                                  { return m_bDepthCoded; }
 #endif
 
Index: branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComPrediction.cpp	(revision 302)
+++ branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComPrediction.cpp	(revision 303)
@@ -1434,5 +1434,4 @@
   Int dstStride = dstPic->getStride();
   Int depStride =  pPicBaseDepth->getStride();
-
   Int depthPosX = Clip3(0,   widthLuma - size_x - 1,  (posX/nTxtPerDepthX) + (mv->getHor()>>2));
   Int depthPosY = Clip3(0,   heightLuma- size_y - 1,  (posY/nTxtPerDepthY) + (mv->getVer()>>2));
Index: branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComSlice.cpp	(revision 302)
+++ branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComSlice.cpp	(revision 303)
@@ -1761,5 +1761,9 @@
 
 Void
+#if FCO_FIX_SPS_CHANGE
+TComSPS::initMultiviewSPSDepth( UInt uiViewId, Int iViewOrderIdx, UInt uiCamParPrecision, Bool bCamParSlice, Int** aaiScale, Int** aaiOffset )
+#else
 TComSPS::initMultiviewSPSDepth( UInt uiViewId, Int iViewOrderIdx )
+#endif
 {
   AOT( uiViewId == 0 && iViewOrderIdx != 0 );
@@ -1769,8 +1773,28 @@
   m_iViewOrderIdx         = iViewOrderIdx;
   m_bDepth                = true;
+#if FCO_FIX_SPS_CHANGE
+  m_uiCamParPrecision     = ( m_uiViewId ? uiCamParPrecision : 0 );
+  m_bCamParInSliceHeader  = ( m_uiViewId ? bCamParSlice  : false );
+#else
   m_uiCamParPrecision     = 0;
   m_bCamParInSliceHeader  = false;
+#endif
   ::memset( m_aaiCodedScale,  0x00, sizeof( m_aaiCodedScale  ) );
   ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) );
+#if FCO_FIX_SPS_CHANGE
+#if !QC_MVHEVC_B0046
+  if( !m_bCamParInSliceHeader )
+  {
+    for( UInt uiBaseViewId = 0; uiBaseViewId < m_uiViewId; uiBaseViewId++ )
+    {
+      m_aaiCodedScale [ 0 ][ uiBaseViewId ] = aaiScale [ uiBaseViewId ][   m_uiViewId ];
+      m_aaiCodedScale [ 1 ][ uiBaseViewId ] = aaiScale [   m_uiViewId ][ uiBaseViewId ];
+      m_aaiCodedOffset[ 0 ][ uiBaseViewId ] = aaiOffset[ uiBaseViewId ][   m_uiViewId ];
+      m_aaiCodedOffset[ 1 ][ uiBaseViewId ] = aaiOffset[   m_uiViewId ][ uiBaseViewId ];
+    }
+  }
+#endif
+#endif
+
 }
 
Index: branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComSlice.h	(revision 302)
+++ branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TComSlice.h	(revision 303)
@@ -623,5 +623,9 @@
 
   Void initMultiviewSPS      ( UInt uiViewId, Int iViewOrderIdx = 0, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );
+#if FCO_FIX_SPS_CHANGE
+  Void initMultiviewSPSDepth ( UInt uiViewId, Int iViewOrderIdx, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );
+#else
   Void initMultiviewSPSDepth ( UInt uiViewId, Int iViewOrderIdx );
+#endif
 
   UInt getViewId             ()  { return m_uiViewId; }
Index: branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TypeDef.h	(revision 302)
+++ branches/HTM-6.0-Mediatek/source/Lib/TLibCommon/TypeDef.h	(revision 303)
@@ -171,4 +171,12 @@
 #if FLEX_CODING_ORDER_M23723
 #define DISABLE_FCO_FOR_VSO               0 // Optional compile settings to disable VSO with FCO.
+#define FCO_DVP_REFINE_C0132_C0170        0 // depth oriented disparity vector prediction from JCT3V-C0132 and JCT3V-C0170
+#define FCO_FIX                           0 // Bug fix for C0137 and C0152 on FCO
+#define FCO_FIX_SPS_CHANGE                0 // Sending camera parameters in SPS of depth for depth to disparity conversion used by VSP and DoDVP
+#else
+#define DISABLE_FCO_FOR_VSO               0 // Optional compile settings to disable VSO with FCO.
+#define FCO_DVP_REFINE_C0132_C0170        0 // depth oriented disparity vector prediction from JCT3V-C0132 and JCT3V-C0170
+#define FCO_FIX                           0 // Fixing bugs from HTM 6.0 which 
+#define FCO_FIX_SPS_CHANGE                0 // Fixing bugs from HTM 6.0 which 
 #endif
 
