1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00

lavu/libm: misc, minor changes

Addition of comments marking the end of ifdef blocks, correction of an
incorrect (at double precision) M_LN2, removal of an unnecessary undef.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
This commit is contained in:
Ganesh Ajjanagadde 2015-12-25 09:20:27 -08:00
parent b218ad4628
commit 5630ed5be6

View File

@ -38,31 +38,31 @@
#if !HAVE_ATANF #if !HAVE_ATANF
#undef atanf #undef atanf
#define atanf(x) ((float)atan(x)) #define atanf(x) ((float)atan(x))
#endif #endif /* HAVE_ATANF */
#if !HAVE_ATAN2F #if !HAVE_ATAN2F
#undef atan2f #undef atan2f
#define atan2f(y, x) ((float)atan2(y, x)) #define atan2f(y, x) ((float)atan2(y, x))
#endif #endif /* HAVE_ATAN2F */
#if !HAVE_POWF #if !HAVE_POWF
#undef powf #undef powf
#define powf(x, y) ((float)pow(x, y)) #define powf(x, y) ((float)pow(x, y))
#endif #endif /* HAVE_POWF */
#if !HAVE_CBRT #if !HAVE_CBRT
static av_always_inline double cbrt(double x) static av_always_inline double cbrt(double x)
{ {
return x < 0 ? -pow(-x, 1.0 / 3.0) : pow(x, 1.0 / 3.0); return x < 0 ? -pow(-x, 1.0 / 3.0) : pow(x, 1.0 / 3.0);
} }
#endif #endif /* HAVE_CBRT */
#if !HAVE_CBRTF #if !HAVE_CBRTF
static av_always_inline float cbrtf(float x) static av_always_inline float cbrtf(float x)
{ {
return x < 0 ? -powf(-x, 1.0 / 3.0) : powf(x, 1.0 / 3.0); return x < 0 ? -powf(-x, 1.0 / 3.0) : powf(x, 1.0 / 3.0);
} }
#endif #endif /* HAVE_CBRTF */
#if !HAVE_COPYSIGN #if !HAVE_COPYSIGN
static av_always_inline double copysign(double x, double y) static av_always_inline double copysign(double x, double y)
@ -71,12 +71,12 @@ static av_always_inline double copysign(double x, double y)
uint64_t vy = av_double2int(y); uint64_t vy = av_double2int(y);
return av_int2double((vx & UINT64_C(0x7fffffffffffffff)) | (vy & UINT64_C(0x8000000000000000))); return av_int2double((vx & UINT64_C(0x7fffffffffffffff)) | (vy & UINT64_C(0x8000000000000000)));
} }
#endif #endif /* HAVE_COPYSIGN */
#if !HAVE_COSF #if !HAVE_COSF
#undef cosf #undef cosf
#define cosf(x) ((float)cos(x)) #define cosf(x) ((float)cos(x))
#endif #endif /* HAVE_COSF */
#if !HAVE_ERF #if !HAVE_ERF
static inline double ff_eval_poly(const double *coeff, int size, double x) { static inline double ff_eval_poly(const double *coeff, int size, double x) {
@ -276,16 +276,16 @@ static inline double erf(double z)
else else
return 1; return 1;
} }
#endif #endif /* HAVE_ERF */
#if !HAVE_EXPF #if !HAVE_EXPF
#undef expf #undef expf
#define expf(x) ((float)exp(x)) #define expf(x) ((float)exp(x))
#endif #endif /* HAVE_EXPF */
#if !HAVE_EXP2 #if !HAVE_EXP2
#undef exp2 #undef exp2
#define exp2(x) exp((x) * 0.693147180559945) #define exp2(x) exp((x) * M_LN2)
#endif /* HAVE_EXP2 */ #endif /* HAVE_EXP2 */
#if !HAVE_EXP2F #if !HAVE_EXP2F
@ -362,7 +362,6 @@ static av_always_inline av_const int avpriv_isnan(double x)
#endif /* HAVE_ISNAN */ #endif /* HAVE_ISNAN */
#if !HAVE_HYPOT #if !HAVE_HYPOT
#undef hypot
static inline av_const double hypot(double x, double y) static inline av_const double hypot(double x, double y)
{ {
double ret, temp; double ret, temp;
@ -387,7 +386,7 @@ static inline av_const double hypot(double x, double y)
#if !HAVE_LDEXPF #if !HAVE_LDEXPF
#undef ldexpf #undef ldexpf
#define ldexpf(x, exp) ((float)ldexp(x, exp)) #define ldexpf(x, exp) ((float)ldexp(x, exp))
#endif #endif /* HAVE_LDEXPF */
#if !HAVE_LLRINT #if !HAVE_LLRINT
#undef llrint #undef llrint
@ -412,12 +411,12 @@ static inline av_const double hypot(double x, double y)
#if !HAVE_LOG10F #if !HAVE_LOG10F
#undef log10f #undef log10f
#define log10f(x) ((float)log10(x)) #define log10f(x) ((float)log10(x))
#endif #endif /* HAVE_LOG10F */
#if !HAVE_SINF #if !HAVE_SINF
#undef sinf #undef sinf
#define sinf(x) ((float)sin(x)) #define sinf(x) ((float)sin(x))
#endif #endif /* HAVE_SINF */
#if !HAVE_RINT #if !HAVE_RINT
static inline double rint(double x) static inline double rint(double x)