Index: /branches/HTM-11.2-dev3-HHI/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-11.2-dev3-HHI/source/Lib/TLibCommon/TypeDef.h	(revision 1018)
+++ /branches/HTM-11.2-dev3-HHI/source/Lib/TLibCommon/TypeDef.h	(revision 1019)
@@ -308,4 +308,5 @@
                                               // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
                                               // LG_ZEROINTRADEPTHRESI_A0087
+#define HHI_DMM4_ENC_I0066                1
 #endif
 ///// ***** VIEW SYNTHESIS PREDICTION *********
Index: /branches/HTM-11.2-dev3-HHI/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- /branches/HTM-11.2-dev3-HHI/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1018)
+++ /branches/HTM-11.2-dev3-HHI/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1019)
@@ -1028,13 +1028,31 @@
           // speedup for inter frames
           if( rpcBestCU->getSlice()->getSliceType() == I_SLICE || 
-            rpcBestCU->getCbf( 0, TEXT_LUMA     ) != 0   ||
-            rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) != 0   ||
+              rpcBestCU->getCbf( 0, TEXT_LUMA     ) != 0   ||
+              rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) != 0   ||
               rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) != 0     
 #if H_3D_DIM_ENC
+#if HHI_DMM4_ENC_I0066
+              || rpcBestCU->getSlice()->getIsDepth()
+#else
             || ( rpcBestCU->getSlice()->getIsDepth() && rpcBestCU->getSlice()->isIRAP() )
+#endif
 #endif
             ) // avoid very complex intra if it is unlikely
           {
+#if HHI_DMM4_ENC_I0066
+            Bool bOnlyIVP = false;
+            if( rpcBestCU->getSlice()->getIsDepth() && !(rpcBestCU->getSlice()->isIRAP()) && 
+                rpcBestCU->getSlice()->getSliceType() != I_SLICE && 
+                rpcBestCU->getCbf( 0, TEXT_LUMA     ) == 0 &&
+                rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) == 0 &&
+                rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) == 0 
+              )
+            { 
+              bOnlyIVP = true;
+            }
+            xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bOnlyIVP );
+#else
             xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N );
+#endif
 
 #if KWU_RC_MADPRED_E0227
@@ -1055,5 +1073,9 @@
                 if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) )
                 {
+#if HHI_DMM4_ENC_I0066
+                  xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN, bOnlyIVP );
+#else
                   xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN   );
+#endif
                   rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
                 }
@@ -2628,5 +2650,9 @@
 #endif
 
+#if HHI_DMM4_ENC_I0066
+Void TEncCu::xCheckRDCostIntra( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize, Bool bOnlyIVP )
+#else
 Void TEncCu::xCheckRDCostIntra( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
+#endif
 {
   UInt uiDepth = rpcTempCU->getDepth( 0 );
@@ -2656,6 +2682,9 @@
     m_pcPredSearch->preestChromaPredMode( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth] );
   }
+#if HHI_DMM4_ENC_I0066
+  m_pcPredSearch  ->estIntraPredQT      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, bSeparateLumaChroma, bOnlyIVP );
+#else
   m_pcPredSearch  ->estIntraPredQT      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, bSeparateLumaChroma );
-
+#endif
   m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() );
   
Index: /branches/HTM-11.2-dev3-HHI/source/Lib/TLibEncoder/TEncCu.h
===================================================================
--- /branches/HTM-11.2-dev3-HHI/source/Lib/TLibEncoder/TEncCu.h	(revision 1018)
+++ /branches/HTM-11.2-dev3-HHI/source/Lib/TLibEncoder/TEncCu.h	(revision 1019)
@@ -162,5 +162,9 @@
   Void  xCheckRDCostSingleDepth   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
 #endif
+#if HHI_DMM4_ENC_I0066
+  Void  xCheckRDCostIntra   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bOnlyIVP );
+#else
   Void  xCheckRDCostIntra   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
+#endif
   Void  xCheckDQP           ( TComDataCU*  pcCU );
   
