Commit c8905e0d authored by Ganesh Ajjanagadde's avatar Ganesh Ajjanagadde

swscale/utils: replace pow by exp2

exp2 is a faster function.
Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
parent 42868ca5
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/imgutils.h" #include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/libm.h"
#include "libavutil/mathematics.h" #include "libavutil/mathematics.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
...@@ -451,7 +452,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos, ...@@ -451,7 +452,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
coeff *= fone >> (30 + 16); coeff *= fone >> (30 + 16);
} else if (flags & SWS_GAUSS) { } else if (flags & SWS_GAUSS) {
double p = param[0] != SWS_PARAM_DEFAULT ? param[0] : 3.0; 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) { } else if (flags & SWS_SINC) {
coeff = (d ? sin(floatd * M_PI) / (floatd * M_PI) : 1.0) * fone; coeff = (d ? sin(floatd * M_PI) / (floatd * M_PI) : 1.0) * fone;
} else if (flags & SWS_LANCZOS) { } else if (flags & SWS_LANCZOS) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment