diff options
-rw-r--r-- | media/base/yuv_convert.cc | 4 | ||||
-rw-r--r-- | media/base/yuv_row.h | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/media/base/yuv_convert.cc b/media/base/yuv_convert.cc index 257d7c8..8ff8b1f 100644 --- a/media/base/yuv_convert.cc +++ b/media/base/yuv_convert.cc @@ -20,7 +20,7 @@ // Header for low level row functions. #include "media/base/yuv_row.h" -#if USE_MMX +#if USE_SSE #if defined(_MSC_VER) #include <intrin.h> #else @@ -67,7 +67,7 @@ void ConvertYUVToRGB32(const uint8* y_buf, // 4 pixels are blended at a time. static void FilterRows(uint8* ybuf, const uint8* y0_ptr, const uint8* y1_ptr, int width, int scaled_y_fraction) { -#if USE_MMX +#if USE_SSE __m128i zero = _mm_setzero_si128(); __m128i y1_fraction = _mm_set1_epi16( static_cast<unsigned short>(scaled_y_fraction >> 8)); diff --git a/media/base/yuv_row.h b/media/base/yuv_row.h index 7e3163d..5392628 100644 --- a/media/base/yuv_row.h +++ b/media/base/yuv_row.h @@ -79,6 +79,12 @@ void LinearScaleYUVToRGB32Row(const uint8* y_buf, #endif #endif +#if defined(__SSE2__) || defined(_MSC_VER) +#define USE_SSE 1 +#else +#define USE_SSE 0 +#endif + // x64 uses MMX2 (SSE) so emms is not required. #if USE_MMX && !defined(ARCH_CPU_X86_64) #if defined(_MSC_VER) |