Changeset 1312 in SHVCSoftware
- Timestamp:
- 21 Jul 2015, 01:32:24 (9 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibCommon
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
r1307 r1312 3295 3295 } 3296 3296 3297 UInt TComDataCU::xGetMvdBits(TComMv cMvd)3298 {3299 return ( xGetComponentBits(cMvd.getHor()) + xGetComponentBits(cMvd.getVer()) );3300 }3301 3302 UInt TComDataCU::xGetComponentBits(Int iVal)3303 {3304 UInt uiLength = 1;3305 UInt uiTemp = ( iVal <= 0) ? (-iVal<<1)+1: (iVal<<1);3306 3307 assert ( uiTemp );3308 3309 while ( 1 != uiTemp )3310 {3311 uiTemp >>= 1;3312 uiLength += 2;3313 }3314 3315 return uiLength;3316 }3317 3318 3319 3297 Int TComDataCU::xGetDistScaleFactor(Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC) 3320 3298 { -
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h
r1307 r1312 165 165 Bool xGetColMVP( RefPicList eRefPicList, Int ctuRsAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx ); 166 166 167 /// compute required bits to encode MVD (used in AMVP)168 UInt xGetMvdBits ( TComMv cMvd );169 UInt xGetComponentBits ( Int iVal );170 171 167 /// compute scaling factor from POC difference 172 168 Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); -
branches/SHM-dev/source/Lib/TLibCommon/TComRdCost.cpp
r1287 r1312 38 38 #include <math.h> 39 39 #include <assert.h> 40 #include <limits> 40 41 #include "TComRom.h" 41 42 #include "TComRdCost.h" … … 276 277 } 277 278 278 UInt TComRdCost::xGetComponentBits( Int iVal ) 279 { 279 // Static member function 280 UInt TComRdCost::xGetExpGolombNumberOfBits( Int iVal ) 281 { 282 assert(iVal != std::numeric_limits<Int>::min()); 280 283 UInt uiLength = 1; 281 UInt uiTemp = ( iVal <= 0) ? (-iVal<<1)+1: (iVal<<1); 282 283 assert ( uiTemp ); 284 UInt uiTemp = ( iVal <= 0) ? (UInt(-iVal)<<1)+1: UInt(iVal<<1); 284 285 285 286 while ( 1 != uiTemp ) -
branches/SHM-dev/source/Lib/TLibCommon/TComRdCost.h
r1287 r1312 159 159 160 160 // for motion cost 161 UInt xGetComponentBits( Int iVal );161 static UInt xGetExpGolombNumberOfBits( Int iVal ); 162 162 #if RExt__HIGH_BIT_DEPTH_SUPPORT 163 163 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); } … … 185 185 UInt getBits( Int x, Int y ) 186 186 { 187 return xGet ComponentBits((x << m_iCostScale) - m_mvPredictor.getHor())188 + xGet ComponentBits((y << m_iCostScale) - m_mvPredictor.getVer());187 return xGetExpGolombNumberOfBits((x << m_iCostScale) - m_mvPredictor.getHor()) 188 + xGetExpGolombNumberOfBits((y << m_iCostScale) - m_mvPredictor.getVer()); 189 189 } 190 190
Note: See TracChangeset for help on using the changeset viewer.