diff options
author | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2016-01-15 13:51:03 -0500 |
---|---|---|
committer | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2016-01-22 19:27:12 +0530 |
commit | 1fb5ae44c43de48fa497b29f559dcf32313f5290 (patch) | |
tree | 0306e4c315df12a9c215dd3bd36540e333b02ccf /libavcodec/wmadec.c | |
parent | cea529dd7f0d2d7fd1c7f33c5f778a051eedfaf9 (diff) | |
download | ffmpeg-1fb5ae44c43de48fa497b29f559dcf32313f5290.tar.gz |
lavc/wmadec: replace pow by faster functions
Further speedups possible by getting rid of exp2f...
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Diffstat (limited to 'libavcodec/wmadec.c')
-rw-r--r-- | libavcodec/wmadec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index da54182249..1a8432376b 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -35,6 +35,7 @@ #include "libavutil/attributes.h" #include "libavutil/internal.h" +#include "libavutil/libm.h" #include "avcodec.h" #include "internal.h" @@ -164,7 +165,7 @@ static av_cold void wma_lsp_to_curve_init(WMACodecContext *s, int frame_len) /* tables for x^-0.25 computation */ for (i = 0; i < 256; i++) { e = i - 126; - s->lsp_pow_e_table[i] = pow(2.0, e * -0.25); + s->lsp_pow_e_table[i] = exp2f(e * -0.25); } /* NOTE: these two tables are needed to avoid two operations in @@ -173,7 +174,7 @@ static av_cold void wma_lsp_to_curve_init(WMACodecContext *s, int frame_len) for (i = (1 << LSP_POW_BITS) - 1; i >= 0; i--) { m = (1 << LSP_POW_BITS) + i; a = (float) m * (0.5 / (1 << LSP_POW_BITS)); - a = pow(a, -0.25); + a = 1/sqrt(sqrt(a)); s->lsp_pow_m_table1[i] = 2 * a - b; s->lsp_pow_m_table2[i] = b - a; b = a; |