]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mathops.h
lavc: add MMAL hardware decoder wrapper
[ffmpeg] / libavcodec / mathops.h
index 8a2ce90d6ac3aec6ac89cfdbf97b4864585150c7..7af13e19e016918a6d6516b8b62b2f513f6e2b50 100644 (file)
 #include "libavutil/common.h"
 #include "config.h"
 
+#define MAX_NEG_CROP 1024
+
 extern const uint32_t ff_inverse[257];
 extern const uint8_t  ff_reverse[256];
 extern const uint8_t ff_sqrt_tab[256];
+extern const uint8_t ff_crop_tab[256 + 2 * MAX_NEG_CROP];
+extern const uint8_t ff_zigzag_direct[64];
 
 #if   ARCH_ARM
 #   include "arm/mathops.h"
@@ -195,15 +199,6 @@ if ((y) < (x)) {\
 #   define FASTDIV(a,b) ((uint32_t)((((uint64_t)a) * ff_inverse[b]) >> 32))
 #endif /* FASTDIV */
 
-#ifndef MOD_UNLIKELY
-#   define MOD_UNLIKELY(modulus, dividend, divisor, prev_dividend) \
-    do { \
-        if ((prev_dividend) == 0 || (dividend) - (prev_dividend) != (divisor)) \
-            (modulus) = (dividend) % (divisor); \
-        (prev_dividend) = (dividend); \
-    } while (0)
-#endif
-
 static inline av_const unsigned int ff_sqrt(unsigned int a)
 {
     unsigned int b;
@@ -224,4 +219,14 @@ static inline av_const unsigned int ff_sqrt(unsigned int a)
     return b - (a < b * b);
 }
 
+static inline int8_t ff_u8_to_s8(uint8_t a)
+{
+    union {
+        uint8_t u8;
+        int8_t  s8;
+    } b;
+    b.u8 = a;
+    return b.s8;
+}
+
 #endif /* AVCODEC_MATHOPS_H */