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


Ignore:
Timestamp:
24 May 2013, 00:29:10 (11 years ago)
Author:
seregin
Message:

JCTVC_L0178 macro clean up

Location:
branches/SHM-2.1-dev/source/Lib/TLibCommon
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.1-dev/source/Lib/TLibCommon/TComPicYuv.h

    r191 r236  
    126126#endif
    127127
    128 #if JCTVC_L0178
    129   Void   setWidth   ( Int iPicWidth )     { m_iPicWidth = iPicWidth; }
    130 #endif
    131128  Int   getStride   ()     { return (m_iPicWidth     ) + (m_iLumaMarginX  <<1); }
    132129  Int   getCStride  ()     { return (m_iPicWidth >> 1) + (m_iChromaMarginX<<1); }
  • branches/SHM-2.1-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp

    r235 r236  
    126126  Pel* piSrcV;
    127127  Pel* piDstV;
    128  
    129 #if JCTVC_L0178
    130   Pel *tempBufRight = NULL, *tempBufBottom = NULL;
    131   Int tempBufSizeRight = 0, tempBufSizeBottom = 0;
    132  
    133   if( confBL.getWindowRightOffset())
    134   {
    135     tempBufSizeRight = confBL.getWindowRightOffset() * pcBasePic->getHeight();
    136   }
    137  
    138   if( confBL.getWindowBottomOffset() )
    139   {
    140     tempBufSizeBottom = confBL.getWindowBottomOffset() * pcBasePic->getWidth ();
    141   }
    142  
    143   if( tempBufSizeRight )
    144   {
    145     tempBufRight = (Pel *) xMalloc(Pel, tempBufSizeRight + (tempBufSizeRight>>1) );
    146     assert( tempBufRight );
    147   }
    148  
    149   if( tempBufSizeBottom )
    150   {
    151     tempBufBottom = (Pel *) xMalloc(Pel, tempBufSizeBottom + (tempBufSizeBottom>>1) );
    152     assert( tempBufBottom );
    153   }
    154  
    155 #endif
    156128
    157129  if( widthEL == widthBL && heightEL == heightBL )
     
    205177  assert ( widthEL == widthBL || widthEL == 2*widthBL || 2*widthEL == 3*widthBL );
    206178  assert ( heightEL == heightBL || heightEL == 2*heightBL || 2*heightEL == 3*heightBL );
    207 
    208 #if JCTVC_L0178
    209   // save the cropped region to copy back to the base picture since the base picture might be used as a reference picture
    210   if( tempBufSizeRight )
    211   {
    212     piSrcY = piSrcBufY + widthBL;
    213     piDstY = tempBufRight;
    214     for( i = 0; i < pcBasePic->getHeight(); i++ )
    215     {
    216       memcpy(piDstY, piSrcY, sizeof(Pel) * confBL.getWindowRightOffset());
    217       piSrcY += strideBL;
    218       piDstY += confBL.getWindowRightOffset();
    219     }
    220    
    221     if(confBL.getWindowRightOffset()>>1)
    222     {
    223       Int strideBLChroma = (strideBL>>1);
    224       piSrcU = piSrcBufU + (widthBL>>1);
    225       piDstU = tempBufRight + confBL.getWindowRightOffset() * pcBasePic->getHeight();
    226       piSrcV = piSrcBufV + (widthBL>>1);
    227       piDstV = piDstU + (confBL.getWindowRightOffset()>>1) * (pcBasePic->getHeight()>>1);
    228    
    229       for( i = 0; i < pcBasePic->getHeight()>>1; i++ )
    230       {
    231         memcpy(piDstU, piSrcU, sizeof(Pel) * (confBL.getWindowRightOffset()>>1));
    232         piSrcU += strideBLChroma;
    233         piDstU += (confBL.getWindowRightOffset()>>1);
    234        
    235         memcpy(piDstV, piSrcV, sizeof(Pel) * (confBL.getWindowRightOffset()>>1));
    236         piSrcV += strideBLChroma;
    237         piDstV += (confBL.getWindowRightOffset()>>1);
    238       }
    239     }
    240    
    241     pcBasePic->setWidth(widthBL);
    242   }
    243  
    244   if( tempBufSizeBottom )
    245   {
    246     piSrcY = piSrcBufY + heightBL * strideBL;
    247     piDstY = tempBufBottom;
    248     for( i = 0; i < confBL.getWindowBottomOffset(); i++ )
    249     {
    250       memcpy(piDstY, piSrcY, sizeof(Pel) * pcBasePic->getWidth());
    251       piSrcY += strideBL;
    252       piDstY += pcBasePic->getWidth();
    253     }
    254    
    255     if(confBL.getWindowBottomOffset()>>1)
    256     {
    257       Int strideBLChroma = (strideBL>>1);
    258       piSrcU = piSrcBufU + (heightBL>>1) * strideBLChroma;
    259       piDstU = tempBufBottom + confBL.getWindowBottomOffset() * pcBasePic->getWidth();
    260       piSrcV = piSrcBufV + (heightBL>>1) * strideBLChroma;
    261       piDstV = piDstU + (confBL.getWindowBottomOffset()>>1) * (pcBasePic->getWidth()>>1);
    262      
    263       for( i = 0; i < confBL.getWindowBottomOffset()>>1; i++ )
    264       {
    265         memcpy(piDstU, piSrcU, sizeof(Pel) * (pcBasePic->getWidth()>>1));
    266         piSrcU += strideBLChroma;
    267         piDstU += (pcBasePic->getWidth()>>1);
    268        
    269         memcpy(piDstV, piSrcV, sizeof(Pel) * (pcBasePic->getWidth()>>1));
    270         piSrcV += strideBLChroma;
    271         piDstV += (pcBasePic->getWidth()>>1);
    272       }
    273     }
    274 
    275     pcBasePic->setHeight(heightBL);
    276   }
    277 #endif
    278179 
    279180  pcBasePic->setBorderExtension(false);
     
    535436  pcTempPic->setBorderExtension(false);
    536437  pcBasePic->setBorderExtension(false);
    537  
    538 #if JCTVC_L0178
    539   // copy back the saved cropped region
    540   if( tempBufSizeRight )
    541   {
    542     // put the correct width back
    543     pcBasePic->setWidth(pcBasePic->getWidth() + confBL.getWindowRightOffset());
    544   }
    545   if( tempBufSizeBottom )
    546   {
    547     pcBasePic->setHeight(pcBasePic->getHeight() + confBL.getWindowBottomOffset());
    548   }
    549  
    550   widthBL   = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
    551   heightBL  = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
    552  
    553   strideBL  = pcBasePic->getStride();
    554  
    555   if( tempBufSizeRight )
    556   {
    557     piSrcY = tempBufRight;
    558     piDstY = piSrcBufY + widthBL;
    559    
    560     for( i = 0; i < pcBasePic->getHeight(); i++ )
    561     {
    562       memcpy(piDstY, piSrcY, sizeof(Pel) * confBL.getWindowRightOffset() );
    563       piSrcY += confBL.getWindowRightOffset();
    564       piDstY += strideBL;
    565     }
    566    
    567     if(confBL.getWindowRightOffset()>>1)
    568     {
    569       Int strideBLChroma = (strideBL>>1);
    570       piSrcU = tempBufRight + confBL.getWindowRightOffset() * pcBasePic->getHeight();
    571       piDstU = piSrcBufU + (widthBL>>1);
    572       piSrcV = piSrcU + (confBL.getWindowRightOffset()>>1) * (pcBasePic->getHeight()>>1);
    573       piDstV = piSrcBufV + (widthBL>>1);
    574 
    575       for( i = 0; i < pcBasePic->getHeight()>>1; i++ )
    576       {
    577         memcpy(piDstU, piSrcU, sizeof(Pel) * (confBL.getWindowRightOffset()>>1));
    578         piSrcU += (confBL.getWindowRightOffset()>>1);
    579         piDstU += strideBLChroma;
    580        
    581         memcpy(piDstV, piSrcV, sizeof(Pel) * (confBL.getWindowRightOffset()>>1));
    582         piSrcV += (confBL.getWindowRightOffset()>>1);
    583         piDstV += strideBLChroma;
    584       }
    585     }
    586   }
    587  
    588   if( tempBufSizeBottom )
    589   {
    590     piDstY = piSrcBufY + heightBL * strideBL;
    591     piSrcY = tempBufBottom;
    592     for( i = 0; i < confBL.getWindowBottomOffset(); i++ )
    593     {
    594       memcpy(piDstY, piSrcY, sizeof(Pel) * pcBasePic->getWidth());
    595       piDstY += strideBL;
    596       piSrcY += pcBasePic->getWidth();
    597     }
    598    
    599     if(confBL.getWindowBottomOffset()>>1)
    600     {
    601       Int strideBLChroma = (strideBL>>1);
    602       piSrcU = tempBufBottom + confBL.getWindowBottomOffset() * pcBasePic->getWidth();
    603       piDstU = piSrcBufU + (heightBL>>1) * strideBLChroma;
    604       piSrcV = piSrcU + (confBL.getWindowBottomOffset()>>1) * (pcBasePic->getWidth()>>1);
    605       piDstV = piSrcBufV + (heightBL>>1) * strideBLChroma;
    606            
    607       for( i = 0; i < confBL.getWindowBottomOffset()>>1; i++ )
    608       {
    609         memcpy(piDstU, piSrcU, sizeof(Pel) * (pcBasePic->getWidth()>>1));
    610         piSrcU += (pcBasePic->getWidth()>>1);
    611         piDstU += strideBLChroma;
    612        
    613         memcpy(piDstV, piSrcV, sizeof(Pel) * (pcBasePic->getWidth()>>1));
    614         piSrcV += (pcBasePic->getWidth()>>1);
    615         piDstV += strideBLChroma;
    616       }
    617     }
    618  
    619   }
    620 
    621   if( tempBufSizeRight )
    622   {
    623     xFree( tempBufRight );
    624   }
    625   if( tempBufSizeBottom )
    626   {
    627     xFree( tempBufBottom );
    628   }
    629 #endif
    630438  }
    631439}
  • branches/SHM-2.1-dev/source/Lib/TLibCommon/TypeDef.h

    r235 r236  
    7777
    7878#define REF_IDX_FRAMEWORK                1      ///< inter-layer reference framework
    79 
    80 #if SVC_UPSAMPLING && !ILP_DECODED_PICTURE
    81 #define JCTVC_L0178                      1      ///< implementation of JCTVC-L0178 (code only supports right and bottom croppping offsets)
    82 #endif
    8379
    8480#define IDR_ALIGNMENT                    1      ///< align IDR picures across layers
Note: See TracChangeset for help on using the changeset viewer.