summaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-12-07 23:05:05 -0500
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-12-08 22:00:05 -0500
commitc8905e0d67f54b3228ea0aec57b7087925c0508b (patch)
tree783d46a0a2ae60f28a515eec23668aa653a04937 /libswscale
parent42868ca569f33b91b0e61ecc3065e7199e9ca58a (diff)
downloadffmpeg-streaming-c8905e0d67f54b3228ea0aec57b7087925c0508b.zip
ffmpeg-streaming-c8905e0d67f54b3228ea0aec57b7087925c0508b.tar.gz
swscale/utils: replace pow by exp2
exp2 is a faster function. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 8fd0ab6..db937b1 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) {
OpenPOWER on IntegriCloud