xref: /aosp_15_r20/external/libvpx/test/partial_idct_test.cc (revision fb1b10ab9aebc7c7068eedab379b749d7e3900be)
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 #include <limits>
15 #include <tuple>
16 
17 #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_config.h"
29 #include "vpx_ports/vpx_timer.h"
30 
31 using libvpx_test::ACMRandom;
32 
33 namespace {
34 
35 typedef void (*FwdTxfmFunc)(const int16_t *in, tran_low_t *out, int stride);
36 typedef void (*InvTxfmFunc)(const tran_low_t *in, uint8_t *out, int stride);
37 typedef void (*InvTxfmWithBdFunc)(const tran_low_t *in, uint8_t *out,
38                                   int stride, int bd);
39 
40 template <InvTxfmFunc fn>
wrapper(const tran_low_t * in,uint8_t * out,int stride,int bd)41 void wrapper(const tran_low_t *in, uint8_t *out, int stride, int bd) {
42   (void)bd;
43   fn(in, out, stride);
44 }
45 
46 #if CONFIG_VP9_HIGHBITDEPTH
47 typedef void (*InvTxfmHighbdFunc)(const tran_low_t *in, uint16_t *out,
48                                   int stride, int bd);
49 template <InvTxfmHighbdFunc fn>
highbd_wrapper(const tran_low_t * in,uint8_t * out,int stride,int bd)50 void highbd_wrapper(const tran_low_t *in, uint8_t *out, int stride, int bd) {
51   fn(in, CAST_TO_SHORTPTR(out), stride, bd);
52 }
53 #endif
54 
55 typedef std::tuple<FwdTxfmFunc, InvTxfmWithBdFunc, InvTxfmWithBdFunc, TX_SIZE,
56                    int, int, int>
57     PartialInvTxfmParam;
58 const int kMaxNumCoeffs = 1024;
59 const int kCountTestBlock = 1000;
60 
61 class PartialIDctTest : public ::testing::TestWithParam<PartialInvTxfmParam> {
62  public:
63   ~PartialIDctTest() override = default;
SetUp()64   void SetUp() override {
65     rnd_.Reset(ACMRandom::DeterministicSeed());
66     fwd_txfm_ = GET_PARAM(0);
67     full_inv_txfm_ = GET_PARAM(1);
68     partial_inv_txfm_ = GET_PARAM(2);
69     tx_size_ = GET_PARAM(3);
70     last_nonzero_ = GET_PARAM(4);
71     bit_depth_ = GET_PARAM(5);
72     pixel_size_ = GET_PARAM(6);
73     mask_ = (1 << bit_depth_) - 1;
74 
75     switch (tx_size_) {
76       case TX_4X4: size_ = 4; break;
77       case TX_8X8: size_ = 8; break;
78       case TX_16X16: size_ = 16; break;
79       case TX_32X32: size_ = 32; break;
80       default: FAIL() << "Wrong Size!";
81     }
82 
83     // Randomize stride_ to a value less than or equal to 1024
84     stride_ = rnd_(1024) + 1;
85     if (stride_ < size_) {
86       stride_ = size_;
87     }
88     // Align stride_ to 16 if it's bigger than 16.
89     if (stride_ > 16) {
90       stride_ &= ~15;
91     }
92 
93     input_block_size_ = size_ * size_;
94     output_block_size_ = size_ * stride_;
95 
96     input_block_ = reinterpret_cast<tran_low_t *>(
97         vpx_memalign(16, sizeof(*input_block_) * input_block_size_));
98     output_block_ = reinterpret_cast<uint8_t *>(
99         vpx_memalign(16, pixel_size_ * output_block_size_));
100     output_block_ref_ = reinterpret_cast<uint8_t *>(
101         vpx_memalign(16, pixel_size_ * output_block_size_));
102   }
103 
TearDown()104   void TearDown() override {
105     vpx_free(input_block_);
106     input_block_ = nullptr;
107     vpx_free(output_block_);
108     output_block_ = nullptr;
109     vpx_free(output_block_ref_);
110     output_block_ref_ = nullptr;
111     libvpx_test::ClearSystemState();
112   }
113 
InitMem()114   void InitMem() {
115     memset(input_block_, 0, sizeof(*input_block_) * input_block_size_);
116     if (pixel_size_ == 1) {
117       for (int j = 0; j < output_block_size_; ++j) {
118         output_block_[j] = output_block_ref_[j] = rnd_.Rand16() & mask_;
119       }
120     } else {
121       ASSERT_EQ(2, pixel_size_);
122       uint16_t *const output = reinterpret_cast<uint16_t *>(output_block_);
123       uint16_t *const output_ref =
124           reinterpret_cast<uint16_t *>(output_block_ref_);
125       for (int j = 0; j < output_block_size_; ++j) {
126         output[j] = output_ref[j] = rnd_.Rand16() & mask_;
127       }
128     }
129   }
130 
InitInput()131   void InitInput() {
132     const int64_t max_coeff = (32766 << (bit_depth_ - 8)) / 4;
133     int64_t max_energy_leftover = max_coeff * max_coeff;
134     for (int j = 0; j < last_nonzero_; ++j) {
135       tran_low_t coeff = static_cast<tran_low_t>(
136           sqrt(1.0 * max_energy_leftover) * (rnd_.Rand16() - 32768) / 65536);
137       max_energy_leftover -= static_cast<int64_t>(coeff) * coeff;
138       if (max_energy_leftover < 0) {
139         max_energy_leftover = 0;
140         coeff = 0;
141       }
142       input_block_[vp9_default_scan_orders[tx_size_].scan[j]] = coeff;
143     }
144   }
145 
PrintDiff()146   void PrintDiff() {
147     if (memcmp(output_block_ref_, output_block_,
148                pixel_size_ * output_block_size_)) {
149       uint16_t ref, opt;
150       for (int y = 0; y < size_; y++) {
151         for (int x = 0; x < size_; x++) {
152           if (pixel_size_ == 1) {
153             ref = output_block_ref_[y * stride_ + x];
154             opt = output_block_[y * stride_ + x];
155           } else {
156             ref = reinterpret_cast<uint16_t *>(
157                 output_block_ref_)[y * stride_ + x];
158             opt = reinterpret_cast<uint16_t *>(output_block_)[y * stride_ + x];
159           }
160           if (ref != opt) {
161             printf("dest[%d][%d] diff:%6d (ref),%6d (opt)\n", y, x, ref, opt);
162           }
163         }
164       }
165 
166       printf("\ninput_block_:\n");
167       for (int y = 0; y < size_; y++) {
168         for (int x = 0; x < size_; x++) {
169           printf("%6d,", input_block_[y * size_ + x]);
170         }
171         printf("\n");
172       }
173     }
174   }
175 
176  protected:
177   int last_nonzero_;
178   TX_SIZE tx_size_;
179   tran_low_t *input_block_;
180   uint8_t *output_block_;
181   uint8_t *output_block_ref_;
182   int size_;
183   int stride_;
184   int pixel_size_;
185   int input_block_size_;
186   int output_block_size_;
187   int bit_depth_;
188   int mask_;
189   FwdTxfmFunc fwd_txfm_;
190   InvTxfmWithBdFunc full_inv_txfm_;
191   InvTxfmWithBdFunc partial_inv_txfm_;
192   ACMRandom rnd_;
193 };
194 
TEST_P(PartialIDctTest,RunQuantCheck)195 TEST_P(PartialIDctTest, RunQuantCheck) {
196   const int count_test_block = (size_ != 4) ? kCountTestBlock : 65536;
197   DECLARE_ALIGNED(16, int16_t, input_extreme_block[kMaxNumCoeffs]);
198   DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kMaxNumCoeffs]);
199 
200   InitMem();
201 
202   for (int i = 0; i < count_test_block; ++i) {
203     // Initialize a test block with input range [-mask_, mask_].
204     if (size_ != 4) {
205       if (i == 0) {
206         for (int k = 0; k < input_block_size_; ++k) {
207           input_extreme_block[k] = mask_;
208         }
209       } else if (i == 1) {
210         for (int k = 0; k < input_block_size_; ++k) {
211           input_extreme_block[k] = -mask_;
212         }
213       } else {
214         for (int k = 0; k < input_block_size_; ++k) {
215           input_extreme_block[k] = rnd_.Rand8() % 2 ? mask_ : -mask_;
216         }
217       }
218     } else {
219       // Try all possible combinations.
220       for (int k = 0; k < input_block_size_; ++k) {
221         input_extreme_block[k] = (i & (1 << k)) ? mask_ : -mask_;
222       }
223     }
224 
225     fwd_txfm_(input_extreme_block, output_ref_block, size_);
226 
227     // quantization with minimum allowed step sizes
228     input_block_[0] = (output_ref_block[0] / 4) * 4;
229     for (int k = 1; k < last_nonzero_; ++k) {
230       const int pos = vp9_default_scan_orders[tx_size_].scan[k];
231       input_block_[pos] = (output_ref_block[pos] / 4) * 4;
232     }
233 
234     ASM_REGISTER_STATE_CHECK(
235         full_inv_txfm_(input_block_, output_block_ref_, stride_, bit_depth_));
236     ASM_REGISTER_STATE_CHECK(
237         partial_inv_txfm_(input_block_, output_block_, stride_, bit_depth_));
238     ASSERT_EQ(0, memcmp(output_block_ref_, output_block_,
239                         pixel_size_ * output_block_size_))
240         << "Error: partial inverse transform produces different results";
241   }
242 }
243 
TEST_P(PartialIDctTest,ResultsMatch)244 TEST_P(PartialIDctTest, ResultsMatch) {
245   for (int i = 0; i < kCountTestBlock; ++i) {
246     InitMem();
247     InitInput();
248 
249     ASM_REGISTER_STATE_CHECK(
250         full_inv_txfm_(input_block_, output_block_ref_, stride_, bit_depth_));
251     ASM_REGISTER_STATE_CHECK(
252         partial_inv_txfm_(input_block_, output_block_, stride_, bit_depth_));
253     ASSERT_EQ(0, memcmp(output_block_ref_, output_block_,
254                         pixel_size_ * output_block_size_))
255         << "Error: partial inverse transform produces different results";
256   }
257 }
258 
TEST_P(PartialIDctTest,AddOutputBlock)259 TEST_P(PartialIDctTest, AddOutputBlock) {
260   for (int i = 0; i < kCountTestBlock; ++i) {
261     InitMem();
262     for (int j = 0; j < last_nonzero_; ++j) {
263       input_block_[vp9_default_scan_orders[tx_size_].scan[j]] = 10;
264     }
265 
266     ASM_REGISTER_STATE_CHECK(
267         full_inv_txfm_(input_block_, output_block_ref_, stride_, bit_depth_));
268     ASM_REGISTER_STATE_CHECK(
269         partial_inv_txfm_(input_block_, output_block_, stride_, bit_depth_));
270     ASSERT_EQ(0, memcmp(output_block_ref_, output_block_,
271                         pixel_size_ * output_block_size_))
272         << "Error: Transform results are not correctly added to output.";
273   }
274 }
275 
TEST_P(PartialIDctTest,SingleExtremeCoeff)276 TEST_P(PartialIDctTest, SingleExtremeCoeff) {
277   const int16_t max_coeff = std::numeric_limits<int16_t>::max();
278   const int16_t min_coeff = std::numeric_limits<int16_t>::min();
279   for (int i = 0; i < last_nonzero_; ++i) {
280     memset(input_block_, 0, sizeof(*input_block_) * input_block_size_);
281     // Run once for min and once for max.
282     for (int j = 0; j < 2; ++j) {
283       const int coeff = j ? min_coeff : max_coeff;
284 
285       memset(output_block_, 0, pixel_size_ * output_block_size_);
286       memset(output_block_ref_, 0, pixel_size_ * output_block_size_);
287       input_block_[vp9_default_scan_orders[tx_size_].scan[i]] = coeff;
288 
289       ASM_REGISTER_STATE_CHECK(
290           full_inv_txfm_(input_block_, output_block_ref_, stride_, bit_depth_));
291       ASM_REGISTER_STATE_CHECK(
292           partial_inv_txfm_(input_block_, output_block_, stride_, bit_depth_));
293       ASSERT_EQ(0, memcmp(output_block_ref_, output_block_,
294                           pixel_size_ * output_block_size_))
295           << "Error: Fails with single coeff of " << coeff << " at " << i
296           << ".";
297     }
298   }
299 }
300 
TEST_P(PartialIDctTest,DISABLED_Speed)301 TEST_P(PartialIDctTest, DISABLED_Speed) {
302   // Keep runtime stable with transform size.
303   const int kCountSpeedTestBlock = 500000000 / input_block_size_;
304   InitMem();
305   InitInput();
306 
307   for (int i = 0; i < kCountSpeedTestBlock; ++i) {
308     ASM_REGISTER_STATE_CHECK(
309         full_inv_txfm_(input_block_, output_block_ref_, stride_, bit_depth_));
310   }
311   vpx_usec_timer timer;
312   vpx_usec_timer_start(&timer);
313   for (int i = 0; i < kCountSpeedTestBlock; ++i) {
314     partial_inv_txfm_(input_block_, output_block_, stride_, bit_depth_);
315   }
316   libvpx_test::ClearSystemState();
317   vpx_usec_timer_mark(&timer);
318   const int elapsed_time =
319       static_cast<int>(vpx_usec_timer_elapsed(&timer) / 1000);
320   printf("idct%dx%d_%d (%s %d) time: %5d ms\n", size_, size_, last_nonzero_,
321          (pixel_size_ == 1) ? "bitdepth" : "high bitdepth", bit_depth_,
322          elapsed_time);
323   ASSERT_EQ(0, memcmp(output_block_ref_, output_block_,
324                       pixel_size_ * output_block_size_))
325       << "Error: partial inverse transform produces different results";
326 }
327 
328 using std::make_tuple;
329 
330 const PartialInvTxfmParam c_partial_idct_tests[] = {
331 #if CONFIG_VP9_HIGHBITDEPTH
332   make_tuple(
333       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
334       &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, TX_32X32, 1024, 8, 2),
335   make_tuple(
336       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
337       &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, TX_32X32, 1024, 10, 2),
338   make_tuple(
339       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
340       &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, TX_32X32, 1024, 12, 2),
341   make_tuple(
342       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
343       &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, TX_32X32, 135, 8, 2),
344   make_tuple(
345       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
346       &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, TX_32X32, 135, 10, 2),
347   make_tuple(
348       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
349       &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, TX_32X32, 135, 12, 2),
350   make_tuple(
351       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
352       &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, TX_32X32, 34, 8, 2),
353   make_tuple(
354       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
355       &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, TX_32X32, 34, 10, 2),
356   make_tuple(
357       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
358       &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, TX_32X32, 34, 12, 2),
359   make_tuple(&vpx_highbd_fdct32x32_c,
360              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
361              &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, TX_32X32, 1, 8, 2),
362   make_tuple(&vpx_highbd_fdct32x32_c,
363              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
364              &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, TX_32X32, 1, 10, 2),
365   make_tuple(&vpx_highbd_fdct32x32_c,
366              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
367              &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, TX_32X32, 1, 12, 2),
368   make_tuple(
369       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
370       &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, TX_16X16, 256, 8, 2),
371   make_tuple(
372       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
373       &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, TX_16X16, 256, 10, 2),
374   make_tuple(
375       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
376       &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, TX_16X16, 256, 12, 2),
377   make_tuple(
378       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
379       &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, TX_16X16, 38, 8, 2),
380   make_tuple(
381       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
382       &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, TX_16X16, 38, 10, 2),
383   make_tuple(
384       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
385       &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, TX_16X16, 38, 12, 2),
386   make_tuple(
387       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
388       &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, TX_16X16, 10, 8, 2),
389   make_tuple(
390       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
391       &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, TX_16X16, 10, 10, 2),
392   make_tuple(
393       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
394       &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, TX_16X16, 10, 12, 2),
395   make_tuple(&vpx_highbd_fdct16x16_c,
396              &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
397              &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, TX_16X16, 1, 8, 2),
398   make_tuple(&vpx_highbd_fdct16x16_c,
399              &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
400              &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, TX_16X16, 1, 10, 2),
401   make_tuple(&vpx_highbd_fdct16x16_c,
402              &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
403              &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, TX_16X16, 1, 12, 2),
404   make_tuple(&vpx_highbd_fdct8x8_c,
405              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
406              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, TX_8X8, 64, 8, 2),
407   make_tuple(&vpx_highbd_fdct8x8_c,
408              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
409              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, TX_8X8, 64, 10, 2),
410   make_tuple(&vpx_highbd_fdct8x8_c,
411              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
412              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, TX_8X8, 64, 12, 2),
413   make_tuple(&vpx_highbd_fdct8x8_c,
414              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
415              &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, TX_8X8, 12, 8, 2),
416   make_tuple(&vpx_highbd_fdct8x8_c,
417              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
418              &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, TX_8X8, 12, 10, 2),
419   make_tuple(&vpx_highbd_fdct8x8_c,
420              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
421              &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, TX_8X8, 12, 12, 2),
422   make_tuple(&vpx_highbd_fdct8x8_c,
423              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
424              &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, TX_8X8, 1, 8, 2),
425   make_tuple(&vpx_highbd_fdct8x8_c,
426              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
427              &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, TX_8X8, 1, 10, 2),
428   make_tuple(&vpx_highbd_fdct8x8_c,
429              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
430              &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, TX_8X8, 1, 12, 2),
431   make_tuple(&vpx_highbd_fdct4x4_c,
432              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
433              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, TX_4X4, 16, 8, 2),
434   make_tuple(&vpx_highbd_fdct4x4_c,
435              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
436              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, TX_4X4, 16, 10, 2),
437   make_tuple(&vpx_highbd_fdct4x4_c,
438              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
439              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, TX_4X4, 16, 12, 2),
440   make_tuple(&vpx_highbd_fdct4x4_c,
441              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
442              &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, TX_4X4, 1, 8, 2),
443   make_tuple(&vpx_highbd_fdct4x4_c,
444              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
445              &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, TX_4X4, 1, 10, 2),
446   make_tuple(&vpx_highbd_fdct4x4_c,
447              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
448              &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, TX_4X4, 1, 12, 2),
449 #endif  // CONFIG_VP9_HIGHBITDEPTH
450   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
451              &wrapper<vpx_idct32x32_1024_add_c>, TX_32X32, 1024, 8, 1),
452   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
453              &wrapper<vpx_idct32x32_135_add_c>, TX_32X32, 135, 8, 1),
454   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
455              &wrapper<vpx_idct32x32_34_add_c>, TX_32X32, 34, 8, 1),
456   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
457              &wrapper<vpx_idct32x32_1_add_c>, TX_32X32, 1, 8, 1),
458   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
459              &wrapper<vpx_idct16x16_256_add_c>, TX_16X16, 256, 8, 1),
460   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
461              &wrapper<vpx_idct16x16_38_add_c>, TX_16X16, 38, 8, 1),
462   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
463              &wrapper<vpx_idct16x16_10_add_c>, TX_16X16, 10, 8, 1),
464   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
465              &wrapper<vpx_idct16x16_1_add_c>, TX_16X16, 1, 8, 1),
466   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
467              &wrapper<vpx_idct8x8_64_add_c>, TX_8X8, 64, 8, 1),
468   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
469              &wrapper<vpx_idct8x8_12_add_c>, TX_8X8, 12, 8, 1),
470   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
471              &wrapper<vpx_idct8x8_1_add_c>, TX_8X8, 1, 8, 1),
472   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>,
473              &wrapper<vpx_idct4x4_16_add_c>, TX_4X4, 16, 8, 1),
474   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>,
475              &wrapper<vpx_idct4x4_1_add_c>, TX_4X4, 1, 8, 1)
476 };
477 
478 INSTANTIATE_TEST_SUITE_P(C, PartialIDctTest,
479                          ::testing::ValuesIn(c_partial_idct_tests));
480 
481 #if !CONFIG_EMULATE_HARDWARE
482 
483 #if HAVE_NEON
484 const PartialInvTxfmParam neon_partial_idct_tests[] = {
485 #if CONFIG_VP9_HIGHBITDEPTH
486   make_tuple(&vpx_highbd_fdct32x32_c,
487              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
488              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_neon>, TX_32X32,
489              1024, 8, 2),
490   make_tuple(&vpx_highbd_fdct32x32_c,
491              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
492              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_neon>, TX_32X32,
493              1024, 10, 2),
494   make_tuple(&vpx_highbd_fdct32x32_c,
495              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
496              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_neon>, TX_32X32,
497              1024, 12, 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, 8, 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, 10, 2),
504   make_tuple(
505       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>,
506       &highbd_wrapper<vpx_highbd_idct32x32_135_add_neon>, TX_32X32, 135, 12, 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, 8, 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, 10, 2),
513   make_tuple(
514       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>,
515       &highbd_wrapper<vpx_highbd_idct32x32_34_add_neon>, TX_32X32, 34, 12, 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, 8, 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, 10, 2),
522   make_tuple(
523       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>,
524       &highbd_wrapper<vpx_highbd_idct32x32_1_add_neon>, TX_32X32, 1, 12, 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, 8, 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, 10, 2),
531   make_tuple(
532       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
533       &highbd_wrapper<vpx_highbd_idct16x16_256_add_neon>, TX_16X16, 256, 12, 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, 8, 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, 10, 2),
540   make_tuple(
541       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>,
542       &highbd_wrapper<vpx_highbd_idct16x16_38_add_neon>, TX_16X16, 38, 12, 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, 8, 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, 10, 2),
549   make_tuple(
550       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>,
551       &highbd_wrapper<vpx_highbd_idct16x16_10_add_neon>, TX_16X16, 10, 12, 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, 8, 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, 10, 2),
558   make_tuple(
559       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>,
560       &highbd_wrapper<vpx_highbd_idct16x16_1_add_neon>, TX_16X16, 1, 12, 2),
561   make_tuple(&vpx_highbd_fdct8x8_c,
562              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
563              &highbd_wrapper<vpx_highbd_idct8x8_64_add_neon>, TX_8X8, 64, 8, 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, 10, 2),
567   make_tuple(
568       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
569       &highbd_wrapper<vpx_highbd_idct8x8_64_add_neon>, TX_8X8, 64, 12, 2),
570   make_tuple(&vpx_highbd_fdct8x8_c,
571              &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>,
572              &highbd_wrapper<vpx_highbd_idct8x8_12_add_neon>, TX_8X8, 12, 8, 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, 10, 2),
576   make_tuple(
577       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>,
578       &highbd_wrapper<vpx_highbd_idct8x8_12_add_neon>, TX_8X8, 12, 12, 2),
579   make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>,
580              &highbd_wrapper<vpx_highbd_idct8x8_1_add_neon>, TX_8X8, 1, 8, 2),
581   make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>,
582              &highbd_wrapper<vpx_highbd_idct8x8_1_add_neon>, TX_8X8, 1, 10, 2),
583   make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>,
584              &highbd_wrapper<vpx_highbd_idct8x8_1_add_neon>, TX_8X8, 1, 12, 2),
585   make_tuple(&vpx_highbd_fdct4x4_c,
586              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
587              &highbd_wrapper<vpx_highbd_idct4x4_16_add_neon>, TX_4X4, 16, 8, 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, 10, 2),
591   make_tuple(
592       &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
593       &highbd_wrapper<vpx_highbd_idct4x4_16_add_neon>, TX_4X4, 16, 12, 2),
594   make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>,
595              &highbd_wrapper<vpx_highbd_idct4x4_1_add_neon>, TX_4X4, 1, 8, 2),
596   make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>,
597              &highbd_wrapper<vpx_highbd_idct4x4_1_add_neon>, TX_4X4, 1, 10, 2),
598   make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>,
599              &highbd_wrapper<vpx_highbd_idct4x4_1_add_neon>, TX_4X4, 1, 12, 2),
600 #endif  // CONFIG_VP9_HIGHBITDEPTH
601   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
602              &wrapper<vpx_idct32x32_1024_add_neon>, TX_32X32, 1024, 8, 1),
603   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_135_add_c>,
604              &wrapper<vpx_idct32x32_135_add_neon>, TX_32X32, 135, 8, 1),
605   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>,
606              &wrapper<vpx_idct32x32_34_add_neon>, TX_32X32, 34, 8, 1),
607   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1_add_c>,
608              &wrapper<vpx_idct32x32_1_add_neon>, TX_32X32, 1, 8, 1),
609   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
610              &wrapper<vpx_idct16x16_256_add_neon>, TX_16X16, 256, 8, 1),
611   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_38_add_c>,
612              &wrapper<vpx_idct16x16_38_add_neon>, TX_16X16, 38, 8, 1),
613   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_10_add_c>,
614              &wrapper<vpx_idct16x16_10_add_neon>, TX_16X16, 10, 8, 1),
615   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_1_add_c>,
616              &wrapper<vpx_idct16x16_1_add_neon>, TX_16X16, 1, 8, 1),
617   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
618              &wrapper<vpx_idct8x8_64_add_neon>, TX_8X8, 64, 8, 1),
619   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>,
620              &wrapper<vpx_idct8x8_12_add_neon>, TX_8X8, 12, 8, 1),
621   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_1_add_c>,
622              &wrapper<vpx_idct8x8_1_add_neon>, TX_8X8, 1, 8, 1),
623   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>,
624              &wrapper<vpx_idct4x4_16_add_neon>, TX_4X4, 16, 8, 1),
625   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_1_add_c>,
626              &wrapper<vpx_idct4x4_1_add_neon>, TX_4X4, 1, 8, 1)
627 };
628 
629 INSTANTIATE_TEST_SUITE_P(NEON, PartialIDctTest,
630                          ::testing::ValuesIn(neon_partial_idct_tests));
631 #endif  // HAVE_NEON
632 
633 #if HAVE_SSE2
634 // 32x32_135_ is implemented using the 1024 version.
635 const PartialInvTxfmParam sse2_partial_idct_tests[] = {
636 #if CONFIG_VP9_HIGHBITDEPTH
637   make_tuple(&vpx_highbd_fdct32x32_c,
638              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
639              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_sse2>, TX_32X32,
640              1024, 8, 2),
641   make_tuple(&vpx_highbd_fdct32x32_c,
642              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
643              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_sse2>, TX_32X32,
644              1024, 10, 2),
645   make_tuple(&vpx_highbd_fdct32x32_c,
646              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
647              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_sse2>, TX_32X32,
648              1024, 12, 2),
649   make_tuple(
650       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>,
651       &highbd_wrapper<vpx_highbd_idct32x32_135_add_sse2>, TX_32X32, 135, 8, 2),
652   make_tuple(
653       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>,
654       &highbd_wrapper<vpx_highbd_idct32x32_135_add_sse2>, TX_32X32, 135, 10, 2),
655   make_tuple(
656       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>,
657       &highbd_wrapper<vpx_highbd_idct32x32_135_add_sse2>, TX_32X32, 135, 12, 2),
658   make_tuple(
659       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>,
660       &highbd_wrapper<vpx_highbd_idct32x32_34_add_sse2>, TX_32X32, 34, 8, 2),
661   make_tuple(
662       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>,
663       &highbd_wrapper<vpx_highbd_idct32x32_34_add_sse2>, TX_32X32, 34, 10, 2),
664   make_tuple(
665       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>,
666       &highbd_wrapper<vpx_highbd_idct32x32_34_add_sse2>, TX_32X32, 34, 12, 2),
667   make_tuple(
668       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>,
669       &highbd_wrapper<vpx_highbd_idct32x32_1_add_sse2>, TX_32X32, 1, 8, 2),
670   make_tuple(
671       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>,
672       &highbd_wrapper<vpx_highbd_idct32x32_1_add_sse2>, TX_32X32, 1, 10, 2),
673   make_tuple(
674       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>,
675       &highbd_wrapper<vpx_highbd_idct32x32_1_add_sse2>, TX_32X32, 1, 12, 2),
676   make_tuple(
677       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
678       &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse2>, TX_16X16, 256, 8, 2),
679   make_tuple(
680       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
681       &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse2>, TX_16X16, 256, 10, 2),
682   make_tuple(
683       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
684       &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse2>, TX_16X16, 256, 12, 2),
685   make_tuple(
686       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>,
687       &highbd_wrapper<vpx_highbd_idct16x16_38_add_sse2>, TX_16X16, 38, 8, 2),
688   make_tuple(
689       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>,
690       &highbd_wrapper<vpx_highbd_idct16x16_38_add_sse2>, TX_16X16, 38, 10, 2),
691   make_tuple(
692       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>,
693       &highbd_wrapper<vpx_highbd_idct16x16_38_add_sse2>, TX_16X16, 38, 12, 2),
694   make_tuple(
695       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>,
696       &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse2>, TX_16X16, 10, 8, 2),
697   make_tuple(
698       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>,
699       &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse2>, TX_16X16, 10, 10, 2),
700   make_tuple(
701       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>,
702       &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse2>, TX_16X16, 10, 12, 2),
703   make_tuple(
704       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>,
705       &highbd_wrapper<vpx_highbd_idct16x16_1_add_sse2>, TX_16X16, 1, 8, 2),
706   make_tuple(
707       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>,
708       &highbd_wrapper<vpx_highbd_idct16x16_1_add_sse2>, TX_16X16, 1, 10, 2),
709   make_tuple(
710       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>,
711       &highbd_wrapper<vpx_highbd_idct16x16_1_add_sse2>, TX_16X16, 1, 12, 2),
712   make_tuple(&vpx_highbd_fdct8x8_c,
713              &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
714              &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse2>, TX_8X8, 64, 8, 2),
715   make_tuple(
716       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
717       &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse2>, TX_8X8, 64, 10, 2),
718   make_tuple(
719       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
720       &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse2>, TX_8X8, 64, 12, 2),
721   make_tuple(&vpx_highbd_fdct8x8_c,
722              &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>,
723              &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse2>, TX_8X8, 12, 8, 2),
724   make_tuple(
725       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>,
726       &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse2>, TX_8X8, 12, 10, 2),
727   make_tuple(
728       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>,
729       &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse2>, TX_8X8, 12, 12, 2),
730   make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>,
731              &highbd_wrapper<vpx_highbd_idct8x8_1_add_sse2>, TX_8X8, 1, 8, 2),
732   make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>,
733              &highbd_wrapper<vpx_highbd_idct8x8_1_add_sse2>, TX_8X8, 1, 10, 2),
734   make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>,
735              &highbd_wrapper<vpx_highbd_idct8x8_1_add_sse2>, TX_8X8, 1, 12, 2),
736   make_tuple(&vpx_highbd_fdct4x4_c,
737              &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
738              &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse2>, TX_4X4, 16, 8, 2),
739   make_tuple(
740       &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
741       &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse2>, TX_4X4, 16, 10, 2),
742   make_tuple(
743       &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
744       &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse2>, TX_4X4, 16, 12, 2),
745   make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>,
746              &highbd_wrapper<vpx_highbd_idct4x4_1_add_sse2>, TX_4X4, 1, 8, 2),
747   make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>,
748              &highbd_wrapper<vpx_highbd_idct4x4_1_add_sse2>, TX_4X4, 1, 10, 2),
749   make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>,
750              &highbd_wrapper<vpx_highbd_idct4x4_1_add_sse2>, TX_4X4, 1, 12, 2),
751 #endif  // CONFIG_VP9_HIGHBITDEPTH
752   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
753              &wrapper<vpx_idct32x32_1024_add_sse2>, TX_32X32, 1024, 8, 1),
754   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_135_add_c>,
755              &wrapper<vpx_idct32x32_135_add_sse2>, TX_32X32, 135, 8, 1),
756   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>,
757              &wrapper<vpx_idct32x32_34_add_sse2>, TX_32X32, 34, 8, 1),
758   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1_add_c>,
759              &wrapper<vpx_idct32x32_1_add_sse2>, TX_32X32, 1, 8, 1),
760   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
761              &wrapper<vpx_idct16x16_256_add_sse2>, TX_16X16, 256, 8, 1),
762   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_38_add_c>,
763              &wrapper<vpx_idct16x16_38_add_sse2>, TX_16X16, 38, 8, 1),
764   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_10_add_c>,
765              &wrapper<vpx_idct16x16_10_add_sse2>, TX_16X16, 10, 8, 1),
766   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_1_add_c>,
767              &wrapper<vpx_idct16x16_1_add_sse2>, TX_16X16, 1, 8, 1),
768   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
769              &wrapper<vpx_idct8x8_64_add_sse2>, TX_8X8, 64, 8, 1),
770   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>,
771              &wrapper<vpx_idct8x8_12_add_sse2>, TX_8X8, 12, 8, 1),
772   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_1_add_c>,
773              &wrapper<vpx_idct8x8_1_add_sse2>, TX_8X8, 1, 8, 1),
774   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>,
775              &wrapper<vpx_idct4x4_16_add_sse2>, TX_4X4, 16, 8, 1),
776   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_1_add_c>,
777              &wrapper<vpx_idct4x4_1_add_sse2>, TX_4X4, 1, 8, 1)
778 };
779 
780 INSTANTIATE_TEST_SUITE_P(SSE2, PartialIDctTest,
781                          ::testing::ValuesIn(sse2_partial_idct_tests));
782 
783 #endif  // HAVE_SSE2
784 
785 #if HAVE_SSSE3
786 const PartialInvTxfmParam ssse3_partial_idct_tests[] = {
787   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_135_add_c>,
788              &wrapper<vpx_idct32x32_135_add_ssse3>, TX_32X32, 135, 8, 1),
789   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>,
790              &wrapper<vpx_idct32x32_34_add_ssse3>, TX_32X32, 34, 8, 1),
791   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>,
792              &wrapper<vpx_idct8x8_12_add_ssse3>, TX_8X8, 12, 8, 1)
793 };
794 
795 INSTANTIATE_TEST_SUITE_P(SSSE3, PartialIDctTest,
796                          ::testing::ValuesIn(ssse3_partial_idct_tests));
797 #endif  // HAVE_SSSE3
798 
799 #if HAVE_SSE4_1 && CONFIG_VP9_HIGHBITDEPTH
800 const PartialInvTxfmParam sse4_1_partial_idct_tests[] = {
801   make_tuple(&vpx_highbd_fdct32x32_c,
802              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
803              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_sse4_1>, TX_32X32,
804              1024, 8, 2),
805   make_tuple(&vpx_highbd_fdct32x32_c,
806              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
807              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_sse4_1>, TX_32X32,
808              1024, 10, 2),
809   make_tuple(&vpx_highbd_fdct32x32_c,
810              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>,
811              &highbd_wrapper<vpx_highbd_idct32x32_1024_add_sse4_1>, TX_32X32,
812              1024, 12, 2),
813   make_tuple(&vpx_highbd_fdct32x32_c,
814              &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>,
815              &highbd_wrapper<vpx_highbd_idct32x32_135_add_sse4_1>, TX_32X32,
816              135, 8, 2),
817   make_tuple(&vpx_highbd_fdct32x32_c,
818              &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>,
819              &highbd_wrapper<vpx_highbd_idct32x32_135_add_sse4_1>, TX_32X32,
820              135, 10, 2),
821   make_tuple(&vpx_highbd_fdct32x32_c,
822              &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>,
823              &highbd_wrapper<vpx_highbd_idct32x32_135_add_sse4_1>, TX_32X32,
824              135, 12, 2),
825   make_tuple(
826       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>,
827       &highbd_wrapper<vpx_highbd_idct32x32_34_add_sse4_1>, TX_32X32, 34, 8, 2),
828   make_tuple(
829       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>,
830       &highbd_wrapper<vpx_highbd_idct32x32_34_add_sse4_1>, TX_32X32, 34, 10, 2),
831   make_tuple(
832       &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>,
833       &highbd_wrapper<vpx_highbd_idct32x32_34_add_sse4_1>, TX_32X32, 34, 12, 2),
834   make_tuple(&vpx_highbd_fdct16x16_c,
835              &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
836              &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse4_1>, TX_16X16,
837              256, 8, 2),
838   make_tuple(&vpx_highbd_fdct16x16_c,
839              &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
840              &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse4_1>, TX_16X16,
841              256, 10, 2),
842   make_tuple(&vpx_highbd_fdct16x16_c,
843              &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>,
844              &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse4_1>, TX_16X16,
845              256, 12, 2),
846   make_tuple(
847       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>,
848       &highbd_wrapper<vpx_highbd_idct16x16_38_add_sse4_1>, TX_16X16, 38, 8, 2),
849   make_tuple(
850       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>,
851       &highbd_wrapper<vpx_highbd_idct16x16_38_add_sse4_1>, TX_16X16, 38, 10, 2),
852   make_tuple(
853       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>,
854       &highbd_wrapper<vpx_highbd_idct16x16_38_add_sse4_1>, TX_16X16, 38, 12, 2),
855   make_tuple(
856       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>,
857       &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse4_1>, TX_16X16, 10, 8, 2),
858   make_tuple(
859       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>,
860       &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse4_1>, TX_16X16, 10, 10, 2),
861   make_tuple(
862       &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>,
863       &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse4_1>, TX_16X16, 10, 12, 2),
864   make_tuple(
865       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
866       &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse4_1>, TX_8X8, 64, 8, 2),
867   make_tuple(
868       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
869       &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse4_1>, TX_8X8, 64, 10, 2),
870   make_tuple(
871       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>,
872       &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse4_1>, TX_8X8, 64, 12, 2),
873   make_tuple(
874       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>,
875       &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse4_1>, TX_8X8, 12, 8, 2),
876   make_tuple(
877       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>,
878       &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse4_1>, TX_8X8, 12, 10, 2),
879   make_tuple(
880       &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>,
881       &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse4_1>, TX_8X8, 12, 12, 2),
882   make_tuple(
883       &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
884       &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse4_1>, TX_4X4, 16, 8, 2),
885   make_tuple(
886       &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
887       &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse4_1>, TX_4X4, 16, 10, 2),
888   make_tuple(
889       &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>,
890       &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse4_1>, TX_4X4, 16, 12, 2)
891 };
892 
893 INSTANTIATE_TEST_SUITE_P(SSE4_1, PartialIDctTest,
894                          ::testing::ValuesIn(sse4_1_partial_idct_tests));
895 #endif  // HAVE_SSE4_1 && CONFIG_VP9_HIGHBITDEPTH
896 
897 #if HAVE_DSPR2 && !CONFIG_VP9_HIGHBITDEPTH
898 const PartialInvTxfmParam dspr2_partial_idct_tests[] = {
899   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
900              &wrapper<vpx_idct32x32_1024_add_dspr2>, TX_32X32, 1024, 8, 1),
901   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>,
902              &wrapper<vpx_idct32x32_34_add_dspr2>, TX_32X32, 34, 8, 1),
903   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1_add_c>,
904              &wrapper<vpx_idct32x32_1_add_dspr2>, TX_32X32, 1, 8, 1),
905   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
906              &wrapper<vpx_idct16x16_256_add_dspr2>, TX_16X16, 256, 8, 1),
907   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_10_add_c>,
908              &wrapper<vpx_idct16x16_10_add_dspr2>, TX_16X16, 10, 8, 1),
909   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_1_add_c>,
910              &wrapper<vpx_idct16x16_1_add_dspr2>, TX_16X16, 1, 8, 1),
911   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
912              &wrapper<vpx_idct8x8_64_add_dspr2>, TX_8X8, 64, 8, 1),
913   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>,
914              &wrapper<vpx_idct8x8_12_add_dspr2>, TX_8X8, 12, 8, 1),
915   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_1_add_c>,
916              &wrapper<vpx_idct8x8_1_add_dspr2>, TX_8X8, 1, 8, 1),
917   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>,
918              &wrapper<vpx_idct4x4_16_add_dspr2>, TX_4X4, 16, 8, 1),
919   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_1_add_c>,
920              &wrapper<vpx_idct4x4_1_add_dspr2>, TX_4X4, 1, 8, 1)
921 };
922 
923 INSTANTIATE_TEST_SUITE_P(DSPR2, PartialIDctTest,
924                          ::testing::ValuesIn(dspr2_partial_idct_tests));
925 #endif  // HAVE_DSPR2 && !CONFIG_VP9_HIGHBITDEPTH
926 
927 #if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH
928 // 32x32_135_ is implemented using the 1024 version.
929 const PartialInvTxfmParam msa_partial_idct_tests[] = {
930   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
931              &wrapper<vpx_idct32x32_1024_add_msa>, TX_32X32, 1024, 8, 1),
932   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>,
933              &wrapper<vpx_idct32x32_34_add_msa>, TX_32X32, 34, 8, 1),
934   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1_add_c>,
935              &wrapper<vpx_idct32x32_1_add_msa>, TX_32X32, 1, 8, 1),
936   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>,
937              &wrapper<vpx_idct16x16_256_add_msa>, TX_16X16, 256, 8, 1),
938   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_10_add_c>,
939              &wrapper<vpx_idct16x16_10_add_msa>, TX_16X16, 10, 8, 1),
940   make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_1_add_c>,
941              &wrapper<vpx_idct16x16_1_add_msa>, TX_16X16, 1, 8, 1),
942   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>,
943              &wrapper<vpx_idct8x8_64_add_msa>, TX_8X8, 64, 8, 1),
944   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>,
945              &wrapper<vpx_idct8x8_12_add_msa>, TX_8X8, 12, 8, 1),
946   make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_1_add_c>,
947              &wrapper<vpx_idct8x8_1_add_msa>, TX_8X8, 1, 8, 1),
948   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>,
949              &wrapper<vpx_idct4x4_16_add_msa>, TX_4X4, 16, 8, 1),
950   make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_1_add_c>,
951              &wrapper<vpx_idct4x4_1_add_msa>, TX_4X4, 1, 8, 1)
952 };
953 
954 INSTANTIATE_TEST_SUITE_P(MSA, PartialIDctTest,
955                          ::testing::ValuesIn(msa_partial_idct_tests));
956 #endif  // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH
957 
958 #if HAVE_LSX && !CONFIG_VP9_HIGHBITDEPTH
959 const PartialInvTxfmParam lsx_partial_idct_tests[] = {
960   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>,
961              &wrapper<vpx_idct32x32_1024_add_lsx>, TX_32X32, 1024, 8, 1),
962   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>,
963              &wrapper<vpx_idct32x32_34_add_lsx>, TX_32X32, 34, 8, 1),
964   make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1_add_c>,
965              &wrapper<vpx_idct32x32_1_add_lsx>, TX_32X32, 1, 8, 1),
966 };
967 
968 INSTANTIATE_TEST_SUITE_P(LSX, PartialIDctTest,
969                          ::testing::ValuesIn(lsx_partial_idct_tests));
970 #endif  // HAVE_LSX && !CONFIG_VP9_HIGHBITDEPTH
971 
972 #endif  // !CONFIG_EMULATE_HARDWARE
973 
974 }  // namespace
975