*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
s->exptab1 = NULL;
/* compute constant table for HAVE_SSE version */
-#if (defined(HAVE_MMX) && defined(HAVE_BUILTIN_VECTOR)) || defined(HAVE_ALTIVEC)
+#if (defined(HAVE_MMX) && (defined(HAVE_BUILTIN_VECTOR) || defined(HAVE_MM3DNOW))) || defined(HAVE_ALTIVEC)
{
int has_vectors = 0;
#if defined(HAVE_MMX)
- has_vectors = mm_support() & MM_SSE;
+ has_vectors = mm_support() & (MM_3DNOW | MM_3DNOWEXT | MM_SSE | MM_SSE2);
#endif
#if defined(HAVE_ALTIVEC) && !defined(ALTIVEC_USE_REFERENCE_C_CODE)
has_vectors = mm_support() & MM_ALTIVEC;
} while (nblocks != 0);
av_freep(&s->exptab);
#if defined(HAVE_MMX)
- s->fft_calc = ff_fft_calc_sse;
-#else
+#ifdef HAVE_MM3DNOW
+ if (has_vectors & MM_3DNOWEXT)
+ /* 3DNowEx for Athlon(XP) */
+ s->fft_calc = ff_fft_calc_3dn2;
+ else if (has_vectors & MM_3DNOW)
+ /* 3DNow! for K6-2/3 */
+ s->fft_calc = ff_fft_calc_3dn;
+#endif
+#ifdef HAVE_BUILTIN_VECTOR
+ if (has_vectors & MM_SSE2)
+ /* SSE for P4/K8 */
+ s->fft_calc = ff_fft_calc_sse;
+ else if ((has_vectors & MM_SSE) &&
+ s->fft_calc == ff_fft_calc_c)
+ /* SSE for P3 */
+ s->fft_calc = ff_fft_calc_sse;
+#endif
+#else /* HAVE_MMX */
s->fft_calc = ff_fft_calc_altivec;
#endif
}
void ff_fft_calc_c(FFTContext *s, FFTComplex *z)
{
int ln = s->nbits;
- int j, np, np2;
- int nblocks, nloops;
+ int j, np, np2;
+ int nblocks, nloops;
register FFTComplex *p, *q;
FFTComplex *exptab = s->exptab;
int l;