21 #ifndef AVUTIL_INTMATH_H
22 #define AVUTIL_INTMATH_H
42 #if AV_GCC_VERSION_AT_LEAST(3,4)
44 # define ff_log2(x) (31 - __builtin_clz((x)|1))
45 # ifndef ff_log2_16bit
46 # define ff_log2_16bit av_log2
49 #elif defined( __INTEL_COMPILER )
51 # define ff_log2(x) (_bit_scan_reverse((x)|1))
52 # ifndef ff_log2_16bit
53 # define ff_log2_16bit av_log2
62 #define ff_log2 ff_log2_c
63 #if !defined( _MSC_VER )
83 _BitScanReverse(&n, v|1);
86 #define ff_log2_16bit av_log2
91 #define ff_log2_16bit ff_log2_16bit_c
105 #define av_log2 ff_log2
106 #define av_log2_16bit ff_log2_16bit
118 #if AV_GCC_VERSION_AT_LEAST(3,4)
120 #define ff_ctz(v) __builtin_ctz(v)
122 #elif defined( __INTEL_COMPILER )
124 #define ff_ctz(v) _bit_scan_forward(v)
130 #define ff_ctz ff_ctz_c
131 #if !defined( _MSC_VER )
164 _BitScanForward(&c, v);
int av_ctz(int v)
Trailing zero bit count.
Macro definitions for various function/variable attributes.
static av_always_inline av_const int ff_log2_c(unsigned int v)
static av_always_inline av_const int ff_ctz_c(int v)
const uint8_t ff_log2_tab[256]
static av_always_inline av_const int ff_log2_16bit_c(unsigned int v)