2 * Copyright (c) 2010 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.
13 #include "third_party/googletest/src/include/gtest/gtest.h"
15 #include "./vpx_config.h"
16 #include "./vp9_rtcd.h"
17 #include "./vpx_dsp_rtcd.h"
18 #include "test/acm_random.h"
19 #include "test/clear_system_state.h"
20 #include "test/register_state_check.h"
21 #include "test/util.h"
22 #include "vp9/common/vp9_common.h"
23 #include "vp9/common/vp9_filter.h"
24 #include "vpx_dsp/vpx_dsp_common.h"
25 #include "vpx_dsp/vpx_filter.h"
26 #include "vpx_mem/vpx_mem.h"
27 #include "vpx_ports/mem.h"
31 static const unsigned int kMaxDimension = 64;
33 typedef void (*ConvolveFunc)(const uint8_t *src, ptrdiff_t src_stride,
34 uint8_t *dst, ptrdiff_t dst_stride,
35 const int16_t *filter_x, int filter_x_stride,
36 const int16_t *filter_y, int filter_y_stride,
39 struct ConvolveFunctions {
40 ConvolveFunctions(ConvolveFunc copy, ConvolveFunc avg,
41 ConvolveFunc h8, ConvolveFunc h8_avg,
42 ConvolveFunc v8, ConvolveFunc v8_avg,
43 ConvolveFunc hv8, ConvolveFunc hv8_avg,
44 ConvolveFunc sh8, ConvolveFunc sh8_avg,
45 ConvolveFunc sv8, ConvolveFunc sv8_avg,
46 ConvolveFunc shv8, ConvolveFunc shv8_avg,
48 : copy_(copy), avg_(avg), h8_(h8), v8_(v8), hv8_(hv8), h8_avg_(h8_avg),
49 v8_avg_(v8_avg), hv8_avg_(hv8_avg), sh8_(sh8), sv8_(sv8), shv8_(shv8),
50 sh8_avg_(sh8_avg), sv8_avg_(sv8_avg), shv8_avg_(shv8_avg),
60 ConvolveFunc hv8_avg_;
61 ConvolveFunc sh8_; // scaled horiz
62 ConvolveFunc sv8_; // scaled vert
63 ConvolveFunc shv8_; // scaled horiz/vert
64 ConvolveFunc sh8_avg_; // scaled avg horiz
65 ConvolveFunc sv8_avg_; // scaled avg vert
66 ConvolveFunc shv8_avg_; // scaled avg horiz/vert
67 int use_highbd_; // 0 if high bitdepth not used, else the actual bit depth.
70 typedef std::tr1::tuple<int, int, const ConvolveFunctions *> ConvolveParam;
72 // Reference 8-tap subpixel filter, slightly modified to fit into this test.
73 #define VP9_FILTER_WEIGHT 128
74 #define VP9_FILTER_SHIFT 7
75 uint8_t clip_pixel(int x) {
81 void filter_block2d_8_c(const uint8_t *src_ptr,
82 const unsigned int src_stride,
83 const int16_t *HFilter,
84 const int16_t *VFilter,
86 unsigned int dst_stride,
87 unsigned int output_width,
88 unsigned int output_height) {
89 // Between passes, we use an intermediate buffer whose height is extended to
90 // have enough horizontally filtered values as input for the vertical pass.
91 // This buffer is allocated to be big enough for the largest block type we
93 const int kInterp_Extend = 4;
94 const unsigned int intermediate_height =
95 (kInterp_Extend - 1) + output_height + kInterp_Extend;
98 // Size of intermediate_buffer is max_intermediate_height * filter_max_width,
99 // where max_intermediate_height = (kInterp_Extend - 1) + filter_max_height
103 // and filter_max_width = 16
105 uint8_t intermediate_buffer[71 * kMaxDimension];
106 const int intermediate_next_stride = 1 - intermediate_height * output_width;
108 // Horizontal pass (src -> transposed intermediate).
109 uint8_t *output_ptr = intermediate_buffer;
110 const int src_next_row_stride = src_stride - output_width;
111 src_ptr -= (kInterp_Extend - 1) * src_stride + (kInterp_Extend - 1);
112 for (i = 0; i < intermediate_height; ++i) {
113 for (j = 0; j < output_width; ++j) {
115 const int temp = (src_ptr[0] * HFilter[0]) +
116 (src_ptr[1] * HFilter[1]) +
117 (src_ptr[2] * HFilter[2]) +
118 (src_ptr[3] * HFilter[3]) +
119 (src_ptr[4] * HFilter[4]) +
120 (src_ptr[5] * HFilter[5]) +
121 (src_ptr[6] * HFilter[6]) +
122 (src_ptr[7] * HFilter[7]) +
123 (VP9_FILTER_WEIGHT >> 1); // Rounding
125 // Normalize back to 0-255...
126 *output_ptr = clip_pixel(temp >> VP9_FILTER_SHIFT);
128 output_ptr += intermediate_height;
130 src_ptr += src_next_row_stride;
131 output_ptr += intermediate_next_stride;
134 // Vertical pass (transposed intermediate -> dst).
135 src_ptr = intermediate_buffer;
136 const int dst_next_row_stride = dst_stride - output_width;
137 for (i = 0; i < output_height; ++i) {
138 for (j = 0; j < output_width; ++j) {
140 const int temp = (src_ptr[0] * VFilter[0]) +
141 (src_ptr[1] * VFilter[1]) +
142 (src_ptr[2] * VFilter[2]) +
143 (src_ptr[3] * VFilter[3]) +
144 (src_ptr[4] * VFilter[4]) +
145 (src_ptr[5] * VFilter[5]) +
146 (src_ptr[6] * VFilter[6]) +
147 (src_ptr[7] * VFilter[7]) +
148 (VP9_FILTER_WEIGHT >> 1); // Rounding
150 // Normalize back to 0-255...
151 *dst_ptr++ = clip_pixel(temp >> VP9_FILTER_SHIFT);
152 src_ptr += intermediate_height;
154 src_ptr += intermediate_next_stride;
155 dst_ptr += dst_next_row_stride;
159 void block2d_average_c(uint8_t *src,
160 unsigned int src_stride,
162 unsigned int output_stride,
163 unsigned int output_width,
164 unsigned int output_height) {
166 for (i = 0; i < output_height; ++i) {
167 for (j = 0; j < output_width; ++j) {
168 output_ptr[j] = (output_ptr[j] + src[i * src_stride + j] + 1) >> 1;
170 output_ptr += output_stride;
174 void filter_average_block2d_8_c(const uint8_t *src_ptr,
175 const unsigned int src_stride,
176 const int16_t *HFilter,
177 const int16_t *VFilter,
179 unsigned int dst_stride,
180 unsigned int output_width,
181 unsigned int output_height) {
182 uint8_t tmp[kMaxDimension * kMaxDimension];
184 assert(output_width <= kMaxDimension);
185 assert(output_height <= kMaxDimension);
186 filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, tmp, 64,
187 output_width, output_height);
188 block2d_average_c(tmp, 64, dst_ptr, dst_stride,
189 output_width, output_height);
192 #if CONFIG_VP9_HIGHBITDEPTH
193 void highbd_filter_block2d_8_c(const uint16_t *src_ptr,
194 const unsigned int src_stride,
195 const int16_t *HFilter,
196 const int16_t *VFilter,
198 unsigned int dst_stride,
199 unsigned int output_width,
200 unsigned int output_height,
202 // Between passes, we use an intermediate buffer whose height is extended to
203 // have enough horizontally filtered values as input for the vertical pass.
204 // This buffer is allocated to be big enough for the largest block type we
206 const int kInterp_Extend = 4;
207 const unsigned int intermediate_height =
208 (kInterp_Extend - 1) + output_height + kInterp_Extend;
210 /* Size of intermediate_buffer is max_intermediate_height * filter_max_width,
211 * where max_intermediate_height = (kInterp_Extend - 1) + filter_max_height
215 * and filter_max_width = 16
217 uint16_t intermediate_buffer[71 * kMaxDimension];
218 const int intermediate_next_stride = 1 - intermediate_height * output_width;
220 // Horizontal pass (src -> transposed intermediate).
222 uint16_t *output_ptr = intermediate_buffer;
223 const int src_next_row_stride = src_stride - output_width;
225 src_ptr -= (kInterp_Extend - 1) * src_stride + (kInterp_Extend - 1);
226 for (i = 0; i < intermediate_height; ++i) {
227 for (j = 0; j < output_width; ++j) {
229 const int temp = (src_ptr[0] * HFilter[0]) +
230 (src_ptr[1] * HFilter[1]) +
231 (src_ptr[2] * HFilter[2]) +
232 (src_ptr[3] * HFilter[3]) +
233 (src_ptr[4] * HFilter[4]) +
234 (src_ptr[5] * HFilter[5]) +
235 (src_ptr[6] * HFilter[6]) +
236 (src_ptr[7] * HFilter[7]) +
237 (VP9_FILTER_WEIGHT >> 1); // Rounding
239 // Normalize back to 0-255...
240 *output_ptr = clip_pixel_highbd(temp >> VP9_FILTER_SHIFT, bd);
242 output_ptr += intermediate_height;
244 src_ptr += src_next_row_stride;
245 output_ptr += intermediate_next_stride;
249 // Vertical pass (transposed intermediate -> dst).
251 uint16_t *src_ptr = intermediate_buffer;
252 const int dst_next_row_stride = dst_stride - output_width;
254 for (i = 0; i < output_height; ++i) {
255 for (j = 0; j < output_width; ++j) {
257 const int temp = (src_ptr[0] * VFilter[0]) +
258 (src_ptr[1] * VFilter[1]) +
259 (src_ptr[2] * VFilter[2]) +
260 (src_ptr[3] * VFilter[3]) +
261 (src_ptr[4] * VFilter[4]) +
262 (src_ptr[5] * VFilter[5]) +
263 (src_ptr[6] * VFilter[6]) +
264 (src_ptr[7] * VFilter[7]) +
265 (VP9_FILTER_WEIGHT >> 1); // Rounding
267 // Normalize back to 0-255...
268 *dst_ptr++ = clip_pixel_highbd(temp >> VP9_FILTER_SHIFT, bd);
269 src_ptr += intermediate_height;
271 src_ptr += intermediate_next_stride;
272 dst_ptr += dst_next_row_stride;
277 void highbd_block2d_average_c(uint16_t *src,
278 unsigned int src_stride,
279 uint16_t *output_ptr,
280 unsigned int output_stride,
281 unsigned int output_width,
282 unsigned int output_height,
285 for (i = 0; i < output_height; ++i) {
286 for (j = 0; j < output_width; ++j) {
287 output_ptr[j] = (output_ptr[j] + src[i * src_stride + j] + 1) >> 1;
289 output_ptr += output_stride;
293 void highbd_filter_average_block2d_8_c(const uint16_t *src_ptr,
294 const unsigned int src_stride,
295 const int16_t *HFilter,
296 const int16_t *VFilter,
298 unsigned int dst_stride,
299 unsigned int output_width,
300 unsigned int output_height,
302 uint16_t tmp[kMaxDimension * kMaxDimension];
304 assert(output_width <= kMaxDimension);
305 assert(output_height <= kMaxDimension);
306 highbd_filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, tmp, 64,
307 output_width, output_height, bd);
308 highbd_block2d_average_c(tmp, 64, dst_ptr, dst_stride,
309 output_width, output_height, bd);
311 #endif // CONFIG_VP9_HIGHBITDEPTH
313 class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
315 static void SetUpTestCase() {
316 // Force input_ to be unaligned, output to be 16 byte aligned.
317 input_ = reinterpret_cast<uint8_t*>(
318 vpx_memalign(kDataAlignment, kInputBufferSize + 1)) + 1;
319 output_ = reinterpret_cast<uint8_t*>(
320 vpx_memalign(kDataAlignment, kOutputBufferSize));
321 output_ref_ = reinterpret_cast<uint8_t*>(
322 vpx_memalign(kDataAlignment, kOutputBufferSize));
323 #if CONFIG_VP9_HIGHBITDEPTH
324 input16_ = reinterpret_cast<uint16_t*>(
325 vpx_memalign(kDataAlignment,
326 (kInputBufferSize + 1) * sizeof(uint16_t))) + 1;
327 output16_ = reinterpret_cast<uint16_t*>(
328 vpx_memalign(kDataAlignment, (kOutputBufferSize) * sizeof(uint16_t)));
329 output16_ref_ = reinterpret_cast<uint16_t*>(
330 vpx_memalign(kDataAlignment, (kOutputBufferSize) * sizeof(uint16_t)));
334 virtual void TearDown() { libvpx_test::ClearSystemState(); }
336 static void TearDownTestCase() {
337 vpx_free(input_ - 1);
341 vpx_free(output_ref_);
343 #if CONFIG_VP9_HIGHBITDEPTH
344 vpx_free(input16_ - 1);
348 vpx_free(output16_ref_);
349 output16_ref_ = NULL;
354 static const int kDataAlignment = 16;
355 static const int kOuterBlockSize = 256;
356 static const int kInputStride = kOuterBlockSize;
357 static const int kOutputStride = kOuterBlockSize;
358 static const int kInputBufferSize = kOuterBlockSize * kOuterBlockSize;
359 static const int kOutputBufferSize = kOuterBlockSize * kOuterBlockSize;
361 int Width() const { return GET_PARAM(0); }
362 int Height() const { return GET_PARAM(1); }
363 int BorderLeft() const {
364 const int center = (kOuterBlockSize - Width()) / 2;
365 return (center + (kDataAlignment - 1)) & ~(kDataAlignment - 1);
367 int BorderTop() const { return (kOuterBlockSize - Height()) / 2; }
369 bool IsIndexInBorder(int i) {
370 return (i < BorderTop() * kOuterBlockSize ||
371 i >= (BorderTop() + Height()) * kOuterBlockSize ||
372 i % kOuterBlockSize < BorderLeft() ||
373 i % kOuterBlockSize >= (BorderLeft() + Width()));
376 virtual void SetUp() {
378 #if CONFIG_VP9_HIGHBITDEPTH
379 if (UUT_->use_highbd_ != 0)
380 mask_ = (1 << UUT_->use_highbd_) - 1;
384 /* Set up guard blocks for an inner block centered in the outer block */
385 for (int i = 0; i < kOutputBufferSize; ++i) {
386 if (IsIndexInBorder(i))
392 ::libvpx_test::ACMRandom prng;
393 for (int i = 0; i < kInputBufferSize; ++i) {
396 #if CONFIG_VP9_HIGHBITDEPTH
400 input_[i] = prng.Rand8Extremes();
401 #if CONFIG_VP9_HIGHBITDEPTH
402 input16_[i] = prng.Rand16() & mask_;
408 void SetConstantInput(int value) {
409 memset(input_, value, kInputBufferSize);
410 #if CONFIG_VP9_HIGHBITDEPTH
411 vpx_memset16(input16_, value, kInputBufferSize);
415 void CopyOutputToRef() {
416 memcpy(output_ref_, output_, kOutputBufferSize);
417 #if CONFIG_VP9_HIGHBITDEPTH
418 memcpy(output16_ref_, output16_, kOutputBufferSize);
422 void CheckGuardBlocks() {
423 for (int i = 0; i < kOutputBufferSize; ++i) {
424 if (IsIndexInBorder(i))
425 EXPECT_EQ(255, output_[i]);
429 uint8_t *input() const {
430 #if CONFIG_VP9_HIGHBITDEPTH
431 if (UUT_->use_highbd_ == 0) {
432 return input_ + BorderTop() * kOuterBlockSize + BorderLeft();
434 return CONVERT_TO_BYTEPTR(input16_ + BorderTop() * kOuterBlockSize +
438 return input_ + BorderTop() * kOuterBlockSize + BorderLeft();
442 uint8_t *output() const {
443 #if CONFIG_VP9_HIGHBITDEPTH
444 if (UUT_->use_highbd_ == 0) {
445 return output_ + BorderTop() * kOuterBlockSize + BorderLeft();
447 return CONVERT_TO_BYTEPTR(output16_ + BorderTop() * kOuterBlockSize +
451 return output_ + BorderTop() * kOuterBlockSize + BorderLeft();
455 uint8_t *output_ref() const {
456 #if CONFIG_VP9_HIGHBITDEPTH
457 if (UUT_->use_highbd_ == 0) {
458 return output_ref_ + BorderTop() * kOuterBlockSize + BorderLeft();
460 return CONVERT_TO_BYTEPTR(output16_ref_ + BorderTop() * kOuterBlockSize +
464 return output_ref_ + BorderTop() * kOuterBlockSize + BorderLeft();
468 uint16_t lookup(uint8_t *list, int index) const {
469 #if CONFIG_VP9_HIGHBITDEPTH
470 if (UUT_->use_highbd_ == 0) {
473 return CONVERT_TO_SHORTPTR(list)[index];
480 void assign_val(uint8_t *list, int index, uint16_t val) const {
481 #if CONFIG_VP9_HIGHBITDEPTH
482 if (UUT_->use_highbd_ == 0) {
483 list[index] = (uint8_t) val;
485 CONVERT_TO_SHORTPTR(list)[index] = val;
488 list[index] = (uint8_t) val;
492 void wrapper_filter_average_block2d_8_c(const uint8_t *src_ptr,
493 const unsigned int src_stride,
494 const int16_t *HFilter,
495 const int16_t *VFilter,
497 unsigned int dst_stride,
498 unsigned int output_width,
499 unsigned int output_height) {
500 #if CONFIG_VP9_HIGHBITDEPTH
501 if (UUT_->use_highbd_ == 0) {
502 filter_average_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
503 dst_ptr, dst_stride, output_width,
506 highbd_filter_average_block2d_8_c(CONVERT_TO_SHORTPTR(src_ptr),
507 src_stride, HFilter, VFilter,
508 CONVERT_TO_SHORTPTR(dst_ptr),
509 dst_stride, output_width, output_height,
513 filter_average_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
514 dst_ptr, dst_stride, output_width,
519 void wrapper_filter_block2d_8_c(const uint8_t *src_ptr,
520 const unsigned int src_stride,
521 const int16_t *HFilter,
522 const int16_t *VFilter,
524 unsigned int dst_stride,
525 unsigned int output_width,
526 unsigned int output_height) {
527 #if CONFIG_VP9_HIGHBITDEPTH
528 if (UUT_->use_highbd_ == 0) {
529 filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
530 dst_ptr, dst_stride, output_width, output_height);
532 highbd_filter_block2d_8_c(CONVERT_TO_SHORTPTR(src_ptr), src_stride,
534 CONVERT_TO_SHORTPTR(dst_ptr), dst_stride,
535 output_width, output_height, UUT_->use_highbd_);
538 filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
539 dst_ptr, dst_stride, output_width, output_height);
543 const ConvolveFunctions* UUT_;
544 static uint8_t* input_;
545 static uint8_t* output_;
546 static uint8_t* output_ref_;
547 #if CONFIG_VP9_HIGHBITDEPTH
548 static uint16_t* input16_;
549 static uint16_t* output16_;
550 static uint16_t* output16_ref_;
555 uint8_t* ConvolveTest::input_ = NULL;
556 uint8_t* ConvolveTest::output_ = NULL;
557 uint8_t* ConvolveTest::output_ref_ = NULL;
558 #if CONFIG_VP9_HIGHBITDEPTH
559 uint16_t* ConvolveTest::input16_ = NULL;
560 uint16_t* ConvolveTest::output16_ = NULL;
561 uint16_t* ConvolveTest::output16_ref_ = NULL;
564 TEST_P(ConvolveTest, GuardBlocks) {
568 TEST_P(ConvolveTest, Copy) {
569 uint8_t* const in = input();
570 uint8_t* const out = output();
572 ASM_REGISTER_STATE_CHECK(
573 UUT_->copy_(in, kInputStride, out, kOutputStride, NULL, 0, NULL, 0,
578 for (int y = 0; y < Height(); ++y)
579 for (int x = 0; x < Width(); ++x)
580 ASSERT_EQ(lookup(out, y * kOutputStride + x),
581 lookup(in, y * kInputStride + x))
582 << "(" << x << "," << y << ")";
585 TEST_P(ConvolveTest, Avg) {
586 uint8_t* const in = input();
587 uint8_t* const out = output();
588 uint8_t* const out_ref = output_ref();
591 ASM_REGISTER_STATE_CHECK(
592 UUT_->avg_(in, kInputStride, out, kOutputStride, NULL, 0, NULL, 0,
597 for (int y = 0; y < Height(); ++y)
598 for (int x = 0; x < Width(); ++x)
599 ASSERT_EQ(lookup(out, y * kOutputStride + x),
600 ROUND_POWER_OF_TWO(lookup(in, y * kInputStride + x) +
601 lookup(out_ref, y * kOutputStride + x), 1))
602 << "(" << x << "," << y << ")";
605 TEST_P(ConvolveTest, CopyHoriz) {
606 uint8_t* const in = input();
607 uint8_t* const out = output();
608 DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0};
610 ASM_REGISTER_STATE_CHECK(
611 UUT_->sh8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, 16,
616 for (int y = 0; y < Height(); ++y)
617 for (int x = 0; x < Width(); ++x)
618 ASSERT_EQ(lookup(out, y * kOutputStride + x),
619 lookup(in, y * kInputStride + x))
620 << "(" << x << "," << y << ")";
623 TEST_P(ConvolveTest, CopyVert) {
624 uint8_t* const in = input();
625 uint8_t* const out = output();
626 DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0};
628 ASM_REGISTER_STATE_CHECK(
629 UUT_->sv8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, 16,
634 for (int y = 0; y < Height(); ++y)
635 for (int x = 0; x < Width(); ++x)
636 ASSERT_EQ(lookup(out, y * kOutputStride + x),
637 lookup(in, y * kInputStride + x))
638 << "(" << x << "," << y << ")";
641 TEST_P(ConvolveTest, Copy2D) {
642 uint8_t* const in = input();
643 uint8_t* const out = output();
644 DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0};
646 ASM_REGISTER_STATE_CHECK(
647 UUT_->shv8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8,
648 16, Width(), Height()));
652 for (int y = 0; y < Height(); ++y)
653 for (int x = 0; x < Width(); ++x)
654 ASSERT_EQ(lookup(out, y * kOutputStride + x),
655 lookup(in, y * kInputStride + x))
656 << "(" << x << "," << y << ")";
659 const int kNumFilterBanks = 4;
660 const int kNumFilters = 16;
662 TEST(ConvolveTest, FiltersWontSaturateWhenAddedPairwise) {
663 for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
664 const InterpKernel *filters =
665 vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)];
666 for (int i = 0; i < kNumFilters; i++) {
667 const int p0 = filters[i][0] + filters[i][1];
668 const int p1 = filters[i][2] + filters[i][3];
669 const int p2 = filters[i][4] + filters[i][5];
670 const int p3 = filters[i][6] + filters[i][7];
675 EXPECT_LE(p0 + p3, 128);
676 EXPECT_LE(p0 + p3 + p1, 128);
677 EXPECT_LE(p0 + p3 + p1 + p2, 128);
678 EXPECT_EQ(p0 + p1 + p2 + p3, 128);
683 const int16_t kInvalidFilter[8] = { 0 };
685 TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) {
686 uint8_t* const in = input();
687 uint8_t* const out = output();
688 #if CONFIG_VP9_HIGHBITDEPTH
689 uint8_t ref8[kOutputStride * kMaxDimension];
690 uint16_t ref16[kOutputStride * kMaxDimension];
692 if (UUT_->use_highbd_ == 0) {
695 ref = CONVERT_TO_BYTEPTR(ref16);
698 uint8_t ref[kOutputStride * kMaxDimension];
701 for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
702 const InterpKernel *filters =
703 vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)];
705 for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
706 for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
707 wrapper_filter_block2d_8_c(in, kInputStride,
708 filters[filter_x], filters[filter_y],
712 if (filter_x && filter_y)
713 ASM_REGISTER_STATE_CHECK(
714 UUT_->hv8_(in, kInputStride, out, kOutputStride,
715 filters[filter_x], 16, filters[filter_y], 16,
718 ASM_REGISTER_STATE_CHECK(
719 UUT_->v8_(in, kInputStride, out, kOutputStride,
720 kInvalidFilter, 16, filters[filter_y], 16,
723 ASM_REGISTER_STATE_CHECK(
724 UUT_->h8_(in, kInputStride, out, kOutputStride,
725 filters[filter_x], 16, kInvalidFilter, 16,
728 ASM_REGISTER_STATE_CHECK(
729 UUT_->copy_(in, kInputStride, out, kOutputStride,
730 kInvalidFilter, 0, kInvalidFilter, 0,
735 for (int y = 0; y < Height(); ++y)
736 for (int x = 0; x < Width(); ++x)
737 ASSERT_EQ(lookup(ref, y * kOutputStride + x),
738 lookup(out, y * kOutputStride + x))
739 << "mismatch at (" << x << "," << y << "), "
740 << "filters (" << filter_bank << ","
741 << filter_x << "," << filter_y << ")";
747 TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) {
748 uint8_t* const in = input();
749 uint8_t* const out = output();
750 #if CONFIG_VP9_HIGHBITDEPTH
751 uint8_t ref8[kOutputStride * kMaxDimension];
752 uint16_t ref16[kOutputStride * kMaxDimension];
754 if (UUT_->use_highbd_ == 0) {
757 ref = CONVERT_TO_BYTEPTR(ref16);
760 uint8_t ref[kOutputStride * kMaxDimension];
763 // Populate ref and out with some random data
764 ::libvpx_test::ACMRandom prng;
765 for (int y = 0; y < Height(); ++y) {
766 for (int x = 0; x < Width(); ++x) {
768 #if CONFIG_VP9_HIGHBITDEPTH
769 if (UUT_->use_highbd_ == 0 || UUT_->use_highbd_ == 8) {
770 r = prng.Rand8Extremes();
772 r = prng.Rand16() & mask_;
775 r = prng.Rand8Extremes();
778 assign_val(out, y * kOutputStride + x, r);
779 assign_val(ref, y * kOutputStride + x, r);
783 for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
784 const InterpKernel *filters =
785 vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)];
787 for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
788 for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
789 wrapper_filter_average_block2d_8_c(in, kInputStride,
790 filters[filter_x], filters[filter_y],
794 if (filter_x && filter_y)
795 ASM_REGISTER_STATE_CHECK(
796 UUT_->hv8_avg_(in, kInputStride, out, kOutputStride,
797 filters[filter_x], 16, filters[filter_y], 16,
800 ASM_REGISTER_STATE_CHECK(
801 UUT_->v8_avg_(in, kInputStride, out, kOutputStride,
802 kInvalidFilter, 16, filters[filter_y], 16,
805 ASM_REGISTER_STATE_CHECK(
806 UUT_->h8_avg_(in, kInputStride, out, kOutputStride,
807 filters[filter_x], 16, kInvalidFilter, 16,
810 ASM_REGISTER_STATE_CHECK(
811 UUT_->avg_(in, kInputStride, out, kOutputStride,
812 kInvalidFilter, 0, kInvalidFilter, 0,
817 for (int y = 0; y < Height(); ++y)
818 for (int x = 0; x < Width(); ++x)
819 ASSERT_EQ(lookup(ref, y * kOutputStride + x),
820 lookup(out, y * kOutputStride + x))
821 << "mismatch at (" << x << "," << y << "), "
822 << "filters (" << filter_bank << ","
823 << filter_x << "," << filter_y << ")";
829 TEST_P(ConvolveTest, FilterExtremes) {
830 uint8_t *const in = input();
831 uint8_t *const out = output();
832 #if CONFIG_VP9_HIGHBITDEPTH
833 uint8_t ref8[kOutputStride * kMaxDimension];
834 uint16_t ref16[kOutputStride * kMaxDimension];
836 if (UUT_->use_highbd_ == 0) {
839 ref = CONVERT_TO_BYTEPTR(ref16);
842 uint8_t ref[kOutputStride * kMaxDimension];
845 // Populate ref and out with some random data
846 ::libvpx_test::ACMRandom prng;
847 for (int y = 0; y < Height(); ++y) {
848 for (int x = 0; x < Width(); ++x) {
850 #if CONFIG_VP9_HIGHBITDEPTH
851 if (UUT_->use_highbd_ == 0 || UUT_->use_highbd_ == 8) {
852 r = prng.Rand8Extremes();
854 r = prng.Rand16() & mask_;
857 r = prng.Rand8Extremes();
859 assign_val(out, y * kOutputStride + x, r);
860 assign_val(ref, y * kOutputStride + x, r);
864 for (int axis = 0; axis < 2; axis++) {
866 while (seed_val < 256) {
867 for (int y = 0; y < 8; ++y) {
868 for (int x = 0; x < 8; ++x) {
869 #if CONFIG_VP9_HIGHBITDEPTH
870 assign_val(in, y * kOutputStride + x - SUBPEL_TAPS / 2 + 1,
871 ((seed_val >> (axis ? y : x)) & 1) * mask_);
873 assign_val(in, y * kOutputStride + x - SUBPEL_TAPS / 2 + 1,
874 ((seed_val >> (axis ? y : x)) & 1) * 255);
876 if (axis) seed_val++;
883 if (axis) seed_val += 8;
885 for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
886 const InterpKernel *filters =
887 vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)];
888 for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
889 for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
890 wrapper_filter_block2d_8_c(in, kInputStride,
891 filters[filter_x], filters[filter_y],
894 if (filter_x && filter_y)
895 ASM_REGISTER_STATE_CHECK(
896 UUT_->hv8_(in, kInputStride, out, kOutputStride,
897 filters[filter_x], 16, filters[filter_y], 16,
900 ASM_REGISTER_STATE_CHECK(
901 UUT_->v8_(in, kInputStride, out, kOutputStride,
902 kInvalidFilter, 16, filters[filter_y], 16,
905 ASM_REGISTER_STATE_CHECK(
906 UUT_->h8_(in, kInputStride, out, kOutputStride,
907 filters[filter_x], 16, kInvalidFilter, 16,
910 ASM_REGISTER_STATE_CHECK(
911 UUT_->copy_(in, kInputStride, out, kOutputStride,
912 kInvalidFilter, 0, kInvalidFilter, 0,
915 for (int y = 0; y < Height(); ++y)
916 for (int x = 0; x < Width(); ++x)
917 ASSERT_EQ(lookup(ref, y * kOutputStride + x),
918 lookup(out, y * kOutputStride + x))
919 << "mismatch at (" << x << "," << y << "), "
920 << "filters (" << filter_bank << ","
921 << filter_x << "," << filter_y << ")";
929 /* This test exercises that enough rows and columns are filtered with every
930 possible initial fractional positions and scaling steps. */
931 TEST_P(ConvolveTest, CheckScalingFiltering) {
932 uint8_t* const in = input();
933 uint8_t* const out = output();
934 const InterpKernel *const eighttap = vp9_filter_kernels[EIGHTTAP];
936 SetConstantInput(127);
938 for (int frac = 0; frac < 16; ++frac) {
939 for (int step = 1; step <= 32; ++step) {
940 /* Test the horizontal and vertical filters in combination. */
941 ASM_REGISTER_STATE_CHECK(UUT_->shv8_(in, kInputStride, out, kOutputStride,
942 eighttap[frac], step,
943 eighttap[frac], step,
948 for (int y = 0; y < Height(); ++y) {
949 for (int x = 0; x < Width(); ++x) {
950 ASSERT_EQ(lookup(in, y * kInputStride + x),
951 lookup(out, y * kOutputStride + x))
952 << "x == " << x << ", y == " << y
953 << ", frac == " << frac << ", step == " << step;
960 using std::tr1::make_tuple;
962 #if CONFIG_VP9_HIGHBITDEPTH
963 #if HAVE_SSE2 && ARCH_X86_64
964 void wrap_convolve8_horiz_sse2_8(const uint8_t *src, ptrdiff_t src_stride,
965 uint8_t *dst, ptrdiff_t dst_stride,
966 const int16_t *filter_x,
968 const int16_t *filter_y,
971 vpx_highbd_convolve8_horiz_sse2(src, src_stride, dst, dst_stride, filter_x,
972 filter_x_stride, filter_y, filter_y_stride,
976 void wrap_convolve8_avg_horiz_sse2_8(const uint8_t *src, ptrdiff_t src_stride,
977 uint8_t *dst, ptrdiff_t dst_stride,
978 const int16_t *filter_x,
980 const int16_t *filter_y,
983 vpx_highbd_convolve8_avg_horiz_sse2(src, src_stride, dst, dst_stride,
984 filter_x, filter_x_stride,
985 filter_y, filter_y_stride, w, h, 8);
988 void wrap_convolve8_vert_sse2_8(const uint8_t *src, ptrdiff_t src_stride,
989 uint8_t *dst, ptrdiff_t dst_stride,
990 const int16_t *filter_x,
992 const int16_t *filter_y,
995 vpx_highbd_convolve8_vert_sse2(src, src_stride, dst, dst_stride,
996 filter_x, filter_x_stride,
997 filter_y, filter_y_stride, w, h, 8);
1000 void wrap_convolve8_avg_vert_sse2_8(const uint8_t *src, ptrdiff_t src_stride,
1001 uint8_t *dst, ptrdiff_t dst_stride,
1002 const int16_t *filter_x,
1003 int filter_x_stride,
1004 const int16_t *filter_y,
1005 int filter_y_stride,
1007 vpx_highbd_convolve8_avg_vert_sse2(src, src_stride, dst, dst_stride,
1008 filter_x, filter_x_stride,
1009 filter_y, filter_y_stride, w, h, 8);
1012 void wrap_convolve8_sse2_8(const uint8_t *src, ptrdiff_t src_stride,
1013 uint8_t *dst, ptrdiff_t dst_stride,
1014 const int16_t *filter_x,
1015 int filter_x_stride,
1016 const int16_t *filter_y,
1017 int filter_y_stride,
1019 vpx_highbd_convolve8_sse2(src, src_stride, dst, dst_stride,
1020 filter_x, filter_x_stride,
1021 filter_y, filter_y_stride, w, h, 8);
1024 void wrap_convolve8_avg_sse2_8(const uint8_t *src, ptrdiff_t src_stride,
1025 uint8_t *dst, ptrdiff_t dst_stride,
1026 const int16_t *filter_x,
1027 int filter_x_stride,
1028 const int16_t *filter_y,
1029 int filter_y_stride,
1031 vpx_highbd_convolve8_avg_sse2(src, src_stride, dst, dst_stride,
1032 filter_x, filter_x_stride,
1033 filter_y, filter_y_stride, w, h, 8);
1036 void wrap_convolve8_horiz_sse2_10(const uint8_t *src, ptrdiff_t src_stride,
1037 uint8_t *dst, ptrdiff_t dst_stride,
1038 const int16_t *filter_x,
1039 int filter_x_stride,
1040 const int16_t *filter_y,
1041 int filter_y_stride,
1043 vpx_highbd_convolve8_horiz_sse2(src, src_stride, dst, dst_stride,
1044 filter_x, filter_x_stride,
1045 filter_y, filter_y_stride, w, h, 10);
1048 void wrap_convolve8_avg_horiz_sse2_10(const uint8_t *src, ptrdiff_t src_stride,
1049 uint8_t *dst, ptrdiff_t dst_stride,
1050 const int16_t *filter_x,
1051 int filter_x_stride,
1052 const int16_t *filter_y,
1053 int filter_y_stride,
1055 vpx_highbd_convolve8_avg_horiz_sse2(src, src_stride, dst, dst_stride,
1056 filter_x, filter_x_stride,
1057 filter_y, filter_y_stride, w, h, 10);
1060 void wrap_convolve8_vert_sse2_10(const uint8_t *src, ptrdiff_t src_stride,
1061 uint8_t *dst, ptrdiff_t dst_stride,
1062 const int16_t *filter_x,
1063 int filter_x_stride,
1064 const int16_t *filter_y,
1065 int filter_y_stride,
1067 vpx_highbd_convolve8_vert_sse2(src, src_stride, dst, dst_stride,
1068 filter_x, filter_x_stride,
1069 filter_y, filter_y_stride, w, h, 10);
1072 void wrap_convolve8_avg_vert_sse2_10(const uint8_t *src, ptrdiff_t src_stride,
1073 uint8_t *dst, ptrdiff_t dst_stride,
1074 const int16_t *filter_x,
1075 int filter_x_stride,
1076 const int16_t *filter_y,
1077 int filter_y_stride,
1079 vpx_highbd_convolve8_avg_vert_sse2(src, src_stride, dst, dst_stride,
1080 filter_x, filter_x_stride,
1081 filter_y, filter_y_stride, w, h, 10);
1084 void wrap_convolve8_sse2_10(const uint8_t *src, ptrdiff_t src_stride,
1085 uint8_t *dst, ptrdiff_t dst_stride,
1086 const int16_t *filter_x,
1087 int filter_x_stride,
1088 const int16_t *filter_y,
1089 int filter_y_stride,
1091 vpx_highbd_convolve8_sse2(src, src_stride, dst, dst_stride,
1092 filter_x, filter_x_stride,
1093 filter_y, filter_y_stride, w, h, 10);
1096 void wrap_convolve8_avg_sse2_10(const uint8_t *src, ptrdiff_t src_stride,
1097 uint8_t *dst, ptrdiff_t dst_stride,
1098 const int16_t *filter_x,
1099 int filter_x_stride,
1100 const int16_t *filter_y,
1101 int filter_y_stride,
1103 vpx_highbd_convolve8_avg_sse2(src, src_stride, dst, dst_stride,
1104 filter_x, filter_x_stride,
1105 filter_y, filter_y_stride, w, h, 10);
1108 void wrap_convolve8_horiz_sse2_12(const uint8_t *src, ptrdiff_t src_stride,
1109 uint8_t *dst, ptrdiff_t dst_stride,
1110 const int16_t *filter_x,
1111 int filter_x_stride,
1112 const int16_t *filter_y,
1113 int filter_y_stride,
1115 vpx_highbd_convolve8_horiz_sse2(src, src_stride, dst, dst_stride,
1116 filter_x, filter_x_stride,
1117 filter_y, filter_y_stride, w, h, 12);
1120 void wrap_convolve8_avg_horiz_sse2_12(const uint8_t *src, ptrdiff_t src_stride,
1121 uint8_t *dst, ptrdiff_t dst_stride,
1122 const int16_t *filter_x,
1123 int filter_x_stride,
1124 const int16_t *filter_y,
1125 int filter_y_stride,
1127 vpx_highbd_convolve8_avg_horiz_sse2(src, src_stride, dst, dst_stride,
1128 filter_x, filter_x_stride,
1129 filter_y, filter_y_stride, w, h, 12);
1132 void wrap_convolve8_vert_sse2_12(const uint8_t *src, ptrdiff_t src_stride,
1133 uint8_t *dst, ptrdiff_t dst_stride,
1134 const int16_t *filter_x,
1135 int filter_x_stride,
1136 const int16_t *filter_y,
1137 int filter_y_stride,
1139 vpx_highbd_convolve8_vert_sse2(src, src_stride, dst, dst_stride,
1140 filter_x, filter_x_stride,
1141 filter_y, filter_y_stride, w, h, 12);
1144 void wrap_convolve8_avg_vert_sse2_12(const uint8_t *src, ptrdiff_t src_stride,
1145 uint8_t *dst, ptrdiff_t dst_stride,
1146 const int16_t *filter_x,
1147 int filter_x_stride,
1148 const int16_t *filter_y,
1149 int filter_y_stride,
1151 vpx_highbd_convolve8_avg_vert_sse2(src, src_stride, dst, dst_stride,
1152 filter_x, filter_x_stride,
1153 filter_y, filter_y_stride, w, h, 12);
1156 void wrap_convolve8_sse2_12(const uint8_t *src, ptrdiff_t src_stride,
1157 uint8_t *dst, ptrdiff_t dst_stride,
1158 const int16_t *filter_x,
1159 int filter_x_stride,
1160 const int16_t *filter_y,
1161 int filter_y_stride,
1163 vpx_highbd_convolve8_sse2(src, src_stride, dst, dst_stride,
1164 filter_x, filter_x_stride,
1165 filter_y, filter_y_stride, w, h, 12);
1168 void wrap_convolve8_avg_sse2_12(const uint8_t *src, ptrdiff_t src_stride,
1169 uint8_t *dst, ptrdiff_t dst_stride,
1170 const int16_t *filter_x,
1171 int filter_x_stride,
1172 const int16_t *filter_y,
1173 int filter_y_stride,
1175 vpx_highbd_convolve8_avg_sse2(src, src_stride, dst, dst_stride,
1176 filter_x, filter_x_stride,
1177 filter_y, filter_y_stride, w, h, 12);
1179 #endif // HAVE_SSE2 && ARCH_X86_64
1181 void wrap_convolve_copy_c_8(const uint8_t *src, ptrdiff_t src_stride,
1182 uint8_t *dst, ptrdiff_t dst_stride,
1183 const int16_t *filter_x,
1184 int filter_x_stride,
1185 const int16_t *filter_y,
1186 int filter_y_stride,
1188 vpx_highbd_convolve_copy_c(src, src_stride, dst, dst_stride,
1189 filter_x, filter_x_stride,
1190 filter_y, filter_y_stride, w, h, 8);
1193 void wrap_convolve_avg_c_8(const uint8_t *src, ptrdiff_t src_stride,
1194 uint8_t *dst, ptrdiff_t dst_stride,
1195 const int16_t *filter_x,
1196 int filter_x_stride,
1197 const int16_t *filter_y,
1198 int filter_y_stride,
1200 vpx_highbd_convolve_avg_c(src, src_stride, dst, dst_stride,
1201 filter_x, filter_x_stride,
1202 filter_y, filter_y_stride, w, h, 8);
1205 void wrap_convolve8_horiz_c_8(const uint8_t *src, ptrdiff_t src_stride,
1206 uint8_t *dst, ptrdiff_t dst_stride,
1207 const int16_t *filter_x,
1208 int filter_x_stride,
1209 const int16_t *filter_y,
1210 int filter_y_stride,
1212 vpx_highbd_convolve8_horiz_c(src, src_stride, dst, dst_stride,
1213 filter_x, filter_x_stride,
1214 filter_y, filter_y_stride, w, h, 8);
1217 void wrap_convolve8_avg_horiz_c_8(const uint8_t *src, ptrdiff_t src_stride,
1218 uint8_t *dst, ptrdiff_t dst_stride,
1219 const int16_t *filter_x,
1220 int filter_x_stride,
1221 const int16_t *filter_y,
1222 int filter_y_stride,
1224 vpx_highbd_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride,
1225 filter_x, filter_x_stride,
1226 filter_y, filter_y_stride, w, h, 8);
1229 void wrap_convolve8_vert_c_8(const uint8_t *src, ptrdiff_t src_stride,
1230 uint8_t *dst, ptrdiff_t dst_stride,
1231 const int16_t *filter_x,
1232 int filter_x_stride,
1233 const int16_t *filter_y,
1234 int filter_y_stride,
1236 vpx_highbd_convolve8_vert_c(src, src_stride, dst, dst_stride,
1237 filter_x, filter_x_stride,
1238 filter_y, filter_y_stride, w, h, 8);
1241 void wrap_convolve8_avg_vert_c_8(const uint8_t *src, ptrdiff_t src_stride,
1242 uint8_t *dst, ptrdiff_t dst_stride,
1243 const int16_t *filter_x,
1244 int filter_x_stride,
1245 const int16_t *filter_y,
1246 int filter_y_stride,
1248 vpx_highbd_convolve8_avg_vert_c(src, src_stride, dst, dst_stride,
1249 filter_x, filter_x_stride,
1250 filter_y, filter_y_stride, w, h, 8);
1253 void wrap_convolve8_c_8(const uint8_t *src, ptrdiff_t src_stride,
1254 uint8_t *dst, ptrdiff_t dst_stride,
1255 const int16_t *filter_x,
1256 int filter_x_stride,
1257 const int16_t *filter_y,
1258 int filter_y_stride,
1260 vpx_highbd_convolve8_c(src, src_stride, dst, dst_stride,
1261 filter_x, filter_x_stride,
1262 filter_y, filter_y_stride, w, h, 8);
1265 void wrap_convolve8_avg_c_8(const uint8_t *src, ptrdiff_t src_stride,
1266 uint8_t *dst, ptrdiff_t dst_stride,
1267 const int16_t *filter_x,
1268 int filter_x_stride,
1269 const int16_t *filter_y,
1270 int filter_y_stride,
1272 vpx_highbd_convolve8_avg_c(src, src_stride, dst, dst_stride,
1273 filter_x, filter_x_stride,
1274 filter_y, filter_y_stride, w, h, 8);
1277 void wrap_convolve_copy_c_10(const uint8_t *src, ptrdiff_t src_stride,
1278 uint8_t *dst, ptrdiff_t dst_stride,
1279 const int16_t *filter_x,
1280 int filter_x_stride,
1281 const int16_t *filter_y,
1282 int filter_y_stride,
1284 vpx_highbd_convolve_copy_c(src, src_stride, dst, dst_stride,
1285 filter_x, filter_x_stride,
1286 filter_y, filter_y_stride, w, h, 10);
1289 void wrap_convolve_avg_c_10(const uint8_t *src, ptrdiff_t src_stride,
1290 uint8_t *dst, ptrdiff_t dst_stride,
1291 const int16_t *filter_x,
1292 int filter_x_stride,
1293 const int16_t *filter_y,
1294 int filter_y_stride,
1296 vpx_highbd_convolve_avg_c(src, src_stride, dst, dst_stride,
1297 filter_x, filter_x_stride,
1298 filter_y, filter_y_stride, w, h, 10);
1301 void wrap_convolve8_horiz_c_10(const uint8_t *src, ptrdiff_t src_stride,
1302 uint8_t *dst, ptrdiff_t dst_stride,
1303 const int16_t *filter_x,
1304 int filter_x_stride,
1305 const int16_t *filter_y,
1306 int filter_y_stride,
1308 vpx_highbd_convolve8_horiz_c(src, src_stride, dst, dst_stride,
1309 filter_x, filter_x_stride,
1310 filter_y, filter_y_stride, w, h, 10);
1313 void wrap_convolve8_avg_horiz_c_10(const uint8_t *src, ptrdiff_t src_stride,
1314 uint8_t *dst, ptrdiff_t dst_stride,
1315 const int16_t *filter_x,
1316 int filter_x_stride,
1317 const int16_t *filter_y,
1318 int filter_y_stride,
1320 vpx_highbd_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride,
1321 filter_x, filter_x_stride,
1322 filter_y, filter_y_stride, w, h, 10);
1325 void wrap_convolve8_vert_c_10(const uint8_t *src, ptrdiff_t src_stride,
1326 uint8_t *dst, ptrdiff_t dst_stride,
1327 const int16_t *filter_x,
1328 int filter_x_stride,
1329 const int16_t *filter_y,
1330 int filter_y_stride,
1332 vpx_highbd_convolve8_vert_c(src, src_stride, dst, dst_stride,
1333 filter_x, filter_x_stride,
1334 filter_y, filter_y_stride, w, h, 10);
1337 void wrap_convolve8_avg_vert_c_10(const uint8_t *src, ptrdiff_t src_stride,
1338 uint8_t *dst, ptrdiff_t dst_stride,
1339 const int16_t *filter_x,
1340 int filter_x_stride,
1341 const int16_t *filter_y,
1342 int filter_y_stride,
1344 vpx_highbd_convolve8_avg_vert_c(src, src_stride, dst, dst_stride,
1345 filter_x, filter_x_stride,
1346 filter_y, filter_y_stride, w, h, 10);
1349 void wrap_convolve8_c_10(const uint8_t *src, ptrdiff_t src_stride,
1350 uint8_t *dst, ptrdiff_t dst_stride,
1351 const int16_t *filter_x,
1352 int filter_x_stride,
1353 const int16_t *filter_y,
1354 int filter_y_stride,
1356 vpx_highbd_convolve8_c(src, src_stride, dst, dst_stride,
1357 filter_x, filter_x_stride,
1358 filter_y, filter_y_stride, w, h, 10);
1361 void wrap_convolve8_avg_c_10(const uint8_t *src, ptrdiff_t src_stride,
1362 uint8_t *dst, ptrdiff_t dst_stride,
1363 const int16_t *filter_x,
1364 int filter_x_stride,
1365 const int16_t *filter_y,
1366 int filter_y_stride,
1368 vpx_highbd_convolve8_avg_c(src, src_stride, dst, dst_stride,
1369 filter_x, filter_x_stride,
1370 filter_y, filter_y_stride, w, h, 10);
1373 void wrap_convolve_copy_c_12(const uint8_t *src, ptrdiff_t src_stride,
1374 uint8_t *dst, ptrdiff_t dst_stride,
1375 const int16_t *filter_x,
1376 int filter_x_stride,
1377 const int16_t *filter_y,
1378 int filter_y_stride,
1380 vpx_highbd_convolve_copy_c(src, src_stride, dst, dst_stride,
1381 filter_x, filter_x_stride,
1382 filter_y, filter_y_stride, w, h, 12);
1385 void wrap_convolve_avg_c_12(const uint8_t *src, ptrdiff_t src_stride,
1386 uint8_t *dst, ptrdiff_t dst_stride,
1387 const int16_t *filter_x,
1388 int filter_x_stride,
1389 const int16_t *filter_y,
1390 int filter_y_stride,
1392 vpx_highbd_convolve_avg_c(src, src_stride, dst, dst_stride,
1393 filter_x, filter_x_stride,
1394 filter_y, filter_y_stride, w, h, 12);
1397 void wrap_convolve8_horiz_c_12(const uint8_t *src, ptrdiff_t src_stride,
1398 uint8_t *dst, ptrdiff_t dst_stride,
1399 const int16_t *filter_x,
1400 int filter_x_stride,
1401 const int16_t *filter_y,
1402 int filter_y_stride,
1404 vpx_highbd_convolve8_horiz_c(src, src_stride, dst, dst_stride,
1405 filter_x, filter_x_stride,
1406 filter_y, filter_y_stride, w, h, 12);
1409 void wrap_convolve8_avg_horiz_c_12(const uint8_t *src, ptrdiff_t src_stride,
1410 uint8_t *dst, ptrdiff_t dst_stride,
1411 const int16_t *filter_x,
1412 int filter_x_stride,
1413 const int16_t *filter_y,
1414 int filter_y_stride,
1416 vpx_highbd_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride,
1417 filter_x, filter_x_stride,
1418 filter_y, filter_y_stride, w, h, 12);
1421 void wrap_convolve8_vert_c_12(const uint8_t *src, ptrdiff_t src_stride,
1422 uint8_t *dst, ptrdiff_t dst_stride,
1423 const int16_t *filter_x,
1424 int filter_x_stride,
1425 const int16_t *filter_y,
1426 int filter_y_stride,
1428 vpx_highbd_convolve8_vert_c(src, src_stride, dst, dst_stride,
1429 filter_x, filter_x_stride,
1430 filter_y, filter_y_stride, w, h, 12);
1433 void wrap_convolve8_avg_vert_c_12(const uint8_t *src, ptrdiff_t src_stride,
1434 uint8_t *dst, ptrdiff_t dst_stride,
1435 const int16_t *filter_x,
1436 int filter_x_stride,
1437 const int16_t *filter_y,
1438 int filter_y_stride,
1440 vpx_highbd_convolve8_avg_vert_c(src, src_stride, dst, dst_stride,
1441 filter_x, filter_x_stride,
1442 filter_y, filter_y_stride, w, h, 12);
1445 void wrap_convolve8_c_12(const uint8_t *src, ptrdiff_t src_stride,
1446 uint8_t *dst, ptrdiff_t dst_stride,
1447 const int16_t *filter_x,
1448 int filter_x_stride,
1449 const int16_t *filter_y,
1450 int filter_y_stride,
1452 vpx_highbd_convolve8_c(src, src_stride, dst, dst_stride,
1453 filter_x, filter_x_stride,
1454 filter_y, filter_y_stride, w, h, 12);
1457 void wrap_convolve8_avg_c_12(const uint8_t *src, ptrdiff_t src_stride,
1458 uint8_t *dst, ptrdiff_t dst_stride,
1459 const int16_t *filter_x,
1460 int filter_x_stride,
1461 const int16_t *filter_y,
1462 int filter_y_stride,
1464 vpx_highbd_convolve8_avg_c(src, src_stride, dst, dst_stride,
1465 filter_x, filter_x_stride,
1466 filter_y, filter_y_stride, w, h, 12);
1469 const ConvolveFunctions convolve8_c(
1470 wrap_convolve_copy_c_8, wrap_convolve_avg_c_8,
1471 wrap_convolve8_horiz_c_8, wrap_convolve8_avg_horiz_c_8,
1472 wrap_convolve8_vert_c_8, wrap_convolve8_avg_vert_c_8,
1473 wrap_convolve8_c_8, wrap_convolve8_avg_c_8,
1474 wrap_convolve8_horiz_c_8, wrap_convolve8_avg_horiz_c_8,
1475 wrap_convolve8_vert_c_8, wrap_convolve8_avg_vert_c_8,
1476 wrap_convolve8_c_8, wrap_convolve8_avg_c_8, 8);
1477 INSTANTIATE_TEST_CASE_P(C_8, ConvolveTest, ::testing::Values(
1478 make_tuple(4, 4, &convolve8_c),
1479 make_tuple(8, 4, &convolve8_c),
1480 make_tuple(4, 8, &convolve8_c),
1481 make_tuple(8, 8, &convolve8_c),
1482 make_tuple(16, 8, &convolve8_c),
1483 make_tuple(8, 16, &convolve8_c),
1484 make_tuple(16, 16, &convolve8_c),
1485 make_tuple(32, 16, &convolve8_c),
1486 make_tuple(16, 32, &convolve8_c),
1487 make_tuple(32, 32, &convolve8_c),
1488 make_tuple(64, 32, &convolve8_c),
1489 make_tuple(32, 64, &convolve8_c),
1490 make_tuple(64, 64, &convolve8_c)));
1491 const ConvolveFunctions convolve10_c(
1492 wrap_convolve_copy_c_10, wrap_convolve_avg_c_10,
1493 wrap_convolve8_horiz_c_10, wrap_convolve8_avg_horiz_c_10,
1494 wrap_convolve8_vert_c_10, wrap_convolve8_avg_vert_c_10,
1495 wrap_convolve8_c_10, wrap_convolve8_avg_c_10,
1496 wrap_convolve8_horiz_c_10, wrap_convolve8_avg_horiz_c_10,
1497 wrap_convolve8_vert_c_10, wrap_convolve8_avg_vert_c_10,
1498 wrap_convolve8_c_10, wrap_convolve8_avg_c_10, 10);
1499 INSTANTIATE_TEST_CASE_P(C_10, ConvolveTest, ::testing::Values(
1500 make_tuple(4, 4, &convolve10_c),
1501 make_tuple(8, 4, &convolve10_c),
1502 make_tuple(4, 8, &convolve10_c),
1503 make_tuple(8, 8, &convolve10_c),
1504 make_tuple(16, 8, &convolve10_c),
1505 make_tuple(8, 16, &convolve10_c),
1506 make_tuple(16, 16, &convolve10_c),
1507 make_tuple(32, 16, &convolve10_c),
1508 make_tuple(16, 32, &convolve10_c),
1509 make_tuple(32, 32, &convolve10_c),
1510 make_tuple(64, 32, &convolve10_c),
1511 make_tuple(32, 64, &convolve10_c),
1512 make_tuple(64, 64, &convolve10_c)));
1513 const ConvolveFunctions convolve12_c(
1514 wrap_convolve_copy_c_12, wrap_convolve_avg_c_12,
1515 wrap_convolve8_horiz_c_12, wrap_convolve8_avg_horiz_c_12,
1516 wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12,
1517 wrap_convolve8_c_12, wrap_convolve8_avg_c_12,
1518 wrap_convolve8_horiz_c_12, wrap_convolve8_avg_horiz_c_12,
1519 wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12,
1520 wrap_convolve8_c_12, wrap_convolve8_avg_c_12, 12);
1521 INSTANTIATE_TEST_CASE_P(C_12, ConvolveTest, ::testing::Values(
1522 make_tuple(4, 4, &convolve12_c),
1523 make_tuple(8, 4, &convolve12_c),
1524 make_tuple(4, 8, &convolve12_c),
1525 make_tuple(8, 8, &convolve12_c),
1526 make_tuple(16, 8, &convolve12_c),
1527 make_tuple(8, 16, &convolve12_c),
1528 make_tuple(16, 16, &convolve12_c),
1529 make_tuple(32, 16, &convolve12_c),
1530 make_tuple(16, 32, &convolve12_c),
1531 make_tuple(32, 32, &convolve12_c),
1532 make_tuple(64, 32, &convolve12_c),
1533 make_tuple(32, 64, &convolve12_c),
1534 make_tuple(64, 64, &convolve12_c)));
1538 const ConvolveFunctions convolve8_c(
1539 vpx_convolve_copy_c, vpx_convolve_avg_c,
1540 vpx_convolve8_horiz_c, vpx_convolve8_avg_horiz_c,
1541 vpx_convolve8_vert_c, vpx_convolve8_avg_vert_c,
1542 vpx_convolve8_c, vpx_convolve8_avg_c,
1543 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1544 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1545 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1547 INSTANTIATE_TEST_CASE_P(C, ConvolveTest, ::testing::Values(
1548 make_tuple(4, 4, &convolve8_c),
1549 make_tuple(8, 4, &convolve8_c),
1550 make_tuple(4, 8, &convolve8_c),
1551 make_tuple(8, 8, &convolve8_c),
1552 make_tuple(16, 8, &convolve8_c),
1553 make_tuple(8, 16, &convolve8_c),
1554 make_tuple(16, 16, &convolve8_c),
1555 make_tuple(32, 16, &convolve8_c),
1556 make_tuple(16, 32, &convolve8_c),
1557 make_tuple(32, 32, &convolve8_c),
1558 make_tuple(64, 32, &convolve8_c),
1559 make_tuple(32, 64, &convolve8_c),
1560 make_tuple(64, 64, &convolve8_c)));
1563 #if HAVE_SSE2 && ARCH_X86_64
1564 #if CONFIG_VP9_HIGHBITDEPTH
1565 const ConvolveFunctions convolve8_sse2(
1566 wrap_convolve_copy_c_8, wrap_convolve_avg_c_8,
1567 wrap_convolve8_horiz_sse2_8, wrap_convolve8_avg_horiz_sse2_8,
1568 wrap_convolve8_vert_sse2_8, wrap_convolve8_avg_vert_sse2_8,
1569 wrap_convolve8_sse2_8, wrap_convolve8_avg_sse2_8,
1570 wrap_convolve8_horiz_sse2_8, wrap_convolve8_avg_horiz_sse2_8,
1571 wrap_convolve8_vert_sse2_8, wrap_convolve8_avg_vert_sse2_8,
1572 wrap_convolve8_sse2_8, wrap_convolve8_avg_sse2_8, 8);
1573 const ConvolveFunctions convolve10_sse2(
1574 wrap_convolve_copy_c_10, wrap_convolve_avg_c_10,
1575 wrap_convolve8_horiz_sse2_10, wrap_convolve8_avg_horiz_sse2_10,
1576 wrap_convolve8_vert_sse2_10, wrap_convolve8_avg_vert_sse2_10,
1577 wrap_convolve8_sse2_10, wrap_convolve8_avg_sse2_10,
1578 wrap_convolve8_horiz_sse2_10, wrap_convolve8_avg_horiz_sse2_10,
1579 wrap_convolve8_vert_sse2_10, wrap_convolve8_avg_vert_sse2_10,
1580 wrap_convolve8_sse2_10, wrap_convolve8_avg_sse2_10, 10);
1581 const ConvolveFunctions convolve12_sse2(
1582 wrap_convolve_copy_c_12, wrap_convolve_avg_c_12,
1583 wrap_convolve8_horiz_sse2_12, wrap_convolve8_avg_horiz_sse2_12,
1584 wrap_convolve8_vert_sse2_12, wrap_convolve8_avg_vert_sse2_12,
1585 wrap_convolve8_sse2_12, wrap_convolve8_avg_sse2_12,
1586 wrap_convolve8_horiz_sse2_12, wrap_convolve8_avg_horiz_sse2_12,
1587 wrap_convolve8_vert_sse2_12, wrap_convolve8_avg_vert_sse2_12,
1588 wrap_convolve8_sse2_12, wrap_convolve8_avg_sse2_12, 12);
1589 INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values(
1590 make_tuple(4, 4, &convolve8_sse2),
1591 make_tuple(8, 4, &convolve8_sse2),
1592 make_tuple(4, 8, &convolve8_sse2),
1593 make_tuple(8, 8, &convolve8_sse2),
1594 make_tuple(16, 8, &convolve8_sse2),
1595 make_tuple(8, 16, &convolve8_sse2),
1596 make_tuple(16, 16, &convolve8_sse2),
1597 make_tuple(32, 16, &convolve8_sse2),
1598 make_tuple(16, 32, &convolve8_sse2),
1599 make_tuple(32, 32, &convolve8_sse2),
1600 make_tuple(64, 32, &convolve8_sse2),
1601 make_tuple(32, 64, &convolve8_sse2),
1602 make_tuple(64, 64, &convolve8_sse2),
1603 make_tuple(4, 4, &convolve10_sse2),
1604 make_tuple(8, 4, &convolve10_sse2),
1605 make_tuple(4, 8, &convolve10_sse2),
1606 make_tuple(8, 8, &convolve10_sse2),
1607 make_tuple(16, 8, &convolve10_sse2),
1608 make_tuple(8, 16, &convolve10_sse2),
1609 make_tuple(16, 16, &convolve10_sse2),
1610 make_tuple(32, 16, &convolve10_sse2),
1611 make_tuple(16, 32, &convolve10_sse2),
1612 make_tuple(32, 32, &convolve10_sse2),
1613 make_tuple(64, 32, &convolve10_sse2),
1614 make_tuple(32, 64, &convolve10_sse2),
1615 make_tuple(64, 64, &convolve10_sse2),
1616 make_tuple(4, 4, &convolve12_sse2),
1617 make_tuple(8, 4, &convolve12_sse2),
1618 make_tuple(4, 8, &convolve12_sse2),
1619 make_tuple(8, 8, &convolve12_sse2),
1620 make_tuple(16, 8, &convolve12_sse2),
1621 make_tuple(8, 16, &convolve12_sse2),
1622 make_tuple(16, 16, &convolve12_sse2),
1623 make_tuple(32, 16, &convolve12_sse2),
1624 make_tuple(16, 32, &convolve12_sse2),
1625 make_tuple(32, 32, &convolve12_sse2),
1626 make_tuple(64, 32, &convolve12_sse2),
1627 make_tuple(32, 64, &convolve12_sse2),
1628 make_tuple(64, 64, &convolve12_sse2)));
1630 const ConvolveFunctions convolve8_sse2(
1631 #if CONFIG_USE_X86INC
1632 vpx_convolve_copy_sse2, vpx_convolve_avg_sse2,
1634 vpx_convolve_copy_c, vpx_convolve_avg_c,
1635 #endif // CONFIG_USE_X86INC
1636 vpx_convolve8_horiz_sse2, vpx_convolve8_avg_horiz_sse2,
1637 vpx_convolve8_vert_sse2, vpx_convolve8_avg_vert_sse2,
1638 vpx_convolve8_sse2, vpx_convolve8_avg_sse2,
1639 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1640 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1641 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1643 INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values(
1644 make_tuple(4, 4, &convolve8_sse2),
1645 make_tuple(8, 4, &convolve8_sse2),
1646 make_tuple(4, 8, &convolve8_sse2),
1647 make_tuple(8, 8, &convolve8_sse2),
1648 make_tuple(16, 8, &convolve8_sse2),
1649 make_tuple(8, 16, &convolve8_sse2),
1650 make_tuple(16, 16, &convolve8_sse2),
1651 make_tuple(32, 16, &convolve8_sse2),
1652 make_tuple(16, 32, &convolve8_sse2),
1653 make_tuple(32, 32, &convolve8_sse2),
1654 make_tuple(64, 32, &convolve8_sse2),
1655 make_tuple(32, 64, &convolve8_sse2),
1656 make_tuple(64, 64, &convolve8_sse2)));
1657 #endif // CONFIG_VP9_HIGHBITDEPTH
1661 const ConvolveFunctions convolve8_ssse3(
1662 vpx_convolve_copy_c, vpx_convolve_avg_c,
1663 vpx_convolve8_horiz_ssse3, vpx_convolve8_avg_horiz_ssse3,
1664 vpx_convolve8_vert_ssse3, vpx_convolve8_avg_vert_ssse3,
1665 vpx_convolve8_ssse3, vpx_convolve8_avg_ssse3,
1666 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1667 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1668 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1670 INSTANTIATE_TEST_CASE_P(SSSE3, ConvolveTest, ::testing::Values(
1671 make_tuple(4, 4, &convolve8_ssse3),
1672 make_tuple(8, 4, &convolve8_ssse3),
1673 make_tuple(4, 8, &convolve8_ssse3),
1674 make_tuple(8, 8, &convolve8_ssse3),
1675 make_tuple(16, 8, &convolve8_ssse3),
1676 make_tuple(8, 16, &convolve8_ssse3),
1677 make_tuple(16, 16, &convolve8_ssse3),
1678 make_tuple(32, 16, &convolve8_ssse3),
1679 make_tuple(16, 32, &convolve8_ssse3),
1680 make_tuple(32, 32, &convolve8_ssse3),
1681 make_tuple(64, 32, &convolve8_ssse3),
1682 make_tuple(32, 64, &convolve8_ssse3),
1683 make_tuple(64, 64, &convolve8_ssse3)));
1686 #if HAVE_AVX2 && HAVE_SSSE3
1687 const ConvolveFunctions convolve8_avx2(
1688 vpx_convolve_copy_c, vpx_convolve_avg_c,
1689 vpx_convolve8_horiz_avx2, vpx_convolve8_avg_horiz_ssse3,
1690 vpx_convolve8_vert_avx2, vpx_convolve8_avg_vert_ssse3,
1691 vpx_convolve8_avx2, vpx_convolve8_avg_ssse3,
1692 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1693 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1694 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1696 INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest, ::testing::Values(
1697 make_tuple(4, 4, &convolve8_avx2),
1698 make_tuple(8, 4, &convolve8_avx2),
1699 make_tuple(4, 8, &convolve8_avx2),
1700 make_tuple(8, 8, &convolve8_avx2),
1701 make_tuple(8, 16, &convolve8_avx2),
1702 make_tuple(16, 8, &convolve8_avx2),
1703 make_tuple(16, 16, &convolve8_avx2),
1704 make_tuple(32, 16, &convolve8_avx2),
1705 make_tuple(16, 32, &convolve8_avx2),
1706 make_tuple(32, 32, &convolve8_avx2),
1707 make_tuple(64, 32, &convolve8_avx2),
1708 make_tuple(32, 64, &convolve8_avx2),
1709 make_tuple(64, 64, &convolve8_avx2)));
1710 #endif // HAVE_AVX2 && HAVE_SSSE3
1714 const ConvolveFunctions convolve8_neon(
1715 vpx_convolve_copy_neon, vpx_convolve_avg_neon,
1716 vpx_convolve8_horiz_neon, vpx_convolve8_avg_horiz_neon,
1717 vpx_convolve8_vert_neon, vpx_convolve8_avg_vert_neon,
1718 vpx_convolve8_neon, vpx_convolve8_avg_neon,
1719 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1720 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1721 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1723 const ConvolveFunctions convolve8_neon(
1724 vpx_convolve_copy_neon, vpx_convolve_avg_neon,
1725 vpx_convolve8_horiz_neon, vpx_convolve8_avg_horiz_neon,
1726 vpx_convolve8_vert_neon, vpx_convolve8_avg_vert_neon,
1727 vpx_convolve8_neon, vpx_convolve8_avg_neon,
1728 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1729 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1730 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1731 #endif // HAVE_NEON_ASM
1733 INSTANTIATE_TEST_CASE_P(NEON, ConvolveTest, ::testing::Values(
1734 make_tuple(4, 4, &convolve8_neon),
1735 make_tuple(8, 4, &convolve8_neon),
1736 make_tuple(4, 8, &convolve8_neon),
1737 make_tuple(8, 8, &convolve8_neon),
1738 make_tuple(16, 8, &convolve8_neon),
1739 make_tuple(8, 16, &convolve8_neon),
1740 make_tuple(16, 16, &convolve8_neon),
1741 make_tuple(32, 16, &convolve8_neon),
1742 make_tuple(16, 32, &convolve8_neon),
1743 make_tuple(32, 32, &convolve8_neon),
1744 make_tuple(64, 32, &convolve8_neon),
1745 make_tuple(32, 64, &convolve8_neon),
1746 make_tuple(64, 64, &convolve8_neon)));
1750 const ConvolveFunctions convolve8_dspr2(
1751 vpx_convolve_copy_dspr2, vpx_convolve_avg_dspr2,
1752 vpx_convolve8_horiz_dspr2, vpx_convolve8_avg_horiz_dspr2,
1753 vpx_convolve8_vert_dspr2, vpx_convolve8_avg_vert_dspr2,
1754 vpx_convolve8_dspr2, vpx_convolve8_avg_dspr2,
1755 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1756 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1757 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1759 INSTANTIATE_TEST_CASE_P(DSPR2, ConvolveTest, ::testing::Values(
1760 make_tuple(4, 4, &convolve8_dspr2),
1761 make_tuple(8, 4, &convolve8_dspr2),
1762 make_tuple(4, 8, &convolve8_dspr2),
1763 make_tuple(8, 8, &convolve8_dspr2),
1764 make_tuple(16, 8, &convolve8_dspr2),
1765 make_tuple(8, 16, &convolve8_dspr2),
1766 make_tuple(16, 16, &convolve8_dspr2),
1767 make_tuple(32, 16, &convolve8_dspr2),
1768 make_tuple(16, 32, &convolve8_dspr2),
1769 make_tuple(32, 32, &convolve8_dspr2),
1770 make_tuple(64, 32, &convolve8_dspr2),
1771 make_tuple(32, 64, &convolve8_dspr2),
1772 make_tuple(64, 64, &convolve8_dspr2)));
1776 const ConvolveFunctions convolve8_msa(
1777 vpx_convolve_copy_msa, vpx_convolve_avg_msa,
1778 vpx_convolve8_horiz_msa, vpx_convolve8_avg_horiz_msa,
1779 vpx_convolve8_vert_msa, vpx_convolve8_avg_vert_msa,
1780 vpx_convolve8_msa, vpx_convolve8_avg_msa,
1781 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1782 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1783 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1785 INSTANTIATE_TEST_CASE_P(MSA, ConvolveTest, ::testing::Values(
1786 make_tuple(4, 4, &convolve8_msa),
1787 make_tuple(8, 4, &convolve8_msa),
1788 make_tuple(4, 8, &convolve8_msa),
1789 make_tuple(8, 8, &convolve8_msa),
1790 make_tuple(16, 8, &convolve8_msa),
1791 make_tuple(8, 16, &convolve8_msa),
1792 make_tuple(16, 16, &convolve8_msa),
1793 make_tuple(32, 16, &convolve8_msa),
1794 make_tuple(16, 32, &convolve8_msa),
1795 make_tuple(32, 32, &convolve8_msa),
1796 make_tuple(64, 32, &convolve8_msa),
1797 make_tuple(32, 64, &convolve8_msa),
1798 make_tuple(64, 64, &convolve8_msa)));