blob: 0e54c401375c13a73a989dd2b8aea898ded19fd5 [file] [log] [blame]
John Koleszar5ca6a362013-01-25 09:47:09 -08001/*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 *
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.
9 */
10
Tero Rintaluomae326cec2013-08-22 11:29:19 +030011#include <string.h>
Jingning Han097d59c2015-07-29 14:51:36 -070012
James Zern8fb48af2013-05-02 13:08:19 -070013#include "third_party/googletest/src/include/gtest/gtest.h"
John Koleszar5ca6a362013-01-25 09:47:09 -080014
John Koleszar5ca6a362013-01-25 09:47:09 -080015#include "./vpx_config.h"
16#include "./vp9_rtcd.h"
Zoe Liu7186a2d2015-07-22 10:40:42 -070017#include "./vpx_dsp_rtcd.h"
Jingning Han097d59c2015-07-29 14:51:36 -070018#include "test/acm_random.h"
19#include "test/clear_system_state.h"
20#include "test/register_state_check.h"
21#include "test/util.h"
Johann1c3594c2014-12-09 12:05:15 -080022#include "vp9/common/vp9_common.h"
John Koleszar557a1b22013-02-20 16:13:01 -080023#include "vp9/common/vp9_filter.h"
Zoe Liu7186a2d2015-07-22 10:40:42 -070024#include "vpx_dsp/vpx_dsp_common.h"
25#include "vpx_dsp/vpx_filter.h"
John Koleszar29d47ac2013-02-07 17:00:37 -080026#include "vpx_mem/vpx_mem.h"
John Koleszar6fd7dd12013-02-20 15:59:20 -080027#include "vpx_ports/mem.h"
John Koleszar5ca6a362013-01-25 09:47:09 -080028
29namespace {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -070030
Geza Lore938b8df2016-03-04 15:55:48 +000031static const unsigned int kMaxDimension = MAX_CU_SIZE;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -070032
James Zerndfc4e8f2014-07-16 18:48:20 -070033typedef 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,
37 int w, int h);
John Koleszar5ca6a362013-01-25 09:47:09 -080038
39struct ConvolveFunctions {
Johann1c3594c2014-12-09 12:05:15 -080040 ConvolveFunctions(ConvolveFunc copy, ConvolveFunc avg,
41 ConvolveFunc h8, ConvolveFunc h8_avg,
James Zerndfc4e8f2014-07-16 18:48:20 -070042 ConvolveFunc v8, ConvolveFunc v8_avg,
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -070043 ConvolveFunc hv8, ConvolveFunc hv8_avg,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -070044 ConvolveFunc sh8, ConvolveFunc sh8_avg,
45 ConvolveFunc sv8, ConvolveFunc sv8_avg,
46 ConvolveFunc shv8, ConvolveFunc shv8_avg,
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -070047 int bd)
Johann1c3594c2014-12-09 12:05:15 -080048 : copy_(copy), avg_(avg), h8_(h8), v8_(v8), hv8_(hv8), h8_avg_(h8_avg),
Scott LaVarnway4e6b5072015-08-05 10:47:06 -070049 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),
51 use_highbd_(bd) {}
John Koleszar5ca6a362013-01-25 09:47:09 -080052
Johann1c3594c2014-12-09 12:05:15 -080053 ConvolveFunc copy_;
54 ConvolveFunc avg_;
James Zerndfc4e8f2014-07-16 18:48:20 -070055 ConvolveFunc h8_;
56 ConvolveFunc v8_;
57 ConvolveFunc hv8_;
58 ConvolveFunc h8_avg_;
59 ConvolveFunc v8_avg_;
60 ConvolveFunc hv8_avg_;
Scott LaVarnway4e6b5072015-08-05 10:47:06 -070061 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
Deb Mukherjee1929c9b2014-10-08 12:43:22 -070067 int use_highbd_; // 0 if high bitdepth not used, else the actual bit depth.
John Koleszar5ca6a362013-01-25 09:47:09 -080068};
69
James Zerndfc4e8f2014-07-16 18:48:20 -070070typedef std::tr1::tuple<int, int, const ConvolveFunctions *> ConvolveParam;
Joshua Litt51490e52013-11-18 17:07:55 -080071
John Koleszar5ca6a362013-01-25 09:47:09 -080072// Reference 8-tap subpixel filter, slightly modified to fit into this test.
73#define VP9_FILTER_WEIGHT 128
74#define VP9_FILTER_SHIFT 7
James Zern8fb48af2013-05-02 13:08:19 -070075uint8_t clip_pixel(int x) {
John Koleszar5ca6a362013-01-25 09:47:09 -080076 return x < 0 ? 0 :
77 x > 255 ? 255 :
78 x;
79}
80
James Zern8fb48af2013-05-02 13:08:19 -070081void 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,
85 uint8_t *dst_ptr,
86 unsigned int dst_stride,
87 unsigned int output_width,
88 unsigned int output_height) {
John Koleszar5ca6a362013-01-25 09:47:09 -080089 // 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
92 // support.
93 const int kInterp_Extend = 4;
94 const unsigned int intermediate_height =
James Zern8fb48af2013-05-02 13:08:19 -070095 (kInterp_Extend - 1) + output_height + kInterp_Extend;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -070096 unsigned int i, j;
John Koleszar5ca6a362013-01-25 09:47:09 -080097
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -070098 // Size of intermediate_buffer is max_intermediate_height * filter_max_width,
99 // where max_intermediate_height = (kInterp_Extend - 1) + filter_max_height
100 // + kInterp_Extend
101 // = 3 + 16 + 4
102 // = 23
103 // and filter_max_width = 16
104 //
Geza Lore938b8df2016-03-04 15:55:48 +0000105 uint8_t intermediate_buffer[(kMaxDimension+8) * kMaxDimension];
John Koleszar5ca6a362013-01-25 09:47:09 -0800106 const int intermediate_next_stride = 1 - intermediate_height * output_width;
107
108 // Horizontal pass (src -> transposed intermediate).
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700109 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) {
114 // Apply filter...
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
John Koleszar5ca6a362013-01-25 09:47:09 -0800124
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700125 // Normalize back to 0-255...
126 *output_ptr = clip_pixel(temp >> VP9_FILTER_SHIFT);
127 ++src_ptr;
128 output_ptr += intermediate_height;
John Koleszar5ca6a362013-01-25 09:47:09 -0800129 }
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700130 src_ptr += src_next_row_stride;
131 output_ptr += intermediate_next_stride;
John Koleszar5ca6a362013-01-25 09:47:09 -0800132 }
133
134 // Vertical pass (transposed intermediate -> dst).
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700135 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) {
139 // Apply filter...
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
John Koleszar5ca6a362013-01-25 09:47:09 -0800149
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700150 // Normalize back to 0-255...
151 *dst_ptr++ = clip_pixel(temp >> VP9_FILTER_SHIFT);
152 src_ptr += intermediate_height;
John Koleszar5ca6a362013-01-25 09:47:09 -0800153 }
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700154 src_ptr += intermediate_next_stride;
155 dst_ptr += dst_next_row_stride;
John Koleszar5ca6a362013-01-25 09:47:09 -0800156 }
157}
158
James Zern8fb48af2013-05-02 13:08:19 -0700159void block2d_average_c(uint8_t *src,
160 unsigned int src_stride,
161 uint8_t *output_ptr,
162 unsigned int output_stride,
163 unsigned int output_width,
164 unsigned int output_height) {
John Koleszar5ca6a362013-01-25 09:47:09 -0800165 unsigned int i, j;
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;
169 }
170 output_ptr += output_stride;
171 }
172}
173
James Zern8fb48af2013-05-02 13:08:19 -0700174void 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,
178 uint8_t *dst_ptr,
179 unsigned int dst_stride,
180 unsigned int output_width,
181 unsigned int output_height) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700182 uint8_t tmp[kMaxDimension * kMaxDimension];
John Koleszar5ca6a362013-01-25 09:47:09 -0800183
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700184 assert(output_width <= kMaxDimension);
185 assert(output_height <= kMaxDimension);
Geza Lore938b8df2016-03-04 15:55:48 +0000186 filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, tmp, kMaxDimension,
John Koleszar5ca6a362013-01-25 09:47:09 -0800187 output_width, output_height);
Geza Lore938b8df2016-03-04 15:55:48 +0000188 block2d_average_c(tmp, kMaxDimension, dst_ptr, dst_stride,
John Koleszar5ca6a362013-01-25 09:47:09 -0800189 output_width, output_height);
190}
191
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700192#if CONFIG_VP9_HIGHBITDEPTH
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700193void 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,
197 uint16_t *dst_ptr,
198 unsigned int dst_stride,
199 unsigned int output_width,
200 unsigned int output_height,
201 int bd) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700202 // 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
205 // support.
206 const int kInterp_Extend = 4;
207 const unsigned int intermediate_height =
208 (kInterp_Extend - 1) + output_height + kInterp_Extend;
209
210 /* Size of intermediate_buffer is max_intermediate_height * filter_max_width,
211 * where max_intermediate_height = (kInterp_Extend - 1) + filter_max_height
212 * + kInterp_Extend
213 * = 3 + 16 + 4
214 * = 23
215 * and filter_max_width = 16
216 */
Geza Lore938b8df2016-03-04 15:55:48 +0000217 uint16_t intermediate_buffer[(kMaxDimension+8) * kMaxDimension];
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700218 const int intermediate_next_stride = 1 - intermediate_height * output_width;
219
220 // Horizontal pass (src -> transposed intermediate).
221 {
222 uint16_t *output_ptr = intermediate_buffer;
223 const int src_next_row_stride = src_stride - output_width;
224 unsigned int i, j;
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) {
228 // Apply filter...
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
238
239 // Normalize back to 0-255...
Deb Mukherjeed50716f2014-10-02 15:43:27 -0700240 *output_ptr = clip_pixel_highbd(temp >> VP9_FILTER_SHIFT, bd);
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700241 ++src_ptr;
242 output_ptr += intermediate_height;
243 }
244 src_ptr += src_next_row_stride;
245 output_ptr += intermediate_next_stride;
246 }
247 }
248
249 // Vertical pass (transposed intermediate -> dst).
250 {
251 uint16_t *src_ptr = intermediate_buffer;
252 const int dst_next_row_stride = dst_stride - output_width;
253 unsigned int i, j;
254 for (i = 0; i < output_height; ++i) {
255 for (j = 0; j < output_width; ++j) {
256 // Apply filter...
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
266
267 // Normalize back to 0-255...
Deb Mukherjeed50716f2014-10-02 15:43:27 -0700268 *dst_ptr++ = clip_pixel_highbd(temp >> VP9_FILTER_SHIFT, bd);
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700269 src_ptr += intermediate_height;
270 }
271 src_ptr += intermediate_next_stride;
272 dst_ptr += dst_next_row_stride;
273 }
274 }
275}
276
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700277void 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,
James Zerncffef112016-02-11 18:27:00 -0800282 unsigned int output_height) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700283 unsigned int i, j;
284 for (i = 0; i < output_height; ++i) {
285 for (j = 0; j < output_width; ++j) {
286 output_ptr[j] = (output_ptr[j] + src[i * src_stride + j] + 1) >> 1;
287 }
288 output_ptr += output_stride;
289 }
290}
291
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700292void highbd_filter_average_block2d_8_c(const uint16_t *src_ptr,
293 const unsigned int src_stride,
294 const int16_t *HFilter,
295 const int16_t *VFilter,
296 uint16_t *dst_ptr,
297 unsigned int dst_stride,
298 unsigned int output_width,
299 unsigned int output_height,
300 int bd) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700301 uint16_t tmp[kMaxDimension * kMaxDimension];
302
303 assert(output_width <= kMaxDimension);
304 assert(output_height <= kMaxDimension);
Geza Lore938b8df2016-03-04 15:55:48 +0000305 highbd_filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
306 tmp, kMaxDimension,
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700307 output_width, output_height, bd);
Geza Lore938b8df2016-03-04 15:55:48 +0000308 highbd_block2d_average_c(tmp, kMaxDimension, dst_ptr, dst_stride,
James Zerncffef112016-02-11 18:27:00 -0800309 output_width, output_height);
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700310}
311#endif // CONFIG_VP9_HIGHBITDEPTH
312
James Zerndfc4e8f2014-07-16 18:48:20 -0700313class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
John Koleszar29d47ac2013-02-07 17:00:37 -0800314 public:
315 static void SetUpTestCase() {
316 // Force input_ to be unaligned, output to be 16 byte aligned.
317 input_ = reinterpret_cast<uint8_t*>(
James Zernb0e57752013-05-02 12:29:34 -0700318 vpx_memalign(kDataAlignment, kInputBufferSize + 1)) + 1;
John Koleszar29d47ac2013-02-07 17:00:37 -0800319 output_ = reinterpret_cast<uint8_t*>(
James Zernb0e57752013-05-02 12:29:34 -0700320 vpx_memalign(kDataAlignment, kOutputBufferSize));
Johann1c3594c2014-12-09 12:05:15 -0800321 output_ref_ = reinterpret_cast<uint8_t*>(
322 vpx_memalign(kDataAlignment, kOutputBufferSize));
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700323#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)));
Johann1c3594c2014-12-09 12:05:15 -0800329 output16_ref_ = reinterpret_cast<uint16_t*>(
330 vpx_memalign(kDataAlignment, (kOutputBufferSize) * sizeof(uint16_t)));
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700331#endif
John Koleszar29d47ac2013-02-07 17:00:37 -0800332 }
333
Jim Bankoski18d32362014-12-12 06:18:56 -0800334 virtual void TearDown() { libvpx_test::ClearSystemState(); }
335
John Koleszar29d47ac2013-02-07 17:00:37 -0800336 static void TearDownTestCase() {
337 vpx_free(input_ - 1);
338 input_ = NULL;
339 vpx_free(output_);
340 output_ = NULL;
Johann1c3594c2014-12-09 12:05:15 -0800341 vpx_free(output_ref_);
342 output_ref_ = NULL;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700343#if CONFIG_VP9_HIGHBITDEPTH
344 vpx_free(input16_ - 1);
345 input16_ = NULL;
346 vpx_free(output16_);
347 output16_ = NULL;
Johann1c3594c2014-12-09 12:05:15 -0800348 vpx_free(output16_ref_);
349 output16_ref_ = NULL;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700350#endif
John Koleszar29d47ac2013-02-07 17:00:37 -0800351 }
352
James Zern8fb48af2013-05-02 13:08:19 -0700353 protected:
354 static const int kDataAlignment = 16;
Geza Lore938b8df2016-03-04 15:55:48 +0000355 static const int kOuterBlockSize = 4*kMaxDimension;
James Zern8fb48af2013-05-02 13:08:19 -0700356 static const int kInputStride = kOuterBlockSize;
357 static const int kOutputStride = kOuterBlockSize;
James Zern8fb48af2013-05-02 13:08:19 -0700358 static const int kInputBufferSize = kOuterBlockSize * kOuterBlockSize;
359 static const int kOutputBufferSize = kOuterBlockSize * kOuterBlockSize;
John Koleszar5ca6a362013-01-25 09:47:09 -0800360
James Zern8fb48af2013-05-02 13:08:19 -0700361 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);
366 }
367 int BorderTop() const { return (kOuterBlockSize - Height()) / 2; }
John Koleszar5ca6a362013-01-25 09:47:09 -0800368
James Zern8fb48af2013-05-02 13:08:19 -0700369 bool IsIndexInBorder(int i) {
370 return (i < BorderTop() * kOuterBlockSize ||
371 i >= (BorderTop() + Height()) * kOuterBlockSize ||
372 i % kOuterBlockSize < BorderLeft() ||
373 i % kOuterBlockSize >= (BorderLeft() + Width()));
374 }
375
376 virtual void SetUp() {
377 UUT_ = GET_PARAM(2);
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700378#if CONFIG_VP9_HIGHBITDEPTH
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700379 if (UUT_->use_highbd_ != 0)
380 mask_ = (1 << UUT_->use_highbd_) - 1;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700381 else
382 mask_ = 255;
383#endif
Johann158c80c2013-05-23 12:50:41 -0700384 /* Set up guard blocks for an inner block centered in the outer block */
James Zern8fb48af2013-05-02 13:08:19 -0700385 for (int i = 0; i < kOutputBufferSize; ++i) {
386 if (IsIndexInBorder(i))
387 output_[i] = 255;
388 else
389 output_[i] = 0;
John Koleszar5ca6a362013-01-25 09:47:09 -0800390 }
391
James Zern8fb48af2013-05-02 13:08:19 -0700392 ::libvpx_test::ACMRandom prng;
Yaowu Xu077144d2014-05-23 12:23:29 -0700393 for (int i = 0; i < kInputBufferSize; ++i) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700394 if (i & 1) {
Yaowu Xu077144d2014-05-23 12:23:29 -0700395 input_[i] = 255;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700396#if CONFIG_VP9_HIGHBITDEPTH
397 input16_[i] = mask_;
398#endif
399 } else {
Yaowu Xu077144d2014-05-23 12:23:29 -0700400 input_[i] = prng.Rand8Extremes();
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700401#if CONFIG_VP9_HIGHBITDEPTH
402 input16_[i] = prng.Rand16() & mask_;
403#endif
404 }
Yaowu Xu077144d2014-05-23 12:23:29 -0700405 }
James Zern8fb48af2013-05-02 13:08:19 -0700406 }
John Koleszar5ca6a362013-01-25 09:47:09 -0800407
Tero Rintaluomae326cec2013-08-22 11:29:19 +0300408 void SetConstantInput(int value) {
409 memset(input_, value, kInputBufferSize);
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700410#if CONFIG_VP9_HIGHBITDEPTH
411 vpx_memset16(input16_, value, kInputBufferSize);
412#endif
Tero Rintaluomae326cec2013-08-22 11:29:19 +0300413 }
414
Johann1c3594c2014-12-09 12:05:15 -0800415 void CopyOutputToRef() {
James Zernf274c212015-04-23 20:42:19 -0700416 memcpy(output_ref_, output_, kOutputBufferSize);
Johann1c3594c2014-12-09 12:05:15 -0800417#if CONFIG_VP9_HIGHBITDEPTH
Geza Lore938b8df2016-03-04 15:55:48 +0000418 memcpy(output16_ref_, output16_,
419 kOutputBufferSize * sizeof(*output16_ref_));
Johann1c3594c2014-12-09 12:05:15 -0800420#endif
421 }
422
James Zern8fb48af2013-05-02 13:08:19 -0700423 void CheckGuardBlocks() {
424 for (int i = 0; i < kOutputBufferSize; ++i) {
425 if (IsIndexInBorder(i))
426 EXPECT_EQ(255, output_[i]);
John Koleszar5ca6a362013-01-25 09:47:09 -0800427 }
James Zern8fb48af2013-05-02 13:08:19 -0700428 }
John Koleszar5ca6a362013-01-25 09:47:09 -0800429
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700430 uint8_t *input() const {
Geza Lore938b8df2016-03-04 15:55:48 +0000431 const int index = BorderTop() * kOuterBlockSize + BorderLeft();
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700432#if CONFIG_VP9_HIGHBITDEPTH
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700433 if (UUT_->use_highbd_ == 0) {
Geza Lore938b8df2016-03-04 15:55:48 +0000434 return input_ + index;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700435 } else {
Geza Lore938b8df2016-03-04 15:55:48 +0000436 return CONVERT_TO_BYTEPTR(input16_) + index;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700437 }
438#else
Geza Lore938b8df2016-03-04 15:55:48 +0000439 return input_ + index;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700440#endif
James Zern8fb48af2013-05-02 13:08:19 -0700441 }
John Koleszar5ca6a362013-01-25 09:47:09 -0800442
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700443 uint8_t *output() const {
Geza Lore938b8df2016-03-04 15:55:48 +0000444 const int index = BorderTop() * kOuterBlockSize + BorderLeft();
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700445#if CONFIG_VP9_HIGHBITDEPTH
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700446 if (UUT_->use_highbd_ == 0) {
Geza Lore938b8df2016-03-04 15:55:48 +0000447 return output_ + index;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700448 } else {
Geza Lore938b8df2016-03-04 15:55:48 +0000449 return CONVERT_TO_BYTEPTR(output16_ + index);
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700450 }
451#else
Geza Lore938b8df2016-03-04 15:55:48 +0000452 return output_ + index;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700453#endif
454 }
455
Johann1c3594c2014-12-09 12:05:15 -0800456 uint8_t *output_ref() const {
Geza Lore938b8df2016-03-04 15:55:48 +0000457 const int index = BorderTop() * kOuterBlockSize + BorderLeft();
Johann1c3594c2014-12-09 12:05:15 -0800458#if CONFIG_VP9_HIGHBITDEPTH
459 if (UUT_->use_highbd_ == 0) {
Geza Lore938b8df2016-03-04 15:55:48 +0000460 return output_ref_ + index;
Johann1c3594c2014-12-09 12:05:15 -0800461 } else {
Geza Lore938b8df2016-03-04 15:55:48 +0000462 return CONVERT_TO_BYTEPTR(output16_ref_ + index);
Johann1c3594c2014-12-09 12:05:15 -0800463 }
464#else
Geza Lore938b8df2016-03-04 15:55:48 +0000465 return output_ref_ + index;
Johann1c3594c2014-12-09 12:05:15 -0800466#endif
467 }
468
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700469 uint16_t lookup(uint8_t *list, int index) const {
470#if CONFIG_VP9_HIGHBITDEPTH
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700471 if (UUT_->use_highbd_ == 0) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700472 return list[index];
473 } else {
474 return CONVERT_TO_SHORTPTR(list)[index];
475 }
476#else
477 return list[index];
478#endif
479 }
480
481 void assign_val(uint8_t *list, int index, uint16_t val) const {
482#if CONFIG_VP9_HIGHBITDEPTH
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700483 if (UUT_->use_highbd_ == 0) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700484 list[index] = (uint8_t) val;
485 } else {
486 CONVERT_TO_SHORTPTR(list)[index] = val;
487 }
488#else
489 list[index] = (uint8_t) val;
490#endif
491 }
492
493 void wrapper_filter_average_block2d_8_c(const uint8_t *src_ptr,
494 const unsigned int src_stride,
495 const int16_t *HFilter,
496 const int16_t *VFilter,
497 uint8_t *dst_ptr,
498 unsigned int dst_stride,
499 unsigned int output_width,
500 unsigned int output_height) {
501#if CONFIG_VP9_HIGHBITDEPTH
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700502 if (UUT_->use_highbd_ == 0) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700503 filter_average_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
504 dst_ptr, dst_stride, output_width,
505 output_height);
506 } else {
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700507 highbd_filter_average_block2d_8_c(CONVERT_TO_SHORTPTR(src_ptr),
508 src_stride, HFilter, VFilter,
509 CONVERT_TO_SHORTPTR(dst_ptr),
510 dst_stride, output_width, output_height,
511 UUT_->use_highbd_);
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700512 }
513#else
514 filter_average_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
515 dst_ptr, dst_stride, output_width,
516 output_height);
517#endif
518 }
519
520 void wrapper_filter_block2d_8_c(const uint8_t *src_ptr,
521 const unsigned int src_stride,
522 const int16_t *HFilter,
523 const int16_t *VFilter,
524 uint8_t *dst_ptr,
525 unsigned int dst_stride,
526 unsigned int output_width,
527 unsigned int output_height) {
528#if CONFIG_VP9_HIGHBITDEPTH
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700529 if (UUT_->use_highbd_ == 0) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700530 filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
531 dst_ptr, dst_stride, output_width, output_height);
532 } else {
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700533 highbd_filter_block2d_8_c(CONVERT_TO_SHORTPTR(src_ptr), src_stride,
534 HFilter, VFilter,
535 CONVERT_TO_SHORTPTR(dst_ptr), dst_stride,
536 output_width, output_height, UUT_->use_highbd_);
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700537 }
538#else
539 filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
540 dst_ptr, dst_stride, output_width, output_height);
541#endif
James Zern8fb48af2013-05-02 13:08:19 -0700542 }
John Koleszar5ca6a362013-01-25 09:47:09 -0800543
James Zern8fb48af2013-05-02 13:08:19 -0700544 const ConvolveFunctions* UUT_;
545 static uint8_t* input_;
546 static uint8_t* output_;
Johann1c3594c2014-12-09 12:05:15 -0800547 static uint8_t* output_ref_;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700548#if CONFIG_VP9_HIGHBITDEPTH
549 static uint16_t* input16_;
550 static uint16_t* output16_;
Johann1c3594c2014-12-09 12:05:15 -0800551 static uint16_t* output16_ref_;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700552 int mask_;
553#endif
John Koleszar5ca6a362013-01-25 09:47:09 -0800554};
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700555
John Koleszar29d47ac2013-02-07 17:00:37 -0800556uint8_t* ConvolveTest::input_ = NULL;
557uint8_t* ConvolveTest::output_ = NULL;
Johann1c3594c2014-12-09 12:05:15 -0800558uint8_t* ConvolveTest::output_ref_ = NULL;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700559#if CONFIG_VP9_HIGHBITDEPTH
560uint16_t* ConvolveTest::input16_ = NULL;
561uint16_t* ConvolveTest::output16_ = NULL;
Johann1c3594c2014-12-09 12:05:15 -0800562uint16_t* ConvolveTest::output16_ref_ = NULL;
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700563#endif
John Koleszar5ca6a362013-01-25 09:47:09 -0800564
565TEST_P(ConvolveTest, GuardBlocks) {
566 CheckGuardBlocks();
567}
568
Johann1c3594c2014-12-09 12:05:15 -0800569TEST_P(ConvolveTest, Copy) {
570 uint8_t* const in = input();
571 uint8_t* const out = output();
572
573 ASM_REGISTER_STATE_CHECK(
574 UUT_->copy_(in, kInputStride, out, kOutputStride, NULL, 0, NULL, 0,
575 Width(), Height()));
576
577 CheckGuardBlocks();
578
579 for (int y = 0; y < Height(); ++y)
580 for (int x = 0; x < Width(); ++x)
581 ASSERT_EQ(lookup(out, y * kOutputStride + x),
582 lookup(in, y * kInputStride + x))
583 << "(" << x << "," << y << ")";
584}
585
586TEST_P(ConvolveTest, Avg) {
587 uint8_t* const in = input();
588 uint8_t* const out = output();
589 uint8_t* const out_ref = output_ref();
590 CopyOutputToRef();
591
592 ASM_REGISTER_STATE_CHECK(
593 UUT_->avg_(in, kInputStride, out, kOutputStride, NULL, 0, NULL, 0,
594 Width(), Height()));
595
596 CheckGuardBlocks();
597
598 for (int y = 0; y < Height(); ++y)
599 for (int x = 0; x < Width(); ++x)
600 ASSERT_EQ(lookup(out, y * kOutputStride + x),
601 ROUND_POWER_OF_TWO(lookup(in, y * kInputStride + x) +
602 lookup(out_ref, y * kOutputStride + x), 1))
603 << "(" << x << "," << y << ")";
604}
605
John Koleszar5ca6a362013-01-25 09:47:09 -0800606TEST_P(ConvolveTest, CopyHoriz) {
607 uint8_t* const in = input();
608 uint8_t* const out = output();
James Zerne7b599f2013-06-17 23:11:01 -0700609 DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0};
John Koleszar5ca6a362013-01-25 09:47:09 -0800610
James Zern29e1b1a2014-07-09 21:02:02 -0700611 ASM_REGISTER_STATE_CHECK(
Scott LaVarnway4e6b5072015-08-05 10:47:06 -0700612 UUT_->sh8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, 16,
613 Width(), Height()));
John Koleszar5ca6a362013-01-25 09:47:09 -0800614
615 CheckGuardBlocks();
616
617 for (int y = 0; y < Height(); ++y)
618 for (int x = 0; x < Width(); ++x)
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700619 ASSERT_EQ(lookup(out, y * kOutputStride + x),
620 lookup(in, y * kInputStride + x))
John Koleszar5ca6a362013-01-25 09:47:09 -0800621 << "(" << x << "," << y << ")";
622}
623
624TEST_P(ConvolveTest, CopyVert) {
625 uint8_t* const in = input();
626 uint8_t* const out = output();
James Zerne7b599f2013-06-17 23:11:01 -0700627 DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0};
John Koleszar5ca6a362013-01-25 09:47:09 -0800628
James Zern29e1b1a2014-07-09 21:02:02 -0700629 ASM_REGISTER_STATE_CHECK(
Scott LaVarnway4e6b5072015-08-05 10:47:06 -0700630 UUT_->sv8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, 16,
631 Width(), Height()));
John Koleszar5ca6a362013-01-25 09:47:09 -0800632
633 CheckGuardBlocks();
634
635 for (int y = 0; y < Height(); ++y)
636 for (int x = 0; x < Width(); ++x)
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700637 ASSERT_EQ(lookup(out, y * kOutputStride + x),
638 lookup(in, y * kInputStride + x))
John Koleszar5ca6a362013-01-25 09:47:09 -0800639 << "(" << x << "," << y << ")";
640}
641
642TEST_P(ConvolveTest, Copy2D) {
643 uint8_t* const in = input();
644 uint8_t* const out = output();
James Zerne7b599f2013-06-17 23:11:01 -0700645 DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0};
John Koleszar5ca6a362013-01-25 09:47:09 -0800646
James Zern29e1b1a2014-07-09 21:02:02 -0700647 ASM_REGISTER_STATE_CHECK(
Scott LaVarnway4e6b5072015-08-05 10:47:06 -0700648 UUT_->shv8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8,
649 16, Width(), Height()));
John Koleszar5ca6a362013-01-25 09:47:09 -0800650
651 CheckGuardBlocks();
652
653 for (int y = 0; y < Height(); ++y)
654 for (int x = 0; x < Width(); ++x)
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700655 ASSERT_EQ(lookup(out, y * kOutputStride + x),
656 lookup(in, y * kInputStride + x))
John Koleszar5ca6a362013-01-25 09:47:09 -0800657 << "(" << x << "," << y << ")";
658}
659
Dmitry Kovalev3d4ed272014-04-21 14:15:35 -0700660const int kNumFilterBanks = 4;
John Koleszara9ebbcc2013-04-18 13:05:38 -0700661const int kNumFilters = 16;
662
663TEST(ConvolveTest, FiltersWontSaturateWhenAddedPairwise) {
664 for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
Dmitry Kovalev3d4ed272014-04-21 14:15:35 -0700665 const InterpKernel *filters =
James Zern017253b2015-07-01 19:01:58 -0700666 vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)];
John Koleszara9ebbcc2013-04-18 13:05:38 -0700667 for (int i = 0; i < kNumFilters; i++) {
668 const int p0 = filters[i][0] + filters[i][1];
669 const int p1 = filters[i][2] + filters[i][3];
670 const int p2 = filters[i][4] + filters[i][5];
671 const int p3 = filters[i][6] + filters[i][7];
672 EXPECT_LE(p0, 128);
673 EXPECT_LE(p1, 128);
674 EXPECT_LE(p2, 128);
675 EXPECT_LE(p3, 128);
676 EXPECT_LE(p0 + p3, 128);
677 EXPECT_LE(p0 + p3 + p1, 128);
678 EXPECT_LE(p0 + p3 + p1 + p2, 128);
679 EXPECT_EQ(p0 + p1 + p2 + p3, 128);
680 }
681 }
682}
John Koleszar557a1b22013-02-20 16:13:01 -0800683
John Koleszar04c24072013-02-20 16:32:02 -0800684const int16_t kInvalidFilter[8] = { 0 };
685
John Koleszar5ca6a362013-01-25 09:47:09 -0800686TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) {
687 uint8_t* const in = input();
688 uint8_t* const out = output();
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700689#if CONFIG_VP9_HIGHBITDEPTH
690 uint8_t ref8[kOutputStride * kMaxDimension];
691 uint16_t ref16[kOutputStride * kMaxDimension];
692 uint8_t* ref;
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700693 if (UUT_->use_highbd_ == 0) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700694 ref = ref8;
695 } else {
696 ref = CONVERT_TO_BYTEPTR(ref16);
697 }
698#else
John Koleszar5ca6a362013-01-25 09:47:09 -0800699 uint8_t ref[kOutputStride * kMaxDimension];
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700700#endif
John Koleszar5ca6a362013-01-25 09:47:09 -0800701
John Koleszar557a1b22013-02-20 16:13:01 -0800702 for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
Dmitry Kovalev3d4ed272014-04-21 14:15:35 -0700703 const InterpKernel *filters =
James Zern017253b2015-07-01 19:01:58 -0700704 vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)];
Dmitry Kovalev021eaab2014-05-14 16:21:41 -0700705
John Koleszar557a1b22013-02-20 16:13:01 -0800706 for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
707 for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700708 wrapper_filter_block2d_8_c(in, kInputStride,
709 filters[filter_x], filters[filter_y],
710 ref, kOutputStride,
711 Width(), Height());
John Koleszar5ca6a362013-01-25 09:47:09 -0800712
Scott LaVarnway4e6b5072015-08-05 10:47:06 -0700713 if (filter_x && filter_y)
James Zern29e1b1a2014-07-09 21:02:02 -0700714 ASM_REGISTER_STATE_CHECK(
John Koleszar557a1b22013-02-20 16:13:01 -0800715 UUT_->hv8_(in, kInputStride, out, kOutputStride,
716 filters[filter_x], 16, filters[filter_y], 16,
717 Width(), Height()));
718 else if (filter_y)
James Zern29e1b1a2014-07-09 21:02:02 -0700719 ASM_REGISTER_STATE_CHECK(
John Koleszar557a1b22013-02-20 16:13:01 -0800720 UUT_->v8_(in, kInputStride, out, kOutputStride,
John Koleszar04c24072013-02-20 16:32:02 -0800721 kInvalidFilter, 16, filters[filter_y], 16,
John Koleszar557a1b22013-02-20 16:13:01 -0800722 Width(), Height()));
Scott LaVarnway4e6b5072015-08-05 10:47:06 -0700723 else if (filter_x)
James Zern29e1b1a2014-07-09 21:02:02 -0700724 ASM_REGISTER_STATE_CHECK(
John Koleszar557a1b22013-02-20 16:13:01 -0800725 UUT_->h8_(in, kInputStride, out, kOutputStride,
John Koleszar04c24072013-02-20 16:32:02 -0800726 filters[filter_x], 16, kInvalidFilter, 16,
John Koleszar557a1b22013-02-20 16:13:01 -0800727 Width(), Height()));
Scott LaVarnway4e6b5072015-08-05 10:47:06 -0700728 else
729 ASM_REGISTER_STATE_CHECK(
730 UUT_->copy_(in, kInputStride, out, kOutputStride,
731 kInvalidFilter, 0, kInvalidFilter, 0,
732 Width(), Height()));
John Koleszar5ca6a362013-01-25 09:47:09 -0800733
John Koleszar557a1b22013-02-20 16:13:01 -0800734 CheckGuardBlocks();
John Koleszar5ca6a362013-01-25 09:47:09 -0800735
John Koleszar557a1b22013-02-20 16:13:01 -0800736 for (int y = 0; y < Height(); ++y)
737 for (int x = 0; x < Width(); ++x)
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700738 ASSERT_EQ(lookup(ref, y * kOutputStride + x),
739 lookup(out, y * kOutputStride + x))
John Koleszar557a1b22013-02-20 16:13:01 -0800740 << "mismatch at (" << x << "," << y << "), "
741 << "filters (" << filter_bank << ","
742 << filter_x << "," << filter_y << ")";
743 }
John Koleszar5ca6a362013-01-25 09:47:09 -0800744 }
745 }
746}
747
748TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) {
749 uint8_t* const in = input();
750 uint8_t* const out = output();
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700751#if CONFIG_VP9_HIGHBITDEPTH
752 uint8_t ref8[kOutputStride * kMaxDimension];
753 uint16_t ref16[kOutputStride * kMaxDimension];
754 uint8_t* ref;
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700755 if (UUT_->use_highbd_ == 0) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700756 ref = ref8;
757 } else {
758 ref = CONVERT_TO_BYTEPTR(ref16);
759 }
760#else
John Koleszar5ca6a362013-01-25 09:47:09 -0800761 uint8_t ref[kOutputStride * kMaxDimension];
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700762#endif
John Koleszar5ca6a362013-01-25 09:47:09 -0800763
764 // Populate ref and out with some random data
765 ::libvpx_test::ACMRandom prng;
766 for (int y = 0; y < Height(); ++y) {
767 for (int x = 0; x < Width(); ++x) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700768 uint16_t r;
769#if CONFIG_VP9_HIGHBITDEPTH
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700770 if (UUT_->use_highbd_ == 0 || UUT_->use_highbd_ == 8) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700771 r = prng.Rand8Extremes();
772 } else {
773 r = prng.Rand16() & mask_;
774 }
775#else
776 r = prng.Rand8Extremes();
777#endif
John Koleszar5ca6a362013-01-25 09:47:09 -0800778
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700779 assign_val(out, y * kOutputStride + x, r);
780 assign_val(ref, y * kOutputStride + x, r);
John Koleszar5ca6a362013-01-25 09:47:09 -0800781 }
782 }
783
John Koleszar557a1b22013-02-20 16:13:01 -0800784 for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
Dmitry Kovalev3d4ed272014-04-21 14:15:35 -0700785 const InterpKernel *filters =
James Zern017253b2015-07-01 19:01:58 -0700786 vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)];
John Koleszar5ca6a362013-01-25 09:47:09 -0800787
John Koleszar557a1b22013-02-20 16:13:01 -0800788 for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
789 for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700790 wrapper_filter_average_block2d_8_c(in, kInputStride,
791 filters[filter_x], filters[filter_y],
792 ref, kOutputStride,
793 Width(), Height());
John Koleszar5ca6a362013-01-25 09:47:09 -0800794
Scott LaVarnway4e6b5072015-08-05 10:47:06 -0700795 if (filter_x && filter_y)
James Zern29e1b1a2014-07-09 21:02:02 -0700796 ASM_REGISTER_STATE_CHECK(
John Koleszar557a1b22013-02-20 16:13:01 -0800797 UUT_->hv8_avg_(in, kInputStride, out, kOutputStride,
798 filters[filter_x], 16, filters[filter_y], 16,
799 Width(), Height()));
800 else if (filter_y)
James Zern29e1b1a2014-07-09 21:02:02 -0700801 ASM_REGISTER_STATE_CHECK(
John Koleszar557a1b22013-02-20 16:13:01 -0800802 UUT_->v8_avg_(in, kInputStride, out, kOutputStride,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -0700803 kInvalidFilter, 16, filters[filter_y], 16,
804 Width(), Height()));
805 else if (filter_x)
806 ASM_REGISTER_STATE_CHECK(
807 UUT_->h8_avg_(in, kInputStride, out, kOutputStride,
808 filters[filter_x], 16, kInvalidFilter, 16,
John Koleszar557a1b22013-02-20 16:13:01 -0800809 Width(), Height()));
810 else
James Zern29e1b1a2014-07-09 21:02:02 -0700811 ASM_REGISTER_STATE_CHECK(
Scott LaVarnway4e6b5072015-08-05 10:47:06 -0700812 UUT_->avg_(in, kInputStride, out, kOutputStride,
813 kInvalidFilter, 0, kInvalidFilter, 0,
814 Width(), Height()));
John Koleszar5ca6a362013-01-25 09:47:09 -0800815
John Koleszar557a1b22013-02-20 16:13:01 -0800816 CheckGuardBlocks();
John Koleszar5ca6a362013-01-25 09:47:09 -0800817
John Koleszar557a1b22013-02-20 16:13:01 -0800818 for (int y = 0; y < Height(); ++y)
819 for (int x = 0; x < Width(); ++x)
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700820 ASSERT_EQ(lookup(ref, y * kOutputStride + x),
821 lookup(out, y * kOutputStride + x))
John Koleszar557a1b22013-02-20 16:13:01 -0800822 << "mismatch at (" << x << "," << y << "), "
823 << "filters (" << filter_bank << ","
824 << filter_x << "," << filter_y << ")";
825 }
John Koleszar5ca6a362013-01-25 09:47:09 -0800826 }
827 }
828}
829
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700830TEST_P(ConvolveTest, FilterExtremes) {
831 uint8_t *const in = input();
832 uint8_t *const out = output();
833#if CONFIG_VP9_HIGHBITDEPTH
834 uint8_t ref8[kOutputStride * kMaxDimension];
835 uint16_t ref16[kOutputStride * kMaxDimension];
836 uint8_t *ref;
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700837 if (UUT_->use_highbd_ == 0) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700838 ref = ref8;
839 } else {
840 ref = CONVERT_TO_BYTEPTR(ref16);
841 }
842#else
843 uint8_t ref[kOutputStride * kMaxDimension];
844#endif
845
846 // Populate ref and out with some random data
847 ::libvpx_test::ACMRandom prng;
848 for (int y = 0; y < Height(); ++y) {
849 for (int x = 0; x < Width(); ++x) {
850 uint16_t r;
851#if CONFIG_VP9_HIGHBITDEPTH
Deb Mukherjee1929c9b2014-10-08 12:43:22 -0700852 if (UUT_->use_highbd_ == 0 || UUT_->use_highbd_ == 8) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700853 r = prng.Rand8Extremes();
854 } else {
855 r = prng.Rand16() & mask_;
856 }
857#else
858 r = prng.Rand8Extremes();
859#endif
860 assign_val(out, y * kOutputStride + x, r);
861 assign_val(ref, y * kOutputStride + x, r);
862 }
863 }
864
865 for (int axis = 0; axis < 2; axis++) {
866 int seed_val = 0;
867 while (seed_val < 256) {
868 for (int y = 0; y < 8; ++y) {
869 for (int x = 0; x < 8; ++x) {
870#if CONFIG_VP9_HIGHBITDEPTH
871 assign_val(in, y * kOutputStride + x - SUBPEL_TAPS / 2 + 1,
872 ((seed_val >> (axis ? y : x)) & 1) * mask_);
873#else
874 assign_val(in, y * kOutputStride + x - SUBPEL_TAPS / 2 + 1,
875 ((seed_val >> (axis ? y : x)) & 1) * 255);
876#endif
877 if (axis) seed_val++;
878 }
879 if (axis)
880 seed_val-= 8;
881 else
882 seed_val++;
883 }
884 if (axis) seed_val += 8;
885
886 for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
887 const InterpKernel *filters =
James Zern017253b2015-07-01 19:01:58 -0700888 vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)];
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700889 for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
890 for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
891 wrapper_filter_block2d_8_c(in, kInputStride,
892 filters[filter_x], filters[filter_y],
893 ref, kOutputStride,
894 Width(), Height());
Scott LaVarnway4e6b5072015-08-05 10:47:06 -0700895 if (filter_x && filter_y)
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700896 ASM_REGISTER_STATE_CHECK(
897 UUT_->hv8_(in, kInputStride, out, kOutputStride,
898 filters[filter_x], 16, filters[filter_y], 16,
899 Width(), Height()));
900 else if (filter_y)
901 ASM_REGISTER_STATE_CHECK(
902 UUT_->v8_(in, kInputStride, out, kOutputStride,
903 kInvalidFilter, 16, filters[filter_y], 16,
904 Width(), Height()));
Scott LaVarnway4e6b5072015-08-05 10:47:06 -0700905 else if (filter_x)
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700906 ASM_REGISTER_STATE_CHECK(
907 UUT_->h8_(in, kInputStride, out, kOutputStride,
908 filters[filter_x], 16, kInvalidFilter, 16,
909 Width(), Height()));
Scott LaVarnway4e6b5072015-08-05 10:47:06 -0700910 else
911 ASM_REGISTER_STATE_CHECK(
912 UUT_->copy_(in, kInputStride, out, kOutputStride,
913 kInvalidFilter, 0, kInvalidFilter, 0,
914 Width(), Height()));
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700915
916 for (int y = 0; y < Height(); ++y)
917 for (int x = 0; x < Width(); ++x)
918 ASSERT_EQ(lookup(ref, y * kOutputStride + x),
919 lookup(out, y * kOutputStride + x))
920 << "mismatch at (" << x << "," << y << "), "
921 << "filters (" << filter_bank << ","
922 << filter_x << "," << filter_y << ")";
923 }
924 }
925 }
926 }
927 }
928}
929
Tero Rintaluomae326cec2013-08-22 11:29:19 +0300930/* This test exercises that enough rows and columns are filtered with every
931 possible initial fractional positions and scaling steps. */
932TEST_P(ConvolveTest, CheckScalingFiltering) {
933 uint8_t* const in = input();
934 uint8_t* const out = output();
James Zern017253b2015-07-01 19:01:58 -0700935 const InterpKernel *const eighttap = vp9_filter_kernels[EIGHTTAP];
Tero Rintaluomae326cec2013-08-22 11:29:19 +0300936
937 SetConstantInput(127);
938
939 for (int frac = 0; frac < 16; ++frac) {
940 for (int step = 1; step <= 32; ++step) {
941 /* Test the horizontal and vertical filters in combination. */
Scott LaVarnway4e6b5072015-08-05 10:47:06 -0700942 ASM_REGISTER_STATE_CHECK(UUT_->shv8_(in, kInputStride, out, kOutputStride,
943 eighttap[frac], step,
944 eighttap[frac], step,
945 Width(), Height()));
Tero Rintaluomae326cec2013-08-22 11:29:19 +0300946
947 CheckGuardBlocks();
948
949 for (int y = 0; y < Height(); ++y) {
950 for (int x = 0; x < Width(); ++x) {
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700951 ASSERT_EQ(lookup(in, y * kInputStride + x),
952 lookup(out, y * kOutputStride + x))
Tero Rintaluomae326cec2013-08-22 11:29:19 +0300953 << "x == " << x << ", y == " << y
954 << ", frac == " << frac << ", step == " << step;
955 }
956 }
957 }
958 }
959}
960
John Koleszar5ca6a362013-01-25 09:47:09 -0800961using std::tr1::make_tuple;
962
Deb Mukherjee10783d42014-09-02 16:34:09 -0700963#if CONFIG_VP9_HIGHBITDEPTH
Alex Converse7e779382015-10-09 11:42:05 -0700964#define WRAP(func, bd) \
965void wrap_ ## func ## _ ## bd(const uint8_t *src, ptrdiff_t src_stride, \
966 uint8_t *dst, ptrdiff_t dst_stride, \
967 const int16_t *filter_x, \
968 int filter_x_stride, \
969 const int16_t *filter_y, \
970 int filter_y_stride, \
971 int w, int h) { \
972 vpx_highbd_ ## func(src, src_stride, dst, dst_stride, filter_x, \
973 filter_x_stride, filter_y, filter_y_stride, \
974 w, h, bd); \
975}
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -0700976#if HAVE_SSE2 && ARCH_X86_64
Alex Converse0c00af12015-10-06 15:59:03 -0700977#if CONFIG_USE_X86INC
978WRAP(convolve_copy_sse2, 8)
979WRAP(convolve_avg_sse2, 8)
980WRAP(convolve_copy_sse2, 10)
981WRAP(convolve_avg_sse2, 10)
982WRAP(convolve_copy_sse2, 12)
983WRAP(convolve_avg_sse2, 12)
984#endif // CONFIG_USE_X86INC
Alex Converse7e779382015-10-09 11:42:05 -0700985WRAP(convolve8_horiz_sse2, 8)
986WRAP(convolve8_avg_horiz_sse2, 8)
987WRAP(convolve8_vert_sse2, 8)
988WRAP(convolve8_avg_vert_sse2, 8)
989WRAP(convolve8_sse2, 8)
990WRAP(convolve8_avg_sse2, 8)
991WRAP(convolve8_horiz_sse2, 10)
992WRAP(convolve8_avg_horiz_sse2, 10)
993WRAP(convolve8_vert_sse2, 10)
994WRAP(convolve8_avg_vert_sse2, 10)
995WRAP(convolve8_sse2, 10)
996WRAP(convolve8_avg_sse2, 10)
997WRAP(convolve8_horiz_sse2, 12)
998WRAP(convolve8_avg_horiz_sse2, 12)
999WRAP(convolve8_vert_sse2, 12)
1000WRAP(convolve8_avg_vert_sse2, 12)
1001WRAP(convolve8_sse2, 12)
1002WRAP(convolve8_avg_sse2, 12)
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001003#endif // HAVE_SSE2 && ARCH_X86_64
1004
Alex Converse7e779382015-10-09 11:42:05 -07001005WRAP(convolve_copy_c, 8)
1006WRAP(convolve_avg_c, 8)
1007WRAP(convolve8_horiz_c, 8)
1008WRAP(convolve8_avg_horiz_c, 8)
1009WRAP(convolve8_vert_c, 8)
1010WRAP(convolve8_avg_vert_c, 8)
1011WRAP(convolve8_c, 8)
1012WRAP(convolve8_avg_c, 8)
1013WRAP(convolve_copy_c, 10)
1014WRAP(convolve_avg_c, 10)
1015WRAP(convolve8_horiz_c, 10)
1016WRAP(convolve8_avg_horiz_c, 10)
1017WRAP(convolve8_vert_c, 10)
1018WRAP(convolve8_avg_vert_c, 10)
1019WRAP(convolve8_c, 10)
1020WRAP(convolve8_avg_c, 10)
1021WRAP(convolve_copy_c, 12)
1022WRAP(convolve_avg_c, 12)
1023WRAP(convolve8_horiz_c, 12)
1024WRAP(convolve8_avg_horiz_c, 12)
1025WRAP(convolve8_vert_c, 12)
1026WRAP(convolve8_avg_vert_c, 12)
1027WRAP(convolve8_c, 12)
1028WRAP(convolve8_avg_c, 12)
1029#undef WRAP
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001030
1031const ConvolveFunctions convolve8_c(
Johann1c3594c2014-12-09 12:05:15 -08001032 wrap_convolve_copy_c_8, wrap_convolve_avg_c_8,
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001033 wrap_convolve8_horiz_c_8, wrap_convolve8_avg_horiz_c_8,
1034 wrap_convolve8_vert_c_8, wrap_convolve8_avg_vert_c_8,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -07001035 wrap_convolve8_c_8, wrap_convolve8_avg_c_8,
1036 wrap_convolve8_horiz_c_8, wrap_convolve8_avg_horiz_c_8,
1037 wrap_convolve8_vert_c_8, wrap_convolve8_avg_vert_c_8,
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001038 wrap_convolve8_c_8, wrap_convolve8_avg_c_8, 8);
1039INSTANTIATE_TEST_CASE_P(C_8, ConvolveTest, ::testing::Values(
Geza Lore938b8df2016-03-04 15:55:48 +00001040#if CONFIG_VP10 && CONFIG_EXT_PARTITION
1041 make_tuple(128, 64, &convolve8_c),
1042 make_tuple(64, 128, &convolve8_c),
1043 make_tuple(128, 128, &convolve8_c),
1044#endif // CONFIG_VP10 && CONFIG_EXT_PARTITION
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001045 make_tuple(4, 4, &convolve8_c),
1046 make_tuple(8, 4, &convolve8_c),
1047 make_tuple(4, 8, &convolve8_c),
1048 make_tuple(8, 8, &convolve8_c),
1049 make_tuple(16, 8, &convolve8_c),
1050 make_tuple(8, 16, &convolve8_c),
1051 make_tuple(16, 16, &convolve8_c),
1052 make_tuple(32, 16, &convolve8_c),
1053 make_tuple(16, 32, &convolve8_c),
1054 make_tuple(32, 32, &convolve8_c),
1055 make_tuple(64, 32, &convolve8_c),
1056 make_tuple(32, 64, &convolve8_c),
1057 make_tuple(64, 64, &convolve8_c)));
1058const ConvolveFunctions convolve10_c(
Johann1c3594c2014-12-09 12:05:15 -08001059 wrap_convolve_copy_c_10, wrap_convolve_avg_c_10,
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001060 wrap_convolve8_horiz_c_10, wrap_convolve8_avg_horiz_c_10,
1061 wrap_convolve8_vert_c_10, wrap_convolve8_avg_vert_c_10,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -07001062 wrap_convolve8_c_10, wrap_convolve8_avg_c_10,
1063 wrap_convolve8_horiz_c_10, wrap_convolve8_avg_horiz_c_10,
1064 wrap_convolve8_vert_c_10, wrap_convolve8_avg_vert_c_10,
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001065 wrap_convolve8_c_10, wrap_convolve8_avg_c_10, 10);
1066INSTANTIATE_TEST_CASE_P(C_10, ConvolveTest, ::testing::Values(
Geza Lore938b8df2016-03-04 15:55:48 +00001067#if CONFIG_VP10 && CONFIG_EXT_PARTITION
1068 make_tuple(128, 64, &convolve10_c),
1069 make_tuple(64, 128, &convolve10_c),
1070 make_tuple(128, 128, &convolve10_c),
1071#endif // CONFIG_VP10 && CONFIG_EXT_PARTITION
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001072 make_tuple(4, 4, &convolve10_c),
1073 make_tuple(8, 4, &convolve10_c),
1074 make_tuple(4, 8, &convolve10_c),
1075 make_tuple(8, 8, &convolve10_c),
1076 make_tuple(16, 8, &convolve10_c),
1077 make_tuple(8, 16, &convolve10_c),
1078 make_tuple(16, 16, &convolve10_c),
1079 make_tuple(32, 16, &convolve10_c),
1080 make_tuple(16, 32, &convolve10_c),
1081 make_tuple(32, 32, &convolve10_c),
1082 make_tuple(64, 32, &convolve10_c),
1083 make_tuple(32, 64, &convolve10_c),
1084 make_tuple(64, 64, &convolve10_c)));
1085const ConvolveFunctions convolve12_c(
Johann1c3594c2014-12-09 12:05:15 -08001086 wrap_convolve_copy_c_12, wrap_convolve_avg_c_12,
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001087 wrap_convolve8_horiz_c_12, wrap_convolve8_avg_horiz_c_12,
1088 wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -07001089 wrap_convolve8_c_12, wrap_convolve8_avg_c_12,
1090 wrap_convolve8_horiz_c_12, wrap_convolve8_avg_horiz_c_12,
1091 wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12,
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001092 wrap_convolve8_c_12, wrap_convolve8_avg_c_12, 12);
1093INSTANTIATE_TEST_CASE_P(C_12, ConvolveTest, ::testing::Values(
Geza Lore938b8df2016-03-04 15:55:48 +00001094#if CONFIG_VP10 && CONFIG_EXT_PARTITION
1095 make_tuple(128, 64, &convolve12_c),
1096 make_tuple(64, 128, &convolve12_c),
1097 make_tuple(128, 128, &convolve12_c),
1098#endif // CONFIG_VP10 && CONFIG_EXT_PARTITION
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001099 make_tuple(4, 4, &convolve12_c),
1100 make_tuple(8, 4, &convolve12_c),
1101 make_tuple(4, 8, &convolve12_c),
1102 make_tuple(8, 8, &convolve12_c),
1103 make_tuple(16, 8, &convolve12_c),
1104 make_tuple(8, 16, &convolve12_c),
1105 make_tuple(16, 16, &convolve12_c),
1106 make_tuple(32, 16, &convolve12_c),
1107 make_tuple(16, 32, &convolve12_c),
1108 make_tuple(32, 32, &convolve12_c),
1109 make_tuple(64, 32, &convolve12_c),
1110 make_tuple(32, 64, &convolve12_c),
1111 make_tuple(64, 64, &convolve12_c)));
1112
Deb Mukherjee10783d42014-09-02 16:34:09 -07001113#else
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001114
John Koleszar5ca6a362013-01-25 09:47:09 -08001115const ConvolveFunctions convolve8_c(
Zoe Liu7186a2d2015-07-22 10:40:42 -07001116 vpx_convolve_copy_c, vpx_convolve_avg_c,
1117 vpx_convolve8_horiz_c, vpx_convolve8_avg_horiz_c,
1118 vpx_convolve8_vert_c, vpx_convolve8_avg_vert_c,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -07001119 vpx_convolve8_c, vpx_convolve8_avg_c,
1120 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1121 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1122 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
John Koleszar5ca6a362013-01-25 09:47:09 -08001123
1124INSTANTIATE_TEST_CASE_P(C, ConvolveTest, ::testing::Values(
Geza Lore938b8df2016-03-04 15:55:48 +00001125#if CONFIG_VP10 && CONFIG_EXT_PARTITION
1126 make_tuple(128, 64, &convolve8_c),
1127 make_tuple(64, 128, &convolve8_c),
1128 make_tuple(128, 128, &convolve8_c),
1129#endif // CONFIG_VP10 && CONFIG_EXT_PARTITION
John Koleszar5ca6a362013-01-25 09:47:09 -08001130 make_tuple(4, 4, &convolve8_c),
1131 make_tuple(8, 4, &convolve8_c),
John Koleszara9ebbcc2013-04-18 13:05:38 -07001132 make_tuple(4, 8, &convolve8_c),
John Koleszar5ca6a362013-01-25 09:47:09 -08001133 make_tuple(8, 8, &convolve8_c),
John Koleszar6a4f7082013-02-08 17:49:44 -08001134 make_tuple(16, 8, &convolve8_c),
John Koleszara9ebbcc2013-04-18 13:05:38 -07001135 make_tuple(8, 16, &convolve8_c),
1136 make_tuple(16, 16, &convolve8_c),
1137 make_tuple(32, 16, &convolve8_c),
1138 make_tuple(16, 32, &convolve8_c),
1139 make_tuple(32, 32, &convolve8_c),
1140 make_tuple(64, 32, &convolve8_c),
1141 make_tuple(32, 64, &convolve8_c),
1142 make_tuple(64, 64, &convolve8_c)));
Deb Mukherjee10783d42014-09-02 16:34:09 -07001143#endif
John Koleszar29d47ac2013-02-07 17:00:37 -08001144
Deb Mukherjee10783d42014-09-02 16:34:09 -07001145#if HAVE_SSE2 && ARCH_X86_64
1146#if CONFIG_VP9_HIGHBITDEPTH
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001147const ConvolveFunctions convolve8_sse2(
Alex Converse0c00af12015-10-06 15:59:03 -07001148#if CONFIG_USE_X86INC
1149 wrap_convolve_copy_sse2_8, wrap_convolve_avg_sse2_8,
1150#else
Johann1c3594c2014-12-09 12:05:15 -08001151 wrap_convolve_copy_c_8, wrap_convolve_avg_c_8,
Alex Converse0c00af12015-10-06 15:59:03 -07001152#endif // CONFIG_USE_X86INC
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001153 wrap_convolve8_horiz_sse2_8, wrap_convolve8_avg_horiz_sse2_8,
1154 wrap_convolve8_vert_sse2_8, wrap_convolve8_avg_vert_sse2_8,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -07001155 wrap_convolve8_sse2_8, wrap_convolve8_avg_sse2_8,
1156 wrap_convolve8_horiz_sse2_8, wrap_convolve8_avg_horiz_sse2_8,
1157 wrap_convolve8_vert_sse2_8, wrap_convolve8_avg_vert_sse2_8,
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001158 wrap_convolve8_sse2_8, wrap_convolve8_avg_sse2_8, 8);
Deb Mukherjee27dce0f2014-11-07 10:19:46 -08001159const ConvolveFunctions convolve10_sse2(
Alex Converse0c00af12015-10-06 15:59:03 -07001160#if CONFIG_USE_X86INC
1161 wrap_convolve_copy_sse2_10, wrap_convolve_avg_sse2_10,
1162#else
Johann1c3594c2014-12-09 12:05:15 -08001163 wrap_convolve_copy_c_10, wrap_convolve_avg_c_10,
Alex Converse0c00af12015-10-06 15:59:03 -07001164#endif // CONFIG_USE_X86INC
Deb Mukherjee27dce0f2014-11-07 10:19:46 -08001165 wrap_convolve8_horiz_sse2_10, wrap_convolve8_avg_horiz_sse2_10,
1166 wrap_convolve8_vert_sse2_10, wrap_convolve8_avg_vert_sse2_10,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -07001167 wrap_convolve8_sse2_10, wrap_convolve8_avg_sse2_10,
1168 wrap_convolve8_horiz_sse2_10, wrap_convolve8_avg_horiz_sse2_10,
1169 wrap_convolve8_vert_sse2_10, wrap_convolve8_avg_vert_sse2_10,
Deb Mukherjee27dce0f2014-11-07 10:19:46 -08001170 wrap_convolve8_sse2_10, wrap_convolve8_avg_sse2_10, 10);
1171const ConvolveFunctions convolve12_sse2(
Alex Converse0c00af12015-10-06 15:59:03 -07001172#if CONFIG_USE_X86INC
1173 wrap_convolve_copy_sse2_12, wrap_convolve_avg_sse2_12,
1174#else
Johann1c3594c2014-12-09 12:05:15 -08001175 wrap_convolve_copy_c_12, wrap_convolve_avg_c_12,
Alex Converse0c00af12015-10-06 15:59:03 -07001176#endif // CONFIG_USE_X86INC
Deb Mukherjee27dce0f2014-11-07 10:19:46 -08001177 wrap_convolve8_horiz_sse2_12, wrap_convolve8_avg_horiz_sse2_12,
1178 wrap_convolve8_vert_sse2_12, wrap_convolve8_avg_vert_sse2_12,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -07001179 wrap_convolve8_sse2_12, wrap_convolve8_avg_sse2_12,
1180 wrap_convolve8_horiz_sse2_12, wrap_convolve8_avg_horiz_sse2_12,
1181 wrap_convolve8_vert_sse2_12, wrap_convolve8_avg_vert_sse2_12,
Deb Mukherjee27dce0f2014-11-07 10:19:46 -08001182 wrap_convolve8_sse2_12, wrap_convolve8_avg_sse2_12, 12);
Geza Lore938b8df2016-03-04 15:55:48 +00001183INSTANTIATE_TEST_CASE_P(SSE2_8, ConvolveTest, ::testing::Values(
1184#if CONFIG_VP10 && CONFIG_EXT_PARTITION
1185 make_tuple(128, 64, &convolve8_sse2),
1186 make_tuple(64, 128, &convolve8_sse2),
1187 make_tuple(128, 128, &convolve8_sse2),
1188#endif // CONFIG_VP10 && CONFIG_EXT_PARTITION
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001189 make_tuple(4, 4, &convolve8_sse2),
1190 make_tuple(8, 4, &convolve8_sse2),
1191 make_tuple(4, 8, &convolve8_sse2),
1192 make_tuple(8, 8, &convolve8_sse2),
1193 make_tuple(16, 8, &convolve8_sse2),
1194 make_tuple(8, 16, &convolve8_sse2),
1195 make_tuple(16, 16, &convolve8_sse2),
1196 make_tuple(32, 16, &convolve8_sse2),
1197 make_tuple(16, 32, &convolve8_sse2),
1198 make_tuple(32, 32, &convolve8_sse2),
1199 make_tuple(64, 32, &convolve8_sse2),
1200 make_tuple(32, 64, &convolve8_sse2),
Geza Lore938b8df2016-03-04 15:55:48 +00001201 make_tuple(64, 64, &convolve8_sse2)));
1202INSTANTIATE_TEST_CASE_P(SSE2_10, ConvolveTest, ::testing::Values(
1203#if CONFIG_VP10 && CONFIG_EXT_PARTITION
1204 make_tuple(128, 64, &convolve10_sse2),
1205 make_tuple(64, 128, &convolve10_sse2),
1206 make_tuple(128, 128, &convolve10_sse2),
1207#endif // CONFIG_VP10 && CONFIG_EXT_PARTITION
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001208 make_tuple(4, 4, &convolve10_sse2),
1209 make_tuple(8, 4, &convolve10_sse2),
1210 make_tuple(4, 8, &convolve10_sse2),
1211 make_tuple(8, 8, &convolve10_sse2),
1212 make_tuple(16, 8, &convolve10_sse2),
1213 make_tuple(8, 16, &convolve10_sse2),
1214 make_tuple(16, 16, &convolve10_sse2),
1215 make_tuple(32, 16, &convolve10_sse2),
1216 make_tuple(16, 32, &convolve10_sse2),
1217 make_tuple(32, 32, &convolve10_sse2),
1218 make_tuple(64, 32, &convolve10_sse2),
1219 make_tuple(32, 64, &convolve10_sse2),
Geza Lore938b8df2016-03-04 15:55:48 +00001220 make_tuple(64, 64, &convolve10_sse2)));
1221INSTANTIATE_TEST_CASE_P(SSE2_12, ConvolveTest, ::testing::Values(
1222#if CONFIG_VP10 && CONFIG_EXT_PARTITION
1223 make_tuple(128, 64, &convolve12_sse2),
1224 make_tuple(64, 128, &convolve12_sse2),
1225 make_tuple(128, 128, &convolve12_sse2),
1226#endif // CONFIG_VP10 && CONFIG_EXT_PARTITION
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001227 make_tuple(4, 4, &convolve12_sse2),
1228 make_tuple(8, 4, &convolve12_sse2),
1229 make_tuple(4, 8, &convolve12_sse2),
1230 make_tuple(8, 8, &convolve12_sse2),
1231 make_tuple(16, 8, &convolve12_sse2),
1232 make_tuple(8, 16, &convolve12_sse2),
1233 make_tuple(16, 16, &convolve12_sse2),
1234 make_tuple(32, 16, &convolve12_sse2),
1235 make_tuple(16, 32, &convolve12_sse2),
1236 make_tuple(32, 32, &convolve12_sse2),
1237 make_tuple(64, 32, &convolve12_sse2),
1238 make_tuple(32, 64, &convolve12_sse2),
1239 make_tuple(64, 64, &convolve12_sse2)));
Deb Mukherjee10783d42014-09-02 16:34:09 -07001240#else
Yunqing Wang3fb728c2013-10-10 13:51:35 -07001241const ConvolveFunctions convolve8_sse2(
Johannff8505a2015-06-29 16:44:30 -07001242#if CONFIG_USE_X86INC
Zoe Liu7186a2d2015-07-22 10:40:42 -07001243 vpx_convolve_copy_sse2, vpx_convolve_avg_sse2,
Johannff8505a2015-06-29 16:44:30 -07001244#else
Zoe Liu7186a2d2015-07-22 10:40:42 -07001245 vpx_convolve_copy_c, vpx_convolve_avg_c,
Johannff8505a2015-06-29 16:44:30 -07001246#endif // CONFIG_USE_X86INC
Zoe Liu7186a2d2015-07-22 10:40:42 -07001247 vpx_convolve8_horiz_sse2, vpx_convolve8_avg_horiz_sse2,
1248 vpx_convolve8_vert_sse2, vpx_convolve8_avg_vert_sse2,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -07001249 vpx_convolve8_sse2, vpx_convolve8_avg_sse2,
1250 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1251 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1252 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
Yunqing Wang3fb728c2013-10-10 13:51:35 -07001253
1254INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values(
Geza Lore938b8df2016-03-04 15:55:48 +00001255#if CONFIG_VP10 && CONFIG_EXT_PARTITION
1256 make_tuple(128, 64, &convolve8_sse2),
1257 make_tuple(64, 128, &convolve8_sse2),
1258 make_tuple(128, 128, &convolve8_sse2),
1259#endif // CONFIG_VP10 && CONFIG_EXT_PARTITION
Yunqing Wang3fb728c2013-10-10 13:51:35 -07001260 make_tuple(4, 4, &convolve8_sse2),
1261 make_tuple(8, 4, &convolve8_sse2),
1262 make_tuple(4, 8, &convolve8_sse2),
1263 make_tuple(8, 8, &convolve8_sse2),
1264 make_tuple(16, 8, &convolve8_sse2),
1265 make_tuple(8, 16, &convolve8_sse2),
1266 make_tuple(16, 16, &convolve8_sse2),
1267 make_tuple(32, 16, &convolve8_sse2),
1268 make_tuple(16, 32, &convolve8_sse2),
1269 make_tuple(32, 32, &convolve8_sse2),
1270 make_tuple(64, 32, &convolve8_sse2),
1271 make_tuple(32, 64, &convolve8_sse2),
1272 make_tuple(64, 64, &convolve8_sse2)));
Deb Mukherjee0d3c3d32014-09-16 12:47:18 -07001273#endif // CONFIG_VP9_HIGHBITDEPTH
Deb Mukherjee10783d42014-09-02 16:34:09 -07001274#endif
Yunqing Wang3fb728c2013-10-10 13:51:35 -07001275
John Koleszar29d47ac2013-02-07 17:00:37 -08001276#if HAVE_SSSE3
1277const ConvolveFunctions convolve8_ssse3(
Zoe Liu7186a2d2015-07-22 10:40:42 -07001278 vpx_convolve_copy_c, vpx_convolve_avg_c,
1279 vpx_convolve8_horiz_ssse3, vpx_convolve8_avg_horiz_ssse3,
1280 vpx_convolve8_vert_ssse3, vpx_convolve8_avg_vert_ssse3,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -07001281 vpx_convolve8_ssse3, vpx_convolve8_avg_ssse3,
1282 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1283 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
Geza Lore938b8df2016-03-04 15:55:48 +00001284 vpx_scaled_2d_ssse3, vpx_scaled_avg_2d_c, 0);
John Koleszar29d47ac2013-02-07 17:00:37 -08001285
1286INSTANTIATE_TEST_CASE_P(SSSE3, ConvolveTest, ::testing::Values(
Geza Lore938b8df2016-03-04 15:55:48 +00001287#if CONFIG_VP10 && CONFIG_EXT_PARTITION
1288 make_tuple(128, 64, &convolve8_ssse3),
1289 make_tuple(64, 128, &convolve8_ssse3),
1290 make_tuple(128, 128, &convolve8_ssse3),
1291#endif // CONFIG_VP10 && CONFIG_EXT_PARTITION
John Koleszar29d47ac2013-02-07 17:00:37 -08001292 make_tuple(4, 4, &convolve8_ssse3),
1293 make_tuple(8, 4, &convolve8_ssse3),
John Koleszara9ebbcc2013-04-18 13:05:38 -07001294 make_tuple(4, 8, &convolve8_ssse3),
John Koleszar29d47ac2013-02-07 17:00:37 -08001295 make_tuple(8, 8, &convolve8_ssse3),
John Koleszar6a4f7082013-02-08 17:49:44 -08001296 make_tuple(16, 8, &convolve8_ssse3),
John Koleszara9ebbcc2013-04-18 13:05:38 -07001297 make_tuple(8, 16, &convolve8_ssse3),
1298 make_tuple(16, 16, &convolve8_ssse3),
1299 make_tuple(32, 16, &convolve8_ssse3),
1300 make_tuple(16, 32, &convolve8_ssse3),
1301 make_tuple(32, 32, &convolve8_ssse3),
1302 make_tuple(64, 32, &convolve8_ssse3),
1303 make_tuple(32, 64, &convolve8_ssse3),
1304 make_tuple(64, 64, &convolve8_ssse3)));
John Koleszar29d47ac2013-02-07 17:00:37 -08001305#endif
Johann158c80c2013-05-23 12:50:41 -07001306
Johann8645a532014-09-10 10:27:58 -07001307#if HAVE_AVX2 && HAVE_SSSE3
Yunqing Wang4f0943b2014-05-27 10:36:56 -07001308const ConvolveFunctions convolve8_avx2(
Zoe Liu7186a2d2015-07-22 10:40:42 -07001309 vpx_convolve_copy_c, vpx_convolve_avg_c,
1310 vpx_convolve8_horiz_avx2, vpx_convolve8_avg_horiz_ssse3,
1311 vpx_convolve8_vert_avx2, vpx_convolve8_avg_vert_ssse3,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -07001312 vpx_convolve8_avx2, vpx_convolve8_avg_ssse3,
1313 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1314 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1315 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
Yunqing Wang4f0943b2014-05-27 10:36:56 -07001316
1317INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest, ::testing::Values(
Geza Lore938b8df2016-03-04 15:55:48 +00001318#if CONFIG_VP10 && CONFIG_EXT_PARTITION
1319 make_tuple(128, 64, &convolve8_avx2),
1320 make_tuple(64, 128, &convolve8_avx2),
1321 make_tuple(128, 128, &convolve8_avx2),
1322#endif // CONFIG_VP10 && CONFIG_EXT_PARTITION
Yunqing Wang4f0943b2014-05-27 10:36:56 -07001323 make_tuple(4, 4, &convolve8_avx2),
1324 make_tuple(8, 4, &convolve8_avx2),
1325 make_tuple(4, 8, &convolve8_avx2),
1326 make_tuple(8, 8, &convolve8_avx2),
levytamar82839911f2014-07-27 16:45:55 -07001327 make_tuple(8, 16, &convolve8_avx2),
Yunqing Wang4f0943b2014-05-27 10:36:56 -07001328 make_tuple(16, 8, &convolve8_avx2),
Yunqing Wang4f0943b2014-05-27 10:36:56 -07001329 make_tuple(16, 16, &convolve8_avx2),
1330 make_tuple(32, 16, &convolve8_avx2),
1331 make_tuple(16, 32, &convolve8_avx2),
1332 make_tuple(32, 32, &convolve8_avx2),
1333 make_tuple(64, 32, &convolve8_avx2),
1334 make_tuple(32, 64, &convolve8_avx2),
1335 make_tuple(64, 64, &convolve8_avx2)));
Johann8645a532014-09-10 10:27:58 -07001336#endif // HAVE_AVX2 && HAVE_SSSE3
Yunqing Wang4f0943b2014-05-27 10:36:56 -07001337
Geza Lore938b8df2016-03-04 15:55:48 +00001338// TODO(any): Make NEON versions support 128x128 128x64 64x128 block sizes
1339#if HAVE_NEON && !(CONFIG_VP10 && CONFIG_EXT_PARTITION)
Johannce239312014-05-07 11:01:31 -07001340#if HAVE_NEON_ASM
Johann158c80c2013-05-23 12:50:41 -07001341const ConvolveFunctions convolve8_neon(
Zoe Liu7186a2d2015-07-22 10:40:42 -07001342 vpx_convolve_copy_neon, vpx_convolve_avg_neon,
1343 vpx_convolve8_horiz_neon, vpx_convolve8_avg_horiz_neon,
1344 vpx_convolve8_vert_neon, vpx_convolve8_avg_vert_neon,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -07001345 vpx_convolve8_neon, vpx_convolve8_avg_neon,
1346 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1347 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1348 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
Scott LaVarnway617382a2014-09-10 09:49:34 -07001349#else // HAVE_NEON
1350const ConvolveFunctions convolve8_neon(
Zoe Liu7186a2d2015-07-22 10:40:42 -07001351 vpx_convolve_copy_neon, vpx_convolve_avg_neon,
1352 vpx_convolve8_horiz_neon, vpx_convolve8_avg_horiz_neon,
1353 vpx_convolve8_vert_neon, vpx_convolve8_avg_vert_neon,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -07001354 vpx_convolve8_neon, vpx_convolve8_avg_neon,
1355 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1356 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1357 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
Scott LaVarnway617382a2014-09-10 09:49:34 -07001358#endif // HAVE_NEON_ASM
Johann158c80c2013-05-23 12:50:41 -07001359
1360INSTANTIATE_TEST_CASE_P(NEON, ConvolveTest, ::testing::Values(
Geza Lore938b8df2016-03-04 15:55:48 +00001361#if CONFIG_VP10 && CONFIG_EXT_PARTITION
1362 make_tuple(128, 64, &convolve8_neon),
1363 make_tuple(64, 128, &convolve8_neon),
1364 make_tuple(128, 128, &convolve8_neon),
1365#endif // CONFIG_VP10 && CONFIG_EXT_PARTITION
Johann158c80c2013-05-23 12:50:41 -07001366 make_tuple(4, 4, &convolve8_neon),
1367 make_tuple(8, 4, &convolve8_neon),
1368 make_tuple(4, 8, &convolve8_neon),
1369 make_tuple(8, 8, &convolve8_neon),
1370 make_tuple(16, 8, &convolve8_neon),
1371 make_tuple(8, 16, &convolve8_neon),
1372 make_tuple(16, 16, &convolve8_neon),
1373 make_tuple(32, 16, &convolve8_neon),
1374 make_tuple(16, 32, &convolve8_neon),
1375 make_tuple(32, 32, &convolve8_neon),
1376 make_tuple(64, 32, &convolve8_neon),
1377 make_tuple(32, 64, &convolve8_neon),
1378 make_tuple(64, 64, &convolve8_neon)));
Scott LaVarnway617382a2014-09-10 09:49:34 -07001379#endif // HAVE_NEON
Parag Salasakar40edab52013-09-13 15:18:32 +05301380
Geza Lore938b8df2016-03-04 15:55:48 +00001381// TODO(any): Make DSPR2 versions support 128x128 128x64 64x128 block sizes
1382#if HAVE_DSPR2 && !(CONFIG_VP10 && CONFIG_EXT_PARTITION)
Parag Salasakar40edab52013-09-13 15:18:32 +05301383const ConvolveFunctions convolve8_dspr2(
Zoe Liu7186a2d2015-07-22 10:40:42 -07001384 vpx_convolve_copy_dspr2, vpx_convolve_avg_dspr2,
1385 vpx_convolve8_horiz_dspr2, vpx_convolve8_avg_horiz_dspr2,
1386 vpx_convolve8_vert_dspr2, vpx_convolve8_avg_vert_dspr2,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -07001387 vpx_convolve8_dspr2, vpx_convolve8_avg_dspr2,
1388 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1389 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1390 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
Parag Salasakar40edab52013-09-13 15:18:32 +05301391
1392INSTANTIATE_TEST_CASE_P(DSPR2, ConvolveTest, ::testing::Values(
Geza Lore938b8df2016-03-04 15:55:48 +00001393#if CONFIG_VP10 && CONFIG_EXT_PARTITION
1394 make_tuple(128, 64, &convolve8_dspr2),
1395 make_tuple(64, 128, &convolve8_dspr2),
1396 make_tuple(128, 128, &convolve8_dspr2),
1397#endif // CONFIG_VP10 && CONFIG_EXT_PARTITION
Parag Salasakar40edab52013-09-13 15:18:32 +05301398 make_tuple(4, 4, &convolve8_dspr2),
1399 make_tuple(8, 4, &convolve8_dspr2),
1400 make_tuple(4, 8, &convolve8_dspr2),
1401 make_tuple(8, 8, &convolve8_dspr2),
1402 make_tuple(16, 8, &convolve8_dspr2),
1403 make_tuple(8, 16, &convolve8_dspr2),
1404 make_tuple(16, 16, &convolve8_dspr2),
1405 make_tuple(32, 16, &convolve8_dspr2),
1406 make_tuple(16, 32, &convolve8_dspr2),
1407 make_tuple(32, 32, &convolve8_dspr2),
1408 make_tuple(64, 32, &convolve8_dspr2),
1409 make_tuple(32, 64, &convolve8_dspr2),
1410 make_tuple(64, 64, &convolve8_dspr2)));
1411#endif
Parag Salasakar27d083c2015-04-16 11:03:24 +05301412
Geza Lore938b8df2016-03-04 15:55:48 +00001413// TODO(any): Make MSA versions support 128x128 128x64 64x128 block sizes
1414#if HAVE_MSA && !(CONFIG_VP10 && CONFIG_EXT_PARTITION)
Parag Salasakar27d083c2015-04-16 11:03:24 +05301415const ConvolveFunctions convolve8_msa(
Zoe Liu7186a2d2015-07-22 10:40:42 -07001416 vpx_convolve_copy_msa, vpx_convolve_avg_msa,
1417 vpx_convolve8_horiz_msa, vpx_convolve8_avg_horiz_msa,
1418 vpx_convolve8_vert_msa, vpx_convolve8_avg_vert_msa,
Scott LaVarnway4e6b5072015-08-05 10:47:06 -07001419 vpx_convolve8_msa, vpx_convolve8_avg_msa,
1420 vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1421 vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1422 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
Parag Salasakar27d083c2015-04-16 11:03:24 +05301423
1424INSTANTIATE_TEST_CASE_P(MSA, ConvolveTest, ::testing::Values(
Geza Lore938b8df2016-03-04 15:55:48 +00001425#if CONFIG_VP10 && CONFIG_EXT_PARTITION
1426 make_tuple(128, 64, &convolve8_msa),
1427 make_tuple(64, 128, &convolve8_msa),
1428 make_tuple(128, 128, &convolve8_msa),
1429#endif // CONFIG_VP10 && CONFIG_EXT_PARTITION
Parag Salasakar27d083c2015-04-16 11:03:24 +05301430 make_tuple(4, 4, &convolve8_msa),
1431 make_tuple(8, 4, &convolve8_msa),
1432 make_tuple(4, 8, &convolve8_msa),
1433 make_tuple(8, 8, &convolve8_msa),
1434 make_tuple(16, 8, &convolve8_msa),
1435 make_tuple(8, 16, &convolve8_msa),
1436 make_tuple(16, 16, &convolve8_msa),
1437 make_tuple(32, 16, &convolve8_msa),
1438 make_tuple(16, 32, &convolve8_msa),
1439 make_tuple(32, 32, &convolve8_msa),
1440 make_tuple(64, 32, &convolve8_msa),
1441 make_tuple(32, 64, &convolve8_msa),
1442 make_tuple(64, 64, &convolve8_msa)));
1443#endif // HAVE_MSA
James Zern8fb48af2013-05-02 13:08:19 -07001444} // namespace