From eca1b8dc294df59160a4bfb072d3643c6953c867 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sun, 7 Nov 2021 18:12:28 +0100 Subject: vo_gpu_next: implement --dither-depth I somehow completely forgot about this option existing. Closes #9416 --- video/out/vo_gpu_next.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index df902802ee..64e2955046 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -610,6 +610,11 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame) target.color.transfer = mp_trc_to_pl(opts->target_trc); if (opts->target_peak) target.color.sig_peak = opts->target_peak; + if (opts->dither_depth > 0) { + struct pl_bit_encoding *tbits = &target.repr.bits; + tbits->color_depth += opts->dither_depth - tbits->sample_depth; + tbits->sample_depth = opts->dither_depth; + } struct pl_frame_mix mix = {0}; if (frame->current) { @@ -1210,6 +1215,9 @@ static void update_render_options(struct priv *p) break; } + if (opts->dither_depth < 0) + p->params.dither_params = NULL; + update_icc_opts(p, opts->icc_opts); const struct pl_hook *hook; -- cgit v1.2.3