Index: branches/HTM-14.1-update-dev2-Sharp/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1225)
@@ -291,5 +291,5 @@
     m_cTEncTop.setDWeight                      ( isDepth ? m_iDWeight             : 0     );
 #endif // H_3D_VSO
-#if H_3D_IC
+#if NH_3D_IC
     m_cTEncTop.setUseIC                        ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_abUseIC );
     m_cTEncTop.setUseICLowLatencyEnc           ( m_bUseLowLatencyICEnc );
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/ContextTables.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/ContextTables.h	(revision 1225)
@@ -166,5 +166,5 @@
 #endif
 
-#if H_3D_IC
+#if NH_3D_IC
 #define NUM_IC_FLAG_CTX               1       ///< number of context models for illumination compensation flag
 #endif
@@ -552,5 +552,5 @@
 
 #endif
-#if H_3D_IC
+#if NH_3D_IC
 static const UChar 
 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] =  
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComCodingStatistics.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComCodingStatistics.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComCodingStatistics.h	(revision 1225)
@@ -92,4 +92,7 @@
   STATS__CABAC_BITS__ALIGNED_SIGN_BIT,
   STATS__CABAC_BITS__ALIGNED_ESCAPE_BITS,
+#if NH_3D_IC
+  STATS__CABAC_BITS__3D_IC,
+#endif
   STATS__NUM_STATS
 };
@@ -142,4 +145,7 @@
     "CABAC_BITS__ALIGNED_SIGN_BIT",
     "CABAC_BITS__ALIGNED_ESCAPE_BITS"
+#if NH_3D_IC
+    "CABAC_BITS__3D_IC"
+#endif
   };
   assert(STATS__NUM_STATS == sizeof(statNames)/sizeof(Char *) && name < STATS__NUM_STATS);
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1225)
@@ -137,5 +137,5 @@
   m_puhARPW              = NULL;
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   m_pbICFlag             = NULL;
 #endif
@@ -252,5 +252,5 @@
     m_puhARPW            = new UChar[ uiNumPartition];
 #endif
-#if H_3D_IC
+#if NH_3D_IC
     m_pbICFlag           = (Bool* )xMalloc(Bool,   uiNumPartition);
 #endif
@@ -471,5 +471,5 @@
     if ( m_puhARPW            ) { delete[] m_puhARPW;           m_puhARPW           = NULL; }
 #endif
-#if H_3D_IC
+#if NH_3D_IC
     if ( m_pbICFlag           ) { xFree(m_pbICFlag);            m_pbICFlag          = NULL; }
 #endif
@@ -601,6 +601,6 @@
     m_puhARPW   [ui] = pcFrom->getARPW( ui );
 #endif
-#if H_3D_IC
-    m_pbICFlag[ui]   =  pcFrom->m_pbICFlag[ui];
+#if NH_3D_IC
+  memset( m_pbICFlag          , false,                      m_uiNumPartition * sizeof( *m_pbICFlag ) );
 #endif
 
@@ -654,8 +654,4 @@
     memset( m_puhARPW           + firstElement, 0,                        numElements * sizeof( UChar )         );
 #endif
-#if H_3D_IC
-    memset( m_pbICFlag          + firstElement, false,                    numElements * sizeof( *m_pbICFlag )   );
-#endif
-
 
 #if H_3D_DIM
@@ -815,5 +811,5 @@
       m_puhARPW[ui] = 0;
 #endif
-#if H_3D_IC
+#if NH_3D_IC
       m_pbICFlag[ui]  = false;
 #endif
@@ -926,5 +922,5 @@
   memset( m_puhHeight,         uhHeight, iSizeInUchar );
   memset( m_pbIPCMFlag,        0, iSizeInBool  );
-#if H_3D_IC
+#if NH_3D_IC
   memset( m_pbICFlag,          0, iSizeInBool  );
 #endif
@@ -986,5 +982,5 @@
       m_puhARPW           [ui] = pcCU->getARPW( uiPartOffset+ui );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
       m_pbICFlag          [ui] = pcCU->m_pbICFlag[uiPartOffset+ui];
 #endif
@@ -1093,5 +1089,5 @@
   m_puhARPW             = pcCU->getARPW()             + uiPart;
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   m_pbICFlag            = pcCU->getICFlag()           + uiPart;
 #endif
@@ -1259,5 +1255,5 @@
   }
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   m_pbICFlag           = pcCU->getICFlag()                + uiAbsPartIdx;
 #endif
@@ -1383,5 +1379,5 @@
   memcpy( m_puhARPW             + uiOffset, pcCU->getARPW(),              iSizeInUchar );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   memcpy( m_pbICFlag            + uiOffset, pcCU->getICFlag(),            iSizeInBool );
 #endif
@@ -1504,6 +1500,6 @@
   memcpy( rpcCU->getARPW()             + m_uiAbsIdxInLCU, m_puhARPW,             iSizeInUchar );
 #endif
-#if H_3D_IC
-  memcpy( rpcCU->getICFlag()           + m_uiAbsIdxInLCU, m_pbICFlag,            iSizeInBool );
+#if NH_3D_IC
+  memcpy( pCtu->getICFlag() + m_absZIdxInCtu, m_pbICFlag, sizeof( *m_pbICFlag ) * m_uiNumPartition );
 #endif
 
@@ -1545,7 +1541,4 @@
 #if H_3D_ARP
   memcpy( rpcCU->getARPW()             + uiPartOffset, m_puhARPW,             iSizeInUchar );
-#endif
-#if H_3D_IC
-  memcpy( rpcCU->getICFlag()           + uiPartOffset, m_pbICFlag,            iSizeInBool );
 #endif
 
@@ -2731,5 +2724,5 @@
 
 // This is for use by a leaf/sub CU object only, with no additional AbsPartIdx
