1
mirror of https://github.com/mpv-player/mpv synced 2024-11-14 22:48:35 +01:00

vo_gpu_next: make dither-depth=auto mean 8 bpc for non-d3d11 SDR

Fixes the issue described in https://github.com/mpv-player/mpv/issues/11862
for SDR files for non-d3d11 gpu-api. We currently don't have a smarter
way to get the real on-the-wire bpc for other APIs, so this is the best
that can be done.
This commit is contained in:
llyyr 2024-03-06 15:49:01 +05:30 committed by Kacper Michajłow
parent 16ae76948d
commit f914947dda
2 changed files with 9 additions and 3 deletions

View File

@ -5554,8 +5554,10 @@ them.
no
Disable any dithering done by mpv.
auto
Automatic selection. If output bit depth cannot be detected, 8 bits per
component are assumed.
Automatic selection.
On ``vo=gpu``: if output bit depth cannot be detected, 8 bpc is assumed.
On ``vo=gpu-next``: with ``gpu-api=d3d11``, real on-the-wire bpc is used.
For other ``gpu-api``, 8 bpc is used for SDR content.
8
Dither to 8 bit output.

View File

@ -841,7 +841,11 @@ static void apply_target_options(struct priv *p, struct pl_frame *target)
int dither_depth = opts->dither_depth;
if (dither_depth == 0) {
struct ra_swapchain *sw = p->ra_ctx->swapchain;
dither_depth = sw->fns->color_depth ? sw->fns->color_depth(sw) : 0;
if (sw->fns->color_depth) {
dither_depth = sw->fns->color_depth(sw);
} else if (!pl_color_transfer_is_hdr(target->color.transfer)) {
dither_depth = 8;
}
}
if (dither_depth > 0) {
struct pl_bit_encoding *tbits = &target->repr.bits;