aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/f_cue.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-08-03 14:37:51 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-08-07 09:21:13 +0200
commit2f62a433f26cab5d26d59b961b34637c26cf8e22 (patch)
tree0d70e36850612c6ffe9f55523152aea0b18365ea /libavfilter/f_cue.c
parent6d15643173263c8ff9e9422bbbdcb843f4bc8f9c (diff)
downloadffmpeg-2f62a433f26cab5d26d59b961b34637c26cf8e22.tar.gz
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>
Diffstat (limited to 'libavfilter/f_cue.c')
-rw-r--r--libavfilter/f_cue.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/libavfilter/f_cue.c b/libavfilter/f_cue.c
index 290a828d99..7748e8f1fd 100644
--- a/libavfilter/f_cue.c
+++ b/libavfilter/f_cue.c
@@ -26,6 +26,7 @@
#include "avfilter.h"
#include "filters.h"
#include "internal.h"
+#include "video.h"
typedef struct CueContext {
const AVClass *class;
@@ -100,27 +101,13 @@ static const AVOption options[] = {
AVFILTER_DEFINE_CLASS_EXT(cue_acue, "(a)cue", options);
#if CONFIG_CUE_FILTER
-static const AVFilterPad cue_inputs[] = {
- {
- .name = "default",
- .type = AVMEDIA_TYPE_VIDEO,
- },
-};
-
-static const AVFilterPad cue_outputs[] = {
- {
- .name = "default",
- .type = AVMEDIA_TYPE_VIDEO,
- },
-};
-
const AVFilter ff_vf_cue = {
.name = "cue",
.description = NULL_IF_CONFIG_SMALL("Delay filtering to match a cue."),
.priv_class = &cue_acue_class,
.priv_size = sizeof(CueContext),
- FILTER_INPUTS(cue_inputs),
- FILTER_OUTPUTS(cue_outputs),
+ FILTER_INPUTS(ff_video_default_filterpad),
+ FILTER_OUTPUTS(ff_video_default_filterpad),
.activate = activate,
};
#endif /* CONFIG_CUE_FILTER */