summaryrefslogtreecommitdiff
path: root/libavfilter/af_astats.c
Commit message (Collapse)AuthorAgeFilesLines
* lavfi/astats: sort measures keys by nameStefano Sabatini2023-02-111-16/+16
|
* avfilter/af_astats: accessing outlink in uninit is not validPaul B Mahol2022-12-031-2/+5
|
* avfilter/af_astats: print stats in case nb_samples is 0Paul B Mahol2022-12-011-2/+2
| | | | Happens with special function only.
* avfilter/af_astats: do not give output for 0 samplesPaul B Mahol2022-11-301-0/+6
|
* avfilter: convert to new channel layout APIJames Almer2022-03-151-5/+5
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/af_astats: improve options descriptionsLimin Wang2021-12-141-3/+3
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avfilter: add AVFILTER_FLAG_METADATA_ONLYAnton Khirnov2021-12-041-1/+1
| | | | | | This flag allows distinguishing between filters that actually modify the data and those that only modify metadata or gather some stream information.
* all: Remove unused-but-set variablesAndreas Rheinhardt2021-12-031-4/+0
| | | | | | Newer versions of Clang detect this and emit warnings for it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/af_astats: Use formats list instead of query functionAndreas Rheinhardt2021-10-051-22/+5
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.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/af_astats: add entropy statPaul B Mahol2021-09-111-0/+35
|
* avfilter/af_astats: remove invalid 5x factor in window size calculationPaul B Mahol2021-08-211-3/+3
| | | | | Also allow smaller window sizes, and change histogram for noise floor calculation to uint64_t type.
* 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-1/+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-16/+3
| | | | | | | | | | | 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_astats: Only print header lines when values are to be printedTobias Rapp2021-07-141-2/+4
| | | | | | | | Avoids empty "Channel" or "Overall" header lines added to log output when measurement is restricted to one scope using "measure_perchannel=none" or "measure_overall=none". Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* 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_astats: fix possible crash because of undefined float to integer ↵Marton Balint2021-01-231-2/+2
| | | | | | | | rounding Fixes ticket #9049. Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/af_astats: clip input value to prevent overflowPaul B Mahol2021-01-041-1/+1
|
* avfilter/af_astats: add noise floor count statPaul B Mahol2020-04-171-4/+24
|
* avfilter/af_astats: add slice threading supportPaul B Mahol2020-04-171-14/+29
|
* avfilter/af_astats: measure noise floorPaul B Mahol2020-04-171-1/+79
|
* avfilter/af_astats: fix calculations involving last samplePaul B Mahol2019-05-121-4/+7
|
* avfilter/af_astats: fix initial values of variablesPaul B Mahol2019-05-121-8/+8
|
* avfilter/af_astats: fix msvc compile errorMatthias Troffaes2019-04-291-1/+1
| | | | | | MSVC requires an explicit cast from void * to void when applying the ternary conditional operator to switch between methods that return void.
* avfilter/af_astats: count number of NaNs/Infs/denormals for floating-point ↵Paul B Mahol2019-04-261-6/+80
| | | | audio too
* avfilter/af_astats: add support for optimized min/max/peak calculationMarton Balint2019-03-211-5/+21
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/af_astats: rework sample loopsMarton Balint2019-03-211-8/+9
| | | | | | | The channel loop is now the outer loop for both planar and interleaved. This is needed by the next patch, and the speed difference is negligable if any. Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/af_astats: factorize sample loopsMarton Balint2019-03-211-71/+37
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/af_astats: fix identationMarton Balint2019-03-211-74/+74
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/af_astats: add support for selecting measured statisticsMarton Balint2019-03-211-0/+118
| | | | | | | | | | | set_metadata with many entries is not very efficient, and with small audio frames the performance loss is noticable. Also with this very simple calculations (like peak) can be even further optimized. Unfoturnately there are some small differences in metadata and av_log info output, so factorizing calculations and output might not worth the hassle. Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/af_astats: count zero crossingsPaul B Mahol2018-09-171-0/+12
|
* avfilter/af_astats: measure dynamic rangePaul B Mahol2017-07-191-0/+7
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_astats: do not overwrite already set values when doing resetPaul B Mahol2017-07-191-2/+0
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter: don't anonymously typedef structsPaul B Mahol2017-05-131-1/+1
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_astats: add RMS difference tooPaul B Mahol2017-05-121-2/+13
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter: do not use AVFrame accessorMuhammad Faiz2017-04-231-1/+1
| | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* avfilter/af_astats: fix flt(p) supportPaul B Mahol2016-08-181-2/+2
|
* avfilter/af_astats: add support for s64(p) sample formatPaul B Mahol2016-08-181-0/+18
|
* avfilter/af_astats: add support for other sample formatsPaul B Mahol2016-08-151-25/+89
|
* avfilter/af_astats: extend bitdepth calculationPaul B Mahol2016-08-031-9/+28
|
* avfilter/af_astats: do not clear previous sample valuePaul B Mahol2016-02-261-5/+18
| | | | | | Should help when using reset=1 and metadata=1 Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_astats: clear all statsPaul B Mahol2016-02-251-1/+1
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_astats: reset stats prior not after filteringPaul B Mahol2016-02-241-8/+9
| | | | | | This way stats printed at uninit are also useful. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_astats: replace FFABS with fabsGanesh Ajjanagadde2015-10-131-3/+3
|
* avfilter: use ff_all_channel_counts() instead of ff_all_channel_layouts()Paul B Mahol2015-09-121-1/+1
| | | | | | Fixes playback of some files with ffplay. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/astats: use AV_OPT_TYPE_BOOL for metadata optionClément Bœsch2015-09-081-1/+1
|
* avfilter/af_astats: use UINT64_C instead of the LLU suffixJames Almer2015-07-201-1/+1
| | | | | | Should fix compilation with vs2012 Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/af_astats: measure minimal and mean difference between two ↵Paul B Mahol2015-07-171-4/+21
| | | | | | consecutive samples Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_astats: make sure p->last is actually always set when measuring ↵Paul B Mahol2015-07-151-1/+2
| | | | | | max difference Signed-off-by: Paul B Mahol <onemda@gmail.com>