summaryrefslogtreecommitdiffstats
path: root/libavcodec/mathops.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-06 16:14:33 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-06 16:23:32 +0200
commit0df55e1ba88600a14ed2bd5921fdf8279d63ae08 (patch)
tree3ae5c6e44af564a24e924c938fb41eddb193300d /libavcodec/mathops.h
parent91062ddef18e94d54e4b37b288c77c11947d8756 (diff)
parenta22ae9f0c579793f411e2bd7a8db557091a3a4ae (diff)
downloadffmpeg-streaming-0df55e1ba88600a14ed2bd5921fdf8279d63ae08.zip
ffmpeg-streaming-0df55e1ba88600a14ed2bd5921fdf8279d63ae08.tar.gz
Merge commit 'a22ae9f0c579793f411e2bd7a8db557091a3a4ae'
* commit 'a22ae9f0c579793f411e2bd7a8db557091a3a4ae': mpegts: Remove one 64-bit integer modulus operation per packet Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 592f5a5..1d57342 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;
OpenPOWER on IntegriCloud