fdct4x4_test.cc 17.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 *  Copyright (c) 2012 The WebM project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include <math.h>
#include <stdlib.h>
#include <string.h>

#include "third_party/googletest/src/include/gtest/gtest.h"
16 17 18 19
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
20

Yaowu Xu's avatar
Yaowu Xu committed
21
#include "./vp9_rtcd.h"
22
#include "vp9/common/vp9_entropy.h"
23
#include "vpx/vpx_codec.h"
24 25
#include "vpx/vpx_integer.h"

Daniel Kang's avatar
Daniel Kang committed
26
using libvpx_test::ACMRandom;
27

Daniel Kang's avatar
Daniel Kang committed
28
namespace {
29
const int kNumCoeffs = 16;
30 31 32
typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride);
typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride);
typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
33
                        int tx_type);
34
typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
35
                        int tx_type);
36

37 38
typedef std::tr1::tuple<FdctFunc, IdctFunc, int, vpx_bit_depth_t> Dct4x4Param;
typedef std::tr1::tuple<FhtFunc, IhtFunc, int, vpx_bit_depth_t> Ht4x4Param;
39

40 41
void fdct4x4_ref(const int16_t *in, tran_low_t *out, int stride,
                 int tx_type) {
42
  vp9_fdct4x4_c(in, out, stride);
43
}
44

45
void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
46
  vp9_fht4x4_c(in, out, stride, tx_type);
47 48
}

49 50
void fwht4x4_ref(const int16_t *in, tran_low_t *out, int stride,
                 int tx_type) {
Alex Converse's avatar
Alex Converse committed
51 52 53
  vp9_fwht4x4_c(in, out, stride);
}

54 55
#if CONFIG_VP9_HIGHBITDEPTH
void idct4x4_10(const tran_low_t *in, uint8_t *out, int stride) {
56
  vp9_highbd_idct4x4_16_add_c(in, out, stride, 10);
57 58 59
}

void idct4x4_12(const tran_low_t *in, uint8_t *out, int stride) {
60
  vp9_highbd_idct4x4_16_add_c(in, out, stride, 12);
61 62 63
}

void iht4x4_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
64
  vp9_highbd_iht4x4_16_add_c(in, out, stride, tx_type, 10);
65 66 67
}

void iht4x4_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
68
  vp9_highbd_iht4x4_16_add_c(in, out, stride, tx_type, 12);
69 70 71
}

void iwht4x4_10(const tran_low_t *in, uint8_t *out, int stride) {
72
  vp9_highbd_iwht4x4_16_add_c(in, out, stride, 10);
73 74 75
}

void iwht4x4_12(const tran_low_t *in, uint8_t *out, int stride) {
76
  vp9_highbd_iwht4x4_16_add_c(in, out, stride, 12);
77
}
78 79 80 81 82 83 84 85 86 87 88

#if HAVE_SSE2
void idct4x4_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
  vp9_highbd_idct4x4_16_add_sse2(in, out, stride, 10);
}

void idct4x4_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
  vp9_highbd_idct4x4_16_add_sse2(in, out, stride, 12);
}
#endif  // HAVE_SSE2
#endif  // CONFIG_VP9_HIGHBITDEPTH
89

90
class Trans4x4TestBase {
91
 public:
92
  virtual ~Trans4x4TestBase() {}
93 94

 protected:
95
  virtual void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) = 0;
96

97
  virtual void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) = 0;
98

Alex Converse's avatar
Alex Converse committed
99
  void RunAccuracyCheck(int limit) {
100 101 102 103 104 105
    ACMRandom rnd(ACMRandom::DeterministicSeed());
    uint32_t max_error = 0;
    int64_t total_error = 0;
    const int count_test_block = 10000;
    for (int i = 0; i < count_test_block; ++i) {
      DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, kNumCoeffs);
106
      DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, kNumCoeffs);
107 108
      DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
      DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
109 110 111 112
#if CONFIG_VP9_HIGHBITDEPTH
      DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
      DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
