]> granicus.if.org Git - libvpx/blob - test/partial_idct_test.cc
Merge "ppc: Add vpx_sadnxmx4d_vsx for n,m = {8, 16, 32 ,64}"
[libvpx] / test / partial_idct_test.cc
1 /*
2  *  Copyright (c) 2013 The WebM project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10
11 #include <math.h>
12 #include <stdlib.h>
13 #include <string.h>
14
15 #include <limits>
16
17 #include "third_party/googletest/src/include/gtest/gtest.h"
18
19 #include "./vp9_rtcd.h"
20 #include "./vpx_dsp_rtcd.h"
21 #include "test/acm_random.h"
22 #include "test/clear_system_state.h"
23 #include "test/register_state_check.h"
24 #include "test/util.h"
25 #include "vp9/common/vp9_blockd.h"
26 #include "vp9/common/vp9_scan.h"
27 #include "vpx/vpx_integer.h"
28 #include "vpx_ports/vpx_timer.h"
29
30 using libvpx_test::ACMRandom;
31
32 namespace {
33
34 typedef void (*FwdTxfmFunc)(const int16_t *in, tran_low_t *out, int stride);
35 typedef void (*InvTxfmFunc)(const tran_low_t *in, uint8_t *out, int stride);
36 typedef void (*InvTxfmWithBdFunc)(const tran_low_t *in, uint8_t *out,
37                                   int stride, int bd);
38
39 template <InvTxfmFunc fn>
40 void wrapper(const tran_low_t *in, uint8_t *out, int stride, int bd) {
41   (void)bd;
42   fn(in, out, stride);
43 }
44
45 #if CONFIG_VP9_HIGHBITDEPTH
46 typedef void (*InvTxfmHighbdFunc)(const tran_low_t *in, uint16_t *out,
47                                   int stride, int bd);
48 template <InvTxfmHighbdFunc fn>
49 void highbd_wrapper(const tran_low_t *in, uint8_t *out, int stride, int bd) {
50   fn(in, CAST_TO_SHORTPTR(out), stride, bd);
51 }
52 #endif
53
54 typedef std::tr1::tuple<FwdTxfmFunc, InvTxfmWithBdFunc, InvTxfmWithBdFunc,
55                         TX_SIZE, int, int, int>
56     PartialInvTxfmParam;
57 const int kMaxNumCoeffs = 1024;
58 const int kCountTestBlock = 1000;
59
60 class PartialIDctTest : public ::testing::TestWithParam<PartialInvTxfmParam> {
61  public:
62   virtual ~PartialIDctTest() {}
63   virtual void SetUp() {
64     rnd_.Reset(ACMRandom::DeterministicSeed());
65     ftxfm_ = GET_PARAM(0);
66     full_itxfm_ = GET_PARAM(1);
67     partial_itxfm_ = GET_PARAM(2);
68     tx_size_ = GET_PARAM(3);
69     last_nonzero_ = GET_PARAM(4);
70     bit_depth_ = GET_PARAM(5);
71     pixel_size_ = GET_PARAM(6);
72     mask_ = (1 << bit_depth_) - 1;
73
74     switch (tx_size_) {
75       case TX_4X4: size_ = 4; break;
76       case TX_8X8: size_ = 8; break;
77       case TX_16X16: size_ = 16; break;
78       case TX_32X32: size_ = 32; break;
79       default: FAIL() << "Wrong Size!"; break;
80     }
81
82     // Randomize stride_ to a value less than or equal to 1024
83     stride_ = rnd_(1024) + 1;
84     if (stride_ < size_) {
85       stride_ = size_;
86     }
87     // Align stride_ to 16 if it's bigger than 16.
88     if (stride_ > 16) {
89       stride_ &= ~15;
90     }
91
92     input_block_size_ = size_ * size_;
93     output_block_size_ = size_ * stride_;
94
95     input_block_ = reinterpret_cast<tran_low_t *>(
96         vpx_memalign(16, sizeof(*input_block_) * input_block_size_));
97     output_block_ = reinterpret_cast<uint8_t *>(
98         vpx_memalign(16, pixel_size_ * output_block_size_));
99     output_block_ref_ = reinterpret_cast<uint8_t *>(
100         vpx_memalign(16, pixel_size_ * output_block_size_));
101   }
102
103   virtual void TearDown() {
104     vpx_free(input_block_);
105     input_block_ = NULL;
106     vpx_free(output_block_);
107     output_block_ = NULL;
108     vpx_free(output_block_ref_);
109     output_block_ref_ = NULL;
110     libvpx_test::ClearSystemState();
111   }
112
113   void InitMem() {
114     memset(input_block_, 0, sizeof(*input_block_) * input_block_size_);
115     if (pixel_size_ == 1) {
116       for (int j = 0; j < output_block_size_; ++j) {
117         output_block_[j] = output_block_ref_[j] = rnd_.Rand16() & mask_;
118       }
119     } else {
120       ASSERT_EQ(2, pixel_size_);
121       uint16_t *const output = reinterpret_cast<uint16_t *>(output_block_);
122       uint16_t *const output_ref =
123           reinterpret_cast<uint16_t *>(output_block_ref_);
124       for (int j = 0; j < output_block_size_; ++j) {
125         output[j] = output_ref[j] = rnd_.Rand16() & mask_;
126       }
127     }
128   }
129
130   void InitInput() {
131     const int64_t max_coeff = (32766 << (bit_depth_ - 8)) / 4;
132     int64_t max_energy_leftover = max_coeff * max_coeff;
133     for (int j = 0; j < last_nonzero_; ++j) {
134       tran_low_t coeff = static_cast<tran_low_t>(
135           sqrt(1.0 * max_energy_leftover) * (rnd_.Rand16() - 32768) / 65536);
136       max_energy_leftover -= static_cast<int64_t>(coeff) * coeff;
137       if (max_energy_leftover < 0) {
138         max_energy_leftover = 0;
139         coeff = 0;
140       }
141       input_block_[vp9_default_scan_orders[tx_size_].scan[j]] = coeff;
142     }
143   }
144
145   void PrintDiff() {
146     if (memcmp(output_block_ref_, output_block_,
147                pixel_size_ * output_block_size_)) {
148       uint16_t ref, opt;
149       for (int y = 0; y < size_; y++) {
150         for (int x = 0; x < size_; x++) {
151           if (pixel_size_ == 1) {
152             ref = output_block_ref_[y * stride_ + x];
153             opt = output_block_[y * stride_ + x];
154           } else {
155             ref = reinterpret_cast<uint16_t *>(
156                 output_block_ref_)[y * stride_ + x];
157             opt = reinterpret_cast<uint16_t *>(output_block_)[y * stride_ + x];
158           }
159           if (ref != opt) {
160             printf("dest[%d][%d] diff:%6d (ref),%6d (opt)\n", y, x, ref, opt);
161           }
162         }
163       }
164
165       printf("\ninput_block_:\n");
166       for (int y = 0; y < size_; y++) {
167         for (int x = 0; x < size_; x++) {
168           printf("%6d,", input_block_[y * size_ + x]);
169         }
170         printf("\n");
171       }
172     }
173   }
174
175  protected:
176   int last_nonzero_;
177   TX_SIZE tx_size_;
178   tran_low_t *input_block_;
179   uint8_t *output_block_;
180   uint8_t *output_block_ref_;
181   int size_;
182   int stride_;
183   int pixel_size_;
184   int input_block_size_;
185   int output_block_size_;
186   int bit_depth_;
187   int mask_;
188   FwdTxfmFunc ftxfm_;
189   InvTxfmWithBdFunc full_itxfm_;
190   InvTxfmWithBdFunc partial_itxfm_;
191   ACMRandom rnd_;
192 };
193
194 TEST_P(PartialIDctTest, RunQuantCheck) {
195   const int count_test_block = (size_ != 4) ? kCountTestBlock : 65536;
196   DECLARE_ALIGNED(16, int16_t, input_extreme_block[kMaxNumCoeffs]);
197   DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kMaxNumCoeffs]);
198
199   InitMem();
200
201   for (int i = 0; i < count_test_block; ++i) {
202     // Initialize a test block with input range [-mask_, mask_].
203     if (size_ != 4) {
204       if (i == 0) {
205         for (int k = 0; k < input_block_size_; ++k) {
206           input_extreme_block[k] = mask_;
207         }
208       } else if (i == 1) {
209         for (int k = 0; k < input_block_size_; ++k) {
210           input_extreme_block[k] = -mask_;
211         }
212       } else {
213         for (int k = 0; k < input_block_size_; ++k) {
214           input_extreme_block[k] = rnd_.Rand8() % 2 ? mask_ : -mask_;
215         }
216       }
217     } else {
218       // Try all possible combinations.
219       for (int k = 0; k < input_block_size_; ++k) {
220         input_extreme_block[k] = (i & (1 << k)) ? mask_ : -mask_;
221       }
222     }
223
224     ftxfm_(input_extreme_block, output_ref_block, size_);
225
226     // quantization with minimum allowed step sizes
227     input_block_[0] = (output_ref_block[0] / 4) * 4;
228     for (int k = 1; k < last_nonzero_; ++k) {
229       const int pos = vp9_default_scan_orders[tx_size_].scan[k];
230       input_block_[pos] = (output_ref_block[pos] / 4) * 4;
231     }
232
233     ASM_REGISTER_STATE_CHECK(
234         full_itxfm_(input_block_, output_block_ref_, stride_, bit_depth_));
235     ASM_REGISTER_STATE_CHECK(
236         partial_itxfm_(input_block_, output_block_, stride_, bit_depth_));
237     ASSERT_EQ(0, memcmp(output_block_ref_, output_block_,
238                         pixel_size_ * output_block_size_))
239         << "Error: partial inverse transform produces different results";
240   }
241 }
242
243 TEST_P(PartialIDctTest, ResultsMatch) {
244   for (int i = 0; i < kCountTestBlock; ++i) {
245     InitMem();
246     InitInput();
247
248     ASM_REGISTER_STATE_CHECK(
249         full_itxfm_(input_block_, output_block_ref_, stride_, bit_depth_));
250     ASM_REGISTER_STATE_CHECK(
251         partial_itxfm_(input_block_, output_block_, stride_, bit_depth_));
252     ASSERT_EQ(0, memcmp(output_block_ref_, output_block_,
253                         pixel_size_ * output_block_size_))
254         << "Error: partial inverse transform produces different results";
255   }
256 }
257
258 TEST_P(PartialIDctTest, AddOutputBlock) {
259   for (int i = 0; i < kCountTestBlock; ++i) {
260     InitMem();
261     for (int j = 0; j < last_nonzero_; ++j) {
262       input_block_[vp9_default_scan_orders[tx_size_].scan[j]] = 10;
263     }
264
265     ASM_REGISTER_STATE_CHECK(
266         full_itxfm_(input_block_, output_block_ref_, stride_, bit_depth_));
267     ASM_REGISTER_STATE_CHECK(
268         partial_itxfm_(input_block_, output_block_, stride_, bit_depth_));
269     ASSERT_EQ(0, memcmp(output_block_ref_, output_block_,
270                         pixel_size_ * output_block_size_))
271         << "Error: Transform results are not correctly added to output.";
272   }
273 }
274
275 TEST_P(PartialIDctTest, SingleExtremeCoeff) {
276   const int16_t max_coeff = std::numeric_limits<int16_t>::max();
277   const int16_t min_coeff = std::numeric_limits<int16_t>::min();
278   for (int i = 0; i < last_nonzero_; ++i) {
279     memset(input_block_, 0, sizeof(*input_block_) * input_block_size_);
280     // Run once for min and once for max.
281     for (int j = 0; j < 2; ++j) {
282       const int coeff = j ? min_coeff : max_coeff;
283
284       memset(output_block_, 0, pixel_size_ * output_block_size_);
285       memset(output_block_ref_, 0, pixel_size_ * output_block_size_);
286       input_block_[vp9_default_scan_orders[tx_size_].scan[i]] = coeff;
287
288       ASM_REGISTER_STATE_CHECK(
289           full_itxfm_(input_block_, output_block_ref_, stride_, bit_depth_));
290       ASM_REGISTER_STATE_CHECK(
291           partial_itxfm_(input_block_, output_block_, stride_, bit_depth_));
292       ASSERT_EQ(0, memcmp(output_block_ref_, output_block_,
293                           pixel_size_ * output_block_size_))
294           << "Error: Fails with single coeff of " << coeff << " at " << i
295           << ".";
296     }
297   }
298 }
299
300 TEST_P(PartialIDctTest, DISABLED_Speed) {
301   // Keep runtime stable with transform size.
302   const int kCountSpeedTestBlock = 500000000 / input_block_size_;
303   InitMem();
304   InitInput();
305
306   for (int i = 0; i < kCountSpeedTestBlock; ++i) {
307     ASM_REGISTER_STATE_CHECK(
308         full_itxfm_(input_block_, output_block_ref_, stride_, bit_depth_));
309   }
310   vpx_usec_timer timer;
311   vpx_usec_timer_start(&timer);
312   for (int i = 0; i < kCountSpeedTestBlock; ++i) {
313     partial_itxfm_(input_block_, output_block_, stride_, bit_depth_);
314   }
315   libvpx_test::ClearSystemState();
316   vpx_usec_timer_mark(&timer);
317   const int elapsed_time =
318       static_cast<int>(vpx_usec_timer_elapsed(&timer) / 1000);
319   printf("idct%dx%d_%d (%s %d) time: %5d ms\n", size_, size_, last_nonzero_,
320          (pixel_size_ == 1) ? "bitdepth" : "high bitdepth", bit_depth_,
321          elapsed_time);
322   ASSERT_EQ(0, memcmp(output_block_ref_, output_block_,
323                       pixel_size_ * output_block_size_))
324       << "Error: partial inverse transform produces different results";
325 }
326
327 using std::tr1::make_tuple;
328
329 const PartialInvTxfmParam c_partial_idct_tests[] = {
330 #if CONFIG_VP9_HIGHBITDEPTH
331   make_tuple(
332       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
333       &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, TX_32X32, 1024, 8, 2),
334   make_tuple(
335       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
336       &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, TX_32X32, 1024, 10, 2),
337   make_tuple(
338       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
339       &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, TX_32X32, 1024, 12, 2),
340   make_tuple(
341       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
342       &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, TX_32X32, 135, 8, 2),
343   make_tuple(
344       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
345       &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, TX_32X32, 135, 10, 2),
346   make_tuple(
347       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
348       &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, TX_32X32, 135, 12, 2),
349   make_tuple(
350       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
351       &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, TX_32X32, 34, 8, 2),
352   make_tuple(
353       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
354       &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, TX_32X32, 34, 10, 2),
355   make_tuple(
356       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
357       &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, TX_32X32, 34, 12, 2),
358   make_tuple(&vpx_highbd_fdct32x32_c,
359              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
360              &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, TX_32X32, 1, 8, 2),
361   make_tuple(&vpx_highbd_fdct32x32_c,
362              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
363              &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, TX_32X32, 1, 10, 2),
364   make_tuple(&vpx_highbd_fdct32x32_c,
365              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
366              &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, TX_32X32, 1, 12, 2),
367   make_tuple(
368       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
369       &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, TX_16X16, 256, 8, 2),
370   make_tuple(
371       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
372       &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, TX_16X16, 256, 10, 2),
373   make_tuple(
374       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
375       &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, TX_16X16, 256, 12, 2),
376   make_tuple(
377       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
378       &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, TX_16X16, 38, 8, 2),
379   make_tuple(
380       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
381       &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, TX_16X16, 38, 10, 2),
382   make_tuple(
383       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
384       &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, TX_16X16, 38, 12, 2),
385   make_tuple(
386       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
387       &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, TX_16X16, 10, 8, 2),
388   make_tuple(
389       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
390       &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, TX_16X16, 10, 10, 2),
391   make_tuple(
392       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
393       &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, TX_16X16, 10, 12, 2),
394   make_tuple(&vpx_highbd_fdct16x16_c,
395              &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
396              &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, TX_16X16, 1, 8, 2),
397   make_tuple(&vpx_highbd_fdct16x16_c,
398              &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
399              &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, TX_16X16, 1, 10, 2),
400   make_tuple(&vpx_highbd_fdct16x16_c,
401              &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
402              &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, TX_16X16, 1, 12, 2),
403   make_tuple(&vpx_highbd_fdct8x8_c,
404              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
405              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, TX_8X8, 64, 8, 2),
406   make_tuple(&vpx_highbd_fdct8x8_c,
407              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
408              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, TX_8X8, 64, 10, 2),
409   make_tuple(&vpx_highbd_fdct8x8_c,
410              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
411              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, TX_8X8, 64, 12, 2),
412   make_tuple(&vpx_highbd_fdct8x8_c,
413              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
414              &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, TX_8X8, 12, 8, 2),
415   make_tuple(&vpx_highbd_fdct8x8_c,
416              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
417              &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, TX_8X8, 12, 10, 2),
418   make_tuple(&vpx_highbd_fdct8x8_c,
419              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
420              &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, TX_8X8, 12, 12, 2),
421   make_tuple(&vpx_highbd_fdct8x8_c,
422              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
423              &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, TX_8X8, 1, 8, 2),
424   make_tuple(&vpx_highbd_fdct8x8_c,
425              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
426              &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, TX_8X8, 1, 10, 2),
427   make_tuple(&vpx_highbd_fdct8x8_c,
428              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
429              &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, TX_8X8, 1, 12, 2),
430   make_tuple(&vpx_highbd_fdct4x4_c,
431              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
432              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, TX_4X4, 16, 8, 2),
433   make_tuple(&vpx_highbd_fdct4x4_c,
434              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
435              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, TX_4X4, 16, 10, 2),
436   make_tuple(&vpx_highbd_fdct4x4_c,
437              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
438              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, TX_4X4, 16, 12, 2),
439   make_tuple(&vpx_highbd_fdct4x4_c,
440              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
441              &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, TX_4X4, 1, 8, 2),
442   make_tuple(&vpx_highbd_fdct4x4_c,
443              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
444              &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, TX_4X4, 1, 10, 2),
445   make_tuple(&vpx_highbd_fdct4x4_c,
446              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
447              &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, TX_4X4, 1, 12, 2),
448 #endif  // CONFIG_VP9_HIGHBITDEPTH
449   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
450              &wrapper<vpx_idct32x32_1024_add_c>, TX_32X32, 1024, 8, 1),
451   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
452              &wrapper<vpx_idct32x32_135_add_c>, TX_32X32, 135, 8, 1),
453   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
454              &wrapper<vpx_idct32x32_34_add_c>, TX_32X32, 34, 8, 1),
455   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
456              &wrapper<vpx_idct32x32_1_add_c>, TX_32X32, 1, 8, 1),
457   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
458              &wrapper<vpx_idct16x16_256_add_c>, TX_16X16, 256, 8, 1),
459   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
460              &wrapper<vpx_idct16x16_38_add_c>, TX_16X16, 38, 8, 1),
461   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
462              &wrapper<vpx_idct16x16_10_add_c>, TX_16X16, 10, 8, 1),
463   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
464              &wrapper<vpx_idct16x16_1_add_c>, TX_16X16, 1, 8, 1),
465   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
466              &wrapper<vpx_idct8x8_64_add_c>, TX_8X8, 64, 8, 1),
467   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
468              &wrapper<vpx_idct8x8_12_add_c>, TX_8X8, 12, 8, 1),
469   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
470              &wrapper<vpx_idct8x8_1_add_c>, TX_8X8, 1, 8, 1),
471   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>,
472              &wrapper<vpx_idct4x4_16_add_c>, TX_4X4, 16, 8, 1),
473   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>,
474              &wrapper<vpx_idct4x4_1_add_c>, TX_4X4, 1, 8, 1)
475 };
476
477 INSTANTIATE_TEST_CASE_P(C, PartialIDctTest,
478                         ::testing::ValuesIn(c_partial_idct_tests));
479
480 #if HAVE_NEON && !CONFIG_EMULATE_HARDWARE
481 const PartialInvTxfmParam neon_partial_idct_tests[] = {
482 #if CONFIG_VP9_HIGHBITDEPTH
483   make_tuple(&vpx_highbd_fdct32x32_c,
484              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
485              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_neon>, TX_32X32,
486              1024, 8, 2),
487   make_tuple(&vpx_highbd_fdct32x32_c,
488              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
489              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_neon>, TX_32X32,
490              1024, 10, 2),
491   make_tuple(&vpx_highbd_fdct32x32_c,
492              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
493              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_neon>, TX_32X32,
494              1024, 12, 2),
495   make_tuple(
496       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>,
497       &highbd_wrapper<vpx_highbd_idct32x32_135_add_neon>, TX_32X32, 135, 8, 2),
498   make_tuple(
499       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>,
500       &highbd_wrapper<vpx_highbd_idct32x32_135_add_neon>, TX_32X32, 135, 10, 2),
501   make_tuple(
502       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>,
503       &highbd_wrapper<vpx_highbd_idct32x32_135_add_neon>, TX_32X32, 135, 12, 2),
504   make_tuple(
505       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>,
506       &highbd_wrapper<vpx_highbd_idct32x32_34_add_neon>, TX_32X32, 34, 8, 2),
507   make_tuple(
508       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>,
509       &highbd_wrapper<vpx_highbd_idct32x32_34_add_neon>, TX_32X32, 34, 10, 2),
510   make_tuple(
511       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>,
512       &highbd_wrapper<vpx_highbd_idct32x32_34_add_neon>, TX_32X32, 34, 12, 2),
513   make_tuple(
514       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>,
515       &highbd_wrapper<vpx_highbd_idct32x32_1_add_neon>, TX_32X32, 1, 8, 2),
516   make_tuple(
517       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>,
518       &highbd_wrapper<vpx_highbd_idct32x32_1_add_neon>, TX_32X32, 1, 10, 2),
519   make_tuple(
520       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>,
521       &highbd_wrapper<vpx_highbd_idct32x32_1_add_neon>, TX_32X32, 1, 12, 2),
522   make_tuple(
523       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
524       &highbd_wrapper<vpx_highbd_idct16x16_256_add_neon>, TX_16X16, 256, 8, 2),
525   make_tuple(
526       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
527       &highbd_wrapper<vpx_highbd_idct16x16_256_add_neon>, TX_16X16, 256, 10, 2),
528   make_tuple(
529       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
530       &highbd_wrapper<vpx_highbd_idct16x16_256_add_neon>, TX_16X16, 256, 12, 2),
531   make_tuple(
532       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>,
533       &highbd_wrapper<vpx_highbd_idct16x16_38_add_neon>, TX_16X16, 38, 8, 2),
534   make_tuple(
535       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>,
536       &highbd_wrapper<vpx_highbd_idct16x16_38_add_neon>, TX_16X16, 38, 10, 2),
537   make_tuple(
538       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>,
539       &highbd_wrapper<vpx_highbd_idct16x16_38_add_neon>, TX_16X16, 38, 12, 2),
540   make_tuple(
541       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>,
542       &highbd_wrapper<vpx_highbd_idct16x16_10_add_neon>, TX_16X16, 10, 8, 2),
543   make_tuple(
544       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>,
545       &highbd_wrapper<vpx_highbd_idct16x16_10_add_neon>, TX_16X16, 10, 10, 2),
546   make_tuple(
547       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>,
548       &highbd_wrapper<vpx_highbd_idct16x16_10_add_neon>, TX_16X16, 10, 12, 2),
549   make_tuple(
550       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>,
551       &highbd_wrapper<vpx_highbd_idct16x16_1_add_neon>, TX_16X16, 1, 8, 2),
552   make_tuple(
553       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>,
554       &highbd_wrapper<vpx_highbd_idct16x16_1_add_neon>, TX_16X16, 1, 10, 2),
555   make_tuple(
556       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>,
557       &highbd_wrapper<vpx_highbd_idct16x16_1_add_neon>, TX_16X16, 1, 12, 2),
558   make_tuple(&vpx_highbd_fdct8x8_c,
559              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
560              &highbd_wrapper<vpx_highbd_idct8x8_64_add_neon>, TX_8X8, 64, 8, 2),
561   make_tuple(
562       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
563       &highbd_wrapper<vpx_highbd_idct8x8_64_add_neon>, TX_8X8, 64, 10, 2),
564   make_tuple(
565       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
566       &highbd_wrapper<vpx_highbd_idct8x8_64_add_neon>, TX_8X8, 64, 12, 2),
567   make_tuple(&vpx_highbd_fdct8x8_c,
568              &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>,
569              &highbd_wrapper<vpx_highbd_idct8x8_12_add_neon>, TX_8X8, 12, 8, 2),
570   make_tuple(
571       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>,
572       &highbd_wrapper<vpx_highbd_idct8x8_12_add_neon>, TX_8X8, 12, 10, 2),
573   make_tuple(
574       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>,
575       &highbd_wrapper<vpx_highbd_idct8x8_12_add_neon>, TX_8X8, 12, 12, 2),
576   make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>,
577              &highbd_wrapper<vpx_highbd_idct8x8_1_add_neon>, TX_8X8, 1, 8, 2),
578   make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>,
579              &highbd_wrapper<vpx_highbd_idct8x8_1_add_neon>, TX_8X8, 1, 10, 2),
580   make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>,
581              &highbd_wrapper<vpx_highbd_idct8x8_1_add_neon>, TX_8X8, 1, 12, 2),
582   make_tuple(&vpx_highbd_fdct4x4_c,
583              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
584              &highbd_wrapper<vpx_highbd_idct4x4_16_add_neon>, TX_4X4, 16, 8, 2),
585   make_tuple(
586       &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
587       &highbd_wrapper<vpx_highbd_idct4x4_16_add_neon>, TX_4X4, 16, 10, 2),
588   make_tuple(
589       &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
590       &highbd_wrapper<vpx_highbd_idct4x4_16_add_neon>, TX_4X4, 16, 12, 2),
591   make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>,
592              &highbd_wrapper<vpx_highbd_idct4x4_1_add_neon>, TX_4X4, 1, 8, 2),
593   make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>,
594              &highbd_wrapper<vpx_highbd_idct4x4_1_add_neon>, TX_4X4, 1, 10, 2),
595   make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>,
596              &highbd_wrapper<vpx_highbd_idct4x4_1_add_neon>, TX_4X4, 1, 12, 2),
597 #endif  // CONFIG_VP9_HIGHBITDEPTH
598   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
599              &wrapper<vpx_idct32x32_1024_add_neon>, TX_32X32, 1024, 8, 1),
600   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_135_add_c>,
601              &wrapper<vpx_idct32x32_135_add_neon>, TX_32X32, 135, 8, 1),
602   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>,
603              &wrapper<vpx_idct32x32_34_add_neon>, TX_32X32, 34, 8, 1),
604   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1_add_c>,
605              &wrapper<vpx_idct32x32_1_add_neon>, TX_32X32, 1, 8, 1),
606   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
607              &wrapper<vpx_idct16x16_256_add_neon>, TX_16X16, 256, 8, 1),
608   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_38_add_c>,
609              &wrapper<vpx_idct16x16_38_add_neon>, TX_16X16, 38, 8, 1),
610   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_10_add_c>,
611              &wrapper<vpx_idct16x16_10_add_neon>, TX_16X16, 10, 8, 1),
612   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_1_add_c>,
613              &wrapper<vpx_idct16x16_1_add_neon>, TX_16X16, 1, 8, 1),
614   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
615              &wrapper<vpx_idct8x8_64_add_neon>, TX_8X8, 64, 8, 1),
616   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>,
617              &wrapper<vpx_idct8x8_12_add_neon>, TX_8X8, 12, 8, 1),
618   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_1_add_c>,
619              &wrapper<vpx_idct8x8_1_add_neon>, TX_8X8, 1, 8, 1),
620   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>,
621              &wrapper<vpx_idct4x4_16_add_neon>, TX_4X4, 16, 8, 1),
622   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_1_add_c>,
623              &wrapper<vpx_idct4x4_1_add_neon>, TX_4X4, 1, 8, 1)
624 };
625
626 INSTANTIATE_TEST_CASE_P(NEON, PartialIDctTest,
627                         ::testing::ValuesIn(neon_partial_idct_tests));
628 #endif  // HAVE_NEON && !CONFIG_EMULATE_HARDWARE
629
630 #if HAVE_SSE2 && !CONFIG_EMULATE_HARDWARE
631 // 32x32_135_ is implemented using the 1024 version.
632 const PartialInvTxfmParam sse2_partial_idct_tests[] = {
633 #if CONFIG_VP9_HIGHBITDEPTH
634   make_tuple(
635       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>,
636       &highbd_wrapper<vpx_highbd_idct32x32_1_add_sse2>, TX_32X32, 1, 8, 2),
637   make_tuple(
638       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>,
639       &highbd_wrapper<vpx_highbd_idct32x32_1_add_sse2>, TX_32X32, 1, 10, 2),
640   make_tuple(
641       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>,
642       &highbd_wrapper<vpx_highbd_idct32x32_1_add_sse2>, TX_32X32, 1, 12, 2),
643   make_tuple(
644       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
645       &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse2>, TX_16X16, 256, 8, 2),
646   make_tuple(
647       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
648       &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse2>, TX_16X16, 256, 10, 2),
649   make_tuple(
650       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
651       &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse2>, TX_16X16, 256, 12, 2),
652   make_tuple(
653       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>,
654       &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse2>, TX_16X16, 10, 8, 2),
655   make_tuple(
656       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>,
657       &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse2>, TX_16X16, 10, 10, 2),
658   make_tuple(
659       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>,
660       &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse2>, TX_16X16, 10, 12, 2),
661   make_tuple(
662       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>,
663       &highbd_wrapper<vpx_highbd_idct16x16_1_add_sse2>, TX_16X16, 1, 8, 2),
664   make_tuple(
665       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>,
666       &highbd_wrapper<vpx_highbd_idct16x16_1_add_sse2>, TX_16X16, 1, 10, 2),
667   make_tuple(
668       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>,
669       &highbd_wrapper<vpx_highbd_idct16x16_1_add_sse2>, TX_16X16, 1, 12, 2),
670   make_tuple(&vpx_highbd_fdct8x8_c,
671              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
672              &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse2>, TX_8X8, 64, 8, 2),
673   make_tuple(
674       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
675       &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse2>, TX_8X8, 64, 10, 2),
676   make_tuple(
677       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
678       &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse2>, TX_8X8, 64, 12, 2),
679   make_tuple(&vpx_highbd_fdct8x8_c,
680              &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>,
681              &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse2>, TX_8X8, 12, 8, 2),
682   make_tuple(
683       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>,
684       &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse2>, TX_8X8, 12, 10, 2),
685   make_tuple(
686       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>,
687       &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse2>, TX_8X8, 12, 12, 2),
688   make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>,
689              &highbd_wrapper<vpx_highbd_idct8x8_1_add_sse2>, TX_8X8, 1, 8, 2),
690   make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>,
691              &highbd_wrapper<vpx_highbd_idct8x8_1_add_sse2>, TX_8X8, 1, 10, 2),
692   make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>,
693              &highbd_wrapper<vpx_highbd_idct8x8_1_add_sse2>, TX_8X8, 1, 12, 2),
694   make_tuple(&vpx_highbd_fdct4x4_c,
695              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
696              &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse2>, TX_4X4, 16, 8, 2),
697   make_tuple(
698       &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
699       &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse2>, TX_4X4, 16, 10, 2),
700   make_tuple(
701       &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
702       &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse2>, TX_4X4, 16, 12, 2),
703   make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>,
704              &highbd_wrapper<vpx_highbd_idct4x4_1_add_sse2>, TX_4X4, 1, 8, 2),
705   make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>,
706              &highbd_wrapper<vpx_highbd_idct4x4_1_add_sse2>, TX_4X4, 1, 10, 2),
707   make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>,
708              &highbd_wrapper<vpx_highbd_idct4x4_1_add_sse2>, TX_4X4, 1, 12, 2),
709 #endif  // CONFIG_VP9_HIGHBITDEPTH
710   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
711              &wrapper<vpx_idct32x32_1024_add_sse2>, TX_32X32, 1024, 8, 1),
712   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>,
713              &wrapper<vpx_idct32x32_34_add_sse2>, TX_32X32, 34, 8, 1),
714   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1_add_c>,
715              &wrapper<vpx_idct32x32_1_add_sse2>, TX_32X32, 1, 8, 1),
716   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
717              &wrapper<vpx_idct16x16_256_add_sse2>, TX_16X16, 256, 8, 1),
718   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_10_add_c>,
719              &wrapper<vpx_idct16x16_10_add_sse2>, TX_16X16, 10, 8, 1),
720   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_1_add_c>,
721              &wrapper<vpx_idct16x16_1_add_sse2>, TX_16X16, 1, 8, 1),
722   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
723              &wrapper<vpx_idct8x8_64_add_sse2>, TX_8X8, 64, 8, 1),
724   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>,
725              &wrapper<vpx_idct8x8_12_add_sse2>, TX_8X8, 12, 8, 1),
726   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_1_add_c>,
727              &wrapper<vpx_idct8x8_1_add_sse2>, TX_8X8, 1, 8, 1),
728   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>,
729              &wrapper<vpx_idct4x4_16_add_sse2>, TX_4X4, 16, 8, 1),
730   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_1_add_c>,
731              &wrapper<vpx_idct4x4_1_add_sse2>, TX_4X4, 1, 8, 1)
732 };
733
734 INSTANTIATE_TEST_CASE_P(SSE2, PartialIDctTest,
735                         ::testing::ValuesIn(sse2_partial_idct_tests));
736
737 #endif  // HAVE_SSE2 && !CONFIG_EMULATE_HARDWARE
738
739 #if HAVE_SSSE3 && !CONFIG_EMULATE_HARDWARE
740 const PartialInvTxfmParam ssse3_partial_idct_tests[] = {
741   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
742              &wrapper<vpx_idct32x32_1024_add_ssse3>, TX_32X32, 1024, 8, 1),
743   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_135_add_c>,
744              &wrapper<vpx_idct32x32_135_add_ssse3>, TX_32X32, 135, 8, 1),
745   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>,
746              &wrapper<vpx_idct32x32_34_add_ssse3>, TX_32X32, 34, 8, 1),
747   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
748              &wrapper<vpx_idct8x8_64_add_ssse3>, TX_8X8, 64, 8, 1),
749   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>,
750              &wrapper<vpx_idct8x8_12_add_ssse3>, TX_8X8, 12, 8, 1)
751 };
752
753 INSTANTIATE_TEST_CASE_P(SSSE3, PartialIDctTest,
754                         ::testing::ValuesIn(ssse3_partial_idct_tests));
755 #endif  // HAVE_SSSE3 && ARCH_X86_64 && !CONFIG_EMULATE_HARDWARE
756
757 #if HAVE_DSPR2 && !CONFIG_EMULATE_HARDWARE && !CONFIG_VP9_HIGHBITDEPTH
758 const PartialInvTxfmParam dspr2_partial_idct_tests[] = {
759   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
760              &wrapper<vpx_idct32x32_1024_add_dspr2>, TX_32X32, 1024, 8, 1),
761   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>,
762              &wrapper<vpx_idct32x32_34_add_dspr2>, TX_32X32, 34, 8, 1),
763   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1_add_c>,
764              &wrapper<vpx_idct32x32_1_add_dspr2>, TX_32X32, 1, 8, 1),
765   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
766              &wrapper<vpx_idct16x16_256_add_dspr2>, TX_16X16, 256, 8, 1),
767   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_10_add_c>,
768              &wrapper<vpx_idct16x16_10_add_dspr2>, TX_16X16, 10, 8, 1),
769   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_1_add_c>,
770              &wrapper<vpx_idct16x16_1_add_dspr2>, TX_16X16, 1, 8, 1),
771   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
772              &wrapper<vpx_idct8x8_64_add_dspr2>, TX_8X8, 64, 8, 1),
773   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>,
774              &wrapper<vpx_idct8x8_12_add_dspr2>, TX_8X8, 12, 8, 1),
775   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_1_add_c>,
776              &wrapper<vpx_idct8x8_1_add_dspr2>, TX_8X8, 1, 8, 1),
777   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>,
778              &wrapper<vpx_idct4x4_16_add_dspr2>, TX_4X4, 16, 8, 1),
779   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_1_add_c>,
780              &wrapper<vpx_idct4x4_1_add_dspr2>, TX_4X4, 1, 8, 1)
781 };
782
783 INSTANTIATE_TEST_CASE_P(DSPR2, PartialIDctTest,
784                         ::testing::ValuesIn(dspr2_partial_idct_tests));
785 #endif  // HAVE_DSPR2 && !CONFIG_EMULATE_HARDWARE && !CONFIG_VP9_HIGHBITDEPTH
786
787 #if HAVE_MSA && !CONFIG_EMULATE_HARDWARE && !CONFIG_VP9_HIGHBITDEPTH
788 // 32x32_135_ is implemented using the 1024 version.
789 const PartialInvTxfmParam msa_partial_idct_tests[] = {
790   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
791              &wrapper<vpx_idct32x32_1024_add_msa>, TX_32X32, 1024, 8, 1),
792   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>,
793              &wrapper<vpx_idct32x32_34_add_msa>, TX_32X32, 34, 8, 1),
794   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1_add_c>,
795              &wrapper<vpx_idct32x32_1_add_msa>, TX_32X32, 1, 8, 1),
796   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
797              &wrapper<vpx_idct16x16_256_add_msa>, TX_16X16, 256, 8, 1),
798   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_10_add_c>,
799              &wrapper<vpx_idct16x16_10_add_msa>, TX_16X16, 10, 8, 1),
800   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_1_add_c>,
801              &wrapper<vpx_idct16x16_1_add_msa>, TX_16X16, 1, 8, 1),
802   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
803              &wrapper<vpx_idct8x8_64_add_msa>, TX_8X8, 64, 8, 1),
804   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>,
805              &wrapper<vpx_idct8x8_12_add_msa>, TX_8X8, 12, 8, 1),
806   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_1_add_c>,
807              &wrapper<vpx_idct8x8_1_add_msa>, TX_8X8, 1, 8, 1),
808   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>,
809              &wrapper<vpx_idct4x4_16_add_msa>, TX_4X4, 16, 8, 1),
810   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_1_add_c>,
811              &wrapper<vpx_idct4x4_1_add_msa>, TX_4X4, 1, 8, 1)
812 };
813
814 INSTANTIATE_TEST_CASE_P(MSA, PartialIDctTest,
815                         ::testing::ValuesIn(msa_partial_idct_tests));
816 #endif  // HAVE_MSA && !CONFIG_EMULATE_HARDWARE && !CONFIG_VP9_HIGHBITDEPTH
817
818 }  // namespace