diff options
authorzc62 <>2019-03-04 05:46:35 -0500
committersfan5 <>2019-03-09 12:55:44 +0100
commite37c253b9207980a33ff3789b560efa3c4b6eb3e (patch)
parent89eacf8131827533c956a9a10ec1519d2ebdcc31 (diff)
lcms: allow infinite contrast
Fixes #5980
2 files changed, 5 insertions, 3 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index d57ffa88d3..1f1c2138c9 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -5357,12 +5357,14 @@ The following video options are currently all specific to ``--vo=gpu`` and
Size of the 3D LUT generated from the ICC profile in each dimension.
Default is 64x64x64. Sizes may range from 2 to 512.
Specifies an upper limit on the target device's contrast ratio. This is
detected automatically from the profile if possible, but for some profiles
it might be missing, causing the contrast to be assumed as infinite. As a
result, video may appear darker than intended. This only affects BT.1886
- content. The default of 0 means no limit.
+ content. The default of 0 means no limit if the detected contrast is less
+ than 100000, and limits to 1000 otherwise. Use ``--icc-contrast=inf`` to
+ preserve the infinite contrast (most likely when using OLED displays).
Blend subtitles directly onto upscaled video frames, before interpolation
diff --git a/video/out/gpu/lcms.c b/video/out/gpu/lcms.c
index bc76db965f..a8f277d3f0 100644
--- a/video/out/gpu/lcms.c
+++ b/video/out/gpu/lcms.c
@@ -83,7 +83,7 @@ const struct m_sub_options mp_icc_conf = {
OPT_FLAG("icc-profile-auto", profile_auto, 0),
OPT_STRING("icc-cache-dir", cache_dir, M_OPT_FILE),
OPT_INT("icc-intent", intent, 0),
- OPT_INTRANGE("icc-contrast", contrast, 0, 0, 1000000),
+ OPT_CHOICE_OR_INT("icc-contrast", contrast, 0, 0, 1000000, ({"inf", -1})),
OPT_STRING_VALIDATE("icc-3dlut-size", size_str, 0, validate_3dlut_size_opt),
OPT_REPLACED("3dlut-size", "icc-3dlut-size"),