summaryrefslogtreecommitdiff
path: root/libavutil/intmath.h
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2010-01-19 23:25:36 +0000
committerMåns Rullgård <mans@mansr.com>2010-01-19 23:25:36 +0000
commit75fb5c24ed16743a31d5838b55984b4bf89d48bb (patch)
tree9d823b9bb5b0834cc19d7550ae970799b2c7b91b /libavutil/intmath.h
parent2087c82339edfa0cacfdfa612d99939a453624a7 (diff)
Move FASTDIV macro to intmath.h
Originally committed as revision 21335 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/intmath.h')
-rw-r--r--libavutil/intmath.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavutil/intmath.h b/libavutil/intmath.h
index 39e14c28ae..7aff78ceb1 100644
--- a/libavutil/intmath.h
+++ b/libavutil/intmath.h
@@ -24,6 +24,14 @@
#include "config.h"
#include "common.h"
+extern const uint32_t ff_inverse[257];
+
+#if ARCH_ARM
+# include "arm/intmath.h"
+#elif ARCH_X86
+# include "x86/intmath.h"
+#endif
+
#if HAVE_FAST_CLZ && AV_GCC_VERSION_AT_LEAST(3,4)
#ifndef av_log2
@@ -38,4 +46,14 @@
#endif /* AV_GCC_VERSION_AT_LEAST(3,4) */
+#ifndef FASTDIV
+
+#if CONFIG_FASTDIV
+# define FASTDIV(a,b) ((uint32_t)((((uint64_t)a) * ff_inverse[b]) >> 32))
+#else
+# define FASTDIV(a,b) ((a) / (b))
+#endif
+
+#endif /* FASTDIV */
+
#endif /* AVUTIL_INTMATH_H */