Ignore:
Timestamp:
22 May 2012, 00:18:14 (12 years ago)
Author:
qualcomm
Message:

Integration of Qualcomm's m24938

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-3.0-Qualcomm/source/Lib/TLibCommon/TComResidualGenerator.cpp

    r62 r66  
    221221
    222222Bool
    223 TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv )
     223TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv
     224#if QC_SIMPLIFIEDIVRP_M24938
     225  , Bool bRecon
     226#endif
     227  )
    224228{
    225229  AOF(  pcCU );
     
    231235  iBlkHeight  = pcCU->getHeight ( 0 );
    232236  pcCU->getPic()->getPicYuvRec()->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iXPos, iYPos );
    233   return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv );
     237  return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv
     238#if QC_SIMPLIFIEDIVRP_M24938
     239    , bRecon
     240#endif
     241    );
    234242}
    235243 
    236244Bool
    237 TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv )
     245TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv
     246#if QC_SIMPLIFIEDIVRP_M24938
     247  , Bool bRecon
     248#endif
     249  )
    238250{
    239251  UInt  uiBaseViewId  = m_pcDepthMapGenerator->getBaseViewId( 0 );
     
    243255    pcYuv = m_ppcYuvTmp[1];
    244256  }
    245   xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv );
     257#if QC_SIMPLIFIEDIVRP_M24938
     258  UInt uiXPosInRefView = uiXPos , uiYPosInRefView = uiYPos;
     259#endif
     260  xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv
     261#if QC_SIMPLIFIEDIVRP_M24938
     262    , &uiXPosInRefView , &uiYPosInRefView , bRecon
     263#endif
     264    );
     265
     266#if QC_SIMPLIFIEDIVRP_M24938
     267  return xIsNonZeroByCBF( uiBaseViewId , uiXPosInRefView , uiYPosInRefView , uiBlkWidth , uiBlkHeight );
     268#else
    246269  return xIsNonZero( pcYuv, uiBlkWidth, uiBlkHeight );
    247 }
     270#endif
     271}
     272
     273#if QC_SIMPLIFIEDIVRP_M24938
     274Bool TComResidualGenerator::xIsNonZeroByCBF( UInt uiBaseViewId , UInt uiXPos , UInt uiYPos, UInt uiBlkWidth , UInt uiBlkHeight )
     275{
     276  TComPic* pcBasePic   = m_pcAUPicAccess->getPic( uiBaseViewId );
     277  const Int nMaxPicX = pcBasePic->getSPS()->getPicWidthInLumaSamples() - 1;
     278  const Int nMaxPicY = pcBasePic->getSPS()->getPicHeightInLumaSamples() - 1;
     279  for( UInt y = 0 ; y < uiBlkHeight ; y +=4 )
     280  {
     281    for( UInt x = 0 ; x <= uiBlkWidth ; x += 4 )
     282    {      // to cover both the mapped CU and the 1-pixel-right-shifted mapped CU
     283      Int iCuAddr = 0, iAbsZorderIdx = 0;
     284      pcBasePic->getPicYuvRec()->getCUAddrAndPartIdx( Min( uiXPos + x , nMaxPicX ) , Min( uiYPos + y , nMaxPicY ) , iCuAddr , iAbsZorderIdx );
     285      TComDataCU *pCUInRefView = pcBasePic->getCU( iCuAddr );
     286      if( pCUInRefView->isIntra( iAbsZorderIdx ) )
     287        // no inter-view residual pred from a intra CU
     288        continue;
     289      UInt uiTempTrDepth = pCUInRefView->getTransformIdx( iAbsZorderIdx );
     290      if( pCUInRefView->getCbf( iAbsZorderIdx , TEXT_LUMA , uiTempTrDepth )
     291        || pCUInRefView->getCbf( iAbsZorderIdx , TEXT_CHROMA_U , uiTempTrDepth )
     292        || pCUInRefView->getCbf( iAbsZorderIdx , TEXT_CHROMA_V , uiTempTrDepth ) )
     293        return( true );
     294    }
     295  }
     296
     297  return( false );
     298}
     299#endif
    248300
    249301
     
    364416  {
    365417    AOF( pcCU->getResPredAvail( 0 ) );
    366     Bool bOK = pcCU->getResidualSamples( 0, m_ppcYuvTmp[0] );
     418    Bool bOK = pcCU->getResidualSamples( 0,
     419#if QC_SIMPLIFIEDIVRP_M24938
     420      true,
     421#endif
     422      m_ppcYuvTmp[0] );
    367423    AOF( bOK );
    368424#if LG_RESTRICTEDRESPRED_M24766
     
    431487
    432488Void 
    433 TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv )
     489TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv
     490#if QC_SIMPLIFIEDIVRP_M24938
     491  , UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon
     492#endif
     493  )
    434494{
    435495  //===== set and check some basic variables =====
     
    464524  Pel*          pSrcSamplesY= pcBaseRes->getLumaAddr ( 0 ) + uiYPos * iSrcStrideY;
    465525  Pel*          pDesSamplesY= pcYuv    ->getLumaAddr ();
     526
     527#if QC_SIMPLIFIEDIVRP_M24938
     528  if( puiXPosInRefView != NULL )
     529    *puiXPosInRefView = Max( 0, Min( iYMaxPosX, iYRefPosX0 ) );
     530  if( puiYPosInRefView != NULL )
     531    *puiYPosInRefView = uiYPos;
     532  if( bRecon == false )
     533    return;
     534#endif
     535
    466536  for(   Int iY = 0; iY < iYHeight; iY++, pSrcSamplesY += iSrcStrideY, pDesSamplesY += iDesStrideY )
    467537  {
Note: See TracChangeset for help on using the changeset viewer.