Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014 The WebM project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include <cmath> |
| 12 | #include <cstdlib> |
| 13 | #include <string> |
| 14 | |
| 15 | #include "third_party/googletest/src/include/gtest/gtest.h" |
Jingning Han | 097d59c | 2015-07-29 14:51:36 -0700 | [diff] [blame] | 16 | |
| 17 | #include "./vpx_config.h" |
| 18 | #include "./vpx_dsp_rtcd.h" |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 19 | #include "test/acm_random.h" |
| 20 | #include "test/clear_system_state.h" |
| 21 | #include "test/register_state_check.h" |
| 22 | #include "test/util.h" |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 23 | #include "vp9/common/vp9_entropy.h" |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 24 | #include "vp9/common/vp9_loopfilter.h" |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 25 | #include "vpx/vpx_integer.h" |
| 26 | |
| 27 | using libvpx_test::ACMRandom; |
| 28 | |
| 29 | namespace { |
| 30 | // Horizontally and Vertically need 32x32: 8 Coeffs preceeding filtered section |
| 31 | // 16 Coefs within filtered section |
| 32 | // 8 Coeffs following filtered section |
| 33 | const int kNumCoeffs = 1024; |
| 34 | |
| 35 | const int number_of_iterations = 10000; |
| 36 | |
| 37 | #if CONFIG_VP9_HIGHBITDEPTH |
| 38 | typedef void (*loop_op_t)(uint16_t *s, int p, const uint8_t *blimit, |
| 39 | const uint8_t *limit, const uint8_t *thresh, |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 40 | int bd); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 41 | typedef void (*dual_loop_op_t)(uint16_t *s, int p, const uint8_t *blimit0, |
| 42 | const uint8_t *limit0, const uint8_t *thresh0, |
| 43 | const uint8_t *blimit1, const uint8_t *limit1, |
| 44 | const uint8_t *thresh1, int bd); |
| 45 | #else |
| 46 | typedef void (*loop_op_t)(uint8_t *s, int p, const uint8_t *blimit, |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 47 | const uint8_t *limit, const uint8_t *thresh); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 48 | typedef void (*dual_loop_op_t)(uint8_t *s, int p, const uint8_t *blimit0, |
| 49 | const uint8_t *limit0, const uint8_t *thresh0, |
| 50 | const uint8_t *blimit1, const uint8_t *limit1, |
| 51 | const uint8_t *thresh1); |
| 52 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 53 | |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 54 | typedef std::tr1::tuple<loop_op_t, loop_op_t, int> loop8_param_t; |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 55 | typedef std::tr1::tuple<dual_loop_op_t, dual_loop_op_t, int> dualloop8_param_t; |
| 56 | |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 57 | class Loop8Test6Param : public ::testing::TestWithParam<loop8_param_t> { |
| 58 | public: |
| 59 | virtual ~Loop8Test6Param() {} |
| 60 | virtual void SetUp() { |
| 61 | loopfilter_op_ = GET_PARAM(0); |
| 62 | ref_loopfilter_op_ = GET_PARAM(1); |
| 63 | bit_depth_ = GET_PARAM(2); |
| 64 | mask_ = (1 << bit_depth_) - 1; |
| 65 | } |
| 66 | |
| 67 | virtual void TearDown() { libvpx_test::ClearSystemState(); } |
| 68 | |
| 69 | protected: |
| 70 | int bit_depth_; |
| 71 | int mask_; |
| 72 | loop_op_t loopfilter_op_; |
| 73 | loop_op_t ref_loopfilter_op_; |
| 74 | }; |
| 75 | |
| 76 | class Loop8Test9Param : public ::testing::TestWithParam<dualloop8_param_t> { |
| 77 | public: |
| 78 | virtual ~Loop8Test9Param() {} |
| 79 | virtual void SetUp() { |
| 80 | loopfilter_op_ = GET_PARAM(0); |
| 81 | ref_loopfilter_op_ = GET_PARAM(1); |
| 82 | bit_depth_ = GET_PARAM(2); |
| 83 | mask_ = (1 << bit_depth_) - 1; |
| 84 | } |
| 85 | |
| 86 | virtual void TearDown() { libvpx_test::ClearSystemState(); } |
| 87 | |
| 88 | protected: |
| 89 | int bit_depth_; |
| 90 | int mask_; |
| 91 | dual_loop_op_t loopfilter_op_; |
| 92 | dual_loop_op_t ref_loopfilter_op_; |
| 93 | }; |
| 94 | |
| 95 | TEST_P(Loop8Test6Param, OperationCheck) { |
| 96 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 97 | const int count_test_block = number_of_iterations; |
| 98 | #if CONFIG_VP9_HIGHBITDEPTH |
| 99 | int32_t bd = bit_depth_; |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 100 | DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); |
| 101 | DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 102 | #else |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 103 | DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); |
| 104 | DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 105 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 106 | int err_count_total = 0; |
| 107 | int first_failure = -1; |
| 108 | for (int i = 0; i < count_test_block; ++i) { |
| 109 | int err_count = 0; |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 110 | uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 111 | DECLARE_ALIGNED(16, const uint8_t, blimit[16]) = { |
| 112 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 113 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 114 | }; |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 115 | tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 116 | DECLARE_ALIGNED(16, const uint8_t, limit[16]) = { |
| 117 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 118 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 119 | }; |
| 120 | tmp = rnd.Rand8(); |
| 121 | DECLARE_ALIGNED(16, const uint8_t, thresh[16]) = { |
| 122 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 123 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 124 | }; |
| 125 | int32_t p = kNumCoeffs/32; |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 126 | |
| 127 | uint16_t tmp_s[kNumCoeffs]; |
| 128 | int j = 0; |
| 129 | while (j < kNumCoeffs) { |
| 130 | uint8_t val = rnd.Rand8(); |
| 131 | if (val & 0x80) { // 50% chance to choose a new value. |
| 132 | tmp_s[j] = rnd.Rand16(); |
| 133 | j++; |
| 134 | } else { // 50% chance to repeat previous value in row X times |
| 135 | int k = 0; |
| 136 | while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) { |
| 137 | if (j < 1) { |
| 138 | tmp_s[j] = rnd.Rand16(); |
| 139 | } else if (val & 0x20) { // Increment by an value within the limit |
| 140 | tmp_s[j] = (tmp_s[j - 1] + (*limit - 1)); |
| 141 | } else { // Decrement by an value within the limit |
| 142 | tmp_s[j] = (tmp_s[j - 1] - (*limit - 1)); |
| 143 | } |
| 144 | j++; |
| 145 | } |
| 146 | } |
| 147 | } |
| 148 | for (j = 0; j < kNumCoeffs; j++) { |
| 149 | if (i % 2) { |
| 150 | s[j] = tmp_s[j] & mask_; |
| 151 | } else { |
| 152 | s[j] = tmp_s[p * (j % p) + j / p] & mask_; |
| 153 | } |
| 154 | ref_s[j] = s[j]; |
| 155 | } |
| 156 | #if CONFIG_VP9_HIGHBITDEPTH |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 157 | ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bd); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 158 | ASM_REGISTER_STATE_CHECK( |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 159 | loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bd)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 160 | #else |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 161 | ref_loopfilter_op_(ref_s+8+p*8, p, blimit, limit, thresh); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 162 | ASM_REGISTER_STATE_CHECK( |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 163 | loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 164 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 165 | |
| 166 | for (int j = 0; j < kNumCoeffs; ++j) { |
| 167 | err_count += ref_s[j] != s[j]; |
| 168 | } |
| 169 | if (err_count && !err_count_total) { |
| 170 | first_failure = i; |
| 171 | } |
| 172 | err_count_total += err_count; |
| 173 | } |
| 174 | EXPECT_EQ(0, err_count_total) |
| 175 | << "Error: Loop8Test6Param, C output doesn't match SSE2 " |
| 176 | "loopfilter output. " |
| 177 | << "First failed at test case " << first_failure; |
| 178 | } |
| 179 | |
| 180 | TEST_P(Loop8Test6Param, ValueCheck) { |
| 181 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 182 | const int count_test_block = number_of_iterations; |
| 183 | #if CONFIG_VP9_HIGHBITDEPTH |
| 184 | const int32_t bd = bit_depth_; |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 185 | DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); |
| 186 | DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 187 | #else |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 188 | DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); |
| 189 | DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 190 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 191 | int err_count_total = 0; |
| 192 | int first_failure = -1; |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 193 | |
| 194 | // NOTE: The code in vp9_loopfilter.c:update_sharpness computes mblim as a |
| 195 | // function of sharpness_lvl and the loopfilter lvl as: |
| 196 | // block_inside_limit = lvl >> ((sharpness_lvl > 0) + (sharpness_lvl > 4)); |
| 197 | // ... |
James Zern | f58011a | 2015-04-23 20:47:40 -0700 | [diff] [blame] | 198 | // memset(lfi->lfthr[lvl].mblim, (2 * (lvl + 2) + block_inside_limit), |
| 199 | // SIMD_WIDTH); |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 200 | // This means that the largest value for mblim will occur when sharpness_lvl |
| 201 | // is equal to 0, and lvl is equal to its greatest value (MAX_LOOP_FILTER). |
| 202 | // In this case block_inside_limit will be equal to MAX_LOOP_FILTER and |
| 203 | // therefore mblim will be equal to (2 * (lvl + 2) + block_inside_limit) = |
| 204 | // 2 * (MAX_LOOP_FILTER + 2) + MAX_LOOP_FILTER = 3 * MAX_LOOP_FILTER + 4 |
| 205 | |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 206 | for (int i = 0; i < count_test_block; ++i) { |
| 207 | int err_count = 0; |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 208 | uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 209 | DECLARE_ALIGNED(16, const uint8_t, blimit[16]) = { |
| 210 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 211 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 212 | }; |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 213 | tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 214 | DECLARE_ALIGNED(16, const uint8_t, limit[16]) = { |
| 215 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 216 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 217 | }; |
| 218 | tmp = rnd.Rand8(); |
| 219 | DECLARE_ALIGNED(16, const uint8_t, thresh[16]) = { |
| 220 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 221 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 222 | }; |
| 223 | int32_t p = kNumCoeffs / 32; |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 224 | for (int j = 0; j < kNumCoeffs; ++j) { |
| 225 | s[j] = rnd.Rand16() & mask_; |
| 226 | ref_s[j] = s[j]; |
| 227 | } |
| 228 | #if CONFIG_VP9_HIGHBITDEPTH |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 229 | ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bd); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 230 | ASM_REGISTER_STATE_CHECK( |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 231 | loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bd)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 232 | #else |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 233 | ref_loopfilter_op_(ref_s+8+p*8, p, blimit, limit, thresh); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 234 | ASM_REGISTER_STATE_CHECK( |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 235 | loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 236 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 237 | for (int j = 0; j < kNumCoeffs; ++j) { |
| 238 | err_count += ref_s[j] != s[j]; |
| 239 | } |
| 240 | if (err_count && !err_count_total) { |
| 241 | first_failure = i; |
| 242 | } |
| 243 | err_count_total += err_count; |
| 244 | } |
| 245 | EXPECT_EQ(0, err_count_total) |
| 246 | << "Error: Loop8Test6Param, C output doesn't match SSE2 " |
| 247 | "loopfilter output. " |
| 248 | << "First failed at test case " << first_failure; |
| 249 | } |
| 250 | |
| 251 | TEST_P(Loop8Test9Param, OperationCheck) { |
| 252 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 253 | const int count_test_block = number_of_iterations; |
| 254 | #if CONFIG_VP9_HIGHBITDEPTH |
| 255 | const int32_t bd = bit_depth_; |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 256 | DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); |
| 257 | DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 258 | #else |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 259 | DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); |
| 260 | DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 261 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 262 | int err_count_total = 0; |
| 263 | int first_failure = -1; |
| 264 | for (int i = 0; i < count_test_block; ++i) { |
| 265 | int err_count = 0; |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 266 | uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 267 | DECLARE_ALIGNED(16, const uint8_t, blimit0[16]) = { |
| 268 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 269 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 270 | }; |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 271 | tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 272 | DECLARE_ALIGNED(16, const uint8_t, limit0[16]) = { |
| 273 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 274 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 275 | }; |
| 276 | tmp = rnd.Rand8(); |
| 277 | DECLARE_ALIGNED(16, const uint8_t, thresh0[16]) = { |
| 278 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 279 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 280 | }; |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 281 | tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 282 | DECLARE_ALIGNED(16, const uint8_t, blimit1[16]) = { |
| 283 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 284 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 285 | }; |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 286 | tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 287 | DECLARE_ALIGNED(16, const uint8_t, limit1[16]) = { |
| 288 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 289 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 290 | }; |
| 291 | tmp = rnd.Rand8(); |
| 292 | DECLARE_ALIGNED(16, const uint8_t, thresh1[16]) = { |
| 293 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 294 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 295 | }; |
| 296 | int32_t p = kNumCoeffs / 32; |
| 297 | uint16_t tmp_s[kNumCoeffs]; |
| 298 | int j = 0; |
| 299 | const uint8_t limit = *limit0 < *limit1 ? *limit0 : *limit1; |
| 300 | while (j < kNumCoeffs) { |
| 301 | uint8_t val = rnd.Rand8(); |
| 302 | if (val & 0x80) { // 50% chance to choose a new value. |
| 303 | tmp_s[j] = rnd.Rand16(); |
| 304 | j++; |
| 305 | } else { // 50% chance to repeat previous value in row X times. |
| 306 | int k = 0; |
| 307 | while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) { |
| 308 | if (j < 1) { |
| 309 | tmp_s[j] = rnd.Rand16(); |
| 310 | } else if (val & 0x20) { // Increment by a value within the limit. |
| 311 | tmp_s[j] = (tmp_s[j - 1] + (limit - 1)); |
| 312 | } else { // Decrement by an value within the limit. |
| 313 | tmp_s[j] = (tmp_s[j - 1] - (limit - 1)); |
| 314 | } |
| 315 | j++; |
| 316 | } |
| 317 | } |
| 318 | } |
| 319 | for (j = 0; j < kNumCoeffs; j++) { |
| 320 | if (i % 2) { |
| 321 | s[j] = tmp_s[j] & mask_; |
| 322 | } else { |
| 323 | s[j] = tmp_s[p * (j % p) + j / p] & mask_; |
| 324 | } |
| 325 | ref_s[j] = s[j]; |
| 326 | } |
| 327 | #if CONFIG_VP9_HIGHBITDEPTH |
| 328 | ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, |
| 329 | blimit1, limit1, thresh1, bd); |
| 330 | ASM_REGISTER_STATE_CHECK( |
| 331 | loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0, |
| 332 | blimit1, limit1, thresh1, bd)); |
| 333 | #else |
| 334 | ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, |
| 335 | blimit1, limit1, thresh1); |
| 336 | ASM_REGISTER_STATE_CHECK( |
| 337 | loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0, |
| 338 | blimit1, limit1, thresh1)); |
| 339 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 340 | for (int j = 0; j < kNumCoeffs; ++j) { |
| 341 | err_count += ref_s[j] != s[j]; |
| 342 | } |
| 343 | if (err_count && !err_count_total) { |
| 344 | first_failure = i; |
| 345 | } |
| 346 | err_count_total += err_count; |
| 347 | } |
| 348 | EXPECT_EQ(0, err_count_total) |
| 349 | << "Error: Loop8Test9Param, C output doesn't match SSE2 " |
| 350 | "loopfilter output. " |
| 351 | << "First failed at test case " << first_failure; |
| 352 | } |
| 353 | |
| 354 | TEST_P(Loop8Test9Param, ValueCheck) { |
| 355 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 356 | const int count_test_block = number_of_iterations; |
| 357 | #if CONFIG_VP9_HIGHBITDEPTH |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 358 | DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); |
| 359 | DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 360 | #else |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 361 | DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); |
| 362 | DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 363 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 364 | int err_count_total = 0; |
| 365 | int first_failure = -1; |
| 366 | for (int i = 0; i < count_test_block; ++i) { |
| 367 | int err_count = 0; |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 368 | uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 369 | DECLARE_ALIGNED(16, const uint8_t, blimit0[16]) = { |
| 370 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 371 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 372 | }; |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 373 | tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 374 | DECLARE_ALIGNED(16, const uint8_t, limit0[16]) = { |
| 375 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 376 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 377 | }; |
| 378 | tmp = rnd.Rand8(); |
| 379 | DECLARE_ALIGNED(16, const uint8_t, thresh0[16]) = { |
| 380 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 381 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 382 | }; |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 383 | tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 384 | DECLARE_ALIGNED(16, const uint8_t, blimit1[16]) = { |
| 385 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 386 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 387 | }; |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 388 | tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER)); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 389 | DECLARE_ALIGNED(16, const uint8_t, limit1[16]) = { |
| 390 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 391 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 392 | }; |
| 393 | tmp = rnd.Rand8(); |
| 394 | DECLARE_ALIGNED(16, const uint8_t, thresh1[16]) = { |
| 395 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, |
| 396 | tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp |
| 397 | }; |
| 398 | int32_t p = kNumCoeffs / 32; // TODO(pdlf) can we have non-square here? |
| 399 | for (int j = 0; j < kNumCoeffs; ++j) { |
| 400 | s[j] = rnd.Rand16() & mask_; |
| 401 | ref_s[j] = s[j]; |
| 402 | } |
| 403 | #if CONFIG_VP9_HIGHBITDEPTH |
| 404 | const int32_t bd = bit_depth_; |
| 405 | ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, |
| 406 | blimit1, limit1, thresh1, bd); |
| 407 | ASM_REGISTER_STATE_CHECK( |
| 408 | loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, |
| 409 | thresh0, blimit1, limit1, thresh1, bd)); |
| 410 | #else |
| 411 | ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, |
| 412 | blimit1, limit1, thresh1); |
| 413 | ASM_REGISTER_STATE_CHECK( |
| 414 | loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0, |
| 415 | blimit1, limit1, thresh1)); |
| 416 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 417 | for (int j = 0; j < kNumCoeffs; ++j) { |
| 418 | err_count += ref_s[j] != s[j]; |
| 419 | } |
| 420 | if (err_count && !err_count_total) { |
| 421 | first_failure = i; |
| 422 | } |
| 423 | err_count_total += err_count; |
| 424 | } |
| 425 | EXPECT_EQ(0, err_count_total) |
| 426 | << "Error: Loop8Test9Param, C output doesn't match SSE2" |
| 427 | "loopfilter output. " |
| 428 | << "First failed at test case " << first_failure; |
| 429 | } |
| 430 | |
| 431 | using std::tr1::make_tuple; |
| 432 | |
James Zern | c3f2c8a | 2016-02-12 20:23:41 -0800 | [diff] [blame] | 433 | #if HAVE_MMX && !CONFIG_VP9_HIGHBITDEPTH |
| 434 | INSTANTIATE_TEST_CASE_P( |
| 435 | MMX, Loop8Test6Param, |
| 436 | ::testing::Values( |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 437 | make_tuple(&vpx_lpf_horizontal_4_mmx, |
| 438 | &vpx_lpf_horizontal_4_c, 8), |
| 439 | make_tuple(&vpx_lpf_vertical_4_mmx, |
| 440 | &vpx_lpf_vertical_4_c, 8))); |
James Zern | c3f2c8a | 2016-02-12 20:23:41 -0800 | [diff] [blame] | 441 | #endif // HAVE_MMX |
| 442 | |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 443 | #if HAVE_SSE2 |
| 444 | #if CONFIG_VP9_HIGHBITDEPTH |
| 445 | INSTANTIATE_TEST_CASE_P( |
Deb Mukherjee | 27dce0f | 2014-11-07 10:19:46 -0800 | [diff] [blame] | 446 | SSE2, Loop8Test6Param, |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 447 | ::testing::Values( |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 448 | make_tuple(&vpx_highbd_lpf_horizontal_4_sse2, |
| 449 | &vpx_highbd_lpf_horizontal_4_c, 8), |
| 450 | make_tuple(&vpx_highbd_lpf_vertical_4_sse2, |
| 451 | &vpx_highbd_lpf_vertical_4_c, 8), |
| 452 | make_tuple(&vpx_highbd_lpf_horizontal_8_sse2, |
| 453 | &vpx_highbd_lpf_horizontal_8_c, 8), |
| 454 | make_tuple(&vpx_highbd_lpf_horizontal_edge_8_sse2, |
| 455 | &vpx_highbd_lpf_horizontal_edge_8_c, 8), |
| 456 | make_tuple(&vpx_highbd_lpf_horizontal_edge_16_sse2, |
| 457 | &vpx_highbd_lpf_horizontal_edge_16_c, 8), |
| 458 | make_tuple(&vpx_highbd_lpf_vertical_8_sse2, |
| 459 | &vpx_highbd_lpf_vertical_8_c, 8), |
| 460 | make_tuple(&vpx_highbd_lpf_vertical_16_sse2, |
| 461 | &vpx_highbd_lpf_vertical_16_c, 8), |
| 462 | make_tuple(&vpx_highbd_lpf_horizontal_4_sse2, |
| 463 | &vpx_highbd_lpf_horizontal_4_c, 10), |
| 464 | make_tuple(&vpx_highbd_lpf_vertical_4_sse2, |
| 465 | &vpx_highbd_lpf_vertical_4_c, 10), |
| 466 | make_tuple(&vpx_highbd_lpf_horizontal_8_sse2, |
| 467 | &vpx_highbd_lpf_horizontal_8_c, 10), |
| 468 | make_tuple(&vpx_highbd_lpf_horizontal_edge_8_sse2, |
| 469 | &vpx_highbd_lpf_horizontal_edge_8_c, 10), |
| 470 | make_tuple(&vpx_highbd_lpf_horizontal_edge_16_sse2, |
| 471 | &vpx_highbd_lpf_horizontal_edge_16_c, 10), |
| 472 | make_tuple(&vpx_highbd_lpf_vertical_8_sse2, |
| 473 | &vpx_highbd_lpf_vertical_8_c, 10), |
| 474 | make_tuple(&vpx_highbd_lpf_vertical_16_sse2, |
| 475 | &vpx_highbd_lpf_vertical_16_c, 10), |
| 476 | make_tuple(&vpx_highbd_lpf_horizontal_4_sse2, |
| 477 | &vpx_highbd_lpf_horizontal_4_c, 12), |
| 478 | make_tuple(&vpx_highbd_lpf_vertical_4_sse2, |
| 479 | &vpx_highbd_lpf_vertical_4_c, 12), |
| 480 | make_tuple(&vpx_highbd_lpf_horizontal_8_sse2, |
| 481 | &vpx_highbd_lpf_horizontal_8_c, 12), |
| 482 | make_tuple(&vpx_highbd_lpf_horizontal_edge_8_sse2, |
| 483 | &vpx_highbd_lpf_horizontal_edge_8_c, 12), |
| 484 | make_tuple(&vpx_highbd_lpf_horizontal_edge_16_sse2, |
| 485 | &vpx_highbd_lpf_horizontal_edge_16_c, 12), |
| 486 | make_tuple(&vpx_highbd_lpf_vertical_8_sse2, |
| 487 | &vpx_highbd_lpf_vertical_8_c, 12), |
| 488 | make_tuple(&vpx_highbd_lpf_vertical_16_sse2, |
| 489 | &vpx_highbd_lpf_vertical_16_c, 12), |
| 490 | make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2, |
| 491 | &vpx_highbd_lpf_vertical_16_dual_c, 8), |
| 492 | make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2, |
| 493 | &vpx_highbd_lpf_vertical_16_dual_c, 10), |
| 494 | make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2, |
| 495 | &vpx_highbd_lpf_vertical_16_dual_c, 12))); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 496 | #else |
| 497 | INSTANTIATE_TEST_CASE_P( |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 498 | SSE2, Loop8Test6Param, |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 499 | ::testing::Values( |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 500 | make_tuple(&vpx_lpf_horizontal_8_sse2, |
| 501 | &vpx_lpf_horizontal_8_c, 8), |
| 502 | make_tuple(&vpx_lpf_horizontal_edge_8_sse2, |
| 503 | &vpx_lpf_horizontal_edge_8_c, 8), |
| 504 | make_tuple(&vpx_lpf_horizontal_edge_16_sse2, |
| 505 | &vpx_lpf_horizontal_edge_16_c, 8), |
| 506 | make_tuple(&vpx_lpf_vertical_8_sse2, |
| 507 | &vpx_lpf_vertical_8_c, 8), |
| 508 | make_tuple(&vpx_lpf_vertical_16_sse2, |
| 509 | &vpx_lpf_vertical_16_c, 8), |
| 510 | make_tuple(&vpx_lpf_vertical_16_dual_sse2, |
| 511 | &vpx_lpf_vertical_16_dual_c, 8))); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 512 | #endif // CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 27dce0f | 2014-11-07 10:19:46 -0800 | [diff] [blame] | 513 | #endif |
| 514 | |
| 515 | #if HAVE_AVX2 && (!CONFIG_VP9_HIGHBITDEPTH) |
| 516 | INSTANTIATE_TEST_CASE_P( |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 517 | AVX2, Loop8Test6Param, |
Deb Mukherjee | 27dce0f | 2014-11-07 10:19:46 -0800 | [diff] [blame] | 518 | ::testing::Values( |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 519 | make_tuple(&vpx_lpf_horizontal_edge_8_avx2, |
| 520 | &vpx_lpf_horizontal_edge_8_c, 8), |
| 521 | make_tuple(&vpx_lpf_horizontal_edge_16_avx2, |
| 522 | &vpx_lpf_horizontal_edge_16_c, 8))); |
Deb Mukherjee | 27dce0f | 2014-11-07 10:19:46 -0800 | [diff] [blame] | 523 | #endif |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 524 | |
| 525 | #if HAVE_SSE2 |
| 526 | #if CONFIG_VP9_HIGHBITDEPTH |
| 527 | INSTANTIATE_TEST_CASE_P( |
Deb Mukherjee | 27dce0f | 2014-11-07 10:19:46 -0800 | [diff] [blame] | 528 | SSE2, Loop8Test9Param, |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 529 | ::testing::Values( |
Jingning Han | 2992739 | 2015-07-17 12:31:53 -0700 | [diff] [blame] | 530 | make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2, |
| 531 | &vpx_highbd_lpf_horizontal_4_dual_c, 8), |
| 532 | make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2, |
| 533 | &vpx_highbd_lpf_horizontal_8_dual_c, 8), |
| 534 | make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2, |
| 535 | &vpx_highbd_lpf_vertical_4_dual_c, 8), |
| 536 | make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2, |
| 537 | &vpx_highbd_lpf_vertical_8_dual_c, 8), |
| 538 | make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2, |
| 539 | &vpx_highbd_lpf_horizontal_4_dual_c, 10), |
| 540 | make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2, |
| 541 | &vpx_highbd_lpf_horizontal_8_dual_c, 10), |
| 542 | make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2, |
| 543 | &vpx_highbd_lpf_vertical_4_dual_c, 10), |
| 544 | make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2, |
| 545 | &vpx_highbd_lpf_vertical_8_dual_c, 10), |
| 546 | make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2, |
| 547 | &vpx_highbd_lpf_horizontal_4_dual_c, 12), |
| 548 | make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2, |
| 549 | &vpx_highbd_lpf_horizontal_8_dual_c, 12), |
| 550 | make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2, |
| 551 | &vpx_highbd_lpf_vertical_4_dual_c, 12), |
| 552 | make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2, |
| 553 | &vpx_highbd_lpf_vertical_8_dual_c, 12))); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 554 | #else |
| 555 | INSTANTIATE_TEST_CASE_P( |
Deb Mukherjee | 072ed17 | 2014-12-03 16:26:48 -0800 | [diff] [blame] | 556 | SSE2, Loop8Test9Param, |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 557 | ::testing::Values( |
Jingning Han | 2992739 | 2015-07-17 12:31:53 -0700 | [diff] [blame] | 558 | make_tuple(&vpx_lpf_horizontal_4_dual_sse2, |
| 559 | &vpx_lpf_horizontal_4_dual_c, 8), |
| 560 | make_tuple(&vpx_lpf_horizontal_8_dual_sse2, |
| 561 | &vpx_lpf_horizontal_8_dual_c, 8), |
| 562 | make_tuple(&vpx_lpf_vertical_4_dual_sse2, |
| 563 | &vpx_lpf_vertical_4_dual_c, 8), |
| 564 | make_tuple(&vpx_lpf_vertical_8_dual_sse2, |
| 565 | &vpx_lpf_vertical_8_dual_c, 8))); |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 566 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 567 | #endif |
levytamar82 | 86175a5 | 2014-10-16 16:56:37 -0700 | [diff] [blame] | 568 | |
Johann | fca0037 | 2015-01-06 14:13:41 -0800 | [diff] [blame] | 569 | #if HAVE_NEON |
| 570 | #if CONFIG_VP9_HIGHBITDEPTH |
| 571 | // No neon high bitdepth functions. |
| 572 | #else |
James Yu | 5b098b1 | 2014-01-21 09:43:29 +0800 | [diff] [blame] | 573 | INSTANTIATE_TEST_CASE_P( |
| 574 | NEON, Loop8Test6Param, |
| 575 | ::testing::Values( |
| 576 | #if HAVE_NEON_ASM |
Johann | fca0037 | 2015-01-06 14:13:41 -0800 | [diff] [blame] | 577 | // Using #if inside the macro is unsupported on MSVS but the tests are not |
| 578 | // currently built for MSVS with ARM and NEON. |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 579 | make_tuple(&vpx_lpf_horizontal_edge_8_neon, |
| 580 | &vpx_lpf_horizontal_edge_8_c, 8), |
| 581 | make_tuple(&vpx_lpf_horizontal_edge_16_neon, |
| 582 | &vpx_lpf_horizontal_edge_16_c, 8), |
| 583 | make_tuple(&vpx_lpf_vertical_16_neon, |
| 584 | &vpx_lpf_vertical_16_c, 8), |
| 585 | make_tuple(&vpx_lpf_vertical_16_dual_neon, |
| 586 | &vpx_lpf_vertical_16_dual_c, 8), |
Jingning Han | 50adfdf | 2015-07-15 19:14:54 -0700 | [diff] [blame] | 587 | #endif // HAVE_NEON_ASM |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 588 | make_tuple(&vpx_lpf_horizontal_8_neon, |
| 589 | &vpx_lpf_horizontal_8_c, 8), |
| 590 | make_tuple(&vpx_lpf_vertical_8_neon, |
| 591 | &vpx_lpf_vertical_8_c, 8), |
| 592 | make_tuple(&vpx_lpf_horizontal_4_neon, |
| 593 | &vpx_lpf_horizontal_4_c, 8), |
| 594 | make_tuple(&vpx_lpf_vertical_4_neon, |
| 595 | &vpx_lpf_vertical_4_c, 8))); |
James Yu | 5b098b1 | 2014-01-21 09:43:29 +0800 | [diff] [blame] | 596 | INSTANTIATE_TEST_CASE_P( |
| 597 | NEON, Loop8Test9Param, |
| 598 | ::testing::Values( |
Johann | 377b668 | 2014-12-19 15:00:04 -0800 | [diff] [blame] | 599 | #if HAVE_NEON_ASM |
Jingning Han | 2992739 | 2015-07-17 12:31:53 -0700 | [diff] [blame] | 600 | make_tuple(&vpx_lpf_horizontal_8_dual_neon, |
| 601 | &vpx_lpf_horizontal_8_dual_c, 8), |
| 602 | make_tuple(&vpx_lpf_vertical_8_dual_neon, |
| 603 | &vpx_lpf_vertical_8_dual_c, 8), |
Johann | 377b668 | 2014-12-19 15:00:04 -0800 | [diff] [blame] | 604 | #endif // HAVE_NEON_ASM |
Jingning Han | 2992739 | 2015-07-17 12:31:53 -0700 | [diff] [blame] | 605 | make_tuple(&vpx_lpf_horizontal_4_dual_neon, |
| 606 | &vpx_lpf_horizontal_4_dual_c, 8), |
| 607 | make_tuple(&vpx_lpf_vertical_4_dual_neon, |
| 608 | &vpx_lpf_vertical_4_dual_c, 8))); |
Johann | fca0037 | 2015-01-06 14:13:41 -0800 | [diff] [blame] | 609 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 610 | #endif // HAVE_NEON |
James Yu | 5b098b1 | 2014-01-21 09:43:29 +0800 | [diff] [blame] | 611 | |
James Zern | 47dee37 | 2016-02-13 10:24:26 -0800 | [diff] [blame] | 612 | #if HAVE_DSPR2 && !CONFIG_VP9_HIGHBITDEPTH |
| 613 | INSTANTIATE_TEST_CASE_P( |
| 614 | DSPR2, Loop8Test6Param, |
| 615 | ::testing::Values( |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 616 | make_tuple(&vpx_lpf_horizontal_4_dspr2, |
| 617 | &vpx_lpf_horizontal_4_c, 8), |
| 618 | make_tuple(&vpx_lpf_horizontal_8_dspr2, |
| 619 | &vpx_lpf_horizontal_8_c, 8), |
| 620 | make_tuple(&vpx_lpf_horizontal_edge_8, |
| 621 | &vpx_lpf_horizontal_edge_8, 8), |
| 622 | make_tuple(&vpx_lpf_horizontal_edge_16, |
| 623 | &vpx_lpf_horizontal_edge_16, 8), |
| 624 | make_tuple(&vpx_lpf_vertical_4_dspr2, |
| 625 | &vpx_lpf_vertical_4_c, 8), |
| 626 | make_tuple(&vpx_lpf_vertical_8_dspr2, |
| 627 | &vpx_lpf_vertical_8_c, 8), |
| 628 | make_tuple(&vpx_lpf_vertical_16_dspr2, |
| 629 | &vpx_lpf_vertical_16_c, 8), |
| 630 | make_tuple(&vpx_lpf_vertical_16_dual_dspr2, |
| 631 | &vpx_lpf_vertical_16_dual_c, 8))); |
James Zern | 47dee37 | 2016-02-13 10:24:26 -0800 | [diff] [blame] | 632 | |
| 633 | INSTANTIATE_TEST_CASE_P( |
| 634 | DSPR2, Loop8Test9Param, |
| 635 | ::testing::Values( |
| 636 | make_tuple(&vpx_lpf_horizontal_4_dual_dspr2, |
| 637 | &vpx_lpf_horizontal_4_dual_c, 8), |
| 638 | make_tuple(&vpx_lpf_horizontal_8_dual_dspr2, |
| 639 | &vpx_lpf_horizontal_8_dual_c, 8), |
| 640 | make_tuple(&vpx_lpf_vertical_4_dual_dspr2, |
| 641 | &vpx_lpf_vertical_4_dual_c, 8), |
| 642 | make_tuple(&vpx_lpf_vertical_8_dual_dspr2, |
| 643 | &vpx_lpf_vertical_8_dual_c, 8))); |
| 644 | #endif // HAVE_DSPR2 && !CONFIG_VP9_HIGHBITDEPTH |
| 645 | |
Parag Salasakar | 914f8f9 | 2015-06-04 11:50:41 +0530 | [diff] [blame] | 646 | #if HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH) |
| 647 | INSTANTIATE_TEST_CASE_P( |
| 648 | MSA, Loop8Test6Param, |
| 649 | ::testing::Values( |
James Zern | 3ea537c | 2016-02-13 11:05:24 -0800 | [diff] [blame] | 650 | make_tuple(&vpx_lpf_horizontal_4_msa, |
| 651 | &vpx_lpf_horizontal_4_c, 8), |
| 652 | make_tuple(&vpx_lpf_horizontal_8_msa, |
| 653 | &vpx_lpf_horizontal_8_c, 8), |
| 654 | make_tuple(&vpx_lpf_horizontal_edge_8_msa, |
| 655 | &vpx_lpf_horizontal_edge_8_c, 8), |
| 656 | make_tuple(&vpx_lpf_horizontal_edge_16_msa, |
| 657 | &vpx_lpf_horizontal_edge_16_c, 8), |
| 658 | make_tuple(&vpx_lpf_vertical_4_msa, |
| 659 | &vpx_lpf_vertical_4_c, 8), |
| 660 | make_tuple(&vpx_lpf_vertical_8_msa, |
| 661 | &vpx_lpf_vertical_8_c, 8), |
| 662 | make_tuple(&vpx_lpf_vertical_16_msa, |
| 663 | &vpx_lpf_vertical_16_c, 8))); |
Parag Salasakar | d43fd99 | 2015-06-05 07:52:40 +0530 | [diff] [blame] | 664 | |
| 665 | INSTANTIATE_TEST_CASE_P( |
| 666 | MSA, Loop8Test9Param, |
| 667 | ::testing::Values( |
Jingning Han | 2992739 | 2015-07-17 12:31:53 -0700 | [diff] [blame] | 668 | make_tuple(&vpx_lpf_horizontal_4_dual_msa, |
| 669 | &vpx_lpf_horizontal_4_dual_c, 8), |
| 670 | make_tuple(&vpx_lpf_horizontal_8_dual_msa, |
| 671 | &vpx_lpf_horizontal_8_dual_c, 8), |
| 672 | make_tuple(&vpx_lpf_vertical_4_dual_msa, |
| 673 | &vpx_lpf_vertical_4_dual_c, 8), |
| 674 | make_tuple(&vpx_lpf_vertical_8_dual_msa, |
| 675 | &vpx_lpf_vertical_8_dual_c, 8))); |
Parag Salasakar | 914f8f9 | 2015-06-04 11:50:41 +0530 | [diff] [blame] | 676 | #endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH) |
| 677 | |
Deb Mukherjee | 931ed51 | 2014-09-17 16:55:05 -0700 | [diff] [blame] | 678 | } // namespace |