summaryrefslogtreecommitdiffstats
path: root/libavfilter/avf_avectorscope.c
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-10-12 01:30:22 -0400
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-10-22 16:13:26 -0400
commit8507b98c10d948653375400e2b0a3d4389f74be4 (patch)
tree2b17e0bd420990847602cc352c87328abace3483 /libavfilter/avf_avectorscope.c
parentdde8e5ad02ad60b149d9a532e67587f45f3aecc5 (diff)
downloadffmpeg-streaming-8507b98c10d948653375400e2b0a3d4389f74be4.zip
ffmpeg-streaming-8507b98c10d948653375400e2b0a3d4389f74be4.tar.gz
avfilter,swresample,swscale: use fabs, fabsf instead of FFABS
It is well known that fabs and fabsf are at least as fast and sometimes faster than the FFABS macro, at least on the gcc+glibc combination. For instance, see the reference: http://patchwork.sourceware.org/patch/6735/. This was a patch to glibc in order to remove their usages of a macro. The reason essentially boils down to fabs using the __builtin_fabs of the compiler, while FFABS needs to infer to not use a branch and to simply change the sign bit. Usually the inference works, but sometimes it does not. This may be easily checked by looking at the asm. This also has the added benefit of reducing macro usage, which has problems with side-effects. Note that avcodec is not handled here, as it is huge and most things there are integer arithmetic anyway. Tested with FATE. Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Diffstat (limited to 'libavfilter/avf_avectorscope.c')
-rw-r--r--libavfilter/avf_avectorscope.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/avf_avectorscope.c b/libavfilter/avf_avectorscope.c
index 30985f3..38dd97e 100644
--- a/libavfilter/avf_avectorscope.c
+++ b/libavfilter/avf_avectorscope.c
@@ -220,7 +220,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
cx = sx * sqrtf(1 - 0.5*sy*sy);
cy = sy * sqrtf(1 - 0.5*sx*sx);
x = hw + hw * FFSIGN(cx + cy) * (cx - cy) * .7;
- y = s->h - s->h * FFABS(cx + cy) * .7;
+ y = s->h - s->h * fabsf(cx + cy) * .7;
}
draw_dot(s, x, y);
@@ -244,7 +244,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
cx = sx * sqrtf(1 - 0.5 * sy * sy);
cy = sy * sqrtf(1 - 0.5 * sx * sx);
x = hw + hw * FFSIGN(cx + cy) * (cx - cy) * .7;
- y = s->h - s->h * FFABS(cx + cy) * .7;
+ y = s->h - s->h * fabsf(cx + cy) * .7;
}
draw_dot(s, x, y);
OpenPOWER on IntegriCloud