summaryrefslogtreecommitdiff
path: root/libavfilter/af_aiir.c
Commit message (Collapse)AuthorAge
* avfilter: convert to new channel layout APIJames Almer2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter: Replace query_formats callback with union of list and callbackAndreas Rheinhardt2021-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If one looks at the many query_formats callbacks in existence, one will immediately recognize that there is one type of default callback for video and a slightly different default callback for audio: It is "return ff_set_common_formats_from_list(ctx, pix_fmts);" for video with a filter-specific pix_fmts list. For audio, it is the same with a filter-specific sample_fmts list together with ff_set_common_all_samplerates() and ff_set_common_all_channel_counts(). This commit allows to remove the boilerplate query_formats callbacks by replacing said callback with a union consisting the old callback and pointers for pixel and sample format arrays. For the not uncommon case in which these lists only contain a single entry (besides the sentinel) enum AVPixelFormat and enum AVSampleFormat fields are also added to the union to store them directly in the AVFilter, thereby avoiding a relocation. The state of said union will be contained in a new, dedicated AVFilter field (the nb_inputs and nb_outputs fields have been shrunk to uint8_t in order to create a hole for this new field; this is no problem, as the maximum of all the nb_inputs is four; for nb_outputs it is only two). The state's default value coincides with the earlier default of query_formats being unset, namely that the filter accepts all formats (and also sample rates and channel counts/layouts for audio) provided that these properties agree coincide for all inputs and outputs. By using different union members for audio and video filters the type-unsafety of using the same functions for audio and video lists will furthermore be more confined to formats.c than before. When the new fields are used, they will also avoid allocations: Currently something nearly equivalent to ff_default_query_formats() is called after every successful call to a query_formats callback; yet in the common case that the newly allocated AVFilterFormats are not used at all (namely if there are no free links) these newly allocated AVFilterFormats are freed again without ever being used. Filters no longer using the callback will not exhibit this any more. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilterAndreas Rheinhardt2021-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* avfilter/avfilter: Remove unused feature to add pads in the middleAndreas Rheinhardt2021-08-17
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/internal: Factor out executing a filter's execute_funcAndreas Rheinhardt2021-08-15
| | | | | | | 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>
* avfilter/formats: Factor common function combinations outAndreas Rheinhardt2021-08-13
| | | | | | | | | | | 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>
* Remove unnecessary avassert.h inclusionsAndreas Rheinhardt2021-07-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: Constify all AVFiltersAndreas Rheinhardt2021-04-27
| | | | | | | 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>
* Remove double ';'Andreas Rheinhardt2021-03-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* Mark some pointers as constAndreas Rheinhardt2021-01-01
| | | | | Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_aiir: add support for arbitrary order lattice-ladder filter formatPaul B Mahol2020-11-22
|
* avfilter/af_aiir: remove unused argumentPaul B Mahol2020-10-19
|
* avfilter/af_aiir: fix sp2zp mappingPaul B Mahol2020-10-19
|
* avfilter/af_aiir: add analog transfer function formatPaul B Mahol2020-10-18
|
* avfilter/af_aiir: use av_sscanf()Paul B Mahol2020-10-17
|
* avfilter/af_aiir: reverse order of biquads in serial processingPaul B Mahol2020-10-17
| | | | | This avoids most of clippings for fixed-point precision inputs. Also add warning about filtering fixed-point precision with parallel processing.
* avfilter/af_aiir: use transposed II form for biquad sectionsPaul B Mahol2020-10-16
|
* avfilter/af_aiir: implement parallel processingPaul B Mahol2020-10-16
|
* lavfi: regroup formats lists in a single structure.Nicolas George2020-09-08
| | | | | | | | | | | | | | | 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/*(.)
* avfilter/af_aiir: Fix segfault and leak upon allocation failureAndreas Rheinhardt2020-08-26
| | | | | | | | | | | | | | | | | | | | | The aiir filter adds output pads in its init function. Each of these output pads had a name which was allocated and to be freed in the uninit function. Given that the aiir filter has between one and two outputs, one output pad's name was freed unconditionally and a second was freed conditionally. Yet if adding output pads fails, there are no output pads at all and trying to free a nonexistent pad's name will lead to a segfault. Furthermore, if the name could be successfully allocated, yet adding the new pad fails, the name would leak. This commit fixes this by not allocating the pads' names at all any more: They are constant anyway. This allows to remove the code to free them and hence fixes the aforementioned bugs. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_aiir: simplify polynomial evaluationPaul B Mahol2020-05-30
|
* avfilter/af_aiir: use correct size when allocating in zp2tfPaul B Mahol2020-05-30
|
* lavfi/aiir: Refine the pad/vpad related operationJun Zhao2020-05-30
| | | | | | | move the pad/vpad related operation with more natural coding style. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* Revert "avfilter/af_aiir: move response drawing as last step"Paul B Mahol2020-05-30
| | | | This reverts commit ca7095a9072fab4cdb41af12da9d94752e082e34.
* avfilter/af_aiir: improve response calculation with zp coefficientsPaul B Mahol2020-05-30
|
* avfilter/af_aiir: add S-plane supportPaul B Mahol2020-05-30
|
* avfilter/af_aiir: make it clear that transfer function is digital onePaul B Mahol2020-05-30
|
* avfilter/af_aiir: move response drawing as last stepPaul B Mahol2020-05-22
|
* avfilter/af_aiir: fix first denominator calculationPaul B Mahol2020-05-22
|
* avfilter/af_aiir: add more descriptive options aliasesPaul B Mahol2020-05-22
|
* avfilter/af_aiir: export normalize optionPaul B Mahol2020-05-22
| | | | And enable it in all modes by default.
* avfilter/af_aiir: fix first delay valuePaul B Mahol2020-05-22
|
* avfilter/af_aiir: fix phase and group delay calculationPaul B Mahol2020-05-20
| | | | Properly unwrap phase.
* avfilter/af_aiir: fix invalid memory access with tf filteringPaul B Mahol2020-05-19
|
* avfilter/af_aiir: check if frame clone is setPaul B Mahol2020-01-14
|
* avfilter/af_aiir: normalize biquads only if divisor is big enoughPaul B Mahol2019-11-22
|
* avfilter/af_aiir: fix biquads normalizationPaul B Mahol2019-11-22
|
* avfilter/af_aiir: add missing normalization of biquads gainsPaul B Mahol2019-11-22
|
* avfilter/af_aiir: make a/b coefficients arrayPaul B Mahol2019-11-22
|
* avfilter/af_aiir: factor out response calculationPaul B Mahol2019-11-22
|
* avfilter/af_aiir: check for stabilityPaul B Mahol2019-11-22
|
* avfilter/af_aiir: fix array length when selecting conjugate polesPaul B Mahol2019-11-21
|
* avfilter/af_aiir: calculate group delay tooPaul B Mahol2019-07-13
|
* avfilter/af_aiir: do not ignore k option for audio filteringPaul B Mahol2019-07-13
| | | | Previously it was used only for displaying frequency response.
* avfilter/af_aiir: implement mix optionPaul B Mahol2019-07-08
|
* avfilter/af_aiir: implement rate optionPaul B Mahol2018-11-08
|
* avfilter/af_aiir: Remove l from %lf in av_log environmentMichael Niedermayer2018-10-07
| | | | | | The l modifier does nothing in C99 and it was undefined in C89 for %f Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavfi/af_afir,af_aiir: Remove a variable that is always -1.Carl Eugen Hoyos2018-07-19
| | | | | | | | | | Fixes two warnings: libavfilter/af_afir.c:194:45: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow] int dx = FFABS(x1-x0), sx = x0 < x1 ? 1 : -1; ~~~~~~~~~~~~^~~~ libavfilter/af_aiir.c:689:45: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow] int dx = FFABS(x1-x0), sx = x0 < x1 ? 1 : -1; ~~~~~~~~~~~~^~~~
* avfilter/af_aiir: draw IR frequency responsePaul B Mahol2018-05-30
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_aiir: add polar zeros/poles format variantPaul B Mahol2018-01-10
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>