X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=libavcodec%2Fwmadec.c;h=1a8432376bbb42e1fda57e4f9d935dd74fbe6522;hb=ebf648d490448d511b5fe970d76040169e65ef74;hp=da541822499336d2c88123d264aa26ceb56b1674;hpb=4440c8e9c98f138a04dafdec8f3d21ce8f07f7b9;p=ffmpeg diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index da541822499..1a8432376bb 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;