comparison fft.h @ 11512:1382cfff33bb libavcodec

Call rdft by function pointer Call the RDFT by a function pointer like other FFT related transforms. This makes instruction set optimized versions possible. Based on patch by Alex Converse.
author mru
date Sat, 20 Mar 2010 21:27:03 +0000
parents 384d803faff4
children 628a6ba6a4af
comparison
equal deleted inserted replaced
11511:6bf21de8e6eb 11512:1382cfff33bb
194 194
195 /* pre/post rotation tables */ 195 /* pre/post rotation tables */
196 const FFTSample *tcos; 196 const FFTSample *tcos;
197 SINTABLE_CONST FFTSample *tsin; 197 SINTABLE_CONST FFTSample *tsin;
198 FFTContext fft; 198 FFTContext fft;
199 void (*rdft_calc)(struct RDFTContext *s, FFTSample *z);
199 }; 200 };
200 201
201 /** 202 /**
202 * Sets up a real FFT. 203 * Sets up a real FFT.
203 * @param nbits log2 of the length of the input array 204 * @param nbits log2 of the length of the input array
204 * @param trans the type of transform 205 * @param trans the type of transform
205 */ 206 */
206 int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans); 207 int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans);
207 void ff_rdft_calc(RDFTContext *s, FFTSample *data);
208 void ff_rdft_end(RDFTContext *s); 208 void ff_rdft_end(RDFTContext *s);
209
210 static av_always_inline void ff_rdft_calc(RDFTContext *s, FFTSample *data)
211 {
212 s->rdft_calc(s, data);
213 }
209 214
210 /* Discrete Cosine Transform */ 215 /* Discrete Cosine Transform */
211 216
212 struct DCTContext { 217 struct DCTContext {
213 int nbits; 218 int nbits;