-#if H_3D_IC
+#if NH_3D_IC
 Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU)
 {
@@ -3699,5 +3692,5 @@
 #endif 
 
-#if H_3D_IC
+#if NH_3D_IC
   Bool bICFlag = getICFlag(uiAbsPartIdx);
 #endif
@@ -3737,5 +3730,5 @@
 #if H_3D_VSP
     , (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
-#if H_3D_IC
+#if NH_3D_IC
       && !bICFlag
 #endif
@@ -4185,5 +4178,5 @@
     if (
       (!getAvailableFlagA1() || !(pcCULeft->getVSPFlag(uiLeftPartIdx) != 0)) &&
-#if H_3D_IC
+#if NH_3D_IC
       !bICFlag &&
 #endif
@@ -5222,15 +5215,4 @@
   return ( getSkipFlag( uiPartIdx ) );
 }
-
-#if H_3D_IC
-Bool TComDataCU::isIC( UInt uiPartIdx )
-{
-    if ( m_pcSlice->isIntra () )
-    {
-        return false;
-    }
-    return ( ( getSkipFlag(uiPartIdx) || getPredictionMode(uiPartIdx) == MODE_INTER) && getICFlag( uiPartIdx ) && isICFlagRequired( uiPartIdx ) );
-}
-#endif
 
 // ====================================================================================================================
@@ -6681,8 +6663,8 @@
 #endif
 
-#if H_3D_IC
+#if NH_3D_IC
 Void TComDataCU::setICFlagSubParts( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
 {
-  memset( m_pbICFlag + uiAbsPartIdx, bICFlag, (m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ))*sizeof(Bool) );
+  memset( m_pbICFlag + uiAbsPartIdx, bICFlag, (m_pcPic->getNumPartitionsInCtu() >> ( 2 * uiDepth ))*sizeof(Bool) );
 }
 
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComDataCU.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComDataCU.h	(revision 1225)
@@ -179,5 +179,5 @@
   UChar*        m_puhARPW;
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Bool*         m_pbICFlag;           ///< array of IC flags
 #endif
@@ -536,5 +536,5 @@
   Double        getARPWFactor      ( UInt uiIdx );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Bool*         getICFlag          ()                        { return m_pbICFlag;               }
   Bool          getICFlag          ( UInt uiIdx )            { return m_pbICFlag[uiIdx];        }
@@ -705,8 +705,4 @@
   Bool          isBipredRestriction( UInt puIdx );
 
-#if H_3D_IC
-  Bool          isIC      ( UInt uiPartIdx );
-#endif
-
   // -------------------------------------------------------------------------------------------------------------------
   // member functions for symbol prediction (most probable / mode conversion)
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComPattern.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComPattern.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComPattern.h	(revision 1225)
@@ -81,5 +81,5 @@
 //  TComPatternParam  m_cPatternCb;
   //TComPatternParam  m_cPatternCr;
-#if H_3D_IC
+#if NH_3D_IC
   Bool              m_bICFlag;
 #endif
@@ -98,5 +98,5 @@
   Int   getBitDepthY()            { return m_cPatternY.m_bitDepth; }
 
-#if H_3D_IC
+#if NH_3D_IC
   Bool  getICFlag()               { return m_bICFlag; }
   Void  setICFlag( Bool bICFlag ) { m_bICFlag = bICFlag; }
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1225)
@@ -201,5 +201,5 @@
     }
   }
-#if H_3D_IC
+#if NH_3D_IC
   m_uiaShift[0] = 0;
   for( Int i = 1; i < 64; i++ )
@@ -1398,25 +1398,18 @@
     {
 #endif
-#if H_3D_IC
-      Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() );
-      xPredInterLumaBlk  ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
+  for (UInt comp=COMPONENT_Y; comp<pcYuvPred->getNumberValidComponents(); comp++)
+  {
+    const ComponentID compID=ComponentID(comp);
+#if NH_3D_IC
+    Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ) && ( isLuma(compID) || (iWidth > 8) );
+      xPredInterBlk(compID,  pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID))
 #if H_3D_ARP
         , false
 #endif
         , bICFlag );
-      bICFlag = bICFlag && (iWidth > 8);
-      xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
-#if H_3D_ARP
-        , false
-#endif
-        , bICFlag );
 #else
-
-  for (UInt comp=COMPONENT_Y; comp<pcYuvPred->getNumberValidComponents(); comp++)
-  {
-    const ComponentID compID=ComponentID(comp);
     xPredInterBlk  (compID,  pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) );
-  }
-#endif
+#endif
+  }
 #if H_3D_ARP
     }
@@ -1902,5 +1895,5 @@
     , Bool filterType
 #endif
-#if H_3D_IC
+#if NH_3D_IC
     , Bool bICFlag
 #endif
@@ -1925,5 +1918,6 @@
   {
     refOffset = mv->getHor() + mv->getVer() * refStride;
-    ref       = refPic->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr ) + refOffset;
+    ref       = refPic->getAddr(compID, cu->getCtuRsAddr(), cu->getZorderIdxInCtu() + partAddr ) + refOffset;
+
     xFrac     = 0;
     yFrac     = 0;
