Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nt codec_init(void);
- void codec_set_replaygain(struct mp3entry* id3);
- # 36 "/home/mike/rockbox/mdct/apps/codecs/lib/fft-ffmpeg.c" 2
- # 1 "/home/mike/rockbox/mdct/apps/codecs/lib/mdct_lookup.h" 1
- # 19 "/home/mike/rockbox/mdct/apps/codecs/lib/mdct_lookup.h"
- extern const int sincos_lookup0[1026];
- extern const int sincos_lookup1[1024];
- # 41 "/home/mike/rockbox/mdct/apps/codecs/lib/fft-ffmpeg.c" 2
- static void ff_fft_permute_c(FFTContext *s, FFTComplex *z);
- # 52 "/home/mike/rockbox/mdct/apps/codecs/lib/fft-ffmpeg.c"
- int muls, adds;
- # 79 "/home/mike/rockbox/mdct/apps/codecs/lib/fft-ffmpeg.c"
- unsigned short revtab[1<
- <
- 12];
- static _Bool revtab_initialised = 0;
- static int split_radix_permutation(int i, int n, int inverse)
- {
- int m;
- if(n <
- = 2) return i&1;
- m = n >
- >
- 1;
- if(!(i&m)) return split_radix_permutation(i, m, inverse)*2;
- m >
- >
- = 1;
- if(inverse == !(i&m)) return split_radix_permutation(i, m, inverse)*4 + 1;
- else return split_radix_permutation(i, m, inverse)*4 - 1;
- }
- int ff_fft_init(void *arg_s, int nbits, int inverse)
- {
- int i, n;
- FFTContext *s = (FFTContext *)(arg_s);
- if (nbits <
- 2 || nbits >
- 12)
- return -1;
- s->
- nbits = nbits;
- n = 1 <
- <
- nbits;
- s->
- revtab = revtab;
- s->
- inverse = inverse;
- s->
- fft_permute = ff_fft_permute_c;
- s->
- fft_calc = ff_fft_calc_c;
- s->
- split_radix = 1;
- # 156 "/home/mike/rockbox/mdct/apps/codecs/lib/fft-ffmpeg.c"
- if( !revtab_initialised )
- {
- const int MAX_REVTAB=1<
- <
- 12;
- for(i=0; i<MAX_REVTAB ; i++)
- s->
- revtab[-split_radix_permutation(i, MAX_REVTAB, s->
- inverse) & (MAX_REVTAB-1)] = i;
- revtab_initialised = 1;
- }
- return 0;
- }
- static void ff_fft_permute_c(FFTContext *s, FFTComplex *z)
- {
- int j, k, np;
- FFTComplex tmp;
- const unsigned short *revtab = s->
- revtab;
- np = 1 <
- <
- s->
- nbits;
- const int revtab_shift = (12 - s->
- nbits);
- for(j=0;j<np;j++) {
- k = revtab[j]>
- >
- revtab_shift;
- if (k <
- j) {
- tmp = z[k];
- z[k] = z[j];
- z[j] = tmp;
- }
- }
- }
- # 316 "/home/mike/rockbox/mdct/apps/codecs/lib/fft-ffmpeg.c"
- static void pass(FFTComplex *z, unsigned int STEP, unsigned int n){
- FFTSample t1, t2, t3, t4, t5, t6;
- int o1 = 2*n;
- int o2 = 4*n;
- int o3 = 6*n;
- muls += 3;
- const FFTSample *wim = sincos_lookup0+STEP;
- const FFTSample *w_end = sincos_lookup0+1024;
- adds += 2;
- {
- t1 = z[o2].re;
- t2 = z[o2].im;
- t5 = z[o3].re;
- t6 = z[o3].im;
- {
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[o2].re = z[0].re - t5;
- z[0].re = z[0].re + t5;
- adds += 2;
- }
- ;
- {
- z[o3].im = z[o1].im - t3;
- z[o1].im = z[o1].im + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[o3].re = z[o1].re - t4;
- z[o1].re = z[o1].re + t4;
- adds += 2;
- }
- ;
- {
- z[o2].im = z[0].im - t6;
- z[0].im = z[0].im + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- {
- t1 = fixmul32b(z[o2+1].re, wim[1]) + fixmul32b(z[o2+1].im, wim[0]);
- t2 = fixmul32b(z[o2+1].im, wim[1]) - fixmul32b(z[o2+1].re, wim[0]);
- t5 = fixmul32b(z[o3+1].re, wim[1]) - fixmul32b(z[o3+1].im, wim[0]);
- t6 = fixmul32b(z[o3+1].im, wim[1]) + fixmul32b(z[o3+1].re, wim[0]);
- muls += 8;
- {
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[o2+1].re = z[1].re - t5;
- z[1].re = z[1].re + t5;
- adds += 2;
- }
- ;
- {
- z[o3+1].im = z[o1+1].im - t3;
- z[o1+1].im = z[o1+1].im + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[o3+1].re = z[o1+1].re - t4;
- z[o1+1].re = z[o1+1].re + t4;
- adds += 2;
- }
- ;
- {
- z[o2+1].im = z[1].im - t6;
- z[1].im = z[1].im + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- wim += STEP;
- adds += 1;
- do {
- z += 2;
- {
- t1 = fixmul32b(z[o2].re, wim[1]) + fixmul32b(z[o2].im, wim[0]);
- t2 = fixmul32b(z[o2].im, wim[1]) - fixmul32b(z[o2].re, wim[0]);
- t5 = fixmul32b(z[o3].re, wim[1]) - fixmul32b(z[o3].im, wim[0]);
- t6 = fixmul32b(z[o3].im, wim[1]) + fixmul32b(z[o3].re, wim[0]);
- muls += 8;
- {
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[o2].re = z[0].re - t5;
- z[0].re = z[0].re + t5;
- adds += 2;
- }
- ;
- {
- z[o3].im = z[o1].im - t3;
- z[o1].im = z[o1].im + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[o3].re = z[o1].re - t4;
- z[o1].re = z[o1].re + t4;
- adds += 2;
- }
- ;
- {
- z[o2].im = z[0].im - t6;
- z[0].im = z[0].im + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- wim += STEP;
- {
- t1 = fixmul32b(z[o2+1].re, wim[1]) + fixmul32b(z[o2+1].im, wim[0]);
- t2 = fixmul32b(z[o2+1].im, wim[1]) - fixmul32b(z[o2+1].re, wim[0]);
- t5 = fixmul32b(z[o3+1].re, wim[1]) - fixmul32b(z[o3+1].im, wim[0]);
- t6 = fixmul32b(z[o3+1].im, wim[1]) + fixmul32b(z[o3+1].re, wim[0]);
- muls += 8;
- {
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[o2+1].re = z[1].re - t5;
- z[1].re = z[1].re + t5;
- adds += 2;
- }
- ;
- {
- z[o3+1].im = z[o1+1].im - t3;
- z[o1+1].im = z[o1+1].im + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[o3+1].re = z[o1+1].re - t4;
- z[o1+1].re = z[o1+1].re + t4;
- adds += 2;
- }
- ;
- {
- z[o2+1].im = z[1].im - t6;
- z[1].im = z[1].im + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- wim += STEP;
- adds += 3;
- }
- while(wim <
- w_end);
- w_end=sincos_lookup0;
- while(wim>
- w_end) {
- z += 2;
- {
- t1 = fixmul32b(z[o2].re, wim[0]) + fixmul32b(z[o2].im, wim[1]);
- t2 = fixmul32b(z[o2].im, wim[0]) - fixmul32b(z[o2].re, wim[1]);
- t5 = fixmul32b(z[o3].re, wim[0]) - fixmul32b(z[o3].im, wim[1]);
- t6 = fixmul32b(z[o3].im, wim[0]) + fixmul32b(z[o3].re, wim[1]);
- muls += 8;
- {
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[o2].re = z[0].re - t5;
- z[0].re = z[0].re + t5;
- adds += 2;
- }
- ;
- {
- z[o3].im = z[o1].im - t3;
- z[o1].im = z[o1].im + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[o3].re = z[o1].re - t4;
- z[o1].re = z[o1].re + t4;
- adds += 2;
- }
- ;
- {
- z[o2].im = z[0].im - t6;
- z[0].im = z[0].im + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- wim -= STEP;
- {
- t1 = fixmul32b(z[o2+1].re, wim[0]) + fixmul32b(z[o2+1].im, wim[1]);
- t2 = fixmul32b(z[o2+1].im, wim[0]) - fixmul32b(z[o2+1].re, wim[1]);
- t5 = fixmul32b(z[o3+1].re, wim[0]) - fixmul32b(z[o3+1].im, wim[1]);
- t6 = fixmul32b(z[o3+1].im, wim[0]) + fixmul32b(z[o3+1].re, wim[1]);
- muls += 8;
- {
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[o2+1].re = z[1].re - t5;
- z[1].re = z[1].re + t5;
- adds += 2;
- }
- ;
- {
- z[o3+1].im = z[o1+1].im - t3;
- z[o1+1].im = z[o1+1].im + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[o3+1].re = z[o1+1].re - t4;
- z[o1+1].re = z[o1+1].re + t4;
- adds += 2;
- }
- ;
- {
- z[o2+1].im = z[1].im - t6;
- z[1].im = z[1].im + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- wim -= STEP;
- adds += 3;
- }
- }
- static void pass_big(FFTComplex *z, unsigned int STEP, unsigned int n){
- FFTSample t1, t2, t3, t4, t5, t6;
- int o1 = 2*n;
- int o2 = 4*n;
- int o3 = 6*n;
- muls += 3;
- const FFTSample *wim = sincos_lookup0+STEP;
- const FFTSample *w_end = sincos_lookup0+1024;
- adds += 2;
- {
- t1 = z[o2].re;
- t2 = z[o2].im;
- t5 = z[o3].re;
- t6 = z[o3].im;
- {
- FFTSample r0=z[0].re, i0=z[0].im, r1=z[o1].re, i1=z[o1].im;
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[o2].re = r0 - t5;
- z[0].re = r0 + t5;
- adds += 2;
- }
- ;
- {
- z[o3].im = i1 - t3;
- z[o1].im = i1 + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[o3].re = r1 - t4;
- z[o1].re = r1 + t4;
- adds += 2;
- }
- ;
- {
- z[o2].im = i0 - t6;
- z[0].im = i0 + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- {
- t1 = fixmul32b(z[o2+1].re, wim[1]) + fixmul32b(z[o2+1].im, wim[0]);
- t2 = fixmul32b(z[o2+1].im, wim[1]) - fixmul32b(z[o2+1].re, wim[0]);
- t5 = fixmul32b(z[o3+1].re, wim[1]) - fixmul32b(z[o3+1].im, wim[0]);
- t6 = fixmul32b(z[o3+1].im, wim[1]) + fixmul32b(z[o3+1].re, wim[0]);
- muls += 8;
- {
- FFTSample r0=z[1].re, i0=z[1].im, r1=z[o1+1].re, i1=z[o1+1].im;
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[o2+1].re = r0 - t5;
- z[1].re = r0 + t5;
- adds += 2;
- }
- ;
- {
- z[o3+1].im = i1 - t3;
- z[o1+1].im = i1 + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[o3+1].re = r1 - t4;
- z[o1+1].re = r1 + t4;
- adds += 2;
- }
- ;
- {
- z[o2+1].im = i0 - t6;
- z[1].im = i0 + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- wim += STEP;
- adds += 1;
- do {
- z += 2;
- {
- t1 = fixmul32b(z[o2].re, wim[1]) + fixmul32b(z[o2].im, wim[0]);
- t2 = fixmul32b(z[o2].im, wim[1]) - fixmul32b(z[o2].re, wim[0]);
- t5 = fixmul32b(z[o3].re, wim[1]) - fixmul32b(z[o3].im, wim[0]);
- t6 = fixmul32b(z[o3].im, wim[1]) + fixmul32b(z[o3].re, wim[0]);
- muls += 8;
- {
- FFTSample r0=z[0].re, i0=z[0].im, r1=z[o1].re, i1=z[o1].im;
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[o2].re = r0 - t5;
- z[0].re = r0 + t5;
- adds += 2;
- }
- ;
- {
- z[o3].im = i1 - t3;
- z[o1].im = i1 + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[o3].re = r1 - t4;
- z[o1].re = r1 + t4;
- adds += 2;
- }
- ;
- {
- z[o2].im = i0 - t6;
- z[0].im = i0 + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- wim += STEP;
- {
- t1 = fixmul32b(z[o2+1].re, wim[1]) + fixmul32b(z[o2+1].im, wim[0]);
- t2 = fixmul32b(z[o2+1].im, wim[1]) - fixmul32b(z[o2+1].re, wim[0]);
- t5 = fixmul32b(z[o3+1].re, wim[1]) - fixmul32b(z[o3+1].im, wim[0]);
- t6 = fixmul32b(z[o3+1].im, wim[1]) + fixmul32b(z[o3+1].re, wim[0]);
- muls += 8;
- {
- FFTSample r0=z[1].re, i0=z[1].im, r1=z[o1+1].re, i1=z[o1+1].im;
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[o2+1].re = r0 - t5;
- z[1].re = r0 + t5;
- adds += 2;
- }
- ;
- {
- z[o3+1].im = i1 - t3;
- z[o1+1].im = i1 + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[o3+1].re = r1 - t4;
- z[o1+1].re = r1 + t4;
- adds += 2;
- }
- ;
- {
- z[o2+1].im = i0 - t6;
- z[1].im = i0 + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- wim += STEP;
- adds += 3;
- }
- while(wim <
- w_end);
- w_end=sincos_lookup0;
- while(wim>
- w_end) {
- z += 2;
- {
- t1 = fixmul32b(z[o2].re, wim[0]) + fixmul32b(z[o2].im, wim[1]);
- t2 = fixmul32b(z[o2].im, wim[0]) - fixmul32b(z[o2].re, wim[1]);
- t5 = fixmul32b(z[o3].re, wim[0]) - fixmul32b(z[o3].im, wim[1]);
- t6 = fixmul32b(z[o3].im, wim[0]) + fixmul32b(z[o3].re, wim[1]);
- muls += 8;
- {
- FFTSample r0=z[0].re, i0=z[0].im, r1=z[o1].re, i1=z[o1].im;
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[o2].re = r0 - t5;
- z[0].re = r0 + t5;
- adds += 2;
- }
- ;
- {
- z[o3].im = i1 - t3;
- z[o1].im = i1 + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[o3].re = r1 - t4;
- z[o1].re = r1 + t4;
- adds += 2;
- }
- ;
- {
- z[o2].im = i0 - t6;
- z[0].im = i0 + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- wim -= STEP;
- {
- t1 = fixmul32b(z[o2+1].re, wim[0]) + fixmul32b(z[o2+1].im, wim[1]);
- t2 = fixmul32b(z[o2+1].im, wim[0]) - fixmul32b(z[o2+1].re, wim[1]);
- t5 = fixmul32b(z[o3+1].re, wim[0]) - fixmul32b(z[o3+1].im, wim[1]);
- t6 = fixmul32b(z[o3+1].im, wim[0]) + fixmul32b(z[o3+1].re, wim[1]);
- muls += 8;
- {
- FFTSample r0=z[1].re, i0=z[1].im, r1=z[o1+1].re, i1=z[o1+1].im;
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[o2+1].re = r0 - t5;
- z[1].re = r0 + t5;
- adds += 2;
- }
- ;
- {
- z[o3+1].im = i1 - t3;
- z[o1+1].im = i1 + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[o3+1].re = r1 - t4;
- z[o1+1].re = r1 + t4;
- adds += 2;
- }
- ;
- {
- z[o2+1].im = i0 - t6;
- z[1].im = i0 + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- wim -= STEP;
- adds += 3;
- }
- }
- # 348 "/home/mike/rockbox/mdct/apps/codecs/lib/fft-ffmpeg.c"
- static void fft4(FFTComplex *z)
- {
- FFTSample t1, t2, t3, t4, t5, t6, t7, t8;
- {
- t3 = z[0].re - z[1].re;
- t1 = z[0].re + z[1].re;
- adds += 2;
- }
- ;
- {
- t8 = z[3].re - z[2].re;
- t6 = z[3].re + z[2].re;
- adds += 2;
- }
- ;
- {
- z[2].re = t1 - t6;
- z[0].re = t1 + t6;
- adds += 2;
- }
- ;
- {
- t4 = z[0].im - z[1].im;
- t2 = z[0].im + z[1].im;
- adds += 2;
- }
- ;
- {
- t7 = z[2].im - z[3].im;
- t5 = z[2].im + z[3].im;
- adds += 2;
- }
- ;
- {
- z[3].im = t4 - t8;
- z[1].im = t4 + t8;
- adds += 2;
- }
- ;
- {
- z[3].re = t3 - t7;
- z[1].re = t3 + t7;
- adds += 2;
- }
- ;
- {
- z[2].im = t2 - t5;
- z[0].im = t2 + t5;
- adds += 2;
- }
- ;
- }
- static void fft8(FFTComplex *z)
- {
- FFTSample t1, t2, t3, t4, t5, t6, t7, t8;
- fft4(z);
- {
- t1 = z[4].re - -z[5].re;
- z[5].re = z[4].re + -z[5].re;
- adds += 2;
- }
- ;
- {
- t2 = z[4].im - -z[5].im;
- z[5].im = z[4].im + -z[5].im;
- adds += 2;
- }
- ;
- {
- t3 = z[6].re - -z[7].re;
- z[7].re = z[6].re + -z[7].re;
- adds += 2;
- }
- ;
- {
- t4 = z[6].im - -z[7].im;
- z[7].im = z[6].im + -z[7].im;
- adds += 2;
- }
- ;
- {
- t8 = t3 - t1;
- t1 = t3 + t1;
- adds += 2;
- }
- ;
- {
- t7 = t2 - t4;
- t2 = t2 + t4;
- adds += 2;
- }
- ;
- {
- z[4].re = z[0].re - t1;
- z[0].re = z[0].re + t1;
- adds += 2;
- }
- ;
- {
- z[4].im = z[0].im - t2;
- z[0].im = z[0].im + t2;
- adds += 2;
- }
- ;
- {
- z[6].re = z[2].re - t7;
- z[2].re = z[2].re + t7;
- adds += 2;
- }
- ;
- {
- z[6].im = z[2].im - t8;
- z[2].im = z[2].im + t8;
- adds += 2;
- }
- ;
- {
- t3 = fixmul32b(z[5].re, (0x5a82799a));
- t4 = fixmul32b(z[5].im, (0x5a82799a));
- t7 = fixmul32b(z[7].re, (0x5a82799a));
- t8 = fixmul32b(z[7].im, (0x5a82799a));
- t1 = ( t3 + t4 );
- t2 = ( t4 - t3 );
- t5 = ( t7 - t8 );
- t6 = ( t8 + t7 );
- {
- FFTSample r0=z[1].re, i0=z[1].im, r1=z[3].re, i1=z[3].im;
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[5].re = r0 - t5;
- z[1].re = r0 + t5;
- adds += 2;
- }
- ;
- {
- z[7].im = i1 - t3;
- z[3].im = i1 + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[7].re = r1 - t4;
- z[3].re = r1 + t4;
- adds += 2;
- }
- ;
- {
- z[5].im = i0 - t6;
- z[1].im = i0 + t6;
- adds += 2;
- }
- ;
- }
- }
- }
- static void fft16(FFTComplex *z)
- {
- FFTSample t1, t2, t3, t4, t5, t6, t7, t8;
- fft8(z);
- fft4(z+8);
- fft4(z+12);
- {
- t1 = z[8].re;
- t2 = z[8].im;
- t5 = z[12].re;
- t6 = z[12].im;
- {
- FFTSample r0=z[0].re, i0=z[0].im, r1=z[4].re, i1=z[4].im;
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[8].re = r0 - t5;
- z[0].re = r0 + t5;
- adds += 2;
- }
- ;
- {
- z[12].im = i1 - t3;
- z[4].im = i1 + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[12].re = r1 - t4;
- z[4].re = r1 + t4;
- adds += 2;
- }
- ;
- {
- z[8].im = i0 - t6;
- z[0].im = i0 + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- {
- t3 = fixmul32b(z[10].re, (0x5a82799a));
- t4 = fixmul32b(z[10].im, (0x5a82799a));
- t7 = fixmul32b(z[14].re, (0x5a82799a));
- t8 = fixmul32b(z[14].im, (0x5a82799a));
- t1 = ( t3 + t4 );
- t2 = ( t4 - t3 );
- t5 = ( t7 - t8 );
- t6 = ( t8 + t7 );
- {
- FFTSample r0=z[2].re, i0=z[2].im, r1=z[6].re, i1=z[6].im;
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[10].re = r0 - t5;
- z[2].re = r0 + t5;
- adds += 2;
- }
- ;
- {
- z[14].im = i1 - t3;
- z[6].im = i1 + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[14].re = r1 - t4;
- z[6].re = r1 + t4;
- adds += 2;
- }
- ;
- {
- z[10].im = i0 - t6;
- z[2].im = i0 + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- {
- t1 = fixmul32b(z[9].re, (0x7641af3d)) + fixmul32b(z[9].im, (0x30fbc54d));
- t2 = fixmul32b(z[9].im, (0x7641af3d)) - fixmul32b(z[9].re, (0x30fbc54d));
- t5 = fixmul32b(z[13].re, (0x7641af3d)) - fixmul32b(z[13].im, (0x30fbc54d));
- t6 = fixmul32b(z[13].im, (0x7641af3d)) + fixmul32b(z[13].re, (0x30fbc54d));
- muls += 8;
- {
- FFTSample r0=z[1].re, i0=z[1].im, r1=z[5].re, i1=z[5].im;
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[9].re = r0 - t5;
- z[1].re = r0 + t5;
- adds += 2;
- }
- ;
- {
- z[13].im = i1 - t3;
- z[5].im = i1 + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[13].re = r1 - t4;
- z[5].re = r1 + t4;
- adds += 2;
- }
- ;
- {
- z[9].im = i0 - t6;
- z[1].im = i0 + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- {
- t1 = fixmul32b(z[11].re, (0x30fbc54d)) + fixmul32b(z[11].im, (0x7641af3d));
- t2 = fixmul32b(z[11].im, (0x30fbc54d)) - fixmul32b(z[11].re, (0x7641af3d));
- t5 = fixmul32b(z[15].re, (0x30fbc54d)) - fixmul32b(z[15].im, (0x7641af3d));
- t6 = fixmul32b(z[15].im, (0x30fbc54d)) + fixmul32b(z[15].re, (0x7641af3d));
- muls += 8;
- {
- FFTSample r0=z[3].re, i0=z[3].im, r1=z[7].re, i1=z[7].im;
- {
- t3 = t5 - t1;
- t5 = t5 + t1;
- adds += 2;
- }
- ;
- {
- z[11].re = r0 - t5;
- z[3].re = r0 + t5;
- adds += 2;
- }
- ;
- {
- z[15].im = i1 - t3;
- z[7].im = i1 + t3;
- adds += 2;
- }
- ;
- {
- t4 = t2 - t6;
- t6 = t2 + t6;
- adds += 2;
- }
- ;
- {
- z[15].re = r1 - t4;
- z[7].re = r1 + t4;
- adds += 2;
- }
- ;
- {
- z[11].im = i0 - t6;
- z[3].im = i0 + t6;
- adds += 2;
- }
- ;
- }
- }
- ;
- }
- static void fft32(FFTComplex *z){
- fft16(z);
- fft8(z+8*2);
- fft8(z+8*3);
- pass(z,8192/32,8/2);
- }
- static void fft64(FFTComplex *z){
- fft32(z);
- fft16(z+16*2);
- fft16(z+16*3);
- pass(z,8192/64,16/2);
- }
- static void fft128(FFTComplex *z){
- fft64(z);
- fft32(z+32*2);
- fft32(z+32*3);
- pass(z,8192/128,32/2);
- }
- static void fft256(FFTComplex *z){
- fft128(z);
- fft64(z+64*2);
- fft64(z+64*3);
- pass(z,8192/256,64/2);
- }
- static void fft512(FFTComplex *z){
- fft256(z);
- fft128(z+128*2);
- fft128(z+128*3);
- pass(z,8192/512,128/2);
- }
- static void fft1024(FFTComplex *z){
- fft512(z);
- fft256(z+256*2);
- fft256(z+256*3);
- pass_big(z,8192/1024,256/2);
- }
- static void fft2048(FFTComplex *z){
- fft1024(z);
- fft512(z+512*2);
- fft512(z+512*3);
- pass_big(z,8192/2048,512/2);
- }
- static void fft4096(FFTComplex *z){
- fft2048(z);
- fft1024(z+1024*2);
- fft1024(z+1024*3);
- pass_big(z,8192/4096,1024/2);
- }
- static void (*fft_dispatch[])(FFTComplex*) = {
- fft4, fft8, fft16, fft32, fft64, fft128, fft256, fft512, fft1024,
- fft2048, fft4096
- }
- ;
- void ff_fft_calc_c(FFTContext *s, FFTComplex *z)
- {
- fft_dispatch[s->
- nbits-2](z);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement