[FFmpeg-devel] [PATCH] RDFT for Bink audio

Benjamin Larsson banan
Thu Jan 15 10:25:52 CET 2009


Alex Converse wrote:
> Hi,
>
> Attached is an implementation of the Real Discrete Fourier Transform as
> required for Bink Audio.
>
> Regards,
> Alex Converse
>   

Hi, Bink audio has 2 modes:

+        if (s->use_dct)
+            ff_dct_calc (&s->trans.dct,  coeffs);
+        else
+            ff_rdft_calc(&s->trans.rdft, coeffs);



Did you implement both modes in this patch ? To me it looks like we also 
need a dct function also.

+        ev.re =  k1*(data[i1  ]+data[i2  ]);
+        od.im =  k2*(data[i1  ]-data[i2  ]);
+        ev.im =  k1*(data[i1+1]-data[i2+1]);
+        od.re = -k2*(data[i1+1]+data[i2+1]);
+        /* Apply twiddle factors to the odd FFT and add to the even FFT */
+        data[i1  ] =  ev.re + od.re*tcos[i] - od.im*tsin[i];
+        data[i1+1] =  ev.im + od.im*tcos[i] + od.re*tsin[i];
+        data[i2  ] =  ev.re - od.re*tcos[i] + od.im*tsin[i];
+        data[i2+1] = -ev.im + od.im*tcos[i] + od.re*tsin[i];


That part of the code looked like some code we have in the qdm2.c 
decoder ? Can you look and see if it matches? I have always wondered 
what kind of transform it was.

Code wise other then some strange indentation in the struct it looked ok.

MvH
Benjamin Larsson






More information about the ffmpeg-devel mailing list