summaryrefslogtreecommitdiff
path: root/libavcodec/fft_template.c
Commit message (Collapse)AuthorAge
* all: Replace if (ARCH_FOO) checks by #if ARCH_FOOAndreas Rheinhardt2022-06-15
| | | | | | | | | | | | | | | | | | 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>
* avcodec: Remove the FFT_FIXED_32 defineAndreas Rheinhardt2021-08-05
| | | | | | | | Since the removal of the 16-bit FFT said define is unnecessary as FFT_FIXED_32 is always !FFT_FLOAT. But one wouldn't believe it when looking at the code. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/fft_template: Avoid useless functionAndreas Rheinhardt2021-01-29
| | | | | | | | ff_init_ff_cos_tabs is only used for the floating point FFT and only if hardcoded tables are disabled. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* fft: remove 16-bit FFT and MDCT codeLynne2021-01-14
| | | | | | No longer used by anything. Unfortunately the old FFT_FLOAT/FFT_FIXED_32 is left as-is. It's simply too much work for code meant to be all removed anyway.
* avcodec/fft_template: Only check for FF_FFT_PERM_AVX on ARCH_X86Andreas Rheinhardt2021-01-08
| | | | | | | | Also do it for FFT_FLOAT only, as this is the only combination for which it can be set. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/fft_template, fft_init_table: Make ff_fft_init() thread-safeAndreas Rheinhardt2020-11-24
| | | | | | | | | | | | | | | | | | | | | | | | Commit 1af615683e4a1a858407afbaa2fd686842da7e49 put initializing the ff_fft_offsets_lut (which is typically used if FFT_FIXED_32) behind an ff_thread_once() to make ff_fft_init() thread-safe; yet there is a second place where said table may be initialized which is not guarded by this AVOnce: ff_fft_init_mips(). MIPS uses this LUT even for ordinary floating point FFTs, so that ff_fft_init() is not thread-safe (on MIPS) for both 32bit fixed-point as well as floating-point FFTs; e.g. ff_mdct_init() inherits this flaw and therefore initializing e.g. the AAC decoders is not thread-safe (on MIPS) despite them having FF_CODEC_CAP_INIT_CLEANUP set. This commit fixes this by moving the AVOnce to fft_init_table.c and using it to guard all initializations of ff_fft_offsets_lut. (It is not that bad in practice, because every entry of ff_fft_offsets_lut is never read during initialization and is only once ever written to (namely to its final value); but even these are conflicting actions which are (by definition) data races and lead to undefined behaviour.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/fft_template: improve performance of the ff_fft_init in fft_templateSteven Liu2019-01-04
| | | | | | | | | | Before patch: init nbits = 17, get 10000 samples, average cost: 16175 us After patch: init nbits = 17, get 10000 samples, average cost: 14989 us Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavc/fft_template: Do not define unneded functions with --enable-small.Carl Eugen Hoyos2018-07-21
| | | | | | | | | | | | | | | | | | | Fixes the following warnings: In file included from libavcodec/fft_fixed.c:21:0: libavcodec/fft_template.c:528:6: warning: ‘pass_big’ defined but not used [-Wunused-function] PASS(pass_big) ^ libavcodec/fft_template.c:505:13: note: in definition of macro ‘PASS’ static void name(FFTComplex *z, const FFTSample *wre, unsigned int n)\ ^~~~ CC libavcodec/ffv1.o In file included from libavcodec/fft_float.c:21:0: libavcodec/fft_template.c:528:6: warning: ‘pass_big’ defined but not used [-Wunused-function] PASS(pass_big) ^ libavcodec/fft_template.c:505:13: note: in definition of macro ‘PASS’ static void name(FFTComplex *z, const FFTSample *wre, unsigned int n)\ ^~~~
* avcodec/fft_template: use ff_thread_once on costable initializationMuhammad Faiz2017-07-07
| | | | | | | | Make it thread-safe and avoid redundant initialization. Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* avcodec/fft_template: Fix multiple runtime error: signed integer overflow: ↵Michael Niedermayer2017-06-11
| | | | | | | | | | | | -1943918714 - 1935113003 cannot be represented in type 'int' Fixes: 1735/clusterfuzz-testcase-minimized-5350472347025408 This uses unsigned instead of SUINT because the later was rejected by multiple developers See: [FFmpeg-devel] [PATCH] avcodec/fft_template: Fix multiple runtime error: signed integer overflow: -1943918714 - 1935113003 cannot be represented in type 'int' Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/fft: Add revtab32 for FFTs with more than 65536 samplesMichael Niedermayer2016-03-04
| | | | | | x86 optimizations are used only for the cases they support (<=65536 samples) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: Extend fft to size 2^17Michael Niedermayer2016-03-04
| | | | | | Asked-for-by: durandal_1707 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* fft_template: Move variables to where they are used.Reimar Döffinger2014-08-31
| | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* fft: add ff_ prefix to some global arrays.Reimar Döffinger2014-08-31
| | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* fft: add missing const.Reimar Döffinger2014-08-30
| | | | | | | This table was the largest object in FFmpeg's .data, and really should be in .rodata. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* Merge commit '650c4300d94aa9398ff1dd4f454bf39eaa285f62'Michael Niedermayer2014-04-22
|\ | | | | | | | | | | | | * commit '650c4300d94aa9398ff1dd4f454bf39eaa285f62': aarch64: NEON float FFT Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aarch64: NEON float FFTJanne Grunau2014-04-22
| | | | | | | | Approximately as fast as the ARM NEON version on Apple's A7.
* | rename CONFIG_FFT_FIXED_32 -> FFT_FIXED_32Michael Niedermayer2014-01-07
| | | | | | | | | | | | This matches FFT_FLOAT Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '794fcf79a89eca2d4e889803b2c804a0b1defbb3'Michael Niedermayer2014-01-07
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '794fcf79a89eca2d4e889803b2c804a0b1defbb3': Rename CONFIG_FFT_FLOAT ---> FFT_FLOAT Conflicts: libavcodec/fft-internal.h libavcodec/fft-test.c libavcodec/fft_fixed.c libavcodec/fft_float.c libavcodec/fft_template.c libavcodec/mdct_fixed.c libavcodec/mdct_float.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Rename CONFIG_FFT_FLOAT ---> FFT_FLOATDiego Biurrun2014-01-06
| | | | | | | | | | The define does not originate from configure, so it should not have a name that is CONFIG_-prefixed.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-11-21
|/ | | | | | | | | | | | | * qatar/master: dct/fft: Give consistent names to fixed/float template files Conflicts: libavcodec/fft_fixed.c libavcodec/fft_float.c libavcodec/mdct_fixed.c libavcodec/mdct_float.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* dct/fft: Give consistent names to fixed/float template filesDiego Biurrun2013-11-21