fdct4x4_test.cc 15.6 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 19
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
Daniel Kang's avatar
Daniel Kang committed
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;
Daniel Kang's avatar
Daniel Kang committed
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);
Jingning Han's avatar
Jingning Han committed
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);
Jingning Han's avatar
Jingning Han committed
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
}
#endif

80
class Trans4x4TestBase {
Jingning Han's avatar
Jingning Han committed
81
 public:
82
  virtual ~Trans4x4TestBase() {}
Jingning Han's avatar
Jingning Han committed
83 84

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

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

Alex Converse's avatar
Alex Converse committed
89
  void RunAccuracyCheck(int limit) {
90 91 92 93 94 95
    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);
96
      DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, kNumCoeffs);
97 98
      DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
      DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
99 100 101 102
#if CONFIG_VP9_HIGHBITDEPTH
      DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
      DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
#endif
103 104 105

      // Initialize a test block with input range [-255, 255].
      for (int j = 0; j < kNumCoeffs; ++j) {
106 107 108 109 110 111 112 113 114 115 116
        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
        }
117 118
      }

119 120
      ASM_REGISTER_STATE_CHECK(RunFwdTxfm(test_input_block,
                                          test_temp_block, pitch_));
121 122 123 124 125 126 127 128
      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
      }
129 130

      for (int j = 0; j < kNumCoeffs; ++j) {
131 132 133 134
#if CONFIG_VP9_HIGHBITDEPTH
        const uint32_t diff =
            bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
#else
135
        const uint32_t diff = dst[j] - src[j];
136
#endif
137 138 139 140 141 142
        const uint32_t error = diff * diff;
        if (max_error < error)
          max_error = error;
        total_error += error;
      }
    }
Jingning Han's avatar
Jingning Han committed
143

Alex Converse's avatar
Alex Converse committed
144 145 146
    EXPECT_GE(static_cast<uint32_t>(limit), max_error)
        << "Error: 4x4 FHT/IHT has an individual round trip error > "
        << limit;
147

Alex Converse's avatar
Alex Converse committed
148 149 150
    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
151 152
  }

153 154 155 156
  void RunCoeffCheck() {
    ACMRandom rnd(ACMRandom::DeterministicSeed());
    const int count_test_block = 5000;
    DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
157 158
    DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
    DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
159 160

    for (int i = 0; i < count_test_block; ++i) {
161
      // Initialize a test block with input range [-mask_, mask_].
162
      for (int j = 0; j < kNumCoeffs; ++j)
163
        input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
164 165

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

168 169 170
      // 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
171 172 173
    }
  }

174 175 176 177 178
  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);
179 180
    DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
    DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
181 182

    for (int i = 0; i < count_test_block; ++i) {
183
      // Initialize a test block with input range [-mask_, mask_].
184
      for (int j = 0; j < kNumCoeffs; ++j) {
185 186
        input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
        input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
187
      }
188
      if (i == 0) {
189
        for (int j = 0; j < kNumCoeffs; ++j)
190
          input_extreme_block[j] = mask_;
191
      } else if (i == 1) {
192
        for (int j = 0; j < kNumCoeffs; ++j)
193
          input_extreme_block[j] = -mask_;
194
      }
195 196

      fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
197 198
      ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_extreme_block,
                                          output_block, pitch_));
199 200 201 202

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

Alex Converse's avatar
Alex Converse committed
209
  void RunInvAccuracyCheck(int limit) {
210 211 212
    ACMRandom rnd(ACMRandom::DeterministicSeed());
    const int count_test_block = 1000;
    DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
213
    DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
214 215
    DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
    DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
216 217 218 219
#if CONFIG_VP9_HIGHBITDEPTH
    DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
    DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
#endif
Daniel Kang's avatar
Daniel Kang committed
220

221
    for (int i = 0; i < count_test_block; ++i) {
222
      // Initialize a test block with input range [-mask_, mask_].
223
      for (int j = 0; j < kNumCoeffs; ++j) {
224 225 226 227 228 229 230 231 232 233 234
        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
        }
235
      }
Daniel Kang's avatar
Daniel Kang committed
236

237 238
      fwd_txfm_ref(in, coeff, pitch_, tx_type_);

239 240 241 242 243 244 245 246
      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
      }
