Changeset 1312 in SHVCSoftware


Ignore:
Timestamp:
21 Jul 2015, 01:32:24 (9 years ago)
Author:
seregin
Message:

port rev 4386

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

Legend:

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

    r1307 r1312  
    32953295}
    32963296
    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 
    33193297Int TComDataCU::xGetDistScaleFactor(Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC)
    33203298{
  • branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h

    r1307 r1312  
    165165  Bool          xGetColMVP( RefPicList eRefPicList, Int ctuRsAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx );
    166166
    167   /// compute required bits to encode MVD (used in AMVP)
    168   UInt          xGetMvdBits           ( TComMv cMvd );
    169   UInt          xGetComponentBits     ( Int iVal );
    170 
    171167  /// compute scaling factor from POC difference
    172168  Int           xGetDistScaleFactor   ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC );
  • branches/SHM-dev/source/Lib/TLibCommon/TComRdCost.cpp

    r1287 r1312  
    3838#include <math.h>
    3939#include <assert.h>
     40#include <limits>
    4041#include "TComRom.h"
    4142#include "TComRdCost.h"
     
    276277}
    277278
    278 UInt TComRdCost::xGetComponentBits( Int iVal )
    279 {
     279// Static member function
     280UInt TComRdCost::xGetExpGolombNumberOfBits( Int iVal )
     281{
     282  assert(iVal != std::numeric_limits<Int>::min());
    280283  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);
    284285
    285286  while ( 1 != uiTemp )
  • branches/SHM-dev/source/Lib/TLibCommon/TComRdCost.h

    r1287 r1312  
    159159
    160160  // for motion cost
    161   UInt    xGetComponentBits( Int iVal );
     161  static UInt    xGetExpGolombNumberOfBits( Int iVal );
    162162#if RExt__HIGH_BIT_DEPTH_SUPPORT
    163163  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); }
     
    185185  UInt    getBits( Int x, Int y )
    186186  {
    187     return xGetComponentBits((x << m_iCostScale) - m_mvPredictor.getHor())
    188     +      xGetComponentBits((y << m_iCostScale) - m_mvPredictor.getVer());
     187    return xGetExpGolombNumberOfBits((x << m_iCostScale) - m_mvPredictor.getHor())
     188    +      xGetExpGolombNumberOfBits((y << m_iCostScale) - m_mvPredictor.getVer());
    189189  }
    190190
Note: See TracChangeset for help on using the changeset viewer.