blob: 3764ade7555323b44a8a8f66d579c140791c2e6d [file] [log] [blame]
Daniel Kangfed8a182012-08-02 17:03:14 -07001/*
2 * Copyright (c) 2012 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 "third_party/googletest/src/include/gtest/gtest.h"
Jingning Han8f92a7e2013-09-05 12:44:03 -070016#include "test/acm_random.h"
17#include "test/clear_system_state.h"
18#include "test/register_state_check.h"
19#include "test/util.h"
Daniel Kangfed8a182012-08-02 17:03:14 -070020
21extern "C" {
Yaowu Xuebd58082013-02-01 11:02:42 -080022#include "vp9/common/vp9_entropy.h"
Yaowu Xuafffa3d2013-09-05 08:45:56 -070023#include "./vp9_rtcd.h"
24void vp9_short_idct16x16_add_c(int16_t *input, uint8_t *output, int pitch);
Daniel Kangfed8a182012-08-02 17:03:14 -070025}
Daniel Kangfed8a182012-08-02 17:03:14 -070026#include "vpx/vpx_integer.h"
27
28using libvpx_test::ACMRandom;
29
30namespace {
31
Yaowu Xu77f889b2013-02-04 15:22:55 -080032#ifdef _MSC_VER
33static int round(double x) {
34 if (x < 0)
Yaowu Xuafffa3d2013-09-05 08:45:56 -070035 return static_cast<int>(ceil(x - 0.5));
Yaowu Xu77f889b2013-02-04 15:22:55 -080036 else
Yaowu Xuafffa3d2013-09-05 08:45:56 -070037 return static_cast<int>(floor(x + 0.5));
Yaowu Xu77f889b2013-02-04 15:22:55 -080038}
39#endif
40
Jingning Han8f92a7e2013-09-05 12:44:03 -070041const int kNumCoeffs = 256;
Daniel Kangfed8a182012-08-02 17:03:14 -070042const double PI = 3.1415926535898;
43void reference2_16x16_idct_2d(double *input, double *output) {
44 double x;
45 for (int l = 0; l < 16; ++l) {
46 for (int k = 0; k < 16; ++k) {
47 double s = 0;
48 for (int i = 0; i < 16; ++i) {
49 for (int j = 0; j < 16; ++j) {
Yaowu Xuafffa3d2013-09-05 08:45:56 -070050 x = cos(PI * j * (l + 0.5) / 16.0) *
51 cos(PI * i * (k + 0.5) / 16.0) *
52 input[i * 16 + j] / 256;
Daniel Kangfed8a182012-08-02 17:03:14 -070053 if (i != 0)
54 x *= sqrt(2.0);
55 if (j != 0)
56 x *= sqrt(2.0);
57 s += x;
58 }
59 }
60 output[k*16+l] = s;
61 }
62 }
63}
64
Yaowu Xu0b17ea62012-08-07 13:55:49 -070065
Jingning Han8f92a7e2013-09-05 12:44:03 -070066const double C1 = 0.995184726672197;
67const double C2 = 0.98078528040323;
68const double C3 = 0.956940335732209;
69const double C4 = 0.923879532511287;
70const double C5 = 0.881921264348355;
71const double C6 = 0.831469612302545;
72const double C7 = 0.773010453362737;
73const double C8 = 0.707106781186548;
74const double C9 = 0.634393284163646;
75const double C10 = 0.555570233019602;
76const double C11 = 0.471396736825998;
77const double C12 = 0.38268343236509;
78const double C13 = 0.290284677254462;
79const double C14 = 0.195090322016128;
80const double C15 = 0.098017140329561;
Yaowu Xu0b17ea62012-08-07 13:55:49 -070081
Jingning Hanec4b2742013-08-27 17:03:46 -070082void butterfly_16x16_dct_1d(double input[16], double output[16]) {
Daniel Kangfed8a182012-08-02 17:03:14 -070083 double step[16];
84 double intermediate[16];
85 double temp1, temp2;
86
Daniel Kangfed8a182012-08-02 17:03:14 -070087 // step 1
88 step[ 0] = input[0] + input[15];
89 step[ 1] = input[1] + input[14];
90 step[ 2] = input[2] + input[13];
91 step[ 3] = input[3] + input[12];
92 step[ 4] = input[4] + input[11];
93 step[ 5] = input[5] + input[10];
94 step[ 6] = input[6] + input[ 9];
95 step[ 7] = input[7] + input[ 8];
96 step[ 8] = input[7] - input[ 8];
97 step[ 9] = input[6] - input[ 9];
98 step[10] = input[5] - input[10];
99 step[11] = input[4] - input[11];
100 step[12] = input[3] - input[12];
101 step[13] = input[2] - input[13];
102 step[14] = input[1] - input[14];
103 step[15] = input[0] - input[15];
104
105 // step 2
106 output[0] = step[0] + step[7];
107 output[1] = step[1] + step[6];
108 output[2] = step[2] + step[5];
109 output[3] = step[3] + step[4];
110 output[4] = step[3] - step[4];
111 output[5] = step[2] - step[5];
112 output[6] = step[1] - step[6];
113 output[7] = step[0] - step[7];
114
Jingning Han8f92a7e2013-09-05 12:44:03 -0700115 temp1 = step[ 8] * C7;
116 temp2 = step[15] * C9;
Daniel Kangfed8a182012-08-02 17:03:14 -0700117 output[ 8] = temp1 + temp2;
118
Jingning Han8f92a7e2013-09-05 12:44:03 -0700119 temp1 = step[ 9] * C11;
120 temp2 = step[14] * C5;
Daniel Kangfed8a182012-08-02 17:03:14 -0700121 output[ 9] = temp1 - temp2;
122
Jingning Han8f92a7e2013-09-05 12:44:03 -0700123 temp1 = step[10] * C3;
124 temp2 = step[13] * C13;
Daniel Kangfed8a182012-08-02 17:03:14 -0700125 output[10] = temp1 + temp2;
126
Jingning Han8f92a7e2013-09-05 12:44:03 -0700127 temp1 = step[11] * C15;
128 temp2 = step[12] * C1;
Daniel Kangfed8a182012-08-02 17:03:14 -0700129 output[11] = temp1 - temp2;
130
Jingning Han8f92a7e2013-09-05 12:44:03 -0700131 temp1 = step[11] * C1;
132 temp2 = step[12] * C15;
Daniel Kangfed8a182012-08-02 17:03:14 -0700133 output[12] = temp2 + temp1;
134
Jingning Han8f92a7e2013-09-05 12:44:03 -0700135 temp1 = step[10] * C13;
136 temp2 = step[13] * C3;
Daniel Kangfed8a182012-08-02 17:03:14 -0700137 output[13] = temp2 - temp1;
138
Jingning Han8f92a7e2013-09-05 12:44:03 -0700139 temp1 = step[ 9] * C5;
140 temp2 = step[14] * C11;
Daniel Kangfed8a182012-08-02 17:03:14 -0700141 output[14] = temp2 + temp1;
142
Jingning Han8f92a7e2013-09-05 12:44:03 -0700143 temp1 = step[ 8] * C9;
144 temp2 = step[15] * C7;
Daniel Kangfed8a182012-08-02 17:03:14 -0700145 output[15] = temp2 - temp1;
146
147 // step 3
148 step[ 0] = output[0] + output[3];
149 step[ 1] = output[1] + output[2];
150 step[ 2] = output[1] - output[2];
151 step[ 3] = output[0] - output[3];
152
Jingning Han8f92a7e2013-09-05 12:44:03 -0700153 temp1 = output[4] * C14;
154 temp2 = output[7] * C2;
Daniel Kangfed8a182012-08-02 17:03:14 -0700155 step[ 4] = temp1 + temp2;
156
Jingning Han8f92a7e2013-09-05 12:44:03 -0700157 temp1 = output[5] * C10;
158 temp2 = output[6] * C6;
Daniel Kangfed8a182012-08-02 17:03:14 -0700159 step[ 5] = temp1 + temp2;
160
Jingning Han8f92a7e2013-09-05 12:44:03 -0700161 temp1 = output[5] * C6;
162 temp2 = output[6] * C10;
Daniel Kangfed8a182012-08-02 17:03:14 -0700163 step[ 6] = temp2 - temp1;
164
Jingning Han8f92a7e2013-09-05 12:44:03 -0700165 temp1 = output[4] * C2;
166 temp2 = output[7] * C14;
Daniel Kangfed8a182012-08-02 17:03:14 -0700167 step[ 7] = temp2 - temp1;
168
169 step[ 8] = output[ 8] + output[11];
170 step[ 9] = output[ 9] + output[10];
171 step[10] = output[ 9] - output[10];
172 step[11] = output[ 8] - output[11];
173
174 step[12] = output[12] + output[15];
175 step[13] = output[13] + output[14];
176 step[14] = output[13] - output[14];
177 step[15] = output[12] - output[15];
178
179 // step 4
180 output[ 0] = (step[ 0] + step[ 1]);
181 output[ 8] = (step[ 0] - step[ 1]);
182
Jingning Han8f92a7e2013-09-05 12:44:03 -0700183 temp1 = step[2] * C12;
184 temp2 = step[3] * C4;
Daniel Kangfed8a182012-08-02 17:03:14 -0700185 temp1 = temp1 + temp2;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700186 output[ 4] = 2*(temp1 * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700187
Jingning Han8f92a7e2013-09-05 12:44:03 -0700188 temp1 = step[2] * C4;
189 temp2 = step[3] * C12;
Daniel Kangfed8a182012-08-02 17:03:14 -0700190 temp1 = temp2 - temp1;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700191 output[12] = 2 * (temp1 * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700192
Jingning Han8f92a7e2013-09-05 12:44:03 -0700193 output[ 2] = 2 * ((step[4] + step[ 5]) * C8);
194 output[14] = 2 * ((step[7] - step[ 6]) * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700195
196 temp1 = step[4] - step[5];
197 temp2 = step[6] + step[7];
198 output[ 6] = (temp1 + temp2);
199 output[10] = (temp1 - temp2);
200
201 intermediate[8] = step[8] + step[14];
202 intermediate[9] = step[9] + step[15];
203
Jingning Han8f92a7e2013-09-05 12:44:03 -0700204 temp1 = intermediate[8] * C12;
205 temp2 = intermediate[9] * C4;
Daniel Kangfed8a182012-08-02 17:03:14 -0700206 temp1 = temp1 - temp2;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700207 output[3] = 2 * (temp1 * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700208
Jingning Han8f92a7e2013-09-05 12:44:03 -0700209 temp1 = intermediate[8] * C4;
210 temp2 = intermediate[9] * C12;
Daniel Kangfed8a182012-08-02 17:03:14 -0700211 temp1 = temp2 + temp1;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700212 output[13] = 2 * (temp1 * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700213
Jingning Han8f92a7e2013-09-05 12:44:03 -0700214 output[ 9] = 2 * ((step[10] + step[11]) * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700215
216 intermediate[11] = step[10] - step[11];
217 intermediate[12] = step[12] + step[13];
218 intermediate[13] = step[12] - step[13];
219 intermediate[14] = step[ 8] - step[14];
220 intermediate[15] = step[ 9] - step[15];
221
222 output[15] = (intermediate[11] + intermediate[12]);
223 output[ 1] = -(intermediate[11] - intermediate[12]);
224
Jingning Han8f92a7e2013-09-05 12:44:03 -0700225 output[ 7] = 2 * (intermediate[13] * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700226
Jingning Han8f92a7e2013-09-05 12:44:03 -0700227 temp1 = intermediate[14] * C12;
228 temp2 = intermediate[15] * C4;
Daniel Kangfed8a182012-08-02 17:03:14 -0700229 temp1 = temp1 - temp2;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700230 output[11] = -2 * (temp1 * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700231
Jingning Han8f92a7e2013-09-05 12:44:03 -0700232 temp1 = intermediate[14] * C4;
233 temp2 = intermediate[15] * C12;
Daniel Kangfed8a182012-08-02 17:03:14 -0700234 temp1 = temp2 + temp1;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700235 output[ 5] = 2 * (temp1 * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700236}
237
Jingning Han8f92a7e2013-09-05 12:44:03 -0700238void reference_16x16_dct_2d(int16_t input[256], double output[256]) {
Daniel Kangfed8a182012-08-02 17:03:14 -0700239 // First transform columns
240 for (int i = 0; i < 16; ++i) {
241 double temp_in[16], temp_out[16];
242 for (int j = 0; j < 16; ++j)
Jingning Han8f92a7e2013-09-05 12:44:03 -0700243 temp_in[j] = input[j * 16 + i];
Daniel Kangfed8a182012-08-02 17:03:14 -0700244 butterfly_16x16_dct_1d(temp_in, temp_out);
245 for (int j = 0; j < 16; ++j)
Jingning Han8f92a7e2013-09-05 12:44:03 -0700246 output[j * 16 + i] = temp_out[j];
Daniel Kangfed8a182012-08-02 17:03:14 -0700247 }
248 // Then transform rows
249 for (int i = 0; i < 16; ++i) {
250 double temp_in[16], temp_out[16];
251 for (int j = 0; j < 16; ++j)
Jingning Han8f92a7e2013-09-05 12:44:03 -0700252 temp_in[j] = output[j + i * 16];
Daniel Kangfed8a182012-08-02 17:03:14 -0700253 butterfly_16x16_dct_1d(temp_in, temp_out);
254 // Scale by some magic number
255 for (int j = 0; j < 16; ++j)
Jingning Han8f92a7e2013-09-05 12:44:03 -0700256 output[j + i * 16] = temp_out[j]/2;
Daniel Kangfed8a182012-08-02 17:03:14 -0700257 }
258}
259
Jingning Han8f92a7e2013-09-05 12:44:03 -0700260typedef void (*fdct_t)(int16_t *in, int16_t *out, int stride);
261typedef void (*idct_t)(int16_t *in, uint8_t *out, int stride);
262typedef void (*fht_t) (int16_t *in, int16_t *out, int stride, int tx_type);
263typedef void (*iht_t) (int16_t *in, uint8_t *dst, int stride, int tx_type);
Jingning Hancf768b22013-07-09 16:16:49 -0700264
Jingning Han8f92a7e2013-09-05 12:44:03 -0700265class Trans16x16TestBase {
Jingning Hancf768b22013-07-09 16:16:49 -0700266 public:
Jingning Han8f92a7e2013-09-05 12:44:03 -0700267 virtual ~Trans16x16TestBase() {}
Jingning Hancf768b22013-07-09 16:16:49 -0700268
Jingning Han8f92a7e2013-09-05 12:44:03 -0700269 protected:
270 virtual void RunFwdTxfm(int16_t *in, int16_t *out,
271 uint8_t *dst, int stride) = 0;
272
273 virtual void RunInvTxfm(int16_t *in, int16_t *out,
274 uint8_t *dst, int stride) = 0;
275
276 void RunAccuracyCheck() {
277 ACMRandom rnd(ACMRandom::DeterministicSeed());
278 int max_error = 0;
279 int total_error = 0;
280 const int count_test_block = 10000;
281 for (int i = 0; i < count_test_block; ++i) {
282 DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, kNumCoeffs);
283 DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, kNumCoeffs);
284 DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
285 DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
286
287 for (int j = 0; j < kNumCoeffs; ++j) {
288 src[j] = rnd.Rand8();
289 dst[j] = rnd.Rand8();
290 // Initialize a test block with input range [-255, 255].
291 test_input_block[j] = src[j] - dst[j];
292 }
293
294 const int pitch = 32;
295 REGISTER_STATE_CHECK(RunFwdTxfm(test_input_block, test_temp_block,
296 dst, pitch));
297 REGISTER_STATE_CHECK(RunInvTxfm(test_input_block, test_temp_block,
298 dst, pitch));
299
300 for (int j = 0; j < kNumCoeffs; ++j) {
301 const int diff = dst[j] - src[j];
302 const int error = diff * diff;
303 if (max_error < error)
304 max_error = error;
305 total_error += error;
306 }
307 }
308
309 EXPECT_GE(1, max_error)
310 << "Error: 16x16 FHT/IHT has an individual round trip error > 1";
311
312 EXPECT_GE(count_test_block , total_error)
313 << "Error: 16x16 FHT/IHT has average round trip error > 1 per block";
314 }
315
316 void RunCoeffSizeCheck() {
317 ACMRandom rnd(ACMRandom::DeterministicSeed());
318 const int count_test_block = 1000;
319 for (int i = 0; i < count_test_block; ++i) {
320 DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
321 DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs);
322 DECLARE_ALIGNED_ARRAY(16, int16_t, output_block, kNumCoeffs);
323 DECLARE_ALIGNED_ARRAY(16, int16_t, output_extreme_block, kNumCoeffs);
324 DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
325
326 // Initialize a test block with input range [-255, 255].
327 for (int j = 0; j < kNumCoeffs; ++j) {
328 input_block[j] = rnd.Rand8() - rnd.Rand8();
329 input_extreme_block[j] = rnd.Rand8() % 2 ? 255 : -255;
330 }
331 if (i == 0)
332 for (int j = 0; j < kNumCoeffs; ++j)
333 input_extreme_block[j] = 255;
334
335 const int pitch = 32;
336 REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, dst, pitch));
337 REGISTER_STATE_CHECK(RunFwdTxfm(input_extreme_block,
338 output_extreme_block, dst, pitch));
339
340 // The minimum quant value is 4.
341 for (int j = 0; j < kNumCoeffs; ++j) {
342 EXPECT_GE(4 * DCT_MAX_VALUE, abs(output_block[j]))
343 << "Error: 16x16 FDCT has coefficient larger than 4*DCT_MAX_VALUE";
344 EXPECT_GE(4 * DCT_MAX_VALUE, abs(output_extreme_block[j]))
345 << "Error: 16x16 FDCT extreme has coefficient larger "
346 << "than 4*DCT_MAX_VALUE";
347 }
Jingning Hancf768b22013-07-09 16:16:49 -0700348 }
349 }
350
Jingning Han8f92a7e2013-09-05 12:44:03 -0700351 void RunInvAccuracyCheck() {
352 ACMRandom rnd(ACMRandom::DeterministicSeed());
353 const int count_test_block = 1000;
354
355 for (int i = 0; i < count_test_block; ++i) {
356 DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
357 DECLARE_ALIGNED_ARRAY(16, int16_t, coeff, kNumCoeffs);
358 DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
359 DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
360 double out_r[kNumCoeffs];
361
362 // Initialize a test block with input range [-255, 255].
363 for (int j = 0; j < kNumCoeffs; ++j) {
364 src[j] = rnd.Rand8();
365 dst[j] = rnd.Rand8();
366 in[j] = src[j] - dst[j];
367 }
368
369 reference_16x16_dct_2d(in, out_r);
370 for (int j = 0; j < kNumCoeffs; ++j)
371 coeff[j] = round(out_r[j]);
372
373 const int pitch = 32;
374 REGISTER_STATE_CHECK(RunInvTxfm(coeff, coeff, dst, pitch));
375
376 for (int j = 0; j < kNumCoeffs; ++j) {
377 const int diff = dst[j] - src[j];
378 const int error = diff * diff;
379 EXPECT_GE(1, error)
380 << "Error: 16x16 IDCT has error " << error
381 << " at index " << j;
382 }
383 }
Jingning Hancf768b22013-07-09 16:16:49 -0700384 }
Jingning Han8f92a7e2013-09-05 12:44:03 -0700385};
386
387class Trans16x16DCT : public Trans16x16TestBase,
388 public PARAMS(fdct_t, idct_t, int) {
389 public:
390 virtual ~Trans16x16DCT() {}
391
392 virtual void SetUp() {
393 fwd_txfm_ = GET_PARAM(0);
394 inv_txfm_ = GET_PARAM(1);
395 tx_type_ = GET_PARAM(2);
396 }
397 virtual void TearDown() { libvpx_test::ClearSystemState(); }
398
399 protected:
400 void RunFwdTxfm(int16_t *in, int16_t *out, uint8_t *dst, int stride) {
401 fwd_txfm_(in, out, stride);
402 }
403 void RunInvTxfm(int16_t *in, int16_t *out, uint8_t *dst, int stride) {
404 inv_txfm_(out, dst, stride >> 1);
Jingning Hancf768b22013-07-09 16:16:49 -0700405 }
406
407 int tx_type_;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700408 fdct_t fwd_txfm_;
409 idct_t inv_txfm_;
Jingning Hancf768b22013-07-09 16:16:49 -0700410};
411
Jingning Han8f92a7e2013-09-05 12:44:03 -0700412TEST_P(Trans16x16DCT, AccuracyCheck) {
413 RunAccuracyCheck();
Jingning Hancf768b22013-07-09 16:16:49 -0700414}
415
Jingning Han8f92a7e2013-09-05 12:44:03 -0700416TEST_P(Trans16x16DCT, CoeffSizeCheck) {
417 RunCoeffSizeCheck();
Jingning Hancf768b22013-07-09 16:16:49 -0700418}
419
Jingning Han8f92a7e2013-09-05 12:44:03 -0700420TEST_P(Trans16x16DCT, InvAccuracyCheck) {
421 RunInvAccuracyCheck();
Daniel Kangfed8a182012-08-02 17:03:14 -0700422}
Scott LaVarnwaya272ff22013-05-15 13:16:02 -0400423
Jingning Han8f92a7e2013-09-05 12:44:03 -0700424class Trans16x16HT : public Trans16x16TestBase,
425 public PARAMS(fht_t, iht_t, int) {
426 public:
427 virtual ~Trans16x16HT() {}
428
429 virtual void SetUp() {
430 fwd_txfm_ = GET_PARAM(0);
431 inv_txfm_ = GET_PARAM(1);
432 tx_type_ = GET_PARAM(2);
433 }
434 virtual void TearDown() { libvpx_test::ClearSystemState(); }
435
436 protected:
437 void RunFwdTxfm(int16_t *in, int16_t *out, uint8_t *dst, int stride) {
438 fwd_txfm_(in, out, stride >> 1, tx_type_);
439 }
440 void RunInvTxfm(int16_t *in, int16_t *out, uint8_t *dst, int stride) {
441 inv_txfm_(out, dst, stride >> 1, tx_type_);
442 }
443
444 int tx_type_;
445 fht_t fwd_txfm_;
446 iht_t inv_txfm_;
447};
448
449TEST_P(Trans16x16HT, AccuracyCheck) {
450 RunAccuracyCheck();
451}
452
453TEST_P(Trans16x16HT, CoeffSizeCheck) {
454 RunCoeffSizeCheck();
455}
456
457using std::tr1::make_tuple;
458
459INSTANTIATE_TEST_CASE_P(
460 C, Trans16x16DCT,
461 ::testing::Values(
462 make_tuple(&vp9_short_fdct16x16_c, &vp9_short_idct16x16_add_c, 0)));
463INSTANTIATE_TEST_CASE_P(
464 C, Trans16x16HT,
465 ::testing::Values(
466 make_tuple(&vp9_short_fht16x16_c, &vp9_short_iht16x16_add_c, 0),
467 make_tuple(&vp9_short_fht16x16_c, &vp9_short_iht16x16_add_c, 1),
468 make_tuple(&vp9_short_fht16x16_c, &vp9_short_iht16x16_add_c, 2),
469 make_tuple(&vp9_short_fht16x16_c, &vp9_short_iht16x16_add_c, 3)));
470
471#if HAVE_SSE2
472INSTANTIATE_TEST_CASE_P(
473 SSE2, Trans16x16DCT,
474 ::testing::Values(
475 make_tuple(&vp9_short_fdct16x16_sse2, &vp9_short_idct16x16_add_c, 0)));
476INSTANTIATE_TEST_CASE_P(
477 SSE2, Trans16x16HT,
478 ::testing::Values(
479 make_tuple(&vp9_short_fht16x16_sse2, &vp9_short_iht16x16_add_sse2, 0),
480 make_tuple(&vp9_short_fht16x16_sse2, &vp9_short_iht16x16_add_sse2, 1),
481 make_tuple(&vp9_short_fht16x16_sse2, &vp9_short_iht16x16_add_sse2, 2),
482 make_tuple(&vp9_short_fht16x16_sse2, &vp9_short_iht16x16_add_sse2, 3)));
483#endif
Daniel Kangfed8a182012-08-02 17:03:14 -0700484} // namespace