247 248

      for (int j = 0; j < kNumCoeffs; ++j) {
249 250 251 252
#if CONFIG_VP9_HIGHBITDEPTH
        const uint32_t diff =
            bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
#else
253
        const uint32_t diff = dst[j] - src[j];
254
#endif
255
        const uint32_t error = diff * diff;
Alex Converse's avatar
Alex Converse committed
256 257
        EXPECT_GE(static_cast<uint32_t>(limit), error)
            << "Error: 4x4 IDCT has error " << error
258 259
            << " at index " << j;
      }
Daniel Kang's avatar
Daniel Kang committed
260 261 262
    }
  }

263 264
  int pitch_;
  int tx_type_;
265
  FhtFunc fwd_txfm_ref;
266 267
  vpx_bit_depth_t bit_depth_;
  int mask_;
268 269 270 271
};

class Trans4x4DCT
    : public Trans4x4TestBase,
272
      public ::testing::TestWithParam<Dct4x4Param> {
273 274 275 276 277 278 279 280 281
 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;
282 283
    bit_depth_ = GET_PARAM(3);
    mask_ = (1 << bit_depth_) - 1;
Daniel Kang's avatar
Daniel Kang committed
284
  }
285 286 287
  virtual void TearDown() { libvpx_test::ClearSystemState(); }

 protected:
288
  void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
289 290
    fwd_txfm_(in, out, stride);
  }
291
  void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
292 293 294
    inv_txfm_(out, dst, stride);
  }

295 296
  FdctFunc fwd_txfm_;
  IdctFunc inv_txfm_;
297 298 299
};

TEST_P(Trans4x4DCT, AccuracyCheck) {
Alex Converse's avatar
Alex Converse committed
300
  RunAccuracyCheck(1);
Jingning Han's avatar
Jingning Han committed
301
}
Daniel Kang's avatar
Daniel Kang committed
302

303 304 305
TEST_P(Trans4x4DCT, CoeffCheck) {
  RunCoeffCheck();
}
306

307 308 309
TEST_P(Trans4x4DCT, MemCheck) {
  RunMemCheck();
}
Daniel Kang's avatar
Daniel Kang committed
310

311
TEST_P(Trans4x4DCT, InvAccuracyCheck) {
Alex Converse's avatar
Alex Converse committed
312
  RunInvAccuracyCheck(1);
313 314 315 316
}

class Trans4x4HT
    : public Trans4x4TestBase,
317
      public ::testing::TestWithParam<Ht4x4Param> {
318 319 320 321 322 323 324 325 326
 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;
327 328
    bit_depth_ = GET_PARAM(3);
    mask_ = (1 << bit_depth_) - 1;
Daniel Kang's avatar
Daniel Kang committed
329
  }
330
  virtual void TearDown() { libvpx_test::ClearSystemState(); }
Daniel Kang's avatar
Daniel Kang committed
331

332
 protected:
333
  void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
334 335 336
    fwd_txfm_(in, out, stride, tx_type_);
  }

337
  void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
338 339 340
    inv_txfm_(out, dst, stride, tx_type_);
  }

341 342
  FhtFunc fwd_txfm_;
  IhtFunc inv_txfm_;
343 344 345
};

TEST_P(Trans4x4HT, AccuracyCheck) {
Alex Converse's avatar
Alex Converse committed
346
  RunAccuracyCheck(1);
347 348 349 350 351 352 353 354 355 356 357
}

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

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

TEST_P(Trans4x4HT, InvAccuracyCheck) {
Alex Converse's avatar
Alex Converse committed
358
  RunInvAccuracyCheck(1);
Jingning Han's avatar
Jingning Han committed
359
}
Daniel Kang's avatar
Daniel Kang committed
360

Alex Converse's avatar
Alex Converse committed
361 362
class Trans4x4WHT
    : public Trans4x4TestBase,
