Index: media/base/yuv_convert_unittest.cc |
diff --git a/media/base/yuv_convert_unittest.cc b/media/base/yuv_convert_unittest.cc |
index 85d3693ec8605378bd8d4d5d19f45d53ded1649f..0e04279c046450cda53a7a05bfa4bb8201ca7c26 100644 |
--- a/media/base/yuv_convert_unittest.cc |
+++ b/media/base/yuv_convert_unittest.cc |
@@ -657,37 +657,6 @@ TEST(YUVConvertTest, RGB32ToYUV_SSE2_MatchReference) { |
EXPECT_EQ(0, error); |
} |
-TEST(YUVConvertTest, ConvertYUVToRGB32Row_MMX) { |
- base::CPU cpu; |
- if (!cpu.has_mmx()) { |
- LOG(WARNING) << "System not supported. Test skipped."; |
- return; |
- } |
- |
- scoped_ptr<uint8[]> yuv_bytes(new uint8[kYUV12Size]); |
- scoped_ptr<uint8[]> rgb_bytes_reference(new uint8[kRGBSize]); |
- scoped_ptr<uint8[]> rgb_bytes_converted(new uint8[kRGBSize]); |
- ReadYV12Data(&yuv_bytes); |
- |
- const int kWidth = 167; |
- ConvertYUVToRGB32Row_C(yuv_bytes.get(), |
- yuv_bytes.get() + kSourceUOffset, |
- yuv_bytes.get() + kSourceVOffset, |
- rgb_bytes_reference.get(), |
- kWidth, |
- GetLookupTable(YV12)); |
- ConvertYUVToRGB32Row_MMX(yuv_bytes.get(), |
- yuv_bytes.get() + kSourceUOffset, |
- yuv_bytes.get() + kSourceVOffset, |
- rgb_bytes_converted.get(), |
- kWidth, |
- GetLookupTable(YV12)); |
- media::EmptyRegisterState(); |
- EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(), |
- rgb_bytes_converted.get(), |
- kWidth * kBpp)); |
-} |
- |
TEST(YUVConvertTest, ConvertYUVToRGB32Row_SSE) { |
base::CPU cpu; |
if (!cpu.has_sse()) { |
@@ -719,40 +688,9 @@ TEST(YUVConvertTest, ConvertYUVToRGB32Row_SSE) { |
kWidth * kBpp)); |
} |
-TEST(YUVConvertTest, ScaleYUVToRGB32Row_MMX) { |
- base::CPU cpu; |
- if (!cpu.has_mmx()) { |
- LOG(WARNING) << "System not supported. Test skipped."; |
- return; |
- } |
- |
- scoped_ptr<uint8[]> yuv_bytes(new uint8[kYUV12Size]); |
- scoped_ptr<uint8[]> rgb_bytes_reference(new uint8[kRGBSize]); |
- scoped_ptr<uint8[]> rgb_bytes_converted(new uint8[kRGBSize]); |
- ReadYV12Data(&yuv_bytes); |
- |
- const int kWidth = 167; |
- const int kSourceDx = 80000; // This value means a scale down. |
- ScaleYUVToRGB32Row_C(yuv_bytes.get(), |
- yuv_bytes.get() + kSourceUOffset, |
- yuv_bytes.get() + kSourceVOffset, |
- rgb_bytes_reference.get(), |
- kWidth, |
- kSourceDx, |
- GetLookupTable(YV12)); |
- ScaleYUVToRGB32Row_MMX(yuv_bytes.get(), |
- yuv_bytes.get() + kSourceUOffset, |
- yuv_bytes.get() + kSourceVOffset, |
- rgb_bytes_converted.get(), |
- kWidth, |
- kSourceDx, |
- GetLookupTable(YV12)); |
- media::EmptyRegisterState(); |
- EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(), |
- rgb_bytes_converted.get(), |
- kWidth * kBpp)); |
-} |
- |
+// 64-bit release + component builds on Windows are too smart and optimizes |
+// away the function being tested. |
+#if defined(OS_WIN) && (defined(ARCH_CPU_X86) || !defined(COMPONENT_BUILD)) |
TEST(YUVConvertTest, ScaleYUVToRGB32Row_SSE) { |
base::CPU cpu; |
if (!cpu.has_sse()) { |
@@ -787,40 +725,6 @@ TEST(YUVConvertTest, ScaleYUVToRGB32Row_SSE) { |
kWidth * kBpp)); |
} |
-TEST(YUVConvertTest, LinearScaleYUVToRGB32Row_MMX) { |
- base::CPU cpu; |
- if (!cpu.has_mmx()) { |
- LOG(WARNING) << "System not supported. Test skipped."; |
- return; |
- } |
- |
- scoped_ptr<uint8[]> yuv_bytes(new uint8[kYUV12Size]); |
- scoped_ptr<uint8[]> rgb_bytes_reference(new uint8[kRGBSize]); |
- scoped_ptr<uint8[]> rgb_bytes_converted(new uint8[kRGBSize]); |
- ReadYV12Data(&yuv_bytes); |
- |
- const int kWidth = 167; |
- const int kSourceDx = 80000; // This value means a scale down. |
- LinearScaleYUVToRGB32Row_C(yuv_bytes.get(), |
- yuv_bytes.get() + kSourceUOffset, |
- yuv_bytes.get() + kSourceVOffset, |
- rgb_bytes_reference.get(), |
- kWidth, |
- kSourceDx, |
- GetLookupTable(YV12)); |
- LinearScaleYUVToRGB32Row_MMX(yuv_bytes.get(), |
- yuv_bytes.get() + kSourceUOffset, |
- yuv_bytes.get() + kSourceVOffset, |
- rgb_bytes_converted.get(), |
- kWidth, |
- kSourceDx, |
- GetLookupTable(YV12)); |
- media::EmptyRegisterState(); |
- EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(), |
- rgb_bytes_converted.get(), |
- kWidth * kBpp)); |
-} |
- |
TEST(YUVConvertTest, LinearScaleYUVToRGB32Row_SSE) { |
base::CPU cpu; |
if (!cpu.has_sse()) { |
@@ -854,6 +758,7 @@ TEST(YUVConvertTest, LinearScaleYUVToRGB32Row_SSE) { |
rgb_bytes_converted.get(), |
kWidth * kBpp)); |
} |
+#endif // defined(OS_WIN) && (ARCH_CPU_X86 || COMPONENT_BUILD) |
TEST(YUVConvertTest, FilterYUVRows_C_OutOfBounds) { |
scoped_ptr<uint8[]> src(new uint8[16]); |
@@ -870,30 +775,6 @@ TEST(YUVConvertTest, FilterYUVRows_C_OutOfBounds) { |
} |
} |
-#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) |
-TEST(YUVConvertTest, FilterYUVRows_MMX_OutOfBounds) { |
- base::CPU cpu; |
- if (!cpu.has_mmx()) { |
- LOG(WARNING) << "System not supported. Test skipped."; |
- return; |
- } |
- |
- scoped_ptr<uint8[]> src(new uint8[16]); |
- scoped_ptr<uint8[]> dst(new uint8[16]); |
- |
- memset(src.get(), 0xff, 16); |
- memset(dst.get(), 0, 16); |
- |
- media::FilterYUVRows_MMX(dst.get(), src.get(), src.get(), 1, 255); |
- media::EmptyRegisterState(); |
- |
- EXPECT_EQ(255u, dst[0]); |
- for (int i = 1; i < 16; ++i) { |
- EXPECT_EQ(0u, dst[i]); |
- } |
-} |
-#endif // defined(MEDIA_MMX_INTRINSICS_AVAILABLE) |
- |
TEST(YUVConvertTest, FilterYUVRows_SSE2_OutOfBounds) { |
base::CPU cpu; |
if (!cpu.has_sse2()) { |
@@ -915,38 +796,6 @@ TEST(YUVConvertTest, FilterYUVRows_SSE2_OutOfBounds) { |
} |
} |
-#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) |
-TEST(YUVConvertTest, FilterYUVRows_MMX_UnalignedDestination) { |
- base::CPU cpu; |
- if (!cpu.has_mmx()) { |
- LOG(WARNING) << "System not supported. Test skipped."; |
- return; |
- } |
- |
- const int kSize = 32; |
- scoped_ptr<uint8[]> src(new uint8[kSize]); |
- scoped_ptr<uint8[]> dst_sample(new uint8[kSize]); |
- scoped_ptr<uint8[]> dst(new uint8[kSize]); |
- |
- memset(dst_sample.get(), 0, kSize); |
- memset(dst.get(), 0, kSize); |
- for (int i = 0; i < kSize; ++i) |
- src[i] = 100 + i; |
- |
- media::FilterYUVRows_C(dst_sample.get(), |
- src.get(), src.get(), 17, 128); |
- |
- // Generate an unaligned output address. |
- uint8* dst_ptr = |
- reinterpret_cast<uint8*>( |
- (reinterpret_cast<uintptr_t>(dst.get() + 8) & ~7) + 1); |
- media::FilterYUVRows_MMX(dst_ptr, src.get(), src.get(), 17, 128); |
- media::EmptyRegisterState(); |
- |
- EXPECT_EQ(0, memcmp(dst_sample.get(), dst_ptr, 17)); |
-} |
-#endif // defined(MEDIA_MMX_INTRINSICS_AVAILABLE) |
- |
TEST(YUVConvertTest, FilterYUVRows_SSE2_UnalignedDestination) { |
base::CPU cpu; |
if (!cpu.has_sse2()) { |