aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/common.h
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2010-03-09 01:19:28 +0000
committerMåns Rullgård <mans@mansr.com>2010-03-09 01:19:28 +0000
commitb90b1b4c3c519d66146cf8a3ae16ba4c245f0a72 (patch)
treea5b3019baa6fe58310b78e899695fad724380c23 /libavutil/common.h
parent08a186c648c15aabac328996a46797119f7fae76 (diff)
downloadffmpeg-b90b1b4c3c519d66146cf8a3ae16ba4c245f0a72.tar.gz
Fix build on configurations without fast av_log2()
This is a bit hackish. I will try to think of something nicer, but this will do for now. Originally committed as revision 22366 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/common.h')
-rw-r--r--libavutil/common.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/libavutil/common.h b/libavutil/common.h
index 3f81de4f00..fae0b5b09b 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -36,11 +36,6 @@
#include <string.h>
#include "attributes.h"
-#ifdef HAVE_AV_CONFIG_H
-# include "config.h"
-# include "intmath.h"
-#endif
-
//rounded division & shift
#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
/* assume b>0 */
@@ -62,8 +57,7 @@ extern const uint8_t ff_log2_tab[256];
extern const uint8_t av_reverse[256];
-#ifndef av_log2
-static inline av_const int av_log2(unsigned int v)
+static inline av_const int av_log2_c(unsigned int v)
{
int n = 0;
if (v & 0xffff0000) {
@@ -78,10 +72,8 @@ static inline av_const int av_log2(unsigned int v)
return n;
}
-#endif
-#ifndef av_log2_16bit
-static inline av_const int av_log2_16bit(unsigned int v)
+static inline av_const int av_log2_16bit_c(unsigned int v)
{
int n = 0;
if (v & 0xff00) {
@@ -92,6 +84,17 @@ static inline av_const int av_log2_16bit(unsigned int v)
return n;
}
+
+#ifdef HAVE_AV_CONFIG_H
+# include "config.h"
+# include "intmath.h"
+#endif
+
+#ifndef av_log2
+# define av_log2 av_log2_c
+#endif
+#ifndef av_log2_16bit
+# define av_log2_16bit av_log2_16bit_c
#endif
/**