mirror of https://git.ffmpeg.org/ffmpeg.git
avfilter/vf_signalstats: avoid doubles in calculations
This commit is contained in:
parent
ed6ea4f9ca
commit
7871b3ca5e
|
@ -485,8 +485,8 @@ static int compute_sat_hue_metrics8(AVFilterContext *ctx, void *arg, int jobnr,
|
||||||
for (i = 0; i < s->chromaw; i++) {
|
for (i = 0; i < s->chromaw; i++) {
|
||||||
const int yuvu = p_u[i];
|
const int yuvu = p_u[i];
|
||||||
const int yuvv = p_v[i];
|
const int yuvv = p_v[i];
|
||||||
p_sat[i] = hypot(yuvu - 128, yuvv - 128); // int or round?
|
p_sat[i] = hypotf(yuvu - 128, yuvv - 128); // int or round?
|
||||||
((int16_t*)p_hue)[i] = fmod(floor((180 / M_PI) * atan2f(yuvu-128, yuvv-128) + 180), 360.);
|
((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_u += lsz_u;
|
||||||
p_v += lsz_v;
|
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++) {
|
for (i = 0; i < s->chromaw; i++) {
|
||||||
const int yuvu = p_u[i];
|
const int yuvu = p_u[i];
|
||||||
const int yuvv = p_v[i];
|
const int yuvv = p_v[i];
|
||||||
p_sat[i] = hypot(yuvu - mid, yuvv - mid); // int or round?
|
p_sat[i] = hypotf(yuvu - mid, yuvv - mid); // int or round?
|
||||||
((int16_t*)p_hue)[i] = fmod(floor((180 / M_PI) * atan2f(yuvu-mid, yuvv-mid) + 180), 360.);
|
((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_u += lsz_u;
|
||||||
p_v += lsz_v;
|
p_v += lsz_v;
|
||||||
|
|
Loading…
Reference in New Issue