@@ -1938,6 +1932,6 @@
   if ( yFrac == 0 )
   {
-#if H_3D_IC
-    m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac,       !bi || bICFlag
+#if NH_3D_IC
+    m_if.filterHor(compID, ref, refStride, dst,  dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag, chFmt, bitDepth
 #else
     m_if.filterHor(compID, ref, refStride, dst,  dstStride, cxWidth, cxHeight, xFrac, !bi, chFmt, bitDepth
@@ -1950,6 +1944,6 @@
   else if ( xFrac == 0 )
   {
-#if H_3D_IC
-    m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi || bICFlag
+#if NH_3D_IC
+    m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag, chFmt, bitDepth
 #else
     m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi, chFmt, bitDepth
@@ -1972,6 +1966,6 @@
 #endif 
 );
-#if H_3D_IC
-    m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height,              yFrac, false, !bi || bICFlag
+#if NH_3D_IC
+    m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight,               yFrac, false, !bi || bICFlag, chFmt, bitDepth
 #else
     m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight,               yFrac, false, !bi, chFmt, bitDepth
@@ -1983,18 +1977,18 @@
   }
 
-#if H_3D_IC
+#if NH_3D_IC
   if( bICFlag )
   {
     Int a, b, i, j;
     const Int iShift = IC_CONST_SHIFT;
-
-    xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_LUMA );
-
-
-    for ( i = 0; i < height; i++ )
-    {
-      for ( j = 0; j < width; j++ )
-      {
-          dst[j] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, ( ( a*dst[j] ) >> iShift ) + b );
+    Pel *dst2 = dst;
+
+    xGetLLSICPrediction( compID, cu, mv, refPic, a, b, bitDepth );
+
+    for ( i = 0; i < cxHeight; i++ )
+    {
+      for ( j = 0; j < cxWidth; j++ )
+      {
+        dst[j] = Clip3( 0, ( 1 << bitDepth ) - 1, ( ( a*dst[j] ) >> iShift ) + b );
       }
       dst += dstStride;
@@ -2003,12 +1997,11 @@
     if(bi)
     {
-      Pel *dst2      = dstPic->getLumaAddr( partAddr );
-      Int shift = IF_INTERNAL_PREC - g_bitDepthY;
-      for (i = 0; i < height; i++)
-      {
-        for (j = 0; j < width; j++)
+      Int shift = IF_INTERNAL_PREC - bitDepth;
+      for (i = 0; i < cxHeight; i++)
+      {
+        for (j = 0; j < cxWidth; j++)
         {
-          Short val = dst2[j] << shift;
-          dst2[j] = val - (Short)IF_INTERNAL_OFFS;
+          Pel val = dst2[j] << shift;
+          dst2[j] = val - (Pel)IF_INTERNAL_OFFS;
         }
         dst2 += dstStride;
@@ -2020,105 +2013,4 @@
 }
 
-
-#if H_3D_ARP
-    , Bool filterType
-#endif
-#if H_3D_IC
-    , Bool bICFlag
-#endif
-#if H_3D_IC
-    m_if.filterHorChroma(refCb, refStride, dstCb,  dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag
-#else
-#endif
-#if H_3D_ARP
-    , filterType
-#endif
-#if H_3D_IC
-    m_if.filterHorChroma(refCr, refStride, dstCr,  dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag
-#else
-#endif
-#if H_3D_ARP
-    , filterType
-#endif
-#if H_3D_IC
-    m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag
-#else
-#endif
-#if H_3D_ARP
-    , filterType
-#endif
-#if H_3D_IC
-    m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag
-#else
-#endif
-#if H_3D_ARP
-    , filterType
-#endif
-#if H_3D_ARP
-    , filterType
-#endif  
-#if H_3D_IC
-    m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight  , yFrac, false, !bi || bICFlag
-#else
-#endif
-#if H_3D_ARP
-    , filterType
-#endif 
-#if H_3D_ARP
-    , filterType
-#endif 
-#if H_3D_IC
-    m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight  , yFrac, false, !bi || bICFlag
-#else
-#endif
-#if H_3D_ARP
-    , filterType
-#endif 
-#if H_3D_IC
-  if( bICFlag )
-  {
-    Int a, b, i, j;
-    const Int iShift = IC_CONST_SHIFT;
-
-    xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_U ); // Cb
-    for ( i = 0; i < cxHeight; i++ )
-    {
-      for ( j = 0; j < cxWidth; j++ )
-      {
-          dstCb[j] = Clip3(  0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCb[j] ) >> iShift ) + b );
-      }
-      dstCb += dstStride;
-    }
-    xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_V ); // Cr
-    for ( i = 0; i < cxHeight; i++ )
-    {
-      for ( j = 0; j < cxWidth; j++ )
-      {
-          dstCr[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCr[j] ) >> iShift ) + b );
-      }
-      dstCr += dstStride;
-    }
-
-    if(bi)
-    {
-      Pel* dstCb2 = dstPic->getCbAddr( partAddr );
-      Pel* dstCr2 = dstPic->getCrAddr( partAddr );
-      Int shift = IF_INTERNAL_PREC - g_bitDepthC;
-      for (i = 0; i < cxHeight; i++)
-      {
-        for (j = 0; j < cxWidth; j++)
-        {
-          Short val = dstCb2[j] << shift;
-          dstCb2[j] = val - (Short)IF_INTERNAL_OFFS;
-
-          val = dstCr2[j] << shift;
-          dstCr2[j] = val - (Short)IF_INTERNAL_OFFS;
-        }
-        dstCb2 += dstStride;
-        dstCr2 += dstStride;
-      }
-    }
-  }
-#endif
 Void TComPrediction::xWeightedAverage( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv* pcYuvDst, const BitDepths &clipBitDepths
  )
@@ -2265,5 +2157,5 @@
           (uiDirMode==HOR_IDX || uiDirMode==VER_IDX);
 }
-#if H_3D_IC
+#if NH_3D_IC
 /** Function for deriving the position of first non-zero binary bit of a value
  * \param x input value
@@ -2295,54 +2187,39 @@
 /** Function for deriving LM illumination compensation.
  */
-Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType )
+Void TComPrediction::xGetLLSICPrediction( const ComponentID compID, TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, const Int bitDepth )
 {
   TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec();
   Pel *pRec = NULL, *pRef = NULL;
   UInt uiWidth, uiHeight, uiTmpPartIdx;
-  Int iRecStride = ( eType == TEXT_LUMA ) ? pRecPic->getStride() : pRecPic->getCStride();
-  Int iRefStride = ( eType == TEXT_LUMA ) ? pRefPic->getStride() : pRefPic->getCStride();
+  Int iRecStride = pRecPic->getStride(compID);
+  Int iRefStride = pRefPic->getStride(compID);
   Int iRefOffset, iHor, iVer;
   iHor = pcCU->getSlice()->getIsDepth() ? pMv->getHor() : ( ( pMv->getHor() + 2 ) >> 2 );
   iVer = pcCU->getSlice()->getIsDepth() ? pMv->getVer() : ( ( pMv->getVer() + 2 ) >> 2 );
-  if( eType != TEXT_LUMA )
+  if( !isLuma(compID) )
   {
     iHor = pcCU->getSlice()->getIsDepth() ? ( ( pMv->getHor() + 1 ) >> 1 ) : ( ( pMv->getHor() + 4 ) >> 3 );
     iVer = pcCU->getSlice()->getIsDepth() ? ( ( pMv->getVer() + 1 ) >> 1 ) : ( ( pMv->getVer() + 4 ) >> 3 );
   }
-  uiWidth  = ( eType == TEXT_LUMA ) ? pcCU->getWidth( 0 )  : ( pcCU->getWidth( 0 )  >> 1 );
-  uiHeight = ( eType == TEXT_LUMA ) ? pcCU->getHeight( 0 ) : ( pcCU->getHeight( 0 ) >> 1 );
+  uiWidth  = pcCU->getWidth( 0 ) >> pRefPic->getComponentScaleX(compID);
+  uiHeight = pcCU->getHeight( 0 ) >> pRefPic->getComponentScaleY(compID);
 
   Int i, j, iCountShift = 0;
 
-  // LLS parameters estimation -->
-
+  // LLS parameters estimation
   Int x = 0, y = 0, xx = 0, xy = 0;
-  Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12);
-
-  if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) )
+  Int precShift = std::max(0, bitDepth - 12);
+
+  UInt partAddr = 0;
+  if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCtu() ) )
   {
     iRefOffset = iHor + iVer * iRefStride - iRefStride;
-    if( eType == TEXT_LUMA )
-    {
-      pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset;
-      pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride;
-    }
-    else if( eType == TEXT_CHROMA_U )
-    {
-      pRef = pRefPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset;
-      pRec = pRecPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride;
-    }
-    else
-    {
-      assert( eType == TEXT_CHROMA_V );
-      pRef = pRefPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset;
-      pRec = pRecPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride;
-    }
-
+    pRef = pRefPic->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + partAddr ) + iRefOffset;
+    pRec = pRecPic->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + partAddr ) - iRecStride;
     for( j = 0; j < uiWidth; j+=2 )
     {
       x += pRef[j];
       y += pRec[j];
-      if ( eType == TEXT_LUMA )
+      if( isLuma(compID) )
       {
         xx += (pRef[j] * pRef[j])>>precShift;
@@ -2353,29 +2230,14 @@
   }
 
-  if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) )
+  if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInCtu() ) )
   {
     iRefOffset = iHor + iVer * iRefStride - 1;
-    if( eType == TEXT_LUMA )
-    {
-      pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset;
-      pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1;
-    }
-    else if( eType == TEXT_CHROMA_U )
-    {
-      pRef = pRefPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset;
-      pRec = pRecPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1;
-    }
-    else
-    {
-      assert( eType == TEXT_CHROMA_V );
-      pRef = pRefPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset;
-      pRec = pRecPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1;
-    }
-
+    pRef = pRefPic->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + partAddr ) + iRefOffset;
+    pRec = pRecPic->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + partAddr ) - 1;
     for( i = 0; i < uiHeight; i+=2 )
     {
       x += pRef[0];
       y += pRec[0];
-      if ( eType == TEXT_LUMA )
+      if( isLuma(compID) )
       {
         xx += (pRef[0] * pRef[0])>>precShift;
@@ -2395,52 +2257,44 @@
   }
 
-  if (  eType != TEXT_LUMA )
-  {
-    a = 32;
+  if( !isLuma(compID) )
+  {
+    a = ( 1 << IC_CONST_SHIFT );
     b = (  y - x + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift;
   }
   else
   {
-  xy += xx >> IC_REG_COST_SHIFT;
-  xx += xx >> IC_REG_COST_SHIFT;
-  Int a1 = ( xy << iCountShift ) - ((y * x) >> precShift);
-  Int a2 = ( xx << iCountShift ) - ((x * x) >> precShift);
-  const Int iShift = IC_CONST_SHIFT;
-  {
-    {
-      const Int iShiftA2 = 6;
-      const Int iAccuracyShift = 15;
-
-      Int iScaleShiftA2 = 0;
-      Int iScaleShiftA1 = 0;
-      Int a1s = a1;
-      Int a2s = a2;
-
-      a1 = Clip3(0, 2*a2, a1);
-      iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2;
-      iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF;
-
-      if( iScaleShiftA1 < 0 )
-      {
-        iScaleShiftA1 = 0;
-      }
-
-      if( iScaleShiftA2 < 0 )
-      {
-        iScaleShiftA2 = 0;
-      }
-
-      Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1;
-
-
-      a2s = a2 >> iScaleShiftA2;
-
-      a1s = a1 >> iScaleShiftA1;
-
-      a = a1s * m_uiaShift[ a2s ];
-      a = a >> iScaleShiftA;
-      b = (  y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift;
-    }
-  }   
+    xy += xx >> IC_REG_COST_SHIFT;
+    xx += xx >> IC_REG_COST_SHIFT;
+    Int a1 = ( xy << iCountShift ) - ((y * x) >> precShift);
+    Int a2 = ( xx << iCountShift ) - ((x * x) >> precShift);
+    const Int iShift = IC_CONST_SHIFT;
+    const Int iShiftA2 = 6;
+    const Int iAccuracyShift = 15;
+    Int iScaleShiftA2 = 0;
+    Int iScaleShiftA1 = 0;
+    Int a1s;
+    Int a2s;
+    
+    a1 = Clip3(0, 2*a2, a1);
+    iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2;
+    iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF;
+    
+    if( iScaleShiftA1 < 0 )
+    {
+      iScaleShiftA1 = 0;
+    }
+    if( iScaleShiftA2 < 0 )
+    {
+      iScaleShiftA2 = 0;
+    }
+    
+    Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1;
+
+    a2s = a2 >> iScaleShiftA2;
+    a1s = a1 >> iScaleShiftA1;
+    
+    a = a1s * m_uiaShift[ a2s ];
+    a = a >> iScaleShiftA;
+    b = (  y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift;
   }
 }
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComPrediction.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComPrediction.h	(revision 1225)
@@ -87,5 +87,5 @@
   Pel*   m_pLumaRecBuffer;       ///< array for downsampled reconstructed luma sample
   Int    m_iLumaRecStride;       ///< stride of #m_pLumaRecBuffer array
-#if H_3D_IC
+#if NH_3D_IC
   UInt   m_uiaShift[ 64 ];       // Table for multiplication to substitue of division operation
 #endif
@@ -117,5 +117,5 @@
     , Bool filterType = false
 #endif
-#if H_3D_IC
+#if NH_3D_IC
     , Bool bICFlag    = false
 #endif
@@ -124,7 +124,4 @@
 #if H_3D_ARP
     , Bool filterType = false
-#endif
-#if H_3D_IC
-    , Bool bICFlag    = false
 #endif
 #if H_3D_VSP
@@ -135,6 +132,6 @@
 
   Void xGetLLSPrediction ( const Pel* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0, const ChromaFormat chFmt  DEBUG_STRING_FN_DECLARE(sDebug) );
-#if H_3D_IC
-  Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType );
+#if NH_3D_IC
+  Void xGetLLSICPrediction( const ComponentID compID, TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, const Int bitDepth);
 #endif
   Void xDCPredFiltering( const Pel* pSrc, Int iSrcStride, Pel* pDst, Int iDstStride, Int iWidth, Int iHeight, ChannelType channelType );
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComRdCost.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComRdCost.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComRdCost.cpp	(revision 1225)
@@ -562,5 +562,5 @@
   cDtParam.bitDepth     = bitDepth;
 
-#if H_3D_IC
+#if NH_3D_IC
   cDtParam.bUseIC       = false;
 #endif
@@ -690,5 +690,5 @@
   
   AOF(!pcDtParam->bApplyWeight);
-#if H_3D_IC
+#if NH_3D_IC
   AOF(!pcDtParam->bUseIC);
 #endif
@@ -764,5 +764,5 @@
     return TComRdCostWeightPrediction::xGetSADw( pcDtParam );
   }
-#if H_3D_IC
+#if NH_3D_IC
   if( pcDtParam->bUseIC )
   {
@@ -806,5 +806,5 @@
   }
 
-#if H_3D_IC
+#if NH_3D_IC
   if( pcDtParam->bUseIC )
   {
@@ -851,5 +851,5 @@
   }
 
-#if H_3D_IC
+#if NH_3D_IC
   if( pcDtParam->bUseIC )
   {
@@ -900,5 +900,5 @@
   }
 
-#if H_3D_IC
+#if NH_3D_IC
   if( pcDtParam->bUseIC )
   {
@@ -956,5 +956,5 @@
     return TComRdCostWeightPrediction::xGetSADw( pcDtParam );
   }
-#if H_3D_IC
+#if NH_3D_IC
   if( pcDtParam->bUseIC )
   {
@@ -1004,5 +1004,5 @@
 Distortion TComRdCost::xGetSAD16N( DistParam* pcDtParam )
 {
-#if H_3D_IC
+#if NH_3D_IC
   if( pcDtParam->bUseIC )
   {
@@ -1064,5 +1064,5 @@
   }
 
-#if H_3D_IC
+#if NH_3D_IC
   if( pcDtParam->bUseIC )
   {
@@ -1137,5 +1137,5 @@
   }
 
-#if H_3D_IC
+#if NH_3D_IC
   if( pcDtParam->bUseIC )
   {
@@ -1202,5 +1202,5 @@
   }
 
-#if H_3D_IC
+#if NH_3D_IC
   if( pcDtParam->bUseIC )
   {
@@ -1306,5 +1306,5 @@
     return TComRdCostWeightPrediction::xGetSADw( pcDtParam );
   }
-#if H_3D_IC
+#if NH_3D_IC
   if( pcDtParam->bUseIC )
   {
@@ -1389,10 +1389,10 @@
 
 
-#if H_3D_IC || H_3D_INTER_SDC
+#if NH_3D_IC || H_3D_INTER_SDC
 UInt TComRdCost::xGetSADic( DistParam* pcDtParam )
 {
   if ( pcDtParam->bApplyWeight )
   {
-    return xGetSADw( pcDtParam );
+    return TComRdCostWeightPrediction::xGetSADw( pcDtParam );
   }
   Pel* piOrg   = pcDtParam->pOrg;
@@ -1442,5 +1442,5 @@
   if ( pcDtParam->bApplyWeight ) 
   {
-    return xGetSADw( pcDtParam );
+    return TComRdCostWeightPrediction::xGetSADw( pcDtParam );
   }
   Pel* piOrg   = pcDtParam->pOrg;
@@ -1499,5 +1499,5 @@
   if ( pcDtParam->bApplyWeight )
   {
-    return xGetSADw( pcDtParam );
+    return TComRdCostWeightPrediction::xGetSADw( pcDtParam );
   }
   Pel* piOrg      = pcDtParam->pOrg;
@@ -1568,5 +1568,5 @@
   if ( pcDtParam->bApplyWeight )
   {
-    return xGetSADw( pcDtParam );
+    return TComRdCostWeightPrediction::xGetSADw( pcDtParam );
   }
   Pel* piOrg   = pcDtParam->pOrg;
@@ -1661,5 +1661,5 @@
   if ( pcDtParam->bApplyWeight )
   {
-    return xGetSADw( pcDtParam );
+    return TComRdCostWeightPrediction::xGetSADw( pcDtParam );
   }
   Pel* piOrg   = pcDtParam->pOrg;
@@ -1836,5 +1836,5 @@
   if ( pcDtParam->bApplyWeight )
   {
-    return xGetSADw( pcDtParam );
+    return TComRdCostWeightPrediction::xGetSADw( pcDtParam );
   }
   Pel* piOrg   = pcDtParam->pOrg;
@@ -1978,5 +1978,5 @@
   if ( pcDtParam->bApplyWeight )
   {
-    return xGetSADw( pcDtParam );
+    return TComRdCostWeightPrediction::xGetSADw( pcDtParam );
   }
   Pel* piOrg   = pcDtParam->pOrg;
@@ -2095,5 +2095,5 @@
   if ( pcDtParam->bApplyWeight )
   {
-    return xGetSADw( pcDtParam );
+    return TComRdCostWeightPrediction::xGetSADw( pcDtParam );
   }
   Pel* piOrg   = pcDtParam->pOrg;
@@ -2333,5 +2333,5 @@
   if ( pcDtParam->bApplyWeight )
   {
-    return xGetSADw( pcDtParam );
+    return TComRdCostWeightPrediction::xGetSADw( pcDtParam );
   }
 
@@ -3328,5 +3328,5 @@
     return TComRdCostWeightPrediction::xGetHADsw( pcDtParam );
   }
-#if H_3D_IC
+#if NH_3D_IC
   if( pcDtParam->bUseIC )
   {
@@ -3404,10 +3404,10 @@
 }
 
-#if H_3D_IC || H_3D_INTER_SDC
+#if NH_3D_IC || H_3D_INTER_SDC
 UInt TComRdCost::xGetHADsic( DistParam* pcDtParam )
 {
   if ( pcDtParam->bApplyWeight )
   {
-    return xGetHADsw( pcDtParam );
+    return TComRdCostWeightPrediction::xGetHADsw( pcDtParam );
   }
   Pel* piOrg   = pcDtParam->pOrg;
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComRdCost.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComRdCost.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComRdCost.h	(revision 1225)
@@ -91,5 +91,5 @@
   Int   iStrideVir;
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Bool  bUseIC;
 #endif
@@ -256,5 +256,5 @@
   static Distortion xGetSSE64         ( DistParam* pcDtParam );
   static Distortion xGetSSE16N        ( DistParam* pcDtParam );
-#if H_3D_IC || H_3D_INTER_SDC
+#if NH_3D_IC || H_3D_INTER_SDC
   static UInt xGetSADic         ( DistParam* pcDtParam );
   static UInt xGetSAD4ic        ( DistParam* pcDtParam );
@@ -283,5 +283,5 @@
 #endif
 
-#if H_3D_IC || H_3D_INTER_SDC
+#if NH_3D_IC || H_3D_INTER_SDC
   static UInt xGetSAD12ic       ( DistParam* pcDtParam );
   static UInt xGetSAD24ic       ( DistParam* pcDtParam );
@@ -294,5 +294,5 @@
 
 
-#if H_3D_IC || H_3D_INTER_SDC
+#if NH_3D_IC || H_3D_INTER_SDC
   static UInt xGetHADsic          ( DistParam* pcDtParam );
 #endif
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComSlice.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComSlice.cpp	(revision 1225)
@@ -140,5 +140,5 @@
 , m_pocMsbValRequiredFlag         (false)
 #endif
-#if H_3D_IC
+#if NH_3D_IC
 , m_bApplyIC                      (false)
 , m_icSkipParseFlag               (false)
@@ -1170,5 +1170,5 @@
   m_bApplyDIS = pSrc->m_bApplyDIS;
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   m_bApplyIC = pSrc->m_bApplyIC;
   m_icSkipParseFlag = pSrc->m_icSkipParseFlag;
@@ -3690,5 +3690,5 @@
 #endif
 
-#if H_3D_IC
+#if NH_3D_IC
 // This is an encoder only function and should be moved to TEncSlice or TEncSearch!!
 Void TComSlice::xSetApplyIC(Bool bUseLowLatencyICEnc)
@@ -3779,5 +3779,5 @@
     {
       // Histogram building - luminance
-      Int iMaxPelValue = ( 1 << g_bitDepthY ); 
+      Int iMaxPelValue = ( 1 << getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) ); 
       Int *aiRefOrgHist = (Int *) xMalloc( Int,iMaxPelValue );
       Int *aiCurrHist   = (Int *) xMalloc( Int,iMaxPelValue );
@@ -3785,12 +3785,10 @@
       memset( aiCurrHist, 0, iMaxPelValue*sizeof(Int) );
 
-      Int iWidth   = pcCurrPicYuv->getWidth();
-      Int iHeight  = pcCurrPicYuv->getHeight();
-
-      Pel* pCurrY   = pcCurrPicYuv ->getLumaAddr();
-      Pel* pRefOrgY = pcRefPicYuvOrg  ->getLumaAddr();
-      Int iCurrStride = pcCurrPicYuv->getStride();
-      Int iRefStride = pcRefPicYuvOrg->getStride();
-
+      Int iWidth   = pcCurrPicYuv->getWidth(COMPONENT_Y);
+      Int iHeight  = pcCurrPicYuv->getHeight(COMPONENT_Y);
+      Pel* pCurrY   = pcCurrPicYuv->getAddr(COMPONENT_Y);
+      Pel* pRefOrgY = pcRefPicYuvOrg->getAddr(COMPONENT_Y);
+      Int iCurrStride = pcCurrPicYuv->getStride(COMPONENT_Y);
+      Int iRefStride = pcRefPicYuvOrg->getStride(COMPONENT_Y);
       for ( Int y = 0; y < iHeight; y++ )
       {
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComSlice.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComSlice.h	(revision 1225)
@@ -2603,5 +2603,5 @@
   std::vector<Int> m_pocsInCurrRPSs; 
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Bool       m_bApplyIC;
   Bool       m_icSkipParseFlag;
@@ -2619,5 +2619,5 @@
 #endif
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Int*       m_aICEnableCandidate;
   Int*       m_aICEnableNum;
@@ -2706,13 +2706,14 @@
   Int                         getNumCurCmpLIds( )                      const         { return (Int) m_inCmpRefViewIdcs.size();                       }
   TComPic*                    getIvPic( Bool depthFlag, Int viewIndex) const         { return  m_ivPicsCurrPoc[ depthFlag ? 1 : 0 ][ viewIndex ];    }
-#endif                                                                                                                                               
+#endif                                                                                                                                          
 #if H_3D                                                                                                                                             
   TComPic*                    getTexturePic       ()                                 { return  m_ivPicsCurrPoc[0][ m_viewIndex ];                    }
 #endif                                                                                                                                               
-#if H_3D_IC                                                                                                                                          
+#if NH_3D_IC
   Void                        setApplyIC( Bool b )                                   { m_bApplyIC = b;                                               }
   Bool                        getApplyIC()                                           { return m_bApplyIC;                                            }
-  Void                        xSetApplyIC();                                                                                                         
-  Void                        xSetApplyIC(Bool bUseLowLatencyICEnc);                                                                                 
+  Void                        xSetApplyIC();
+  Void                        xSetApplyIC(Bool bUseLowLatencyICEnc);
+
   Void                        setIcSkipParseFlag( Bool b )                           { m_icSkipParseFlag = b;                                        }
   Bool                        getIcSkipParseFlag()                                   { return m_icSkipParseFlag;                                     }
@@ -2957,5 +2958,5 @@
   Int*                        getDepthToDisparityB( Int refViewIdx )                 { return m_depthToDisparityB[ getVPS()->getVoiInVps( refViewIdx) ];}
   Int*                        getDepthToDisparityF( Int refViewIdx )                 { return m_depthToDisparityF[ getVPS()->getVoiInVps( refViewIdx) ];}
-#if H_3D_IC                                                                                                                                             
+#if NH_3D_IC                                                                                                                                             
   Void                        setICEnableCandidate( Int* icEnableCandidate)          { m_aICEnableCandidate = icEnableCandidate;                     }
   Void                        setICEnableNum( Int* icEnableNum)                      { m_aICEnableNum = icEnableNum;                                 }
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TypeDef.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TypeDef.h	(revision 1225)
@@ -66,4 +66,5 @@
 #if NH_MV
 #define H_MV_ENC_DEC_TRAC                 1  //< CU/PU level tracking
+#define H_MV_ENC_DEC_TRAC_FIX             1  // by SHARP
 
 #if NH_3D
@@ -72,4 +73,18 @@
                                               // Sony_M23639
                                               // H_3D_TMVP_SCALING_FIX_K0053       1   // QC/CY for K0053
+#define NH_3D_IC                          1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
+                                              // Unifying rounding offset, for IC part, JCT3V-D0135
+                                              // SHARP_ILLUCOMP_REFINE_E0046
+                                              // MTK_CLIPPING_ALIGN_IC_E0168       // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168
+                                              // LGE_IC_CTX_F0160 //JCT3V-F0160
+                                              // SEC_ONLY_TEXTURE_IC_F0151
+                                              // 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
+                                              // MTK_LOW_LATENCY_IC_ENCODING_H0086  Low-latency IC encoding in JCT3V-H0086
+                                              // MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX  1  // Remove the global variables used in JCT3V-H0086
+                                              // SEC_IC_NEIGHBOR_CLIP_I0080    // Clipping of neighboring sample position, JCT3V-I0080
+                                              // LGE_CHROMA_IC_J0050_J0034
+
+
 #endif
 
@@ -322,5 +337,5 @@
 #endif
 ///// ***** ILLUMATION COMPENSATION *********
-#if H_3D_IC
+#if NH_3D_IC
 #define IC_REG_COST_SHIFT                 7
 #define IC_CONST_SHIFT                    5
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1225)
@@ -2783,5 +2783,5 @@
     }
 
-#if H_3D_IC
+#if NH_3D_IC
     else if(    pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) 
              && !pcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0 
@@ -2796,5 +2796,5 @@
       if ( uiCodeTmp )
       {
-        READ_FLAG ( uiCodeTmp, "ic_skip_mergeidx0" );
+        READ_FLAG ( uiCodeTmp, "slice_ic_disabled_merge_zero_idx_flag" );
         pcSlice->setIcSkipParseFlag( uiCodeTmp );
       }
@@ -3382,5 +3382,5 @@
 }
 #endif
-#if H_3D_IC
+#if NH_3D_IC
 Void TDecCavlc::parseICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 1225)
@@ -120,5 +120,5 @@
   Void parseARPW            ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Void  parseICFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1225)
@@ -399,5 +399,5 @@
     m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
     m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
 #endif
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1225)
@@ -124,10 +124,14 @@
 #endif
 
-#if H_3D_IC
+#if NH_3D_IC
 Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
   pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );
 
