Index: branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1253)
+++ branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1258)
@@ -2550,5 +2550,5 @@
   assert(0);
 }
-#if H_3D
+#if NH_3D_DIS
 Void TEncCavlc::codeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
Index: branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncCavlc.h	(revision 1253)
+++ branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncCavlc.h	(revision 1258)
@@ -121,5 +121,5 @@
   Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
   Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-#if H_3D
+#if NH_3D_DIS
   Void codeDIS           ( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
Index: branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1253)
+++ branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1258)
@@ -739,5 +739,5 @@
     }
 #endif
-#if H_3D
+#if NH_3D_DIS
     rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
     if( rpcBestCU->getSlice()->getDepthIntraSkipFlag() )
@@ -1583,5 +1583,5 @@
   }
 
-#if H_3D
+#if NH_3D_DIS
   m_pcEntropyCoder->encodeDIS( pcCU, uiAbsPartIdx );
   if(!pcCU->getDISFlag(uiAbsPartIdx))
@@ -1628,5 +1628,5 @@
   setCodeChromaQpAdjFlag( codeChromaQpAdj );
   setdQPFlag( bCodeDQP );
-#if H_3D
+#if NH_3D_DIS
   }
 #endif
@@ -2021,5 +2021,5 @@
             mergeCandBuffer[uiMergeCand] = 1;
           }
-#if H_3D
+#if NH_3D_DIS
           rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
 #endif
@@ -2063,5 +2063,5 @@
               }
               rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
-#if H_3D
+#if NH_3D_DIS
               rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
 #endif
@@ -2214,5 +2214,5 @@
       }
 #endif
-#if H_3D
+#if NH_3D_DIS
       rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
 #endif
@@ -2331,5 +2331,5 @@
           }
           rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
-#if H_3D
+#if NH_3D_DIS
           rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
 #endif
@@ -2440,78 +2440,4 @@
     pMask   += 2*uiMaskStride;
   }
-}
-
-Void TEncCu::xCheckRDCostDIS( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
-{
-  UInt uiDepth = rpcTempCU->getDepth( 0 );
-  if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N))
-  {
-    return;
-  }
-
-#if NH_3D_VSO // M5
-  if( m_pcRdCost->getUseRenModel() )
-  {
-    UInt  uiWidth     = m_ppcOrigYuv[uiDepth]->getWidth   ( COMPONENT_Y );
-    UInt  uiHeight    = m_ppcOrigYuv[uiDepth]->getHeight  ( COMPONENT_Y );
-    Pel*  piSrc       = m_ppcOrigYuv[uiDepth]->getAddr    ( COMPONENT_Y );
-    UInt  uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride  ( COMPONENT_Y );
-    m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
-  }
-#endif
-
-  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
-  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
-  rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth );
-  rpcTempCU->setCUTransquantBypassSubParts( rpcTempCU->getCUTransquantBypass(0), 0, uiDepth );
-
-  rpcTempCU->setTrIdxSubParts(0, 0, uiDepth);
-  rpcTempCU->setCbfSubParts(0, 1, 1, 0, uiDepth);
-  rpcTempCU->setDISFlagSubParts(true, 0, uiDepth);
-  rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth);
-#if NH_3D_SDC_INTRA
-  rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth);
-#endif
-
-  UInt uiPreCalcDistC;
-  m_pcPredSearch  ->estIntraPredDIS      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false );
-
-#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
-  Int oldTraceCopyBack = g_traceCopyBack; 
-  g_traceCopyBack = false;  
-#endif
-  m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() );
-  #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC  
-    g_traceCopyBack = oldTraceCopyBack; 
-  #endif
-
-
-  m_pcEntropyCoder->resetBits();
-  if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
-  {
-    m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0,          true );
-  }
-  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
-  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
-
-
-  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
-
-  rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits();
-  rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded();
-
-
-#if NH_3D_VSO // M6
-  if( m_pcRdCost->getUseLambdaScaleVSO())
-  {
-    rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );  
-  }
-  else
-#endif
-    rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
-
-
-  xCheckDQP( rpcTempCU );
-  xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth);
 }
 
@@ -2651,5 +2577,75 @@
 }
 #endif
