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_adeclick.c | |
parent | 6b82f35041fd3229f056e9b8644e8a91d0e0bc19 (diff) |
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_adeclick.c')
-rw-r--r-- | libavfilter/af_adeclick.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/libavfilter/af_adeclick.c b/libavfilter/af_adeclick.c index 2db9a29fd3..5c9c4283ff 100644 --- a/libavfilter/af_adeclick.c +++ b/libavfilter/af_adeclick.c @@ -724,13 +724,6 @@ static const AVFilterPad inputs[] = { }, }; -static const AVFilterPad outputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_AUDIO, - }, -}; - const AVFilter ff_af_adeclick = { .name = "adeclick", .description = NULL_IF_CONFIG_SMALL("Remove impulsive noise from input audio."), @@ -740,7 +733,7 @@ const AVFilter ff_af_adeclick = { .activate = activate, .uninit = uninit, FILTER_INPUTS(inputs), - FILTER_OUTPUTS(outputs), + FILTER_OUTPUTS(ff_audio_default_filterpad), FILTER_SINGLE_SAMPLEFMT(AV_SAMPLE_FMT_DBLP), .flags = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL, }; @@ -776,7 +769,7 @@ const AVFilter ff_af_adeclip = { .activate = activate, .uninit = uninit, FILTER_INPUTS(inputs), - FILTER_OUTPUTS(outputs), + FILTER_OUTPUTS(ff_audio_default_filterpad), FILTER_SINGLE_SAMPLEFMT(AV_SAMPLE_FMT_DBLP), .flags = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL, }; |