diff options
author | Måns Rullgård <mans@mansr.com> | 2010-03-09 15:10:23 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-03-09 15:10:23 +0000 |
commit | 335ee1aaddd4de450d95352205f68373ec51bae5 (patch) | |
tree | 0b6f288df48252cb3a8c60359fba5a280a8bb0e4 /libavutil/internal.h | |
parent | 03f8fc0897c128028111182e6276139fa00b891b (diff) | |
download | ffmpeg-335ee1aaddd4de450d95352205f68373ec51bae5.tar.gz |
Move libm replacements to new header libm.h
ffmpeg.c uses lrintf(), which is missing on some systems. Previously
it picked up the replacement via libavutil/internal.h due to
HAVE_AV_CONFIG_H being erroneously defined.
Moving these replacements to a separate header enables ffmpeg.c to
use them without being exposed to internal interfaces.
This use of a non-public header is justified by the header in question
not being part of the internal interface either. It should rather be
considered as part of the build system, which is shared between the
libraries and the applications.
This header cannot be installed since the tested conditions depend on
the compiler.
Originally committed as revision 22399 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/internal.h')
-rw-r--r-- | libavutil/internal.h | 60 |
1 files changed, 1 insertions, 59 deletions
diff --git a/libavutil/internal.h b/libavutil/internal.h index a9c2ff5e7e..eac7bd3012 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -192,65 +192,7 @@ }\ } -#if !HAVE_EXP2 -#undef exp2 -#define exp2(x) exp((x) * 0.693147180559945) -#endif /* HAVE_EXP2 */ - -#if !HAVE_EXP2F -#undef exp2f -#define exp2f(x) ((float)exp2(x)) -#endif /* HAVE_EXP2F */ - -#if !HAVE_LLRINT -#undef llrint -#define llrint(x) ((long long)rint(x)) -#endif /* HAVE_LLRINT */ - -#if !HAVE_LOG2 -#undef log2 -#define log2(x) (log(x) * 1.44269504088896340736) -#endif /* HAVE_LOG2 */ - -#if !HAVE_LOG2F -#undef log2f -#define log2f(x) ((float)log2(x)) -#endif /* HAVE_LOG2F */ - -#if !HAVE_LRINT -static av_always_inline av_const long int lrint(double x) -{ - return rint(x); -} -#endif /* HAVE_LRINT */ - -#if !HAVE_LRINTF -static av_always_inline av_const long int lrintf(float x) -{ - return (int)(rint(x)); -} -#endif /* HAVE_LRINTF */ - -#if !HAVE_ROUND -static av_always_inline av_const double round(double x) -{ - return (x > 0) ? floor(x + 0.5) : ceil(x - 0.5); -} -#endif /* HAVE_ROUND */ - -#if !HAVE_ROUNDF -static av_always_inline av_const float roundf(float x) -{ - return (x > 0) ? floor(x + 0.5) : ceil(x - 0.5); -} -#endif /* HAVE_ROUNDF */ - -#if !HAVE_TRUNCF -static av_always_inline av_const float truncf(float x) -{ - return (x > 0) ? floor(x) : ceil(x); -} -#endif /* HAVE_TRUNCF */ +#include "libm.h" /** * Returns NULL if CONFIG_SMALL is true, otherwise the argument |