lpf_test.cc 33.3 KB
Newer Older
1
/*
Yaowu Xu's avatar
Yaowu Xu committed
2
 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
3
 *
Yaowu Xu's avatar
Yaowu Xu committed
4 5 6 7 8 9 10
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed with this source code in the LICENSE file, you can
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
11 12 13 14 15

#include <cmath>
#include <cstdlib>
#include <string>

16
#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
17

Yaowu Xu's avatar
Yaowu Xu committed
18 19
#include "./aom_config.h"
#include "./aom_dsp_rtcd.h"
20 21 22 23
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
24
#include "av1/common/av1_loopfilter.h"
25
#include "av1/common/entropy.h"
Yaowu Xu's avatar
Yaowu Xu committed
26
#include "aom/aom_integer.h"
27

28
using libaom_test::ACMRandom;
29 30 31 32 33 34 35 36 37

namespace {
// Horizontally and Vertically need 32x32: 8  Coeffs preceeding filtered section
//                                         16 Coefs within filtered section
//                                         8  Coeffs following filtered section
const int kNumCoeffs = 1024;

const int number_of_iterations = 10000;

Yi Luo's avatar
Yi Luo committed
38 39
const int kSpeedTestNum = 500000;

40
#if CONFIG_HIGHBITDEPTH
41 42 43 44
typedef uint16_t Pixel;
#define PIXEL_WIDTH 16

typedef void (*loop_op_t)(Pixel *s, int p, const uint8_t *blimit,
clang-format's avatar
clang-format committed
45
                          const uint8_t *limit, const uint8_t *thresh, int bd);
46
typedef void (*dual_loop_op_t)(Pixel *s, int p, const uint8_t *blimit0,
47 48 49 50
                               const uint8_t *limit0, const uint8_t *thresh0,
                               const uint8_t *blimit1, const uint8_t *limit1,
                               const uint8_t *thresh1, int bd);
#else
51 52 53 54
typedef uint8_t Pixel;
#define PIXEL_WIDTH 8

typedef void (*loop_op_t)(Pixel *s, int p, const uint8_t *blimit,
55
                          const uint8_t *limit, const uint8_t *thresh);
56
typedef void (*dual_loop_op_t)(Pixel *s, int p, const uint8_t *blimit0,
57 58 59
                               const uint8_t *limit0, const uint8_t *thresh0,
                               const uint8_t *blimit1, const uint8_t *limit1,
                               const uint8_t *thresh1);
60
#endif  // CONFIG_HIGHBITDEPTH
61

62
typedef std::tr1::tuple<loop_op_t, loop_op_t, int> loop8_param_t;
63
typedef std::tr1::tuple<dual_loop_op_t, dual_loop_op_t, int> dualloop8_param_t;
64

65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
void InitInput(Pixel *s, Pixel *ref_s, ACMRandom *rnd, const uint8_t limit,
               const int mask, const int32_t p, const int i) {
  uint16_t tmp_s[kNumCoeffs];

  for (int j = 0; j < kNumCoeffs;) {
    const uint8_t val = rnd->Rand8();
    if (val & 0x80) {  // 50% chance to choose a new value.
      tmp_s[j] = rnd->Rand16();
      j++;
    } else {  // 50% chance to repeat previous value in row X times.
      int k = 0;
      while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) {
        if (j < 1) {
          tmp_s[j] = rnd->Rand16();
        } else if (val & 0x20) {  // Increment by a value within the limit.
          tmp_s[j] = tmp_s[j - 1] + (limit - 1);
        } else {  // Decrement by a value within the limit.
          tmp_s[j] = tmp_s[j - 1] - (limit - 1);
        }
        j++;
      }
    }
  }

  for (int j = 0; j < kNumCoeffs;) {
    const uint8_t val = rnd->Rand8();
    if (val & 0x80) {
      j++;
    } else {  // 50% chance to repeat previous value in column X times.
      int k = 0;
      while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) {
        if (j < 1) {
          tmp_s[j] = rnd->Rand16();
        } else if (val & 0x20) {  // Increment by a value within the limit.
          tmp_s[(j % 32) * 32 + j / 32] =
              tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] + (limit - 1);
        } else {  // Decrement by a value within the limit.
          tmp_s[(j % 32) * 32 + j / 32] =
              tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] - (limit - 1);
        }
        j++;
      }
    }
  }

  for (int j = 0; j < kNumCoeffs; j++) {
    if (i % 2) {
      s[j] = tmp_s[j] & mask;
    } else {
      s[j] = tmp_s[p * (j % p) + j / p] & mask;
    }
    ref_s[j] = s[j];
  }
}

120 121 122 123 124 125 126 127 128 129
class Loop8Test6Param : public ::testing::TestWithParam<loop8_param_t> {
 public:
  virtual ~Loop8Test6Param() {}
  virtual void SetUp() {
    loopfilter_op_ = GET_PARAM(0);
    ref_loopfilter_op_ = GET_PARAM(1);
    bit_depth_ = GET_PARAM(2);
    mask_ = (1 << bit_depth_) - 1;
  }

130
  virtual void TearDown() { libaom_test::ClearSystemState(); }
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148

 protected:
  int bit_depth_;
  int mask_;
  loop_op_t loopfilter_op_;
  loop_op_t ref_loopfilter_op_;
};

class Loop8Test9Param : public ::testing::TestWithParam<dualloop8_param_t> {
 public:
  virtual ~Loop8Test9Param() {}
  virtual void SetUp() {
    loopfilter_op_ = GET_PARAM(0);
    ref_loopfilter_op_ = GET_PARAM(1);
    bit_depth_ = GET_PARAM(2);
    mask_ = (1 << bit_depth_) - 1;
  }

149
  virtual void TearDown() { libaom_test::ClearSystemState(); }
150 151 152 153 154 155 156 157 158 159 160

 protected:
  int bit_depth_;
  int mask_;
  dual_loop_op_t loopfilter_op_;
  dual_loop_op_t ref_loopfilter_op_;
};

TEST_P(Loop8Test6Param, OperationCheck) {
  ACMRandom rnd(ACMRandom::DeterministicSeed());
  const int count_test_block = number_of_iterations;
161 162 163
  const int32_t p = kNumCoeffs / 32;
  DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]);
  DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]);
164 165 166 167
  int err_count_total = 0;
  int first_failure = -1;
  for (int i = 0; i < count_test_block; ++i) {
    int err_count = 0;
Deb Mukherjee's avatar
Deb Mukherjee committed
168
    uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
clang-format's avatar
clang-format committed
169 170 171
    DECLARE_ALIGNED(16, const uint8_t,
                    blimit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                    tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
Deb Mukherjee's avatar
Deb Mukherjee committed
172
    tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
clang-format's avatar
clang-format committed
173 174 175
    DECLARE_ALIGNED(16, const uint8_t,
                    limit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                   tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
176
    tmp = rnd.Rand8();
clang-format's avatar
clang-format committed
177 178 179
    DECLARE_ALIGNED(16, const uint8_t,
                    thresh[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                    tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
180
    InitInput(s, ref_s, &rnd, *limit, mask_, p, i);
181
#if CONFIG_HIGHBITDEPTH
182
    ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_);
183
    ASM_REGISTER_STATE_CHECK(
184
        loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_));
185
#else
clang-format's avatar
clang-format committed
186
    ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh);
187
    ASM_REGISTER_STATE_CHECK(
188
        loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh));
189
#endif  // CONFIG_HIGHBITDEPTH
190

191
    for (int j = 0; j < kNumCoeffs; ++j) {
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
      err_count += ref_s[j] != s[j];
    }
    if (err_count && !err_count_total) {
      first_failure = i;
    }
    err_count_total += err_count;
  }
  EXPECT_EQ(0, err_count_total)
      << "Error: Loop8Test6Param, C output doesn't match SSE2 "
         "loopfilter output. "
      << "First failed at test case " << first_failure;
}

TEST_P(Loop8Test6Param, ValueCheck) {
  ACMRandom rnd(ACMRandom::DeterministicSeed());
  const int count_test_block = number_of_iterations;
208 209
  DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]);
  DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]);
210 211
  int err_count_total = 0;
  int first_failure = -1;
Deb Mukherjee's avatar
Deb Mukherjee committed
212

Yaowu Xu's avatar
Yaowu Xu committed
213
  // NOTE: The code in av1_loopfilter.c:update_sharpness computes mblim as a
Deb Mukherjee's avatar
Deb Mukherjee committed
214 215 216
  // function of sharpness_lvl and the loopfilter lvl as:
  // block_inside_limit = lvl >> ((sharpness_lvl > 0) + (sharpness_lvl > 4));
  // ...
James Zern's avatar
James Zern committed
217 218
  // memset(lfi->lfthr[lvl].mblim, (2 * (lvl + 2) + block_inside_limit),
  //        SIMD_WIDTH);
Deb Mukherjee's avatar
Deb Mukherjee committed
219 220 221 222 223 224
  // This means that the largest value for mblim will occur when sharpness_lvl
  // is equal to 0, and lvl is equal to its greatest value (MAX_LOOP_FILTER).
  // In this case block_inside_limit will be equal to MAX_LOOP_FILTER and
  // therefore mblim will be equal to (2 * (lvl + 2) + block_inside_limit) =
  // 2 * (MAX_LOOP_FILTER + 2) + MAX_LOOP_FILTER = 3 * MAX_LOOP_FILTER + 4

225 226
  for (int i = 0; i < count_test_block; ++i) {
    int err_count = 0;
Deb Mukherjee's avatar
Deb Mukherjee committed
227
    uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
clang-format's avatar
clang-format committed
228 229 230
    DECLARE_ALIGNED(16, const uint8_t,
                    blimit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                    tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
Deb Mukherjee's avatar
Deb Mukherjee committed
231
    tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
clang-format's avatar
clang-format committed
232 233 234
    DECLARE_ALIGNED(16, const uint8_t,
                    limit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                   tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
235
    tmp = rnd.Rand8();
clang-format's avatar
clang-format committed
236 237 238
    DECLARE_ALIGNED(16, const uint8_t,
                    thresh[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                    tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
239 240 241 242 243
    int32_t p = kNumCoeffs / 32;
    for (int j = 0; j < kNumCoeffs; ++j) {
      s[j] = rnd.Rand16() & mask_;
      ref_s[j] = s[j];
    }
244
#if CONFIG_HIGHBITDEPTH
245
    ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_);
246
    ASM_REGISTER_STATE_CHECK(
247
        loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_));
248
#else
clang-format's avatar
clang-format committed
249
    ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh);
250
    ASM_REGISTER_STATE_CHECK(
251
        loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh));
252
#endif  // CONFIG_HIGHBITDEPTH
253

254 255 256 257 258 259 260 261 262 263 264 265 266 267
    for (int j = 0; j < kNumCoeffs; ++j) {
      err_count += ref_s[j] != s[j];
    }
    if (err_count && !err_count_total) {
      first_failure = i;
    }
    err_count_total += err_count;
  }
  EXPECT_EQ(0, err_count_total)
      << "Error: Loop8Test6Param, C output doesn't match SSE2 "
         "loopfilter output. "
      << "First failed at test case " << first_failure;
}

Yi Luo's avatar
Yi Luo committed
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
TEST_P(Loop8Test6Param, DISABLED_Speed) {
  ACMRandom rnd(ACMRandom::DeterministicSeed());
  const int count_test_block = kSpeedTestNum;
#if CONFIG_HIGHBITDEPTH
  const int32_t bd = bit_depth_;
  DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]);
#else
  DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]);
#endif  // CONFIG_HIGHBITDEPTH

  uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
  DECLARE_ALIGNED(16, const uint8_t,
                  blimit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                  tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
  tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
  DECLARE_ALIGNED(16, const uint8_t,
                  limit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
  tmp = rnd.Rand8();
  DECLARE_ALIGNED(16, const uint8_t,
                  thresh[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                  tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };

  int32_t p = kNumCoeffs / 32;
  for (int j = 0; j < kNumCoeffs; ++j) {
    s[j] = rnd.Rand16() & mask_;
  }

  for (int i = 0; i < count_test_block; ++i) {
#if CONFIG_HIGHBITDEPTH
    loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bd);
#else
    loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh);
#endif  // CONFIG_HIGHBITDEPTH
  }
}

305 306 307
TEST_P(Loop8Test9Param, OperationCheck) {
  ACMRandom rnd(ACMRandom::DeterministicSeed());
  const int count_test_block = number_of_iterations;
308 309
  DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]);
  DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]);
310 311 312 313
  int err_count_total = 0;
  int first_failure = -1;
  for (int i = 0; i < count_test_block; ++i) {
    int err_count = 0;
Deb Mukherjee's avatar
Deb Mukherjee committed
314
    uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
clang-format's avatar
clang-format committed
315 316 317
    DECLARE_ALIGNED(16, const uint8_t,
                    blimit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                     tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
Deb Mukherjee's avatar
Deb Mukherjee committed
318
    tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
clang-format's avatar
clang-format committed
319 320 321
    DECLARE_ALIGNED(16, const uint8_t,
                    limit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                    tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
322
    tmp = rnd.Rand8();
clang-format's avatar
clang-format committed
323 324 325
    DECLARE_ALIGNED(16, const uint8_t,
                    thresh0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                     tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
Deb Mukherjee's avatar
Deb Mukherjee committed
326
    tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
clang-format's avatar
clang-format committed
327 328 329
    DECLARE_ALIGNED(16, const uint8_t,
                    blimit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                     tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
Deb Mukherjee's avatar
Deb Mukherjee committed
330
    tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
clang-format's avatar
clang-format committed
331 332 333
    DECLARE_ALIGNED(16, const uint8_t,
                    limit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                    tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
334
    tmp = rnd.Rand8();
clang-format's avatar
clang-format committed
335 336 337
    DECLARE_ALIGNED(16, const uint8_t,
                    thresh1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                     tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
338 339
    int32_t p = kNumCoeffs / 32;
    const uint8_t limit = *limit0 < *limit1 ? *limit0 : *limit1;
340
    InitInput(s, ref_s, &rnd, limit, mask_, p, i);
341
#if CONFIG_HIGHBITDEPTH
clang-format's avatar
clang-format committed
342
    ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
343
                       limit1, thresh1, bit_depth_);
clang-format's avatar
clang-format committed
344 345
    ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
                                            thresh0, blimit1, limit1, thresh1,
346
                                            bit_depth_));
347
#else
clang-format's avatar
clang-format committed
348 349 350 351
    ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
                       limit1, thresh1);
    ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
                                            thresh0, blimit1, limit1, thresh1));
352
#endif  // CONFIG_HIGHBITDEPTH
353 354

    for (int j = 0; j < kNumCoeffs; ++j) {
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370
      err_count += ref_s[j] != s[j];
    }
    if (err_count && !err_count_total) {
      first_failure = i;
    }
    err_count_total += err_count;
  }
  EXPECT_EQ(0, err_count_total)
      << "Error: Loop8Test9Param, C output doesn't match SSE2 "
         "loopfilter output. "
      << "First failed at test case " << first_failure;
}

TEST_P(Loop8Test9Param, ValueCheck) {
  ACMRandom rnd(ACMRandom::DeterministicSeed());
  const int count_test_block = number_of_iterations;
371 372
  DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]);
  DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]);
373 374 375 376
  int err_count_total = 0;
  int first_failure = -1;
  for (int i = 0; i < count_test_block; ++i) {
    int err_count = 0;
Deb Mukherjee's avatar
Deb Mukherjee committed
377
    uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
clang-format's avatar
clang-format committed
378 379 380
    DECLARE_ALIGNED(16, const uint8_t,
                    blimit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                     tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
Deb Mukherjee's avatar
Deb Mukherjee committed
381
    tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
clang-format's avatar
clang-format committed
382 383 384
    DECLARE_ALIGNED(16, const uint8_t,
                    limit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                    tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
385
    tmp = rnd.Rand8();
clang-format's avatar
clang-format committed
386 387 388
    DECLARE_ALIGNED(16, const uint8_t,
                    thresh0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                     tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
Deb Mukherjee's avatar
Deb Mukherjee committed
389
    tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
clang-format's avatar
clang-format committed
390 391 392
    DECLARE_ALIGNED(16, const uint8_t,
                    blimit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                     tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
Deb Mukherjee's avatar
Deb Mukherjee committed
393
    tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
clang-format's avatar
clang-format committed
394 395 396
    DECLARE_ALIGNED(16, const uint8_t,
                    limit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                    tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
397
    tmp = rnd.Rand8();
clang-format's avatar
clang-format committed
398 399 400
    DECLARE_ALIGNED(16, const uint8_t,
                    thresh1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                     tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
401 402 403 404 405
    int32_t p = kNumCoeffs / 32;  // TODO(pdlf) can we have non-square here?
    for (int j = 0; j < kNumCoeffs; ++j) {
      s[j] = rnd.Rand16() & mask_;
      ref_s[j] = s[j];
    }
406
#if CONFIG_HIGHBITDEPTH
clang-format's avatar
clang-format committed
407
    ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
408
                       limit1, thresh1, bit_depth_);
clang-format's avatar
clang-format committed
409 410
    ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
                                            thresh0, blimit1, limit1, thresh1,
411
                                            bit_depth_));
412
#else
clang-format's avatar
clang-format committed
413 414 415 416
    ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
                       limit1, thresh1);
    ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
                                            thresh0, blimit1, limit1, thresh1));
417
#endif  // CONFIG_HIGHBITDEPTH
418

419 420 421 422 423 424 425 426 427 428 429 430 431 432
    for (int j = 0; j < kNumCoeffs; ++j) {
      err_count += ref_s[j] != s[j];
    }
    if (err_count && !err_count_total) {
      first_failure = i;
    }
    err_count_total += err_count;
  }
  EXPECT_EQ(0, err_count_total)
      << "Error: Loop8Test9Param, C output doesn't match SSE2"
         "loopfilter output. "
      << "First failed at test case " << first_failure;
}

Yi Luo's avatar
Yi Luo committed
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482
TEST_P(Loop8Test9Param, DISABLED_Speed) {
  ACMRandom rnd(ACMRandom::DeterministicSeed());
  const int count_test_block = kSpeedTestNum;
#if CONFIG_HIGHBITDEPTH
  DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]);
#else
  DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]);
#endif  // CONFIG_HIGHBITDEPTH

  uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
  DECLARE_ALIGNED(16, const uint8_t,
                  blimit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                   tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
  tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
  DECLARE_ALIGNED(16, const uint8_t,
                  limit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                  tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
  tmp = rnd.Rand8();
  DECLARE_ALIGNED(16, const uint8_t,
                  thresh0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                   tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
  tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
  DECLARE_ALIGNED(16, const uint8_t,
                  blimit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                   tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
  tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
  DECLARE_ALIGNED(16, const uint8_t,
                  limit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                  tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
  tmp = rnd.Rand8();
  DECLARE_ALIGNED(16, const uint8_t,
                  thresh1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                   tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
  int32_t p = kNumCoeffs / 32;  // TODO(pdlf) can we have non-square here?
  for (int j = 0; j < kNumCoeffs; ++j) {
    s[j] = rnd.Rand16() & mask_;
  }

  for (int i = 0; i < count_test_block; ++i) {
#if CONFIG_HIGHBITDEPTH
    const int32_t bd = bit_depth_;
    loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, limit1,
                   thresh1, bd);
#else
    loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, limit1,
                   thresh1);
#endif  // CONFIG_HIGHBITDEPTH
  }
}

483 484
using std::tr1::make_tuple;

485
#if HAVE_SSE2
486
#if CONFIG_HIGHBITDEPTH
487 488 489 490 491 492 493

const loop8_param_t kHbdLoop8Test6[] = {
  make_tuple(&aom_highbd_lpf_horizontal_4_sse2, &aom_highbd_lpf_horizontal_4_c,
             8),
  make_tuple(&aom_highbd_lpf_vertical_4_sse2, &aom_highbd_lpf_vertical_4_c, 8),
  make_tuple(&aom_highbd_lpf_horizontal_8_sse2, &aom_highbd_lpf_horizontal_8_c,
             8),
494 495 496
#if !CONFIG_DEBLOCK_13TAP
  // Despite the name the following funcition is doing 15-tap filtering
  // which is changed to 13-tap and not yet implemented in SIMD
497 498
  make_tuple(&aom_highbd_lpf_horizontal_16_sse2,
             &aom_highbd_lpf_horizontal_16_c, 8),
499 500
#endif
#if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
501 502
  make_tuple(&aom_highbd_lpf_horizontal_16_dual_sse2,
             &aom_highbd_lpf_horizontal_16_dual_c, 8),
503
#endif
504
  make_tuple(&aom_highbd_lpf_vertical_8_sse2, &aom_highbd_lpf_vertical_8_c, 8),
505
#if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
506 507
  make_tuple(&aom_highbd_lpf_vertical_16_sse2, &aom_highbd_lpf_vertical_16_c,
             8),
508
#endif
509 510 511 512 513
  make_tuple(&aom_highbd_lpf_horizontal_4_sse2, &aom_highbd_lpf_horizontal_4_c,
             10),
  make_tuple(&aom_highbd_lpf_vertical_4_sse2, &aom_highbd_lpf_vertical_4_c, 10),
  make_tuple(&aom_highbd_lpf_horizontal_8_sse2, &aom_highbd_lpf_horizontal_8_c,
             10),
514 515 516
#if !CONFIG_DEBLOCK_13TAP
  // Despite the name the following funcition is doing 15-tap filtering
  // which is changed to 13-tap and not yet implemented in SIMD
517 518
  make_tuple(&aom_highbd_lpf_horizontal_16_sse2,
             &aom_highbd_lpf_horizontal_16_c, 10),
519 520
#endif
#if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
521 522
  make_tuple(&aom_highbd_lpf_horizontal_16_dual_sse2,
             &aom_highbd_lpf_horizontal_16_dual_c, 10),
523
#endif
524
  make_tuple(&aom_highbd_lpf_vertical_8_sse2, &aom_highbd_lpf_vertical_8_c, 10),
525
#if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
526 527
  make_tuple(&aom_highbd_lpf_vertical_16_sse2, &aom_highbd_lpf_vertical_16_c,
             10),
528
#endif
529 530 531 532 533
  make_tuple(&aom_highbd_lpf_horizontal_4_sse2, &aom_highbd_lpf_horizontal_4_c,
             12),
  make_tuple(&aom_highbd_lpf_vertical_4_sse2, &aom_highbd_lpf_vertical_4_c, 12),
  make_tuple(&aom_highbd_lpf_horizontal_8_sse2, &aom_highbd_lpf_horizontal_8_c,
             12),
534 535 536
#if !CONFIG_DEBLOCK_13TAP
  // Despite the name the following funcition is doing 15-tap filtering
  // which is changed to 13-tap and not yet implemented in SIMD
537 538
  make_tuple(&aom_highbd_lpf_horizontal_16_sse2,
             &aom_highbd_lpf_horizontal_16_c, 12),
539 540
#endif
#if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
541 542
  make_tuple(&aom_highbd_lpf_horizontal_16_dual_sse2,
             &aom_highbd_lpf_horizontal_16_dual_c, 12),
543 544 545 546 547 548 549
  make_tuple(&aom_highbd_lpf_vertical_16_sse2, &aom_highbd_lpf_vertical_16_c,
             12),
  make_tuple(&aom_highbd_lpf_vertical_16_dual_sse2,
             &aom_highbd_lpf_vertical_16_dual_c, 8),
  make_tuple(&aom_highbd_lpf_vertical_16_dual_sse2,
             &aom_highbd_lpf_vertical_16_dual_c, 10),
  make_tuple(&aom_highbd_lpf_vertical_16_dual_sse2,
550 551 552
             &aom_highbd_lpf_vertical_16_dual_c, 12),
#endif
  make_tuple(&aom_highbd_lpf_vertical_8_sse2, &aom_highbd_lpf_vertical_8_c, 12)
553 554 555 556
};

INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test6Param,
                        ::testing::ValuesIn(kHbdLoop8Test6));
557
#else
558 559 560
const loop8_param_t kLoop8Test6[] = {
  make_tuple(&aom_lpf_horizontal_4_sse2, &aom_lpf_horizontal_4_c, 8),
  make_tuple(&aom_lpf_horizontal_8_sse2, &aom_lpf_horizontal_8_c, 8),
561 562 563
#if !CONFIG_DEBLOCK_13TAP
  // Despite the name the following funcition is doing 15-tap filtering
  // which is changed to 13-tap and not yet implemented in SIMD
James Zern's avatar
James Zern committed
564
  make_tuple(&aom_lpf_horizontal_16_sse2, &aom_lpf_horizontal_16_c, 8),
565 566
#endif
#if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
James Zern's avatar
James Zern committed
567
  make_tuple(&aom_lpf_horizontal_16_dual_sse2, &aom_lpf_horizontal_16_dual_c,
568
             8),
569
#endif
570 571
  make_tuple(&aom_lpf_vertical_4_sse2, &aom_lpf_vertical_4_c, 8),
  make_tuple(&aom_lpf_vertical_8_sse2, &aom_lpf_vertical_8_c, 8),
572
#if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
573
  make_tuple(&aom_lpf_vertical_16_sse2, &aom_lpf_vertical_16_c, 8),
574
#endif
575
#if !CONFIG_PARALLEL_DEBLOCKING
576
  make_tuple(&aom_lpf_vertical_16_dual_sse2, &aom_lpf_vertical_16_dual_c, 8)
577
#endif
578 579 580 581
};

INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test6Param,
                        ::testing::ValuesIn(kLoop8Test6));
582 583
#endif  // CONFIG_HIGHBITDEPTH
#endif  // HAVE_SSE2
584

585
#if HAVE_AVX2
Yi Luo's avatar
Yi Luo committed
586 587
#if CONFIG_HIGHBITDEPTH

588
#if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
Yi Luo's avatar
Yi Luo committed
589
const loop8_param_t kHbdLoop8Test6Avx2[] = {
590 591 592 593 594 595
  make_tuple(&aom_highbd_lpf_horizontal_16_dual_avx2,
             &aom_highbd_lpf_horizontal_16_dual_c, 8),
  make_tuple(&aom_highbd_lpf_horizontal_16_dual_avx2,
             &aom_highbd_lpf_horizontal_16_dual_c, 10),
  make_tuple(&aom_highbd_lpf_horizontal_16_dual_avx2,
             &aom_highbd_lpf_horizontal_16_dual_c, 12),
Yi Luo's avatar
Yi Luo committed
596 597 598 599 600 601 602 603 604 605 606 607 608
  make_tuple(&aom_highbd_lpf_vertical_16_dual_avx2,
             &aom_highbd_lpf_vertical_16_dual_c, 8),
  make_tuple(&aom_highbd_lpf_vertical_16_dual_avx2,
             &aom_highbd_lpf_vertical_16_dual_c, 10),
  make_tuple(&aom_highbd_lpf_vertical_16_dual_avx2,
             &aom_highbd_lpf_vertical_16_dual_c, 12)
};

INSTANTIATE_TEST_CASE_P(AVX2, Loop8Test6Param,
                        ::testing::ValuesIn(kHbdLoop8Test6Avx2));

#endif
#endif
609
#endif
Yi Luo's avatar
Yi Luo committed
610

611
#if HAVE_AVX2 && (!CONFIG_HIGHBITDEPTH) && (!CONFIG_PARALLEL_DEBLOCKING)
612 613 614
INSTANTIATE_TEST_CASE_P(AVX2, Loop8Test6Param,
                        ::testing::Values(
#if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
James Zern's avatar
James Zern committed
615 616
                            make_tuple(&aom_lpf_horizontal_16_dual_avx2,
                                       &aom_lpf_horizontal_16_dual_c, 8),
617
#endif
James Zern's avatar
James Zern committed
618 619
                            make_tuple(&aom_lpf_horizontal_16_avx2,
                                       &aom_lpf_horizontal_16_c, 8)));
levytamar82's avatar
levytamar82 committed
620 621
#endif

622
#if HAVE_SSE2
623
#if CONFIG_HIGHBITDEPTH
624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652
const dualloop8_param_t kHbdLoop8Test9[] = {
  make_tuple(&aom_highbd_lpf_horizontal_4_dual_sse2,
             &aom_highbd_lpf_horizontal_4_dual_c, 8),
  make_tuple(&aom_highbd_lpf_horizontal_8_dual_sse2,
             &aom_highbd_lpf_horizontal_8_dual_c, 8),
  make_tuple(&aom_highbd_lpf_vertical_4_dual_sse2,
             &aom_highbd_lpf_vertical_4_dual_c, 8),
  make_tuple(&aom_highbd_lpf_vertical_8_dual_sse2,
             &aom_highbd_lpf_vertical_8_dual_c, 8),
  make_tuple(&aom_highbd_lpf_horizontal_4_dual_sse2,
             &aom_highbd_lpf_horizontal_4_dual_c, 10),
  make_tuple(&aom_highbd_lpf_horizontal_8_dual_sse2,
             &aom_highbd_lpf_horizontal_8_dual_c, 10),
  make_tuple(&aom_highbd_lpf_vertical_4_dual_sse2,
             &aom_highbd_lpf_vertical_4_dual_c, 10),
  make_tuple(&aom_highbd_lpf_vertical_8_dual_sse2,
             &aom_highbd_lpf_vertical_8_dual_c, 10),
  make_tuple(&aom_highbd_lpf_horizontal_4_dual_sse2,
             &aom_highbd_lpf_horizontal_4_dual_c, 12),
  make_tuple(&aom_highbd_lpf_horizontal_8_dual_sse2,
             &aom_highbd_lpf_horizontal_8_dual_c, 12),
  make_tuple(&aom_highbd_lpf_vertical_4_dual_sse2,
             &aom_highbd_lpf_vertical_4_dual_c, 12),
  make_tuple(&aom_highbd_lpf_vertical_8_dual_sse2,
             &aom_highbd_lpf_vertical_8_dual_c, 12)
};

INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test9Param,
                        ::testing::ValuesIn(kHbdLoop8Test9));
653
#else
654
#if !CONFIG_PARALLEL_DEBLOCKING
655 656 657 658 659 660 661 662 663
const dualloop8_param_t kLoop8Test9[] = {
  make_tuple(&aom_lpf_horizontal_4_dual_sse2, &aom_lpf_horizontal_4_dual_c, 8),
  make_tuple(&aom_lpf_horizontal_8_dual_sse2, &aom_lpf_horizontal_8_dual_c, 8),
  make_tuple(&aom_lpf_vertical_4_dual_sse2, &aom_lpf_vertical_4_dual_c, 8),
  make_tuple(&aom_lpf_vertical_8_dual_sse2, &aom_lpf_vertical_8_dual_c, 8)
};

INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test9Param,
                        ::testing::ValuesIn(kLoop8Test9));
664
#endif
665 666
#endif  // CONFIG_HIGHBITDEPTH
#endif  // HAVE_SSE2
levytamar82's avatar
levytamar82 committed
667

668
#if HAVE_AVX2
Yi Luo's avatar
Yi Luo committed
669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701
#if CONFIG_HIGHBITDEPTH
const dualloop8_param_t kHbdLoop8Test9Avx2[] = {
  make_tuple(&aom_highbd_lpf_horizontal_4_dual_avx2,
             &aom_highbd_lpf_horizontal_4_dual_c, 8),
  make_tuple(&aom_highbd_lpf_horizontal_4_dual_avx2,
             &aom_highbd_lpf_horizontal_4_dual_c, 10),
  make_tuple(&aom_highbd_lpf_horizontal_4_dual_avx2,
             &aom_highbd_lpf_horizontal_4_dual_c, 12),
  make_tuple(&aom_highbd_lpf_horizontal_8_dual_avx2,
             &aom_highbd_lpf_horizontal_8_dual_c, 8),
  make_tuple(&aom_highbd_lpf_horizontal_8_dual_avx2,
             &aom_highbd_lpf_horizontal_8_dual_c, 10),
  make_tuple(&aom_highbd_lpf_horizontal_8_dual_avx2,
             &aom_highbd_lpf_horizontal_8_dual_c, 12),
  make_tuple(&aom_highbd_lpf_vertical_4_dual_avx2,
             &aom_highbd_lpf_vertical_4_dual_c, 8),
  make_tuple(&aom_highbd_lpf_vertical_4_dual_avx2,
             &aom_highbd_lpf_vertical_4_dual_c, 10),
  make_tuple(&aom_highbd_lpf_vertical_4_dual_avx2,
             &aom_highbd_lpf_vertical_4_dual_c, 12),
  make_tuple(&aom_highbd_lpf_vertical_8_dual_avx2,
             &aom_highbd_lpf_vertical_8_dual_c, 8),
  make_tuple(&aom_highbd_lpf_vertical_8_dual_avx2,
             &aom_highbd_lpf_vertical_8_dual_c, 10),
  make_tuple(&aom_highbd_lpf_vertical_8_dual_avx2,
             &aom_highbd_lpf_vertical_8_dual_c, 12),
};

INSTANTIATE_TEST_CASE_P(AVX2, Loop8Test9Param,
                        ::testing::ValuesIn(kHbdLoop8Test9Avx2));
#endif
#endif

702
#if HAVE_NEON && (!CONFIG_PARALLEL_DEBLOCKING)
703
#if CONFIG_HIGHBITDEPTH
704 705
// No neon high bitdepth functions.
#else
706 707 708 709
INSTANTIATE_TEST_CASE_P(
    NEON, Loop8Test6Param,
    ::testing::Values(
#if HAVE_NEON_ASM
clang-format's avatar
clang-format committed
710 711 712
        // Using #if inside the macro is unsupported on MSVS but the tests are
        // not
        // currently built for MSVS with ARM and NEON.
James Zern's avatar
James Zern committed
713
        make_tuple(&aom_lpf_horizontal_16_neon, &aom_lpf_horizontal_16_c, 8),
714
#if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
James Zern's avatar
James Zern committed
715 716
        make_tuple(&aom_lpf_horizontal_16_dual_neon,
                   &aom_lpf_horizontal_16_dual_c, 8),
Yaowu Xu's avatar
Yaowu Xu committed
717 718
        make_tuple(&aom_lpf_vertical_16_neon, &aom_lpf_vertical_16_c, 8),
        make_tuple(&aom_lpf_vertical_16_dual_neon, &aom_lpf_vertical_16_dual_c,
clang-format's avatar
clang-format committed
719
                   8),
720
#endif
721
#endif  // HAVE_NEON_ASM
Yaowu Xu's avatar
Yaowu Xu committed
722 723 724 725
        make_tuple(&aom_lpf_horizontal_8_neon, &aom_lpf_horizontal_8_c, 8),
        make_tuple(&aom_lpf_vertical_8_neon, &aom_lpf_vertical_8_c, 8),
        make_tuple(&aom_lpf_horizontal_4_neon, &aom_lpf_horizontal_4_c, 8),
        make_tuple(&aom_lpf_vertical_4_neon, &aom_lpf_vertical_4_c, 8)));
clang-format's avatar
clang-format committed
726 727
INSTANTIATE_TEST_CASE_P(NEON, Loop8Test9Param,
                        ::testing::Values(
Johann's avatar
Johann committed
728
#if HAVE_NEON_ASM
Yaowu Xu's avatar
Yaowu Xu committed
729 730 731 732
                            make_tuple(&aom_lpf_horizontal_8_dual_neon,
                                       &aom_lpf_horizontal_8_dual_c, 8),
                            make_tuple(&aom_lpf_vertical_8_dual_neon,
                                       &aom_lpf_vertical_8_dual_c, 8),
Johann's avatar
Johann committed
733
#endif  // HAVE_NEON_ASM
Yaowu Xu's avatar
Yaowu Xu committed
734 735 736 737
                            make_tuple(&aom_lpf_horizontal_4_dual_neon,
                                       &aom_lpf_horizontal_4_dual_c, 8),
                            make_tuple(&aom_lpf_vertical_4_dual_neon,
                                       &aom_lpf_vertical_4_dual_c, 8)));
738
#endif  // CONFIG_HIGHBITDEPTH
739
#endif  // HAVE_NEON && (!CONFIG_PARALLEL_DEBLOCKING)
740

741
#if HAVE_DSPR2 && !CONFIG_HIGHBITDEPTH && (!CONFIG_PARALLEL_DEBLOCKING)
742 743 744
INSTANTIATE_TEST_CASE_P(
    DSPR2, Loop8Test6Param,
    ::testing::Values(
Yaowu Xu's avatar
Yaowu Xu committed
745 746
        make_tuple(&aom_lpf_horizontal_4_dspr2, &aom_lpf_horizontal_4_c, 8),
        make_tuple(&aom_lpf_horizontal_8_dspr2, &aom_lpf_horizontal_8_c, 8),
James Zern's avatar
James Zern committed
747 748
        make_tuple(&aom_lpf_horizontal_16, &aom_lpf_horizontal_16, 8),
        make_tuple(&aom_lpf_horizontal_16_dual, &aom_lpf_horizontal_16_dual, 8),
Yaowu Xu's avatar
Yaowu Xu committed
749
        make_tuple(&aom_lpf_vertical_4_dspr2, &aom_lpf_vertical_4_c, 8),
750
#if CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
Yaowu Xu's avatar
Yaowu Xu committed
751 752
        make_tuple(&aom_lpf_vertical_16_dspr2, &aom_lpf_vertical_16_c, 8),
        make_tuple(&aom_lpf_vertical_16_dual_dspr2, &aom_lpf_vertical_16_dual_c,
753 754 755
                   8),
#endif
        make_tuple(&aom_lpf_vertical_8_dspr2, &aom_lpf_vertical_8_c, 8)));
756 757 758

INSTANTIATE_TEST_CASE_P(
    DSPR2, Loop8Test9Param,
Yaowu Xu's avatar
Yaowu Xu committed
759 760 761 762 763 764 765 766
    ::testing::Values(make_tuple(&aom_lpf_horizontal_4_dual_dspr2,
                                 &aom_lpf_horizontal_4_dual_c, 8),
                      make_tuple(&aom_lpf_horizontal_8_dual_dspr2,
                                 &aom_lpf_horizontal_8_dual_c, 8),
                      make_tuple(&aom_lpf_vertical_4_dual_dspr2,
                                 &aom_lpf_vertical_4_dual_c, 8),
                      make_tuple(&aom_lpf_vertical_8_dual_dspr2,
                                 &aom_lpf_vertical_8_dual_c, 8)));
767
#endif  // HAVE_DSPR2 && !CONFIG_HIGHBITDEPTH && (!CONFIG_PARALLEL_DEBLOCKING)
Yaowu Xu's avatar
Yaowu Xu committed
768

769
#if HAVE_MSA && (!CONFIG_HIGHBITDEPTH) && (!CONFIG_PARALLEL_DEBLOCKING)
770 771 772
INSTANTIATE_TEST_CASE_P(
    MSA, Loop8Test6Param,
    ::testing::Values(
Yaowu Xu's avatar
Yaowu Xu committed
773 774
        make_tuple(&aom_lpf_horizontal_4_msa, &aom_lpf_horizontal_4_c, 8),
        make_tuple(&aom_lpf_horizontal_8_msa, &aom_lpf_horizontal_8_c, 8),
James Zern's avatar
James Zern committed
775
        make_tuple(&aom_lpf_horizontal_16_msa, &aom_lpf_horizontal_16_c, 8),
776
#if CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
James Zern's avatar
James Zern committed
777 778
        make_tuple(&aom_lpf_horizontal_16_dual_msa,
                   &aom_lpf_horizontal_16_dual_c, 8),
779 780
        make_tuple(&aom_lpf_vertical_16_msa, &aom_lpf_vertical_16_c, 8),
#endif
Yaowu Xu's avatar
Yaowu Xu committed
781
        make_tuple(&aom_lpf_vertical_4_msa, &aom_lpf_vertical_4_c, 8),
782
        make_tuple(&aom_lpf_vertical_8_msa, &aom_lpf_vertical_8_c, 8)));
783 784 785

INSTANTIATE_TEST_CASE_P(
    MSA, Loop8Test9Param,
Yaowu Xu's avatar
Yaowu Xu committed
786 787 788 789 790 791 792 793
    ::testing::Values(make_tuple(&aom_lpf_horizontal_4_dual_msa,
                                 &aom_lpf_horizontal_4_dual_c, 8),
                      make_tuple(&aom_lpf_horizontal_8_dual_msa,
                                 &aom_lpf_horizontal_8_dual_c, 8),
                      make_tuple(&aom_lpf_vertical_4_dual_msa,
                                 &aom_lpf_vertical_4_dual_c, 8),
                      make_tuple(&aom_lpf_vertical_8_dual_msa,
                                 &aom_lpf_vertical_8_dual_c, 8)));
794
#endif  // HAVE_MSA && (!CONFIG_HIGHBITDEPTH) && (!CONFIG_PARALLEL_DEBLOCKING)
795

796
}  // namespace