]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mathops.h
DCA: ARM/NEON optimised lfe_fir
[ffmpeg] / libavcodec / mathops.h
index 1a05787806b8c5cdc33be5e34e01fe13ca3eca22..149910bb1ddc064f2bb20c9f8bb50dd48abb0131 100644 (file)
 
 #include "libavutil/common.h"
 
-#if   ARCH_X86
-#   include "x86/mathops.h"
-#elif ARCH_ARM
+#if   ARCH_ARM
 #   include "arm/mathops.h"
-#elif ARCH_PPC
-#   include "ppc/mathops.h"
+#elif ARCH_AVR32
+#   include "avr32/mathops.h"
 #elif ARCH_BFIN
 #   include "bfin/mathops.h"
+#elif ARCH_MIPS
+#   include "mips/mathops.h"
+#elif ARCH_PPC
+#   include "ppc/mathops.h"
+#elif ARCH_X86
+#   include "x86/mathops.h"
 #endif
 
 /* generic implementation */
@@ -49,6 +53,12 @@ static av_always_inline int MULH(int a, int b){
 }
 #endif
 
+#ifndef UMULH
+static av_always_inline unsigned UMULH(unsigned a, unsigned b){
+    return ((uint64_t)(a) * (uint64_t)(b))>>32;
+}
+#endif
+
 #ifndef MUL64
 #   define MUL64(a,b) ((int64_t)(a) * (int64_t)(b))
 #endif
@@ -112,5 +122,29 @@ static inline av_const int sign_extend(int val, unsigned bits)
 }
 #endif
 
+#ifndef zero_extend
+static inline av_const unsigned zero_extend(unsigned val, unsigned bits)
+{
+    return (val << (INT_BIT - bits)) >> (INT_BIT - bits);
+}
+#endif
+
+#ifndef COPY3_IF_LT
+#define COPY3_IF_LT(x, y, a, b, c, d)\
+if ((y) < (x)) {\
+    (x) = (y);\
+    (a) = (b);\
+    (c) = (d);\
+}
+#endif
+
+#ifndef NEG_SSR32
+#   define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s)))
+#endif
+
+#ifndef NEG_USR32
+#   define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s)))
+#endif
+
 #endif /* AVCODEC_MATHOPS_H */