]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mathops.h
Implement CODEC_CAP_DRAW_HORIZ_BAND for VP3 decoder
[ffmpeg] / libavcodec / mathops.h
index 1365903913770e9d8614a87a0a24a5160d5b9d19..e33f3bf303ea3dee3d9afeae998b8d18ec2561f2 100644 (file)
 
 #include "libavutil/common.h"
 
-#if   ARCH_X86_32
-
-#include "x86/mathops.h"
-
-#elif ARCH_ARM
-
-#include "arm/mathops.h"
-
-#elif ARCH_PPC
-
-#include "ppc/mathops.h"
-
+#if   ARCH_ARM
+#   include "arm/mathops.h"
+#elif ARCH_AVR32
+#   include "avr32/mathops.h"
 #elif ARCH_BFIN
-
-#include "bfin/mathops.h"
-
+#   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 */
@@ -57,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
@@ -113,5 +115,21 @@ static inline av_const int mid_pred(int a, int b, int c)
 }
 #endif
 
+#ifndef sign_extend
+static inline av_const int sign_extend(int 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
+
 #endif /* AVCODEC_MATHOPS_H */