Changeset 169 in SHVCSoftware for branches/SHM-2.0-dev/source


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

Remove ceil and log functions

From: Adarsh K. Ramasubramonian <aramasub@…>

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

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r167 r169  
    978978    if( i > (vps->getNumLayerSets() - 1) )
    979979    {
    980       Int numBits = (Int)std::max(1.0, ceil( log((double)vps->getNumLayerSets() - 1) / log(2.0) ));
     980      Int numBits = 1;
     981      while ((1 << numBits) < (vps->getNumLayerSets() - 1))
     982      {
     983        numBits++;
     984      }
    981985      READ_CODE( numBits, uiCode, "output_layer_set_idx_minus1");   vps->setOutputLayerSetIdx( i, uiCode + 1);
    982986      Int lsIdx = vps->getOutputLayerSetIdx(i);
     
    10061010      }
    10071011    }
    1008     Int numBits = (Int)std::max(1.0, ceil( log((double)vps->getNumProfileTierLevel()) / log(2.0) ));
     1012    Int numBits = 1;
     1013    while ((1 << numBits) < (vps->getNumProfileTierLevel()))
     1014    {
     1015      numBits++;
     1016    }
    10091017    READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" );     vps->setProfileLevelTierIdx(i, uiCode);
    10101018  }
  • 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.