+#if H_3D_ARP
   if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 )
+#else
+  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() )
+#endif
   {
     return;
@@ -475,4 +479,7 @@
         std::cout << " merge index: " << (UInt)pcCU->getMergeIndex(uiSubPartIdx) << std::endl;
       }
+#endif
+#if NH_3D_IC
+      decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
 #endif
 
@@ -531,4 +538,7 @@
         }
       }
+#if NH_3D_IC
+      decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
+#endif
     }
 
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecEntropy.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecEntropy.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecEntropy.h	(revision 1225)
@@ -88,5 +88,5 @@
   virtual Void parseARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   virtual Void parseICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
 #endif
@@ -177,5 +177,5 @@
   Void decodeARPW              ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Void decodeICFlag            ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1225)
@@ -76,5 +76,5 @@
 , m_cCUPUARPWSCModel          ( 1,             1,               NUM_ARPW_CTX                  , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
-#if H_3D_IC
+#if NH_3D_IC
 , m_cCUICFlagSCModel          ( 1,             1,               NUM_IC_FLAG_CTX               , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
@@ -167,5 +167,5 @@
   m_cCUPUARPWSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_ARPW );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   m_cCUICFlagSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_IC_FLAG );
 #endif
@@ -243,7 +243,4 @@
 #if H_3D_ARP
   m_cCUPUARPWSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_ARPW );
