1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

18 Commits

Author SHA1 Message Date
Paul B Mahol
d460a5f8ba avfilter/af_arnndn: initialize ret to silence compiler warning 2021-09-11 22:19:25 +02:00
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
Andreas Rheinhardt
1b20853fb3 avfilter/internal: Factor out executing a filter's execute_func
The current way of doing it involves writing the ctx parameter twice.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-15 21:33:25 +02:00
Andreas Rheinhardt
18ec426a86 avfilter/formats: Factor common function combinations out
Several combinations of functions happen quite often in query_format
functions; e.g. ff_set_common_formats(ctx, ff_make_format_list(sample_fmts))
is very common. This commit therefore adds functions that are equivalent
to commonly used function combinations in order to reduce code
duplication.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-13 17:36:22 +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
Paul B Mahol
129978af6b avfilter/af_arnndn: skip array extra entries by looking for new line 2021-02-10 14:15:42 +01:00
Paul B Mahol
199301a03a avfilter/af_arnndn: make model opening errors more verbose
Also return proper error code.
2021-02-09 23:56:11 +01:00
Paul B Mahol
fb9c56bbd5 avfilter/af_arnndn: add support for commands 2021-02-05 00:43:11 +01:00
Anton Khirnov
c8c2dfbc37 lavu: move LOCAL_ALIGNED from internal.h to mem_internal.h
That is a more appropriate place for it.
2021-01-01 14:11:01 +01:00
Paul B Mahol
7025c91d07 avfilter/af_arnndn: add mix option
Mostly useful to listen to actual noise.
2020-12-04 23:57:01 +01:00
Paul B Mahol
5b1ccd748a avfilter/af_arnndn: add timeline support 2020-11-25 13:41:52 +01:00
Paul B Mahol
939f4b35b8 avfilter/af_arnndn: reduce size of second_check[] table 2020-09-04 18:02:52 +02:00
Paul B Mahol
f7deae7215 avfilter/af_arnndn: use memcpy for copying in compute_rnn() 2020-08-27 20:39:33 +02:00
Paul B Mahol
ace1cc6163 avfilter/af_arnndn: use scalarproduct_float() in dct function 2020-08-27 20:39:33 +02:00
Paul B Mahol
999f5160c4 avfilter/af_arnndn: use RNN_COPY macro to copy 2020-08-21 22:46:07 +02:00
Andreas Rheinhardt
6aae322120 avfilter/af_arnndn: Remove superfluous qualifier
remove_doubling() returned a const float, but returning qualified types
is pointless anyway. This is all the more important given that  GCC 4.2.1
(and maybe other compilers, too) seems to treat this as an error as several
FATE units that don't compile any more show.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-10-17 12:30:24 +02:00
Paul B Mahol
fb7b222b91 avfilter/af_arnndn: make sure that vad_output nb_neurons is always 1 2019-10-17 11:02:02 +02:00
Paul B Mahol
b0bfa3699c avfilter: add arnndn filter 2019-10-16 15:13:59 +02:00