Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-04lavfi/avf_showcqt: set frame durationsAnton Khirnov
The filter is supposed to produce CFR output.
2022-06-15all: Replace if (ARCH_FOO) checks by #if ARCH_FOOAndreas Rheinhardt
This is more spec-compliant because it does not rely on dead-code elimination by the compiler. Especially MSVC has problems with this, as can be seen in https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html or https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/297022.html This commit does not eliminate every instance where we rely on dead code elimination: It only tackles branching to the initialization of arch-specific dsp code, not e.g. all uses of CONFIG_ and HAVE_ checks. But maybe it is already enough to compile FFmpeg with MSVC with whole-programm-optimizations enabled (if one does not disable too many components). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-15avfilter: convert to new channel layout APIJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2021-10-05avfilter: Replace query_formats callback with union of list and callbackAndreas Rheinhardt
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>
2021-08-20avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilterAndreas Rheinhardt
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-07-27avfilter/avf_showcqt: switch to TX FFT from avutilPaul B Mahol
2021-07-22Remove unnecessary avassert.h inclusionsAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22avcodec/avcodec: Stop including channel_layout.h in avcodec.hAndreas Rheinhardt
Also include channel_layout.h directly wherever used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-27avfilter: Constify all AVFiltersAndreas Rheinhardt
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-02-27avfilter/avf_showcqt: use av_gettime_relative() instead of av_gettime()Marton Balint
av_gettime_relative() is using the monotonic clock therefore more suitable for relative time calculations. Signed-off-by: Marton Balint <cus@passwd.hu>
2020-09-08lavfi: regroup formats lists in a single structure.Nicolas George
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/*(.)
2020-08-12avfilter/formats: Schedule avfilter_make_format64_list() for removalAndreas Rheinhardt
Despite its name, this function is not part of the public API, as formats.h, the header containing its declaration, is a private header. The formats API was once public API, but that changed long ago (b74a1da49db5ebed51aceae6cacc2329288a92c1, the commit scheduling it to become private, is from 2012). That avfilter_make_format64_list() was forgotten is probably a result of the confusion resulting from the libav-ffmpeg split. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-12avfilter/avf_showcqt: Mark arrays as static constAndreas Rheinhardt
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-05-22Stop hardcoding align=32 in av_frame_get_buffer() calls.Anton Khirnov
Use 0, which selects the alignment automatically.
2020-03-18remove CHAR_MIN/CHAR_MAX usagePaul B Mahol
It is not needed at all.
2017-04-23avfilter: do not use AVFrame accessorMuhammad Faiz
Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-04-09avfilter/avf_showcqt: add attack optionMuhammad Faiz
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-01-30avfilter/showcqt: make minimum timeclamp option lowerMuhammad Faiz
high basefreq does not require high timeclamp Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-10-29avfilter/avf_showcqt: add bar_t optionMuhammad Faiz
custom bargraph transparency Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-10-20avfilter/showcqt: add cscheme optionMuhammad Faiz
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-10-17avfilter/showcqt: add font optionMuhammad Faiz
this is fontconfig pattern Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-10-16avfilter/showcqt: add csp optionMuhammad Faiz
from colorspace filter Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-06-24avfilter/showcqt: set some frame propertiesMuhammad Faiz
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-06-08avfilter/avf_showcqt: set range on fps/rate/r optionMuhammad Faiz
see Ticket #5618 Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-06-08avfilter/avf_showcqt: cqt_calc optimization on x86Muhammad Faiz
on x86_64: time PSNR plain 3.303 inf SSE 1.649 107.087535 SSE3 1.632 107.087535 AVX 1.409 106.986771 FMA3 1.265 107.108437 on x86_32 (PSNR compared to x86_64 plain): time PSNR plain 7.225 103.951979 SSE 1.827 105.859282 SSE3 1.819 105.859282 AVX 1.533 105.997661 FMA3 1.384 105.885377 FMA4 test is not available Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-06-04avfilter/avf_showcqt: render default font at 960x16Muhammad Faiz
and let ffmpeg scaler scale it this impoves quality Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-06-02avfilter/avf_showcqt: full chroma blending on draw_axis_yuvMuhammad Faiz
improve quality on axis drawing with yuv422p and yuv420p format Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-03-08avfilter/avf_showcqt: add performance debugging logMuhammad Faiz
for easier development Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-03-06avfilter/avf_showcqt: remove CoeffsTypeMuhammad Faiz
seems not useful Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-02-29avfilter/avf_showcqt: optimize draw routinesMuhammad Faiz
optimize draw_bar_yuv (slightly faster) optimize draw_axis (about 2x faster) Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-02-23avfilter/avf_showcqt: use lrintMuhammad Faiz
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-02-22avfilter/avf_showcqt: remove unneeded headersMuhammad Faiz
2016-02-17avfilter/avf_showcqt: improve pts handlingMuhammad Faiz
correct output pts based on input pts make seeking possible output frame one by one on eof tested with showinfo filter Suggested-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-07avfilter/showcqt: BASEFREQ and ENDFREQ cast to doubleMuhammad Faiz
fix default basefreq/endfreq comparison on platform that does not do comparison in double type found on zeranoe 32-bit build, where default freq range is detected as non-default Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11avfilter/avf_showcqt: Fix uninitialized return codeMichael Niedermayer
Fixes CID1322329 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-04avfilter/showcqt: remove yuv offsetMuhammad Faiz
this makes draw_bar faster slightly different result with old version check result (with ~3 minutes audio file): old: real 0m49.611s user 0m49.260s sys 0m0.073s new: real 0m47.606s user 0m47.378s sys 0m0.068s PSNR between old and new: yuv444p PSNR y:109.519298 u:107.506485 v:104.746878 average:106.816074 min:99.167305 max:inf yuv422p PSNR y:109.519298 u:108.025801 v:104.489734 average:107.279817 min:98.007467 max:inf yuv420p PSNR y:109.519298 u:108.363875 v:105.290200 average:108.261511 min:97.461812 max:inf Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-31avfilter/avf_showcqt: Replace all fmin* and fmax* by FFMIN/FFMAXMichael Niedermayer
Should fix build on x86_32-msvc2012 The alternative of emulating fmin/fmax* turns out to be non trivial Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-28avfilter/avf_showcqt: rewrite showcqt and add featuresMuhammad Faiz
add yuv444p, yuv422p, and yuv420p output format (lower cpu usage on ffplay playback because it does not do format conversion) custom size with size/s option (fullhd option is deprecated) custom layout with bar_h, axis_h, and sono_h option support rational frame rate (within fps/r/rate option) relaxed frame rate restriction (support fractional sample step) support all input sample rates separate sonogram and bargraph volume (with volume/sono_v and volume2/bar_v) timeclamp option alias (timeclamp/tc) fcount option gamma option alias (gamma/sono_g and gamma2/bar_g) support custom frequency range (basefreq and endfreq) support drawing axis using external image file (axisfile option) alias for disabling drawing to axis (text/axis) possibility to optimize it using arch specific asm code Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-22avfilter,swresample,swscale: use fabs, fabsf instead of FFABSGanesh Ajjanagadde
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>
2015-10-14avfilter/all: propagate errors of functions from avfilter/formatsGanesh Ajjanagadde
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>
2015-10-07lavfi/avf_showcqt: remove looping on request_frame().Nicolas George
2015-09-18avfilter/avf_showcqt: use frequency domain windowingMuhammad Faiz
faster initialization and less code slightly different result computationally from previous coeffclamp option is ignored Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-15avfilter/avf_showcqt: draw text optionallyPaul B Mahol
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-09-14avfilter/avf_showcqt: change fft left-right separationMuhammad Faiz
This simplifies the code Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-09avfilter/showcqt: use AV_OPT_TYPE_BOOL for fullhd optionClément Bœsch
2015-05-12avfilter/avf_showcqt: Fix gamma comparisonsMichael Niedermayer
Fixes CID1297587, CID1297586, 1297585 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-03avfilter/avf_showcqt: optimize gamma calculationMuhammad Faiz
benchmark (on intel core2 duo, gcc 4.9.1) input samples duration 00:03:39.59 command: time -p ffmpeg -f f32le -ac 2 -ar 44100 -i input.pcm \ -filter_complex showcqt=fullhd=0:gamma=$gamma \ -f rawvideo -y /dev/null gamma previous modified 1 48.49 s 45.38 s 2 49.33 s 48.11 s 3 80.86 s 59.80 s 4 80.84 s 51.25 s 5 80.75 s 61.06 s 6 80.93 s 61.80 s 7 80.03 s 61.56 s Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-16lavfi/avf_showcqt: fix error code.Nicolas George
Signed-off-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-22avfilter/avf_showcqt: use av_malloc_array()Michael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-18avfilter/showcqt: add gamma2 optionMuhammad Faiz
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>