Index: branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1211)
+++ branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1217)
@@ -2160,7 +2160,7 @@
     
     Bool depthRefineFlag = false;
-#if H_3D_NBDV_REF
-    depthRefineFlag = m_pcSlice->getDepthRefinementFlag(  );
-#endif // H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
+    depthRefineFlag = m_pcSlice->getDepthRefinementFlag();
+#endif // NH_3D_NBDV_REF
     
     TComMv cDv = depthRefineFlag ? DvInfo.m_acDoNBDV : DvInfo.m_acNBDV;
@@ -5760,9 +5760,9 @@
 #if NH_3D_NBDV 
 //Notes from QC:
-//TBD#1: DoNBDV related contributions are just partially integrated under the marco of H_3D_NBDV_REF, remove this comment once DoNBDV and BVSP are done
+//TBD#1: DoNBDV related contributions are just partially integrated under the marco of NH_3D_NBDV_REF, remove this comment once DoNBDV and BVSP are done
 //TBD#2: set of DvMCP values need to be done as part of inter-view motion prediction process. Remove this comment once merge related integration is done
 //To be checked: Parallel Merge features for NBDV, related to DV_DERIVATION_PARALLEL_B0096 and LGE_IVMP_PARALLEL_MERGE_B0136 are not integrated. The need of these features due to the adoption of CU-based NBDV is not clear. We need confirmation on this, especially by proponents
 Void TComDataCU::getDisMvpCandNBDV( DisInfo* pDInfo
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
 , Bool bDepthRefine
 #endif
@@ -5787,5 +5787,5 @@
     }
   }
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
   if( !m_pcSlice->getDepthRefinementFlag( ) )
   {
@@ -5837,5 +5837,5 @@
         pDInfo->m_aVIdxCan  = iTargetViewIdx;
 
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
         TComPic* picDepth = NULL;   
 #if H_3D_FCO_VSP_DONBDV_E0163
@@ -5859,5 +5859,5 @@
         }
         pDInfo->m_acDoNBDV  = cColMv;
-#endif //H_3D_NBDV_REF
+#endif //NH_3D_NBDV_REF
         return;
       }
@@ -5873,5 +5873,5 @@
   bCheckMcpDv = true; 
   if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_LEFT
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
     , bDepthRefine 
 #endif
@@ -5885,5 +5885,5 @@
     bCheckMcpDv = ( ( getCtuRsAddr() - pcTmpCU->getCtuRsAddr() ) == 0);
     if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVE
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
       , bDepthRefine 
 #endif
@@ -5904,5 +5904,5 @@
           pDInfo->m_acNBDV = cDispVec;
           pDInfo->m_aVIdxCan = cIDVInfo.m_aVIdxCan[iList][ curPos ];
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
 #if H_3D_FCO_VSP_DONBDV_E0163
           TComPic* picDepth  = NULL;
@@ -5942,5 +5942,5 @@
     pDInfo->m_aVIdxCan = getSlice()->getDefaultRefViewIdx();
 
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
     TComPic* picDepth = NULL;
 #if H_3D_FCO_VSP_DONBDV_E0163
@@ -5968,10 +5968,10 @@
 }
 
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
 Pel TComDataCU::getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iBlkWidth, Int iBlkHeight, Int* aiShiftLUT )
 {
-  Int iPictureWidth  = pcBaseViewDepthPicYuv->getWidth();
-  Int iPictureHeight = pcBaseViewDepthPicYuv->getHeight();
-  
+  Int iPictureWidth  = pcBaseViewDepthPicYuv->getWidth(COMPONENT_Y);
+  Int iPictureHeight = pcBaseViewDepthPicYuv->getHeight(COMPONENT_Y);
+
   Int depthStartPosX = Clip3(0,   iPictureWidth - 1,  iBlkX + ((mv->getHor()+2)>>2));
   Int depthStartPosY = Clip3(0,   iPictureHeight - 1, iBlkY + ((mv->getVer()+2)>>2));
@@ -5979,6 +5979,6 @@
   Int depthEndPosY   = Clip3(0,   iPictureHeight - 1, iBlkY + iBlkHeight - 1 + ((mv->getVer()+2)>>2));
 
-  Pel* depthTL  = pcBaseViewDepthPicYuv->getLumaAddr();
-  Int depStride =  pcBaseViewDepthPicYuv->getStride();
+  Pel* depthTL  = pcBaseViewDepthPicYuv->getAddr(COMPONENT_Y);
+  Int depStride =  pcBaseViewDepthPicYuv->getStride(COMPONENT_Y);
 
   Pel  maxDepthVal = 0;
@@ -5995,11 +5995,12 @@
   if (picDepth)
   {
-    UInt uiAbsPartAddrCurrCU = m_uiAbsIdxInLCU + uiPartAddr;
+    UInt uiAbsPartAddrCurrCU = m_absZIdxInCtu + uiPartAddr;
     Int iWidth, iHeight;
     getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight ); // The modified value of uiPartAddr won't be used any more
 
     TComPicYuv* pcBaseViewDepthPicYuv = picDepth->getPicYuvRec();
-    Int iBlkX = ( getAddr() % picDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth  + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartAddrCurrCU ] ];
-    Int iBlkY = ( getAddr() / picDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartAddrCurrCU ] ];
+    const TComSPS   &sps =*(getSlice()->getSPS());
+    Int iBlkX = ( getCtuRsAddr() % picDepth->getFrameWidthInCtus() ) * sps.getMaxCUWidth()  + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartAddrCurrCU ] ];
+    Int iBlkY = ( getCtuRsAddr() / picDepth->getFrameWidthInCtus() ) * sps.getMaxCUHeight() + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartAddrCurrCU ] ];
 
     Int* aiShiftLUT = getSlice()->getDepthToDisparityB(refViewIdx );
