9#ifndef BROTLI_ENC_FAST_LOG_H_
10#define BROTLI_ENC_FAST_LOG_H_
15#include <brotli/types.h>
17#if defined(__cplusplus) || defined(c_plusplus)
22#if defined(BROTLI_BSR32)
23 return BROTLI_BSR32((uint32_t)n);
26 while (n >>= 1) result++;
31#define BROTLI_LOG2_TABLE_SIZE 256
39#if !defined(BROTLI_HAVE_LOG2)
40#if ((defined(_MSC_VER) && _MSC_VER <= 1700) || \
41 (defined(__ANDROID_API__) && __ANDROID_API__ < 18))
42#define BROTLI_HAVE_LOG2 0
44#define BROTLI_HAVE_LOG2 1
48#define LOG_2_INV 1.4426950408889634
55#if !(BROTLI_HAVE_LOG2)
58 return log2((
double)v);
62#if defined(__cplusplus) || defined(c_plusplus)
#define LOG_2_INV
Definition fast_log.h:48
BROTLI_INTERNAL const double kBrotliLog2Table[BROTLI_LOG2_TABLE_SIZE]
Definition fast_log.c:14
#define BROTLI_LOG2_TABLE_SIZE
Definition fast_log.h:31