Skip to content

vo_gpu_next: use reported display contrast value also in SDR mode - #16928

Merged
kasper93 merged 2 commits into
mpv-player:masterfrom
kasper93:contrast
Oct 15, 2025
Merged

vo_gpu_next: use reported display contrast value also in SDR mode#16928
kasper93 merged 2 commits into
mpv-player:masterfrom
kasper93:contrast

Conversation

@kasper93

Copy link
Copy Markdown
Member

No description provided.

It is useful in SDR mode to use correct target-contrast too.
OLEDs report min luminance of 0.0002 nits, while we couldn't set this
with options due to limit. Set limit, so that we cannot exceed the hdr
black value used in libplacebo in worst case scenario of target peak 10
nits.
@kasper93
kasper93 marked this pull request as ready for review October 15, 2025 19:34
@kasper93 kasper93 added this to the Release v0.41.0 milestone Oct 15, 2025
@kasper93
kasper93 merged commit 233e896 into mpv-player:master Oct 15, 2025
28 checks passed
@verygoodlee

verygoodlee commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

On my SDR display, STATS page 1 shows HDR10

2025-10-16 215514

The value of video-target-params/min-luma was 0.203, and it became 0.5 after this PR

mpv/player/lua/stats.lua

Lines 821 to 833 in 233e896

local has_dml = has(hdr["min-luma"], 0.203) or has(hdr["max-luma"], 203)
local has_cll = hdr["max-cll"] and hdr["max-cll"] > 0
local has_fall = hdr["max-fall"] and hdr["max-fall"] > 0
if has_dml or has_cll or has_fall then
append(s, "", {prefix="HDR10:"})
if has_dml then
-- libplacebo uses close to zero values as "defined zero"
hdr["min-luma"] = hdr["min-luma"] <= 1e-6 and 0 or hdr["min-luma"]
append(s, format("%.2g / %.0f", hdr["min-luma"], hdr["max-luma"]),
{prefix=display_prefix, suffix=" cd/m²", nl="", indent=indent})
indent = o.prefix_sep .. o.prefix_sep
end

@kasper93

Copy link
Copy Markdown
Member Author

On my SDR display, STATS page 1 shows HDR10

2025-10-16 215514

The value of video-target-params/min-luma was 0.203, and it became 0.5 after this PR

mpv/player/lua/stats.lua

Lines 821 to 833 in 233e896

local has_dml = has(hdr["min-luma"], 0.203) or has(hdr["max-luma"], 203)
local has_cll = hdr["max-cll"] and hdr["max-cll"] > 0
local has_fall = hdr["max-fall"] and hdr["max-fall"] > 0
if has_dml or has_cll or has_fall then
append(s, "", {prefix="HDR10:"})
if has_dml then
-- libplacebo uses close to zero values as "defined zero"
hdr["min-luma"] = hdr["min-luma"] <= 1e-6 and 0 or hdr["min-luma"]
append(s, format("%.2g / %.0f", hdr["min-luma"], hdr["max-luma"]),
{prefix=display_prefix, suffix=" cd/m²", nl="", indent=indent})
indent = o.prefix_sep .. o.prefix_sep
end

If this is what is reported, sounds good. You can adjust contrast if needed.

@verygoodlee

Copy link
Copy Markdown
Contributor

It's unreasonable to identify a 203 nits display as HDR10, #16702 may need optimization

@Jules-A

Jules-A commented Oct 17, 2025

Copy link
Copy Markdown

It's honestly a bit confusing since my monitor was marketed as being HDR ready but it was awful I never enabled it and in the last few years it became impossible to even enable in Windows but games were able to request it (like CoD which enabled it by default despite Windows being in SDR mode).

Also, previously I set target-contrast to 950 (from the then capped 1000) to workaround some issues with gamma (currently shows 0.21 / 203 cd/m² but now that looks very wrong since some other changes that seem to have occurred. If I remove it, I see 0.049 / 203 cd/m².

@kasper93
kasper93 deleted the contrast branch October 17, 2025 10:30
@kasper93

Copy link
Copy Markdown
Member Author

Also, previously I set target-contrast to 950 (from the then capped 1000) to workaround some issues with gamma (currently shows 0.21 / 203 cd/m² but now that looks very wrong since some other changes that seem to have occurred. If I remove it, I see 0.049 / 203 cd/m².

In which scenario looks wrong? Generally you can adjust --target-contrast to make it look like you want really.

@Jules-A

Jules-A commented Oct 17, 2025

Copy link
Copy Markdown

In which scenario looks wrong? Generally you can adjust --target-contrast to make it look like you want really.

Both look very wrong now and super bright/washed out, for now I've settled with target-contrast=7800 which isn't perfect. Setting to icc-profile-auto (sets that figure to 0) looks far more natural but blacks are getting crushed. I could probably find a better solution but with so much changing on MPV/libplacebo side and probably going to get a new monitor soonish, I'm not going to bother.

EDIT: Decreasing target-peak significantly improved dark scenes but scenes with a lot of bright whites got messed up so just switched to setting higher contrast for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants