blob: 23cd5f588ae5d6b882ac6b746cb367d3c831d50e [file] [log] [blame]
Johannfbea8972012-06-28 11:43:58 -07001/*
Krishna Rapaka7319db52021-09-28 20:35:29 -07002 * Copyright (c) 2021, Alliance for Open Media. All rights reserved
Johannfbea8972012-06-28 11:43:58 -07003 *
Vibhoothi41c6dd72021-10-12 18:48:26 +00004 * This source code is subject to the terms of the BSD 3-Clause Clear License
5 * and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear
6 * License was not distributed with this source code in the LICENSE file, you
7 * can obtain it at aomedia.org/license/software-license/bsd-3-c-c/. If the
8 * Alliance for Open Media Patent License 1.0 was not distributed with this
9 * source code in the PATENTS file, you can obtain it at
10 * aomedia.org/license/patent-license/.
Johann123e8a62017-12-28 14:40:49 -080011 */
Johannfbea8972012-06-28 11:43:58 -070012
Johannfbea8972012-06-28 11:43:58 -070013#include <string.h>
14#include <limits.h>
15#include <stdio.h>
sarahparkera543df52018-11-02 16:02:05 -070016#include <tuple>
Johannfbea8972012-06-28 11:43:58 -070017
Tom Finegan7a07ece2017-02-07 17:14:05 -080018#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
Jingning Han097d59c2015-07-29 14:51:36 -070019
Tom Finegan60e653d2018-05-22 11:34:58 -070020#include "config/aom_config.h"
Tom Finegan44702c82018-05-22 13:00:39 -070021#include "config/aom_dsp_rtcd.h"
Tom Finegan60e653d2018-05-22 11:34:58 -070022
Johannfbea8972012-06-28 11:43:58 -070023#include "test/acm_random.h"
James Zern5b756742013-06-17 22:58:40 -070024#include "test/clear_system_state.h"
James Zerneebb6482012-11-27 13:08:05 -080025#include "test/register_state_check.h"
Johannfbea8972012-06-28 11:43:58 -070026#include "test/util.h"
Yaowu Xuf883b422016-08-30 14:01:10 -070027#include "aom/aom_codec.h"
28#include "aom_mem/aom_mem.h"
Yaowu Xuc27fc142016-08-22 16:08:15 -070029#include "aom_ports/mem.h"
Johannfbea8972012-06-28 11:43:58 -070030
James Almer756717c2022-10-19 17:32:48 +000031typedef unsigned int (*SadMxNFunc)(const uint16_t *src_ptr, int src_stride,
32 const uint16_t *ref_ptr, int ref_stride);
sarahparkera543df52018-11-02 16:02:05 -070033typedef std::tuple<int, int, SadMxNFunc, int> SadMxNParam;
Johannd5d92892015-04-17 16:11:38 -040034
James Almer756717c2022-10-19 17:32:48 +000035typedef unsigned int (*SadSkipMxNFunc)(const uint16_t *src_ptr, int src_stride,
36 const uint16_t *ref_ptr, int ref_stride);
chiyotsaic814afb2020-08-04 13:12:35 -070037typedef std::tuple<int, int, SadSkipMxNFunc, int> SadSkipMxNParam;
38
James Almer756717c2022-10-19 17:32:48 +000039typedef uint32_t (*SadMxNAvgFunc)(const uint16_t *src_ptr, int src_stride,
40 const uint16_t *ref_ptr, int ref_stride,
41 const uint16_t *second_pred);
sarahparkera543df52018-11-02 16:02:05 -070042typedef std::tuple<int, int, SadMxNAvgFunc, int> SadMxNAvgParam;
Johannfbea8972012-06-28 11:43:58 -070043
James Almer756717c2022-10-19 17:32:48 +000044typedef void (*DistWtdCompAvgFunc)(uint16_t *comp_pred, const uint16_t *pred,
45 int width, int height, const uint16_t *ref,
Debargha Mukherjee0c96c112018-12-20 16:04:18 -080046 int ref_stride,
47 const DIST_WTD_COMP_PARAMS *jcp_param);
sarahparkera543df52018-11-02 16:02:05 -070048typedef std::tuple<int, int, DistWtdCompAvgFunc, int> DistWtdCompAvgParam;
Cheng Chena0367dc2017-11-16 19:20:42 -080049
James Almer756717c2022-10-19 17:32:48 +000050typedef unsigned int (*DistWtdSadMxhFunc)(const uint16_t *src_ptr,
Debargha Mukherjee0c96c112018-12-20 16:04:18 -080051 int src_stride,
James Almer756717c2022-10-19 17:32:48 +000052 const uint16_t *ref_ptr,
Debargha Mukherjee0c96c112018-12-20 16:04:18 -080053 int ref_stride, int width,
54 int height);
sarahparkera543df52018-11-02 16:02:05 -070055typedef std::tuple<int, int, DistWtdSadMxhFunc, int> DistWtdSadMxhParam;
Cheng Chena0367dc2017-11-16 19:20:42 -080056
James Almer756717c2022-10-19 17:32:48 +000057typedef uint32_t (*DistWtdSadMxNAvgFunc)(const uint16_t *src_ptr,
58 int src_stride,
59 const uint16_t *ref_ptr,
60 int ref_stride,
61 const uint16_t *second_pred,
Debargha Mukherjee0c96c112018-12-20 16:04:18 -080062 const DIST_WTD_COMP_PARAMS *jcp_param);
sarahparkera543df52018-11-02 16:02:05 -070063typedef std::tuple<int, int, DistWtdSadMxNAvgFunc, int> DistWtdSadMxNAvgParam;
Cheng Chena0367dc2017-11-16 19:20:42 -080064
James Almer756717c2022-10-19 17:32:48 +000065typedef void (*SadMxNx4Func)(const uint16_t *src_ptr, int src_stride,
66 const uint16_t *const ref_ptr[], int ref_stride,
Peter de Rivaz7eee4872014-10-16 13:41:55 +010067 uint32_t *sad_array);
sarahparkera543df52018-11-02 16:02:05 -070068typedef std::tuple<int, int, SadMxNx4Func, int> SadMxNx4Param;
John Koleszar1cfc86e2013-03-01 12:43:41 -080069
James Almer756717c2022-10-19 17:32:48 +000070typedef void (*SadSkipMxNx4Func)(const uint16_t *src_ptr, int src_stride,
71 const uint16_t *const ref_ptr[],
72 int ref_stride, uint32_t *sad_array);
chiyotsaic814afb2020-08-04 13:12:35 -070073typedef std::tuple<int, int, SadSkipMxNx4Func, int> SadSkipMxNx4Param;
74
James Almer756717c2022-10-19 17:32:48 +000075typedef void (*SadMxNx4AvgFunc)(const uint16_t *src_ptr, int src_stride,
76 const uint16_t *const ref_ptr[], int ref_stride,
77 const uint16_t *second_pred,
Ruiling Song8dc32d72020-01-20 15:33:37 +080078 uint32_t *sad_array);
79typedef std::tuple<int, int, SadMxNx4AvgFunc, int> SadMxNx4AvgParam;
80
Yaowu Xuc27fc142016-08-22 16:08:15 -070081using libaom_test::ACMRandom;
Johannfbea8972012-06-28 11:43:58 -070082
83namespace {
John Koleszar1cfc86e2013-03-01 12:43:41 -080084class SADTestBase : public ::testing::Test {
James Zern10f8b362012-08-27 17:13:09 -070085 public:
clang-format3a826f12016-08-11 17:46:05 -070086 SADTestBase(int width, int height, int bit_depth)
87 : width_(width), height_(height), bd_(bit_depth) {}
John Koleszar1cfc86e2013-03-01 12:43:41 -080088
chiyotsai9dfac722020-07-07 17:43:02 -070089 static void SetUpTestSuite() {
clang-format3a826f12016-08-11 17:46:05 -070090 source_data16_ = reinterpret_cast<uint16_t *>(
Yaowu Xuf883b422016-08-30 14:01:10 -070091 aom_memalign(kDataAlignment, kDataBlockSize * sizeof(uint16_t)));
clang-format3a826f12016-08-11 17:46:05 -070092 reference_data16_ = reinterpret_cast<uint16_t *>(
Yaowu Xuf883b422016-08-30 14:01:10 -070093 aom_memalign(kDataAlignment, kDataBufferSize * sizeof(uint16_t)));
clang-format3a826f12016-08-11 17:46:05 -070094 second_pred16_ = reinterpret_cast<uint16_t *>(
Yaowu Xuf883b422016-08-30 14:01:10 -070095 aom_memalign(kDataAlignment, 128 * 128 * sizeof(uint16_t)));
Cheng Chena0367dc2017-11-16 19:20:42 -080096 comp_pred16_ = reinterpret_cast<uint16_t *>(
97 aom_memalign(kDataAlignment, 128 * 128 * sizeof(uint16_t)));
98 comp_pred16_test_ = reinterpret_cast<uint16_t *>(
99 aom_memalign(kDataAlignment, 128 * 128 * sizeof(uint16_t)));
James Zern10f8b362012-08-27 17:13:09 -0700100 }
101
chiyotsai9dfac722020-07-07 17:43:02 -0700102 static void TearDownTestSuite() {
Yaowu Xuf883b422016-08-30 14:01:10 -0700103 aom_free(source_data16_);
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100104 source_data16_ = NULL;
Yaowu Xuf883b422016-08-30 14:01:10 -0700105 aom_free(reference_data16_);
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100106 reference_data16_ = NULL;
Yaowu Xuf883b422016-08-30 14:01:10 -0700107 aom_free(second_pred16_);
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100108 second_pred16_ = NULL;
Cheng Chena0367dc2017-11-16 19:20:42 -0800109 aom_free(comp_pred16_);
110 comp_pred16_ = NULL;
111 aom_free(comp_pred16_test_);
112 comp_pred16_test_ = NULL;
James Zern10f8b362012-08-27 17:13:09 -0700113 }
114
Yaowu Xuc27fc142016-08-22 16:08:15 -0700115 virtual void TearDown() { libaom_test::ClearSystemState(); }
James Zern5b756742013-06-17 22:58:40 -0700116
James Zern10f8b362012-08-27 17:13:09 -0700117 protected:
Geza Lore697bf5b2016-03-02 11:12:52 +0000118 // Handle up to 4 128x128 blocks, with stride up to 256
James Zern10f8b362012-08-27 17:13:09 -0700119 static const int kDataAlignment = 16;
Geza Lore697bf5b2016-03-02 11:12:52 +0000120 static const int kDataBlockSize = 128 * 256;
John Koleszar1cfc86e2013-03-01 12:43:41 -0800121 static const int kDataBufferSize = 4 * kDataBlockSize;
James Zern10f8b362012-08-27 17:13:09 -0700122
Johannfbea8972012-06-28 11:43:58 -0700123 virtual void SetUp() {
James Almer756717c2022-10-19 17:32:48 +0000124 bit_depth_ = static_cast<aom_bit_depth_t>(bd_);
125 source_data_ = source_data16_;
126 reference_data_ = reference_data16_;
127 second_pred_ = second_pred16_;
128 comp_pred_ = comp_pred16_;
129 comp_pred_test_ = comp_pred16_test_;
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100130 mask_ = (1 << bit_depth_) - 1;
John Koleszar6b653cb2013-02-28 17:03:02 -0800131 source_stride_ = (width_ + 31) & ~31;
Johannfbea8972012-06-28 11:43:58 -0700132 reference_stride_ = width_ * 2;
133 rnd_.Reset(ACMRandom::DeterministicSeed());
134 }
135
James Almer756717c2022-10-19 17:32:48 +0000136 virtual uint16_t *GetReference(int block_idx) {
John Koleszar1cfc86e2013-03-01 12:43:41 -0800137 return reference_data_ + block_idx * kDataBlockSize;
Johannfbea8972012-06-28 11:43:58 -0700138 }
139
140 // Sum of Absolute Differences. Given two blocks, calculate the absolute
141 // difference between two pixels in the same relative location; accumulate.
Johannd5d92892015-04-17 16:11:38 -0400142 unsigned int ReferenceSAD(int block_idx) {
Johannfbea8972012-06-28 11:43:58 -0700143 unsigned int sad = 0;
James Almer756717c2022-10-19 17:32:48 +0000144 const uint16_t *const reference16 = GetReference(block_idx);
145 const uint16_t *const source16 = source_data_;
Johannfbea8972012-06-28 11:43:58 -0700146 for (int h = 0; h < height_; ++h) {
147 for (int w = 0; w < width_; ++w) {
James Almer756717c2022-10-19 17:32:48 +0000148 sad += abs(source16[h * source_stride_ + w] -
149 reference16[h * reference_stride_ + w]);
Jim Bankoskia16794d2014-05-15 08:31:20 -0700150 }
Johannfbea8972012-06-28 11:43:58 -0700151 }
152 return sad;
153 }
154
chiyotsaic814afb2020-08-04 13:12:35 -0700155 // Sum of Absolute Differences Skip rows. Given two blocks,
156 // calculate the absolute difference between two pixels in the same
157 // relative location every other row; accumulate and double the result at the
158 // end.
159 unsigned int ReferenceSADSkip(int block_idx) {
160 unsigned int sad = 0;
James Almer756717c2022-10-19 17:32:48 +0000161 const uint16_t *const reference16 = GetReference(block_idx);
162 const uint16_t *const source16 = source_data_;
chiyotsaic814afb2020-08-04 13:12:35 -0700163 for (int h = 0; h < height_; h += 2) {
164 for (int w = 0; w < width_; ++w) {
James Almer756717c2022-10-19 17:32:48 +0000165 sad += abs(source16[h * source_stride_ + w] -
166 reference16[h * reference_stride_ + w]);
chiyotsaic814afb2020-08-04 13:12:35 -0700167 }
168 }
169 return sad * 2;
170 }
171
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100172 // Sum of Absolute Differences Average. Given two blocks, and a prediction
173 // calculate the absolute difference between one pixel and average of the
174 // corresponding and predicted pixels; accumulate.
Johannd5d92892015-04-17 16:11:38 -0400175 unsigned int ReferenceSADavg(int block_idx) {
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100176 unsigned int sad = 0;
James Almer756717c2022-10-19 17:32:48 +0000177 const uint16_t *const reference16 = GetReference(block_idx);
178 const uint16_t *const source16 = source_data_;
179 const uint16_t *const second_pred16 = second_pred_;
Johannfbea8972012-06-28 11:43:58 -0700180 for (int h = 0; h < height_; ++h) {
181 for (int w = 0; w < width_; ++w) {
James Almer756717c2022-10-19 17:32:48 +0000182 const int tmp = second_pred16[h * width_ + w] +
183 reference16[h * reference_stride_ + w];
184 const uint16_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1);
185 sad += abs(source16[h * source_stride_ + w] - comp_pred);
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100186 }
187 }
188 return sad;
189 }
190
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800191 void ReferenceDistWtdCompAvg(int block_idx) {
James Almer756717c2022-10-19 17:32:48 +0000192 const uint16_t *const reference16 = GetReference(block_idx);
193 const uint16_t *const second_pred16 = second_pred_;
194 uint16_t *const comp_pred16 = comp_pred_;
Cheng Chena0367dc2017-11-16 19:20:42 -0800195 for (int h = 0; h < height_; ++h) {
196 for (int w = 0; w < width_; ++w) {
James Almer756717c2022-10-19 17:32:48 +0000197 const int tmp =
198 second_pred16[h * width_ + w] * jcp_param_.bck_offset +
199 reference16[h * reference_stride_ + w] * jcp_param_.fwd_offset;
200 comp_pred16[h * width_ + w] = ROUND_POWER_OF_TWO(tmp, 4);
Cheng Chena0367dc2017-11-16 19:20:42 -0800201 }
202 }
203 }
204
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800205 unsigned int ReferenceDistWtdSADavg(int block_idx) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800206 unsigned int sad = 0;
James Almer756717c2022-10-19 17:32:48 +0000207 const uint16_t *const reference16 = GetReference(block_idx);
208 const uint16_t *const source16 = source_data_;
209 const uint16_t *const second_pred16 = second_pred_;
Cheng Chena0367dc2017-11-16 19:20:42 -0800210 for (int h = 0; h < height_; ++h) {
211 for (int w = 0; w < width_; ++w) {
James Almer756717c2022-10-19 17:32:48 +0000212 const int tmp =
213 second_pred16[h * width_ + w] * jcp_param_.bck_offset +
214 reference16[h * reference_stride_ + w] * jcp_param_.fwd_offset;
215 const uint16_t comp_pred = ROUND_POWER_OF_TWO(tmp, 4);
216 sad += abs(source16[h * source_stride_ + w] - comp_pred);
Cheng Chena0367dc2017-11-16 19:20:42 -0800217 }
218 }
219 return sad;
220 }
Cheng Chena0367dc2017-11-16 19:20:42 -0800221
James Almer756717c2022-10-19 17:32:48 +0000222 void FillConstant(uint16_t *data, int stride, uint16_t fill_constant) {
223 uint16_t *data16 = data;
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100224 for (int h = 0; h < height_; ++h) {
225 for (int w = 0; w < width_; ++w) {
James Almer756717c2022-10-19 17:32:48 +0000226 data16[h * stride + w] = fill_constant;
Johannfbea8972012-06-28 11:43:58 -0700227 }
228 }
229 }
230
James Almer756717c2022-10-19 17:32:48 +0000231 void FillRandom(uint16_t *data, int stride) {
232 uint16_t *data16 = data;
Johannfbea8972012-06-28 11:43:58 -0700233 for (int h = 0; h < height_; ++h) {
234 for (int w = 0; w < width_; ++w) {
James Almer756717c2022-10-19 17:32:48 +0000235 data16[h * stride + w] = rnd_.Rand16() & mask_;
Johannfbea8972012-06-28 11:43:58 -0700236 }
237 }
238 }
239
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100240 int width_, height_, mask_, bd_;
Yaowu Xuf883b422016-08-30 14:01:10 -0700241 aom_bit_depth_t bit_depth_;
James Almer756717c2022-10-19 17:32:48 +0000242 static uint16_t *source_data_;
243 static uint16_t *reference_data_;
244 static uint16_t *second_pred_;
John Koleszar1cfc86e2013-03-01 12:43:41 -0800245 int source_stride_;
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100246 static uint16_t *source_data16_;
247 static uint16_t *reference_data16_;
248 static uint16_t *second_pred16_;
John Koleszar1cfc86e2013-03-01 12:43:41 -0800249 int reference_stride_;
James Almer756717c2022-10-19 17:32:48 +0000250 static uint16_t *comp_pred_;
Cheng Chena0367dc2017-11-16 19:20:42 -0800251 static uint16_t *comp_pred16_;
James Almer756717c2022-10-19 17:32:48 +0000252 static uint16_t *comp_pred_test_;
Cheng Chena0367dc2017-11-16 19:20:42 -0800253 static uint16_t *comp_pred16_test_;
Debargha Mukherjeef90004a2018-12-20 13:35:06 -0800254 DIST_WTD_COMP_PARAMS jcp_param_;
John Koleszar1cfc86e2013-03-01 12:43:41 -0800255
256 ACMRandom rnd_;
257};
258
Sebastien Alaiwan4322bc12017-06-05 10:18:28 +0200259class SADx4Test : public ::testing::WithParamInterface<SadMxNx4Param>,
260 public SADTestBase {
John Koleszar1cfc86e2013-03-01 12:43:41 -0800261 public:
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100262 SADx4Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {}
John Koleszar1cfc86e2013-03-01 12:43:41 -0800263
264 protected:
265 void SADs(unsigned int *results) {
James Almer756717c2022-10-19 17:32:48 +0000266 const uint16_t *references[] = { GetReference(0), GetReference(1),
267 GetReference(2), GetReference(3) };
John Koleszar1cfc86e2013-03-01 12:43:41 -0800268
clang-format3a826f12016-08-11 17:46:05 -0700269 ASM_REGISTER_STATE_CHECK(GET_PARAM(2)(
270 source_data_, source_stride_, references, reference_stride_, results));
John Koleszar1cfc86e2013-03-01 12:43:41 -0800271 }
272
273 void CheckSADs() {
274 unsigned int reference_sad, exp_sad[4];
275
276 SADs(exp_sad);
Deb Mukherjeefc882922014-05-13 10:11:42 -0700277 for (int block = 0; block < 4; ++block) {
Johannd5d92892015-04-17 16:11:38 -0400278 reference_sad = ReferenceSAD(block);
John Koleszar1cfc86e2013-03-01 12:43:41 -0800279
Deb Mukherjeefc882922014-05-13 10:11:42 -0700280 EXPECT_EQ(reference_sad, exp_sad[block]) << "block " << block;
John Koleszar1cfc86e2013-03-01 12:43:41 -0800281 }
282 }
chiyotsaic814afb2020-08-04 13:12:35 -0700283
284 void SpeedSAD() {
285 int test_count = 2000000;
286 unsigned int exp_sad[4];
287 while (test_count > 0) {
288 SADs(exp_sad);
289 test_count -= 1;
290 }
291 }
292};
293
294class SADSkipx4Test : public ::testing::WithParamInterface<SadMxNx4Param>,
295 public SADTestBase {
296 public:
297 SADSkipx4Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {}
298
299 protected:
300 void SADs(unsigned int *results) {
James Almer756717c2022-10-19 17:32:48 +0000301 const uint16_t *references[] = { GetReference(0), GetReference(1),
302 GetReference(2), GetReference(3) };
chiyotsaic814afb2020-08-04 13:12:35 -0700303
304 ASM_REGISTER_STATE_CHECK(GET_PARAM(2)(
305 source_data_, source_stride_, references, reference_stride_, results));
306 }
307
308 void CheckSADs() {
309 unsigned int reference_sad, exp_sad[4];
310
311 SADs(exp_sad);
312 for (int block = 0; block < 4; ++block) {
313 reference_sad = ReferenceSADSkip(block);
314
315 EXPECT_EQ(reference_sad, exp_sad[block]) << "block " << block;
316 }
317 }
318
319 void SpeedSAD() {
320 int test_count = 2000000;
321 unsigned int exp_sad[4];
322 while (test_count > 0) {
323 SADs(exp_sad);
324 test_count -= 1;
325 }
326 }
John Koleszar1cfc86e2013-03-01 12:43:41 -0800327};
328
Ruiling Song8dc32d72020-01-20 15:33:37 +0800329class SADx4AvgTest : public ::testing::WithParamInterface<SadMxNx4AvgParam>,
330 public SADTestBase {
331 public:
332 SADx4AvgTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {}
333
334 protected:
335 void SADs(unsigned int *results) {
James Almer756717c2022-10-19 17:32:48 +0000336 const uint16_t *references[] = { GetReference(0), GetReference(1),
337 GetReference(2), GetReference(3) };
Ruiling Song8dc32d72020-01-20 15:33:37 +0800338
339 ASM_REGISTER_STATE_CHECK(GET_PARAM(2)(source_data_, source_stride_,
340 references, reference_stride_,
341 second_pred_, results));
342 }
343
344 void CheckSADs() {
345 unsigned int reference_sad, exp_sad[4];
346
347 SADs(exp_sad);
348 for (int block = 0; block < 4; ++block) {
349 reference_sad = ReferenceSADavg(block);
350
351 EXPECT_EQ(reference_sad, exp_sad[block]) << "block " << block;
352 }
353 }
354
355 void SpeedSAD() {
356 int test_count = 200000;
357 unsigned int exp_sad[4];
358 while (test_count > 0) {
359 SADs(exp_sad);
360 test_count -= 1;
361 }
362 }
363};
James Almer857e93f2022-05-25 16:44:43 +0000364GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SADx4AvgTest);
Ruiling Song8dc32d72020-01-20 15:33:37 +0800365
Sebastien Alaiwan4322bc12017-06-05 10:18:28 +0200366class SADTest : public ::testing::WithParamInterface<SadMxNParam>,
367 public SADTestBase {
Deb Mukherjeefc882922014-05-13 10:11:42 -0700368 public:
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100369 SADTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {}
Deb Mukherjeefc882922014-05-13 10:11:42 -0700370
371 protected:
Deb Mukherjeefc882922014-05-13 10:11:42 -0700372 unsigned int SAD(int block_idx) {
373 unsigned int ret;
James Almer756717c2022-10-19 17:32:48 +0000374 const uint16_t *const reference = GetReference(block_idx);
Deb Mukherjeefc882922014-05-13 10:11:42 -0700375
James Zern29e1b1a2014-07-09 21:02:02 -0700376 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_,
377 reference, reference_stride_));
Deb Mukherjeefc882922014-05-13 10:11:42 -0700378 return ret;
379 }
380
381 void CheckSAD() {
Johannd5d92892015-04-17 16:11:38 -0400382 const unsigned int reference_sad = ReferenceSAD(0);
Deb Mukherjeefc882922014-05-13 10:11:42 -0700383 const unsigned int exp_sad = SAD(0);
384
385 ASSERT_EQ(reference_sad, exp_sad);
386 }
Yi Luoe9832582016-11-29 19:38:12 -0800387
388 void SpeedSAD() {
389 int test_count = 20000000;
390 while (test_count > 0) {
391 SAD(0);
392 test_count -= 1;
393 }
394 }
Deb Mukherjeefc882922014-05-13 10:11:42 -0700395};
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100396
chiyotsaic814afb2020-08-04 13:12:35 -0700397class SADSkipTest : public ::testing::WithParamInterface<SadMxNParam>,
398 public SADTestBase {
399 public:
400 SADSkipTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {}
401
402 protected:
403 unsigned int SAD(int block_idx) {
404 unsigned int ret;
James Almer756717c2022-10-19 17:32:48 +0000405 const uint16_t *const reference = GetReference(block_idx);
chiyotsaic814afb2020-08-04 13:12:35 -0700406
407 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_,
408 reference, reference_stride_));
409 return ret;
410 }
411
412 void CheckSAD() {
413 const unsigned int reference_sad = ReferenceSADSkip(0);
414 const unsigned int exp_sad = SAD(0);
415
416 ASSERT_EQ(reference_sad, exp_sad);
417 }
418
419 void SpeedSAD() {
420 int test_count = 20000000;
421 while (test_count > 0) {
422 SAD(0);
423 test_count -= 1;
424 }
425 }
426};
427
Sebastien Alaiwan4322bc12017-06-05 10:18:28 +0200428class SADavgTest : public ::testing::WithParamInterface<SadMxNAvgParam>,
429 public SADTestBase {
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100430 public:
Johannd5d92892015-04-17 16:11:38 -0400431 SADavgTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {}
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100432
433 protected:
434 unsigned int SAD_avg(int block_idx) {
435 unsigned int ret;
James Almer756717c2022-10-19 17:32:48 +0000436 const uint16_t *const reference = GetReference(block_idx);
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100437
438 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_,
439 reference, reference_stride_,
440 second_pred_));
441 return ret;
442 }
443
444 void CheckSAD() {
Johannd5d92892015-04-17 16:11:38 -0400445 const unsigned int reference_sad = ReferenceSADavg(0);
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100446 const unsigned int exp_sad = SAD_avg(0);
447
448 ASSERT_EQ(reference_sad, exp_sad);
449 }
450};
Deb Mukherjeefc882922014-05-13 10:11:42 -0700451
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800452class DistWtdCompAvgTest
453 : public ::testing::WithParamInterface<DistWtdCompAvgParam>,
454 public SADTestBase {
Cheng Chena0367dc2017-11-16 19:20:42 -0800455 public:
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800456 DistWtdCompAvgTest()
457 : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {}
Cheng Chena0367dc2017-11-16 19:20:42 -0800458
459 protected:
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800460 void dist_wtd_comp_avg(int block_idx) {
James Almer756717c2022-10-19 17:32:48 +0000461 const uint16_t *const reference = GetReference(block_idx);
Cheng Chena0367dc2017-11-16 19:20:42 -0800462
463 ASM_REGISTER_STATE_CHECK(GET_PARAM(2)(comp_pred_test_, second_pred_, width_,
464 height_, reference, reference_stride_,
465 &jcp_param_));
466 }
467
468 void CheckCompAvg() {
469 for (int j = 0; j < 2; ++j) {
470 for (int i = 0; i < 4; ++i) {
Urvang Joshif96d93f2021-05-10 13:53:07 -0700471 jcp_param_.fwd_offset = quant_dist_lookup_table[i][j];
472 jcp_param_.bck_offset = quant_dist_lookup_table[i][1 - j];
Cheng Chena0367dc2017-11-16 19:20:42 -0800473
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800474 ReferenceDistWtdCompAvg(0);
475 dist_wtd_comp_avg(0);
Cheng Chena0367dc2017-11-16 19:20:42 -0800476
477 for (int y = 0; y < height_; ++y)
478 for (int x = 0; x < width_; ++x)
479 ASSERT_EQ(comp_pred_[y * width_ + x],
480 comp_pred_test_[y * width_ + x]);
481 }
482 }
483 }
484};
James Almer857e93f2022-05-25 16:44:43 +0000485GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DistWtdCompAvgTest);
Cheng Chena0367dc2017-11-16 19:20:42 -0800486
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800487class DistWtdSADTest : public ::testing::WithParamInterface<DistWtdSadMxhParam>,
488 public SADTestBase {
Cheng Chena0367dc2017-11-16 19:20:42 -0800489 public:
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800490 DistWtdSADTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {}
Cheng Chena0367dc2017-11-16 19:20:42 -0800491
492 protected:
493 unsigned int SAD(int block_idx) {
494 unsigned int ret;
James Almer756717c2022-10-19 17:32:48 +0000495 const uint16_t *const reference = GetReference(block_idx);
Cheng Chena0367dc2017-11-16 19:20:42 -0800496
497 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_,
498 reference, reference_stride_,
499 GET_PARAM(0), GET_PARAM(1)));
500 return ret;
501 }
502
503 void CheckSAD() {
504 const unsigned int reference_sad = ReferenceSAD(0);
505 const unsigned int exp_sad = SAD(0);
506
507 ASSERT_EQ(reference_sad, exp_sad);
508 }
509
510 void SpeedSAD() {
511 int test_count = 20000000;
512 while (test_count > 0) {
513 SAD(0);
514 test_count -= 1;
515 }
516 }
517};
chiyotsai9dfac722020-07-07 17:43:02 -0700518GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DistWtdSADTest);
Cheng Chena0367dc2017-11-16 19:20:42 -0800519
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800520class DistWtdSADavgTest
521 : public ::testing::WithParamInterface<DistWtdSadMxNAvgParam>,
522 public SADTestBase {
Cheng Chena0367dc2017-11-16 19:20:42 -0800523 public:
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800524 DistWtdSADavgTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {}
Cheng Chena0367dc2017-11-16 19:20:42 -0800525
526 protected:
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800527 unsigned int dist_wtd_SAD_avg(int block_idx) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800528 unsigned int ret;
James Almer756717c2022-10-19 17:32:48 +0000529 const uint16_t *const reference = GetReference(block_idx);
Cheng Chena0367dc2017-11-16 19:20:42 -0800530
531 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_,
532 reference, reference_stride_,
533 second_pred_, &jcp_param_));
534 return ret;
535 }
536
537 void CheckSAD() {
538 for (int j = 0; j < 2; ++j) {
539 for (int i = 0; i < 4; ++i) {
Urvang Joshif96d93f2021-05-10 13:53:07 -0700540 jcp_param_.fwd_offset = quant_dist_lookup_table[i][j];
541 jcp_param_.bck_offset = quant_dist_lookup_table[i][1 - j];
Cheng Chena0367dc2017-11-16 19:20:42 -0800542
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800543 const unsigned int reference_sad = ReferenceDistWtdSADavg(0);
544 const unsigned int exp_sad = dist_wtd_SAD_avg(0);
Cheng Chena0367dc2017-11-16 19:20:42 -0800545
546 ASSERT_EQ(reference_sad, exp_sad);
547 }
548 }
549 }
550};
James Almer857e93f2022-05-25 16:44:43 +0000551GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DistWtdSADavgTest);
Cheng Chena0367dc2017-11-16 19:20:42 -0800552
James Almer756717c2022-10-19 17:32:48 +0000553uint16_t *SADTestBase::source_data_ = NULL;
554uint16_t *SADTestBase::reference_data_ = NULL;
555uint16_t *SADTestBase::second_pred_ = NULL;
556uint16_t *SADTestBase::comp_pred_ = NULL;
557uint16_t *SADTestBase::comp_pred_test_ = NULL;
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100558uint16_t *SADTestBase::source_data16_ = NULL;
559uint16_t *SADTestBase::reference_data16_ = NULL;
560uint16_t *SADTestBase::second_pred16_ = NULL;
Cheng Chena0367dc2017-11-16 19:20:42 -0800561uint16_t *SADTestBase::comp_pred16_ = NULL;
562uint16_t *SADTestBase::comp_pred16_test_ = NULL;
James Zern10f8b362012-08-27 17:13:09 -0700563
Johannfbea8972012-06-28 11:43:58 -0700564TEST_P(SADTest, MaxRef) {
565 FillConstant(source_data_, source_stride_, 0);
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100566 FillConstant(reference_data_, reference_stride_, mask_);
Johannd5d92892015-04-17 16:11:38 -0400567 CheckSAD();
Johannfbea8972012-06-28 11:43:58 -0700568}
569
Deb Mukherjeefc882922014-05-13 10:11:42 -0700570TEST_P(SADTest, MaxSrc) {
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100571 FillConstant(source_data_, source_stride_, mask_);
Deb Mukherjeefc882922014-05-13 10:11:42 -0700572 FillConstant(reference_data_, reference_stride_, 0);
Johannd5d92892015-04-17 16:11:38 -0400573 CheckSAD();
Deb Mukherjeefc882922014-05-13 10:11:42 -0700574}
575
576TEST_P(SADTest, ShortRef) {
Johannd5d92892015-04-17 16:11:38 -0400577 const int tmp_stride = reference_stride_;
Deb Mukherjeefc882922014-05-13 10:11:42 -0700578 reference_stride_ >>= 1;
579 FillRandom(source_data_, source_stride_);
580 FillRandom(reference_data_, reference_stride_);
Johannd5d92892015-04-17 16:11:38 -0400581 CheckSAD();
Deb Mukherjeefc882922014-05-13 10:11:42 -0700582 reference_stride_ = tmp_stride;
583}
584
585TEST_P(SADTest, UnalignedRef) {
586 // The reference frame, but not the source frame, may be unaligned for
587 // certain types of searches.
588 const int tmp_stride = reference_stride_;
589 reference_stride_ -= 1;
590 FillRandom(source_data_, source_stride_);
591 FillRandom(reference_data_, reference_stride_);
Johannd5d92892015-04-17 16:11:38 -0400592 CheckSAD();
Deb Mukherjeefc882922014-05-13 10:11:42 -0700593 reference_stride_ = tmp_stride;
594}
595
596TEST_P(SADTest, ShortSrc) {
597 const int tmp_stride = source_stride_;
598 source_stride_ >>= 1;
Yi Luoe9832582016-11-29 19:38:12 -0800599 int test_count = 2000;
600 while (test_count > 0) {
601 FillRandom(source_data_, source_stride_);
602 FillRandom(reference_data_, reference_stride_);
603 CheckSAD();
604 test_count -= 1;
605 }
Deb Mukherjeefc882922014-05-13 10:11:42 -0700606 source_stride_ = tmp_stride;
607}
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100608
Sarah Parkerd1da7482021-04-16 17:39:25 -0700609TEST_P(SADTest, DISABLED_Speed) {
Yi Luoe9832582016-11-29 19:38:12 -0800610 const int tmp_stride = source_stride_;
611 source_stride_ >>= 1;
612 FillRandom(source_data_, source_stride_);
613 FillRandom(reference_data_, reference_stride_);
614 SpeedSAD();
615 source_stride_ = tmp_stride;
616}
Yi Luoe9832582016-11-29 19:38:12 -0800617
chiyotsaic814afb2020-08-04 13:12:35 -0700618TEST_P(SADSkipTest, MaxRef) {
619 FillConstant(source_data_, source_stride_, 0);
620 FillConstant(reference_data_, reference_stride_, mask_);
621 CheckSAD();
622}
623
624TEST_P(SADSkipTest, MaxSrc) {
625 FillConstant(source_data_, source_stride_, mask_);
626 FillConstant(reference_data_, reference_stride_, 0);
627 CheckSAD();
628}
629
630TEST_P(SADSkipTest, ShortRef) {
631 const int tmp_stride = reference_stride_;
632 reference_stride_ >>= 1;
633 FillRandom(source_data_, source_stride_);
634 FillRandom(reference_data_, reference_stride_);
635 CheckSAD();
636 reference_stride_ = tmp_stride;
637}
638
639TEST_P(SADSkipTest, UnalignedRef) {
640 // The reference frame, but not the source frame, may be unaligned for
641 // certain types of searches.
642 const int tmp_stride = reference_stride_;
643 reference_stride_ -= 1;
644 FillRandom(source_data_, source_stride_);
645 FillRandom(reference_data_, reference_stride_);
646 CheckSAD();
647 reference_stride_ = tmp_stride;
648}
649
650TEST_P(SADSkipTest, ShortSrc) {
651 const int tmp_stride = source_stride_;
652 source_stride_ >>= 1;
653 int test_count = 2000;
654 while (test_count > 0) {
655 FillRandom(source_data_, source_stride_);
656 FillRandom(reference_data_, reference_stride_);
657 CheckSAD();
658 test_count -= 1;
659 }
660 source_stride_ = tmp_stride;
661}
662
Sarah Parkerd1da7482021-04-16 17:39:25 -0700663TEST_P(SADSkipTest, DISABLED_Speed) {
chiyotsaic814afb2020-08-04 13:12:35 -0700664 const int tmp_stride = source_stride_;
665 source_stride_ >>= 1;
666 FillRandom(source_data_, source_stride_);
667 FillRandom(reference_data_, reference_stride_);
668 SpeedSAD();
669 source_stride_ = tmp_stride;
670}
chiyotsaic814afb2020-08-04 13:12:35 -0700671
Johannd5d92892015-04-17 16:11:38 -0400672TEST_P(SADavgTest, MaxRef) {
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100673 FillConstant(source_data_, source_stride_, 0);
674 FillConstant(reference_data_, reference_stride_, mask_);
675 FillConstant(second_pred_, width_, 0);
676 CheckSAD();
677}
Johannd5d92892015-04-17 16:11:38 -0400678TEST_P(SADavgTest, MaxSrc) {
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100679 FillConstant(source_data_, source_stride_, mask_);
680 FillConstant(reference_data_, reference_stride_, 0);
681 FillConstant(second_pred_, width_, 0);
682 CheckSAD();
683}
684
Johannd5d92892015-04-17 16:11:38 -0400685TEST_P(SADavgTest, ShortRef) {
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100686 const int tmp_stride = reference_stride_;
687 reference_stride_ >>= 1;
688 FillRandom(source_data_, source_stride_);
689 FillRandom(reference_data_, reference_stride_);
690 FillRandom(second_pred_, width_);
691 CheckSAD();
692 reference_stride_ = tmp_stride;
693}
694
Johannd5d92892015-04-17 16:11:38 -0400695TEST_P(SADavgTest, UnalignedRef) {
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100696 // The reference frame, but not the source frame, may be unaligned for
697 // certain types of searches.
698 const int tmp_stride = reference_stride_;
699 reference_stride_ -= 1;
700 FillRandom(source_data_, source_stride_);
701 FillRandom(reference_data_, reference_stride_);
702 FillRandom(second_pred_, width_);
703 CheckSAD();
704 reference_stride_ = tmp_stride;
705}
706
Johannd5d92892015-04-17 16:11:38 -0400707TEST_P(SADavgTest, ShortSrc) {
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100708 const int tmp_stride = source_stride_;
709 source_stride_ >>= 1;
Yi Luoe9832582016-11-29 19:38:12 -0800710 int test_count = 2000;
711 while (test_count > 0) {
712 FillRandom(source_data_, source_stride_);
713 FillRandom(reference_data_, reference_stride_);
714 FillRandom(second_pred_, width_);
715 CheckSAD();
716 test_count -= 1;
717 }
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100718 source_stride_ = tmp_stride;
719}
Deb Mukherjeefc882922014-05-13 10:11:42 -0700720
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800721TEST_P(DistWtdCompAvgTest, MaxRef) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800722 FillConstant(reference_data_, reference_stride_, mask_);
723 FillConstant(second_pred_, width_, 0);
724 CheckCompAvg();
725}
726
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800727TEST_P(DistWtdCompAvgTest, MaxSecondPred) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800728 FillConstant(reference_data_, reference_stride_, 0);
729 FillConstant(second_pred_, width_, mask_);
730 CheckCompAvg();
731}
732
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800733TEST_P(DistWtdCompAvgTest, ShortRef) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800734 const int tmp_stride = reference_stride_;
735 reference_stride_ >>= 1;
736 FillRandom(reference_data_, reference_stride_);
737 FillRandom(second_pred_, width_);
738 CheckCompAvg();
739 reference_stride_ = tmp_stride;
740}
741
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800742TEST_P(DistWtdCompAvgTest, UnalignedRef) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800743 // The reference frame, but not the source frame, may be unaligned for
744 // certain types of searches.
745 const int tmp_stride = reference_stride_;
746 reference_stride_ -= 1;
747 FillRandom(reference_data_, reference_stride_);
748 FillRandom(second_pred_, width_);
749 CheckCompAvg();
750 reference_stride_ = tmp_stride;
751}
752
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800753TEST_P(DistWtdSADTest, MaxRef) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800754 FillConstant(source_data_, source_stride_, 0);
755 FillConstant(reference_data_, reference_stride_, mask_);
756 CheckSAD();
757}
758
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800759TEST_P(DistWtdSADTest, MaxSrc) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800760 FillConstant(source_data_, source_stride_, mask_);
761 FillConstant(reference_data_, reference_stride_, 0);
762 CheckSAD();
763}
764
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800765TEST_P(DistWtdSADTest, ShortRef) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800766 const int tmp_stride = reference_stride_;
767 reference_stride_ >>= 1;
768 FillRandom(source_data_, source_stride_);
769 FillRandom(reference_data_, reference_stride_);
770 CheckSAD();
771 reference_stride_ = tmp_stride;
772}
773
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800774TEST_P(DistWtdSADTest, UnalignedRef) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800775 // The reference frame, but not the source frame, may be unaligned for
776 // certain types of searches.
777 const int tmp_stride = reference_stride_;
778 reference_stride_ -= 1;
779 FillRandom(source_data_, source_stride_);
780 FillRandom(reference_data_, reference_stride_);
781 CheckSAD();
782 reference_stride_ = tmp_stride;
783}
784
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800785TEST_P(DistWtdSADTest, ShortSrc) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800786 const int tmp_stride = source_stride_;
787 source_stride_ >>= 1;
788 int test_count = 2000;
789 while (test_count > 0) {
790 FillRandom(source_data_, source_stride_);
791 FillRandom(reference_data_, reference_stride_);
792 CheckSAD();
793 test_count -= 1;
794 }
795 source_stride_ = tmp_stride;
796}
797
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800798TEST_P(DistWtdSADavgTest, MaxRef) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800799 FillConstant(source_data_, source_stride_, 0);
800 FillConstant(reference_data_, reference_stride_, mask_);
801 FillConstant(second_pred_, width_, 0);
802 CheckSAD();
803}
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800804TEST_P(DistWtdSADavgTest, MaxSrc) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800805 FillConstant(source_data_, source_stride_, mask_);
806 FillConstant(reference_data_, reference_stride_, 0);
807 FillConstant(second_pred_, width_, 0);
808 CheckSAD();
809}
810
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800811TEST_P(DistWtdSADavgTest, ShortRef) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800812 const int tmp_stride = reference_stride_;
813 reference_stride_ >>= 1;
814 FillRandom(source_data_, source_stride_);
815 FillRandom(reference_data_, reference_stride_);
816 FillRandom(second_pred_, width_);
817 CheckSAD();
818 reference_stride_ = tmp_stride;
819}
820
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800821TEST_P(DistWtdSADavgTest, UnalignedRef) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800822 // The reference frame, but not the source frame, may be unaligned for
823 // certain types of searches.
824 const int tmp_stride = reference_stride_;
825 reference_stride_ -= 1;
826 FillRandom(source_data_, source_stride_);
827 FillRandom(reference_data_, reference_stride_);
828 FillRandom(second_pred_, width_);
829 CheckSAD();
830 reference_stride_ = tmp_stride;
831}
832
Debargha Mukherjee0c96c112018-12-20 16:04:18 -0800833TEST_P(DistWtdSADavgTest, ShortSrc) {
Cheng Chena0367dc2017-11-16 19:20:42 -0800834 const int tmp_stride = source_stride_;
835 source_stride_ >>= 1;
836 int test_count = 2000;
837 while (test_count > 0) {
838 FillRandom(source_data_, source_stride_);
839 FillRandom(reference_data_, reference_stride_);
840 FillRandom(second_pred_, width_);
841 CheckSAD();
842 test_count -= 1;
843 }
844 source_stride_ = tmp_stride;
845}
Cheng Chena0367dc2017-11-16 19:20:42 -0800846
John Koleszar1cfc86e2013-03-01 12:43:41 -0800847TEST_P(SADx4Test, MaxRef) {
848 FillConstant(source_data_, source_stride_, 0);
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100849 FillConstant(GetReference(0), reference_stride_, mask_);
850 FillConstant(GetReference(1), reference_stride_, mask_);
851 FillConstant(GetReference(2), reference_stride_, mask_);
852 FillConstant(GetReference(3), reference_stride_, mask_);
John Koleszar1cfc86e2013-03-01 12:43:41 -0800853 CheckSADs();
854}
855
John Koleszar1cfc86e2013-03-01 12:43:41 -0800856TEST_P(SADx4Test, MaxSrc) {
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100857 FillConstant(source_data_, source_stride_, mask_);
John Koleszar1cfc86e2013-03-01 12:43:41 -0800858 FillConstant(GetReference(0), reference_stride_, 0);
859 FillConstant(GetReference(1), reference_stride_, 0);
860 FillConstant(GetReference(2), reference_stride_, 0);
861 FillConstant(GetReference(3), reference_stride_, 0);
862 CheckSADs();
863}
864
John Koleszar1cfc86e2013-03-01 12:43:41 -0800865TEST_P(SADx4Test, ShortRef) {
866 int tmp_stride = reference_stride_;
867 reference_stride_ >>= 1;
868 FillRandom(source_data_, source_stride_);
869 FillRandom(GetReference(0), reference_stride_);
870 FillRandom(GetReference(1), reference_stride_);
871 FillRandom(GetReference(2), reference_stride_);
872 FillRandom(GetReference(3), reference_stride_);
873 CheckSADs();
874 reference_stride_ = tmp_stride;
875}
876
John Koleszar1cfc86e2013-03-01 12:43:41 -0800877TEST_P(SADx4Test, UnalignedRef) {
878 // The reference frame, but not the source frame, may be unaligned for
879 // certain types of searches.
880 int tmp_stride = reference_stride_;
881 reference_stride_ -= 1;
882 FillRandom(source_data_, source_stride_);
883 FillRandom(GetReference(0), reference_stride_);
884 FillRandom(GetReference(1), reference_stride_);
885 FillRandom(GetReference(2), reference_stride_);
886 FillRandom(GetReference(3), reference_stride_);
887 CheckSADs();
888 reference_stride_ = tmp_stride;
889}
890
John Koleszar1cfc86e2013-03-01 12:43:41 -0800891TEST_P(SADx4Test, ShortSrc) {
892 int tmp_stride = source_stride_;
893 source_stride_ >>= 1;
Yi Luoe9832582016-11-29 19:38:12 -0800894 int test_count = 1000;
895 while (test_count > 0) {
896 FillRandom(source_data_, source_stride_);
897 FillRandom(GetReference(0), reference_stride_);
898 FillRandom(GetReference(1), reference_stride_);
899 FillRandom(GetReference(2), reference_stride_);
900 FillRandom(GetReference(3), reference_stride_);
901 CheckSADs();
902 test_count -= 1;
903 }
John Koleszar1cfc86e2013-03-01 12:43:41 -0800904 source_stride_ = tmp_stride;
905}
906
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100907TEST_P(SADx4Test, SrcAlignedByWidth) {
James Almer756717c2022-10-19 17:32:48 +0000908 uint16_t *tmp_source_data = source_data_;
Peter de Rivaz7eee4872014-10-16 13:41:55 +0100909 source_data_ += width_;
910 FillRandom(source_data_, source_stride_);
911 FillRandom(GetReference(0), reference_stride_);
912 FillRandom(GetReference(1), reference_stride_);
913 FillRandom(GetReference(2), reference_stride_);
914 FillRandom(GetReference(3), reference_stride_);
915 CheckSADs();
916 source_data_ = tmp_source_data;
917}
918
Sarah Parkerd1da7482021-04-16 17:39:25 -0700919TEST_P(SADx4Test, DISABLED_Speed) {
chiyotsaic814afb2020-08-04 13:12:35 -0700920 FillRandom(source_data_, source_stride_);
921 FillRandom(GetReference(0), reference_stride_);
922 FillRandom(GetReference(1), reference_stride_);
923 FillRandom(GetReference(2), reference_stride_);
924 FillRandom(GetReference(3), reference_stride_);
925 SpeedSAD();
926}
chiyotsaic814afb2020-08-04 13:12:35 -0700927
928// SADSkipx4
929TEST_P(SADSkipx4Test, MaxRef) {
930 FillConstant(source_data_, source_stride_, 0);
931 FillConstant(GetReference(0), reference_stride_, mask_);
932 FillConstant(GetReference(1), reference_stride_, mask_);
933 FillConstant(GetReference(2), reference_stride_, mask_);
934 FillConstant(GetReference(3), reference_stride_, mask_);
935 CheckSADs();
936}
937
938TEST_P(SADSkipx4Test, MaxSrc) {
939 FillConstant(source_data_, source_stride_, mask_);
940 FillConstant(GetReference(0), reference_stride_, 0);
941 FillConstant(GetReference(1), reference_stride_, 0);
942 FillConstant(GetReference(2), reference_stride_, 0);
943 FillConstant(GetReference(3), reference_stride_, 0);
944 CheckSADs();
945}
946
947TEST_P(SADSkipx4Test, ShortRef) {
948 int tmp_stride = reference_stride_;
949 reference_stride_ >>= 1;
950 FillRandom(source_data_, source_stride_);
951 FillRandom(GetReference(0), reference_stride_);
952 FillRandom(GetReference(1), reference_stride_);
953 FillRandom(GetReference(2), reference_stride_);
954 FillRandom(GetReference(3), reference_stride_);
955 CheckSADs();
956 reference_stride_ = tmp_stride;
957}
958
959TEST_P(SADSkipx4Test, UnalignedRef) {
960 // The reference frame, but not the source frame, may be unaligned for
961 // certain types of searches.
962 int tmp_stride = reference_stride_;
963 reference_stride_ -= 1;
964 FillRandom(source_data_, source_stride_);
965 FillRandom(GetReference(0), reference_stride_);
966 FillRandom(GetReference(1), reference_stride_);
967 FillRandom(GetReference(2), reference_stride_);
968 FillRandom(GetReference(3), reference_stride_);
969 CheckSADs();
970 reference_stride_ = tmp_stride;
971}
972
973TEST_P(SADSkipx4Test, ShortSrc) {
974 int tmp_stride = source_stride_;
975 source_stride_ >>= 1;
976 int test_count = 1000;
977 while (test_count > 0) {
978 FillRandom(source_data_, source_stride_);
979 FillRandom(GetReference(0), reference_stride_);
980 FillRandom(GetReference(1), reference_stride_);
981 FillRandom(GetReference(2), reference_stride_);
982 FillRandom(GetReference(3), reference_stride_);
983 CheckSADs();
984 test_count -= 1;
985 }
986 source_stride_ = tmp_stride;
987}
988
989TEST_P(SADSkipx4Test, SrcAlignedByWidth) {
James Almer756717c2022-10-19 17:32:48 +0000990 uint16_t *tmp_source_data = source_data_;
chiyotsaic814afb2020-08-04 13:12:35 -0700991 source_data_ += width_;
992 FillRandom(source_data_, source_stride_);
993 FillRandom(GetReference(0), reference_stride_);
994 FillRandom(GetReference(1), reference_stride_);
995 FillRandom(GetReference(2), reference_stride_);
996 FillRandom(GetReference(3), reference_stride_);
997 CheckSADs();
998 source_data_ = tmp_source_data;
999}
1000
Sarah Parkerd1da7482021-04-16 17:39:25 -07001001TEST_P(SADSkipx4Test, DISABLED_Speed) {
chiyotsaic814afb2020-08-04 13:12:35 -07001002 FillRandom(source_data_, source_stride_);
1003 FillRandom(GetReference(0), reference_stride_);
1004 FillRandom(GetReference(1), reference_stride_);
1005 FillRandom(GetReference(2), reference_stride_);
1006 FillRandom(GetReference(3), reference_stride_);
1007 SpeedSAD();
1008}
chiyotsaic814afb2020-08-04 13:12:35 -07001009
sarahparkera543df52018-11-02 16:02:05 -07001010using std::make_tuple;
James Zern12ddb752012-08-15 11:54:41 -07001011
Sarah Parkerd1da7482021-04-16 17:39:25 -07001012TEST_P(SADx4AvgTest, DISABLED_Speed) {
Ruiling Song8dc32d72020-01-20 15:33:37 +08001013 int tmp_stride = reference_stride_;
1014 reference_stride_ >>= 1;
1015 FillRandom(source_data_, source_stride_);
1016 FillRandom(GetReference(0), reference_stride_);
1017 FillRandom(GetReference(1), reference_stride_);
1018 FillRandom(GetReference(2), reference_stride_);
1019 FillRandom(GetReference(3), reference_stride_);
1020 FillRandom(second_pred_, width_);
1021 SpeedSAD();
1022 reference_stride_ = tmp_stride;
1023}
Ruiling Song8dc32d72020-01-20 15:33:37 +08001024
1025TEST_P(SADx4AvgTest, MaxRef) {
1026 FillConstant(source_data_, source_stride_, 0);
1027 FillConstant(GetReference(0), reference_stride_, mask_);
1028 FillConstant(GetReference(1), reference_stride_, mask_);
1029 FillConstant(GetReference(2), reference_stride_, mask_);
1030 FillConstant(GetReference(3), reference_stride_, mask_);
1031 FillConstant(second_pred_, width_, 0);
1032 CheckSADs();
1033}
1034
1035TEST_P(SADx4AvgTest, MaxSrc) {
1036 FillConstant(source_data_, source_stride_, mask_);
1037 FillConstant(GetReference(0), reference_stride_, 0);
1038 FillConstant(GetReference(1), reference_stride_, 0);
1039 FillConstant(GetReference(2), reference_stride_, 0);
1040 FillConstant(GetReference(3), reference_stride_, 0);
1041 FillConstant(second_pred_, width_, 0);
1042 CheckSADs();
1043}
1044
1045TEST_P(SADx4AvgTest, ShortRef) {
1046 int tmp_stride = reference_stride_;
1047 reference_stride_ >>= 1;
1048 FillRandom(source_data_, source_stride_);
1049 FillRandom(GetReference(0), reference_stride_);
1050 FillRandom(GetReference(1), reference_stride_);
1051 FillRandom(GetReference(2), reference_stride_);
1052 FillRandom(GetReference(3), reference_stride_);
1053 FillRandom(second_pred_, width_);
1054 CheckSADs();
1055 reference_stride_ = tmp_stride;
1056}
1057
1058TEST_P(SADx4AvgTest, UnalignedRef) {
1059 // The reference frame, but not the source frame, may be unaligned for
1060 // certain types of searches.
1061 int tmp_stride = reference_stride_;
1062 reference_stride_ -= 1;
1063 FillRandom(source_data_, source_stride_);
1064 FillRandom(GetReference(0), reference_stride_);
1065 FillRandom(GetReference(1), reference_stride_);
1066 FillRandom(GetReference(2), reference_stride_);
1067 FillRandom(GetReference(3), reference_stride_);
1068 FillRandom(second_pred_, width_);
1069 CheckSADs();
1070 reference_stride_ = tmp_stride;
1071}
1072
James Zernd7cff282014-02-27 12:49:02 -08001073//------------------------------------------------------------------------------
1074// C functions
James Zern18e733b2014-07-16 18:59:28 -07001075const SadMxNParam c_tests[] = {
Yaowu Xuf883b422016-08-30 14:01:10 -07001076 make_tuple(128, 128, &aom_highbd_sad128x128_c, 8),
1077 make_tuple(128, 64, &aom_highbd_sad128x64_c, 8),
1078 make_tuple(64, 128, &aom_highbd_sad64x128_c, 8),
Yaowu Xuf883b422016-08-30 14:01:10 -07001079 make_tuple(64, 64, &aom_highbd_sad64x64_c, 8),
1080 make_tuple(64, 32, &aom_highbd_sad64x32_c, 8),
1081 make_tuple(32, 64, &aom_highbd_sad32x64_c, 8),
1082 make_tuple(32, 32, &aom_highbd_sad32x32_c, 8),
1083 make_tuple(32, 16, &aom_highbd_sad32x16_c, 8),
1084 make_tuple(16, 32, &aom_highbd_sad16x32_c, 8),
1085 make_tuple(16, 16, &aom_highbd_sad16x16_c, 8),
1086 make_tuple(16, 8, &aom_highbd_sad16x8_c, 8),
1087 make_tuple(8, 16, &aom_highbd_sad8x16_c, 8),
1088 make_tuple(8, 8, &aom_highbd_sad8x8_c, 8),
1089 make_tuple(8, 4, &aom_highbd_sad8x4_c, 8),
1090 make_tuple(4, 8, &aom_highbd_sad4x8_c, 8),
1091 make_tuple(4, 4, &aom_highbd_sad4x4_c, 8),
Yaowu Xuf883b422016-08-30 14:01:10 -07001092 make_tuple(128, 128, &aom_highbd_sad128x128_c, 10),
1093 make_tuple(128, 64, &aom_highbd_sad128x64_c, 10),
1094 make_tuple(64, 128, &aom_highbd_sad64x128_c, 10),
Yaowu Xuf883b422016-08-30 14:01:10 -07001095 make_tuple(64, 64, &aom_highbd_sad64x64_c, 10),
1096 make_tuple(64, 32, &aom_highbd_sad64x32_c, 10),
1097 make_tuple(32, 64, &aom_highbd_sad32x64_c, 10),
1098 make_tuple(32, 32, &aom_highbd_sad32x32_c, 10),
1099 make_tuple(32, 16, &aom_highbd_sad32x16_c, 10),
1100 make_tuple(16, 32, &aom_highbd_sad16x32_c, 10),
1101 make_tuple(16, 16, &aom_highbd_sad16x16_c, 10),
1102 make_tuple(16, 8, &aom_highbd_sad16x8_c, 10),
1103 make_tuple(8, 16, &aom_highbd_sad8x16_c, 10),
1104 make_tuple(8, 8, &aom_highbd_sad8x8_c, 10),
1105 make_tuple(8, 4, &aom_highbd_sad8x4_c, 10),
1106 make_tuple(4, 8, &aom_highbd_sad4x8_c, 10),
1107 make_tuple(4, 4, &aom_highbd_sad4x4_c, 10),
Yaowu Xuf883b422016-08-30 14:01:10 -07001108 make_tuple(128, 128, &aom_highbd_sad128x128_c, 12),
1109 make_tuple(128, 64, &aom_highbd_sad128x64_c, 12),
1110 make_tuple(64, 128, &aom_highbd_sad64x128_c, 12),
Yaowu Xuf883b422016-08-30 14:01:10 -07001111 make_tuple(64, 64, &aom_highbd_sad64x64_c, 12),
1112 make_tuple(64, 32, &aom_highbd_sad64x32_c, 12),
1113 make_tuple(32, 64, &aom_highbd_sad32x64_c, 12),
1114 make_tuple(32, 32, &aom_highbd_sad32x32_c, 12),
1115 make_tuple(32, 16, &aom_highbd_sad32x16_c, 12),
1116 make_tuple(16, 32, &aom_highbd_sad16x32_c, 12),
1117 make_tuple(16, 16, &aom_highbd_sad16x16_c, 12),
1118 make_tuple(16, 8, &aom_highbd_sad16x8_c, 12),
1119 make_tuple(8, 16, &aom_highbd_sad8x16_c, 12),
1120 make_tuple(8, 8, &aom_highbd_sad8x8_c, 12),
1121 make_tuple(8, 4, &aom_highbd_sad8x4_c, 12),
1122 make_tuple(4, 8, &aom_highbd_sad4x8_c, 12),
1123 make_tuple(4, 4, &aom_highbd_sad4x4_c, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001124
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001125 make_tuple(64, 16, &aom_highbd_sad64x16_c, 8),
1126 make_tuple(16, 64, &aom_highbd_sad16x64_c, 8),
1127 make_tuple(64, 16, &aom_highbd_sad64x16_c, 10),
1128 make_tuple(16, 64, &aom_highbd_sad16x64_c, 10),
1129 make_tuple(64, 16, &aom_highbd_sad64x16_c, 12),
1130 make_tuple(16, 64, &aom_highbd_sad16x64_c, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001131
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001132 make_tuple(32, 8, &aom_highbd_sad32x8_c, 8),
1133 make_tuple(8, 32, &aom_highbd_sad8x32_c, 8),
1134 make_tuple(32, 8, &aom_highbd_sad32x8_c, 10),
1135 make_tuple(8, 32, &aom_highbd_sad8x32_c, 10),
1136 make_tuple(32, 8, &aom_highbd_sad32x8_c, 12),
1137 make_tuple(8, 32, &aom_highbd_sad8x32_c, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001138
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001139 make_tuple(16, 4, &aom_highbd_sad16x4_c, 8),
1140 make_tuple(4, 16, &aom_highbd_sad4x16_c, 8),
1141 make_tuple(16, 4, &aom_highbd_sad16x4_c, 10),
1142 make_tuple(4, 16, &aom_highbd_sad4x16_c, 10),
1143 make_tuple(16, 4, &aom_highbd_sad16x4_c, 12),
1144 make_tuple(4, 16, &aom_highbd_sad4x16_c, 12),
Deb Mukherjeefc882922014-05-13 10:11:42 -07001145};
Cheng Chen96786fe2020-02-14 17:28:25 -08001146INSTANTIATE_TEST_SUITE_P(C, SADTest, ::testing::ValuesIn(c_tests));
Deb Mukherjeefc882922014-05-13 10:11:42 -07001147
chiyotsaic814afb2020-08-04 13:12:35 -07001148const SadSkipMxNParam skip_c_tests[] = {
chiyotsaic814afb2020-08-04 13:12:35 -07001149 make_tuple(128, 128, &aom_highbd_sad_skip_128x128_c, 8),
1150 make_tuple(128, 64, &aom_highbd_sad_skip_128x64_c, 8),
1151 make_tuple(64, 128, &aom_highbd_sad_skip_64x128_c, 8),
1152 make_tuple(64, 64, &aom_highbd_sad_skip_64x64_c, 8),
1153 make_tuple(64, 32, &aom_highbd_sad_skip_64x32_c, 8),
1154 make_tuple(32, 64, &aom_highbd_sad_skip_32x64_c, 8),
1155 make_tuple(32, 32, &aom_highbd_sad_skip_32x32_c, 8),
1156 make_tuple(32, 16, &aom_highbd_sad_skip_32x16_c, 8),
1157 make_tuple(16, 32, &aom_highbd_sad_skip_16x32_c, 8),
1158 make_tuple(16, 16, &aom_highbd_sad_skip_16x16_c, 8),
1159 make_tuple(16, 8, &aom_highbd_sad_skip_16x8_c, 8),
1160 make_tuple(8, 16, &aom_highbd_sad_skip_8x16_c, 8),
1161 make_tuple(8, 8, &aom_highbd_sad_skip_8x8_c, 8),
1162 make_tuple(8, 4, &aom_highbd_sad_skip_8x4_c, 8),
1163 make_tuple(4, 8, &aom_highbd_sad_skip_4x8_c, 8),
1164 make_tuple(4, 4, &aom_highbd_sad_skip_4x4_c, 8),
1165 make_tuple(64, 16, &aom_highbd_sad_skip_64x16_c, 8),
1166 make_tuple(16, 64, &aom_highbd_sad_skip_16x64_c, 8),
1167 make_tuple(32, 8, &aom_highbd_sad_skip_32x8_c, 8),
1168 make_tuple(8, 32, &aom_highbd_sad_skip_8x32_c, 8),
1169 make_tuple(16, 4, &aom_highbd_sad_skip_16x4_c, 8),
1170 make_tuple(4, 16, &aom_highbd_sad_skip_4x16_c, 8),
1171
1172 make_tuple(128, 128, &aom_highbd_sad_skip_128x128_c, 10),
1173 make_tuple(128, 64, &aom_highbd_sad_skip_128x64_c, 10),
1174 make_tuple(64, 128, &aom_highbd_sad_skip_64x128_c, 10),
1175 make_tuple(64, 64, &aom_highbd_sad_skip_64x64_c, 10),
1176 make_tuple(64, 32, &aom_highbd_sad_skip_64x32_c, 10),
1177 make_tuple(32, 64, &aom_highbd_sad_skip_32x64_c, 10),
1178 make_tuple(32, 32, &aom_highbd_sad_skip_32x32_c, 10),
1179 make_tuple(32, 16, &aom_highbd_sad_skip_32x16_c, 10),
1180 make_tuple(16, 32, &aom_highbd_sad_skip_16x32_c, 10),
1181 make_tuple(16, 16, &aom_highbd_sad_skip_16x16_c, 10),
1182 make_tuple(16, 8, &aom_highbd_sad_skip_16x8_c, 10),
1183 make_tuple(8, 16, &aom_highbd_sad_skip_8x16_c, 10),
1184 make_tuple(8, 8, &aom_highbd_sad_skip_8x8_c, 10),
1185 make_tuple(8, 4, &aom_highbd_sad_skip_8x4_c, 10),
1186 make_tuple(4, 8, &aom_highbd_sad_skip_4x8_c, 10),
1187 make_tuple(4, 4, &aom_highbd_sad_skip_4x4_c, 10),
1188 make_tuple(64, 16, &aom_highbd_sad_skip_64x16_c, 10),
1189 make_tuple(16, 64, &aom_highbd_sad_skip_16x64_c, 10),
1190 make_tuple(32, 8, &aom_highbd_sad_skip_32x8_c, 10),
1191 make_tuple(8, 32, &aom_highbd_sad_skip_8x32_c, 10),
1192 make_tuple(16, 4, &aom_highbd_sad_skip_16x4_c, 10),
1193 make_tuple(4, 16, &aom_highbd_sad_skip_4x16_c, 10),
1194
1195 make_tuple(128, 128, &aom_highbd_sad_skip_128x128_c, 12),
1196 make_tuple(128, 64, &aom_highbd_sad_skip_128x64_c, 12),
1197 make_tuple(64, 128, &aom_highbd_sad_skip_64x128_c, 12),
1198 make_tuple(64, 64, &aom_highbd_sad_skip_64x64_c, 12),
1199 make_tuple(64, 32, &aom_highbd_sad_skip_64x32_c, 12),
1200 make_tuple(32, 64, &aom_highbd_sad_skip_32x64_c, 12),
1201 make_tuple(32, 32, &aom_highbd_sad_skip_32x32_c, 12),
1202 make_tuple(32, 16, &aom_highbd_sad_skip_32x16_c, 12),
1203 make_tuple(16, 32, &aom_highbd_sad_skip_16x32_c, 12),
1204 make_tuple(16, 16, &aom_highbd_sad_skip_16x16_c, 12),
1205 make_tuple(16, 8, &aom_highbd_sad_skip_16x8_c, 12),
1206 make_tuple(8, 16, &aom_highbd_sad_skip_8x16_c, 12),
1207 make_tuple(8, 8, &aom_highbd_sad_skip_8x8_c, 12),
1208 make_tuple(8, 4, &aom_highbd_sad_skip_8x4_c, 12),
1209 make_tuple(4, 8, &aom_highbd_sad_skip_4x8_c, 12),
1210 make_tuple(4, 4, &aom_highbd_sad_skip_4x4_c, 12),
1211 make_tuple(64, 16, &aom_highbd_sad_skip_64x16_c, 12),
1212 make_tuple(16, 64, &aom_highbd_sad_skip_16x64_c, 12),
1213 make_tuple(32, 8, &aom_highbd_sad_skip_32x8_c, 12),
1214 make_tuple(8, 32, &aom_highbd_sad_skip_8x32_c, 12),
1215 make_tuple(16, 4, &aom_highbd_sad_skip_16x4_c, 12),
1216 make_tuple(4, 16, &aom_highbd_sad_skip_4x16_c, 12),
chiyotsaic814afb2020-08-04 13:12:35 -07001217};
1218INSTANTIATE_TEST_SUITE_P(C, SADSkipTest, ::testing::ValuesIn(skip_c_tests));
1219
Johannd5d92892015-04-17 16:11:38 -04001220const SadMxNAvgParam avg_c_tests[] = {
Yaowu Xuf883b422016-08-30 14:01:10 -07001221 make_tuple(128, 128, &aom_highbd_sad128x128_avg_c, 8),
1222 make_tuple(128, 64, &aom_highbd_sad128x64_avg_c, 8),
1223 make_tuple(64, 128, &aom_highbd_sad64x128_avg_c, 8),
Yaowu Xuf883b422016-08-30 14:01:10 -07001224 make_tuple(64, 64, &aom_highbd_sad64x64_avg_c, 8),
1225 make_tuple(64, 32, &aom_highbd_sad64x32_avg_c, 8),
1226 make_tuple(32, 64, &aom_highbd_sad32x64_avg_c, 8),
1227 make_tuple(32, 32, &aom_highbd_sad32x32_avg_c, 8),
1228 make_tuple(32, 16, &aom_highbd_sad32x16_avg_c, 8),
1229 make_tuple(16, 32, &aom_highbd_sad16x32_avg_c, 8),
1230 make_tuple(16, 16, &aom_highbd_sad16x16_avg_c, 8),
1231 make_tuple(16, 8, &aom_highbd_sad16x8_avg_c, 8),
1232 make_tuple(8, 16, &aom_highbd_sad8x16_avg_c, 8),
1233 make_tuple(8, 8, &aom_highbd_sad8x8_avg_c, 8),
1234 make_tuple(8, 4, &aom_highbd_sad8x4_avg_c, 8),
1235 make_tuple(4, 8, &aom_highbd_sad4x8_avg_c, 8),
1236 make_tuple(4, 4, &aom_highbd_sad4x4_avg_c, 8),
Yaowu Xuf883b422016-08-30 14:01:10 -07001237 make_tuple(128, 128, &aom_highbd_sad128x128_avg_c, 10),
1238 make_tuple(128, 64, &aom_highbd_sad128x64_avg_c, 10),
1239 make_tuple(64, 128, &aom_highbd_sad64x128_avg_c, 10),
Yaowu Xuf883b422016-08-30 14:01:10 -07001240 make_tuple(64, 64, &aom_highbd_sad64x64_avg_c, 10),
1241 make_tuple(64, 32, &aom_highbd_sad64x32_avg_c, 10),
1242 make_tuple(32, 64, &aom_highbd_sad32x64_avg_c, 10),
1243 make_tuple(32, 32, &aom_highbd_sad32x32_avg_c, 10),
1244 make_tuple(32, 16, &aom_highbd_sad32x16_avg_c, 10),
1245 make_tuple(16, 32, &aom_highbd_sad16x32_avg_c, 10),
1246 make_tuple(16, 16, &aom_highbd_sad16x16_avg_c, 10),
1247 make_tuple(16, 8, &aom_highbd_sad16x8_avg_c, 10),
1248 make_tuple(8, 16, &aom_highbd_sad8x16_avg_c, 10),
1249 make_tuple(8, 8, &aom_highbd_sad8x8_avg_c, 10),
1250 make_tuple(8, 4, &aom_highbd_sad8x4_avg_c, 10),
1251 make_tuple(4, 8, &aom_highbd_sad4x8_avg_c, 10),
1252 make_tuple(4, 4, &aom_highbd_sad4x4_avg_c, 10),
Yaowu Xuf883b422016-08-30 14:01:10 -07001253 make_tuple(128, 128, &aom_highbd_sad128x128_avg_c, 12),
1254 make_tuple(128, 64, &aom_highbd_sad128x64_avg_c, 12),
1255 make_tuple(64, 128, &aom_highbd_sad64x128_avg_c, 12),
Yaowu Xuf883b422016-08-30 14:01:10 -07001256 make_tuple(64, 64, &aom_highbd_sad64x64_avg_c, 12),
1257 make_tuple(64, 32, &aom_highbd_sad64x32_avg_c, 12),
1258 make_tuple(32, 64, &aom_highbd_sad32x64_avg_c, 12),
1259 make_tuple(32, 32, &aom_highbd_sad32x32_avg_c, 12),
1260 make_tuple(32, 16, &aom_highbd_sad32x16_avg_c, 12),
1261 make_tuple(16, 32, &aom_highbd_sad16x32_avg_c, 12),
1262 make_tuple(16, 16, &aom_highbd_sad16x16_avg_c, 12),
1263 make_tuple(16, 8, &aom_highbd_sad16x8_avg_c, 12),
1264 make_tuple(8, 16, &aom_highbd_sad8x16_avg_c, 12),
1265 make_tuple(8, 8, &aom_highbd_sad8x8_avg_c, 12),
1266 make_tuple(8, 4, &aom_highbd_sad8x4_avg_c, 12),
1267 make_tuple(4, 8, &aom_highbd_sad4x8_avg_c, 12),
1268 make_tuple(4, 4, &aom_highbd_sad4x4_avg_c, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001269
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001270 make_tuple(64, 16, &aom_highbd_sad64x16_avg_c, 8),
1271 make_tuple(16, 64, &aom_highbd_sad16x64_avg_c, 8),
1272 make_tuple(64, 16, &aom_highbd_sad64x16_avg_c, 10),
1273 make_tuple(16, 64, &aom_highbd_sad16x64_avg_c, 10),
1274 make_tuple(64, 16, &aom_highbd_sad64x16_avg_c, 12),
1275 make_tuple(16, 64, &aom_highbd_sad16x64_avg_c, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001276
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001277 make_tuple(32, 8, &aom_highbd_sad32x8_avg_c, 8),
1278 make_tuple(8, 32, &aom_highbd_sad8x32_avg_c, 8),
1279 make_tuple(32, 8, &aom_highbd_sad32x8_avg_c, 10),
1280 make_tuple(8, 32, &aom_highbd_sad8x32_avg_c, 10),
1281 make_tuple(32, 8, &aom_highbd_sad32x8_avg_c, 12),
1282 make_tuple(8, 32, &aom_highbd_sad8x32_avg_c, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001283
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001284 make_tuple(16, 4, &aom_highbd_sad16x4_avg_c, 8),
1285 make_tuple(4, 16, &aom_highbd_sad4x16_avg_c, 8),
1286 make_tuple(16, 4, &aom_highbd_sad16x4_avg_c, 10),
1287 make_tuple(4, 16, &aom_highbd_sad4x16_avg_c, 10),
1288 make_tuple(16, 4, &aom_highbd_sad16x4_avg_c, 12),
1289 make_tuple(4, 16, &aom_highbd_sad4x16_avg_c, 12),
Johannd5d92892015-04-17 16:11:38 -04001290};
Cheng Chen96786fe2020-02-14 17:28:25 -08001291INSTANTIATE_TEST_SUITE_P(C, SADavgTest, ::testing::ValuesIn(avg_c_tests));
Johannd5d92892015-04-17 16:11:38 -04001292
Johannd5d92892015-04-17 16:11:38 -04001293const SadMxNx4Param x4d_c_tests[] = {
Yaowu Xuf883b422016-08-30 14:01:10 -07001294 make_tuple(128, 128, &aom_highbd_sad128x128x4d_c, 8),
1295 make_tuple(128, 64, &aom_highbd_sad128x64x4d_c, 8),
1296 make_tuple(64, 128, &aom_highbd_sad64x128x4d_c, 8),
Yaowu Xuf883b422016-08-30 14:01:10 -07001297 make_tuple(64, 64, &aom_highbd_sad64x64x4d_c, 8),
1298 make_tuple(64, 32, &aom_highbd_sad64x32x4d_c, 8),
1299 make_tuple(32, 64, &aom_highbd_sad32x64x4d_c, 8),
1300 make_tuple(32, 32, &aom_highbd_sad32x32x4d_c, 8),
1301 make_tuple(32, 16, &aom_highbd_sad32x16x4d_c, 8),
1302 make_tuple(16, 32, &aom_highbd_sad16x32x4d_c, 8),
1303 make_tuple(16, 16, &aom_highbd_sad16x16x4d_c, 8),
1304 make_tuple(16, 8, &aom_highbd_sad16x8x4d_c, 8),
1305 make_tuple(8, 16, &aom_highbd_sad8x16x4d_c, 8),
1306 make_tuple(8, 8, &aom_highbd_sad8x8x4d_c, 8),
1307 make_tuple(8, 4, &aom_highbd_sad8x4x4d_c, 8),
1308 make_tuple(4, 8, &aom_highbd_sad4x8x4d_c, 8),
1309 make_tuple(4, 4, &aom_highbd_sad4x4x4d_c, 8),
Yaowu Xuf883b422016-08-30 14:01:10 -07001310 make_tuple(128, 128, &aom_highbd_sad128x128x4d_c, 10),
1311 make_tuple(128, 64, &aom_highbd_sad128x64x4d_c, 10),
1312 make_tuple(64, 128, &aom_highbd_sad64x128x4d_c, 10),
Yaowu Xuf883b422016-08-30 14:01:10 -07001313 make_tuple(64, 64, &aom_highbd_sad64x64x4d_c, 10),
1314 make_tuple(64, 32, &aom_highbd_sad64x32x4d_c, 10),
1315 make_tuple(32, 64, &aom_highbd_sad32x64x4d_c, 10),
1316 make_tuple(32, 32, &aom_highbd_sad32x32x4d_c, 10),
1317 make_tuple(32, 16, &aom_highbd_sad32x16x4d_c, 10),
1318 make_tuple(16, 32, &aom_highbd_sad16x32x4d_c, 10),
1319 make_tuple(16, 16, &aom_highbd_sad16x16x4d_c, 10),
1320 make_tuple(16, 8, &aom_highbd_sad16x8x4d_c, 10),
1321 make_tuple(8, 16, &aom_highbd_sad8x16x4d_c, 10),
1322 make_tuple(8, 8, &aom_highbd_sad8x8x4d_c, 10),
1323 make_tuple(8, 4, &aom_highbd_sad8x4x4d_c, 10),
1324 make_tuple(4, 8, &aom_highbd_sad4x8x4d_c, 10),
1325 make_tuple(4, 4, &aom_highbd_sad4x4x4d_c, 10),
Yaowu Xuf883b422016-08-30 14:01:10 -07001326 make_tuple(128, 128, &aom_highbd_sad128x128x4d_c, 12),
1327 make_tuple(128, 64, &aom_highbd_sad128x64x4d_c, 12),
1328 make_tuple(64, 128, &aom_highbd_sad64x128x4d_c, 12),
Yaowu Xuf883b422016-08-30 14:01:10 -07001329 make_tuple(64, 64, &aom_highbd_sad64x64x4d_c, 12),
1330 make_tuple(64, 32, &aom_highbd_sad64x32x4d_c, 12),
1331 make_tuple(32, 64, &aom_highbd_sad32x64x4d_c, 12),
1332 make_tuple(32, 32, &aom_highbd_sad32x32x4d_c, 12),
1333 make_tuple(32, 16, &aom_highbd_sad32x16x4d_c, 12),
1334 make_tuple(16, 32, &aom_highbd_sad16x32x4d_c, 12),
1335 make_tuple(16, 16, &aom_highbd_sad16x16x4d_c, 12),
1336 make_tuple(16, 8, &aom_highbd_sad16x8x4d_c, 12),
1337 make_tuple(8, 16, &aom_highbd_sad8x16x4d_c, 12),
1338 make_tuple(8, 8, &aom_highbd_sad8x8x4d_c, 12),
1339 make_tuple(8, 4, &aom_highbd_sad8x4x4d_c, 12),
1340 make_tuple(4, 8, &aom_highbd_sad4x8x4d_c, 12),
1341 make_tuple(4, 4, &aom_highbd_sad4x4x4d_c, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001342
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001343 make_tuple(64, 16, &aom_highbd_sad64x16x4d_c, 8),
1344 make_tuple(16, 64, &aom_highbd_sad16x64x4d_c, 8),
1345 make_tuple(64, 16, &aom_highbd_sad64x16x4d_c, 10),
1346 make_tuple(16, 64, &aom_highbd_sad16x64x4d_c, 10),
1347 make_tuple(64, 16, &aom_highbd_sad64x16x4d_c, 12),
1348 make_tuple(16, 64, &aom_highbd_sad16x64x4d_c, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001349
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001350 make_tuple(32, 8, &aom_highbd_sad32x8x4d_c, 8),
1351 make_tuple(8, 32, &aom_highbd_sad8x32x4d_c, 8),
1352 make_tuple(32, 8, &aom_highbd_sad32x8x4d_c, 10),
1353 make_tuple(8, 32, &aom_highbd_sad8x32x4d_c, 10),
1354 make_tuple(32, 8, &aom_highbd_sad32x8x4d_c, 12),
1355 make_tuple(8, 32, &aom_highbd_sad8x32x4d_c, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001356
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001357 make_tuple(16, 4, &aom_highbd_sad16x4x4d_c, 8),
1358 make_tuple(4, 16, &aom_highbd_sad4x16x4d_c, 8),
1359 make_tuple(16, 4, &aom_highbd_sad16x4x4d_c, 10),
1360 make_tuple(4, 16, &aom_highbd_sad4x16x4d_c, 10),
1361 make_tuple(16, 4, &aom_highbd_sad16x4x4d_c, 12),
1362 make_tuple(4, 16, &aom_highbd_sad4x16x4d_c, 12),
Johannd5d92892015-04-17 16:11:38 -04001363};
Cheng Chen96786fe2020-02-14 17:28:25 -08001364INSTANTIATE_TEST_SUITE_P(C, SADx4Test, ::testing::ValuesIn(x4d_c_tests));
John Koleszar1cfc86e2013-03-01 12:43:41 -08001365
chiyotsaic814afb2020-08-04 13:12:35 -07001366const SadMxNx4Param skip_x4d_c_tests[] = {
chiyotsaic814afb2020-08-04 13:12:35 -07001367 make_tuple(128, 128, &aom_highbd_sad_skip_128x128x4d_c, 8),
1368 make_tuple(128, 64, &aom_highbd_sad_skip_128x64x4d_c, 8),
1369 make_tuple(64, 128, &aom_highbd_sad_skip_64x128x4d_c, 8),
1370 make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_c, 8),
1371 make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_c, 8),
1372 make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_c, 8),
1373 make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_c, 8),
1374 make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_c, 8),
1375 make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_c, 8),
1376 make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_c, 8),
1377 make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_c, 8),
1378 make_tuple(8, 16, &aom_highbd_sad_skip_8x16x4d_c, 8),
1379 make_tuple(8, 8, &aom_highbd_sad_skip_8x8x4d_c, 8),
1380 make_tuple(8, 4, &aom_highbd_sad_skip_8x4x4d_c, 8),
1381 make_tuple(4, 8, &aom_highbd_sad_skip_4x8x4d_c, 8),
1382 make_tuple(4, 4, &aom_highbd_sad_skip_4x4x4d_c, 8),
1383 make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_c, 8),
1384 make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_c, 8),
1385 make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_c, 8),
1386 make_tuple(8, 32, &aom_highbd_sad_skip_8x32x4d_c, 8),
1387 make_tuple(16, 4, &aom_highbd_sad_skip_16x4x4d_c, 8),
1388 make_tuple(4, 16, &aom_highbd_sad_skip_4x16x4d_c, 8),
1389
1390 make_tuple(128, 128, &aom_highbd_sad_skip_128x128x4d_c, 10),
1391 make_tuple(128, 64, &aom_highbd_sad_skip_128x64x4d_c, 10),
1392 make_tuple(64, 128, &aom_highbd_sad_skip_64x128x4d_c, 10),
1393 make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_c, 10),
1394 make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_c, 10),
1395 make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_c, 10),
1396 make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_c, 10),
1397 make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_c, 10),
1398 make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_c, 10),
1399 make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_c, 10),
1400 make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_c, 10),
1401 make_tuple(8, 16, &aom_highbd_sad_skip_8x16x4d_c, 10),
1402 make_tuple(8, 8, &aom_highbd_sad_skip_8x8x4d_c, 10),
1403 make_tuple(8, 4, &aom_highbd_sad_skip_8x4x4d_c, 10),
1404 make_tuple(4, 8, &aom_highbd_sad_skip_4x8x4d_c, 10),
1405 make_tuple(4, 4, &aom_highbd_sad_skip_4x4x4d_c, 10),
1406 make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_c, 10),
1407 make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_c, 10),
1408 make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_c, 10),
1409 make_tuple(8, 32, &aom_highbd_sad_skip_8x32x4d_c, 10),
1410 make_tuple(16, 4, &aom_highbd_sad_skip_16x4x4d_c, 10),
1411 make_tuple(4, 16, &aom_highbd_sad_skip_4x16x4d_c, 10),
1412
1413 make_tuple(128, 128, &aom_highbd_sad_skip_128x128x4d_c, 12),
1414 make_tuple(128, 64, &aom_highbd_sad_skip_128x64x4d_c, 12),
1415 make_tuple(64, 128, &aom_highbd_sad_skip_64x128x4d_c, 12),
1416 make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_c, 12),
1417 make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_c, 12),
1418 make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_c, 12),
1419 make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_c, 12),
1420 make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_c, 12),
1421 make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_c, 12),
1422 make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_c, 12),
1423 make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_c, 12),
1424 make_tuple(8, 16, &aom_highbd_sad_skip_8x16x4d_c, 12),
1425 make_tuple(8, 8, &aom_highbd_sad_skip_8x8x4d_c, 12),
1426 make_tuple(8, 4, &aom_highbd_sad_skip_8x4x4d_c, 12),
1427 make_tuple(4, 8, &aom_highbd_sad_skip_4x8x4d_c, 12),
1428 make_tuple(4, 4, &aom_highbd_sad_skip_4x4x4d_c, 12),
1429 make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_c, 12),
1430 make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_c, 12),
1431 make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_c, 12),
1432 make_tuple(8, 32, &aom_highbd_sad_skip_8x32x4d_c, 12),
1433 make_tuple(16, 4, &aom_highbd_sad_skip_16x4x4d_c, 12),
1434 make_tuple(4, 16, &aom_highbd_sad_skip_4x16x4d_c, 12),
chiyotsaic814afb2020-08-04 13:12:35 -07001435};
1436INSTANTIATE_TEST_SUITE_P(C, SADSkipx4Test,
1437 ::testing::ValuesIn(skip_x4d_c_tests));
James Zernd7cff282014-02-27 12:49:02 -08001438//------------------------------------------------------------------------------
1439// x86 functions
Johannfbea8972012-06-28 11:43:58 -07001440#if HAVE_SSE2
James Zern18e733b2014-07-16 18:59:28 -07001441const SadMxNParam sse2_tests[] = {
Yaowu Xuf883b422016-08-30 14:01:10 -07001442 make_tuple(64, 64, &aom_highbd_sad64x64_sse2, 8),
1443 make_tuple(64, 32, &aom_highbd_sad64x32_sse2, 8),
1444 make_tuple(32, 64, &aom_highbd_sad32x64_sse2, 8),
1445 make_tuple(32, 32, &aom_highbd_sad32x32_sse2, 8),
1446 make_tuple(32, 16, &aom_highbd_sad32x16_sse2, 8),
1447 make_tuple(16, 32, &aom_highbd_sad16x32_sse2, 8),
1448 make_tuple(16, 16, &aom_highbd_sad16x16_sse2, 8),
1449 make_tuple(16, 8, &aom_highbd_sad16x8_sse2, 8),
1450 make_tuple(8, 16, &aom_highbd_sad8x16_sse2, 8),
1451 make_tuple(8, 8, &aom_highbd_sad8x8_sse2, 8),
1452 make_tuple(8, 4, &aom_highbd_sad8x4_sse2, 8),
chiyotsaic6b9f6b2019-07-16 10:39:32 -07001453 make_tuple(4, 8, &aom_highbd_sad4x8_sse2, 8),
1454 make_tuple(4, 4, &aom_highbd_sad4x4_sse2, 8),
Yaowu Xuf883b422016-08-30 14:01:10 -07001455 make_tuple(64, 64, &aom_highbd_sad64x64_sse2, 10),
1456 make_tuple(64, 32, &aom_highbd_sad64x32_sse2, 10),
1457 make_tuple(32, 64, &aom_highbd_sad32x64_sse2, 10),
1458 make_tuple(32, 32, &aom_highbd_sad32x32_sse2, 10),
1459 make_tuple(32, 16, &aom_highbd_sad32x16_sse2, 10),
1460 make_tuple(16, 32, &aom_highbd_sad16x32_sse2, 10),
1461 make_tuple(16, 16, &aom_highbd_sad16x16_sse2, 10),
1462 make_tuple(16, 8, &aom_highbd_sad16x8_sse2, 10),
1463 make_tuple(8, 16, &aom_highbd_sad8x16_sse2, 10),
1464 make_tuple(8, 8, &aom_highbd_sad8x8_sse2, 10),
1465 make_tuple(8, 4, &aom_highbd_sad8x4_sse2, 10),
chiyotsaic6b9f6b2019-07-16 10:39:32 -07001466 make_tuple(4, 8, &aom_highbd_sad4x8_sse2, 10),
1467 make_tuple(4, 4, &aom_highbd_sad4x4_sse2, 10),
Yaowu Xuf883b422016-08-30 14:01:10 -07001468 make_tuple(64, 64, &aom_highbd_sad64x64_sse2, 12),
1469 make_tuple(64, 32, &aom_highbd_sad64x32_sse2, 12),
1470 make_tuple(32, 64, &aom_highbd_sad32x64_sse2, 12),
1471 make_tuple(32, 32, &aom_highbd_sad32x32_sse2, 12),
1472 make_tuple(32, 16, &aom_highbd_sad32x16_sse2, 12),
1473 make_tuple(16, 32, &aom_highbd_sad16x32_sse2, 12),
1474 make_tuple(16, 16, &aom_highbd_sad16x16_sse2, 12),
1475 make_tuple(16, 8, &aom_highbd_sad16x8_sse2, 12),
1476 make_tuple(8, 16, &aom_highbd_sad8x16_sse2, 12),
1477 make_tuple(8, 8, &aom_highbd_sad8x8_sse2, 12),
1478 make_tuple(8, 4, &aom_highbd_sad8x4_sse2, 12),
chiyotsaic6b9f6b2019-07-16 10:39:32 -07001479 make_tuple(4, 8, &aom_highbd_sad4x8_sse2, 12),
1480 make_tuple(4, 4, &aom_highbd_sad4x4_sse2, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001481
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001482 make_tuple(64, 16, &aom_highbd_sad64x16_sse2, 8),
1483 make_tuple(16, 64, &aom_highbd_sad16x64_sse2, 8),
1484 make_tuple(64, 16, &aom_highbd_sad64x16_sse2, 10),
1485 make_tuple(16, 64, &aom_highbd_sad16x64_sse2, 10),
1486 make_tuple(64, 16, &aom_highbd_sad64x16_sse2, 12),
1487 make_tuple(16, 64, &aom_highbd_sad16x64_sse2, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001488
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001489 make_tuple(32, 8, &aom_highbd_sad32x8_sse2, 8),
1490 make_tuple(8, 32, &aom_highbd_sad8x32_sse2, 8),
1491 make_tuple(32, 8, &aom_highbd_sad32x8_sse2, 10),
1492 make_tuple(8, 32, &aom_highbd_sad8x32_sse2, 10),
1493 make_tuple(32, 8, &aom_highbd_sad32x8_sse2, 12),
1494 make_tuple(8, 32, &aom_highbd_sad8x32_sse2, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001495
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001496 make_tuple(16, 4, &aom_highbd_sad16x4_sse2, 8),
chiyotsaic6b9f6b2019-07-16 10:39:32 -07001497 make_tuple(4, 16, &aom_highbd_sad4x16_sse2, 8),
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001498 make_tuple(16, 4, &aom_highbd_sad16x4_sse2, 10),
chiyotsaic6b9f6b2019-07-16 10:39:32 -07001499 make_tuple(4, 16, &aom_highbd_sad4x16_sse2, 10),
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001500 make_tuple(16, 4, &aom_highbd_sad16x4_sse2, 12),
chiyotsaic6b9f6b2019-07-16 10:39:32 -07001501 make_tuple(4, 16, &aom_highbd_sad4x16_sse2, 12),
Deb Mukherjeefc882922014-05-13 10:11:42 -07001502};
Cheng Chen96786fe2020-02-14 17:28:25 -08001503INSTANTIATE_TEST_SUITE_P(SSE2, SADTest, ::testing::ValuesIn(sse2_tests));
Deb Mukherjeefc882922014-05-13 10:11:42 -07001504
chiyotsaic814afb2020-08-04 13:12:35 -07001505const SadSkipMxNParam skip_sse2_tests[] = {
chiyotsaic814afb2020-08-04 13:12:35 -07001506 make_tuple(64, 64, &aom_highbd_sad_skip_64x64_sse2, 8),
1507 make_tuple(64, 32, &aom_highbd_sad_skip_64x32_sse2, 8),
1508 make_tuple(32, 64, &aom_highbd_sad_skip_32x64_sse2, 8),
1509 make_tuple(32, 32, &aom_highbd_sad_skip_32x32_sse2, 8),
1510 make_tuple(32, 16, &aom_highbd_sad_skip_32x16_sse2, 8),
1511 make_tuple(16, 32, &aom_highbd_sad_skip_16x32_sse2, 8),
1512 make_tuple(16, 16, &aom_highbd_sad_skip_16x16_sse2, 8),
1513 make_tuple(16, 8, &aom_highbd_sad_skip_16x8_sse2, 8),
1514 make_tuple(8, 16, &aom_highbd_sad_skip_8x16_sse2, 8),
1515 make_tuple(8, 8, &aom_highbd_sad_skip_8x8_sse2, 8),
1516 make_tuple(4, 8, &aom_highbd_sad_skip_4x8_sse2, 8),
1517 make_tuple(64, 16, &aom_highbd_sad_skip_64x16_sse2, 8),
1518 make_tuple(16, 64, &aom_highbd_sad_skip_16x64_sse2, 8),
1519 make_tuple(32, 8, &aom_highbd_sad_skip_32x8_sse2, 8),
1520 make_tuple(8, 32, &aom_highbd_sad_skip_8x32_sse2, 8),
1521 make_tuple(4, 16, &aom_highbd_sad_skip_4x16_sse2, 8),
1522
1523 make_tuple(64, 64, &aom_highbd_sad_skip_64x64_sse2, 10),
1524 make_tuple(64, 32, &aom_highbd_sad_skip_64x32_sse2, 10),
1525 make_tuple(32, 64, &aom_highbd_sad_skip_32x64_sse2, 10),
1526 make_tuple(32, 32, &aom_highbd_sad_skip_32x32_sse2, 10),
1527 make_tuple(32, 16, &aom_highbd_sad_skip_32x16_sse2, 10),
1528 make_tuple(16, 32, &aom_highbd_sad_skip_16x32_sse2, 10),
1529 make_tuple(16, 16, &aom_highbd_sad_skip_16x16_sse2, 10),
1530 make_tuple(16, 8, &aom_highbd_sad_skip_16x8_sse2, 10),
1531 make_tuple(8, 16, &aom_highbd_sad_skip_8x16_sse2, 10),
1532 make_tuple(8, 8, &aom_highbd_sad_skip_8x8_sse2, 10),
1533 make_tuple(4, 8, &aom_highbd_sad_skip_4x8_sse2, 10),
1534 make_tuple(64, 16, &aom_highbd_sad_skip_64x16_sse2, 10),
1535 make_tuple(16, 64, &aom_highbd_sad_skip_16x64_sse2, 10),
1536 make_tuple(32, 8, &aom_highbd_sad_skip_32x8_sse2, 10),
1537 make_tuple(8, 32, &aom_highbd_sad_skip_8x32_sse2, 10),
1538 make_tuple(4, 16, &aom_highbd_sad_skip_4x16_sse2, 10),
1539
1540 make_tuple(64, 64, &aom_highbd_sad_skip_64x64_sse2, 12),
1541 make_tuple(64, 32, &aom_highbd_sad_skip_64x32_sse2, 12),
1542 make_tuple(32, 64, &aom_highbd_sad_skip_32x64_sse2, 12),
1543 make_tuple(32, 32, &aom_highbd_sad_skip_32x32_sse2, 12),
1544 make_tuple(32, 16, &aom_highbd_sad_skip_32x16_sse2, 12),
1545 make_tuple(16, 32, &aom_highbd_sad_skip_16x32_sse2, 12),
1546 make_tuple(16, 16, &aom_highbd_sad_skip_16x16_sse2, 12),
1547 make_tuple(16, 8, &aom_highbd_sad_skip_16x8_sse2, 12),
1548 make_tuple(8, 16, &aom_highbd_sad_skip_8x16_sse2, 12),
1549 make_tuple(8, 8, &aom_highbd_sad_skip_8x8_sse2, 12),
1550 make_tuple(4, 8, &aom_highbd_sad_skip_4x8_sse2, 12),
1551 make_tuple(64, 16, &aom_highbd_sad_skip_64x16_sse2, 12),
1552 make_tuple(16, 64, &aom_highbd_sad_skip_16x64_sse2, 12),
1553 make_tuple(32, 8, &aom_highbd_sad_skip_32x8_sse2, 12),
1554 make_tuple(8, 32, &aom_highbd_sad_skip_8x32_sse2, 12),
1555 make_tuple(4, 16, &aom_highbd_sad_skip_4x16_sse2, 12),
chiyotsaic814afb2020-08-04 13:12:35 -07001556};
1557INSTANTIATE_TEST_SUITE_P(SSE2, SADSkipTest,
1558 ::testing::ValuesIn(skip_sse2_tests));
1559
Johannd5d92892015-04-17 16:11:38 -04001560const SadMxNAvgParam avg_sse2_tests[] = {
Yaowu Xuf883b422016-08-30 14:01:10 -07001561 make_tuple(64, 64, &aom_highbd_sad64x64_avg_sse2, 8),
1562 make_tuple(64, 32, &aom_highbd_sad64x32_avg_sse2, 8),
1563 make_tuple(32, 64, &aom_highbd_sad32x64_avg_sse2, 8),
1564 make_tuple(32, 32, &aom_highbd_sad32x32_avg_sse2, 8),
1565 make_tuple(32, 16, &aom_highbd_sad32x16_avg_sse2, 8),
1566 make_tuple(16, 32, &aom_highbd_sad16x32_avg_sse2, 8),
1567 make_tuple(16, 16, &aom_highbd_sad16x16_avg_sse2, 8),
1568 make_tuple(16, 8, &aom_highbd_sad16x8_avg_sse2, 8),
1569 make_tuple(8, 16, &aom_highbd_sad8x16_avg_sse2, 8),
1570 make_tuple(8, 8, &aom_highbd_sad8x8_avg_sse2, 8),
1571 make_tuple(8, 4, &aom_highbd_sad8x4_avg_sse2, 8),
chiyotsaic6b9f6b2019-07-16 10:39:32 -07001572 make_tuple(4, 8, &aom_highbd_sad4x8_avg_sse2, 8),
1573 make_tuple(4, 4, &aom_highbd_sad4x4_avg_sse2, 8),
Yaowu Xuf883b422016-08-30 14:01:10 -07001574 make_tuple(64, 64, &aom_highbd_sad64x64_avg_sse2, 10),
1575 make_tuple(64, 32, &aom_highbd_sad64x32_avg_sse2, 10),
1576 make_tuple(32, 64, &aom_highbd_sad32x64_avg_sse2, 10),
1577 make_tuple(32, 32, &aom_highbd_sad32x32_avg_sse2, 10),
1578 make_tuple(32, 16, &aom_highbd_sad32x16_avg_sse2, 10),
1579 make_tuple(16, 32, &aom_highbd_sad16x32_avg_sse2, 10),
1580 make_tuple(16, 16, &aom_highbd_sad16x16_avg_sse2, 10),
1581 make_tuple(16, 8, &aom_highbd_sad16x8_avg_sse2, 10),
1582 make_tuple(8, 16, &aom_highbd_sad8x16_avg_sse2, 10),
1583 make_tuple(8, 8, &aom_highbd_sad8x8_avg_sse2, 10),
1584 make_tuple(8, 4, &aom_highbd_sad8x4_avg_sse2, 10),
chiyotsaic6b9f6b2019-07-16 10:39:32 -07001585 make_tuple(4, 8, &aom_highbd_sad4x8_avg_sse2, 10),
1586 make_tuple(4, 4, &aom_highbd_sad4x4_avg_sse2, 10),
Yaowu Xuf883b422016-08-30 14:01:10 -07001587 make_tuple(64, 64, &aom_highbd_sad64x64_avg_sse2, 12),
1588 make_tuple(64, 32, &aom_highbd_sad64x32_avg_sse2, 12),
1589 make_tuple(32, 64, &aom_highbd_sad32x64_avg_sse2, 12),
1590 make_tuple(32, 32, &aom_highbd_sad32x32_avg_sse2, 12),
1591 make_tuple(32, 16, &aom_highbd_sad32x16_avg_sse2, 12),
1592 make_tuple(16, 32, &aom_highbd_sad16x32_avg_sse2, 12),
1593 make_tuple(16, 16, &aom_highbd_sad16x16_avg_sse2, 12),
1594 make_tuple(16, 8, &aom_highbd_sad16x8_avg_sse2, 12),
1595 make_tuple(8, 16, &aom_highbd_sad8x16_avg_sse2, 12),
1596 make_tuple(8, 8, &aom_highbd_sad8x8_avg_sse2, 12),
1597 make_tuple(8, 4, &aom_highbd_sad8x4_avg_sse2, 12),
chiyotsaic6b9f6b2019-07-16 10:39:32 -07001598 make_tuple(4, 8, &aom_highbd_sad4x8_avg_sse2, 12),
1599 make_tuple(4, 4, &aom_highbd_sad4x4_avg_sse2, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001600
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001601 make_tuple(64, 16, &aom_highbd_sad64x16_avg_sse2, 8),
1602 make_tuple(16, 64, &aom_highbd_sad16x64_avg_sse2, 8),
1603 make_tuple(64, 16, &aom_highbd_sad64x16_avg_sse2, 10),
1604 make_tuple(16, 64, &aom_highbd_sad16x64_avg_sse2, 10),
1605 make_tuple(64, 16, &aom_highbd_sad64x16_avg_sse2, 12),
1606 make_tuple(16, 64, &aom_highbd_sad16x64_avg_sse2, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001607
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001608 make_tuple(32, 8, &aom_highbd_sad32x8_avg_sse2, 8),
1609 make_tuple(8, 32, &aom_highbd_sad8x32_avg_sse2, 8),
1610 make_tuple(32, 8, &aom_highbd_sad32x8_avg_sse2, 10),
1611 make_tuple(8, 32, &aom_highbd_sad8x32_avg_sse2, 10),
1612 make_tuple(32, 8, &aom_highbd_sad32x8_avg_sse2, 12),
1613 make_tuple(8, 32, &aom_highbd_sad8x32_avg_sse2, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001614
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001615 make_tuple(16, 4, &aom_highbd_sad16x4_avg_sse2, 8),
chiyotsaic6b9f6b2019-07-16 10:39:32 -07001616 make_tuple(4, 16, &aom_highbd_sad4x16_avg_sse2, 8),
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001617 make_tuple(16, 4, &aom_highbd_sad16x4_avg_sse2, 10),
chiyotsaic6b9f6b2019-07-16 10:39:32 -07001618 make_tuple(4, 16, &aom_highbd_sad4x16_avg_sse2, 10),
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001619 make_tuple(16, 4, &aom_highbd_sad16x4_avg_sse2, 12),
chiyotsaic6b9f6b2019-07-16 10:39:32 -07001620 make_tuple(4, 16, &aom_highbd_sad4x16_avg_sse2, 12),
Johannd5d92892015-04-17 16:11:38 -04001621};
Cheng Chen96786fe2020-02-14 17:28:25 -08001622INSTANTIATE_TEST_SUITE_P(SSE2, SADavgTest, ::testing::ValuesIn(avg_sse2_tests));
Johannd5d92892015-04-17 16:11:38 -04001623
Johannd5d92892015-04-17 16:11:38 -04001624const SadMxNx4Param x4d_sse2_tests[] = {
Yaowu Xuf883b422016-08-30 14:01:10 -07001625 make_tuple(64, 64, &aom_highbd_sad64x64x4d_sse2, 8),
1626 make_tuple(64, 32, &aom_highbd_sad64x32x4d_sse2, 8),
1627 make_tuple(32, 64, &aom_highbd_sad32x64x4d_sse2, 8),
1628 make_tuple(32, 32, &aom_highbd_sad32x32x4d_sse2, 8),
1629 make_tuple(32, 16, &aom_highbd_sad32x16x4d_sse2, 8),
1630 make_tuple(16, 32, &aom_highbd_sad16x32x4d_sse2, 8),
1631 make_tuple(16, 16, &aom_highbd_sad16x16x4d_sse2, 8),
1632 make_tuple(16, 8, &aom_highbd_sad16x8x4d_sse2, 8),
1633 make_tuple(8, 16, &aom_highbd_sad8x16x4d_sse2, 8),
1634 make_tuple(8, 8, &aom_highbd_sad8x8x4d_sse2, 8),
1635 make_tuple(8, 4, &aom_highbd_sad8x4x4d_sse2, 8),
1636 make_tuple(4, 8, &aom_highbd_sad4x8x4d_sse2, 8),
1637 make_tuple(4, 4, &aom_highbd_sad4x4x4d_sse2, 8),
1638 make_tuple(64, 64, &aom_highbd_sad64x64x4d_sse2, 10),
1639 make_tuple(64, 32, &aom_highbd_sad64x32x4d_sse2, 10),
1640 make_tuple(32, 64, &aom_highbd_sad32x64x4d_sse2, 10),
1641 make_tuple(32, 32, &aom_highbd_sad32x32x4d_sse2, 10),
1642 make_tuple(32, 16, &aom_highbd_sad32x16x4d_sse2, 10),
1643 make_tuple(16, 32, &aom_highbd_sad16x32x4d_sse2, 10),
1644 make_tuple(16, 16, &aom_highbd_sad16x16x4d_sse2, 10),
1645 make_tuple(16, 8, &aom_highbd_sad16x8x4d_sse2, 10),
1646 make_tuple(8, 16, &aom_highbd_sad8x16x4d_sse2, 10),
1647 make_tuple(8, 8, &aom_highbd_sad8x8x4d_sse2, 10),
1648 make_tuple(8, 4, &aom_highbd_sad8x4x4d_sse2, 10),
1649 make_tuple(4, 8, &aom_highbd_sad4x8x4d_sse2, 10),
1650 make_tuple(4, 4, &aom_highbd_sad4x4x4d_sse2, 10),
1651 make_tuple(64, 64, &aom_highbd_sad64x64x4d_sse2, 12),
1652 make_tuple(64, 32, &aom_highbd_sad64x32x4d_sse2, 12),
1653 make_tuple(32, 64, &aom_highbd_sad32x64x4d_sse2, 12),
1654 make_tuple(32, 32, &aom_highbd_sad32x32x4d_sse2, 12),
1655 make_tuple(32, 16, &aom_highbd_sad32x16x4d_sse2, 12),
1656 make_tuple(16, 32, &aom_highbd_sad16x32x4d_sse2, 12),
1657 make_tuple(16, 16, &aom_highbd_sad16x16x4d_sse2, 12),
1658 make_tuple(16, 8, &aom_highbd_sad16x8x4d_sse2, 12),
1659 make_tuple(8, 16, &aom_highbd_sad8x16x4d_sse2, 12),
1660 make_tuple(8, 8, &aom_highbd_sad8x8x4d_sse2, 12),
1661 make_tuple(8, 4, &aom_highbd_sad8x4x4d_sse2, 12),
1662 make_tuple(4, 8, &aom_highbd_sad4x8x4d_sse2, 12),
1663 make_tuple(4, 4, &aom_highbd_sad4x4x4d_sse2, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001664
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001665 make_tuple(64, 16, &aom_highbd_sad64x16x4d_sse2, 8),
1666 make_tuple(16, 64, &aom_highbd_sad16x64x4d_sse2, 8),
1667 make_tuple(64, 16, &aom_highbd_sad64x16x4d_sse2, 10),
1668 make_tuple(16, 64, &aom_highbd_sad16x64x4d_sse2, 10),
1669 make_tuple(64, 16, &aom_highbd_sad64x16x4d_sse2, 12),
1670 make_tuple(16, 64, &aom_highbd_sad16x64x4d_sse2, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001671
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001672 make_tuple(32, 8, &aom_highbd_sad32x8x4d_sse2, 8),
1673 make_tuple(8, 32, &aom_highbd_sad8x32x4d_sse2, 8),
1674 make_tuple(32, 8, &aom_highbd_sad32x8x4d_sse2, 10),
1675 make_tuple(8, 32, &aom_highbd_sad8x32x4d_sse2, 10),
1676 make_tuple(32, 8, &aom_highbd_sad32x8x4d_sse2, 12),
1677 make_tuple(8, 32, &aom_highbd_sad8x32x4d_sse2, 12),
Ryan Lei2a676372020-09-28 16:58:52 -07001678
Debargha Mukherjee5b5cbbd2019-07-15 15:43:57 -07001679 make_tuple(16, 4, &aom_highbd_sad16x4x4d_sse2, 8),
1680 make_tuple(4, 16, &aom_highbd_sad4x16x4d_sse2, 8),
1681 make_tuple(16, 4, &aom_highbd_sad16x4x4d_sse2, 10),
1682 make_tuple(4, 16, &aom_highbd_sad4x16x4d_sse2, 10),
1683 make_tuple(16, 4, &aom_highbd_sad16x4x4d_sse2, 12),
1684 make_tuple(4, 16, &aom_highbd_sad4x16x4d_sse2, 12),
Johannd5d92892015-04-17 16:11:38 -04001685};
Cheng Chen96786fe2020-02-14 17:28:25 -08001686INSTANTIATE_TEST_SUITE_P(SSE2, SADx4Test, ::testing::ValuesIn(x4d_sse2_tests));
Ruiling Song8dc32d72020-01-20 15:33:37 +08001687
chiyotsaic814afb2020-08-04 13:12:35 -07001688const SadSkipMxNx4Param skip_x4d_sse2_tests[] = {
chiyotsaic814afb2020-08-04 13:12:35 -07001689 make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_sse2, 8),
1690 make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_sse2, 8),
1691 make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_sse2, 8),
1692 make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_sse2, 8),
1693 make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_sse2, 8),
1694 make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_sse2, 8),
1695 make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_sse2, 8),
1696 make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_sse2, 8),
1697 make_tuple(8, 16, &aom_highbd_sad_skip_8x16x4d_sse2, 8),
1698 make_tuple(8, 8, &aom_highbd_sad_skip_8x8x4d_sse2, 8),
1699 make_tuple(4, 8, &aom_highbd_sad_skip_4x8x4d_sse2, 8),
1700 make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_sse2, 8),
1701 make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_sse2, 8),
1702 make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_sse2, 8),
1703 make_tuple(8, 32, &aom_highbd_sad_skip_8x32x4d_sse2, 8),
1704 make_tuple(4, 16, &aom_highbd_sad_skip_4x16x4d_sse2, 8),
1705
1706 make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_sse2, 10),
1707 make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_sse2, 10),
1708 make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_sse2, 10),
1709 make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_sse2, 10),
1710 make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_sse2, 10),
1711 make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_sse2, 10),
1712 make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_sse2, 10),
1713 make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_sse2, 10),
1714 make_tuple(8, 16, &aom_highbd_sad_skip_8x16x4d_sse2, 10),
1715 make_tuple(8, 8, &aom_highbd_sad_skip_8x8x4d_sse2, 10),
1716 make_tuple(4, 8, &aom_highbd_sad_skip_4x8x4d_sse2, 10),
1717 make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_sse2, 10),
1718 make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_sse2, 10),
1719 make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_sse2, 10),
1720 make_tuple(8, 32, &aom_highbd_sad_skip_8x32x4d_sse2, 10),
1721 make_tuple(4, 16, &aom_highbd_sad_skip_4x16x4d_sse2, 10),
1722
1723 make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_sse2, 12),
1724 make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_sse2, 12),
1725 make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_sse2, 12),
1726 make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_sse2, 12),
1727 make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_sse2, 12),
1728 make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_sse2, 12),
1729 make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_sse2, 12),
1730 make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_sse2, 12),
1731 make_tuple(8, 16, &aom_highbd_sad_skip_8x16x4d_sse2, 12),
1732 make_tuple(8, 8, &aom_highbd_sad_skip_8x8x4d_sse2, 12),
1733 make_tuple(4, 8, &aom_highbd_sad_skip_4x8x4d_sse2, 12),
1734 make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_sse2, 12),
1735 make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_sse2, 12),
1736 make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_sse2, 12),
1737 make_tuple(8, 32, &aom_highbd_sad_skip_8x32x4d_sse2, 12),
1738 make_tuple(4, 16, &aom_highbd_sad_skip_4x16x4d_sse2, 12),
chiyotsaic814afb2020-08-04 13:12:35 -07001739};
1740INSTANTIATE_TEST_SUITE_P(SSE2, SADSkipx4Test,
1741 ::testing::ValuesIn(skip_x4d_sse2_tests));
Urvang Joshib8b8dad2018-05-08 19:23:30 -04001742#endif // HAVE_SSE2
Cheng Chena0367dc2017-11-16 19:20:42 -08001743
Johannd5d92892015-04-17 16:11:38 -04001744#if HAVE_AVX2
Johannd5d92892015-04-17 16:11:38 -04001745const SadMxNParam avx2_tests[] = {
Yi Luoe9832582016-11-29 19:38:12 -08001746 make_tuple(128, 128, &aom_highbd_sad128x128_avx2, 8),
1747 make_tuple(128, 128, &aom_highbd_sad128x128_avx2, 10),
1748 make_tuple(128, 128, &aom_highbd_sad128x128_avx2, 12),
1749 make_tuple(128, 64, &aom_highbd_sad128x64_avx2, 8),
1750 make_tuple(128, 64, &aom_highbd_sad128x64_avx2, 10),
1751 make_tuple(128, 64, &aom_highbd_sad128x64_avx2, 12),
1752 make_tuple(64, 128, &aom_highbd_sad64x128_avx2, 8),
1753 make_tuple(64, 128, &aom_highbd_sad64x128_avx2, 10),
1754 make_tuple(64, 128, &aom_highbd_sad64x128_avx2, 12),
Yi Luoe9832582016-11-29 19:38:12 -08001755 make_tuple(64, 64, &aom_highbd_sad64x64_avx2, 8),
1756 make_tuple(64, 64, &aom_highbd_sad64x64_avx2, 10),
1757 make_tuple(64, 64, &aom_highbd_sad64x64_avx2, 12),
1758 make_tuple(64, 32, &aom_highbd_sad64x32_avx2, 8),
1759 make_tuple(64, 32, &aom_highbd_sad64x32_avx2, 10),
1760 make_tuple(64, 32, &aom_highbd_sad64x32_avx2, 12),
1761 make_tuple(32, 64, &aom_highbd_sad32x64_avx2, 8),
1762 make_tuple(32, 64, &aom_highbd_sad32x64_avx2, 10),
1763 make_tuple(32, 64, &aom_highbd_sad32x64_avx2, 12),
1764 make_tuple(32, 32, &aom_highbd_sad32x32_avx2, 8),
1765 make_tuple(32, 32, &aom_highbd_sad32x32_avx2, 10),
1766 make_tuple(32, 32, &aom_highbd_sad32x32_avx2, 12),
1767 make_tuple(32, 16, &aom_highbd_sad32x16_avx2, 8),
1768 make_tuple(32, 16, &aom_highbd_sad32x16_avx2, 10),
1769 make_tuple(32, 16, &aom_highbd_sad32x16_avx2, 12),
1770 make_tuple(16, 32, &aom_highbd_sad16x32_avx2, 8),
1771 make_tuple(16, 32, &aom_highbd_sad16x32_avx2, 10),
1772 make_tuple(16, 32, &aom_highbd_sad16x32_avx2, 12),
1773 make_tuple(16, 16, &aom_highbd_sad16x16_avx2, 8),
1774 make_tuple(16, 16, &aom_highbd_sad16x16_avx2, 10),
1775 make_tuple(16, 16, &aom_highbd_sad16x16_avx2, 12),
1776 make_tuple(16, 8, &aom_highbd_sad16x8_avx2, 8),
1777 make_tuple(16, 8, &aom_highbd_sad16x8_avx2, 10),
1778 make_tuple(16, 8, &aom_highbd_sad16x8_avx2, 12),
Debargha Mukherjee42451f72019-07-16 00:45:13 -07001779
1780 make_tuple(64, 16, &aom_highbd_sad64x16_avx2, 8),
1781 make_tuple(64, 16, &aom_highbd_sad64x16_avx2, 10),
1782 make_tuple(64, 16, &aom_highbd_sad64x16_avx2, 12),
1783 make_tuple(16, 64, &aom_highbd_sad16x64_avx2, 8),
1784 make_tuple(16, 64, &aom_highbd_sad16x64_avx2, 10),
1785 make_tuple(16, 64, &aom_highbd_sad16x64_avx2, 12),
1786 make_tuple(32, 8, &aom_highbd_sad32x8_avx2, 8),
1787 make_tuple(32, 8, &aom_highbd_sad32x8_avx2, 10),
1788 make_tuple(32, 8, &aom_highbd_sad32x8_avx2, 12),
1789 make_tuple(16, 4, &aom_highbd_sad16x4_avx2, 8),
1790 make_tuple(16, 4, &aom_highbd_sad16x4_avx2, 10),
1791 make_tuple(16, 4, &aom_highbd_sad16x4_avx2, 12),
Johannd5d92892015-04-17 16:11:38 -04001792};
Cheng Chen96786fe2020-02-14 17:28:25 -08001793INSTANTIATE_TEST_SUITE_P(AVX2, SADTest, ::testing::ValuesIn(avx2_tests));
Johannd5d92892015-04-17 16:11:38 -04001794
chiyotsaic814afb2020-08-04 13:12:35 -07001795const SadSkipMxNParam skip_avx2_tests[] = {
Ryan Lei2a676372020-09-28 16:58:52 -07001796
chiyotsaic814afb2020-08-04 13:12:35 -07001797 make_tuple(128, 128, &aom_highbd_sad_skip_128x128_avx2, 8),
1798 make_tuple(128, 64, &aom_highbd_sad_skip_128x64_avx2, 8),
1799 make_tuple(64, 128, &aom_highbd_sad_skip_64x128_avx2, 8),
1800 make_tuple(64, 64, &aom_highbd_sad_skip_64x64_avx2, 8),
1801 make_tuple(64, 32, &aom_highbd_sad_skip_64x32_avx2, 8),
1802 make_tuple(32, 64, &aom_highbd_sad_skip_32x64_avx2, 8),
1803 make_tuple(32, 32, &aom_highbd_sad_skip_32x32_avx2, 8),
1804 make_tuple(32, 16, &aom_highbd_sad_skip_32x16_avx2, 8),
1805 make_tuple(16, 64, &aom_highbd_sad_skip_16x64_avx2, 8),
1806 make_tuple(16, 32, &aom_highbd_sad_skip_16x32_avx2, 8),
1807 make_tuple(16, 16, &aom_highbd_sad_skip_16x16_avx2, 8),
1808 make_tuple(16, 8, &aom_highbd_sad_skip_16x8_avx2, 8),
1809
1810 make_tuple(128, 128, &aom_highbd_sad_skip_128x128_avx2, 10),
1811 make_tuple(128, 64, &aom_highbd_sad_skip_128x64_avx2, 10),
1812 make_tuple(64, 128, &aom_highbd_sad_skip_64x128_avx2, 10),
1813 make_tuple(64, 64, &aom_highbd_sad_skip_64x64_avx2, 10),
1814 make_tuple(64, 32, &aom_highbd_sad_skip_64x32_avx2, 10),
1815 make_tuple(32, 64, &aom_highbd_sad_skip_32x64_avx2, 10),
1816 make_tuple(32, 32, &aom_highbd_sad_skip_32x32_avx2, 10),
1817 make_tuple(32, 16, &aom_highbd_sad_skip_32x16_avx2, 10),
1818 make_tuple(16, 64, &aom_highbd_sad_skip_16x64_avx2, 10),
1819 make_tuple(16, 32, &aom_highbd_sad_skip_16x32_avx2, 10),
1820 make_tuple(16, 16, &aom_highbd_sad_skip_16x16_avx2, 10),
1821 make_tuple(16, 8, &aom_highbd_sad_skip_16x8_avx2, 10),
1822
1823 make_tuple(128, 128, &aom_highbd_sad_skip_128x128_avx2, 12),
1824 make_tuple(128, 64, &aom_highbd_sad_skip_128x64_avx2, 12),
1825 make_tuple(64, 128, &aom_highbd_sad_skip_64x128_avx2, 12),
1826 make_tuple(64, 64, &aom_highbd_sad_skip_64x64_avx2, 12),
1827 make_tuple(64, 32, &aom_highbd_sad_skip_64x32_avx2, 12),
1828 make_tuple(32, 64, &aom_highbd_sad_skip_32x64_avx2, 12),
1829 make_tuple(32, 32, &aom_highbd_sad_skip_32x32_avx2, 12),
1830 make_tuple(32, 16, &aom_highbd_sad_skip_32x16_avx2, 12),
1831 make_tuple(16, 64, &aom_highbd_sad_skip_16x64_avx2, 12),
1832 make_tuple(16, 32, &aom_highbd_sad_skip_16x32_avx2, 12),
1833 make_tuple(16, 16, &aom_highbd_sad_skip_16x16_avx2, 12),
1834 make_tuple(16, 8, &aom_highbd_sad_skip_16x8_avx2, 12),
chiyotsaic814afb2020-08-04 13:12:35 -07001835};
1836INSTANTIATE_TEST_SUITE_P(AVX2, SADSkipTest,
1837 ::testing::ValuesIn(skip_avx2_tests));
1838
Johannd5d92892015-04-17 16:11:38 -04001839const SadMxNAvgParam avg_avx2_tests[] = {
Yi Luoe9832582016-11-29 19:38:12 -08001840 make_tuple(128, 128, &aom_highbd_sad128x128_avg_avx2, 8),
1841 make_tuple(128, 128, &aom_highbd_sad128x128_avg_avx2, 10),
1842 make_tuple(128, 128, &aom_highbd_sad128x128_avg_avx2, 12),
1843 make_tuple(128, 64, &aom_highbd_sad128x64_avg_avx2, 8),
1844 make_tuple(128, 64, &aom_highbd_sad128x64_avg_avx2, 10),
1845 make_tuple(128, 64, &aom_highbd_sad128x64_avg_avx2, 12),
1846 make_tuple(64, 128, &aom_highbd_sad64x128_avg_avx2, 8),
1847 make_tuple(64, 128, &aom_highbd_sad64x128_avg_avx2, 10),
1848 make_tuple(64, 128, &aom_highbd_sad64x128_avg_avx2, 12),
Yi Luoe9832582016-11-29 19:38:12 -08001849 make_tuple(64, 64, &aom_highbd_sad64x64_avg_avx2, 8),
1850 make_tuple(64, 64, &aom_highbd_sad64x64_avg_avx2, 10),
1851 make_tuple(64, 64, &aom_highbd_sad64x64_avg_avx2, 12),
1852 make_tuple(64, 32, &aom_highbd_sad64x32_avg_avx2, 8),
1853 make_tuple(64, 32, &aom_highbd_sad64x32_avg_avx2, 10),
1854 make_tuple(64, 32, &aom_highbd_sad64x32_avg_avx2, 12),
1855 make_tuple(32, 64, &aom_highbd_sad32x64_avg_avx2, 8),
1856 make_tuple(32, 64, &aom_highbd_sad32x64_avg_avx2, 10),
1857 make_tuple(32, 64, &aom_highbd_sad32x64_avg_avx2, 12),
1858 make_tuple(32, 32, &aom_highbd_sad32x32_avg_avx2, 8),
1859 make_tuple(32, 32, &aom_highbd_sad32x32_avg_avx2, 10),
1860 make_tuple(32, 32, &aom_highbd_sad32x32_avg_avx2, 12),
1861 make_tuple(32, 16, &aom_highbd_sad32x16_avg_avx2, 8),
1862 make_tuple(32, 16, &aom_highbd_sad32x16_avg_avx2, 10),
1863 make_tuple(32, 16, &aom_highbd_sad32x16_avg_avx2, 12),
1864 make_tuple(16, 32, &aom_highbd_sad16x32_avg_avx2, 8),
1865 make_tuple(16, 32, &aom_highbd_sad16x32_avg_avx2, 10),
1866 make_tuple(16, 32, &aom_highbd_sad16x32_avg_avx2, 12),
1867 make_tuple(16, 16, &aom_highbd_sad16x16_avg_avx2, 8),
1868 make_tuple(16, 16, &aom_highbd_sad16x16_avg_avx2, 10),
1869 make_tuple(16, 16, &aom_highbd_sad16x16_avg_avx2, 12),
1870 make_tuple(16, 8, &aom_highbd_sad16x8_avg_avx2, 8),
1871 make_tuple(16, 8, &aom_highbd_sad16x8_avg_avx2, 10),
1872 make_tuple(16, 8, &aom_highbd_sad16x8_avg_avx2, 12),
Debargha Mukherjee42451f72019-07-16 00:45:13 -07001873
1874 make_tuple(64, 16, &aom_highbd_sad64x16_avg_avx2, 8),
1875 make_tuple(64, 16, &aom_highbd_sad64x16_avg_avx2, 10),
1876 make_tuple(64, 16, &aom_highbd_sad64x16_avg_avx2, 12),
1877 make_tuple(16, 64, &aom_highbd_sad16x64_avg_avx2, 8),
1878 make_tuple(16, 64, &aom_highbd_sad16x64_avg_avx2, 10),
1879 make_tuple(16, 64, &aom_highbd_sad16x64_avg_avx2, 12),
1880 make_tuple(32, 8, &aom_highbd_sad32x8_avg_avx2, 8),
1881 make_tuple(32, 8, &aom_highbd_sad32x8_avg_avx2, 10),
1882 make_tuple(32, 8, &aom_highbd_sad32x8_avg_avx2, 12),
1883 make_tuple(16, 4, &aom_highbd_sad16x4_avg_avx2, 8),
1884 make_tuple(16, 4, &aom_highbd_sad16x4_avg_avx2, 10),
1885 make_tuple(16, 4, &aom_highbd_sad16x4_avg_avx2, 12),
Johannd5d92892015-04-17 16:11:38 -04001886};
Cheng Chen96786fe2020-02-14 17:28:25 -08001887INSTANTIATE_TEST_SUITE_P(AVX2, SADavgTest, ::testing::ValuesIn(avg_avx2_tests));
Johannd5d92892015-04-17 16:11:38 -04001888
chiyotsaic814afb2020-08-04 13:12:35 -07001889const SadSkipMxNx4Param skip_x4d_avx2_tests[] = {
chiyotsaic814afb2020-08-04 13:12:35 -07001890 make_tuple(128, 128, &aom_highbd_sad_skip_128x128x4d_avx2, 8),
1891 make_tuple(128, 64, &aom_highbd_sad_skip_128x64x4d_avx2, 8),
1892 make_tuple(64, 128, &aom_highbd_sad_skip_64x128x4d_avx2, 8),
1893 make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_avx2, 8),
1894 make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_avx2, 8),
1895 make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_avx2, 8),
1896 make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_avx2, 8),
1897 make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_avx2, 8),
1898 make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_avx2, 8),
1899 make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_avx2, 8),
1900 make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_avx2, 8),
1901 make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_avx2, 8),
1902 make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_avx2, 8),
1903 make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_avx2, 8),
1904
1905 make_tuple(128, 128, &aom_highbd_sad_skip_128x128x4d_avx2, 10),
1906 make_tuple(128, 64, &aom_highbd_sad_skip_128x64x4d_avx2, 10),
1907 make_tuple(64, 128, &aom_highbd_sad_skip_64x128x4d_avx2, 10),
1908 make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_avx2, 10),
1909 make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_avx2, 10),
1910 make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_avx2, 10),
1911 make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_avx2, 10),
1912 make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_avx2, 10),
1913 make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_avx2, 10),
1914 make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_avx2, 10),
1915 make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_avx2, 10),
1916 make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_avx2, 10),
1917 make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_avx2, 10),
1918 make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_avx2, 10),
1919
1920 make_tuple(128, 128, &aom_highbd_sad_skip_128x128x4d_avx2, 12),
1921 make_tuple(128, 64, &aom_highbd_sad_skip_128x64x4d_avx2, 12),
1922 make_tuple(64, 128, &aom_highbd_sad_skip_64x128x4d_avx2, 12),
1923 make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_avx2, 12),
1924 make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_avx2, 12),
1925 make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_avx2, 12),
1926 make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_avx2, 12),
1927 make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_avx2, 12),
1928 make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_avx2, 12),
1929 make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_avx2, 12),
1930 make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_avx2, 12),
1931 make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_avx2, 12),
1932 make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_avx2, 12),
1933 make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_avx2, 12),
chiyotsaic814afb2020-08-04 13:12:35 -07001934};
1935INSTANTIATE_TEST_SUITE_P(AVX2, SADSkipx4Test,
1936 ::testing::ValuesIn(skip_x4d_avx2_tests));
1937
Johannd5d92892015-04-17 16:11:38 -04001938const SadMxNx4Param x4d_avx2_tests[] = {
Yi Luoe9832582016-11-29 19:38:12 -08001939 make_tuple(128, 128, &aom_highbd_sad128x128x4d_avx2, 8),
1940 make_tuple(128, 128, &aom_highbd_sad128x128x4d_avx2, 10),
1941 make_tuple(128, 128, &aom_highbd_sad128x128x4d_avx2, 12),
1942 make_tuple(128, 64, &aom_highbd_sad128x64x4d_avx2, 8),
1943 make_tuple(128, 64, &aom_highbd_sad128x64x4d_avx2, 10),
1944 make_tuple(128, 64, &aom_highbd_sad128x64x4d_avx2, 12),
1945 make_tuple(64, 128, &aom_highbd_sad64x128x4d_avx2, 8),
1946 make_tuple(64, 128, &aom_highbd_sad64x128x4d_avx2, 10),
1947 make_tuple(64, 128, &aom_highbd_sad64x128x4d_avx2, 12),
Yi Luoe9832582016-11-29 19:38:12 -08001948 make_tuple(64, 64, &aom_highbd_sad64x64x4d_avx2, 8),
1949 make_tuple(64, 64, &aom_highbd_sad64x64x4d_avx2, 10),
1950 make_tuple(64, 64, &aom_highbd_sad64x64x4d_avx2, 12),
1951 make_tuple(64, 32, &aom_highbd_sad64x32x4d_avx2, 8),
1952 make_tuple(64, 32, &aom_highbd_sad64x32x4d_avx2, 10),
1953 make_tuple(64, 32, &aom_highbd_sad64x32x4d_avx2, 12),
1954 make_tuple(32, 64, &aom_highbd_sad32x64x4d_avx2, 8),
1955 make_tuple(32, 64, &aom_highbd_sad32x64x4d_avx2, 10),
1956 make_tuple(32, 64, &aom_highbd_sad32x64x4d_avx2, 12),
1957 make_tuple(32, 32, &aom_highbd_sad32x32x4d_avx2, 8),
1958 make_tuple(32, 32, &aom_highbd_sad32x32x4d_avx2, 10),
1959 make_tuple(32, 32, &aom_highbd_sad32x32x4d_avx2, 12),
1960 make_tuple(32, 16, &aom_highbd_sad32x16x4d_avx2, 8),
1961 make_tuple(32, 16, &aom_highbd_sad32x16x4d_avx2, 10),
1962 make_tuple(32, 16, &aom_highbd_sad32x16x4d_avx2, 12),
1963 make_tuple(16, 32, &aom_highbd_sad16x32x4d_avx2, 8),
1964 make_tuple(16, 32, &aom_highbd_sad16x32x4d_avx2, 10),
1965 make_tuple(16, 32, &aom_highbd_sad16x32x4d_avx2, 12),
1966 make_tuple(16, 16, &aom_highbd_sad16x16x4d_avx2, 8),
1967 make_tuple(16, 16, &aom_highbd_sad16x16x4d_avx2, 10),
1968 make_tuple(16, 16, &aom_highbd_sad16x16x4d_avx2, 12),
1969 make_tuple(16, 8, &aom_highbd_sad16x8x4d_avx2, 8),
1970 make_tuple(16, 8, &aom_highbd_sad16x8x4d_avx2, 10),
1971 make_tuple(16, 8, &aom_highbd_sad16x8x4d_avx2, 12),
Debargha Mukherjee42451f72019-07-16 00:45:13 -07001972
1973 make_tuple(16, 64, &aom_highbd_sad16x64x4d_avx2, 8),
1974 make_tuple(16, 64, &aom_highbd_sad16x64x4d_avx2, 10),
1975 make_tuple(16, 64, &aom_highbd_sad16x64x4d_avx2, 12),
1976 make_tuple(64, 16, &aom_highbd_sad64x16x4d_avx2, 8),
1977 make_tuple(64, 16, &aom_highbd_sad64x16x4d_avx2, 10),
1978 make_tuple(64, 16, &aom_highbd_sad64x16x4d_avx2, 12),
1979 make_tuple(32, 8, &aom_highbd_sad32x8x4d_avx2, 8),
1980 make_tuple(32, 8, &aom_highbd_sad32x8x4d_avx2, 10),
1981 make_tuple(32, 8, &aom_highbd_sad32x8x4d_avx2, 12),
1982 make_tuple(16, 4, &aom_highbd_sad16x4x4d_avx2, 8),
1983 make_tuple(16, 4, &aom_highbd_sad16x4x4d_avx2, 10),
1984 make_tuple(16, 4, &aom_highbd_sad16x4x4d_avx2, 12),
Johannd5d92892015-04-17 16:11:38 -04001985};
Cheng Chen96786fe2020-02-14 17:28:25 -08001986INSTANTIATE_TEST_SUITE_P(AVX2, SADx4Test, ::testing::ValuesIn(x4d_avx2_tests));
Johannd5d92892015-04-17 16:11:38 -04001987#endif // HAVE_AVX2
Frank Galligan54fa9562015-01-24 12:11:16 -08001988
Johannfbea8972012-06-28 11:43:58 -07001989} // namespace