Commit Graph

13 Commits

Author SHA1 Message Date
Andreas Rheinhardt 8be701d9f7 avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilter
Up until now, an AVFilter's lists of input and output AVFilterPads
were terminated by a sentinel and the only way to get the length
of these lists was by using avfilter_pad_count(). This has two
drawbacks: first, sizeof(AVFilterPad) is not negligible
(i.e. 64B on 64bit systems); second, getting the size involves
a function call instead of just reading the data.

This commit therefore changes this. The sentinels are removed and new
private fields nb_inputs and nb_outputs are added to AVFilter that
contain the number of elements of the respective AVFilterPad array.

Given that AVFilter.(in|out)puts are the only arrays of zero-terminated
AVFilterPads an API user has access to (AVFilterContext.(in|out)put_pads
are not zero-terminated and they already have a size field) the argument
to avfilter_pad_count() is always one of these lists, so it just has to
find the filter the list belongs to and read said number. This is slower
than before, but a replacement function that just reads the internal numbers
that users are expected to switch to will be added soon; and furthermore,
avfilter_pad_count() is probably never called in hot loops anyway.

This saves about 49KiB from the binary; notice that these sentinels are
not in .bss despite being zeroed: they are in .data.rel.ro due to the
non-sentinels.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-20 12:53:58 +02:00
Martin Storsjö 6d2365882f libavfilter: Fix implicit declarations of av_cpu_max_align
Signed-off-by: Martin Storsjö <martin@martin.st>
2021-08-04 20:58:15 +03:00
Paul B Mahol b3117f376d avfilter/vaf_spectrumsynth: switch to TX FFT from avutil 2021-08-04 10:04:58 +02:00
Andreas Rheinhardt a04ad248a0 avfilter: Constify all AVFilters
This is possible now that the next-API is gone.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:05 -03:00
Nicolas George 2f76476549 lavfi: regroup formats lists in a single structure.
It will allow to refernce it as a whole without clunky macros.

Most of the changes have been automatically made with sed:

sed -i '
  s/-> *in_formats/->incfg.formats/g;
  s/-> *out_formats/->outcfg.formats/g;
  s/-> *in_channel_layouts/->incfg.channel_layouts/g;
  s/-> *out_channel_layouts/->outcfg.channel_layouts/g;
  s/-> *in_samplerates/->incfg.samplerates/g;
  s/-> *out_samplerates/->outcfg.samplerates/g;
  ' src/libavfilter/*(.)
2020-09-08 14:02:40 +02:00
Nicolas George 29e0c30b1c lavfi/vaf_spectrumsynth: switch to activate.
Preserve the original workings, that does not use frames timestamps
and therefore is very fragile.

Allow to remove needs_fifo.
2020-08-20 18:55:19 +02:00
Rostislav Pehlivanov 039ebaa5f3 lavfi: make window_func an inline function
Eliminate lavc->lavfi dependency. The function isn't big and doesn't
deserve its own file.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-09-23 14:35:06 +01:00
Paul B Mahol a2c40931c8 avfilter/vaf_spectrumsynth: check return code 2016-08-16 16:01:35 +02:00
Ganesh Ajjanagadde db1a642cd2 all: move ff_exp10, ff_exp10f, ff_fast_powf to lavu/ffmath.h
The idea is to use ffmath.h for internal implementations of math functions.
Currently, it is used for variants of libm functions, but is by no means
limited to such things.

Note that this is not exported; use lavu/mathematics for such purposes.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
2016-03-22 10:15:31 -07:00
Michael Niedermayer 03c1129b20 avfilter/vaf_spectrumsynth: assert that variables are initialized by switch()
Silences: CID1351387
Silences: CID1351388
Silences: CID1351389

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-11 23:06:24 +01:00
Michael Niedermayer e7786959cc avfilter/vaf_spectrumsynth: Move "break" up
Fixes CID1351347

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-07 23:03:33 +01:00
Michael Niedermayer 48f5244df7 avfilter/vaf_spectrumsynth: Fix mixed declaration and statment
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 16:51:54 +01:00
Paul B Mahol 653f9d84ae avfilter: add spectrumsynth filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-01-14 20:51:20 +01:00