mirror of
https://github.com/mpv-player/mpv
synced 2025-01-05 22:49:58 +00:00
vo_gpu: improve numerical accuracy of PQ OETF constant
Not a huge deal, but we can do the division in C, which makes the float constant larger.
This commit is contained in:
parent
4e8022da26
commit
11b58415d5
@ -380,7 +380,7 @@ void pass_linearize(struct gl_shader_cache *sc, enum mp_csp_trc trc)
|
||||
GLSLF("color.rgb = max(color.rgb - vec3(%f), vec3(0.0)) \n"
|
||||
" / (vec3(%f) - vec3(%f) * color.rgb);\n",
|
||||
PQ_C1, PQ_C2, PQ_C3);
|
||||
GLSLF("color.rgb = pow(color.rgb, vec3(1.0/%f));\n", PQ_M1);
|
||||
GLSLF("color.rgb = pow(color.rgb, vec3(%f));\n", 1.0 / PQ_M1);
|
||||
// PQ's output range is 0-10000, but we need it to be relative to to
|
||||
// MP_REF_WHITE instead, so rescale
|
||||
GLSLF("color.rgb *= vec3(%f);\n", 10000 / MP_REF_WHITE);
|
||||
|
Loading…
Reference in New Issue
Block a user