[FFmpeg-devel] Fixpoint FFT optimization, with MDCT and IMDCT wrappers for audio optimization

Michael Niedermayer michaelni
Sun Jul 29 13:47:01 CEST 2007


Hi

On Sun, Jul 29, 2007 at 07:43:05AM -0400, Marc Hoffman wrote:
[...]
> > is this what you want?
> >
> > static FFTComplex16 *stwids (FFTComplex *w, int n) {
> >     int i;
> >     FFTComplex16 *v = av_malloc (sizeof (short)*n);
> >     for (i = 0; i < n/2; i++) {
> >         v[i].re = lrintf(w[i].re*32768);
> >         v[i].im = lrintf(w[i].im*32768);
> >     }
> >     return v;
> > }
> >
> 
> Thats what you want no problem sorry to be annoying.
> 
> /**
>  * Generate 16b coefficient table from a predefined floating point table.
>  * @param w     - floating point twiddle factors
>  * Wparam n     - number of twiddle factors
>  */
> static FFTComplex16 *stwids (FFTComplex *w, int n) {
>     int i;
>     FFTComplex16 *v = av_malloc (sizeof (short)*n);
>     for (i = 0; i < n/2; i++) {
>         v[i].re = lrintf(FFMAX(FFMIN(w[i].re*32768,32767),-32768));
>         v[i].im = lrintf(FFMAX(FFMIN(w[i].im*32768,32767),-32768));
>     }
>     return v;
> }

yes but i think the FFMAX is unneeded

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070729/145e93f5/attachment.pgp>



More information about the ffmpeg-devel mailing list