#endif
113 114 115

      // Initialize a test block with input range [-255, 255].
      for (int j = 0; j < kNumCoeffs; ++j) {
116 117 118 119 120 121 122 123 124 125 126
        if (bit_depth_ == VPX_BITS_8) {
          src[j] = rnd.Rand8();
          dst[j] = rnd.Rand8();
          test_input_block[j] = src[j] - dst[j];
#if CONFIG_VP9_HIGHBITDEPTH
        } else {
          src16[j] = rnd.Rand16() & mask_;
          dst16[j] = rnd.Rand16() & mask_;
          test_input_block[j] = src16[j] - dst16[j];
#endif
        }
127 128
      }

129 130
      ASM_REGISTER_STATE_CHECK(RunFwdTxfm(test_input_block,
                                          test_temp_block, pitch_));
131 132 133 134 135 136 137 138
      if (bit_depth_ == VPX_BITS_8) {
        ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
#if CONFIG_VP9_HIGHBITDEPTH
      } else {
        ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block,
                                            CONVERT_TO_BYTEPTR(dst16), pitch_));
#endif
      }
139 140

      for (int j = 0; j < kNumCoeffs; ++j) {
141 142 143 144
#if CONFIG_VP9_HIGHBITDEPTH
        const uint32_t diff =
            bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
#else
145
        const uint32_t diff = dst[j] - src[j];
146
#endif
147 148 149 150 151 152
        const uint32_t error = diff * diff;
        if (max_error < error)
          max_error = error;
        total_error += error;
      }
    }
153

Alex Converse's avatar
Alex Converse committed
154 155 156
    EXPECT_GE(static_cast<uint32_t>(limit), max_error)
        << "Error: 4x4 FHT/IHT has an individual round trip error > "
        << limit;
157

Alex Converse's avatar
Alex Converse committed
158 159 160
    EXPECT_GE(count_test_block * limit, total_error)
        << "Error: 4x4 FHT/IHT has average round trip error > " << limit
        << " per block";
161 162
  }

163 164 165 166
  void RunCoeffCheck() {
    ACMRandom rnd(ACMRandom::DeterministicSeed());
    const int count_test_block = 5000;
    DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
167 168
    DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
    DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
169 170

    for (int i = 0; i < count_test_block; ++i) {
171
      // Initialize a test block with input range [-mask_, mask_].
172
      for (int j = 0; j < kNumCoeffs; ++j)
173
        input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
174 175

      fwd_txfm_ref(input_block, output_ref_block, pitch_, tx_type_);
176
      ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, pitch_));
177

178 179 180
      // The minimum quant value is 4.
      for (int j = 0; j < kNumCoeffs; ++j)
        EXPECT_EQ(output_block[j], output_ref_block[j]);
181 182 183
    }
  }

184 185 186 187 188
  void RunMemCheck() {
    ACMRandom rnd(ACMRandom::DeterministicSeed());
    const int count_test_block = 5000;
    DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
    DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs);
189 190
    DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
    DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
191 192

    for (int i = 0; i < count_test_block; ++i) {
193
      // Initialize a test block with input range [-mask_, mask_].
194
      for (int j = 0; j < kNumCoeffs; ++j) {
195 196
        input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
        input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
197
      }
198
      if (i == 0) {
199
        for (int j = 0; j < kNumCoeffs; ++j)
200
          input_extreme_block[j] = mask_;
201
      } else if (i == 1) {
202
        for (int j = 0; j < kNumCoeffs; ++j)
203
          input_extreme_block[j] = -mask_;
204
      }
205 206

      fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
207 208
      ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_extreme_block,
                                          output_block, pitch_));
209 210 211 212

      // The minimum quant value is 4.
      for (int j = 0; j < kNumCoeffs; ++j) {
        EXPECT_EQ(output_block[j], output_ref_block[j]);
213 214
        EXPECT_GE(4 * DCT_MAX_VALUE << (bit_depth_ - 8), abs(output_block[j]))
            << "Error: 4x4 FDCT has coefficient larger than 4*DCT_MAX_VALUE";
215 216
      }
    }
217 218
  }

