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:
Niklas Haas 2019-01-03 01:29:08 +01:00 committed by Jan Ekström
parent 4e8022da26
commit 11b58415d5
1 changed files with 1 additions and 1 deletions

View File

@ -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);