[FFmpeg-devel] [PATCH 3/3] avfilter/formats: Avoid reallocations for video in ff_all_formats()

Nicolas George george at nsup.org
Sun Sep 26 12:09:51 EEST 2021


Andreas Rheinhardt (12021-09-26):
> Up until now, the list of pixfmts is reallocated every time an entry
> is added to it; there are currently 196 pixel formats, so this matters:
> It causes 5541704 calls to av_realloc_array() in a typical FATE run,
> which is the majority for said function (8095768 calls) and even
> a large chunk of the calls to av_realloc() itself (12589508 calls).
> 
> Fix this by using ff_formats_pixdesc_filter() instead.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
>  libavfilter/formats.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)

All three look good to me, but I have not looked that carefully at each
individual change in the second patch.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210926/f28ecfdd/attachment.sig>


More information about the ffmpeg-devel mailing list