diff options
author | John Stebbins <[email protected]> | 2019-03-15 15:27:01 -0600 |
---|---|---|
committer | John Stebbins <[email protected]> | 2019-04-08 07:44:09 -0600 |
commit | 3712b297c3487780d31151362b85c49ca27ff8ad (patch) | |
tree | 71f449d83c224bc2ff5cad824560c2730759540e /libhb/unsharp.c | |
parent | 248c880fc86ee07d23d62135e002940f16364eb6 (diff) |
libhb: propagate color matrix info through the pipeline
Propagates pix_fmt, range, primaries, transfer, and matrix everywhere.
Everything that passes or creates video frames tags the frames with
their color matrix info.
All filters know the expected color matrix info of input frames.
Diffstat (limited to 'libhb/unsharp.c')
-rw-r--r-- | libhb/unsharp.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libhb/unsharp.c b/libhb/unsharp.c index 058440872..0206283c4 100644 --- a/libhb/unsharp.c +++ b/libhb/unsharp.c @@ -42,6 +42,9 @@ struct hb_filter_private_s unsharp_plane_context_t plane_ctx[3]; unsharp_thread_context3_t * thread_ctx; int threads; + + hb_filter_init_t input; + hb_filter_init_t output; }; static int unsharp_init(hb_filter_object_t *filter, @@ -167,6 +170,8 @@ static int unsharp_init(hb_filter_object_t *filter, } hb_filter_private_t * pv = filter->private_data; + pv->input = *init; + // Mark parameters unset for (int c = 0; c < 3; c++) { @@ -236,6 +241,8 @@ static int unsharp_init(hb_filter_object_t *filter, return -1; } + pv->output = *init; + return 0; } @@ -318,7 +325,11 @@ static int unsharp_work_thread(hb_filter_object_t *filter, return HB_FILTER_DONE; } - out = hb_frame_buffer_init(in->f.fmt, in->f.width, in->f.height); + out = hb_frame_buffer_init(pv->output.pix_fmt, in->f.width, in->f.height); + out->f.color_prim = pv->output.color_prim; + out->f.color_transfer = pv->output.color_transfer; + out->f.color_matrix = pv->output.color_matrix; + out->f.color_range = pv->output.color_range ; int c; for (c = 0; c < 3; c++) |