Index: branches/0.3-nokia/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- branches/0.3-nokia/source/Lib/TLibEncoder/TEncCfg.h	(revision 33)
+++ branches/0.3-nokia/source/Lib/TLibEncoder/TEncCfg.h	(revision 34)
@@ -159,4 +159,7 @@
   Bool m_bUseDMM;
 #endif
+#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER
+  Bool m_bUseDMM34;
+#endif
 #if HHI_MPI
   Bool m_bUseMVI;
@@ -424,5 +427,8 @@
   Bool getUseDMM()        { return m_bUseDMM; }
 #endif
-
+#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER
+  Void setUseDMM34( Bool b) { m_bUseDMM34 = b;    }
+  Bool getUseDMM34()        { return m_bUseDMM34; }
+#endif
 #if LM_CHROMA
   Bool getUseLMChroma                       ()      { return m_bUseLMChroma;        }
Index: branches/0.3-nokia/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- branches/0.3-nokia/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 33)
+++ branches/0.3-nokia/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 34)
@@ -1126,4 +1126,11 @@
 #endif
 #if HHI_DMM_PRED_TEX
+#if FLEX_CODING_ORDER
+    if ( !pcCU->getSlice()->getSPS()->getUseDMM34() )
+    {
+      assert( uiDir != DMM_WEDGE_PREDTEX_D_IDX );
+      assert( uiDir != DMM_CONTOUR_PREDTEX_D_IDX );
+    }
+#endif
     if( uiDir == DMM_WEDGE_PREDTEX_D_IDX )     { xCodeWedgePredTexDeltaInfo  ( pcCU, uiAbsPartIdx ); }
     if( uiDir == DMM_CONTOUR_PREDTEX_D_IDX )   { xCodeContourPredTexDeltaInfo( pcCU, uiAbsPartIdx ); }
Index: branches/0.3-nokia/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/0.3-nokia/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 33)
+++ branches/0.3-nokia/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 34)
@@ -1926,4 +1926,8 @@
 #endif
 #if HHI_DMM_PRED_TEX
+#if FLEX_CODING_ORDER
+      if ( pcCU->getSlice()->getSPS()->getUseDMM34() )
+      {
+#endif
       TComYuv cTempYuv; cTempYuv.create( uiWidth, uiHeight ); cTempYuv.clear();
       Pel* piTempY      = cTempYuv.getLumaAddr();
@@ -1958,6 +1962,8 @@
         uiRdModeList[ uiNewMaxMode++ ] = DMM_CONTOUR_PREDTEX_D_IDX;
       }
-
       cTempYuv.destroy();
+#if FLEX_CODING_ORDER
+      }
+#endif
 #endif
     }
@@ -1988,5 +1994,9 @@
 #else
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
+#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER
+      if( m_pcEncCfg->isDepthCoder() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getUseDMM34() ) )
+#else
       if( m_pcEncCfg->isDepthCoder() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight ) )
+#endif
         continue;
 #endif
@@ -2076,5 +2086,9 @@
 #else
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
+#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER
+      if( m_pcEncCfg->isDepthCoder() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getUseDMM34() ) )
+#else
       if( m_pcEncCfg->isDepthCoder() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight ) )
+#endif
         continue;
 #endif
@@ -2719,5 +2733,9 @@
 }
 
+#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER
+Bool TEncSearch::predIntraLumaDMMAvailable( UInt uiMode, UInt uiWidth, UInt uiHeight, Bool bDMMAvailable34 )
+#else
 Bool TEncSearch::predIntraLumaDMMAvailable( UInt uiMode, UInt uiWidth, UInt uiHeight )
+#endif
 {
   if( uiMode <= MAX_MODE_ID_INTRA_DIR ) return true;
@@ -2747,4 +2765,10 @@
       bDMMAvailable = false;
     }
+#if FLEX_CODING_ORDER
+    if ( !bDMMAvailable34 )
+    {
+      bDMMAvailable = false;
+    }
+#endif
   }
 
Index: branches/0.3-nokia/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- branches/0.3-nokia/source/Lib/TLibEncoder/TEncSearch.h	(revision 33)
+++ branches/0.3-nokia/source/Lib/TLibEncoder/TEncSearch.h	(revision 34)
@@ -207,5 +207,10 @@
   Bool predIntraLumaDMMAvailable( UInt         uiMode, 
                                   UInt         uiWidth, 
+#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER
+                                  UInt         uiHeight, 
+                                  Bool         bDMMAvailable34 );
+#else
                                   UInt         uiHeight );
+#endif
 #endif
 #if HHI_DMM_WEDGE_INTRA
Index: branches/0.3-nokia/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/0.3-nokia/source/Lib/TLibEncoder/TEncTop.cpp	(revision 33)
+++ branches/0.3-nokia/source/Lib/TLibEncoder/TEncTop.cpp	(revision 34)
@@ -287,6 +287,9 @@
 
   bool bSomethingCoded = false ;
-
+#if FLEX_CODING_ORDER  
+  if (TEncTop::m_bPicWaitingForCoding )
+#else
   if (m_bPicWaitingForCoding )
+#endif
   {
     std::map<Int, TComPic*>::iterator cIter = m_acInputPicMap.find( (Int)m_cSeqIter.getPoc() );
@@ -615,4 +618,7 @@
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
   m_cSPS.setUseDMM( m_bUseDMM );
+#endif
+#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER
+  m_cSPS.setUseDMM34( m_bUseDMM34 );
 #endif
 #if HHI_MPI
