summaryrefslogtreecommitdiff
path: root/libavfilter/af_sofalizer.c
Commit message (Collapse)AuthorAgeFilesLines
* avfilter: fix av_tx_fn stride usage for complex inputsPaul B Mahol2022-11-191-5/+5
|
* avfilter/af_sofalizer: fix getting speaker positionJames Almer2022-03-151-6/+6
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter: convert to new channel layout APIJames Almer2022-03-151-53/+42
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter: Replace query_formats callback with union of list and callbackAndreas Rheinhardt2021-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-201-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/internal: Factor out executing a filter's execute_funcAndreas Rheinhardt2021-08-151-2/+2
| | | | | | | 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-131-9/+2
| | | | | | | | | | | 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>
* avfilter/af_sofalizer: switch to TX FFT from avutilPaul B Mahol2021-07-241-64/+85
|
* avfilter: Constify all AVFiltersAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | 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>
* avfilter/af_sofalizer: allow up to 64 channelsPaul B Mahol2020-10-121-4/+4
|
* avfilter/af_sofalizer: allow to specify virtual speakers indetifier as numberPaul B Mahol2020-10-121-5/+14
|
* lavfi: regroup formats lists in a single structure.Nicolas George2020-09-081-2/+2
| | | | | | | | | | | | | | | 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_sofalizer: switch to activatePaul B Mahol2019-04-291-6/+30
|
* afilter/af_sofalizer: check explicitly other typePaul B Mahol2019-01-011-3/+3
|
* avfilter/af_sofalizer: stop allocating never used buffersPaul B Mahol2018-12-311-3/+11
|
* avfilter/af_sofalizer: use av_log2()Paul B Mahol2018-12-271-4/+4
|
* avfilter/af_sofalizer: fix regression after 7ea4b928a264Paul B Mahol2018-12-261-7/+7
|
* avfilter/af_sofalizer: fix typo in commentsPaul B Mahol2018-12-261-1/+1
|
* avfilter/af_sofalizer: use float constantsPaul B Mahol2018-12-261-2/+2
|
* avfilter/af_sofalizer: add fltp sample format supportPaul B Mahol2018-12-261-28/+61
|
* avfilter/af_sofalizer: speed up fast convolutionPaul B Mahol2018-12-251-16/+28
| | | | Do inverse FFT only once per output channel.
* avfilter/af_sofalizer: do not reduce LFE by 6dBPaul B Mahol2018-12-241-2/+2
| | | | It is already reduced enough.
* avfilter/af_sofalizer: fix memory leaksPaul B Mahol2018-12-231-1/+1
|
* avfilter/af_sofalizer: set delays when interpolation is disabledPaul B Mahol2018-12-231-0/+7
|
* avfilter/af_sofalizer: stop using easy APIPaul B Mahol2018-12-231-17/+100
| | | | Easy API is not flexible enough for our needs.
* avfilter/af_sofalizer: reset FFT pointers back to NULLPaul B Mahol2018-12-231-0/+4
|
* avfilter/af_sofalizer: pick IR length after loading sofaPaul B Mahol2018-12-231-3/+5
| | | | Instead of picking it in preloading stage.
* avfilter/af_sofalizer: increase range for lfegainPaul B Mahol2018-12-231-1/+1
| | | | Fixes #7634.
* avfilter/af_sofalizer: fix non-power of 2 IR length filtering in time domainPaul B Mahol2018-12-221-20/+25
|
* avfilter/af_sofalizer: use fabsf() instead of fabs()Paul B Mahol2018-12-211-3/+3
|
* avfilter/af_sofalizer: add framesize optionPaul B Mahol2018-12-201-2/+4
|
* avfilter/af_sofalizer: increase max radiusPaul B Mahol2018-12-201-1/+1
|
* avfilter/af_sofalizer: add printing of license backPaul B Mahol2018-12-201-0/+4
|
* avfilter/af_sofalizer: use av_sscanf()Paul B Mahol2018-11-181-3/+3
|
* avfilter/af_sofalizer: switch to libmysofaPaul B Mahol2017-06-081-511/+189
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_sofalizer: make lfe gain user configurablePaul B Mahol2017-05-181-1/+3
| | | | | | Default settings have it too low. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_sofalizer: avoid castingPaul B Mahol2017-05-181-2/+2
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_sofalizer: Fix bad shiftMichael Niedermayer2017-03-301-1/+1
| | | | | | Fixes CID1396835 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/af_sofalizer: speed and clean up fast convolution a littlePaul B Mahol2017-01-091-5/+9
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_sofalizer: warn if user gives unknown channel namesPaul B Mahol2016-12-141-3/+5
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_sofalizer: allow user to setup custom virtual speakers positionsPaul B Mahol2016-03-281-0/+77
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_sofalizer: Fix "warning: ISO C90 forbids mixed declarations and ↵Michael Niedermayer2016-03-141-1/+2
| | | | | | code" Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/af_sofalizer: check if filename was set.Paul B Mahol2016-03-041-0/+5
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_sofalizer: fix crash when ir size is not aligned, usually when ↵Paul B Mahol2016-03-041-2/+9
| | | | | | n_samples are not power of 2 Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_sofalizer: fix crash with odd IR sizePaul B Mahol2016-03-031-10/+12
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_sofalizer: print size of FFT that failed to initPaul B Mahol2016-03-031-1/+1
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavfi/af_sofalizer: remove exp2 and replace clz by ff_clzGanesh Ajjanagadde2016-01-011-14/+3
| | | | | | | | | | ff_clz is faster, and uses an intrinsic (at the moment on GCC). exp2 is a wasteful function for a simple integer exponentiation. Untested. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* avfilter/af_sofalizer: make virtual speaker positioning supports all channel ↵Paul B Mahol2015-12-241-172/+53
| | | | | | layouts Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_sofalizer: Fix occured typoMichael Niedermayer2015-12-171-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/af_sofalizer: use SIMD in compensate_volume()Paul B Mahol2015-12-161-6/+8
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>