blob: 7848e20f323dc6fcfe47c902345ec0ac8aa0f771 [file] [log] [blame]
James Zern98473442012-11-06 16:58:11 -08001/*
Yaowu Xu2ab7ff02016-09-02 12:04:54 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
James Zern98473442012-11-06 16:58:11 -08003 *
Yaowu Xu2ab7ff02016-09-02 12:04:54 -07004 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 * Media Patent License 1.0 was not distributed with this source code in the
9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10*/
Peter de Rivaz48032bf2014-10-16 14:00:54 +010011
12#include <cstdlib>
James Zern98473442012-11-06 16:58:11 -080013#include <new>
14
Peter de Rivaz48032bf2014-10-16 14:00:54 +010015#include "third_party/googletest/src/include/gtest/gtest.h"
James Zern5b756742013-06-17 22:58:40 -070016
Yaowu Xuf883b422016-08-30 14:01:10 -070017#include "./aom_config.h"
18#include "./aom_dsp_rtcd.h"
Jingning Han097d59c2015-07-29 14:51:36 -070019#include "test/acm_random.h"
20#include "test/clear_system_state.h"
21#include "test/register_state_check.h"
Yaowu Xuf883b422016-08-30 14:01:10 -070022#include "aom/aom_codec.h"
23#include "aom/aom_integer.h"
24#include "aom_mem/aom_mem.h"
Yaowu Xuc27fc142016-08-22 16:08:15 -070025#include "aom_ports/mem.h"
James Zern98473442012-11-06 16:58:11 -080026
27namespace {
28
Johannc3bdffb2015-05-15 11:52:03 -070029typedef unsigned int (*VarianceMxNFunc)(const uint8_t *a, int a_stride,
30 const uint8_t *b, int b_stride,
31 unsigned int *sse);
Johanneb88b172015-05-26 11:30:25 -070032typedef unsigned int (*SubpixVarMxNFunc)(const uint8_t *a, int a_stride,
33 int xoffset, int yoffset,
34 const uint8_t *b, int b_stride,
35 unsigned int *sse);
Johann6a82f0d2015-06-05 09:54:19 -070036typedef unsigned int (*SubpixAvgVarMxNFunc)(const uint8_t *a, int a_stride,
37 int xoffset, int yoffset,
38 const uint8_t *b, int b_stride,
39 uint32_t *sse,
40 const uint8_t *second_pred);
Johannc5a7c892015-05-27 11:38:43 -070041typedef unsigned int (*Get4x4SseFunc)(const uint8_t *a, int a_stride,
Johannc3bdffb2015-05-15 11:52:03 -070042 const uint8_t *b, int b_stride);
Johann6a82f0d2015-06-05 09:54:19 -070043typedef unsigned int (*SumOfSquaresFunction)(const int16_t *src);
44
Yaowu Xuc27fc142016-08-22 16:08:15 -070045using libaom_test::ACMRandom;
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -070046
Johannc855ed72015-05-27 14:37:31 -070047// Truncate high bit depth results by downshifting (with rounding) by:
48// 2 * (bit_depth - 8) for sse
49// (bit_depth - 8) for se
50static void RoundHighBitDepth(int bit_depth, int64_t *se, uint64_t *sse) {
51 switch (bit_depth) {
Yaowu Xuf883b422016-08-30 14:01:10 -070052 case AOM_BITS_12:
Johannc855ed72015-05-27 14:37:31 -070053 *sse = (*sse + 128) >> 8;
54 *se = (*se + 8) >> 4;
55 break;
Yaowu Xuf883b422016-08-30 14:01:10 -070056 case AOM_BITS_10:
Johannc855ed72015-05-27 14:37:31 -070057 *sse = (*sse + 8) >> 4;
58 *se = (*se + 2) >> 2;
59 break;
Yaowu Xuf883b422016-08-30 14:01:10 -070060 case AOM_BITS_8:
skal8dbbcda2016-07-13 17:33:22 -070061 default: break;
Johannc855ed72015-05-27 14:37:31 -070062 }
63}
64
Dmitry Kovalev1f19ebb2014-09-06 00:10:25 -070065static unsigned int mb_ss_ref(const int16_t *src) {
66 unsigned int res = 0;
67 for (int i = 0; i < 256; ++i) {
68 res += src[i] * src[i];
69 }
70 return res;
71}
72
Yi Luoc3e07b22016-04-04 09:44:56 -070073/* Note:
74 * Our codebase calculates the "diff" value in the variance algorithm by
75 * (src - ref).
76 */
skal8dbbcda2016-07-13 17:33:22 -070077static uint32_t variance_ref(const uint8_t *src, const uint8_t *ref, int l2w,
78 int l2h, int src_stride, int ref_stride,
79 uint32_t *sse_ptr, bool use_high_bit_depth_,
Yaowu Xuf883b422016-08-30 14:01:10 -070080 aom_bit_depth_t bit_depth) {
Peter de Rivaz48032bf2014-10-16 14:00:54 +010081 int64_t se = 0;
82 uint64_t sse = 0;
83 const int w = 1 << l2w;
84 const int h = 1 << l2h;
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -070085 for (int y = 0; y < h; y++) {
86 for (int x = 0; x < w; x++) {
Peter de Rivaz48032bf2014-10-16 14:00:54 +010087 int diff;
88 if (!use_high_bit_depth_) {
skal8dbbcda2016-07-13 17:33:22 -070089 diff = src[y * src_stride + x] - ref[y * ref_stride + x];
Peter de Rivaz48032bf2014-10-16 14:00:54 +010090 se += diff;
91 sse += diff * diff;
Yaowu Xuf883b422016-08-30 14:01:10 -070092#if CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz48032bf2014-10-16 14:00:54 +010093 } else {
skal8dbbcda2016-07-13 17:33:22 -070094 diff = CONVERT_TO_SHORTPTR(src)[y * src_stride + x] -
95 CONVERT_TO_SHORTPTR(ref)[y * ref_stride + x];
Peter de Rivaz48032bf2014-10-16 14:00:54 +010096 se += diff;
97 sse += diff * diff;
Yaowu Xuf883b422016-08-30 14:01:10 -070098#endif // CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz48032bf2014-10-16 14:00:54 +010099 }
100 }
101 }
Johannc855ed72015-05-27 14:37:31 -0700102 RoundHighBitDepth(bit_depth, &se, &sse);
Johannd90536c2015-06-01 13:03:30 -0700103 *sse_ptr = static_cast<uint32_t>(sse);
Urvang Joshi77853e52016-07-15 12:47:01 -0700104 return static_cast<uint32_t>(sse - ((se * se) >> (l2w + l2h)));
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700105}
106
Johanneb88b172015-05-26 11:30:25 -0700107/* The subpel reference functions differ from the codec version in one aspect:
108 * they calculate the bilinear factors directly instead of using a lookup table
109 * and therefore upshift xoff and yoff by 1. Only every other calculated value
110 * is used so the codec version shrinks the table to save space and maintain
111 * compatibility with vp8.
112 */
Johannd90536c2015-06-01 13:03:30 -0700113static uint32_t subpel_variance_ref(const uint8_t *ref, const uint8_t *src,
114 int l2w, int l2h, int xoff, int yoff,
skal8dbbcda2016-07-13 17:33:22 -0700115 uint32_t *sse_ptr, bool use_high_bit_depth_,
Yaowu Xuf883b422016-08-30 14:01:10 -0700116 aom_bit_depth_t bit_depth) {
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100117 int64_t se = 0;
118 uint64_t sse = 0;
119 const int w = 1 << l2w;
120 const int h = 1 << l2h;
Johanneb88b172015-05-26 11:30:25 -0700121
122 xoff <<= 1;
123 yoff <<= 1;
124
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700125 for (int y = 0; y < h; y++) {
126 for (int x = 0; x < w; x++) {
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100127 // Bilinear interpolation at a 16th pel step.
128 if (!use_high_bit_depth_) {
129 const int a1 = ref[(w + 1) * (y + 0) + x + 0];
130 const int a2 = ref[(w + 1) * (y + 0) + x + 1];
131 const int b1 = ref[(w + 1) * (y + 1) + x + 0];
132 const int b2 = ref[(w + 1) * (y + 1) + x + 1];
133 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
134 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
135 const int r = a + (((b - a) * yoff + 8) >> 4);
136 const int diff = r - src[w * y + x];
137 se += diff;
138 sse += diff * diff;
Yaowu Xuf883b422016-08-30 14:01:10 -0700139#if CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100140 } else {
141 uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref);
142 uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
143 const int a1 = ref16[(w + 1) * (y + 0) + x + 0];
144 const int a2 = ref16[(w + 1) * (y + 0) + x + 1];
145 const int b1 = ref16[(w + 1) * (y + 1) + x + 0];
146 const int b2 = ref16[(w + 1) * (y + 1) + x + 1];
147 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
148 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
149 const int r = a + (((b - a) * yoff + 8) >> 4);
150 const int diff = r - src16[w * y + x];
151 se += diff;
152 sse += diff * diff;
Yaowu Xuf883b422016-08-30 14:01:10 -0700153#endif // CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100154 }
155 }
156 }
Johannc855ed72015-05-27 14:37:31 -0700157 RoundHighBitDepth(bit_depth, &se, &sse);
Johannd90536c2015-06-01 13:03:30 -0700158 *sse_ptr = static_cast<uint32_t>(sse);
Urvang Joshi77853e52016-07-15 12:47:01 -0700159 return static_cast<uint32_t>(sse - ((se * se) >> (l2w + l2h)));
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700160}
James Zern98473442012-11-06 16:58:11 -0800161
skal8dbbcda2016-07-13 17:33:22 -0700162static uint32_t subpel_avg_variance_ref(const uint8_t *ref, const uint8_t *src,
163 const uint8_t *second_pred, int l2w,
164 int l2h, int xoff, int yoff,
165 uint32_t *sse_ptr,
166 bool use_high_bit_depth,
Yaowu Xuf883b422016-08-30 14:01:10 -0700167 aom_bit_depth_t bit_depth) {
skal8dbbcda2016-07-13 17:33:22 -0700168 int64_t se = 0;
169 uint64_t sse = 0;
170 const int w = 1 << l2w;
171 const int h = 1 << l2h;
172
173 xoff <<= 1;
174 yoff <<= 1;
175
176 for (int y = 0; y < h; y++) {
177 for (int x = 0; x < w; x++) {
178 // bilinear interpolation at a 16th pel step
179 if (!use_high_bit_depth) {
180 const int a1 = ref[(w + 1) * (y + 0) + x + 0];
181 const int a2 = ref[(w + 1) * (y + 0) + x + 1];
182 const int b1 = ref[(w + 1) * (y + 1) + x + 0];
183 const int b2 = ref[(w + 1) * (y + 1) + x + 1];
184 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
185 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
186 const int r = a + (((b - a) * yoff + 8) >> 4);
187 const int diff =
188 ((r + second_pred[w * y + x] + 1) >> 1) - src[w * y + x];
189 se += diff;
190 sse += diff * diff;
Yaowu Xuf883b422016-08-30 14:01:10 -0700191#if CONFIG_AOM_HIGHBITDEPTH
skal8dbbcda2016-07-13 17:33:22 -0700192 } else {
193 const uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref);
194 const uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
195 const uint16_t *sec16 = CONVERT_TO_SHORTPTR(second_pred);
196 const int a1 = ref16[(w + 1) * (y + 0) + x + 0];
197 const int a2 = ref16[(w + 1) * (y + 0) + x + 1];
198 const int b1 = ref16[(w + 1) * (y + 1) + x + 0];
199 const int b2 = ref16[(w + 1) * (y + 1) + x + 1];
200 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
201 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
202 const int r = a + (((b - a) * yoff + 8) >> 4);
203 const int diff = ((r + sec16[w * y + x] + 1) >> 1) - src16[w * y + x];
204 se += diff;
205 sse += diff * diff;
Yaowu Xuf883b422016-08-30 14:01:10 -0700206#endif // CONFIG_AOM_HIGHBITDEPTH
skal8dbbcda2016-07-13 17:33:22 -0700207 }
208 }
209 }
210 RoundHighBitDepth(bit_depth, &se, &sse);
211 *sse_ptr = static_cast<uint32_t>(sse);
Urvang Joshi77853e52016-07-15 12:47:01 -0700212 return static_cast<uint32_t>(sse - ((se * se) >> (l2w + l2h)));
skal8dbbcda2016-07-13 17:33:22 -0700213}
214
215////////////////////////////////////////////////////////////////////////////////
216
Dmitry Kovalev1f19ebb2014-09-06 00:10:25 -0700217class SumOfSquaresTest : public ::testing::TestWithParam<SumOfSquaresFunction> {
218 public:
219 SumOfSquaresTest() : func_(GetParam()) {}
220
Yaowu Xuc27fc142016-08-22 16:08:15 -0700221 virtual ~SumOfSquaresTest() { libaom_test::ClearSystemState(); }
Dmitry Kovalev1f19ebb2014-09-06 00:10:25 -0700222
223 protected:
224 void ConstTest();
225 void RefTest();
226
227 SumOfSquaresFunction func_;
228 ACMRandom rnd_;
229};
230
231void SumOfSquaresTest::ConstTest() {
232 int16_t mem[256];
233 unsigned int res;
234 for (int v = 0; v < 256; ++v) {
235 for (int i = 0; i < 256; ++i) {
236 mem[i] = v;
237 }
238 ASM_REGISTER_STATE_CHECK(res = func_(mem));
239 EXPECT_EQ(256u * (v * v), res);
240 }
241}
242
243void SumOfSquaresTest::RefTest() {
244 int16_t mem[256];
245 for (int i = 0; i < 100; ++i) {
246 for (int j = 0; j < 256; ++j) {
247 mem[j] = rnd_.Rand8() - rnd_.Rand8();
248 }
249
250 const unsigned int expected = mb_ss_ref(mem);
251 unsigned int res;
252 ASM_REGISTER_STATE_CHECK(res = func_(mem));
253 EXPECT_EQ(expected, res);
254 }
255}
256
skal8dbbcda2016-07-13 17:33:22 -0700257////////////////////////////////////////////////////////////////////////////////
258// Encapsulating struct to store the function to test along with
259// some testing context.
260// Can be used for MSE, SSE, Variance, etc.
261
262template <typename Func>
263struct TestParams {
264 TestParams(int log2w = 0, int log2h = 0, Func function = NULL,
265 int bit_depth_value = 0)
266 : log2width(log2w), log2height(log2h), func(function) {
267 use_high_bit_depth = (bit_depth_value > 0);
268 if (use_high_bit_depth) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700269 bit_depth = static_cast<aom_bit_depth_t>(bit_depth_value);
skal8dbbcda2016-07-13 17:33:22 -0700270 } else {
Yaowu Xuf883b422016-08-30 14:01:10 -0700271 bit_depth = AOM_BITS_8;
skal8dbbcda2016-07-13 17:33:22 -0700272 }
273 width = 1 << log2width;
274 height = 1 << log2height;
275 block_size = width * height;
276 mask = (1u << bit_depth) - 1;
277 }
278
279 int log2width, log2height;
280 int width, height;
281 int block_size;
282 Func func;
Yaowu Xuf883b422016-08-30 14:01:10 -0700283 aom_bit_depth_t bit_depth;
skal8dbbcda2016-07-13 17:33:22 -0700284 bool use_high_bit_depth;
285 uint32_t mask;
286};
287
288template <typename Func>
289std::ostream &operator<<(std::ostream &os, const TestParams<Func> &p) {
290 return os << "log2width/height:" << p.log2width << "/" << p.log2height
291 << " function:" << reinterpret_cast<const void *>(p.func)
292 << " bit-depth:" << p.bit_depth;
293}
294
295// Main class for testing a function type
296template <typename FunctionType>
297class MainTestClass
298 : public ::testing::TestWithParam<TestParams<FunctionType> > {
James Zern98473442012-11-06 16:58:11 -0800299 public:
300 virtual void SetUp() {
skal8dbbcda2016-07-13 17:33:22 -0700301 params_ = this->GetParam();
302
303 rnd_.Reset(ACMRandom::DeterministicSeed());
304 const size_t unit =
305 use_high_bit_depth() ? sizeof(uint16_t) : sizeof(uint8_t);
Yaowu Xuf883b422016-08-30 14:01:10 -0700306 src_ = reinterpret_cast<uint8_t *>(aom_memalign(16, block_size() * unit));
skal8dbbcda2016-07-13 17:33:22 -0700307 ref_ = new uint8_t[block_size() * unit];
308 ASSERT_TRUE(src_ != NULL);
309 ASSERT_TRUE(ref_ != NULL);
Yaowu Xuf883b422016-08-30 14:01:10 -0700310#if CONFIG_AOM_HIGHBITDEPTH
skal8dbbcda2016-07-13 17:33:22 -0700311 if (use_high_bit_depth()) {
312 // TODO(skal): remove!
313 src_ = CONVERT_TO_BYTEPTR(src_);
314 ref_ = CONVERT_TO_BYTEPTR(ref_);
315 }
316#endif
317 }
318
319 virtual void TearDown() {
Yaowu Xuf883b422016-08-30 14:01:10 -0700320#if CONFIG_AOM_HIGHBITDEPTH
skal8dbbcda2016-07-13 17:33:22 -0700321 if (use_high_bit_depth()) {
322 // TODO(skal): remove!
323 src_ = reinterpret_cast<uint8_t *>(CONVERT_TO_SHORTPTR(src_));
324 ref_ = reinterpret_cast<uint8_t *>(CONVERT_TO_SHORTPTR(ref_));
325 }
326#endif
327
Yaowu Xuf883b422016-08-30 14:01:10 -0700328 aom_free(src_);
skal8dbbcda2016-07-13 17:33:22 -0700329 delete[] ref_;
330 src_ = NULL;
331 ref_ = NULL;
Yaowu Xuc27fc142016-08-22 16:08:15 -0700332 libaom_test::ClearSystemState();
skal8dbbcda2016-07-13 17:33:22 -0700333 }
334
335 protected:
336 // We could sub-class MainTestClass into dedicated class for Variance
337 // and MSE/SSE, but it involves a lot of 'this->xxx' dereferencing
338 // to access top class fields xxx. That's cumbersome, so for now we'll just
339 // implement the testing methods here:
340
341 // Variance tests
342 void ZeroTest();
343 void RefTest();
344 void RefStrideTest();
345 void OneQuarterTest();
346
347 // MSE/SSE tests
348 void RefTestMse();
349 void RefTestSse();
350 void MaxTestMse();
351 void MaxTestSse();
352
353 protected:
354 ACMRandom rnd_;
355 uint8_t *src_;
356 uint8_t *ref_;
357 TestParams<FunctionType> params_;
358
359 // some relay helpers
360 bool use_high_bit_depth() const { return params_.use_high_bit_depth; }
361 int byte_shift() const { return params_.bit_depth - 8; }
362 int block_size() const { return params_.block_size; }
363 int width() const { return params_.width; }
364 uint32_t mask() const { return params_.mask; }
365};
366
367////////////////////////////////////////////////////////////////////////////////
368// Tests related to variance.
369
370template <typename VarianceFunctionType>
371void MainTestClass<VarianceFunctionType>::ZeroTest() {
372 for (int i = 0; i <= 255; ++i) {
373 if (!use_high_bit_depth()) {
374 memset(src_, i, block_size());
375 } else {
376 uint16_t *const src16 = CONVERT_TO_SHORTPTR(src_);
377 for (int k = 0; k < block_size(); ++k) src16[k] = i << byte_shift();
378 }
379 for (int j = 0; j <= 255; ++j) {
380 if (!use_high_bit_depth()) {
381 memset(ref_, j, block_size());
382 } else {
383 uint16_t *const ref16 = CONVERT_TO_SHORTPTR(ref_);
384 for (int k = 0; k < block_size(); ++k) ref16[k] = j << byte_shift();
385 }
386 unsigned int sse, var;
387 ASM_REGISTER_STATE_CHECK(
388 var = params_.func(src_, width(), ref_, width(), &sse));
389 EXPECT_EQ(0u, var) << "src values: " << i << " ref values: " << j;
390 }
391 }
392}
393
394template <typename VarianceFunctionType>
395void MainTestClass<VarianceFunctionType>::RefTest() {
396 for (int i = 0; i < 10; ++i) {
397 for (int j = 0; j < block_size(); j++) {
398 if (!use_high_bit_depth()) {
399 src_[j] = rnd_.Rand8();
400 ref_[j] = rnd_.Rand8();
Yaowu Xuf883b422016-08-30 14:01:10 -0700401#if CONFIG_AOM_HIGHBITDEPTH
skal8dbbcda2016-07-13 17:33:22 -0700402 } else {
403 CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask();
404 CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask();
Yaowu Xuf883b422016-08-30 14:01:10 -0700405#endif // CONFIG_AOM_HIGHBITDEPTH
skal8dbbcda2016-07-13 17:33:22 -0700406 }
407 }
408 unsigned int sse1, sse2, var1, var2;
409 const int stride = width();
410 ASM_REGISTER_STATE_CHECK(
411 var1 = params_.func(src_, stride, ref_, stride, &sse1));
412 var2 =
413 variance_ref(src_, ref_, params_.log2width, params_.log2height, stride,
414 stride, &sse2, use_high_bit_depth(), params_.bit_depth);
415 EXPECT_EQ(sse1, sse2) << "Error at test index: " << i;
416 EXPECT_EQ(var1, var2) << "Error at test index: " << i;
417 }
418}
419
420template <typename VarianceFunctionType>
421void MainTestClass<VarianceFunctionType>::RefStrideTest() {
422 for (int i = 0; i < 10; ++i) {
423 const int ref_stride = (i & 1) * width();
424 const int src_stride = ((i >> 1) & 1) * width();
425 for (int j = 0; j < block_size(); j++) {
426 const int ref_ind = (j / width()) * ref_stride + j % width();
427 const int src_ind = (j / width()) * src_stride + j % width();
428 if (!use_high_bit_depth()) {
429 src_[src_ind] = rnd_.Rand8();
430 ref_[ref_ind] = rnd_.Rand8();
Yaowu Xuf883b422016-08-30 14:01:10 -0700431#if CONFIG_AOM_HIGHBITDEPTH
skal8dbbcda2016-07-13 17:33:22 -0700432 } else {
433 CONVERT_TO_SHORTPTR(src_)[src_ind] = rnd_.Rand16() & mask();
434 CONVERT_TO_SHORTPTR(ref_)[ref_ind] = rnd_.Rand16() & mask();
Yaowu Xuf883b422016-08-30 14:01:10 -0700435#endif // CONFIG_AOM_HIGHBITDEPTH
skal8dbbcda2016-07-13 17:33:22 -0700436 }
437 }
438 unsigned int sse1, sse2;
439 unsigned int var1, var2;
440
441 ASM_REGISTER_STATE_CHECK(
442 var1 = params_.func(src_, src_stride, ref_, ref_stride, &sse1));
443 var2 = variance_ref(src_, ref_, params_.log2width, params_.log2height,
444 src_stride, ref_stride, &sse2, use_high_bit_depth(),
445 params_.bit_depth);
446 EXPECT_EQ(sse1, sse2) << "Error at test index: " << i;
447 EXPECT_EQ(var1, var2) << "Error at test index: " << i;
448 }
449}
450
451template <typename VarianceFunctionType>
452void MainTestClass<VarianceFunctionType>::OneQuarterTest() {
453 const int half = block_size() / 2;
454 if (!use_high_bit_depth()) {
455 memset(src_, 255, block_size());
456 memset(ref_, 255, half);
457 memset(ref_ + half, 0, half);
Yaowu Xuf883b422016-08-30 14:01:10 -0700458#if CONFIG_AOM_HIGHBITDEPTH
skal8dbbcda2016-07-13 17:33:22 -0700459 } else {
Yaowu Xuf883b422016-08-30 14:01:10 -0700460 aom_memset16(CONVERT_TO_SHORTPTR(src_), 255 << byte_shift(), block_size());
461 aom_memset16(CONVERT_TO_SHORTPTR(ref_), 255 << byte_shift(), half);
462 aom_memset16(CONVERT_TO_SHORTPTR(ref_) + half, 0, half);
463#endif // CONFIG_AOM_HIGHBITDEPTH
skal8dbbcda2016-07-13 17:33:22 -0700464 }
465 unsigned int sse, var, expected;
466 ASM_REGISTER_STATE_CHECK(
467 var = params_.func(src_, width(), ref_, width(), &sse));
468 expected = block_size() * 255 * 255 / 4;
469 EXPECT_EQ(expected, var);
470}
471
472////////////////////////////////////////////////////////////////////////////////
473// Tests related to MSE / SSE.
474
475template <typename FunctionType>
476void MainTestClass<FunctionType>::RefTestMse() {
477 for (int i = 0; i < 10; ++i) {
478 for (int j = 0; j < block_size(); ++j) {
479 src_[j] = rnd_.Rand8();
480 ref_[j] = rnd_.Rand8();
481 }
482 unsigned int sse1, sse2;
483 const int stride = width();
484 ASM_REGISTER_STATE_CHECK(params_.func(src_, stride, ref_, stride, &sse1));
485 variance_ref(src_, ref_, params_.log2width, params_.log2height, stride,
Yaowu Xuf883b422016-08-30 14:01:10 -0700486 stride, &sse2, false, AOM_BITS_8);
skal8dbbcda2016-07-13 17:33:22 -0700487 EXPECT_EQ(sse1, sse2);
488 }
489}
490
491template <typename FunctionType>
492void MainTestClass<FunctionType>::RefTestSse() {
493 for (int i = 0; i < 10; ++i) {
494 for (int j = 0; j < block_size(); ++j) {
495 src_[j] = rnd_.Rand8();
496 ref_[j] = rnd_.Rand8();
497 }
498 unsigned int sse2;
499 unsigned int var1;
500 const int stride = width();
501 ASM_REGISTER_STATE_CHECK(var1 = params_.func(src_, stride, ref_, stride));
502 variance_ref(src_, ref_, params_.log2width, params_.log2height, stride,
Yaowu Xuf883b422016-08-30 14:01:10 -0700503 stride, &sse2, false, AOM_BITS_8);
skal8dbbcda2016-07-13 17:33:22 -0700504 EXPECT_EQ(var1, sse2);
505 }
506}
507
508template <typename FunctionType>
509void MainTestClass<FunctionType>::MaxTestMse() {
510 memset(src_, 255, block_size());
511 memset(ref_, 0, block_size());
512 unsigned int sse;
513 ASM_REGISTER_STATE_CHECK(params_.func(src_, width(), ref_, width(), &sse));
514 const unsigned int expected = block_size() * 255 * 255;
515 EXPECT_EQ(expected, sse);
516}
517
518template <typename FunctionType>
519void MainTestClass<FunctionType>::MaxTestSse() {
520 memset(src_, 255, block_size());
521 memset(ref_, 0, block_size());
522 unsigned int var;
523 ASM_REGISTER_STATE_CHECK(var = params_.func(src_, width(), ref_, width()));
524 const unsigned int expected = block_size() * 255 * 255;
525 EXPECT_EQ(expected, var);
526}
527
528////////////////////////////////////////////////////////////////////////////////
529
530using ::std::tr1::get;
531using ::std::tr1::make_tuple;
532using ::std::tr1::tuple;
533
534template <typename SubpelVarianceFunctionType>
535class SubpelVarianceTest
536 : public ::testing::TestWithParam<
537 tuple<int, int, SubpelVarianceFunctionType, int> > {
538 public:
539 virtual void SetUp() {
540 const tuple<int, int, SubpelVarianceFunctionType, int> &params =
541 this->GetParam();
542 log2width_ = get<0>(params);
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700543 width_ = 1 << log2width_;
544 log2height_ = get<1>(params);
545 height_ = 1 << log2height_;
skal8dbbcda2016-07-13 17:33:22 -0700546 subpel_variance_ = get<2>(params);
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100547 if (get<3>(params)) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700548 bit_depth_ = (aom_bit_depth_t)get<3>(params);
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100549 use_high_bit_depth_ = true;
550 } else {
Yaowu Xuf883b422016-08-30 14:01:10 -0700551 bit_depth_ = AOM_BITS_8;
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100552 use_high_bit_depth_ = false;
553 }
554 mask_ = (1 << bit_depth_) - 1;
James Zern98473442012-11-06 16:58:11 -0800555
Dmitry Kovalev202edb32014-09-04 12:24:52 -0700556 rnd_.Reset(ACMRandom::DeterministicSeed());
James Zern98473442012-11-06 16:58:11 -0800557 block_size_ = width_ * height_;
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100558 if (!use_high_bit_depth_) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700559 src_ = reinterpret_cast<uint8_t *>(aom_memalign(16, block_size_));
560 sec_ = reinterpret_cast<uint8_t *>(aom_memalign(16, block_size_));
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100561 ref_ = new uint8_t[block_size_ + width_ + height_ + 1];
Yaowu Xuf883b422016-08-30 14:01:10 -0700562#if CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100563 } else {
skal8dbbcda2016-07-13 17:33:22 -0700564 src_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(
Yaowu Xuf883b422016-08-30 14:01:10 -0700565 aom_memalign(16, block_size_ * sizeof(uint16_t))));
skal8dbbcda2016-07-13 17:33:22 -0700566 sec_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(
Yaowu Xuf883b422016-08-30 14:01:10 -0700567 aom_memalign(16, block_size_ * sizeof(uint16_t))));
skal8dbbcda2016-07-13 17:33:22 -0700568 ref_ =
569 CONVERT_TO_BYTEPTR(new uint16_t[block_size_ + width_ + height_ + 1]);
Yaowu Xuf883b422016-08-30 14:01:10 -0700570#endif // CONFIG_AOM_HIGHBITDEPTH
Johannc3bdffb2015-05-15 11:52:03 -0700571 }
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700572 ASSERT_TRUE(src_ != NULL);
Ronald S. Bultjeac6ea2a2013-06-21 17:03:57 -0700573 ASSERT_TRUE(sec_ != NULL);
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700574 ASSERT_TRUE(ref_ != NULL);
575 }
576
577 virtual void TearDown() {
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100578 if (!use_high_bit_depth_) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700579 aom_free(src_);
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100580 delete[] ref_;
Yaowu Xuf883b422016-08-30 14:01:10 -0700581 aom_free(sec_);
582#if CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100583 } else {
Yaowu Xuf883b422016-08-30 14:01:10 -0700584 aom_free(CONVERT_TO_SHORTPTR(src_));
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100585 delete[] CONVERT_TO_SHORTPTR(ref_);
Yaowu Xuf883b422016-08-30 14:01:10 -0700586 aom_free(CONVERT_TO_SHORTPTR(sec_));
587#endif // CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100588 }
Yaowu Xuc27fc142016-08-22 16:08:15 -0700589 libaom_test::ClearSystemState();
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700590 }
591
592 protected:
593 void RefTest();
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100594 void ExtremeRefTest();
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700595
Dmitry Kovalev202edb32014-09-04 12:24:52 -0700596 ACMRandom rnd_;
Ronald S. Bultje1e6a32f2013-06-20 15:59:48 -0700597 uint8_t *src_;
598 uint8_t *ref_;
599 uint8_t *sec_;
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100600 bool use_high_bit_depth_;
Yaowu Xuf883b422016-08-30 14:01:10 -0700601 aom_bit_depth_t bit_depth_;
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700602 int width_, log2width_;
603 int height_, log2height_;
skal8dbbcda2016-07-13 17:33:22 -0700604 int block_size_, mask_;
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700605 SubpelVarianceFunctionType subpel_variance_;
606};
607
skal8dbbcda2016-07-13 17:33:22 -0700608template <typename SubpelVarianceFunctionType>
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700609void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() {
Johanneb88b172015-05-26 11:30:25 -0700610 for (int x = 0; x < 8; ++x) {
611 for (int y = 0; y < 8; ++y) {
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100612 if (!use_high_bit_depth_) {
613 for (int j = 0; j < block_size_; j++) {
614 src_[j] = rnd_.Rand8();
615 }
616 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) {
617 ref_[j] = rnd_.Rand8();
618 }
Yaowu Xuf883b422016-08-30 14:01:10 -0700619#if CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100620 } else {
621 for (int j = 0; j < block_size_; j++) {
622 CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask_;
623 }
624 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) {
625 CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask_;
626 }
Yaowu Xuf883b422016-08-30 14:01:10 -0700627#endif // CONFIG_AOM_HIGHBITDEPTH
Johannc3bdffb2015-05-15 11:52:03 -0700628 }
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700629 unsigned int sse1, sse2;
James Zerncc774c82013-06-18 19:15:56 -0700630 unsigned int var1;
skal8dbbcda2016-07-13 17:33:22 -0700631 ASM_REGISTER_STATE_CHECK(
632 var1 = subpel_variance_(ref_, width_ + 1, x, y, src_, width_, &sse1));
633 const unsigned int var2 =
634 subpel_variance_ref(ref_, src_, log2width_, log2height_, x, y, &sse2,
635 use_high_bit_depth_, bit_depth_);
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100636 EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
637 EXPECT_EQ(var1, var2) << "at position " << x << ", " << y;
638 }
639 }
640}
641
skal8dbbcda2016-07-13 17:33:22 -0700642template <typename SubpelVarianceFunctionType>
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100643void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() {
644 // Compare against reference.
645 // Src: Set the first half of values to 0, the second half to the maximum.
646 // Ref: Set the first half of values to the maximum, the second half to 0.
Johanneb88b172015-05-26 11:30:25 -0700647 for (int x = 0; x < 8; ++x) {
648 for (int y = 0; y < 8; ++y) {
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100649 const int half = block_size_ / 2;
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100650 if (!use_high_bit_depth_) {
651 memset(src_, 0, half);
652 memset(src_ + half, 255, half);
653 memset(ref_, 255, half);
654 memset(ref_ + half, 0, half + width_ + height_ + 1);
Yaowu Xuf883b422016-08-30 14:01:10 -0700655#if CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100656 } else {
Yaowu Xuf883b422016-08-30 14:01:10 -0700657 aom_memset16(CONVERT_TO_SHORTPTR(src_), mask_, half);
658 aom_memset16(CONVERT_TO_SHORTPTR(src_) + half, 0, half);
659 aom_memset16(CONVERT_TO_SHORTPTR(ref_), 0, half);
660 aom_memset16(CONVERT_TO_SHORTPTR(ref_) + half, mask_,
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100661 half + width_ + height_ + 1);
Yaowu Xuf883b422016-08-30 14:01:10 -0700662#endif // CONFIG_AOM_HIGHBITDEPTH
Johannc3bdffb2015-05-15 11:52:03 -0700663 }
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100664 unsigned int sse1, sse2;
665 unsigned int var1;
666 ASM_REGISTER_STATE_CHECK(
667 var1 = subpel_variance_(ref_, width_ + 1, x, y, src_, width_, &sse1));
668 const unsigned int var2 =
skal8dbbcda2016-07-13 17:33:22 -0700669 subpel_variance_ref(ref_, src_, log2width_, log2height_, x, y, &sse2,
670 use_high_bit_depth_, bit_depth_);
Johanneb88b172015-05-26 11:30:25 -0700671 EXPECT_EQ(sse1, sse2) << "for xoffset " << x << " and yoffset " << y;
672 EXPECT_EQ(var1, var2) << "for xoffset " << x << " and yoffset " << y;
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -0700673 }
674 }
675}
676
skal8dbbcda2016-07-13 17:33:22 -0700677template <>
Johann6a82f0d2015-06-05 09:54:19 -0700678void SubpelVarianceTest<SubpixAvgVarMxNFunc>::RefTest() {
Johanneb88b172015-05-26 11:30:25 -0700679 for (int x = 0; x < 8; ++x) {
680 for (int y = 0; y < 8; ++y) {
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100681 if (!use_high_bit_depth_) {
682 for (int j = 0; j < block_size_; j++) {
683 src_[j] = rnd_.Rand8();
684 sec_[j] = rnd_.Rand8();
685 }
686 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) {
687 ref_[j] = rnd_.Rand8();
688 }
Yaowu Xuf883b422016-08-30 14:01:10 -0700689#if CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100690 } else {
691 for (int j = 0; j < block_size_; j++) {
692 CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask_;
693 CONVERT_TO_SHORTPTR(sec_)[j] = rnd_.Rand16() & mask_;
694 }
695 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) {
696 CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask_;
697 }
Yaowu Xuf883b422016-08-30 14:01:10 -0700698#endif // CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz48032bf2014-10-16 14:00:54 +0100699 }
skal8dbbcda2016-07-13 17:33:22 -0700700 uint32_t sse1, sse2;
701 uint32_t var1, var2;
702 ASM_REGISTER_STATE_CHECK(var1 =
703 subpel_variance_(ref_, width_ + 1, x, y,
704 src_, width_, &sse1, sec_));
705 var2 = subpel_avg_variance_ref(ref_, src_, sec_, log2width_, log2height_,
706 x, y, &sse2, use_high_bit_depth_,
Yaowu Xuf883b422016-08-30 14:01:10 -0700707 static_cast<aom_bit_depth_t>(bit_depth_));
Ronald S. Bultje1e6a32f2013-06-20 15:59:48 -0700708 EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
709 EXPECT_EQ(var1, var2) << "at position " << x << ", " << y;
710 }
711 }
712}
James Zerna0fcbcf2013-09-17 18:47:25 -0700713
Yaowu Xuf883b422016-08-30 14:01:10 -0700714typedef MainTestClass<Get4x4SseFunc> AvxSseTest;
715typedef MainTestClass<VarianceMxNFunc> AvxMseTest;
716typedef MainTestClass<VarianceMxNFunc> AvxVarianceTest;
717typedef SubpelVarianceTest<SubpixVarMxNFunc> AvxSubpelVarianceTest;
718typedef SubpelVarianceTest<SubpixAvgVarMxNFunc> AvxSubpelAvgVarianceTest;
James Zern1711cf22013-02-22 16:23:36 -0800719
Yaowu Xuf883b422016-08-30 14:01:10 -0700720TEST_P(AvxSseTest, RefSse) { RefTestSse(); }
721TEST_P(AvxSseTest, MaxSse) { MaxTestSse(); }
722TEST_P(AvxMseTest, RefMse) { RefTestMse(); }
723TEST_P(AvxMseTest, MaxMse) { MaxTestMse(); }
724TEST_P(AvxVarianceTest, Zero) { ZeroTest(); }
725TEST_P(AvxVarianceTest, Ref) { RefTest(); }
726TEST_P(AvxVarianceTest, RefStride) { RefStrideTest(); }
727TEST_P(AvxVarianceTest, OneQuarter) { OneQuarterTest(); }
Dmitry Kovalev1f19ebb2014-09-06 00:10:25 -0700728TEST_P(SumOfSquaresTest, Const) { ConstTest(); }
729TEST_P(SumOfSquaresTest, Ref) { RefTest(); }
Yaowu Xuf883b422016-08-30 14:01:10 -0700730TEST_P(AvxSubpelVarianceTest, Ref) { RefTest(); }
731TEST_P(AvxSubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); }
732TEST_P(AvxSubpelAvgVarianceTest, Ref) { RefTest(); }
Dmitry Kovalev1f19ebb2014-09-06 00:10:25 -0700733
734INSTANTIATE_TEST_CASE_P(C, SumOfSquaresTest,
Yaowu Xuf883b422016-08-30 14:01:10 -0700735 ::testing::Values(aom_get_mb_ss_c));
Dmitry Kovalev1f19ebb2014-09-06 00:10:25 -0700736
skal8dbbcda2016-07-13 17:33:22 -0700737typedef TestParams<Get4x4SseFunc> SseParams;
Yaowu Xuf883b422016-08-30 14:01:10 -0700738INSTANTIATE_TEST_CASE_P(C, AvxSseTest,
skal8dbbcda2016-07-13 17:33:22 -0700739 ::testing::Values(SseParams(2, 2,
Yaowu Xuf883b422016-08-30 14:01:10 -0700740 &aom_get4x4sse_cs_c)));
Johannc3bdffb2015-05-15 11:52:03 -0700741
skal8dbbcda2016-07-13 17:33:22 -0700742typedef TestParams<VarianceMxNFunc> MseParams;
Yaowu Xuf883b422016-08-30 14:01:10 -0700743INSTANTIATE_TEST_CASE_P(C, AvxMseTest,
744 ::testing::Values(MseParams(4, 4, &aom_mse16x16_c),
745 MseParams(4, 3, &aom_mse16x8_c),
746 MseParams(3, 4, &aom_mse8x16_c),
747 MseParams(3, 3, &aom_mse8x8_c)));
Johannc3bdffb2015-05-15 11:52:03 -0700748
skal8dbbcda2016-07-13 17:33:22 -0700749typedef TestParams<VarianceMxNFunc> VarianceParams;
Johannc3bdffb2015-05-15 11:52:03 -0700750INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -0700751 C, AvxVarianceTest,
752 ::testing::Values(VarianceParams(6, 6, &aom_variance64x64_c),
753 VarianceParams(6, 5, &aom_variance64x32_c),
754 VarianceParams(5, 6, &aom_variance32x64_c),
755 VarianceParams(5, 5, &aom_variance32x32_c),
756 VarianceParams(5, 4, &aom_variance32x16_c),
757 VarianceParams(4, 5, &aom_variance16x32_c),
758 VarianceParams(4, 4, &aom_variance16x16_c),
759 VarianceParams(4, 3, &aom_variance16x8_c),
760 VarianceParams(3, 4, &aom_variance8x16_c),
761 VarianceParams(3, 3, &aom_variance8x8_c),
762 VarianceParams(3, 2, &aom_variance8x4_c),
763 VarianceParams(2, 3, &aom_variance4x8_c),
764 VarianceParams(2, 2, &aom_variance4x4_c)));
Johannc3bdffb2015-05-15 11:52:03 -0700765
Johann6a82f0d2015-06-05 09:54:19 -0700766INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -0700767 C, AvxSubpelVarianceTest,
768 ::testing::Values(make_tuple(6, 6, &aom_sub_pixel_variance64x64_c, 0),
769 make_tuple(6, 5, &aom_sub_pixel_variance64x32_c, 0),
770 make_tuple(5, 6, &aom_sub_pixel_variance32x64_c, 0),
771 make_tuple(5, 5, &aom_sub_pixel_variance32x32_c, 0),
772 make_tuple(5, 4, &aom_sub_pixel_variance32x16_c, 0),
773 make_tuple(4, 5, &aom_sub_pixel_variance16x32_c, 0),
774 make_tuple(4, 4, &aom_sub_pixel_variance16x16_c, 0),
775 make_tuple(4, 3, &aom_sub_pixel_variance16x8_c, 0),
776 make_tuple(3, 4, &aom_sub_pixel_variance8x16_c, 0),
777 make_tuple(3, 3, &aom_sub_pixel_variance8x8_c, 0),
778 make_tuple(3, 2, &aom_sub_pixel_variance8x4_c, 0),
779 make_tuple(2, 3, &aom_sub_pixel_variance4x8_c, 0),
780 make_tuple(2, 2, &aom_sub_pixel_variance4x4_c, 0)));
Johann6a82f0d2015-06-05 09:54:19 -0700781
Johann6a82f0d2015-06-05 09:54:19 -0700782INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -0700783 C, AvxSubpelAvgVarianceTest,
784 ::testing::Values(make_tuple(6, 6, &aom_sub_pixel_avg_variance64x64_c, 0),
785 make_tuple(6, 5, &aom_sub_pixel_avg_variance64x32_c, 0),
786 make_tuple(5, 6, &aom_sub_pixel_avg_variance32x64_c, 0),
787 make_tuple(5, 5, &aom_sub_pixel_avg_variance32x32_c, 0),
788 make_tuple(5, 4, &aom_sub_pixel_avg_variance32x16_c, 0),
789 make_tuple(4, 5, &aom_sub_pixel_avg_variance16x32_c, 0),
790 make_tuple(4, 4, &aom_sub_pixel_avg_variance16x16_c, 0),
791 make_tuple(4, 3, &aom_sub_pixel_avg_variance16x8_c, 0),
792 make_tuple(3, 4, &aom_sub_pixel_avg_variance8x16_c, 0),
793 make_tuple(3, 3, &aom_sub_pixel_avg_variance8x8_c, 0),
794 make_tuple(3, 2, &aom_sub_pixel_avg_variance8x4_c, 0),
795 make_tuple(2, 3, &aom_sub_pixel_avg_variance4x8_c, 0),
796 make_tuple(2, 2, &aom_sub_pixel_avg_variance4x4_c, 0)));
Johann6a82f0d2015-06-05 09:54:19 -0700797
Yaowu Xuf883b422016-08-30 14:01:10 -0700798#if CONFIG_AOM_HIGHBITDEPTH
799typedef MainTestClass<VarianceMxNFunc> AvxHBDMseTest;
800typedef MainTestClass<VarianceMxNFunc> AvxHBDVarianceTest;
801typedef SubpelVarianceTest<SubpixVarMxNFunc> AvxHBDSubpelVarianceTest;
802typedef SubpelVarianceTest<SubpixAvgVarMxNFunc> AvxHBDSubpelAvgVarianceTest;
Johannc3bdffb2015-05-15 11:52:03 -0700803
Yaowu Xuf883b422016-08-30 14:01:10 -0700804TEST_P(AvxHBDMseTest, RefMse) { RefTestMse(); }
805TEST_P(AvxHBDMseTest, MaxMse) { MaxTestMse(); }
806TEST_P(AvxHBDVarianceTest, Zero) { ZeroTest(); }
807TEST_P(AvxHBDVarianceTest, Ref) { RefTest(); }
808TEST_P(AvxHBDVarianceTest, RefStride) { RefStrideTest(); }
809TEST_P(AvxHBDVarianceTest, OneQuarter) { OneQuarterTest(); }
810TEST_P(AvxHBDSubpelVarianceTest, Ref) { RefTest(); }
811TEST_P(AvxHBDSubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); }
812TEST_P(AvxHBDSubpelAvgVarianceTest, Ref) { RefTest(); }
Johannc3bdffb2015-05-15 11:52:03 -0700813
814/* TODO(debargha): This test does not support the highbd version
Johannc3bdffb2015-05-15 11:52:03 -0700815INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -0700816 C, AvxHBDMseTest,
817 ::testing::Values(make_tuple(4, 4, &aom_highbd_12_mse16x16_c),
818 make_tuple(4, 4, &aom_highbd_12_mse16x8_c),
819 make_tuple(4, 4, &aom_highbd_12_mse8x16_c),
820 make_tuple(4, 4, &aom_highbd_12_mse8x8_c),
821 make_tuple(4, 4, &aom_highbd_10_mse16x16_c),
822 make_tuple(4, 4, &aom_highbd_10_mse16x8_c),
823 make_tuple(4, 4, &aom_highbd_10_mse8x16_c),
824 make_tuple(4, 4, &aom_highbd_10_mse8x8_c),
825 make_tuple(4, 4, &aom_highbd_8_mse16x16_c),
826 make_tuple(4, 4, &aom_highbd_8_mse16x8_c),
827 make_tuple(4, 4, &aom_highbd_8_mse8x16_c),
828 make_tuple(4, 4, &aom_highbd_8_mse8x8_c)));
Johannc3bdffb2015-05-15 11:52:03 -0700829*/
830
skal8dbbcda2016-07-13 17:33:22 -0700831const VarianceParams kArrayHBDVariance_c[] = {
Yaowu Xuf883b422016-08-30 14:01:10 -0700832#if CONFIG_AV1 && CONFIG_EXT_PARTITION
833 VarianceParams(7, 7, &aom_highbd_12_variance128x128_c, 12),
834 VarianceParams(7, 6, &aom_highbd_12_variance128x64_c, 12),
835 VarianceParams(6, 7, &aom_highbd_12_variance64x128_c, 12),
836#endif // CONFIG_AV1 && CONFIG_EXT_PARTITION
837 VarianceParams(6, 6, &aom_highbd_12_variance64x64_c, 12),
838 VarianceParams(6, 5, &aom_highbd_12_variance64x32_c, 12),
839 VarianceParams(5, 6, &aom_highbd_12_variance32x64_c, 12),
840 VarianceParams(5, 5, &aom_highbd_12_variance32x32_c, 12),
841 VarianceParams(5, 4, &aom_highbd_12_variance32x16_c, 12),
842 VarianceParams(4, 5, &aom_highbd_12_variance16x32_c, 12),
843 VarianceParams(4, 4, &aom_highbd_12_variance16x16_c, 12),
844 VarianceParams(4, 3, &aom_highbd_12_variance16x8_c, 12),
845 VarianceParams(3, 4, &aom_highbd_12_variance8x16_c, 12),
846 VarianceParams(3, 3, &aom_highbd_12_variance8x8_c, 12),
847 VarianceParams(3, 2, &aom_highbd_12_variance8x4_c, 12),
848 VarianceParams(2, 3, &aom_highbd_12_variance4x8_c, 12),
849 VarianceParams(2, 2, &aom_highbd_12_variance4x4_c, 12),
850#if CONFIG_AV1 && CONFIG_EXT_PARTITION
851 VarianceParams(7, 7, &aom_highbd_10_variance128x128_c, 10),
852 VarianceParams(7, 6, &aom_highbd_10_variance128x64_c, 10),
853 VarianceParams(6, 7, &aom_highbd_10_variance64x128_c, 10),
854#endif // CONFIG_AV1 && CONFIG_EXT_PARTITION
855 VarianceParams(6, 6, &aom_highbd_10_variance64x64_c, 10),
856 VarianceParams(6, 5, &aom_highbd_10_variance64x32_c, 10),
857 VarianceParams(5, 6, &aom_highbd_10_variance32x64_c, 10),
858 VarianceParams(5, 5, &aom_highbd_10_variance32x32_c, 10),
859 VarianceParams(5, 4, &aom_highbd_10_variance32x16_c, 10),
860 VarianceParams(4, 5, &aom_highbd_10_variance16x32_c, 10),
861 VarianceParams(4, 4, &aom_highbd_10_variance16x16_c, 10),
862 VarianceParams(4, 3, &aom_highbd_10_variance16x8_c, 10),
863 VarianceParams(3, 4, &aom_highbd_10_variance8x16_c, 10),
864 VarianceParams(3, 3, &aom_highbd_10_variance8x8_c, 10),
865 VarianceParams(3, 2, &aom_highbd_10_variance8x4_c, 10),
866 VarianceParams(2, 3, &aom_highbd_10_variance4x8_c, 10),
867 VarianceParams(2, 2, &aom_highbd_10_variance4x4_c, 10),
868#if CONFIG_AV1 && CONFIG_EXT_PARTITION
869 VarianceParams(7, 7, &aom_highbd_8_variance128x128_c, 8),
870 VarianceParams(7, 6, &aom_highbd_8_variance128x64_c, 8),
871 VarianceParams(6, 7, &aom_highbd_8_variance64x128_c, 8),
872#endif // CONFIG_AV1 && CONFIG_EXT_PARTITION
873 VarianceParams(6, 6, &aom_highbd_8_variance64x64_c, 8),
874 VarianceParams(6, 5, &aom_highbd_8_variance64x32_c, 8),
875 VarianceParams(5, 6, &aom_highbd_8_variance32x64_c, 8),
876 VarianceParams(5, 5, &aom_highbd_8_variance32x32_c, 8),
877 VarianceParams(5, 4, &aom_highbd_8_variance32x16_c, 8),
878 VarianceParams(4, 5, &aom_highbd_8_variance16x32_c, 8),
879 VarianceParams(4, 4, &aom_highbd_8_variance16x16_c, 8),
880 VarianceParams(4, 3, &aom_highbd_8_variance16x8_c, 8),
881 VarianceParams(3, 4, &aom_highbd_8_variance8x16_c, 8),
882 VarianceParams(3, 3, &aom_highbd_8_variance8x8_c, 8),
883 VarianceParams(3, 2, &aom_highbd_8_variance8x4_c, 8),
884 VarianceParams(2, 3, &aom_highbd_8_variance4x8_c, 8),
885 VarianceParams(2, 2, &aom_highbd_8_variance4x4_c, 8)
skal8dbbcda2016-07-13 17:33:22 -0700886};
Yaowu Xuf883b422016-08-30 14:01:10 -0700887INSTANTIATE_TEST_CASE_P(C, AvxHBDVarianceTest,
clang-format3a826f12016-08-11 17:46:05 -0700888 ::testing::ValuesIn(kArrayHBDVariance_c));
Johann6a82f0d2015-06-05 09:54:19 -0700889
Yaowu Xuf883b422016-08-30 14:01:10 -0700890#if HAVE_SSE4_1 && CONFIG_AOM_HIGHBITDEPTH
Yi Luoc2496892016-04-08 11:16:30 -0700891INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -0700892 SSE4_1, AvxHBDVarianceTest,
skal8dbbcda2016-07-13 17:33:22 -0700893 ::testing::Values(
Yaowu Xuf883b422016-08-30 14:01:10 -0700894 VarianceParams(2, 2, &aom_highbd_8_variance4x4_sse4_1, 8),
895 VarianceParams(2, 2, &aom_highbd_10_variance4x4_sse4_1, 10),
896 VarianceParams(2, 2, &aom_highbd_12_variance4x4_sse4_1, 12)));
897#endif // HAVE_SSE4_1 && CONFIG_AOM_HIGHBITDEPTH
Yi Luoc2496892016-04-08 11:16:30 -0700898
Yaowu Xuf883b422016-08-30 14:01:10 -0700899const AvxHBDSubpelVarianceTest::ParamType kArrayHBDSubpelVariance_c[] = {
900#if CONFIG_AV1 && CONFIG_EXT_PARTITION
901 make_tuple(7, 7, &aom_highbd_8_sub_pixel_variance128x128_c, 8),
902 make_tuple(7, 6, &aom_highbd_8_sub_pixel_variance128x64_c, 8),
903 make_tuple(6, 7, &aom_highbd_8_sub_pixel_variance64x128_c, 8),
904#endif // CONFIG_AV1 && CONFIG_EXT_PARTITION
905 make_tuple(6, 6, &aom_highbd_8_sub_pixel_variance64x64_c, 8),
906 make_tuple(6, 5, &aom_highbd_8_sub_pixel_variance64x32_c, 8),
907 make_tuple(5, 6, &aom_highbd_8_sub_pixel_variance32x64_c, 8),
908 make_tuple(5, 5, &aom_highbd_8_sub_pixel_variance32x32_c, 8),
909 make_tuple(5, 4, &aom_highbd_8_sub_pixel_variance32x16_c, 8),
910 make_tuple(4, 5, &aom_highbd_8_sub_pixel_variance16x32_c, 8),
911 make_tuple(4, 4, &aom_highbd_8_sub_pixel_variance16x16_c, 8),
912 make_tuple(4, 3, &aom_highbd_8_sub_pixel_variance16x8_c, 8),
913 make_tuple(3, 4, &aom_highbd_8_sub_pixel_variance8x16_c, 8),
914 make_tuple(3, 3, &aom_highbd_8_sub_pixel_variance8x8_c, 8),
915 make_tuple(3, 2, &aom_highbd_8_sub_pixel_variance8x4_c, 8),
916 make_tuple(2, 3, &aom_highbd_8_sub_pixel_variance4x8_c, 8),
917 make_tuple(2, 2, &aom_highbd_8_sub_pixel_variance4x4_c, 8),
918#if CONFIG_AV1 && CONFIG_EXT_PARTITION
919 make_tuple(7, 7, &aom_highbd_10_sub_pixel_variance128x128_c, 10),
920 make_tuple(7, 6, &aom_highbd_10_sub_pixel_variance128x64_c, 10),
921 make_tuple(6, 7, &aom_highbd_10_sub_pixel_variance64x128_c, 10),
922#endif // CONFIG_AV1 && CONFIG_EXT_PARTITION
923 make_tuple(6, 6, &aom_highbd_10_sub_pixel_variance64x64_c, 10),
924 make_tuple(6, 5, &aom_highbd_10_sub_pixel_variance64x32_c, 10),
925 make_tuple(5, 6, &aom_highbd_10_sub_pixel_variance32x64_c, 10),
926 make_tuple(5, 5, &aom_highbd_10_sub_pixel_variance32x32_c, 10),
927 make_tuple(5, 4, &aom_highbd_10_sub_pixel_variance32x16_c, 10),
928 make_tuple(4, 5, &aom_highbd_10_sub_pixel_variance16x32_c, 10),
929 make_tuple(4, 4, &aom_highbd_10_sub_pixel_variance16x16_c, 10),
930 make_tuple(4, 3, &aom_highbd_10_sub_pixel_variance16x8_c, 10),
931 make_tuple(3, 4, &aom_highbd_10_sub_pixel_variance8x16_c, 10),
932 make_tuple(3, 3, &aom_highbd_10_sub_pixel_variance8x8_c, 10),
933 make_tuple(3, 2, &aom_highbd_10_sub_pixel_variance8x4_c, 10),
934 make_tuple(2, 3, &aom_highbd_10_sub_pixel_variance4x8_c, 10),
935 make_tuple(2, 2, &aom_highbd_10_sub_pixel_variance4x4_c, 10),
936#if CONFIG_AV1 && CONFIG_EXT_PARTITION
937 make_tuple(7, 7, &aom_highbd_12_sub_pixel_variance128x128_c, 12),
938 make_tuple(7, 6, &aom_highbd_12_sub_pixel_variance128x64_c, 12),
939 make_tuple(6, 7, &aom_highbd_12_sub_pixel_variance64x128_c, 12),
940#endif // CONFIG_AV1 && CONFIG_EXT_PARTITION
941 make_tuple(6, 6, &aom_highbd_12_sub_pixel_variance64x64_c, 12),
942 make_tuple(6, 5, &aom_highbd_12_sub_pixel_variance64x32_c, 12),
943 make_tuple(5, 6, &aom_highbd_12_sub_pixel_variance32x64_c, 12),
944 make_tuple(5, 5, &aom_highbd_12_sub_pixel_variance32x32_c, 12),
945 make_tuple(5, 4, &aom_highbd_12_sub_pixel_variance32x16_c, 12),
946 make_tuple(4, 5, &aom_highbd_12_sub_pixel_variance16x32_c, 12),
947 make_tuple(4, 4, &aom_highbd_12_sub_pixel_variance16x16_c, 12),
948 make_tuple(4, 3, &aom_highbd_12_sub_pixel_variance16x8_c, 12),
949 make_tuple(3, 4, &aom_highbd_12_sub_pixel_variance8x16_c, 12),
950 make_tuple(3, 3, &aom_highbd_12_sub_pixel_variance8x8_c, 12),
951 make_tuple(3, 2, &aom_highbd_12_sub_pixel_variance8x4_c, 12),
952 make_tuple(2, 3, &aom_highbd_12_sub_pixel_variance4x8_c, 12),
953 make_tuple(2, 2, &aom_highbd_12_sub_pixel_variance4x4_c, 12),
Alex Converse25de2e12016-04-27 12:23:00 -0700954};
Yaowu Xuf883b422016-08-30 14:01:10 -0700955INSTANTIATE_TEST_CASE_P(C, AvxHBDSubpelVarianceTest,
skal8dbbcda2016-07-13 17:33:22 -0700956 ::testing::ValuesIn(kArrayHBDSubpelVariance_c));
Johann6a82f0d2015-06-05 09:54:19 -0700957
Yaowu Xuf883b422016-08-30 14:01:10 -0700958const AvxHBDSubpelAvgVarianceTest::ParamType kArrayHBDSubpelAvgVariance_c[] = {
959#if CONFIG_AV1 && CONFIG_EXT_PARTITION
960 make_tuple(7, 7, &aom_highbd_8_sub_pixel_avg_variance128x128_c, 8),
961 make_tuple(7, 6, &aom_highbd_8_sub_pixel_avg_variance128x64_c, 8),
962 make_tuple(6, 7, &aom_highbd_8_sub_pixel_avg_variance64x128_c, 8),
963#endif // CONFIG_AV1 && CONFIG_EXT_PARTITION
964 make_tuple(6, 6, &aom_highbd_8_sub_pixel_avg_variance64x64_c, 8),
965 make_tuple(6, 5, &aom_highbd_8_sub_pixel_avg_variance64x32_c, 8),
966 make_tuple(5, 6, &aom_highbd_8_sub_pixel_avg_variance32x64_c, 8),
967 make_tuple(5, 5, &aom_highbd_8_sub_pixel_avg_variance32x32_c, 8),
968 make_tuple(5, 4, &aom_highbd_8_sub_pixel_avg_variance32x16_c, 8),
969 make_tuple(4, 5, &aom_highbd_8_sub_pixel_avg_variance16x32_c, 8),
970 make_tuple(4, 4, &aom_highbd_8_sub_pixel_avg_variance16x16_c, 8),
971 make_tuple(4, 3, &aom_highbd_8_sub_pixel_avg_variance16x8_c, 8),
972 make_tuple(3, 4, &aom_highbd_8_sub_pixel_avg_variance8x16_c, 8),
973 make_tuple(3, 3, &aom_highbd_8_sub_pixel_avg_variance8x8_c, 8),
974 make_tuple(3, 2, &aom_highbd_8_sub_pixel_avg_variance8x4_c, 8),
975 make_tuple(2, 3, &aom_highbd_8_sub_pixel_avg_variance4x8_c, 8),
976 make_tuple(2, 2, &aom_highbd_8_sub_pixel_avg_variance4x4_c, 8),
977#if CONFIG_AV1 && CONFIG_EXT_PARTITION
978 make_tuple(7, 7, &aom_highbd_10_sub_pixel_avg_variance128x128_c, 10),
979 make_tuple(7, 6, &aom_highbd_10_sub_pixel_avg_variance128x64_c, 10),
980 make_tuple(6, 7, &aom_highbd_10_sub_pixel_avg_variance64x128_c, 10),
981#endif // CONFIG_AV1 && CONFIG_EXT_PARTITION
982 make_tuple(6, 6, &aom_highbd_10_sub_pixel_avg_variance64x64_c, 10),
983 make_tuple(6, 5, &aom_highbd_10_sub_pixel_avg_variance64x32_c, 10),
984 make_tuple(5, 6, &aom_highbd_10_sub_pixel_avg_variance32x64_c, 10),
985 make_tuple(5, 5, &aom_highbd_10_sub_pixel_avg_variance32x32_c, 10),
986 make_tuple(5, 4, &aom_highbd_10_sub_pixel_avg_variance32x16_c, 10),
987 make_tuple(4, 5, &aom_highbd_10_sub_pixel_avg_variance16x32_c, 10),
988 make_tuple(4, 4, &aom_highbd_10_sub_pixel_avg_variance16x16_c, 10),
989 make_tuple(4, 3, &aom_highbd_10_sub_pixel_avg_variance16x8_c, 10),
990 make_tuple(3, 4, &aom_highbd_10_sub_pixel_avg_variance8x16_c, 10),
991 make_tuple(3, 3, &aom_highbd_10_sub_pixel_avg_variance8x8_c, 10),
992 make_tuple(3, 2, &aom_highbd_10_sub_pixel_avg_variance8x4_c, 10),
993 make_tuple(2, 3, &aom_highbd_10_sub_pixel_avg_variance4x8_c, 10),
994 make_tuple(2, 2, &aom_highbd_10_sub_pixel_avg_variance4x4_c, 10),
995#if CONFIG_AV1 && CONFIG_EXT_PARTITION
996 make_tuple(7, 7, &aom_highbd_12_sub_pixel_avg_variance128x128_c, 12),
997 make_tuple(7, 6, &aom_highbd_12_sub_pixel_avg_variance128x64_c, 12),
998 make_tuple(6, 7, &aom_highbd_12_sub_pixel_avg_variance64x128_c, 12),
999#endif // CONFIG_AV1 && CONFIG_EXT_PARTITION
1000 make_tuple(6, 6, &aom_highbd_12_sub_pixel_avg_variance64x64_c, 12),
1001 make_tuple(6, 5, &aom_highbd_12_sub_pixel_avg_variance64x32_c, 12),
1002 make_tuple(5, 6, &aom_highbd_12_sub_pixel_avg_variance32x64_c, 12),
1003 make_tuple(5, 5, &aom_highbd_12_sub_pixel_avg_variance32x32_c, 12),
1004 make_tuple(5, 4, &aom_highbd_12_sub_pixel_avg_variance32x16_c, 12),
1005 make_tuple(4, 5, &aom_highbd_12_sub_pixel_avg_variance16x32_c, 12),
1006 make_tuple(4, 4, &aom_highbd_12_sub_pixel_avg_variance16x16_c, 12),
1007 make_tuple(4, 3, &aom_highbd_12_sub_pixel_avg_variance16x8_c, 12),
1008 make_tuple(3, 4, &aom_highbd_12_sub_pixel_avg_variance8x16_c, 12),
1009 make_tuple(3, 3, &aom_highbd_12_sub_pixel_avg_variance8x8_c, 12),
1010 make_tuple(3, 2, &aom_highbd_12_sub_pixel_avg_variance8x4_c, 12),
1011 make_tuple(2, 3, &aom_highbd_12_sub_pixel_avg_variance4x8_c, 12),
1012 make_tuple(2, 2, &aom_highbd_12_sub_pixel_avg_variance4x4_c, 12)
Alex Converse25de2e12016-04-27 12:23:00 -07001013};
Yaowu Xuf883b422016-08-30 14:01:10 -07001014INSTANTIATE_TEST_CASE_P(C, AvxHBDSubpelAvgVarianceTest,
skal8dbbcda2016-07-13 17:33:22 -07001015 ::testing::ValuesIn(kArrayHBDSubpelAvgVariance_c));
Yaowu Xuf883b422016-08-30 14:01:10 -07001016#endif // CONFIG_AOM_HIGHBITDEPTH
Johannc3bdffb2015-05-15 11:52:03 -07001017
Johannc3bdffb2015-05-15 11:52:03 -07001018#if HAVE_SSE2
1019INSTANTIATE_TEST_CASE_P(SSE2, SumOfSquaresTest,
Yaowu Xuf883b422016-08-30 14:01:10 -07001020 ::testing::Values(aom_get_mb_ss_sse2));
Johannc3bdffb2015-05-15 11:52:03 -07001021
Yaowu Xuf883b422016-08-30 14:01:10 -07001022INSTANTIATE_TEST_CASE_P(SSE2, AvxMseTest,
1023 ::testing::Values(MseParams(4, 4, &aom_mse16x16_sse2),
1024 MseParams(4, 3, &aom_mse16x8_sse2),
1025 MseParams(3, 4, &aom_mse8x16_sse2),
1026 MseParams(3, 3, &aom_mse8x8_sse2)));
Johannc3bdffb2015-05-15 11:52:03 -07001027
Johannc3bdffb2015-05-15 11:52:03 -07001028INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001029 SSE2, AvxVarianceTest,
1030 ::testing::Values(VarianceParams(6, 6, &aom_variance64x64_sse2),
1031 VarianceParams(6, 5, &aom_variance64x32_sse2),
1032 VarianceParams(5, 6, &aom_variance32x64_sse2),
1033 VarianceParams(5, 5, &aom_variance32x32_sse2),
1034 VarianceParams(5, 4, &aom_variance32x16_sse2),
1035 VarianceParams(4, 5, &aom_variance16x32_sse2),
1036 VarianceParams(4, 4, &aom_variance16x16_sse2),
1037 VarianceParams(4, 3, &aom_variance16x8_sse2),
1038 VarianceParams(3, 4, &aom_variance8x16_sse2),
1039 VarianceParams(3, 3, &aom_variance8x8_sse2),
1040 VarianceParams(3, 2, &aom_variance8x4_sse2),
1041 VarianceParams(2, 3, &aom_variance4x8_sse2),
1042 VarianceParams(2, 2, &aom_variance4x4_sse2)));
Johann6a82f0d2015-06-05 09:54:19 -07001043
Johann6a82f0d2015-06-05 09:54:19 -07001044INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001045 SSE2, AvxSubpelVarianceTest,
1046 ::testing::Values(make_tuple(6, 6, &aom_sub_pixel_variance64x64_sse2, 0),
1047 make_tuple(6, 5, &aom_sub_pixel_variance64x32_sse2, 0),
1048 make_tuple(5, 6, &aom_sub_pixel_variance32x64_sse2, 0),
1049 make_tuple(5, 5, &aom_sub_pixel_variance32x32_sse2, 0),
1050 make_tuple(5, 4, &aom_sub_pixel_variance32x16_sse2, 0),
1051 make_tuple(4, 5, &aom_sub_pixel_variance16x32_sse2, 0),
1052 make_tuple(4, 4, &aom_sub_pixel_variance16x16_sse2, 0),
1053 make_tuple(4, 3, &aom_sub_pixel_variance16x8_sse2, 0),
1054 make_tuple(3, 4, &aom_sub_pixel_variance8x16_sse2, 0),
1055 make_tuple(3, 3, &aom_sub_pixel_variance8x8_sse2, 0),
1056 make_tuple(3, 2, &aom_sub_pixel_variance8x4_sse2, 0),
1057 make_tuple(2, 3, &aom_sub_pixel_variance4x8_sse2, 0),
1058 make_tuple(2, 2, &aom_sub_pixel_variance4x4_sse2, 0)));
Johann6a82f0d2015-06-05 09:54:19 -07001059
Johann6a82f0d2015-06-05 09:54:19 -07001060INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001061 SSE2, AvxSubpelAvgVarianceTest,
Johann6a82f0d2015-06-05 09:54:19 -07001062 ::testing::Values(
Yaowu Xuf883b422016-08-30 14:01:10 -07001063 make_tuple(6, 6, &aom_sub_pixel_avg_variance64x64_sse2, 0),
1064 make_tuple(6, 5, &aom_sub_pixel_avg_variance64x32_sse2, 0),
1065 make_tuple(5, 6, &aom_sub_pixel_avg_variance32x64_sse2, 0),
1066 make_tuple(5, 5, &aom_sub_pixel_avg_variance32x32_sse2, 0),
1067 make_tuple(5, 4, &aom_sub_pixel_avg_variance32x16_sse2, 0),
1068 make_tuple(4, 5, &aom_sub_pixel_avg_variance16x32_sse2, 0),
1069 make_tuple(4, 4, &aom_sub_pixel_avg_variance16x16_sse2, 0),
1070 make_tuple(4, 3, &aom_sub_pixel_avg_variance16x8_sse2, 0),
1071 make_tuple(3, 4, &aom_sub_pixel_avg_variance8x16_sse2, 0),
1072 make_tuple(3, 3, &aom_sub_pixel_avg_variance8x8_sse2, 0),
1073 make_tuple(3, 2, &aom_sub_pixel_avg_variance8x4_sse2, 0),
1074 make_tuple(2, 3, &aom_sub_pixel_avg_variance4x8_sse2, 0),
1075 make_tuple(2, 2, &aom_sub_pixel_avg_variance4x4_sse2, 0)));
Johann6a82f0d2015-06-05 09:54:19 -07001076
Yaowu Xuf883b422016-08-30 14:01:10 -07001077#if HAVE_SSE4_1 && CONFIG_AOM_HIGHBITDEPTH
Yi Luoc2496892016-04-08 11:16:30 -07001078INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001079 SSE4_1, AvxSubpelVarianceTest,
Yi Luoc2496892016-04-08 11:16:30 -07001080 ::testing::Values(
Yaowu Xuf883b422016-08-30 14:01:10 -07001081 make_tuple(2, 2, &aom_highbd_8_sub_pixel_variance4x4_sse4_1, 8),
1082 make_tuple(2, 2, &aom_highbd_10_sub_pixel_variance4x4_sse4_1, 10),
1083 make_tuple(2, 2, &aom_highbd_12_sub_pixel_variance4x4_sse4_1, 12)));
Yi Luoc2496892016-04-08 11:16:30 -07001084
1085INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001086 SSE4_1, AvxSubpelAvgVarianceTest,
Yi Luoc2496892016-04-08 11:16:30 -07001087 ::testing::Values(
Yaowu Xuf883b422016-08-30 14:01:10 -07001088 make_tuple(2, 2, &aom_highbd_8_sub_pixel_avg_variance4x4_sse4_1, 8),
1089 make_tuple(2, 2, &aom_highbd_10_sub_pixel_avg_variance4x4_sse4_1, 10),
1090 make_tuple(2, 2, &aom_highbd_12_sub_pixel_avg_variance4x4_sse4_1, 12)));
1091#endif // HAVE_SSE4_1 && CONFIG_AOM_HIGHBITDEPTH
Yi Luoc2496892016-04-08 11:16:30 -07001092
Yaowu Xuf883b422016-08-30 14:01:10 -07001093#if CONFIG_AOM_HIGHBITDEPTH
Johannc3bdffb2015-05-15 11:52:03 -07001094/* TODO(debargha): This test does not support the highbd version
Johannc3bdffb2015-05-15 11:52:03 -07001095INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001096 SSE2, AvxHBDMseTest,
1097 ::testing::Values(MseParams(4, 4, &aom_highbd_12_mse16x16_sse2),
1098 MseParams(4, 3, &aom_highbd_12_mse16x8_sse2),
1099 MseParams(3, 4, &aom_highbd_12_mse8x16_sse2),
1100 MseParams(3, 3, &aom_highbd_12_mse8x8_sse2),
1101 MseParams(4, 4, &aom_highbd_10_mse16x16_sse2),
1102 MseParams(4, 3, &aom_highbd_10_mse16x8_sse2),
1103 MseParams(3, 4, &aom_highbd_10_mse8x16_sse2),
1104 MseParams(3, 3, &aom_highbd_10_mse8x8_sse2),
1105 MseParams(4, 4, &aom_highbd_8_mse16x16_sse2),
1106 MseParams(4, 3, &aom_highbd_8_mse16x8_sse2),
1107 MseParams(3, 4, &aom_highbd_8_mse8x16_sse2),
1108 MseParams(3, 3, &aom_highbd_8_mse8x8_sse2)));
Johannc3bdffb2015-05-15 11:52:03 -07001109*/
1110
Johannc3bdffb2015-05-15 11:52:03 -07001111INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001112 SSE2, AvxHBDVarianceTest,
skal8dbbcda2016-07-13 17:33:22 -07001113 ::testing::Values(
Yaowu Xuf883b422016-08-30 14:01:10 -07001114 VarianceParams(6, 6, &aom_highbd_12_variance64x64_sse2, 12),
1115 VarianceParams(6, 5, &aom_highbd_12_variance64x32_sse2, 12),
1116 VarianceParams(5, 6, &aom_highbd_12_variance32x64_sse2, 12),
1117 VarianceParams(5, 5, &aom_highbd_12_variance32x32_sse2, 12),
1118 VarianceParams(5, 4, &aom_highbd_12_variance32x16_sse2, 12),
1119 VarianceParams(4, 5, &aom_highbd_12_variance16x32_sse2, 12),
1120 VarianceParams(4, 4, &aom_highbd_12_variance16x16_sse2, 12),
1121 VarianceParams(4, 3, &aom_highbd_12_variance16x8_sse2, 12),
1122 VarianceParams(3, 4, &aom_highbd_12_variance8x16_sse2, 12),
1123 VarianceParams(3, 3, &aom_highbd_12_variance8x8_sse2, 12),
1124 VarianceParams(6, 6, &aom_highbd_10_variance64x64_sse2, 10),
1125 VarianceParams(6, 5, &aom_highbd_10_variance64x32_sse2, 10),
1126 VarianceParams(5, 6, &aom_highbd_10_variance32x64_sse2, 10),
1127 VarianceParams(5, 5, &aom_highbd_10_variance32x32_sse2, 10),
1128 VarianceParams(5, 4, &aom_highbd_10_variance32x16_sse2, 10),
1129 VarianceParams(4, 5, &aom_highbd_10_variance16x32_sse2, 10),
1130 VarianceParams(4, 4, &aom_highbd_10_variance16x16_sse2, 10),
1131 VarianceParams(4, 3, &aom_highbd_10_variance16x8_sse2, 10),
1132 VarianceParams(3, 4, &aom_highbd_10_variance8x16_sse2, 10),
1133 VarianceParams(3, 3, &aom_highbd_10_variance8x8_sse2, 10),
1134 VarianceParams(6, 6, &aom_highbd_8_variance64x64_sse2, 8),
1135 VarianceParams(6, 5, &aom_highbd_8_variance64x32_sse2, 8),
1136 VarianceParams(5, 6, &aom_highbd_8_variance32x64_sse2, 8),
1137 VarianceParams(5, 5, &aom_highbd_8_variance32x32_sse2, 8),
1138 VarianceParams(5, 4, &aom_highbd_8_variance32x16_sse2, 8),
1139 VarianceParams(4, 5, &aom_highbd_8_variance16x32_sse2, 8),
1140 VarianceParams(4, 4, &aom_highbd_8_variance16x16_sse2, 8),
1141 VarianceParams(4, 3, &aom_highbd_8_variance16x8_sse2, 8),
1142 VarianceParams(3, 4, &aom_highbd_8_variance8x16_sse2, 8),
1143 VarianceParams(3, 3, &aom_highbd_8_variance8x8_sse2, 8)));
Johannc3bdffb2015-05-15 11:52:03 -07001144
Peter de Rivaz48032bf2014-10-16 14:00:54 +01001145INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001146 SSE2, AvxHBDSubpelVarianceTest,
James Zern837cea42015-11-05 19:00:45 -08001147 ::testing::Values(
Yaowu Xuf883b422016-08-30 14:01:10 -07001148 make_tuple(6, 6, &aom_highbd_12_sub_pixel_variance64x64_sse2, 12),
1149 make_tuple(6, 5, &aom_highbd_12_sub_pixel_variance64x32_sse2, 12),
1150 make_tuple(5, 6, &aom_highbd_12_sub_pixel_variance32x64_sse2, 12),
1151 make_tuple(5, 5, &aom_highbd_12_sub_pixel_variance32x32_sse2, 12),
1152 make_tuple(5, 4, &aom_highbd_12_sub_pixel_variance32x16_sse2, 12),
1153 make_tuple(4, 5, &aom_highbd_12_sub_pixel_variance16x32_sse2, 12),
1154 make_tuple(4, 4, &aom_highbd_12_sub_pixel_variance16x16_sse2, 12),
1155 make_tuple(4, 3, &aom_highbd_12_sub_pixel_variance16x8_sse2, 12),
1156 make_tuple(3, 4, &aom_highbd_12_sub_pixel_variance8x16_sse2, 12),
1157 make_tuple(3, 3, &aom_highbd_12_sub_pixel_variance8x8_sse2, 12),
1158 make_tuple(3, 2, &aom_highbd_12_sub_pixel_variance8x4_sse2, 12),
1159 make_tuple(6, 6, &aom_highbd_10_sub_pixel_variance64x64_sse2, 10),
1160 make_tuple(6, 5, &aom_highbd_10_sub_pixel_variance64x32_sse2, 10),
1161 make_tuple(5, 6, &aom_highbd_10_sub_pixel_variance32x64_sse2, 10),
1162 make_tuple(5, 5, &aom_highbd_10_sub_pixel_variance32x32_sse2, 10),
1163 make_tuple(5, 4, &aom_highbd_10_sub_pixel_variance32x16_sse2, 10),
1164 make_tuple(4, 5, &aom_highbd_10_sub_pixel_variance16x32_sse2, 10),
1165 make_tuple(4, 4, &aom_highbd_10_sub_pixel_variance16x16_sse2, 10),
1166 make_tuple(4, 3, &aom_highbd_10_sub_pixel_variance16x8_sse2, 10),
1167 make_tuple(3, 4, &aom_highbd_10_sub_pixel_variance8x16_sse2, 10),
1168 make_tuple(3, 3, &aom_highbd_10_sub_pixel_variance8x8_sse2, 10),
1169 make_tuple(3, 2, &aom_highbd_10_sub_pixel_variance8x4_sse2, 10),
1170 make_tuple(6, 6, &aom_highbd_8_sub_pixel_variance64x64_sse2, 8),
1171 make_tuple(6, 5, &aom_highbd_8_sub_pixel_variance64x32_sse2, 8),
1172 make_tuple(5, 6, &aom_highbd_8_sub_pixel_variance32x64_sse2, 8),
1173 make_tuple(5, 5, &aom_highbd_8_sub_pixel_variance32x32_sse2, 8),
1174 make_tuple(5, 4, &aom_highbd_8_sub_pixel_variance32x16_sse2, 8),
1175 make_tuple(4, 5, &aom_highbd_8_sub_pixel_variance16x32_sse2, 8),
1176 make_tuple(4, 4, &aom_highbd_8_sub_pixel_variance16x16_sse2, 8),
1177 make_tuple(4, 3, &aom_highbd_8_sub_pixel_variance16x8_sse2, 8),
1178 make_tuple(3, 4, &aom_highbd_8_sub_pixel_variance8x16_sse2, 8),
1179 make_tuple(3, 3, &aom_highbd_8_sub_pixel_variance8x8_sse2, 8),
1180 make_tuple(3, 2, &aom_highbd_8_sub_pixel_variance8x4_sse2, 8)));
Johann6a82f0d2015-06-05 09:54:19 -07001181
Peter de Rivaz48032bf2014-10-16 14:00:54 +01001182INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001183 SSE2, AvxHBDSubpelAvgVarianceTest,
Peter de Rivaz48032bf2014-10-16 14:00:54 +01001184 ::testing::Values(
Yaowu Xuf883b422016-08-30 14:01:10 -07001185 make_tuple(6, 6, &aom_highbd_12_sub_pixel_avg_variance64x64_sse2, 12),
1186 make_tuple(6, 5, &aom_highbd_12_sub_pixel_avg_variance64x32_sse2, 12),
1187 make_tuple(5, 6, &aom_highbd_12_sub_pixel_avg_variance32x64_sse2, 12),
1188 make_tuple(5, 5, &aom_highbd_12_sub_pixel_avg_variance32x32_sse2, 12),
1189 make_tuple(5, 4, &aom_highbd_12_sub_pixel_avg_variance32x16_sse2, 12),
1190 make_tuple(4, 5, &aom_highbd_12_sub_pixel_avg_variance16x32_sse2, 12),
1191 make_tuple(4, 4, &aom_highbd_12_sub_pixel_avg_variance16x16_sse2, 12),
1192 make_tuple(4, 3, &aom_highbd_12_sub_pixel_avg_variance16x8_sse2, 12),
1193 make_tuple(3, 4, &aom_highbd_12_sub_pixel_avg_variance8x16_sse2, 12),
1194 make_tuple(3, 3, &aom_highbd_12_sub_pixel_avg_variance8x8_sse2, 12),
1195 make_tuple(3, 2, &aom_highbd_12_sub_pixel_avg_variance8x4_sse2, 12),
1196 make_tuple(6, 6, &aom_highbd_10_sub_pixel_avg_variance64x64_sse2, 10),
1197 make_tuple(6, 5, &aom_highbd_10_sub_pixel_avg_variance64x32_sse2, 10),
1198 make_tuple(5, 6, &aom_highbd_10_sub_pixel_avg_variance32x64_sse2, 10),
1199 make_tuple(5, 5, &aom_highbd_10_sub_pixel_avg_variance32x32_sse2, 10),
1200 make_tuple(5, 4, &aom_highbd_10_sub_pixel_avg_variance32x16_sse2, 10),
1201 make_tuple(4, 5, &aom_highbd_10_sub_pixel_avg_variance16x32_sse2, 10),
1202 make_tuple(4, 4, &aom_highbd_10_sub_pixel_avg_variance16x16_sse2, 10),
1203 make_tuple(4, 3, &aom_highbd_10_sub_pixel_avg_variance16x8_sse2, 10),
1204 make_tuple(3, 4, &aom_highbd_10_sub_pixel_avg_variance8x16_sse2, 10),
1205 make_tuple(3, 3, &aom_highbd_10_sub_pixel_avg_variance8x8_sse2, 10),
1206 make_tuple(3, 2, &aom_highbd_10_sub_pixel_avg_variance8x4_sse2, 10),
1207 make_tuple(6, 6, &aom_highbd_8_sub_pixel_avg_variance64x64_sse2, 8),
1208 make_tuple(6, 5, &aom_highbd_8_sub_pixel_avg_variance64x32_sse2, 8),
1209 make_tuple(5, 6, &aom_highbd_8_sub_pixel_avg_variance32x64_sse2, 8),
1210 make_tuple(5, 5, &aom_highbd_8_sub_pixel_avg_variance32x32_sse2, 8),
1211 make_tuple(5, 4, &aom_highbd_8_sub_pixel_avg_variance32x16_sse2, 8),
1212 make_tuple(4, 5, &aom_highbd_8_sub_pixel_avg_variance16x32_sse2, 8),
1213 make_tuple(4, 4, &aom_highbd_8_sub_pixel_avg_variance16x16_sse2, 8),
1214 make_tuple(4, 3, &aom_highbd_8_sub_pixel_avg_variance16x8_sse2, 8),
1215 make_tuple(3, 4, &aom_highbd_8_sub_pixel_avg_variance8x16_sse2, 8),
1216 make_tuple(3, 3, &aom_highbd_8_sub_pixel_avg_variance8x8_sse2, 8),
1217 make_tuple(3, 2, &aom_highbd_8_sub_pixel_avg_variance8x4_sse2, 8)));
1218#endif // CONFIG_AOM_HIGHBITDEPTH
Peter de Rivaz48032bf2014-10-16 14:00:54 +01001219#endif // HAVE_SSE2
Johannc3bdffb2015-05-15 11:52:03 -07001220
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -07001221#if HAVE_SSSE3
Ronald S. Bultje8fb6c582013-06-20 09:34:25 -07001222INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001223 SSSE3, AvxSubpelVarianceTest,
1224 ::testing::Values(make_tuple(6, 6, &aom_sub_pixel_variance64x64_ssse3, 0),
1225 make_tuple(6, 5, &aom_sub_pixel_variance64x32_ssse3, 0),
1226 make_tuple(5, 6, &aom_sub_pixel_variance32x64_ssse3, 0),
1227 make_tuple(5, 5, &aom_sub_pixel_variance32x32_ssse3, 0),
1228 make_tuple(5, 4, &aom_sub_pixel_variance32x16_ssse3, 0),
1229 make_tuple(4, 5, &aom_sub_pixel_variance16x32_ssse3, 0),
1230 make_tuple(4, 4, &aom_sub_pixel_variance16x16_ssse3, 0),
1231 make_tuple(4, 3, &aom_sub_pixel_variance16x8_ssse3, 0),
1232 make_tuple(3, 4, &aom_sub_pixel_variance8x16_ssse3, 0),
1233 make_tuple(3, 3, &aom_sub_pixel_variance8x8_ssse3, 0),
1234 make_tuple(3, 2, &aom_sub_pixel_variance8x4_ssse3, 0),
1235 make_tuple(2, 3, &aom_sub_pixel_variance4x8_ssse3, 0),
1236 make_tuple(2, 2, &aom_sub_pixel_variance4x4_ssse3, 0)));
Johann6a82f0d2015-06-05 09:54:19 -07001237
Ronald S. Bultje1e6a32f2013-06-20 15:59:48 -07001238INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001239 SSSE3, AvxSubpelAvgVarianceTest,
James Zern837cea42015-11-05 19:00:45 -08001240 ::testing::Values(
Yaowu Xuf883b422016-08-30 14:01:10 -07001241 make_tuple(6, 6, &aom_sub_pixel_avg_variance64x64_ssse3, 0),
1242 make_tuple(6, 5, &aom_sub_pixel_avg_variance64x32_ssse3, 0),
1243 make_tuple(5, 6, &aom_sub_pixel_avg_variance32x64_ssse3, 0),
1244 make_tuple(5, 5, &aom_sub_pixel_avg_variance32x32_ssse3, 0),
1245 make_tuple(5, 4, &aom_sub_pixel_avg_variance32x16_ssse3, 0),
1246 make_tuple(4, 5, &aom_sub_pixel_avg_variance16x32_ssse3, 0),
1247 make_tuple(4, 4, &aom_sub_pixel_avg_variance16x16_ssse3, 0),
1248 make_tuple(4, 3, &aom_sub_pixel_avg_variance16x8_ssse3, 0),
1249 make_tuple(3, 4, &aom_sub_pixel_avg_variance8x16_ssse3, 0),
1250 make_tuple(3, 3, &aom_sub_pixel_avg_variance8x8_ssse3, 0),
1251 make_tuple(3, 2, &aom_sub_pixel_avg_variance8x4_ssse3, 0),
1252 make_tuple(2, 3, &aom_sub_pixel_avg_variance4x8_ssse3, 0),
1253 make_tuple(2, 2, &aom_sub_pixel_avg_variance4x4_ssse3, 0)));
Peter de Rivaz48032bf2014-10-16 14:00:54 +01001254#endif // HAVE_SSSE3
Johanneb88b172015-05-26 11:30:25 -07001255
James Zern520cb3f2014-06-08 18:25:37 -07001256#if HAVE_AVX2
Yaowu Xuf883b422016-08-30 14:01:10 -07001257INSTANTIATE_TEST_CASE_P(AVX2, AvxMseTest,
1258 ::testing::Values(MseParams(4, 4, &aom_mse16x16_avx2)));
levytamar8269a5f5e2014-07-24 00:20:19 -07001259
James Zern520cb3f2014-06-08 18:25:37 -07001260INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001261 AVX2, AvxVarianceTest,
1262 ::testing::Values(VarianceParams(6, 6, &aom_variance64x64_avx2),
1263 VarianceParams(6, 5, &aom_variance64x32_avx2),
1264 VarianceParams(5, 5, &aom_variance32x32_avx2),
1265 VarianceParams(5, 4, &aom_variance32x16_avx2),
1266 VarianceParams(4, 4, &aom_variance16x16_avx2)));
James Zern520cb3f2014-06-08 18:25:37 -07001267
James Zern520cb3f2014-06-08 18:25:37 -07001268INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001269 AVX2, AvxSubpelVarianceTest,
1270 ::testing::Values(make_tuple(6, 6, &aom_sub_pixel_variance64x64_avx2, 0),
1271 make_tuple(5, 5, &aom_sub_pixel_variance32x32_avx2, 0)));
James Zern520cb3f2014-06-08 18:25:37 -07001272
James Zern520cb3f2014-06-08 18:25:37 -07001273INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001274 AVX2, AvxSubpelAvgVarianceTest,
James Zern837cea42015-11-05 19:00:45 -08001275 ::testing::Values(
Yaowu Xuf883b422016-08-30 14:01:10 -07001276 make_tuple(6, 6, &aom_sub_pixel_avg_variance64x64_avx2, 0),
1277 make_tuple(5, 5, &aom_sub_pixel_avg_variance32x32_avx2, 0)));
James Zern520cb3f2014-06-08 18:25:37 -07001278#endif // HAVE_AVX2
Scott LaVarnway521cf7e2014-07-29 16:47:34 -07001279
Johanneb88b172015-05-26 11:30:25 -07001280#if HAVE_MEDIA
Yaowu Xuf883b422016-08-30 14:01:10 -07001281INSTANTIATE_TEST_CASE_P(MEDIA, AvxMseTest,
skal8dbbcda2016-07-13 17:33:22 -07001282 ::testing::Values(MseParams(4, 4,
Yaowu Xuf883b422016-08-30 14:01:10 -07001283 &aom_mse16x16_media)));
Johann6a82f0d2015-06-05 09:54:19 -07001284
Johanneb88b172015-05-26 11:30:25 -07001285INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001286 MEDIA, AvxVarianceTest,
1287 ::testing::Values(VarianceParams(4, 4, &aom_variance16x16_media),
1288 VarianceParams(3, 3, &aom_variance8x8_media)));
Johann6a82f0d2015-06-05 09:54:19 -07001289
Johann6a82f0d2015-06-05 09:54:19 -07001290INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001291 MEDIA, AvxSubpelVarianceTest,
1292 ::testing::Values(make_tuple(4, 4, &aom_sub_pixel_variance16x16_media, 0),
1293 make_tuple(3, 3, &aom_sub_pixel_variance8x8_media, 0)));
Johanneb88b172015-05-26 11:30:25 -07001294#endif // HAVE_MEDIA
Johanneb88b172015-05-26 11:30:25 -07001295
Johannc3bdffb2015-05-15 11:52:03 -07001296#if HAVE_NEON
Yaowu Xuf883b422016-08-30 14:01:10 -07001297INSTANTIATE_TEST_CASE_P(NEON, AvxSseTest,
skal8dbbcda2016-07-13 17:33:22 -07001298 ::testing::Values(SseParams(2, 2,
Yaowu Xuf883b422016-08-30 14:01:10 -07001299 &aom_get4x4sse_cs_neon)));
Johannc3bdffb2015-05-15 11:52:03 -07001300
Yaowu Xuf883b422016-08-30 14:01:10 -07001301INSTANTIATE_TEST_CASE_P(NEON, AvxMseTest,
1302 ::testing::Values(MseParams(4, 4, &aom_mse16x16_neon)));
Johannc3bdffb2015-05-15 11:52:03 -07001303
Johannc3bdffb2015-05-15 11:52:03 -07001304INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001305 NEON, AvxVarianceTest,
1306 ::testing::Values(VarianceParams(6, 6, &aom_variance64x64_neon),
1307 VarianceParams(6, 5, &aom_variance64x32_neon),
1308 VarianceParams(5, 6, &aom_variance32x64_neon),
1309 VarianceParams(5, 5, &aom_variance32x32_neon),
1310 VarianceParams(4, 4, &aom_variance16x16_neon),
1311 VarianceParams(4, 3, &aom_variance16x8_neon),
1312 VarianceParams(3, 4, &aom_variance8x16_neon),
1313 VarianceParams(3, 3, &aom_variance8x8_neon)));
Johannc3bdffb2015-05-15 11:52:03 -07001314
Scott LaVarnway521cf7e2014-07-29 16:47:34 -07001315INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001316 NEON, AvxSubpelVarianceTest,
1317 ::testing::Values(make_tuple(6, 6, &aom_sub_pixel_variance64x64_neon, 0),
1318 make_tuple(5, 5, &aom_sub_pixel_variance32x32_neon, 0),
1319 make_tuple(4, 4, &aom_sub_pixel_variance16x16_neon, 0),
1320 make_tuple(3, 3, &aom_sub_pixel_variance8x8_neon, 0)));
Johannc3bdffb2015-05-15 11:52:03 -07001321#endif // HAVE_NEON
James Zern1711cf22013-02-22 16:23:36 -08001322
Parag Salasakar2d730a22015-06-26 14:02:16 +05301323#if HAVE_MSA
1324INSTANTIATE_TEST_CASE_P(MSA, SumOfSquaresTest,
Yaowu Xuf883b422016-08-30 14:01:10 -07001325 ::testing::Values(aom_get_mb_ss_msa));
Parag Salasakar2d730a22015-06-26 14:02:16 +05301326
Yaowu Xuf883b422016-08-30 14:01:10 -07001327INSTANTIATE_TEST_CASE_P(MSA, AvxSseTest,
skal8dbbcda2016-07-13 17:33:22 -07001328 ::testing::Values(SseParams(2, 2,
Yaowu Xuf883b422016-08-30 14:01:10 -07001329 &aom_get4x4sse_cs_msa)));
Parag Salasakar2d730a22015-06-26 14:02:16 +05301330
Yaowu Xuf883b422016-08-30 14:01:10 -07001331INSTANTIATE_TEST_CASE_P(MSA, AvxMseTest,
1332 ::testing::Values(MseParams(4, 4, &aom_mse16x16_msa),
1333 MseParams(4, 3, &aom_mse16x8_msa),
1334 MseParams(3, 4, &aom_mse8x16_msa),
1335 MseParams(3, 3, &aom_mse8x8_msa)));
Parag Salasakar2d730a22015-06-26 14:02:16 +05301336
Parag Salasakar2d730a22015-06-26 14:02:16 +05301337INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001338 MSA, AvxVarianceTest,
1339 ::testing::Values(VarianceParams(6, 6, &aom_variance64x64_msa),
1340 VarianceParams(6, 5, &aom_variance64x32_msa),
1341 VarianceParams(5, 6, &aom_variance32x64_msa),
1342 VarianceParams(5, 5, &aom_variance32x32_msa),
1343 VarianceParams(5, 4, &aom_variance32x16_msa),
1344 VarianceParams(4, 5, &aom_variance16x32_msa),
1345 VarianceParams(4, 4, &aom_variance16x16_msa),
1346 VarianceParams(4, 3, &aom_variance16x8_msa),
1347 VarianceParams(3, 4, &aom_variance8x16_msa),
1348 VarianceParams(3, 3, &aom_variance8x8_msa),
1349 VarianceParams(3, 2, &aom_variance8x4_msa),
1350 VarianceParams(2, 3, &aom_variance4x8_msa),
1351 VarianceParams(2, 2, &aom_variance4x4_msa)));
Parag Salasakarfbe67d32015-07-05 21:44:06 +05301352
Parag Salasakarfbe67d32015-07-05 21:44:06 +05301353INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001354 MSA, AvxSubpelVarianceTest,
1355 ::testing::Values(make_tuple(2, 2, &aom_sub_pixel_variance4x4_msa, 0),
1356 make_tuple(2, 3, &aom_sub_pixel_variance4x8_msa, 0),
1357 make_tuple(3, 2, &aom_sub_pixel_variance8x4_msa, 0),
1358 make_tuple(3, 3, &aom_sub_pixel_variance8x8_msa, 0),
1359 make_tuple(3, 4, &aom_sub_pixel_variance8x16_msa, 0),
1360 make_tuple(4, 3, &aom_sub_pixel_variance16x8_msa, 0),
1361 make_tuple(4, 4, &aom_sub_pixel_variance16x16_msa, 0),
1362 make_tuple(4, 5, &aom_sub_pixel_variance16x32_msa, 0),
1363 make_tuple(5, 4, &aom_sub_pixel_variance32x16_msa, 0),
1364 make_tuple(5, 5, &aom_sub_pixel_variance32x32_msa, 0),
1365 make_tuple(5, 6, &aom_sub_pixel_variance32x64_msa, 0),
1366 make_tuple(6, 5, &aom_sub_pixel_variance64x32_msa, 0),
1367 make_tuple(6, 6, &aom_sub_pixel_variance64x64_msa, 0)));
Parag Salasakar1d7f1ca2015-07-08 12:07:28 +05301368
Parag Salasakar1d7f1ca2015-07-08 12:07:28 +05301369INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -07001370 MSA, AvxSubpelAvgVarianceTest,
1371 ::testing::Values(make_tuple(6, 6, &aom_sub_pixel_avg_variance64x64_msa, 0),
1372 make_tuple(6, 5, &aom_sub_pixel_avg_variance64x32_msa, 0),
1373 make_tuple(5, 6, &aom_sub_pixel_avg_variance32x64_msa, 0),
1374 make_tuple(5, 5, &aom_sub_pixel_avg_variance32x32_msa, 0),
1375 make_tuple(5, 4, &aom_sub_pixel_avg_variance32x16_msa, 0),
1376 make_tuple(4, 5, &aom_sub_pixel_avg_variance16x32_msa, 0),
1377 make_tuple(4, 4, &aom_sub_pixel_avg_variance16x16_msa, 0),
1378 make_tuple(4, 3, &aom_sub_pixel_avg_variance16x8_msa, 0),
1379 make_tuple(3, 4, &aom_sub_pixel_avg_variance8x16_msa, 0),
1380 make_tuple(3, 3, &aom_sub_pixel_avg_variance8x8_msa, 0),
1381 make_tuple(3, 2, &aom_sub_pixel_avg_variance8x4_msa, 0),
1382 make_tuple(2, 3, &aom_sub_pixel_avg_variance4x8_msa, 0),
1383 make_tuple(2, 2, &aom_sub_pixel_avg_variance4x4_msa, 0)));
Parag Salasakar2d730a22015-06-26 14:02:16 +05301384#endif // HAVE_MSA
James Zern98473442012-11-06 16:58:11 -08001385} // namespace