-#endif
-#if H_3D_IC
-  m_cCUICFlagSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_IC_FLAG );
 #endif
 #if H_3D_DIM
@@ -2445,5 +2442,5 @@
 #endif
 
-#if H_3D_IC
+#if NH_3D_IC
 /** parse illumination compensation flag
  * \param pcCU
@@ -2455,5 +2452,6 @@
 { 
   UInt uiSymbol = 0;
-  m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, 0 ) );
+  m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__3D_IC) );
+
 #if !H_MV_ENC_DEC_TRAC 
   DTRACE_CABAC_VL( g_nSymbolCounter++ );
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecSbac.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecSbac.h	(revision 1225)
@@ -142,5 +142,5 @@
   Void parseARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Void parseICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
@@ -193,5 +193,5 @@
   ContextModel3DBuffer m_cCUPUARPWSCModel;
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   ContextModel3DBuffer m_cCUICFlagSCModel;
 #endif
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1225)
@@ -423,7 +423,14 @@
 {
 #if ENC_DEC_TRACE
+#if H_MV_ENC_DEC_TRAC_FIX
+  if (g_hTrace != stdout && g_hTrace != NULL)
+#else
   if (g_hTrace != stdout)
+#endif
   {
     fclose( g_hTrace );
+#if H_MV_ENC_DEC_TRAC_FIX
+    g_hTrace = NULL;
+#endif
   }
 #endif
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1225)
@@ -2182,5 +2182,5 @@
       xCodePredWeightTable( pcSlice );
     }
-#if H_3D_IC
+#if NH_3D_IC
     else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE )
       && !pcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0 
@@ -2191,5 +2191,5 @@
       if( pcSlice->getApplyIC() )
       {
-        WRITE_FLAG( pcSlice->getIcSkipParseFlag() ? 1 : 0, "ic_skip_mergeidx0" );
+        WRITE_FLAG( pcSlice->getIcSkipParseFlag() ? 1 : 0, "slice_ic_disabled_merge_zero_idx_flag" );
       }
     }
@@ -2585,5 +2585,5 @@
 #endif
 
-#if H_3D_IC
+#if NH_3D_IC
 Void TEncCavlc::codeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncCavlc.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncCavlc.h	(revision 1225)
@@ -129,5 +129,5 @@
   Void codeARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncCfg.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncCfg.h	(revision 1225)
@@ -572,5 +572,5 @@
   Void      setMaxTotalCUDepth              ( UInt  u )      { m_maxTotalCUDepth = u; }
   Void      setLog2DiffMaxMinCodingBlockSize( UInt  u )      { m_log2DiffMaxMinCodingBlockSize = u; }
-#if H_3D_IC
+#if NH_3D_IC
   Void       setUseIC                       ( Bool bVal )    { m_bUseIC = bVal; }
   Bool       getUseIC                       ()               { return m_bUseIC; }
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1225)
@@ -505,5 +505,5 @@
   }
 
-#if H_3D_IC
+#if NH_3D_IC
   Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE ) && !rpcTempCU->getSlice()->getIsDepth();
   bICEnabled = bICEnabled && rpcTempCU->getSlice()->getApplyIC();
@@ -642,5 +642,5 @@
       if( rpcBestCU->getSlice()->getSliceType() != I_SLICE )
       {
-#if H_3D_IC
+#if NH_3D_IC
         for( UInt uiICId = 0; uiICId < ( bICEnabled ? 2 : 1 ); uiICId++ )
         {
@@ -650,5 +650,5 @@
         if(m_pcEncCfg->getUseEarlySkipDetection())
         {
-#if H_3D_IC
+#if NH_3D_IC
             rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
 #endif
@@ -664,5 +664,5 @@
         }
         // SKIP
-#if H_3D_IC
+#if NH_3D_IC
           rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
 #endif
@@ -680,5 +680,5 @@
         {
           // 2Nx2N, NxN
-#if H_3D_IC
+#if NH_3D_IC
             rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
 #endif
@@ -709,5 +709,5 @@
           }
         }
-#if H_3D_IC
+#if NH_3D_IC
         }
 #endif
@@ -1577,5 +1577,5 @@
     m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
     m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
 #endif
@@ -1620,5 +1620,5 @@
   m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
 #endif
@@ -1777,5 +1777,5 @@
   }
   UChar uhDepth = rpcTempCU->getDepth( 0 );
-#if H_3D_IC
+#if NH_3D_IC
   Bool bICFlag = rpcTempCU->getICFlag( 0 );
 #endif
@@ -1862,5 +1862,5 @@
     rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level
     rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
-#if H_3D_IC
+#if NH_3D_IC
     rpcTempCU->setICFlagSubParts( bICFlag, 0, 0, uhDepth );
 #endif
@@ -1905,5 +1905,5 @@
     for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand )
     {
-#if H_3D_IC
+#if NH_3D_IC
       if( rpcTempCU->getSlice()->getApplyIC() && rpcTempCU->getSlice()->getIcSkipParseFlag() )
       {
@@ -1922,5 +1922,5 @@
           // set MC parameters
           rpcTempCU->setPredModeSubParts( MODE_INTER, 0, uhDepth ); // interprets depth relative to CTU level
-#if H_3D_IC
+#if NH_3D_IC
           rpcTempCU->setICFlagSubParts( bICFlag, 0, 0, uhDepth );
 #endif
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1225)
@@ -148,8 +148,12 @@
 }
 
-#if H_3D_IC
+#if NH_3D_IC
 Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
 {
+#if H_3D_ARP
   if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 )
+#else
+  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() )
+#endif
   {
     return;
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncEntropy.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncEntropy.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncEntropy.h	(revision 1225)
@@ -87,5 +87,5 @@
   virtual Void codeARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   virtual Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
 #endif
@@ -176,5 +176,5 @@
   Void encodeARPW         ( TComDataCU* pcCU, UInt uiAbspartIdx );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Void encodeICFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
 #endif
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1225)
@@ -155,5 +155,5 @@
 #endif
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   m_aICEnableCandidate   = pcTEncTop->getICEnableCandidate(); 
   m_aICEnableNum         = pcTEncTop->getICEnableNum(); 
@@ -1490,5 +1490,5 @@
     }
 #endif
-#if H_3D_IC
+#if NH_3D_IC
     pcSlice->setICEnableCandidate( m_aICEnableCandidate );         
     pcSlice->setICEnableNum( m_aICEnableNum );         
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncGOP.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncGOP.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncGOP.h	(revision 1225)
@@ -132,5 +132,5 @@
 #endif
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Int*                    m_aICEnableCandidate; 
   Int*                    m_aICEnableNum; 
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1225)
@@ -71,5 +71,5 @@
 , m_cCUPUARPWSCModel                   ( 1,             1,                      NUM_ARPW_CTX                         , m_contextModels + m_numContextModels, m_numContextModels)
 #endif                                                                                                               
-#if H_3D_IC                                                                                                          
+#if NH_3D_IC                                                                                                          
 , m_cCUICFlagSCModel                   ( 1,             1,                      NUM_IC_FLAG_CTX                      , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
@@ -151,5 +151,5 @@
   m_cCUPUARPWSCModel.initBuffer                   ( eSliceType, iQp, (UChar*)INIT_ARPW );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   m_cCUICFlagSCModel.initBuffer                   ( eSliceType, iQp, (UChar*)INIT_IC_FLAG );
 #endif
@@ -238,5 +238,5 @@
       curCost += m_cCUPUARPWSCModel.calcCost                   ( curSliceType, qp, (UChar*)INIT_ARPW );
 #endif                                                     
-#if H_3D_IC                                                
+#if NH_3D_IC                                                
       curCost += m_cCUICFlagSCModel.calcCost                   ( curSliceType, qp, (UChar*)INIT_IC_FLAG );
 #endif                                                     
@@ -305,7 +305,4 @@
   m_cCUPUARPWSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_ARPW );
 #endif
-#if H_3D_IC
-  m_cCUICFlagSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_IC_FLAG );
-#endif
 #if H_3D_DIM
   m_cDepthIntraModeSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_DEPTH_INTRA_MODE );
@@ -994,5 +991,5 @@
 #endif
 
-#if H_3D_IC
+#if NH_3D_IC
 /** code Illumination Compensation flag
  * \param pcCU
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncSbac.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncSbac.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncSbac.h	(revision 1225)
@@ -143,5 +143,5 @@
   Void codeARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
@@ -215,5 +215,5 @@
   ContextModel3DBuffer m_cCUPUARPWSCModel;
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   ContextModel3DBuffer m_cCUICFlagSCModel;
 #endif
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1225)
@@ -340,5 +340,5 @@
 
   piRefSrch = rcStruct.piRefY + iSearchY * rcStruct.iYStride + iSearchX;
-#if H_3D_IC
+#if NH_3D_IC
   m_cDistParam.bUseIC = pcPatternKey->getICFlag();
 #endif
@@ -851,5 +851,5 @@
 
     setDistParamComp(COMPONENT_Y);
-#if H_3D_IC
+#if NH_3D_IC
     m_cDistParam.bUseIC = pcPatternKey->getICFlag();
 #endif
@@ -3857,5 +3857,5 @@
                             iWidth, iHeight, m_pcEncCfg->getUseHADME() && (pcCU->getCUTransquantBypass(iPartIdx) == 0) );
 
-#if H_3D_IC
+#if NH_3D_IC
   cDistParam.bUseIC = false;
 #endif
@@ -5000,5 +5000,5 @@
   pcCU->clipMv( cMvCand );
 
-#if H_3D_IC
+#if NH_3D_IC
   Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getViewIndex() != pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() );
 #endif
@@ -5015,5 +5015,5 @@
       , false
 #endif
-#if H_3D_IC
+#if NH_3D_IC
     , bICFlag
 #endif
@@ -5060,5 +5060,5 @@
   pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iRoiWidth, iRoiHeight );
 
-#if H_3D_IC
+#if NH_3D_IC
   Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getViewIndex() != pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->getViewIndex() );
   pcPatternKey->setICFlag( bICFlag );
@@ -5250,5 +5250,5 @@
       m_cDistParam.bitDepth = pcPatternKey->getBitDepthY();
 
-#if H_3D_IC
+#if NH_3D_IC
       m_cDistParam.bUseIC = pcPatternKey->getICFlag();
 #endif
@@ -5784,5 +5784,5 @@
     m_pcEntropyCoder->encodeARPW( pcCU, 0 );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
     m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
 #endif
@@ -7100,5 +7100,5 @@
     m_pcEntropyCoder->encodeARPW( pcCU, 0 );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
     m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
 #endif
@@ -7127,5 +7127,5 @@
     m_pcEntropyCoder->encodeARPW( pcCU , 0  );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
     m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
 #endif
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 1225)
@@ -226,5 +226,5 @@
   rpcSlice->setPicOutputFlag( true );
   rpcSlice->setPOC( pocCurr );
-#if H_3D_IC
+#if NH_3D_IC
   rpcSlice->setApplyIC( false );
 #endif
@@ -823,10 +823,10 @@
 #endif
 
-#if H_3D_IC
-  if ( pcEncTop->getViewIndex() && pcEncTop->getUseIC() &&
+#if NH_3D_IC
+  if ( m_pcCfg->getViewIndex() && m_pcCfg->getUseIC() &&
        !( ( pcSlice->getSliceType() == P_SLICE && pcSlice->getPPS()->getUseWP() ) || ( pcSlice->getSliceType() == B_SLICE && pcSlice->getPPS()->getWPBiPred() ) )
      )
   {
-    pcSlice ->xSetApplyIC(pcEncTop->getUseICLowLatencyEnc());
+    pcSlice ->xSetApplyIC(m_pcCfg->getUseICLowLatencyEnc());
     if ( pcSlice->getApplyIC() )
     {
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1225)
@@ -79,5 +79,5 @@
   m_ivPicLists = NULL;
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   m_aICEnableCandidate = NULL;
   m_aICEnableNum = NULL;
@@ -227,5 +227,5 @@
 
   xInitPPSforTiles();
-#if H_3D_IC
+#if NH_3D_IC
   m_aICEnableCandidate = new Int[ 10 ];
   m_aICEnableNum = new Int[ 10 ];
Index: branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncTop.h	(revision 1215)
+++ branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibEncoder/TEncTop.h	(revision 1225)
@@ -81,5 +81,5 @@
   TComPicLists*           m_ivPicLists;                   ///< access to picture lists of other layers 
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Int *m_aICEnableCandidate;
   Int *m_aICEnableNum;
@@ -158,5 +158,5 @@
   TComPicLists* getIvPicLists() { return m_ivPicLists; }
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Int*      getICEnableCandidate() { return m_aICEnableCandidate; }
   Int*      getICEnableNum() { return m_aICEnableNum; }
@@ -208,5 +208,5 @@
   Void                    setSps3dExtension     ( TComSps3dExtension sps3dExtension ) { m_cSPS.setSps3dExtension( sps3dExtension );  };
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   Void                    setICEnableCandidate         ( Int* ICEnableCandidate) { m_aICEnableCandidate = ICEnableCandidate; }
   Void                    setICEnableNum         ( Int* ICEnableNum) { m_aICEnableNum = ICEnableNum; }
