Changeset 237 in SHVCSoftware for branches/SHM-2.1-dev/source


Ignore:
Timestamp:
24 May 2013, 00:30:48 (12 years ago)
Author:
seregin
Message:

code formating

File:
1 edited

Legend:

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

    r236 r237  
    110110  Pel* piSrcBufY  = pcBasePic->getLumaAddr();
    111111  Pel* piDstBufY  = pcUsPic->getLumaAddr();
    112  
     112
    113113  Pel* piSrcY;
    114114  Pel* piDstY;
    115  
     115
    116116  Pel* piTempBufU = pcTempPic->getCbAddr();
    117117  Pel* piSrcBufU  = pcBasePic->getCbAddr();
    118118  Pel* piDstBufU  = pcUsPic->getCbAddr();
    119  
     119
    120120  Pel* piTempBufV = pcTempPic->getCrAddr();
    121121  Pel* piSrcBufV  = pcBasePic->getCrAddr();
    122122  Pel* piDstBufV  = pcUsPic->getCrAddr();
    123  
     123
    124124  Pel* piSrcU;
    125125  Pel* piDstU;
     
    165165  else
    166166  {
    167   Int refPos16 = 0;
    168   Int phase    = 0;
    169   Int refPos   = 0;
    170   Int* coeff = m_chromaFilter[phase];
    171   for ( i = 0; i < 16; i++)
    172   {
    173     memcpy(   m_lumaFilter[i],   m_lumaFixedFilter[i], sizeof(Int) * NTAPS_US_LUMA   );
    174     memcpy( m_chromaFilter[i], m_chromaFixedFilter[i], sizeof(Int) * NTAPS_US_CHROMA );
    175   }
    176 
    177   assert ( widthEL == widthBL || widthEL == 2*widthBL || 2*widthEL == 3*widthBL );
    178   assert ( heightEL == heightBL || heightEL == 2*heightBL || 2*heightEL == 3*heightBL );
    179  
    180   pcBasePic->setBorderExtension(false);
    181   pcBasePic->extendPicBorder   (); // extend the border.
    182 
    183   Int   shiftX = 16;
    184   Int   shiftY = 16;
    185 
    186   Int   phaseX = 0;
    187   Int   phaseY = 0;
    188 
    189   Int   addX       = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
    190   Int   addY       = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
    191 
    192   Int   deltaX     = 4 * phaseX;
    193   Int   deltaY     = 4 * phaseY; 
    194  
    195   Int shiftXM4 = shiftX - 4;
    196   Int shiftYM4 = shiftY - 4;
    197 
    198   Int   scaleX     = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL;
    199   Int   scaleY     = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL;
     167    Int refPos16 = 0;
     168    Int phase    = 0;
     169    Int refPos   = 0;
     170    Int* coeff = m_chromaFilter[phase];
     171    for ( i = 0; i < 16; i++)
     172    {
     173      memcpy(   m_lumaFilter[i],   m_lumaFixedFilter[i], sizeof(Int) * NTAPS_US_LUMA   );
     174      memcpy( m_chromaFilter[i], m_chromaFixedFilter[i], sizeof(Int) * NTAPS_US_CHROMA );
     175    }
     176
     177    assert ( widthEL == widthBL || widthEL == 2*widthBL || 2*widthEL == 3*widthBL );
     178    assert ( heightEL == heightBL || heightEL == 2*heightBL || 2*heightEL == 3*heightBL );
     179
     180    pcBasePic->setBorderExtension(false);
     181    pcBasePic->extendPicBorder   (); // extend the border.
     182
     183    Int   shiftX = 16;
     184    Int   shiftY = 16;
     185
     186    Int   phaseX = 0;
     187    Int   phaseY = 0;
     188
     189    Int   addX       = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
     190    Int   addY       = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
     191
     192    Int   deltaX     = 4 * phaseX;
     193    Int   deltaY     = 4 * phaseY; 
     194
     195    Int shiftXM4 = shiftX - 4;
     196    Int shiftYM4 = shiftY - 4;
     197
     198    Int   scaleX     = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL;
     199    Int   scaleY     = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL;
    200200
    201201#if ILP_DECODED_PICTURE
    202   widthEL   = pcUsPic->getWidth ();
    203   heightEL  = pcUsPic->getHeight();
    204 
    205   widthBL   = pcBasePic->getWidth ();
    206   heightBL  = min<Int>( pcBasePic->getHeight(), heightEL );
    207 #endif
    208 #if SCALED_REF_LAYER_OFFSETS
    209   Int leftStartL = scalEL.getWindowLeftOffset();
    210   Int rightEndL  = pcUsPic->getWidth() - scalEL.getWindowRightOffset();
    211   Int topStartL  = scalEL.getWindowTopOffset();
    212   Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset();
    213 #endif
    214 
    215   //========== horizontal upsampling ===========
    216   for( i = 0; i < widthEL; i++ )
    217   {
    218 #if SCALED_REF_LAYER_OFFSETS
    219     Int x = Clip3( leftStartL, rightEndL - 1, i );
    220     refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX;
    221 #else
    222     refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX;
    223 #endif
    224     phase    = refPos16 & 15;
    225     refPos   = refPos16 >> 4;
    226     coeff = m_lumaFilter[phase];
    227 
    228     piSrcY = piSrcBufY + refPos -((NTAPS_US_LUMA>>1) - 1);
    229     piDstY = piTempBufY + i;
    230 
    231     for( j = 0; j < heightBL ; j++ )
    232     {
    233       *piDstY = sumLumaHor(piSrcY, coeff);
    234       piSrcY += strideBL;
    235       piDstY += strideEL;
    236     }
    237   }
    238 
    239 
    240   //========== vertical upsampling ===========
    241   pcTempPic->setBorderExtension(false);
    242   pcTempPic->setHeight(heightBL);
    243   pcTempPic->extendPicBorder   (); // extend the border.
    244   pcTempPic->setHeight(heightEL);
    245 
    246   const Int nShift = US_FILTER_PREC*2;
    247   Int iOffset = 1 << (nShift - 1);
    248 
    249 #if SCALED_REF_LAYER_OFFSETS
    250   for( j = 0; j < pcTempPic->getHeight(); j++ )
    251 #else
    252   for( j = 0; j < heightEL; j++ )
    253 #endif
    254   {
    255 #if SCALED_REF_LAYER_OFFSETS
    256     Int y = Clip3(topStartL, bottomEndL - 1, j);
    257     refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY;
    258 #else
    259     refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY;
    260 #endif
    261     phase    = refPos16 & 15;
    262     refPos   = refPos16 >> 4;
    263     coeff = m_lumaFilter[phase];
    264 
    265     piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL;
    266     piDstY = piDstBufY + j * strideEL;
    267 #if SCALED_REF_LAYER_OFFSETS
    268     for( i = 0; i < pcTempPic->getWidth(); i++ )
    269 #else
     202    widthEL   = pcUsPic->getWidth ();
     203    heightEL  = pcUsPic->getHeight();
     204
     205    widthBL   = pcBasePic->getWidth ();
     206    heightBL  = min<Int>( pcBasePic->getHeight(), heightEL );
     207#endif
     208#if SCALED_REF_LAYER_OFFSETS
     209    Int leftStartL = scalEL.getWindowLeftOffset();
     210    Int rightEndL  = pcUsPic->getWidth() - scalEL.getWindowRightOffset();
     211    Int topStartL  = scalEL.getWindowTopOffset();
     212    Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset();
     213#endif
     214
     215    //========== horizontal upsampling ===========
    270216    for( i = 0; i < widthEL; i++ )
    271 #endif
    272     {
    273       *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift));
    274 #if SCALED_REF_LAYER_OFFSETS
    275       // Only increase the x position of reference upsample picture when within the window
    276       // "-2" to ensure that pointer doesn't go beyond the boundary rightEndL-1
    277       if( (i >= leftStartL) && (i <= rightEndL-2) )
     217    {
     218#if SCALED_REF_LAYER_OFFSETS
     219      Int x = Clip3( leftStartL, rightEndL - 1, i );
     220      refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX;
     221#else
     222      refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX;
     223#endif
     224      phase    = refPos16 & 15;
     225      refPos   = refPos16 >> 4;
     226      coeff = m_lumaFilter[phase];
     227
     228      piSrcY = piSrcBufY + refPos -((NTAPS_US_LUMA>>1) - 1);
     229      piDstY = piTempBufY + i;
     230
     231      for( j = 0; j < heightBL ; j++ )
    278232      {
     233        *piDstY = sumLumaHor(piSrcY, coeff);
     234        piSrcY += strideBL;
     235        piDstY += strideEL;
     236      }
     237    }
     238
     239
     240    //========== vertical upsampling ===========
     241    pcTempPic->setBorderExtension(false);
     242    pcTempPic->setHeight(heightBL);
     243    pcTempPic->extendPicBorder   (); // extend the border.
     244    pcTempPic->setHeight(heightEL);
     245
     246    const Int nShift = US_FILTER_PREC*2;
     247    Int iOffset = 1 << (nShift - 1);
     248
     249#if SCALED_REF_LAYER_OFFSETS
     250    for( j = 0; j < pcTempPic->getHeight(); j++ )
     251#else
     252    for( j = 0; j < heightEL; j++ )
     253#endif
     254    {
     255#if SCALED_REF_LAYER_OFFSETS
     256      Int y = Clip3(topStartL, bottomEndL - 1, j);
     257      refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY;
     258#else
     259      refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY;
     260#endif
     261      phase    = refPos16 & 15;
     262      refPos   = refPos16 >> 4;
     263      coeff = m_lumaFilter[phase];
     264
     265      piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL;
     266      piDstY = piDstBufY + j * strideEL;
     267#if SCALED_REF_LAYER_OFFSETS
     268      for( i = 0; i < pcTempPic->getWidth(); i++ )
     269#else
     270      for( i = 0; i < widthEL; i++ )
     271#endif
     272      {
     273        *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift));
     274#if SCALED_REF_LAYER_OFFSETS
     275        // Only increase the x position of reference upsample picture when within the window
     276        // "-2" to ensure that pointer doesn't go beyond the boundary rightEndL-1
     277        if( (i >= leftStartL) && (i <= rightEndL-2) )
     278        {
     279          piSrcY++;
     280        }
     281#else
    279282        piSrcY++;
     283#endif
     284        piDstY++;
    280285      }
    281 #else
    282       piSrcY++;
    283 #endif
    284       piDstY++;
    285     }
    286   }
     286    }
    287287
    288288#if ILP_DECODED_PICTURE
    289289#if SCALED_REF_LAYER_OFFSETS
    290   widthBL   = pcBasePic->getWidth ();
    291   heightBL  = pcBasePic->getHeight();
    292 
    293   widthEL   = pcUsPic->getWidth () - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
    294   heightEL  = pcUsPic->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
    295 #else
    296   widthBL   = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
    297   heightBL  = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
    298 
    299   widthEL   = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
    300   heightEL  = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
    301 #endif
    302 #endif
    303 
    304   //========== UV component upsampling ===========
    305 
    306   widthEL  >>= 1;
    307   heightEL >>= 1;
    308 
    309   widthBL  >>= 1;
    310   heightBL >>= 1;
    311 
    312   strideBL  = pcBasePic->getCStride();
    313   strideEL  = pcUsPic->getCStride();
    314 #if SCALED_REF_LAYER_OFFSETS
    315   Int leftStartC = scalEL.getWindowLeftOffset() >> 1;
    316   Int rightEndC  = (pcUsPic->getWidth() >> 1) - (scalEL.getWindowRightOffset() >> 1);
    317   Int topStartC  = scalEL.getWindowTopOffset() >> 1;
    318   Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1);
    319 #endif
    320 
    321   shiftX = 16;
    322   shiftY = 16;
    323 
    324   phaseX = 0;
    325   phaseY = 1;
    326 
    327   addX       = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
    328   addY       = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
    329 
    330   deltaX     = 4 * phaseX;
    331   deltaY     = 4 * phaseY;
    332 
    333   shiftXM4 = shiftX - 4;
    334   shiftYM4 = shiftY - 4;
    335 
    336   scaleX     = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL;
    337   scaleY     = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL;
     290    widthBL   = pcBasePic->getWidth ();
     291    heightBL  = pcBasePic->getHeight();
     292
     293    widthEL   = pcUsPic->getWidth () - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
     294    heightEL  = pcUsPic->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
     295#else
     296    widthBL   = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
     297    heightBL  = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
     298
     299    widthEL   = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
     300    heightEL  = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
     301#endif
     302#endif
     303
     304    //========== UV component upsampling ===========
     305
     306    widthEL  >>= 1;
     307    heightEL >>= 1;
     308
     309    widthBL  >>= 1;
     310    heightBL >>= 1;
     311
     312    strideBL  = pcBasePic->getCStride();
     313    strideEL  = pcUsPic->getCStride();
     314#if SCALED_REF_LAYER_OFFSETS
     315    Int leftStartC = scalEL.getWindowLeftOffset() >> 1;
     316    Int rightEndC  = (pcUsPic->getWidth() >> 1) - (scalEL.getWindowRightOffset() >> 1);
     317    Int topStartC  = scalEL.getWindowTopOffset() >> 1;
     318    Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1);
     319#endif
     320
     321    shiftX = 16;
     322    shiftY = 16;
     323
     324    phaseX = 0;
     325    phaseY = 1;
     326
     327    addX       = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
     328    addY       = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
     329
     330    deltaX     = 4 * phaseX;
     331    deltaY     = 4 * phaseY;
     332
     333    shiftXM4 = shiftX - 4;
     334    shiftYM4 = shiftY - 4;
     335
     336    scaleX     = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL;
     337    scaleY     = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL;
    338338
    339339#if ILP_DECODED_PICTURE
    340   widthEL   = pcUsPic->getWidth () >> 1;
    341   heightEL  = pcUsPic->getHeight() >> 1;
    342 
    343   widthBL   = pcBasePic->getWidth () >> 1;
    344   heightBL  = min<Int>( pcBasePic->getHeight(), heightEL );
    345 #endif
    346 
    347   //========== horizontal upsampling ===========
    348   for( i = 0; i < widthEL; i++ )
    349   {
    350 #if SCALED_REF_LAYER_OFFSETS
    351     Int x = Clip3(leftStartC, rightEndC - 1, i);
    352     refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX;
    353 #else
    354     refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX;
    355 #endif
    356     phase    = refPos16 & 15;
    357     refPos   = refPos16 >> 4;
    358     coeff = m_chromaFilter[phase];
    359 
    360     piSrcU = piSrcBufU + refPos -((NTAPS_US_CHROMA>>1) - 1);
    361     piSrcV = piSrcBufV + refPos -((NTAPS_US_CHROMA>>1) - 1);
    362     piDstU = piTempBufU + i;
    363     piDstV = piTempBufV + i;
    364 
    365     for( j = 0; j < heightBL ; j++ )
    366     {
    367       *piDstU = sumChromaHor(piSrcU, coeff);
    368       *piDstV = sumChromaHor(piSrcV, coeff);
    369 
    370       piSrcU += strideBL;
    371       piSrcV += strideBL;
    372       piDstU += strideEL;
    373       piDstV += strideEL;
    374     }
    375   }
    376 
    377   //========== vertical upsampling ===========
    378   pcTempPic->setBorderExtension(false);
    379   pcTempPic->setHeight(heightBL << 1);
    380   pcTempPic->extendPicBorder   (); // extend the border.
    381   pcTempPic->setHeight(heightEL << 1);
    382 
    383 #if SCALED_REF_LAYER_OFFSETS
    384   for( j = 0; j < pcTempPic->getHeight() >> 1; j++ )
     340    widthEL   = pcUsPic->getWidth () >> 1;
     341    heightEL  = pcUsPic->getHeight() >> 1;
     342
     343    widthBL   = pcBasePic->getWidth () >> 1;
     344    heightBL  = min<Int>( pcBasePic->getHeight(), heightEL );
     345#endif
     346
     347    //========== horizontal upsampling ===========
     348    for( i = 0; i < widthEL; i++ )
     349    {
     350#if SCALED_REF_LAYER_OFFSETS
     351      Int x = Clip3(leftStartC, rightEndC - 1, i);
     352      refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX;
     353#else
     354      refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX;
     355#endif
     356      phase    = refPos16 & 15;
     357      refPos   = refPos16 >> 4;
     358      coeff = m_chromaFilter[phase];
     359
     360      piSrcU = piSrcBufU + refPos -((NTAPS_US_CHROMA>>1) - 1);
     361      piSrcV = piSrcBufV + refPos -((NTAPS_US_CHROMA>>1) - 1);
     362      piDstU = piTempBufU + i;
     363      piDstV = piTempBufV + i;
     364
     365      for( j = 0; j < heightBL ; j++ )
     366      {
     367        *piDstU = sumChromaHor(piSrcU, coeff);
     368        *piDstV = sumChromaHor(piSrcV, coeff);
     369
     370        piSrcU += strideBL;
     371        piSrcV += strideBL;
     372        piDstU += strideEL;
     373        piDstV += strideEL;
     374      }
     375    }
     376
     377    //========== vertical upsampling ===========
     378    pcTempPic->setBorderExtension(false);
     379    pcTempPic->setHeight(heightBL << 1);
     380    pcTempPic->extendPicBorder   (); // extend the border.
     381    pcTempPic->setHeight(heightEL << 1);
     382
     383#if SCALED_REF_LAYER_OFFSETS
     384    for( j = 0; j < pcTempPic->getHeight() >> 1; j++ )
    385385#else
    386386    for( j = 0; j < heightEL; j++ )
    387387#endif
    388   {
    389 #if SCALED_REF_LAYER_OFFSETS
    390     Int y = Clip3(topStartC, bottomEndC - 1, j);
    391     refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY;
    392 #else
    393     refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY;
    394 #endif
    395     phase    = refPos16 & 15;
    396     refPos   = refPos16 >> 4;
    397     coeff = m_chromaFilter[phase];
    398 
    399     piSrcU = piTempBufU  + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL;
    400     piSrcV = piTempBufV  + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL;
    401 
    402     piDstU = piDstBufU + j*strideEL;
    403     piDstV = piDstBufV + j*strideEL;
    404 
    405 #if SCALED_REF_LAYER_OFFSETS
    406     for( i = 0; i < pcTempPic->getWidth() >> 1; i++ )
    407 #else
    408     for( i = 0; i < widthEL; i++ )
    409 #endif
    410     {
    411       *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift));
    412       *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift));
    413 
    414 #if SCALED_REF_LAYER_OFFSETS
    415       // Only increase the x position of reference upsample picture when within the window
    416       // "-2" to ensure that pointer doesn't go beyond the boundary rightEndC-1
    417       if( (i >= leftStartC) && (i <= rightEndC-2) )
     388    {
     389#if SCALED_REF_LAYER_OFFSETS
     390      Int y = Clip3(topStartC, bottomEndC - 1, j);
     391      refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY;
     392#else
     393      refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY;
     394#endif
     395      phase    = refPos16 & 15;
     396      refPos   = refPos16 >> 4;
     397      coeff = m_chromaFilter[phase];
     398
     399      piSrcU = piTempBufU  + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL;
     400      piSrcV = piTempBufV  + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL;
     401
     402      piDstU = piDstBufU + j*strideEL;
     403      piDstV = piDstBufV + j*strideEL;
     404
     405#if SCALED_REF_LAYER_OFFSETS
     406      for( i = 0; i < pcTempPic->getWidth() >> 1; i++ )
     407#else
     408      for( i = 0; i < widthEL; i++ )
     409#endif
    418410      {
     411        *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift));
     412        *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift));
     413
     414#if SCALED_REF_LAYER_OFFSETS
     415        // Only increase the x position of reference upsample picture when within the window
     416        // "-2" to ensure that pointer doesn't go beyond the boundary rightEndC-1
     417        if( (i >= leftStartC) && (i <= rightEndC-2) )
     418        {
     419          piSrcU++;
     420          piSrcV++;
     421        }
     422#else
    419423        piSrcU++;
    420424        piSrcV++;
     425#endif
     426        piDstU++;
     427        piDstV++;
    421428      }
    422 #else
    423       piSrcU++;
    424       piSrcV++;
    425 #endif
    426       piDstU++;
    427       piDstV++;
    428     }
    429   }
    430 
    431   pcUsPic->setBorderExtension(false);
    432   pcUsPic->extendPicBorder   (); // extend the border.
    433 
    434   //Reset the Border extension flag
    435   pcUsPic->setBorderExtension(false);
    436   pcTempPic->setBorderExtension(false);
    437   pcBasePic->setBorderExtension(false);
     429    }
     430
     431    pcUsPic->setBorderExtension(false);
     432    pcUsPic->extendPicBorder   (); // extend the border.
     433
     434    //Reset the Border extension flag
     435    pcUsPic->setBorderExtension(false);
     436    pcTempPic->setBorderExtension(false);
     437    pcBasePic->setBorderExtension(false);
    438438  }
    439439}
Note: See TracChangeset for help on using the changeset viewer.