Alex Converse's avatar
Alex Converse committed
219
  void RunInvAccuracyCheck(int limit) {
220 221 222
    ACMRandom rnd(ACMRandom::DeterministicSeed());
    const int count_test_block = 1000;
    DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
223
    DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
224 225
    DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
    DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
226 227 228 229
#if CONFIG_VP9_HIGHBITDEPTH
    DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
    DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
#endif
230

231
    for (int i = 0; i < count_test_block; ++i) {
232
      // Initialize a test block with input range [-mask_, mask_].
233
      for (int j = 0; j < kNumCoeffs; ++j) {
234 235 236 237 238 239 240 241 242 243 244
        if (bit_depth_ == VPX_BITS_8) {
          src[j] = rnd.Rand8();
          dst[j] = rnd.Rand8();
          in[j] = src[j] - dst[j];
#if CONFIG_VP9_HIGHBITDEPTH
        } else {
          src16[j] = rnd.Rand16() & mask_;
          dst16[j] = rnd.Rand16() & mask_;
          in[j] = src16[j] - dst16[j];
#endif
        }
245
      }
246

247 248
      fwd_txfm_ref(in, coeff, pitch_, tx_type_);

249 250 251 252 253 254 255 256
      if (bit_depth_ == VPX_BITS_8) {
        ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
#if CONFIG_VP9_HIGHBITDEPTH
      } else {
        ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
                                            pitch_));
#endif
      }
257 258

      for (int j = 0; j < kNumCoeffs; ++j) {
259 260 261 262
#if CONFIG_VP9_HIGHBITDEPTH
        const uint32_t diff =
            bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
#else
263
        const uint32_t diff = dst[j] - src[j];
264
#endif
265
        const uint32_t error = diff * diff;
Alex Converse's avatar
Alex Converse committed
266 267
        EXPECT_GE(static_cast<uint32_t>(limit), error)
            << "Error: 4x4 IDCT has error " << error
268 269
            << " at index " << j;
      }
270 271 272
    }
  }

273 274
  int pitch_;
  int tx_type_;
275
  FhtFunc fwd_txfm_ref;
276 277
  vpx_bit_depth_t bit_depth_;
  int mask_;
278 279 280 281
};

class Trans4x4DCT
    : public Trans4x4TestBase,
282
      public ::testing::TestWithParam<Dct4x4Param> {
283 284 285 286 287 288 289 290 291
 public:
  virtual ~Trans4x4DCT() {}

  virtual void SetUp() {
    fwd_txfm_ = GET_PARAM(0);
    inv_txfm_ = GET_PARAM(1);
    tx_type_  = GET_PARAM(2);
    pitch_    = 4;
    fwd_txfm_ref = fdct4x4_ref;
292 293
    bit_depth_ = GET_PARAM(3);
    mask_ = (1 << bit_depth_) - 1;
294
  }
295 296 297
  virtual void TearDown() { libvpx_test::ClearSystemState(); }

 protected:
298
  void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
299 300
    fwd_txfm_(in, out, stride);
  }
301
  void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
302 303 304
    inv_txfm_(out, dst, stride);
  }

305 306
  FdctFunc fwd_txfm_;
  IdctFunc inv_txfm_;
307 308 309
};

TEST_P(Trans4x4DCT, AccuracyCheck) {
Alex Converse's avatar
Alex Converse committed
310
  RunAccuracyCheck(1);
311
}
312

313 314 315
TEST_P(Trans4x4DCT, CoeffCheck) {
  RunCoeffCheck();
}
316

317 318 319
TEST_P(Trans4x4DCT, MemCheck) {
  RunMemCheck();
}
320

321
TEST_P(Trans4x4DCT, InvAccuracyCheck) {
Alex Converse's avatar
Alex Converse committed
322
  RunInvAccuracyCheck(1);
323 324 325 326
}

class Trans4x4HT
    : public Trans4x4TestBase,
327
      public ::testing::TestWithParam<Ht4x4Param> {
328 329 330 331 332 333 334 335 336
 public:
  virtual ~Trans4x4HT() {}

  virtual void SetUp() {
    fwd_txfm_ = GET_PARAM(0);
    inv_txfm_ = GET_PARAM(1);
    tx_type_  = GET_PARAM(2);
    pitch_    = 4;
    fwd_txfm_ref = fht4x4_ref;
337 338
    bit_depth_ = GET_PARAM(3);
    mask_ = (1 << bit_depth_) - 1;
339
  }
340
  virtual void TearDown() { libvpx_test::ClearSystemState(); }
341

342
 protected:
343
  void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
344 345 346
    fwd_txfm_(in, out, stride, tx_type_);
  }

347
  void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
