[FFmpeg-devel] [PATCH] NellyMoser audio decoder v2

Loïc Minier lool
Thu Sep 13 16:54:50 CEST 2007

On Thu, Sep 13, 2007, Michael Niedermayer wrote:
> > > > +static void inverse_dft(float *audio)
> > > if this is a standard dft (discrete fourier transform) then please use
> > > the existing code from fft.c 
> > > if its not a dft then please elaborate on what it is
> >  I have no idea what it is; like you, I simply read its name.  I didn't
> >  change it yet.
> well try our fft please :)
> or feed the inverse_dft with an array of all 0 and just the first element 1
> then only the second element 1, then only the third, then only the last and
> post the 4 outputs here and we will maybe be able to tell what it is

 I gave a try with ff_fft_* funcs, but couldn't replace the current code
 for all inputs.  In summary, the audio ouput is almost identical, but
 still noticeably changed.

 I replaced this original code:

 with something like:
    ff_fft_permute(&fftc, (FFTComplex*)aptr);
    ff_fft_calc(&fftc, (FFTComplex*)aptr);
    /* flip sign of imaginary component */
    for (j = 0; j<64; j++) {
        ((FFTComplex*)aptr)[j].im = -((FFTComplex*)aptr)[j].im;

 I attach my test program where I implemented a simple input frequency
 analysis as you suggested, and it proved that the results of the
 original code (center + inverse_dft) is identical to the ffmpeg version
 (ff_fft_permute + ff_fft_calc + flip) for pure real input, but diverges
 for non-zero imaginary input.  If you like to run the test case, you
 can tweak input in init_data().  I also included the reference fft
 implementation from fft-test.c for completeness.

Lo?c Minier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fft.c
Type: text/x-csrc
Size: 9125 bytes
Desc: fft.c
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070913/e4985ff3/attachment.c>

More information about the ffmpeg-devel mailing list