Index: branches/HTM-8.2-dev0/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- branches/HTM-8.2-dev0/source/Lib/TLibCommon/ContextTables.h	(revision 711)
+++ branches/HTM-8.2-dev0/source/Lib/TLibCommon/ContextTables.h	(revision 712)
@@ -109,8 +109,14 @@
 #define NUM_DEPTH_INTRA_MODE_CTX      8       ///< number of context models for depth intra modes
 #define NUM_DDC_FLAG_CTX              2       ///< number of context models for deltaDC flag (DMM or RBC)
+#if QC_DIM_DELTADC_UNIFY_F0132
+#define NUM_DDC_DATA_CTX              1       ///< number of context models for deltaDC data (DMM or RBC)
+#else
 #define NUM_DDC_DATA_CTX              2       ///< number of context models for deltaDC data (DMM or RBC)
+#endif
 #if H_3D_DIM_DMM
 #define NUM_DMM1_DATA_CTX             1       ///< number of context models for DMM1 data
+#if !SEC_DMM3_RBC_F0147
 #define NUM_DMM3_DATA_CTX             1       ///< number of context models for DMM3 data
+#endif
 #endif
 #if H_3D_DIM_RBC
@@ -387,7 +393,13 @@
 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] =  
 {
+#if LGE_IC_CTX_F0160
+    { 154,  154,  154, },
+    { 154,  154,  154, },
+    { 154,  154,  154, },
+#else
   { CNU,  CNU,  CNU, }, 
   { 197,  185,  201, }, 
   { 197,  185,  201, }, 
+#endif
 };
 #endif
@@ -411,7 +423,13 @@
 INIT_DDC_DATA[3][NUM_DDC_DATA_CTX] = 
 {
+#if QC_DIM_DELTADC_UNIFY_F0132
+  { 154 }, 
+  { 154 }, 
+  { 154 }, 
+#else
   { CNU, CNU }, 
   { CNU, CNU }, 
   { CNU, CNU }, 
+#endif
 };
 #if H_3D_DIM_DMM
@@ -423,4 +441,5 @@
   { CNU }, 
 };
+#if !SEC_DMM3_RBC_F0147
 static const UChar
 INIT_DMM3_DATA[3][NUM_DMM3_DATA_CTX] = 
@@ -430,4 +449,5 @@
   { CNU }, 
 };
+#endif
 #endif
 #if H_3D_DIM_RBC
Index: branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 711)
+++ branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 712)
@@ -120,5 +120,7 @@
     m_dmmWedgeTabIdx[i] = NULL;
   }
+#if !SEC_DMM3_RBC_F0147
   m_dmm3IntraTabIdx = NULL;
+#endif
 #endif
 #if H_3D_DIM_RBC
@@ -271,5 +273,7 @@
       m_dmmWedgeTabIdx[i]    = (UInt*)xMalloc(UInt, uiNumPartition);
     }
+#if !SEC_DMM3_RBC_F0147
     m_dmm3IntraTabIdx = (UInt*)xMalloc(UInt, uiNumPartition);
+#endif
 #endif
 #if H_3D_DIM_RBC
@@ -404,5 +408,7 @@
       if ( m_dmmWedgeTabIdx[i] ) { xFree( m_dmmWedgeTabIdx[i] ); m_dmmWedgeTabIdx[i] = NULL; }
     }
+#if !SEC_DMM3_RBC_F0147
     if ( m_dmm3IntraTabIdx ) { xFree( m_dmm3IntraTabIdx ); m_dmm3IntraTabIdx = NULL; }
+#endif
 #endif
 #if H_3D_DIM_RBC
@@ -622,5 +628,7 @@
       memset( m_dmmWedgeTabIdx[i] + firstElement, 0,                      numElements * sizeof( *m_dmmWedgeTabIdx[i] ) );
     }
+#if !SEC_DMM3_RBC_F0147
     memset( m_dmm3IntraTabIdx   + firstElement, 0,                        numElements * sizeof( *m_dmm3IntraTabIdx ) );
+#endif
 #endif
 #if H_3D_DIM_RBC
@@ -799,5 +807,7 @@
         m_dmmWedgeTabIdx[i] [ui] = 0;
       }
+#if !SEC_DMM3_RBC_F0147
       m_dmm3IntraTabIdx [ui] = 0;
+#endif
 #endif
 #if H_3D_DIM_SDC
