Changeset 1469 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon


Ignore:
Timestamp:
9 Sep 2015, 18:16:24 (10 years ago)
Author:
seregin
Message:

port rev 4598

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

Legend:

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

    r1397 r1469  
    165165  m_costMode                   = COST_STANDARD_LOSSY;
    166166
    167   m_dCost                      = 0;
     167  m_motionLambda               = 0;
    168168  m_iCostScale                 = 0;
    169169}
  • branches/SHM-dev/source/Lib/TLibCommon/TComRdCost.h

    r1398 r1469  
    125125  // for motion cost
    126126  TComMv                  m_mvPredictor;
    127   Double                  m_dCost;
     127  Double                  m_motionLambda;
    128128  Int                     m_iCostScale;
    129129
     
    157157  // for motion cost
    158158  static UInt    xGetExpGolombNumberOfBits( Int iVal );
    159   Void    getMotionCost( Bool bSad, Int iAdd, Bool bIsTransquantBypass ) { m_dCost = (bSad ? m_dLambdaMotionSAD[(bIsTransquantBypass && m_costMode==COST_MIXED_LOSSLESS_LOSSY_CODING) ?1:0] + iAdd : m_dLambdaMotionSSE[(bIsTransquantBypass && m_costMode==COST_MIXED_LOSSLESS_LOSSY_CODING)?1:0] + iAdd); }
     159  Void    selectMotionLambda( Bool bSad, Int iAdd, Bool bIsTransquantBypass ) { m_motionLambda = (bSad ? m_dLambdaMotionSAD[(bIsTransquantBypass && m_costMode==COST_MIXED_LOSSLESS_LOSSY_CODING) ?1:0] + iAdd : m_dLambdaMotionSSE[(bIsTransquantBypass && m_costMode==COST_MIXED_LOSSLESS_LOSSY_CODING)?1:0] + iAdd); }
    160160  Void    setPredictor( TComMv& rcMv )
    161161  {
     
    163163  }
    164164  Void    setCostScale( Int iCostScale )    { m_iCostScale = iCostScale; }
    165   __inline Distortion getCost( Int x, Int y )
     165  Distortion getCost( UInt b )                 { return Distortion(( m_motionLambda * b ) / 65536.0); }
     166  Distortion getCostOfVectorWithPredictor( const Int x, const Int y )
    166167  {
    167     return Distortion((m_dCost * getBits(x, y)) / 65536.0);
     168    return Distortion((m_motionLambda * getBitsOfVectorWithPredictor(x, y)) / 65536.0);
    168169  }
    169   Distortion getCost( UInt b )                 { return Distortion(( m_dCost * b ) / 65536.0); }
    170   UInt    getBits( Int x, Int y )
     170  UInt getBitsOfVectorWithPredictor( const Int x, const Int y )
    171171  {
    172172    return xGetExpGolombNumberOfBits((x << m_iCostScale) - m_mvPredictor.getHor())
Note: See TracChangeset for help on using the changeset viewer.