Index: trunk/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 313)
+++ trunk/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 345)
@@ -906,11 +906,5 @@
         m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
       }
-#if INTRA_BL
-      m_pcEntropyCoder->encodeIntraBLFlag ( pcCU, 0, true );
-      if( pcCU->isIntraBL( 0 ) )
-      {
-        return;
-      }
-#endif      
+    
       m_pcEntropyCoder  ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
 
@@ -950,10 +944,5 @@
     }
   }
-#if INTRA_BL
-  if( pcCU->isIntraBL( 0 ) )
-  {
-    return;
-  }
-#endif
+
   if( bChroma )
   {
@@ -1055,11 +1044,4 @@
     pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, uiTrDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
     //===== get prediction signal =====
-#if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED
-    if(pcCU->isIntraBL ( uiAbsPartIdx ) )
-    {
-      pcCU->getBaseLumaBlk( uiWidth, uiHeight, uiAbsPartIdx, piPred, uiStride );
-    }
-    else
-#endif
     predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
     // save prediction 
@@ -1247,14 +1229,6 @@
 
     //===== get prediction signal =====
-#if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED
-  if(pcCU->isIntraBL ( uiAbsPartIdx ) )
-  {
-    pcCU->getBaseChromaBlk( uiWidth, uiHeight, uiAbsPartIdx, piPred, uiStride, uiChromaId );
-  }
-  else
-#endif
-    {
-      predIntraChromaAng( pPatChroma, uiChromaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
-    }
+    predIntraChromaAng( pPatChroma, uiChromaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
+
     // save prediction 
     if( default0Save1Load2 == 1 )
@@ -4567,9 +4541,5 @@
 Void TEncSearch::encodeResAndCalcRdInterCU( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* pcYuvPred, TComYuv*& rpcYuvResi, TComYuv*& rpcYuvResiBest, TComYuv*& rpcYuvRec, Bool bSkipRes )
 {
-#if NO_RESIDUAL_FLAG_FOR_BLPRED
-  if ( pcCU->isIntra(0) && !pcCU->isIntraBL(0))
-#else
   if ( pcCU->isIntra(0) )
-#endif
   {
     return;
@@ -4682,18 +4652,4 @@
       pcCU->setTransformSkipSubParts ( 0, 0, 0, 0, pcCU->getDepth(0) );
     }
-#if NO_RESIDUAL_FLAG_FOR_BLPRED 
-    else if(pcCU->getLayerId() > 0 && pcCU->isIntraBL(0) && uiZeroDistortion == uiDistortion) // all zeros
-    {
-      const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (pcCU->getDepth(0) << 1);
-      ::memset( pcCU->getTransformIdx()      , 0, uiQPartNum * sizeof(UChar) );
-      ::memset( pcCU->getCbf( TEXT_LUMA )    , 0, uiQPartNum * sizeof(UChar) );
-      ::memset( pcCU->getCbf( TEXT_CHROMA_U ), 0, uiQPartNum * sizeof(UChar) );
-      ::memset( pcCU->getCbf( TEXT_CHROMA_V ), 0, uiQPartNum * sizeof(UChar) );
-      ::memset( pcCU->getCoeffY()            , 0, uiWidth * uiHeight * sizeof( TCoeff )      );
-      ::memset( pcCU->getCoeffCb()           , 0, uiWidth * uiHeight * sizeof( TCoeff ) >> 2 );
-      ::memset( pcCU->getCoeffCr()           , 0, uiWidth * uiHeight * sizeof( TCoeff ) >> 2 );
-      pcCU->setTransformSkipSubParts ( 0, 0, 0, 0, pcCU->getDepth(0) );
-    }
-#endif
     else
     {
@@ -4994,17 +4950,5 @@
       Int scalingListType = 3 + g_eTTable[(Int)TEXT_LUMA];
       assert(scalingListType < 6);     
-#if NO_RESIDUAL_FLAG_FOR_BLPRED
-      if(pcCU->isIntraBL(uiAbsPartIdx) )
-      {
-        m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,DC_IDX, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType );//this is for inter mode only
-      }
-      else
-      {
-        m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType );//this is for inter mode only
-      }
-#else
       m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType );//this is for inter mode only
-#endif
-      
       const UInt uiNonzeroDistY = m_pcRdCost->getDistPart(g_bitDepthY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( absTUPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),
       pcResi->getLumaAddr( absTUPartIdx ), pcResi->getStride(), trWidth,trHeight );
@@ -5275,16 +5219,5 @@
         assert(scalingListType < 6);     
 
-#if NO_RESIDUAL_FLAG_FOR_BLPRED
-        if(pcCU->isIntraBL(uiAbsPartIdx) )
-        {
-          m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,DC_IDX, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType, true );
-        }
-        else
-        {
-          m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType, true );
-        }
-#else
         m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType, true );