-
+#if NH_3D_DIS
+Void TEncCu::xCheckRDCostDIS( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
+{
+  UInt uiDepth = rpcTempCU->getDepth( 0 );
+  if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N))
+  {
+    return;
+  }
+
+#if NH_3D_VSO // M5
+  if( m_pcRdCost->getUseRenModel() )
+  {
+    UInt  uiWidth     = m_ppcOrigYuv[uiDepth]->getWidth   ( COMPONENT_Y );
+    UInt  uiHeight    = m_ppcOrigYuv[uiDepth]->getHeight  ( COMPONENT_Y );
+    Pel*  piSrc       = m_ppcOrigYuv[uiDepth]->getAddr    ( COMPONENT_Y );
+    UInt  uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride  ( COMPONENT_Y );
+    m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
+  }
+#endif
+
+  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
+  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
+  rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth );
+  rpcTempCU->setCUTransquantBypassSubParts( rpcTempCU->getCUTransquantBypass(0), 0, uiDepth );
+
+  rpcTempCU->setTrIdxSubParts(0, 0, uiDepth);
+  rpcTempCU->setCbfSubParts(0, COMPONENT_Y, 0, uiDepth);
+  rpcTempCU->setDISFlagSubParts(true, 0, uiDepth);
+  rpcTempCU->setIntraDirSubParts(CHANNEL_TYPE_LUMA, DC_IDX, 0, uiDepth);
+#if NH_3D_SDC_INTRA
+  rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth);
+#endif
+
+  UInt uiPreCalcDistC;
+  m_pcPredSearch  ->estIntraPredDIS      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false );
+
+#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
+  Int oldTraceCopyBack = g_traceCopyBack; 
+  g_traceCopyBack = false;  
+#endif
+  m_ppcRecoYuvTemp[uiDepth]->copyToPicComponent(COMPONENT_Y, rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getCtuRsAddr(), rpcTempCU->getZorderIdxInCtu() );
+#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC  
+  g_traceCopyBack = oldTraceCopyBack; 
+#endif
+
+  m_pcEntropyCoder->resetBits();
+  if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
+  {
+    m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0,          true );
+  }
+  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
+  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
+
+  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
+
+  rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits();
+  rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded();
+
+#if NH_3D_VSO // M6
+  if( m_pcRdCost->getUseLambdaScaleVSO())
+  {
+    rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );  
+  }
+  else
+#endif
+  rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
+
+  xCheckDQP( rpcTempCU );
+  xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth);
+}
+#endif
 Void TEncCu::xCheckRDCostIntra( TComDataCU *&rpcBestCU,
                                 TComDataCU *&rpcTempCU,
@@ -2677,5 +2673,5 @@
 
   rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
-#if H_3D
+#if NH_3D_DIS
   rpcTempCU->setDISFlagSubParts( false, 0, uiDepth );
 #endif
@@ -2715,5 +2711,5 @@
     m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0,          true );
   }
-#if H_3D
+#if NH_3D_DIS
   m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
   if(!rpcTempCU->getDISFlag(0))
@@ -2735,5 +2731,5 @@
   setCodeChromaQpAdjFlag( codeChromaQpAdjFlag );
   setdQPFlag( bCodeDQP );
-#if H_3D
+#if NH_3D_DIS
   }
 #endif
@@ -2782,5 +2778,5 @@
 
   rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
-#if H_3D
+#if NH_3D_DIS
   rpcTempCU->setDISFlagSubParts( false, 0, uiDepth );
 #endif
@@ -2804,5 +2800,5 @@
 
   m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
-#if H_3D
+#if NH_3D_DIS
   m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
 #endif
Index: branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncCu.h
===================================================================
--- branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncCu.h	(revision 1253)
+++ branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncCu.h	(revision 1258)
@@ -159,5 +159,5 @@
   Void  xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG = false );
 #endif
-#if H_3D
+#if NH_3D_DIS
   Void  xCheckRDCostDIS   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
 #endif
Index: branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1253)
+++ branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1258)
@@ -116,5 +116,5 @@
   m_pcEntropyCoderIf->codeSkipFlag( pcCU, uiAbsPartIdx );
 }
