X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavutil%2Fmathematics.h;h=043dd0fafea85034edef9079c8662f815409ab48;hb=c4642788e83b0858bca449f9b6e71ddb015dfa5d;hp=0b072ebe63cfcda52b757737651ba4a1e0fab453;hpb=757cd8d876b18c07e00b53fd4e5c01bedc106d2e;p=ffmpeg diff --git a/libavutil/mathematics.h b/libavutil/mathematics.h index 0b072ebe63c..043dd0fafea 100644 --- a/libavutil/mathematics.h +++ b/libavutil/mathematics.h @@ -25,36 +25,19 @@ #include #include "attributes.h" #include "rational.h" +#include "intfloat.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_LOG2_10 #define M_LOG2_10 3.32192809488736234787 /* log_2 10 */ #endif #ifndef M_PHI #define M_PHI 1.61803398874989484820 /* phi / golden ratio */ #endif -#ifndef M_PI -#define M_PI 3.14159265358979323846 /* pi */ -#endif -#ifndef M_SQRT1_2 -#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ -#endif -#ifndef M_SQRT2 -#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ -#endif #ifndef NAN -#define NAN (0.0/0.0) +#define NAN av_int2float(0x7fc00000) #endif #ifndef INFINITY -#define INFINITY (1.0/0.0) +#define INFINITY av_int2float(0x7f800000) #endif /** @@ -95,6 +78,12 @@ int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_cons */ int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const; +/** + * Rescale a 64-bit integer by 2 rational numbers with specified rounding. + */ +int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq, + enum AVRounding) av_const; + /** * Compare 2 timestamps each in its own timebases. * The result of the function is undefined if one of the timestamps