Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 1 | /* |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 3 | * |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 4 | * This source code is subject to the terms of the BSD 2 Clause License and |
| 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
| 6 | * was not distributed with this source code in the LICENSE file, you can |
| 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open |
| 8 | * Media Patent License 1.0 was not distributed with this source code in the |
| 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
Johann | 123e8a6 | 2017-12-28 14:40:49 -0800 | [diff] [blame] | 10 | */ |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 11 | |
| 12 | #include <cmath> |
| 13 | #include <cstdlib> |
| 14 | #include <string> |
sarahparker | a543df5 | 2018-11-02 16:02:05 -0700 | [diff] [blame] | 15 | #include <tuple> |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 16 | |
Tom Finegan | 7a07ece | 2017-02-07 17:14:05 -0800 | [diff] [blame] | 17 | #include "third_party/googletest/src/googletest/include/gtest/gtest.h" |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 18 | |
Tom Finegan | 60e653d | 2018-05-22 11:34:58 -0700 | [diff] [blame] | 19 | #include "config/aom_config.h" |
Tom Finegan | 44702c8 | 2018-05-22 13:00:39 -0700 | [diff] [blame] | 20 | #include "config/av1_rtcd.h" |
Tom Finegan | 60e653d | 2018-05-22 11:34:58 -0700 | [diff] [blame] | 21 | |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 22 | #include "test/acm_random.h" |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 23 | #include "test/register_state_check.h" |
| 24 | #include "test/util.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 25 | #include "av1/common/entropy.h" |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 26 | #include "aom/aom_codec.h" |
| 27 | #include "aom/aom_integer.h" |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 28 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 29 | using libaom_test::ACMRandom; |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 30 | |
| 31 | namespace { |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 32 | const int kNumIterations = 1000; |
| 33 | |
chiyotsai | 65078e2 | 2021-09-29 10:36:53 -0700 | [diff] [blame] | 34 | using ErrorBlockFunc = int64_t (*)(const tran_low_t *coeff, |
| 35 | const tran_low_t *dqcoeff, |
| 36 | intptr_t block_size, int64_t *ssz, int bps); |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 37 | |
chiyotsai | 65078e2 | 2021-09-29 10:36:53 -0700 | [diff] [blame] | 38 | using ErrorBlockFunc8Bits = int64_t (*)(const tran_low_t *coeff, |
| 39 | const tran_low_t *dqcoeff, |
| 40 | intptr_t block_size, int64_t *ssz); |
Jerome Jiang | 44a8d5c | 2019-07-01 17:21:14 -0700 | [diff] [blame] | 41 | |
chiyotsai | 65078e2 | 2021-09-29 10:36:53 -0700 | [diff] [blame] | 42 | using ErrorBlockLpFunc = int64_t (*)(const int16_t *coeff, |
| 43 | const int16_t *dqcoeff, |
| 44 | intptr_t block_size); |
| 45 | |
| 46 | using ErrorBlockParam = |
| 47 | std::tuple<ErrorBlockFunc, ErrorBlockFunc, aom_bit_depth_t>; |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 48 | |
Jerome Jiang | 44a8d5c | 2019-07-01 17:21:14 -0700 | [diff] [blame] | 49 | template <ErrorBlockFunc8Bits fn> |
| 50 | int64_t BlockError8BitWrapper(const tran_low_t *coeff, |
| 51 | const tran_low_t *dqcoeff, intptr_t block_size, |
| 52 | int64_t *ssz, int bps) { |
| 53 | EXPECT_EQ(bps, 8); |
| 54 | return fn(coeff, dqcoeff, block_size, ssz); |
| 55 | } |
| 56 | |
chiyotsai | 65078e2 | 2021-09-29 10:36:53 -0700 | [diff] [blame] | 57 | template <ErrorBlockLpFunc fn> |
| 58 | int64_t BlockErrorLpWrapper(const tran_low_t *coeff, const tran_low_t *dqcoeff, |
| 59 | intptr_t block_size, int64_t *ssz, int bps) { |
| 60 | EXPECT_EQ(bps, 8); |
| 61 | *ssz = -1; |
| 62 | return fn(reinterpret_cast<const int16_t *>(coeff), |
| 63 | reinterpret_cast<const int16_t *>(dqcoeff), block_size); |
| 64 | } |
| 65 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 66 | class ErrorBlockTest : public ::testing::TestWithParam<ErrorBlockParam> { |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 67 | public: |
| 68 | virtual ~ErrorBlockTest() {} |
| 69 | virtual void SetUp() { |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 70 | error_block_op_ = GET_PARAM(0); |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 71 | ref_error_block_op_ = GET_PARAM(1); |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 72 | bit_depth_ = GET_PARAM(2); |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 73 | } |
| 74 | |
chiyotsai | 6ddbede | 2021-06-30 14:24:15 -0700 | [diff] [blame] | 75 | virtual void TearDown() {} |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 76 | |
| 77 | protected: |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 78 | aom_bit_depth_t bit_depth_; |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 79 | ErrorBlockFunc error_block_op_; |
| 80 | ErrorBlockFunc ref_error_block_op_; |
| 81 | }; |
chiyotsai | 9dfac72 | 2020-07-07 17:43:02 -0700 | [diff] [blame] | 82 | GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ErrorBlockTest); |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 83 | |
| 84 | TEST_P(ErrorBlockTest, OperationCheck) { |
| 85 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 86 | DECLARE_ALIGNED(16, tran_low_t, coeff[4096]); |
| 87 | DECLARE_ALIGNED(16, tran_low_t, dqcoeff[4096]); |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 88 | int err_count_total = 0; |
| 89 | int first_failure = -1; |
| 90 | intptr_t block_size; |
| 91 | int64_t ssz; |
| 92 | int64_t ret; |
| 93 | int64_t ref_ssz; |
| 94 | int64_t ref_ret; |
Geza Lore | aa8f852 | 2015-10-15 18:28:31 +0100 | [diff] [blame] | 95 | const int msb = bit_depth_ + 8 - 1; |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 96 | for (int i = 0; i < kNumIterations; ++i) { |
| 97 | int err_count = 0; |
| 98 | block_size = 16 << (i % 9); // All block sizes from 4x4, 8x4 ..64x64 |
| 99 | for (int j = 0; j < block_size; j++) { |
Geza Lore | aa8f852 | 2015-10-15 18:28:31 +0100 | [diff] [blame] | 100 | // coeff and dqcoeff will always have at least the same sign, and this |
| 101 | // can be used for optimization, so generate test input precisely. |
| 102 | if (rnd(2)) { |
| 103 | // Positive number |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 104 | coeff[j] = rnd(1 << msb); |
Geza Lore | aa8f852 | 2015-10-15 18:28:31 +0100 | [diff] [blame] | 105 | dqcoeff[j] = rnd(1 << msb); |
| 106 | } else { |
| 107 | // Negative number |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 108 | coeff[j] = -rnd(1 << msb); |
Geza Lore | aa8f852 | 2015-10-15 18:28:31 +0100 | [diff] [blame] | 109 | dqcoeff[j] = -rnd(1 << msb); |
| 110 | } |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 111 | } |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 112 | ref_ret = |
| 113 | ref_error_block_op_(coeff, dqcoeff, block_size, &ref_ssz, bit_depth_); |
chiyotsai | ef26106 | 2021-07-01 14:01:45 -0700 | [diff] [blame] | 114 | API_REGISTER_STATE_CHECK( |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 115 | ret = error_block_op_(coeff, dqcoeff, block_size, &ssz, bit_depth_)); |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 116 | err_count += (ref_ret != ret) | (ref_ssz != ssz); |
| 117 | if (err_count && !err_count_total) { |
| 118 | first_failure = i; |
| 119 | } |
| 120 | err_count_total += err_count; |
| 121 | } |
| 122 | EXPECT_EQ(0, err_count_total) |
Geza Lore | aa8f852 | 2015-10-15 18:28:31 +0100 | [diff] [blame] | 123 | << "Error: Error Block Test, C output doesn't match optimized output. " |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 124 | << "First failed at test case " << first_failure; |
| 125 | } |
| 126 | |
| 127 | TEST_P(ErrorBlockTest, ExtremeValues) { |
| 128 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 129 | DECLARE_ALIGNED(16, tran_low_t, coeff[4096]); |
| 130 | DECLARE_ALIGNED(16, tran_low_t, dqcoeff[4096]); |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 131 | int err_count_total = 0; |
| 132 | int first_failure = -1; |
| 133 | intptr_t block_size; |
| 134 | int64_t ssz; |
| 135 | int64_t ret; |
| 136 | int64_t ref_ssz; |
| 137 | int64_t ref_ret; |
Geza Lore | aa8f852 | 2015-10-15 18:28:31 +0100 | [diff] [blame] | 138 | const int msb = bit_depth_ + 8 - 1; |
| 139 | int max_val = ((1 << msb) - 1); |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 140 | for (int i = 0; i < kNumIterations; ++i) { |
| 141 | int err_count = 0; |
Geza Lore | aa8f852 | 2015-10-15 18:28:31 +0100 | [diff] [blame] | 142 | int k = (i / 9) % 9; |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 143 | |
| 144 | // Change the maximum coeff value, to test different bit boundaries |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 145 | if (k == 8 && (i % 9) == 0) { |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 146 | max_val >>= 1; |
| 147 | } |
| 148 | block_size = 16 << (i % 9); // All block sizes from 4x4, 8x4 ..64x64 |
| 149 | for (int j = 0; j < block_size; j++) { |
Geza Lore | aa8f852 | 2015-10-15 18:28:31 +0100 | [diff] [blame] | 150 | if (k < 4) { |
| 151 | // Test at positive maximum values |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 152 | coeff[j] = k % 2 ? max_val : 0; |
Geza Lore | aa8f852 | 2015-10-15 18:28:31 +0100 | [diff] [blame] | 153 | dqcoeff[j] = (k >> 1) % 2 ? max_val : 0; |
| 154 | } else if (k < 8) { |
| 155 | // Test at negative maximum values |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 156 | coeff[j] = k % 2 ? -max_val : 0; |
Geza Lore | aa8f852 | 2015-10-15 18:28:31 +0100 | [diff] [blame] | 157 | dqcoeff[j] = (k >> 1) % 2 ? -max_val : 0; |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 158 | } else { |
Geza Lore | aa8f852 | 2015-10-15 18:28:31 +0100 | [diff] [blame] | 159 | if (rnd(2)) { |
| 160 | // Positive number |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 161 | coeff[j] = rnd(1 << 14); |
Geza Lore | aa8f852 | 2015-10-15 18:28:31 +0100 | [diff] [blame] | 162 | dqcoeff[j] = rnd(1 << 14); |
| 163 | } else { |
| 164 | // Negative number |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 165 | coeff[j] = -rnd(1 << 14); |
Geza Lore | aa8f852 | 2015-10-15 18:28:31 +0100 | [diff] [blame] | 166 | dqcoeff[j] = -rnd(1 << 14); |
| 167 | } |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 168 | } |
| 169 | } |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 170 | ref_ret = |
| 171 | ref_error_block_op_(coeff, dqcoeff, block_size, &ref_ssz, bit_depth_); |
chiyotsai | ef26106 | 2021-07-01 14:01:45 -0700 | [diff] [blame] | 172 | API_REGISTER_STATE_CHECK( |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 173 | ret = error_block_op_(coeff, dqcoeff, block_size, &ssz, bit_depth_)); |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 174 | err_count += (ref_ret != ret) | (ref_ssz != ssz); |
| 175 | if (err_count && !err_count_total) { |
| 176 | first_failure = i; |
| 177 | } |
| 178 | err_count_total += err_count; |
| 179 | } |
| 180 | EXPECT_EQ(0, err_count_total) |
Geza Lore | aa8f852 | 2015-10-15 18:28:31 +0100 | [diff] [blame] | 181 | << "Error: Error Block Test, C output doesn't match optimized output. " |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 182 | << "First failed at test case " << first_failure; |
| 183 | } |
| 184 | |
Aniket Dhok | 3054fcf | 2019-02-12 10:15:23 +0530 | [diff] [blame] | 185 | TEST_P(ErrorBlockTest, DISABLED_Speed) { |
| 186 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 187 | DECLARE_ALIGNED(16, tran_low_t, coeff[4096]); |
| 188 | DECLARE_ALIGNED(16, tran_low_t, dqcoeff[4096]); |
| 189 | intptr_t block_size; |
| 190 | int64_t ssz; |
| 191 | int num_iters = 100000; |
| 192 | int64_t ref_ssz; |
| 193 | int k; |
| 194 | const int msb = bit_depth_ + 8 - 1; |
| 195 | for (int i = 0; i < 9; ++i) { |
| 196 | block_size = 16 << (i % 9); // All block sizes from 4x4, 8x4 ..64x64 |
| 197 | for (k = 0; k < 9; k++) { |
| 198 | for (int j = 0; j < block_size; j++) { |
| 199 | if (k < 5) { |
| 200 | if (rnd(2)) { |
| 201 | // Positive number |
| 202 | coeff[j] = rnd(1 << msb); |
| 203 | dqcoeff[j] = rnd(1 << msb); |
| 204 | } else { |
| 205 | // Negative number |
| 206 | coeff[j] = -rnd(1 << msb); |
| 207 | dqcoeff[j] = -rnd(1 << msb); |
| 208 | } |
| 209 | } else { |
| 210 | if (rnd(2)) { |
| 211 | // Positive number |
| 212 | coeff[j] = rnd(1 << 14); |
| 213 | dqcoeff[j] = rnd(1 << 14); |
| 214 | } else { |
| 215 | // Negative number |
| 216 | coeff[j] = -rnd(1 << 14); |
| 217 | dqcoeff[j] = -rnd(1 << 14); |
| 218 | } |
| 219 | } |
| 220 | } |
| 221 | aom_usec_timer ref_timer, test_timer; |
| 222 | |
| 223 | aom_usec_timer_start(&ref_timer); |
| 224 | for (int i = 0; i < num_iters; ++i) { |
| 225 | ref_error_block_op_(coeff, dqcoeff, block_size, &ref_ssz, bit_depth_); |
| 226 | } |
| 227 | aom_usec_timer_mark(&ref_timer); |
| 228 | const int elapsed_time_c = |
| 229 | static_cast<int>(aom_usec_timer_elapsed(&ref_timer)); |
| 230 | |
| 231 | aom_usec_timer_start(&test_timer); |
| 232 | for (int i = 0; i < num_iters; ++i) { |
| 233 | error_block_op_(coeff, dqcoeff, block_size, &ssz, bit_depth_); |
| 234 | } |
| 235 | aom_usec_timer_mark(&test_timer); |
| 236 | |
| 237 | const int elapsed_time_simd = |
| 238 | static_cast<int>(aom_usec_timer_elapsed(&test_timer)); |
| 239 | |
| 240 | printf( |
| 241 | " c_time=%d \t simd_time=%d \t " |
| 242 | "gain=%d \n", |
| 243 | elapsed_time_c, elapsed_time_simd, |
| 244 | (elapsed_time_c / elapsed_time_simd)); |
| 245 | } |
| 246 | } |
| 247 | } |
| 248 | |
sarahparker | a543df5 | 2018-11-02 16:02:05 -0700 | [diff] [blame] | 249 | using std::make_tuple; |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 250 | |
Jerome Jiang | 58f2feb | 2019-07-22 16:29:51 -0700 | [diff] [blame] | 251 | #if (HAVE_SSE2) |
James Zern | 6e632d3 | 2019-09-20 23:04:52 -0700 | [diff] [blame] | 252 | const ErrorBlockParam kErrorBlockTestParamsSse2[] = { |
Jerome Jiang | 7683ed5 | 2019-09-17 15:10:25 -0700 | [diff] [blame] | 253 | #if CONFIG_AV1_HIGHBITDEPTH |
James Zern | 6e632d3 | 2019-09-20 23:04:52 -0700 | [diff] [blame] | 254 | make_tuple(&av1_highbd_block_error_sse2, &av1_highbd_block_error_c, |
| 255 | AOM_BITS_10), |
| 256 | make_tuple(&av1_highbd_block_error_sse2, &av1_highbd_block_error_c, |
| 257 | AOM_BITS_12), |
| 258 | make_tuple(&av1_highbd_block_error_sse2, &av1_highbd_block_error_c, |
| 259 | AOM_BITS_8), |
Jerome Jiang | 7683ed5 | 2019-09-17 15:10:25 -0700 | [diff] [blame] | 260 | #endif |
James Zern | 6e632d3 | 2019-09-20 23:04:52 -0700 | [diff] [blame] | 261 | make_tuple(&BlockError8BitWrapper<av1_block_error_sse2>, |
chiyotsai | 3f31104 | 2021-09-29 11:50:24 -0700 | [diff] [blame] | 262 | &BlockError8BitWrapper<av1_block_error_c>, AOM_BITS_8), |
| 263 | make_tuple(&BlockErrorLpWrapper<av1_block_error_lp_sse2>, |
| 264 | &BlockErrorLpWrapper<av1_block_error_lp_c>, AOM_BITS_8) |
James Zern | 6e632d3 | 2019-09-20 23:04:52 -0700 | [diff] [blame] | 265 | }; |
| 266 | |
Cheng Chen | 96786fe | 2020-02-14 17:28:25 -0800 | [diff] [blame] | 267 | INSTANTIATE_TEST_SUITE_P(SSE2, ErrorBlockTest, |
| 268 | ::testing::ValuesIn(kErrorBlockTestParamsSse2)); |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 269 | #endif // HAVE_SSE2 |
Aniket Dhok | 3054fcf | 2019-02-12 10:15:23 +0530 | [diff] [blame] | 270 | |
| 271 | #if (HAVE_AVX2) |
James Zern | 6e632d3 | 2019-09-20 23:04:52 -0700 | [diff] [blame] | 272 | const ErrorBlockParam kErrorBlockTestParamsAvx2[] = { |
Jerome Jiang | 7683ed5 | 2019-09-17 15:10:25 -0700 | [diff] [blame] | 273 | #if CONFIG_AV1_HIGHBITDEPTH |
James Zern | 6e632d3 | 2019-09-20 23:04:52 -0700 | [diff] [blame] | 274 | make_tuple(&av1_highbd_block_error_avx2, &av1_highbd_block_error_c, |
| 275 | AOM_BITS_10), |
| 276 | make_tuple(&av1_highbd_block_error_avx2, &av1_highbd_block_error_c, |
| 277 | AOM_BITS_12), |
| 278 | make_tuple(&av1_highbd_block_error_avx2, &av1_highbd_block_error_c, |
| 279 | AOM_BITS_8), |
Jerome Jiang | 7683ed5 | 2019-09-17 15:10:25 -0700 | [diff] [blame] | 280 | #endif |
James Zern | 6e632d3 | 2019-09-20 23:04:52 -0700 | [diff] [blame] | 281 | make_tuple(&BlockError8BitWrapper<av1_block_error_avx2>, |
chiyotsai | 65078e2 | 2021-09-29 10:36:53 -0700 | [diff] [blame] | 282 | &BlockError8BitWrapper<av1_block_error_c>, AOM_BITS_8), |
| 283 | make_tuple(&BlockErrorLpWrapper<av1_block_error_lp_avx2>, |
| 284 | &BlockErrorLpWrapper<av1_block_error_lp_c>, AOM_BITS_8) |
James Zern | 6e632d3 | 2019-09-20 23:04:52 -0700 | [diff] [blame] | 285 | }; |
| 286 | |
Cheng Chen | 96786fe | 2020-02-14 17:28:25 -0800 | [diff] [blame] | 287 | INSTANTIATE_TEST_SUITE_P(AVX2, ErrorBlockTest, |
| 288 | ::testing::ValuesIn(kErrorBlockTestParamsAvx2)); |
Aniket Dhok | 3054fcf | 2019-02-12 10:15:23 +0530 | [diff] [blame] | 289 | #endif // HAVE_AVX2 |
Jerome Jiang | 44a8d5c | 2019-07-01 17:21:14 -0700 | [diff] [blame] | 290 | |
Jerome Jiang | 44a8d5c | 2019-07-01 17:21:14 -0700 | [diff] [blame] | 291 | #if (HAVE_NEON) |
chiyotsai | 65078e2 | 2021-09-29 10:36:53 -0700 | [diff] [blame] | 292 | const ErrorBlockParam kErrorBlockTestParamsNeon[] = { |
| 293 | make_tuple(&BlockError8BitWrapper<av1_block_error_neon>, |
| 294 | &BlockError8BitWrapper<av1_block_error_c>, AOM_BITS_8), |
| 295 | make_tuple(&BlockErrorLpWrapper<av1_block_error_lp_neon>, |
| 296 | &BlockErrorLpWrapper<av1_block_error_lp_c>, AOM_BITS_8) |
| 297 | }; |
| 298 | |
| 299 | INSTANTIATE_TEST_SUITE_P(NEON, ErrorBlockTest, |
| 300 | ::testing::ValuesIn(kErrorBlockTestParamsNeon)); |
Jerome Jiang | 44a8d5c | 2019-07-01 17:21:14 -0700 | [diff] [blame] | 301 | #endif // HAVE_NEON |
Peter de Rivaz | a7b2d09 | 2014-10-16 13:38:46 +0100 | [diff] [blame] | 302 | } // namespace |