From 6e6c32ed6cc70f21e99c882e57944e272906c368 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Tue, 28 Jun 2016 13:55:10 +0200 Subject: vo_opengl: revise the logic for picking the default color space Too many "exceptions" these days, it's easier to just hard-code a whitelist instead of a blacklist. And besides, it only really makes sense to avoid adaptation for BT.601 specifically, since that's the one we auto-guess based on the resolution. --- video/out/opengl/video.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'video') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 89030a8952..fff41a1b91 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -2189,20 +2189,19 @@ static void pass_colormanage(struct gl_video *p, float peak_src, } } - // When auto-guessing the output color params, just pick the source color - // params to preserve the authentic "look and feel" of wrong/naive players. - // Some exceptions apply to source spaces that even hardcore technoluddites - // would probably not enjoy viewing unaltered if (prim_dst == MP_CSP_PRIM_AUTO) { - prim_dst = p->image_params.primaries; + // The vast majority of people are on sRGB or BT.709 displays, so pick + // this as the default output color space. + prim_dst = MP_CSP_PRIM_BT_709; - // Avoid outputting very wide gamut content automatically, since the - // majority target audience has standard gamut displays - if (prim_dst == MP_CSP_PRIM_BT_2020 || - prim_dst == MP_CSP_PRIM_PRO_PHOTO || - prim_dst == MP_CSP_PRIM_V_GAMUT) + if (p->image_params.primaries == MP_CSP_PRIM_BT_601_525 || + p->image_params.primaries == MP_CSP_PRIM_BT_601_625) { - prim_dst = MP_CSP_PRIM_BT_709; + // Since we auto-pick BT.601 and BT.709 based on the dimensions, + // combined with the fact that they're very similar to begin with, + // and to avoid confusing the average user, just don't adapt BT.601 + // content automatically at all. + prim_dst = p->image_params.primaries; } } -- cgit v1.2.3