[FFmpeg-devel] [PATCH] get rid of fft_rev

Reimar Döffinger Reimar.Doeffinger
Sat Jan 12 18:50:09 CET 2008


Hello,
attached patch gets rid of the global fft_rev array and uses ff_reverse
instead.
It has the side effect that the maximum valid value for MDCT_NBITS is
now 10 instead of 11 (currently it is 9), though I doubt this is
relevant.

Greetings,
Reimar D?ffinger
-------------- next part --------------
Index: libavcodec/ac3enc.c
===================================================================
--- libavcodec/ac3enc.c	(revision 11518)
+++ libavcodec/ac3enc.c	(working copy)
@@ -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]);
     }



More information about the ffmpeg-devel mailing list