From dc0e9644cd4e056a30e773851d20b8725d943035 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Wed, 21 Oct 2020 14:39:59 +0200 Subject: vo_gpu: improve gamut warning bounds checks Test for signals exceeding 0.5% of the permitted gamut, in either direction. (Before, it was 1% above and 0% below) Should fix https://github.com/mpv-player/mpv/issues/8161 --- video/out/gpu/video_shaders.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'video/out') diff --git a/video/out/gpu/video_shaders.c b/video/out/gpu/video_shaders.c index a85b02ddee..da48929328 100644 --- a/video/out/gpu/video_shaders.c +++ b/video/out/gpu/video_shaders.c @@ -898,8 +898,8 @@ void pass_color_map(struct gl_shader_cache *sc, bool is_linear, // Warn for remaining out-of-gamut colors is enabled if (opts->gamut_warning) { - GLSL(if (any(greaterThan(color.rgb, vec3(1.01))) || - any(lessThan(color.rgb, vec3(0.0))))) + GLSL(if (any(greaterThan(color.rgb, vec3(1.005))) || + any(lessThan(color.rgb, vec3(-0.005))))) GLSL(color.rgb = vec3(1.0) - color.rgb;) // invert } -- cgit v1.2.3