diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2019-11-17 22:14:13 +0300 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2022-01-15 00:27:42 +0300 |
commit | 9a691b31317c6518fdccdd5a39f9b05e66631f22 (patch) | |
tree | 13e01c6e629c94c800dcdbd8f01e68e95a1b06c2 /tools | |
parent | 19326c40ca88f84016fc3638645221553367f449 (diff) |
add --inloopfilters to enable/disable postfilters dynamically
(To be used alongside --filmgrain.)
Addresses part of #310.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dav1d_cli_parse.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tools/dav1d_cli_parse.c b/tools/dav1d_cli_parse.c index 430bb0e..fa635fc 100644 --- a/tools/dav1d_cli_parse.c +++ b/tools/dav1d_cli_parse.c @@ -61,6 +61,7 @@ enum { ARG_CPU_MASK, ARG_NEG_STRIDE, ARG_OUTPUT_INVISIBLE, + ARG_INLOOP_FILTERS, }; static const struct option long_opts[] = { @@ -86,6 +87,7 @@ static const struct option long_opts[] = { { "cpumask", 1, NULL, ARG_CPU_MASK }, { "negstride", 0, NULL, ARG_NEG_STRIDE }, { "outputinvisible", 1, NULL, ARG_OUTPUT_INVISIBLE }, + { "inloopfilters", 1, NULL, ARG_INLOOP_FILTERS }, { NULL, 0, NULL, 0 }, }; @@ -142,7 +144,8 @@ static void usage(const char *const app, const char *const reason, ...) { " --cpumask $mask: restrict permitted CPU instruction sets (0" ALLOWED_CPU_MASKS "; default: -1)\n" " --negstride: use negative picture strides\n" " this is mostly meant as a developer option\n" - " --outputinvisible $num: whether to output invisible (alt-ref) frames (default: 0)\n"); + " --outputinvisible $num: whether to output invisible (alt-ref) frames (default: 0)\n" + " --inloopfilters $str: which in-loop filters to enable (none, (no)deblock, (no)cdef, (no)restoration or all; default: all)\n"); exit(1); } @@ -221,6 +224,18 @@ static const EnumParseTable cpu_mask_tbl[] = { { "none", 0 }, }; +static const EnumParseTable inloop_filters_tbl[] = { + { "none", DAV1D_INLOOPFILTER_NONE }, + { "deblock", DAV1D_INLOOPFILTER_DEBLOCK }, + { "nodeblock", DAV1D_INLOOPFILTER_ALL - DAV1D_INLOOPFILTER_DEBLOCK }, + { "cdef", DAV1D_INLOOPFILTER_CDEF }, + { "nocdef", DAV1D_INLOOPFILTER_ALL - DAV1D_INLOOPFILTER_CDEF }, + { "restoration", DAV1D_INLOOPFILTER_RESTORATION }, + { "norestoration", DAV1D_INLOOPFILTER_ALL - DAV1D_INLOOPFILTER_RESTORATION }, + { "all", DAV1D_INLOOPFILTER_ALL }, + { 0 }, +}; + #define ARRAY_SIZE(n) (sizeof(n)/sizeof(*(n))) static unsigned parse_enum(char *optarg, const EnumParseTable *const tbl, @@ -362,6 +377,11 @@ void parse(const int argc, char *const *const argv, lib_settings->output_invisible_frames = !!parse_unsigned(optarg, ARG_OUTPUT_INVISIBLE, argv[0]); break; + case ARG_INLOOP_FILTERS: + lib_settings->inloop_filters = + parse_enum(optarg, inloop_filters_tbl, + ARRAY_SIZE(inloop_filters_tbl),ARG_INLOOP_FILTERS, argv[0]); + break; default: usage(argv[0], NULL); } |