Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(810)

Unified Diff: unit_test/planar_test.cc

Issue 1579023002: Fix ifdef mismatch for mirroruv (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/row_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unit_test/planar_test.cc
diff --git a/unit_test/planar_test.cc b/unit_test/planar_test.cc
index 3740c078397a42669f0375b9e3c0facd39bff9f4..a816f4fddf291e0ff487739c27c761963419bf56 100644
--- a/unit_test/planar_test.cc
+++ b/unit_test/planar_test.cc
@@ -1149,111 +1149,6 @@ TEST_F(LibYUVPlanarTest, ARGBBlend_Opt) {
EXPECT_LE(max_diff, 1);
}
-#ifdef HAS_BLENDPLANEROW_AVX2
-static void TestBlendPlaneRow(int width, int height, int benchmark_iterations,
- int invert, int off) {
- int has_ssse3 = TestCpuFlag(kCpuHasSSSE3);
- int has_avx2 = TestCpuFlag(kCpuHasAVX2);
- width = width * height;
- height = 1;
- if (width < 256) {
- width = 256;
- }
- const int kBpp = 1;
- const int kStride = width * kBpp;
- align_buffer_64(src_argb_a, kStride * height + off);
- align_buffer_64(src_argb_b, kStride * height + off);
- align_buffer_64(src_argb_alpha, kStride * height + off);
- align_buffer_64(dst_argb_c, kStride * height + off);
- align_buffer_64(dst_argb_opt, kStride * height + off);
- memset(dst_argb_c, 255, kStride * height + off);
- memset(dst_argb_opt, 255, kStride * height + off);
-
- if (has_ssse3) {
- // Test source is maintained exactly if alpha is 255.
- for (int i = 0; i < 256; ++i) {
- src_argb_a[i + off] = i;
- src_argb_b[i + off] = 255 - i;
- src_argb_alpha[i + off] = 255;
- }
- BlendPlaneRow_SSSE3(src_argb_a + off,
- src_argb_b + off,
- src_argb_alpha + off,
- dst_argb_opt + off,
- 256);
- for (int i = 0; i < 256; ++i) {
- EXPECT_EQ(src_argb_a[i + off], dst_argb_opt[i + off]);
- }
- // Test destination is maintained exactly if alpha is 0.
- for (int i = 0; i < 256; ++i) {
- src_argb_a[i + off] = i;
- src_argb_b[i + off] = 255 - i;
- src_argb_alpha[i + off] = 0;
- }
- BlendPlaneRow_SSSE3(src_argb_a + off,
- src_argb_b + off,
- src_argb_alpha + off,
- dst_argb_opt + off,
- 256);
- for (int i = 0; i < 256; ++i) {
- EXPECT_EQ(src_argb_b[i + off], dst_argb_opt[i + off]);
- }
- }
- for (int i = 0; i < kStride * height; ++i) {
- src_argb_a[i + off] = (fastrand() & 0xff);
- src_argb_b[i + off] = (fastrand() & 0xff);
- src_argb_alpha[i + off] = (fastrand() & 0xff);
- }
-
- BlendPlaneRow_C(src_argb_a + off,
- src_argb_b + off,
- src_argb_alpha + off,
- dst_argb_c + off,
- width * height);
- for (int i = 0; i < benchmark_iterations; ++i) {
- if (has_avx2) {
- BlendPlaneRow_AVX2(src_argb_a + off,
- src_argb_b + off,
- src_argb_alpha + off,
- dst_argb_opt + off,
- width * height);
- } else {
- if (has_ssse3) {
- BlendPlaneRow_SSSE3(src_argb_a + off,
- src_argb_b + off,
- src_argb_alpha + off,
- dst_argb_opt + off,
- width * height);
- } else {
- BlendPlaneRow_C(src_argb_a + off,
- src_argb_b + off,
- src_argb_alpha + off,
- dst_argb_opt + off,
- width * height);
- }
- }
- }
- for (int i = 0; i < kStride * height; ++i) {
- EXPECT_EQ(dst_argb_c[i + off], dst_argb_opt[i + off]);
- }
- free_aligned_buffer_64(src_argb_a);
- free_aligned_buffer_64(src_argb_b);
- free_aligned_buffer_64(src_argb_alpha);
- free_aligned_buffer_64(dst_argb_c);
- free_aligned_buffer_64(dst_argb_opt);
- return;
-}
-
-TEST_F(LibYUVPlanarTest, BlendPlaneRow_Opt) {
- TestBlendPlaneRow(benchmark_width_, benchmark_height_, benchmark_iterations_,
- +1, 0);
-}
-TEST_F(LibYUVPlanarTest, BlendPlaneRow_Unaligned) {
- TestBlendPlaneRow(benchmark_width_, benchmark_height_, benchmark_iterations_,
- +1, 1);
-}
-#endif
-
static void TestBlendPlane(int width, int height, int benchmark_iterations,
int disable_cpu_flags, int benchmark_cpu_info,
int invert, int off) {
« no previous file with comments | « source/row_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698