Changeset 640 in SHVCSoftware


Ignore:
Timestamp:
22 Mar 2014, 23:15:23 (11 years ago)
Author:
seregin
Message:

non-normative software optimization provided by Auyeung, Cheung <Cheung.Auyeung@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-5.1-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp

    r638 r640  
    162162  UInt currLayerId = currSlice->getLayerId();
    163163  UInt refLayerId  = currSlice->getVPS()->getRefLayerId( currLayerId, refLayerIdc );
    164 
    165   if( scaleX == 65536 && scaleY == 65536 && g_bitDepthYLayer[currLayerId] == g_bitDepthYLayer[refLayerId] && g_bitDepthCLayer[currLayerId] == g_bitDepthCLayer[refLayerId] ) // ratio 1x
    166 #else
     164#endif
     165
     166  // non-normative software optimization for certain simple resampling cases
    167167  if( scaleX == 65536 && scaleY == 65536 ) // ratio 1x
    168 #endif
    169168  {
    170169    piSrcY = piSrcBufY;
    171170    piDstY = piDstBufY + scalEL.getWindowLeftOffset() + scalEL.getWindowTopOffset() * strideEL;
     171
     172#if O0194_JOINT_US_BITSHIFT
     173    Int shift = g_bitDepthYLayer[currLayerId] - g_bitDepthYLayer[refLayerId];
     174#endif
     175
    172176    for( i = 0; i < heightBL; i++ )
    173177    {
     178#if O0194_JOINT_US_BITSHIFT
     179      for( j = 0; j < widthBL; j++ )
     180      {
     181        piDstY[j] = piSrcY[j] << shift;
     182      }
     183#else
    174184      memcpy( piDstY, piSrcY, sizeof(Pel) * widthBL );
     185#endif
    175186      piSrcY += strideBL;
    176187      piDstY += strideEL;
     
    183194    heightBL >>= 1;
    184195
    185     strideBL  = pcBasePic->getCStride();
    186     strideEL  = pcUsPic->getCStride();
     196    strideBL = pcBasePic->getCStride();
     197    strideEL = pcUsPic->getCStride();
    187198
    188199    piSrcU = piSrcBufU;
     
    192203    piDstV = piDstBufV + ( scalEL.getWindowLeftOffset() >> 1 ) + ( scalEL.getWindowTopOffset() >> 1 ) * strideEL;
    193204
     205#if O0194_JOINT_US_BITSHIFT
     206    shift = g_bitDepthCLayer[currLayerId] - g_bitDepthCLayer[refLayerId];
     207#endif
     208
    194209    for( i = 0; i < heightBL; i++ )
    195210    {
     211#if O0194_JOINT_US_BITSHIFT
     212      for( j = 0; j < widthBL; j++ )
     213      {
     214        piDstU[j] = piSrcU[j] << shift;
     215        piDstV[j] = piSrcV[j] << shift;
     216      }
     217#else
    196218      memcpy( piDstU, piSrcU, sizeof(Pel) * widthBL );
    197219      memcpy( piDstV, piSrcV, sizeof(Pel) * widthBL );
     220#endif
    198221      piSrcU += strideBL;
    199222      piSrcV += strideBL;
     
    202225    }
    203226  }
    204   else
     227  else // general resampling process
    205228  {
    206229    Int refPos16 = 0;
     
    223246
    224247    pcBasePic->setBorderExtension(false);
    225     pcBasePic->extendPicBorder   (); // extend the border.
     248    pcBasePic->extendPicBorder(); // extend the border.
    226249
    227250    Int   shiftX = 16;
     
    270293    Int leftOffset = leftStartL > 0 ? leftStartL : 0;
    271294
    272 #if  N0214_INTERMEDIATE_BUFFER_16BITS
     295#if N0214_INTERMEDIATE_BUFFER_16BITS
    273296#if O0194_JOINT_US_BITSHIFT
    274297    // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth
     
    293316      for( j = 0; j < heightBL ; j++ )
    294317      {
    295 #if  N0214_INTERMEDIATE_BUFFER_16BITS
     318#if N0214_INTERMEDIATE_BUFFER_16BITS
    296319        *piDstY = sumLumaHor(piSrcY, coeff) >> shift1;
    297320#else
     
    309332    pcTempPic->setHeight(heightEL);
    310333
    311 #if  N0214_INTERMEDIATE_BUFFER_16BITS
     334#if N0214_INTERMEDIATE_BUFFER_16BITS
    312335#if O0194_JOINT_US_BITSHIFT
    313336    Int nShift = 20 - g_bitDepthYLayer[currLayerId];
     
    417440    heightBL  = min<Int>( pcBasePic->getHeight() >> 1, heightEL );
    418441
    419 #if  N0214_INTERMEDIATE_BUFFER_16BITS
     442#if N0214_INTERMEDIATE_BUFFER_16BITS
    420443#if O0194_JOINT_US_BITSHIFT
    421444    // g_bitDepthC was set to EL bit-depth, but shift1 should be calculated using BL bit-depth
     
    442465      for( j = 0; j < heightBL ; j++ )
    443466      {
    444 #if  N0214_INTERMEDIATE_BUFFER_16BITS
     467#if N0214_INTERMEDIATE_BUFFER_16BITS
    445468        *piDstU = sumChromaHor(piSrcU, coeff) >> shift1;
    446469        *piDstV = sumChromaHor(piSrcV, coeff) >> shift1;
     
    463486    pcTempPic->setHeight(heightEL << 1);
    464487
    465 #if  N0214_INTERMEDIATE_BUFFER_16BITS
     488#if N0214_INTERMEDIATE_BUFFER_16BITS
    466489#if O0194_JOINT_US_BITSHIFT
    467490    nShift = 20 - g_bitDepthCLayer[currLayerId];
Note: See TracChangeset for help on using the changeset viewer.