aboutsummaryrefslogtreecommitdiff
path: root/src/dsp/cdef_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/dsp/cdef_test.cc')
-rw-r--r--src/dsp/cdef_test.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/dsp/cdef_test.cc b/src/dsp/cdef_test.cc
index c25d7df..e2db17a 100644
--- a/src/dsp/cdef_test.cc
+++ b/src/dsp/cdef_test.cc
@@ -79,11 +79,11 @@ class CdefDirectionTest : public testing::TestWithParam<int> {
const char* const test_case = test_info->test_suite_name();
if (absl::StartsWith(test_case, "C/")) {
} else if (absl::StartsWith(test_case, "SSE41/")) {
+ if ((GetCpuInfo() & kSSE4_1) == 0) GTEST_SKIP() << "No SSE4.1 support!";
CdefInit_SSE4_1();
} else if (absl::StartsWith(test_case, "AVX2/")) {
- if ((GetCpuInfo() & kAVX2) != 0) {
- CdefInit_AVX2();
- }
+ if ((GetCpuInfo() & kAVX2) == 0) GTEST_SKIP() << "No AVX2 support!";
+ CdefInit_AVX2();
} else if (absl::StartsWith(test_case, "NEON/")) {
CdefInit_NEON();
} else {
@@ -275,11 +275,11 @@ class CdefFilteringTest : public testing::TestWithParam<CdefTestParam> {
} else if (absl::StartsWith(test_case, "NEON/")) {
CdefInit_NEON();
} else if (absl::StartsWith(test_case, "SSE41/")) {
+ if ((GetCpuInfo() & kSSE4_1) == 0) GTEST_SKIP() << "No SSE4.1 support!";
CdefInit_SSE4_1();
} else if (absl::StartsWith(test_case, "AVX2/")) {
- if ((GetCpuInfo() & kAVX2) != 0) {
- CdefInit_AVX2();
- }
+ if ((GetCpuInfo() & kAVX2) == 0) GTEST_SKIP() << "No AVX2 support!";
+ CdefInit_AVX2();
} else {
FAIL() << "Unrecognized architecture prefix in test case name: "
<< test_case;
@@ -304,7 +304,7 @@ template <int bitdepth, typename Pixel>
void CdefFilteringTest<bitdepth, Pixel>::TestRandomValues(int num_runs) {
const int id = static_cast<int>(param_.rows4x4 < 4) * 3 +
(param_.subsampling_x + param_.subsampling_y) * 6;
- absl::Duration elapsed_time;
+ absl::Duration elapsed_time[kMaxPlanes];
for (int num_tests = 0; num_tests < num_runs; ++num_tests) {
for (int plane = kPlaneY; plane < kMaxPlanes; ++plane) {
const int subsampling_x = (plane == kPlaneY) ? 0 : param_.subsampling_x;
@@ -355,7 +355,7 @@ void CdefFilteringTest<bitdepth, Pixel>::TestRandomValues(int num_runs) {
source_ + offset, kSourceStride, block_height, primary_strength_,
secondary_strength_, damping_, direction_, dest_[plane],
kTestBufferStride * sizeof(dest_[0][0]));
- elapsed_time += absl::Now() - start;
+ elapsed_time[plane] += absl::Now() - start;
}
}
@@ -379,7 +379,7 @@ void CdefFilteringTest<bitdepth, Pixel>::TestRandomValues(int num_runs) {
ASSERT_NE(expected_digest, nullptr);
test_utils::CheckMd5Digest(kCdef, kCdefFilterName, expected_digest,
reinterpret_cast<uint8_t*>(dest_[plane]),
- sizeof(dest_[plane]), elapsed_time);
+ sizeof(dest_[plane]), elapsed_time[plane]);
}
}