348 349 350
    inv_txfm_(out, dst, stride, tx_type_);
  }

351 352
  FhtFunc fwd_txfm_;
  IhtFunc inv_txfm_;
353 354 355
};

TEST_P(Trans4x4HT, AccuracyCheck) {
Alex Converse's avatar
Alex Converse committed
356
  RunAccuracyCheck(1);
357 358 359 360 361 362 363 364 365 366 367
}

TEST_P(Trans4x4HT, CoeffCheck) {
  RunCoeffCheck();
}

TEST_P(Trans4x4HT, MemCheck) {
  RunMemCheck();
}

TEST_P(Trans4x4HT, InvAccuracyCheck) {
Alex Converse's avatar
Alex Converse committed
368
  RunInvAccuracyCheck(1);
369
}
370

Alex Converse's avatar
Alex Converse committed
371 372
class Trans4x4WHT
    : public Trans4x4TestBase,
373
      public ::testing::TestWithParam<Dct4x4Param> {
Alex Converse's avatar
Alex Converse committed
374 375 376 377 378 379 380 381 382
 public:
  virtual ~Trans4x4WHT() {}

  virtual void SetUp() {
    fwd_txfm_ = GET_PARAM(0);
    inv_txfm_ = GET_PARAM(1);
    tx_type_  = GET_PARAM(2);
    pitch_    = 4;
    fwd_txfm_ref = fwht4x4_ref;
383 384
    bit_depth_ = GET_PARAM(3);
    mask_ = (1 << bit_depth_) - 1;
Alex Converse's avatar
Alex Converse committed
385 386 387 388
  }
  virtual void TearDown() { libvpx_test::ClearSystemState(); }

 protected:
389
  void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
Alex Converse's avatar
Alex Converse committed
390 391
    fwd_txfm_(in, out, stride);
  }
392
  void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
Alex Converse's avatar
Alex Converse committed
393 394 395
    inv_txfm_(out, dst, stride);
  }

396 397
  FdctFunc fwd_txfm_;
  IdctFunc inv_txfm_;
Alex Converse's avatar
Alex Converse committed
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
};

TEST_P(Trans4x4WHT, AccuracyCheck) {
  RunAccuracyCheck(0);
}

TEST_P(Trans4x4WHT, CoeffCheck) {
  RunCoeffCheck();
}

TEST_P(Trans4x4WHT, MemCheck) {
  RunMemCheck();
}

TEST_P(Trans4x4WHT, InvAccuracyCheck) {
  RunInvAccuracyCheck(0);
}
415 416
using std::tr1::make_tuple;

417
#if CONFIG_VP9_HIGHBITDEPTH
418 419 420
INSTANTIATE_TEST_CASE_P(
    C, Trans4x4DCT,
    ::testing::Values(
421 422
        make_tuple(&vp9_highbd_fdct4x4_c, &idct4x4_10, 0, VPX_BITS_10),
        make_tuple(&vp9_highbd_fdct4x4_c, &idct4x4_12, 0, VPX_BITS_12),
423 424 425 426 427 428
        make_tuple(&vp9_fdct4x4_c, &vp9_idct4x4_16_add_c, 0, VPX_BITS_8)));
#else
INSTANTIATE_TEST_CASE_P(
    C, Trans4x4DCT,
    ::testing::Values(
        make_tuple(&vp9_fdct4x4_c, &vp9_idct4x4_16_add_c, 0, VPX_BITS_8)));
429
#endif  // CONFIG_VP9_HIGHBITDEPTH
430 431

#if CONFIG_VP9_HIGHBITDEPTH
432 433 434
INSTANTIATE_TEST_CASE_P(
    C, Trans4x4HT,
    ::testing::Values(
435 436 437 438 439 440 441 442
        make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_10, 0, VPX_BITS_10),
        make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_10, 1, VPX_BITS_10),
        make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_10, 2, VPX_BITS_10),
        make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_10, 3, VPX_BITS_10),
        make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_12, 0, VPX_BITS_12),
        make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_12, 1, VPX_BITS_12),
        make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_12, 2, VPX_BITS_12),
        make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_12, 3, VPX_BITS_12),
443 444 445 446 447 448 449 450 451 452 453 454
        make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 0, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 1, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 2, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 3, VPX_BITS_8)));
