fdct4x4_test.cc 17.8 KB
Newer Older
Daniel Kang's avatar
Daniel Kang committed
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

#include "./vp9_rtcd.h"
#include "./vpx_dsp_rtcd.h"
19 20 21 22
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
23
#include "vp9/common/vp9_entropy.h"
24
#include "vpx/vpx_codec.h"
25
#include "vpx/vpx_integer.h"
26
#include "vpx_ports/mem.h"
27

Daniel Kang's avatar
Daniel Kang committed
28
using libvpx_test::ACMRandom;
Daniel Kang's avatar
Daniel Kang committed
29

Daniel Kang's avatar
Daniel Kang committed
30
namespace {
31
const int kNumCoeffs = 16;
32 33 34
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,
35
                        int tx_type);
36
typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
37
                        int tx_type);
38

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

42
void fdct4x4_ref(const int16_t *in, tran_low_t *out, int stride,
43
                 int /*tx_type*/) {
44
  vpx_fdct4x4_c(in, out, stride);
Jingning Han's avatar
Jingning Han committed
45
}
46

47
void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
48
  vp9_fht4x4_c(in, out, stride, tx_type);
Jingning Han's avatar
Jingning Han committed
49 50
}

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

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

void idct4x4_12(const tran_low_t *in, uint8_t *out, int stride) {
62
  vpx_highbd_idct4x4_16_add_c(in, out, stride, 12);
63 64 65
}

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

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

void iwht4x4_10(const tran_low_t *in, uint8_t *out, int stride) {
74
  vpx_highbd_iwht4x4_16_add_c(in, out, stride, 10);
75 76 77
}

void iwht4x4_12(const tran_low_t *in, uint8_t *out, int stride) {
78
  vpx_highbd_iwht4x4_16_add_c(in, out, stride, 12);
79
}
80 81 82

#if HAVE_SSE2
void idct4x4_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
83
  vpx_highbd_idct4x4_16_add_sse2(in, out, stride, 10);
84 85 86
}

void idct4x4_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
87
  vpx_highbd_idct4x4_16_add_sse2(in, out, stride, 12);
88 89 90
}
#endif  // HAVE_SSE2
#endif  // CONFIG_VP9_HIGHBITDEPTH
91

92
class Trans4x4TestBase {
Jingning Han's avatar
Jingning Han committed
93
 public:
94
  virtual ~Trans4x4TestBase() {}
Jingning Han's avatar
Jingning Han committed
95 96

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

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

Alex Converse's avatar
Alex Converse committed
101
  void RunAccuracyCheck(int limit) {
102 103 104 105 106
    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) {
107 108 109 110
      DECLARE_ALIGNED(16, int16_t, test_input_block[kNumCoeffs]);
      DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]);
      DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
      DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
111
#if CONFIG_VP9_HIGHBITDEPTH
112 113
      DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
      DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
114
#endif
115 116 117

      // Initialize a test block with input range [-255, 255].
      for (int j = 0; j < kNumCoeffs; ++j) {
118 119 120 121 122 123 124 125 126 127 128
        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
        }
129 130
      }

131 132
      ASM_REGISTER_STATE_CHECK(RunFwdTxfm(test_input_block,
                                          test_temp_block, pitch_));
133 134 135 136 137 138 139 140
      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
      }
141 142

      for (int j = 0; j < kNumCoeffs; ++j) {
143
#if CONFIG_VP9_HIGHBITDEPTH
144
        const int diff =
145 146
            bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
#else
147
        ASSERT_EQ(VPX_BITS_8, bit_depth_);
148
        const int diff = dst[j] - src[j];
149
#endif
150 151 152 153 154 155
        const uint32_t error = diff * diff;
        if (max_error < error)
          max_error = error;
        total_error += error;
      }
    }
Jingning Han's avatar
Jingning Han committed
156

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

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

166 167 168
  void RunCoeffCheck() {
    ACMRandom rnd(ACMRandom::DeterministicSeed());
    const int count_test_block = 5000;
169 170 171
    DECLARE_ALIGNED(16, int16_t, input_block[kNumCoeffs]);
    DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
    DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]);
172 173

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

      fwd_txfm_ref(input_block, output_ref_block, pitch_, tx_type_);
179
      ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, pitch_));
Daniel Kang's avatar
Daniel Kang committed
180

181 182 183
      // The minimum quant value is 4.
      for (int j = 0; j < kNumCoeffs; ++j)
        EXPECT_EQ(output_block[j], output_ref_block[j]);
Daniel Kang's avatar
Daniel Kang committed
184 185 186
    }
  }

187 188 189
  void RunMemCheck() {
    ACMRandom rnd(ACMRandom::DeterministicSeed());
    const int count_test_block = 5000;
190 191 192
    DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]);
    DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
    DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]);
193 194

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

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

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

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

232
    for (int i = 0; i < count_test_block; ++i) {
233
      // Initialize a test block with input range [-mask_, mask_].
234
      for (int j = 0; j < kNumCoeffs; ++j) {
235 236 237 238 239 240 241 242 243 244 245
        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
        }
246
      }
Daniel Kang's avatar
Daniel Kang committed
247

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

250 251 252 253 254 255 256 257
      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
      }
258 259

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

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

class Trans4x4DCT
    : public Trans4x4TestBase,
283
      public ::testing::TestWithParam<Dct4x4Param> {
284 285 286 287 288 289 290 291 292
 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;
293 294
    bit_depth_ = GET_PARAM(3);
    mask_ = (1 << bit_depth_) - 1;
Daniel Kang's avatar
Daniel Kang committed
295
  }
296 297 298
  virtual void TearDown() { libvpx_test::ClearSystemState(); }

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

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

