Mercurial > libavcodec.hg
comparison x86/fft_3dn2.c @ 10199:38ab367d4231 libavcodec
Merge FFTContext and MDCTContext
author | mru |
---|---|
date | Sun, 20 Sep 2009 17:30:20 +0000 |
parents | 5cf49858179a |
children | 34a65026fa06 |
comparison
equal
deleted
inserted
replaced
10198:78af613fc316 | 10199:38ab367d4231 |
---|---|
51 if(n <= 8) | 51 if(n <= 8) |
52 for(i=0; i<n; i+=2) | 52 for(i=0; i<n; i+=2) |
53 FFSWAP(FFTSample, z[i].im, z[i+1].re); | 53 FFSWAP(FFTSample, z[i].im, z[i+1].re); |
54 } | 54 } |
55 | 55 |
56 void ff_imdct_half_3dn2(MDCTContext *s, FFTSample *output, const FFTSample *input) | 56 void ff_imdct_half_3dn2(FFTContext *s, FFTSample *output, const FFTSample *input) |
57 { | 57 { |
58 x86_reg j, k; | 58 x86_reg j, k; |
59 long n = 1 << s->nbits; | 59 long n = 1 << s->mdct_bits; |
60 long n2 = n >> 1; | 60 long n2 = n >> 1; |
61 long n4 = n >> 2; | 61 long n4 = n >> 2; |
62 long n8 = n >> 3; | 62 long n8 = n >> 3; |
63 const uint16_t *revtab = s->fft.revtab; | 63 const uint16_t *revtab = s->revtab; |
64 const FFTSample *tcos = s->tcos; | 64 const FFTSample *tcos = s->tcos; |
65 const FFTSample *tsin = s->tsin; | 65 const FFTSample *tsin = s->tsin; |
66 const FFTSample *in1, *in2; | 66 const FFTSample *in1, *in2; |
67 FFTComplex *z = (FFTComplex *)output; | 67 FFTComplex *z = (FFTComplex *)output; |
68 | 68 |
99 "movq %%mm0, %0 \n\t" | 99 "movq %%mm0, %0 \n\t" |
100 :"=m"(z[revtab[k]]) | 100 :"=m"(z[revtab[k]]) |
101 ); | 101 ); |
102 } | 102 } |
103 | 103 |
104 ff_fft_dispatch_3dn2(z, s->fft.nbits); | 104 ff_fft_dispatch_3dn2(z, s->nbits); |
105 | 105 |
106 #define CMUL(j,mm0,mm1)\ | 106 #define CMUL(j,mm0,mm1)\ |
107 "movq (%2,"#j",2), %%mm6 \n"\ | 107 "movq (%2,"#j",2), %%mm6 \n"\ |
108 "movq 8(%2,"#j",2), "#mm0"\n"\ | 108 "movq 8(%2,"#j",2), "#mm0"\n"\ |
109 "movq %%mm6, "#mm1"\n"\ | 109 "movq %%mm6, "#mm1"\n"\ |
142 :"memory" | 142 :"memory" |
143 ); | 143 ); |
144 __asm__ volatile("femms"); | 144 __asm__ volatile("femms"); |
145 } | 145 } |
146 | 146 |
147 void ff_imdct_calc_3dn2(MDCTContext *s, FFTSample *output, const FFTSample *input) | 147 void ff_imdct_calc_3dn2(FFTContext *s, FFTSample *output, const FFTSample *input) |
148 { | 148 { |
149 x86_reg j, k; | 149 x86_reg j, k; |
150 long n = 1 << s->nbits; | 150 long n = 1 << s->mdct_bits; |
151 long n4 = n >> 2; | 151 long n4 = n >> 2; |
152 | 152 |
153 ff_imdct_half_3dn2(s, output+n4, input); | 153 ff_imdct_half_3dn2(s, output+n4, input); |
154 | 154 |
155 j = -n; | 155 j = -n; |