[FFmpeg-cvslog] mathops: move macro to the only place it is used

Vittorio Giovara git at videolan.org
Tue Mar 4 14:05:38 CET 2014


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Sat Mar  1 13:01:43 2014 +0100| [5397386effba2e53e4ff82852a86f6be4d59e9c1] | committer: Vittorio Giovara

mathops: move macro to the only place it is used

This helps in disentangling lavf and lavc too.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5397386effba2e53e4ff82852a86f6be4d59e9c1
---

 libavcodec/mathops.h |    9 ---------
 libavformat/mpegts.c |    8 +++++++-
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h
index 6c216c2..0489a60 100644
--- a/libavcodec/mathops.h
+++ b/libavcodec/mathops.h
@@ -195,15 +195,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;
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 5962592..5a3561f 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -28,7 +28,6 @@
 #include "libavutil/opt.h"
 #include "libavcodec/bytestream.h"
 #include "libavcodec/get_bits.h"
-#include "libavcodec/mathops.h"
 #include "avformat.h"
 #include "mpegts.h"
 #include "internal.h"
@@ -45,6 +44,13 @@
 
 #define MAX_MP4_DESCR_COUNT 16
 
+#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)
+
 enum MpegTSFilterType {
     MPEGTS_PES,
     MPEGTS_SECTION,



More information about the ffmpeg-cvslog mailing list