summaryrefslogtreecommitdiff
path: root/libavfilter/vf_signalstats.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2021-08-20 07:34:17 +0200
committerPaul B Mahol <onemda@gmail.com>2021-08-20 07:34:17 +0200
commit7871b3ca5e8b0d73f1093ea232578ec7cee34b52 (patch)
tree88d2ffdfc0b59f77e36721b43a3d5537b45d011e /libavfilter/vf_signalstats.c
parented6ea4f9ca2e40222efc111d203423b27691a1f1 (diff)
avfilter/vf_signalstats: avoid doubles in calculations
Diffstat (limited to 'libavfilter/vf_signalstats.c')
-rw-r--r--libavfilter/vf_signalstats.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/vf_signalstats.c b/libavfilter/vf_signalstats.c
index fc8e81375f..6863f16803 100644
--- a/libavfilter/vf_signalstats.c
+++ b/libavfilter/vf_signalstats.c
@@ -485,8 +485,8 @@ static int compute_sat_hue_metrics8(AVFilterContext *ctx, void *arg, int jobnr,
for (i = 0; i < s->chromaw; i++) {
const int yuvu = p_u[i];
const int yuvv = p_v[i];
- p_sat[i] = hypot(yuvu - 128, yuvv - 128); // int or round?
- ((int16_t*)p_hue)[i] = fmod(floor((180 / M_PI) * atan2f(yuvu-128, yuvv-128) + 180), 360.);
+ p_sat[i] = hypotf(yuvu - 128, yuvv - 128); // int or round?
+ ((int16_t*)p_hue)[i] = fmodf(floorf((180.f / M_PI) * atan2f(yuvu-128, yuvv-128) + 180.f), 360.f);
}
p_u += lsz_u;
p_v += lsz_v;
@@ -524,8 +524,8 @@ static int compute_sat_hue_metrics16(AVFilterContext *ctx, void *arg, int jobnr,
for (i = 0; i < s->chromaw; i++) {
const int yuvu = p_u[i];
const int yuvv = p_v[i];
- p_sat[i] = hypot(yuvu - mid, yuvv - mid); // int or round?
- ((int16_t*)p_hue)[i] = fmod(floor((180 / M_PI) * atan2f(yuvu-mid, yuvv-mid) + 180), 360.);
+ p_sat[i] = hypotf(yuvu - mid, yuvv - mid); // int or round?
+ ((int16_t*)p_hue)[i] = fmodf(floorf((180.f / M_PI) * atan2f(yuvu-mid, yuvv-mid) + 180.f), 360.f);
}
p_u += lsz_u;
p_v += lsz_v;