aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-15 12:10:08 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-15 12:10:08 +0100
commit61fbb4cd57d7bd280c6645df98acdacfe6004a88 (patch)
tree52c35fd93bdfc3b30d6b284e59e9362131b49962 /libavutil
parent75758f84def252a228a80a2e08d0c9ed7fce8df4 (diff)
parent4db96649ca700db563d9da4ebe70bf9fc4c7a6ba (diff)
downloadffmpeg-61fbb4cd57d7bd280c6645df98acdacfe6004a88.tar.gz
Merge commit '4db96649ca700db563d9da4ebe70bf9fc4c7a6ba'
* commit '4db96649ca700db563d9da4ebe70bf9fc4c7a6ba': avutil: Ensure that emms_c is always defined, even on non-x86 configure: Move MinGW CPPFLAGS setting to libc section, where it belongs avutil: Move emms code to x86-specific header Conflicts: configure libavutil/internal.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/internal.h29
-rw-r--r--libavutil/x86/emms.h22
2 files changed, 30 insertions, 21 deletions
diff --git a/libavutil/internal.h b/libavutil/internal.h
index 2dacb2c5af..a105fe6b44 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -40,6 +40,14 @@
#include "cpu.h"
#include "dict.h"
+#if ARCH_X86
+# include "x86/emms.h"
+#endif
+
+#ifndef emms_c
+# define emms_c()
+#endif
+
#ifndef attribute_align_arg
#if ARCH_X86_32 && AV_GCC_VERSION_AT_LEAST(4,2)
# define attribute_align_arg __attribute__((force_align_arg_pointer))
@@ -154,25 +162,4 @@
# define ONLY_IF_THREADS_ENABLED(x) NULL
#endif
-#if HAVE_MMX_INLINE
-/**
- * Empty mmx state.
- * this must be called between any dsp function and float/double code.
- * for example sin(); dsp->idct_put(); emms_c(); cos()
- */
-static av_always_inline void emms_c(void)
-{
- if(av_get_cpu_flags() & AV_CPU_FLAG_MMX)
- __asm__ volatile ("emms" ::: "memory");
-}
-#elif HAVE_MMX && HAVE_MM_EMPTY
-# include <mmintrin.h>
-# define emms_c _mm_empty
-#elif HAVE_MMX && HAVE_YASM
-# include "libavutil/x86/emms.h"
-# define emms_c avpriv_emms_yasm
-#else
-# define emms_c()
-#endif /* HAVE_MMX_INLINE */
-
#endif /* AVUTIL_INTERNAL_H */
diff --git a/libavutil/x86/emms.h b/libavutil/x86/emms.h
index 35f0dfbfc1..809a23b05b 100644
--- a/libavutil/x86/emms.h
+++ b/libavutil/x86/emms.h
@@ -19,6 +19,28 @@
#ifndef AVUTIL_X86_EMMS_H
#define AVUTIL_X86_EMMS_H
+#include "config.h"
+#include "libavutil/attributes.h"
+
void avpriv_emms_yasm(void);
+#if HAVE_MMX_INLINE
+# define emms_c emms_c
+/**
+ * Empty mmx state.
+ * this must be called between any dsp function and float/double code.
+ * for example sin(); dsp->idct_put(); emms_c(); cos()
+ */
+static av_always_inline void emms_c(void)
+{
+ if(av_get_cpu_flags() & AV_CPU_FLAG_MMX)
+ __asm__ volatile ("emms" ::: "memory");
+}
+#elif HAVE_MMX && HAVE_MM_EMPTY
+# include <mmintrin.h>
+# define emms_c _mm_empty
+#elif HAVE_MMX_EXTERNAL
+# define emms_c avpriv_emms_yasm
+#endif /* HAVE_MMX_INLINE */
+
#endif /* AVUTIL_X86_EMMS_H */