summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-07-11 13:26:27 +0200
committerNiklas Haas <github-daiK1o@haasn.dev>2022-07-15 16:34:11 +0200
commit81c5ed5b137a626813aa6e134ace9897f6daa14e (patch)
treebc86bf13acfe75f8d234d480f1d94a2a74c61a34 /video/out
parent0044c19f0de29ff752eb708365322b0ec16b53e7 (diff)
downloadmpv-81c5ed5b137a626813aa6e134ace9897f6daa14e.tar.bz2
mpv-81c5ed5b137a626813aa6e134ace9897f6daa14e.tar.xz
vo_gpu: fix 3DLUT precision
Using cmsFLAGS_HIGHRESPRECALC results in Little-CMS generating an internal 49x49x49 3DLUT, from which it then samples our own 3DLUT. This is completely pointless and not only destroys the accuracy of the 3DLUT, but also results in no additional gain from increasing the 3DLUT precision further. The correct flag for us to be using is cmsFLAGS_NOOPTIMIZE, which suppresses this internal 3DLUT generation and gives us the full precision. We can also specify cmsFLAGS_NOCACHE, which is negligible but in theory prevents Little-CMS from unnecessary pixel equality tests.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/gpu/lcms.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/video/out/gpu/lcms.c b/video/out/gpu/lcms.c
index 17edf96f3b..09c4a696b1 100644
--- a/video/out/gpu/lcms.c
+++ b/video/out/gpu/lcms.c
@@ -289,7 +289,7 @@ static cmsHPROFILE get_vid_profile(struct gl_lcms *p, cmsContext cms,
cmsHPROFILE xyz_profile = cmsCreateXYZProfile();
cmsHTRANSFORM xyz2src = cmsCreateTransformTHR(cms,
xyz_profile, TYPE_XYZ_DBL, rev_profile, TYPE_RGB_DBL,
- intent, 0);
+ intent, cmsFLAGS_NOCACHE | cmsFLAGS_NOOPTIMIZE);
cmsFreeToneCurve(linear);
cmsCloseProfile(rev_profile);
cmsCloseProfile(xyz_profile);
@@ -429,7 +429,8 @@ bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **result_lut3d,
cmsHTRANSFORM trafo = cmsCreateTransformTHR(cms, vid_hprofile, TYPE_RGB_16,
profile, TYPE_RGBA_16,
p->opts->intent,
- cmsFLAGS_HIGHRESPRECALC |
+ cmsFLAGS_NOCACHE |
+ cmsFLAGS_NOOPTIMIZE |
cmsFLAGS_BLACKPOINTCOMPENSATION);
cmsCloseProfile(profile);
cmsCloseProfile(vid_hprofile);