diff options
Diffstat (limited to 'apps/codecs/lib/fft-ffmpeg.c')
-rw-r--r-- | apps/codecs/lib/fft-ffmpeg.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/apps/codecs/lib/fft-ffmpeg.c b/apps/codecs/lib/fft-ffmpeg.c index a5ffab9086..c00abde694 100644 --- a/apps/codecs/lib/fft-ffmpeg.c +++ b/apps/codecs/lib/fft-ffmpeg.c | |||
@@ -202,7 +202,7 @@ static void ff_fft_permute_c(FFTContext *s, FFTComplex *z) | |||
202 | */ | 202 | */ |
203 | 203 | ||
204 | #ifndef FFT_FFMPEG_INCL_OPTIMISED_TRANSFORM | 204 | #ifndef FFT_FFMPEG_INCL_OPTIMISED_TRANSFORM |
205 | static inline void TRANSFORM(FFTComplex * z, unsigned int n, FFTSample wre, FFTSample wim) | 205 | static inline FFTComplex* TRANSFORM(FFTComplex * z, unsigned int n, FFTSample wre, FFTSample wim) |
206 | { | 206 | { |
207 | register FFTSample t1,t2,t5,t6,r_re,r_im; | 207 | register FFTSample t1,t2,t5,t6,r_re,r_im; |
208 | r_re = z[n*2].re; | 208 | r_re = z[n*2].re; |
@@ -212,9 +212,10 @@ static inline void TRANSFORM(FFTComplex * z, unsigned int n, FFTSample wre, FFTS | |||
212 | r_im = z[n*3].im; | 212 | r_im = z[n*3].im; |
213 | XNPROD31_R(r_re, r_im, wre, wim, t5,t6); | 213 | XNPROD31_R(r_re, r_im, wre, wim, t5,t6); |
214 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); | 214 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); |
215 | return z+1; | ||
215 | } | 216 | } |
216 | 217 | ||
217 | static inline void TRANSFORM_W01(FFTComplex * z, unsigned int n, const FFTSample * w) | 218 | static inline FFTComplex* TRANSFORM_W01(FFTComplex * z, unsigned int n, const FFTSample * w) |
218 | { | 219 | { |
219 | register const FFTSample wre=w[0],wim=w[1]; | 220 | register const FFTSample wre=w[0],wim=w[1]; |
220 | register FFTSample t1,t2,t5,t6,r_re,r_im; | 221 | register FFTSample t1,t2,t5,t6,r_re,r_im; |
@@ -225,9 +226,10 @@ static inline void TRANSFORM_W01(FFTComplex * z, unsigned int n, const FFTSample | |||
225 | r_im = z[n*3].im; | 226 | r_im = z[n*3].im; |
226 | XNPROD31_R(r_re, r_im, wre, wim, t5,t6); | 227 | XNPROD31_R(r_re, r_im, wre, wim, t5,t6); |
227 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); | 228 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); |
229 | return z+1; | ||
228 | } | 230 | } |
229 | 231 | ||
230 | static inline void TRANSFORM_W10(FFTComplex * z, unsigned int n, const FFTSample * w) | 232 | static inline FFTComplex* TRANSFORM_W10(FFTComplex * z, unsigned int n, const FFTSample * w) |
231 | { | 233 | { |
232 | register const FFTSample wim=w[0],wre=w[1]; | 234 | register const FFTSample wim=w[0],wre=w[1]; |
233 | register FFTSample t1,t2,t5,t6,r_re,r_im; | 235 | register FFTSample t1,t2,t5,t6,r_re,r_im; |
@@ -238,9 +240,10 @@ static inline void TRANSFORM_W10(FFTComplex * z, unsigned int n, const FFTSample | |||
238 | r_im = z[n*3].im; | 240 | r_im = z[n*3].im; |
239 | XNPROD31_R(r_re, r_im, wre, wim, t5,t6); | 241 | XNPROD31_R(r_re, r_im, wre, wim, t5,t6); |
240 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); | 242 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); |
243 | return z+1; | ||
241 | } | 244 | } |
242 | 245 | ||
243 | static inline void TRANSFORM_EQUAL(FFTComplex * z, unsigned int n) | 246 | static inline FFTComplex* TRANSFORM_EQUAL(FFTComplex * z, unsigned int n) |
244 | { | 247 | { |
245 | register FFTSample t1,t2,t5,t6,temp1,temp2; | 248 | register FFTSample t1,t2,t5,t6,temp1,temp2; |
246 | register FFTSample * my_z = (FFTSample *)(z); | 249 | register FFTSample * my_z = (FFTSample *)(z); |
@@ -256,9 +259,10 @@ static inline void TRANSFORM_EQUAL(FFTComplex * z, unsigned int n) | |||
256 | t5 = ( temp2 - t5 ); | 259 | t5 = ( temp2 - t5 ); |
257 | my_z -= n*6; | 260 | my_z -= n*6; |
258 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); | 261 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); |
262 | return z+1; | ||
259 | } | 263 | } |
260 | 264 | ||
261 | static inline void TRANSFORM_ZERO(FFTComplex * z, unsigned int n) | 265 | static inline FFTComplex* TRANSFORM_ZERO(FFTComplex * z, unsigned int n) |
262 | { | 266 | { |
263 | FFTSample t1,t2,t5,t6; | 267 | FFTSample t1,t2,t5,t6; |
264 | t1 = z[n*2].re; | 268 | t1 = z[n*2].re; |
@@ -266,6 +270,7 @@ static inline void TRANSFORM_ZERO(FFTComplex * z, unsigned int n) | |||
266 | t5 = z[n*3].re; | 270 | t5 = z[n*3].re; |
267 | t6 = z[n*3].im; | 271 | t6 = z[n*3].im; |
268 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); | 272 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); |
273 | return z+1; | ||
269 | } | 274 | } |
270 | #endif | 275 | #endif |
271 | 276 | ||
@@ -282,17 +287,14 @@ void pass(FFTComplex *z_arg, unsigned int STEP_arg, unsigned int n_arg) | |||
282 | register const FFTSample *w_end = sincos_lookup0+1024; | 287 | register const FFTSample *w_end = sincos_lookup0+1024; |
283 | 288 | ||
284 | /* first two are special (well, first one is special, but we need to do pairs) */ | 289 | /* first two are special (well, first one is special, but we need to do pairs) */ |
285 | TRANSFORM_ZERO(z,n); | 290 | z = TRANSFORM_ZERO(z,n); |
286 | z++; | 291 | z = TRANSFORM_W10(z,n,w); |
287 | TRANSFORM_W10(z,n,w); | ||
288 | w += STEP; | 292 | w += STEP; |
289 | /* first pass forwards through sincos_lookup0*/ | 293 | /* first pass forwards through sincos_lookup0*/ |
290 | do { | 294 | do { |
291 | z++; | 295 | z = TRANSFORM_W10(z,n,w); |
292 | TRANSFORM_W10(z,n,w); | ||
293 | w += STEP; | 296 | w += STEP; |
294 | z++; | 297 | z = TRANSFORM_W10(z,n,w); |
295 | TRANSFORM_W10(z,n,w); | ||
296 | w += STEP; | 298 | w += STEP; |
297 | } while(LIKELY(w < w_end)); | 299 | } while(LIKELY(w < w_end)); |
298 | /* second half: pass backwards through sincos_lookup0*/ | 300 | /* second half: pass backwards through sincos_lookup0*/ |
@@ -300,11 +302,9 @@ void pass(FFTComplex *z_arg, unsigned int STEP_arg, unsigned int n_arg) | |||
300 | w_end=sincos_lookup0; | 302 | w_end=sincos_lookup0; |
301 | while(LIKELY(w>w_end)) | 303 | while(LIKELY(w>w_end)) |
302 | { | 304 | { |
303 | z++; | 305 | z = TRANSFORM_W01(z,n,w); |
304 | TRANSFORM_W01(z,n,w); | ||
305 | w -= STEP; | 306 | w -= STEP; |
306 | z++; | 307 | z = TRANSFORM_W01(z,n,w); |
307 | TRANSFORM_W01(z,n,w); | ||
308 | w -= STEP; | 308 | w -= STEP; |
309 | } | 309 | } |
310 | } | 310 | } |