From c8905e0d67f54b3228ea0aec57b7087925c0508b Mon Sep 17 00:00:00 2001 From: Ganesh Ajjanagadde Date: Mon, 7 Dec 2015 23:05:05 -0500 Subject: [PATCH] swscale/utils: replace pow by exp2 exp2 is a faster function. Reviewed-by: Michael Niedermayer Signed-off-by: Ganesh Ajjanagadde --- libswscale/utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libswscale/utils.c b/libswscale/utils.c index 8fd0ab6921..db937b160f 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -45,6 +45,7 @@ #include "libavutil/cpu.h" #include "libavutil/imgutils.h" #include "libavutil/intreadwrite.h" +#include "libavutil/libm.h" #include "libavutil/mathematics.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" @@ -451,7 +452,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos, coeff *= fone >> (30 + 16); } else if (flags & SWS_GAUSS) { double p = param[0] != SWS_PARAM_DEFAULT ? param[0] : 3.0; - coeff = (pow(2.0, -p * floatd * floatd)) * fone; + coeff = exp2(-p * floatd * floatd) * fone; } else if (flags & SWS_SINC) { coeff = (d ? sin(floatd * M_PI) / (floatd * M_PI) : 1.0) * fone; } else if (flags & SWS_LANCZOS) {