2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
14 #include "third_party/googletest/src/include/gtest/gtest.h"
16 #include "./vpx_config.h"
17 #include "./vpx_dsp_rtcd.h"
18 #include "test/acm_random.h"
19 #include "test/bench.h"
20 #include "test/clear_system_state.h"
21 #include "test/register_state_check.h"
22 #include "test/util.h"
23 #include "vpx/vpx_codec.h"
24 #include "vpx_mem/vpx_mem.h"
25 #include "vpx_ports/mem.h"
26 #include "vpx_ports/msvc.h"
27 #include "vpx_ports/vpx_timer.h"
29 // const[expr] should be sufficient for DECLARE_ALIGNED but early
30 // implementations of c++11 appear to have some issues with it.
31 #define kDataAlignment 32
33 template <typename Function>
35 TestParams(int w, int h, Function f, int bd = -1)
36 : width(w), height(h), bit_depth(bd), func(f) {}
37 int width, height, bit_depth;
41 typedef unsigned int (*SadMxNFunc)(const uint8_t *src_ptr, int src_stride,
42 const uint8_t *ref_ptr, int ref_stride);
43 typedef TestParams<SadMxNFunc> SadMxNParam;
45 typedef unsigned int (*SadMxNAvgFunc)(const uint8_t *src_ptr, int src_stride,
46 const uint8_t *ref_ptr, int ref_stride,
47 const uint8_t *second_pred);
48 typedef TestParams<SadMxNAvgFunc> SadMxNAvgParam;
50 typedef void (*SadMxNx4Func)(const uint8_t *src_ptr, int src_stride,
51 const uint8_t *const ref_ptr[], int ref_stride,
52 unsigned int *sad_array);
53 typedef TestParams<SadMxNx4Func> SadMxNx4Param;
55 typedef void (*SadMxNx8Func)(const uint8_t *src_ptr, int src_stride,
56 const uint8_t *ref_ptr, int ref_stride,
57 unsigned int *sad_array);
59 using libvpx_test::ACMRandom;
62 template <typename ParamType>
63 class SADTestBase : public ::testing::TestWithParam<ParamType> {
65 explicit SADTestBase(const ParamType ¶ms) : params_(params) {}
67 virtual void SetUp() {
68 source_data8_ = reinterpret_cast<uint8_t *>(
69 vpx_memalign(kDataAlignment, kDataBlockSize));
70 reference_data8_ = reinterpret_cast<uint8_t *>(
71 vpx_memalign(kDataAlignment, kDataBufferSize));
73 reinterpret_cast<uint8_t *>(vpx_memalign(kDataAlignment, 64 * 64));
74 source_data16_ = reinterpret_cast<uint16_t *>(
75 vpx_memalign(kDataAlignment, kDataBlockSize * sizeof(uint16_t)));
76 reference_data16_ = reinterpret_cast<uint16_t *>(
77 vpx_memalign(kDataAlignment, kDataBufferSize * sizeof(uint16_t)));
78 second_pred16_ = reinterpret_cast<uint16_t *>(
79 vpx_memalign(kDataAlignment, 64 * 64 * sizeof(uint16_t)));
81 if (params_.bit_depth == -1) {
82 use_high_bit_depth_ = false;
83 bit_depth_ = VPX_BITS_8;
84 source_data_ = source_data8_;
85 reference_data_ = reference_data8_;
86 second_pred_ = second_pred8_;
87 #if CONFIG_VP9_HIGHBITDEPTH
89 use_high_bit_depth_ = true;
90 bit_depth_ = static_cast<vpx_bit_depth_t>(params_.bit_depth);
91 source_data_ = CONVERT_TO_BYTEPTR(source_data16_);
92 reference_data_ = CONVERT_TO_BYTEPTR(reference_data16_);
93 second_pred_ = CONVERT_TO_BYTEPTR(second_pred16_);
94 #endif // CONFIG_VP9_HIGHBITDEPTH
96 mask_ = (1 << bit_depth_) - 1;
97 source_stride_ = (params_.width + 63) & ~63;
98 reference_stride_ = params_.width * 2;
99 rnd_.Reset(ACMRandom::DeterministicSeed());
102 virtual void TearDown() {
103 vpx_free(source_data8_);
104 source_data8_ = nullptr;
105 vpx_free(reference_data8_);
106 reference_data8_ = nullptr;
107 vpx_free(second_pred8_);
108 second_pred8_ = nullptr;
109 vpx_free(source_data16_);
110 source_data16_ = nullptr;
111 vpx_free(reference_data16_);
112 reference_data16_ = nullptr;
113 vpx_free(second_pred16_);
114 second_pred16_ = nullptr;
116 libvpx_test::ClearSystemState();
120 // Handle blocks up to 4 blocks 64x64 with stride up to 128
121 // crbug.com/webm/1660
122 static const int kDataBlockSize = 64 * 128;
123 static const int kDataBufferSize = 4 * kDataBlockSize;
125 int GetBlockRefOffset(int block_idx) const {
126 return block_idx * kDataBlockSize;
129 uint8_t *GetReferenceFromOffset(int ref_offset) const {
130 assert((params_.height - 1) * reference_stride_ + params_.width - 1 +
133 #if CONFIG_VP9_HIGHBITDEPTH
134 if (use_high_bit_depth_) {
135 return CONVERT_TO_BYTEPTR(CONVERT_TO_SHORTPTR(reference_data_) +
138 #endif // CONFIG_VP9_HIGHBITDEPTH
139 return reference_data_ + ref_offset;
142 uint8_t *GetReference(int block_idx) const {
143 return GetReferenceFromOffset(GetBlockRefOffset(block_idx));
146 // Sum of Absolute Differences. Given two blocks, calculate the absolute
147 // difference between two pixels in the same relative location; accumulate.
148 uint32_t ReferenceSAD(int ref_offset) const {
150 const uint8_t *const reference8 = GetReferenceFromOffset(ref_offset);
151 const uint8_t *const source8 = source_data_;
152 #if CONFIG_VP9_HIGHBITDEPTH
153 const uint16_t *const reference16 =
154 CONVERT_TO_SHORTPTR(GetReferenceFromOffset(ref_offset));
155 const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_);
156 #endif // CONFIG_VP9_HIGHBITDEPTH
157 for (int h = 0; h < params_.height; ++h) {
158 for (int w = 0; w < params_.width; ++w) {
159 if (!use_high_bit_depth_) {
160 sad += abs(source8[h * source_stride_ + w] -
161 reference8[h * reference_stride_ + w]);
162 #if CONFIG_VP9_HIGHBITDEPTH
164 sad += abs(source16[h * source_stride_ + w] -
165 reference16[h * reference_stride_ + w]);
166 #endif // CONFIG_VP9_HIGHBITDEPTH
173 // Sum of Absolute Differences Average. Given two blocks, and a prediction
174 // calculate the absolute difference between one pixel and average of the
175 // corresponding and predicted pixels; accumulate.
176 unsigned int ReferenceSADavg(int block_idx) const {
177 unsigned int sad = 0;
178 const uint8_t *const reference8 = GetReference(block_idx);
179 const uint8_t *const source8 = source_data_;
180 const uint8_t *const second_pred8 = second_pred_;
181 #if CONFIG_VP9_HIGHBITDEPTH
182 const uint16_t *const reference16 =
183 CONVERT_TO_SHORTPTR(GetReference(block_idx));
184 const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_);
185 const uint16_t *const second_pred16 = CONVERT_TO_SHORTPTR(second_pred_);
186 #endif // CONFIG_VP9_HIGHBITDEPTH
187 for (int h = 0; h < params_.height; ++h) {
188 for (int w = 0; w < params_.width; ++w) {
189 if (!use_high_bit_depth_) {
190 const int tmp = second_pred8[h * params_.width + w] +
191 reference8[h * reference_stride_ + w];
192 const uint8_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1);
193 sad += abs(source8[h * source_stride_ + w] - comp_pred);
194 #if CONFIG_VP9_HIGHBITDEPTH
196 const int tmp = second_pred16[h * params_.width + w] +
197 reference16[h * reference_stride_ + w];
198 const uint16_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1);
199 sad += abs(source16[h * source_stride_ + w] - comp_pred);
200 #endif // CONFIG_VP9_HIGHBITDEPTH
207 void FillConstant(uint8_t *data, int stride, uint16_t fill_constant) const {
208 uint8_t *data8 = data;
209 #if CONFIG_VP9_HIGHBITDEPTH
210 uint16_t *data16 = CONVERT_TO_SHORTPTR(data);
211 #endif // CONFIG_VP9_HIGHBITDEPTH
212 for (int h = 0; h < params_.height; ++h) {
213 for (int w = 0; w < params_.width; ++w) {
214 if (!use_high_bit_depth_) {
215 data8[h * stride + w] = static_cast<uint8_t>(fill_constant);
216 #if CONFIG_VP9_HIGHBITDEPTH
218 data16[h * stride + w] = fill_constant;
219 #endif // CONFIG_VP9_HIGHBITDEPTH
225 void FillRandomWH(uint8_t *data, int stride, int w, int h) {
226 uint8_t *data8 = data;
227 #if CONFIG_VP9_HIGHBITDEPTH
228 uint16_t *data16 = CONVERT_TO_SHORTPTR(data);
229 #endif // CONFIG_VP9_HIGHBITDEPTH
230 for (int r = 0; r < h; ++r) {
231 for (int c = 0; c < w; ++c) {
232 if (!use_high_bit_depth_) {
233 data8[r * stride + c] = rnd_.Rand8();
234 #if CONFIG_VP9_HIGHBITDEPTH
236 data16[r * stride + c] = rnd_.Rand16() & mask_;
237 #endif // CONFIG_VP9_HIGHBITDEPTH
243 void FillRandom(uint8_t *data, int stride) {
244 FillRandomWH(data, stride, params_.width, params_.height);
248 vpx_bit_depth_t bit_depth_;
250 int reference_stride_;
251 bool use_high_bit_depth_;
253 uint8_t *source_data_;
254 uint8_t *reference_data_;
255 uint8_t *second_pred_;
256 uint8_t *source_data8_;
257 uint8_t *reference_data8_;
258 uint8_t *second_pred8_;
259 uint16_t *source_data16_;
260 uint16_t *reference_data16_;
261 uint16_t *second_pred16_;
267 class SADx4Test : public SADTestBase<SadMxNx4Param> {
269 SADx4Test() : SADTestBase(GetParam()) {}
272 void SADs(unsigned int *results) const {
273 const uint8_t *references[] = { GetReference(0), GetReference(1),
274 GetReference(2), GetReference(3) };
276 ASM_REGISTER_STATE_CHECK(params_.func(
277 source_data_, source_stride_, references, reference_stride_, results));
280 void CheckSADs() const {
281 uint32_t reference_sad;
282 DECLARE_ALIGNED(kDataAlignment, uint32_t, exp_sad[4]);
285 for (int block = 0; block < 4; ++block) {
286 reference_sad = ReferenceSAD(GetBlockRefOffset(block));
288 EXPECT_EQ(reference_sad, exp_sad[block]) << "block " << block;
293 class SADTest : public AbstractBench, public SADTestBase<SadMxNParam> {
295 SADTest() : SADTestBase(GetParam()) {}
298 unsigned int SAD(int block_idx) const {
300 const uint8_t *const reference = GetReference(block_idx);
302 ASM_REGISTER_STATE_CHECK(ret = params_.func(source_data_, source_stride_,
303 reference, reference_stride_));
307 void CheckSAD() const {
308 const unsigned int reference_sad = ReferenceSAD(GetBlockRefOffset(0));
309 const unsigned int exp_sad = SAD(0);
311 ASSERT_EQ(reference_sad, exp_sad);
315 params_.func(source_data_, source_stride_, reference_data_,
320 class SADavgTest : public SADTestBase<SadMxNAvgParam> {
322 SADavgTest() : SADTestBase(GetParam()) {}
325 unsigned int SAD_avg(int block_idx) const {
327 const uint8_t *const reference = GetReference(block_idx);
329 ASM_REGISTER_STATE_CHECK(ret = params_.func(source_data_, source_stride_,
330 reference, reference_stride_,
335 void CheckSAD() const {
336 const unsigned int reference_sad = ReferenceSADavg(0);
337 const unsigned int exp_sad = SAD_avg(0);
339 ASSERT_EQ(reference_sad, exp_sad);
343 TEST_P(SADTest, MaxRef) {
344 FillConstant(source_data_, source_stride_, 0);
345 FillConstant(reference_data_, reference_stride_, mask_);
349 TEST_P(SADTest, MaxSrc) {
350 FillConstant(source_data_, source_stride_, mask_);
351 FillConstant(reference_data_, reference_stride_, 0);
355 TEST_P(SADTest, ShortRef) {
356 const int tmp_stride = reference_stride_;
357 reference_stride_ >>= 1;
358 FillRandom(source_data_, source_stride_);
359 FillRandom(reference_data_, reference_stride_);
361 reference_stride_ = tmp_stride;
364 TEST_P(SADTest, UnalignedRef) {
365 // The reference frame, but not the source frame, may be unaligned for
366 // certain types of searches.
367 const int tmp_stride = reference_stride_;
368 reference_stride_ -= 1;
369 FillRandom(source_data_, source_stride_);
370 FillRandom(reference_data_, reference_stride_);
372 reference_stride_ = tmp_stride;
375 TEST_P(SADTest, ShortSrc) {
376 const int tmp_stride = source_stride_;
377 source_stride_ >>= 1;
378 FillRandom(source_data_, source_stride_);
379 FillRandom(reference_data_, reference_stride_);
381 source_stride_ = tmp_stride;
384 TEST_P(SADTest, DISABLED_Speed) {
385 const int kCountSpeedTestBlock = 50000000 / (params_.width * params_.height);
386 FillRandom(source_data_, source_stride_);
388 RunNTimes(kCountSpeedTestBlock);
391 snprintf(title, sizeof(title), "%dx%d", params_.width, params_.height);
395 TEST_P(SADavgTest, MaxRef) {
396 FillConstant(source_data_, source_stride_, 0);
397 FillConstant(reference_data_, reference_stride_, mask_);
398 FillConstant(second_pred_, params_.width, 0);
401 TEST_P(SADavgTest, MaxSrc) {
402 FillConstant(source_data_, source_stride_, mask_);
403 FillConstant(reference_data_, reference_stride_, 0);
404 FillConstant(second_pred_, params_.width, 0);
408 TEST_P(SADavgTest, ShortRef) {
409 const int tmp_stride = reference_stride_;
410 reference_stride_ >>= 1;
411 FillRandom(source_data_, source_stride_);
412 FillRandom(reference_data_, reference_stride_);
413 FillRandom(second_pred_, params_.width);
415 reference_stride_ = tmp_stride;
418 TEST_P(SADavgTest, UnalignedRef) {
419 // The reference frame, but not the source frame, may be unaligned for
420 // certain types of searches.
421 const int tmp_stride = reference_stride_;
422 reference_stride_ -= 1;
423 FillRandom(source_data_, source_stride_);
424 FillRandom(reference_data_, reference_stride_);
425 FillRandom(second_pred_, params_.width);
427 reference_stride_ = tmp_stride;
430 TEST_P(SADavgTest, ShortSrc) {
431 const int tmp_stride = source_stride_;
432 source_stride_ >>= 1;
433 FillRandom(source_data_, source_stride_);
434 FillRandom(reference_data_, reference_stride_);
435 FillRandom(second_pred_, params_.width);
437 source_stride_ = tmp_stride;
440 TEST_P(SADx4Test, MaxRef) {
441 FillConstant(source_data_, source_stride_, 0);
442 FillConstant(GetReference(0), reference_stride_, mask_);
443 FillConstant(GetReference(1), reference_stride_, mask_);
444 FillConstant(GetReference(2), reference_stride_, mask_);
445 FillConstant(GetReference(3), reference_stride_, mask_);
449 TEST_P(SADx4Test, MaxSrc) {
450 FillConstant(source_data_, source_stride_, mask_);
451 FillConstant(GetReference(0), reference_stride_, 0);
452 FillConstant(GetReference(1), reference_stride_, 0);
453 FillConstant(GetReference(2), reference_stride_, 0);
454 FillConstant(GetReference(3), reference_stride_, 0);
458 TEST_P(SADx4Test, ShortRef) {
459 int tmp_stride = reference_stride_;
460 reference_stride_ >>= 1;
461 FillRandom(source_data_, source_stride_);
462 FillRandom(GetReference(0), reference_stride_);
463 FillRandom(GetReference(1), reference_stride_);
464 FillRandom(GetReference(2), reference_stride_);
465 FillRandom(GetReference(3), reference_stride_);
467 reference_stride_ = tmp_stride;
470 TEST_P(SADx4Test, UnalignedRef) {
471 // The reference frame, but not the source frame, may be unaligned for
472 // certain types of searches.
473 int tmp_stride = reference_stride_;
474 reference_stride_ -= 1;
475 FillRandom(source_data_, source_stride_);
476 FillRandom(GetReference(0), reference_stride_);
477 FillRandom(GetReference(1), reference_stride_);
478 FillRandom(GetReference(2), reference_stride_);
479 FillRandom(GetReference(3), reference_stride_);
481 reference_stride_ = tmp_stride;
484 TEST_P(SADx4Test, ShortSrc) {
485 int tmp_stride = source_stride_;
486 source_stride_ >>= 1;
487 FillRandom(source_data_, source_stride_);
488 FillRandom(GetReference(0), reference_stride_);
489 FillRandom(GetReference(1), reference_stride_);
490 FillRandom(GetReference(2), reference_stride_);
491 FillRandom(GetReference(3), reference_stride_);
493 source_stride_ = tmp_stride;
496 TEST_P(SADx4Test, SrcAlignedByWidth) {
497 uint8_t *tmp_source_data = source_data_;
498 source_data_ += params_.width;
499 FillRandom(source_data_, source_stride_);
500 FillRandom(GetReference(0), reference_stride_);
501 FillRandom(GetReference(1), reference_stride_);
502 FillRandom(GetReference(2), reference_stride_);
503 FillRandom(GetReference(3), reference_stride_);
505 source_data_ = tmp_source_data;
508 TEST_P(SADx4Test, DISABLED_Speed) {
509 int tmp_stride = reference_stride_;
510 reference_stride_ -= 1;
511 FillRandom(source_data_, source_stride_);
512 FillRandom(GetReference(0), reference_stride_);
513 FillRandom(GetReference(1), reference_stride_);
514 FillRandom(GetReference(2), reference_stride_);
515 FillRandom(GetReference(3), reference_stride_);
516 const int kCountSpeedTestBlock = 500000000 / (params_.width * params_.height);
517 uint32_t reference_sad[4];
518 DECLARE_ALIGNED(kDataAlignment, uint32_t, exp_sad[4]);
519 vpx_usec_timer timer;
521 memset(reference_sad, 0, sizeof(reference_sad));
523 vpx_usec_timer_start(&timer);
524 for (int i = 0; i < kCountSpeedTestBlock; ++i) {
525 for (int block = 0; block < 4; ++block) {
526 reference_sad[block] = ReferenceSAD(GetBlockRefOffset(block));
529 vpx_usec_timer_mark(&timer);
530 for (int block = 0; block < 4; ++block) {
531 EXPECT_EQ(reference_sad[block], exp_sad[block]) << "block " << block;
533 const int elapsed_time =
534 static_cast<int>(vpx_usec_timer_elapsed(&timer) / 1000);
535 printf("sad%dx%dx4 (%2dbit) time: %5d ms\n", params_.width, params_.height,
536 bit_depth_, elapsed_time);
538 reference_stride_ = tmp_stride;
541 //------------------------------------------------------------------------------
543 const SadMxNParam c_tests[] = {
544 SadMxNParam(64, 64, &vpx_sad64x64_c),
545 SadMxNParam(64, 32, &vpx_sad64x32_c),
546 SadMxNParam(32, 64, &vpx_sad32x64_c),
547 SadMxNParam(32, 32, &vpx_sad32x32_c),
548 SadMxNParam(32, 16, &vpx_sad32x16_c),
549 SadMxNParam(16, 32, &vpx_sad16x32_c),
550 SadMxNParam(16, 16, &vpx_sad16x16_c),
551 SadMxNParam(16, 8, &vpx_sad16x8_c),
552 SadMxNParam(8, 16, &vpx_sad8x16_c),
553 SadMxNParam(8, 8, &vpx_sad8x8_c),
554 SadMxNParam(8, 4, &vpx_sad8x4_c),
555 SadMxNParam(4, 8, &vpx_sad4x8_c),
556 SadMxNParam(4, 4, &vpx_sad4x4_c),
557 #if CONFIG_VP9_HIGHBITDEPTH
558 SadMxNParam(64, 64, &vpx_highbd_sad64x64_c, 8),
559 SadMxNParam(64, 32, &vpx_highbd_sad64x32_c, 8),
560 SadMxNParam(32, 64, &vpx_highbd_sad32x64_c, 8),
561 SadMxNParam(32, 32, &vpx_highbd_sad32x32_c, 8),
562 SadMxNParam(32, 16, &vpx_highbd_sad32x16_c, 8),
563 SadMxNParam(16, 32, &vpx_highbd_sad16x32_c, 8),
564 SadMxNParam(16, 16, &vpx_highbd_sad16x16_c, 8),
565 SadMxNParam(16, 8, &vpx_highbd_sad16x8_c, 8),
566 SadMxNParam(8, 16, &vpx_highbd_sad8x16_c, 8),
567 SadMxNParam(8, 8, &vpx_highbd_sad8x8_c, 8),
568 SadMxNParam(8, 4, &vpx_highbd_sad8x4_c, 8),
569 SadMxNParam(4, 8, &vpx_highbd_sad4x8_c, 8),
570 SadMxNParam(4, 4, &vpx_highbd_sad4x4_c, 8),
571 SadMxNParam(64, 64, &vpx_highbd_sad64x64_c, 10),
572 SadMxNParam(64, 32, &vpx_highbd_sad64x32_c, 10),
573 SadMxNParam(32, 64, &vpx_highbd_sad32x64_c, 10),
574 SadMxNParam(32, 32, &vpx_highbd_sad32x32_c, 10),
575 SadMxNParam(32, 16, &vpx_highbd_sad32x16_c, 10),
576 SadMxNParam(16, 32, &vpx_highbd_sad16x32_c, 10),
577 SadMxNParam(16, 16, &vpx_highbd_sad16x16_c, 10),
578 SadMxNParam(16, 8, &vpx_highbd_sad16x8_c, 10),
579 SadMxNParam(8, 16, &vpx_highbd_sad8x16_c, 10),
580 SadMxNParam(8, 8, &vpx_highbd_sad8x8_c, 10),
581 SadMxNParam(8, 4, &vpx_highbd_sad8x4_c, 10),
582 SadMxNParam(4, 8, &vpx_highbd_sad4x8_c, 10),
583 SadMxNParam(4, 4, &vpx_highbd_sad4x4_c, 10),
584 SadMxNParam(64, 64, &vpx_highbd_sad64x64_c, 12),
585 SadMxNParam(64, 32, &vpx_highbd_sad64x32_c, 12),
586 SadMxNParam(32, 64, &vpx_highbd_sad32x64_c, 12),
587 SadMxNParam(32, 32, &vpx_highbd_sad32x32_c, 12),
588 SadMxNParam(32, 16, &vpx_highbd_sad32x16_c, 12),
589 SadMxNParam(16, 32, &vpx_highbd_sad16x32_c, 12),
590 SadMxNParam(16, 16, &vpx_highbd_sad16x16_c, 12),
591 SadMxNParam(16, 8, &vpx_highbd_sad16x8_c, 12),
592 SadMxNParam(8, 16, &vpx_highbd_sad8x16_c, 12),
593 SadMxNParam(8, 8, &vpx_highbd_sad8x8_c, 12),
594 SadMxNParam(8, 4, &vpx_highbd_sad8x4_c, 12),
595 SadMxNParam(4, 8, &vpx_highbd_sad4x8_c, 12),
596 SadMxNParam(4, 4, &vpx_highbd_sad4x4_c, 12),
597 #endif // CONFIG_VP9_HIGHBITDEPTH
599 INSTANTIATE_TEST_SUITE_P(C, SADTest, ::testing::ValuesIn(c_tests));
601 const SadMxNAvgParam avg_c_tests[] = {
602 SadMxNAvgParam(64, 64, &vpx_sad64x64_avg_c),
603 SadMxNAvgParam(64, 32, &vpx_sad64x32_avg_c),
604 SadMxNAvgParam(32, 64, &vpx_sad32x64_avg_c),
605 SadMxNAvgParam(32, 32, &vpx_sad32x32_avg_c),
606 SadMxNAvgParam(32, 16, &vpx_sad32x16_avg_c),
607 SadMxNAvgParam(16, 32, &vpx_sad16x32_avg_c),
608 SadMxNAvgParam(16, 16, &vpx_sad16x16_avg_c),
609 SadMxNAvgParam(16, 8, &vpx_sad16x8_avg_c),
610 SadMxNAvgParam(8, 16, &vpx_sad8x16_avg_c),
611 SadMxNAvgParam(8, 8, &vpx_sad8x8_avg_c),
612 SadMxNAvgParam(8, 4, &vpx_sad8x4_avg_c),
613 SadMxNAvgParam(4, 8, &vpx_sad4x8_avg_c),
614 SadMxNAvgParam(4, 4, &vpx_sad4x4_avg_c),
615 #if CONFIG_VP9_HIGHBITDEPTH
616 SadMxNAvgParam(64, 64, &vpx_highbd_sad64x64_avg_c, 8),
617 SadMxNAvgParam(64, 32, &vpx_highbd_sad64x32_avg_c, 8),
618 SadMxNAvgParam(32, 64, &vpx_highbd_sad32x64_avg_c, 8),
619 SadMxNAvgParam(32, 32, &vpx_highbd_sad32x32_avg_c, 8),
620 SadMxNAvgParam(32, 16, &vpx_highbd_sad32x16_avg_c, 8),
621 SadMxNAvgParam(16, 32, &vpx_highbd_sad16x32_avg_c, 8),
622 SadMxNAvgParam(16, 16, &vpx_highbd_sad16x16_avg_c, 8),
623 SadMxNAvgParam(16, 8, &vpx_highbd_sad16x8_avg_c, 8),
624 SadMxNAvgParam(8, 16, &vpx_highbd_sad8x16_avg_c, 8),
625 SadMxNAvgParam(8, 8, &vpx_highbd_sad8x8_avg_c, 8),
626 SadMxNAvgParam(8, 4, &vpx_highbd_sad8x4_avg_c, 8),
627 SadMxNAvgParam(4, 8, &vpx_highbd_sad4x8_avg_c, 8),
628 SadMxNAvgParam(4, 4, &vpx_highbd_sad4x4_avg_c, 8),
629 SadMxNAvgParam(64, 64, &vpx_highbd_sad64x64_avg_c, 10),
630 SadMxNAvgParam(64, 32, &vpx_highbd_sad64x32_avg_c, 10),
631 SadMxNAvgParam(32, 64, &vpx_highbd_sad32x64_avg_c, 10),
632 SadMxNAvgParam(32, 32, &vpx_highbd_sad32x32_avg_c, 10),
633 SadMxNAvgParam(32, 16, &vpx_highbd_sad32x16_avg_c, 10),
634 SadMxNAvgParam(16, 32, &vpx_highbd_sad16x32_avg_c, 10),
635 SadMxNAvgParam(16, 16, &vpx_highbd_sad16x16_avg_c, 10),
636 SadMxNAvgParam(16, 8, &vpx_highbd_sad16x8_avg_c, 10),
637 SadMxNAvgParam(8, 16, &vpx_highbd_sad8x16_avg_c, 10),
638 SadMxNAvgParam(8, 8, &vpx_highbd_sad8x8_avg_c, 10),
639 SadMxNAvgParam(8, 4, &vpx_highbd_sad8x4_avg_c, 10),
640 SadMxNAvgParam(4, 8, &vpx_highbd_sad4x8_avg_c, 10),
641 SadMxNAvgParam(4, 4, &vpx_highbd_sad4x4_avg_c, 10),
642 SadMxNAvgParam(64, 64, &vpx_highbd_sad64x64_avg_c, 12),
643 SadMxNAvgParam(64, 32, &vpx_highbd_sad64x32_avg_c, 12),
644 SadMxNAvgParam(32, 64, &vpx_highbd_sad32x64_avg_c, 12),
645 SadMxNAvgParam(32, 32, &vpx_highbd_sad32x32_avg_c, 12),
646 SadMxNAvgParam(32, 16, &vpx_highbd_sad32x16_avg_c, 12),
647 SadMxNAvgParam(16, 32, &vpx_highbd_sad16x32_avg_c, 12),
648 SadMxNAvgParam(16, 16, &vpx_highbd_sad16x16_avg_c, 12),
649 SadMxNAvgParam(16, 8, &vpx_highbd_sad16x8_avg_c, 12),
650 SadMxNAvgParam(8, 16, &vpx_highbd_sad8x16_avg_c, 12),
651 SadMxNAvgParam(8, 8, &vpx_highbd_sad8x8_avg_c, 12),
652 SadMxNAvgParam(8, 4, &vpx_highbd_sad8x4_avg_c, 12),
653 SadMxNAvgParam(4, 8, &vpx_highbd_sad4x8_avg_c, 12),
654 SadMxNAvgParam(4, 4, &vpx_highbd_sad4x4_avg_c, 12),
655 #endif // CONFIG_VP9_HIGHBITDEPTH
657 INSTANTIATE_TEST_SUITE_P(C, SADavgTest, ::testing::ValuesIn(avg_c_tests));
659 const SadMxNx4Param x4d_c_tests[] = {
660 SadMxNx4Param(64, 64, &vpx_sad64x64x4d_c),
661 SadMxNx4Param(64, 32, &vpx_sad64x32x4d_c),
662 SadMxNx4Param(32, 64, &vpx_sad32x64x4d_c),
663 SadMxNx4Param(32, 32, &vpx_sad32x32x4d_c),
664 SadMxNx4Param(32, 16, &vpx_sad32x16x4d_c),
665 SadMxNx4Param(16, 32, &vpx_sad16x32x4d_c),
666 SadMxNx4Param(16, 16, &vpx_sad16x16x4d_c),
667 SadMxNx4Param(16, 8, &vpx_sad16x8x4d_c),
668 SadMxNx4Param(8, 16, &vpx_sad8x16x4d_c),
669 SadMxNx4Param(8, 8, &vpx_sad8x8x4d_c),
670 SadMxNx4Param(8, 4, &vpx_sad8x4x4d_c),
671 SadMxNx4Param(4, 8, &vpx_sad4x8x4d_c),
672 SadMxNx4Param(4, 4, &vpx_sad4x4x4d_c),
673 #if CONFIG_VP9_HIGHBITDEPTH
674 SadMxNx4Param(64, 64, &vpx_highbd_sad64x64x4d_c, 8),
675 SadMxNx4Param(64, 32, &vpx_highbd_sad64x32x4d_c, 8),
676 SadMxNx4Param(32, 64, &vpx_highbd_sad32x64x4d_c, 8),
677 SadMxNx4Param(32, 32, &vpx_highbd_sad32x32x4d_c, 8),
678 SadMxNx4Param(32, 16, &vpx_highbd_sad32x16x4d_c, 8),
679 SadMxNx4Param(16, 32, &vpx_highbd_sad16x32x4d_c, 8),
680 SadMxNx4Param(16, 16, &vpx_highbd_sad16x16x4d_c, 8),
681 SadMxNx4Param(16, 8, &vpx_highbd_sad16x8x4d_c, 8),
682 SadMxNx4Param(8, 16, &vpx_highbd_sad8x16x4d_c, 8),
683 SadMxNx4Param(8, 8, &vpx_highbd_sad8x8x4d_c, 8),
684 SadMxNx4Param(8, 4, &vpx_highbd_sad8x4x4d_c, 8),
685 SadMxNx4Param(4, 8, &vpx_highbd_sad4x8x4d_c, 8),
686 SadMxNx4Param(4, 4, &vpx_highbd_sad4x4x4d_c, 8),
687 SadMxNx4Param(64, 64, &vpx_highbd_sad64x64x4d_c, 10),
688 SadMxNx4Param(64, 32, &vpx_highbd_sad64x32x4d_c, 10),
689 SadMxNx4Param(32, 64, &vpx_highbd_sad32x64x4d_c, 10),
690 SadMxNx4Param(32, 32, &vpx_highbd_sad32x32x4d_c, 10),
691 SadMxNx4Param(32, 16, &vpx_highbd_sad32x16x4d_c, 10),
692 SadMxNx4Param(16, 32, &vpx_highbd_sad16x32x4d_c, 10),
693 SadMxNx4Param(16, 16, &vpx_highbd_sad16x16x4d_c, 10),
694 SadMxNx4Param(16, 8, &vpx_highbd_sad16x8x4d_c, 10),
695 SadMxNx4Param(8, 16, &vpx_highbd_sad8x16x4d_c, 10),
696 SadMxNx4Param(8, 8, &vpx_highbd_sad8x8x4d_c, 10),
697 SadMxNx4Param(8, 4, &vpx_highbd_sad8x4x4d_c, 10),
698 SadMxNx4Param(4, 8, &vpx_highbd_sad4x8x4d_c, 10),
699 SadMxNx4Param(4, 4, &vpx_highbd_sad4x4x4d_c, 10),
700 SadMxNx4Param(64, 64, &vpx_highbd_sad64x64x4d_c, 12),
701 SadMxNx4Param(64, 32, &vpx_highbd_sad64x32x4d_c, 12),
702 SadMxNx4Param(32, 64, &vpx_highbd_sad32x64x4d_c, 12),
703 SadMxNx4Param(32, 32, &vpx_highbd_sad32x32x4d_c, 12),
704 SadMxNx4Param(32, 16, &vpx_highbd_sad32x16x4d_c, 12),
705 SadMxNx4Param(16, 32, &vpx_highbd_sad16x32x4d_c, 12),
706 SadMxNx4Param(16, 16, &vpx_highbd_sad16x16x4d_c, 12),
707 SadMxNx4Param(16, 8, &vpx_highbd_sad16x8x4d_c, 12),
708 SadMxNx4Param(8, 16, &vpx_highbd_sad8x16x4d_c, 12),
709 SadMxNx4Param(8, 8, &vpx_highbd_sad8x8x4d_c, 12),
710 SadMxNx4Param(8, 4, &vpx_highbd_sad8x4x4d_c, 12),
711 SadMxNx4Param(4, 8, &vpx_highbd_sad4x8x4d_c, 12),
712 SadMxNx4Param(4, 4, &vpx_highbd_sad4x4x4d_c, 12),
713 #endif // CONFIG_VP9_HIGHBITDEPTH
715 INSTANTIATE_TEST_SUITE_P(C, SADx4Test, ::testing::ValuesIn(x4d_c_tests));
717 //------------------------------------------------------------------------------
720 const SadMxNParam neon_tests[] = {
721 SadMxNParam(64, 64, &vpx_sad64x64_neon),
722 SadMxNParam(64, 32, &vpx_sad64x32_neon),
723 SadMxNParam(32, 32, &vpx_sad32x32_neon),
724 SadMxNParam(16, 32, &vpx_sad16x32_neon),
725 SadMxNParam(16, 16, &vpx_sad16x16_neon),
726 SadMxNParam(16, 8, &vpx_sad16x8_neon),
727 SadMxNParam(8, 16, &vpx_sad8x16_neon),
728 SadMxNParam(8, 8, &vpx_sad8x8_neon),
729 SadMxNParam(8, 4, &vpx_sad8x4_neon),
730 SadMxNParam(4, 8, &vpx_sad4x8_neon),
731 SadMxNParam(4, 4, &vpx_sad4x4_neon),
733 INSTANTIATE_TEST_SUITE_P(NEON, SADTest, ::testing::ValuesIn(neon_tests));
735 const SadMxNAvgParam avg_neon_tests[] = {
736 SadMxNAvgParam(64, 64, &vpx_sad64x64_avg_neon),
737 SadMxNAvgParam(64, 32, &vpx_sad64x32_avg_neon),
738 SadMxNAvgParam(32, 64, &vpx_sad32x64_avg_neon),
739 SadMxNAvgParam(32, 32, &vpx_sad32x32_avg_neon),
740 SadMxNAvgParam(32, 16, &vpx_sad32x16_avg_neon),
741 SadMxNAvgParam(16, 32, &vpx_sad16x32_avg_neon),
742 SadMxNAvgParam(16, 16, &vpx_sad16x16_avg_neon),
743 SadMxNAvgParam(16, 8, &vpx_sad16x8_avg_neon),
744 SadMxNAvgParam(8, 16, &vpx_sad8x16_avg_neon),
745 SadMxNAvgParam(8, 8, &vpx_sad8x8_avg_neon),
746 SadMxNAvgParam(8, 4, &vpx_sad8x4_avg_neon),
747 SadMxNAvgParam(4, 8, &vpx_sad4x8_avg_neon),
748 SadMxNAvgParam(4, 4, &vpx_sad4x4_avg_neon),
750 INSTANTIATE_TEST_SUITE_P(NEON, SADavgTest, ::testing::ValuesIn(avg_neon_tests));
752 const SadMxNx4Param x4d_neon_tests[] = {
753 SadMxNx4Param(64, 64, &vpx_sad64x64x4d_neon),
754 SadMxNx4Param(64, 32, &vpx_sad64x32x4d_neon),
755 SadMxNx4Param(32, 64, &vpx_sad32x64x4d_neon),
756 SadMxNx4Param(32, 32, &vpx_sad32x32x4d_neon),
757 SadMxNx4Param(32, 16, &vpx_sad32x16x4d_neon),
758 SadMxNx4Param(16, 32, &vpx_sad16x32x4d_neon),
759 SadMxNx4Param(16, 16, &vpx_sad16x16x4d_neon),
760 SadMxNx4Param(16, 8, &vpx_sad16x8x4d_neon),
761 SadMxNx4Param(8, 16, &vpx_sad8x16x4d_neon),
762 SadMxNx4Param(8, 8, &vpx_sad8x8x4d_neon),
763 SadMxNx4Param(8, 4, &vpx_sad8x4x4d_neon),
764 SadMxNx4Param(4, 8, &vpx_sad4x8x4d_neon),
765 SadMxNx4Param(4, 4, &vpx_sad4x4x4d_neon),
767 INSTANTIATE_TEST_SUITE_P(NEON, SADx4Test, ::testing::ValuesIn(x4d_neon_tests));
770 //------------------------------------------------------------------------------
773 const SadMxNParam sse2_tests[] = {
774 SadMxNParam(64, 64, &vpx_sad64x64_sse2),
775 SadMxNParam(64, 32, &vpx_sad64x32_sse2),
776 SadMxNParam(32, 64, &vpx_sad32x64_sse2),
777 SadMxNParam(32, 32, &vpx_sad32x32_sse2),
778 SadMxNParam(32, 16, &vpx_sad32x16_sse2),
779 SadMxNParam(16, 32, &vpx_sad16x32_sse2),
780 SadMxNParam(16, 16, &vpx_sad16x16_sse2),
781 SadMxNParam(16, 8, &vpx_sad16x8_sse2),
782 SadMxNParam(8, 16, &vpx_sad8x16_sse2),
783 SadMxNParam(8, 8, &vpx_sad8x8_sse2),
784 SadMxNParam(8, 4, &vpx_sad8x4_sse2),
785 SadMxNParam(4, 8, &vpx_sad4x8_sse2),
786 SadMxNParam(4, 4, &vpx_sad4x4_sse2),
787 #if CONFIG_VP9_HIGHBITDEPTH
788 SadMxNParam(64, 64, &vpx_highbd_sad64x64_sse2, 8),
789 SadMxNParam(64, 32, &vpx_highbd_sad64x32_sse2, 8),
790 SadMxNParam(32, 64, &vpx_highbd_sad32x64_sse2, 8),
791 SadMxNParam(32, 32, &vpx_highbd_sad32x32_sse2, 8),
792 SadMxNParam(32, 16, &vpx_highbd_sad32x16_sse2, 8),
793 SadMxNParam(16, 32, &vpx_highbd_sad16x32_sse2, 8),
794 SadMxNParam(16, 16, &vpx_highbd_sad16x16_sse2, 8),
795 SadMxNParam(16, 8, &vpx_highbd_sad16x8_sse2, 8),
796 SadMxNParam(8, 16, &vpx_highbd_sad8x16_sse2, 8),
797 SadMxNParam(8, 8, &vpx_highbd_sad8x8_sse2, 8),
798 SadMxNParam(8, 4, &vpx_highbd_sad8x4_sse2, 8),
799 SadMxNParam(64, 64, &vpx_highbd_sad64x64_sse2, 10),
800 SadMxNParam(64, 32, &vpx_highbd_sad64x32_sse2, 10),
801 SadMxNParam(32, 64, &vpx_highbd_sad32x64_sse2, 10),
802 SadMxNParam(32, 32, &vpx_highbd_sad32x32_sse2, 10),
803 SadMxNParam(32, 16, &vpx_highbd_sad32x16_sse2, 10),
804 SadMxNParam(16, 32, &vpx_highbd_sad16x32_sse2, 10),
805 SadMxNParam(16, 16, &vpx_highbd_sad16x16_sse2, 10),
806 SadMxNParam(16, 8, &vpx_highbd_sad16x8_sse2, 10),
807 SadMxNParam(8, 16, &vpx_highbd_sad8x16_sse2, 10),
808 SadMxNParam(8, 8, &vpx_highbd_sad8x8_sse2, 10),
809 SadMxNParam(8, 4, &vpx_highbd_sad8x4_sse2, 10),
810 SadMxNParam(64, 64, &vpx_highbd_sad64x64_sse2, 12),
811 SadMxNParam(64, 32, &vpx_highbd_sad64x32_sse2, 12),
812 SadMxNParam(32, 64, &vpx_highbd_sad32x64_sse2, 12),
813 SadMxNParam(32, 32, &vpx_highbd_sad32x32_sse2, 12),
814 SadMxNParam(32, 16, &vpx_highbd_sad32x16_sse2, 12),
815 SadMxNParam(16, 32, &vpx_highbd_sad16x32_sse2, 12),
816 SadMxNParam(16, 16, &vpx_highbd_sad16x16_sse2, 12),
817 SadMxNParam(16, 8, &vpx_highbd_sad16x8_sse2, 12),
818 SadMxNParam(8, 16, &vpx_highbd_sad8x16_sse2, 12),
819 SadMxNParam(8, 8, &vpx_highbd_sad8x8_sse2, 12),
820 SadMxNParam(8, 4, &vpx_highbd_sad8x4_sse2, 12),
821 #endif // CONFIG_VP9_HIGHBITDEPTH
823 INSTANTIATE_TEST_SUITE_P(SSE2, SADTest, ::testing::ValuesIn(sse2_tests));
825 const SadMxNAvgParam avg_sse2_tests[] = {
826 SadMxNAvgParam(64, 64, &vpx_sad64x64_avg_sse2),
827 SadMxNAvgParam(64, 32, &vpx_sad64x32_avg_sse2),
828 SadMxNAvgParam(32, 64, &vpx_sad32x64_avg_sse2),
829 SadMxNAvgParam(32, 32, &vpx_sad32x32_avg_sse2),
830 SadMxNAvgParam(32, 16, &vpx_sad32x16_avg_sse2),
831 SadMxNAvgParam(16, 32, &vpx_sad16x32_avg_sse2),
832 SadMxNAvgParam(16, 16, &vpx_sad16x16_avg_sse2),
833 SadMxNAvgParam(16, 8, &vpx_sad16x8_avg_sse2),
834 SadMxNAvgParam(8, 16, &vpx_sad8x16_avg_sse2),
835 SadMxNAvgParam(8, 8, &vpx_sad8x8_avg_sse2),
836 SadMxNAvgParam(8, 4, &vpx_sad8x4_avg_sse2),
837 SadMxNAvgParam(4, 8, &vpx_sad4x8_avg_sse2),
838 SadMxNAvgParam(4, 4, &vpx_sad4x4_avg_sse2),
839 #if CONFIG_VP9_HIGHBITDEPTH
840 SadMxNAvgParam(64, 64, &vpx_highbd_sad64x64_avg_sse2, 8),
841 SadMxNAvgParam(64, 32, &vpx_highbd_sad64x32_avg_sse2, 8),
842 SadMxNAvgParam(32, 64, &vpx_highbd_sad32x64_avg_sse2, 8),
843 SadMxNAvgParam(32, 32, &vpx_highbd_sad32x32_avg_sse2, 8),
844 SadMxNAvgParam(32, 16, &vpx_highbd_sad32x16_avg_sse2, 8),
845 SadMxNAvgParam(16, 32, &vpx_highbd_sad16x32_avg_sse2, 8),
846 SadMxNAvgParam(16, 16, &vpx_highbd_sad16x16_avg_sse2, 8),
847 SadMxNAvgParam(16, 8, &vpx_highbd_sad16x8_avg_sse2, 8),
848 SadMxNAvgParam(8, 16, &vpx_highbd_sad8x16_avg_sse2, 8),
849 SadMxNAvgParam(8, 8, &vpx_highbd_sad8x8_avg_sse2, 8),
850 SadMxNAvgParam(8, 4, &vpx_highbd_sad8x4_avg_sse2, 8),
851 SadMxNAvgParam(64, 64, &vpx_highbd_sad64x64_avg_sse2, 10),
852 SadMxNAvgParam(64, 32, &vpx_highbd_sad64x32_avg_sse2, 10),
853 SadMxNAvgParam(32, 64, &vpx_highbd_sad32x64_avg_sse2, 10),
854 SadMxNAvgParam(32, 32, &vpx_highbd_sad32x32_avg_sse2, 10),
855 SadMxNAvgParam(32, 16, &vpx_highbd_sad32x16_avg_sse2, 10),
856 SadMxNAvgParam(16, 32, &vpx_highbd_sad16x32_avg_sse2, 10),
857 SadMxNAvgParam(16, 16, &vpx_highbd_sad16x16_avg_sse2, 10),
858 SadMxNAvgParam(16, 8, &vpx_highbd_sad16x8_avg_sse2, 10),
859 SadMxNAvgParam(8, 16, &vpx_highbd_sad8x16_avg_sse2, 10),
860 SadMxNAvgParam(8, 8, &vpx_highbd_sad8x8_avg_sse2, 10),
861 SadMxNAvgParam(8, 4, &vpx_highbd_sad8x4_avg_sse2, 10),
862 SadMxNAvgParam(64, 64, &vpx_highbd_sad64x64_avg_sse2, 12),
863 SadMxNAvgParam(64, 32, &vpx_highbd_sad64x32_avg_sse2, 12),
864 SadMxNAvgParam(32, 64, &vpx_highbd_sad32x64_avg_sse2, 12),
865 SadMxNAvgParam(32, 32, &vpx_highbd_sad32x32_avg_sse2, 12),
866 SadMxNAvgParam(32, 16, &vpx_highbd_sad32x16_avg_sse2, 12),
867 SadMxNAvgParam(16, 32, &vpx_highbd_sad16x32_avg_sse2, 12),
868 SadMxNAvgParam(16, 16, &vpx_highbd_sad16x16_avg_sse2, 12),
869 SadMxNAvgParam(16, 8, &vpx_highbd_sad16x8_avg_sse2, 12),
870 SadMxNAvgParam(8, 16, &vpx_highbd_sad8x16_avg_sse2, 12),
871 SadMxNAvgParam(8, 8, &vpx_highbd_sad8x8_avg_sse2, 12),
872 SadMxNAvgParam(8, 4, &vpx_highbd_sad8x4_avg_sse2, 12),
873 #endif // CONFIG_VP9_HIGHBITDEPTH
875 INSTANTIATE_TEST_SUITE_P(SSE2, SADavgTest, ::testing::ValuesIn(avg_sse2_tests));
877 const SadMxNx4Param x4d_sse2_tests[] = {
878 SadMxNx4Param(64, 64, &vpx_sad64x64x4d_sse2),
879 SadMxNx4Param(64, 32, &vpx_sad64x32x4d_sse2),
880 SadMxNx4Param(32, 64, &vpx_sad32x64x4d_sse2),
881 SadMxNx4Param(32, 32, &vpx_sad32x32x4d_sse2),
882 SadMxNx4Param(32, 16, &vpx_sad32x16x4d_sse2),
883 SadMxNx4Param(16, 32, &vpx_sad16x32x4d_sse2),
884 SadMxNx4Param(16, 16, &vpx_sad16x16x4d_sse2),
885 SadMxNx4Param(16, 8, &vpx_sad16x8x4d_sse2),
886 SadMxNx4Param(8, 16, &vpx_sad8x16x4d_sse2),
887 SadMxNx4Param(8, 8, &vpx_sad8x8x4d_sse2),
888 SadMxNx4Param(8, 4, &vpx_sad8x4x4d_sse2),
889 SadMxNx4Param(4, 8, &vpx_sad4x8x4d_sse2),
890 SadMxNx4Param(4, 4, &vpx_sad4x4x4d_sse2),
891 #if CONFIG_VP9_HIGHBITDEPTH
892 SadMxNx4Param(64, 64, &vpx_highbd_sad64x64x4d_sse2, 8),
893 SadMxNx4Param(64, 32, &vpx_highbd_sad64x32x4d_sse2, 8),
894 SadMxNx4Param(32, 64, &vpx_highbd_sad32x64x4d_sse2, 8),
895 SadMxNx4Param(32, 32, &vpx_highbd_sad32x32x4d_sse2, 8),
896 SadMxNx4Param(32, 16, &vpx_highbd_sad32x16x4d_sse2, 8),
897 SadMxNx4Param(16, 32, &vpx_highbd_sad16x32x4d_sse2, 8),
898 SadMxNx4Param(16, 16, &vpx_highbd_sad16x16x4d_sse2, 8),
899 SadMxNx4Param(16, 8, &vpx_highbd_sad16x8x4d_sse2, 8),
900 SadMxNx4Param(8, 16, &vpx_highbd_sad8x16x4d_sse2, 8),
901 SadMxNx4Param(8, 8, &vpx_highbd_sad8x8x4d_sse2, 8),
902 SadMxNx4Param(8, 4, &vpx_highbd_sad8x4x4d_sse2, 8),
903 SadMxNx4Param(4, 8, &vpx_highbd_sad4x8x4d_sse2, 8),
904 SadMxNx4Param(4, 4, &vpx_highbd_sad4x4x4d_sse2, 8),
905 SadMxNx4Param(64, 64, &vpx_highbd_sad64x64x4d_sse2, 10),
906 SadMxNx4Param(64, 32, &vpx_highbd_sad64x32x4d_sse2, 10),
907 SadMxNx4Param(32, 64, &vpx_highbd_sad32x64x4d_sse2, 10),
908 SadMxNx4Param(32, 32, &vpx_highbd_sad32x32x4d_sse2, 10),
909 SadMxNx4Param(32, 16, &vpx_highbd_sad32x16x4d_sse2, 10),
910 SadMxNx4Param(16, 32, &vpx_highbd_sad16x32x4d_sse2, 10),
911 SadMxNx4Param(16, 16, &vpx_highbd_sad16x16x4d_sse2, 10),
912 SadMxNx4Param(16, 8, &vpx_highbd_sad16x8x4d_sse2, 10),
913 SadMxNx4Param(8, 16, &vpx_highbd_sad8x16x4d_sse2, 10),
914 SadMxNx4Param(8, 8, &vpx_highbd_sad8x8x4d_sse2, 10),
915 SadMxNx4Param(8, 4, &vpx_highbd_sad8x4x4d_sse2, 10),
916 SadMxNx4Param(4, 8, &vpx_highbd_sad4x8x4d_sse2, 10),
917 SadMxNx4Param(4, 4, &vpx_highbd_sad4x4x4d_sse2, 10),
918 SadMxNx4Param(64, 64, &vpx_highbd_sad64x64x4d_sse2, 12),
919 SadMxNx4Param(64, 32, &vpx_highbd_sad64x32x4d_sse2, 12),
920 SadMxNx4Param(32, 64, &vpx_highbd_sad32x64x4d_sse2, 12),
921 SadMxNx4Param(32, 32, &vpx_highbd_sad32x32x4d_sse2, 12),
922 SadMxNx4Param(32, 16, &vpx_highbd_sad32x16x4d_sse2, 12),
923 SadMxNx4Param(16, 32, &vpx_highbd_sad16x32x4d_sse2, 12),
924 SadMxNx4Param(16, 16, &vpx_highbd_sad16x16x4d_sse2, 12),
925 SadMxNx4Param(16, 8, &vpx_highbd_sad16x8x4d_sse2, 12),
926 SadMxNx4Param(8, 16, &vpx_highbd_sad8x16x4d_sse2, 12),
927 SadMxNx4Param(8, 8, &vpx_highbd_sad8x8x4d_sse2, 12),
928 SadMxNx4Param(8, 4, &vpx_highbd_sad8x4x4d_sse2, 12),
929 SadMxNx4Param(4, 8, &vpx_highbd_sad4x8x4d_sse2, 12),
930 SadMxNx4Param(4, 4, &vpx_highbd_sad4x4x4d_sse2, 12),
931 #endif // CONFIG_VP9_HIGHBITDEPTH
933 INSTANTIATE_TEST_SUITE_P(SSE2, SADx4Test, ::testing::ValuesIn(x4d_sse2_tests));
937 // Only functions are x3, which do not have tests.
941 // Only functions are x3, which do not have tests.
945 const SadMxNParam avx2_tests[] = {
946 SadMxNParam(64, 64, &vpx_sad64x64_avx2),
947 SadMxNParam(64, 32, &vpx_sad64x32_avx2),
948 SadMxNParam(32, 64, &vpx_sad32x64_avx2),
949 SadMxNParam(32, 32, &vpx_sad32x32_avx2),
950 SadMxNParam(32, 16, &vpx_sad32x16_avx2),
952 INSTANTIATE_TEST_SUITE_P(AVX2, SADTest, ::testing::ValuesIn(avx2_tests));
954 const SadMxNAvgParam avg_avx2_tests[] = {
955 SadMxNAvgParam(64, 64, &vpx_sad64x64_avg_avx2),
956 SadMxNAvgParam(64, 32, &vpx_sad64x32_avg_avx2),
957 SadMxNAvgParam(32, 64, &vpx_sad32x64_avg_avx2),
958 SadMxNAvgParam(32, 32, &vpx_sad32x32_avg_avx2),
959 SadMxNAvgParam(32, 16, &vpx_sad32x16_avg_avx2),
961 INSTANTIATE_TEST_SUITE_P(AVX2, SADavgTest, ::testing::ValuesIn(avg_avx2_tests));
963 const SadMxNx4Param x4d_avx2_tests[] = {
964 SadMxNx4Param(64, 64, &vpx_sad64x64x4d_avx2),
965 SadMxNx4Param(32, 32, &vpx_sad32x32x4d_avx2),
967 INSTANTIATE_TEST_SUITE_P(AVX2, SADx4Test, ::testing::ValuesIn(x4d_avx2_tests));
972 const SadMxNx4Param x4d_avx512_tests[] = {
973 SadMxNx4Param(64, 64, &vpx_sad64x64x4d_avx512),
975 INSTANTIATE_TEST_SUITE_P(AVX512, SADx4Test,
976 ::testing::ValuesIn(x4d_avx512_tests));
977 #endif // HAVE_AVX512
979 //------------------------------------------------------------------------------
982 const SadMxNParam msa_tests[] = {
983 SadMxNParam(64, 64, &vpx_sad64x64_msa),
984 SadMxNParam(64, 32, &vpx_sad64x32_msa),
985 SadMxNParam(32, 64, &vpx_sad32x64_msa),
986 SadMxNParam(32, 32, &vpx_sad32x32_msa),
987 SadMxNParam(32, 16, &vpx_sad32x16_msa),
988 SadMxNParam(16, 32, &vpx_sad16x32_msa),
989 SadMxNParam(16, 16, &vpx_sad16x16_msa),
990 SadMxNParam(16, 8, &vpx_sad16x8_msa),
991 SadMxNParam(8, 16, &vpx_sad8x16_msa),
992 SadMxNParam(8, 8, &vpx_sad8x8_msa),
993 SadMxNParam(8, 4, &vpx_sad8x4_msa),
994 SadMxNParam(4, 8, &vpx_sad4x8_msa),
995 SadMxNParam(4, 4, &vpx_sad4x4_msa),
997 INSTANTIATE_TEST_SUITE_P(MSA, SADTest, ::testing::ValuesIn(msa_tests));
999 const SadMxNAvgParam avg_msa_tests[] = {
1000 SadMxNAvgParam(64, 64, &vpx_sad64x64_avg_msa),
1001 SadMxNAvgParam(64, 32, &vpx_sad64x32_avg_msa),
1002 SadMxNAvgParam(32, 64, &vpx_sad32x64_avg_msa),
1003 SadMxNAvgParam(32, 32, &vpx_sad32x32_avg_msa),
1004 SadMxNAvgParam(32, 16, &vpx_sad32x16_avg_msa),
1005 SadMxNAvgParam(16, 32, &vpx_sad16x32_avg_msa),
1006 SadMxNAvgParam(16, 16, &vpx_sad16x16_avg_msa),
1007 SadMxNAvgParam(16, 8, &vpx_sad16x8_avg_msa),
1008 SadMxNAvgParam(8, 16, &vpx_sad8x16_avg_msa),
1009 SadMxNAvgParam(8, 8, &vpx_sad8x8_avg_msa),
1010 SadMxNAvgParam(8, 4, &vpx_sad8x4_avg_msa),
1011 SadMxNAvgParam(4, 8, &vpx_sad4x8_avg_msa),
1012 SadMxNAvgParam(4, 4, &vpx_sad4x4_avg_msa),
1014 INSTANTIATE_TEST_SUITE_P(MSA, SADavgTest, ::testing::ValuesIn(avg_msa_tests));
1016 const SadMxNx4Param x4d_msa_tests[] = {
1017 SadMxNx4Param(64, 64, &vpx_sad64x64x4d_msa),
1018 SadMxNx4Param(64, 32, &vpx_sad64x32x4d_msa),
1019 SadMxNx4Param(32, 64, &vpx_sad32x64x4d_msa),
1020 SadMxNx4Param(32, 32, &vpx_sad32x32x4d_msa),
1021 SadMxNx4Param(32, 16, &vpx_sad32x16x4d_msa),
1022 SadMxNx4Param(16, 32, &vpx_sad16x32x4d_msa),
1023 SadMxNx4Param(16, 16, &vpx_sad16x16x4d_msa),
1024 SadMxNx4Param(16, 8, &vpx_sad16x8x4d_msa),
1025 SadMxNx4Param(8, 16, &vpx_sad8x16x4d_msa),
1026 SadMxNx4Param(8, 8, &vpx_sad8x8x4d_msa),
1027 SadMxNx4Param(8, 4, &vpx_sad8x4x4d_msa),
1028 SadMxNx4Param(4, 8, &vpx_sad4x8x4d_msa),
1029 SadMxNx4Param(4, 4, &vpx_sad4x4x4d_msa),
1031 INSTANTIATE_TEST_SUITE_P(MSA, SADx4Test, ::testing::ValuesIn(x4d_msa_tests));
1034 //------------------------------------------------------------------------------
1037 const SadMxNParam vsx_tests[] = {
1038 SadMxNParam(64, 64, &vpx_sad64x64_vsx),
1039 SadMxNParam(64, 32, &vpx_sad64x32_vsx),
1040 SadMxNParam(32, 64, &vpx_sad32x64_vsx),
1041 SadMxNParam(32, 32, &vpx_sad32x32_vsx),
1042 SadMxNParam(32, 16, &vpx_sad32x16_vsx),
1043 SadMxNParam(16, 32, &vpx_sad16x32_vsx),
1044 SadMxNParam(16, 16, &vpx_sad16x16_vsx),
1045 SadMxNParam(16, 8, &vpx_sad16x8_vsx),
1046 SadMxNParam(8, 16, &vpx_sad8x16_vsx),
1047 SadMxNParam(8, 8, &vpx_sad8x8_vsx),
1048 SadMxNParam(8, 4, &vpx_sad8x4_vsx),
1050 INSTANTIATE_TEST_SUITE_P(VSX, SADTest, ::testing::ValuesIn(vsx_tests));
1052 const SadMxNAvgParam avg_vsx_tests[] = {
1053 SadMxNAvgParam(64, 64, &vpx_sad64x64_avg_vsx),
1054 SadMxNAvgParam(64, 32, &vpx_sad64x32_avg_vsx),
1055 SadMxNAvgParam(32, 64, &vpx_sad32x64_avg_vsx),
1056 SadMxNAvgParam(32, 32, &vpx_sad32x32_avg_vsx),
1057 SadMxNAvgParam(32, 16, &vpx_sad32x16_avg_vsx),
1058 SadMxNAvgParam(16, 32, &vpx_sad16x32_avg_vsx),
1059 SadMxNAvgParam(16, 16, &vpx_sad16x16_avg_vsx),
1060 SadMxNAvgParam(16, 8, &vpx_sad16x8_avg_vsx),
1062 INSTANTIATE_TEST_SUITE_P(VSX, SADavgTest, ::testing::ValuesIn(avg_vsx_tests));
1064 const SadMxNx4Param x4d_vsx_tests[] = {
1065 SadMxNx4Param(64, 64, &vpx_sad64x64x4d_vsx),
1066 SadMxNx4Param(64, 32, &vpx_sad64x32x4d_vsx),
1067 SadMxNx4Param(32, 64, &vpx_sad32x64x4d_vsx),
1068 SadMxNx4Param(32, 32, &vpx_sad32x32x4d_vsx),
1069 SadMxNx4Param(32, 16, &vpx_sad32x16x4d_vsx),
1070 SadMxNx4Param(16, 32, &vpx_sad16x32x4d_vsx),
1071 SadMxNx4Param(16, 16, &vpx_sad16x16x4d_vsx),
1072 SadMxNx4Param(16, 8, &vpx_sad16x8x4d_vsx),
1074 INSTANTIATE_TEST_SUITE_P(VSX, SADx4Test, ::testing::ValuesIn(x4d_vsx_tests));
1077 //------------------------------------------------------------------------------
1078 // Loongson functions
1080 const SadMxNParam mmi_tests[] = {
1081 SadMxNParam(64, 64, &vpx_sad64x64_mmi),
1082 SadMxNParam(64, 32, &vpx_sad64x32_mmi),
1083 SadMxNParam(32, 64, &vpx_sad32x64_mmi),
1084 SadMxNParam(32, 32, &vpx_sad32x32_mmi),
1085 SadMxNParam(32, 16, &vpx_sad32x16_mmi),
1086 SadMxNParam(16, 32, &vpx_sad16x32_mmi),
1087 SadMxNParam(16, 16, &vpx_sad16x16_mmi),
1088 SadMxNParam(16, 8, &vpx_sad16x8_mmi),
1089 SadMxNParam(8, 16, &vpx_sad8x16_mmi),
1090 SadMxNParam(8, 8, &vpx_sad8x8_mmi),
1091 SadMxNParam(8, 4, &vpx_sad8x4_mmi),
1092 SadMxNParam(4, 8, &vpx_sad4x8_mmi),
1093 SadMxNParam(4, 4, &vpx_sad4x4_mmi),
1095 INSTANTIATE_TEST_SUITE_P(MMI, SADTest, ::testing::ValuesIn(mmi_tests));
1097 const SadMxNAvgParam avg_mmi_tests[] = {
1098 SadMxNAvgParam(64, 64, &vpx_sad64x64_avg_mmi),
1099 SadMxNAvgParam(64, 32, &vpx_sad64x32_avg_mmi),
1100 SadMxNAvgParam(32, 64, &vpx_sad32x64_avg_mmi),
1101 SadMxNAvgParam(32, 32, &vpx_sad32x32_avg_mmi),
1102 SadMxNAvgParam(32, 16, &vpx_sad32x16_avg_mmi),
1103 SadMxNAvgParam(16, 32, &vpx_sad16x32_avg_mmi),
1104 SadMxNAvgParam(16, 16, &vpx_sad16x16_avg_mmi),
1105 SadMxNAvgParam(16, 8, &vpx_sad16x8_avg_mmi),
1106 SadMxNAvgParam(8, 16, &vpx_sad8x16_avg_mmi),
1107 SadMxNAvgParam(8, 8, &vpx_sad8x8_avg_mmi),
1108 SadMxNAvgParam(8, 4, &vpx_sad8x4_avg_mmi),
1109 SadMxNAvgParam(4, 8, &vpx_sad4x8_avg_mmi),
1110 SadMxNAvgParam(4, 4, &vpx_sad4x4_avg_mmi),
1112 INSTANTIATE_TEST_SUITE_P(MMI, SADavgTest, ::testing::ValuesIn(avg_mmi_tests));
1114 const SadMxNx4Param x4d_mmi_tests[] = {
1115 SadMxNx4Param(64, 64, &vpx_sad64x64x4d_mmi),
1116 SadMxNx4Param(64, 32, &vpx_sad64x32x4d_mmi),
1117 SadMxNx4Param(32, 64, &vpx_sad32x64x4d_mmi),
1118 SadMxNx4Param(32, 32, &vpx_sad32x32x4d_mmi),
1119 SadMxNx4Param(32, 16, &vpx_sad32x16x4d_mmi),
1120 SadMxNx4Param(16, 32, &vpx_sad16x32x4d_mmi),
1121 SadMxNx4Param(16, 16, &vpx_sad16x16x4d_mmi),
1122 SadMxNx4Param(16, 8, &vpx_sad16x8x4d_mmi),
1123 SadMxNx4Param(8, 16, &vpx_sad8x16x4d_mmi),
1124 SadMxNx4Param(8, 8, &vpx_sad8x8x4d_mmi),
1125 SadMxNx4Param(8, 4, &vpx_sad8x4x4d_mmi),
1126 SadMxNx4Param(4, 8, &vpx_sad4x8x4d_mmi),
1127 SadMxNx4Param(4, 4, &vpx_sad4x4x4d_mmi),
1129 INSTANTIATE_TEST_SUITE_P(MMI, SADx4Test, ::testing::ValuesIn(x4d_mmi_tests));
1132 //------------------------------------------------------------------------------
1133 // loongarch functions
1135 const SadMxNParam lsx_tests[] = {
1136 SadMxNParam(64, 64, &vpx_sad64x64_lsx),
1137 SadMxNParam(32, 32, &vpx_sad32x32_lsx),
1138 SadMxNParam(16, 16, &vpx_sad16x16_lsx),
1139 SadMxNParam(8, 8, &vpx_sad8x8_lsx),
1141 INSTANTIATE_TEST_SUITE_P(LSX, SADTest, ::testing::ValuesIn(lsx_tests));
1143 const SadMxNAvgParam avg_lsx_tests[] = {
1144 SadMxNAvgParam(64, 64, &vpx_sad64x64_avg_lsx),
1145 SadMxNAvgParam(32, 32, &vpx_sad32x32_avg_lsx),
1147 INSTANTIATE_TEST_SUITE_P(LSX, SADavgTest, ::testing::ValuesIn(avg_lsx_tests));
1149 const SadMxNx4Param x4d_lsx_tests[] = {
1150 SadMxNx4Param(64, 64, &vpx_sad64x64x4d_lsx),
1151 SadMxNx4Param(64, 32, &vpx_sad64x32x4d_lsx),
1152 SadMxNx4Param(32, 64, &vpx_sad32x64x4d_lsx),
1153 SadMxNx4Param(32, 32, &vpx_sad32x32x4d_lsx),
1154 SadMxNx4Param(16, 16, &vpx_sad16x16x4d_lsx),
1155 SadMxNx4Param(8, 8, &vpx_sad8x8x4d_lsx),
1157 INSTANTIATE_TEST_SUITE_P(LSX, SADx4Test, ::testing::ValuesIn(x4d_lsx_tests));