summaryrefslogtreecommitdiff
path: root/libavutil/mathematics.h
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2008-08-13 10:04:59 +0000
committerAurelien Jacobs <aurel@gnuage.org>2008-08-13 10:04:59 +0000
commitd1a12956a0196a1745c121e586befdc311bf8a89 (patch)
tree11aa9e79fa2d81d0fe9525016348523f5a0949c0 /libavutil/mathematics.h
parent29d3ed3be648f07f14eedade868c9318fd63bc3f (diff)
define some math constants so as not to depend on _XOPEN_SOURCE
Originally committed as revision 14725 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/mathematics.h')
-rw-r--r--libavutil/mathematics.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavutil/mathematics.h b/libavutil/mathematics.h
index a9dfe7eccf..244baca020 100644
--- a/libavutil/mathematics.h
+++ b/libavutil/mathematics.h
@@ -22,8 +22,22 @@
#define FFMPEG_MATHEMATICS_H
#include <stdint.h>
+#include <math.h>
#include "rational.h"
+#ifndef M_E
+#define M_E 2.7182818284590452354 /* e */
+#endif
+#ifndef M_LN2
+#define M_LN2 0.69314718055994530942 /* log_e 2 */
+#endif
+#ifndef M_LN10
+#define M_LN10 2.30258509299404568402 /* log_e 10 */
+#endif
+#ifndef M_SQRT1_2
+#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
+#endif
+
enum AVRounding {
AV_ROUND_ZERO = 0, ///< round toward zero
AV_ROUND_INF = 1, ///< round away from zero