Index: /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_2view+depth.cfg
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_2view+depth.cfg	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_2view+depth.cfg	(revision 902)
@@ -198,4 +198,5 @@
 AdvMultiviewResPred                 : 1                # Advanced inter-view residual prediction (0:off, 1:on)
 IlluCompEnable                      : 1                # Enable Illumination compensation ( 0: off, 1: on )   (v/d) 
+IlluCompLowLatencyEnc               : 0                # Enable low-latency Illumination compensation encoding( 0: off, 1: on )
 ViewSynthesisPred                   : 1                # View synthesis prediction 
 DepthRefinement                     : 1                # Dispary refined by depth DoNBDV
Index: /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_2view.cfg
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_2view.cfg	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_2view.cfg	(revision 902)
@@ -173,4 +173,5 @@
 AdvMultiviewResPred                 : 1                # Advanced inter-view residual prediction (0:off, 1:on)
 IlluCompEnable                      : 1                # Enable Illumination compensation ( 0: off, 1: on ) (v/d)
+IlluCompLowLatencyEnc               : 0                # Enable low-latency Illumination compensation encoding( 0: off, 1: on )
 ViewSynthesisPred                   : 1                # View synthesis prediction 
 DepthRefinement                     : 1                # Dispary refined by depth DoNBDV
Index: /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_3view+depth.cfg
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_3view+depth.cfg	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_3view+depth.cfg	(revision 902)
@@ -229,4 +229,5 @@
 AdvMultiviewResPred                 : 1                # Advanced inter-view residual prediction (0:off, 1:on)
 IlluCompEnable                      : 1                # Enable Illumination compensation ( 0: off, 1: on )  (v/d)
+IlluCompLowLatencyEnc               : 0                # Enable low-latency Illumination compensation encoding( 0: off, 1: on )
 ViewSynthesisPred                   : 1                # View synthesis prediction 
 DepthRefinement                     : 1                # Dispary refined by depth DoNBDV
Index: /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_3view.cfg
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_3view.cfg	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_3view.cfg	(revision 902)
@@ -188,4 +188,5 @@
 AdvMultiviewResPred                 : 1                # Advanced inter-view residual prediction (0:off, 1:on)
 IlluCompEnable                      : 1                # Enable Illumination compensation ( 0: off, 1: on )   (v/d)
+IlluCompLowLatencyEnc               : 0                # Enable low-latency Illumination compensation encoding( 0: off, 1: on )
 ViewSynthesisPred                   : 0                # View synthesis prediction 
 DepthRefinement                     : 0                # Dispary refined by depth DoNBDV
Index: /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/fullCfg.cfg
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/fullCfg.cfg	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/cfg/3D-HEVC/fullCfg.cfg	(revision 902)
@@ -253,4 +253,5 @@
 AdvMultiviewResPred                 : 1                # Advanced inter-view residual prediction (0:off, 1:on)
 IlluCompEnable                      : 1                # Enable Illumination compensation ( 0: off, 1: on ) (v/d)
+IlluCompLowLatencyEnc               : 0                # Enable low-latency Illumination compensation encoding( 0: off, 1: on )
 ViewSynthesisPred                   : 1                # View synthesis prediction 
 DepthRefinement                     : 1                # Dispary refined by depth DoNBDV
Index: /branches/HTM-10.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 902)
@@ -517,4 +517,7 @@
 #if H_3D_IC
   ("IlluCompEnable",           m_abUseIC, true, "Enable illumination compensation")
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+  ("IlluCompLowLatencyEnc",    m_bUseLowLatencyICEnc, false, "Enable low-latency illumination compensation encoding")
+#endif
 #endif
 #if H_3D_INTER_SDC
@@ -2479,4 +2482,7 @@
 #if H_3D_IC
   printf( "IlluCompEnable:%d ", m_abUseIC);
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+  printf ("IlluCompLowLatencyEnc:%d ",  m_bUseLowLatencyICEnc);
+#endif
 #endif
 #if H_3D_NBDV_REF
Index: /branches/HTM-10.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncCfg.h	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncCfg.h	(revision 902)
@@ -137,4 +137,7 @@
 #if H_3D_IC
   Bool   m_abUseIC;
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+  Bool  m_bUseLowLatencyICEnc;
+#endif
 #endif
 #if H_3D_NBDV_REF
Index: /branches/HTM-10.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncTop.cpp	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncTop.cpp	(revision 902)
@@ -189,4 +189,7 @@
 #if H_3D_IC
     m_cTEncTop.setUseIC                        ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_abUseIC );
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+    m_cTEncTop.setUseICLowLatencyEnc           ( m_bUseLowLatencyICEnc );
+#endif
 #endif
   //========== Depth intra modes ==========
Index: /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TComRom.cpp	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TComRom.cpp	(revision 902)
@@ -359,5 +359,9 @@
 
 Char  g_aucConvertToBit  [ MAX_CU_SIZE+1 ];
-
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+UInt g_aICEnableCANDIDATE[10] = { 0, };
+UInt g_aICEnableNUM[ 10 ] = { 0, };
+Int g_lastlayer=0;
+#endif
 #if ENC_DEC_TRACE
 FILE*  g_hTrace = NULL;
Index: /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TComRom.h
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TComRom.h	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TComRom.h	(revision 902)
@@ -189,4 +189,10 @@
 extern       Char   g_aucConvertToBit  [ MAX_CU_SIZE+1 ];   // from width to log2(width)-2
 
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+extern UInt g_aICEnableCANDIDATE[10];
+extern UInt g_aICEnableNUM[ 10 ]; //10 layers
+extern Int g_lastlayer;
+#endif
+
 #ifndef ENC_DEC_TRACE
 #define ENC_DEC_TRACE   0