#else
INSTANTIATE_TEST_CASE_P(
    C, Trans4x4HT,
    ::testing::Values(
        make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 0, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 1, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 2, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 3, VPX_BITS_8)));
455
#endif  // CONFIG_VP9_HIGHBITDEPTH
456 457 458 459 460

#if CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(
    C, Trans4x4WHT,
    ::testing::Values(
461 462
        make_tuple(&vp9_highbd_fwht4x4_c, &iwht4x4_10, 0, VPX_BITS_10),
        make_tuple(&vp9_highbd_fwht4x4_c, &iwht4x4_12, 0, VPX_BITS_12),
463 464
        make_tuple(&vp9_fwht4x4_c, &vp9_iwht4x4_16_add_c, 0, VPX_BITS_8)));
#else
Alex Converse's avatar
Alex Converse committed
465 466 467
INSTANTIATE_TEST_CASE_P(
    C, Trans4x4WHT,
    ::testing::Values(
468
        make_tuple(&vp9_fwht4x4_c, &vp9_iwht4x4_16_add_c, 0, VPX_BITS_8)));
469
#endif  // CONFIG_VP9_HIGHBITDEPTH
470

471
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
472 473 474 475
INSTANTIATE_TEST_CASE_P(
    NEON, Trans4x4DCT,
    ::testing::Values(
        make_tuple(&vp9_fdct4x4_c,
476
                   &vp9_idct4x4_16_add_neon, 0, VPX_BITS_8)));
477 478 479
#endif  // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE

#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
480
INSTANTIATE_TEST_CASE_P(
481
    NEON, Trans4x4HT,
482
    ::testing::Values(
483 484 485 486
        make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 0, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 1, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 2, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 3, VPX_BITS_8)));
487
#endif  // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
488

489 490
#if CONFIG_USE_X86INC && HAVE_MMX && !CONFIG_VP9_HIGHBITDEPTH && \
    !CONFIG_EMULATE_HARDWARE
491 492 493
INSTANTIATE_TEST_CASE_P(
    MMX, Trans4x4WHT,
    ::testing::Values(
494
        make_tuple(&vp9_fwht4x4_mmx, &vp9_iwht4x4_16_add_c, 0, VPX_BITS_8)));
495 496
#endif

497
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
498 499 500 501
INSTANTIATE_TEST_CASE_P(
    SSE2, Trans4x4DCT,
    ::testing::Values(
        make_tuple(&vp9_fdct4x4_sse2,
502
                   &vp9_idct4x4_16_add_sse2, 0, VPX_BITS_8)));
503 504 505
INSTANTIATE_TEST_CASE_P(
    SSE2, Trans4x4HT,
    ::testing::Values(
506 507 508 509
        make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 0, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 1, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 2, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 3, VPX_BITS_8)));
510 511 512 513 514 515 516 517 518 519 520 521
#endif  // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE

#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
    SSE2, Trans4x4DCT,
    ::testing::Values(
        make_tuple(&vp9_highbd_fdct4x4_c,    &idct4x4_10_sse2, 0, VPX_BITS_10),
        make_tuple(&vp9_highbd_fdct4x4_sse2, &idct4x4_10_sse2, 0, VPX_BITS_10),
        make_tuple(&vp9_highbd_fdct4x4_c,    &idct4x4_12_sse2, 0, VPX_BITS_12),
        make_tuple(&vp9_highbd_fdct4x4_sse2, &idct4x4_12_sse2, 0, VPX_BITS_12),
        make_tuple(&vp9_fdct4x4_sse2,      &vp9_idct4x4_16_add_c, 0,
                   VPX_BITS_8)));
522

523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538
INSTANTIATE_TEST_CASE_P(
    SSE2, Trans4x4HT,
    ::testing::Values(
        make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_10, 0, VPX_BITS_10),
        make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_10, 1, VPX_BITS_10),
        make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_10, 2, VPX_BITS_10),
        make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_10, 3, VPX_BITS_10),
        make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_12, 0, VPX_BITS_12),
        make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_12, 1, VPX_BITS_12),
        make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_12, 2, VPX_BITS_12),
        make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_12, 3, VPX_BITS_12),
        make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 0, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 1, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 2, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 3, VPX_BITS_8)));
#endif  // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
539
}  // namespace