Skip to content

Commit 60058f6

Browse files
committed
vo_gpu_next: don't set target peak for SDR output transfers
1 parent 570c5ec commit 60058f6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

video/out/vo_gpu_next.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,14 @@ static void apply_target_options(struct priv *p, struct pl_frame *target,
813813
// If swapchain returned a value use this, override is used in hint
814814
if (target_peak && !target->color.hdr.max_luma)
815815
target->color.hdr.max_luma = target_peak;
816+
// Don't set a target peak for SDR output. It rarely makes sense. If there's
817+
// a use case for it, we likely need separate options for SDR, as the target
818+
// peak almost never matches what we have in HDR mode. The exception is inverse
819+
// tone mapping mode, in which case we might want to upconvert SDR even
820+
// while in SDR mode.
821+
if (!pl_color_transfer_is_hdr(target->color.transfer) && !opts->tone_map.inverse)
822+
target->color.hdr.max_luma = 0;
823+
// Note that we still set min_luma in SDR mode, for bt.1886.
816824
if (!target->color.hdr.min_luma)
817825
apply_target_contrast(p, &target->color, min_luma);
818826
if (opts->target_gamut) {

0 commit comments

Comments
 (0)