@@ -910,5 +920,7 @@
     memset( m_dmmWedgeTabIdx[i], 0, sizeof(UInt) * m_uiNumPartition );
   }
+#if !SEC_DMM3_RBC_F0147
   memset( m_dmm3IntraTabIdx, 0, sizeof(UInt) * m_uiNumPartition );
+#endif
 #endif
 #if H_3D_DIM_RBC
@@ -992,5 +1004,7 @@
         m_dmmWedgeTabIdx[i] [ui] = pcCU->m_dmmWedgeTabIdx[i] [uiPartOffset+ui];
       }
+#if !SEC_DMM3_RBC_F0147
       m_dmm3IntraTabIdx [ui] = pcCU->m_dmm3IntraTabIdx[uiPartOffset+ui];
+#endif
 #endif
 #if H_3D_DIM_SDC
@@ -1146,5 +1160,7 @@
     m_dmmWedgeTabIdx[i] = pcCU->getDmmWedgeTabIdx( i ) + uiPart;
   }
+#if !SEC_DMM3_RBC_F0147
   m_dmm3IntraTabIdx = pcCU->getDmm3IntraTabIdx() + uiPart;
+#endif
 #endif
 #if H_3D_DIM_RBC
@@ -1342,5 +1358,7 @@
     memcpy( m_dmmWedgeTabIdx[i] + uiOffset, pcCU->getDmmWedgeTabIdx( i ), sizeof(UInt) * uiNumPartition );
   }
+#if !SEC_DMM3_RBC_F0147
   memcpy( m_dmm3IntraTabIdx + uiOffset, pcCU->getDmm3IntraTabIdx(), sizeof(UInt) * uiNumPartition );
+#endif
 #endif
 #if H_3D_DIM_RBC
@@ -1469,5 +1487,7 @@
     memcpy( rpcCU->getDmmWedgeTabIdx( i ) + m_uiAbsIdxInLCU, m_dmmWedgeTabIdx[i], sizeof(UInt) * m_uiNumPartition );
   }
+#if !SEC_DMM3_RBC_F0147
   memcpy( rpcCU->getDmm3IntraTabIdx() + m_uiAbsIdxInLCU, m_dmm3IntraTabIdx, sizeof(UInt) * m_uiNumPartition );
+#endif
 #endif
 #if H_3D_DIM_RBC
@@ -1582,5 +1602,7 @@
     memcpy( rpcCU->getDmmWedgeTabIdx( i ) + uiPartOffset, m_dmmWedgeTabIdx[i], sizeof(UInt) * uiQNumPart );
   }
+#if !SEC_DMM3_RBC_F0147
   memcpy( rpcCU->getDmm3IntraTabIdx() + uiPartOffset, m_dmm3IntraTabIdx, sizeof(UInt) * uiQNumPart );
+#endif
 #endif
 #if H_3D_DIM_RBC
@@ -2313,4 +2335,15 @@
 {
   UInt        uiCtx = 0;
+
+#if LGE_IC_CTX_F0160
+  TComDataCU* pcTempCU = NULL;
+  UInt        uiTempPartIdx = 0;
+
+  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
+  uiCtx    = ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0;
+
+  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
+  uiCtx    += ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0;
+#endif
 
   return uiCtx;
@@ -6647,4 +6680,15 @@
 }
 
+#if LGE_IC_CTX_F0160
+Bool TComDataCU::isIC( UInt uiPartIdx )
+{
+    if ( m_pcSlice->isIntra () )
+    {
+        return false;
+    }
+    return ( ( getSkipFlag(uiPartIdx) || getPredictionMode(uiPartIdx) == MODE_INTER) && getICFlag( uiPartIdx ) && isICFlagRequired( uiPartIdx ) );
+}
+#endif
+
 // ====================================================================================================================
 // Protected member functions
@@ -8304,4 +8348,5 @@
   for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; }
 }
+#if !SEC_DMM3_RBC_F0147
 Void  TComDataCU::setDmm3IntraTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth )
 {
@@ -8309,4 +8354,5 @@
   for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm3IntraTabIdx[uiAbsPartIdx+ui] = uiTIdx; }
 }
+#endif
 #endif
 #if H_3D_DIM_RBC
Index: branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 711)
+++ branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 712)
@@ -208,5 +208,7 @@
 #if H_3D_DIM_DMM
   UInt*         m_dmmWedgeTabIdx[DMM_NUM_TYPE]; 
