summaryrefslogtreecommitdiff
path: root/libavcodec/mips/fft_mips.c
Commit message (Collapse)AuthorAge
* Include attributes.h directlyAndreas Rheinhardt2021-04-19
| | | | | | | | Some files currently rely on libavutil/cpu.h to include it for them; yet said file won't use include it any more after the currently deprecated functions are removed, so include attributes.h directly. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.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/mips: Fix segfault in imdct36_mips_float.Shiyou Yin2020-07-30
| | | | | | | 'li.s' is a synthesized instruction, it does not work properly when compiled with clang on mips, and A segfault occurred. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mips: Optimization synced to the newest code base.Jovan Zelincevic2016-03-29
| | | | | | | | FFT expanded to 2^17. Signed-off-by: Jovan Zelincevic <jovan.zelincevic@imgtec.com> Reviewed-by: Nedeljko Babic <Nedeljko.Babic@imgtec.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* mips: add support for R6Vicente Olivert Riera2016-03-09
| | | | | | | | | | | Understanding the mips32r6 and mips64r6 ISAs in the configure script is not enough. In order to have full support for MIPS R6 in FFmpeg we need to be able to build it, and for that we need to make sure we don't use incompatible assembler code which makes the build fail. Ifdefing the offending code is sufficient to fix the problem. Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com> 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>
* mips: port optimizations to mips n64James Cowgill2015-03-06
| | | | | | | | | | | | | This mainly consists of replacing all the pointer arithmatic 'addiu' instructions with PTR_ADDIU which will handle the differences in pointer sizes when compiled on 64 bit mips systems. The header asmdefs.h contains the PTR_ macros which expend to the correct mips instructions to manipulate registers containing pointers. Signed-off-by: James Cowgill <james410@cowgill.org.uk> Reviewed-by: Nedeljko Babic <Nedeljko.Babic@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* mips/fft: remove some useless assemblyJames Cowgill2015-02-26
| | | | | | | | Remove some assembly that the compiler can easily handle optimally on its own. GCC produces almost identical assembly. Signed-off-by: James Cowgill <james410@cowgill.org.uk> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* fft: add ff_ prefix to some global arrays.Reimar Döffinger2014-08-31
| | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* libavcodec: Implementation of 32 bit fixed point FFTNedeljko Babic2013-08-04
| | | | | | | | Iterative implementation of 32 bit fixed point split-radix FFT. Max FFT that can be calculated currently is 2^12. Signed-off-by: Nedeljko Babic <nbabic@mips.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* libavcodec/mips: fix for mips optimized fp fft with hard coded tables disabledNedeljko Babic2013-03-20
| | | | | | | | | | | Floating point FFT (nips optimized) breaks when hard coded tables are not enabled because MIPS optimization of floating point FFT uses only ff_init_ff_cos_tabs(16) which is not enabled by default in that case. This patch is fixing it. Signed-off-by: Nedeljko Babic <nbabic@mips.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* mips: inline assembly clobber list polishingNedeljko Babic2013-03-19
| | | | | | | List of clobbered registers fixed and added where it is lacking. Signed-off-by: Nedeljko Babic <nbabic@mips.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* mips: Add dependencies on HAVE_INLINE_ASMNedeljko Babic2012-11-10
| | | | | | | | | Add dependencies on HAVE_INLINE_ASM for files and parts of code where it is necessary. Signed-off-by: Nedeljko Babic <nbabic@mips.com> Reviewed-by: Vitor Sessak <vitor1001@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Optimization of AC3 floating point decoder for MIPSNedeljko Babic2012-09-05
FFT in MIPS implementation is working iteratively instead of "recursively" calling functions for smaller FFT sizes. Some of DSP and format convert utils functions are also optimized. Signed-off-by: Nedeljko Babic <nbabic@mips.com> Reviewed-by: Vitor Sessak <vitor1001@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>