From e64bceeac0cdf312d9481b3dd1ec1fda7ee2b94c Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 24 Jun 2012 22:20:21 +0300 Subject: configure: Check for sys/time.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apparently this include is needed on some systems for building the poll fallback (for the timeval struct for select?), but it isn't available on all systems. Thus only include it if it exists. Signed-off-by: Martin Storsjö --- configure | 2 ++ 1 file changed, 2 insertions(+) (limited to 'configure') diff --git a/configure b/configure index aa1856d673..52c25b484c 100755 --- a/configure +++ b/configure @@ -1148,6 +1148,7 @@ HAVE_LIST=" sys_resource_h sys_select_h sys_soundcard_h + sys_time_h sys_videoio_h threads trunc @@ -2873,6 +2874,7 @@ check_header sys/mman.h check_header sys/param.h check_header sys/resource.h check_header sys/select.h +check_header sys/time.h check_header unistd.h check_header vdpau/vdpau.h check_header vdpau/vdpau_x11.h -- cgit v1.2.3 From 153335625c429d2e4ab6a4d2d704d7eb91293290 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Fri, 22 Jun 2012 15:37:46 +0100 Subject: libm: provide fallback definition for cbrtf() using powf() This adds a fallback for cbrtf() using powf(x, 1/3). Since powf() with a non-integer exponent requires a non-negative base, special handling of negative inputs is needed. Signed-off-by: Mans Rullgard --- configure | 2 ++ libavutil/libm.h | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 52c25b484c..473393a4e8 100755 --- a/configure +++ b/configure @@ -1059,6 +1059,7 @@ HAVE_LIST=" asm_mod_y attribute_may_alias attribute_packed + cbrtf closesocket cmov dcbzl @@ -2918,6 +2919,7 @@ done check_lib math.h sin -lm && LIBM="-lm" enabled vaapi && require vaapi va/va.h vaInitialize -lva +check_mathfunc cbrtf check_mathfunc exp2 check_mathfunc exp2f check_mathfunc llrint diff --git a/libavutil/libm.h b/libavutil/libm.h index 783f3cdfab..b6d8a94fce 100644 --- a/libavutil/libm.h +++ b/libavutil/libm.h @@ -28,6 +28,13 @@ #include "config.h" #include "attributes.h" +#if !HAVE_CBRTF +static av_always_inline float cbrtf(float x) +{ + return x < 0 ? -powf(-x, 1.0 / 3.0) : powf(x, 1.0 / 3.0); +} +#endif + #if !HAVE_EXP2 #undef exp2 #define exp2(x) exp((x) * 0.693147180559945) -- cgit v1.2.3