FFmpeg git repo
Go to file
Andreas Rheinhardt 4d7a1a4619 swscale/input: Avoid calls to av_pix_fmt_desc_get()
Up until now, libswscale/input.c used a macro to read
an input pixel which involved a call to av_pix_fmt_desc_get()
to find out whether the input pixel format is BE or LE
despite this being known at compile-time (there are templates
per pixfmt). Even worse, these calls are made in a loop,
so that e.g. there are six calls to av_pix_fmt_desc_get()
for every pair of UV pixel processed in
rgb64ToUV_half_c_template().

This commit modifies these macros to ensure that isBE()
is evaluated at compile-time. This saved 9743B of .text
for me (GCC 11.2, -O3). For a simple RGB64LE->YUV420P
transformation like
ffmpeg -f lavfi -i haldclutsrc,format=rgba64le -pix_fmt yuv420p \
-threads 1  -t 1:00  -f null -
the amount of decicycles spent in rgb64LEToUV_half_c
(which is created via the template mentioned above)
decreases from 19751 to 5341; for RGBA64BE the number
went down from 11945 to 5393. For shared builds (where
the call to av_pix_fmt_desc_get() is indirect) the old numbers
are 15230 for RGBA64BE and 27502 for RGBA64LE, whereas
the numbers with this patch are indistinguishable from
the numbers from a static build.

Also make the macros that are touched conform to the
usual convention of using uppercase names while just at it.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-19 23:40:41 +02:00
compat
doc doc/filters: add speechnorm examples 2022-09-18 19:43:42 +02:00
ffbuild
fftools fftools/ffplay: fix rotation incorrect when frame contains the displaymatrix 2022-09-15 16:16:16 +08:00
libavcodec avcodec/vorbisdec: Move ff_vorbis_inverse_coupling() to vorbisdsp.c 2022-09-19 19:19:08 +02:00
libavdevice
libavfilter avfilter/af_afftdn: add double sample format support 2022-09-18 22:43:58 +02:00
libavformat avformat/aptxdec: Don't set AV_PKT_FLAG_CORRUPT mistakenly 2022-09-19 17:05:33 +02:00
libavutil avutil/dict: Error out in case of key == NULL 2022-09-19 23:39:58 +02:00
libpostproc
libswresample swsresample/swresample: error out on invalid layouts 2022-09-14 09:52:33 -03:00
libswscale swscale/input: Avoid calls to av_pix_fmt_desc_get() 2022-09-19 23:40:41 +02:00
presets
tests avcodec/aptxenc: Process data in complete blocks of four samples only 2022-09-19 17:05:33 +02:00
tools tools/target_dec_fuzzer: Adjust threshold for Jpeg2000 2022-09-16 21:30:59 +02:00
.gitattributes
.gitignore
.mailmap
.travis.yml
CONTRIBUTING.md
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS
Changelog avformat: add LAF demuxer 2022-09-16 10:02:19 +02:00
INSTALL.md
LICENSE.md
MAINTAINERS
Makefile
README.md
RELEASE
configure configure: Remove obsolete APTX decoder dependencies 2022-09-18 22:43:47 +02:00

README.md

FFmpeg README

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.

Libraries

  • libavcodec provides implementation of a wider range of codecs.
  • libavformat implements streaming protocols, container formats and basic I/O access.
  • libavutil includes hashers, decompressors and miscellaneous utility functions.
  • libavfilter provides means to alter decoded audio and video through a directed graph of connected filters.
  • libavdevice provides an abstraction to access capture and playback devices.
  • libswresample implements audio mixing and resampling routines.
  • libswscale implements color conversion and scaling routines.

Tools

  • ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
  • ffplay is a minimalistic multimedia player.
  • ffprobe is a simple analysis tool to inspect multimedia content.
  • Additional small tools such as aviocat, ismindex and qt-faststart.

Documentation

The offline documentation is available in the doc/ directory.

The online documentation is available in the main website and in the wiki.

Examples

Coding examples are available in the doc/examples directory.

License

FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

Contributing

Patches should be submitted to the ffmpeg-devel mailing list using git format-patch or git send-email. Github pull requests should be avoided because they are not part of our review process and will be ignored.