Index: branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComPrediction.cpp	(revision 612)
+++ branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComPrediction.cpp	(revision 613)
@@ -2852,6 +2852,11 @@
   Int           uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255;
 
+#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
+  assert( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 );
+  return g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]][uiColTexIntraDir-2].at(intraTabIdx);
+#else
   if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 ) { return g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]][uiColTexIntraDir-2].at(intraTabIdx); }
   else                                                     { return g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])].at(intraTabIdx).getPatternIdx(); }
+#endif
 }
 
Index: branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComRom.cpp	(revision 612)
+++ branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComRom.cpp	(revision 613)
@@ -347,5 +347,5 @@
 { //2x2   4x4   8x8 16x16 32x32 64x64
      0,    7,   10,   11,   11,   13 };
-#if LGE_PKU_DMM3_OVERLAP_E0159
+#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
 const UChar g_dmm3IntraTabIdxBits[6] =
 { //2x2   4x4   8x8 16x16 32x32 64x64
@@ -611,5 +611,9 @@
 std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
 
+#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
+Void initWedgeLists( Bool initNodeList )
+#else
 Void initWedgeLists( Bool initRefinements )
+#endif
 {
   if( !g_dmmWedgeLists.empty() ) return;
@@ -624,4 +628,8 @@
     g_dmmWedgeRefLists.push_back( acWedgeRefList );
 
+#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
+    if( initNodeList )
+    {
+#endif
     // create WedgeNodeList
     std::vector<TComWedgeNode> acWedgeNodeList;
@@ -633,6 +641,8 @@
         cWedgeNode.setPatternIdx( uiPos );
 
+#if !LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
         if( initRefinements )
         {
+#endif
           UInt uiRefPos = 0;
           for( Int iOffS = -1; iOffS <= 1; iOffS++ )
@@ -681,9 +691,14 @@
             }
           }
+#if !LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
         }
+#endif
         acWedgeNodeList.push_back( cWedgeNode );
       }
     }
     g_dmmWedgeNodeLists.push_back( acWedgeNodeList );
+#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
+  }
+#endif
   }
   return;
Index: branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComRom.h
===================================================================
--- branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComRom.h	(revision 612)
+++ branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComRom.h	(revision 613)
@@ -174,5 +174,9 @@
 extern       std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
 
+#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
+Void initWedgeLists( Bool initNodeList = false );
+#else
 Void initWedgeLists( Bool initRefinements = false );
+#endif
 Void createWedgeList( UInt uiWidth, UInt uiHeight, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList, WedgeResolution eWedgeRes );
 Void addWedgeletToList( TComWedgelet cWedgelet, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList );
Index: branches/HTM-8.0-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-8.0-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 612)
+++ branches/HTM-8.0-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 613)
@@ -265,5 +265,5 @@
 #endif
 #if H_3D_DIM_DMM
-#define LGE_PKU_DMM3_OVERLAP_E0159        1   // Removal of overlap between DMM3 and DMM1
+#define LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1   // Removal of overlap between DMM3 and DMM1
 #endif
 #endif
Index: branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 612)
+++ branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 613)
@@ -2893,5 +2893,5 @@
           case( DMM3_IDX ):
             {
-#if LGE_PKU_DMM3_OVERLAP_E0159
+#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
               TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
               TComDataCU* pcColTexCU = pcPicTex->getCU( pcCU->getAddr() );
@@ -2903,9 +2903,13 @@
 #endif
               UInt uiIntraTabIdx = 0;
+#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
+              xSearchDmm3Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx, uiIntraTabIdx, uiColTexIntraDir );
+#else
               xSearchDmm3Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx, uiIntraTabIdx );
+#endif
               pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth );
               pcCU->setDmm3IntraTabIdxSubParts( uiIntraTabIdx, uiPartOffset, uiDepth + uiInitTrDepth );
               biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
-#if LGE_PKU_DMM3_OVERLAP_E0159
+#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
               }
 #endif
@@ -7429,5 +7433,6 @@
 #endif
 
-Void TEncSearch::xSearchDmm3Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx )
+#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
+Void TEncSearch::xSearchDmm3Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir )
 {
   ruiTabIdx       = 0;
@@ -7446,4 +7451,41 @@
   Pel refDC1 = 0; Pel refDC2 = 0;
 
+  std::vector< std::vector<UInt> > pauiWdgLstSz = g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]];
+  std::vector<UInt>* pauiWdgLst = &pauiWdgLstSz[colTexIntraDir-2];
+  for( UInt uiIdxW = 0; uiIdxW < pauiWdgLst->size(); uiIdxW++ )
+  {
+    UInt uiIdx     =   pauiWdgLst->at(uiIdxW);
+    TComWedgelet* pcWedgelet = &(pacWedgeList->at(uiIdx));
+    xCalcBiSegDCs  ( piRef,  uiRefStride,  pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
+    xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
+
+    UInt uiActDist = m_pcRdCost->getDistPart( g_bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, TEXT_LUMA, DF_SAD );
+    if( uiActDist < uiBestDist || uiBestDist == MAX_UINT )
+    {
+      uiBestDist     = uiActDist;
+      ruiTabIdx      = uiIdx;
+      ruiIntraTabIdx = uiIdxW;
+    }
+  }
+  cPredYuv.destroy();
+}
+#else
+Void TEncSearch::xSearchDmm3Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx )
+{
+  ruiTabIdx       = 0;
+  ruiIntraTabIdx  = 0;
+
+  // local pred buffer
+  TComYuv cPredYuv; 
+  cPredYuv.create( uiWidth, uiHeight ); 
+  cPredYuv.clear();
+  Pel* piPred = cPredYuv.getLumaAddr();
+  UInt uiPredStride = cPredYuv.getStride();
+
+  // wedge search
+  UInt uiBestDist = MAX_UINT;
+  WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
+  Pel refDC1 = 0; Pel refDC2 = 0;
+
   TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
   assert( pcPicTex != NULL );
@@ -7496,4 +7538,5 @@
   cPredYuv.destroy();
 }
+#endif
 #endif
 #if H_3D_DIM_RBC
Index: branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncSearch.h	(revision 612)
+++ branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncSearch.h	(revision 613)
@@ -355,5 +355,9 @@
   Void xSearchDmm2Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd );
 #endif
+#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
+  Void xSearchDmm3Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir );
+#else
   Void xSearchDmm3Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx );
+#endif
 #endif
 #if H_3D_DIM_RBC
