Skip to content

Commit

Permalink
renderer: never use linear downscaling on HDR sources
Browse files Browse the repository at this point in the history
This logic regressed sometime in the move from mpv vo_gpu to libplacebo.

Fixes: mpv-player/mpv#11036
See-Also: mpv-player/mpv#4631
  • Loading branch information
haasn committed Dec 21, 2022
1 parent c62182d commit 030b59d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1875,12 +1875,10 @@ static bool pass_scale_main(struct pass_state *pass)
if (params->disable_linear_scaling || fbofmt->component_depth[0] < 16)
use_sigmoid = use_linear = false;

// Avoid sigmoidization for HDR content because it clips to [0,1]
if (pl_color_space_is_hdr(&img->color)) {
use_sigmoid = false;
if (fbofmt->type != PL_FMT_FLOAT)
use_linear = false; // linear HDR needs out-of-range signals
}
// Avoid sigmoidization for HDR content because it clips to [0,1], and
// linearization because it causes very nasty ringing artefacts.
if (pl_color_space_is_hdr(&img->color))
use_sigmoid = use_linear = false;

if (!use_linear && img->color.transfer == PL_COLOR_TRC_LINEAR) {
img->color.transfer = image->color.transfer;
Expand Down

0 comments on commit 030b59d

Please sign in to comment.