changeset 7135:6bd6a2da306e libavcodec

Define mm_flags/support to be 0 on architectures where they don't exist. Make sure we don't try to set them if that's the case. This lets dct-test and fft-test build with --disable-mmx on x86, but not yet on ARM.
author astrange
date Tue, 24 Jun 2008 23:51:17 +0000
parents 1238746e1301
children 7a73d76aaaa0
files dct-test.c dsputil.h fft-test.c
diffstat 3 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dct-test.c	Tue Jun 24 21:32:34 2008 +0000
+++ b/dct-test.c	Tue Jun 24 23:51:17 2008 +0000
@@ -531,7 +531,10 @@
 
     init_fdct();
     idct_mmx_init();
+
+#ifndef mm_flags
     mm_flags = mm_support();
+#endif
 
     for(i=0;i<256;i++) cropTbl[i + MAX_NEG_CROP] = i;
     for(i=0;i<MAX_NEG_CROP;i++) {
--- a/dsputil.h	Tue Jun 24 21:32:34 2008 +0000
+++ b/dsputil.h	Tue Jun 24 23:51:17 2008 +0000
@@ -578,6 +578,11 @@
 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(16, t, v)
 #define STRIDE_ALIGN 16
 
+#else
+
+#define mm_flags 0
+#define mm_support() 0
+
 #endif
 
 #ifndef DECLARE_ALIGNED_8
--- a/fft-test.c	Tue Jun 24 21:32:34 2008 +0000
+++ b/fft-test.c	Tue Jun 24 23:51:17 2008 +0000
@@ -186,7 +186,10 @@
     MDCTContext m1, *m = &m1;
     int fft_nbits, fft_size;
 
+#ifndef mm_flags
     mm_flags = 0;
+#endif
+
     fft_nbits = 9;
     for(;;) {
         c = getopt(argc, argv, "hsimn:");