Commit a2bbfc85 authored by vitor's avatar vitor

Add replacements for log2f(), exp2() and exp2f() for platforms that lacks it.

Should fix build breakage on some platforms introduced in r21125.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@21155 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent a93ba093
...@@ -954,6 +954,8 @@ HAVE_LIST=" ...@@ -954,6 +954,8 @@ HAVE_LIST="
dos_paths dos_paths
ebp_available ebp_available
ebx_available ebx_available
exp2
exp2f
fast_64bit fast_64bit
fast_cmov fast_cmov
fast_unaligned fast_unaligned
...@@ -970,6 +972,7 @@ HAVE_LIST=" ...@@ -970,6 +972,7 @@ HAVE_LIST="
libdc1394_2 libdc1394_2
llrint llrint
log2 log2
log2f
loongson loongson
lrint lrint
lrintf lrintf
...@@ -2379,8 +2382,11 @@ done ...@@ -2379,8 +2382,11 @@ done
check_lib math.h sin -lm check_lib math.h sin -lm
check_lib va/va.h vaInitialize -lva check_lib va/va.h vaInitialize -lva
check_func exp2
check_func exp2f
check_func llrint check_func llrint
check_func log2 check_func log2
check_func log2f
check_func lrint check_func lrint
check_func lrintf check_func lrintf
check_func round check_func round
......
...@@ -263,6 +263,20 @@ if ((y) < (x)) {\ ...@@ -263,6 +263,20 @@ if ((y) < (x)) {\
}\ }\
} }
#if !HAVE_EXP2
static av_always_inline av_const double exp2(double x)
{
return exp(x * 0.693147180559945);
}
#endif /* HAVE_EXP2 */
#if !HAVE_EXP2F
static av_always_inline av_const float exp2f(float x)
{
return exp2(x);
}
#endif /* HAVE_EXP2F */
#if !HAVE_LLRINT #if !HAVE_LLRINT
static av_always_inline av_const long long llrint(double x) static av_always_inline av_const long long llrint(double x)
{ {
...@@ -277,6 +291,13 @@ static av_always_inline av_const double log2(double x) ...@@ -277,6 +291,13 @@ static av_always_inline av_const double log2(double x)
} }
#endif /* HAVE_LOG2 */ #endif /* HAVE_LOG2 */
#if !HAVE_LOG2F
static av_always_inline av_const float log2f(float x)
{
return log2(x);
}
#endif /* HAVE_LOG2F */
#if !HAVE_LRINT #if !HAVE_LRINT
static av_always_inline av_const long int lrint(double x) static av_always_inline av_const long int lrint(double x)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment