summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
Diffstat (limited to 'media')
-rw-r--r--media/base/yuv_convert.cc10
-rw-r--r--media/base/yuv_convert.h10
-rw-r--r--media/base/yuv_convert_unittest.cc4
3 files changed, 14 insertions, 10 deletions
diff --git a/media/base/yuv_convert.cc b/media/base/yuv_convert.cc
index f32c1d2..85b0699 100644
--- a/media/base/yuv_convert.cc
+++ b/media/base/yuv_convert.cc
@@ -33,16 +33,6 @@
#endif
#endif
-// Visual Studio 2010 does not support MMX intrinsics on x64.
-// Some win64 yuv_convert code paths use SSE+MMX yasm, so without rewriting
-// them, we use yasm EmptyRegisterState_MMX in place of _mm_empty() or
-// hide the versions implemented with heavy use of MMX intrinsics.
-// TODO(wolenetz): Use MMX intrinsics when compiling win64 with Visual
-// Studio 2012? http://crbug.com/173450
-#if !(defined(ARCH_CPU_X86_64) && defined(COMPILER_MSVC))
-#define MEDIA_MMX_INTRINSICS_AVAILABLE
-#endif
-
// Assembly functions are declared without namespace.
extern "C" {
void EmptyRegisterState_MMX();
diff --git a/media/base/yuv_convert.h b/media/base/yuv_convert.h
index 719e6a3..30c07ab 100644
--- a/media/base/yuv_convert.h
+++ b/media/base/yuv_convert.h
@@ -7,6 +7,16 @@
#include "base/basictypes.h"
+// Visual Studio 2010 does not support MMX intrinsics on x64.
+// Some win64 yuv_convert code paths use SSE+MMX yasm, so without rewriting
+// them, we use yasm EmptyRegisterState_MMX in place of _mm_empty() or
+// hide the versions implemented with heavy use of MMX intrinsics.
+// TODO(wolenetz): Use MMX intrinsics when compiling win64 with Visual
+// Studio 2012? http://crbug.com/173450
+#if !(defined(ARCH_CPU_X86_64) && defined(COMPILER_MSVC))
+#define MEDIA_MMX_INTRINSICS_AVAILABLE
+#endif
+
namespace media {
// Type of YUV surface.
diff --git a/media/base/yuv_convert_unittest.cc b/media/base/yuv_convert_unittest.cc
index c57f715..c2647e7 100644
--- a/media/base/yuv_convert_unittest.cc
+++ b/media/base/yuv_convert_unittest.cc
@@ -775,6 +775,7 @@ TEST(YUVConvertTest, FilterYUVRows_C_OutOfBounds) {
}
}
+#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
TEST(YUVConvertTest, FilterYUVRows_MMX_OutOfBounds) {
base::CPU cpu;
if (!cpu.has_mmx()) {
@@ -796,6 +797,7 @@ TEST(YUVConvertTest, FilterYUVRows_MMX_OutOfBounds) {
EXPECT_EQ(0u, dst[i]);
}
}
+#endif // defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
TEST(YUVConvertTest, FilterYUVRows_SSE2_OutOfBounds) {
base::CPU cpu;
@@ -818,6 +820,7 @@ TEST(YUVConvertTest, FilterYUVRows_SSE2_OutOfBounds) {
}
}
+#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
TEST(YUVConvertTest, FilterYUVRows_MMX_UnalignedDestination) {
base::CPU cpu;
if (!cpu.has_mmx()) {
@@ -847,6 +850,7 @@ TEST(YUVConvertTest, FilterYUVRows_MMX_UnalignedDestination) {
EXPECT_EQ(0, memcmp(dst_sample.get(), dst_ptr, 17));
}
+#endif // defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
TEST(YUVConvertTest, FilterYUVRows_SSE2_UnalignedDestination) {
base::CPU cpu;