+#if !SEC_DMM3_RBC_F0147
   UInt*         m_dmm3IntraTabIdx;
+#endif
 #endif
 #if H_3D_DIM_RBC
@@ -570,8 +572,10 @@
   Void  setDmmWedgeTabIdxSubParts     ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth );
 
+#if !SEC_DMM3_RBC_F0147
   UInt* getDmm3IntraTabIdx            ()                      { return m_dmm3IntraTabIdx;        }
   UInt  getDmm3IntraTabIdx            ( UInt uiIdx )          { return m_dmm3IntraTabIdx[uiIdx]; }
   Void  setDmm3IntraTabIdx            ( UInt uiIdx, UInt uh ) { m_dmm3IntraTabIdx[uiIdx] = uh;   }
   Void  setDmm3IntraTabIdxSubParts    ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
+#endif
 #endif
 #if H_3D_DIM_RBC
@@ -725,4 +729,8 @@
   Bool          isSkipped ( UInt uiPartIdx );                                                     ///< SKIP (no residual)
   Bool          isBipredRestriction( UInt puIdx );
+
+#if LGE_IC_CTX_F0160
+  Bool          isIC      ( UInt uiPartIdx );
+#endif
 
   // -------------------------------------------------------------------------------------------------------------------
Index: branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp	(revision 711)
+++ branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp	(revision 712)
@@ -425,5 +425,7 @@
   Bool dimDeltaDC = isDimDeltaDC( uiIntraMode );    
   Bool isDmmMode  = (dimType <  DMM_NUM_TYPE);
+#if !SEC_DMM3_RBC_F0147
   Bool isRbcMode  = (dimType == RBC_IDX);
+#endif
 
   Bool* biSegPattern  = NULL;
@@ -441,4 +443,5 @@
         dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]);
       } break;
+#if !SEC_DMM3_RBC_F0147
     case( DMM3_IDX ): 
       {
@@ -452,4 +455,5 @@
         dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ uiTabIdx ]);
       } break;
+#endif
     case( DMM4_IDX ): 
       {
@@ -475,6 +479,10 @@
   assert( biSegPattern );
   Int* piMask = NULL;
+#if QC_DIM_DELTADC_UNIFY_F0132 || HHI_DIM_PREDSAMP_FIX_F0171
+  piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering
+#else
   if( isDmmMode ) piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering for DMM
   else            piMask = pcCU->getPattern()->getPredictorPtr( 0, g_aucConvertToBit[ iWidth ] + 2, m_piYuvExt );
+#endif
   assert( piMask );
   Int maskStride = 2*iWidth + 1;  
@@ -491,5 +499,9 @@
     Pel deltaDC2 = pcCU->getDimDeltaDC( dimType, 1, uiAbsPartIdx );
 #if H_3D_DIM_DMM
+#if QC_DIM_DELTADC_UNIFY_F0132 && !SEC_DMM3_RBC_F0147
+    if( isDmmMode || isRbcMode)
+#else
     if( isDmmMode )
+#endif
     {
 #if H_3D_DIM_DLT
@@ -502,5 +514,5 @@
     }
 #endif
-#if H_3D_DIM_RBC
+#if H_3D_DIM_RBC && !QC_DIM_DELTADC_UNIFY_F0132
     if( isRbcMode )
     {
@@ -2398,4 +2410,5 @@
 
 #if H_3D_DIM_DMM
+#if !SEC_DMM3_RBC_F0147
 UInt TComPrediction::xPredWedgeFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt intraTabIdx )
 {
@@ -2409,4 +2422,5 @@
   return g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]][uiColTexIntraDir-2].at(intraTabIdx);
 }
+#endif
 
 Void TComPrediction::xPredContourFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge )
Index: branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComRom.cpp	(revision 711)
+++ branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComRom.cpp	(revision 712)
@@ -604,5 +604,7 @@
 std::vector< std::vector<TComWedgeRef>  > g_dmmWedgeRefLists;
 std::vector< std::vector<TComWedgeNode> > g_dmmWedgeNodeLists;
+#if !SEC_DMM3_RBC_F0147
 std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
+#endif
 
 Void initWedgeLists( Bool initNodeList )
@@ -723,4 +725,5 @@
   }
 
