Skip to content
Snippets Groups Projects
Commit e29db08c authored by Ganesh Ajjanagadde's avatar Ganesh Ajjanagadde
Browse files

lavu/libm: add exp10 support


exp10 is a function available in GNU libm. Looks like no other common
libm has it. This adds support for it to FFmpeg.

There are essentially 2 ways of handling the fallback:
1. Using pow(10, x)
2. Using exp2(M_LOG2_10 * x).

First one represents a Pareto improvement, with no speed or accuracy
regression anywhere, but speed improvement limited to GNU libm.

Second one represents a slight accuracy loss (relative error ~ 1e-13)
for non GNU libm. Speedup of > 2x is obtained on non GNU libm platforms,
~30% on GNU libm. These are "average case numbers", another benefit is
the lack of triggering of the well-known terrible worst case paths
through pow.

Based on reviews, second one chosen. Comment added accordingly.

Reviewed-by: default avatarHendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
Reviewed-by: default avatarRonald S. Bultje <rsbultje@gmail.com>
Signed-off-by: default avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
parent 520a5d33
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment