diff options
author | eustas <eustas.ru@gmail.com> | 2016-06-13 16:46:25 +0200 |
---|---|---|
committer | Eugene Kliuchnikov <eustas@google.com> | 2016-06-14 16:02:38 +0200 |
commit | 048b14c65f659bce2510b1e2231c939ae1ce024c (patch) | |
tree | 20d6dc54e68e5f686463e04792f10590c324836d | |
parent | 999a3ce9b2d65bea2a88b651e017e1fa7d1da9c3 (diff) | |
download | brotli-048b14c65f659bce2510b1e2231c939ae1ce024c.zip brotli-048b14c65f659bce2510b1e2231c939ae1ce024c.tar.gz brotli-048b14c65f659bce2510b1e2231c939ae1ce024c.tar.bz2 |
Fix declaration / instruction mixture
-rw-r--r-- | enc/fast_log.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/enc/fast_log.h b/enc/fast_log.h index 6685c20..ca1d6cb 100644 --- a/enc/fast_log.h +++ b/enc/fast_log.h @@ -121,6 +121,8 @@ static const float kLog2Table[] = { 7.9943534368588578f }; +#define LOG_2_INV 1.4426950408889634 + /* Faster logarithm for small integers, with the property of log2(0) == 0. */ static BROTLI_INLINE double FastLog2(size_t v) { if (v < sizeof(kLog2Table) / sizeof(kLog2Table[0])) { @@ -130,8 +132,7 @@ static BROTLI_INLINE double FastLog2(size_t v) { (defined(__ANDROID_API__) && __ANDROID_API__ < 18) /* Visual Studio 2012 and Android API levels < 18 do not have the log2() * function defined, so we use log() and a multiplication instead. */ - static const double kLog2Inv = 1.4426950408889634; - return log((double)v) * kLog2Inv; + return log((double)v) * LOG_2_INV; #else return log2((double)v); #endif |