+#if !SEC_DMM3_RBC_F0147
   UInt uiThrSz = DMM3_SIMPLIFY_TR;
   std::vector< std::vector<UInt> > auiWdgListSz;
@@ -739,4 +742,5 @@
   }
   g_aauiWdgLstM3.push_back(auiWdgListSz);
+#endif
 }
 
Index: branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComRom.h
===================================================================
--- branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComRom.h	(revision 711)
+++ branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComRom.h	(revision 712)
@@ -172,5 +172,7 @@
 extern       std::vector< std::vector<TComWedgeRef> >        g_dmmWedgeRefLists;
 extern       std::vector< std::vector<TComWedgeNode> >       g_dmmWedgeNodeLists;
+#if !SEC_DMM3_RBC_F0147
 extern       std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
+#endif
 
 Void initWedgeLists( Bool initNodeList = false );
Index: branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComWedgelet.h
===================================================================
--- branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComWedgelet.h	(revision 711)
+++ branches/HTM-8.2-dev0/source/Lib/TLibCommon/TComWedgelet.h	(revision 712)
@@ -50,13 +50,23 @@
 enum DIM_IDX
 {
+#if SEC_DMM3_RBC_F0147
+  DMM1_IDX = 0,
+  DMM4_IDX = 1,
+#else
   DMM1_IDX = 0,
   DMM3_IDX = 1,
   DMM4_IDX = 2,
   RBC_IDX  = 3
+#endif
 };
 
+#if SEC_DMM3_RBC_F0147
+#define DMM_NUM_TYPE   2
+#define DIM_NUM_TYPE   (DMM_NUM_TYPE)
+#else
 #define DMM_NUM_TYPE   3
 #define RBC_NUM_TYPE   1
 #define DIM_NUM_TYPE   (DMM_NUM_TYPE+RBC_NUM_TYPE)
+#endif
 #define DIM_NO_IDX     MAX_UINT
 
@@ -75,5 +85,7 @@
 #define DMM_NO_WEDGEINDEX       MAX_UINT
 #define DMM_NUM_WEDGE_REFINES   8
+#if !SEC_DMM3_RBC_F0147
 #define DMM3_SIMPLIFY_TR        1
+#endif
 
 enum WedgeResolution
Index: branches/HTM-8.2-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-8.2-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 711)
+++ branches/HTM-8.2-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 712)
@@ -65,4 +65,5 @@
 #define H_3D          ( HEVC_EXT == 2)
 
+#define LGE_BUGFIX_F0158 1 //JCT3V-F0158
 /////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////   MAJOR DEFINES   ///////////////////////////////////  
@@ -103,4 +104,7 @@
                                               // MTK_CLIPPING_ALIGN_IC_E0168       // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168
 
+#define LGE_IC_CTX_F0160 1 //JCT3V-F0160
+#define SEC_ONLY_TEXTURE_IC_F0151         1
+
 #if H_3D_NBDV
 #define H_3D_NBDV_REF                     1   // Depth oriented neighboring block disparity derivation
@@ -158,4 +162,5 @@
                                               // LGE_SDC_REMOVE_DC_E0158 Removal of DC mode from SDC
                                               // LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1   Removal of overlap between DMM3 and DMM1
+#define SEC_DMM3_RBC_F0147                1   // Removal of DMM3 and RBC from DMMs
 
 #define H_3D_INTER_SDC                    1   // INTER SDC, Inter simplified depth coding
@@ -213,5 +218,7 @@
 #if H_3D_DIM
 #define H_3D_DIM_DMM                      1   // Depth Modeling Modes
+#if !SEC_DMM3_RBC_F0147
 #define H_3D_DIM_RBC                      1   // Region Boundary Chain mode
+#endif
 #define H_3D_DIM_SDC                      1   // Simplified Depth Coding method
 #define H_3D_DIM_DLT                      1   // Depth Lookup Table
@@ -219,4 +226,7 @@
                                               // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
                                               // LG_ZEROINTRADEPTHRESI_A0087
+#define QC_DIM_DELTADC_UNIFY_F0132        1   // Unify delta DC coding in depth intra modes
+#define HHI_DIM_PREDSAMP_FIX_F0171        1
+#define LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 1 //JCT3V-F0159
 #endif
 ///// ***** VIEW SYNTHESIS PREDICTION *********
