summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2020-10-21 14:39:59 +0200
committerNiklas Haas <git@haasn.xyz>2020-10-21 14:39:59 +0200
commitdc0e9644cd4e056a30e773851d20b8725d943035 (patch)
treeba6958a0c2c246ddac6379e8fb4f007760a12d22
parent9976c83e0f225c846004a1ddd83d80372ec83723 (diff)
downloadmpv-dc0e9644cd4e056a30e773851d20b8725d943035.tar.bz2
mpv-dc0e9644cd4e056a30e773851d20b8725d943035.tar.xz
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
-rw-r--r--video/out/gpu/video_shaders.c4
1 files changed, 2 insertions, 2 deletions
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
}