]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
trivial mdct cleanups
authorAndre Noll <maan@systemlinux.org>
Wed, 14 Oct 2009 19:10:27 +0000 (21:10 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 18 Nov 2009 18:34:13 +0000 (19:34 +0100)
imdct.c

diff --git a/imdct.c b/imdct.c
index e3021b45cd0c3522a06b3043bf8a5a1e93056e6a..e2cfe03426eee48092b6973924e7e458a7a4fab3 100644 (file)
--- a/imdct.c
+++ b/imdct.c
@@ -219,6 +219,7 @@ static void fft16(struct fft_complex *z)
        TRANSFORM(z[1], z[5], z[9], z[13], ff_cos_16[1], ff_cos_16[3]);
        TRANSFORM(z[3], z[7], z[11], z[15], ff_cos_16[3], ff_cos_16[1]);
 }
+
 DECL_FFT(32, 16, 8)
 DECL_FFT(64, 32, 16)
 DECL_FFT(128, 64, 32)
@@ -233,8 +234,7 @@ DECL_FFT(16384, 8192, 4096)
 DECL_FFT(32768, 16384, 8192)
 DECL_FFT(65536, 32768, 16384)
 
-static void (*fft_dispatch[]) (struct fft_complex *) =
-{
+static void (*fft_dispatch[]) (struct fft_complex *) = {
        fft4, fft8, fft16, fft32, fft64, fft128, fft256, fft512, fft1024,
        fft2048, fft4096, fft8192, fft16384, fft32768, fft65536,
 };
@@ -247,12 +247,12 @@ static void fft(struct fft_context *s, struct fft_complex *z)
 /* complex multiplication: p = a * b */
 #define CMUL(pre, pim, are, aim, bre, bim) \
 {\
-    fftsample_t _are = (are);\
-    fftsample_t _aim = (aim);\
-    fftsample_t _bre = (bre);\
-    fftsample_t _bim = (bim);\
-    (pre) = _are * _bre - _aim * _bim;\
-    (pim) = _are * _bim + _aim * _bre;\
+       fftsample_t _are = (are);\
+       fftsample_t _aim = (aim);\
+       fftsample_t _bre = (bre);\
+       fftsample_t _bim = (bim);\
+       (pre) = _are * _bre - _aim * _bim;\
+       (pim) = _are * _bim + _aim * _bre;\
 }
 
 /**
@@ -391,13 +391,11 @@ static int fft_init(struct fft_context *s, int nbits, int inverse)
                        nblocks = nblocks >> 1;
                } while (nblocks != 0);
                freep(&s->exptab);
-
                /* compute bit reverse table */
                for (i = 0; i < n; i++) {
                        m = 0;
-                       for (j = 0; j < nbits; j++) {
+                       for (j = 0; j < nbits; j++)
                                m |= ((i >> j) & 1) << (nbits - j - 1);
-                       }
                        s->revtab[i] = m;
                }
        }
@@ -442,8 +440,7 @@ int imdct_init(int nbits, int inverse, struct mdct_context **result)
        double alpha;
        struct mdct_context *s;
 
-       s = para_malloc(sizeof(*s));
-       memset(s, 0, sizeof(*s));
+       s = para_calloc(sizeof(*s));
        n = 1 << nbits;
        s->nbits = nbits;
        s->n = n;