summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/lcms.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2023-09-14 20:31:57 +0200
committerNiklas Haas <github-daiK1o@haasn.dev>2023-09-15 10:58:37 +0200
commit40de03fdba6cef8963f991e621866977977ef437 (patch)
tree989988f377121590b16169e19506df06e805b3cf /video/out/gpu/lcms.c
parent400c12fe00c48c55da2f682266cbdd245713a14c (diff)
downloadmpv-40de03fdba6cef8963f991e621866977977ef437.tar.bz2
mpv-40de03fdba6cef8963f991e621866977977ef437.tar.xz
vo_gpu: vo_gpu_next: support --icc-3dlut-size=auto
And make it the default. In libplacebo, this uses internal heuristics to pick a good size based on the actual ICC characteristics. This is significantly less wasteful than always generating a 64x64x64 3DLUT (the old status quo). In vo_gpu, for simplicity, just default to 65x65x65. Note that this provides slightly better accuracy than the old default of 64x64x64 for technical reasons, and matches what libplacebo defaults to for typical display profiles.
Diffstat (limited to 'video/out/gpu/lcms.c')
-rw-r--r--video/out/gpu/lcms.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/video/out/gpu/lcms.c b/video/out/gpu/lcms.c
index 47ea160d8c..360363385c 100644
--- a/video/out/gpu/lcms.c
+++ b/video/out/gpu/lcms.c
@@ -326,6 +326,12 @@ bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **result_lut3d,
if (!gl_lcms_has_profile(p))
return false;
+ // For simplicity, default to 65x65x65, which is large enough to cover
+ // typical profiles with good accuracy while not being too wasteful
+ s_r = s_r ? s_r : 65;
+ s_g = s_g ? s_g : 65;
+ s_b = s_b ? s_b : 65;
+
void *tmp = talloc_new(NULL);
uint16_t *output = talloc_array(tmp, uint16_t, s_r * s_g * s_b * 4);
struct lut3d *lut = NULL;
@@ -514,7 +520,7 @@ const struct m_sub_options mp_icc_conf = {
},
.size = sizeof(struct mp_icc_opts),
.defaults = &(const struct mp_icc_opts) {
- .size_str = "64x64x64",
+ .size_str = "auto",
.intent = MP_INTENT_RELATIVE_COLORIMETRIC,
.use_embedded = true,
.cache = true,