363
      public ::testing::TestWithParam<Dct4x4Param> {
Alex Converse's avatar
Alex Converse committed
364 365 366 367 368 369 370 371 372
 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;
373 374
    bit_depth_ = GET_PARAM(3);
    mask_ = (1 << bit_depth_) - 1;
Alex Converse's avatar
Alex Converse committed
375 376 377 378
  }
  virtual void TearDown() { libvpx_test::ClearSystemState(); }

 protected:
379
  void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
Alex Converse's avatar
Alex Converse committed
380 381
    fwd_txfm_(in, out, stride);
  }
382
  void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
Alex Converse's avatar
Alex Converse committed
383 384 385
    inv_txfm_(out, dst, stride);
  }

386 387
  FdctFunc fwd_txfm_;
  IdctFunc inv_txfm_;
Alex Converse's avatar
Alex Converse committed
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404
};

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

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

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

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

407
#if CONFIG_VP9_HIGHBITDEPTH
408 409 410
INSTANTIATE_TEST_CASE_P(
    C, Trans4x4DCT,
    ::testing::Values(
411 412
        make_tuple(&vp9_highbd_fdct4x4_c, &idct4x4_10, 0, VPX_BITS_10),
        make_tuple(&vp9_highbd_fdct4x4_c, &idct4x4_12, 0, VPX_BITS_12),
413 414 415 416 417 418 419 420 421
        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)));
#endif

#if CONFIG_VP9_HIGHBITDEPTH
422 423 424
INSTANTIATE_TEST_CASE_P(
    C, Trans4x4HT,
    ::testing::Values(
425 426 427 428 429 430 431 432
        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),
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
        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)));
#endif

#if CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(
    C, Trans4x4WHT,
    ::testing::Values(
451 452
        make_tuple(&vp9_highbd_fwht4x4_c, &iwht4x4_10, 0, VPX_BITS_10),
        make_tuple(&vp9_highbd_fwht4x4_c, &iwht4x4_12, 0, VPX_BITS_12),
453 454
        make_tuple(&vp9_fwht4x4_c, &vp9_iwht4x4_16_add_c, 0, VPX_BITS_8)));
#else
Alex Converse's avatar
Alex Converse committed
455 456 457
INSTANTIATE_TEST_CASE_P(
    C, Trans4x4WHT,
    ::testing::Values(
458 459
        make_tuple(&vp9_fwht4x4_c, &vp9_iwht4x4_16_add_c, 0, VPX_BITS_8)));
#endif
460

461
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
James Zern's avatar
James Zern committed
462 463 464 465
INSTANTIATE_TEST_CASE_P(
    NEON, Trans4x4DCT,
    ::testing::Values(
        make_tuple(&vp9_fdct4x4_c,
466
                   &vp9_idct4x4_16_add_neon, 0, VPX_BITS_8)));
James Zern's avatar
James Zern committed
467 468 469
INSTANTIATE_TEST_CASE_P(
    DISABLED_NEON, Trans4x4HT,
    ::testing::Values(
470 471 472 473
        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)));
James Zern's avatar
James Zern committed
474 475
#endif

476 477
#if CONFIG_USE_X86INC && HAVE_MMX && !CONFIG_VP9_HIGHBITDEPTH && \
    !CONFIG_EMULATE_HARDWARE
Alex Converse's avatar
Alex Converse committed
478 479 480
INSTANTIATE_TEST_CASE_P(
    MMX, Trans4x4WHT,
    ::testing::Values(
481
        make_tuple(&vp9_fwht4x4_mmx, &vp9_iwht4x4_16_add_c, 0, VPX_BITS_8)));
Alex Converse's avatar
Alex Converse committed
482 483
#endif

484
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
485 486 487 488
INSTANTIATE_TEST_CASE_P(
    SSE2, Trans4x4DCT,
    ::testing::Values(
        make_tuple(&vp9_fdct4x4_sse2,
489
                   &vp9_idct4x4_16_add_sse2, 0, VPX_BITS_8)));
490 491 492
INSTANTIATE_TEST_CASE_P(
    SSE2, Trans4x4HT,
    ::testing::Values(
493 494 495 496
        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)));
497 498
#endif

Daniel Kang's avatar
Daniel Kang committed
499
}  // namespace