mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-06 15:49:50 +08:00
avfilter: Deduplicate default video inputs/outputs
Lots of video filters use a very simple input or output: An array with a single AVFilterPad whose name is "default" and whose type is AVMEDIA_TYPE_VIDEO; 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 (8312B here) as well as relocations. *: In fact, several filters (like the filters in vf_lut.c) already use the same outputs; 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>
This commit is contained in:
@ -135,19 +135,12 @@ static const AVFilterPad avfilter_vf_vflip_inputs[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static const AVFilterPad avfilter_vf_vflip_outputs[] = {
|
||||
{
|
||||
.name = "default",
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
},
|
||||
};
|
||||
|
||||
const AVFilter ff_vf_vflip = {
|
||||
.name = "vflip",
|
||||
.description = NULL_IF_CONFIG_SMALL("Flip the input video vertically."),
|
||||
.priv_size = sizeof(FlipContext),
|
||||
.priv_class = &vflip_class,
|
||||
FILTER_INPUTS(avfilter_vf_vflip_inputs),
|
||||
FILTER_OUTPUTS(avfilter_vf_vflip_outputs),
|
||||
FILTER_OUTPUTS(ff_video_default_filterpad),
|
||||
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
|
||||
};
|
||||
|
Reference in New Issue
Block a user