[FFmpeg-devel] [PATCH] RDFT for Bink audio
Vitor Sessak
vitor1001
Sat Jan 17 13:18:36 CET 2009
Michael Niedermayer wrote:
> On Thu, Jan 15, 2009 at 11:52:20AM -0500, Alex Converse wrote:
> [...]
>> +int ff_rdft_init(RDFTContext *s, int nbits, int inverse)
>> +{
>> + int n = 1 << nbits;
>> + int i;
>> + const double theta = (1-2*inverse)*2*M_PI/n;
>> +
>> + s->nbits = nbits;
>> + s->inverse = inverse;
>> +
>> + if (ff_fft_init(&s->fft, nbits-1, !inverse) < 0)
>> + goto fail;
>> +
>> + s->tcos = av_malloc((n>>2) * sizeof(FFTSample));
>> + if (!s->tcos)
>> + goto fail;
>> + s->tsin = av_malloc((n>>2) * sizeof(FFTSample));
>> + if (!s->tsin)
>> + goto fail;
>> + for (i = 0; i < (n>>2); i++) {
>> + s->tcos[i] = cos(i*theta);
>> + s->tsin[i] = sin(i*theta);
>> + }
>
> we have a large number of sin and cos tables already
> see ff_sine_* / ff_cos_*, no need to duplicate them in each context
Since you are at it, patch not to duplicate it in nellymoserdec.c...
-Vitor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sin.diff
Type: text/x-diff
Size: 1131 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090117/8692c4af/attachment.diff>
More information about the ffmpeg-devel
mailing list