Index: trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 210)
+++ trunk/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 296)
@@ -52,5 +52,4 @@
 Void TEncEntropy::encodeSliceHeader ( TComSlice* pcSlice )
 {
-#if SAO_UNIT_INTERLEAVING
   if (pcSlice->getSPS()->getUseSAO())
   {
@@ -68,5 +67,4 @@
     }
   }
-#endif
 
   m_pcEntropyCoderIf->codeSliceHeader( pcSlice );
@@ -74,15 +72,8 @@
 }
 
-#if TILES_WPP_ENTRY_POINT_SIGNALLING
 Void  TEncEntropy::encodeTilesWPPEntryPoint( TComSlice* pSlice )
 {
   m_pcEntropyCoderIf->codeTilesWPPEntryPoint( pSlice );
 }
-#else
-Void TEncEntropy::encodeSliceHeaderSubstreamTable( TComSlice* pcSlice )
-{
-  m_pcEntropyCoderIf->codeSliceHeaderSubstreamTable( pcSlice );
-}
-#endif
 
 Void TEncEntropy::encodeTerminatingBit      ( UInt uiIsLast )
@@ -98,5 +89,4 @@
 }
 
-#if OL_FLUSH
 Void TEncEntropy::encodeFlush()
 {
@@ -107,5 +97,4 @@
   m_pcEntropyCoderIf->encodeStart();
 }
-#endif
 
 Void TEncEntropy::encodeSEI(const SEI& sei)
@@ -133,5 +122,5 @@
 #endif
 
-#if HHI_MPI
+#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068 
 Void TEncEntropy::encodeSPS( TComSPS* pcSPS, Bool bIsDepth )
 {
@@ -157,5 +146,4 @@
     uiAbsPartIdx = 0;
   }
-#if BURST_IPCM
   if( !bRD )
   {
@@ -165,12 +153,19 @@
     }
   }
-#endif
   m_pcEntropyCoderIf->codeSkipFlag( pcCU, uiAbsPartIdx );
 }
 
 #if LGE_ILLUCOMP_B0045
-Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
-{
-  if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0) || pcCU->getSlice()->getSPS()->isDepth())
+Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD 
+#if LGE_ILLUCOMP_DEPTH_C0046
+    , UInt uiDepth
+#endif
+    )
+{
+  if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0)
+#if !LGE_ILLUCOMP_DEPTH_C0046
+      || pcCU->getSlice()->getSPS()->isDepth()
+#endif
+      )
   {
     return;
@@ -185,5 +180,9 @@
   }
 
-  if(pcCU->isICFlagRequired(uiAbsPartIdx))
+  if(pcCU->isICFlagRequired(uiAbsPartIdx
+#if LGE_ILLUCOMP_DEPTH_C0046
+      , uiDepth //This modification is not needed after integrating JCT3V-C0137
+#endif
+      ))
     m_pcEntropyCoderIf->codeICFlag( pcCU, uiAbsPartIdx );
 }
@@ -214,10 +213,4 @@
   //  m_pcEntropyCoderIf->codeAlfUvlc(pAlfParam->realfiltNo); 
 
-#if !LCU_SYNTAX_ALF
-  m_pcEntropyCoderIf->codeAlfFlag(pAlfParam->alf_pcr_region_flag);
-#endif
-#if !ALF_SINGLE_FILTER_SHAPE
-  m_pcEntropyCoderIf->codeAlfUvlc(pAlfParam->filter_shape); 
-#endif
   Int noFilters = min(pAlfParam->filters_per_group-1, 2);
   m_pcEntropyCoderIf->codeAlfUvlc(noFilters);
