From b32f2ef0d344e224a24ed72bf7abf394675ea58f Mon Sep 17 00:00:00 2001 From: nand Date: Sun, 23 Dec 2012 19:49:19 +0100 Subject: vo_opengl: use more precise gamma for BT.709 with color management MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change from gamma 2.2 to the slightly more precise 1/0.45 as per BT.709. https://www.itu.int/rec/R-REC-BT.709-5-200204-I/en mentions a value of γ=0.45 for the conceptual non-linear precorrection of video signals. This is approximately the inverse of 2.22, and not 2.20 as the code had been using until now. --- video/out/vo_opengl_shaders.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'video/out/vo_opengl_shaders.glsl') diff --git a/video/out/vo_opengl_shaders.glsl b/video/out/vo_opengl_shaders.glsl index 1f302889e4..13595ec77e 100644 --- a/video/out/vo_opengl_shaders.glsl +++ b/video/out/vo_opengl_shaders.glsl @@ -74,7 +74,7 @@ void main() { #ifdef USE_OSD_LINEAR_CONV // If no 3dlut is being used, we need to pull up to linear light for // the sRGB function. *IF* 3dlut is used, we do not. - color.rgb = pow(color.rgb, vec3(2.2)); + color.rgb = pow(color.rgb, vec3(1.0/0.45)); #endif #ifdef USE_OSD_3DLUT color = vec4(texture3D(lut_3d, color.rgb).rgb, color.a); @@ -331,12 +331,12 @@ void main() { color = mat3(colormatrix) * color + colormatrix[3]; #endif #ifdef USE_LINEAR_CONV - color = pow(color, vec3(2.2)); + color = pow(color, vec3(1.0/0.45)); #endif #ifdef USE_LINEAR_CONV_INV // Convert from linear RGB to gamma RGB before putting it through the 3D-LUT // in the final stage. - color = pow(color, vec3(1.0/2.2)); + color = pow(color, vec3(0.45)); #endif #ifdef USE_GAMMA_POW color = pow(color, inv_gamma); -- cgit v1.2.3