-#if H_3D
+#if NH_3D_DIS
 Void TEncEntropy::encodeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
 {
Index: branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncEntropy.h
===================================================================
--- branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncEntropy.h	(revision 1253)
+++ branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncEntropy.h	(revision 1258)
@@ -79,5 +79,5 @@
   virtual Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
   virtual Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
-#if H_3D
+#if NH_3D_DIS
   virtual Void codeDIS          ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
 #endif
@@ -165,5 +165,5 @@
   Void encodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
   Void encodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
-#if H_3D
+#if NH_3D_DIS
   Void encodeDIS               ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD=false );
 #endif
Index: branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1253)
+++ branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1258)
@@ -62,5 +62,5 @@
 , m_cCUSplitFlagSCModel                ( 1,             1,                      NUM_SPLIT_FLAG_CTX                   , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cCUSkipFlagSCModel                 ( 1,             1,                      NUM_SKIP_FLAG_CTX                    , m_contextModels + m_numContextModels, m_numContextModels)
-#if H_3D
+#if NH_3D_DIS
 , m_cCUDISFlagSCModel                  ( 1,             1,                      NUM_DIS_FLAG_CTX                     , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cCUDISTypeSCModel                  ( 1,             1,                      NUM_DIS_TYPE_CTX                     , m_contextModels + m_numContextModels, m_numContextModels)
@@ -143,5 +143,5 @@
   m_cCUSplitFlagSCModel.initBuffer                ( eSliceType, iQp, (UChar*)INIT_SPLIT_FLAG );
   m_cCUSkipFlagSCModel.initBuffer                 ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
-#if H_3D
+#if NH_3D_DIS
   m_cCUDISFlagSCModel.initBuffer                  ( eSliceType, iQp, (UChar*)INIT_DIS_FLAG );
   m_cCUDISTypeSCModel.initBuffer                  ( eSliceType, iQp, (UChar*)INIT_DIS_TYPE );
@@ -231,5 +231,5 @@
       curCost  = m_cCUSplitFlagSCModel.calcCost                ( curSliceType, qp, (UChar*)INIT_SPLIT_FLAG );
       curCost += m_cCUSkipFlagSCModel.calcCost                 ( curSliceType, qp, (UChar*)INIT_SKIP_FLAG );
-#if H_3D
+#if NH_3D_DIS
       curCost += m_cCUDISFlagSCModel.calcCost                  ( curSliceType, qp, (UChar*)INIT_DIS_FLAG );
       curCost += m_cCUDISTypeSCModel.calcCost                  ( curSliceType, qp, (UChar*)INIT_DIS_TYPE );
@@ -297,9 +297,4 @@
   }
 }
-
-#if H_3D
-  m_cCUDISFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_FLAG );
-  m_cCUDISTypeSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_TYPE );
-#endif
 #if H_3D_ARP
   m_cCUPUARPWSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_ARPW );
@@ -420,5 +415,5 @@
 }
 
-#if H_3D
+#if NH_3D_DIS
 Void TEncSbac::codeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
Index: branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncSbac.h
===================================================================
--- branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncSbac.h	(revision 1253)
+++ branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncSbac.h	(revision 1258)
@@ -138,5 +138,5 @@
   Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
   Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-#if H_3D
+#if NH_3D_DIS
   Void codeDIS           ( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
@@ -204,5 +204,5 @@
   ContextModel3DBuffer m_cCUSplitFlagSCModel;
   ContextModel3DBuffer m_cCUSkipFlagSCModel;
-#if H_3D
+#if NH_3D_DIS
   ContextModel3DBuffer m_cCUDISFlagSCModel;
   ContextModel3DBuffer m_cCUDISTypeSCModel;
Index: branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1253)
+++ branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1258)
@@ -1007,5 +1007,5 @@
         }
         m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true );
-#if H_3D
+#if NH_3D_DIS
         m_pcEntropyCoder->encodeDIS(pcCU, 0, true );
         if(!pcCU->getDISFlag(uiAbsPartIdx))
@@ -1013,5 +1013,5 @@
         m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
       }
-#if H_3D
+#if NH_3D_DIS
       else
       {
@@ -1019,5 +1019,5 @@
       }
 #endif
