diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-01-08 13:18:42 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-01-08 13:18:42 +0000 |
commit | 6f1c8d4eafabd914b87e9171bf4d04f4ef9160ea (patch) | |
tree | e70be493d1222b10f96aa5efac01c0ec0d5bcc97 /src/libffmpeg/libavcodec/fft.c | |
parent | 1fb58a63872660424777d41389e426dc90f1b660 (diff) | |
download | xine-lib-6f1c8d4eafabd914b87e9171bf4d04f4ef9160ea.tar.gz xine-lib-6f1c8d4eafabd914b87e9171bf4d04f4ef9160ea.tar.bz2 |
syncing ffmpeg (with some compilation fixes)
- fixes wma bugs
- mace, huffyuv and mp3 decoders imported (but not enabled)
tested: wma (v1 and v2), mpeg4, msmpeg4 v1, v2 and v3, divx3, divx4, divx5, xvid and
dv decoders. everything looks fine.
CVS patchset: 3828
CVS date: 2003/01/08 13:18:42
Diffstat (limited to 'src/libffmpeg/libavcodec/fft.c')
-rw-r--r-- | src/libffmpeg/libavcodec/fft.c | 69 |
1 files changed, 42 insertions, 27 deletions
diff --git a/src/libffmpeg/libavcodec/fft.c b/src/libffmpeg/libavcodec/fft.c index 0f5181ac3..f060992f4 100644 --- a/src/libffmpeg/libavcodec/fft.c +++ b/src/libffmpeg/libavcodec/fft.c @@ -51,33 +51,48 @@ int fft_init(FFTContext *s, int nbits, int inverse) s->exptab1 = NULL; /* compute constant table for HAVE_SSE version */ -#if defined(HAVE_MMX) && 0 - if (mm_flags & MM_SSE) { - int np, nblocks, np2, l; - FFTComplex *q; - - np = 1 << nbits; - nblocks = np >> 3; - np2 = np >> 1; - s->exptab1 = av_malloc(np * 2 * sizeof(FFTComplex)); - if (!s->exptab1) - goto fail; - q = s->exptab1; - do { - for(l = 0; l < np2; l += 2 * nblocks) { - *q++ = s->exptab[l]; - *q++ = s->exptab[l + nblocks]; - - q->re = -s->exptab[l].im; - q->im = s->exptab[l].re; - q++; - q->re = -s->exptab[l + nblocks].im; - q->im = s->exptab[l + nblocks].re; - q++; - } - nblocks = nblocks >> 1; - } while (nblocks != 0); - av_freep(&s->exptab); +#if (defined(HAVE_MMX) && defined(HAVE_BUILTIN_VECTOR)) || defined(HAVE_ALTIVEC) + { + int has_vectors; + +#if defined(HAVE_MMX) + has_vectors = mm_support() & MM_SSE; +#else + /* XXX: should also use mm_support() ? */ + has_vectors = has_altivec() & MM_ALTIVEC; +#endif + if (has_vectors) { + int np, nblocks, np2, l; + FFTComplex *q; + + np = 1 << nbits; + nblocks = np >> 3; + np2 = np >> 1; + s->exptab1 = av_malloc(np * 2 * sizeof(FFTComplex)); + if (!s->exptab1) + goto fail; + q = s->exptab1; + do { + for(l = 0; l < np2; l += 2 * nblocks) { + *q++ = s->exptab[l]; + *q++ = s->exptab[l + nblocks]; + + q->re = -s->exptab[l].im; + q->im = s->exptab[l].re; + q++; + q->re = -s->exptab[l + nblocks].im; + q->im = s->exptab[l + nblocks].re; + q++; + } + nblocks = nblocks >> 1; + } while (nblocks != 0); + av_freep(&s->exptab); +#if defined(HAVE_MMX) + s->fft_calc = fft_calc_sse; +#else + s->fft_calc = fft_calc_altivec; +#endif + } } #endif |