summaryrefslogtreecommitdiff
path: root/libavutil/internal.h
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanag@gmail.com>2016-03-14 21:28:56 -0400
committerGanesh Ajjanagadde <gajjanag@gmail.com>2016-03-22 10:15:31 -0700
commitdb1a642cd213804ed1579a19c9f5db08407dad9b (patch)
tree03b30c952698571c0544f3591f835d4aacd1745a /libavutil/internal.h
parent124526ba1aee5b616b9f6cf2da6b5db85d05711d (diff)
downloadffmpeg-db1a642cd213804ed1579a19c9f5db08407dad9b.tar.gz
all: move ff_exp10, ff_exp10f, ff_fast_powf to lavu/ffmath.h
The idea is to use ffmath.h for internal implementations of math functions. Currently, it is used for variants of libm functions, but is by no means limited to such things. Note that this is not exported; use lavu/mathematics for such purposes. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
Diffstat (limited to 'libavutil/internal.h')
-rw-r--r--libavutil/internal.h36
1 files changed, 0 insertions, 36 deletions
diff --git a/libavutil/internal.h b/libavutil/internal.h
index 340e18bc5d..61784b5128 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -295,42 +295,6 @@ static av_always_inline av_const int64_t ff_rint64_clip(double a, int64_t amin,
}
/**
- * Compute 10^x for floating point values. Note: this function is by no means
- * "correctly rounded", and is meant as a fast, reasonably accurate approximation.
- * For instance, maximum relative error for the double precision variant is
- * ~ 1e-13 for very small and very large values.
- * This is ~2x faster than GNU libm's approach, which is still off by 2ulp on
- * some inputs.
- * @param x exponent
- * @return 10^x
- */
-static av_always_inline double ff_exp10(double x)
-{
- return exp2(M_LOG2_10 * x);
-}
-
-static av_always_inline float ff_exp10f(float x)
-{
- return exp2f(M_LOG2_10 * x);
-}
-
-/**
- * Compute x^y for floating point x, y. Note: this function is faster than the
- * libm variant due to mainly 2 reasons:
- * 1. It does not handle any edge cases. In particular, this is only guaranteed
- * to work correctly for x > 0.
- * 2. It is not as accurate as a standard nearly "correctly rounded" libm variant.
- * @param x base
- * @param y exponent
- * @return x^y
- */
-static av_always_inline float ff_fast_powf(float x, float y)
-{
- return expf(logf(x) * y);
-}
-
-
-/**
* A wrapper for open() setting O_CLOEXEC.
*/
av_warn_unused_result