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

Michael Niedermayer michaelni
Thu Sep 13 18:20:57 CEST 2007


Hi

On Thu, Sep 13, 2007 at 04:54:50PM +0200, Lo?c Minier wrote:
> 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:
>     center(aptr);
>     inverse_dft(aptr);
> 
>  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.

you have to flip the sign of the imaginary input as well as output


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070913/4d30f24c/attachment.pgp>



More information about the ffmpeg-devel mailing list