diff --git a/jpeg/jdmerge.c b/jpeg/jdmerge.c index 4d4424d9272f..5c83654af9dc 100644 --- a/jpeg/jdmerge.c +++ b/jpeg/jdmerge.c @@ -39,7 +39,7 @@ #ifdef UPSAMPLE_MERGING_SUPPORTED -#ifdef XP_WIN32 +#ifdef HAVE_MMX_INTEL_MNEMONICS __int64 const1 = 0x59BA0000D24B59BA; // Cr_r Cr_b Cr_g Cr_r __int64 const2 = 0x00007168E9FA0000; // Cb-r Cb_b Cb_g Cb_r __int64 const5 = 0x0000D24B59BA0000; // Cr_b Cr_g Cr_r Cr_b @@ -300,7 +300,7 @@ h2v1_merged_upsample (j_decompress_ptr cinfo, * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical. */ -#ifdef XP_WIN32 +#ifdef HAVE_MMX_INTEL_MNEMONICS __inline METHODDEF(void) h2v2_merged_upsample_orig (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, @@ -316,7 +316,7 @@ h2v2_merged_upsample (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); -#ifdef XP_WIN32 +#ifdef HAVE_MMX_INTEL_MNEMONICS METHODDEF(void) h2v2_merged_upsample (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, diff --git a/jpeg/jidctfst.c b/jpeg/jidctfst.c index 8e00287b2112..325514c9d3dc 100644 --- a/jpeg/jidctfst.c +++ b/jpeg/jidctfst.c @@ -38,6 +38,7 @@ #include "jdct.h" /* Private declarations for DCT subsystem */ #include "xp_core.h" + #ifdef DCT_IFAST_SUPPORTED @@ -160,7 +161,7 @@ #define IDESCALE(x,n) ((int) IRIGHT_SHIFT(x, n)) #endif -#ifdef XP_WIN32 +#ifdef HAVE_MMX_INTEL_MNEMONICS __inline GLOBAL(void) jpeg_idct_ifast_mmx (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, @@ -177,7 +178,7 @@ jpeg_idct_ifast(j_decompress_ptr cinfo, jpeg_component_info * compptr, JSAMPARRAY output_buf, JDIMENSION output_col); -#ifdef XP_WIN32 +#ifdef HAVE_MMX_INTEL_MNEMONICS GLOBAL(void) jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, @@ -397,7 +398,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, #endif -#ifdef XP_WIN32 +#ifdef HAVE_MMX_INTEL_MNEMONICS _inline GLOBAL(void) diff --git a/jpeg/jmorecfg.h b/jpeg/jmorecfg.h index de7e3be41755..3a52fc2204fd 100644 --- a/jpeg/jmorecfg.h +++ b/jpeg/jmorecfg.h @@ -105,6 +105,11 @@ typedef short JSAMPLE; typedef short JCOEF; +/* Defines for MMX support. */ + +#if defined(XP_WIN32) && defined(_M_IX86) +#define HAVE_MMX_INTEL_MNEMONICS +#endif /* Compressed datastreams are represented as arrays of JOCTET. * These must be EXACTLY 8 bits wide, at least once they are written to diff --git a/jpeg/jpeglib.h b/jpeg/jpeglib.h index 492994467a88..eb80b60b4858 100644 --- a/jpeg/jpeglib.h +++ b/jpeg/jpeglib.h @@ -15,10 +15,6 @@ #include "xp_core.h" -#ifdef XP_WIN32 - extern int MMXAvailable; -#endif - /* * First we include the configuration files that record how this * installation of the JPEG library is set up. jconfig.h can be @@ -32,6 +28,11 @@ #include "jmorecfg.h" /* seldom changed options */ +#ifdef HAVE_MMX_INTEL_MNEMONICS + extern int MMXAvailable; +#endif + + /* Version ID for the JPEG library. * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60". */