-#if H_3D
+#if NH_3D_DIS
       if(!pcCU->getDISFlag(uiAbsPartIdx))
       {
@@ -1037,9 +1037,9 @@
         }
       }
-#if H_3D
-    }
-#endif
-  }
-#if H_3D
+#if NH_3D_DIS
+    }
+#endif
+  }
+#if NH_3D_DIS
     if(!pcCU->getDISFlag(uiAbsPartIdx))
     {
@@ -1080,5 +1080,5 @@
 #endif
 #endif
-#if H_3D
+#if NH_3D_DIS
       }
 #endif
@@ -1875,34 +1875,39 @@
 }
 
-#if H_3D
+#if NH_3D_DIS
 Void TEncSearch::xIntraCodingDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode )
 {
   UInt    uiWidth           = pcCU     ->getWidth   ( 0 );
   UInt    uiHeight          = pcCU     ->getHeight  ( 0 );
-  UInt    uiStride          = pcOrgYuv ->getStride  ();
-  Pel*    piOrg             = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );
-  Pel*    piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
+  UInt    uiStride          = pcOrgYuv ->getStride  (COMPONENT_Y);
+  Pel*    piOrg             = pcOrgYuv ->getAddr(COMPONENT_Y, uiAbsPartIdx );
+  Pel*    piPred            = pcPredYuv->getAddr(COMPONENT_Y, uiAbsPartIdx );
 
   AOF( uiWidth == uiHeight );
   AOF( uiAbsPartIdx == 0 );
-  pcCU->setDISTypeSubParts(uiPredMode, uiAbsPartIdx, 0, pcCU->getDepth(0));  
+  pcCU->setDISTypeSubParts((UChar)uiPredMode, uiAbsPartIdx, pcCU->getDepth(0));  
   //===== reconstruction =====
 
   Bool bAboveAvail = false;
   Bool bLeftAvail  = false;
-  pcCU->getPattern()->initPattern   ( pcCU, 0, 0 );
-  pcCU->getPattern()->initAdiPattern( pcCU, 0, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
+
+  TComTURecurse rTu(pcCU, 0);
+  const ChromaFormat chFmt     = rTu.GetChromaFormat();
 
   if ( uiPredMode == 0 )
   {
-    predIntraLumaAng( pcCU->getPattern(), VER_IDX, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
+    const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, VER_IDX, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag());
+    initIntraPatternChType( rTu, bAboveAvail, bLeftAvail, COMPONENT_Y, bUseFilteredPredictions  DEBUG_STRING_PASS_INTO(sTemp) );
+    predIntraAng( COMPONENT_Y, VER_IDX, 0, uiStride, piPred, uiStride, rTu, bAboveAvail, bLeftAvail, bUseFilteredPredictions );
   }
   else if ( uiPredMode == 1 )
   {
-    predIntraLumaAng( pcCU->getPattern(), HOR_IDX, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
+    const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, HOR_IDX, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag());
+    initIntraPatternChType( rTu, bAboveAvail, bLeftAvail, COMPONENT_Y, bUseFilteredPredictions  DEBUG_STRING_PASS_INTO(sTemp) );
+    predIntraAng( COMPONENT_Y, HOR_IDX, 0, uiStride, piPred, uiStride, rTu, bAboveAvail, bLeftAvail, bUseFilteredPredictions );
   }
   else if ( uiPredMode == 2 )
   {
-    Pel pSingleDepth = 1 << ( g_bitDepthY - 1 );
+    Pel pSingleDepth = 1 << ( pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) - 1 );
     pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 0 );
     for( UInt uiY = 0; uiY < uiHeight; uiY++ )
@@ -1917,5 +1922,5 @@
   else if ( uiPredMode == 3 )
   {
-    Pel pSingleDepth = 1 << ( g_bitDepthY - 1 );
+    Pel pSingleDepth = 1 << ( pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) - 1 );
     pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 1 );
     for( UInt uiY = 0; uiY < uiHeight; uiY++ )
@@ -1930,7 +1935,7 @@
 
   // clear UV
