From 11b58415d51e14760ffb0302d9c6d86a504a2b57 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Thu, 3 Jan 2019 01:29:08 +0100 Subject: 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. --- video/out/gpu/video_shaders.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/out/gpu/video_shaders.c b/video/out/gpu/video_shaders.c index 127db58ea2..3b6c9d01af 100644 --- a/video/out/gpu/video_shaders.c +++ b/video/out/gpu/video_shaders.c @@ -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); -- cgit v1.2.3