Changeset 21 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComYuv.cpp


Ignore:
Timestamp:
15 Feb 2012, 19:05:04 (13 years ago)
Author:
hschwarz
Message:

updated with HHI branch (0.2-HHI)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TComYuv.cpp

    r5 r21  
    300300}
    301301
     302#if DEPTH_MAP_GENERATION
     303Void TComYuv::copyPartToPartYuvPdm   ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt iWidth, UInt iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY )
     304{
     305  copyPartToPartLumaPdm   (pcYuvDst, uiPartIdx, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY );
     306}
     307#endif
     308   
    302309Void TComYuv::copyPartToPartYuv   ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt iWidth, UInt iHeight )
    303310{
     
    305312  copyPartToPartChroma (pcYuvDst, uiPartIdx, iWidth>>1, iHeight>>1 );
    306313}
     314
     315#if DEPTH_MAP_GENERATION
     316Void TComYuv::copyPartToPartLumaPdm  ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt iWidth, UInt iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY )
     317{
     318  UInt uiBlkX = g_auiRasterToPelX[ g_auiZscanToRaster[ uiPartIdx ] ] >> uiSubSampExpX;
     319  UInt uiBlkY = g_auiRasterToPelY[ g_auiZscanToRaster[ uiPartIdx ] ] >> uiSubSampExpY;
     320  Pel* pSrc   = getLumaAddr(uiPartIdx);
     321  Pel* pDst   = pcYuvDst->getLumaAddr() + uiBlkY * pcYuvDst->getStride() + uiBlkX;
     322 
     323  if( pSrc == pDst )
     324  {
     325    //th not a good idea
     326    //th best would be to fix the caller
     327    return ;
     328  }
     329 
     330  UInt  iSrcStride = getStride();
     331  UInt  iDstStride = pcYuvDst->getStride();
     332  for ( UInt y = iHeight; y != 0; y-- )
     333  {
     334    ::memcpy( pDst, pSrc, iWidth * sizeof(Pel) );
     335    pSrc += iSrcStride;
     336    pDst += iDstStride;
     337  }
     338}
     339#endif
    307340
    308341Void TComYuv::copyPartToPartLuma  ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt iWidth, UInt iHeight )
     
    801834}
    802835
     836#if DEPTH_MAP_GENERATION
     837Void TComYuv::addAvgPdm( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iWidth, UInt iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY )
     838{
     839  Int x, y;
     840
     841  UInt uiBlkX  = g_auiRasterToPelX[ g_auiZscanToRaster[ iPartUnitIdx ] ] >> uiSubSampExpX;
     842  UInt uiBlkY  = g_auiRasterToPelY[ g_auiZscanToRaster[ iPartUnitIdx ] ] >> uiSubSampExpY;
     843  Pel* pSrcY0  = pcYuvSrc0->getLumaAddr( iPartUnitIdx );
     844  Pel* pSrcY1  = pcYuvSrc1->getLumaAddr( iPartUnitIdx );
     845  Pel* pDstY   = getLumaAddr() + uiBlkY * getStride() + uiBlkX;
     846 
     847  UInt  iSrc0Stride = pcYuvSrc0->getStride();
     848  UInt  iSrc1Stride = pcYuvSrc1->getStride();
     849  UInt  iDstStride  = getStride();
     850
     851  for ( y = iHeight-1; y >= 0; y-- )
     852  {
     853    for ( x = iWidth-1; x >= 0; x-- )
     854    {
     855      pDstY[x] = (pSrcY0[x] + pSrcY1[x] + 1) >> 1;
     856    }
     857    pSrcY0 += iSrc0Stride;
     858    pSrcY1 += iSrc1Stride;
     859    pDstY  += iDstStride;
     860  }
     861}
     862#endif
     863
     864
    803865Void TComYuv::removeHighFreq( TComYuv* pcYuvSrc, UInt uiWidht, UInt uiHeight )
    804866{
Note: See TracChangeset for help on using the changeset viewer.