Ignore:
Timestamp:
9 May 2013, 10:43:46 (12 years ago)
Author:
qualcomm
Message:

Remove ceil and log functions

From: Adarsh K. Ramasubramonian <aramasub@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r165 r169  
    755755    if( i > (vps->getNumLayerSets() - 1) )
    756756    {
    757       Int numBits = std::max(1.0, ceil( log((double)vps->getNumLayerSets() - 1) / log(2.0) ));
     757      Int numBits = 1;
     758      while ((1 << numBits) < (vps->getNumLayerSets() - 1))
     759      {
     760        numBits++;
     761      }
    758762      WRITE_CODE( vps->getOutputLayerSetIdx(i) - 1, numBits, "output_layer_set_idx_minus1"); 
    759763      Int lsIdx = vps->getOutputLayerSetIdx(i);
     
    763767      }
    764768    }
    765     Int numBits = std::max(1.0, ceil( log((double)vps->getNumProfileTierLevel()) / log(2.0) ));
     769    Int numBits = 1;
     770    while ((1 << numBits) < (vps->getNumProfileTierLevel()))
     771    {
     772      numBits++;
     773    }
    766774    WRITE_CODE( vps->getProfileLevelTierIdx(i), numBits, "profile_level_tier_idx[i]" );     
    767775  }
Note: See TracChangeset for help on using the changeset viewer.