From 9734b8ba56d05e970c353dfd5baafa43fdb08024 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Thu, 11 Oct 2012 01:16:05 +0200 Subject: Move avutil tables only used in libavcodec to libavcodec. --- libavcodec/arm/mathops.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'libavcodec/arm') diff --git a/libavcodec/arm/mathops.h b/libavcodec/arm/mathops.h index 3803fcde8c..17a687da6a 100644 --- a/libavcodec/arm/mathops.h +++ b/libavcodec/arm/mathops.h @@ -36,6 +36,30 @@ static inline av_const int MULH(int a, int b) __asm__ ("smmul %0, %1, %2" : "=r"(r) : "r"(a), "r"(b)); return r; } + +#define FASTDIV FASTDIV +static av_always_inline av_const int FASTDIV(int a, int b) +{ + int r; + __asm__ ("cmp %2, #2 \n\t" + "ldr %0, [%3, %2, lsl #2] \n\t" + "ite le \n\t" + "lsrle %0, %1, #1 \n\t" + "smmulgt %0, %0, %1 \n\t" + : "=&r"(r) : "r"(a), "r"(b), "r"(ff_inverse) : "cc"); + return r; +} + +#else /* HAVE_ARMV6 */ + +#define FASTDIV FASTDIV +static av_always_inline av_const int FASTDIV(int a, int b) +{ + int r, t; + __asm__ ("umull %1, %0, %2, %3" + : "=&r"(r), "=&r"(t) : "r"(a), "r"(ff_inverse[b])); + return r; +} #endif #define MLS64(d, a, b) MAC64(d, -(a), b) -- cgit v1.2.1