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/detelecine.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/detelecine.c')
-rw-r--r-- | libhb/detelecine.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libhb/detelecine.c b/libhb/detelecine.c index a0a5367f1..a9abf8601 100644 --- a/libhb/detelecine.c +++ b/libhb/detelecine.c @@ -92,6 +92,9 @@ struct hb_filter_private_s struct pullup_context * pullup_ctx; int pullup_fakecount; int pullup_skipflag; + + hb_filter_init_t input; + hb_filter_init_t output; }; static int hb_detelecine_init( hb_filter_object_t * filter, @@ -821,10 +824,12 @@ void pullup_flush_fields( struct pullup_context * c ) static int hb_detelecine_init( hb_filter_object_t * filter, hb_filter_init_t * init ) { - filter->private_data = calloc( sizeof(struct hb_filter_private_s), 1 ); - hb_filter_private_t * pv = filter->private_data; + filter->private_data = calloc(sizeof(struct hb_filter_private_s), 1); + hb_filter_private_t * pv = filter->private_data; struct pullup_context * ctx; + + pv->input = *init; pv->pullup_ctx = ctx = pullup_alloc_context(); ctx->junk_left = ctx->junk_right = 1; @@ -877,6 +882,7 @@ static int hb_detelecine_init( hb_filter_object_t * filter, pv->pullup_skipflag = 0; init->job->use_detelecine = 1; + pv->output = *init; return 0; } @@ -1017,7 +1023,11 @@ static int hb_detelecine_work( hb_filter_object_t * filter, pullup_pack_frame( ctx, frame ); } - out = hb_video_buffer_init( 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 ; /* Copy pullup frame buffer into output buffer */ memcpy( out->plane[0].data, frame->buffer->planes[0], frame->buffer->size[0] ); |