History

gpu-next: add support for --dither-depth=auto

On supported APIs. Fixes: https://github.com/mpv-player/mpv/issues/11862

Kacper Michajłow committed 2 years ago

Commit 7265bde1 parent 16e3d7d1 file · +8 −3Browse files

Unified · Split

video/out/vo_gpu_next.c+8−3
@@ -838,10 +838,15 @@ static void apply_target_options(struct priv *p, struct pl_frame *target) · 837 unmodified lines
838838 container = pl_raw_primaries_get(target->color.primaries);
839839 target->color.hdr.prim = pl_primaries_clip(gamut, container);
840840 }
841− if (opts->dither_depth > 0) {
841+ int dither_depth = opts->dither_depth;
842+ if (dither_depth == 0) {
843+ struct ra_swapchain *sw = p->ra_ctx->swapchain;
844+ dither_depth = sw->fns->color_depth ? sw->fns->color_depth(sw) : 0;
845+ }
846+ if (dither_depth > 0) {
842847 struct pl_bit_encoding *tbits = &target->repr.bits;
843− tbits->color_depth += opts->dither_depth - tbits->sample_depth;
844− tbits->sample_depth = opts->dither_depth;
848+ tbits->color_depth += dither_depth - tbits->sample_depth;
849+ tbits->sample_depth = dither_depth;
845850 }
846851
847852 if (opts->icc_opts->icc_use_luma) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t