Index: branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComRom.cpp	(revision 1048)
+++ branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComRom.cpp	(revision 1049)
@@ -369,9 +369,10 @@
 
 Char  g_aucConvertToBit  [ MAX_CU_SIZE+1 ];
-
+#if !MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
 #if H_3D_IC
 UInt g_aICEnableCANDIDATE[10] = { 0, };
 UInt g_aICEnableNUM[ 10 ] = { 0, };
 Int g_lastlayer=0;
+#endif
 #endif
 #if ENC_DEC_TRACE
Index: branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComRom.h
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComRom.h	(revision 1048)
+++ branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComRom.h	(revision 1049)
@@ -192,9 +192,10 @@
 
 extern       Char   g_aucConvertToBit  [ MAX_CU_SIZE+1 ];   // from width to log2(width)-2
-
+#if !MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
 #if H_3D_IC
 extern UInt g_aICEnableCANDIDATE[10];
 extern UInt g_aICEnableNUM[ 10 ]; //10 layers
 extern Int  g_lastlayer;
+#endif
 #endif
 
Index: branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.cpp	(revision 1048)
+++ branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.cpp	(revision 1049)
@@ -3602,10 +3602,13 @@
       m_bApplyIC = true;
       Int refLayer = curLayer-1;
-      if( (refLayer>=0) && (g_aICEnableCANDIDATE[refLayer]>0) )
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+      Int ICEnableCandidate = getICEnableCandidate(refLayer);
+      Int ICEnableNum = getICEnableNum(refLayer);
+      if( (refLayer>=0) && (ICEnableCandidate>0) )
       {    
-        Double ratio=Double(g_aICEnableNUM[refLayer])/Double(g_aICEnableCANDIDATE[refLayer]);
+        Double ratio=Double(ICEnableNum/Double(ICEnableCandidate));
 
         if( ratio > IC_LOW_LATENCY_ENCODING_THRESHOLD)
-{
+        {
           m_bApplyIC=true;
         }
@@ -3615,7 +3618,24 @@
         }
       }
+      setICEnableCandidate(curLayer, 0);
+      setICEnableNum(curLayer, 0);
+#else
+      if( (refLayer>=0) && (g_aICEnableCANDIDATE[refLayer]>0) )
+      {    
+        Double ratio=Double(g_aICEnableNUM[refLayer])/Double(g_aICEnableCANDIDATE[refLayer]);
+
+        if( ratio > IC_LOW_LATENCY_ENCODING_THRESHOLD)
+{
+          m_bApplyIC=true;
+        }
+        else
+        {
+          m_bApplyIC=false;
+        }
+      }
       g_aICEnableNUM[curLayer]=0;
       g_aICEnableCANDIDATE[curLayer]=0;
       g_lastlayer=getDepth();
+#endif
     }
   }
Index: branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.h	(revision 1048)
+++ branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.h	(revision 1049)
@@ -2256,4 +2256,8 @@
   Bool      m_bApplySingleDepthMode;
 #endif
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+  Int *m_aICEnableCandidate;
+  Int *m_aICEnableNum;
+#endif
 public:
   TComSlice();
@@ -2567,4 +2571,13 @@
 #endif
 #endif
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+  Void    setICEnableCandidate( Int* ICEnableCandidate)   { m_aICEnableCandidate = ICEnableCandidate; };
+  Void    setICEnableNum( Int* ICEnableNum)   { m_aICEnableNum = ICEnableNum; };
+  Void    setICEnableCandidate( UInt layer, Int value)   { m_aICEnableCandidate[ layer ] = value; };
+  Void    setICEnableNum( UInt layer, Int value)   { m_aICEnableNum[ layer ] = value; };
+
+  Int    getICEnableCandidate( Int layer){ return  m_aICEnableCandidate[ layer ]; }; 
+  Int    getICEnableNum( Int layer){ return m_aICEnableNum[ layer ]; }; 
+#endif
 #if H_MV
 // Additional slice header syntax elements
Index: branches/HTM-12.0-dev1/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibCommon/TypeDef.h	(revision 1048)
+++ branches/HTM-12.0-dev1/source/Lib/TLibCommon/TypeDef.h	(revision 1049)
@@ -123,4 +123,7 @@
                                               // SEC_IC_ARP_SIG_G0072, Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121
                                               // MTK_LOW_LATENCY_IC_ENCODING_H0086  Low-latency IC encoding in JCT3V-H0086
