Changeset 338 in SHVCSoftware for branches/SHM-3.0-dev


Ignore:
Timestamp:
15 Aug 2013, 21:08:40 (11 years ago)
Author:
seregin
Message:

resampling bug fix for positive left scalled offset with BUGFIX_RESAMPLE macro (JCTVC-N0055). Patch was provided by Takeshi Tsukuba <tsukuba.takeshi@…>

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

Legend:

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

    r335 r338  
    250250    Int topStartL  = scalEL.getWindowTopOffset();
    251251    Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset();
     252#if BUGFIX_RESAMPLE
     253    Int leftOffset = leftStartL > 0 ? leftStartL : 0;
     254#endif
    252255#endif
    253256
     
    315318      piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL;
    316319#if SCALED_REF_LAYER_OFFSETS
     320#if BUGFIX_RESAMPLE
     321      Pel* piDstY0 = piDstBufY + j * strideEL;           
     322      piDstY = piDstY0 + leftOffset;
     323      piSrcY += leftOffset;
     324
     325      for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- )
     326      {
     327        *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift));
     328        piSrcY++;
     329        piDstY++;
     330      }
     331
     332      for( i = rightEndL; i < pcTempPic->getWidth(); i++ )
     333      {
     334        *piDstY = piDstY0[rightEndL-1];
     335        piDstY++;
     336      }
     337
     338      piDstY = piDstY0;
     339      for( i = 0; i < leftStartL; i++ )
     340      {
     341        *piDstY = piDstY0[leftStartL];
     342        piDstY++;
     343      }
     344#else
    317345#if 1 // it should provide identical result
    318346      Pel* piDstY0 = piDstBufY + j * strideEL;           
     
    354382      }
    355383#endif
     384#endif
    356385#else
    357386      piDstY = piDstBufY + j * strideEL;
     
    397426    Int topStartC  = scalEL.getWindowTopOffset() >> 1;
    398427    Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1);
     428#if BUGFIX_RESAMPLE
     429    leftOffset = leftStartC > 0 ? leftStartC : 0;
     430#endif
    399431#endif
    400432
     
    501533      piSrcV = piTempBufV  + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL;
    502534#if SCALED_REF_LAYER_OFFSETS
     535#if BUGFIX_RESAMPLE
     536      Pel* piDstU0 = piDstBufU + j*strideEL;
     537      Pel* piDstV0 = piDstBufV + j*strideEL;
     538      piDstU = piDstU0 + leftOffset;
     539      piDstV = piDstV0 + leftOffset;
     540      piSrcU += leftOffset;
     541      piSrcV += leftOffset;
     542
     543      for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- )
     544      {
     545        *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift));
     546        *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift));
     547        piSrcU++;
     548        piSrcV++;
     549        piDstU++;
     550        piDstV++;
     551      }
     552
     553      for( i = rightEndC; i < pcTempPic->getWidth() >> 1; i++ )
     554      {
     555        *piDstU = piDstU0[rightEndC-1];
     556        *piDstV = piDstV0[rightEndC-1];
     557        piDstU++;
     558        piDstV++;
     559      }
     560
     561      piDstU = piDstU0;
     562      piDstV = piDstV0;
     563      for( i = 0; i < leftStartC; i++ )
     564      {
     565        *piDstU = piDstU0[leftStartC];
     566        *piDstV = piDstV0[leftStartC];
     567        piDstU++;
     568        piDstV++;
     569      }
     570#else
    503571#if 1 // it should provide identical result
    504572      Pel* piDstU0 = piDstBufU + j*strideEL;
     
    555623      }
    556624#endif
     625#endif
    557626#else
    558627      piDstU = piDstBufU + j*strideEL;
  • branches/SHM-3.0-dev/source/Lib/TLibCommon/TypeDef.h

    r337 r338  
    8484#define N0214_INTERMEDIATE_BUFFER_16BITS 1      ///< JCTVC-N0214 support base layer input more than 8 bits
    8585#define ARBITRARY_SPATIAL_RATIO          0      ///< JCTVC-N0219, JCTVC-N0273: Support arbitrary spatial ratio
    86 
     86#define BUGFIX_RESAMPLE                  1      ///< JCTVC-N0055: resampling bug fix for positive left scalled offset
    8787
    8888#define SIMPLIFIED_MV_POS_SCALING        1      ///< M0133/M0449: inter-layer MV scaling and pixel mapping position calculation
     
    111111#define JCTVC_M0203_INTERLAYER_PRED_IDC  1      ///< implementation of JCTVC-M0203 Inter-layer Prediction Indication
    112112#if JCTVC_M0203_INTERLAYER_PRED_IDC
    113 #define ILR_RESTR                        1     ///< JCTVC-M0209 Inter-layer RPS and RPL
     113#define ILR_RESTR                        1      ///< JCTVC-M0209 Inter-layer RPS and RPL
    114114#define N0120_MAX_TID_REF_PRESENT_FLAG   1      ///< JCTVC-N0120 max_tid_ref_pics_plus1_present_flag
    115115#endif
    116116#if REF_IDX_MFM
    117 #define REMOVE_COL_PICTURE_SIGNALING     1     ///< JCTVC-N0107 remove alternative collocated picture signalling
     117#define REMOVE_COL_PICTURE_SIGNALING     1      ///< JCTVC-N0107 remove alternative collocated picture signalling
    118118#define M0457_COL_PICTURE_SIGNALING      1
    119119#endif
    120120
    121121#if !VPS_EXTN_DIRECT_REF_LAYERS || !M0457_PREDICTION_INDICATIONS || !JCTVC_M0458_INTERLAYER_RPS_SIG
    122 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG   0     ///< shall be 0, JCTVC-N0107
     122#define M0457_IL_SAMPLE_PRED_ONLY_FLAG   0      ///< shall be 0, JCTVC-N0107
    123123#else
    124 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG   0     ///< shall be 0, JCTVC-N0107
     124#define M0457_IL_SAMPLE_PRED_ONLY_FLAG   0      ///< shall be 0, JCTVC-N0107
    125125#endif
    126126#endif
     
    128128#define FAST_INTRA_SHVC                  1      ///< M0115: reduction number of intra modes in the EL (encoder only)
    129129#if FAST_INTRA_SHVC
    130   #define NB_REMAIN_MODES                2      ///< nb of remaining modes (M0115)
    131 #endif
    132 
    133 #define RC_SHVC_HARMONIZATION            1  ///< JCTVC-M0037, rate control for SHVC
     130#define NB_REMAIN_MODES                  2      ///< nb of remaining modes (M0115)
     131#endif
     132
     133#define RC_SHVC_HARMONIZATION            1      ///< JCTVC-M0037, rate control for SHVC
    134134
    135135#else
Note: See TracChangeset for help on using the changeset viewer.