libavcodec: Implementation of 32 bit fixed point FFT
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>
This commit is contained in:

committed by
Michael Niedermayer

parent
27cc3e72f8
commit
18d7074b4e
@@ -36,12 +36,29 @@
|
||||
|
||||
#else
|
||||
|
||||
#define SCALE_FLOAT(a, bits) lrint((a) * (double)(1 << (bits)))
|
||||
|
||||
#if CONFIG_FFT_FIXED_32
|
||||
|
||||
#define CMUL(dre, dim, are, aim, bre, bim) do { \
|
||||
int64_t accu; \
|
||||
(accu) = (int64_t)(bre) * (are); \
|
||||
(accu) -= (int64_t)(bim) * (aim); \
|
||||
(dre) = (int)(((accu) + 0x40000000) >> 31); \
|
||||
(accu) = (int64_t)(bre) * (aim); \
|
||||
(accu) += (int64_t)(bim) * (are); \
|
||||
(dim) = (int)(((accu) + 0x40000000) >> 31); \
|
||||
} while (0)
|
||||
|
||||
#define FIX15(a) av_clip(SCALE_FLOAT(a, 31), -2147483647, 2147483647)
|
||||
|
||||
#else /* CONFIG_FFT_FIXED_32 */
|
||||
|
||||
#include "fft.h"
|
||||
#include "mathops.h"
|
||||
|
||||
void ff_mdct_calcw_c(FFTContext *s, FFTDouble *output, const FFTSample *input);
|
||||
|
||||
#define SCALE_FLOAT(a, bits) lrint((a) * (double)(1 << (bits)))
|
||||
#define FIX15(a) av_clip(SCALE_FLOAT(a, 15), -32767, 32767)
|
||||
|
||||
#define sqrthalf ((int16_t)((1<<15)*M_SQRT1_2))
|
||||
@@ -62,6 +79,8 @@ void ff_mdct_calcw_c(FFTContext *s, FFTDouble *output, const FFTSample *input);
|
||||
#define CMULL(dre, dim, are, aim, bre, bim) \
|
||||
CMULS(dre, dim, are, aim, bre, bim, 0)
|
||||
|
||||
#endif /* CONFIG_FFT_FIXED_32 */
|
||||
|
||||
#endif /* CONFIG_FFT_FLOAT */
|
||||
|
||||
#define ff_imdct_calc_c FFT_NAME(ff_imdct_calc_c)
|
||||
|
Reference in New Issue
Block a user