diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2001-07-24 20:42:03 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2001-07-24 20:42:03 +0000 |
commit | fb16b7e7b33ec84765d9bb9b36e0859a7b2c0b05 (patch) | |
tree | b347472908fdacf757acc4d3234ff0fc30511362 /libavcodec | |
parent | 7d650cb540b68ceba96abbe3be196473df8e3c5d (diff) | |
download | ffmpeg-fb16b7e7b33ec84765d9bb9b36e0859a7b2c0b05.tar.gz |
added emms_c() macro which should can used in c code in both mmx/non mmx cases
Originally committed as revision 12 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dsputil.c | 4 | ||||
-rw-r--r-- | libavcodec/dsputil.h | 10 | ||||
-rw-r--r-- | libavcodec/motion_est.c | 5 |
3 files changed, 10 insertions, 9 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index a1734be8c1..b68ba8c521 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -21,10 +21,6 @@ #include "avcodec.h" #include "dsputil.h" -#ifdef HAVE_MMX -int mm_flags; /* multimedia extension flags */ -#endif - void (*get_pixels)(DCTELEM *block, const UINT8 *pixels, int line_size); void (*put_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size); void (*add_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size); diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index fa8eb239a5..76f4475f82 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -75,7 +75,13 @@ int mm_support(void); static inline void emms(void) { - asm volatile ("emms;"); + __asm __volatile ("emms;":::"memory"); +} + +#define emms_c() \ +{\ + if (mm_flags & MM_MMX)\ + emms();\ } #define __align8 __attribute__ ((aligned (8))) @@ -84,6 +90,8 @@ void dsputil_init_mmx(void); #else +#define emms_c() + #define __align8 #endif diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c index 0d776631cc..d3e31fc428 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -434,10 +434,7 @@ int estimate_motion(MpegEncContext * s, dmin = phods_motion_search(s, &mx, &my, range / 2, xmin, ymin, xmax, ymax); break; } -#ifdef HAVE_MMX - if (mm_flags & MM_MMX) - emms(); -#endif + emms_c(); /* intra / predictive decision */ xx = mb_x * 16; |