Changeset 345 in SHVCSoftware for trunk/source/Lib/TLibEncoder/TEncSearch.cpp


Ignore:
Timestamp:
17 Aug 2013, 06:27:19 (11 years ago)
Author:
seregin
Message:

merge SHM-3.0-dev branch

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r313 r345  
    906906        m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
    907907      }
    908 #if INTRA_BL
    909       m_pcEntropyCoder->encodeIntraBLFlag ( pcCU, 0, true );
    910       if( pcCU->isIntraBL( 0 ) )
    911       {
    912         return;
    913       }
    914 #endif     
     908   
    915909      m_pcEntropyCoder  ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
    916910
     
    950944    }
    951945  }
    952 #if INTRA_BL
    953   if( pcCU->isIntraBL( 0 ) )
    954   {
    955     return;
    956   }
    957 #endif
     946
    958947  if( bChroma )
    959948  {
     
    10551044    pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, uiTrDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
    10561045    //===== get prediction signal =====
    1057 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED
    1058     if(pcCU->isIntraBL ( uiAbsPartIdx ) )
    1059     {
    1060       pcCU->getBaseLumaBlk( uiWidth, uiHeight, uiAbsPartIdx, piPred, uiStride );
    1061     }
    1062     else
    1063 #endif
    10641046    predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
    10651047    // save prediction
     
    12471229
    12481230    //===== get prediction signal =====
    1249 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED
    1250   if(pcCU->isIntraBL ( uiAbsPartIdx ) )
    1251   {
    1252     pcCU->getBaseChromaBlk( uiWidth, uiHeight, uiAbsPartIdx, piPred, uiStride, uiChromaId );
    1253   }
    1254   else
    1255 #endif
    1256     {
    1257       predIntraChromaAng( pPatChroma, uiChromaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
    1258     }
     1231    predIntraChromaAng( pPatChroma, uiChromaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
     1232
    12591233    // save prediction
    12601234    if( default0Save1Load2 == 1 )
     
    45674541Void TEncSearch::encodeResAndCalcRdInterCU( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* pcYuvPred, TComYuv*& rpcYuvResi, TComYuv*& rpcYuvResiBest, TComYuv*& rpcYuvRec, Bool bSkipRes )
    45684542{
    4569 #if NO_RESIDUAL_FLAG_FOR_BLPRED
    4570   if ( pcCU->isIntra(0) && !pcCU->isIntraBL(0))
    4571 #else
    45724543  if ( pcCU->isIntra(0) )
    4573 #endif
    45744544  {
    45754545    return;
     
    46824652      pcCU->setTransformSkipSubParts ( 0, 0, 0, 0, pcCU->getDepth(0) );
    46834653    }
    4684 #if NO_RESIDUAL_FLAG_FOR_BLPRED
    4685     else if(pcCU->getLayerId() > 0 && pcCU->isIntraBL(0) && uiZeroDistortion == uiDistortion) // all zeros
    4686     {
    4687       const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (pcCU->getDepth(0) << 1);
    4688       ::memset( pcCU->getTransformIdx()      , 0, uiQPartNum * sizeof(UChar) );
    4689       ::memset( pcCU->getCbf( TEXT_LUMA )    , 0, uiQPartNum * sizeof(UChar) );
    4690       ::memset( pcCU->getCbf( TEXT_CHROMA_U ), 0, uiQPartNum * sizeof(UChar) );
    4691       ::memset( pcCU->getCbf( TEXT_CHROMA_V ), 0, uiQPartNum * sizeof(UChar) );
    4692       ::memset( pcCU->getCoeffY()            , 0, uiWidth * uiHeight * sizeof( TCoeff )      );
    4693       ::memset( pcCU->getCoeffCb()           , 0, uiWidth * uiHeight * sizeof( TCoeff ) >> 2 );
    4694       ::memset( pcCU->getCoeffCr()           , 0, uiWidth * uiHeight * sizeof( TCoeff ) >> 2 );
    4695       pcCU->setTransformSkipSubParts ( 0, 0, 0, 0, pcCU->getDepth(0) );
    4696     }
    4697 #endif
    46984654    else
    46994655    {
     
    49944950      Int scalingListType = 3 + g_eTTable[(Int)TEXT_LUMA];
    49954951      assert(scalingListType < 6);     
    4996 #if NO_RESIDUAL_FLAG_FOR_BLPRED
    4997       if(pcCU->isIntraBL(uiAbsPartIdx) )
    4998       {
    4999         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
    5000       }
    5001       else
    5002       {
    5003         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
    5004       }
    5005 #else
    50064952      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
    5007 #endif
    5008      
    50094953      const UInt uiNonzeroDistY = m_pcRdCost->getDistPart(g_bitDepthY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( absTUPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),
    50104954      pcResi->getLumaAddr( absTUPartIdx ), pcResi->getStride(), trWidth,trHeight );
     
    52755219        assert(scalingListType < 6);     
    52765220
    5277 #if NO_RESIDUAL_FLAG_FOR_BLPRED
    5278         if(pcCU->isIntraBL(uiAbsPartIdx) )
    5279         {
    5280           m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,DC_IDX, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType, true );
    5281         }
    5282         else
    5283         {
    5284           m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType, true );
    5285         }
    5286 #else
    52875221        m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType, true );
    5288 #endif
    52895222
    52905223        uiNonzeroDistY = m_pcRdCost->getDistPart(g_bitDepthY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( absTUPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),
     
    56175550
    56185551  {
    5619 #if INTRA_BL
    5620 #if NO_RESIDUAL_FLAG_FOR_BLPRED
    5621     assert( !pcCU->isIntra(uiAbsPartIdx) || pcCU->isIntraBL(uiAbsPartIdx));
    5622 #else
    5623     assert( !pcCU->isIntra(uiAbsPartIdx) );
    5624 #endif
    5625 #else
    56265552    assert( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA );
    5627 #endif
    56285553    if( bSubdivAndCbf )
    56295554    {
     
    58595784    }
    58605785    m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true );
    5861 #if INTRA_BL
    5862     if(m_pcEncCfg->getLayerId())
    5863     {
    5864       m_pcEntropyCoder->encodeIntraBLFlag(pcCU, 0, true);
    5865 #if !NO_RESIDUAL_FLAG_FOR_BLPRED
    5866       assert( pcCU->isIntraBL( 0 ) == false );
    5867 #endif
    5868     }
    5869 #endif
    5870 #if NO_RESIDUAL_FLAG_FOR_BLPRED
    5871     if( !pcCU->isIntraBL(0))
    5872     {
    5873 #endif
    58745786    m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
    58755787    m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
    58765788    m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
    5877 #if NO_RESIDUAL_FLAG_FOR_BLPRED
    5878     }
    5879 #endif
     5789
    58805790    Bool bDummy = false;
    58815791    m_pcEntropyCoder->encodeCoeff   ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy );
     
    62956205#endif
    62966206
    6297 #if INTRA_BL
    6298 Void
    6299 TEncSearch::estIntraBLPredQT( TComDataCU* pcCU,
    6300                            TComYuv*    pcOrgYuv,
    6301                            TComYuv*    pcPredYuv,
    6302                            TComYuv*    pcResiYuv,
    6303                            TComYuv*    pcRecoYuv )
    6304 {
    6305   UInt    uiDepth        = pcCU->getDepth(0);
    6306   UInt    uiOverallDistY = 0;
    6307   UInt    uiOverallDistC = 0;
    6308  
    6309   //===== set QP and clear Cbf =====
    6310   if ( pcCU->getSlice()->getPPS()->getUseDQP() == true)
    6311   {
    6312     pcCU->setQPSubParts( pcCU->getQP(0), 0, uiDepth );
    6313   }
    6314   else
    6315   {
    6316     pcCU->setQPSubParts( pcCU->getSlice()->getSliceQp(), 0, uiDepth );
    6317   }
    6318  
    6319   //===== init pattern for luma prediction =====
    6320   Bool bAboveAvail = false;
    6321   Bool bLeftAvail  = false;
    6322   pcCU->getPattern()->initPattern   ( pcCU, 0, 0 );
    6323   pcCU->getPattern()->initAdiPattern( pcCU, 0, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
    6324  
    6325   pcCU->setLumaIntraDirSubParts ( DC_IDX, 0, uiDepth );
    6326  
    6327   // set context models
    6328   if( m_bUseSBACRD )
    6329   {
    6330     m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );
    6331   }
    6332  
    6333   // determine residual for partition
    6334   Double dPUCost   = 0.0;
    6335   xRecurIntraCodingQT( pcCU, 0, 0, false, pcOrgYuv, pcPredYuv, pcResiYuv, uiOverallDistY, uiOverallDistC, false, dPUCost );
    6336   xSetIntraResultQT( pcCU, 0, 0, false, pcRecoYuv );
    6337  
    6338   //=== update PU data ====
    6339   pcCU->copyToPic( uiDepth, 0, 0 );
    6340    
    6341   //===== reset context models =====
    6342   if(m_bUseSBACRD)
    6343   {
    6344     m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]);
    6345   }
    6346 
    6347   //===== set distortion (rate and r-d costs are determined later) =====
    6348   pcCU->getTotalDistortion() = uiOverallDistY + uiOverallDistC;
    6349 }
    6350 
    6351 #endif
    63526207//! \}
Note: See TracChangeset for help on using the changeset viewer.