summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2015-02-28 20:15:12 +0100
committerNiklas Haas <git@nand.wakku.to>2015-02-28 20:23:47 +0100
commita76cc1dafcf948cce93f6d258e33444206a83c45 (patch)
tree89e3bb2afb4192ee1e8f54aa9943927535845269 /video/out
parent8d24e9d9b8ad1b5d82139980eca148dc0f4a1eab (diff)
downloadmpv-a76cc1dafcf948cce93f6d258e33444206a83c45.tar.bz2
mpv-a76cc1dafcf948cce93f6d258e33444206a83c45.tar.xz
Revert "Revert recent vo_opengl related commits"
Omitted a simple, but devastasting check. Fixed the relevant commits now. This reverts commit 8d24e9d9b8ad1b5d82139980eca148dc0f4a1eab. diff --git a/video/out/gl_video.c b/video/out/gl_video.c index 9c8a643..f1ea03e 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -1034,9 +1034,9 @@ static void compile_shaders(struct gl_video *p) shader_def_opt(&header_conv, "USE_CONV_GAMMA", use_conv_gamma); shader_def_opt(&header_conv, "USE_CONST_LUMA", use_const_luma); shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_BT1886", - gamma_fun == MP_CSP_TRC_BT_1886); + use_linear_light && gamma_fun == MP_CSP_TRC_BT_1886); shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_SRGB", - gamma_fun == MP_CSP_TRC_SRGB); + use_linear_light && gamma_fun == MP_CSP_TRC_SRGB); shader_def_opt(&header_conv, "USE_SIGMOID", use_sigmoid); if (p->opts.alpha_mode > 0 && p->has_alpha && p->plane_count > 3) shader_def(&header_conv, "USE_ALPHA_PLANE", "3");
Diffstat (limited to 'video/out')
-rw-r--r--video/out/gl_video.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 23b19b3125..f1ea03ed80 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -937,8 +937,7 @@ static void compile_shaders(struct gl_video *p)
bool use_input_gamma = p->input_gamma != 1.0;
bool use_conv_gamma = p->conv_gamma != 1.0;
bool use_const_luma = p->image_params.colorspace == MP_CSP_BT_2020_C;
-
- enum mp_csp_trc gamma_fun = MP_CSP_TRC_NONE;
+ enum mp_csp_trc gamma_fun = p->image_params.gamma;
// If either color correction option (3dlut or srgb) is enabled, or if
// sigmoidal upscaling is requested, or if the source is linear XYZ, we
@@ -946,20 +945,6 @@ static void compile_shaders(struct gl_video *p)
bool use_linear_light = p->opts.linear_scaling || p->opts.sigmoid_upscaling
|| use_cms || is_xyz;
- if (use_linear_light) {
- // We use the color level range to distinguish between PC
- // content like images, which are most likely sRGB, and TV content
- // like movies, which are most likely BT.1886. XYZ input is always
- // treated as linear.
- if (is_xyz) {
- gamma_fun = MP_CSP_TRC_LINEAR;
- } else if (p->image_params.colorlevels == MP_CSP_LEVELS_PC) {
- gamma_fun = MP_CSP_TRC_SRGB;
- } else {
- gamma_fun = MP_CSP_TRC_BT_1886;
- }
- }
-
// The inverse of the above transformation is normally handled by
// the CMS cases, but if CMS is disabled we need to go back manually
bool use_inv_bt1886 = false;
@@ -1049,9 +1034,9 @@ static void compile_shaders(struct gl_video *p)
shader_def_opt(&header_conv, "USE_CONV_GAMMA", use_conv_gamma);
shader_def_opt(&header_conv, "USE_CONST_LUMA", use_const_luma);
shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_BT1886",
- gamma_fun == MP_CSP_TRC_BT_1886);
+ use_linear_light && gamma_fun == MP_CSP_TRC_BT_1886);
shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_SRGB",
- gamma_fun == MP_CSP_TRC_SRGB);
+ use_linear_light && gamma_fun == MP_CSP_TRC_SRGB);
shader_def_opt(&header_conv, "USE_SIGMOID", use_sigmoid);
if (p->opts.alpha_mode > 0 && p->has_alpha && p->plane_count > 3)
shader_def(&header_conv, "USE_ALPHA_PLANE", "3");