diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-06 16:14:33 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-06 16:23:32 +0200 |
commit | 0df55e1ba88600a14ed2bd5921fdf8279d63ae08 (patch) | |
tree | 3ae5c6e44af564a24e924c938fb41eddb193300d /libavcodec/mathops.h | |
parent | 91062ddef18e94d54e4b37b288c77c11947d8756 (diff) | |
parent | a22ae9f0c579793f411e2bd7a8db557091a3a4ae (diff) | |
download | ffmpeg-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.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h index 592f5a5e75..1d573424f4 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; |