@@ -229,17 +222,5 @@
   else if (noFilters == 2)
   {
-#if LCU_SYNTAX_ALF
-#if ALF_16_BA_GROUPS
     Int numMergeFlags = 16;
-#else
-    Int numMergeFlags = 15;
-#endif
-#else
-#if ALF_16_BA_GROUPS
-    Int numMergeFlags = 16;
-#else
-    Int numMergeFlags = pAlfParam->alf_pcr_region_flag ? 16 : 15;
-#endif
-#endif
     for (Int i=1; i<numMergeFlags; i++) 
     {
@@ -273,9 +254,5 @@
   pDepthInt = pDepthIntTabShapes[ALFp->filter_shape];
   maxScanVal = 0;
-#if ALF_SINGLE_FILTER_SHAPE
   int minScanVal = MIN_SCAN_POS_CROSS;
-#else
-  int minScanVal = ( ALFp->filter_shape==ALF_STAR5x5 ) ? 0 : MIN_SCAN_POS_CROSS;
-#endif
 
   for(i = 0; i < sqrFiltLength; i++)
@@ -343,7 +320,4 @@
   // Coding parameters
   ALFp->minKStart = minKStart;
-#if !LCU_SYNTAX_ALF  
-  ALFp->maxScanVal = maxScanVal;
-#endif
   for(scanPos = minScanVal; scanPos < maxScanVal; scanPos++)
   {
@@ -351,5 +325,4 @@
   }
 
-#if LCU_SYNTAX_ALF
   if (ALFp->filters_per_group == 1)
   {
@@ -358,12 +331,9 @@
   else
   {
-#endif
   len += writeFilterCodingParams(minKStart, minScanVal, maxScanVal, kMinTab);
 
   // Filter coefficients
   len += writeFilterCoeffs(sqrFiltLength, filters_per_group, pDepthInt, ALFp->coeffmulti, kMinTab);
-#if LCU_SYNTAX_ALF
-  }
-#endif
+  }
   
   return len;
@@ -403,10 +373,6 @@
     {
       scanPos = pDepthInt[i] - 1;
-#if LCU_SYNTAX_ALF
       Int k = (filters_per_group == 1) ? kMinTab[i] : kMinTab[scanPos];
       golombEncode(FilterCoeff[ind][i], k);
-#else
-      golombEncode(FilterCoeff[ind][i], kMinTab[scanPos]);
-#endif
     }
   }
@@ -489,5 +455,5 @@
 }
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP && !MTK_MDIVRP_C0138
 Void
 TEncEntropy::encodeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD )
@@ -514,5 +480,4 @@
 #endif
 
