diff options
author | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-13 02:55:28 +0000 |
---|---|---|
committer | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-13 02:55:28 +0000 |
commit | 6d05df627ba8614a90d8ba4a941424490708533b (patch) | |
tree | 60a7df9e4f0bfa475105a49809cc5b70dcc1f218 /media | |
parent | f5b05bfa0f15fc461049863e2e881cd24256174e (diff) | |
download | chromium_src-6d05df627ba8614a90d8ba4a941424490708533b.zip chromium_src-6d05df627ba8614a90d8ba4a941424490708533b.tar.gz chromium_src-6d05df627ba8614a90d8ba4a941424490708533b.tar.bz2 |
include emmintrin for chrome linux to use mmx _m64 types.
BUG=19113
TEST=build official chrome on linux 32 bit.
Review URL: http://codereview.chromium.org/1508031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44318 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/base/yuv_convert.cc | 19 | ||||
-rw-r--r-- | media/base/yuv_row.h | 3 |
2 files changed, 10 insertions, 12 deletions
diff --git a/media/base/yuv_convert.cc b/media/base/yuv_convert.cc index fc77ef6..9144b2f 100644 --- a/media/base/yuv_convert.cc +++ b/media/base/yuv_convert.cc @@ -28,7 +28,7 @@ #endif #endif -#if USE_SSE +#if USE_SSE || USE_MMX #include <emmintrin.h> #endif @@ -75,17 +75,17 @@ static void FilterRows(uint8* ybuf, const uint8* y0_ptr, const uint8* y1_ptr, int width, int scaled_y_fraction) { __m128i zero = _mm_setzero_si128(); __m128i y1_fraction = _mm_set1_epi16( - static_cast<unsigned short>(scaled_y_fraction >> 8)); + static_cast<uint16>(scaled_y_fraction >> 8)); __m128i y0_fraction = _mm_set1_epi16( - static_cast<unsigned short>((scaled_y_fraction >> 8) ^ 255)); + static_cast<uint16>((scaled_y_fraction >> 8) ^ 255)); uint8* end = ybuf + width; if (ybuf < end) { do { __m128i y0 = _mm_loadl_epi64(reinterpret_cast<__m128i const*>(y0_ptr)); __m128i y1 = _mm_loadl_epi64(reinterpret_cast<__m128i const*>(y1_ptr)); - y0 = _mm_unpacklo_epi8 (y0, zero); - y1 = _mm_unpacklo_epi8 (y1, zero); + y0 = _mm_unpacklo_epi8(y0, zero); + y1 = _mm_unpacklo_epi8(y1, zero); y0 = _mm_mullo_epi16(y0, y0_fraction); y1 = _mm_mullo_epi16(y1, y1_fraction); y0 = _mm_add_epi16(y0, y1); // 8.8 fixed point result @@ -105,17 +105,17 @@ static void FilterRows(uint8* ybuf, const uint8* y0_ptr, const uint8* y1_ptr, int width, int scaled_y_fraction) { __m64 zero = _mm_setzero_si64(); __m64 y1_fraction = _mm_set1_pi16( - static_cast<short>(scaled_y_fraction >> 8)); + static_cast<int16>(scaled_y_fraction >> 8)); __m64 y0_fraction = _mm_set1_pi16( - static_cast<short>((scaled_y_fraction >> 8) ^ 255)); + static_cast<int16>((scaled_y_fraction >> 8) ^ 255)); uint8* end = ybuf + width; if (ybuf < end) { do { __m64 y0 = _mm_cvtsi32_si64(*reinterpret_cast<const int *>(y0_ptr)); __m64 y1 = _mm_cvtsi32_si64(*reinterpret_cast<const int *>(y1_ptr)); - y0 = _mm_unpacklo_pi8 (y0, zero); - y1 = _mm_unpacklo_pi8 (y1, zero); + y0 = _mm_unpacklo_pi8(y0, zero); + y1 = _mm_unpacklo_pi8(y1, zero); y0 = _mm_mullo_pi16(y0, y0_fraction); y1 = _mm_mullo_pi16(y1, y1_fraction); y0 = _mm_add_pi16(y0, y1); // 8.8 fixed point result @@ -139,7 +139,6 @@ static void FilterRows(uint8* ybuf, const uint8* y0_ptr, const uint8* y1_ptr, uint8* end = ybuf + width; if (ybuf < end) { do { - ybuf[0] = (y0_ptr[0] * (y0_fraction) + y1_ptr[0] * (y1_fraction)) >> 16; ybuf[1] = (y0_ptr[1] * (y0_fraction) + y1_ptr[1] * (y1_fraction)) >> 16; ybuf[2] = (y0_ptr[2] * (y0_fraction) + y1_ptr[2] * (y1_fraction)) >> 16; diff --git a/media/base/yuv_row.h b/media/base/yuv_row.h index e87f76e..2f8b277 100644 --- a/media/base/yuv_row.h +++ b/media/base/yuv_row.h @@ -67,12 +67,11 @@ void LinearScaleYUVToRGB32Row(const uint8* y_buf, uint8* rgb_buf, int width, int dx); - } // extern "C" #if !defined(USE_MMX) // Windows, Mac and Linux/BSD use MMX -#if defined(ARCH_CPU_X86) || (defined(ARCH_CPU_X86_64) && defined(OS_POSIX) && !defined(OS_MACOSX)) +#if defined(__MMX__) || defined(_MSC_VER) #define USE_MMX 1 #else #define USE_MMX 0 |