Changeset 1469 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon
- Timestamp:
- 9 Sep 2015, 18:16:24 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibCommon
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComRdCost.cpp
r1397 r1469 165 165 m_costMode = COST_STANDARD_LOSSY; 166 166 167 m_ dCost= 0;167 m_motionLambda = 0; 168 168 m_iCostScale = 0; 169 169 } -
branches/SHM-dev/source/Lib/TLibCommon/TComRdCost.h
r1398 r1469 125 125 // for motion cost 126 126 TComMv m_mvPredictor; 127 Double m_ dCost;127 Double m_motionLambda; 128 128 Int m_iCostScale; 129 129 … … 157 157 // for motion cost 158 158 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); } 160 160 Void setPredictor( TComMv& rcMv ) 161 161 { … … 163 163 } 164 164 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 ) 166 167 { 167 return Distortion((m_ dCost * getBits(x, y)) / 65536.0);168 return Distortion((m_motionLambda * getBitsOfVectorWithPredictor(x, y)) / 65536.0); 168 169 } 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 ) 171 171 { 172 172 return xGetExpGolombNumberOfBits((x << m_iCostScale) - m_mvPredictor.getHor())
Note: See TracChangeset for help on using the changeset viewer.