+
+#define MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX  1  // Remove the global variables used in JCT3V-H0086
+
 
 #define SEC_IC_NEIGHBOR_CLIP_I0080        1   // Clipping of neighboring sample position, JCT3V-I0080
Index: branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1048)
+++ branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1049)
@@ -185,4 +185,15 @@
   else
   {
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+    Int ICEnableCandidate = pcCU->getSlice()->getICEnableCandidate(pcCU->getSlice()->getDepth());
+    Int ICEnableNum = pcCU->getSlice()->getICEnableNum(pcCU->getSlice()->getDepth());
+    ICEnableCandidate++;
+    if(pcCU->getICFlag(uiAbsPartIdx))
+    {
+      ICEnableNum++;
+    }
+    pcCU->getSlice()->setICEnableCandidate(pcCU->getSlice()->getDepth(), ICEnableCandidate);
+    pcCU->getSlice()->setICEnableNum(pcCU->getSlice()->getDepth(), ICEnableNum);
+#else
     g_aICEnableCANDIDATE[pcCU->getSlice()->getDepth()]++;
     if(pcCU->getICFlag(uiAbsPartIdx))
@@ -190,4 +201,5 @@
       g_aICEnableNUM[pcCU->getSlice()->getDepth()]++;
     }
+#endif
   }
   if( pcCU->isICFlagRequired( uiAbsPartIdx ) )
Index: branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1048)
+++ branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1049)
@@ -160,5 +160,8 @@
 #endif
 #endif
-
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+  m_aICEnableCandidate           = pcTEncTop->getICEnableCandidate(); 
+  m_aICEnableNum           = pcTEncTop->getICEnableNum(); 
+#endif
 #if KWU_FIX_URQ
   m_pcRateCtrl           = pcTEncTop->getRateCtrl();
@@ -968,4 +971,8 @@
 #endif    
 #endif
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+    pcSlice->setICEnableCandidate( m_aICEnableCandidate );         
+    pcSlice->setICEnableNum( m_aICEnableNum );         
+#endif
     //  Slice info. refinement
 #if H_MV
Index: branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncGOP.h
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncGOP.h	(revision 1048)
+++ branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncGOP.h	(revision 1049)
@@ -116,4 +116,8 @@
 #endif
 #endif
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+  Int *m_aICEnableCandidate; 
+  Int *m_aICEnableNum; 
+#endif
   //--Adaptive Loop filter
   TEncSampleAdaptiveOffset*  m_pcSAO;
Index: branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1048)
+++ branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1049)
@@ -84,4 +84,8 @@
   m_ivPicLists = NULL;
 #endif
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+  m_aICEnableCandidate = NULL;
+  m_aICEnableNum = NULL;
+#endif
 }
 
@@ -305,5 +309,14 @@
 
   xInitPPSforTiles();
-
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+  m_aICEnableCandidate = new Int[ 10 ];
+  m_aICEnableNum = new Int[ 10 ];
+
+  for(int i=0;i<10;i++)
+  {
+    m_aICEnableCandidate[i]=0;
+    m_aICEnableNum[i]=0;
+  }
+#endif
   // initialize processing unit classes
   m_cGOPEncoder.  init( this );
Index: branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncTop.h	(revision 1048)
+++ branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncTop.h	(revision 1049)
@@ -79,4 +79,8 @@
 #if H_MV
   TComPicLists*           m_ivPicLists;                   ///< access to picture lists of other layers 
+#endif
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+  Int *m_aICEnableCandidate;
+  Int *m_aICEnableNum;
 #endif
   // encoder search
@@ -162,4 +166,8 @@
   TComPicLists* getIvPicLists() { return m_ivPicLists; }
 #endif
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+  Int *getICEnableCandidate() { return m_aICEnableCandidate; }
+  Int *getICEnableNum() { return m_aICEnableNum; }
+#endif
   Void      deletePicBuffer ();
 
@@ -221,4 +229,8 @@
   Void                    setIvPicLists         ( TComPicLists* picLists) { m_ivPicLists = picLists; }
 #endif
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+  Void                    setICEnableCandidate         ( Int* ICEnableCandidate) { m_aICEnableCandidate = ICEnableCandidate; }
+  Void                    setICEnableNum         ( Int* ICEnableNum) { m_aICEnableNum = ICEnableNum; }
+#endif
   // -------------------------------------------------------------------------------------------------------------------
   // encoder function
