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

Unified Diff: cc/resources/video_resource_updater_unittest.cc

Issue 2425423006: libyuv r1629 roll for AVX2 optimized HalfFloatPlane and ExtractAlpha. (Closed)
Patch Set: avoid reading off end of buffer VideoResourceUpdaterTest.MakeHalfFloatTest Created 4 years, 2 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 | « DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/video_resource_updater_unittest.cc
diff --git a/cc/resources/video_resource_updater_unittest.cc b/cc/resources/video_resource_updater_unittest.cc
index 9b9dcfccf9ab60ef7b9df11c429d745bd2b6ce9f..4ebf31d8af390c0d27c71a023f61893fdcc32354 100644
--- a/cc/resources/video_resource_updater_unittest.cc
+++ b/cc/resources/video_resource_updater_unittest.cc
@@ -548,14 +548,17 @@ TEST_F(VideoResourceUpdaterTest, MakeHalfFloatTest) {
// Multiplier to converting integers to 0.0..1.0 range.
double multiplier = 1.0 / (num_values - 1);
+ float expected_precision = 0.f;
for (int i = 0; i < num_values; i++) {
// We expect the result to be within +/- one least-significant bit.
// Within the range we care about, half-floats values and
// their representation both sort in the same order, so we
// can just add one to get the next bigger half-float.
- float expected_precision =
+ if (i < num_values - 1) {
hubbe 2016/10/20 18:55:11 Why is this change needed? It seems it will just u
fbarchard1 2016/10/20 22:57:34 Done. unittest does not need a change.
+ expected_precision =
FromHalfFloat(half_floats[i] + 1) - FromHalfFloat(half_floats[i]);
+ }
EXPECT_NEAR(FromHalfFloat(half_floats[i]), integers[i] * multiplier,
expected_precision)
<< "i = " << i << " bits = " << bits;
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698