-#if LCU_SYNTAX_ALF
 /** parse the fixed length code (smaller than one max value) in ALF
  * \param run: coded value
@@ -781,10 +746,8 @@
 
 }
-#endif
 
 
 Void TEncEntropy::encodeAlfParam(ALFParam* pAlfParam)
 {
-#if LCU_SYNTAX_ALF
   const Int numCoeff = (Int)ALF_MAX_NUM_COEF;
 
@@ -814,27 +777,4 @@
     }
   }
-#else
-  if (!pAlfParam->alf_flag)
-  {
-    return;
-  }
-  Int pos;
-  codeAux(pAlfParam);
-  codeFilt(pAlfParam);
-  
-  // filter parameters for chroma
-  m_pcEntropyCoderIf->codeAlfUvlc(pAlfParam->chroma_idc);
-  if(pAlfParam->chroma_idc)
-  {
-#if !ALF_SINGLE_FILTER_SHAPE
-    m_pcEntropyCoderIf->codeAlfUvlc(pAlfParam->filter_shape_chroma);
-#endif
-    // filter coefficients for chroma
-    for(pos=0; pos<pAlfParam->num_coeff_chroma; pos++)
-    {
-      m_pcEntropyCoderIf->codeAlfSvlc(pAlfParam->coeff_chroma[pos]);
-    }
-  }
-#endif
 }
 
@@ -895,5 +835,4 @@
     uiAbsPartIdx = 0;
   }
-#if BURST_IPCM
   if( !bRD )
   {
@@ -903,5 +842,4 @@
     }
   }
-#endif
 
 #if !RWTH_SDC_DLT_B0036
@@ -931,5 +869,4 @@
     uiAbsPartIdx = 0;
   }
-#if BURST_IPCM
   if( !bRD )
   {
@@ -939,5 +876,4 @@
     }
   }
-#endif
 
   m_pcEntropyCoderIf->codeSplitFlag( pcCU, uiAbsPartIdx, uiDepth );
@@ -957,5 +893,4 @@
     uiAbsPartIdx = 0;
   }
-#if BURST_IPCM
   if( !bRD )
   {
@@ -965,5 +900,4 @@
     }
   }
-#endif  
 #if RWTH_SDC_DLT_B0036
   if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx)  )
@@ -1019,5 +953,4 @@
   }
   
-#if BURST_IPCM
   Int numIPCM = 0;
   Bool firstIPCMFlag = false;
@@ -1035,19 +968,11 @@
   }
   m_pcEntropyCoderIf->codeIPCMInfo ( pcCU, uiAbsPartIdx, numIPCM, firstIPCMFlag);
-#else
-  m_pcEntropyCoderIf->codeIPCMInfo ( pcCU, uiAbsPartIdx );
-#endif
-
-}
-
-#if UNIFIED_TRANSFORM_TREE
+
+}
+
 Void TEncEntropy::xEncodeTransform( TComDataCU* pcCU,UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3, Bool& bCodeDQP )
-#else
-Void TEncEntropy::xEncodeTransformSubdiv( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3 )
-#endif
 {
   const UInt uiSubdiv = pcCU->getTransformIdx( uiAbsPartIdx ) + pcCU->getDepth( uiAbsPartIdx ) > uiDepth;
   const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth;
-#if UNIFIED_TRANSFORM_TREE
   UInt cbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA    , uiTrIdx );
   UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
@@ -1072,5 +997,4 @@
     }
   }
-#endif // UNIFIED_TRANSFORM_TREE
   {//CABAC
     if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && uiDepth == pcCU->getDepth(uiAbsPartIdx) )
@@ -1152,5 +1076,4 @@
     if( uiSubdiv )
     {
-#if UNIFIED_TRANSFORM_TREE
       UInt size;
       width  >>= 1;
@@ -1158,11 +1081,6 @@
       size = width*height;
       uiTrIdx++;
-#endif // UNIFIED_TRANSFORM_TREE
       ++uiDepth;
-#if UNIFIED_TRANSFORM_TREE
       const UInt partNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
-#else
-      const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
-#endif
       
       UInt uiCurrentCbfY = 0;
@@ -1170,5 +1088,4 @@
       UInt uiCurrentCbfV = 0;
       
-#if UNIFIED_TRANSFORM_TREE
       UInt nsAddr = 0;
       nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, 0, uiDepth - pcCU->getDepth( uiAbsPartIdx ) );
@@ -1186,21 +1103,4 @@
       nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, 3, uiDepth - pcCU->getDepth( uiAbsPartIdx ) );
       xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, nsAddr, uiDepth, width, height, uiTrIdx, 3, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV, bCodeDQP );      
-#else // UNIFIED_TRANSFORM_TREE
-      UInt nsAddr = 0;
-      nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, 0, uiDepth - pcCU->getDepth( uiAbsPartIdx ) );
-      xEncodeTransformSubdiv( pcCU, uiAbsPartIdx, nsAddr, uiDepth, 0, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV );
-
-      uiAbsPartIdx += uiQPartNum;
-      nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, 1, uiDepth - pcCU->getDepth( uiAbsPartIdx ) );
-      xEncodeTransformSubdiv( pcCU, uiAbsPartIdx, nsAddr, uiDepth, 1, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV );
-
-      uiAbsPartIdx += uiQPartNum;
-      nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, 2, uiDepth - pcCU->getDepth( uiAbsPartIdx ) );
-      xEncodeTransformSubdiv( pcCU, uiAbsPartIdx, nsAddr, uiDepth, 2, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV );
-
-      uiAbsPartIdx += uiQPartNum;
-      nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, 3, uiDepth - pcCU->getDepth( uiAbsPartIdx ) );
-      xEncodeTransformSubdiv( pcCU, uiAbsPartIdx, nsAddr, uiDepth, 3, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV );
-#endif // UNIFIED_TRANSFORM_TREE
       
       uiYCbfFront3 += uiCurrentCbfY;
@@ -1246,5 +1146,4 @@
       }
       
-#if UNIFIED_TRANSFORM_TREE
       if ( cbfY || cbfU || cbfV )
       {
@@ -1298,29 +1197,8 @@
         }
       }
-#endif // UNIFIED_TRANSFORM_TREE
-    }
-  }
-}
-
-#if !UNIFIED_TRANSFORM_TREE
-// transform index
-Void TEncEntropy::encodeTransformIdx( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD )
-{
-  assert( !bRD ); // parameter bRD can be removed
-  if( bRD )
-  {
-    uiAbsPartIdx = 0;
-  }
-  
-  DTRACE_CABAC_VL( g_nSymbolCounter++ )
-  DTRACE_CABAC_T( "\tdecodeTransformIdx()\tCUDepth=" )
-  DTRACE_CABAC_V( uiDepth )
-  DTRACE_CABAC_T( "\n" )
-  UInt temp = 0;
-  UInt temp1 = 0;
-  UInt temp2 = 0;
-  xEncodeTransformSubdiv( pcCU, uiAbsPartIdx, uiAbsPartIdx, uiDepth, 0, temp, temp1, temp2 );
-}
-#endif // !UNIFIED_TRANSFORM_TREE
+    }
+  }
+}
+
 
 // Intra direction for Luma
@@ -1347,5 +1225,5 @@
     uiAbsPartIdx = 0;
   }
-  
+
 #if RWTH_SDC_DLT_B0036
   if( pcCU->getSDCFlag(uiAbsPartIdx) )
@@ -1355,5 +1233,5 @@
   }
 #endif
-  
+
   PartSize eSize = pcCU->getPartitionSize( uiAbsPartIdx );
   
@@ -1496,5 +1374,5 @@
   if ( (pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList )) && (pcCU->getAMVPMode(uiAbsPartIdx) == AM_EXPL) )
   {
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
     const Int iNumCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
     m_pcEntropyCoderIf->codeMVPIdx( pcCU, uiAbsPartIdx, eRefList, iNumCands );
@@ -1538,135 +1416,4 @@
 
 // texture
-#if !UNIFIED_TRANSFORM_TREE
-Void TEncEntropy::xEncodeCoeff( TComDataCU* pcCU, UInt uiLumaOffset, UInt uiChromaOffset, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, UInt uiTrIdx, UInt uiCurrTrIdx, Bool& bCodeDQP )
-{
-  UInt uiLog2TrSize = g_aucConvertToBit[ pcCU->getSlice()->getSPS()->getMaxCUWidth() >> uiDepth ] + 2;
-  UInt uiCbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrIdx );
-  UInt uiCbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
-  UInt uiCbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
-
-  if( uiLog2TrSize == 2 )
-  {
-    UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 );
-    if( ( uiAbsPartIdx % uiQPDiv ) == 0 )
-    {
-      m_uiBakAbsPartIdx   = uiAbsPartIdx;
-      m_uiBakChromaOffset = uiChromaOffset;
-    }
-    else if( ( uiAbsPartIdx % uiQPDiv ) == (uiQPDiv - 1) )
-    {
-      uiCbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
-      uiCbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
-    }
-  }
-
-  if ( uiCbfY || uiCbfU || uiCbfV )
-  {
-    // dQP: only for LCU once
-    if ( pcCU->getSlice()->getPPS()->getUseDQP() )
-    {
-      if ( bCodeDQP )
-      {
-        encodeQP( pcCU, uiAbsPartIdx );
-        bCodeDQP = false;
-      }
-    }
-    UInt uiLumaTrMode, uiChromaTrMode;
-    pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx( uiAbsPartIdx ), uiLumaTrMode, uiChromaTrMode );
-    const UInt uiStopTrMode = uiLumaTrMode;
-    
-    assert(1); // as long as quadtrees are not used for residual transform
-    
-    if( uiTrIdx == uiStopTrMode )
-    {
-      if( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrIdx ) )
-      {
-        Int trWidth = uiWidth;
-        Int trHeight = uiHeight;
-        pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );
-        m_pcEntropyCoderIf->codeCoeffNxN( pcCU, (pcCU->getCoeffY()+uiLumaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA );
-      }
-
-      uiWidth  >>= 1;
-      uiHeight >>= 1;
-
-      if( uiLog2TrSize == 2 )
-      {
-        UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 );
-        if( ( uiAbsPartIdx % uiQPDiv ) == (uiQPDiv - 1) )
-        {
-          uiWidth  <<= 1;
-          uiHeight <<= 1;
-          Int trWidth = uiWidth;
-          Int trHeight = uiHeight;
-          pcCU->getNSQTSize( uiTrIdx-1, uiAbsPartIdx, trWidth, trHeight );
-          if( pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ) )
-          {
-            m_pcEntropyCoderIf->codeCoeffNxN( pcCU, (pcCU->getCoeffCb()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U );
-          }
-          if( pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ) )
-          {
-            m_pcEntropyCoderIf->codeCoeffNxN( pcCU, (pcCU->getCoeffCr()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V );
-          }
-        }
-      }
-      else
-      {
-        Int trWidth = uiWidth;
-        Int trHeight = uiHeight;
-        pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );
-        if( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ) )
-        {
-          m_pcEntropyCoderIf->codeCoeffNxN( pcCU, (pcCU->getCoeffCb()+uiChromaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U );
-        }
-        if( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ) )
-        {
-          m_pcEntropyCoderIf->codeCoeffNxN( pcCU, (pcCU->getCoeffCr()+uiChromaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V );
-        }
-      }
-    }
-    else
-    {
-      {
-        DTRACE_CABAC_VL( g_nSymbolCounter++ );
-        DTRACE_CABAC_T( "\tgoing down\tdepth=" );
-        DTRACE_CABAC_V( uiDepth );
-        DTRACE_CABAC_T( "\ttridx=" );
-        DTRACE_CABAC_V( uiTrIdx );
-        DTRACE_CABAC_T( "\n" );
-      }
-      if( uiCurrTrIdx <= uiTrIdx )
-        assert(1);
-      
-      UInt uiSize;
-      uiWidth  >>= 1;
-      uiHeight >>= 1;
-      uiSize = uiWidth*uiHeight;
-      uiDepth++;
-      uiTrIdx++;
-      
-      UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
-      UInt uiIdx      = uiAbsPartIdx;
-      
-      {
-        xEncodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP );
-        uiLumaOffset += uiSize;  uiChromaOffset += (uiSize>>2);  uiIdx += uiQPartNum;
-
-        xEncodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP );
-        uiLumaOffset += uiSize;  uiChromaOffset += (uiSize>>2);  uiIdx += uiQPartNum;
-
-        xEncodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP );
-        uiLumaOffset += uiSize;  uiChromaOffset += (uiSize>>2);  uiIdx += uiQPartNum;
-
-        xEncodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP );
-      }
-      {
-        DTRACE_CABAC_VL( g_nSymbolCounter++ );
-        DTRACE_CABAC_T( "\tgoing up\n" );
-      }
-    }
-  }
-}
-#endif // !UNIFIED_TRANSFORM_TREE
 
 /** encode coefficients
@@ -1706,10 +1453,4 @@
     DTRACE_CABAC_V( uiDepth )
     DTRACE_CABAC_T( "\n" )
-#if !UNIFIED_TRANSFORM_TREE
-    UInt temp = 0;
-    UInt temp1 = 0;
-    UInt temp2 = 0;
-    xEncodeTransformSubdiv( pcCU, uiAbsPartIdx, uiAbsPartIdx, uiDepth, 0, temp, temp1, temp2 );
-#endif // !UNIFIED_TRANSFORM_TREE
   }
   else
@@ -1735,7 +1476,4 @@
       }
     }
-#if !UNIFIED_TRANSFORM_TREE
-    encodeTransformIdx( pcCU, uiAbsPartIdx, pcCU->getDepth(uiAbsPartIdx) );
-#endif
   }
   
@@ -1756,12 +1494,8 @@
 #endif
 
-#if UNIFIED_TRANSFORM_TREE
   UInt temp = 0;
   UInt temp1 = 0;
   UInt temp2 = 0;
   xEncodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, temp, temp1, temp2, bCodeDQP );
-#else // UNIFIED_TRANSFORM_TREE
-  xEncodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, uiLumaTrMode, bCodeDQP );
-#endif // UNIFIED_TRANSFORM_TREE
 
 #if FIX_MPI_B0065
@@ -1785,5 +1519,4 @@
 }
 
-#if SAO_UNIT_INTERLEAVING
 /** Encode SAO Offset
  * \param  saoLcuParam SAO LCU paramters
@@ -1973,94 +1706,4 @@
   }
 }
-#else
-/** Encode SAO for one partition
- * \param  pSaoParam, iPartIdx
- */
-Void TEncEntropy::encodeSaoOnePart(SAOParam* pSaoParam, Int iPartIdx, Int iYCbCr)
-{
-  SAOQTPart*  pAlfPart = NULL;
-  pAlfPart = &(pSaoParam->psSaoPart[iYCbCr][iPartIdx]); 
-
-  UInt uiSymbol;
-
-  if(!pAlfPart->bSplit)
-  {
-    if (pAlfPart->bEnableFlag)
-    {
-      uiSymbol = pAlfPart->iBestType + 1;
-    }
-    else
-    {
-      uiSymbol = 0;
-    }
-    
-    m_pcEntropyCoderIf->codeSaoUvlc(uiSymbol);
-
-    if (pAlfPart->bEnableFlag)
-    {
-      for(Int i=0; i< pAlfPart->iLength; i++)
-      {
-        m_pcEntropyCoderIf->codeSaoSvlc(pAlfPart->iOffset[i]);
-      }   
-    }
-    return;
-  }
-
-  //split
-  if (pAlfPart->PartLevel < pSaoParam->iMaxSplitLevel)
-  {
-    for (Int i=0;i<NUM_DOWN_PART;i++)
-    {
-      encodeSaoOnePart(pSaoParam, pAlfPart->DownPartsIdx[i], iYCbCr);
-    }
-  }
-}
-
-/** Encode quadtree split flag
- * \param  pSaoParam, iPartIdx
- */
-Void TEncEntropy::encodeQuadTreeSplitFlag(SAOParam* pSaoParam, Int iPartIdx, Int iYCbCr)
-{
-  SAOQTPart*  pSaoPart = NULL;
-  pSaoPart = &(pSaoParam->psSaoPart[iYCbCr][iPartIdx]);
-
-  if(pSaoPart->PartLevel < pSaoParam->iMaxSplitLevel)
-  {
-    //send one flag
-    m_pcEntropyCoderIf->codeSaoFlag( (pSaoPart->bSplit)?(1):(0)  );
-
-    if(pSaoPart->bSplit)
-    {
-      for (Int i=0;i<NUM_DOWN_PART;i++)
-      {
-        encodeQuadTreeSplitFlag(pSaoParam, pSaoPart->DownPartsIdx[i], iYCbCr);
-      }
-    } 
-  }
-}
-/** Encode SAO parameters
- * \param  pSaoParam
- */
-Void TEncEntropy::encodeSaoParam(SAOParam* pSaoParam)
-{
-  if (pSaoParam->bSaoFlag[0])
-  {
-    encodeQuadTreeSplitFlag(pSaoParam, 0, 0);
-    encodeSaoOnePart(pSaoParam, 0, 0);
-    m_pcEntropyCoderIf->codeSaoFlag(pSaoParam->bSaoFlag[1]); 
-    if (pSaoParam->bSaoFlag[1])
-    {
-      encodeQuadTreeSplitFlag(pSaoParam, 0, 1);
-      encodeSaoOnePart(pSaoParam, 0, 1);
-    }
-    m_pcEntropyCoderIf->codeSaoFlag(pSaoParam->bSaoFlag[2]); 
-    if (pSaoParam->bSaoFlag[2])
-    {
-      encodeQuadTreeSplitFlag(pSaoParam, 0, 2);
-      encodeSaoOnePart(pSaoParam, 0, 2);
-    }
-  }
-}
-#endif
 
 Int TEncEntropy::countNonZeroCoeffs( TCoeff* pcCoef, UInt uiSize )
