summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2019-01-03 01:29:08 +0100
committerJan Ekström <jeebjp@gmail.com>2019-02-18 01:54:06 +0200
commit11b58415d51e14760ffb0302d9c6d86a504a2b57 (patch)
treeac6a71cfb37ee308575623e74fbea64d03fdcce2
parent4e8022da269d02c3bb23e4e119e4b1dc9aa3f3e4 (diff)
downloadmpv-11b58415d51e14760ffb0302d9c6d86a504a2b57.tar.bz2
mpv-11b58415d51e14760ffb0302d9c6d86a504a2b57.tar.xz
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.
-rw-r--r--video/out/gpu/video_shaders.c2
1 files changed, 1 insertions, 1 deletions
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);