00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AVUTIL_MATHEMATICS_H
00022 #define AVUTIL_MATHEMATICS_H
00023
00024 #include <stdint.h>
00025 #include <math.h>
00026 #include "attributes.h"
00027 #include "rational.h"
00028
00029 #ifndef M_E
00030 #define M_E 2.7182818284590452354
00031 #endif
00032 #ifndef M_LN2
00033 #define M_LN2 0.69314718055994530942
00034 #endif
00035 #ifndef M_LN10
00036 #define M_LN10 2.30258509299404568402
00037 #endif
00038 #ifndef M_LOG2_10
00039 #define M_LOG2_10 3.32192809488736234787
00040 #endif
00041 #ifndef M_PI
00042 #define M_PI 3.14159265358979323846
00043 #endif
00044 #ifndef M_SQRT1_2
00045 #define M_SQRT1_2 0.70710678118654752440
00046 #endif
00047 #ifndef M_SQRT2
00048 #define M_SQRT2 1.41421356237309504880
00049 #endif
00050 #ifndef NAN
00051 #define NAN (0.0/0.0)
00052 #endif
00053 #ifndef INFINITY
00054 #define INFINITY (1.0/0.0)
00055 #endif
00056
00057 enum AVRounding {
00058 AV_ROUND_ZERO = 0,
00059 AV_ROUND_INF = 1,
00060 AV_ROUND_DOWN = 2,
00061 AV_ROUND_UP = 3,
00062 AV_ROUND_NEAR_INF = 5,
00063 };
00064
00070 int64_t av_const av_gcd(int64_t a, int64_t b);
00071
00076 int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
00077
00082 int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const;
00083
00087 int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
00088
00095 int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
00096
00097
00098 #endif