mirror of
https://github.com/mpv-player/mpv
synced 2025-03-11 08:37:59 +00:00
vo_gpu: fix extreme clipping with --gamut-clipping for HDR outputs
Checking against 1.0 is wrong for this code, because it's in an absolute luminance scale relative to reference white. We should be normalizing this by `dst.sig_peak`.
This commit is contained in:
parent
f4e89dde36
commit
6c1dd02f32
@ -888,7 +888,8 @@ void pass_color_map(struct gl_shader_cache *sc, bool is_linear,
|
||||
float coeff = cmin / (cmin - luma);
|
||||
color.rgb = mix(color.rgb, vec3(luma), coeff);
|
||||
})
|
||||
GLSL(float cmax = max(max(color.r, color.g), color.b);)
|
||||
GLSLF("float cmax = 1.0/%f * max(max(color.r, color.g), color.b);\n",
|
||||
dst.sig_peak);
|
||||
GLSL(if (cmax > 1.0) color.rgb /= cmax;)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user