blob: b4bb14fada42fde79643a58569e8126704b5b434 [file] [log] [blame]
Daniel Kangfed8a182012-08-02 17:03:14 -07001/*
Yaowu Xu2ab7ff02016-09-02 12:04:54 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Daniel Kangfed8a182012-08-02 17:03:14 -07003 *
Yaowu Xu2ab7ff02016-09-02 12:04:54 -07004 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 * Media Patent License 1.0 was not distributed with this source code in the
9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10*/
Daniel Kangfed8a182012-08-02 17:03:14 -070011
12#include <math.h>
13#include <stdlib.h>
14#include <string.h>
15
16#include "third_party/googletest/src/include/gtest/gtest.h"
Jingning Han097d59c2015-07-29 14:51:36 -070017
Yaowu Xuf883b422016-08-30 14:01:10 -070018#include "./av1_rtcd.h"
19#include "./aom_dsp_rtcd.h"
Jingning Han8f92a7e2013-09-05 12:44:03 -070020#include "test/acm_random.h"
21#include "test/clear_system_state.h"
22#include "test/register_state_check.h"
23#include "test/util.h"
Yaowu Xuc27fc142016-08-22 16:08:15 -070024#include "av1/common/entropy.h"
25#include "av1/common/scan.h"
Yaowu Xuf883b422016-08-30 14:01:10 -070026#include "aom/aom_codec.h"
27#include "aom/aom_integer.h"
Yaowu Xuc27fc142016-08-22 16:08:15 -070028#include "aom_ports/mem.h"
29#include "aom_ports/msvc.h" // for round()
James Zern002ad402014-01-18 13:03:31 -080030
Yaowu Xuc27fc142016-08-22 16:08:15 -070031using libaom_test::ACMRandom;
Daniel Kangfed8a182012-08-02 17:03:14 -070032
33namespace {
34
Jingning Han8f92a7e2013-09-05 12:44:03 -070035const int kNumCoeffs = 256;
Jingning Han8f92a7e2013-09-05 12:44:03 -070036const double C1 = 0.995184726672197;
37const double C2 = 0.98078528040323;
38const double C3 = 0.956940335732209;
39const double C4 = 0.923879532511287;
40const double C5 = 0.881921264348355;
41const double C6 = 0.831469612302545;
42const double C7 = 0.773010453362737;
43const double C8 = 0.707106781186548;
44const double C9 = 0.634393284163646;
45const double C10 = 0.555570233019602;
46const double C11 = 0.471396736825998;
47const double C12 = 0.38268343236509;
48const double C13 = 0.290284677254462;
49const double C14 = 0.195090322016128;
50const double C15 = 0.098017140329561;
Yaowu Xu0b17ea62012-08-07 13:55:49 -070051
Jingning Hanec4b2742013-08-27 17:03:46 -070052void butterfly_16x16_dct_1d(double input[16], double output[16]) {
Daniel Kangfed8a182012-08-02 17:03:14 -070053 double step[16];
54 double intermediate[16];
55 double temp1, temp2;
56
Daniel Kangfed8a182012-08-02 17:03:14 -070057 // step 1
clang-format3a826f12016-08-11 17:46:05 -070058 step[0] = input[0] + input[15];
59 step[1] = input[1] + input[14];
60 step[2] = input[2] + input[13];
61 step[3] = input[3] + input[12];
62 step[4] = input[4] + input[11];
63 step[5] = input[5] + input[10];
64 step[6] = input[6] + input[9];
65 step[7] = input[7] + input[8];
66 step[8] = input[7] - input[8];
67 step[9] = input[6] - input[9];
Daniel Kangfed8a182012-08-02 17:03:14 -070068 step[10] = input[5] - input[10];
69 step[11] = input[4] - input[11];
70 step[12] = input[3] - input[12];
71 step[13] = input[2] - input[13];
72 step[14] = input[1] - input[14];
73 step[15] = input[0] - input[15];
74
75 // step 2
76 output[0] = step[0] + step[7];
77 output[1] = step[1] + step[6];
78 output[2] = step[2] + step[5];
79 output[3] = step[3] + step[4];
80 output[4] = step[3] - step[4];
81 output[5] = step[2] - step[5];
82 output[6] = step[1] - step[6];
83 output[7] = step[0] - step[7];
84
clang-format3a826f12016-08-11 17:46:05 -070085 temp1 = step[8] * C7;
Jingning Han8f92a7e2013-09-05 12:44:03 -070086 temp2 = step[15] * C9;
clang-format3a826f12016-08-11 17:46:05 -070087 output[8] = temp1 + temp2;
Daniel Kangfed8a182012-08-02 17:03:14 -070088
clang-format3a826f12016-08-11 17:46:05 -070089 temp1 = step[9] * C11;
Jingning Han8f92a7e2013-09-05 12:44:03 -070090 temp2 = step[14] * C5;
clang-format3a826f12016-08-11 17:46:05 -070091 output[9] = temp1 - temp2;
Daniel Kangfed8a182012-08-02 17:03:14 -070092
Jingning Han8f92a7e2013-09-05 12:44:03 -070093 temp1 = step[10] * C3;
94 temp2 = step[13] * C13;
Daniel Kangfed8a182012-08-02 17:03:14 -070095 output[10] = temp1 + temp2;
96
Jingning Han8f92a7e2013-09-05 12:44:03 -070097 temp1 = step[11] * C15;
98 temp2 = step[12] * C1;
Daniel Kangfed8a182012-08-02 17:03:14 -070099 output[11] = temp1 - temp2;
100
Jingning Han8f92a7e2013-09-05 12:44:03 -0700101 temp1 = step[11] * C1;
102 temp2 = step[12] * C15;
Daniel Kangfed8a182012-08-02 17:03:14 -0700103 output[12] = temp2 + temp1;
104
Jingning Han8f92a7e2013-09-05 12:44:03 -0700105 temp1 = step[10] * C13;
106 temp2 = step[13] * C3;
Daniel Kangfed8a182012-08-02 17:03:14 -0700107 output[13] = temp2 - temp1;
108
clang-format3a826f12016-08-11 17:46:05 -0700109 temp1 = step[9] * C5;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700110 temp2 = step[14] * C11;
Daniel Kangfed8a182012-08-02 17:03:14 -0700111 output[14] = temp2 + temp1;
112
clang-format3a826f12016-08-11 17:46:05 -0700113 temp1 = step[8] * C9;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700114 temp2 = step[15] * C7;
Daniel Kangfed8a182012-08-02 17:03:14 -0700115 output[15] = temp2 - temp1;
116
117 // step 3
clang-format3a826f12016-08-11 17:46:05 -0700118 step[0] = output[0] + output[3];
119 step[1] = output[1] + output[2];
120 step[2] = output[1] - output[2];
121 step[3] = output[0] - output[3];
Daniel Kangfed8a182012-08-02 17:03:14 -0700122
Jingning Han8f92a7e2013-09-05 12:44:03 -0700123 temp1 = output[4] * C14;
124 temp2 = output[7] * C2;
clang-format3a826f12016-08-11 17:46:05 -0700125 step[4] = temp1 + temp2;
Daniel Kangfed8a182012-08-02 17:03:14 -0700126
Jingning Han8f92a7e2013-09-05 12:44:03 -0700127 temp1 = output[5] * C10;
128 temp2 = output[6] * C6;
clang-format3a826f12016-08-11 17:46:05 -0700129 step[5] = temp1 + temp2;
Daniel Kangfed8a182012-08-02 17:03:14 -0700130
Jingning Han8f92a7e2013-09-05 12:44:03 -0700131 temp1 = output[5] * C6;
132 temp2 = output[6] * C10;
clang-format3a826f12016-08-11 17:46:05 -0700133 step[6] = temp2 - temp1;
Daniel Kangfed8a182012-08-02 17:03:14 -0700134
Jingning Han8f92a7e2013-09-05 12:44:03 -0700135 temp1 = output[4] * C2;
136 temp2 = output[7] * C14;
clang-format3a826f12016-08-11 17:46:05 -0700137 step[7] = temp2 - temp1;
Daniel Kangfed8a182012-08-02 17:03:14 -0700138
clang-format3a826f12016-08-11 17:46:05 -0700139 step[8] = output[8] + output[11];
140 step[9] = output[9] + output[10];
141 step[10] = output[9] - output[10];
142 step[11] = output[8] - output[11];
Daniel Kangfed8a182012-08-02 17:03:14 -0700143
144 step[12] = output[12] + output[15];
145 step[13] = output[13] + output[14];
146 step[14] = output[13] - output[14];
147 step[15] = output[12] - output[15];
148
149 // step 4
clang-format3a826f12016-08-11 17:46:05 -0700150 output[0] = (step[0] + step[1]);
151 output[8] = (step[0] - step[1]);
Daniel Kangfed8a182012-08-02 17:03:14 -0700152
Jingning Han8f92a7e2013-09-05 12:44:03 -0700153 temp1 = step[2] * C12;
154 temp2 = step[3] * C4;
Daniel Kangfed8a182012-08-02 17:03:14 -0700155 temp1 = temp1 + temp2;
clang-format3a826f12016-08-11 17:46:05 -0700156 output[4] = 2 * (temp1 * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700157
Jingning Han8f92a7e2013-09-05 12:44:03 -0700158 temp1 = step[2] * C4;
159 temp2 = step[3] * C12;
Daniel Kangfed8a182012-08-02 17:03:14 -0700160 temp1 = temp2 - temp1;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700161 output[12] = 2 * (temp1 * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700162
clang-format3a826f12016-08-11 17:46:05 -0700163 output[2] = 2 * ((step[4] + step[5]) * C8);
164 output[14] = 2 * ((step[7] - step[6]) * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700165
166 temp1 = step[4] - step[5];
167 temp2 = step[6] + step[7];
clang-format3a826f12016-08-11 17:46:05 -0700168 output[6] = (temp1 + temp2);
Daniel Kangfed8a182012-08-02 17:03:14 -0700169 output[10] = (temp1 - temp2);
170
171 intermediate[8] = step[8] + step[14];
172 intermediate[9] = step[9] + step[15];
173
Jingning Han8f92a7e2013-09-05 12:44:03 -0700174 temp1 = intermediate[8] * C12;
175 temp2 = intermediate[9] * C4;
Daniel Kangfed8a182012-08-02 17:03:14 -0700176 temp1 = temp1 - temp2;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700177 output[3] = 2 * (temp1 * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700178
Jingning Han8f92a7e2013-09-05 12:44:03 -0700179 temp1 = intermediate[8] * C4;
180 temp2 = intermediate[9] * C12;
Daniel Kangfed8a182012-08-02 17:03:14 -0700181 temp1 = temp2 + temp1;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700182 output[13] = 2 * (temp1 * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700183
clang-format3a826f12016-08-11 17:46:05 -0700184 output[9] = 2 * ((step[10] + step[11]) * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700185
186 intermediate[11] = step[10] - step[11];
187 intermediate[12] = step[12] + step[13];
188 intermediate[13] = step[12] - step[13];
clang-format3a826f12016-08-11 17:46:05 -0700189 intermediate[14] = step[8] - step[14];
190 intermediate[15] = step[9] - step[15];
Daniel Kangfed8a182012-08-02 17:03:14 -0700191
192 output[15] = (intermediate[11] + intermediate[12]);
clang-format3a826f12016-08-11 17:46:05 -0700193 output[1] = -(intermediate[11] - intermediate[12]);
Daniel Kangfed8a182012-08-02 17:03:14 -0700194
clang-format3a826f12016-08-11 17:46:05 -0700195 output[7] = 2 * (intermediate[13] * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700196
Jingning Han8f92a7e2013-09-05 12:44:03 -0700197 temp1 = intermediate[14] * C12;
198 temp2 = intermediate[15] * C4;
Daniel Kangfed8a182012-08-02 17:03:14 -0700199 temp1 = temp1 - temp2;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700200 output[11] = -2 * (temp1 * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700201
Jingning Han8f92a7e2013-09-05 12:44:03 -0700202 temp1 = intermediate[14] * C4;
203 temp2 = intermediate[15] * C12;
Daniel Kangfed8a182012-08-02 17:03:14 -0700204 temp1 = temp2 + temp1;
clang-format3a826f12016-08-11 17:46:05 -0700205 output[5] = 2 * (temp1 * C8);
Daniel Kangfed8a182012-08-02 17:03:14 -0700206}
207
Jingning Han8f92a7e2013-09-05 12:44:03 -0700208void reference_16x16_dct_2d(int16_t input[256], double output[256]) {
Daniel Kangfed8a182012-08-02 17:03:14 -0700209 // First transform columns
210 for (int i = 0; i < 16; ++i) {
211 double temp_in[16], temp_out[16];
clang-format3a826f12016-08-11 17:46:05 -0700212 for (int j = 0; j < 16; ++j) temp_in[j] = input[j * 16 + i];
Daniel Kangfed8a182012-08-02 17:03:14 -0700213 butterfly_16x16_dct_1d(temp_in, temp_out);
clang-format3a826f12016-08-11 17:46:05 -0700214 for (int j = 0; j < 16; ++j) output[j * 16 + i] = temp_out[j];
Daniel Kangfed8a182012-08-02 17:03:14 -0700215 }
216 // Then transform rows
217 for (int i = 0; i < 16; ++i) {
218 double temp_in[16], temp_out[16];
clang-format3a826f12016-08-11 17:46:05 -0700219 for (int j = 0; j < 16; ++j) temp_in[j] = output[j + i * 16];
Daniel Kangfed8a182012-08-02 17:03:14 -0700220 butterfly_16x16_dct_1d(temp_in, temp_out);
221 // Scale by some magic number
clang-format3a826f12016-08-11 17:46:05 -0700222 for (int j = 0; j < 16; ++j) output[j + i * 16] = temp_out[j] / 2;
Daniel Kangfed8a182012-08-02 17:03:14 -0700223 }
224}
225
Deb Mukherjee10783d42014-09-02 16:34:09 -0700226typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride);
227typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride);
228typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
James Zern44f84842014-07-16 18:53:33 -0700229 int tx_type);
Deb Mukherjee10783d42014-09-02 16:34:09 -0700230typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
James Zern44f84842014-07-16 18:53:33 -0700231 int tx_type);
Jingning Hancf768b22013-07-09 16:16:49 -0700232
Yaowu Xuf883b422016-08-30 14:01:10 -0700233typedef std::tr1::tuple<FdctFunc, IdctFunc, int, aom_bit_depth_t> Dct16x16Param;
234typedef std::tr1::tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t> Ht16x16Param;
235typedef std::tr1::tuple<IdctFunc, IdctFunc, int, aom_bit_depth_t>
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100236 Idct16x16Param;
Joshua Litt51490e52013-11-18 17:07:55 -0800237
Deb Mukherjee10783d42014-09-02 16:34:09 -0700238void fdct16x16_ref(const int16_t *in, tran_low_t *out, int stride,
James Zern632e4192014-08-22 12:11:42 -0700239 int /*tx_type*/) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700240 aom_fdct16x16_c(in, out, stride);
Jingning Han37705a32013-09-09 17:07:55 -0700241}
242
Deb Mukherjee10783d42014-09-02 16:34:09 -0700243void idct16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
James Zern632e4192014-08-22 12:11:42 -0700244 int /*tx_type*/) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700245 aom_idct16x16_256_add_c(in, dest, stride);
Jingning Han49b4a272014-05-29 12:50:54 -0700246}
247
clang-format3a826f12016-08-11 17:46:05 -0700248void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700249 av1_fht16x16_c(in, out, stride, tx_type);
Jingning Han37705a32013-09-09 17:07:55 -0700250}
251
Deb Mukherjee10783d42014-09-02 16:34:09 -0700252void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
253 int tx_type) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700254 av1_iht16x16_256_add_c(in, dest, stride, tx_type);
Jingning Han49b4a272014-05-29 12:50:54 -0700255}
256
Yaowu Xuf883b422016-08-30 14:01:10 -0700257#if CONFIG_AOM_HIGHBITDEPTH
Deb Mukherjee10783d42014-09-02 16:34:09 -0700258void idct16x16_10(const tran_low_t *in, uint8_t *out, int stride) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700259 aom_highbd_idct16x16_256_add_c(in, out, stride, 10);
Deb Mukherjee10783d42014-09-02 16:34:09 -0700260}
261
262void idct16x16_12(const tran_low_t *in, uint8_t *out, int stride) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700263 aom_highbd_idct16x16_256_add_c(in, out, stride, 12);
Deb Mukherjee10783d42014-09-02 16:34:09 -0700264}
265
266void idct16x16_10_ref(const tran_low_t *in, uint8_t *out, int stride,
Urvang Joshid71a2312016-07-14 12:33:48 -0700267 int /*tx_type*/) {
Deb Mukherjee10783d42014-09-02 16:34:09 -0700268 idct16x16_10(in, out, stride);
269}
270
271void idct16x16_12_ref(const tran_low_t *in, uint8_t *out, int stride,
Urvang Joshid71a2312016-07-14 12:33:48 -0700272 int /*tx_type*/) {
Deb Mukherjee10783d42014-09-02 16:34:09 -0700273 idct16x16_12(in, out, stride);
274}
275
276void iht16x16_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700277 av1_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 10);
Deb Mukherjee10783d42014-09-02 16:34:09 -0700278}
279
280void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700281 av1_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 12);
Deb Mukherjee10783d42014-09-02 16:34:09 -0700282}
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100283
James Zern81c16592016-02-02 19:42:19 -0800284#if HAVE_SSE2
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100285void idct16x16_10_add_10_c(const tran_low_t *in, uint8_t *out, int stride) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700286 aom_highbd_idct16x16_10_add_c(in, out, stride, 10);
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100287}
288
289void idct16x16_10_add_12_c(const tran_low_t *in, uint8_t *out, int stride) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700290 aom_highbd_idct16x16_10_add_c(in, out, stride, 12);
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100291}
292
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100293void idct16x16_256_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700294 aom_highbd_idct16x16_256_add_sse2(in, out, stride, 10);
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100295}
296
297void idct16x16_256_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700298 aom_highbd_idct16x16_256_add_sse2(in, out, stride, 12);
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100299}
300
301void idct16x16_10_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700302 aom_highbd_idct16x16_10_add_sse2(in, out, stride, 10);
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100303}
304
305void idct16x16_10_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700306 aom_highbd_idct16x16_10_add_sse2(in, out, stride, 12);
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100307}
308#endif // HAVE_SSE2
Yaowu Xuf883b422016-08-30 14:01:10 -0700309#endif // CONFIG_AOM_HIGHBITDEPTH
Deb Mukherjee10783d42014-09-02 16:34:09 -0700310
Jingning Han8f92a7e2013-09-05 12:44:03 -0700311class Trans16x16TestBase {
Jingning Hancf768b22013-07-09 16:16:49 -0700312 public:
Jingning Han8f92a7e2013-09-05 12:44:03 -0700313 virtual ~Trans16x16TestBase() {}
Jingning Hancf768b22013-07-09 16:16:49 -0700314
Jingning Han8f92a7e2013-09-05 12:44:03 -0700315 protected:
Deb Mukherjee10783d42014-09-02 16:34:09 -0700316 virtual void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) = 0;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700317
Deb Mukherjee10783d42014-09-02 16:34:09 -0700318 virtual void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) = 0;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700319
320 void RunAccuracyCheck() {
321 ACMRandom rnd(ACMRandom::DeterministicSeed());
Jingning Han37705a32013-09-09 17:07:55 -0700322 uint32_t max_error = 0;
323 int64_t total_error = 0;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700324 const int count_test_block = 10000;
325 for (int i = 0; i < count_test_block; ++i) {
James Zernfd3658b2015-05-02 13:24:16 -0700326 DECLARE_ALIGNED(16, int16_t, test_input_block[kNumCoeffs]);
327 DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]);
328 DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
329 DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
Yaowu Xuf883b422016-08-30 14:01:10 -0700330#if CONFIG_AOM_HIGHBITDEPTH
James Zernfd3658b2015-05-02 13:24:16 -0700331 DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
332 DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
Deb Mukherjee10783d42014-09-02 16:34:09 -0700333#endif
Jingning Han8f92a7e2013-09-05 12:44:03 -0700334
Deb Mukherjee10783d42014-09-02 16:34:09 -0700335 // Initialize a test block with input range [-mask_, mask_].
Jingning Han8f92a7e2013-09-05 12:44:03 -0700336 for (int j = 0; j < kNumCoeffs; ++j) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700337 if (bit_depth_ == AOM_BITS_8) {
Deb Mukherjee10783d42014-09-02 16:34:09 -0700338 src[j] = rnd.Rand8();
339 dst[j] = rnd.Rand8();
340 test_input_block[j] = src[j] - dst[j];
Yaowu Xuf883b422016-08-30 14:01:10 -0700341#if CONFIG_AOM_HIGHBITDEPTH
Deb Mukherjee10783d42014-09-02 16:34:09 -0700342 } else {
343 src16[j] = rnd.Rand16() & mask_;
344 dst16[j] = rnd.Rand16() & mask_;
345 test_input_block[j] = src16[j] - dst16[j];
346#endif
347 }
Jingning Han8f92a7e2013-09-05 12:44:03 -0700348 }
349
clang-format3a826f12016-08-11 17:46:05 -0700350 ASM_REGISTER_STATE_CHECK(
351 RunFwdTxfm(test_input_block, test_temp_block, pitch_));
Yaowu Xuf883b422016-08-30 14:01:10 -0700352 if (bit_depth_ == AOM_BITS_8) {
clang-format3a826f12016-08-11 17:46:05 -0700353 ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
Yaowu Xuf883b422016-08-30 14:01:10 -0700354#if CONFIG_AOM_HIGHBITDEPTH
Deb Mukherjee10783d42014-09-02 16:34:09 -0700355 } else {
356 ASM_REGISTER_STATE_CHECK(
357 RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
358#endif
359 }
Jingning Han8f92a7e2013-09-05 12:44:03 -0700360
361 for (int j = 0; j < kNumCoeffs; ++j) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700362#if CONFIG_AOM_HIGHBITDEPTH
Yaowu Xu63827272016-05-31 16:54:58 -0700363 const int32_t diff =
Yaowu Xuf883b422016-08-30 14:01:10 -0700364 bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
Deb Mukherjee10783d42014-09-02 16:34:09 -0700365#else
Yaowu Xu63827272016-05-31 16:54:58 -0700366 const int32_t diff = dst[j] - src[j];
Deb Mukherjee10783d42014-09-02 16:34:09 -0700367#endif
Jingning Han37705a32013-09-09 17:07:55 -0700368 const uint32_t error = diff * diff;
clang-format3a826f12016-08-11 17:46:05 -0700369 if (max_error < error) max_error = error;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700370 total_error += error;
371 }
372 }
373
clang-format3a826f12016-08-11 17:46:05 -0700374 EXPECT_GE(1u << 2 * (bit_depth_ - 8), max_error)
Jingning Han8f92a7e2013-09-05 12:44:03 -0700375 << "Error: 16x16 FHT/IHT has an individual round trip error > 1";
376
Deb Mukherjee10783d42014-09-02 16:34:09 -0700377 EXPECT_GE(count_test_block << 2 * (bit_depth_ - 8), total_error)
Jingning Han8f92a7e2013-09-05 12:44:03 -0700378 << "Error: 16x16 FHT/IHT has average round trip error > 1 per block";
379 }
380
Jingning Han37705a32013-09-09 17:07:55 -0700381 void RunCoeffCheck() {
Jingning Han8f92a7e2013-09-05 12:44:03 -0700382 ACMRandom rnd(ACMRandom::DeterministicSeed());
383 const int count_test_block = 1000;
James Zernfd3658b2015-05-02 13:24:16 -0700384 DECLARE_ALIGNED(16, int16_t, input_block[kNumCoeffs]);
385 DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
386 DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]);
Jingning Han8f92a7e2013-09-05 12:44:03 -0700387
Jingning Han37705a32013-09-09 17:07:55 -0700388 for (int i = 0; i < count_test_block; ++i) {
Deb Mukherjee10783d42014-09-02 16:34:09 -0700389 // Initialize a test block with input range [-mask_, mask_].
Jingning Han37705a32013-09-09 17:07:55 -0700390 for (int j = 0; j < kNumCoeffs; ++j)
Deb Mukherjee10783d42014-09-02 16:34:09 -0700391 input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
Jingning Han37705a32013-09-09 17:07:55 -0700392
393 fwd_txfm_ref(input_block, output_ref_block, pitch_, tx_type_);
James Zern29e1b1a2014-07-09 21:02:02 -0700394 ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, pitch_));
Jingning Han37705a32013-09-09 17:07:55 -0700395
396 // The minimum quant value is 4.
397 for (int j = 0; j < kNumCoeffs; ++j)
398 EXPECT_EQ(output_block[j], output_ref_block[j]);
399 }
400 }
401
402 void RunMemCheck() {
403 ACMRandom rnd(ACMRandom::DeterministicSeed());
404 const int count_test_block = 1000;
James Zernfd3658b2015-05-02 13:24:16 -0700405 DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]);
406 DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
407 DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]);
Jingning Han37705a32013-09-09 17:07:55 -0700408
409 for (int i = 0; i < count_test_block; ++i) {
Deb Mukherjee10783d42014-09-02 16:34:09 -0700410 // Initialize a test block with input range [-mask_, mask_].
Jingning Han8f92a7e2013-09-05 12:44:03 -0700411 for (int j = 0; j < kNumCoeffs; ++j) {
Deb Mukherjee10783d42014-09-02 16:34:09 -0700412 input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700413 }
Jingning Han5c2696c2014-06-02 16:40:01 -0700414 if (i == 0) {
clang-format3a826f12016-08-11 17:46:05 -0700415 for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = mask_;
Jingning Han5c2696c2014-06-02 16:40:01 -0700416 } else if (i == 1) {
clang-format3a826f12016-08-11 17:46:05 -0700417 for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
Jingning Han5c2696c2014-06-02 16:40:01 -0700418 }
Jingning Han8f92a7e2013-09-05 12:44:03 -0700419
Jingning Han37705a32013-09-09 17:07:55 -0700420 fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
clang-format3a826f12016-08-11 17:46:05 -0700421 ASM_REGISTER_STATE_CHECK(
422 RunFwdTxfm(input_extreme_block, output_block, pitch_));
Jingning Han8f92a7e2013-09-05 12:44:03 -0700423
424 // The minimum quant value is 4.
425 for (int j = 0; j < kNumCoeffs; ++j) {
Jingning Han37705a32013-09-09 17:07:55 -0700426 EXPECT_EQ(output_block[j], output_ref_block[j]);
Deb Mukherjee10783d42014-09-02 16:34:09 -0700427 EXPECT_GE(4 * DCT_MAX_VALUE << (bit_depth_ - 8), abs(output_block[j]))
Jingning Han8f92a7e2013-09-05 12:44:03 -0700428 << "Error: 16x16 FDCT has coefficient larger than 4*DCT_MAX_VALUE";
Jingning Han8f92a7e2013-09-05 12:44:03 -0700429 }
Jingning Hancf768b22013-07-09 16:16:49 -0700430 }
431 }
432
Jingning Han49b4a272014-05-29 12:50:54 -0700433 void RunQuantCheck(int dc_thred, int ac_thred) {
434 ACMRandom rnd(ACMRandom::DeterministicSeed());
Jingning Han12344f22014-10-06 10:18:17 -0700435 const int count_test_block = 100000;
James Zernfd3658b2015-05-02 13:24:16 -0700436 DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]);
437 DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
Jingning Han49b4a272014-05-29 12:50:54 -0700438
James Zernfd3658b2015-05-02 13:24:16 -0700439 DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
440 DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
Yaowu Xuf883b422016-08-30 14:01:10 -0700441#if CONFIG_AOM_HIGHBITDEPTH
James Zernfd3658b2015-05-02 13:24:16 -0700442 DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
443 DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
Deb Mukherjee10783d42014-09-02 16:34:09 -0700444#endif
Jingning Han49b4a272014-05-29 12:50:54 -0700445
446 for (int i = 0; i < count_test_block; ++i) {
Deb Mukherjee10783d42014-09-02 16:34:09 -0700447 // Initialize a test block with input range [-mask_, mask_].
Jingning Han49b4a272014-05-29 12:50:54 -0700448 for (int j = 0; j < kNumCoeffs; ++j) {
Deb Mukherjee10783d42014-09-02 16:34:09 -0700449 input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
Jingning Han49b4a272014-05-29 12:50:54 -0700450 }
451 if (i == 0)
clang-format3a826f12016-08-11 17:46:05 -0700452 for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = mask_;
Jingning Han49b4a272014-05-29 12:50:54 -0700453 if (i == 1)
clang-format3a826f12016-08-11 17:46:05 -0700454 for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
Jingning Han49b4a272014-05-29 12:50:54 -0700455
456 fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
457
458 // clear reconstructed pixel buffers
James Zernf58011a2015-04-23 20:47:40 -0700459 memset(dst, 0, kNumCoeffs * sizeof(uint8_t));
460 memset(ref, 0, kNumCoeffs * sizeof(uint8_t));
Yaowu Xuf883b422016-08-30 14:01:10 -0700461#if CONFIG_AOM_HIGHBITDEPTH
James Zernf58011a2015-04-23 20:47:40 -0700462 memset(dst16, 0, kNumCoeffs * sizeof(uint16_t));
463 memset(ref16, 0, kNumCoeffs * sizeof(uint16_t));
Deb Mukherjee10783d42014-09-02 16:34:09 -0700464#endif
Jingning Han49b4a272014-05-29 12:50:54 -0700465
466 // quantization with maximum allowed step sizes
467 output_ref_block[0] = (output_ref_block[0] / dc_thred) * dc_thred;
468 for (int j = 1; j < kNumCoeffs; ++j)
469 output_ref_block[j] = (output_ref_block[j] / ac_thred) * ac_thred;
Yaowu Xuf883b422016-08-30 14:01:10 -0700470 if (bit_depth_ == AOM_BITS_8) {
Deb Mukherjee10783d42014-09-02 16:34:09 -0700471 inv_txfm_ref(output_ref_block, ref, pitch_, tx_type_);
472 ASM_REGISTER_STATE_CHECK(RunInvTxfm(output_ref_block, dst, pitch_));
Yaowu Xuf883b422016-08-30 14:01:10 -0700473#if CONFIG_AOM_HIGHBITDEPTH
Deb Mukherjee10783d42014-09-02 16:34:09 -0700474 } else {
475 inv_txfm_ref(output_ref_block, CONVERT_TO_BYTEPTR(ref16), pitch_,
476 tx_type_);
clang-format3a826f12016-08-11 17:46:05 -0700477 ASM_REGISTER_STATE_CHECK(
478 RunInvTxfm(output_ref_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
Deb Mukherjee10783d42014-09-02 16:34:09 -0700479#endif
480 }
Yaowu Xuf883b422016-08-30 14:01:10 -0700481 if (bit_depth_ == AOM_BITS_8) {
clang-format3a826f12016-08-11 17:46:05 -0700482 for (int j = 0; j < kNumCoeffs; ++j) EXPECT_EQ(ref[j], dst[j]);
Yaowu Xuf883b422016-08-30 14:01:10 -0700483#if CONFIG_AOM_HIGHBITDEPTH
Deb Mukherjee10783d42014-09-02 16:34:09 -0700484 } else {
clang-format3a826f12016-08-11 17:46:05 -0700485 for (int j = 0; j < kNumCoeffs; ++j) EXPECT_EQ(ref16[j], dst16[j]);
Deb Mukherjee10783d42014-09-02 16:34:09 -0700486#endif
487 }
Jingning Han49b4a272014-05-29 12:50:54 -0700488 }
489 }
490
Jingning Han8f92a7e2013-09-05 12:44:03 -0700491 void RunInvAccuracyCheck() {
492 ACMRandom rnd(ACMRandom::DeterministicSeed());
493 const int count_test_block = 1000;
James Zernfd3658b2015-05-02 13:24:16 -0700494 DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]);
495 DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
496 DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
497 DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
Yaowu Xuf883b422016-08-30 14:01:10 -0700498#if CONFIG_AOM_HIGHBITDEPTH
James Zernfd3658b2015-05-02 13:24:16 -0700499 DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
500 DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
Yaowu Xuf883b422016-08-30 14:01:10 -0700501#endif // CONFIG_AOM_HIGHBITDEPTH
Jingning Han8f92a7e2013-09-05 12:44:03 -0700502
503 for (int i = 0; i < count_test_block; ++i) {
Jingning Han8f92a7e2013-09-05 12:44:03 -0700504 double out_r[kNumCoeffs];
505
506 // Initialize a test block with input range [-255, 255].
507 for (int j = 0; j < kNumCoeffs; ++j) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700508 if (bit_depth_ == AOM_BITS_8) {
Deb Mukherjee10783d42014-09-02 16:34:09 -0700509 src[j] = rnd.Rand8();
510 dst[j] = rnd.Rand8();
511 in[j] = src[j] - dst[j];
Yaowu Xuf883b422016-08-30 14:01:10 -0700512#if CONFIG_AOM_HIGHBITDEPTH
Deb Mukherjee10783d42014-09-02 16:34:09 -0700513 } else {
514 src16[j] = rnd.Rand16() & mask_;
515 dst16[j] = rnd.Rand16() & mask_;
516 in[j] = src16[j] - dst16[j];
Yaowu Xuf883b422016-08-30 14:01:10 -0700517#endif // CONFIG_AOM_HIGHBITDEPTH
Deb Mukherjee10783d42014-09-02 16:34:09 -0700518 }
Jingning Han8f92a7e2013-09-05 12:44:03 -0700519 }
520
521 reference_16x16_dct_2d(in, out_r);
522 for (int j = 0; j < kNumCoeffs; ++j)
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100523 coeff[j] = static_cast<tran_low_t>(round(out_r[j]));
Jingning Han8f92a7e2013-09-05 12:44:03 -0700524
Yaowu Xuf883b422016-08-30 14:01:10 -0700525 if (bit_depth_ == AOM_BITS_8) {
Deb Mukherjee10783d42014-09-02 16:34:09 -0700526 ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, 16));
Yaowu Xuf883b422016-08-30 14:01:10 -0700527#if CONFIG_AOM_HIGHBITDEPTH
Deb Mukherjee10783d42014-09-02 16:34:09 -0700528 } else {
clang-format3a826f12016-08-11 17:46:05 -0700529 ASM_REGISTER_STATE_CHECK(
530 RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), 16));
Yaowu Xuf883b422016-08-30 14:01:10 -0700531#endif // CONFIG_AOM_HIGHBITDEPTH
Deb Mukherjee10783d42014-09-02 16:34:09 -0700532 }
Jingning Han8f92a7e2013-09-05 12:44:03 -0700533
534 for (int j = 0; j < kNumCoeffs; ++j) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700535#if CONFIG_AOM_HIGHBITDEPTH
Yaowu Xu59b969d2016-10-24 09:21:09 -0700536 const int diff =
Yaowu Xuf883b422016-08-30 14:01:10 -0700537 bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
Deb Mukherjee10783d42014-09-02 16:34:09 -0700538#else
Yaowu Xu59b969d2016-10-24 09:21:09 -0700539 const int diff = dst[j] - src[j];
Yaowu Xuf883b422016-08-30 14:01:10 -0700540#endif // CONFIG_AOM_HIGHBITDEPTH
Jingning Han37705a32013-09-09 17:07:55 -0700541 const uint32_t error = diff * diff;
clang-format3a826f12016-08-11 17:46:05 -0700542 EXPECT_GE(1u, error) << "Error: 16x16 IDCT has error " << error
543 << " at index " << j;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700544 }
545 }
Jingning Hancf768b22013-07-09 16:16:49 -0700546 }
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100547
548 void CompareInvReference(IdctFunc ref_txfm, int thresh) {
549 ACMRandom rnd(ACMRandom::DeterministicSeed());
550 const int count_test_block = 10000;
551 const int eob = 10;
Yaowu Xuf883b422016-08-30 14:01:10 -0700552 const int16_t *scan = av1_default_scan_orders[TX_16X16].scan;
James Zernfd3658b2015-05-02 13:24:16 -0700553 DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
554 DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
555 DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
Yaowu Xuf883b422016-08-30 14:01:10 -0700556#if CONFIG_AOM_HIGHBITDEPTH
James Zernfd3658b2015-05-02 13:24:16 -0700557 DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
558 DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
Yaowu Xuf883b422016-08-30 14:01:10 -0700559#endif // CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100560
561 for (int i = 0; i < count_test_block; ++i) {
562 for (int j = 0; j < kNumCoeffs; ++j) {
563 if (j < eob) {
564 // Random values less than the threshold, either positive or negative
565 coeff[scan[j]] = rnd(thresh) * (1 - 2 * (i % 2));
566 } else {
567 coeff[scan[j]] = 0;
568 }
Yaowu Xuf883b422016-08-30 14:01:10 -0700569 if (bit_depth_ == AOM_BITS_8) {
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100570 dst[j] = 0;
571 ref[j] = 0;
Yaowu Xuf883b422016-08-30 14:01:10 -0700572#if CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100573 } else {
574 dst16[j] = 0;
575 ref16[j] = 0;
Yaowu Xuf883b422016-08-30 14:01:10 -0700576#endif // CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100577 }
578 }
Yaowu Xuf883b422016-08-30 14:01:10 -0700579 if (bit_depth_ == AOM_BITS_8) {
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100580 ref_txfm(coeff, ref, pitch_);
581 ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
582 } else {
Yaowu Xuf883b422016-08-30 14:01:10 -0700583#if CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100584 ref_txfm(coeff, CONVERT_TO_BYTEPTR(ref16), pitch_);
clang-format3a826f12016-08-11 17:46:05 -0700585 ASM_REGISTER_STATE_CHECK(
586 RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), pitch_));
Yaowu Xuf883b422016-08-30 14:01:10 -0700587#endif // CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100588 }
589
590 for (int j = 0; j < kNumCoeffs; ++j) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700591#if CONFIG_AOM_HIGHBITDEPTH
Yaowu Xu59b969d2016-10-24 09:21:09 -0700592 const int diff =
Yaowu Xuf883b422016-08-30 14:01:10 -0700593 bit_depth_ == AOM_BITS_8 ? dst[j] - ref[j] : dst16[j] - ref16[j];
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100594#else
Yaowu Xu59b969d2016-10-24 09:21:09 -0700595 const int diff = dst[j] - ref[j];
Yaowu Xuf883b422016-08-30 14:01:10 -0700596#endif // CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100597 const uint32_t error = diff * diff;
clang-format3a826f12016-08-11 17:46:05 -0700598 EXPECT_EQ(0u, error) << "Error: 16x16 IDCT Comparison has error "
599 << error << " at index " << j;
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100600 }
601 }
602 }
603
Jingning Han37705a32013-09-09 17:07:55 -0700604 int pitch_;
605 int tx_type_;
Yaowu Xuf883b422016-08-30 14:01:10 -0700606 aom_bit_depth_t bit_depth_;
Deb Mukherjee10783d42014-09-02 16:34:09 -0700607 int mask_;
James Zern44f84842014-07-16 18:53:33 -0700608 FhtFunc fwd_txfm_ref;
609 IhtFunc inv_txfm_ref;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700610};
611
clang-format3a826f12016-08-11 17:46:05 -0700612class Trans16x16DCT : public Trans16x16TestBase,
613 public ::testing::TestWithParam<Dct16x16Param> {
Jingning Han8f92a7e2013-09-05 12:44:03 -0700614 public:
615 virtual ~Trans16x16DCT() {}
616
617 virtual void SetUp() {
618 fwd_txfm_ = GET_PARAM(0);
619 inv_txfm_ = GET_PARAM(1);
clang-format3a826f12016-08-11 17:46:05 -0700620 tx_type_ = GET_PARAM(2);
Deb Mukherjee10783d42014-09-02 16:34:09 -0700621 bit_depth_ = GET_PARAM(3);
clang-format3a826f12016-08-11 17:46:05 -0700622 pitch_ = 16;
Jingning Han37705a32013-09-09 17:07:55 -0700623 fwd_txfm_ref = fdct16x16_ref;
Jingning Han49b4a272014-05-29 12:50:54 -0700624 inv_txfm_ref = idct16x16_ref;
Deb Mukherjee10783d42014-09-02 16:34:09 -0700625 mask_ = (1 << bit_depth_) - 1;
Yaowu Xuf883b422016-08-30 14:01:10 -0700626#if CONFIG_AOM_HIGHBITDEPTH
Deb Mukherjee10783d42014-09-02 16:34:09 -0700627 switch (bit_depth_) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700628 case AOM_BITS_10: inv_txfm_ref = idct16x16_10_ref; break;
629 case AOM_BITS_12: inv_txfm_ref = idct16x16_12_ref; break;
clang-format3a826f12016-08-11 17:46:05 -0700630 default: inv_txfm_ref = idct16x16_ref; break;
Deb Mukherjee10783d42014-09-02 16:34:09 -0700631 }
632#else
633 inv_txfm_ref = idct16x16_ref;
634#endif
Jingning Han8f92a7e2013-09-05 12:44:03 -0700635 }
Yaowu Xuc27fc142016-08-22 16:08:15 -0700636 virtual void TearDown() { libaom_test::ClearSystemState(); }
Jingning Han8f92a7e2013-09-05 12:44:03 -0700637
638 protected:
Deb Mukherjee10783d42014-09-02 16:34:09 -0700639 void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {
Jingning Han8f92a7e2013-09-05 12:44:03 -0700640 fwd_txfm_(in, out, stride);
641 }
Deb Mukherjee10783d42014-09-02 16:34:09 -0700642 void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
Dmitry Kovalev1aa7fd52013-10-18 11:49:33 -0700643 inv_txfm_(out, dst, stride);
Jingning Hancf768b22013-07-09 16:16:49 -0700644 }
645
James Zern44f84842014-07-16 18:53:33 -0700646 FdctFunc fwd_txfm_;
647 IdctFunc inv_txfm_;
Jingning Hancf768b22013-07-09 16:16:49 -0700648};
649
clang-format3a826f12016-08-11 17:46:05 -0700650TEST_P(Trans16x16DCT, AccuracyCheck) { RunAccuracyCheck(); }
Jingning Hancf768b22013-07-09 16:16:49 -0700651
clang-format3a826f12016-08-11 17:46:05 -0700652TEST_P(Trans16x16DCT, CoeffCheck) { RunCoeffCheck(); }
Jingning Han37705a32013-09-09 17:07:55 -0700653
clang-format3a826f12016-08-11 17:46:05 -0700654TEST_P(Trans16x16DCT, MemCheck) { RunMemCheck(); }
Jingning Hancf768b22013-07-09 16:16:49 -0700655
Jingning Han49b4a272014-05-29 12:50:54 -0700656TEST_P(Trans16x16DCT, QuantCheck) {
657 // Use maximally allowed quantization step sizes for DC and AC
658 // coefficients respectively.
659 RunQuantCheck(1336, 1828);
660}
661
clang-format3a826f12016-08-11 17:46:05 -0700662TEST_P(Trans16x16DCT, InvAccuracyCheck) { RunInvAccuracyCheck(); }
Scott LaVarnwaya272ff22013-05-15 13:16:02 -0400663
clang-format3a826f12016-08-11 17:46:05 -0700664class Trans16x16HT : public Trans16x16TestBase,
665 public ::testing::TestWithParam<Ht16x16Param> {
Jingning Han8f92a7e2013-09-05 12:44:03 -0700666 public:
667 virtual ~Trans16x16HT() {}
668
669 virtual void SetUp() {
670 fwd_txfm_ = GET_PARAM(0);
671 inv_txfm_ = GET_PARAM(1);
clang-format3a826f12016-08-11 17:46:05 -0700672 tx_type_ = GET_PARAM(2);
Deb Mukherjee10783d42014-09-02 16:34:09 -0700673 bit_depth_ = GET_PARAM(3);
clang-format3a826f12016-08-11 17:46:05 -0700674 pitch_ = 16;
Jingning Han37705a32013-09-09 17:07:55 -0700675 fwd_txfm_ref = fht16x16_ref;
Jingning Han49b4a272014-05-29 12:50:54 -0700676 inv_txfm_ref = iht16x16_ref;
Deb Mukherjee10783d42014-09-02 16:34:09 -0700677 mask_ = (1 << bit_depth_) - 1;
Yaowu Xuf883b422016-08-30 14:01:10 -0700678#if CONFIG_AOM_HIGHBITDEPTH
Deb Mukherjee10783d42014-09-02 16:34:09 -0700679 switch (bit_depth_) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700680 case AOM_BITS_10: inv_txfm_ref = iht16x16_10; break;
681 case AOM_BITS_12: inv_txfm_ref = iht16x16_12; break;
clang-format3a826f12016-08-11 17:46:05 -0700682 default: inv_txfm_ref = iht16x16_ref; break;
Deb Mukherjee10783d42014-09-02 16:34:09 -0700683 }
684#else
685 inv_txfm_ref = iht16x16_ref;
686#endif
Jingning Han8f92a7e2013-09-05 12:44:03 -0700687 }
Yaowu Xuc27fc142016-08-22 16:08:15 -0700688 virtual void TearDown() { libaom_test::ClearSystemState(); }
Jingning Han8f92a7e2013-09-05 12:44:03 -0700689
690 protected:
Deb Mukherjee10783d42014-09-02 16:34:09 -0700691 void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {
Jingning Han37705a32013-09-09 17:07:55 -0700692 fwd_txfm_(in, out, stride, tx_type_);
Jingning Han8f92a7e2013-09-05 12:44:03 -0700693 }
Deb Mukherjee10783d42014-09-02 16:34:09 -0700694 void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
Jingning Han37705a32013-09-09 17:07:55 -0700695 inv_txfm_(out, dst, stride, tx_type_);
Jingning Han8f92a7e2013-09-05 12:44:03 -0700696 }
697
James Zern44f84842014-07-16 18:53:33 -0700698 FhtFunc fwd_txfm_;
699 IhtFunc inv_txfm_;
Jingning Han8f92a7e2013-09-05 12:44:03 -0700700};
701
clang-format3a826f12016-08-11 17:46:05 -0700702TEST_P(Trans16x16HT, AccuracyCheck) { RunAccuracyCheck(); }
Jingning Han8f92a7e2013-09-05 12:44:03 -0700703
clang-format3a826f12016-08-11 17:46:05 -0700704TEST_P(Trans16x16HT, CoeffCheck) { RunCoeffCheck(); }
Jingning Han37705a32013-09-09 17:07:55 -0700705
clang-format3a826f12016-08-11 17:46:05 -0700706TEST_P(Trans16x16HT, MemCheck) { RunMemCheck(); }
Jingning Han8f92a7e2013-09-05 12:44:03 -0700707
Jingning Han49b4a272014-05-29 12:50:54 -0700708TEST_P(Trans16x16HT, QuantCheck) {
709 // The encoder skips any non-DC intra prediction modes,
710 // when the quantization step size goes beyond 988.
Jingning Han12344f22014-10-06 10:18:17 -0700711 RunQuantCheck(429, 729);
Jingning Han49b4a272014-05-29 12:50:54 -0700712}
713
clang-format3a826f12016-08-11 17:46:05 -0700714class InvTrans16x16DCT : public Trans16x16TestBase,
715 public ::testing::TestWithParam<Idct16x16Param> {
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100716 public:
717 virtual ~InvTrans16x16DCT() {}
718
719 virtual void SetUp() {
720 ref_txfm_ = GET_PARAM(0);
721 inv_txfm_ = GET_PARAM(1);
722 thresh_ = GET_PARAM(2);
723 bit_depth_ = GET_PARAM(3);
724 pitch_ = 16;
725 mask_ = (1 << bit_depth_) - 1;
clang-format3a826f12016-08-11 17:46:05 -0700726 }
Yaowu Xuc27fc142016-08-22 16:08:15 -0700727 virtual void TearDown() { libaom_test::ClearSystemState(); }
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100728
729 protected:
Urvang Joshid71a2312016-07-14 12:33:48 -0700730 void RunFwdTxfm(int16_t * /*in*/, tran_low_t * /*out*/, int /*stride*/) {}
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100731 void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
732 inv_txfm_(out, dst, stride);
733 }
734
735 IdctFunc ref_txfm_;
736 IdctFunc inv_txfm_;
737 int thresh_;
738};
739
740TEST_P(InvTrans16x16DCT, CompareReference) {
741 CompareInvReference(ref_txfm_, thresh_);
742}
743
clang-format3a826f12016-08-11 17:46:05 -0700744class PartialTrans16x16Test : public ::testing::TestWithParam<
Yaowu Xuf883b422016-08-30 14:01:10 -0700745 std::tr1::tuple<FdctFunc, aom_bit_depth_t> > {
James Zerneb64ea32016-03-29 21:04:38 -0700746 public:
747 virtual ~PartialTrans16x16Test() {}
748 virtual void SetUp() {
749 fwd_txfm_ = GET_PARAM(0);
750 bit_depth_ = GET_PARAM(1);
751 }
752
Yaowu Xuc27fc142016-08-22 16:08:15 -0700753 virtual void TearDown() { libaom_test::ClearSystemState(); }
James Zerneb64ea32016-03-29 21:04:38 -0700754
755 protected:
Yaowu Xuf883b422016-08-30 14:01:10 -0700756 aom_bit_depth_t bit_depth_;
James Zerneb64ea32016-03-29 21:04:38 -0700757 FdctFunc fwd_txfm_;
758};
759
760TEST_P(PartialTrans16x16Test, Extremes) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700761#if CONFIG_AOM_HIGHBITDEPTH
James Zerneb64ea32016-03-29 21:04:38 -0700762 const int16_t maxval =
763 static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
764#else
765 const int16_t maxval = 255;
766#endif
767 const int minval = -maxval;
768 DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
769 DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
770
771 for (int i = 0; i < kNumCoeffs; ++i) input[i] = maxval;
772 output[0] = 0;
773 ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 16));
774 EXPECT_EQ((maxval * kNumCoeffs) >> 1, output[0]);
775
776 for (int i = 0; i < kNumCoeffs; ++i) input[i] = minval;
777 output[0] = 0;
778 ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 16));
779 EXPECT_EQ((minval * kNumCoeffs) >> 1, output[0]);
780}
781
782TEST_P(PartialTrans16x16Test, Random) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700783#if CONFIG_AOM_HIGHBITDEPTH
James Zerneb64ea32016-03-29 21:04:38 -0700784 const int16_t maxval =
785 static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
786#else
787 const int16_t maxval = 255;
788#endif
789 DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
790 DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
791 ACMRandom rnd(ACMRandom::DeterministicSeed());
792
793 int sum = 0;
794 for (int i = 0; i < kNumCoeffs; ++i) {
795 const int val = (i & 1) ? -rnd(maxval + 1) : rnd(maxval + 1);
796 input[i] = val;
797 sum += val;
798 }
799 output[0] = 0;
800 ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 16));
801 EXPECT_EQ(sum >> 1, output[0]);
802}
803
Jingning Han8f92a7e2013-09-05 12:44:03 -0700804using std::tr1::make_tuple;
805
Yaowu Xuf883b422016-08-30 14:01:10 -0700806#if CONFIG_AOM_HIGHBITDEPTH
Jingning Han8f92a7e2013-09-05 12:44:03 -0700807INSTANTIATE_TEST_CASE_P(
808 C, Trans16x16DCT,
809 ::testing::Values(
Yaowu Xuf883b422016-08-30 14:01:10 -0700810 make_tuple(&aom_highbd_fdct16x16_c, &idct16x16_10, 0, AOM_BITS_10),
811 make_tuple(&aom_highbd_fdct16x16_c, &idct16x16_12, 0, AOM_BITS_12),
812 make_tuple(&aom_fdct16x16_c, &aom_idct16x16_256_add_c, 0, AOM_BITS_8)));
Deb Mukherjee10783d42014-09-02 16:34:09 -0700813#else
clang-format3a826f12016-08-11 17:46:05 -0700814INSTANTIATE_TEST_CASE_P(C, Trans16x16DCT,
Yaowu Xuf883b422016-08-30 14:01:10 -0700815 ::testing::Values(make_tuple(&aom_fdct16x16_c,
816 &aom_idct16x16_256_add_c,
817 0, AOM_BITS_8)));
818#endif // CONFIG_AOM_HIGHBITDEPTH
Deb Mukherjee10783d42014-09-02 16:34:09 -0700819
Yaowu Xuf883b422016-08-30 14:01:10 -0700820#if CONFIG_AOM_HIGHBITDEPTH
Jingning Han8f92a7e2013-09-05 12:44:03 -0700821INSTANTIATE_TEST_CASE_P(
822 C, Trans16x16HT,
823 ::testing::Values(
Yaowu Xuf883b422016-08-30 14:01:10 -0700824 make_tuple(&av1_highbd_fht16x16_c, &iht16x16_10, 0, AOM_BITS_10),
825 make_tuple(&av1_highbd_fht16x16_c, &iht16x16_10, 1, AOM_BITS_10),
826 make_tuple(&av1_highbd_fht16x16_c, &iht16x16_10, 2, AOM_BITS_10),
827 make_tuple(&av1_highbd_fht16x16_c, &iht16x16_10, 3, AOM_BITS_10),
828 make_tuple(&av1_highbd_fht16x16_c, &iht16x16_12, 0, AOM_BITS_12),
829 make_tuple(&av1_highbd_fht16x16_c, &iht16x16_12, 1, AOM_BITS_12),
830 make_tuple(&av1_highbd_fht16x16_c, &iht16x16_12, 2, AOM_BITS_12),
831 make_tuple(&av1_highbd_fht16x16_c, &iht16x16_12, 3, AOM_BITS_12),
832 make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 0, AOM_BITS_8),
833 make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 1, AOM_BITS_8),
834 make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 2, AOM_BITS_8),
835 make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 3, AOM_BITS_8)));
James Zerneb64ea32016-03-29 21:04:38 -0700836INSTANTIATE_TEST_CASE_P(
837 C, PartialTrans16x16Test,
Yaowu Xuf883b422016-08-30 14:01:10 -0700838 ::testing::Values(make_tuple(&aom_highbd_fdct16x16_1_c, AOM_BITS_8),
839 make_tuple(&aom_highbd_fdct16x16_1_c, AOM_BITS_10),
840 make_tuple(&aom_highbd_fdct16x16_1_c, AOM_BITS_12)));
Deb Mukherjee10783d42014-09-02 16:34:09 -0700841#else
842INSTANTIATE_TEST_CASE_P(
843 C, Trans16x16HT,
844 ::testing::Values(
Yaowu Xuf883b422016-08-30 14:01:10 -0700845 make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 0, AOM_BITS_8),
846 make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 1, AOM_BITS_8),
847 make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 2, AOM_BITS_8),
848 make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 3, AOM_BITS_8)));
James Zerneb64ea32016-03-29 21:04:38 -0700849INSTANTIATE_TEST_CASE_P(C, PartialTrans16x16Test,
Yaowu Xuf883b422016-08-30 14:01:10 -0700850 ::testing::Values(make_tuple(&aom_fdct16x16_1_c,
851 AOM_BITS_8)));
852#endif // CONFIG_AOM_HIGHBITDEPTH
Jingning Han8f92a7e2013-09-05 12:44:03 -0700853
Yaowu Xuf883b422016-08-30 14:01:10 -0700854#if HAVE_NEON_ASM && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
James Zernadbb8812014-02-25 23:11:49 -0800855INSTANTIATE_TEST_CASE_P(
856 NEON, Trans16x16DCT,
Yaowu Xuf883b422016-08-30 14:01:10 -0700857 ::testing::Values(make_tuple(&aom_fdct16x16_c, &aom_idct16x16_256_add_neon,
858 0, AOM_BITS_8)));
James Zernadbb8812014-02-25 23:11:49 -0800859#endif
860
Yaowu Xuf883b422016-08-30 14:01:10 -0700861#if HAVE_SSE2 && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
Jingning Han8f92a7e2013-09-05 12:44:03 -0700862INSTANTIATE_TEST_CASE_P(
863 SSE2, Trans16x16DCT,
Yaowu Xuf883b422016-08-30 14:01:10 -0700864 ::testing::Values(make_tuple(&aom_fdct16x16_sse2,
865 &aom_idct16x16_256_add_sse2, 0, AOM_BITS_8)));
Jingning Han8f92a7e2013-09-05 12:44:03 -0700866INSTANTIATE_TEST_CASE_P(
867 SSE2, Trans16x16HT,
Yaowu Xuf883b422016-08-30 14:01:10 -0700868 ::testing::Values(make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
869 0, AOM_BITS_8),
870 make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
871 1, AOM_BITS_8),
872 make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
873 2, AOM_BITS_8),
874 make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
875 3, AOM_BITS_8)));
James Zerneb64ea32016-03-29 21:04:38 -0700876INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans16x16Test,
Yaowu Xuf883b422016-08-30 14:01:10 -0700877 ::testing::Values(make_tuple(&aom_fdct16x16_1_sse2,
878 AOM_BITS_8)));
879#endif // HAVE_SSE2 && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100880
Yi Luoe8e8cd82016-09-21 10:45:01 -0700881#if HAVE_AVX2 && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
882INSTANTIATE_TEST_CASE_P(AVX2, PartialTrans16x16Test,
883 ::testing::Values(make_tuple(&aom_fdct16x16_1_avx2,
884 AOM_BITS_8)));
885#endif // HAVE_AVX2 && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
886
Yaowu Xuf883b422016-08-30 14:01:10 -0700887#if HAVE_SSE2 && CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100888INSTANTIATE_TEST_CASE_P(
889 SSE2, Trans16x16DCT,
890 ::testing::Values(
Yaowu Xuf883b422016-08-30 14:01:10 -0700891 make_tuple(&aom_highbd_fdct16x16_sse2, &idct16x16_10, 0, AOM_BITS_10),
892 make_tuple(&aom_highbd_fdct16x16_c, &idct16x16_256_add_10_sse2, 0,
893 AOM_BITS_10),
894 make_tuple(&aom_highbd_fdct16x16_sse2, &idct16x16_12, 0, AOM_BITS_12),
895 make_tuple(&aom_highbd_fdct16x16_c, &idct16x16_256_add_12_sse2, 0,
896 AOM_BITS_12),
897 make_tuple(&aom_fdct16x16_sse2, &aom_idct16x16_256_add_c, 0,
898 AOM_BITS_8)));
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100899INSTANTIATE_TEST_CASE_P(
900 SSE2, Trans16x16HT,
Yaowu Xuf883b422016-08-30 14:01:10 -0700901 ::testing::Values(
902 make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c, 0, AOM_BITS_8),
903 make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c, 1, AOM_BITS_8),
904 make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c, 2, AOM_BITS_8),
905 make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c, 3,
906 AOM_BITS_8)));
Peter de Rivaz7e40a552014-10-24 08:48:02 +0100907// Optimizations take effect at a threshold of 3155, so we use a value close to
908// that to test both branches.
909INSTANTIATE_TEST_CASE_P(
910 SSE2, InvTrans16x16DCT,
clang-format3a826f12016-08-11 17:46:05 -0700911 ::testing::Values(make_tuple(&idct16x16_10_add_10_c,
Yaowu Xuf883b422016-08-30 14:01:10 -0700912 &idct16x16_10_add_10_sse2, 3167, AOM_BITS_10),
clang-format3a826f12016-08-11 17:46:05 -0700913 make_tuple(&idct16x16_10, &idct16x16_256_add_10_sse2,
Yaowu Xuf883b422016-08-30 14:01:10 -0700914 3167, AOM_BITS_10),
clang-format3a826f12016-08-11 17:46:05 -0700915 make_tuple(&idct16x16_10_add_12_c,
Yaowu Xuf883b422016-08-30 14:01:10 -0700916 &idct16x16_10_add_12_sse2, 3167, AOM_BITS_12),
clang-format3a826f12016-08-11 17:46:05 -0700917 make_tuple(&idct16x16_12, &idct16x16_256_add_12_sse2,
Yaowu Xuf883b422016-08-30 14:01:10 -0700918 3167, AOM_BITS_12)));
Yi Luofbf56812016-09-02 11:46:46 -0700919// TODO(luoyi):
920// For this test case, we should test function: aom_highbd_fdct16x16_1_sse2.
921// However this function is not available yet. if we mistakely test
922// aom_fdct16x16_1_sse2, it could only pass AOM_BITS_8/AOM_BITS_10 but not
923// AOM_BITS_12.
James Zerneb64ea32016-03-29 21:04:38 -0700924INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans16x16Test,
Yaowu Xuf883b422016-08-30 14:01:10 -0700925 ::testing::Values(make_tuple(&aom_fdct16x16_1_sse2,
926 AOM_BITS_8)));
927#endif // HAVE_SSE2 && CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
Parag Salasakar60052b62015-05-04 13:45:55 +0530928
Yaowu Xuf883b422016-08-30 14:01:10 -0700929#if HAVE_MSA && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
clang-format3a826f12016-08-11 17:46:05 -0700930INSTANTIATE_TEST_CASE_P(MSA, Trans16x16DCT,
Yaowu Xuf883b422016-08-30 14:01:10 -0700931 ::testing::Values(make_tuple(&aom_fdct16x16_msa,
932 &aom_idct16x16_256_add_msa,
933 0, AOM_BITS_8)));
James Zern1c25b7f2016-08-13 10:58:54 -0700934#if !CONFIG_EXT_TX
Parag Salasakar60052b62015-05-04 13:45:55 +0530935INSTANTIATE_TEST_CASE_P(
936 MSA, Trans16x16HT,
Yaowu Xuf883b422016-08-30 14:01:10 -0700937 ::testing::Values(
938 make_tuple(&av1_fht16x16_msa, &av1_iht16x16_256_add_msa, 0, AOM_BITS_8),
939 make_tuple(&av1_fht16x16_msa, &av1_iht16x16_256_add_msa, 1, AOM_BITS_8),
940 make_tuple(&av1_fht16x16_msa, &av1_iht16x16_256_add_msa, 2, AOM_BITS_8),
941 make_tuple(&av1_fht16x16_msa, &av1_iht16x16_256_add_msa, 3,
942 AOM_BITS_8)));
James Zern1c25b7f2016-08-13 10:58:54 -0700943#endif // !CONFIG_EXT_TX
James Zerneb64ea32016-03-29 21:04:38 -0700944INSTANTIATE_TEST_CASE_P(MSA, PartialTrans16x16Test,
Yaowu Xuf883b422016-08-30 14:01:10 -0700945 ::testing::Values(make_tuple(&aom_fdct16x16_1_msa,
946 AOM_BITS_8)));
947#endif // HAVE_MSA && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
Daniel Kangfed8a182012-08-02 17:03:14 -0700948} // namespace