Index: /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.cpp	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.cpp	(revision 902)
@@ -3220,6 +3220,72 @@
 #endif
 #if H_3D_IC
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+Void TComSlice::xSetApplyIC(Bool bUseLowLatencyICEnc)
+#else
 Void TComSlice::xSetApplyIC()
-{
+#endif
+{
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+  if(bUseLowLatencyICEnc)
+  {
+    Bool existInterViewRef=false;
+    TComPic* pcCurrPic = getPic();
+    TComPic* pcRefPic = NULL;
+    for ( Int i = 0; (i < getNumRefIdx( REF_PIC_LIST_0 )) && !existInterViewRef; i++ )
+    {
+      pcRefPic = getRefPic( REF_PIC_LIST_0, i );
+      if ( pcRefPic != NULL )
+      {
+        if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() )
+        {
+          existInterViewRef = true;        
+        }
+      }
+    }
+
+    for ( Int i = 0; (i < getNumRefIdx( REF_PIC_LIST_1 )) && !existInterViewRef; i++ )
+    {
+      pcRefPic = getRefPic( REF_PIC_LIST_1, i );
+      if ( pcRefPic != NULL )
+      {
+        if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() )
+        {
+          existInterViewRef = true;        
+        }
+      }
+    }
+
+    if(!existInterViewRef)
+    {
+      m_bApplyIC = false;
+    }
+    else
+    {
+      Int curLayer=getDepth();
+      if( curLayer>9) curLayer=9; // Max layer is 10
+
+      m_bApplyIC = true;
+      Int refLayer = curLayer-1;
+      if( (refLayer>=0) && (g_aICEnableCANDIDATE[refLayer]>0) )
+      {    
+        Double ratio=Double(g_aICEnableNUM[refLayer])/Double(g_aICEnableCANDIDATE[refLayer]);
+
+        if( ratio > MTK_LOW_LATENCY_IC_ENCODING_THRESHOLD_H0086)
+        {
+          m_bApplyIC=true;
+        }
+        else
+        {
+          m_bApplyIC=false;
+        }
+      }
+      g_aICEnableNUM[curLayer]=0;
+      g_aICEnableCANDIDATE[curLayer]=0;
+      g_lastlayer=getDepth();
+    }
+  }
+  else
+  {
+#endif
   Int iMaxPelValue = ( 1 << g_bitDepthY ); 
   Int *aiRefOrgHist;
@@ -3295,4 +3361,7 @@
   aiCurrHist = NULL;
   aiRefOrgHist = NULL;
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+  }//if(bUseLowLatencyICEnc)
+#endif
 }
 #endif
Index: /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.h	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.h	(revision 902)
@@ -2179,4 +2179,7 @@
   Bool      getApplyIC()                                        { return m_bApplyIC; }
   Void      xSetApplyIC();
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+  Void      xSetApplyIC(Bool bUseLowLatencyICEnc);
+#endif
   Void      setIcSkipParseFlag( Bool b )                        { m_icSkipParseFlag = b; }
   Bool      getIcSkipParseFlag()                                { return m_icSkipParseFlag; }
Index: /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TypeDef.h	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibCommon/TypeDef.h	(revision 902)
@@ -118,4 +118,9 @@
                                               // MTK_IC_FLAG_CABAC_SIMP_G0061
                                               // SEC_IC_ARP_SIG_G0072, Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121
+
+#define MTK_LOW_LATENCY_IC_ENCODING_H0086   1 // Low-latency IC encoding in JCT3V-H0086
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+#define MTK_LOW_LATENCY_IC_ENCODING_THRESHOLD_H0086    0.1 // Threshold for low-latency IC encoding in JCT3V-H0086
+#endif
 
 #if H_3D_NBDV
Index: /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCfg.h	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCfg.h	(revision 902)
@@ -401,4 +401,7 @@
 #if H_3D_IC
   Bool      m_bUseIC;
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+  Bool      m_bUseICLowLatencyEnc;
+#endif
 #endif
 #if H_3D_INTER_SDC
@@ -511,4 +514,8 @@
   Void       setUseIC                       ( Bool bVal )    { m_bUseIC = bVal; }
   Bool       getUseIC                       ()               { return m_bUseIC; }
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+  Void       setUseICLowLatencyEnc          ( Bool bVal )    { m_bUseICLowLatencyEnc = bVal; }
+  Bool       getUseICLowLatencyEnc          ()               { return m_bUseICLowLatencyEnc; }
+#endif
 #endif
 #if H_3D_INTER_SDC
Index: /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 902)
@@ -163,5 +163,14 @@
     uiAbsPartIdx = 0;
   }
-
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+  else
+  {
+    g_aICEnableCANDIDATE[pcCU->getSlice()->getDepth()]++;
+    if(pcCU->getICFlag(uiAbsPartIdx))
+    {
+      g_aICEnableNUM[pcCU->getSlice()->getDepth()]++;
+    }
+  }
+#endif
   if( pcCU->isICFlagRequired( uiAbsPartIdx ) )
     m_pcEntropyCoderIf->codeICFlag( pcCU, uiAbsPartIdx );
Index: /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 901)
+++ /branches/HTM-10.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 902)
@@ -866,5 +866,9 @@
      )
   {
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+    pcSlice ->xSetApplyIC(pcEncTop->getUseICLowLatencyEnc());
+#else
     pcSlice ->xSetApplyIC();
+#endif
     if ( pcSlice->getApplyIC() )
     {
