summaryrefslogtreecommitdiff
path: root/libavcodec/mathops.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mathops.h')
-rw-r--r--libavcodec/mathops.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h
index 551017e8d9..8a2ce90d6a 100644
--- a/libavcodec/mathops.h
+++ b/libavcodec/mathops.h
@@ -195,6 +195,15 @@ 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;