changeset 6141:932523fb0562 libavcodec

Get rid of fft_rev table, use ff_reverse and a shift. Reduces maximum allowed value for MDCT_NBITS to 10 (current value is 9)
author reimar
date Sun, 13 Jan 2008 08:33:00 +0000
parents bf4d7ce32af5
children a35b838ab955
files ac3enc.c
diffstat 1 files changed, 1 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/ac3enc.c	Sat Jan 12 17:37:36 2008 +0000
+++ b/ac3enc.c	Sun Jan 13 08:33:00 2008 +0000
@@ -64,7 +64,6 @@
 
 static int16_t costab[64];
 static int16_t sintab[64];
-static int16_t fft_rev[512];
 static int16_t xcos1[128];
 static int16_t xsin1[128];
 
@@ -103,14 +102,6 @@
         costab[i] = fix15(cos(alpha));
         sintab[i] = fix15(sin(alpha));
     }
-
-    for(i=0;i<n;i++) {
-        m=0;
-        for(j=0;j<ln;j++) {
-            m |= ((i >> j) & 1) << (ln-j-1);
-        }
-        fft_rev[i]=m;
-    }
 }
 
 /* butter fly op */
@@ -148,8 +139,7 @@
 
     /* reverse */
     for(j=0;j<np;j++) {
-        int k;
-        k = fft_rev[j];
+        int k = ff_reverse[j] >> (8 - ln);
         if (k < j)
             FFSWAP(IComplex, z[k], z[j]);
     }