mirror of
https://github.com/mpv-player/mpv
synced 2025-01-10 17:09:45 +00:00
zimg: fix broken sig_peak handling
In sum there were three issues: 1. nominal_peak_luminance is an output parameter, not input 2. mpv internally uses MP_REF_WHITE which we need to scale by 3. the value should be left at its default for SDR Together with the last change this means mpv can sucessfully take HDR screenshots with --screenshot-sw without resulting in a brightly colored mess. Though note that zimg does not perform proper tonemapping.
This commit is contained in:
parent
a960b75604
commit
a0d8962be8
@ -540,8 +540,9 @@ static bool mp_zimg_state_init(struct mp_zimg_context *ctx,
|
||||
if (opts->fast)
|
||||
params.allow_approximate_gamma = 1;
|
||||
|
||||
if (ctx->src.color.sig_peak > 0)
|
||||
params.nominal_peak_luminance = ctx->src.color.sig_peak;
|
||||
// leave at default for SDR, which means 100 cd/m^2 for zimg
|
||||
if (ctx->dst.color.sig_peak > 0 && mp_trc_is_hdr(ctx->dst.color.gamma))
|
||||
params.nominal_peak_luminance = ctx->dst.color.sig_peak * MP_REF_WHITE;
|
||||
|
||||
st->graph = zimg_filter_graph_build(&src_fmt, &dst_fmt, ¶ms);
|
||||
if (!st->graph) {
|
||||
|
Loading…
Reference in New Issue
Block a user