-  UInt  uiStrideC     = pcPredYuv->getCStride();
-  Pel   *pRecCb       = pcPredYuv->getCbAddr();
-  Pel   *pRecCr       = pcPredYuv->getCrAddr();
+  UInt  uiStrideC     = pcPredYuv->getStride(COMPONENT_Cb);
+  Pel   *pRecCb       = pcPredYuv->getAddr(COMPONENT_Cb);
+  Pel   *pRecCr       = pcPredYuv->getAddr(COMPONENT_Cr);
 
   for (Int y=0; y<uiHeight/2; y++)
@@ -1938,6 +1943,6 @@
     for (Int x=0; x<uiWidth/2; x++)
     {
-      pRecCb[x] = 1<<(g_bitDepthC-1);
-      pRecCr[x] = 1<<(g_bitDepthC-1);
+      pRecCb[x] = 1<<(pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA)-1);
+      pRecCr[x] = 1<<(pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA)-1);
     }
 
@@ -1946,12 +1951,12 @@
   }
 
-  piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
+  piPred            = pcPredYuv->getAddr(COMPONENT_Y, uiAbsPartIdx );
   //===== determine distortion =====
-#if H_3D_VSO
+#if NH_3D_VSO
   if ( m_pcRdCost->getUseVSO() )
-    ruiDist = m_pcRdCost->getDistPartVSO  ( pcCU, uiAbsPartIdx, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );
+    ruiDist = m_pcRdCost->getDistPartVSO  ( pcCU, uiAbsPartIdx, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA), piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );
   else
 #endif
-    ruiDist = m_pcRdCost->getDistPart(g_bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight );
+    ruiDist = m_pcRdCost->getDistPart(pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA), piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, COMPONENT_Y );
 
   //===== determine rate and r-d cost =====
@@ -1960,5 +1965,5 @@
   UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
 
-#if H_3D_VSO
+#if NH_3D_VSO
   if ( m_pcRdCost->getUseLambdaScaleVSO())
     dRDCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist );
@@ -2721,5 +2726,5 @@
 }
 
-#if H_3D
+#if NH_3D_DIS
 Void TEncSearch::estIntraPredDIS( TComDataCU* pcCU, 
                                   TComYuv*    pcOrgYuv, 
@@ -2734,8 +2739,8 @@
   UInt    uiHeight       = pcCU->getHeight(0);
 
-
-  Pel* piOrg         = pcOrgYuv ->getLumaAddr( 0, uiWidth );
-  UInt uiStride      = pcPredYuv->getStride();
-
+#if NH_3D_VSO // M36
+  Pel* piOrg         = pcOrgYuv ->getAddr(COMPONENT_Y, 0, uiWidth );
+  UInt uiStride      = pcPredYuv->getStride(COMPONENT_Y);
+#endif
   Dist   uiDist = 0;
   Double dCost   = 0.0;
@@ -2752,5 +2757,5 @@
     uiDist = 0;
     dCost   = 0.0;
-#if H_3D_VSO // M36
+#if NH_3D_VSO // M36
     if( m_pcRdCost->getUseRenModel() )
     {
@@ -2771,5 +2776,5 @@
 
 
-  pcCU->setDISTypeSubParts(uiBestDISType, 0, 0, uiDepth);  
+  pcCU->setDISTypeSubParts((UChar)uiBestDISType, 0, uiDepth);  
   assert(uiBestDISType >= 0);
 
@@ -7091,5 +7096,5 @@
 
     m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true );
-#if H_3D
+#if NH_3D_DIS
     m_pcEntropyCoder->encodeDIS ( pcCU, 0, true );
 #endif
Index: branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncSearch.h	(revision 1253)
+++ branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncSearch.h	(revision 1258)
@@ -192,5 +192,5 @@
                                   Pel         resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE]
                                   DEBUG_STRING_FN_DECLARE(sDebug));
-#if H_3D
+#if NH_3D_DIS
   Void  estIntraPredDIS        ( TComDataCU* pcCU, 
                                  TComYuv*    pcOrgYuv, 
@@ -344,5 +344,5 @@
   Void  xStoreIntraResultQT       ( const ComponentID compID, TComTU &rTu);
   Void  xLoadIntraResultQT        ( const ComponentID compID, TComTU &rTu);
-#if H_3D
+#if NH_3D_DIS
   Void xIntraCodingDIS           ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode );
 #endif
