Browse code

Merge FFTContext and MDCTContext

Originally committed as revision 19931 to svn://svn.ffmpeg.org/ffmpeg/trunk

Måns Rullgård authored on 2009/09/21 02:30:20
Showing 22 changed files
... ...
@@ -257,8 +257,8 @@ typedef struct {
257 257
      * @defgroup tables   Computed / set up during initialization.
258 258
      * @{
259 259
      */
260
-    MDCTContext mdct;
261
-    MDCTContext mdct_small;
260
+    FFTContext mdct;
261
+    FFTContext mdct_small;
262 262
     DSPContext dsp;
263 263
     int random_state;
264 264
     /** @} */
... ...
@@ -49,8 +49,8 @@ extern AACCoefficientsEncoder ff_aac_coders[];
49 49
  */
50 50
 typedef struct AACEncContext {
51 51
     PutBitContext pb;
52
-    MDCTContext mdct1024;                        ///< long (1024 samples) frame transform context
53
-    MDCTContext mdct128;                         ///< short (128 samples) frame transform context
52
+    FFTContext mdct1024;                         ///< long (1024 samples) frame transform context
53
+    FFTContext mdct128;                          ///< short (128 samples) frame transform context
54 54
     DSPContext  dsp;
55 55
     DECLARE_ALIGNED_16(FFTSample, output[2048]); ///< temporary buffer for MDCT input coefficients
56 56
     int16_t* samples;                            ///< saved preprocessed input
... ...
@@ -146,8 +146,8 @@ typedef struct {
146 146
 
147 147
 ///@defgroup imdct IMDCT
148 148
     int block_switch[AC3_MAX_CHANNELS];     ///< block switch flags                     (blksw)
149
-    MDCTContext imdct_512;                  ///< for 512 sample IMDCT
150
-    MDCTContext imdct_256;                  ///< for 256 sample IMDCT
149
+    FFTContext imdct_512;                   ///< for 512 sample IMDCT
150
+    FFTContext imdct_256;                   ///< for 256 sample IMDCT
151 151
 ///@}
152 152
 
153 153
 ///@defgroup opt optimization
... ...
@@ -23,9 +23,9 @@
23 23
 void ff_fft_permute_neon(FFTContext *s, FFTComplex *z);
24 24
 void ff_fft_calc_neon(FFTContext *s, FFTComplex *z);
25 25
 
26
-void ff_imdct_calc_neon(MDCTContext *s, FFTSample *output, const FFTSample *input);
27
-void ff_imdct_half_neon(MDCTContext *s, FFTSample *output, const FFTSample *input);
28
-void ff_mdct_calc_neon(MDCTContext *s, FFTSample *output, const FFTSample *input);
26
+void ff_imdct_calc_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
27
+void ff_imdct_half_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
28
+void ff_mdct_calc_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
29 29
 
30 30
 av_cold void ff_fft_init_arm(FFTContext *s)
31 31
 {
... ...
@@ -28,10 +28,10 @@ function ff_imdct_half_neon, export=1
28 28
         push            {r4-r8,lr}
29 29
 
30 30
         mov             r12, #1
31
-        ldr             lr,  [r0, #4]           @ nbits
32
-        ldr             r4,  [r0, #8]           @ tcos
33
-        ldr             r5,  [r0, #12]          @ tsin
34
-        ldr             r3,  [r0, #24]          @ revtab
31
+        ldr             lr,  [r0, #28]          @ mdct_bits
32
+        ldr             r4,  [r0, #32]          @ tcos
33
+        ldr             r5,  [r0, #36]          @ tsin
34
+        ldr             r3,  [r0, #8]           @ revtab
35 35
         lsl             r12, r12, lr            @ n  = 1 << nbits
36 36
         lsr             lr,  r12, #2            @ n4 = n >> 2
37 37
         add             r7,  r2,  r12,  lsl #1
... ...
@@ -73,13 +73,12 @@ function ff_imdct_half_neon, export=1
73 73
 
74 74
         mov             r4,  r0
75 75
         mov             r6,  r1
76
-        add             r0,  r0,  #16
77 76
         bl              ff_fft_calc_neon
78 77
 
79 78
         mov             r12, #1
80
-        ldr             lr,  [r4, #4]           @ nbits
81
-        ldr             r5,  [r4, #12]          @ tsin
82
-        ldr             r4,  [r4, #8]           @ tcos
79
+        ldr             lr,  [r4, #28]          @ mdct_bits
80
+        ldr             r5,  [r4, #36]          @ tsin
81
+        ldr             r4,  [r4, #32]          @ tcos
83 82
         lsl             r12, r12, lr            @ n  = 1 << nbits
84 83
         lsr             lr,  r12, #3            @ n8 = n >> 3
85 84
 
... ...
@@ -134,7 +133,7 @@ function ff_imdct_half_neon, export=1
134 134
 function ff_imdct_calc_neon, export=1
135 135
         push            {r4-r6,lr}
136 136
 
137
-        ldr             r3,  [r0, #4]
137
+        ldr             r3,  [r0, #28]
138 138
         mov             r4,  #1
139 139
         mov             r5,  r1
140 140
         lsl             r4,  r4,  r3
... ...
@@ -171,10 +170,10 @@ function ff_mdct_calc_neon, export=1
171 171
         push            {r4-r10,lr}
172 172
 
173 173
         mov             r12, #1
174
-        ldr             lr,  [r0, #4]           @ nbits
175
-        ldr             r4,  [r0, #8]           @ tcos
176
-        ldr             r5,  [r0, #12]          @ tsin
177
-        ldr             r3,  [r0, #24]          @ revtab
174
+        ldr             lr,  [r0, #28]          @ mdct_bits
175
+        ldr             r4,  [r0, #32]          @ tcos
176
+        ldr             r5,  [r0, #36]          @ tsin
177
+        ldr             r3,  [r0, #8]           @ revtab
178 178
         lsl             lr,  r12, lr            @ n  = 1 << nbits
179 179
         add             r7,  r2,  lr            @ in4u
180 180
         sub             r9,  r7,  #16           @ in4d
... ...
@@ -224,7 +223,7 @@ function ff_mdct_calc_neon, export=1
224 224
         vst2.32         {d6[1],d7[1]}, [r10,:64]
225 225
 
226 226
         mov             r12, #1
227
-        ldr             lr,  [r0, #4]           @ nbits
227
+        ldr             lr,  [r0, #28]          @ mdct_bits
228 228
         lsl             lr,  r12, lr            @ n  = 1 << nbits
229 229
         sub             r8,  r2,  #16           @ in1d
230 230
         add             r2,  r9,  #16           @ in0u
... ...
@@ -272,13 +271,12 @@ function ff_mdct_calc_neon, export=1
272 272
 
273 273
         mov             r4,  r0
274 274
         mov             r6,  r1
275
-        add             r0,  r0,  #16
276 275
         bl              ff_fft_calc_neon
277 276
 
278 277
         mov             r12, #1
279
-        ldr             lr,  [r4, #4]           @ nbits
280
-        ldr             r5,  [r4, #12]          @ tsin
281
-        ldr             r4,  [r4, #8]           @ tcos
278
+        ldr             lr,  [r4, #28]          @ mdct_bits
279
+        ldr             r5,  [r4, #36]          @ tsin
280
+        ldr             r4,  [r4, #32]          @ tcos
282 281
         lsl             r12, r12, lr            @ n  = 1 << nbits
283 282
         lsr             lr,  r12, #3            @ n8 = n >> 3
284 283
 
... ...
@@ -79,7 +79,7 @@ typedef struct {
79 79
     DECLARE_ALIGNED_16(float, high[512]);
80 80
     float*              bands[3];
81 81
     DECLARE_ALIGNED_16(float, out_samples[AT1_MAX_CHANNELS][AT1_SU_SAMPLES]);
82
-    MDCTContext         mdct_ctx[3];
82
+    FFTContext          mdct_ctx[3];
83 83
     int                 channels;
84 84
     DSPContext          dsp;
85 85
 } AT1Ctx;
... ...
@@ -94,7 +94,7 @@ static const uint8_t   mdct_long_nbits[3] = {7, 7, 8};
94 94
 static void at1_imdct(AT1Ctx *q, float *spec, float *out, int nbits,
95 95
                       int rev_spec)
96 96
 {
97
-    MDCTContext* mdct_context;
97
+    FFTContext* mdct_context;
98 98
     int transf_size = 1 << nbits;
99 99
 
100 100
     mdct_context = &q->mdct_ctx[nbits - 5 - (nbits > 6)];
... ...
@@ -123,7 +123,7 @@ static DECLARE_ALIGNED_16(float,mdct_window[512]);
123 123
 static VLC              spectral_coeff_tab[7];
124 124
 static float            gain_tab1[16];
125 125
 static float            gain_tab2[31];
126
-static MDCTContext      mdct_ctx;
126
+static FFTContext       mdct_ctx;
127 127
 static DSPContext       dsp;
128 128
 
129 129
 
... ...
@@ -136,7 +136,7 @@ typedef struct cook {
136 136
     AVLFG               random_state;
137 137
 
138 138
     /* transform data */
139
-    MDCTContext         mdct_ctx;
139
+    FFTContext          mdct_ctx;
140 140
     float*              mlt_window;
141 141
 
142 142
     /* VLC data */
... ...
@@ -250,7 +250,7 @@ typedef struct {
250 250
 
251 251
     int debug_flag;             ///< used for suppressing repeated error messages output
252 252
     DSPContext dsp;
253
-    MDCTContext imdct;
253
+    FFTContext imdct;
254 254
 } DCAContext;
255 255
 
256 256
 static const uint16_t dca_vlc_offs[] = {
... ...
@@ -665,8 +665,6 @@ void get_psnr(uint8_t *orig_image[3], uint8_t *coded_image[3],
665 665
    FFTSample type */
666 666
 typedef float FFTSample;
667 667
 
668
-struct MDCTContext;
669
-
670 668
 typedef struct FFTComplex {
671 669
     FFTSample re, im;
672 670
 } FFTComplex;
... ...
@@ -678,11 +676,16 @@ typedef struct FFTContext {
678 678
     FFTComplex *exptab;
679 679
     FFTComplex *exptab1; /* only used by SSE code */
680 680
     FFTComplex *tmp_buf;
681
+    int mdct_size; /* size of MDCT (i.e. number of input data * 2) */
682
+    int mdct_bits; /* n = 2^nbits */
683
+    /* pre/post rotation tables */
684
+    FFTSample *tcos;
685
+    FFTSample *tsin;
681 686
     void (*fft_permute)(struct FFTContext *s, FFTComplex *z);
682 687
     void (*fft_calc)(struct FFTContext *s, FFTComplex *z);
683
-    void (*imdct_calc)(struct MDCTContext *s, FFTSample *output, const FFTSample *input);
684
-    void (*imdct_half)(struct MDCTContext *s, FFTSample *output, const FFTSample *input);
685
-    void (*mdct_calc)(struct MDCTContext *s, FFTSample *output, const FFTSample *input);
688
+    void (*imdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
689
+    void (*imdct_half)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
690
+    void (*mdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
686 691
     int split_radix;
687 692
 } FFTContext;
688 693
 
... ...
@@ -720,28 +723,19 @@ void ff_fft_end(FFTContext *s);
720 720
 
721 721
 /* MDCT computation */
722 722
 
723
-typedef struct MDCTContext {
724
-    int n;  /* size of MDCT (i.e. number of input data * 2) */
725
-    int nbits; /* n = 2^nbits */
726
-    /* pre/post rotation tables */
727
-    FFTSample *tcos;
728
-    FFTSample *tsin;
729
-    FFTContext fft;
730
-} MDCTContext;
731
-
732
-static inline void ff_imdct_calc(MDCTContext *s, FFTSample *output, const FFTSample *input)
723
+static inline void ff_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
733 724
 {
734
-    s->fft.imdct_calc(s, output, input);
725
+    s->imdct_calc(s, output, input);
735 726
 }
736
-static inline void ff_imdct_half(MDCTContext *s, FFTSample *output, const FFTSample *input)
727
+static inline void ff_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input)
737 728
 {
738
-    s->fft.imdct_half(s, output, input);
729
+    s->imdct_half(s, output, input);
739 730
 }
740 731
 
741
-static inline void ff_mdct_calc(MDCTContext *s, FFTSample *output,
732
+static inline void ff_mdct_calc(FFTContext *s, FFTSample *output,
742 733
                                 const FFTSample *input)
743 734
 {
744
-    s->fft.mdct_calc(s, output, input);
735
+    s->mdct_calc(s, output, input);
745 736
 }
746 737
 
747 738
 /**
... ...
@@ -768,11 +762,11 @@ extern float ff_sine_2048[2048];
768 768
 extern float ff_sine_4096[4096];
769 769
 extern float * const ff_sine_windows[13];
770 770
 
771
-int ff_mdct_init(MDCTContext *s, int nbits, int inverse, double scale);
772
-void ff_imdct_calc_c(MDCTContext *s, FFTSample *output, const FFTSample *input);
773
-void ff_imdct_half_c(MDCTContext *s, FFTSample *output, const FFTSample *input);
774
-void ff_mdct_calc_c(MDCTContext *s, FFTSample *output, const FFTSample *input);
775
-void ff_mdct_end(MDCTContext *s);
771
+int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale);
772
+void ff_imdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input);
773
+void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input);
774
+void ff_mdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input);
775
+void ff_mdct_end(FFTContext *s);
776 776
 
777 777
 /* Real Discrete Fourier Transform */
778 778
 
... ...
@@ -184,7 +184,7 @@ int main(int argc, char **argv)
184 184
     int do_mdct = 0;
185 185
     int do_inverse = 0;
186 186
     FFTContext s1, *s = &s1;
187
-    MDCTContext m1, *m = &m1;
187
+    FFTContext m1, *m = &m1;
188 188
     int fft_nbits, fft_size;
189 189
     double scale = 1.0;
190 190
     AVLFG prng;
... ...
@@ -72,15 +72,15 @@ av_cold void ff_sine_window_init(float *window, int n) {
72 72
 /**
73 73
  * init MDCT or IMDCT computation.
74 74
  */
75
-av_cold int ff_mdct_init(MDCTContext *s, int nbits, int inverse, double scale)
75
+av_cold int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale)
76 76
 {
77 77
     int n, n4, i;
78 78
     double alpha, theta;
79 79
 
80 80
     memset(s, 0, sizeof(*s));
81 81
     n = 1 << nbits;
82
-    s->nbits = nbits;
83
-    s->n = n;
82
+    s->mdct_bits = nbits;
83
+    s->mdct_size = n;
84 84
     n4 = n >> 2;
85 85
     s->tcos = av_malloc(n4 * sizeof(FFTSample));
86 86
     if (!s->tcos)
... ...
@@ -96,7 +96,7 @@ av_cold int ff_mdct_init(MDCTContext *s, int nbits, int inverse, double scale)
96 96
         s->tcos[i] = -cos(alpha) * scale;
97 97
         s->tsin[i] = -sin(alpha) * scale;
98 98
     }
99
-    if (ff_fft_init(&s->fft, s->nbits - 2, inverse) < 0)
99
+    if (ff_fft_init(s, s->mdct_bits - 2, inverse) < 0)
100 100
         goto fail;
101 101
     return 0;
102 102
  fail:
... ...
@@ -122,16 +122,16 @@ av_cold int ff_mdct_init(MDCTContext *s, int nbits, int inverse, double scale)
122 122
  * @param output N/2 samples
123 123
  * @param input N/2 samples
124 124
  */
125
-void ff_imdct_half_c(MDCTContext *s, FFTSample *output, const FFTSample *input)
125
+void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input)
126 126
 {
127 127
     int k, n8, n4, n2, n, j;
128
-    const uint16_t *revtab = s->fft.revtab;
128
+    const uint16_t *revtab = s->revtab;
129 129
     const FFTSample *tcos = s->tcos;
130 130
     const FFTSample *tsin = s->tsin;
131 131
     const FFTSample *in1, *in2;
132 132
     FFTComplex *z = (FFTComplex *)output;
133 133
 
134
-    n = 1 << s->nbits;
134
+    n = 1 << s->mdct_bits;
135 135
     n2 = n >> 1;
136 136
     n4 = n >> 2;
137 137
     n8 = n >> 3;
... ...
@@ -145,7 +145,7 @@ void ff_imdct_half_c(MDCTContext *s, FFTSample *output, const FFTSample *input)
145 145
         in1 += 2;
146 146
         in2 -= 2;
147 147
     }
148
-    ff_fft_calc(&s->fft, z);
148
+    ff_fft_calc(s, z);
149 149
 
150 150
     /* post rotation + reordering */
151 151
     for(k = 0; k < n8; k++) {
... ...
@@ -164,10 +164,10 @@ void ff_imdct_half_c(MDCTContext *s, FFTSample *output, const FFTSample *input)
164 164
  * @param output N samples
165 165
  * @param input N/2 samples
166 166
  */
167
-void ff_imdct_calc_c(MDCTContext *s, FFTSample *output, const FFTSample *input)
167
+void ff_imdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input)
168 168
 {
169 169
     int k;
170
-    int n = 1 << s->nbits;
170
+    int n = 1 << s->mdct_bits;
171 171
     int n2 = n >> 1;
172 172
     int n4 = n >> 2;
173 173
 
... ...
@@ -184,16 +184,16 @@ void ff_imdct_calc_c(MDCTContext *s, FFTSample *output, const FFTSample *input)
184 184
  * @param input N samples
185 185
  * @param out N/2 samples
186 186
  */
187
-void ff_mdct_calc_c(MDCTContext *s, FFTSample *out, const FFTSample *input)
187
+void ff_mdct_calc_c(FFTContext *s, FFTSample *out, const FFTSample *input)
188 188
 {
189 189
     int i, j, n, n8, n4, n2, n3;
190 190
     FFTSample re, im;
191
-    const uint16_t *revtab = s->fft.revtab;
191
+    const uint16_t *revtab = s->revtab;
192 192
     const FFTSample *tcos = s->tcos;
193 193
     const FFTSample *tsin = s->tsin;
194 194
     FFTComplex *x = (FFTComplex *)out;
195 195
 
196
-    n = 1 << s->nbits;
196
+    n = 1 << s->mdct_bits;
197 197
     n2 = n >> 1;
198 198
     n4 = n >> 2;
199 199
     n8 = n >> 3;
... ...
@@ -212,7 +212,7 @@ void ff_mdct_calc_c(MDCTContext *s, FFTSample *out, const FFTSample *input)
212 212
         CMUL(x[j].re, x[j].im, re, im, -tcos[n8 + i], tsin[n8 + i]);
213 213
     }
214 214
 
215
-    ff_fft_calc(&s->fft, x);
215
+    ff_fft_calc(s, x);
216 216
 
217 217
     /* post rotation */
218 218
     for(i=0;i<n8;i++) {
... ...
@@ -226,9 +226,9 @@ void ff_mdct_calc_c(MDCTContext *s, FFTSample *out, const FFTSample *input)
226 226
     }
227 227
 }
228 228
 
229
-av_cold void ff_mdct_end(MDCTContext *s)
229
+av_cold void ff_mdct_end(FFTContext *s)
230 230
 {
231 231
     av_freep(&s->tcos);
232 232
     av_freep(&s->tsin);
233
-    ff_fft_end(&s->fft);
233
+    ff_fft_end(s);
234 234
 }
... ...
@@ -50,7 +50,7 @@ typedef struct NellyMoserDecodeContext {
50 50
     int             add_bias;
51 51
     float           scale_bias;
52 52
     DSPContext      dsp;
53
-    MDCTContext     imdct_ctx;
53
+    FFTContext      imdct_ctx;
54 54
     DECLARE_ALIGNED_16(float,imdct_out[NELLY_BUF_LEN * 2]);
55 55
 } NellyMoserDecodeContext;
56 56
 
... ...
@@ -52,7 +52,7 @@ typedef struct NellyMoserEncodeContext {
52 52
     int             bufsel;
53 53
     int             have_saved;
54 54
     DSPContext      dsp;
55
-    MDCTContext     mdct_ctx;
55
+    FFTContext      mdct_ctx;
56 56
     DECLARE_ALIGNED_16(float, mdct_out[NELLY_SAMPLES]);
57 57
     DECLARE_ALIGNED_16(float, in_buff[NELLY_SAMPLES]);
58 58
     DECLARE_ALIGNED_16(float, buf[2][3 * NELLY_BUF_LEN]);     ///< sample buffer
... ...
@@ -172,7 +172,7 @@ static const ModeTab mode_44_48 = {
172 172
 typedef struct TwinContext {
173 173
     AVCodecContext *avctx;
174 174
     DSPContext      dsp;
175
-    MDCTContext mdct_ctx[3];
175
+    FFTContext mdct_ctx[3];
176 176
 
177 177
     const ModeTab *mtab;
178 178
 
... ...
@@ -128,7 +128,7 @@ typedef struct vorbis_context_s {
128 128
     GetBitContext gb;
129 129
     DSPContext dsp;
130 130
 
131
-    MDCTContext mdct[2];
131
+    FFTContext mdct[2];
132 132
     uint_fast8_t first_frame;
133 133
     uint_fast32_t version;
134 134
     uint_fast8_t audio_channels;
... ...
@@ -98,7 +98,7 @@ typedef struct {
98 98
     int channels;
99 99
     int sample_rate;
100 100
     int log2_blocksize[2];
101
-    MDCTContext mdct[2];
101
+    FFTContext mdct[2];
102 102
     const float * win[2];
103 103
     int have_saved;
104 104
     float * saved;
... ...
@@ -116,7 +116,7 @@ typedef struct WMACodecContext {
116 116
     WMACoef coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE];
117 117
     DECLARE_ALIGNED_16(float, coefs[MAX_CHANNELS][BLOCK_MAX_SIZE]);
118 118
     DECLARE_ALIGNED_16(FFTSample, output[BLOCK_MAX_SIZE * 2]);
119
-    MDCTContext mdct_ctx[BLOCK_NB_SIZES];
119
+    FFTContext mdct_ctx[BLOCK_NB_SIZES];
120 120
     float *windows[BLOCK_NB_SIZES];
121 121
     /* output buffer for one frame and the last for IMDCT windowing */
122 122
     DECLARE_ALIGNED_16(float, frame_out[MAX_CHANNELS][BLOCK_MAX_SIZE * 2]);
... ...
@@ -166,7 +166,7 @@ typedef struct WMAProDecodeCtx {
166 166
     uint8_t          frame_data[MAX_FRAMESIZE +
167 167
                       FF_INPUT_BUFFER_PADDING_SIZE];///< compressed frame data
168 168
     PutBitContext    pb;                            ///< context for filling the frame_data buffer
169
-    MDCTContext      mdct_ctx[WMAPRO_BLOCK_SIZES];  ///< MDCT context per block size
169
+    FFTContext       mdct_ctx[WMAPRO_BLOCK_SIZES];  ///< MDCT context per block size
170 170
     DECLARE_ALIGNED_16(float, tmp[WMAPRO_BLOCK_MAX_SIZE]); ///< IMDCT output buffer
171 171
     float*           windows[WMAPRO_BLOCK_SIZES];   ///< windows for the different block sizes
172 172
 
... ...
@@ -26,11 +26,11 @@ void ff_fft_calc_sse(FFTContext *s, FFTComplex *z);
26 26
 void ff_fft_calc_3dn(FFTContext *s, FFTComplex *z);
27 27
 void ff_fft_calc_3dn2(FFTContext *s, FFTComplex *z);
28 28
 
29
-void ff_imdct_calc_3dn(MDCTContext *s, FFTSample *output, const FFTSample *input);
30
-void ff_imdct_half_3dn(MDCTContext *s, FFTSample *output, const FFTSample *input);
31
-void ff_imdct_calc_3dn2(MDCTContext *s, FFTSample *output, const FFTSample *input);
32
-void ff_imdct_half_3dn2(MDCTContext *s, FFTSample *output, const FFTSample *input);
33
-void ff_imdct_calc_sse(MDCTContext *s, FFTSample *output, const FFTSample *input);
34
-void ff_imdct_half_sse(MDCTContext *s, FFTSample *output, const FFTSample *input);
29
+void ff_imdct_calc_3dn(FFTContext *s, FFTSample *output, const FFTSample *input);
30
+void ff_imdct_half_3dn(FFTContext *s, FFTSample *output, const FFTSample *input);
31
+void ff_imdct_calc_3dn2(FFTContext *s, FFTSample *output, const FFTSample *input);
32
+void ff_imdct_half_3dn2(FFTContext *s, FFTSample *output, const FFTSample *input);
33
+void ff_imdct_calc_sse(FFTContext *s, FFTSample *output, const FFTSample *input);
34
+void ff_imdct_half_sse(FFTContext *s, FFTSample *output, const FFTSample *input);
35 35
 
36 36
 #endif
... ...
@@ -53,14 +53,14 @@ void ff_fft_calc_3dn2(FFTContext *s, FFTComplex *z)
53 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 58
     x86_reg j, k;
59
-    long n = 1 << s->nbits;
59
+    long n = 1 << s->mdct_bits;
60 60
     long n2 = n >> 1;
61 61
     long n4 = n >> 2;
62 62
     long n8 = n >> 3;
63
-    const uint16_t *revtab = s->fft.revtab;
63
+    const uint16_t *revtab = s->revtab;
64 64
     const FFTSample *tcos = s->tcos;
65 65
     const FFTSample *tsin = s->tsin;
66 66
     const FFTSample *in1, *in2;
... ...
@@ -101,7 +101,7 @@ void ff_imdct_half_3dn2(MDCTContext *s, FFTSample *output, const FFTSample *inpu
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 106
 #define CMUL(j,mm0,mm1)\
107 107
         "movq  (%2,"#j",2), %%mm6 \n"\
... ...
@@ -144,10 +144,10 @@ void ff_imdct_half_3dn2(MDCTContext *s, FFTSample *output, const FFTSample *inpu
144 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 149
     x86_reg j, k;
150
-    long n = 1 << s->nbits;
150
+    long n = 1 << s->mdct_bits;
151 151
     long n4 = n >> 2;
152 152
 
153 153
     ff_imdct_half_3dn2(s, output+n4, input);
... ...
@@ -71,14 +71,14 @@ void ff_fft_permute_sse(FFTContext *s, FFTComplex *z)
71 71
     memcpy(z, s->tmp_buf, n*sizeof(FFTComplex));
72 72
 }
73 73
 
74
-void ff_imdct_half_sse(MDCTContext *s, FFTSample *output, const FFTSample *input)
74
+void ff_imdct_half_sse(FFTContext *s, FFTSample *output, const FFTSample *input)
75 75
 {
76 76
     av_unused x86_reg i, j, k, l;
77
-    long n = 1 << s->nbits;
77
+    long n = 1 << s->mdct_bits;
78 78
     long n2 = n >> 1;
79 79
     long n4 = n >> 2;
80 80
     long n8 = n >> 3;
81
-    const uint16_t *revtab = s->fft.revtab + n8;
81
+    const uint16_t *revtab = s->revtab + n8;
82 82
     const FFTSample *tcos = s->tcos;
83 83
     const FFTSample *tsin = s->tsin;
84 84
     FFTComplex *z = (FFTComplex *)output;
... ...
@@ -129,7 +129,7 @@ void ff_imdct_half_sse(MDCTContext *s, FFTSample *output, const FFTSample *input
129 129
 #endif
130 130
     }
131 131
 
132
-    ff_fft_dispatch_sse(z, s->fft.nbits);
132
+    ff_fft_dispatch_sse(z, s->nbits);
133 133
 
134 134
     /* post rotation + reinterleave + reorder */
135 135
 
... ...
@@ -172,10 +172,10 @@ void ff_imdct_half_sse(MDCTContext *s, FFTSample *output, const FFTSample *input
172 172
     );
173 173
 }
174 174
 
175
-void ff_imdct_calc_sse(MDCTContext *s, FFTSample *output, const FFTSample *input)
175
+void ff_imdct_calc_sse(FFTContext *s, FFTSample *output, const FFTSample *input)
176 176
 {
177 177
     x86_reg j, k;
178
-    long n = 1 << s->nbits;
178
+    long n = 1 << s->mdct_bits;
179 179
     long n4 = n >> 2;
180 180
 
181 181
     ff_imdct_half_sse(s, output+n4, input);