Fixes #8249
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -491,7 +491,7 @@ static int compute_sat_hue_metrics8(AVFilterContext *ctx, void *arg, int jobnr, · 490 unmodified lines | ||
| 491 | 491 | const int yuvu = p_u[i]; |
| 492 | 492 | const int yuvv = p_v[i]; |
| 493 | 493 | p_sat[i] = hypot(yuvu - 128, yuvv - 128); // int or round? |
| 494 | − ((int16_t*)p_hue)[i] = floor((180 / M_PI) * atan2f(yuvu-128, yuvv-128) + 180); | |
| 494 | + ((int16_t*)p_hue)[i] = fmod(floor((180 / M_PI) * atan2f(yuvu-128, yuvv-128) + 180), 360.); | |
| 495 | 495 | } |
| 496 | 496 | p_u += lsz_u; |
| 497 | 497 | p_v += lsz_v; |
| @@ -530,7 +530,7 @@ static int compute_sat_hue_metrics16(AVFilterContext *ctx, void *arg, int jobnr, · 32 unmodified lines | ||
| 530 | 530 | const int yuvu = p_u[i]; |
| 531 | 531 | const int yuvv = p_v[i]; |
| 532 | 532 | p_sat[i] = hypot(yuvu - mid, yuvv - mid); // int or round? |
| 533 | − ((int16_t*)p_hue)[i] = floor((180 / M_PI) * atan2f(yuvu-mid, yuvv-mid) + 180); | |
| 533 | + ((int16_t*)p_hue)[i] = fmod(floor((180 / M_PI) * atan2f(yuvu-mid, yuvv-mid) + 180), 360.); | |
| 534 | 534 | } |
| 535 | 535 | p_u += lsz_u; |
| 536 | 536 | p_v += lsz_v; |