diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-08-03 00:59:02 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-08-07 09:21:13 +0200 |
commit | 50ea7389ecae321ea6c4c585b8f721b84bd64a1d (patch) | |
tree | 87f92b2b059f2ca17392f5dceca05c14d1859934 /libavfilter/af_biquads.c | |
parent | 6b82f35041fd3229f056e9b8644e8a91d0e0bc19 (diff) | |
download | ffmpeg-50ea7389ecae321ea6c4c585b8f721b84bd64a1d.tar.gz |
avfilter: Deduplicate default audio inputs/outputs
Lots of audio filters use very simple inputs or outputs:
An array with a single AVFilterPad whose name is "default"
and whose type is AVMEDIA_TYPE_AUDIO; everything else is unset.
Given that we never use pointer equality for inputs or outputs*,
we can simply use a single AVFilterPad instead of dozens; this
even saves .data.rel.ro (4784B here) as well as relocations.
*: In fact, several filters (like the filters in af_biquads.c)
already use the same inputs; furthermore, ff_filter_alloc()
duplicates the input and output pads so that we do not even
work with the pads directly.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/af_biquads.c')
-rw-r--r-- | libavfilter/af_biquads.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c index 3b12aee3c0..1453f51a16 100644 --- a/libavfilter/af_biquads.c +++ b/libavfilter/af_biquads.c @@ -1431,13 +1431,6 @@ static av_cold void uninit(AVFilterContext *ctx) av_channel_layout_uninit(&s->ch_layout); } -static const AVFilterPad inputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_AUDIO, - }, -}; - static const AVFilterPad outputs[] = { { .name = "default", @@ -1467,7 +1460,7 @@ const AVFilter ff_af_##name_ = { \ .init = name_##_init, \ .activate = activate, \ .uninit = uninit, \ - FILTER_INPUTS(inputs), \ + FILTER_INPUTS(ff_audio_default_filterpad), \ FILTER_OUTPUTS(outputs), \ FILTER_QUERY_FUNC(query_formats), \ .process_command = process_command, \ |