@@ -6009,9 +6010,9 @@
   }
 }
-#endif //H_3D_NBDV_REF
+#endif //NH_3D_NBDV_REF
 
 
 Bool TComDataCU::xCheckSpatialNBDV( TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paIDVInfo, UInt uiMvpDvPos
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
 , Bool bDepthRefine 
 #endif
@@ -6034,5 +6035,5 @@
           pNbDvInfo->m_acNBDV = cMvPred;
           pNbDvInfo->m_aVIdxCan = refViewIdx;
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
           TComPic* picDepth = NULL;
           assert(getSlice()->getRefPic(eRefPicList, refId)->getPOC() == getSlice()->getPOC());          
@@ -6209,7 +6210,7 @@
 
   Bool depthRefineFlag = false; 
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
   depthRefineFlag = m_pcSlice->getDepthRefinementFlag( ); 
-#endif // H_3D_NBDV_REF
+#endif // NH_3D_NBDV_REF
 
   TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 
@@ -6346,7 +6347,7 @@
 
   Bool depthRefineFlag = false; 
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
   depthRefineFlag = m_pcSlice->getDepthRefinementFlag( ); 
-#endif // H_3D_NBDV_REF
+#endif // NH_3D_NBDV_REF
 
   TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 
@@ -6645,5 +6646,5 @@
             abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true;
             paiPdmRefIdx  [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx;
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
             TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 
 #endif
Index: branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.h	(revision 1211)
+++ branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.h	(revision 1217)
@@ -490,5 +490,5 @@
   Bool          xCheckSpatialNBDV (TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paMvpDvInfo,
                                    UInt uiMvpDvPos
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
   , Bool bDepthRefine = false
 #endif
@@ -496,5 +496,5 @@
   Bool          xGetColDisMV      ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );
   Void          getDisMvpCandNBDV ( DisInfo* pDInfo
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
    , Bool bDepthRefine = false
 #endif
@@ -507,8 +507,8 @@
    Bool          getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index);
 #endif
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
   Pel           getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT );
   Void          estimateDVFromDM(Int refViewIdx, UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred );
-#endif //H_3D_NBDV_REF
+#endif //NH_3D_NBDV_REF
 #endif
 #if  H_3D_FAST_TEXTURE_ENCODING
Index: branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TComMotionInfo.h
===================================================================
--- branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TComMotionInfo.h	(revision 1211)
+++ branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TComMotionInfo.h	(revision 1217)
@@ -64,5 +64,5 @@
 {
   TComMv m_acNBDV;              // DV from NBDV
-#if H_3D_NBDV_REF 
+#if NH_3D_NBDV_REF 
   TComMv m_acDoNBDV;            // DV from DoNBDV
 #endif  
Index: branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.cpp	(revision 1211)
+++ branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.cpp	(revision 1217)
@@ -3850,5 +3850,5 @@
   setupLUT = setupLUT || getViewSynthesisPredFlag( ); 
 
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
   setupLUT = setupLUT || getDepthRefinementFlag( );
 #endif  
Index: branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TypeDef.h	(revision 1211)
+++ branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibCommon/TypeDef.h	(revision 1217)
@@ -70,4 +70,5 @@
 #define NH_3D_VSO                         1
 #define NH_3D_NBDV                        1
+#define NH_3D_NBDV_REF                    1
 #endif
 
Index: branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1211)
+++ branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1217)
@@ -287,5 +287,5 @@
   DvInfo.m_acNBDV.setZero();
   DvInfo.m_aVIdxCan = 0;
-#if H_3D_NBDV_REF  
+#if NH_3D_NBDV_REF  
   DvInfo.m_acDoNBDV.setZero();
 #endif
@@ -323,5 +323,5 @@
       {
 #endif
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
       if( pcCU->getSlice()->getDepthBasedBlkPartFlag() )  //Notes from QC: please check the condition for DoNBDV. Remove this comment once it is done.
       {
Index: branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1211)
+++ branches/HTM-14.1-update-dev3-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1217)
@@ -445,5 +445,5 @@
   DvInfo.m_acNBDV.setZero();
   DvInfo.m_aVIdxCan = 0;
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
   DvInfo.m_acDoNBDV.setZero();
 #endif
@@ -611,5 +611,5 @@
           {
 #endif 
-#if H_3D_NBDV_REF
+#if NH_3D_NBDV_REF
             if( rpcTempCU->getSlice()->getDepthRefinementFlag() )
             {
