From 75fb5c24ed16743a31d5838b55984b4bf89d48bb Mon Sep 17 00:00:00 2001 From: Måns Rullgård Date: Tue, 19 Jan 2010 23:25:36 +0000 Subject: Move FASTDIV macro to intmath.h Originally committed as revision 21335 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavutil/intmath.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libavutil/intmath.h') 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 */ -- cgit v1.2.3