Revision 7087ce08 libavcodec/fft.h

View differences:

libavcodec/fft.h
22 22
#ifndef AVCODEC_FFT_H
23 23
#define AVCODEC_FFT_H
24 24

  
25
#ifndef CONFIG_FFT_FLOAT
26
#define CONFIG_FFT_FLOAT 1
27
#endif
28

  
25 29
#include <stdint.h>
26 30
#include "config.h"
27 31
#include "libavutil/mem.h"
32

  
33
#if CONFIG_FFT_FLOAT
34

  
28 35
#include "avfft.h"
29 36

  
37
#define FFT_NAME(x) x
38

  
39
typedef float FFTDouble;
40

  
41
#else
42

  
43
#define FFT_NAME(x) x ## _fixed
44

  
45
typedef int16_t FFTSample;
46
typedef int     FFTDouble;
47

  
48
typedef struct FFTComplex {
49
    int16_t re, im;
50
} FFTComplex;
51

  
52
typedef struct FFTContext FFTContext;
53

  
54
#endif /* CONFIG_FFT_FLOAT */
55

  
30 56
/* FFT computation */
31 57

  
32 58
struct FFTContext {
......
66 92
#endif
67 93

  
68 94
#define COSTABLE(size) \
69
    COSTABLE_CONST DECLARE_ALIGNED(16, FFTSample, ff_cos_##size)[size/2]
95
    COSTABLE_CONST DECLARE_ALIGNED(16, FFTSample, FFT_NAME(ff_cos_##size))[size/2]
70 96

  
71 97
extern COSTABLE(16);
72 98
extern COSTABLE(32);
......
81 107
extern COSTABLE(16384);
82 108
extern COSTABLE(32768);
83 109
extern COSTABLE(65536);
84
extern COSTABLE_CONST FFTSample* const ff_cos_tabs[17];
110
extern COSTABLE_CONST FFTSample* const FFT_NAME(ff_cos_tabs)[17];
111

  
112
#define ff_init_ff_cos_tabs FFT_NAME(ff_init_ff_cos_tabs)
85 113

  
86 114
/**
87 115
 * Initialize the cosine table in ff_cos_tabs[index]
......
89 117
 */
90 118
void ff_init_ff_cos_tabs(int index);
91 119

  
120
#define ff_fft_init FFT_NAME(ff_fft_init)
121
#define ff_fft_end  FFT_NAME(ff_fft_end)
122

  
92 123
/**
93 124
 * Set up a complex FFT.
94 125
 * @param nbits           log2 of the length of the input array
......
102 133

  
103 134
void ff_fft_end(FFTContext *s);
104 135

  
136
#define ff_mdct_init FFT_NAME(ff_mdct_init)
137
#define ff_mdct_end  FFT_NAME(ff_mdct_end)
138

  
105 139
int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale);
106
void ff_imdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input);
107
void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input);
108
void ff_mdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input);
109 140
void ff_mdct_end(FFTContext *s);
110 141

  
111 142
#endif /* AVCODEC_FFT_H */

Also available in: Unified diff