From 2a9546579587a4835752001ce141c93dc02fb02f Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Wed, 8 Aug 2012 23:18:56 +0000 Subject: [PATCH] HAVE_ARGBAFFINEROW_SSE2 macro BUG=62 TEST=none Review URL: https://webrtc-codereview.appspot.com/716006 git-svn-id: http://libyuv.googlecode.com/svn/trunk@316 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/planar_functions.h | 3 +++ include/libyuv/version.h | 2 +- unit_test/planar_test.cc | 15 +++++++++------ 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.chromium b/README.chromium index adab2a77c..6b77771ec 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 314 +Version: 315 License: BSD License File: LICENSE diff --git a/include/libyuv/planar_functions.h b/include/libyuv/planar_functions.h index 7453aa75c..2b2f9c307 100644 --- a/include/libyuv/planar_functions.h +++ b/include/libyuv/planar_functions.h @@ -232,8 +232,11 @@ int ARGBInterpolate(const uint8* src_argb0, int src_stride_argb0, // of destination. Useful for scaling, rotation, mirror, texture mapping. void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride, uint8* dst_argb, const float* uv_dudv, int width); +#if defined(_MSC_VER) void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride, uint8* dst_argb, const float* uv_dudv, int width); +#define HAS_ARGBAFFINEROW_SSE2 +#endif #ifdef __cplusplus } // extern "C" diff --git a/include/libyuv/version.h b/include/libyuv/version.h index fe51fd0c0..ab79f711f 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 314 +#define LIBYUV_VERSION 315 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/unit_test/planar_test.cc b/unit_test/planar_test.cc index ffe47d36d..183e3a35d 100644 --- a/unit_test/planar_test.cc +++ b/unit_test/planar_test.cc @@ -918,25 +918,28 @@ TEST_F(libyuvTest, TestAffine) { EXPECT_EQ(96u, interpolate_pixels_C[128][0]); EXPECT_EQ(191u, interpolate_pixels_C[255][3]); -#if defined(_MSC_VER) +#if defined(HAS_ARGBAFFINEROW_SSE2) ARGBAffineRow_SSE2(&orig_pixels_0[0][0], 0, &interpolate_pixels_Opt[0][0], uv_step, 256); EXPECT_EQ(0, memcmp(interpolate_pixels_Opt, interpolate_pixels_C, 256 * 4)); #endif -#if defined(_MSC_VER) +#if defined(HAS_ARGBAFFINEROW_SSE2) int has_sse2 = TestCpuFlag(kCpuHasSSE2); if (has_sse2) { for (int i = 0; i < 1000 * 1280 * 720 / 256; ++i) { ARGBAffineRow_SSE2(&orig_pixels_0[0][0], 0, &interpolate_pixels_Opt[0][0], uv_step, 256); } - } else + } else { #endif - for (int i = 0; i < 1000 * 1280 * 720 / 256; ++i) { - ARGBAffineRow_C(&orig_pixels_0[0][0], 0, &interpolate_pixels_C[0][0], - uv_step, 256); + for (int i = 0; i < 1000 * 1280 * 720 / 256; ++i) { + ARGBAffineRow_C(&orig_pixels_0[0][0], 0, &interpolate_pixels_C[0][0], + uv_step, 256); + } +#if defined(HAS_ARGBAFFINEROW_SSE2) } +#endif } } // namespace libyuv