Changeset 449 in SHVCSoftware for branches


Ignore:
Timestamp:
8 Nov 2013, 06:30:38 (11 years ago)
Author:
seregin
Message:

remove BUGFIX_RESAMPLE

Location:
branches/SHM-4.0-dev/source/Lib/TLibCommon
Files:
2 edited

Legend:

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

    r448 r449  
    227227    Int topStartL  = scalEL.getWindowTopOffset();
    228228    Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset();
    229 #if BUGFIX_RESAMPLE
    230229    Int leftOffset = leftStartL > 0 ? leftStartL : 0;
    231 #endif
    232230
    233231#if  N0214_INTERMEDIATE_BUFFER_16BITS
     
    281279
    282280      piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL;
    283 #if BUGFIX_RESAMPLE
    284281      Pel* piDstY0 = piDstBufY + j * strideEL;           
    285282      piDstY = piDstY0 + leftOffset;
     
    305302        piDstY++;
    306303      }
    307 #else
    308 #if 1 // it should provide identical result
    309       Pel* piDstY0 = piDstBufY + j * strideEL;           
    310       piDstY = piDstY0 + ( leftStartL > 0 ? leftStartL : 0 );
    311 
    312       for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- )
    313       {
    314         *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift));
    315         piSrcY++;
    316         piDstY++;
    317       }
    318 
    319       for( i = rightEndL; i < pcTempPic->getWidth(); i++ )
    320       {
    321         *piDstY = piDstY0[rightEndL-1];
    322         piDstY++;
    323       }
    324 
    325       piDstY = piDstY0;
    326       for( i = 0; i < leftStartL; i++ )
    327       {
    328         *piDstY = piDstY0[leftStartL];
    329         piDstY++;
    330       }
    331 #else
    332       piDstY = piDstBufY + j * strideEL;
    333 
    334       for( i = 0; i < pcTempPic->getWidth(); i++ )
    335       {
    336         *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift));
    337 
    338         // Only increase the x position of reference upsample picture when within the window
    339         // "-2" to ensure that pointer doesn't go beyond the boundary rightEndL-1
    340         if( (i >= leftStartL) && (i <= rightEndL-2) )
    341         {
    342           piSrcY++;
    343         }
    344         piDstY++;
    345       }
    346 #endif
    347 #endif
     304
    348305    }
    349306
     
    369326    Int topStartC  = scalEL.getWindowTopOffset() >> 1;
    370327    Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1);
    371 #if BUGFIX_RESAMPLE
    372328    leftOffset = leftStartC > 0 ? leftStartC : 0;
    373 #endif
    374329
    375330    shiftX = 16;
     
    452407      refPos   = refPos16 >> 4;
    453408      coeff = m_chromaFilter[phase];
    454      
     409
    455410      piSrcU = piTempBufU  + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL;
    456411      piSrcV = piTempBufV  + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL;
    457412
    458 #if BUGFIX_RESAMPLE
    459413      Pel* piDstU0 = piDstBufU + j*strideEL;
    460414      Pel* piDstV0 = piDstBufV + j*strideEL;
     
    491445        piDstV++;
    492446      }
    493 #else
    494 #if 1 // it should provide identical result
    495       Pel* piDstU0 = piDstBufU + j*strideEL;
    496       Pel* piDstV0 = piDstBufV + j*strideEL;
    497       piDstU = piDstU0 + ( leftStartC > 0 ? leftStartC : 0 );
    498       piDstV = piDstV0 + ( leftStartC > 0 ? leftStartC : 0 );
    499 
    500       for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- )
    501       {
    502         *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift));
    503         *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift));
    504         piSrcU++;
    505         piSrcV++;
    506         piDstU++;
    507         piDstV++;
    508       }
    509 
    510       for( i = rightEndC; i < pcTempPic->getWidth() >> 1; i++ )
    511       {
    512         *piDstU = piDstU0[rightEndC-1];
    513         *piDstV = piDstV0[rightEndC-1];
    514         piDstU++;
    515         piDstV++;
    516       }
    517 
    518       piDstU = piDstU0;
    519       piDstV = piDstV0;
    520       for( i = 0; i < leftStartC; i++ )
    521       {
    522         *piDstU = piDstU0[leftStartC];
    523         *piDstV = piDstV0[leftStartC];
    524         piDstU++;
    525         piDstV++;
    526       }
    527 #else
    528       piDstU = piDstBufU + j*strideEL;
    529       piDstV = piDstBufV + j*strideEL;
    530 
    531       for( i = 0; i < pcTempPic->getWidth() >> 1; i++ )
    532       {
    533         *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift));
    534         *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift));
    535 
    536         // Only increase the x position of reference upsample picture when within the window
    537         // "-2" to ensure that pointer doesn't go beyond the boundary rightEndC-1
    538         if( (i >= leftStartC) && (i <= rightEndC-2) )
    539         {
    540           piSrcU++;
    541           piSrcV++;
    542         }
    543 
    544         piDstU++;
    545         piDstV++;
    546       }
    547 #endif
    548 #endif
     447
    549448    }
    550449  }
    551     pcUsPic->setBorderExtension(false);
    552     pcUsPic->extendPicBorder   (); // extend the border.
    553 
    554     //Reset the Border extension flag
    555     pcUsPic->setBorderExtension(false);
    556     pcTempPic->setBorderExtension(false);
    557     pcBasePic->setBorderExtension(false);
     450  pcUsPic->setBorderExtension(false);
     451  pcUsPic->extendPicBorder   (); // extend the border.
     452
     453  //Reset the Border extension flag
     454  pcUsPic->setBorderExtension(false);
     455  pcTempPic->setBorderExtension(false);
     456  pcBasePic->setBorderExtension(false);
    558457}
    559458#endif //SVC_EXTENSION
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TypeDef.h

    r448 r449  
    102102#define N0214_INTERMEDIATE_BUFFER_16BITS 1      ///< JCTVC-N0214: support base layer input more than 8 bits
    103103#define ARBITRARY_SPATIAL_RATIO          0      ///< JCTVC-N0219, JCTVC-N0273: Support arbitrary spatial ratio
    104 #define BUGFIX_RESAMPLE                  1      ///< JCTVC-N0055: resampling bug fix for positive left scalled offset
    105104
    106105#define JCTVC_M0259_LAMBDAREFINEMENT     1      ///< JCTVC-M0259: lambda refinement (encoder only optimization)
Note: See TracChangeset for help on using the changeset viewer.