diff options
Diffstat (limited to 'libavutil/intmath.h')
-rw-r--r-- | libavutil/intmath.h | 18 |
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 */ |