summaryrefslogtreecommitdiffstats
path: root/libhb/deblock.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2019-03-15 15:27:01 -0600
committerJohn Stebbins <[email protected]>2019-04-08 07:44:09 -0600
commit3712b297c3487780d31151362b85c49ca27ff8ad (patch)
tree71f449d83c224bc2ff5cad824560c2730759540e /libhb/deblock.c
parent248c880fc86ee07d23d62135e002940f16364eb6 (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/deblock.c')
-rw-r--r--libhb/deblock.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libhb/deblock.c b/libhb/deblock.c
index 64cf277bb..c334b4ef2 100644
--- a/libhb/deblock.c
+++ b/libhb/deblock.c
@@ -47,6 +47,9 @@ struct hb_filter_private_s
int pp7_mpeg2;
int pp7_temp_stride;
uint8_t * pp7_src;
+
+ hb_filter_init_t input;
+ hb_filter_init_t output;
};
static int hb_deblock_init( hb_filter_object_t * filter,
@@ -346,6 +349,7 @@ static int hb_deblock_init( hb_filter_object_t * filter,
filter->private_data = calloc( sizeof(struct hb_filter_private_s), 1 );
hb_filter_private_t * pv = filter->private_data;
+ pv->input = *init;
pv->pp7_qp = PP7_QP_DEFAULT;
pv->pp7_mode = PP7_MODE_DEFAULT;
pv->pp7_mpeg2 = 1; /*mpi->qscale_type;*/
@@ -378,6 +382,7 @@ static int hb_deblock_init( hb_filter_object_t * filter,
pv->pp7_temp_stride = (init->geometry.width + 16 + 15) & (~15);
pv->pp7_src = (uint8_t*)malloc( pv->pp7_temp_stride*(h+8)*sizeof(uint8_t) );
+ pv->output = *init;
return 0;
}
@@ -411,7 +416,12 @@ static int hb_deblock_work( hb_filter_object_t * filter,
if( /*TODO: mpi->qscale ||*/ pv->pp7_qp )
{
- 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 ;
pp7_filter( pv,
out->plane[0].data,