blob: c3baa1950b83bef1801866e0fbe3bad23bc06252 [file] [log] [blame]
Luc Trudeaub4faea72017-12-15 16:44:01 -05001/*
2 * Copyright (c) 2017, Alliance for Open Media. All rights reserved
3 *
4 * 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 */
11#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
12
13#include "aom_ports/aom_timer.h"
14#include "./av1_rtcd.h"
15#include "test/util.h"
16#include "test/acm_random.h"
Luc Trudeau365f73b2017-12-23 00:07:29 -050017#include "av1/common/cfl.h"
Luc Trudeaub4faea72017-12-15 16:44:01 -050018
19using std::tr1::make_tuple;
20
21using libaom_test::ACMRandom;
22
Luc Trudeau365f73b2017-12-23 00:07:29 -050023#define NUM_ITERATIONS (100)
Luc Trudeaub4faea72017-12-15 16:44:01 -050024#define NUM_ITERATIONS_SPEED (INT16_MAX)
25
Luc Trudeau9bd42782017-12-19 23:15:28 -050026#define ALL_CFL_SIZES(function) \
Luc Trudeaub4faea72017-12-15 16:44:01 -050027 make_tuple(4, 4, &function), make_tuple(8, 4, &function), \
28 make_tuple(4, 8, &function), make_tuple(8, 8, &function), \
29 make_tuple(16, 8, &function), make_tuple(8, 16, &function), \
30 make_tuple(16, 16, &function), make_tuple(32, 16, &function), \
31 make_tuple(16, 32, &function), make_tuple(32, 32, &function)
32
Luc Trudeau9bd42782017-12-19 23:15:28 -050033#define CHROMA_420_CFL_SIZES(function) \
34 make_tuple(4, 4, &function), make_tuple(8, 4, &function), \
35 make_tuple(4, 8, &function), make_tuple(8, 8, &function), \
36 make_tuple(16, 8, &function), make_tuple(8, 16, &function), \
37 make_tuple(16, 16, &function)
38
Luc Trudeau365f73b2017-12-23 00:07:29 -050039#define ALL_CFL_TX_SIZES(function) \
40 make_tuple(TX_4X4, &function), make_tuple(TX_4X8, &function), \
41 make_tuple(TX_4X16, &function), make_tuple(TX_8X4, &function), \
42 make_tuple(TX_8X8, &function), make_tuple(TX_8X16, &function), \
43 make_tuple(TX_8X32, &function), make_tuple(TX_16X4, &function), \
44 make_tuple(TX_16X8, &function), make_tuple(TX_16X16, &function), \
45 make_tuple(TX_16X32, &function), make_tuple(TX_32X8, &function), \
David Michael Barr16f38c22017-12-21 01:56:03 +090046 make_tuple(TX_32X16, &function), make_tuple(TX_32X32, &function)
47
Luc Trudeaub4faea72017-12-15 16:44:01 -050048namespace {
Luc Trudeau9bd42782017-12-19 23:15:28 -050049typedef cfl_subsample_lbd_fn (*get_subsample_fn)(int width, int height);
50
David Michael Barr16f38c22017-12-21 01:56:03 +090051typedef cfl_predict_lbd_fn (*get_predict_fn)(TX_SIZE tx_size);
52
David Michael Barrc363ab72018-01-12 16:53:38 +090053typedef cfl_predict_hbd_fn (*get_predict_fn_hbd)(TX_SIZE tx_size);
54
Luc Trudeau365f73b2017-12-23 00:07:29 -050055typedef cfl_subtract_average_fn (*sub_avg_fn)(TX_SIZE tx_size);
Luc Trudeaub4faea72017-12-15 16:44:01 -050056
Luc Trudeau9bd42782017-12-19 23:15:28 -050057typedef std::tr1::tuple<int, int, get_subsample_fn> subsample_param;
58
David Michael Barr16f38c22017-12-21 01:56:03 +090059typedef std::tr1::tuple<TX_SIZE, get_predict_fn> predict_param;
60
David Michael Barrc363ab72018-01-12 16:53:38 +090061typedef std::tr1::tuple<TX_SIZE, get_predict_fn_hbd> predict_param_hbd;
62
Luc Trudeau365f73b2017-12-23 00:07:29 -050063typedef std::tr1::tuple<TX_SIZE, sub_avg_fn> sub_avg_param;
64
Luc Trudeaub4faea72017-12-15 16:44:01 -050065static void assertFaster(int ref_elapsed_time, int elapsed_time) {
66 EXPECT_GT(ref_elapsed_time, elapsed_time)
67 << "Error: CFLSubtractSpeedTest, SIMD slower than C." << std::endl
68 << "C time: " << ref_elapsed_time << " us" << std::endl
69 << "SIMD time: " << elapsed_time << " us" << std::endl;
70}
71
72static void printSpeed(int ref_elapsed_time, int elapsed_time, int width,
73 int height) {
74 std::cout.precision(2);
75 std::cout << "[ ] " << width << "x" << height
76 << ": C time = " << ref_elapsed_time
77 << " us, SIMD time = " << elapsed_time << " us"
78 << " (~" << ref_elapsed_time / (double)elapsed_time << "x) "
79 << std::endl;
80}
81
Luc Trudeau365f73b2017-12-23 00:07:29 -050082class CFLSubAvgTest : public ::testing::TestWithParam<sub_avg_param> {
Luc Trudeaub4faea72017-12-15 16:44:01 -050083 public:
Luc Trudeau365f73b2017-12-23 00:07:29 -050084 virtual ~CFLSubAvgTest() {}
85 virtual void SetUp() { sub_avg = GET_PARAM(1); }
Luc Trudeaub4faea72017-12-15 16:44:01 -050086
87 protected:
Luc Trudeau365f73b2017-12-23 00:07:29 -050088 int Width() const { return tx_size_wide[GET_PARAM(0)]; }
89 int Height() const { return tx_size_high[GET_PARAM(0)]; }
90 TX_SIZE Tx_size() const { return GET_PARAM(0); }
91 sub_avg_fn sub_avg;
92 int16_t data[CFL_BUF_SQUARE];
93 int16_t data_ref[CFL_BUF_SQUARE];
94 void init() {
95 const int width = Width();
96 const int height = Height();
97 ACMRandom rnd(ACMRandom::DeterministicSeed());
Luc Trudeaub4faea72017-12-15 16:44:01 -050098 for (int j = 0; j < height; j++) {
99 for (int i = 0; i < width; i++) {
Luc Trudeau365f73b2017-12-23 00:07:29 -0500100 const int16_t d = rnd.Rand15Signed();
101 data[j * CFL_BUF_LINE + i] = d;
102 data_ref[j * CFL_BUF_LINE + i] = d;
Luc Trudeaub4faea72017-12-15 16:44:01 -0500103 }
104 }
105 }
106};
107
Luc Trudeau9bd42782017-12-19 23:15:28 -0500108class CFLSubsampleTest : public ::testing::TestWithParam<subsample_param> {
109 public:
110 virtual ~CFLSubsampleTest() {}
111 virtual void SetUp() { subsample = GET_PARAM(2); }
112
113 protected:
114 int Width() const { return GET_PARAM(0); }
115 int Height() const { return GET_PARAM(1); }
116 get_subsample_fn subsample;
117 uint8_t luma_pels[CFL_BUF_SQUARE];
118 uint8_t luma_pels_ref[CFL_BUF_SQUARE];
119 int16_t sub_luma_pels[CFL_BUF_SQUARE];
120 int16_t sub_luma_pels_ref[CFL_BUF_SQUARE];
121 void init(int width, int height) {
122 ACMRandom rnd(ACMRandom::DeterministicSeed());
123 for (int j = 0; j < height * 2; j++) {
124 for (int i = 0; i < width * 2; i++) {
125 const int val = rnd.Rand8();
126 luma_pels[j * CFL_BUF_LINE + i] = val;
127 luma_pels_ref[j * CFL_BUF_LINE + i] = val;
128 }
129 }
130 }
131};
132
David Michael Barr16f38c22017-12-21 01:56:03 +0900133class CFLPredictTest : public ::testing::TestWithParam<predict_param> {
134 public:
135 virtual ~CFLPredictTest() {}
David Michael Barrc6532772018-01-17 09:28:19 +0900136 virtual void SetUp() {
137 predict = GET_PARAM(1);
138 chroma_pels_ref = reinterpret_cast<uint8_t *>(
139 aom_memalign(32, sizeof(uint8_t) * CFL_BUF_SQUARE));
140 sub_luma_pels_ref = reinterpret_cast<int16_t *>(
141 aom_memalign(32, sizeof(int16_t) * CFL_BUF_SQUARE));
142 chroma_pels = reinterpret_cast<uint8_t *>(
143 aom_memalign(32, sizeof(uint8_t) * CFL_BUF_SQUARE));
144 sub_luma_pels = reinterpret_cast<int16_t *>(
145 aom_memalign(32, sizeof(int16_t) * CFL_BUF_SQUARE));
146 }
147
148 virtual void TearDown() {
149 aom_free(chroma_pels_ref);
150 aom_free(sub_luma_pels_ref);
151 aom_free(chroma_pels);
152 aom_free(sub_luma_pels);
153 }
David Michael Barr16f38c22017-12-21 01:56:03 +0900154
155 protected:
156 int Width() const { return tx_size_wide[GET_PARAM(0)]; }
157 int Height() const { return tx_size_high[GET_PARAM(0)]; }
158 TX_SIZE Tx_size() const { return GET_PARAM(0); }
David Michael Barrc6532772018-01-17 09:28:19 +0900159 uint8_t *chroma_pels_ref;
160 int16_t *sub_luma_pels_ref;
161 uint8_t *chroma_pels;
162 int16_t *sub_luma_pels;
David Michael Barr16f38c22017-12-21 01:56:03 +0900163 get_predict_fn predict;
164 int alpha_q3;
165 uint8_t dc;
166 void init(int width, int height) {
167 ACMRandom rnd(ACMRandom::DeterministicSeed());
168 alpha_q3 = rnd(33) - 16;
169 dc = rnd.Rand8();
170 for (int j = 0; j < height; j++) {
171 for (int i = 0; i < width; i++) {
172 chroma_pels[j * CFL_BUF_LINE + i] = dc;
173 chroma_pels_ref[j * CFL_BUF_LINE + i] = dc;
174 sub_luma_pels_ref[j * CFL_BUF_LINE + i] =
175 sub_luma_pels[j * CFL_BUF_LINE + i] = rnd.Rand8() - 128;
176 }
177 }
178 }
179};
180
David Michael Barrc363ab72018-01-12 16:53:38 +0900181class CFLPredictHBDTest : public ::testing::TestWithParam<predict_param_hbd> {
182 public:
183 virtual ~CFLPredictHBDTest() {}
David Michael Barrc6532772018-01-17 09:28:19 +0900184 virtual void SetUp() {
185 predict = GET_PARAM(1);
186 chroma_pels_ref = reinterpret_cast<uint16_t *>(
187 aom_memalign(32, sizeof(uint16_t) * CFL_BUF_SQUARE));
188 sub_luma_pels_ref = reinterpret_cast<int16_t *>(
189 aom_memalign(32, sizeof(int16_t) * CFL_BUF_SQUARE));
190 chroma_pels = reinterpret_cast<uint16_t *>(
191 aom_memalign(32, sizeof(uint16_t) * CFL_BUF_SQUARE));
192 sub_luma_pels = reinterpret_cast<int16_t *>(
193 aom_memalign(32, sizeof(int16_t) * CFL_BUF_SQUARE));
194 }
195
196 virtual void TearDown() {
197 aom_free(chroma_pels_ref);
198 aom_free(sub_luma_pels_ref);
199 aom_free(chroma_pels);
200 aom_free(sub_luma_pels);
201 }
David Michael Barrc363ab72018-01-12 16:53:38 +0900202
203 protected:
204 int Width() const { return tx_size_wide[GET_PARAM(0)]; }
205 int Height() const { return tx_size_high[GET_PARAM(0)]; }
206 TX_SIZE Tx_size() const { return GET_PARAM(0); }
David Michael Barrc6532772018-01-17 09:28:19 +0900207 uint16_t *chroma_pels_ref;
208 int16_t *sub_luma_pels_ref;
209 uint16_t *chroma_pels;
210 int16_t *sub_luma_pels;
David Michael Barrc363ab72018-01-12 16:53:38 +0900211 get_predict_fn_hbd predict;
212 int bd;
213 int alpha_q3;
214 uint8_t dc;
215 void init(int width, int height) {
216 ACMRandom rnd(ACMRandom::DeterministicSeed());
217 bd = 12;
218 alpha_q3 = rnd(33) - 16;
219 dc = rnd(1 << bd);
220 for (int j = 0; j < height; j++) {
221 for (int i = 0; i < width; i++) {
222 chroma_pels[j * CFL_BUF_LINE + i] = dc;
223 chroma_pels_ref[j * CFL_BUF_LINE + i] = dc;
224 sub_luma_pels_ref[j * CFL_BUF_LINE + i] =
225 sub_luma_pels[j * CFL_BUF_LINE + i] =
226 rnd(1 << bd) - (1 << (bd - 1));
227 }
228 }
229 }
230};
231
Luc Trudeau365f73b2017-12-23 00:07:29 -0500232TEST_P(CFLSubAvgTest, SubAvgTest) {
233 const TX_SIZE tx_size = Tx_size();
234 const int width = tx_size_wide[tx_size];
235 const int height = tx_size_high[tx_size];
236 const cfl_subtract_average_fn ref_sub = get_subtract_average_fn_c(tx_size);
237 const cfl_subtract_average_fn sub = sub_avg(tx_size);
Luc Trudeaub4faea72017-12-15 16:44:01 -0500238 for (int it = 0; it < NUM_ITERATIONS; it++) {
Luc Trudeau365f73b2017-12-23 00:07:29 -0500239 init();
240 sub(data);
241 ref_sub(data_ref);
Luc Trudeaub4faea72017-12-15 16:44:01 -0500242 for (int j = 0; j < height; j++) {
243 for (int i = 0; i < width; i++) {
Luc Trudeau365f73b2017-12-23 00:07:29 -0500244 ASSERT_EQ(data_ref[j * CFL_BUF_LINE + i], data[j * CFL_BUF_LINE + i]);
Luc Trudeaub4faea72017-12-15 16:44:01 -0500245 }
246 }
247 }
248}
249
Luc Trudeau365f73b2017-12-23 00:07:29 -0500250TEST_P(CFLSubAvgTest, DISABLED_SubAvgSpeedTest) {
Luc Trudeaub4faea72017-12-15 16:44:01 -0500251 const int width = Width();
252 const int height = Height();
Luc Trudeau365f73b2017-12-23 00:07:29 -0500253 const TX_SIZE tx_size = Tx_size();
254
255 const cfl_subtract_average_fn ref_sub = get_subtract_average_fn_c(tx_size);
256 const cfl_subtract_average_fn sub = sub_avg(tx_size);
Luc Trudeaub4faea72017-12-15 16:44:01 -0500257
258 aom_usec_timer ref_timer;
259 aom_usec_timer timer;
260
Luc Trudeau365f73b2017-12-23 00:07:29 -0500261 init();
Luc Trudeaub4faea72017-12-15 16:44:01 -0500262 aom_usec_timer_start(&ref_timer);
263 for (int k = 0; k < NUM_ITERATIONS_SPEED; k++) {
Luc Trudeau365f73b2017-12-23 00:07:29 -0500264 ref_sub(data_ref);
Luc Trudeaub4faea72017-12-15 16:44:01 -0500265 }
266 aom_usec_timer_mark(&ref_timer);
Luc Trudeau365f73b2017-12-23 00:07:29 -0500267 int ref_elapsed_time = (int)aom_usec_timer_elapsed(&ref_timer);
Luc Trudeaub4faea72017-12-15 16:44:01 -0500268
269 aom_usec_timer_start(&timer);
270 for (int k = 0; k < NUM_ITERATIONS_SPEED; k++) {
Luc Trudeau365f73b2017-12-23 00:07:29 -0500271 sub(data);
Luc Trudeaub4faea72017-12-15 16:44:01 -0500272 }
273 aom_usec_timer_mark(&timer);
Luc Trudeau365f73b2017-12-23 00:07:29 -0500274 int elapsed_time = (int)aom_usec_timer_elapsed(&timer);
Luc Trudeaub4faea72017-12-15 16:44:01 -0500275
Luc Trudeaub4faea72017-12-15 16:44:01 -0500276 printSpeed(ref_elapsed_time, elapsed_time, width, height);
Luc Trudeau9bd42782017-12-19 23:15:28 -0500277 assertFaster(ref_elapsed_time, elapsed_time);
278}
279
280TEST_P(CFLSubsampleTest, SubsampleTest) {
281 const int width = Width();
282 const int height = Height();
283
284 for (int it = 0; it < NUM_ITERATIONS; it++) {
285 init(width, height);
286 subsample(1, 1)(luma_pels, CFL_BUF_LINE, sub_luma_pels, width, height);
287 get_subsample_lbd_fn_c(1, 1)(luma_pels_ref, CFL_BUF_LINE, sub_luma_pels_ref,
288 width, height);
289 for (int j = 0; j < height; j++) {
290 for (int i = 0; i < width; i++) {
291 ASSERT_EQ(sub_luma_pels_ref[j * CFL_BUF_LINE + i],
292 sub_luma_pels[j * CFL_BUF_LINE + i]);
293 }
294 }
295 }
296}
297
298TEST_P(CFLSubsampleTest, DISABLED_SubsampleSpeedTest) {
299 const int width = Width();
300 const int height = Height();
301
302 aom_usec_timer ref_timer;
303 aom_usec_timer timer;
304
305 init(width, height);
306 aom_usec_timer_start(&ref_timer);
307 for (int k = 0; k < NUM_ITERATIONS_SPEED; k++) {
308 get_subsample_lbd_fn_c(1, 1)(luma_pels, CFL_BUF_LINE, sub_luma_pels, width,
309 height);
310 }
311 aom_usec_timer_mark(&ref_timer);
312 int ref_elapsed_time = (int)aom_usec_timer_elapsed(&ref_timer);
313
314 aom_usec_timer_start(&timer);
315 for (int k = 0; k < NUM_ITERATIONS_SPEED; k++) {
316 subsample(1, 1)(luma_pels_ref, CFL_BUF_LINE, sub_luma_pels_ref, width,
317 height);
318 }
319 aom_usec_timer_mark(&timer);
320 int elapsed_time = (int)aom_usec_timer_elapsed(&timer);
321
322 printSpeed(ref_elapsed_time, elapsed_time, width, height);
Luc Trudeaub4faea72017-12-15 16:44:01 -0500323 assertFaster(ref_elapsed_time, elapsed_time);
324}
325
David Michael Barr16f38c22017-12-21 01:56:03 +0900326TEST_P(CFLPredictTest, PredictTest) {
327 const int width = Width();
328 const int height = Height();
329 const TX_SIZE tx_size = Tx_size();
330
331 for (int it = 0; it < NUM_ITERATIONS; it++) {
332 init(width, height);
333 predict(tx_size)(sub_luma_pels, chroma_pels, CFL_BUF_LINE, tx_size,
334 alpha_q3);
335 get_predict_lbd_fn_c(tx_size)(sub_luma_pels_ref, chroma_pels_ref,
336 CFL_BUF_LINE, tx_size, alpha_q3);
337 for (int j = 0; j < height; j++) {
338 for (int i = 0; i < width; i++) {
339 ASSERT_EQ(chroma_pels_ref[j * CFL_BUF_LINE + i],
340 chroma_pels[j * CFL_BUF_LINE + i]);
341 }
342 }
343 }
344}
345
346TEST_P(CFLPredictTest, DISABLED_PredictSpeedTest) {
347 const int width = Width();
348 const int height = Height();
349 const TX_SIZE tx_size = Tx_size();
350
351 aom_usec_timer ref_timer;
352 aom_usec_timer timer;
353
354 init(width, height);
355 cfl_predict_lbd_fn predict_impl = get_predict_lbd_fn_c(tx_size);
356 aom_usec_timer_start(&ref_timer);
357
358 for (int k = 0; k < NUM_ITERATIONS_SPEED; k++) {
359 predict_impl(sub_luma_pels_ref, chroma_pels_ref, CFL_BUF_LINE, tx_size,
360 alpha_q3);
361 }
362 aom_usec_timer_mark(&ref_timer);
363 int ref_elapsed_time = (int)aom_usec_timer_elapsed(&ref_timer);
364
365 predict_impl = predict(tx_size);
366 aom_usec_timer_start(&timer);
367 for (int k = 0; k < NUM_ITERATIONS_SPEED; k++) {
368 predict_impl(sub_luma_pels, chroma_pels, CFL_BUF_LINE, tx_size, alpha_q3);
369 }
370 aom_usec_timer_mark(&timer);
371 int elapsed_time = (int)aom_usec_timer_elapsed(&timer);
372
373 printSpeed(ref_elapsed_time, elapsed_time, width, height);
374 assertFaster(ref_elapsed_time, elapsed_time);
375}
376
David Michael Barrc363ab72018-01-12 16:53:38 +0900377TEST_P(CFLPredictHBDTest, PredictHBDTest) {
378 const int width = Width();
379 const int height = Height();
380 const TX_SIZE tx_size = Tx_size();
381
382 for (int it = 0; it < NUM_ITERATIONS; it++) {
383 init(width, height);
384 predict(tx_size)(sub_luma_pels, chroma_pels, CFL_BUF_LINE, tx_size,
385 alpha_q3, bd);
386 get_predict_hbd_fn_c(tx_size)(sub_luma_pels_ref, chroma_pels_ref,
387 CFL_BUF_LINE, tx_size, alpha_q3, bd);
388 for (int j = 0; j < height; j++) {
389 for (int i = 0; i < width; i++) {
390 ASSERT_EQ(chroma_pels_ref[j * CFL_BUF_LINE + i],
391 chroma_pels[j * CFL_BUF_LINE + i]);
392 }
393 }
394 }
395}
396
397TEST_P(CFLPredictHBDTest, DISABLED_PredictHBDSpeedTest) {
398 const int width = Width();
399 const int height = Height();
400 const TX_SIZE tx_size = Tx_size();
401
402 aom_usec_timer ref_timer;
403 aom_usec_timer timer;
404
405 init(width, height);
406 cfl_predict_hbd_fn predict_impl = get_predict_hbd_fn_c(tx_size);
407 aom_usec_timer_start(&ref_timer);
408
409 for (int k = 0; k < NUM_ITERATIONS_SPEED; k++) {
410 predict_impl(sub_luma_pels_ref, chroma_pels_ref, CFL_BUF_LINE, tx_size,
411 alpha_q3, bd);
412 }
413 aom_usec_timer_mark(&ref_timer);
414 int ref_elapsed_time = (int)aom_usec_timer_elapsed(&ref_timer);
415
416 predict_impl = predict(tx_size);
417 aom_usec_timer_start(&timer);
418 for (int k = 0; k < NUM_ITERATIONS_SPEED; k++) {
419 predict_impl(sub_luma_pels, chroma_pels, CFL_BUF_LINE, tx_size, alpha_q3,
420 bd);
421 }
422 aom_usec_timer_mark(&timer);
423 int elapsed_time = (int)aom_usec_timer_elapsed(&timer);
424
425 printSpeed(ref_elapsed_time, elapsed_time, width, height);
426 assertFaster(ref_elapsed_time, elapsed_time);
427}
428
Luc Trudeaub4faea72017-12-15 16:44:01 -0500429#if HAVE_SSE2
Luc Trudeau365f73b2017-12-23 00:07:29 -0500430const sub_avg_param sub_avg_sizes_sse2[] = { ALL_CFL_TX_SIZES(
431 get_subtract_average_fn_sse2) };
Luc Trudeaub4faea72017-12-15 16:44:01 -0500432
Luc Trudeau365f73b2017-12-23 00:07:29 -0500433INSTANTIATE_TEST_CASE_P(SSE2, CFLSubAvgTest,
434 ::testing::ValuesIn(sub_avg_sizes_sse2));
Luc Trudeau9bd42782017-12-19 23:15:28 -0500435
Luc Trudeaub4faea72017-12-15 16:44:01 -0500436#endif
437
Luc Trudeau9bd42782017-12-19 23:15:28 -0500438#if HAVE_SSSE3
Luc Trudeau365f73b2017-12-23 00:07:29 -0500439
Luc Trudeau9bd42782017-12-19 23:15:28 -0500440const subsample_param subsample_sizes_ssse3[] = { CHROMA_420_CFL_SIZES(
441 get_subsample_lbd_fn_ssse3) };
442
David Michael Barr16f38c22017-12-21 01:56:03 +0900443const predict_param predict_sizes_ssse3[] = { ALL_CFL_TX_SIZES(
444 get_predict_lbd_fn_ssse3) };
445
David Michael Barrc363ab72018-01-12 16:53:38 +0900446const predict_param_hbd predict_sizes_hbd_ssse3[] = { ALL_CFL_TX_SIZES(
447 get_predict_hbd_fn_ssse3) };
448
Luc Trudeau9bd42782017-12-19 23:15:28 -0500449INSTANTIATE_TEST_CASE_P(SSSE3, CFLSubsampleTest,
450 ::testing::ValuesIn(subsample_sizes_ssse3));
David Michael Barr16f38c22017-12-21 01:56:03 +0900451
452INSTANTIATE_TEST_CASE_P(SSSE3, CFLPredictTest,
453 ::testing::ValuesIn(predict_sizes_ssse3));
David Michael Barrc363ab72018-01-12 16:53:38 +0900454
455INSTANTIATE_TEST_CASE_P(SSSE3, CFLPredictHBDTest,
456 ::testing::ValuesIn(predict_sizes_hbd_ssse3));
Luc Trudeau9bd42782017-12-19 23:15:28 -0500457#endif
David Michael Barr16f38c22017-12-21 01:56:03 +0900458
Luc Trudeaub4faea72017-12-15 16:44:01 -0500459#if HAVE_AVX2
Luc Trudeau365f73b2017-12-23 00:07:29 -0500460const sub_avg_param sub_avg_sizes_avx2[] = { ALL_CFL_TX_SIZES(
461 get_subtract_average_fn_avx2) };
Luc Trudeaub4faea72017-12-15 16:44:01 -0500462
Luc Trudeau9bd42782017-12-19 23:15:28 -0500463const subsample_param subsample_sizes_avx2[] = { CHROMA_420_CFL_SIZES(
464 get_subsample_lbd_fn_avx2) };
465
David Michael Barr16f38c22017-12-21 01:56:03 +0900466const predict_param predict_sizes_avx2[] = { ALL_CFL_TX_SIZES(
467 get_predict_lbd_fn_avx2) };
468
David Michael Barrc363ab72018-01-12 16:53:38 +0900469const predict_param_hbd predict_sizes_hbd_avx2[] = { ALL_CFL_TX_SIZES(
470 get_predict_hbd_fn_avx2) };
471
Luc Trudeau365f73b2017-12-23 00:07:29 -0500472INSTANTIATE_TEST_CASE_P(AVX2, CFLSubAvgTest,
473 ::testing::ValuesIn(sub_avg_sizes_avx2));
Luc Trudeau9bd42782017-12-19 23:15:28 -0500474
475INSTANTIATE_TEST_CASE_P(AVX2, CFLSubsampleTest,
476 ::testing::ValuesIn(subsample_sizes_avx2));
David Michael Barr16f38c22017-12-21 01:56:03 +0900477
478INSTANTIATE_TEST_CASE_P(AVX2, CFLPredictTest,
479 ::testing::ValuesIn(predict_sizes_avx2));
David Michael Barrc363ab72018-01-12 16:53:38 +0900480
481INSTANTIATE_TEST_CASE_P(AVX2, CFLPredictHBDTest,
482 ::testing::ValuesIn(predict_sizes_hbd_avx2));
Luc Trudeaub4faea72017-12-15 16:44:01 -0500483#endif
484} // namespace