From 8c0a3d5fe035f2d19b5815f142e145cfbedf28b3 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Thu, 18 Oct 2012 18:15:38 +0100 Subject: avutil: remove inline av_log2 from public API This removes inline av_log2 and av_log2_16bit from the public API, instead exporting them as regular functions. In-tree code still gets the inline and otherwise optimised variants. Signed-off-by: Mans Rullgard --- libavutil/common.h | 43 ++++++++----------------------------------- 1 file changed, 8 insertions(+), 35 deletions(-) (limited to 'libavutil/common.h') diff --git a/libavutil/common.h b/libavutil/common.h index c0e0fc5130..34658635a7 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -62,40 +62,11 @@ #define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1)) /* misc math functions */ -extern const uint8_t ff_log2_tab[256]; #if FF_API_AV_REVERSE extern attribute_deprecated const uint8_t av_reverse[256]; #endif -static av_always_inline av_const int av_log2_c(unsigned int v) -{ - int n = 0; - if (v & 0xffff0000) { - v >>= 16; - n += 16; - } - if (v & 0xff00) { - v >>= 8; - n += 8; - } - n += ff_log2_tab[v]; - - return n; -} - -static av_always_inline av_const int av_log2_16bit_c(unsigned int v) -{ - int n = 0; - if (v & 0xff00) { - v >>= 8; - n += 8; - } - n += ff_log2_tab[v]; - - return n; -} - #ifdef HAVE_AV_CONFIG_H # include "config.h" # include "intmath.h" @@ -104,6 +75,14 @@ static av_always_inline av_const int av_log2_16bit_c(unsigned int v) /* Pull in unguarded fallback defines at the end of this file. */ #include "common.h" +#ifndef av_log2 +av_const int av_log2(unsigned v); +#endif + +#ifndef av_log2_16bit +av_const int av_log2_16bit(unsigned v); +#endif + /** * Clip a signed integer value into the amin-amax range. * @param a value to clip @@ -385,12 +364,6 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x) * to ensure they are immediately available in intmath.h. */ -#ifndef av_log2 -# define av_log2 av_log2_c -#endif -#ifndef av_log2_16bit -# define av_log2_16bit av_log2_16bit_c -#endif #ifndef av_ceil_log2 # define av_ceil_log2 av_ceil_log2_c #endif -- cgit v1.2.3