diff options
author | John Stebbins <[email protected]> | 2016-02-20 18:00:46 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2016-03-09 13:10:10 -0700 |
commit | a44ccb49f182d4eeb122fbe675b28deb5c36b793 (patch) | |
tree | 6cc064cc24dacc2a80d41fb9543640c9004895af /libhb/deblock.c | |
parent | 96c02dd6f256f4a4e74f8962f56502d28e5e65a3 (diff) |
filters: make job filter settings an hb_dict_t
This simplifies accessing and changing filter parameters
programatically. It also changes the custom filter string format to a
':' separated list of key/value pairs.
Diffstat (limited to 'libhb/deblock.c')
-rw-r--r-- | libhb/deblock.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/libhb/deblock.c b/libhb/deblock.c index e48d89ced..64cf277bb 100644 --- a/libhb/deblock.c +++ b/libhb/deblock.c @@ -58,15 +58,19 @@ static int hb_deblock_work( hb_filter_object_t * filter, static void hb_deblock_close( hb_filter_object_t * filter ); +static const char deblock_template[] = + "qp=^"HB_INT_REG"$:mode=^([012])$:disable=^"HB_BOOL_REG"$"; + hb_filter_object_t hb_filter_deblock = { - .id = HB_FILTER_DEBLOCK, - .enforce_order = 1, - .name = "Deblock (pp7)", - .settings = NULL, - .init = hb_deblock_init, - .work = hb_deblock_work, - .close = hb_deblock_close, + .id = HB_FILTER_DEBLOCK, + .enforce_order = 1, + .name = "Deblock (pp7)", + .settings = NULL, + .init = hb_deblock_init, + .work = hb_deblock_work, + .close = hb_deblock_close, + .settings_template = deblock_template, }; static inline void pp7_dct_a( DCTELEM * dst, uint8_t * src, int stride ) @@ -346,10 +350,8 @@ static int hb_deblock_init( hb_filter_object_t * filter, pv->pp7_mode = PP7_MODE_DEFAULT; pv->pp7_mpeg2 = 1; /*mpi->qscale_type;*/ - if( filter->settings ) - { - sscanf( filter->settings, "%d:%d", &pv->pp7_qp, &pv->pp7_mode ); - } + hb_dict_extract_int(&pv->pp7_mode, filter->settings, "mode"); + hb_dict_extract_int(&pv->pp7_qp, filter->settings, "qp"); if( pv->pp7_qp < 0 ) { |