-#endif
 
         uiNonzeroDistY = m_pcRdCost->getDistPart(g_bitDepthY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( absTUPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),
@@ -5617,13 +5550,5 @@
 
   {
-#if INTRA_BL
-#if NO_RESIDUAL_FLAG_FOR_BLPRED
-    assert( !pcCU->isIntra(uiAbsPartIdx) || pcCU->isIntraBL(uiAbsPartIdx));
-#else
-    assert( !pcCU->isIntra(uiAbsPartIdx) );
-#endif
-#else
     assert( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA );
-#endif
     if( bSubdivAndCbf )
     {
@@ -5859,23 +5784,8 @@
     }
     m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true );
-#if INTRA_BL
-    if(m_pcEncCfg->getLayerId())
-    {
-      m_pcEntropyCoder->encodeIntraBLFlag(pcCU, 0, true);
-#if !NO_RESIDUAL_FLAG_FOR_BLPRED
-      assert( pcCU->isIntraBL( 0 ) == false );
-#endif
-    }
-#endif
-#if NO_RESIDUAL_FLAG_FOR_BLPRED
-    if( !pcCU->isIntraBL(0))
-    {
-#endif
     m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
     m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
     m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
-#if NO_RESIDUAL_FLAG_FOR_BLPRED
-    }
-#endif
+
     Bool bDummy = false;
     m_pcEntropyCoder->encodeCoeff   ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy );
@@ -6295,58 +6205,3 @@
 #endif
 
-#if INTRA_BL
-Void 
-TEncSearch::estIntraBLPredQT( TComDataCU* pcCU, 
-                           TComYuv*    pcOrgYuv, 
-                           TComYuv*    pcPredYuv, 
-                           TComYuv*    pcResiYuv,
-                           TComYuv*    pcRecoYuv )
-{
-  UInt    uiDepth        = pcCU->getDepth(0);
-  UInt    uiOverallDistY = 0;
-  UInt    uiOverallDistC = 0;
-  
-  //===== set QP and clear Cbf =====
-  if ( pcCU->getSlice()->getPPS()->getUseDQP() == true)
-  {
-    pcCU->setQPSubParts( pcCU->getQP(0), 0, uiDepth );
-  }
-  else
-  {
-    pcCU->setQPSubParts( pcCU->getSlice()->getSliceQp(), 0, uiDepth );
-  }
-  
-  //===== init pattern for luma prediction =====
-  Bool bAboveAvail = false;
-  Bool bLeftAvail  = false;
-  pcCU->getPattern()->initPattern   ( pcCU, 0, 0 );
-  pcCU->getPattern()->initAdiPattern( pcCU, 0, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
-  
-  pcCU->setLumaIntraDirSubParts ( DC_IDX, 0, uiDepth );
-  
-  // set context models
-  if( m_bUseSBACRD )
-  {
-    m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );
-  }
-  
-  // determine residual for partition
-  Double dPUCost   = 0.0;
-  xRecurIntraCodingQT( pcCU, 0, 0, false, pcOrgYuv, pcPredYuv, pcResiYuv, uiOverallDistY, uiOverallDistC, false, dPUCost );
-  xSetIntraResultQT( pcCU, 0, 0, false, pcRecoYuv );
-  
-  //=== update PU data ====
-  pcCU->copyToPic( uiDepth, 0, 0 );
-   
-  //===== reset context models =====
-  if(m_bUseSBACRD)
-  {
-    m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]);
-  }
-
-  //===== set distortion (rate and r-d costs are determined later) =====
-  pcCU->getTotalDistortion() = uiOverallDistY + uiOverallDistC;
-}
-
-#endif
 //! \}