Index: /branches/HTM-11.2-dev3-HHI/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- /branches/HTM-11.2-dev3-HHI/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1018)
+++ /branches/HTM-11.2-dev3-HHI/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1019)
@@ -2977,10 +2977,14 @@
 Void 
 TEncSearch::estIntraPredQT( TComDataCU* pcCU, 
-                           TComYuv*    pcOrgYuv, 
-                           TComYuv*    pcPredYuv, 
-                           TComYuv*    pcResiYuv, 
-                           TComYuv*    pcRecoYuv,
-                           UInt&       ruiDistC,
-                           Bool        bLumaOnly )
+                            TComYuv*    pcOrgYuv, 
+                            TComYuv*    pcPredYuv, 
+                            TComYuv*    pcResiYuv, 
+                            TComYuv*    pcRecoYuv,
+                            UInt&       ruiDistC,
+                            Bool        bLumaOnly
+#if HHI_DMM4_ENC_I0066
+                          , Bool        bOnlyIVP
+#endif
+                          )
 {
   UInt    uiDepth        = pcCU->getDepth(0);
@@ -3028,4 +3032,12 @@
     Int numModesForFullRD = g_aucIntraModeNumFast[ uiWidthBit ];
     
+#if HHI_DMM4_ENC_I0066
+    if( bOnlyIVP )
+    {
+      numModesForFullRD = 0;
+    }
+    else
+    {
+#endif
     Bool doFastSearch = (numModesForFullRD != numModesAvailable);
     if (doFastSearch)
@@ -3119,10 +3131,39 @@
       }
     }
-    
+#if HHI_DMM4_ENC_I0066
+    }
+#endif
+
 #if H_3D_DIM
     //===== determine set of depth intra modes to be tested =====
     if( m_pcEncCfg->getIsDepth() && uiWidth >= DIM_MIN_SIZE && uiWidth <= DIM_MAX_SIZE && uiWidth == uiHeight )
     {
-
+#if HHI_DMM4_ENC_I0066
+#if SEPARATE_FLAG_I0085
+      if( bOnlyIVP && m_pcEncCfg->getUseIVP() )
+#else
+      if( bOnlyIVP )
+#endif
+      {
+        TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
+        xPredContourFromTex( pcCU, uiPartOffset, uiWidth, uiHeight, dmm4Segmentation );
+
+        Pel deltaDC1 = 0; Pel deltaDC2 = 0;
+        xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, dmm4Segmentation->getPattern(), dmm4Segmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 );
+        pcCU->setDimDeltaDC( DMM4_IDX, 0, uiPartOffset, deltaDC1 );
+        pcCU->setDimDeltaDC( DMM4_IDX, 1, uiPartOffset, deltaDC2 );
+
+#if HS_DMM_SIGNALLING_I0120
+        uiRdModeList[ numModesForFullRD++ ] = (DMM4_IDX+DIM_OFFSET);
+#else
+        uiRdModeList[ numModesForFullRD++ ] = (2*DMM4_IDX  +DIM_OFFSET);
+        if( deltaDC1 != 0 || deltaDC2 != 0 )
+          uiRdModeList[ numModesForFullRD++ ] = (2*DMM4_IDX+1+DIM_OFFSET);
+#endif
+        dmm4Segmentation->destroy(); delete dmm4Segmentation;
+      }
+      else
+      {
+#endif
 #if H_3D_FAST_DEPTH_INTRA
       Int  threshold    = max(((pcCU->getQP(0))>>3)-1,3);
@@ -3223,4 +3264,7 @@
 #else
             uiRdModeList[ numModesForFullRD++ ] = (2*dmmType  +DIM_OFFSET);
+#if HHI_DMM4_ENC_I0066
+            if( deltaDC1 != 0 || deltaDC2 != 0 )
+#endif
             uiRdModeList[ numModesForFullRD++ ] = (2*dmmType+1+DIM_OFFSET);
 #endif
@@ -3230,4 +3274,7 @@
         }
       }
+#if HHI_DMM4_ENC_I0066
+      }
+#endif
 #endif
     }
Index: /branches/HTM-11.2-dev3-HHI/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- /branches/HTM-11.2-dev3-HHI/source/Lib/TLibEncoder/TEncSearch.h	(revision 1018)
+++ /branches/HTM-11.2-dev3-HHI/source/Lib/TLibEncoder/TEncSearch.h	(revision 1019)
@@ -180,5 +180,9 @@
                                   TComYuv*    pcRecoYuv,
                                   UInt&       ruiDistC,
-                                  Bool        bLumaOnly );
+                                  Bool        bLumaOnly
+#if HHI_DMM4_ENC_I0066
+                                , Bool        bOnlyIVP
+#endif
+                                );
   Void  estIntraPredChromaQT    ( TComDataCU* pcCU, 
                                   TComYuv*    pcOrgYuv, 
