summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-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);