Commit e1bf5787 authored by reimar's avatar reimar

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)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11519 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 010eb4e2
...@@ -64,7 +64,6 @@ typedef struct AC3EncodeContext { ...@@ -64,7 +64,6 @@ typedef struct AC3EncodeContext {
static int16_t costab[64]; static int16_t costab[64];
static int16_t sintab[64]; static int16_t sintab[64];
static int16_t fft_rev[512];
static int16_t xcos1[128]; static int16_t xcos1[128];
static int16_t xsin1[128]; static int16_t xsin1[128];
...@@ -103,14 +102,6 @@ static void fft_init(int ln) ...@@ -103,14 +102,6 @@ static void fft_init(int ln)
costab[i] = fix15(cos(alpha)); costab[i] = fix15(cos(alpha));
sintab[i] = fix15(sin(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 */ /* butter fly op */
...@@ -148,8 +139,7 @@ static void fft(IComplex *z, int ln) ...@@ -148,8 +139,7 @@ static void fft(IComplex *z, int ln)
/* reverse */ /* reverse */
for(j=0;j<np;j++) { for(j=0;j<np;j++) {
int k; int k = ff_reverse[j] >> (8 - ln);
k = fft_rev[j];
if (k < j) if (k < j)
FFSWAP(IComplex, z[k], z[j]); FFSWAP(IComplex, z[k], z[j]);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment