summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornand <git@nand.wakku.to>2014-02-09 14:26:27 +0100
committerwm4 <wm4@nowhere>2014-02-12 22:32:56 +0100
commit674cc1d3a93d2bfb8e1964d26f4e073af74f0c24 (patch)
tree8423b1e12c343ee6bf58e9b45085172967f93552
parentc47bb9ca4272012cf53325a2df3047d8d2a32d2c (diff)
downloadmpv-674cc1d3a93d2bfb8e1964d26f4e073af74f0c24.tar.bz2
mpv-674cc1d3a93d2bfb8e1964d26f4e073af74f0c24.tar.xz
vo_opengl: use exactly the values defined by BT.709 for CMS
I could not see any difference whatsoever, but for usage with a 3DLUT there's zero performance difference so we might as well follow the spec to the letter.
-rw-r--r--video/out/gl_lcms.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/video/out/gl_lcms.c b/video/out/gl_lcms.c
index 01e40f9e92..c1d79b5989 100644
--- a/video/out/gl_lcms.c
+++ b/video/out/gl_lcms.c
@@ -157,14 +157,20 @@ struct lut3d *mp_load_icc(struct mp_icc_opts *opts, struct mp_log *log,
if (!profile)
goto error_exit;
- cmsCIExyY d65;
- cmsWhitePointFromTemp(&d65, 6504);
+ cmsCIExyY d65 = {0.3127, 0.3290, 1.0};
static const cmsCIExyYTRIPLE bt709prim = {
.Red = {0.64, 0.33, 1.0},
.Green = {0.30, 0.60, 1.0},
.Blue = {0.15, 0.06, 1.0},
};
- cmsToneCurve *tonecurve = cmsBuildGamma(NULL, 1.0/0.45);
+
+ /* Rec BT.709 defines the tone curve as:
+ V = 1.099 * L^0.45 - 0.099 for L >= 0.018
+ V = 4.500 * L for L < 0.018
+
+ The 0.18 parameter comes from inserting 0.018 into the function */
+ cmsToneCurve *tonecurve = cmsBuildParametricToneCurve(NULL, 4,
+ (cmsFloat64Number[5]){1/0.45, 1/1.099, 0.099, 1/4.5, 0.18});
cmsHPROFILE vid_profile = cmsCreateRGBProfile(&d65, &bt709prim,
(cmsToneCurve*[3]){tonecurve, tonecurve, tonecurve});
cmsFreeToneCurve(tonecurve);