summaryrefslogtreecommitdiff
path: root/libavcodec/fft.h
diff options
context:
space:
mode:
authorNedeljko Babic <nbabic@mips.com>2013-06-03 16:11:12 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-04 14:01:41 +0200
commit18d7074b4e5a1112cfa6a53dde0faa25d2bd0b15 (patch)
tree0d23cbed3eb59d91ba5c734a7222a6ae02c72cba /libavcodec/fft.h
parent27cc3e72f8502d6239dcd0f1dd3fe73f1c85355d (diff)
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>
Diffstat (limited to 'libavcodec/fft.h')
-rw-r--r--libavcodec/fft.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/libavcodec/fft.h b/libavcodec/fft.h
index 910e143f5a..217090cf2a 100644
--- a/libavcodec/fft.h
+++ b/libavcodec/fft.h
@@ -26,6 +26,10 @@
#define CONFIG_FFT_FLOAT 1
#endif
+#ifndef CONFIG_FFT_FIXED_32
+#define CONFIG_FFT_FIXED_32 0
+#endif
+
#include <stdint.h>
#include "config.h"
#include "libavutil/mem.h"
@@ -40,15 +44,26 @@ typedef float FFTDouble;
#else
+#if CONFIG_FFT_FIXED_32
+
+#define Q31(x) (int)((x)*2147483648.0 + 0.5)
+#define FFT_NAME(x) x ## _fixed_32
+
+typedef int32_t FFTSample;
+
+#else /* CONFIG_FFT_FIXED_32 */
+
#define FFT_NAME(x) x ## _fixed
typedef int16_t FFTSample;
-typedef int FFTDouble;
+
+#endif /* CONFIG_FFT_FIXED_32 */
typedef struct FFTComplex {
- int16_t re, im;
+ FFTSample re, im;
} FFTComplex;
+typedef int FFTDouble;
typedef struct FFTContext FFTContext;
#endif /* CONFIG_FFT_FLOAT */