blob: a7067006f3fda04497066c587924b1a7063055d2 [file] [log] [blame]
James Zern98473442012-11-06 16:58:11 -08001/*
Krishna Rapaka7319db52021-09-28 20:35:29 -07002 * Copyright (c) 2021, Alliance for Open Media. All rights reserved
James Zern98473442012-11-06 16:58:11 -08003 *
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 */
Peter de Rivaz48032bf2014-10-16 14:00:54 +010012
13#include <cstdlib>
James Zern98473442012-11-06 16:58:11 -080014#include <new>
Wan-Teh Changf8c35de2020-01-16 14:28:34 -080015#include <ostream>
sarahparkera543df52018-11-02 16:02:05 -070016#include <tuple>
James Zern98473442012-11-06 16:58:11 -080017
Tom Finegan7a07ece2017-02-07 17:14:05 -080018#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
James Zern5b756742013-06-17 22:58:40 -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
Jingning Han097d59c2015-07-29 14:51:36 -070023#include "test/acm_random.h"
24#include "test/clear_system_state.h"
25#include "test/register_state_check.h"
Yaowu Xuf883b422016-08-30 14:01:10 -070026#include "aom/aom_codec.h"
27#include "aom/aom_integer.h"
28#include "aom_mem/aom_mem.h"
Kyle Siefring6042d902018-06-12 00:33:17 -040029#include "aom_ports/aom_timer.h"
Yaowu Xuc27fc142016-08-22 16:08:15 -070030#include "aom_ports/mem.h"
James Zern98473442012-11-06 16:58:11 -080031
32namespace {
33
James Almer756717c2022-10-19 17:32:48 +000034typedef uint64_t (*MseWxH16bitFunc)(uint16_t *dst, int dstride, uint16_t *src,
Satish Kumar Suman5aa160f2020-05-07 13:56:00 +053035 int sstride, int w, int h);
James Almer756717c2022-10-19 17:32:48 +000036typedef unsigned int (*VarianceMxNFunc)(const uint16_t *a, int a_stride,
37 const uint16_t *b, int b_stride,
Johannc3bdffb2015-05-15 11:52:03 -070038 unsigned int *sse);
James Almer756717c2022-10-19 17:32:48 +000039typedef unsigned int (*SubpixVarMxNFunc)(const uint16_t *a, int a_stride,
Johanneb88b172015-05-26 11:30:25 -070040 int xoffset, int yoffset,
James Almer756717c2022-10-19 17:32:48 +000041 const uint16_t *b, int b_stride,
Johanneb88b172015-05-26 11:30:25 -070042 unsigned int *sse);
James Almer756717c2022-10-19 17:32:48 +000043typedef unsigned int (*SubpixAvgVarMxNFunc)(const uint16_t *a, int a_stride,
Johann6a82f0d2015-06-05 09:54:19 -070044 int xoffset, int yoffset,
James Almer756717c2022-10-19 17:32:48 +000045 const uint16_t *b, int b_stride,
Johann6a82f0d2015-06-05 09:54:19 -070046 uint32_t *sse,
James Almer756717c2022-10-19 17:32:48 +000047 const uint16_t *second_pred);
48typedef unsigned int (*Get4x4SseFunc)(const uint16_t *a, int a_stride,
49 const uint16_t *b, int b_stride);
Johann6a82f0d2015-06-05 09:54:19 -070050typedef unsigned int (*SumOfSquaresFunction)(const int16_t *src);
Debargha Mukherjeef90004a2018-12-20 13:35:06 -080051typedef unsigned int (*DistWtdSubpixAvgVarMxNFunc)(
James Almer756717c2022-10-19 17:32:48 +000052 const uint16_t *a, int a_stride, int xoffset, int yoffset,
53 const uint16_t *b, int b_stride, uint32_t *sse, const uint16_t *second_pred,
Debargha Mukherjeef90004a2018-12-20 13:35:06 -080054 const DIST_WTD_COMP_PARAMS *jcp_param);
James Almer756717c2022-10-19 17:32:48 +000055typedef uint32_t (*ObmcSubpelVarFunc)(const uint16_t *pre, int pre_stride,
Kyle Siefring6042d902018-06-12 00:33:17 -040056 int xoffset, int yoffset,
57 const int32_t *wsrc, const int32_t *mask,
58 unsigned int *sse);
Johann6a82f0d2015-06-05 09:54:19 -070059
Yaowu Xuc27fc142016-08-22 16:08:15 -070060using libaom_test::ACMRandom;
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -070061
Johannc855ed72015-05-27 14:37:31 -070062// Truncate high bit depth results by downshifting (with rounding) by:
63// 2 * (bit_depth - 8) for sse
64// (bit_depth - 8) for se
65static void RoundHighBitDepth(int bit_depth, int64_t *se, uint64_t *sse) {
66 switch (bit_depth) {
Yaowu Xuf883b422016-08-30 14:01:10 -070067 case AOM_BITS_12:
Johannc855ed72015-05-27 14:37:31 -070068 *sse = (*sse + 128) >> 8;
69 *se = (*se + 8) >> 4;
70 break;
Yaowu Xuf883b422016-08-30 14:01:10 -070071 case AOM_BITS_10:
Johannc855ed72015-05-27 14:37:31 -070072 *sse = (*sse + 8) >> 4;
73 *se = (*se + 2) >> 2;
74 break;
Yaowu Xuf883b422016-08-30 14:01:10 -070075 case AOM_BITS_8:
skal8dbbcda2016-07-13 17:33:22 -070076 default: break;
Johannc855ed72015-05-27 14:37:31 -070077 }
78}
79
Dmitry Kovalev1f19ebb2014-09-06 00:10:25 -070080static unsigned int mb_ss_ref(const int16_t *src) {
81 unsigned int res = 0;
82 for (int i = 0; i < 256; ++i) {
83 res += src[i] * src[i];
84 }
85 return res;
86}
87
Yi Luoc3e07b22016-04-04 09:44:56 -070088/* Note:
89 * Our codebase calculates the "diff" value in the variance algorithm by
90 * (src - ref).
91 */
James Almer756717c2022-10-19 17:32:48 +000092static uint32_t variance_ref(const uint16_t *src, const uint16_t *ref, int l2w,
skal8dbbcda2016-07-13 17:33:22 -070093 int l2h, int src_stride, int ref_stride,
James Almer756717c2022-10-19 17:32:48 +000094 uint32_t *sse_ptr, aom_bit_depth_t bit_depth) {
Peter de Rivaz48032bf2014-10-16 14:00:54 +010095 int64_t se = 0;
96 uint64_t sse = 0;
97 const int w = 1 << l2w;
98 const int h = 1 << l2h;
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -070099 for (int y = 0; y < h; y++) {
100 for (int x = 0; x < w; x++) {
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100101 int diff;
James Almer756717c2022-10-19 17:32:48 +0000102 diff = src[y * src_stride + x] - ref[y * ref_stride + x];
103 se += diff;
104 sse += diff * diff;
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100105 }
106 }
Johannc855ed72015-05-27 14:37:31 -0700107 RoundHighBitDepth(bit_depth, &se, &sse);
Johannd90536c2015-06-01 13:03:30 -0700108 *sse_ptr = static_cast<uint32_t>(sse);
Urvang Joshi77853e52016-07-15 12:47:01 -0700109 return static_cast<uint32_t>(sse - ((se * se) >> (l2w + l2h)));
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700110}
111
Johanneb88b172015-05-26 11:30:25 -0700112/* The subpel reference functions differ from the codec version in one aspect:
113 * they calculate the bilinear factors directly instead of using a lookup table
114 * and therefore upshift xoff and yoff by 1. Only every other calculated value
Yunqing Wang787f7f72020-02-25 15:39:17 -0800115 * is used so the codec version shrinks the table to save space.
Johanneb88b172015-05-26 11:30:25 -0700116 */
James Almer756717c2022-10-19 17:32:48 +0000117static uint32_t subpel_variance_ref(const uint16_t *ref, const uint16_t *src,
Johannd90536c2015-06-01 13:03:30 -0700118 int l2w, int l2h, int xoff, int yoff,
James Almer756717c2022-10-19 17:32:48 +0000119 uint32_t *sse_ptr,
Yaowu Xuf883b422016-08-30 14:01:10 -0700120 aom_bit_depth_t bit_depth) {
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100121 int64_t se = 0;
122 uint64_t sse = 0;
123 const int w = 1 << l2w;
124 const int h = 1 << l2h;
Johanneb88b172015-05-26 11:30:25 -0700125
126 xoff <<= 1;
127 yoff <<= 1;
128
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700129 for (int y = 0; y < h; y++) {
130 for (int x = 0; x < w; x++) {
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100131 // Bilinear interpolation at a 16th pel step.
James Almer756717c2022-10-19 17:32:48 +0000132 uint16_t *ref16 = (uint16_t *)ref;
133 uint16_t *src16 = (uint16_t *)src;
134 const int a1 = ref16[(w + 1) * (y + 0) + x + 0];
135 const int a2 = ref16[(w + 1) * (y + 0) + x + 1];
136 const int b1 = ref16[(w + 1) * (y + 1) + x + 0];
137 const int b2 = ref16[(w + 1) * (y + 1) + x + 1];
138 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
139 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
140 const int r = a + (((b - a) * yoff + 8) >> 4);
141 const int diff = r - src16[w * y + x];
142 se += diff;
143 sse += diff * diff;
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100144 }
145 }
Johannc855ed72015-05-27 14:37:31 -0700146 RoundHighBitDepth(bit_depth, &se, &sse);
Johannd90536c2015-06-01 13:03:30 -0700147 *sse_ptr = static_cast<uint32_t>(sse);
Urvang Joshi77853e52016-07-15 12:47:01 -0700148 return static_cast<uint32_t>(sse - ((se * se) >> (l2w + l2h)));
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700149}
James Zern98473442012-11-06 16:58:11 -0800150
James Almer756717c2022-10-19 17:32:48 +0000151static uint32_t subpel_avg_variance_ref(const uint16_t *ref,
152 const uint16_t *src,
153 const uint16_t *second_pred, int l2w,
skal8dbbcda2016-07-13 17:33:22 -0700154 int l2h, int xoff, int yoff,
155 uint32_t *sse_ptr,
Yaowu Xuf883b422016-08-30 14:01:10 -0700156 aom_bit_depth_t bit_depth) {
skal8dbbcda2016-07-13 17:33:22 -0700157 int64_t se = 0;
158 uint64_t sse = 0;
159 const int w = 1 << l2w;
160 const int h = 1 << l2h;
161
162 xoff <<= 1;
163 yoff <<= 1;
164
165 for (int y = 0; y < h; y++) {
166 for (int x = 0; x < w; x++) {
167 // bilinear interpolation at a 16th pel step
James Almer756717c2022-10-19 17:32:48 +0000168 const uint16_t *ref16 = ref;
169 const uint16_t *src16 = src;
170 const uint16_t *sec16 = second_pred;
171 const int a1 = ref16[(w + 1) * (y + 0) + x + 0];
172 const int a2 = ref16[(w + 1) * (y + 0) + x + 1];
173 const int b1 = ref16[(w + 1) * (y + 1) + x + 0];
174 const int b2 = ref16[(w + 1) * (y + 1) + x + 1];
175 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
176 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
177 const int r = a + (((b - a) * yoff + 8) >> 4);
178 const int diff = ((r + sec16[w * y + x] + 1) >> 1) - src16[w * y + x];
179 se += diff;
180 sse += diff * diff;
skal8dbbcda2016-07-13 17:33:22 -0700181 }
182 }
183 RoundHighBitDepth(bit_depth, &se, &sse);
184 *sse_ptr = static_cast<uint32_t>(sse);
Urvang Joshi77853e52016-07-15 12:47:01 -0700185 return static_cast<uint32_t>(sse - ((se * se) >> (l2w + l2h)));
skal8dbbcda2016-07-13 17:33:22 -0700186}
187
188////////////////////////////////////////////////////////////////////////////////
189
Dmitry Kovalev1f19ebb2014-09-06 00:10:25 -0700190class SumOfSquaresTest : public ::testing::TestWithParam<SumOfSquaresFunction> {
191 public:
192 SumOfSquaresTest() : func_(GetParam()) {}
193
Yaowu Xuc27fc142016-08-22 16:08:15 -0700194 virtual ~SumOfSquaresTest() { libaom_test::ClearSystemState(); }
Dmitry Kovalev1f19ebb2014-09-06 00:10:25 -0700195
196 protected:
197 void ConstTest();
198 void RefTest();
199
200 SumOfSquaresFunction func_;
201 ACMRandom rnd_;
202};
203
204void SumOfSquaresTest::ConstTest() {
205 int16_t mem[256];
206 unsigned int res;
207 for (int v = 0; v < 256; ++v) {
208 for (int i = 0; i < 256; ++i) {
209 mem[i] = v;
210 }
211 ASM_REGISTER_STATE_CHECK(res = func_(mem));
212 EXPECT_EQ(256u * (v * v), res);
213 }
214}
215
216void SumOfSquaresTest::RefTest() {
217 int16_t mem[256];
218 for (int i = 0; i < 100; ++i) {
219 for (int j = 0; j < 256; ++j) {
220 mem[j] = rnd_.Rand8() - rnd_.Rand8();
221 }
222
223 const unsigned int expected = mb_ss_ref(mem);
224 unsigned int res;
225 ASM_REGISTER_STATE_CHECK(res = func_(mem));
226 EXPECT_EQ(expected, res);
227 }
228}
229
skal8dbbcda2016-07-13 17:33:22 -0700230////////////////////////////////////////////////////////////////////////////////
231// Encapsulating struct to store the function to test along with
232// some testing context.
233// Can be used for MSE, SSE, Variance, etc.
234
235template <typename Func>
236struct TestParams {
237 TestParams(int log2w = 0, int log2h = 0, Func function = NULL,
238 int bit_depth_value = 0)
239 : log2width(log2w), log2height(log2h), func(function) {
James Almer756717c2022-10-19 17:32:48 +0000240 bit_depth = static_cast<aom_bit_depth_t>(bit_depth_value);
skal8dbbcda2016-07-13 17:33:22 -0700241 width = 1 << log2width;
242 height = 1 << log2height;
243 block_size = width * height;
244 mask = (1u << bit_depth) - 1;
245 }
246
247 int log2width, log2height;
248 int width, height;
249 int block_size;
250 Func func;
Yaowu Xuf883b422016-08-30 14:01:10 -0700251 aom_bit_depth_t bit_depth;
skal8dbbcda2016-07-13 17:33:22 -0700252 uint32_t mask;
253};
254
255template <typename Func>
256std::ostream &operator<<(std::ostream &os, const TestParams<Func> &p) {
Peng Bin7ad9dae2018-05-11 14:33:19 +0800257 return os << "width/height:" << p.width << "/" << p.height
skal8dbbcda2016-07-13 17:33:22 -0700258 << " function:" << reinterpret_cast<const void *>(p.func)
259 << " bit-depth:" << p.bit_depth;
260}
261
262// Main class for testing a function type
263template <typename FunctionType>
264class MainTestClass
265 : public ::testing::TestWithParam<TestParams<FunctionType> > {
James Zern98473442012-11-06 16:58:11 -0800266 public:
267 virtual void SetUp() {
skal8dbbcda2016-07-13 17:33:22 -0700268 params_ = this->GetParam();
269
270 rnd_.Reset(ACMRandom::DeterministicSeed());
James Almer756717c2022-10-19 17:32:48 +0000271 const size_t unit = sizeof(uint16_t);
272 src_ = reinterpret_cast<uint16_t *>(aom_memalign(16, block_size() * unit));
273 ref_ = new uint16_t[block_size() * unit];
skal8dbbcda2016-07-13 17:33:22 -0700274 ASSERT_TRUE(src_ != NULL);
275 ASSERT_TRUE(ref_ != NULL);
skal8dbbcda2016-07-13 17:33:22 -0700276 }
277
278 virtual void TearDown() {
Yaowu Xuf883b422016-08-30 14:01:10 -0700279 aom_free(src_);
skal8dbbcda2016-07-13 17:33:22 -0700280 delete[] ref_;
281 src_ = NULL;
282 ref_ = NULL;
Yaowu Xuc27fc142016-08-22 16:08:15 -0700283 libaom_test::ClearSystemState();
skal8dbbcda2016-07-13 17:33:22 -0700284 }
285
286 protected:
287 // We could sub-class MainTestClass into dedicated class for Variance
288 // and MSE/SSE, but it involves a lot of 'this->xxx' dereferencing
289 // to access top class fields xxx. That's cumbersome, so for now we'll just
290 // implement the testing methods here:
291
292 // Variance tests
293 void ZeroTest();
294 void RefTest();
295 void RefStrideTest();
296 void OneQuarterTest();
Peng Binf1abb412018-03-09 19:40:52 +0800297 void SpeedTest();
skal8dbbcda2016-07-13 17:33:22 -0700298
299 // MSE/SSE tests
300 void RefTestMse();
301 void RefTestSse();
302 void MaxTestMse();
303 void MaxTestSse();
304
305 protected:
306 ACMRandom rnd_;
James Almer756717c2022-10-19 17:32:48 +0000307 uint16_t *src_;
308 uint16_t *ref_;
skal8dbbcda2016-07-13 17:33:22 -0700309 TestParams<FunctionType> params_;
310
311 // some relay helpers
skal8dbbcda2016-07-13 17:33:22 -0700312 int byte_shift() const { return params_.bit_depth - 8; }
313 int block_size() const { return params_.block_size; }
314 int width() const { return params_.width; }
Sachin Kumar Gargf2b7da02018-09-06 17:40:49 +0530315 int height() const { return params_.height; }
skal8dbbcda2016-07-13 17:33:22 -0700316 uint32_t mask() const { return params_.mask; }
317};
318
319////////////////////////////////////////////////////////////////////////////////
320// Tests related to variance.
321
322template <typename VarianceFunctionType>
323void MainTestClass<VarianceFunctionType>::ZeroTest() {
324 for (int i = 0; i <= 255; ++i) {
James Almer756717c2022-10-19 17:32:48 +0000325 uint16_t *const src16 = src_;
326 for (int k = 0; k < block_size(); ++k) src16[k] = i << byte_shift();
skal8dbbcda2016-07-13 17:33:22 -0700327 for (int j = 0; j <= 255; ++j) {
James Almer756717c2022-10-19 17:32:48 +0000328 uint16_t *const ref16 = ref_;
329 for (int k = 0; k < block_size(); ++k) ref16[k] = j << byte_shift();
skal8dbbcda2016-07-13 17:33:22 -0700330 unsigned int sse, var;
331 ASM_REGISTER_STATE_CHECK(
332 var = params_.func(src_, width(), ref_, width(), &sse));
333 EXPECT_EQ(0u, var) << "src values: " << i << " ref values: " << j;
334 }
335 }
336}
337
338template <typename VarianceFunctionType>
339void MainTestClass<VarianceFunctionType>::RefTest() {
340 for (int i = 0; i < 10; ++i) {
341 for (int j = 0; j < block_size(); j++) {
James Almer756717c2022-10-19 17:32:48 +0000342 src_[j] = rnd_.Rand16() & mask();
343 ref_[j] = rnd_.Rand16() & mask();
skal8dbbcda2016-07-13 17:33:22 -0700344 }
345 unsigned int sse1, sse2, var1, var2;
346 const int stride = width();
347 ASM_REGISTER_STATE_CHECK(
348 var1 = params_.func(src_, stride, ref_, stride, &sse1));
James Almer756717c2022-10-19 17:32:48 +0000349 var2 = variance_ref(src_, ref_, params_.log2width, params_.log2height,
350 stride, stride, &sse2, params_.bit_depth);
skal8dbbcda2016-07-13 17:33:22 -0700351 EXPECT_EQ(sse1, sse2) << "Error at test index: " << i;
352 EXPECT_EQ(var1, var2) << "Error at test index: " << i;
353 }
354}
355
356template <typename VarianceFunctionType>
357void MainTestClass<VarianceFunctionType>::RefStrideTest() {
358 for (int i = 0; i < 10; ++i) {
359 const int ref_stride = (i & 1) * width();
360 const int src_stride = ((i >> 1) & 1) * width();
361 for (int j = 0; j < block_size(); j++) {
362 const int ref_ind = (j / width()) * ref_stride + j % width();
363 const int src_ind = (j / width()) * src_stride + j % width();
James Almer756717c2022-10-19 17:32:48 +0000364 src_[src_ind] = rnd_.Rand16() & mask();
365 ref_[ref_ind] = rnd_.Rand16() & mask();
skal8dbbcda2016-07-13 17:33:22 -0700366 }
367 unsigned int sse1, sse2;
368 unsigned int var1, var2;
369
370 ASM_REGISTER_STATE_CHECK(
371 var1 = params_.func(src_, src_stride, ref_, ref_stride, &sse1));
372 var2 = variance_ref(src_, ref_, params_.log2width, params_.log2height,
James Almer756717c2022-10-19 17:32:48 +0000373 src_stride, ref_stride, &sse2, params_.bit_depth);
skal8dbbcda2016-07-13 17:33:22 -0700374 EXPECT_EQ(sse1, sse2) << "Error at test index: " << i;
375 EXPECT_EQ(var1, var2) << "Error at test index: " << i;
376 }
377}
378
379template <typename VarianceFunctionType>
380void MainTestClass<VarianceFunctionType>::OneQuarterTest() {
381 const int half = block_size() / 2;
James Almer756717c2022-10-19 17:32:48 +0000382 aom_memset16(src_, 255 << byte_shift(), block_size());
383 aom_memset16(ref_, 255 << byte_shift(), half);
384 aom_memset16(ref_ + half, 0, half);
skal8dbbcda2016-07-13 17:33:22 -0700385 unsigned int sse, var, expected;
386 ASM_REGISTER_STATE_CHECK(
387 var = params_.func(src_, width(), ref_, width(), &sse));
388 expected = block_size() * 255 * 255 / 4;
389 EXPECT_EQ(expected, var);
390}
391
Peng Binf1abb412018-03-09 19:40:52 +0800392template <typename VarianceFunctionType>
393void MainTestClass<VarianceFunctionType>::SpeedTest() {
394 for (int j = 0; j < block_size(); j++) {
James Almer756717c2022-10-19 17:32:48 +0000395 src_[j] = rnd_.Rand16() & mask();
396 ref_[j] = rnd_.Rand16() & mask();
Peng Binf1abb412018-03-09 19:40:52 +0800397 }
Sachin Kumar Gargf2b7da02018-09-06 17:40:49 +0530398 unsigned int sse;
Peng Binf1abb412018-03-09 19:40:52 +0800399 const int stride = width();
400 int run_time = 1000000000 / block_size();
Sachin Kumar Gargf2b7da02018-09-06 17:40:49 +0530401 aom_usec_timer timer;
402 aom_usec_timer_start(&timer);
Peng Binf1abb412018-03-09 19:40:52 +0800403 for (int i = 0; i < run_time; ++i) {
Sachin Kumar Gargf2b7da02018-09-06 17:40:49 +0530404 params_.func(src_, stride, ref_, stride, &sse);
Peng Binf1abb412018-03-09 19:40:52 +0800405 }
Sachin Kumar Gargf2b7da02018-09-06 17:40:49 +0530406
407 aom_usec_timer_mark(&timer);
408 const double elapsed_time =
409 static_cast<double>(aom_usec_timer_elapsed(&timer));
410 printf("Variance %dx%d : %7.2fns\n", width(), height(), elapsed_time);
Peng Binf1abb412018-03-09 19:40:52 +0800411}
412
skal8dbbcda2016-07-13 17:33:22 -0700413////////////////////////////////////////////////////////////////////////////////
414// Tests related to MSE / SSE.
415
416template <typename FunctionType>
417void MainTestClass<FunctionType>::RefTestMse() {
418 for (int i = 0; i < 10; ++i) {
419 for (int j = 0; j < block_size(); ++j) {
420 src_[j] = rnd_.Rand8();
421 ref_[j] = rnd_.Rand8();
422 }
423 unsigned int sse1, sse2;
424 const int stride = width();
425 ASM_REGISTER_STATE_CHECK(params_.func(src_, stride, ref_, stride, &sse1));
426 variance_ref(src_, ref_, params_.log2width, params_.log2height, stride,
James Almer756717c2022-10-19 17:32:48 +0000427 stride, &sse2, AOM_BITS_8);
skal8dbbcda2016-07-13 17:33:22 -0700428 EXPECT_EQ(sse1, sse2);
429 }
430}
431
432template <typename FunctionType>
433void MainTestClass<FunctionType>::RefTestSse() {
434 for (int i = 0; i < 10; ++i) {
435 for (int j = 0; j < block_size(); ++j) {
436 src_[j] = rnd_.Rand8();
437 ref_[j] = rnd_.Rand8();
438 }
439 unsigned int sse2;
440 unsigned int var1;
441 const int stride = width();
442 ASM_REGISTER_STATE_CHECK(var1 = params_.func(src_, stride, ref_, stride));
443 variance_ref(src_, ref_, params_.log2width, params_.log2height, stride,
James Almer756717c2022-10-19 17:32:48 +0000444 stride, &sse2, AOM_BITS_8);
skal8dbbcda2016-07-13 17:33:22 -0700445 EXPECT_EQ(var1, sse2);
446 }
447}
448
449template <typename FunctionType>
450void MainTestClass<FunctionType>::MaxTestMse() {
451 memset(src_, 255, block_size());
452 memset(ref_, 0, block_size());
453 unsigned int sse;
454 ASM_REGISTER_STATE_CHECK(params_.func(src_, width(), ref_, width(), &sse));
455 const unsigned int expected = block_size() * 255 * 255;
456 EXPECT_EQ(expected, sse);
457}
458
459template <typename FunctionType>
460void MainTestClass<FunctionType>::MaxTestSse() {
461 memset(src_, 255, block_size());
462 memset(ref_, 0, block_size());
463 unsigned int var;
464 ASM_REGISTER_STATE_CHECK(var = params_.func(src_, width(), ref_, width()));
465 const unsigned int expected = block_size() * 255 * 255;
466 EXPECT_EQ(expected, var);
467}
468
469////////////////////////////////////////////////////////////////////////////////
470
sarahparkera543df52018-11-02 16:02:05 -0700471using std::get;
472using std::make_tuple;
473using std::tuple;
skal8dbbcda2016-07-13 17:33:22 -0700474
James Zernd598f042017-06-20 23:34:05 -0700475template <typename FunctionType>
skal8dbbcda2016-07-13 17:33:22 -0700476class SubpelVarianceTest
James Zernd598f042017-06-20 23:34:05 -0700477 : public ::testing::TestWithParam<TestParams<FunctionType> > {
skal8dbbcda2016-07-13 17:33:22 -0700478 public:
479 virtual void SetUp() {
James Zernd598f042017-06-20 23:34:05 -0700480 params_ = this->GetParam();
James Zern98473442012-11-06 16:58:11 -0800481
Dmitry Kovalev202edb32014-09-04 12:24:52 -0700482 rnd_.Reset(ACMRandom::DeterministicSeed());
James Almer756717c2022-10-19 17:32:48 +0000483 src_ = reinterpret_cast<uint16_t *>(
484 aom_memalign(32, block_size() * sizeof(uint16_t)));
485 sec_ = reinterpret_cast<uint16_t *>(
486 aom_memalign(32, block_size() * sizeof(uint16_t)));
487 ref_ = reinterpret_cast<uint16_t *>(aom_memalign(
488 32, (block_size() + width() + height() + 1) * sizeof(uint16_t)));
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700489 ASSERT_TRUE(src_ != NULL);
Ronald S. Bultjeac6ea2a2013-06-21 17:03:57 -0700490 ASSERT_TRUE(sec_ != NULL);
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700491 ASSERT_TRUE(ref_ != NULL);
492 }
493
494 virtual void TearDown() {
James Almer756717c2022-10-19 17:32:48 +0000495 aom_free(src_);
496 aom_free(ref_);
497 aom_free(sec_);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700498 libaom_test::ClearSystemState();
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700499 }
500
501 protected:
502 void RefTest();
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100503 void ExtremeRefTest();
Aniket Dhoke9802812019-02-13 16:42:22 +0530504 void SpeedTest();
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700505
Dmitry Kovalev202edb32014-09-04 12:24:52 -0700506 ACMRandom rnd_;
James Almer756717c2022-10-19 17:32:48 +0000507 uint16_t *src_;
508 uint16_t *ref_;
509 uint16_t *sec_;
James Zernd598f042017-06-20 23:34:05 -0700510 TestParams<FunctionType> params_;
Debargha Mukherjeef90004a2018-12-20 13:35:06 -0800511 DIST_WTD_COMP_PARAMS jcp_param_;
James Zernd598f042017-06-20 23:34:05 -0700512
513 // some relay helpers
James Zernd598f042017-06-20 23:34:05 -0700514 int byte_shift() const { return params_.bit_depth - 8; }
515 int block_size() const { return params_.block_size; }
516 int width() const { return params_.width; }
517 int height() const { return params_.height; }
518 uint32_t mask() const { return params_.mask; }
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700519};
520
skal8dbbcda2016-07-13 17:33:22 -0700521template <typename SubpelVarianceFunctionType>
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700522void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() {
Johanneb88b172015-05-26 11:30:25 -0700523 for (int x = 0; x < 8; ++x) {
524 for (int y = 0; y < 8; ++y) {
James Almer756717c2022-10-19 17:32:48 +0000525 for (int j = 0; j < block_size(); j++) {
526 src_[j] = rnd_.Rand16() & mask();
527 }
528 for (int j = 0; j < block_size() + width() + height() + 1; j++) {
529 ref_[j] = rnd_.Rand16() & mask();
Johannc3bdffb2015-05-15 11:52:03 -0700530 }
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700531 unsigned int sse1, sse2;
James Zerncc774c82013-06-18 19:15:56 -0700532 unsigned int var1;
skal8dbbcda2016-07-13 17:33:22 -0700533 ASM_REGISTER_STATE_CHECK(
James Zernd598f042017-06-20 23:34:05 -0700534 var1 = params_.func(ref_, width() + 1, x, y, src_, width(), &sse1));
James Almer756717c2022-10-19 17:32:48 +0000535 const unsigned int var2 =
536 subpel_variance_ref(ref_, src_, params_.log2width, params_.log2height,
537 x, y, &sse2, params_.bit_depth);
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100538 EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
539 EXPECT_EQ(var1, var2) << "at position " << x << ", " << y;
540 }
541 }
542}
543
skal8dbbcda2016-07-13 17:33:22 -0700544template <typename SubpelVarianceFunctionType>
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100545void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() {
546 // Compare against reference.
547 // Src: Set the first half of values to 0, the second half to the maximum.
548 // Ref: Set the first half of values to the maximum, the second half to 0.
Johanneb88b172015-05-26 11:30:25 -0700549 for (int x = 0; x < 8; ++x) {
550 for (int y = 0; y < 8; ++y) {
James Zernd598f042017-06-20 23:34:05 -0700551 const int half = block_size() / 2;
James Almer756717c2022-10-19 17:32:48 +0000552 aom_memset16(src_, mask(), half);
553 aom_memset16(src_ + half, 0, half);
554 aom_memset16(ref_, 0, half);
555 aom_memset16(ref_ + half, mask(), half + width() + height() + 1);
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100556 unsigned int sse1, sse2;
557 unsigned int var1;
558 ASM_REGISTER_STATE_CHECK(
James Zernd598f042017-06-20 23:34:05 -0700559 var1 = params_.func(ref_, width() + 1, x, y, src_, width(), &sse1));
James Almer756717c2022-10-19 17:32:48 +0000560 const unsigned int var2 =
561 subpel_variance_ref(ref_, src_, params_.log2width, params_.log2height,
562 x, y, &sse2, params_.bit_depth);
Johanneb88b172015-05-26 11:30:25 -0700563 EXPECT_EQ(sse1, sse2) << "for xoffset " << x << " and yoffset " << y;
564 EXPECT_EQ(var1, var2) << "for xoffset " << x << " and yoffset " << y;
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700565 }
566 }
567}
568
Aniket Dhoke9802812019-02-13 16:42:22 +0530569template <typename SubpelVarianceFunctionType>
570void SubpelVarianceTest<SubpelVarianceFunctionType>::SpeedTest() {
James Almer756717c2022-10-19 17:32:48 +0000571 for (int j = 0; j < block_size(); j++) {
572 src_[j] = rnd_.Rand16() & mask();
573 }
574 for (int j = 0; j < block_size() + width() + height() + 1; j++) {
575 ref_[j] = rnd_.Rand16() & mask();
Aniket Dhoke9802812019-02-13 16:42:22 +0530576 }
577
venkat sanampudi0a480f22020-03-05 09:09:00 +0530578 unsigned int sse1, sse2;
Aniket Dhoke9802812019-02-13 16:42:22 +0530579 int run_time = 1000000000 / block_size();
580 aom_usec_timer timer;
581
582 aom_usec_timer_start(&timer);
583 for (int i = 0; i < run_time; ++i) {
584 int x = rnd_(8);
585 int y = rnd_(8);
586 params_.func(ref_, width() + 1, x, y, src_, width(), &sse1);
587 }
588 aom_usec_timer_mark(&timer);
589
590 const int elapsed_time = static_cast<int>(aom_usec_timer_elapsed(&timer));
venkat sanampudi0a480f22020-03-05 09:09:00 +0530591
592 aom_usec_timer timer_c;
593
594 aom_usec_timer_start(&timer_c);
595 for (int i = 0; i < run_time; ++i) {
596 int x = rnd_(8);
597 int y = rnd_(8);
598 subpel_variance_ref(ref_, src_, params_.log2width, params_.log2height, x, y,
James Almer756717c2022-10-19 17:32:48 +0000599 &sse2, params_.bit_depth);
venkat sanampudi0a480f22020-03-05 09:09:00 +0530600 }
601 aom_usec_timer_mark(&timer_c);
602
603 const int elapsed_time_c = static_cast<int>(aom_usec_timer_elapsed(&timer_c));
604
605 printf(
606 "sub_pixel_variance_%dx%d_%d: ref_time=%d us opt_time=%d us gain=%d \n",
607 width(), height(), params_.bit_depth, elapsed_time_c, elapsed_time,
608 elapsed_time_c / elapsed_time);
Aniket Dhoke9802812019-02-13 16:42:22 +0530609}
610
skal8dbbcda2016-07-13 17:33:22 -0700611template <>
Johann6a82f0d2015-06-05 09:54:19 -0700612void SubpelVarianceTest<SubpixAvgVarMxNFunc>::RefTest() {
Johanneb88b172015-05-26 11:30:25 -0700613 for (int x = 0; x < 8; ++x) {
614 for (int y = 0; y < 8; ++y) {
James Almer756717c2022-10-19 17:32:48 +0000615 for (int j = 0; j < block_size(); j++) {
616 src_[j] = rnd_.Rand16() & mask();
617 sec_[j] = rnd_.Rand16() & mask();
618 }
619 for (int j = 0; j < block_size() + width() + height() + 1; j++) {
620 ref_[j] = rnd_.Rand16() & mask();
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100621 }
skal8dbbcda2016-07-13 17:33:22 -0700622 uint32_t sse1, sse2;
623 uint32_t var1, var2;
James Zernd598f042017-06-20 23:34:05 -0700624 ASM_REGISTER_STATE_CHECK(var1 = params_.func(ref_, width() + 1, x, y,
625 src_, width(), &sse1, sec_));
626 var2 = subpel_avg_variance_ref(ref_, src_, sec_, params_.log2width,
627 params_.log2height, x, y, &sse2,
James Almer756717c2022-10-19 17:32:48 +0000628 params_.bit_depth);
Ronald S. Bultje1e6a32f2013-06-20 15:59:48 -0700629 EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
630 EXPECT_EQ(var1, var2) << "at position " << x << ", " << y;
631 }
632 }
633}
James Zerna0fcbcf2013-09-17 18:47:25 -0700634
Kyle Siefring6042d902018-06-12 00:33:17 -0400635////////////////////////////////////////////////////////////////////////////////
636
Kyle Siefring6042d902018-06-12 00:33:17 -0400637typedef TestParams<ObmcSubpelVarFunc> ObmcSubpelVarianceParams;
638
639template <typename FunctionType>
640class ObmcVarianceTest
641 : public ::testing::TestWithParam<TestParams<FunctionType> > {
642 public:
643 virtual void SetUp() {
644 params_ = this->GetParam();
645
646 rnd_.Reset(ACMRandom::DeterministicSeed());
James Almer756717c2022-10-19 17:32:48 +0000647 pre_ = reinterpret_cast<uint16_t *>(aom_memalign(
648 32, block_size() + width() + height() + 1 * sizeof(uint16_t)));
Kyle Siefring6042d902018-06-12 00:33:17 -0400649 wsrc_ = reinterpret_cast<int32_t *>(
650 aom_memalign(32, block_size() * sizeof(uint32_t)));
651 mask_ = reinterpret_cast<int32_t *>(
652 aom_memalign(32, block_size() * sizeof(uint32_t)));
653 ASSERT_TRUE(pre_ != NULL);
654 ASSERT_TRUE(wsrc_ != NULL);
655 ASSERT_TRUE(mask_ != NULL);
656 }
657
658 virtual void TearDown() {
James Almer756717c2022-10-19 17:32:48 +0000659 aom_free(pre_);
Kyle Siefring6042d902018-06-12 00:33:17 -0400660 aom_free(wsrc_);
661 aom_free(mask_);
662 libaom_test::ClearSystemState();
663 }
664
665 protected:
666 void RefTest();
667 void ExtremeRefTest();
668 void SpeedTest();
669
670 ACMRandom rnd_;
James Almer756717c2022-10-19 17:32:48 +0000671 uint16_t *pre_;
Kyle Siefring6042d902018-06-12 00:33:17 -0400672 int32_t *wsrc_;
673 int32_t *mask_;
674 TestParams<FunctionType> params_;
675
676 // some relay helpers
Kyle Siefring6042d902018-06-12 00:33:17 -0400677 int byte_shift() const { return params_.bit_depth - 8; }
678 int block_size() const { return params_.block_size; }
679 int width() const { return params_.width; }
680 int height() const { return params_.height; }
681 uint32_t bd_mask() const { return params_.mask; }
682};
683
Yaowu Xuf883b422016-08-30 14:01:10 -0700684typedef SubpelVarianceTest<SubpixVarMxNFunc> AvxSubpelVarianceTest;
685typedef SubpelVarianceTest<SubpixAvgVarMxNFunc> AvxSubpelAvgVarianceTest;
James Zern1711cf22013-02-22 16:23:36 -0800686
Dmitry Kovalev1f19ebb2014-09-06 00:10:25 -0700687TEST_P(SumOfSquaresTest, Const) { ConstTest(); }
688TEST_P(SumOfSquaresTest, Ref) { RefTest(); }
Yaowu Xuf883b422016-08-30 14:01:10 -0700689TEST_P(AvxSubpelVarianceTest, Ref) { RefTest(); }
690TEST_P(AvxSubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); }
venkat sanampudi0a480f22020-03-05 09:09:00 +0530691TEST_P(AvxSubpelVarianceTest, DISABLED_Speed) { SpeedTest(); }
Yaowu Xuf883b422016-08-30 14:01:10 -0700692TEST_P(AvxSubpelAvgVarianceTest, Ref) { RefTest(); }
Wan-Teh Changfefa8f02020-12-03 10:17:33 -0800693
Cheng Chen96786fe2020-02-14 17:28:25 -0800694INSTANTIATE_TEST_SUITE_P(C, SumOfSquaresTest,
695 ::testing::Values(aom_get_mb_ss_c));
Dmitry Kovalev1f19ebb2014-09-06 00:10:25 -0700696
skal8dbbcda2016-07-13 17:33:22 -0700697typedef TestParams<VarianceMxNFunc> VarianceParams;
James Zernd598f042017-06-20 23:34:05 -0700698typedef TestParams<SubpixVarMxNFunc> SubpelVarianceParams;
James Zernd598f042017-06-20 23:34:05 -0700699typedef TestParams<SubpixAvgVarMxNFunc> SubpelAvgVarianceParams;
Debargha Mukherjeef90004a2018-12-20 13:35:06 -0800700typedef TestParams<DistWtdSubpixAvgVarMxNFunc> DistWtdSubpelAvgVarianceParams;
Kyle Siefring6042d902018-06-12 00:33:17 -0400701
Satish Kumar Suman217ac1c2020-05-19 14:37:35 +0530702typedef uint64_t (*MseHBDWxH16bitFunc)(uint16_t *dst, int dstride,
703 uint16_t *src, int sstride, int w,
704 int h);
705
706template <typename FunctionType>
707class MseHBDWxHTestClass
708 : public ::testing::TestWithParam<TestParams<FunctionType> > {
709 public:
710 virtual void SetUp() {
711 params_ = this->GetParam();
712
713 rnd_.Reset(ACMRandom::DeterministicSeed());
714 src_ = reinterpret_cast<uint16_t *>(
715 aom_memalign(16, block_size() * sizeof(src_)));
716 dst_ = reinterpret_cast<uint16_t *>(
717 aom_memalign(16, block_size() * sizeof(dst_)));
718 ASSERT_TRUE(src_ != NULL);
719 ASSERT_TRUE(dst_ != NULL);
720 }
721
722 virtual void TearDown() {
723 aom_free(src_);
724 aom_free(dst_);
725 src_ = NULL;
726 dst_ = NULL;
727 libaom_test::ClearSystemState();
728 }
729
730 protected:
731 void RefMatchTestMse();
732 void SpeedTest();
733
734 protected:
735 ACMRandom rnd_;
736 uint16_t *dst_;
737 uint16_t *src_;
738 TestParams<FunctionType> params_;
739
740 // some relay helpers
741 int block_size() const { return params_.block_size; }
742 int width() const { return params_.width; }
743 int d_stride() const { return params_.width; } // stride is same as width
744 int s_stride() const { return params_.width; } // stride is same as width
745 int height() const { return params_.height; }
746 int mask() const { return params_.mask; }
747};
748
749template <typename MseHBDWxHFunctionType>
750void MseHBDWxHTestClass<MseHBDWxHFunctionType>::SpeedTest() {
751 aom_usec_timer ref_timer, test_timer;
752 double elapsed_time_c = 0;
753 double elapsed_time_simd = 0;
754 int run_time = 10000000;
755 int w = width();
756 int h = height();
757 int dstride = d_stride();
758 int sstride = s_stride();
759 for (int k = 0; k < block_size(); ++k) {
760 dst_[k] = rnd_.Rand16() & mask();
761 src_[k] = rnd_.Rand16() & mask();
762 }
763 aom_usec_timer_start(&ref_timer);
764 for (int i = 0; i < run_time; i++) {
765 aom_mse_wxh_16bit_highbd_c(dst_, dstride, src_, sstride, w, h);
766 }
767 aom_usec_timer_mark(&ref_timer);
768 elapsed_time_c = static_cast<double>(aom_usec_timer_elapsed(&ref_timer));
769
770 aom_usec_timer_start(&test_timer);
771 for (int i = 0; i < run_time; i++) {
772 params_.func(dst_, dstride, src_, sstride, w, h);
773 }
774 aom_usec_timer_mark(&test_timer);
775 elapsed_time_simd = static_cast<double>(aom_usec_timer_elapsed(&test_timer));
776
777 printf("%dx%d\tc_time=%lf \t simd_time=%lf \t gain=%lf\n", width(), height(),
778 elapsed_time_c, elapsed_time_simd,
779 (elapsed_time_c / elapsed_time_simd));
780}
781
782template <typename MseHBDWxHFunctionType>
783void MseHBDWxHTestClass<MseHBDWxHFunctionType>::RefMatchTestMse() {
784 uint64_t mse_ref = 0;
785 uint64_t mse_mod = 0;
786 int w = width();
787 int h = height();
788 int dstride = d_stride();
789 int sstride = s_stride();
790 for (int i = 0; i < 10; i++) {
791 for (int k = 0; k < block_size(); ++k) {
792 dst_[k] = rnd_.Rand16() & mask();
793 src_[k] = rnd_.Rand16() & mask();
794 }
795 ASM_REGISTER_STATE_CHECK(mse_ref = aom_mse_wxh_16bit_highbd_c(
796 dst_, dstride, src_, sstride, w, h));
797 ASM_REGISTER_STATE_CHECK(
798 mse_mod = params_.func(dst_, dstride, src_, sstride, w, h));
799 EXPECT_EQ(mse_ref, mse_mod)
800 << "ref mse: " << mse_ref << " mod mse: " << mse_mod;
801 }
802}
803
804typedef TestParams<MseHBDWxH16bitFunc> MseHBDWxHParams;
805typedef MseHBDWxHTestClass<MseHBDWxH16bitFunc> MseHBDWxHTest;
Yaowu Xuf883b422016-08-30 14:01:10 -0700806typedef MainTestClass<VarianceMxNFunc> AvxHBDMseTest;
chiyotsai9dfac722020-07-07 17:43:02 -0700807GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AvxHBDMseTest);
Yaowu Xuf883b422016-08-30 14:01:10 -0700808typedef MainTestClass<VarianceMxNFunc> AvxHBDVarianceTest;
809typedef SubpelVarianceTest<SubpixVarMxNFunc> AvxHBDSubpelVarianceTest;
810typedef SubpelVarianceTest<SubpixAvgVarMxNFunc> AvxHBDSubpelAvgVarianceTest;
Kyle Siefring6042d902018-06-12 00:33:17 -0400811typedef ObmcVarianceTest<ObmcSubpelVarFunc> AvxHBDObmcSubpelVarianceTest;
chiyotsai9dfac722020-07-07 17:43:02 -0700812GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AvxHBDObmcSubpelVarianceTest);
Johannc3bdffb2015-05-15 11:52:03 -0700813
Satish Kumar Suman217ac1c2020-05-19 14:37:35 +0530814TEST_P(MseHBDWxHTest, RefMse) { RefMatchTestMse(); }
815TEST_P(MseHBDWxHTest, DISABLED_SpeedMse) { SpeedTest(); }
Yaowu Xuf883b422016-08-30 14:01:10 -0700816TEST_P(AvxHBDMseTest, RefMse) { RefTestMse(); }
817TEST_P(AvxHBDMseTest, MaxMse) { MaxTestMse(); }
818TEST_P(AvxHBDVarianceTest, Zero) { ZeroTest(); }
819TEST_P(AvxHBDVarianceTest, Ref) { RefTest(); }
820TEST_P(AvxHBDVarianceTest, RefStride) { RefStrideTest(); }
821TEST_P(AvxHBDVarianceTest, OneQuarter) { OneQuarterTest(); }
Sachin Kumar Gargf2b7da02018-09-06 17:40:49 +0530822TEST_P(AvxHBDVarianceTest, DISABLED_Speed) { SpeedTest(); }
Yaowu Xuf883b422016-08-30 14:01:10 -0700823TEST_P(AvxHBDSubpelVarianceTest, Ref) { RefTest(); }
824TEST_P(AvxHBDSubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); }
Aniket Dhoke9802812019-02-13 16:42:22 +0530825TEST_P(AvxHBDSubpelVarianceTest, DISABLED_Speed) { SpeedTest(); }
Yaowu Xuf883b422016-08-30 14:01:10 -0700826TEST_P(AvxHBDSubpelAvgVarianceTest, Ref) { RefTest(); }
Johannc3bdffb2015-05-15 11:52:03 -0700827
Wan-Teh Changfefa8f02020-12-03 10:17:33 -0800828INSTANTIATE_TEST_SUITE_P(
829 C, MseHBDWxHTest,
830 ::testing::Values(MseHBDWxHParams(3, 3, &aom_mse_wxh_16bit_highbd_c, 10),
831 MseHBDWxHParams(3, 2, &aom_mse_wxh_16bit_highbd_c, 10),
832 MseHBDWxHParams(2, 3, &aom_mse_wxh_16bit_highbd_c, 10),
833 MseHBDWxHParams(2, 2, &aom_mse_wxh_16bit_highbd_c, 10)));
834
Johannc3bdffb2015-05-15 11:52:03 -0700835/* TODO(debargha): This test does not support the highbd version
Cheng Chen96786fe2020-02-14 17:28:25 -0800836INSTANTIATE_TEST_SUITE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -0700837 C, AvxHBDMseTest,
838 ::testing::Values(make_tuple(4, 4, &aom_highbd_12_mse16x16_c),
839 make_tuple(4, 4, &aom_highbd_12_mse16x8_c),
840 make_tuple(4, 4, &aom_highbd_12_mse8x16_c),
841 make_tuple(4, 4, &aom_highbd_12_mse8x8_c),
842 make_tuple(4, 4, &aom_highbd_10_mse16x16_c),
843 make_tuple(4, 4, &aom_highbd_10_mse16x8_c),
844 make_tuple(4, 4, &aom_highbd_10_mse8x16_c),
845 make_tuple(4, 4, &aom_highbd_10_mse8x8_c),
846 make_tuple(4, 4, &aom_highbd_8_mse16x16_c),
847 make_tuple(4, 4, &aom_highbd_8_mse16x8_c),
848 make_tuple(4, 4, &aom_highbd_8_mse8x16_c),
849 make_tuple(4, 4, &aom_highbd_8_mse8x8_c)));
Johannc3bdffb2015-05-15 11:52:03 -0700850*/
851
skal8dbbcda2016-07-13 17:33:22 -0700852const VarianceParams kArrayHBDVariance_c[] = {
Yaowu Xuf883b422016-08-30 14:01:10 -0700853 VarianceParams(7, 7, &aom_highbd_12_variance128x128_c, 12),
854 VarianceParams(7, 6, &aom_highbd_12_variance128x64_c, 12),
855 VarianceParams(6, 7, &aom_highbd_12_variance64x128_c, 12),
Yaowu Xuf883b422016-08-30 14:01:10 -0700856 VarianceParams(6, 6, &aom_highbd_12_variance64x64_c, 12),
857 VarianceParams(6, 5, &aom_highbd_12_variance64x32_c, 12),
858 VarianceParams(5, 6, &aom_highbd_12_variance32x64_c, 12),
859 VarianceParams(5, 5, &aom_highbd_12_variance32x32_c, 12),
860 VarianceParams(5, 4, &aom_highbd_12_variance32x16_c, 12),
861 VarianceParams(4, 5, &aom_highbd_12_variance16x32_c, 12),
862 VarianceParams(4, 4, &aom_highbd_12_variance16x16_c, 12),
863 VarianceParams(4, 3, &aom_highbd_12_variance16x8_c, 12),
864 VarianceParams(3, 4, &aom_highbd_12_variance8x16_c, 12),
865 VarianceParams(3, 3, &aom_highbd_12_variance8x8_c, 12),
866 VarianceParams(3, 2, &aom_highbd_12_variance8x4_c, 12),
867 VarianceParams(2, 3, &aom_highbd_12_variance4x8_c, 12),
868 VarianceParams(2, 2, &aom_highbd_12_variance4x4_c, 12),
Yaowu Xuf883b422016-08-30 14:01:10 -0700869 VarianceParams(7, 7, &aom_highbd_10_variance128x128_c, 10),
870 VarianceParams(7, 6, &aom_highbd_10_variance128x64_c, 10),
871 VarianceParams(6, 7, &aom_highbd_10_variance64x128_c, 10),
Yaowu Xuf883b422016-08-30 14:01:10 -0700872 VarianceParams(6, 6, &aom_highbd_10_variance64x64_c, 10),
873 VarianceParams(6, 5, &aom_highbd_10_variance64x32_c, 10),
874 VarianceParams(5, 6, &aom_highbd_10_variance32x64_c, 10),
875 VarianceParams(5, 5, &aom_highbd_10_variance32x32_c, 10),
876 VarianceParams(5, 4, &aom_highbd_10_variance32x16_c, 10),
877 VarianceParams(4, 5, &aom_highbd_10_variance16x32_c, 10),
878 VarianceParams(4, 4, &aom_highbd_10_variance16x16_c, 10),
879 VarianceParams(4, 3, &aom_highbd_10_variance16x8_c, 10),
880 VarianceParams(3, 4, &aom_highbd_10_variance8x16_c, 10),
881 VarianceParams(3, 3, &aom_highbd_10_variance8x8_c, 10),
882 VarianceParams(3, 2, &aom_highbd_10_variance8x4_c, 10),
883 VarianceParams(2, 3, &aom_highbd_10_variance4x8_c, 10),
884 VarianceParams(2, 2, &aom_highbd_10_variance4x4_c, 10),
Yaowu Xuf883b422016-08-30 14:01:10 -0700885 VarianceParams(7, 7, &aom_highbd_8_variance128x128_c, 8),
886 VarianceParams(7, 6, &aom_highbd_8_variance128x64_c, 8),
887 VarianceParams(6, 7, &aom_highbd_8_variance64x128_c, 8),
Yaowu Xuf883b422016-08-30 14:01:10 -0700888 VarianceParams(6, 6, &aom_highbd_8_variance64x64_c, 8),
889 VarianceParams(6, 5, &aom_highbd_8_variance64x32_c, 8),
890 VarianceParams(5, 6, &aom_highbd_8_variance32x64_c, 8),
891 VarianceParams(5, 5, &aom_highbd_8_variance32x32_c, 8),
892 VarianceParams(5, 4, &aom_highbd_8_variance32x16_c, 8),
893 VarianceParams(4, 5, &aom_highbd_8_variance16x32_c, 8),
894 VarianceParams(4, 4, &aom_highbd_8_variance16x16_c, 8),
895 VarianceParams(4, 3, &aom_highbd_8_variance16x8_c, 8),
896 VarianceParams(3, 4, &aom_highbd_8_variance8x16_c, 8),
897 VarianceParams(3, 3, &aom_highbd_8_variance8x8_c, 8),
898 VarianceParams(3, 2, &aom_highbd_8_variance8x4_c, 8),
899 VarianceParams(2, 3, &aom_highbd_8_variance4x8_c, 8),
Debargha Mukherjee90f256f2019-07-16 21:02:16 -0700900 VarianceParams(2, 2, &aom_highbd_8_variance4x4_c, 8),
901
902 VarianceParams(6, 4, &aom_highbd_12_variance64x16_c, 12),
903 VarianceParams(4, 6, &aom_highbd_12_variance16x64_c, 12),
904 VarianceParams(5, 3, &aom_highbd_12_variance32x8_c, 12),
905 VarianceParams(3, 5, &aom_highbd_12_variance8x32_c, 12),
906 VarianceParams(4, 2, &aom_highbd_12_variance16x4_c, 12),
907 VarianceParams(2, 4, &aom_highbd_12_variance4x16_c, 12),
908 VarianceParams(6, 4, &aom_highbd_10_variance64x16_c, 10),
909 VarianceParams(4, 6, &aom_highbd_10_variance16x64_c, 10),
910 VarianceParams(5, 3, &aom_highbd_10_variance32x8_c, 10),
911 VarianceParams(3, 5, &aom_highbd_10_variance8x32_c, 10),
912 VarianceParams(4, 2, &aom_highbd_10_variance16x4_c, 10),
913 VarianceParams(2, 4, &aom_highbd_10_variance4x16_c, 10),
914 VarianceParams(6, 4, &aom_highbd_8_variance64x16_c, 8),
915 VarianceParams(4, 6, &aom_highbd_8_variance16x64_c, 8),
916 VarianceParams(5, 3, &aom_highbd_8_variance32x8_c, 8),
917 VarianceParams(3, 5, &aom_highbd_8_variance8x32_c, 8),
918 VarianceParams(4, 2, &aom_highbd_8_variance16x4_c, 8),
919 VarianceParams(2, 4, &aom_highbd_8_variance4x16_c, 8),
skal8dbbcda2016-07-13 17:33:22 -0700920};
Cheng Chen96786fe2020-02-14 17:28:25 -0800921INSTANTIATE_TEST_SUITE_P(C, AvxHBDVarianceTest,
922 ::testing::ValuesIn(kArrayHBDVariance_c));
Johann6a82f0d2015-06-05 09:54:19 -0700923
Yaowu Xud3e7c682017-12-21 14:08:25 -0800924#if HAVE_SSE4_1
Cheng Chen96786fe2020-02-14 17:28:25 -0800925INSTANTIATE_TEST_SUITE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -0700926 SSE4_1, AvxHBDVarianceTest,
skal8dbbcda2016-07-13 17:33:22 -0700927 ::testing::Values(
Yaowu Xuf883b422016-08-30 14:01:10 -0700928 VarianceParams(2, 2, &aom_highbd_8_variance4x4_sse4_1, 8),
929 VarianceParams(2, 2, &aom_highbd_10_variance4x4_sse4_1, 10),
930 VarianceParams(2, 2, &aom_highbd_12_variance4x4_sse4_1, 12)));
Yaowu Xud3e7c682017-12-21 14:08:25 -0800931#endif // HAVE_SSE4_1
Yi Luoc2496892016-04-08 11:16:30 -0700932
James Zernd598f042017-06-20 23:34:05 -0700933const SubpelVarianceParams kArrayHBDSubpelVariance_c[] = {
James Zernd598f042017-06-20 23:34:05 -0700934 SubpelVarianceParams(7, 7, &aom_highbd_8_sub_pixel_variance128x128_c, 8),
935 SubpelVarianceParams(7, 6, &aom_highbd_8_sub_pixel_variance128x64_c, 8),
936 SubpelVarianceParams(6, 7, &aom_highbd_8_sub_pixel_variance64x128_c, 8),
James Zernd598f042017-06-20 23:34:05 -0700937 SubpelVarianceParams(6, 6, &aom_highbd_8_sub_pixel_variance64x64_c, 8),
938 SubpelVarianceParams(6, 5, &aom_highbd_8_sub_pixel_variance64x32_c, 8),
939 SubpelVarianceParams(5, 6, &aom_highbd_8_sub_pixel_variance32x64_c, 8),
940 SubpelVarianceParams(5, 5, &aom_highbd_8_sub_pixel_variance32x32_c, 8),
941 SubpelVarianceParams(5, 4, &aom_highbd_8_sub_pixel_variance32x16_c, 8),
942 SubpelVarianceParams(4, 5, &aom_highbd_8_sub_pixel_variance16x32_c, 8),
943 SubpelVarianceParams(4, 4, &aom_highbd_8_sub_pixel_variance16x16_c, 8),
944 SubpelVarianceParams(4, 3, &aom_highbd_8_sub_pixel_variance16x8_c, 8),
945 SubpelVarianceParams(3, 4, &aom_highbd_8_sub_pixel_variance8x16_c, 8),
946 SubpelVarianceParams(3, 3, &aom_highbd_8_sub_pixel_variance8x8_c, 8),
947 SubpelVarianceParams(3, 2, &aom_highbd_8_sub_pixel_variance8x4_c, 8),
948 SubpelVarianceParams(2, 3, &aom_highbd_8_sub_pixel_variance4x8_c, 8),
949 SubpelVarianceParams(2, 2, &aom_highbd_8_sub_pixel_variance4x4_c, 8),
James Zernd598f042017-06-20 23:34:05 -0700950 SubpelVarianceParams(7, 7, &aom_highbd_10_sub_pixel_variance128x128_c, 10),
951 SubpelVarianceParams(7, 6, &aom_highbd_10_sub_pixel_variance128x64_c, 10),
952 SubpelVarianceParams(6, 7, &aom_highbd_10_sub_pixel_variance64x128_c, 10),
James Zernd598f042017-06-20 23:34:05 -0700953 SubpelVarianceParams(6, 6, &aom_highbd_10_sub_pixel_variance64x64_c, 10),
954 SubpelVarianceParams(6, 5, &aom_highbd_10_sub_pixel_variance64x32_c, 10),
955 SubpelVarianceParams(5, 6, &aom_highbd_10_sub_pixel_variance32x64_c, 10),
956 SubpelVarianceParams(5, 5, &aom_highbd_10_sub_pixel_variance32x32_c, 10),
957 SubpelVarianceParams(5, 4, &aom_highbd_10_sub_pixel_variance32x16_c, 10),
958 SubpelVarianceParams(4, 5, &aom_highbd_10_sub_pixel_variance16x32_c, 10),
959 SubpelVarianceParams(4, 4, &aom_highbd_10_sub_pixel_variance16x16_c, 10),
960 SubpelVarianceParams(4, 3, &aom_highbd_10_sub_pixel_variance16x8_c, 10),
961 SubpelVarianceParams(3, 4, &aom_highbd_10_sub_pixel_variance8x16_c, 10),
962 SubpelVarianceParams(3, 3, &aom_highbd_10_sub_pixel_variance8x8_c, 10),
963 SubpelVarianceParams(3, 2, &aom_highbd_10_sub_pixel_variance8x4_c, 10),
964 SubpelVarianceParams(2, 3, &aom_highbd_10_sub_pixel_variance4x8_c, 10),
965 SubpelVarianceParams(2, 2, &aom_highbd_10_sub_pixel_variance4x4_c, 10),
James Zernd598f042017-06-20 23:34:05 -0700966 SubpelVarianceParams(7, 7, &aom_highbd_12_sub_pixel_variance128x128_c, 12),
967 SubpelVarianceParams(7, 6, &aom_highbd_12_sub_pixel_variance128x64_c, 12),
968 SubpelVarianceParams(6, 7, &aom_highbd_12_sub_pixel_variance64x128_c, 12),
James Zernd598f042017-06-20 23:34:05 -0700969 SubpelVarianceParams(6, 6, &aom_highbd_12_sub_pixel_variance64x64_c, 12),
970 SubpelVarianceParams(6, 5, &aom_highbd_12_sub_pixel_variance64x32_c, 12),
971 SubpelVarianceParams(5, 6, &aom_highbd_12_sub_pixel_variance32x64_c, 12),
972 SubpelVarianceParams(5, 5, &aom_highbd_12_sub_pixel_variance32x32_c, 12),
973 SubpelVarianceParams(5, 4, &aom_highbd_12_sub_pixel_variance32x16_c, 12),
974 SubpelVarianceParams(4, 5, &aom_highbd_12_sub_pixel_variance16x32_c, 12),
975 SubpelVarianceParams(4, 4, &aom_highbd_12_sub_pixel_variance16x16_c, 12),
976 SubpelVarianceParams(4, 3, &aom_highbd_12_sub_pixel_variance16x8_c, 12),
977 SubpelVarianceParams(3, 4, &aom_highbd_12_sub_pixel_variance8x16_c, 12),
978 SubpelVarianceParams(3, 3, &aom_highbd_12_sub_pixel_variance8x8_c, 12),
979 SubpelVarianceParams(3, 2, &aom_highbd_12_sub_pixel_variance8x4_c, 12),
980 SubpelVarianceParams(2, 3, &aom_highbd_12_sub_pixel_variance4x8_c, 12),
981 SubpelVarianceParams(2, 2, &aom_highbd_12_sub_pixel_variance4x4_c, 12),
Debargha Mukherjee90f256f2019-07-16 21:02:16 -0700982
983 SubpelVarianceParams(6, 4, &aom_highbd_8_sub_pixel_variance64x16_c, 8),
984 SubpelVarianceParams(4, 6, &aom_highbd_8_sub_pixel_variance16x64_c, 8),
985 SubpelVarianceParams(5, 3, &aom_highbd_8_sub_pixel_variance32x8_c, 8),
986 SubpelVarianceParams(3, 5, &aom_highbd_8_sub_pixel_variance8x32_c, 8),
987 SubpelVarianceParams(4, 2, &aom_highbd_8_sub_pixel_variance16x4_c, 8),
988 SubpelVarianceParams(2, 4, &aom_highbd_8_sub_pixel_variance4x16_c, 8),
989 SubpelVarianceParams(6, 4, &aom_highbd_10_sub_pixel_variance64x16_c, 10),
990 SubpelVarianceParams(4, 6, &aom_highbd_10_sub_pixel_variance16x64_c, 10),
991 SubpelVarianceParams(5, 3, &aom_highbd_10_sub_pixel_variance32x8_c, 10),
992 SubpelVarianceParams(3, 5, &aom_highbd_10_sub_pixel_variance8x32_c, 10),
993 SubpelVarianceParams(4, 2, &aom_highbd_10_sub_pixel_variance16x4_c, 10),
994 SubpelVarianceParams(2, 4, &aom_highbd_10_sub_pixel_variance4x16_c, 10),
995 SubpelVarianceParams(6, 4, &aom_highbd_12_sub_pixel_variance64x16_c, 12),
996 SubpelVarianceParams(4, 6, &aom_highbd_12_sub_pixel_variance16x64_c, 12),
997 SubpelVarianceParams(5, 3, &aom_highbd_12_sub_pixel_variance32x8_c, 12),
998 SubpelVarianceParams(3, 5, &aom_highbd_12_sub_pixel_variance8x32_c, 12),
999 SubpelVarianceParams(4, 2, &aom_highbd_12_sub_pixel_variance16x4_c, 12),
1000 SubpelVarianceParams(2, 4, &aom_highbd_12_sub_pixel_variance4x16_c, 12),
Alex Converse25de2e12016-04-27 12:23:00 -07001001};
Cheng Chen96786fe2020-02-14 17:28:25 -08001002INSTANTIATE_TEST_SUITE_P(C, AvxHBDSubpelVarianceTest,
1003 ::testing::ValuesIn(kArrayHBDSubpelVariance_c));
Johann6a82f0d2015-06-05 09:54:19 -07001004
James Zernd598f042017-06-20 23:34:05 -07001005const SubpelAvgVarianceParams kArrayHBDSubpelAvgVariance_c[] = {
James Zernd598f042017-06-20 23:34:05 -07001006 SubpelAvgVarianceParams(7, 7, &aom_highbd_8_sub_pixel_avg_variance128x128_c,
1007 8),
1008 SubpelAvgVarianceParams(7, 6, &aom_highbd_8_sub_pixel_avg_variance128x64_c,
1009 8),
1010 SubpelAvgVarianceParams(6, 7, &aom_highbd_8_sub_pixel_avg_variance64x128_c,
1011 8),
James Zernd598f042017-06-20 23:34:05 -07001012 SubpelAvgVarianceParams(6, 6, &aom_highbd_8_sub_pixel_avg_variance64x64_c, 8),
1013 SubpelAvgVarianceParams(6, 5, &aom_highbd_8_sub_pixel_avg_variance64x32_c, 8),
1014 SubpelAvgVarianceParams(5, 6, &aom_highbd_8_sub_pixel_avg_variance32x64_c, 8),
1015 SubpelAvgVarianceParams(5, 5, &aom_highbd_8_sub_pixel_avg_variance32x32_c, 8),
1016 SubpelAvgVarianceParams(5, 4, &aom_highbd_8_sub_pixel_avg_variance32x16_c, 8),
1017 SubpelAvgVarianceParams(4, 5, &aom_highbd_8_sub_pixel_avg_variance16x32_c, 8),
1018 SubpelAvgVarianceParams(4, 4, &aom_highbd_8_sub_pixel_avg_variance16x16_c, 8),
1019 SubpelAvgVarianceParams(4, 3, &aom_highbd_8_sub_pixel_avg_variance16x8_c, 8),
1020 SubpelAvgVarianceParams(3, 4, &aom_highbd_8_sub_pixel_avg_variance8x16_c, 8),
1021 SubpelAvgVarianceParams(3, 3, &aom_highbd_8_sub_pixel_avg_variance8x8_c, 8),
1022 SubpelAvgVarianceParams(3, 2, &aom_highbd_8_sub_pixel_avg_variance8x4_c, 8),
1023 SubpelAvgVarianceParams(2, 3, &aom_highbd_8_sub_pixel_avg_variance4x8_c, 8),
1024 SubpelAvgVarianceParams(2, 2, &aom_highbd_8_sub_pixel_avg_variance4x4_c, 8),
James Zernd598f042017-06-20 23:34:05 -07001025 SubpelAvgVarianceParams(7, 7, &aom_highbd_10_sub_pixel_avg_variance128x128_c,
1026 10),
1027 SubpelAvgVarianceParams(7, 6, &aom_highbd_10_sub_pixel_avg_variance128x64_c,
1028 10),
1029 SubpelAvgVarianceParams(6, 7, &aom_highbd_10_sub_pixel_avg_variance64x128_c,
1030 10),
James Zernd598f042017-06-20 23:34:05 -07001031 SubpelAvgVarianceParams(6, 6, &aom_highbd_10_sub_pixel_avg_variance64x64_c,
1032 10),
1033 SubpelAvgVarianceParams(6, 5, &aom_highbd_10_sub_pixel_avg_variance64x32_c,
1034 10),
1035 SubpelAvgVarianceParams(5, 6, &aom_highbd_10_sub_pixel_avg_variance32x64_c,
1036 10),
1037 SubpelAvgVarianceParams(5, 5, &aom_highbd_10_sub_pixel_avg_variance32x32_c,
1038 10),
1039 SubpelAvgVarianceParams(5, 4, &aom_highbd_10_sub_pixel_avg_variance32x16_c,
1040 10),
1041 SubpelAvgVarianceParams(4, 5, &aom_highbd_10_sub_pixel_avg_variance16x32_c,
1042 10),
1043 SubpelAvgVarianceParams(4, 4, &aom_highbd_10_sub_pixel_avg_variance16x16_c,
1044 10),
1045 SubpelAvgVarianceParams(4, 3, &aom_highbd_10_sub_pixel_avg_variance16x8_c,
1046 10),
1047 SubpelAvgVarianceParams(3, 4, &aom_highbd_10_sub_pixel_avg_variance8x16_c,
1048 10),
1049 SubpelAvgVarianceParams(3, 3, &aom_highbd_10_sub_pixel_avg_variance8x8_c, 10),
1050 SubpelAvgVarianceParams(3, 2, &aom_highbd_10_sub_pixel_avg_variance8x4_c, 10),
1051 SubpelAvgVarianceParams(2, 3, &aom_highbd_10_sub_pixel_avg_variance4x8_c, 10),
1052 SubpelAvgVarianceParams(2, 2, &aom_highbd_10_sub_pixel_avg_variance4x4_c, 10),
James Zernd598f042017-06-20 23:34:05 -07001053 SubpelAvgVarianceParams(7, 7, &aom_highbd_12_sub_pixel_avg_variance128x128_c,
1054 12),
1055 SubpelAvgVarianceParams(7, 6, &aom_highbd_12_sub_pixel_avg_variance128x64_c,
1056 12),
1057 SubpelAvgVarianceParams(6, 7, &aom_highbd_12_sub_pixel_avg_variance64x128_c,
1058 12),
James Zernd598f042017-06-20 23:34:05 -07001059 SubpelAvgVarianceParams(6, 6, &aom_highbd_12_sub_pixel_avg_variance64x64_c,
1060 12),
1061 SubpelAvgVarianceParams(6, 5, &aom_highbd_12_sub_pixel_avg_variance64x32_c,
1062 12),
1063 SubpelAvgVarianceParams(5, 6, &aom_highbd_12_sub_pixel_avg_variance32x64_c,
1064 12),
1065 SubpelAvgVarianceParams(5, 5, &aom_highbd_12_sub_pixel_avg_variance32x32_c,
1066 12),
1067 SubpelAvgVarianceParams(5, 4, &aom_highbd_12_sub_pixel_avg_variance32x16_c,
1068 12),
1069 SubpelAvgVarianceParams(4, 5, &aom_highbd_12_sub_pixel_avg_variance16x32_c,
1070 12),
1071 SubpelAvgVarianceParams(4, 4, &aom_highbd_12_sub_pixel_avg_variance16x16_c,
1072 12),
1073 SubpelAvgVarianceParams(4, 3, &aom_highbd_12_sub_pixel_avg_variance16x8_c,
1074 12),
1075 SubpelAvgVarianceParams(3, 4, &aom_highbd_12_sub_pixel_avg_variance8x16_c,
1076 12),
1077 SubpelAvgVarianceParams(3, 3, &aom_highbd_12_sub_pixel_avg_variance8x8_c, 12),
1078 SubpelAvgVarianceParams(3, 2, &aom_highbd_12_sub_pixel_avg_variance8x4_c, 12),
1079 SubpelAvgVarianceParams(2, 3, &aom_highbd_12_sub_pixel_avg_variance4x8_c, 12),
Debargha Mukherjee90f256f2019-07-16 21:02:16 -07001080 SubpelAvgVarianceParams(2, 2, &aom_highbd_12_sub_pixel_avg_variance4x4_c, 12),
1081
1082 SubpelAvgVarianceParams(6, 4, &aom_highbd_8_sub_pixel_avg_variance64x16_c, 8),
1083 SubpelAvgVarianceParams(4, 6, &aom_highbd_8_sub_pixel_avg_variance16x64_c, 8),
1084 SubpelAvgVarianceParams(5, 3, &aom_highbd_8_sub_pixel_avg_variance32x8_c, 8),
1085 SubpelAvgVarianceParams(3, 5, &aom_highbd_8_sub_pixel_avg_variance8x32_c, 8),
1086 SubpelAvgVarianceParams(4, 2, &aom_highbd_8_sub_pixel_avg_variance16x4_c, 8),
1087 SubpelAvgVarianceParams(2, 4, &aom_highbd_8_sub_pixel_avg_variance4x16_c, 8),
1088 SubpelAvgVarianceParams(6, 4, &aom_highbd_10_sub_pixel_avg_variance64x16_c,
1089 10),
1090 SubpelAvgVarianceParams(4, 6, &aom_highbd_10_sub_pixel_avg_variance16x64_c,
1091 10),
1092 SubpelAvgVarianceParams(5, 3, &aom_highbd_10_sub_pixel_avg_variance32x8_c,
1093 10),
1094 SubpelAvgVarianceParams(3, 5, &aom_highbd_10_sub_pixel_avg_variance8x32_c,
1095 10),
1096 SubpelAvgVarianceParams(4, 2, &aom_highbd_10_sub_pixel_avg_variance16x4_c,
1097 10),
1098 SubpelAvgVarianceParams(2, 4, &aom_highbd_10_sub_pixel_avg_variance4x16_c,
1099 10),
1100 SubpelAvgVarianceParams(6, 4, &aom_highbd_12_sub_pixel_avg_variance64x16_c,
1101 12),
1102 SubpelAvgVarianceParams(4, 6, &aom_highbd_12_sub_pixel_avg_variance16x64_c,
1103 12),
1104 SubpelAvgVarianceParams(5, 3, &aom_highbd_12_sub_pixel_avg_variance32x8_c,
1105 12),
1106 SubpelAvgVarianceParams(3, 5, &aom_highbd_12_sub_pixel_avg_variance8x32_c,
1107 12),
1108 SubpelAvgVarianceParams(4, 2, &aom_highbd_12_sub_pixel_avg_variance16x4_c,
1109 12),
1110 SubpelAvgVarianceParams(2, 4, &aom_highbd_12_sub_pixel_avg_variance4x16_c,
1111 12),
Alex Converse25de2e12016-04-27 12:23:00 -07001112};
Cheng Chen96786fe2020-02-14 17:28:25 -08001113INSTANTIATE_TEST_SUITE_P(C, AvxHBDSubpelAvgVarianceTest,
1114 ::testing::ValuesIn(kArrayHBDSubpelAvgVariance_c));
Johannc3bdffb2015-05-15 11:52:03 -07001115
Kyle Siefring6042d902018-06-12 00:33:17 -04001116const ObmcSubpelVarianceParams kArrayHBDObmcSubpelVariance_c[] = {
1117 ObmcSubpelVarianceParams(7, 7, &aom_highbd_obmc_sub_pixel_variance128x128_c,
1118 8),
1119 ObmcSubpelVarianceParams(7, 6, &aom_highbd_obmc_sub_pixel_variance128x64_c,
1120 8),
1121 ObmcSubpelVarianceParams(6, 7, &aom_highbd_obmc_sub_pixel_variance64x128_c,
1122 8),
1123 ObmcSubpelVarianceParams(6, 6, &aom_highbd_obmc_sub_pixel_variance64x64_c, 8),
1124 ObmcSubpelVarianceParams(6, 5, &aom_highbd_obmc_sub_pixel_variance64x32_c, 8),
1125 ObmcSubpelVarianceParams(5, 6, &aom_highbd_obmc_sub_pixel_variance32x64_c, 8),
1126 ObmcSubpelVarianceParams(5, 5, &aom_highbd_obmc_sub_pixel_variance32x32_c, 8),
1127 ObmcSubpelVarianceParams(5, 4, &aom_highbd_obmc_sub_pixel_variance32x16_c, 8),
1128 ObmcSubpelVarianceParams(4, 5, &aom_highbd_obmc_sub_pixel_variance16x32_c, 8),
1129 ObmcSubpelVarianceParams(4, 4, &aom_highbd_obmc_sub_pixel_variance16x16_c, 8),
1130 ObmcSubpelVarianceParams(4, 3, &aom_highbd_obmc_sub_pixel_variance16x8_c, 8),
1131 ObmcSubpelVarianceParams(3, 4, &aom_highbd_obmc_sub_pixel_variance8x16_c, 8),
1132 ObmcSubpelVarianceParams(3, 3, &aom_highbd_obmc_sub_pixel_variance8x8_c, 8),
1133 ObmcSubpelVarianceParams(3, 2, &aom_highbd_obmc_sub_pixel_variance8x4_c, 8),
1134 ObmcSubpelVarianceParams(2, 3, &aom_highbd_obmc_sub_pixel_variance4x8_c, 8),
1135 ObmcSubpelVarianceParams(2, 2, &aom_highbd_obmc_sub_pixel_variance4x4_c, 8),
1136 ObmcSubpelVarianceParams(7, 7,
1137 &aom_highbd_10_obmc_sub_pixel_variance128x128_c, 10),
1138 ObmcSubpelVarianceParams(7, 6, &aom_highbd_10_obmc_sub_pixel_variance128x64_c,
1139 10),
1140 ObmcSubpelVarianceParams(6, 7, &aom_highbd_10_obmc_sub_pixel_variance64x128_c,
1141 10),
1142 ObmcSubpelVarianceParams(6, 6, &aom_highbd_10_obmc_sub_pixel_variance64x64_c,
1143 10),
1144 ObmcSubpelVarianceParams(6, 5, &aom_highbd_10_obmc_sub_pixel_variance64x32_c,
1145 10),
1146 ObmcSubpelVarianceParams(5, 6, &aom_highbd_10_obmc_sub_pixel_variance32x64_c,
1147 10),
1148 ObmcSubpelVarianceParams(5, 5, &aom_highbd_10_obmc_sub_pixel_variance32x32_c,
1149 10),
1150 ObmcSubpelVarianceParams(5, 4, &aom_highbd_10_obmc_sub_pixel_variance32x16_c,
1151 10),
1152 ObmcSubpelVarianceParams(4, 5, &aom_highbd_10_obmc_sub_pixel_variance16x32_c,
1153 10),
1154 ObmcSubpelVarianceParams(4, 4, &aom_highbd_10_obmc_sub_pixel_variance16x16_c,
1155 10),
1156 ObmcSubpelVarianceParams(4, 3, &aom_highbd_10_obmc_sub_pixel_variance16x8_c,
1157 10),
1158 ObmcSubpelVarianceParams(3, 4, &aom_highbd_10_obmc_sub_pixel_variance8x16_c,
1159 10),
1160 ObmcSubpelVarianceParams(3, 3, &aom_highbd_10_obmc_sub_pixel_variance8x8_c,
1161 10),
1162 ObmcSubpelVarianceParams(3, 2, &aom_highbd_10_obmc_sub_pixel_variance8x4_c,
1163 10),
1164 ObmcSubpelVarianceParams(2, 3, &aom_highbd_10_obmc_sub_pixel_variance4x8_c,
1165 10),
1166 ObmcSubpelVarianceParams(2, 2, &aom_highbd_10_obmc_sub_pixel_variance4x4_c,
1167 10),
1168 ObmcSubpelVarianceParams(7, 7,
1169 &aom_highbd_12_obmc_sub_pixel_variance128x128_c, 12),
1170 ObmcSubpelVarianceParams(7, 6, &aom_highbd_12_obmc_sub_pixel_variance128x64_c,
1171 12),
1172 ObmcSubpelVarianceParams(6, 7, &aom_highbd_12_obmc_sub_pixel_variance64x128_c,
1173 12),
1174 ObmcSubpelVarianceParams(6, 6, &aom_highbd_12_obmc_sub_pixel_variance64x64_c,
1175 12),
1176 ObmcSubpelVarianceParams(6, 5, &aom_highbd_12_obmc_sub_pixel_variance64x32_c,
1177 12),
1178 ObmcSubpelVarianceParams(5, 6, &aom_highbd_12_obmc_sub_pixel_variance32x64_c,
1179 12),
1180 ObmcSubpelVarianceParams(5, 5, &aom_highbd_12_obmc_sub_pixel_variance32x32_c,
1181 12),
1182 ObmcSubpelVarianceParams(5, 4, &aom_highbd_12_obmc_sub_pixel_variance32x16_c,
1183 12),
1184 ObmcSubpelVarianceParams(4, 5, &aom_highbd_12_obmc_sub_pixel_variance16x32_c,
1185 12),
1186 ObmcSubpelVarianceParams(4, 4, &aom_highbd_12_obmc_sub_pixel_variance16x16_c,
1187 12),
1188 ObmcSubpelVarianceParams(4, 3, &aom_highbd_12_obmc_sub_pixel_variance16x8_c,
1189 12),
1190 ObmcSubpelVarianceParams(3, 4, &aom_highbd_12_obmc_sub_pixel_variance8x16_c,
1191 12),
1192 ObmcSubpelVarianceParams(3, 3, &aom_highbd_12_obmc_sub_pixel_variance8x8_c,
1193 12),
1194 ObmcSubpelVarianceParams(3, 2, &aom_highbd_12_obmc_sub_pixel_variance8x4_c,
1195 12),
1196 ObmcSubpelVarianceParams(2, 3, &aom_highbd_12_obmc_sub_pixel_variance4x8_c,
1197 12),
1198 ObmcSubpelVarianceParams(2, 2, &aom_highbd_12_obmc_sub_pixel_variance4x4_c,
Debargha Mukherjee90f256f2019-07-16 21:02:16 -07001199 12),
1200
1201 ObmcSubpelVarianceParams(6, 4, &aom_highbd_obmc_sub_pixel_variance64x16_c, 8),
1202 ObmcSubpelVarianceParams(4, 6, &aom_highbd_obmc_sub_pixel_variance16x64_c, 8),
1203 ObmcSubpelVarianceParams(5, 3, &aom_highbd_obmc_sub_pixel_variance32x8_c, 8),
1204 ObmcSubpelVarianceParams(3, 5, &aom_highbd_obmc_sub_pixel_variance8x32_c, 8),
1205 ObmcSubpelVarianceParams(4, 2, &aom_highbd_obmc_sub_pixel_variance16x4_c, 8),
1206 ObmcSubpelVarianceParams(2, 4, &aom_highbd_obmc_sub_pixel_variance4x16_c, 8),
1207 ObmcSubpelVarianceParams(6, 4, &aom_highbd_10_obmc_sub_pixel_variance64x16_c,
1208 10),
1209 ObmcSubpelVarianceParams(4, 6, &aom_highbd_10_obmc_sub_pixel_variance16x64_c,
1210 10),
1211 ObmcSubpelVarianceParams(5, 3, &aom_highbd_10_obmc_sub_pixel_variance32x8_c,
1212 10),
1213 ObmcSubpelVarianceParams(3, 5, &aom_highbd_10_obmc_sub_pixel_variance8x32_c,
1214 10),
1215 ObmcSubpelVarianceParams(4, 2, &aom_highbd_10_obmc_sub_pixel_variance16x4_c,
1216 10),
1217 ObmcSubpelVarianceParams(2, 4, &aom_highbd_10_obmc_sub_pixel_variance4x16_c,
1218 10),
1219 ObmcSubpelVarianceParams(6, 4, &aom_highbd_12_obmc_sub_pixel_variance64x16_c,
1220 12),
1221 ObmcSubpelVarianceParams(4, 6, &aom_highbd_12_obmc_sub_pixel_variance16x64_c,
1222 12),
1223 ObmcSubpelVarianceParams(5, 3, &aom_highbd_12_obmc_sub_pixel_variance32x8_c,
1224 12),
1225 ObmcSubpelVarianceParams(3, 5, &aom_highbd_12_obmc_sub_pixel_variance8x32_c,
1226 12),
1227 ObmcSubpelVarianceParams(4, 2, &aom_highbd_12_obmc_sub_pixel_variance16x4_c,
1228 12),
1229 ObmcSubpelVarianceParams(2, 4, &aom_highbd_12_obmc_sub_pixel_variance4x16_c,
1230 12),
Kyle Siefring6042d902018-06-12 00:33:17 -04001231};
Cheng Chen96786fe2020-02-14 17:28:25 -08001232INSTANTIATE_TEST_SUITE_P(C, AvxHBDObmcSubpelVarianceTest,
1233 ::testing::ValuesIn(kArrayHBDObmcSubpelVariance_c));
Kyle Siefring6042d902018-06-12 00:33:17 -04001234
Johannc3bdffb2015-05-15 11:52:03 -07001235#if HAVE_SSE2
Satish Kumar Sumanda29bc32020-05-18 13:50:58 +05301236INSTANTIATE_TEST_SUITE_P(
Satish Kumar Suman154af702020-05-21 12:35:29 +05301237 SSE2, MseHBDWxHTest,
1238 ::testing::Values(MseHBDWxHParams(3, 3, &aom_mse_wxh_16bit_highbd_sse2, 10),
1239 MseHBDWxHParams(3, 2, &aom_mse_wxh_16bit_highbd_sse2, 10),
1240 MseHBDWxHParams(2, 3, &aom_mse_wxh_16bit_highbd_sse2, 10),
1241 MseHBDWxHParams(2, 2, &aom_mse_wxh_16bit_highbd_sse2,
1242 10)));
James Almer857e93f2022-05-25 16:44:43 +00001243
Yaowu Xud3e7c682017-12-21 14:08:25 -08001244#if HAVE_SSE4_1
Cheng Chen96786fe2020-02-14 17:28:25 -08001245INSTANTIATE_TEST_SUITE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001246 SSE4_1, AvxSubpelVarianceTest,
Yi Luoc2496892016-04-08 11:16:30 -07001247 ::testing::Values(
James Zernd598f042017-06-20 23:34:05 -07001248 SubpelVarianceParams(2, 2, &aom_highbd_8_sub_pixel_variance4x4_sse4_1,
1249 8),
1250 SubpelVarianceParams(2, 2, &aom_highbd_10_sub_pixel_variance4x4_sse4_1,
1251 10),
1252 SubpelVarianceParams(2, 2, &aom_highbd_12_sub_pixel_variance4x4_sse4_1,
1253 12)));
Yi Luoc2496892016-04-08 11:16:30 -07001254
Cheng Chen96786fe2020-02-14 17:28:25 -08001255INSTANTIATE_TEST_SUITE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001256 SSE4_1, AvxSubpelAvgVarianceTest,
Yi Luoc2496892016-04-08 11:16:30 -07001257 ::testing::Values(
James Zernd598f042017-06-20 23:34:05 -07001258 SubpelAvgVarianceParams(2, 2,
1259 &aom_highbd_8_sub_pixel_avg_variance4x4_sse4_1,
1260 8),
1261 SubpelAvgVarianceParams(2, 2,
1262 &aom_highbd_10_sub_pixel_avg_variance4x4_sse4_1,
1263 10),
1264 SubpelAvgVarianceParams(2, 2,
1265 &aom_highbd_12_sub_pixel_avg_variance4x4_sse4_1,
1266 12)));
Yaowu Xud3e7c682017-12-21 14:08:25 -08001267#endif // HAVE_SSE4_1
Yi Luoc2496892016-04-08 11:16:30 -07001268
Johannc3bdffb2015-05-15 11:52:03 -07001269/* TODO(debargha): This test does not support the highbd version
Cheng Chen96786fe2020-02-14 17:28:25 -08001270INSTANTIATE_TEST_SUITE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001271 SSE2, AvxHBDMseTest,
1272 ::testing::Values(MseParams(4, 4, &aom_highbd_12_mse16x16_sse2),
1273 MseParams(4, 3, &aom_highbd_12_mse16x8_sse2),
1274 MseParams(3, 4, &aom_highbd_12_mse8x16_sse2),
1275 MseParams(3, 3, &aom_highbd_12_mse8x8_sse2),
1276 MseParams(4, 4, &aom_highbd_10_mse16x16_sse2),
1277 MseParams(4, 3, &aom_highbd_10_mse16x8_sse2),
1278 MseParams(3, 4, &aom_highbd_10_mse8x16_sse2),
1279 MseParams(3, 3, &aom_highbd_10_mse8x8_sse2),
1280 MseParams(4, 4, &aom_highbd_8_mse16x16_sse2),
1281 MseParams(4, 3, &aom_highbd_8_mse16x8_sse2),
1282 MseParams(3, 4, &aom_highbd_8_mse8x16_sse2),
1283 MseParams(3, 3, &aom_highbd_8_mse8x8_sse2)));
Johannc3bdffb2015-05-15 11:52:03 -07001284*/
1285
Wan-Teh Chang7c01d222018-09-04 15:09:42 -07001286const VarianceParams kArrayHBDVariance_sse2[] = {
1287 VarianceParams(7, 7, &aom_highbd_12_variance128x128_sse2, 12),
1288 VarianceParams(7, 6, &aom_highbd_12_variance128x64_sse2, 12),
1289 VarianceParams(6, 7, &aom_highbd_12_variance64x128_sse2, 12),
1290 VarianceParams(6, 6, &aom_highbd_12_variance64x64_sse2, 12),
1291 VarianceParams(6, 5, &aom_highbd_12_variance64x32_sse2, 12),
1292 VarianceParams(5, 6, &aom_highbd_12_variance32x64_sse2, 12),
1293 VarianceParams(5, 5, &aom_highbd_12_variance32x32_sse2, 12),
1294 VarianceParams(5, 4, &aom_highbd_12_variance32x16_sse2, 12),
1295 VarianceParams(4, 5, &aom_highbd_12_variance16x32_sse2, 12),
1296 VarianceParams(4, 4, &aom_highbd_12_variance16x16_sse2, 12),
1297 VarianceParams(4, 3, &aom_highbd_12_variance16x8_sse2, 12),
1298 VarianceParams(3, 4, &aom_highbd_12_variance8x16_sse2, 12),
1299 VarianceParams(3, 3, &aom_highbd_12_variance8x8_sse2, 12),
1300 VarianceParams(7, 7, &aom_highbd_10_variance128x128_sse2, 10),
1301 VarianceParams(7, 6, &aom_highbd_10_variance128x64_sse2, 10),
1302 VarianceParams(6, 7, &aom_highbd_10_variance64x128_sse2, 10),
1303 VarianceParams(6, 6, &aom_highbd_10_variance64x64_sse2, 10),
1304 VarianceParams(6, 5, &aom_highbd_10_variance64x32_sse2, 10),
1305 VarianceParams(5, 6, &aom_highbd_10_variance32x64_sse2, 10),
1306 VarianceParams(5, 5, &aom_highbd_10_variance32x32_sse2, 10),
1307 VarianceParams(5, 4, &aom_highbd_10_variance32x16_sse2, 10),
1308 VarianceParams(4, 5, &aom_highbd_10_variance16x32_sse2, 10),
1309 VarianceParams(4, 4, &aom_highbd_10_variance16x16_sse2, 10),
1310 VarianceParams(4, 3, &aom_highbd_10_variance16x8_sse2, 10),
1311 VarianceParams(3, 4, &aom_highbd_10_variance8x16_sse2, 10),
1312 VarianceParams(3, 3, &aom_highbd_10_variance8x8_sse2, 10),
1313 VarianceParams(7, 7, &aom_highbd_8_variance128x128_sse2, 8),
1314 VarianceParams(7, 6, &aom_highbd_8_variance128x64_sse2, 8),
1315 VarianceParams(6, 7, &aom_highbd_8_variance64x128_sse2, 8),
1316 VarianceParams(6, 6, &aom_highbd_8_variance64x64_sse2, 8),
1317 VarianceParams(6, 5, &aom_highbd_8_variance64x32_sse2, 8),
1318 VarianceParams(5, 6, &aom_highbd_8_variance32x64_sse2, 8),
1319 VarianceParams(5, 5, &aom_highbd_8_variance32x32_sse2, 8),
1320 VarianceParams(5, 4, &aom_highbd_8_variance32x16_sse2, 8),
1321 VarianceParams(4, 5, &aom_highbd_8_variance16x32_sse2, 8),
1322 VarianceParams(4, 4, &aom_highbd_8_variance16x16_sse2, 8),
1323 VarianceParams(4, 3, &aom_highbd_8_variance16x8_sse2, 8),
1324 VarianceParams(3, 4, &aom_highbd_8_variance8x16_sse2, 8),
Debargha Mukherjee90f256f2019-07-16 21:02:16 -07001325 VarianceParams(3, 3, &aom_highbd_8_variance8x8_sse2, 8),
1326
1327 VarianceParams(6, 4, &aom_highbd_12_variance64x16_sse2, 12),
1328 VarianceParams(4, 6, &aom_highbd_12_variance16x64_sse2, 12),
1329 VarianceParams(5, 3, &aom_highbd_12_variance32x8_sse2, 12),
1330 VarianceParams(3, 5, &aom_highbd_12_variance8x32_sse2, 12),
1331 // VarianceParams(4, 2, &aom_highbd_12_variance16x4_sse2, 12),
1332 // VarianceParams(2, 4, &aom_highbd_12_variance4x16_sse2, 12),
1333 VarianceParams(6, 4, &aom_highbd_10_variance64x16_sse2, 10),
1334 VarianceParams(4, 6, &aom_highbd_10_variance16x64_sse2, 10),
1335 VarianceParams(5, 3, &aom_highbd_10_variance32x8_sse2, 10),
1336 VarianceParams(3, 5, &aom_highbd_10_variance8x32_sse2, 10),
1337 // VarianceParams(4, 2, &aom_highbd_10_variance16x4_sse2, 10),
1338 // VarianceParams(2, 4, &aom_highbd_10_variance4x16_sse2, 10),
1339 VarianceParams(6, 4, &aom_highbd_8_variance64x16_sse2, 8),
1340 VarianceParams(4, 6, &aom_highbd_8_variance16x64_sse2, 8),
1341 VarianceParams(5, 3, &aom_highbd_8_variance32x8_sse2, 8),
1342 VarianceParams(3, 5, &aom_highbd_8_variance8x32_sse2, 8),
1343 // VarianceParams(4, 2, &aom_highbd_8_variance16x4_sse2, 8),
1344 // VarianceParams(2, 4, &aom_highbd_8_variance4x16_sse2, 8),
Wan-Teh Chang7c01d222018-09-04 15:09:42 -07001345};
Cheng Chen96786fe2020-02-14 17:28:25 -08001346INSTANTIATE_TEST_SUITE_P(SSE2, AvxHBDVarianceTest,
1347 ::testing::ValuesIn(kArrayHBDVariance_sse2));
Johannc3bdffb2015-05-15 11:52:03 -07001348
Sachin Kumar Gargf2b7da02018-09-06 17:40:49 +05301349#if HAVE_AVX2
1350
Satish Kumar Suman217ac1c2020-05-19 14:37:35 +05301351INSTANTIATE_TEST_SUITE_P(
1352 AVX2, MseHBDWxHTest,
1353 ::testing::Values(MseHBDWxHParams(3, 3, &aom_mse_wxh_16bit_highbd_avx2, 10),
1354 MseHBDWxHParams(3, 2, &aom_mse_wxh_16bit_highbd_avx2, 10),
1355 MseHBDWxHParams(2, 3, &aom_mse_wxh_16bit_highbd_avx2, 10),
1356 MseHBDWxHParams(2, 2, &aom_mse_wxh_16bit_highbd_avx2,
1357 10)));
1358
Sachin Kumar Gargf2b7da02018-09-06 17:40:49 +05301359const VarianceParams kArrayHBDVariance_avx2[] = {
1360 VarianceParams(7, 7, &aom_highbd_10_variance128x128_avx2, 10),
1361 VarianceParams(7, 6, &aom_highbd_10_variance128x64_avx2, 10),
1362 VarianceParams(6, 7, &aom_highbd_10_variance64x128_avx2, 10),
1363 VarianceParams(6, 6, &aom_highbd_10_variance64x64_avx2, 10),
1364 VarianceParams(6, 5, &aom_highbd_10_variance64x32_avx2, 10),
1365 VarianceParams(5, 6, &aom_highbd_10_variance32x64_avx2, 10),
1366 VarianceParams(5, 5, &aom_highbd_10_variance32x32_avx2, 10),
1367 VarianceParams(5, 4, &aom_highbd_10_variance32x16_avx2, 10),
1368 VarianceParams(4, 5, &aom_highbd_10_variance16x32_avx2, 10),
1369 VarianceParams(4, 4, &aom_highbd_10_variance16x16_avx2, 10),
1370 VarianceParams(4, 3, &aom_highbd_10_variance16x8_avx2, 10),
1371 VarianceParams(3, 4, &aom_highbd_10_variance8x16_avx2, 10),
Debargha Mukherjee90f256f2019-07-16 21:02:16 -07001372 VarianceParams(3, 3, &aom_highbd_10_variance8x8_avx2, 10),
Sachin Kumar Gargf2b7da02018-09-06 17:40:49 +05301373};
1374
Cheng Chen96786fe2020-02-14 17:28:25 -08001375INSTANTIATE_TEST_SUITE_P(AVX2, AvxHBDVarianceTest,
1376 ::testing::ValuesIn(kArrayHBDVariance_avx2));
Krishna Malladi0bf50f82020-03-05 12:38:24 -08001377
1378const SubpelVarianceParams kArrayHBDSubpelVariance_avx2[] = {
1379 SubpelVarianceParams(7, 7, &aom_highbd_10_sub_pixel_variance128x128_avx2, 10),
1380 SubpelVarianceParams(7, 6, &aom_highbd_10_sub_pixel_variance128x64_avx2, 10),
1381 SubpelVarianceParams(6, 7, &aom_highbd_10_sub_pixel_variance64x128_avx2, 10),
1382 SubpelVarianceParams(6, 6, &aom_highbd_10_sub_pixel_variance64x64_avx2, 10),
1383 SubpelVarianceParams(6, 5, &aom_highbd_10_sub_pixel_variance64x32_avx2, 10),
1384 SubpelVarianceParams(5, 6, &aom_highbd_10_sub_pixel_variance32x64_avx2, 10),
1385 SubpelVarianceParams(5, 5, &aom_highbd_10_sub_pixel_variance32x32_avx2, 10),
1386 SubpelVarianceParams(5, 4, &aom_highbd_10_sub_pixel_variance32x16_avx2, 10),
1387 SubpelVarianceParams(4, 5, &aom_highbd_10_sub_pixel_variance16x32_avx2, 10),
1388 SubpelVarianceParams(4, 4, &aom_highbd_10_sub_pixel_variance16x16_avx2, 10),
1389 SubpelVarianceParams(4, 3, &aom_highbd_10_sub_pixel_variance16x8_avx2, 10),
Krishna Malladi3f426362020-07-08 10:50:16 -07001390 SubpelVarianceParams(3, 4, &aom_highbd_10_sub_pixel_variance8x16_avx2, 10),
1391 SubpelVarianceParams(3, 3, &aom_highbd_10_sub_pixel_variance8x8_avx2, 10),
Krishna Malladi0bf50f82020-03-05 12:38:24 -08001392};
1393
1394INSTANTIATE_TEST_SUITE_P(AVX2, AvxHBDSubpelVarianceTest,
1395 ::testing::ValuesIn(kArrayHBDSubpelVariance_avx2));
Sachin Kumar Gargf2b7da02018-09-06 17:40:49 +05301396#endif // HAVE_AVX2
1397
James Zernd598f042017-06-20 23:34:05 -07001398const SubpelVarianceParams kArrayHBDSubpelVariance_sse2[] = {
Aniket Dhoke9802812019-02-13 16:42:22 +05301399 SubpelVarianceParams(7, 7, &aom_highbd_12_sub_pixel_variance128x128_sse2, 12),
1400 SubpelVarianceParams(7, 6, &aom_highbd_12_sub_pixel_variance128x64_sse2, 12),
1401 SubpelVarianceParams(6, 7, &aom_highbd_12_sub_pixel_variance64x128_sse2, 12),
James Zernd598f042017-06-20 23:34:05 -07001402 SubpelVarianceParams(6, 6, &aom_highbd_12_sub_pixel_variance64x64_sse2, 12),
1403 SubpelVarianceParams(6, 5, &aom_highbd_12_sub_pixel_variance64x32_sse2, 12),
1404 SubpelVarianceParams(5, 6, &aom_highbd_12_sub_pixel_variance32x64_sse2, 12),
1405 SubpelVarianceParams(5, 5, &aom_highbd_12_sub_pixel_variance32x32_sse2, 12),
1406 SubpelVarianceParams(5, 4, &aom_highbd_12_sub_pixel_variance32x16_sse2, 12),
1407 SubpelVarianceParams(4, 5, &aom_highbd_12_sub_pixel_variance16x32_sse2, 12),
1408 SubpelVarianceParams(4, 4, &aom_highbd_12_sub_pixel_variance16x16_sse2, 12),
1409 SubpelVarianceParams(4, 3, &aom_highbd_12_sub_pixel_variance16x8_sse2, 12),
1410 SubpelVarianceParams(3, 4, &aom_highbd_12_sub_pixel_variance8x16_sse2, 12),
1411 SubpelVarianceParams(3, 3, &aom_highbd_12_sub_pixel_variance8x8_sse2, 12),
1412 SubpelVarianceParams(3, 2, &aom_highbd_12_sub_pixel_variance8x4_sse2, 12),
Aniket Dhoke9802812019-02-13 16:42:22 +05301413 SubpelVarianceParams(7, 7, &aom_highbd_10_sub_pixel_variance128x128_sse2, 10),
1414 SubpelVarianceParams(7, 6, &aom_highbd_10_sub_pixel_variance128x64_sse2, 10),
1415 SubpelVarianceParams(6, 7, &aom_highbd_10_sub_pixel_variance64x128_sse2, 10),
James Zernd598f042017-06-20 23:34:05 -07001416 SubpelVarianceParams(6, 6, &aom_highbd_10_sub_pixel_variance64x64_sse2, 10),
1417 SubpelVarianceParams(6, 5, &aom_highbd_10_sub_pixel_variance64x32_sse2, 10),
1418 SubpelVarianceParams(5, 6, &aom_highbd_10_sub_pixel_variance32x64_sse2, 10),
1419 SubpelVarianceParams(5, 5, &aom_highbd_10_sub_pixel_variance32x32_sse2, 10),
1420 SubpelVarianceParams(5, 4, &aom_highbd_10_sub_pixel_variance32x16_sse2, 10),
1421 SubpelVarianceParams(4, 5, &aom_highbd_10_sub_pixel_variance16x32_sse2, 10),
1422 SubpelVarianceParams(4, 4, &aom_highbd_10_sub_pixel_variance16x16_sse2, 10),
1423 SubpelVarianceParams(4, 3, &aom_highbd_10_sub_pixel_variance16x8_sse2, 10),
1424 SubpelVarianceParams(3, 4, &aom_highbd_10_sub_pixel_variance8x16_sse2, 10),
1425 SubpelVarianceParams(3, 3, &aom_highbd_10_sub_pixel_variance8x8_sse2, 10),
1426 SubpelVarianceParams(3, 2, &aom_highbd_10_sub_pixel_variance8x4_sse2, 10),
Aniket Dhoke9802812019-02-13 16:42:22 +05301427 SubpelVarianceParams(7, 7, &aom_highbd_8_sub_pixel_variance128x128_sse2, 8),
1428 SubpelVarianceParams(7, 6, &aom_highbd_8_sub_pixel_variance128x64_sse2, 8),
1429 SubpelVarianceParams(6, 7, &aom_highbd_8_sub_pixel_variance64x128_sse2, 8),
James Zernd598f042017-06-20 23:34:05 -07001430 SubpelVarianceParams(6, 6, &aom_highbd_8_sub_pixel_variance64x64_sse2, 8),
1431 SubpelVarianceParams(6, 5, &aom_highbd_8_sub_pixel_variance64x32_sse2, 8),
1432 SubpelVarianceParams(5, 6, &aom_highbd_8_sub_pixel_variance32x64_sse2, 8),
1433 SubpelVarianceParams(5, 5, &aom_highbd_8_sub_pixel_variance32x32_sse2, 8),
1434 SubpelVarianceParams(5, 4, &aom_highbd_8_sub_pixel_variance32x16_sse2, 8),
1435 SubpelVarianceParams(4, 5, &aom_highbd_8_sub_pixel_variance16x32_sse2, 8),
1436 SubpelVarianceParams(4, 4, &aom_highbd_8_sub_pixel_variance16x16_sse2, 8),
1437 SubpelVarianceParams(4, 3, &aom_highbd_8_sub_pixel_variance16x8_sse2, 8),
1438 SubpelVarianceParams(3, 4, &aom_highbd_8_sub_pixel_variance8x16_sse2, 8),
1439 SubpelVarianceParams(3, 3, &aom_highbd_8_sub_pixel_variance8x8_sse2, 8),
Debargha Mukherjee90f256f2019-07-16 21:02:16 -07001440 SubpelVarianceParams(3, 2, &aom_highbd_8_sub_pixel_variance8x4_sse2, 8),
1441
1442 SubpelVarianceParams(6, 4, &aom_highbd_12_sub_pixel_variance64x16_sse2, 12),
1443 SubpelVarianceParams(4, 6, &aom_highbd_12_sub_pixel_variance16x64_sse2, 12),
1444 SubpelVarianceParams(5, 3, &aom_highbd_12_sub_pixel_variance32x8_sse2, 12),
1445 SubpelVarianceParams(3, 5, &aom_highbd_12_sub_pixel_variance8x32_sse2, 12),
1446 SubpelVarianceParams(4, 2, &aom_highbd_12_sub_pixel_variance16x4_sse2, 12),
1447 // SubpelVarianceParams(2, 4, &aom_highbd_12_sub_pixel_variance4x16_sse2, 12),
1448 SubpelVarianceParams(6, 4, &aom_highbd_10_sub_pixel_variance64x16_sse2, 10),
1449 SubpelVarianceParams(4, 6, &aom_highbd_10_sub_pixel_variance16x64_sse2, 10),
1450 SubpelVarianceParams(5, 3, &aom_highbd_10_sub_pixel_variance32x8_sse2, 10),
1451 SubpelVarianceParams(3, 5, &aom_highbd_10_sub_pixel_variance8x32_sse2, 10),
1452 SubpelVarianceParams(4, 2, &aom_highbd_10_sub_pixel_variance16x4_sse2, 10),
1453 // SubpelVarianceParams(2, 4, &aom_highbd_10_sub_pixel_variance4x16_sse2, 10),
1454 SubpelVarianceParams(6, 4, &aom_highbd_8_sub_pixel_variance64x16_sse2, 8),
1455 SubpelVarianceParams(4, 6, &aom_highbd_8_sub_pixel_variance16x64_sse2, 8),
1456 SubpelVarianceParams(5, 3, &aom_highbd_8_sub_pixel_variance32x8_sse2, 8),
1457 SubpelVarianceParams(3, 5, &aom_highbd_8_sub_pixel_variance8x32_sse2, 8),
1458 SubpelVarianceParams(4, 2, &aom_highbd_8_sub_pixel_variance16x4_sse2, 8),
1459 // SubpelVarianceParams(2, 4, &aom_highbd_8_sub_pixel_variance4x16_sse2, 8),
James Zerna9b275f2017-06-20 22:59:23 -07001460};
Cheng Chen96786fe2020-02-14 17:28:25 -08001461INSTANTIATE_TEST_SUITE_P(SSE2, AvxHBDSubpelVarianceTest,
1462 ::testing::ValuesIn(kArrayHBDSubpelVariance_sse2));
James Zerna9b275f2017-06-20 22:59:23 -07001463
James Zernd598f042017-06-20 23:34:05 -07001464const SubpelAvgVarianceParams kArrayHBDSubpelAvgVariance_sse2[] = {
1465 SubpelAvgVarianceParams(6, 6, &aom_highbd_12_sub_pixel_avg_variance64x64_sse2,
1466 12),
1467 SubpelAvgVarianceParams(6, 5, &aom_highbd_12_sub_pixel_avg_variance64x32_sse2,
1468 12),
1469 SubpelAvgVarianceParams(5, 6, &aom_highbd_12_sub_pixel_avg_variance32x64_sse2,
1470 12),
1471 SubpelAvgVarianceParams(5, 5, &aom_highbd_12_sub_pixel_avg_variance32x32_sse2,
1472 12),
1473 SubpelAvgVarianceParams(5, 4, &aom_highbd_12_sub_pixel_avg_variance32x16_sse2,
1474 12),
1475 SubpelAvgVarianceParams(4, 5, &aom_highbd_12_sub_pixel_avg_variance16x32_sse2,
1476 12),
1477 SubpelAvgVarianceParams(4, 4, &aom_highbd_12_sub_pixel_avg_variance16x16_sse2,
1478 12),
1479 SubpelAvgVarianceParams(4, 3, &aom_highbd_12_sub_pixel_avg_variance16x8_sse2,
1480 12),
1481 SubpelAvgVarianceParams(3, 4, &aom_highbd_12_sub_pixel_avg_variance8x16_sse2,
1482 12),
1483 SubpelAvgVarianceParams(3, 3, &aom_highbd_12_sub_pixel_avg_variance8x8_sse2,
1484 12),
1485 SubpelAvgVarianceParams(3, 2, &aom_highbd_12_sub_pixel_avg_variance8x4_sse2,
1486 12),
1487 SubpelAvgVarianceParams(6, 6, &aom_highbd_10_sub_pixel_avg_variance64x64_sse2,
1488 10),
1489 SubpelAvgVarianceParams(6, 5, &aom_highbd_10_sub_pixel_avg_variance64x32_sse2,
1490 10),
1491 SubpelAvgVarianceParams(5, 6, &aom_highbd_10_sub_pixel_avg_variance32x64_sse2,
1492 10),
1493 SubpelAvgVarianceParams(5, 5, &aom_highbd_10_sub_pixel_avg_variance32x32_sse2,
1494 10),
1495 SubpelAvgVarianceParams(5, 4, &aom_highbd_10_sub_pixel_avg_variance32x16_sse2,
1496 10),
1497 SubpelAvgVarianceParams(4, 5, &aom_highbd_10_sub_pixel_avg_variance16x32_sse2,
1498 10),
1499 SubpelAvgVarianceParams(4, 4, &aom_highbd_10_sub_pixel_avg_variance16x16_sse2,
1500 10),
1501 SubpelAvgVarianceParams(4, 3, &aom_highbd_10_sub_pixel_avg_variance16x8_sse2,
1502 10),
1503 SubpelAvgVarianceParams(3, 4, &aom_highbd_10_sub_pixel_avg_variance8x16_sse2,
1504 10),
1505 SubpelAvgVarianceParams(3, 3, &aom_highbd_10_sub_pixel_avg_variance8x8_sse2,
1506 10),
1507 SubpelAvgVarianceParams(3, 2, &aom_highbd_10_sub_pixel_avg_variance8x4_sse2,
1508 10),
1509 SubpelAvgVarianceParams(6, 6, &aom_highbd_8_sub_pixel_avg_variance64x64_sse2,
1510 8),
1511 SubpelAvgVarianceParams(6, 5, &aom_highbd_8_sub_pixel_avg_variance64x32_sse2,
1512 8),
1513 SubpelAvgVarianceParams(5, 6, &aom_highbd_8_sub_pixel_avg_variance32x64_sse2,
1514 8),
1515 SubpelAvgVarianceParams(5, 5, &aom_highbd_8_sub_pixel_avg_variance32x32_sse2,
1516 8),
1517 SubpelAvgVarianceParams(5, 4, &aom_highbd_8_sub_pixel_avg_variance32x16_sse2,
1518 8),
1519 SubpelAvgVarianceParams(4, 5, &aom_highbd_8_sub_pixel_avg_variance16x32_sse2,
1520 8),
1521 SubpelAvgVarianceParams(4, 4, &aom_highbd_8_sub_pixel_avg_variance16x16_sse2,
1522 8),
1523 SubpelAvgVarianceParams(4, 3, &aom_highbd_8_sub_pixel_avg_variance16x8_sse2,
1524 8),
1525 SubpelAvgVarianceParams(3, 4, &aom_highbd_8_sub_pixel_avg_variance8x16_sse2,
1526 8),
1527 SubpelAvgVarianceParams(3, 3, &aom_highbd_8_sub_pixel_avg_variance8x8_sse2,
1528 8),
Debargha Mukherjee90f256f2019-07-16 21:02:16 -07001529 SubpelAvgVarianceParams(3, 2, &aom_highbd_8_sub_pixel_avg_variance8x4_sse2,
1530 8),
1531
1532 SubpelAvgVarianceParams(6, 4, &aom_highbd_12_sub_pixel_avg_variance64x16_sse2,
1533 12),
1534 SubpelAvgVarianceParams(4, 6, &aom_highbd_12_sub_pixel_avg_variance16x64_sse2,
1535 12),
1536 SubpelAvgVarianceParams(5, 3, &aom_highbd_12_sub_pixel_avg_variance32x8_sse2,
1537 12),
1538 SubpelAvgVarianceParams(3, 5, &aom_highbd_12_sub_pixel_avg_variance8x32_sse2,
1539 12),
1540 SubpelAvgVarianceParams(4, 2, &aom_highbd_12_sub_pixel_avg_variance16x4_sse2,
1541 12),
1542 // SubpelAvgVarianceParams(2, 4,
1543 // &aom_highbd_12_sub_pixel_avg_variance4x16_sse2, 12),
1544 SubpelAvgVarianceParams(6, 4, &aom_highbd_10_sub_pixel_avg_variance64x16_sse2,
1545 10),
1546 SubpelAvgVarianceParams(4, 6, &aom_highbd_10_sub_pixel_avg_variance16x64_sse2,
1547 10),
1548 SubpelAvgVarianceParams(5, 3, &aom_highbd_10_sub_pixel_avg_variance32x8_sse2,
1549 10),
1550 SubpelAvgVarianceParams(3, 5, &aom_highbd_10_sub_pixel_avg_variance8x32_sse2,
1551 10),
1552 SubpelAvgVarianceParams(4, 2, &aom_highbd_10_sub_pixel_avg_variance16x4_sse2,
1553 10),
1554 // SubpelAvgVarianceParams(2, 4,
1555 // &aom_highbd_10_sub_pixel_avg_variance4x16_sse2, 10),
1556 SubpelAvgVarianceParams(6, 4, &aom_highbd_8_sub_pixel_avg_variance64x16_sse2,
1557 8),
1558 SubpelAvgVarianceParams(4, 6, &aom_highbd_8_sub_pixel_avg_variance16x64_sse2,
1559 8),
1560 SubpelAvgVarianceParams(5, 3, &aom_highbd_8_sub_pixel_avg_variance32x8_sse2,
1561 8),
1562 SubpelAvgVarianceParams(3, 5, &aom_highbd_8_sub_pixel_avg_variance8x32_sse2,
1563 8),
1564 SubpelAvgVarianceParams(4, 2, &aom_highbd_8_sub_pixel_avg_variance16x4_sse2,
1565 8),
1566 // SubpelAvgVarianceParams(2, 4,
1567 // &aom_highbd_8_sub_pixel_avg_variance4x16_sse2, 8),
James Zernd598f042017-06-20 23:34:05 -07001568};
James Zerna9b275f2017-06-20 22:59:23 -07001569
Cheng Chen96786fe2020-02-14 17:28:25 -08001570INSTANTIATE_TEST_SUITE_P(SSE2, AvxHBDSubpelAvgVarianceTest,
1571 ::testing::ValuesIn(kArrayHBDSubpelAvgVariance_sse2));
Peter de Rivaz48032bf2014-10-16 14:00:54 +01001572#endif // HAVE_SSE2
James Zern98473442012-11-06 16:58:11 -08001573} // namespace