diff options
author | llyyr <llyyr@yukari.in> | 2024-03-06 15:49:01 +0530 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2024-03-19 09:06:01 +0100 |
commit | f914947dda421aa5903084cf1813412c8bacb003 (patch) | |
tree | 461459a478189e342576707a7c94feb15b949350 | |
parent | 16ae76948d85e9f298f77fa7401189acff19c11f (diff) | |
download | mpv-f914947dda421aa5903084cf1813412c8bacb003.tar.bz2 mpv-f914947dda421aa5903084cf1813412c8bacb003.tar.xz |
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.
-rw-r--r-- | DOCS/man/options.rst | 6 | ||||
-rw-r--r-- | video/out/vo_gpu_next.c | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index d3380f3c22..aedd4488e9 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -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. diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 3c5f558473..0faf811733 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -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; |