summaryrefslogtreecommitdiff
path: root/libavfilter/f_ebur128.c
Commit message (Collapse)AuthorAge
* avfilter/f_ebur128: fix typos for swr chlayoutsPaul B Mahol2022-04-11
|
* avfilter/f_ebur128: multiply in integer first, before dividing in floatHendrik Leppkes2022-04-07
| | | | | Restores the order of operations from before 15a1104, which reduces errors from floating point calculations, and fixes FATE on mingw64.
* avfilter: convert to new channel layout APIJames Almer2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/f_ebur128: make sure frame is writable before writing to itPaul B Mahol2022-03-04
|
* avfilter/f_ebur128: switch to activate()Paul B Mahol2022-03-04
|
* avfilter/f_ebur128: set video outlink timebase and frameratePaul B Mahol2022-02-25
|
* avfilter/f_ebur128: also set max peak for all channels in frame metadataPaul B Mahol2022-02-25
|
* avfilter/f_ebur128: multiply is usually faster than dividePaul B Mahol2022-02-24
| | | | Also guard against overflow when subtracting from unsigned.
* avfilter/f_ebur128: use unsigned for hist_entry.countPaul B Mahol2022-02-24
| | | | Also when summing multiple hist_entry.count use uint64_t for accumulator.
* avfilter/f_ebur128: add support for any number of channelsPaul B Mahol2022-02-20
|
* 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/avfilter: Remove unused partial_bufAndreas Rheinhardt2021-08-05
| | | | | | | | It is unused since 02aa0701ae0dc2def8db640c9e3c06dc1b5de70c. The corresponding size field is write-only since then. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/f_ebur128: fix video output regressionPaul B Mahol2021-07-25
|
* avfilter/f_ebur128: add all sample rates supportPaul B Mahol2021-07-25
| | | | | | | | | | | | | | | | | | | | | | | | The magic constants come from the unofficial "ITU-R BS.1770-1 filter specifications"¹ by Raiden (libebur128) which relies on "Parameter Quantization in Direct-Form Recursive Audio Filters"² by Brian Neunaber. The constants seem to include a quantization bias, for example: - Vb is supposed to be exactly √Vh in a high shelf filter - the Pre-filter Gain should likely be 4dB - Pre Q and RLB Q are respectively very close to √½ and ½ Those are not adjusted to prevent the values from drifting away from the official specifications. An alternative to this approach would be to requantize on the fly as proposed by pbelkner³, where the 48kHz code path would use the exact specifications constants while derivating constants for other frequencies. [1]: https://www.scribd.com/document/49991813/ITU-R-BS-1770-1-filters [2]: https://www.scribd.com/document/6531763/Direct-Form-Filter-Parameter-Quantization [3]: https://hydrogenaud.io/index.php?topic=86116.msg740092#msg740092
* 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>
* 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/f_ebur128: Don't allocate outpad namesAndreas Rheinhardt2020-08-26
| | | | | | | | These names are mostly the same, so not using duplicates saves allocations, checks for the allocations as well as frees. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/f_ebur128: check if frame clone is setPaul B Mahol2020-01-14
|
* avfilter/f_ebur128: use correct type for chlPaul B Mahol2019-04-29
|
* lavfi/ebur128: Fix mixed declarations and codeMark Thompson2018-10-25
|
* libavfilter/ebur128: add scale parameterDaniel Molkentin2018-10-10
| | | | | | | | This allows switching between absolute (LUFS) and relativ (LU) display in the status line. Signed-off-by: Daniel Molkentin <daniel@molkentin.de> Signed-off-by: Conrad Zelck <c.zelck@imail.de>
* libavfilter/ebur128: introduce target rangeDaniel Molkentin2018-10-10
| | | | | | | This eases meeting the target level during live mixing. Signed-off-by: Daniel Molkentin <daniel@molkentin.de> Signed-off-by: Conrad Zelck <c.zelck@imail.de>
* libavfilter/ebur128: add gauge optionDaniel Molkentin2018-10-10
| | | | | | | | Allow to show short-term instead of momentary in gauge. Useful for monitoring whilst live mixing. Signed-off-by: Daniel Molkentin <daniel@molkentin.de> Signed-off-by: Conrad Zelck <c.zelck@imail.de>
* libavfilter/ebur128: add target value to statistics lineDaniel Molkentin2018-10-10
| | | | | Signed-off-by: Daniel Molkentin <daniel@molkentin.de> Signed-off-by: Conrad Zelck <c.zelck@imail.de>
* libavfilter/ebur128: add target level option for EBUR128 visualization filterDaniel Molkentin2018-10-10
| | | | | Signed-off-by: Daniel Molkentin <daniel@molkentin.de> Signed-off-by: Conrad Zelck <c.zelck@imail.de>
* avfilter/f_ebur128: check return value of ff_insert_outpad()Paul B Mahol2018-09-15
|
* avfilter: properly set SAR for A->V filtersPaul B Mahol2017-06-13
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter: don't anonymously typedef structsPaul B Mahol2017-05-13
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavfi/f_ebur128: relicense to LGPLClément Bœsch2016-11-27
| | | | | | | | | | | | | | All copyright holders have agreed to the relicensing. Approved-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Approved-by: David Sedacca <sedacca@comcast.net> Approved-by: Ganesh Ajjanagadde <gajjanag@mit.edu> Approved-by: Jean First <jeanfirst@gmail.com> Approved-by: Kyle Swanson <k@ylo.ph> Approved-by: Michael Niedermayer <michael@niedermayer.cc> Approved-by: Nicolas George <george@nsup.org> Approved-by: Paul B Mahol <onemda@gmail.com> Approved-by: Thilo Borgmann <thilo.borgmann@mail.de>
* doc: fix spelling errorsAndreas Cadhalpun2016-10-21
| | | | | | | | Thanks to Mathieu Malaterre <malat@debian.org> for reporting the Que/Queue typo. (https://bugs.debian.org/839542) Reviewed-by: Lou Logan <lou@lrcd.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* all: move ff_exp10, ff_exp10f, ff_fast_powf to lavu/ffmath.hGanesh Ajjanagadde2016-03-22
| | | | | | | | | | | 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>
* lavfi/f_ebur128: replace pow(10,x) by ff_exp10(x)Ganesh Ajjanagadde2015-12-25
| | | | | Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* lavfi/ebur128: apply I dual mono correction only if I availableClément Bœsch2015-12-13
| | | | Spotted-by: jamrial & gcc 6
* avfilter,swresample,swscale: use fabs, fabsf instead of FFABSGanesh Ajjanagadde2015-10-22
| | | | | | | | | | | | | | | | | | | | | | | | It is well known that fabs and fabsf are at least as fast and sometimes faster than the FFABS macro, at least on the gcc+glibc combination. For instance, see the reference: http://patchwork.sourceware.org/patch/6735/. This was a patch to glibc in order to remove their usages of a macro. The reason essentially boils down to fabs using the __builtin_fabs of the compiler, while FFABS needs to infer to not use a branch and to simply change the sign bit. Usually the inference works, but sometimes it does not. This may be easily checked by looking at the asm. This also has the added benefit of reducing macro usage, which has problems with side-effects. Note that avcodec is not handled here, as it is huge and most things there are integer arithmetic anyway. Tested with FATE. Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* avfilter/all: propagate errors of functions from avfilter/formatsGanesh Ajjanagadde2015-10-14
| | | | | | | | | | | | | | | | | | Many of the functions from avfilter/formats can return errors, usually AVERROR(ENOMEM). This propagates the return values. All of these were found by using av_warn_unused_result, demonstrating its utility. Tested with FATE. I am least sure of the changes to avfilter/filtergraph, since I don't know what/how reduce_format is intended to behave and how it should react to errors. Fixes: CID 1325680, 1325679, 1325678. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Previous version Reviewed-by: Nicolas George <george@nsup.org> Previous version Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* avfilter/ebur128: use AV_OPT_TYPE_BOOL for video optionClément Bœsch2015-10-04
|
* avfilter/ebur128: add dualmono measurement optionKyle Swanson2015-10-04
|
* lavfi: remove FF_LINK_FLAG_REQUEST_LOOP.Nicolas George2015-09-20
| | | | It has no longer any effect.
* avfilter/ebur128: use AV_OPT_TYPE_BOOL for metadata optionClément Bœsch2015-09-08
|
* avfilter/ebur128: rework channel weighting definition codeClément Bœsch2014-09-06
| | | | Should fix CID1194399 (Bad bit shift operation)
* avfilter/f_ebur128: Use av_malloc_array()Michael Niedermayer2014-07-01
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavfi/ebur128: add true peak metering per frameJean First2014-02-02
| | | | Signed-off-by: Jean First <jeanfirst@gmail.com>
* lavfi/ebur128: print peak metering in dBFSJean First2014-02-02
| | | | Signed-off-by: Jean First <jeanfirst@gmail.com>
* lavfi/ebur128: add sample and true peak metering.Clément Bœsch2014-02-02
| | | | | | Metadata injection and logging. Not yet present visually. Signed-off-by: Jean First <jeanfirst@gmail.com>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-10-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: lavfi: do not export the filters from shared objects Conflicts: libavfilter/af_amix.c libavfilter/af_anull.c libavfilter/asrc_anullsrc.c libavfilter/f_select.c libavfilter/f_settb.c libavfilter/split.c libavfilter/src_movie.c libavfilter/vf_aspect.c libavfilter/vf_blackframe.c libavfilter/vf_colorbalance.c libavfilter/vf_copy.c libavfilter/vf_crop.c libavfilter/vf_cropdetect.c libavfilter/vf_drawbox.c libavfilter/vf_format.c libavfilter/vf_framestep.c libavfilter/vf_frei0r.c libavfilter/vf_hflip.c libavfilter/vf_libopencv.c libavfilter/vf_lut.c libavfilter/vf_null.c libavfilter/vf_overlay.c libavfilter/vf_scale.c libavfilter/vf_transpose.c libavfilter/vf_unsharp.c libavfilter/vf_vflip.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter: various cosmeticsPaul B Mahol2013-09-12
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter: remove redundant .get_(audio/video)_buffer initializationsPaul B Mahol2013-09-07
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavfi/ebur128: fix typo: s/negociation/negotiationPaul B Mahol2013-08-13
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>