diff options
author | Diego Biurrun <diego@biurrun.de> | 2013-01-22 02:22:29 +0100 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-02-14 17:37:34 +0100 |
commit | ab441e20ffdfa2547f1d6c1dc19994ec05eb7d2f (patch) | |
tree | d27bc7db16b8c9ab4cdea2a006ad55093cf18480 /libavutil/x86 | |
parent | 130cefc9dcedea5babc349251fbeec6f037144ac (diff) | |
download | ffmpeg-ab441e20ffdfa2547f1d6c1dc19994ec05eb7d2f.tar.gz |
avutil: Move emms code to x86-specific header
Diffstat (limited to 'libavutil/x86')
-rw-r--r-- | libavutil/x86/emms.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libavutil/x86/emms.h b/libavutil/x86/emms.h index 6bb8ca3195..56068e581f 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 +/** + * 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) +{ + __asm__ volatile ("emms" ::: "memory"); +} +#elif HAVE_MMX && HAVE_MM_EMPTY +# include <mmintrin.h> +# define emms_c _mm_empty +#elif HAVE_MMX && HAVE_YASM +# define emms_c avpriv_emms_yasm +#else +# define emms_c() +#endif /* HAVE_MMX_INLINE */ + #endif /* AVUTIL_X86_EMMS_H */ |