TEST_P(Trans4x4DCT, AccuracyCheck) {
Alex Converse's avatar
Alex Converse committed
311
  RunAccuracyCheck(1);
Jingning Han's avatar
Jingning Han committed
312
}
Daniel Kang's avatar
Daniel Kang committed
313

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

318 319 320
TEST_P(Trans4x4DCT, MemCheck) {
  RunMemCheck();
}
Daniel Kang's avatar
Daniel Kang committed
321

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

class Trans4x4HT
    : public Trans4x4TestBase,
328
      public ::testing::TestWithParam<Ht4x4Param> {
329 330 331 332 333 334 335 336 337
 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;
338 339
    bit_depth_ = GET_PARAM(3);
    mask_ = (1 << bit_depth_) - 1;
Daniel Kang's avatar
Daniel Kang committed
340
  }
341
  virtual void TearDown() { libvpx_test::ClearSystemState(); }
Daniel Kang's avatar
Daniel Kang committed
342

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

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

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

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

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

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

TEST_P(Trans4x4HT, InvAccuracyCheck) {
Alex Converse's avatar
Alex Converse committed
369
  RunInvAccuracyCheck(1);
Jingning Han's avatar
Jingning Han committed
370
}
Daniel Kang's avatar
Daniel Kang committed
371

Alex Converse's avatar
Alex Converse committed
372 373
class Trans4x4WHT
    : public Trans4x4TestBase,
374
      public ::testing::TestWithParam<Dct4x4Param> {
Alex Converse's avatar
Alex Converse committed
375 376 377 378 379 380 381 382 383
 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;
384 385
    bit_depth_ = GET_PARAM(3);
    mask_ = (1 << bit_depth_) - 1;
Alex Converse's avatar
Alex Converse committed
386 387 388 389
  }
  virtual void TearDown() { libvpx_test::ClearSystemState(); }

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

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

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

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

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

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

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

#if CONFIG_VP9_HIGHBITDEPTH
433 434 435
INSTANTIATE_TEST_CASE_P(
    C, Trans4x4HT,
    ::testing::Values(
436 437 438 439 440 441 442 443
        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),
444 445 446 447 448 449 450 451 452 453 454 455
        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)));
456
#endif  // CONFIG_VP9_HIGHBITDEPTH
457 458 459 460 461

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

472
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
James Zern's avatar
James Zern committed
473 474 475
INSTANTIATE_TEST_CASE_P(
    NEON, Trans4x4DCT,
    ::testing::Values(
476
        make_tuple(&vpx_fdct4x4_c,
477
                   &vpx_idct4x4_16_add_neon, 0, VPX_BITS_8)));
478 479 480
#endif  // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE

#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
James Zern's avatar
James Zern committed
481
INSTANTIATE_TEST_CASE_P(
482
    NEON, Trans4x4HT,
James Zern's avatar
James Zern committed
483
    ::testing::Values(
484 485 486 487
        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)));
488
#endif  // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
James Zern's avatar
James Zern committed
489

490
#if CONFIG_USE_X86INC && HAVE_SSE2 && !CONFIG_EMULATE_HARDWARE
491 492 493
INSTANTIATE_TEST_CASE_P(
    SSE2, Trans4x4WHT,
    ::testing::Values(
494
        make_tuple(&vp9_fwht4x4_sse2, &vpx_iwht4x4_16_add_c, 0, VPX_BITS_8),
495
        make_tuple(&vp9_fwht4x4_c, &vpx_iwht4x4_16_add_sse2, 0, VPX_BITS_8)));
496 497
#endif

498
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
499 500 501
INSTANTIATE_TEST_CASE_P(
    SSE2, Trans4x4DCT,
    ::testing::Values(
502
        make_tuple(&vpx_fdct4x4_sse2,
503
                   &vpx_idct4x4_16_add_sse2, 0, VPX_BITS_8)));
504 505 506
INSTANTIATE_TEST_CASE_P(
    SSE2, Trans4x4HT,
    ::testing::Values(
507 508 509 510
        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)));
511 512 513 514 515 516
#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(
517 518 519 520
        make_tuple(&vpx_highbd_fdct4x4_c,    &idct4x4_10_sse2, 0, VPX_BITS_10),
        make_tuple(&vpx_highbd_fdct4x4_sse2, &idct4x4_10_sse2, 0, VPX_BITS_10),
        make_tuple(&vpx_highbd_fdct4x4_c,    &idct4x4_12_sse2, 0, VPX_BITS_12),
        make_tuple(&vpx_highbd_fdct4x4_sse2, &idct4x4_12_sse2, 0, VPX_BITS_12),
521
        make_tuple(&vpx_fdct4x4_sse2,      &vpx_idct4x4_16_add_c, 0,
522
                   VPX_BITS_8)));
523

524 525 526 527 528 529 530 531
INSTANTIATE_TEST_CASE_P(
    SSE2, Trans4x4HT,
    ::testing::Values(
        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
532

533
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
534 535 536
INSTANTIATE_TEST_CASE_P(
    MSA, Trans4x4DCT,
    ::testing::Values(
537
        make_tuple(&vpx_fdct4x4_msa, &vpx_idct4x4_16_add_msa, 0, VPX_BITS_8)));
538 539 540
INSTANTIATE_TEST_CASE_P(
    MSA, Trans4x4HT,
    ::testing::Values(
541 542 543 544
        make_tuple(&vp9_fht4x4_msa, &vp9_iht4x4_16_add_msa, 0, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_msa, &vp9_iht4x4_16_add_msa, 1, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_msa, &vp9_iht4x4_16_add_msa, 2, VPX_BITS_8),
        make_tuple(&vp9_fht4x4_msa, &vp9_iht4x4_16_add_msa, 3, VPX_BITS_8)));
545
#endif  // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
Daniel Kang's avatar
Daniel Kang committed
546
}  // namespace