OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2015 The LibYuv Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 p += 2; \ | 74 p += 2; \ |
75 } \ | 75 } \ |
76 if (benchmark_width_ & 1) { \ | 76 if (benchmark_width_ & 1) { \ |
77 uint8 r = static_cast<uint8>(fastrand()); \ | 77 uint8 r = static_cast<uint8>(fastrand()); \ |
78 p[0] = r; \ | 78 p[0] = r; \ |
79 p[HN] = r; \ | 79 p[HN] = r; \ |
80 p += 1; \ | 80 p += 1; \ |
81 } \ | 81 } \ |
82 p += HN; \ | 82 p += HN; \ |
83 } \ | 83 } \ |
84 \ | 84 if ((benchmark_height_ & 1) && HS == 2) { \ |
| 85 for (int x = 0; x < benchmark_width_ - 1; x += 2) { \ |
| 86 uint8 r = static_cast<uint8>(fastrand()); \ |
| 87 p[0] = r; \ |
| 88 p[1] = r; \ |
| 89 p += 2; \ |
| 90 } \ |
| 91 if (benchmark_width_ & 1) { \ |
| 92 uint8 r = static_cast<uint8>(fastrand()); \ |
| 93 p[0] = r; \ |
| 94 p += 1; \ |
| 95 } \ |
| 96 } \ |
85 /* Start with YUV converted to ARGB. */ \ | 97 /* Start with YUV converted to ARGB. */ \ |
86 YUVTOARGB(orig_y, benchmark_width_, \ | 98 YUVTOARGB(orig_y, benchmark_width_, \ |
87 orig_u, (benchmark_width_ + 1) / 2, \ | 99 orig_u, (benchmark_width_ + 1) / 2, \ |
88 orig_v, (benchmark_width_ + 1) / 2, \ | 100 orig_v, (benchmark_width_ + 1) / 2, \ |
89 orig_pixels, benchmark_width_ * 4, \ | 101 orig_pixels, benchmark_width_ * 4, \ |
90 benchmark_width_, benchmark_height_); \ | 102 benchmark_width_, benchmark_height_); \ |
91 \ | 103 \ |
92 ARGBTOYUV(orig_pixels, benchmark_width_ * 4, \ | 104 ARGBTOYUV(orig_pixels, benchmark_width_ * 4, \ |
93 temp_y, benchmark_width_, \ | 105 temp_y, benchmark_width_, \ |
94 temp_u, (benchmark_width_ + 1) / 2, \ | 106 temp_u, (benchmark_width_ + 1) / 2, \ |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 EXPECT_EQ(r0, r1); | 561 EXPECT_EQ(r0, r1); |
550 EXPECT_EQ(g0, g1); | 562 EXPECT_EQ(g0, g1); |
551 EXPECT_EQ(b0, b1); | 563 EXPECT_EQ(b0, b1); |
552 EXPECT_EQ(r0, r2); | 564 EXPECT_EQ(r0, r2); |
553 EXPECT_EQ(g0, g2); | 565 EXPECT_EQ(g0, g2); |
554 EXPECT_EQ(b0, b2); | 566 EXPECT_EQ(b0, b2); |
555 } | 567 } |
556 } | 568 } |
557 | 569 |
558 } // namespace libyuv | 570 } // namespace libyuv |
OLD | NEW |