[FFmpeg-devel] [PATCH 3/4] avfilter: Deduplicate default video inputs/outputs

Marvin Scholz epirat07 at gmail.com
Thu Aug 3 19:44:17 EEST 2023



On 3 Aug 2023, at 16:33, Andreas Rheinhardt wrote:

> 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 at outlook.com>
> ---

[...]

> +#include "internal.h"
> +
> +/* An AVFilterPad array whose only entry has name "default"
> + * and is of type video. */
> +extern const AVFilterPad ff_video_default_filterpad[1];

This should probably be a Doxygen comment.

>
>  AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h);
>  AVFrame *ff_default_get_video_buffer2(AVFilterLink *link, int w, int h, int align);
> -- 
> 2.34.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list