diff options
author | Niklas Haas <git@haasn.dev> | 2021-11-07 18:12:28 +0100 |
---|---|---|
committer | Niklas Haas <git@haasn.dev> | 2021-11-07 18:12:42 +0100 |
commit | eca1b8dc294df59160a4bfb072d3643c6953c867 (patch) | |
tree | a68ce33acc001d3ed3d9cacd93a9055ecd2f31ba | |
parent | 459f7d4a8d7f303782e4288bdaf0b9c20c9a47a9 (diff) | |
download | mpv-eca1b8dc294df59160a4bfb072d3643c6953c867.tar.bz2 mpv-eca1b8dc294df59160a4bfb072d3643c6953c867.tar.xz |
vo_gpu_next: implement --dither-depth
I somehow completely forgot about this option existing.
Closes #9416
-rw-r--r-- | video/out/vo_gpu_next.c | 8 |
1 files changed, 8 insertions, 0 deletions
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; |