[FFmpeg-cvslog] swscale/utils: replace pow by exp2
Ganesh Ajjanagadde
git at videolan.org
Wed Dec 9 04:03:59 CET 2015
ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Mon Dec 7 23:05:05 2015 -0500| [c8905e0d67f54b3228ea0aec57b7087925c0508b] | committer: Ganesh Ajjanagadde
swscale/utils: replace pow by exp2
exp2 is a faster function.
Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c8905e0d67f54b3228ea0aec57b7087925c0508b
---
libswscale/utils.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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) {
More information about the ffmpeg-cvslog
mailing list