Changeset 1239 in SHVCSoftware


Ignore:
Timestamp:
13 Jul 2015, 20:58:53 (9 years ago)
Author:
seregin
Message:

port rev 4227

File:
1 edited

Legend:

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

    r1235 r1239  
    33133313
    33143314  TComDataCU *pCU = rTu.getCU();
    3315   const Char alpha = pCU->getCrossComponentPredictionAlpha( rTu.GetAbsPartIdxTU( compID ), compID );
     3315  const Int alpha = pCU->getCrossComponentPredictionAlpha( rTu.GetAbsPartIdxTU( compID ), compID );
    33163316  const Int diffBitDepth = pCU->getSlice()->getSPS()->getDifferentialLumaChromaBitDepth();
    33173317
     
    33203320    if (reverse)
    33213321    {
     3322      // A constraint is to be added to the HEVC Standard to limit the size of pResiL and pResiC at this point.
     3323      // The likely form of the constraint is to either restrict the values to CoeffMin to CoeffMax,
     3324      // or to be representable in a bitDepthY+4 or bitDepthC+4 signed integer.
     3325      //  The result of the constraint is that for 8/10/12bit profiles, the input values
     3326      //  can be represented within a 16-bit Pel-type.
     3327#if RExt__HIGH_BIT_DEPTH_SUPPORT
    33223328      for( Int x = 0; x < width; x++ )
    33233329      {
    33243330        pResiT[x] = pResiC[x] + (( alpha * rightShift( pResiL[x], diffBitDepth) ) >> 3);
    33253331      }
     3332#else
     3333      const Int minPel=std::numeric_limits<Pel>::min();
     3334      const Int maxPel=std::numeric_limits<Pel>::max();
     3335      for( Int x = 0; x < width; x++ )
     3336      {
     3337        pResiT[x] = Clip3<Int>(minPel, maxPel, pResiC[x] + (( alpha * rightShift<Int>(Int(pResiL[x]), diffBitDepth) ) >> 3));
     3338      }
     3339#endif
    33263340    }
    33273341    else
    33283342    {
     3343      // Forward does not need clipping. Pel type should always be big enough.
    33293344      for( Int x = 0; x < width; x++ )
    33303345      {
    3331         pResiT[x] = pResiC[x] - (( alpha * rightShift(pResiL[x], diffBitDepth) ) >> 3);
     3346        pResiT[x] = pResiC[x] - (( alpha * rightShift<Int>(Int(pResiL[x]), diffBitDepth) ) >> 3);
    33323347      }
    33333348    }
Note: See TracChangeset for help on using the changeset viewer.