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

Side by Side Diff: unit_test/compare_test.cc

Issue 2012603002: BenchmarkARGBDetect_Unaligned fix off by one in unitest (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. 2 * Copyright 2011 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 172 }
173 EXPECT_EQ(0, fourcc); 173 EXPECT_EQ(0, fourcc);
174 174
175 free_aligned_buffer_64(src_a); 175 free_aligned_buffer_64(src_a);
176 } 176 }
177 177
178 TEST_F(LibYUVBaseTest, BenchmarkARGBDetect_Unaligned) { 178 TEST_F(LibYUVBaseTest, BenchmarkARGBDetect_Unaligned) {
179 uint32 fourcc; 179 uint32 fourcc;
180 const int kMaxTest = benchmark_width_ * benchmark_height_ * 4 + 1; 180 const int kMaxTest = benchmark_width_ * benchmark_height_ * 4 + 1;
181 align_buffer_64(src_a, kMaxTest); 181 align_buffer_64(src_a, kMaxTest);
182 for (int i = 0; i < kMaxTest; ++i) { 182 for (int i = 1; i < kMaxTest; ++i) {
183 src_a[i + 1] = 255; 183 src_a[i] = 255;
184 } 184 }
185 185
186 src_a[0 + 1] = 0; 186 src_a[0 + 1] = 0;
187 fourcc = ARGBDetect(src_a + 1, benchmark_width_ * 4, 187 fourcc = ARGBDetect(src_a + 1, benchmark_width_ * 4,
188 benchmark_width_, benchmark_height_); 188 benchmark_width_, benchmark_height_);
189 EXPECT_EQ(libyuv::FOURCC_BGRA, fourcc); 189 EXPECT_EQ(libyuv::FOURCC_BGRA, fourcc);
190 src_a[0 + 1] = 255; 190 src_a[0 + 1] = 255;
191 src_a[3 + 1] = 0; 191 src_a[3 + 1] = 0;
192 fourcc = ARGBDetect(src_a + 1, benchmark_width_ * 4, 192 fourcc = ARGBDetect(src_a + 1, benchmark_width_ * 4,
193 benchmark_width_, benchmark_height_); 193 benchmark_width_, benchmark_height_);
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 505
506 if (kSrcWidth > 8 && kSrcHeight > 8) { 506 if (kSrcWidth > 8 && kSrcHeight > 8) {
507 EXPECT_EQ(opt_err, c_err); 507 EXPECT_EQ(opt_err, c_err);
508 } 508 }
509 509
510 free_aligned_buffer_64(src_a); 510 free_aligned_buffer_64(src_a);
511 free_aligned_buffer_64(src_b); 511 free_aligned_buffer_64(src_b);
512 } 512 }
513 513
514 } // namespace libyuv 514 } // namespace libyuv
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698