John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 1 | /* |
| 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 Rintaluoma | e326cec | 2013-08-22 11:29:19 +0300 | [diff] [blame] | 11 | #include <string.h> |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 12 | #include "test/acm_random.h" |
Jim Bankoski | 18d3236 | 2014-12-12 06:18:56 -0800 | [diff] [blame] | 13 | #include "test/clear_system_state.h" |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 14 | #include "test/register_state_check.h" |
| 15 | #include "test/util.h" |
| 16 | #include "third_party/googletest/src/include/gtest/gtest.h" |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 17 | |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 18 | #include "./vpx_config.h" |
| 19 | #include "./vp9_rtcd.h" |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 20 | #include "vp9/common/vp9_common.h" |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 21 | #include "vp9/common/vp9_filter.h" |
John Koleszar | 29d47ac | 2013-02-07 17:00:37 -0800 | [diff] [blame] | 22 | #include "vpx_mem/vpx_mem.h" |
John Koleszar | 6fd7dd1 | 2013-02-20 15:59:20 -0800 | [diff] [blame] | 23 | #include "vpx_ports/mem.h" |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 24 | |
| 25 | namespace { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 26 | |
hkuang | db71c1b | 2014-09-19 22:47:28 -0700 | [diff] [blame] | 27 | static const unsigned int kMaxDimension = 64; |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 28 | |
James Zern | dfc4e8f | 2014-07-16 18:48:20 -0700 | [diff] [blame] | 29 | typedef void (*ConvolveFunc)(const uint8_t *src, ptrdiff_t src_stride, |
| 30 | uint8_t *dst, ptrdiff_t dst_stride, |
| 31 | const int16_t *filter_x, int filter_x_stride, |
| 32 | const int16_t *filter_y, int filter_y_stride, |
| 33 | int w, int h); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 34 | |
| 35 | struct ConvolveFunctions { |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 36 | ConvolveFunctions(ConvolveFunc copy, ConvolveFunc avg, |
| 37 | ConvolveFunc h8, ConvolveFunc h8_avg, |
James Zern | dfc4e8f | 2014-07-16 18:48:20 -0700 | [diff] [blame] | 38 | ConvolveFunc v8, ConvolveFunc v8_avg, |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 39 | ConvolveFunc hv8, ConvolveFunc hv8_avg, |
| 40 | int bd) |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 41 | : copy_(copy), avg_(avg), h8_(h8), v8_(v8), hv8_(hv8), h8_avg_(h8_avg), |
| 42 | v8_avg_(v8_avg), hv8_avg_(hv8_avg), use_highbd_(bd) {} |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 43 | |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 44 | ConvolveFunc copy_; |
| 45 | ConvolveFunc avg_; |
James Zern | dfc4e8f | 2014-07-16 18:48:20 -0700 | [diff] [blame] | 46 | ConvolveFunc h8_; |
| 47 | ConvolveFunc v8_; |
| 48 | ConvolveFunc hv8_; |
| 49 | ConvolveFunc h8_avg_; |
| 50 | ConvolveFunc v8_avg_; |
| 51 | ConvolveFunc hv8_avg_; |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 52 | int use_highbd_; // 0 if high bitdepth not used, else the actual bit depth. |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 53 | }; |
| 54 | |
James Zern | dfc4e8f | 2014-07-16 18:48:20 -0700 | [diff] [blame] | 55 | typedef std::tr1::tuple<int, int, const ConvolveFunctions *> ConvolveParam; |
Joshua Litt | 51490e5 | 2013-11-18 17:07:55 -0800 | [diff] [blame] | 56 | |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 57 | // Reference 8-tap subpixel filter, slightly modified to fit into this test. |
| 58 | #define VP9_FILTER_WEIGHT 128 |
| 59 | #define VP9_FILTER_SHIFT 7 |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 60 | uint8_t clip_pixel(int x) { |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 61 | return x < 0 ? 0 : |
| 62 | x > 255 ? 255 : |
| 63 | x; |
| 64 | } |
| 65 | |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 66 | void filter_block2d_8_c(const uint8_t *src_ptr, |
| 67 | const unsigned int src_stride, |
| 68 | const int16_t *HFilter, |
| 69 | const int16_t *VFilter, |
| 70 | uint8_t *dst_ptr, |
| 71 | unsigned int dst_stride, |
| 72 | unsigned int output_width, |
| 73 | unsigned int output_height) { |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 74 | // Between passes, we use an intermediate buffer whose height is extended to |
| 75 | // have enough horizontally filtered values as input for the vertical pass. |
| 76 | // This buffer is allocated to be big enough for the largest block type we |
| 77 | // support. |
| 78 | const int kInterp_Extend = 4; |
| 79 | const unsigned int intermediate_height = |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 80 | (kInterp_Extend - 1) + output_height + kInterp_Extend; |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 81 | unsigned int i, j; |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 82 | |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 83 | // Size of intermediate_buffer is max_intermediate_height * filter_max_width, |
| 84 | // where max_intermediate_height = (kInterp_Extend - 1) + filter_max_height |
| 85 | // + kInterp_Extend |
| 86 | // = 3 + 16 + 4 |
| 87 | // = 23 |
| 88 | // and filter_max_width = 16 |
| 89 | // |
| 90 | uint8_t intermediate_buffer[71 * kMaxDimension]; |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 91 | const int intermediate_next_stride = 1 - intermediate_height * output_width; |
| 92 | |
| 93 | // Horizontal pass (src -> transposed intermediate). |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 94 | uint8_t *output_ptr = intermediate_buffer; |
| 95 | const int src_next_row_stride = src_stride - output_width; |
| 96 | src_ptr -= (kInterp_Extend - 1) * src_stride + (kInterp_Extend - 1); |
| 97 | for (i = 0; i < intermediate_height; ++i) { |
| 98 | for (j = 0; j < output_width; ++j) { |
| 99 | // Apply filter... |
| 100 | const int temp = (src_ptr[0] * HFilter[0]) + |
| 101 | (src_ptr[1] * HFilter[1]) + |
| 102 | (src_ptr[2] * HFilter[2]) + |
| 103 | (src_ptr[3] * HFilter[3]) + |
| 104 | (src_ptr[4] * HFilter[4]) + |
| 105 | (src_ptr[5] * HFilter[5]) + |
| 106 | (src_ptr[6] * HFilter[6]) + |
| 107 | (src_ptr[7] * HFilter[7]) + |
| 108 | (VP9_FILTER_WEIGHT >> 1); // Rounding |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 109 | |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 110 | // Normalize back to 0-255... |
| 111 | *output_ptr = clip_pixel(temp >> VP9_FILTER_SHIFT); |
| 112 | ++src_ptr; |
| 113 | output_ptr += intermediate_height; |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 114 | } |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 115 | src_ptr += src_next_row_stride; |
| 116 | output_ptr += intermediate_next_stride; |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 117 | } |
| 118 | |
| 119 | // Vertical pass (transposed intermediate -> dst). |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 120 | src_ptr = intermediate_buffer; |
| 121 | const int dst_next_row_stride = dst_stride - output_width; |
| 122 | for (i = 0; i < output_height; ++i) { |
| 123 | for (j = 0; j < output_width; ++j) { |
| 124 | // Apply filter... |
| 125 | const int temp = (src_ptr[0] * VFilter[0]) + |
| 126 | (src_ptr[1] * VFilter[1]) + |
| 127 | (src_ptr[2] * VFilter[2]) + |
| 128 | (src_ptr[3] * VFilter[3]) + |
| 129 | (src_ptr[4] * VFilter[4]) + |
| 130 | (src_ptr[5] * VFilter[5]) + |
| 131 | (src_ptr[6] * VFilter[6]) + |
| 132 | (src_ptr[7] * VFilter[7]) + |
| 133 | (VP9_FILTER_WEIGHT >> 1); // Rounding |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 134 | |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 135 | // Normalize back to 0-255... |
| 136 | *dst_ptr++ = clip_pixel(temp >> VP9_FILTER_SHIFT); |
| 137 | src_ptr += intermediate_height; |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 138 | } |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 139 | src_ptr += intermediate_next_stride; |
| 140 | dst_ptr += dst_next_row_stride; |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 141 | } |
| 142 | } |
| 143 | |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 144 | void block2d_average_c(uint8_t *src, |
| 145 | unsigned int src_stride, |
| 146 | uint8_t *output_ptr, |
| 147 | unsigned int output_stride, |
| 148 | unsigned int output_width, |
| 149 | unsigned int output_height) { |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 150 | unsigned int i, j; |
| 151 | for (i = 0; i < output_height; ++i) { |
| 152 | for (j = 0; j < output_width; ++j) { |
| 153 | output_ptr[j] = (output_ptr[j] + src[i * src_stride + j] + 1) >> 1; |
| 154 | } |
| 155 | output_ptr += output_stride; |
| 156 | } |
| 157 | } |
| 158 | |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 159 | void filter_average_block2d_8_c(const uint8_t *src_ptr, |
| 160 | const unsigned int src_stride, |
| 161 | const int16_t *HFilter, |
| 162 | const int16_t *VFilter, |
| 163 | uint8_t *dst_ptr, |
| 164 | unsigned int dst_stride, |
| 165 | unsigned int output_width, |
| 166 | unsigned int output_height) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 167 | uint8_t tmp[kMaxDimension * kMaxDimension]; |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 168 | |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 169 | assert(output_width <= kMaxDimension); |
| 170 | assert(output_height <= kMaxDimension); |
John Koleszar | a9ebbcc | 2013-04-18 13:05:38 -0700 | [diff] [blame] | 171 | filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, tmp, 64, |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 172 | output_width, output_height); |
John Koleszar | a9ebbcc | 2013-04-18 13:05:38 -0700 | [diff] [blame] | 173 | block2d_average_c(tmp, 64, dst_ptr, dst_stride, |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 174 | output_width, output_height); |
| 175 | } |
| 176 | |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 177 | #if CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 178 | void highbd_filter_block2d_8_c(const uint16_t *src_ptr, |
| 179 | const unsigned int src_stride, |
| 180 | const int16_t *HFilter, |
| 181 | const int16_t *VFilter, |
| 182 | uint16_t *dst_ptr, |
| 183 | unsigned int dst_stride, |
| 184 | unsigned int output_width, |
| 185 | unsigned int output_height, |
| 186 | int bd) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 187 | // Between passes, we use an intermediate buffer whose height is extended to |
| 188 | // have enough horizontally filtered values as input for the vertical pass. |
| 189 | // This buffer is allocated to be big enough for the largest block type we |
| 190 | // support. |
| 191 | const int kInterp_Extend = 4; |
| 192 | const unsigned int intermediate_height = |
| 193 | (kInterp_Extend - 1) + output_height + kInterp_Extend; |
| 194 | |
| 195 | /* Size of intermediate_buffer is max_intermediate_height * filter_max_width, |
| 196 | * where max_intermediate_height = (kInterp_Extend - 1) + filter_max_height |
| 197 | * + kInterp_Extend |
| 198 | * = 3 + 16 + 4 |
| 199 | * = 23 |
| 200 | * and filter_max_width = 16 |
| 201 | */ |
| 202 | uint16_t intermediate_buffer[71 * kMaxDimension]; |
| 203 | const int intermediate_next_stride = 1 - intermediate_height * output_width; |
| 204 | |
| 205 | // Horizontal pass (src -> transposed intermediate). |
| 206 | { |
| 207 | uint16_t *output_ptr = intermediate_buffer; |
| 208 | const int src_next_row_stride = src_stride - output_width; |
| 209 | unsigned int i, j; |
| 210 | src_ptr -= (kInterp_Extend - 1) * src_stride + (kInterp_Extend - 1); |
| 211 | for (i = 0; i < intermediate_height; ++i) { |
| 212 | for (j = 0; j < output_width; ++j) { |
| 213 | // Apply filter... |
| 214 | const int temp = (src_ptr[0] * HFilter[0]) + |
| 215 | (src_ptr[1] * HFilter[1]) + |
| 216 | (src_ptr[2] * HFilter[2]) + |
| 217 | (src_ptr[3] * HFilter[3]) + |
| 218 | (src_ptr[4] * HFilter[4]) + |
| 219 | (src_ptr[5] * HFilter[5]) + |
| 220 | (src_ptr[6] * HFilter[6]) + |
| 221 | (src_ptr[7] * HFilter[7]) + |
| 222 | (VP9_FILTER_WEIGHT >> 1); // Rounding |
| 223 | |
| 224 | // Normalize back to 0-255... |
Deb Mukherjee | d50716f | 2014-10-02 15:43:27 -0700 | [diff] [blame] | 225 | *output_ptr = clip_pixel_highbd(temp >> VP9_FILTER_SHIFT, bd); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 226 | ++src_ptr; |
| 227 | output_ptr += intermediate_height; |
| 228 | } |
| 229 | src_ptr += src_next_row_stride; |
| 230 | output_ptr += intermediate_next_stride; |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | // Vertical pass (transposed intermediate -> dst). |
| 235 | { |
| 236 | uint16_t *src_ptr = intermediate_buffer; |
| 237 | const int dst_next_row_stride = dst_stride - output_width; |
| 238 | unsigned int i, j; |
| 239 | for (i = 0; i < output_height; ++i) { |
| 240 | for (j = 0; j < output_width; ++j) { |
| 241 | // Apply filter... |
| 242 | const int temp = (src_ptr[0] * VFilter[0]) + |
| 243 | (src_ptr[1] * VFilter[1]) + |
| 244 | (src_ptr[2] * VFilter[2]) + |
| 245 | (src_ptr[3] * VFilter[3]) + |
| 246 | (src_ptr[4] * VFilter[4]) + |
| 247 | (src_ptr[5] * VFilter[5]) + |
| 248 | (src_ptr[6] * VFilter[6]) + |
| 249 | (src_ptr[7] * VFilter[7]) + |
| 250 | (VP9_FILTER_WEIGHT >> 1); // Rounding |
| 251 | |
| 252 | // Normalize back to 0-255... |
Deb Mukherjee | d50716f | 2014-10-02 15:43:27 -0700 | [diff] [blame] | 253 | *dst_ptr++ = clip_pixel_highbd(temp >> VP9_FILTER_SHIFT, bd); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 254 | src_ptr += intermediate_height; |
| 255 | } |
| 256 | src_ptr += intermediate_next_stride; |
| 257 | dst_ptr += dst_next_row_stride; |
| 258 | } |
| 259 | } |
| 260 | } |
| 261 | |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 262 | void highbd_block2d_average_c(uint16_t *src, |
| 263 | unsigned int src_stride, |
| 264 | uint16_t *output_ptr, |
| 265 | unsigned int output_stride, |
| 266 | unsigned int output_width, |
| 267 | unsigned int output_height, |
| 268 | int bd) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 269 | unsigned int i, j; |
| 270 | for (i = 0; i < output_height; ++i) { |
| 271 | for (j = 0; j < output_width; ++j) { |
| 272 | output_ptr[j] = (output_ptr[j] + src[i * src_stride + j] + 1) >> 1; |
| 273 | } |
| 274 | output_ptr += output_stride; |
| 275 | } |
| 276 | } |
| 277 | |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 278 | void highbd_filter_average_block2d_8_c(const uint16_t *src_ptr, |
| 279 | const unsigned int src_stride, |
| 280 | const int16_t *HFilter, |
| 281 | const int16_t *VFilter, |
| 282 | uint16_t *dst_ptr, |
| 283 | unsigned int dst_stride, |
| 284 | unsigned int output_width, |
| 285 | unsigned int output_height, |
| 286 | int bd) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 287 | uint16_t tmp[kMaxDimension * kMaxDimension]; |
| 288 | |
| 289 | assert(output_width <= kMaxDimension); |
| 290 | assert(output_height <= kMaxDimension); |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 291 | highbd_filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, tmp, 64, |
| 292 | output_width, output_height, bd); |
| 293 | highbd_block2d_average_c(tmp, 64, dst_ptr, dst_stride, |
| 294 | output_width, output_height, bd); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 295 | } |
| 296 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 297 | |
James Zern | dfc4e8f | 2014-07-16 18:48:20 -0700 | [diff] [blame] | 298 | class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> { |
John Koleszar | 29d47ac | 2013-02-07 17:00:37 -0800 | [diff] [blame] | 299 | public: |
| 300 | static void SetUpTestCase() { |
| 301 | // Force input_ to be unaligned, output to be 16 byte aligned. |
| 302 | input_ = reinterpret_cast<uint8_t*>( |
James Zern | b0e5775 | 2013-05-02 12:29:34 -0700 | [diff] [blame] | 303 | vpx_memalign(kDataAlignment, kInputBufferSize + 1)) + 1; |
John Koleszar | 29d47ac | 2013-02-07 17:00:37 -0800 | [diff] [blame] | 304 | output_ = reinterpret_cast<uint8_t*>( |
James Zern | b0e5775 | 2013-05-02 12:29:34 -0700 | [diff] [blame] | 305 | vpx_memalign(kDataAlignment, kOutputBufferSize)); |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 306 | output_ref_ = reinterpret_cast<uint8_t*>( |
| 307 | vpx_memalign(kDataAlignment, kOutputBufferSize)); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 308 | #if CONFIG_VP9_HIGHBITDEPTH |
| 309 | input16_ = reinterpret_cast<uint16_t*>( |
| 310 | vpx_memalign(kDataAlignment, |
| 311 | (kInputBufferSize + 1) * sizeof(uint16_t))) + 1; |
| 312 | output16_ = reinterpret_cast<uint16_t*>( |
| 313 | vpx_memalign(kDataAlignment, (kOutputBufferSize) * sizeof(uint16_t))); |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 314 | output16_ref_ = reinterpret_cast<uint16_t*>( |
| 315 | vpx_memalign(kDataAlignment, (kOutputBufferSize) * sizeof(uint16_t))); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 316 | #endif |
John Koleszar | 29d47ac | 2013-02-07 17:00:37 -0800 | [diff] [blame] | 317 | } |
| 318 | |
Jim Bankoski | 18d3236 | 2014-12-12 06:18:56 -0800 | [diff] [blame] | 319 | virtual void TearDown() { libvpx_test::ClearSystemState(); } |
| 320 | |
John Koleszar | 29d47ac | 2013-02-07 17:00:37 -0800 | [diff] [blame] | 321 | static void TearDownTestCase() { |
| 322 | vpx_free(input_ - 1); |
| 323 | input_ = NULL; |
| 324 | vpx_free(output_); |
| 325 | output_ = NULL; |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 326 | vpx_free(output_ref_); |
| 327 | output_ref_ = NULL; |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 328 | #if CONFIG_VP9_HIGHBITDEPTH |
| 329 | vpx_free(input16_ - 1); |
| 330 | input16_ = NULL; |
| 331 | vpx_free(output16_); |
| 332 | output16_ = NULL; |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 333 | vpx_free(output16_ref_); |
| 334 | output16_ref_ = NULL; |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 335 | #endif |
John Koleszar | 29d47ac | 2013-02-07 17:00:37 -0800 | [diff] [blame] | 336 | } |
| 337 | |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 338 | protected: |
| 339 | static const int kDataAlignment = 16; |
Tero Rintaluoma | e326cec | 2013-08-22 11:29:19 +0300 | [diff] [blame] | 340 | static const int kOuterBlockSize = 256; |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 341 | static const int kInputStride = kOuterBlockSize; |
| 342 | static const int kOutputStride = kOuterBlockSize; |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 343 | static const int kInputBufferSize = kOuterBlockSize * kOuterBlockSize; |
| 344 | static const int kOutputBufferSize = kOuterBlockSize * kOuterBlockSize; |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 345 | |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 346 | int Width() const { return GET_PARAM(0); } |
| 347 | int Height() const { return GET_PARAM(1); } |
| 348 | int BorderLeft() const { |
| 349 | const int center = (kOuterBlockSize - Width()) / 2; |
| 350 | return (center + (kDataAlignment - 1)) & ~(kDataAlignment - 1); |
| 351 | } |
| 352 | int BorderTop() const { return (kOuterBlockSize - Height()) / 2; } |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 353 | |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 354 | bool IsIndexInBorder(int i) { |
| 355 | return (i < BorderTop() * kOuterBlockSize || |
| 356 | i >= (BorderTop() + Height()) * kOuterBlockSize || |
| 357 | i % kOuterBlockSize < BorderLeft() || |
| 358 | i % kOuterBlockSize >= (BorderLeft() + Width())); |
| 359 | } |
| 360 | |
| 361 | virtual void SetUp() { |
| 362 | UUT_ = GET_PARAM(2); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 363 | #if CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 364 | if (UUT_->use_highbd_ != 0) |
| 365 | mask_ = (1 << UUT_->use_highbd_) - 1; |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 366 | else |
| 367 | mask_ = 255; |
| 368 | #endif |
Johann | 158c80c | 2013-05-23 12:50:41 -0700 | [diff] [blame] | 369 | /* Set up guard blocks for an inner block centered in the outer block */ |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 370 | for (int i = 0; i < kOutputBufferSize; ++i) { |
| 371 | if (IsIndexInBorder(i)) |
| 372 | output_[i] = 255; |
| 373 | else |
| 374 | output_[i] = 0; |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 375 | } |
| 376 | |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 377 | ::libvpx_test::ACMRandom prng; |
Yaowu Xu | 077144d | 2014-05-23 12:23:29 -0700 | [diff] [blame] | 378 | for (int i = 0; i < kInputBufferSize; ++i) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 379 | if (i & 1) { |
Yaowu Xu | 077144d | 2014-05-23 12:23:29 -0700 | [diff] [blame] | 380 | input_[i] = 255; |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 381 | #if CONFIG_VP9_HIGHBITDEPTH |
| 382 | input16_[i] = mask_; |
| 383 | #endif |
| 384 | } else { |
Yaowu Xu | 077144d | 2014-05-23 12:23:29 -0700 | [diff] [blame] | 385 | input_[i] = prng.Rand8Extremes(); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 386 | #if CONFIG_VP9_HIGHBITDEPTH |
| 387 | input16_[i] = prng.Rand16() & mask_; |
| 388 | #endif |
| 389 | } |
Yaowu Xu | 077144d | 2014-05-23 12:23:29 -0700 | [diff] [blame] | 390 | } |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 391 | } |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 392 | |
Tero Rintaluoma | e326cec | 2013-08-22 11:29:19 +0300 | [diff] [blame] | 393 | void SetConstantInput(int value) { |
| 394 | memset(input_, value, kInputBufferSize); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 395 | #if CONFIG_VP9_HIGHBITDEPTH |
| 396 | vpx_memset16(input16_, value, kInputBufferSize); |
| 397 | #endif |
Tero Rintaluoma | e326cec | 2013-08-22 11:29:19 +0300 | [diff] [blame] | 398 | } |
| 399 | |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 400 | void CopyOutputToRef() { |
James Zern | f274c21 | 2015-04-23 20:42:19 -0700 | [diff] [blame] | 401 | memcpy(output_ref_, output_, kOutputBufferSize); |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 402 | #if CONFIG_VP9_HIGHBITDEPTH |
James Zern | f274c21 | 2015-04-23 20:42:19 -0700 | [diff] [blame] | 403 | memcpy(output16_ref_, output16_, kOutputBufferSize); |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 404 | #endif |
| 405 | } |
| 406 | |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 407 | void CheckGuardBlocks() { |
| 408 | for (int i = 0; i < kOutputBufferSize; ++i) { |
| 409 | if (IsIndexInBorder(i)) |
| 410 | EXPECT_EQ(255, output_[i]); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 411 | } |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 412 | } |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 413 | |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 414 | uint8_t *input() const { |
| 415 | #if CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 416 | if (UUT_->use_highbd_ == 0) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 417 | return input_ + BorderTop() * kOuterBlockSize + BorderLeft(); |
| 418 | } else { |
| 419 | return CONVERT_TO_BYTEPTR(input16_ + BorderTop() * kOuterBlockSize + |
| 420 | BorderLeft()); |
| 421 | } |
| 422 | #else |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 423 | return input_ + BorderTop() * kOuterBlockSize + BorderLeft(); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 424 | #endif |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 425 | } |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 426 | |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 427 | uint8_t *output() const { |
| 428 | #if CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 429 | if (UUT_->use_highbd_ == 0) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 430 | return output_ + BorderTop() * kOuterBlockSize + BorderLeft(); |
| 431 | } else { |
| 432 | return CONVERT_TO_BYTEPTR(output16_ + BorderTop() * kOuterBlockSize + |
| 433 | BorderLeft()); |
| 434 | } |
| 435 | #else |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 436 | return output_ + BorderTop() * kOuterBlockSize + BorderLeft(); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 437 | #endif |
| 438 | } |
| 439 | |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 440 | uint8_t *output_ref() const { |
| 441 | #if CONFIG_VP9_HIGHBITDEPTH |
| 442 | if (UUT_->use_highbd_ == 0) { |
| 443 | return output_ref_ + BorderTop() * kOuterBlockSize + BorderLeft(); |
| 444 | } else { |
| 445 | return CONVERT_TO_BYTEPTR(output16_ref_ + BorderTop() * kOuterBlockSize + |
| 446 | BorderLeft()); |
| 447 | } |
| 448 | #else |
| 449 | return output_ref_ + BorderTop() * kOuterBlockSize + BorderLeft(); |
| 450 | #endif |
| 451 | } |
| 452 | |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 453 | uint16_t lookup(uint8_t *list, int index) const { |
| 454 | #if CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 455 | if (UUT_->use_highbd_ == 0) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 456 | return list[index]; |
| 457 | } else { |
| 458 | return CONVERT_TO_SHORTPTR(list)[index]; |
| 459 | } |
| 460 | #else |
| 461 | return list[index]; |
| 462 | #endif |
| 463 | } |
| 464 | |
| 465 | void assign_val(uint8_t *list, int index, uint16_t val) const { |
| 466 | #if CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 467 | if (UUT_->use_highbd_ == 0) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 468 | list[index] = (uint8_t) val; |
| 469 | } else { |
| 470 | CONVERT_TO_SHORTPTR(list)[index] = val; |
| 471 | } |
| 472 | #else |
| 473 | list[index] = (uint8_t) val; |
| 474 | #endif |
| 475 | } |
| 476 | |
| 477 | void wrapper_filter_average_block2d_8_c(const uint8_t *src_ptr, |
| 478 | const unsigned int src_stride, |
| 479 | const int16_t *HFilter, |
| 480 | const int16_t *VFilter, |
| 481 | uint8_t *dst_ptr, |
| 482 | unsigned int dst_stride, |
| 483 | unsigned int output_width, |
| 484 | unsigned int output_height) { |
| 485 | #if CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 486 | if (UUT_->use_highbd_ == 0) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 487 | filter_average_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, |
| 488 | dst_ptr, dst_stride, output_width, |
| 489 | output_height); |
| 490 | } else { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 491 | highbd_filter_average_block2d_8_c(CONVERT_TO_SHORTPTR(src_ptr), |
| 492 | src_stride, HFilter, VFilter, |
| 493 | CONVERT_TO_SHORTPTR(dst_ptr), |
| 494 | dst_stride, output_width, output_height, |
| 495 | UUT_->use_highbd_); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 496 | } |
| 497 | #else |
| 498 | filter_average_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, |
| 499 | dst_ptr, dst_stride, output_width, |
| 500 | output_height); |
| 501 | #endif |
| 502 | } |
| 503 | |
| 504 | void wrapper_filter_block2d_8_c(const uint8_t *src_ptr, |
| 505 | const unsigned int src_stride, |
| 506 | const int16_t *HFilter, |
| 507 | const int16_t *VFilter, |
| 508 | uint8_t *dst_ptr, |
| 509 | unsigned int dst_stride, |
| 510 | unsigned int output_width, |
| 511 | unsigned int output_height) { |
| 512 | #if CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 513 | if (UUT_->use_highbd_ == 0) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 514 | filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, |
| 515 | dst_ptr, dst_stride, output_width, output_height); |
| 516 | } else { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 517 | highbd_filter_block2d_8_c(CONVERT_TO_SHORTPTR(src_ptr), src_stride, |
| 518 | HFilter, VFilter, |
| 519 | CONVERT_TO_SHORTPTR(dst_ptr), dst_stride, |
| 520 | output_width, output_height, UUT_->use_highbd_); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 521 | } |
| 522 | #else |
| 523 | filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, |
| 524 | dst_ptr, dst_stride, output_width, output_height); |
| 525 | #endif |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 526 | } |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 527 | |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 528 | const ConvolveFunctions* UUT_; |
| 529 | static uint8_t* input_; |
| 530 | static uint8_t* output_; |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 531 | static uint8_t* output_ref_; |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 532 | #if CONFIG_VP9_HIGHBITDEPTH |
| 533 | static uint16_t* input16_; |
| 534 | static uint16_t* output16_; |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 535 | static uint16_t* output16_ref_; |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 536 | int mask_; |
| 537 | #endif |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 538 | }; |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 539 | |
John Koleszar | 29d47ac | 2013-02-07 17:00:37 -0800 | [diff] [blame] | 540 | uint8_t* ConvolveTest::input_ = NULL; |
| 541 | uint8_t* ConvolveTest::output_ = NULL; |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 542 | uint8_t* ConvolveTest::output_ref_ = NULL; |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 543 | #if CONFIG_VP9_HIGHBITDEPTH |
| 544 | uint16_t* ConvolveTest::input16_ = NULL; |
| 545 | uint16_t* ConvolveTest::output16_ = NULL; |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 546 | uint16_t* ConvolveTest::output16_ref_ = NULL; |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 547 | #endif |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 548 | |
| 549 | TEST_P(ConvolveTest, GuardBlocks) { |
| 550 | CheckGuardBlocks(); |
| 551 | } |
| 552 | |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 553 | TEST_P(ConvolveTest, Copy) { |
| 554 | uint8_t* const in = input(); |
| 555 | uint8_t* const out = output(); |
| 556 | |
| 557 | ASM_REGISTER_STATE_CHECK( |
| 558 | UUT_->copy_(in, kInputStride, out, kOutputStride, NULL, 0, NULL, 0, |
| 559 | Width(), Height())); |
| 560 | |
| 561 | CheckGuardBlocks(); |
| 562 | |
| 563 | for (int y = 0; y < Height(); ++y) |
| 564 | for (int x = 0; x < Width(); ++x) |
| 565 | ASSERT_EQ(lookup(out, y * kOutputStride + x), |
| 566 | lookup(in, y * kInputStride + x)) |
| 567 | << "(" << x << "," << y << ")"; |
| 568 | } |
| 569 | |
| 570 | TEST_P(ConvolveTest, Avg) { |
| 571 | uint8_t* const in = input(); |
| 572 | uint8_t* const out = output(); |
| 573 | uint8_t* const out_ref = output_ref(); |
| 574 | CopyOutputToRef(); |
| 575 | |
| 576 | ASM_REGISTER_STATE_CHECK( |
| 577 | UUT_->avg_(in, kInputStride, out, kOutputStride, NULL, 0, NULL, 0, |
| 578 | Width(), Height())); |
| 579 | |
| 580 | CheckGuardBlocks(); |
| 581 | |
| 582 | for (int y = 0; y < Height(); ++y) |
| 583 | for (int x = 0; x < Width(); ++x) |
| 584 | ASSERT_EQ(lookup(out, y * kOutputStride + x), |
| 585 | ROUND_POWER_OF_TWO(lookup(in, y * kInputStride + x) + |
| 586 | lookup(out_ref, y * kOutputStride + x), 1)) |
| 587 | << "(" << x << "," << y << ")"; |
| 588 | } |
| 589 | |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 590 | TEST_P(ConvolveTest, CopyHoriz) { |
| 591 | uint8_t* const in = input(); |
| 592 | uint8_t* const out = output(); |
James Zern | e7b599f | 2013-06-17 23:11:01 -0700 | [diff] [blame] | 593 | DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0}; |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 594 | |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 595 | ASM_REGISTER_STATE_CHECK( |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 596 | UUT_->h8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, 16, |
| 597 | Width(), Height())); |
| 598 | |
| 599 | CheckGuardBlocks(); |
| 600 | |
| 601 | for (int y = 0; y < Height(); ++y) |
| 602 | for (int x = 0; x < Width(); ++x) |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 603 | ASSERT_EQ(lookup(out, y * kOutputStride + x), |
| 604 | lookup(in, y * kInputStride + x)) |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 605 | << "(" << x << "," << y << ")"; |
| 606 | } |
| 607 | |
| 608 | TEST_P(ConvolveTest, CopyVert) { |
| 609 | uint8_t* const in = input(); |
| 610 | uint8_t* const out = output(); |
James Zern | e7b599f | 2013-06-17 23:11:01 -0700 | [diff] [blame] | 611 | DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0}; |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 612 | |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 613 | ASM_REGISTER_STATE_CHECK( |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 614 | UUT_->v8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, 16, |
| 615 | Width(), Height())); |
| 616 | |
| 617 | CheckGuardBlocks(); |
| 618 | |
| 619 | for (int y = 0; y < Height(); ++y) |
| 620 | for (int x = 0; x < Width(); ++x) |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 621 | ASSERT_EQ(lookup(out, y * kOutputStride + x), |
| 622 | lookup(in, y * kInputStride + x)) |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 623 | << "(" << x << "," << y << ")"; |
| 624 | } |
| 625 | |
| 626 | TEST_P(ConvolveTest, Copy2D) { |
| 627 | uint8_t* const in = input(); |
| 628 | uint8_t* const out = output(); |
James Zern | e7b599f | 2013-06-17 23:11:01 -0700 | [diff] [blame] | 629 | DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0}; |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 630 | |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 631 | ASM_REGISTER_STATE_CHECK( |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 632 | UUT_->hv8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, 16, |
| 633 | Width(), Height())); |
| 634 | |
| 635 | CheckGuardBlocks(); |
| 636 | |
| 637 | for (int y = 0; y < Height(); ++y) |
| 638 | for (int x = 0; x < Width(); ++x) |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 639 | ASSERT_EQ(lookup(out, y * kOutputStride + x), |
| 640 | lookup(in, y * kInputStride + x)) |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 641 | << "(" << x << "," << y << ")"; |
| 642 | } |
| 643 | |
Dmitry Kovalev | 3d4ed27 | 2014-04-21 14:15:35 -0700 | [diff] [blame] | 644 | const int kNumFilterBanks = 4; |
John Koleszar | a9ebbcc | 2013-04-18 13:05:38 -0700 | [diff] [blame] | 645 | const int kNumFilters = 16; |
| 646 | |
| 647 | TEST(ConvolveTest, FiltersWontSaturateWhenAddedPairwise) { |
| 648 | for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) { |
Dmitry Kovalev | 3d4ed27 | 2014-04-21 14:15:35 -0700 | [diff] [blame] | 649 | const InterpKernel *filters = |
| 650 | vp9_get_interp_kernel(static_cast<INTERP_FILTER>(filter_bank)); |
John Koleszar | a9ebbcc | 2013-04-18 13:05:38 -0700 | [diff] [blame] | 651 | for (int i = 0; i < kNumFilters; i++) { |
| 652 | const int p0 = filters[i][0] + filters[i][1]; |
| 653 | const int p1 = filters[i][2] + filters[i][3]; |
| 654 | const int p2 = filters[i][4] + filters[i][5]; |
| 655 | const int p3 = filters[i][6] + filters[i][7]; |
| 656 | EXPECT_LE(p0, 128); |
| 657 | EXPECT_LE(p1, 128); |
| 658 | EXPECT_LE(p2, 128); |
| 659 | EXPECT_LE(p3, 128); |
| 660 | EXPECT_LE(p0 + p3, 128); |
| 661 | EXPECT_LE(p0 + p3 + p1, 128); |
| 662 | EXPECT_LE(p0 + p3 + p1 + p2, 128); |
| 663 | EXPECT_EQ(p0 + p1 + p2 + p3, 128); |
| 664 | } |
| 665 | } |
| 666 | } |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 667 | |
John Koleszar | 04c2407 | 2013-02-20 16:32:02 -0800 | [diff] [blame] | 668 | const int16_t kInvalidFilter[8] = { 0 }; |
| 669 | |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 670 | TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) { |
| 671 | uint8_t* const in = input(); |
| 672 | uint8_t* const out = output(); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 673 | #if CONFIG_VP9_HIGHBITDEPTH |
| 674 | uint8_t ref8[kOutputStride * kMaxDimension]; |
| 675 | uint16_t ref16[kOutputStride * kMaxDimension]; |
| 676 | uint8_t* ref; |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 677 | if (UUT_->use_highbd_ == 0) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 678 | ref = ref8; |
| 679 | } else { |
| 680 | ref = CONVERT_TO_BYTEPTR(ref16); |
| 681 | } |
| 682 | #else |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 683 | uint8_t ref[kOutputStride * kMaxDimension]; |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 684 | #endif |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 685 | |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 686 | for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) { |
Dmitry Kovalev | 3d4ed27 | 2014-04-21 14:15:35 -0700 | [diff] [blame] | 687 | const InterpKernel *filters = |
| 688 | vp9_get_interp_kernel(static_cast<INTERP_FILTER>(filter_bank)); |
Dmitry Kovalev | 021eaab | 2014-05-14 16:21:41 -0700 | [diff] [blame] | 689 | const InterpKernel *const eighttap_smooth = |
| 690 | vp9_get_interp_kernel(EIGHTTAP_SMOOTH); |
| 691 | |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 692 | for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) { |
| 693 | for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 694 | wrapper_filter_block2d_8_c(in, kInputStride, |
| 695 | filters[filter_x], filters[filter_y], |
| 696 | ref, kOutputStride, |
| 697 | Width(), Height()); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 698 | |
Dmitry Kovalev | 021eaab | 2014-05-14 16:21:41 -0700 | [diff] [blame] | 699 | if (filters == eighttap_smooth || (filter_x && filter_y)) |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 700 | ASM_REGISTER_STATE_CHECK( |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 701 | UUT_->hv8_(in, kInputStride, out, kOutputStride, |
| 702 | filters[filter_x], 16, filters[filter_y], 16, |
| 703 | Width(), Height())); |
| 704 | else if (filter_y) |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 705 | ASM_REGISTER_STATE_CHECK( |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 706 | UUT_->v8_(in, kInputStride, out, kOutputStride, |
John Koleszar | 04c2407 | 2013-02-20 16:32:02 -0800 | [diff] [blame] | 707 | kInvalidFilter, 16, filters[filter_y], 16, |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 708 | Width(), Height())); |
| 709 | else |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 710 | ASM_REGISTER_STATE_CHECK( |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 711 | UUT_->h8_(in, kInputStride, out, kOutputStride, |
John Koleszar | 04c2407 | 2013-02-20 16:32:02 -0800 | [diff] [blame] | 712 | filters[filter_x], 16, kInvalidFilter, 16, |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 713 | Width(), Height())); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 714 | |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 715 | CheckGuardBlocks(); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 716 | |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 717 | for (int y = 0; y < Height(); ++y) |
| 718 | for (int x = 0; x < Width(); ++x) |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 719 | ASSERT_EQ(lookup(ref, y * kOutputStride + x), |
| 720 | lookup(out, y * kOutputStride + x)) |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 721 | << "mismatch at (" << x << "," << y << "), " |
| 722 | << "filters (" << filter_bank << "," |
| 723 | << filter_x << "," << filter_y << ")"; |
| 724 | } |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 725 | } |
| 726 | } |
| 727 | } |
| 728 | |
| 729 | TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) { |
| 730 | uint8_t* const in = input(); |
| 731 | uint8_t* const out = output(); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 732 | #if CONFIG_VP9_HIGHBITDEPTH |
| 733 | uint8_t ref8[kOutputStride * kMaxDimension]; |
| 734 | uint16_t ref16[kOutputStride * kMaxDimension]; |
| 735 | uint8_t* ref; |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 736 | if (UUT_->use_highbd_ == 0) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 737 | ref = ref8; |
| 738 | } else { |
| 739 | ref = CONVERT_TO_BYTEPTR(ref16); |
| 740 | } |
| 741 | #else |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 742 | uint8_t ref[kOutputStride * kMaxDimension]; |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 743 | #endif |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 744 | |
| 745 | // Populate ref and out with some random data |
| 746 | ::libvpx_test::ACMRandom prng; |
| 747 | for (int y = 0; y < Height(); ++y) { |
| 748 | for (int x = 0; x < Width(); ++x) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 749 | uint16_t r; |
| 750 | #if CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 751 | if (UUT_->use_highbd_ == 0 || UUT_->use_highbd_ == 8) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 752 | r = prng.Rand8Extremes(); |
| 753 | } else { |
| 754 | r = prng.Rand16() & mask_; |
| 755 | } |
| 756 | #else |
| 757 | r = prng.Rand8Extremes(); |
| 758 | #endif |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 759 | |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 760 | assign_val(out, y * kOutputStride + x, r); |
| 761 | assign_val(ref, y * kOutputStride + x, r); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 762 | } |
| 763 | } |
| 764 | |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 765 | for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) { |
Dmitry Kovalev | 3d4ed27 | 2014-04-21 14:15:35 -0700 | [diff] [blame] | 766 | const InterpKernel *filters = |
| 767 | vp9_get_interp_kernel(static_cast<INTERP_FILTER>(filter_bank)); |
Dmitry Kovalev | 021eaab | 2014-05-14 16:21:41 -0700 | [diff] [blame] | 768 | const InterpKernel *const eighttap_smooth = |
| 769 | vp9_get_interp_kernel(EIGHTTAP_SMOOTH); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 770 | |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 771 | for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) { |
| 772 | for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 773 | wrapper_filter_average_block2d_8_c(in, kInputStride, |
| 774 | filters[filter_x], filters[filter_y], |
| 775 | ref, kOutputStride, |
| 776 | Width(), Height()); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 777 | |
Dmitry Kovalev | 021eaab | 2014-05-14 16:21:41 -0700 | [diff] [blame] | 778 | if (filters == eighttap_smooth || (filter_x && filter_y)) |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 779 | ASM_REGISTER_STATE_CHECK( |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 780 | UUT_->hv8_avg_(in, kInputStride, out, kOutputStride, |
| 781 | filters[filter_x], 16, filters[filter_y], 16, |
| 782 | Width(), Height())); |
| 783 | else if (filter_y) |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 784 | ASM_REGISTER_STATE_CHECK( |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 785 | UUT_->v8_avg_(in, kInputStride, out, kOutputStride, |
| 786 | filters[filter_x], 16, filters[filter_y], 16, |
| 787 | Width(), Height())); |
| 788 | else |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 789 | ASM_REGISTER_STATE_CHECK( |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 790 | UUT_->h8_avg_(in, kInputStride, out, kOutputStride, |
| 791 | filters[filter_x], 16, filters[filter_y], 16, |
| 792 | Width(), Height())); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 793 | |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 794 | CheckGuardBlocks(); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 795 | |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 796 | for (int y = 0; y < Height(); ++y) |
| 797 | for (int x = 0; x < Width(); ++x) |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 798 | ASSERT_EQ(lookup(ref, y * kOutputStride + x), |
| 799 | lookup(out, y * kOutputStride + x)) |
John Koleszar | 557a1b2 | 2013-02-20 16:13:01 -0800 | [diff] [blame] | 800 | << "mismatch at (" << x << "," << y << "), " |
| 801 | << "filters (" << filter_bank << "," |
| 802 | << filter_x << "," << filter_y << ")"; |
| 803 | } |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 804 | } |
| 805 | } |
| 806 | } |
| 807 | |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 808 | TEST_P(ConvolveTest, FilterExtremes) { |
| 809 | uint8_t *const in = input(); |
| 810 | uint8_t *const out = output(); |
| 811 | #if CONFIG_VP9_HIGHBITDEPTH |
| 812 | uint8_t ref8[kOutputStride * kMaxDimension]; |
| 813 | uint16_t ref16[kOutputStride * kMaxDimension]; |
| 814 | uint8_t *ref; |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 815 | if (UUT_->use_highbd_ == 0) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 816 | ref = ref8; |
| 817 | } else { |
| 818 | ref = CONVERT_TO_BYTEPTR(ref16); |
| 819 | } |
| 820 | #else |
| 821 | uint8_t ref[kOutputStride * kMaxDimension]; |
| 822 | #endif |
| 823 | |
| 824 | // Populate ref and out with some random data |
| 825 | ::libvpx_test::ACMRandom prng; |
| 826 | for (int y = 0; y < Height(); ++y) { |
| 827 | for (int x = 0; x < Width(); ++x) { |
| 828 | uint16_t r; |
| 829 | #if CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 830 | if (UUT_->use_highbd_ == 0 || UUT_->use_highbd_ == 8) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 831 | r = prng.Rand8Extremes(); |
| 832 | } else { |
| 833 | r = prng.Rand16() & mask_; |
| 834 | } |
| 835 | #else |
| 836 | r = prng.Rand8Extremes(); |
| 837 | #endif |
| 838 | assign_val(out, y * kOutputStride + x, r); |
| 839 | assign_val(ref, y * kOutputStride + x, r); |
| 840 | } |
| 841 | } |
| 842 | |
| 843 | for (int axis = 0; axis < 2; axis++) { |
| 844 | int seed_val = 0; |
| 845 | while (seed_val < 256) { |
| 846 | for (int y = 0; y < 8; ++y) { |
| 847 | for (int x = 0; x < 8; ++x) { |
| 848 | #if CONFIG_VP9_HIGHBITDEPTH |
| 849 | assign_val(in, y * kOutputStride + x - SUBPEL_TAPS / 2 + 1, |
| 850 | ((seed_val >> (axis ? y : x)) & 1) * mask_); |
| 851 | #else |
| 852 | assign_val(in, y * kOutputStride + x - SUBPEL_TAPS / 2 + 1, |
| 853 | ((seed_val >> (axis ? y : x)) & 1) * 255); |
| 854 | #endif |
| 855 | if (axis) seed_val++; |
| 856 | } |
| 857 | if (axis) |
| 858 | seed_val-= 8; |
| 859 | else |
| 860 | seed_val++; |
| 861 | } |
| 862 | if (axis) seed_val += 8; |
| 863 | |
| 864 | for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) { |
| 865 | const InterpKernel *filters = |
| 866 | vp9_get_interp_kernel(static_cast<INTERP_FILTER>(filter_bank)); |
| 867 | const InterpKernel *const eighttap_smooth = |
| 868 | vp9_get_interp_kernel(EIGHTTAP_SMOOTH); |
| 869 | for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) { |
| 870 | for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) { |
| 871 | wrapper_filter_block2d_8_c(in, kInputStride, |
| 872 | filters[filter_x], filters[filter_y], |
| 873 | ref, kOutputStride, |
| 874 | Width(), Height()); |
| 875 | if (filters == eighttap_smooth || (filter_x && filter_y)) |
| 876 | ASM_REGISTER_STATE_CHECK( |
| 877 | UUT_->hv8_(in, kInputStride, out, kOutputStride, |
| 878 | filters[filter_x], 16, filters[filter_y], 16, |
| 879 | Width(), Height())); |
| 880 | else if (filter_y) |
| 881 | ASM_REGISTER_STATE_CHECK( |
| 882 | UUT_->v8_(in, kInputStride, out, kOutputStride, |
| 883 | kInvalidFilter, 16, filters[filter_y], 16, |
| 884 | Width(), Height())); |
| 885 | else |
| 886 | ASM_REGISTER_STATE_CHECK( |
| 887 | UUT_->h8_(in, kInputStride, out, kOutputStride, |
| 888 | filters[filter_x], 16, kInvalidFilter, 16, |
| 889 | Width(), Height())); |
| 890 | |
| 891 | for (int y = 0; y < Height(); ++y) |
| 892 | for (int x = 0; x < Width(); ++x) |
| 893 | ASSERT_EQ(lookup(ref, y * kOutputStride + x), |
| 894 | lookup(out, y * kOutputStride + x)) |
| 895 | << "mismatch at (" << x << "," << y << "), " |
| 896 | << "filters (" << filter_bank << "," |
| 897 | << filter_x << "," << filter_y << ")"; |
| 898 | } |
| 899 | } |
| 900 | } |
| 901 | } |
| 902 | } |
| 903 | } |
| 904 | |
John Koleszar | 6fd7dd1 | 2013-02-20 15:59:20 -0800 | [diff] [blame] | 905 | DECLARE_ALIGNED(256, const int16_t, kChangeFilters[16][8]) = { |
| 906 | { 0, 0, 0, 0, 0, 0, 0, 128}, |
| 907 | { 0, 0, 0, 0, 0, 0, 128}, |
| 908 | { 0, 0, 0, 0, 0, 128}, |
| 909 | { 0, 0, 0, 0, 128}, |
| 910 | { 0, 0, 0, 128}, |
| 911 | { 0, 0, 128}, |
| 912 | { 0, 128}, |
| 913 | { 128}, |
| 914 | { 0, 0, 0, 0, 0, 0, 0, 128}, |
| 915 | { 0, 0, 0, 0, 0, 0, 128}, |
| 916 | { 0, 0, 0, 0, 0, 128}, |
| 917 | { 0, 0, 0, 0, 128}, |
| 918 | { 0, 0, 0, 128}, |
| 919 | { 0, 0, 128}, |
| 920 | { 0, 128}, |
| 921 | { 128} |
| 922 | }; |
| 923 | |
Adrian Grange | 3f10831 | 2013-08-22 16:02:18 -0700 | [diff] [blame] | 924 | /* This test exercises the horizontal and vertical filter functions. */ |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 925 | TEST_P(ConvolveTest, ChangeFilterWorks) { |
| 926 | uint8_t* const in = input(); |
| 927 | uint8_t* const out = output(); |
Adrian Grange | 3f10831 | 2013-08-22 16:02:18 -0700 | [diff] [blame] | 928 | |
| 929 | /* Assume that the first input sample is at the 8/16th position. */ |
| 930 | const int kInitialSubPelOffset = 8; |
| 931 | |
| 932 | /* Filters are 8-tap, so the first filter tap will be applied to the pixel |
| 933 | * at position -3 with respect to the current filtering position. Since |
| 934 | * kInitialSubPelOffset is set to 8, we first select sub-pixel filter 8, |
| 935 | * which is non-zero only in the last tap. So, applying the filter at the |
| 936 | * current input position will result in an output equal to the pixel at |
| 937 | * offset +4 (-3 + 7) with respect to the current filtering position. |
| 938 | */ |
John Koleszar | a9ebbcc | 2013-04-18 13:05:38 -0700 | [diff] [blame] | 939 | const int kPixelSelected = 4; |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 940 | |
Adrian Grange | 3f10831 | 2013-08-22 16:02:18 -0700 | [diff] [blame] | 941 | /* Assume that each output pixel requires us to step on by 17/16th pixels in |
| 942 | * the input. |
| 943 | */ |
| 944 | const int kInputPixelStep = 17; |
| 945 | |
| 946 | /* The filters are setup in such a way that the expected output produces |
| 947 | * sets of 8 identical output samples. As the filter position moves to the |
| 948 | * next 1/16th pixel position the only active (=128) filter tap moves one |
| 949 | * position to the left, resulting in the same input pixel being replicated |
| 950 | * in to the output for 8 consecutive samples. After each set of 8 positions |
| 951 | * the filters select a different input pixel. kFilterPeriodAdjust below |
| 952 | * computes which input pixel is written to the output for a specified |
| 953 | * x or y position. |
| 954 | */ |
| 955 | |
| 956 | /* Test the horizontal filter. */ |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 957 | ASM_REGISTER_STATE_CHECK( |
| 958 | UUT_->h8_(in, kInputStride, out, kOutputStride, |
| 959 | kChangeFilters[kInitialSubPelOffset], |
| 960 | kInputPixelStep, NULL, 0, Width(), Height())); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 961 | |
John Koleszar | 6fd7dd1 | 2013-02-20 15:59:20 -0800 | [diff] [blame] | 962 | for (int x = 0; x < Width(); ++x) { |
John Koleszar | a9ebbcc | 2013-04-18 13:05:38 -0700 | [diff] [blame] | 963 | const int kFilterPeriodAdjust = (x >> 3) << 3; |
Adrian Grange | 3f10831 | 2013-08-22 16:02:18 -0700 | [diff] [blame] | 964 | const int ref_x = |
| 965 | kPixelSelected + ((kInitialSubPelOffset |
| 966 | + kFilterPeriodAdjust * kInputPixelStep) |
| 967 | >> SUBPEL_BITS); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 968 | ASSERT_EQ(lookup(in, ref_x), lookup(out, x)) |
| 969 | << "x == " << x << "width = " << Width(); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 970 | } |
| 971 | |
Adrian Grange | 3f10831 | 2013-08-22 16:02:18 -0700 | [diff] [blame] | 972 | /* Test the vertical filter. */ |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 973 | ASM_REGISTER_STATE_CHECK( |
| 974 | UUT_->v8_(in, kInputStride, out, kOutputStride, |
| 975 | NULL, 0, kChangeFilters[kInitialSubPelOffset], |
| 976 | kInputPixelStep, Width(), Height())); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 977 | |
John Koleszar | 6fd7dd1 | 2013-02-20 15:59:20 -0800 | [diff] [blame] | 978 | for (int y = 0; y < Height(); ++y) { |
John Koleszar | a9ebbcc | 2013-04-18 13:05:38 -0700 | [diff] [blame] | 979 | const int kFilterPeriodAdjust = (y >> 3) << 3; |
Adrian Grange | 3f10831 | 2013-08-22 16:02:18 -0700 | [diff] [blame] | 980 | const int ref_y = |
| 981 | kPixelSelected + ((kInitialSubPelOffset |
| 982 | + kFilterPeriodAdjust * kInputPixelStep) |
| 983 | >> SUBPEL_BITS); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 984 | ASSERT_EQ(lookup(in, ref_y * kInputStride), lookup(out, y * kInputStride)) |
| 985 | << "y == " << y; |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 986 | } |
| 987 | |
Adrian Grange | 3f10831 | 2013-08-22 16:02:18 -0700 | [diff] [blame] | 988 | /* Test the horizontal and vertical filters in combination. */ |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 989 | ASM_REGISTER_STATE_CHECK( |
| 990 | UUT_->hv8_(in, kInputStride, out, kOutputStride, |
| 991 | kChangeFilters[kInitialSubPelOffset], kInputPixelStep, |
| 992 | kChangeFilters[kInitialSubPelOffset], kInputPixelStep, |
| 993 | Width(), Height())); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 994 | |
John Koleszar | 6fd7dd1 | 2013-02-20 15:59:20 -0800 | [diff] [blame] | 995 | for (int y = 0; y < Height(); ++y) { |
John Koleszar | a9ebbcc | 2013-04-18 13:05:38 -0700 | [diff] [blame] | 996 | const int kFilterPeriodAdjustY = (y >> 3) << 3; |
Adrian Grange | 3f10831 | 2013-08-22 16:02:18 -0700 | [diff] [blame] | 997 | const int ref_y = |
| 998 | kPixelSelected + ((kInitialSubPelOffset |
| 999 | + kFilterPeriodAdjustY * kInputPixelStep) |
| 1000 | >> SUBPEL_BITS); |
John Koleszar | 6fd7dd1 | 2013-02-20 15:59:20 -0800 | [diff] [blame] | 1001 | for (int x = 0; x < Width(); ++x) { |
John Koleszar | a9ebbcc | 2013-04-18 13:05:38 -0700 | [diff] [blame] | 1002 | const int kFilterPeriodAdjustX = (x >> 3) << 3; |
Adrian Grange | 3f10831 | 2013-08-22 16:02:18 -0700 | [diff] [blame] | 1003 | const int ref_x = |
| 1004 | kPixelSelected + ((kInitialSubPelOffset |
| 1005 | + kFilterPeriodAdjustX * kInputPixelStep) |
| 1006 | >> SUBPEL_BITS); |
John Koleszar | 6fd7dd1 | 2013-02-20 15:59:20 -0800 | [diff] [blame] | 1007 | |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1008 | ASSERT_EQ(lookup(in, ref_y * kInputStride + ref_x), |
| 1009 | lookup(out, y * kOutputStride + x)) |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 1010 | << "x == " << x << ", y == " << y; |
| 1011 | } |
| 1012 | } |
| 1013 | } |
| 1014 | |
Tero Rintaluoma | e326cec | 2013-08-22 11:29:19 +0300 | [diff] [blame] | 1015 | /* This test exercises that enough rows and columns are filtered with every |
| 1016 | possible initial fractional positions and scaling steps. */ |
| 1017 | TEST_P(ConvolveTest, CheckScalingFiltering) { |
| 1018 | uint8_t* const in = input(); |
| 1019 | uint8_t* const out = output(); |
Dmitry Kovalev | 021eaab | 2014-05-14 16:21:41 -0700 | [diff] [blame] | 1020 | const InterpKernel *const eighttap = vp9_get_interp_kernel(EIGHTTAP); |
Tero Rintaluoma | e326cec | 2013-08-22 11:29:19 +0300 | [diff] [blame] | 1021 | |
| 1022 | SetConstantInput(127); |
| 1023 | |
| 1024 | for (int frac = 0; frac < 16; ++frac) { |
| 1025 | for (int step = 1; step <= 32; ++step) { |
| 1026 | /* Test the horizontal and vertical filters in combination. */ |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 1027 | ASM_REGISTER_STATE_CHECK(UUT_->hv8_(in, kInputStride, out, kOutputStride, |
| 1028 | eighttap[frac], step, |
| 1029 | eighttap[frac], step, |
| 1030 | Width(), Height())); |
Tero Rintaluoma | e326cec | 2013-08-22 11:29:19 +0300 | [diff] [blame] | 1031 | |
| 1032 | CheckGuardBlocks(); |
| 1033 | |
| 1034 | for (int y = 0; y < Height(); ++y) { |
| 1035 | for (int x = 0; x < Width(); ++x) { |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1036 | ASSERT_EQ(lookup(in, y * kInputStride + x), |
| 1037 | lookup(out, y * kOutputStride + x)) |
Tero Rintaluoma | e326cec | 2013-08-22 11:29:19 +0300 | [diff] [blame] | 1038 | << "x == " << x << ", y == " << y |
| 1039 | << ", frac == " << frac << ", step == " << step; |
| 1040 | } |
| 1041 | } |
| 1042 | } |
| 1043 | } |
| 1044 | } |
| 1045 | |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 1046 | using std::tr1::make_tuple; |
| 1047 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 1048 | #if CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1049 | #if HAVE_SSE2 && ARCH_X86_64 |
| 1050 | void wrap_convolve8_horiz_sse2_8(const uint8_t *src, ptrdiff_t src_stride, |
| 1051 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1052 | const int16_t *filter_x, |
| 1053 | int filter_x_stride, |
| 1054 | const int16_t *filter_y, |
| 1055 | int filter_y_stride, |
| 1056 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1057 | vp9_highbd_convolve8_horiz_sse2(src, src_stride, dst, dst_stride, filter_x, |
| 1058 | filter_x_stride, filter_y, filter_y_stride, |
| 1059 | w, h, 8); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1060 | } |
| 1061 | |
| 1062 | void wrap_convolve8_avg_horiz_sse2_8(const uint8_t *src, ptrdiff_t src_stride, |
| 1063 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1064 | const int16_t *filter_x, |
| 1065 | int filter_x_stride, |
| 1066 | const int16_t *filter_y, |
| 1067 | int filter_y_stride, |
| 1068 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1069 | vp9_highbd_convolve8_avg_horiz_sse2(src, src_stride, dst, dst_stride, |
| 1070 | filter_x, filter_x_stride, |
| 1071 | filter_y, filter_y_stride, w, h, 8); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1072 | } |
| 1073 | |
| 1074 | void wrap_convolve8_vert_sse2_8(const uint8_t *src, ptrdiff_t src_stride, |
| 1075 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1076 | const int16_t *filter_x, |
| 1077 | int filter_x_stride, |
| 1078 | const int16_t *filter_y, |
| 1079 | int filter_y_stride, |
| 1080 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1081 | vp9_highbd_convolve8_vert_sse2(src, src_stride, dst, dst_stride, |
| 1082 | filter_x, filter_x_stride, |
| 1083 | filter_y, filter_y_stride, w, h, 8); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1084 | } |
| 1085 | |
| 1086 | void wrap_convolve8_avg_vert_sse2_8(const uint8_t *src, ptrdiff_t src_stride, |
| 1087 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1088 | const int16_t *filter_x, |
| 1089 | int filter_x_stride, |
| 1090 | const int16_t *filter_y, |
| 1091 | int filter_y_stride, |
| 1092 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1093 | vp9_highbd_convolve8_avg_vert_sse2(src, src_stride, dst, dst_stride, |
| 1094 | filter_x, filter_x_stride, |
| 1095 | filter_y, filter_y_stride, w, h, 8); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1096 | } |
| 1097 | |
| 1098 | void wrap_convolve8_sse2_8(const uint8_t *src, ptrdiff_t src_stride, |
| 1099 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1100 | const int16_t *filter_x, |
| 1101 | int filter_x_stride, |
| 1102 | const int16_t *filter_y, |
| 1103 | int filter_y_stride, |
| 1104 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1105 | vp9_highbd_convolve8_sse2(src, src_stride, dst, dst_stride, |
| 1106 | filter_x, filter_x_stride, |
| 1107 | filter_y, filter_y_stride, w, h, 8); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1108 | } |
| 1109 | |
| 1110 | void wrap_convolve8_avg_sse2_8(const uint8_t *src, ptrdiff_t src_stride, |
| 1111 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1112 | const int16_t *filter_x, |
| 1113 | int filter_x_stride, |
| 1114 | const int16_t *filter_y, |
| 1115 | int filter_y_stride, |
| 1116 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1117 | vp9_highbd_convolve8_avg_sse2(src, src_stride, dst, dst_stride, |
| 1118 | filter_x, filter_x_stride, |
| 1119 | filter_y, filter_y_stride, w, h, 8); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1120 | } |
| 1121 | |
| 1122 | void wrap_convolve8_horiz_sse2_10(const uint8_t *src, ptrdiff_t src_stride, |
| 1123 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1124 | const int16_t *filter_x, |
| 1125 | int filter_x_stride, |
| 1126 | const int16_t *filter_y, |
| 1127 | int filter_y_stride, |
| 1128 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1129 | vp9_highbd_convolve8_horiz_sse2(src, src_stride, dst, dst_stride, |
| 1130 | filter_x, filter_x_stride, |
| 1131 | filter_y, filter_y_stride, w, h, 10); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1132 | } |
| 1133 | |
| 1134 | void wrap_convolve8_avg_horiz_sse2_10(const uint8_t *src, ptrdiff_t src_stride, |
| 1135 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1136 | const int16_t *filter_x, |
| 1137 | int filter_x_stride, |
| 1138 | const int16_t *filter_y, |
| 1139 | int filter_y_stride, |
| 1140 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1141 | vp9_highbd_convolve8_avg_horiz_sse2(src, src_stride, dst, dst_stride, |
| 1142 | filter_x, filter_x_stride, |
| 1143 | filter_y, filter_y_stride, w, h, 10); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1144 | } |
| 1145 | |
| 1146 | void wrap_convolve8_vert_sse2_10(const uint8_t *src, ptrdiff_t src_stride, |
| 1147 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1148 | const int16_t *filter_x, |
| 1149 | int filter_x_stride, |
| 1150 | const int16_t *filter_y, |
| 1151 | int filter_y_stride, |
| 1152 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1153 | vp9_highbd_convolve8_vert_sse2(src, src_stride, dst, dst_stride, |
| 1154 | filter_x, filter_x_stride, |
| 1155 | filter_y, filter_y_stride, w, h, 10); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1156 | } |
| 1157 | |
| 1158 | void wrap_convolve8_avg_vert_sse2_10(const uint8_t *src, ptrdiff_t src_stride, |
| 1159 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1160 | const int16_t *filter_x, |
| 1161 | int filter_x_stride, |
| 1162 | const int16_t *filter_y, |
| 1163 | int filter_y_stride, |
| 1164 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1165 | vp9_highbd_convolve8_avg_vert_sse2(src, src_stride, dst, dst_stride, |
| 1166 | filter_x, filter_x_stride, |
| 1167 | filter_y, filter_y_stride, w, h, 10); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1168 | } |
| 1169 | |
| 1170 | void wrap_convolve8_sse2_10(const uint8_t *src, ptrdiff_t src_stride, |
| 1171 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1172 | const int16_t *filter_x, |
| 1173 | int filter_x_stride, |
| 1174 | const int16_t *filter_y, |
| 1175 | int filter_y_stride, |
| 1176 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1177 | vp9_highbd_convolve8_sse2(src, src_stride, dst, dst_stride, |
| 1178 | filter_x, filter_x_stride, |
| 1179 | filter_y, filter_y_stride, w, h, 10); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1180 | } |
| 1181 | |
| 1182 | void wrap_convolve8_avg_sse2_10(const uint8_t *src, ptrdiff_t src_stride, |
| 1183 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1184 | const int16_t *filter_x, |
| 1185 | int filter_x_stride, |
| 1186 | const int16_t *filter_y, |
| 1187 | int filter_y_stride, |
| 1188 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1189 | vp9_highbd_convolve8_avg_sse2(src, src_stride, dst, dst_stride, |
| 1190 | filter_x, filter_x_stride, |
| 1191 | filter_y, filter_y_stride, w, h, 10); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1192 | } |
| 1193 | |
| 1194 | void wrap_convolve8_horiz_sse2_12(const uint8_t *src, ptrdiff_t src_stride, |
| 1195 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1196 | const int16_t *filter_x, |
| 1197 | int filter_x_stride, |
| 1198 | const int16_t *filter_y, |
| 1199 | int filter_y_stride, |
| 1200 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1201 | vp9_highbd_convolve8_horiz_sse2(src, src_stride, dst, dst_stride, |
| 1202 | filter_x, filter_x_stride, |
| 1203 | filter_y, filter_y_stride, w, h, 12); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1204 | } |
| 1205 | |
| 1206 | void wrap_convolve8_avg_horiz_sse2_12(const uint8_t *src, ptrdiff_t src_stride, |
| 1207 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1208 | const int16_t *filter_x, |
| 1209 | int filter_x_stride, |
| 1210 | const int16_t *filter_y, |
| 1211 | int filter_y_stride, |
| 1212 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1213 | vp9_highbd_convolve8_avg_horiz_sse2(src, src_stride, dst, dst_stride, |
| 1214 | filter_x, filter_x_stride, |
| 1215 | filter_y, filter_y_stride, w, h, 12); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1216 | } |
| 1217 | |
| 1218 | void wrap_convolve8_vert_sse2_12(const uint8_t *src, ptrdiff_t src_stride, |
| 1219 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1220 | const int16_t *filter_x, |
| 1221 | int filter_x_stride, |
| 1222 | const int16_t *filter_y, |
| 1223 | int filter_y_stride, |
| 1224 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1225 | vp9_highbd_convolve8_vert_sse2(src, src_stride, dst, dst_stride, |
| 1226 | filter_x, filter_x_stride, |
| 1227 | filter_y, filter_y_stride, w, h, 12); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1228 | } |
| 1229 | |
| 1230 | void wrap_convolve8_avg_vert_sse2_12(const uint8_t *src, ptrdiff_t src_stride, |
| 1231 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1232 | const int16_t *filter_x, |
| 1233 | int filter_x_stride, |
| 1234 | const int16_t *filter_y, |
| 1235 | int filter_y_stride, |
| 1236 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1237 | vp9_highbd_convolve8_avg_vert_sse2(src, src_stride, dst, dst_stride, |
| 1238 | filter_x, filter_x_stride, |
| 1239 | filter_y, filter_y_stride, w, h, 12); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1240 | } |
| 1241 | |
| 1242 | void wrap_convolve8_sse2_12(const uint8_t *src, ptrdiff_t src_stride, |
| 1243 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1244 | const int16_t *filter_x, |
| 1245 | int filter_x_stride, |
| 1246 | const int16_t *filter_y, |
| 1247 | int filter_y_stride, |
| 1248 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1249 | vp9_highbd_convolve8_sse2(src, src_stride, dst, dst_stride, |
| 1250 | filter_x, filter_x_stride, |
| 1251 | filter_y, filter_y_stride, w, h, 12); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1252 | } |
| 1253 | |
| 1254 | void wrap_convolve8_avg_sse2_12(const uint8_t *src, ptrdiff_t src_stride, |
| 1255 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1256 | const int16_t *filter_x, |
| 1257 | int filter_x_stride, |
| 1258 | const int16_t *filter_y, |
| 1259 | int filter_y_stride, |
| 1260 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1261 | vp9_highbd_convolve8_avg_sse2(src, src_stride, dst, dst_stride, |
| 1262 | filter_x, filter_x_stride, |
| 1263 | filter_y, filter_y_stride, w, h, 12); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1264 | } |
| 1265 | #endif // HAVE_SSE2 && ARCH_X86_64 |
| 1266 | |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1267 | void wrap_convolve_copy_c_8(const uint8_t *src, ptrdiff_t src_stride, |
| 1268 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1269 | const int16_t *filter_x, |
| 1270 | int filter_x_stride, |
| 1271 | const int16_t *filter_y, |
| 1272 | int filter_y_stride, |
| 1273 | int w, int h) { |
| 1274 | vp9_highbd_convolve_copy_c(src, src_stride, dst, dst_stride, |
| 1275 | filter_x, filter_x_stride, |
| 1276 | filter_y, filter_y_stride, w, h, 8); |
| 1277 | } |
| 1278 | |
| 1279 | void wrap_convolve_avg_c_8(const uint8_t *src, ptrdiff_t src_stride, |
| 1280 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1281 | const int16_t *filter_x, |
| 1282 | int filter_x_stride, |
| 1283 | const int16_t *filter_y, |
| 1284 | int filter_y_stride, |
| 1285 | int w, int h) { |
| 1286 | vp9_highbd_convolve_avg_c(src, src_stride, dst, dst_stride, |
| 1287 | filter_x, filter_x_stride, |
| 1288 | filter_y, filter_y_stride, w, h, 8); |
| 1289 | } |
| 1290 | |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1291 | void wrap_convolve8_horiz_c_8(const uint8_t *src, ptrdiff_t src_stride, |
| 1292 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1293 | const int16_t *filter_x, |
| 1294 | int filter_x_stride, |
| 1295 | const int16_t *filter_y, |
| 1296 | int filter_y_stride, |
| 1297 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1298 | vp9_highbd_convolve8_horiz_c(src, src_stride, dst, dst_stride, |
| 1299 | filter_x, filter_x_stride, |
| 1300 | filter_y, filter_y_stride, w, h, 8); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1301 | } |
| 1302 | |
| 1303 | void wrap_convolve8_avg_horiz_c_8(const uint8_t *src, ptrdiff_t src_stride, |
| 1304 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1305 | const int16_t *filter_x, |
| 1306 | int filter_x_stride, |
| 1307 | const int16_t *filter_y, |
| 1308 | int filter_y_stride, |
| 1309 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1310 | vp9_highbd_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride, |
| 1311 | filter_x, filter_x_stride, |
| 1312 | filter_y, filter_y_stride, w, h, 8); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1313 | } |
| 1314 | |
| 1315 | void wrap_convolve8_vert_c_8(const uint8_t *src, ptrdiff_t src_stride, |
| 1316 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1317 | const int16_t *filter_x, |
| 1318 | int filter_x_stride, |
| 1319 | const int16_t *filter_y, |
| 1320 | int filter_y_stride, |
| 1321 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1322 | vp9_highbd_convolve8_vert_c(src, src_stride, dst, dst_stride, |
| 1323 | filter_x, filter_x_stride, |
| 1324 | filter_y, filter_y_stride, w, h, 8); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1325 | } |
| 1326 | |
| 1327 | void wrap_convolve8_avg_vert_c_8(const uint8_t *src, ptrdiff_t src_stride, |
| 1328 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1329 | const int16_t *filter_x, |
| 1330 | int filter_x_stride, |
| 1331 | const int16_t *filter_y, |
| 1332 | int filter_y_stride, |
| 1333 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1334 | vp9_highbd_convolve8_avg_vert_c(src, src_stride, dst, dst_stride, |
| 1335 | filter_x, filter_x_stride, |
| 1336 | filter_y, filter_y_stride, w, h, 8); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1337 | } |
| 1338 | |
| 1339 | void wrap_convolve8_c_8(const uint8_t *src, ptrdiff_t src_stride, |
| 1340 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1341 | const int16_t *filter_x, |
| 1342 | int filter_x_stride, |
| 1343 | const int16_t *filter_y, |
| 1344 | int filter_y_stride, |
| 1345 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1346 | vp9_highbd_convolve8_c(src, src_stride, dst, dst_stride, |
| 1347 | filter_x, filter_x_stride, |
| 1348 | filter_y, filter_y_stride, w, h, 8); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1349 | } |
| 1350 | |
| 1351 | void wrap_convolve8_avg_c_8(const uint8_t *src, ptrdiff_t src_stride, |
| 1352 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1353 | const int16_t *filter_x, |
| 1354 | int filter_x_stride, |
| 1355 | const int16_t *filter_y, |
| 1356 | int filter_y_stride, |
| 1357 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1358 | vp9_highbd_convolve8_avg_c(src, src_stride, dst, dst_stride, |
| 1359 | filter_x, filter_x_stride, |
| 1360 | filter_y, filter_y_stride, w, h, 8); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1361 | } |
| 1362 | |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1363 | void wrap_convolve_copy_c_10(const uint8_t *src, ptrdiff_t src_stride, |
| 1364 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1365 | const int16_t *filter_x, |
| 1366 | int filter_x_stride, |
| 1367 | const int16_t *filter_y, |
| 1368 | int filter_y_stride, |
| 1369 | int w, int h) { |
| 1370 | vp9_highbd_convolve_copy_c(src, src_stride, dst, dst_stride, |
| 1371 | filter_x, filter_x_stride, |
| 1372 | filter_y, filter_y_stride, w, h, 10); |
| 1373 | } |
| 1374 | |
| 1375 | void wrap_convolve_avg_c_10(const uint8_t *src, ptrdiff_t src_stride, |
| 1376 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1377 | const int16_t *filter_x, |
| 1378 | int filter_x_stride, |
| 1379 | const int16_t *filter_y, |
| 1380 | int filter_y_stride, |
| 1381 | int w, int h) { |
| 1382 | vp9_highbd_convolve_avg_c(src, src_stride, dst, dst_stride, |
| 1383 | filter_x, filter_x_stride, |
| 1384 | filter_y, filter_y_stride, w, h, 10); |
| 1385 | } |
| 1386 | |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1387 | void wrap_convolve8_horiz_c_10(const uint8_t *src, ptrdiff_t src_stride, |
| 1388 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1389 | const int16_t *filter_x, |
| 1390 | int filter_x_stride, |
| 1391 | const int16_t *filter_y, |
| 1392 | int filter_y_stride, |
| 1393 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1394 | vp9_highbd_convolve8_horiz_c(src, src_stride, dst, dst_stride, |
| 1395 | filter_x, filter_x_stride, |
| 1396 | filter_y, filter_y_stride, w, h, 10); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1397 | } |
| 1398 | |
| 1399 | void wrap_convolve8_avg_horiz_c_10(const uint8_t *src, ptrdiff_t src_stride, |
| 1400 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1401 | const int16_t *filter_x, |
| 1402 | int filter_x_stride, |
| 1403 | const int16_t *filter_y, |
| 1404 | int filter_y_stride, |
| 1405 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1406 | vp9_highbd_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride, |
| 1407 | filter_x, filter_x_stride, |
| 1408 | filter_y, filter_y_stride, w, h, 10); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1409 | } |
| 1410 | |
| 1411 | void wrap_convolve8_vert_c_10(const uint8_t *src, ptrdiff_t src_stride, |
| 1412 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1413 | const int16_t *filter_x, |
| 1414 | int filter_x_stride, |
| 1415 | const int16_t *filter_y, |
| 1416 | int filter_y_stride, |
| 1417 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1418 | vp9_highbd_convolve8_vert_c(src, src_stride, dst, dst_stride, |
| 1419 | filter_x, filter_x_stride, |
| 1420 | filter_y, filter_y_stride, w, h, 10); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1421 | } |
| 1422 | |
| 1423 | void wrap_convolve8_avg_vert_c_10(const uint8_t *src, ptrdiff_t src_stride, |
| 1424 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1425 | const int16_t *filter_x, |
| 1426 | int filter_x_stride, |
| 1427 | const int16_t *filter_y, |
| 1428 | int filter_y_stride, |
| 1429 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1430 | vp9_highbd_convolve8_avg_vert_c(src, src_stride, dst, dst_stride, |
| 1431 | filter_x, filter_x_stride, |
| 1432 | filter_y, filter_y_stride, w, h, 10); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1433 | } |
| 1434 | |
| 1435 | void wrap_convolve8_c_10(const uint8_t *src, ptrdiff_t src_stride, |
| 1436 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1437 | const int16_t *filter_x, |
| 1438 | int filter_x_stride, |
| 1439 | const int16_t *filter_y, |
| 1440 | int filter_y_stride, |
| 1441 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1442 | vp9_highbd_convolve8_c(src, src_stride, dst, dst_stride, |
| 1443 | filter_x, filter_x_stride, |
| 1444 | filter_y, filter_y_stride, w, h, 10); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1445 | } |
| 1446 | |
| 1447 | void wrap_convolve8_avg_c_10(const uint8_t *src, ptrdiff_t src_stride, |
| 1448 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1449 | const int16_t *filter_x, |
| 1450 | int filter_x_stride, |
| 1451 | const int16_t *filter_y, |
| 1452 | int filter_y_stride, |
| 1453 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1454 | vp9_highbd_convolve8_avg_c(src, src_stride, dst, dst_stride, |
| 1455 | filter_x, filter_x_stride, |
| 1456 | filter_y, filter_y_stride, w, h, 10); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1457 | } |
| 1458 | |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1459 | void wrap_convolve_copy_c_12(const uint8_t *src, ptrdiff_t src_stride, |
| 1460 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1461 | const int16_t *filter_x, |
| 1462 | int filter_x_stride, |
| 1463 | const int16_t *filter_y, |
| 1464 | int filter_y_stride, |
| 1465 | int w, int h) { |
| 1466 | vp9_highbd_convolve_copy_c(src, src_stride, dst, dst_stride, |
| 1467 | filter_x, filter_x_stride, |
| 1468 | filter_y, filter_y_stride, w, h, 12); |
| 1469 | } |
| 1470 | |
| 1471 | void wrap_convolve_avg_c_12(const uint8_t *src, ptrdiff_t src_stride, |
| 1472 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1473 | const int16_t *filter_x, |
| 1474 | int filter_x_stride, |
| 1475 | const int16_t *filter_y, |
| 1476 | int filter_y_stride, |
| 1477 | int w, int h) { |
| 1478 | vp9_highbd_convolve_avg_c(src, src_stride, dst, dst_stride, |
| 1479 | filter_x, filter_x_stride, |
| 1480 | filter_y, filter_y_stride, w, h, 12); |
| 1481 | } |
| 1482 | |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1483 | void wrap_convolve8_horiz_c_12(const uint8_t *src, ptrdiff_t src_stride, |
| 1484 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1485 | const int16_t *filter_x, |
| 1486 | int filter_x_stride, |
| 1487 | const int16_t *filter_y, |
| 1488 | int filter_y_stride, |
| 1489 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1490 | vp9_highbd_convolve8_horiz_c(src, src_stride, dst, dst_stride, |
| 1491 | filter_x, filter_x_stride, |
| 1492 | filter_y, filter_y_stride, w, h, 12); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1493 | } |
| 1494 | |
| 1495 | void wrap_convolve8_avg_horiz_c_12(const uint8_t *src, ptrdiff_t src_stride, |
| 1496 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1497 | const int16_t *filter_x, |
| 1498 | int filter_x_stride, |
| 1499 | const int16_t *filter_y, |
| 1500 | int filter_y_stride, |
| 1501 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1502 | vp9_highbd_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride, |
| 1503 | filter_x, filter_x_stride, |
| 1504 | filter_y, filter_y_stride, w, h, 12); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1505 | } |
| 1506 | |
| 1507 | void wrap_convolve8_vert_c_12(const uint8_t *src, ptrdiff_t src_stride, |
| 1508 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1509 | const int16_t *filter_x, |
| 1510 | int filter_x_stride, |
| 1511 | const int16_t *filter_y, |
| 1512 | int filter_y_stride, |
| 1513 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1514 | vp9_highbd_convolve8_vert_c(src, src_stride, dst, dst_stride, |
| 1515 | filter_x, filter_x_stride, |
| 1516 | filter_y, filter_y_stride, w, h, 12); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1517 | } |
| 1518 | |
| 1519 | void wrap_convolve8_avg_vert_c_12(const uint8_t *src, ptrdiff_t src_stride, |
| 1520 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1521 | const int16_t *filter_x, |
| 1522 | int filter_x_stride, |
| 1523 | const int16_t *filter_y, |
| 1524 | int filter_y_stride, |
| 1525 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1526 | vp9_highbd_convolve8_avg_vert_c(src, src_stride, dst, dst_stride, |
| 1527 | filter_x, filter_x_stride, |
| 1528 | filter_y, filter_y_stride, w, h, 12); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1529 | } |
| 1530 | |
| 1531 | void wrap_convolve8_c_12(const uint8_t *src, ptrdiff_t src_stride, |
| 1532 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1533 | const int16_t *filter_x, |
| 1534 | int filter_x_stride, |
| 1535 | const int16_t *filter_y, |
| 1536 | int filter_y_stride, |
| 1537 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1538 | vp9_highbd_convolve8_c(src, src_stride, dst, dst_stride, |
| 1539 | filter_x, filter_x_stride, |
| 1540 | filter_y, filter_y_stride, w, h, 12); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1541 | } |
| 1542 | |
| 1543 | void wrap_convolve8_avg_c_12(const uint8_t *src, ptrdiff_t src_stride, |
| 1544 | uint8_t *dst, ptrdiff_t dst_stride, |
| 1545 | const int16_t *filter_x, |
| 1546 | int filter_x_stride, |
| 1547 | const int16_t *filter_y, |
| 1548 | int filter_y_stride, |
| 1549 | int w, int h) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 1550 | vp9_highbd_convolve8_avg_c(src, src_stride, dst, dst_stride, |
| 1551 | filter_x, filter_x_stride, |
| 1552 | filter_y, filter_y_stride, w, h, 12); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1553 | } |
| 1554 | |
| 1555 | const ConvolveFunctions convolve8_c( |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1556 | wrap_convolve_copy_c_8, wrap_convolve_avg_c_8, |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1557 | wrap_convolve8_horiz_c_8, wrap_convolve8_avg_horiz_c_8, |
| 1558 | wrap_convolve8_vert_c_8, wrap_convolve8_avg_vert_c_8, |
| 1559 | wrap_convolve8_c_8, wrap_convolve8_avg_c_8, 8); |
| 1560 | INSTANTIATE_TEST_CASE_P(C_8, ConvolveTest, ::testing::Values( |
| 1561 | make_tuple(4, 4, &convolve8_c), |
| 1562 | make_tuple(8, 4, &convolve8_c), |
| 1563 | make_tuple(4, 8, &convolve8_c), |
| 1564 | make_tuple(8, 8, &convolve8_c), |
| 1565 | make_tuple(16, 8, &convolve8_c), |
| 1566 | make_tuple(8, 16, &convolve8_c), |
| 1567 | make_tuple(16, 16, &convolve8_c), |
| 1568 | make_tuple(32, 16, &convolve8_c), |
| 1569 | make_tuple(16, 32, &convolve8_c), |
| 1570 | make_tuple(32, 32, &convolve8_c), |
| 1571 | make_tuple(64, 32, &convolve8_c), |
| 1572 | make_tuple(32, 64, &convolve8_c), |
| 1573 | make_tuple(64, 64, &convolve8_c))); |
| 1574 | const ConvolveFunctions convolve10_c( |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1575 | wrap_convolve_copy_c_10, wrap_convolve_avg_c_10, |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1576 | wrap_convolve8_horiz_c_10, wrap_convolve8_avg_horiz_c_10, |
| 1577 | wrap_convolve8_vert_c_10, wrap_convolve8_avg_vert_c_10, |
| 1578 | wrap_convolve8_c_10, wrap_convolve8_avg_c_10, 10); |
| 1579 | INSTANTIATE_TEST_CASE_P(C_10, ConvolveTest, ::testing::Values( |
| 1580 | make_tuple(4, 4, &convolve10_c), |
| 1581 | make_tuple(8, 4, &convolve10_c), |
| 1582 | make_tuple(4, 8, &convolve10_c), |
| 1583 | make_tuple(8, 8, &convolve10_c), |
| 1584 | make_tuple(16, 8, &convolve10_c), |
| 1585 | make_tuple(8, 16, &convolve10_c), |
| 1586 | make_tuple(16, 16, &convolve10_c), |
| 1587 | make_tuple(32, 16, &convolve10_c), |
| 1588 | make_tuple(16, 32, &convolve10_c), |
| 1589 | make_tuple(32, 32, &convolve10_c), |
| 1590 | make_tuple(64, 32, &convolve10_c), |
| 1591 | make_tuple(32, 64, &convolve10_c), |
| 1592 | make_tuple(64, 64, &convolve10_c))); |
| 1593 | const ConvolveFunctions convolve12_c( |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1594 | wrap_convolve_copy_c_12, wrap_convolve_avg_c_12, |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1595 | wrap_convolve8_horiz_c_12, wrap_convolve8_avg_horiz_c_12, |
| 1596 | wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12, |
| 1597 | wrap_convolve8_c_12, wrap_convolve8_avg_c_12, 12); |
| 1598 | INSTANTIATE_TEST_CASE_P(C_12, ConvolveTest, ::testing::Values( |
| 1599 | make_tuple(4, 4, &convolve12_c), |
| 1600 | make_tuple(8, 4, &convolve12_c), |
| 1601 | make_tuple(4, 8, &convolve12_c), |
| 1602 | make_tuple(8, 8, &convolve12_c), |
| 1603 | make_tuple(16, 8, &convolve12_c), |
| 1604 | make_tuple(8, 16, &convolve12_c), |
| 1605 | make_tuple(16, 16, &convolve12_c), |
| 1606 | make_tuple(32, 16, &convolve12_c), |
| 1607 | make_tuple(16, 32, &convolve12_c), |
| 1608 | make_tuple(32, 32, &convolve12_c), |
| 1609 | make_tuple(64, 32, &convolve12_c), |
| 1610 | make_tuple(32, 64, &convolve12_c), |
| 1611 | make_tuple(64, 64, &convolve12_c))); |
| 1612 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 1613 | #else |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1614 | |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 1615 | const ConvolveFunctions convolve8_c( |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1616 | vp9_convolve_copy_c, vp9_convolve_avg_c, |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 1617 | vp9_convolve8_horiz_c, vp9_convolve8_avg_horiz_c, |
| 1618 | vp9_convolve8_vert_c, vp9_convolve8_avg_vert_c, |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1619 | vp9_convolve8_c, vp9_convolve8_avg_c, 0); |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 1620 | |
| 1621 | INSTANTIATE_TEST_CASE_P(C, ConvolveTest, ::testing::Values( |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 1622 | make_tuple(4, 4, &convolve8_c), |
| 1623 | make_tuple(8, 4, &convolve8_c), |
John Koleszar | a9ebbcc | 2013-04-18 13:05:38 -0700 | [diff] [blame] | 1624 | make_tuple(4, 8, &convolve8_c), |
John Koleszar | 5ca6a36 | 2013-01-25 09:47:09 -0800 | [diff] [blame] | 1625 | make_tuple(8, 8, &convolve8_c), |
John Koleszar | 6a4f708 | 2013-02-08 17:49:44 -0800 | [diff] [blame] | 1626 | make_tuple(16, 8, &convolve8_c), |
John Koleszar | a9ebbcc | 2013-04-18 13:05:38 -0700 | [diff] [blame] | 1627 | make_tuple(8, 16, &convolve8_c), |
| 1628 | make_tuple(16, 16, &convolve8_c), |
| 1629 | make_tuple(32, 16, &convolve8_c), |
| 1630 | make_tuple(16, 32, &convolve8_c), |
| 1631 | make_tuple(32, 32, &convolve8_c), |
| 1632 | make_tuple(64, 32, &convolve8_c), |
| 1633 | make_tuple(32, 64, &convolve8_c), |
| 1634 | make_tuple(64, 64, &convolve8_c))); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 1635 | #endif |
John Koleszar | 29d47ac | 2013-02-07 17:00:37 -0800 | [diff] [blame] | 1636 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 1637 | #if HAVE_SSE2 && ARCH_X86_64 |
| 1638 | #if CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1639 | const ConvolveFunctions convolve8_sse2( |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1640 | wrap_convolve_copy_c_8, wrap_convolve_avg_c_8, |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1641 | wrap_convolve8_horiz_sse2_8, wrap_convolve8_avg_horiz_sse2_8, |
| 1642 | wrap_convolve8_vert_sse2_8, wrap_convolve8_avg_vert_sse2_8, |
| 1643 | wrap_convolve8_sse2_8, wrap_convolve8_avg_sse2_8, 8); |
Deb Mukherjee | 27dce0f | 2014-11-07 10:19:46 -0800 | [diff] [blame] | 1644 | const ConvolveFunctions convolve10_sse2( |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1645 | wrap_convolve_copy_c_10, wrap_convolve_avg_c_10, |
Deb Mukherjee | 27dce0f | 2014-11-07 10:19:46 -0800 | [diff] [blame] | 1646 | wrap_convolve8_horiz_sse2_10, wrap_convolve8_avg_horiz_sse2_10, |
| 1647 | wrap_convolve8_vert_sse2_10, wrap_convolve8_avg_vert_sse2_10, |
| 1648 | wrap_convolve8_sse2_10, wrap_convolve8_avg_sse2_10, 10); |
| 1649 | const ConvolveFunctions convolve12_sse2( |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1650 | wrap_convolve_copy_c_12, wrap_convolve_avg_c_12, |
Deb Mukherjee | 27dce0f | 2014-11-07 10:19:46 -0800 | [diff] [blame] | 1651 | wrap_convolve8_horiz_sse2_12, wrap_convolve8_avg_horiz_sse2_12, |
| 1652 | wrap_convolve8_vert_sse2_12, wrap_convolve8_avg_vert_sse2_12, |
| 1653 | wrap_convolve8_sse2_12, wrap_convolve8_avg_sse2_12, 12); |
| 1654 | INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values( |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1655 | make_tuple(4, 4, &convolve8_sse2), |
| 1656 | make_tuple(8, 4, &convolve8_sse2), |
| 1657 | make_tuple(4, 8, &convolve8_sse2), |
| 1658 | make_tuple(8, 8, &convolve8_sse2), |
| 1659 | make_tuple(16, 8, &convolve8_sse2), |
| 1660 | make_tuple(8, 16, &convolve8_sse2), |
| 1661 | make_tuple(16, 16, &convolve8_sse2), |
| 1662 | make_tuple(32, 16, &convolve8_sse2), |
| 1663 | make_tuple(16, 32, &convolve8_sse2), |
| 1664 | make_tuple(32, 32, &convolve8_sse2), |
| 1665 | make_tuple(64, 32, &convolve8_sse2), |
| 1666 | make_tuple(32, 64, &convolve8_sse2), |
Deb Mukherjee | 27dce0f | 2014-11-07 10:19:46 -0800 | [diff] [blame] | 1667 | make_tuple(64, 64, &convolve8_sse2), |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1668 | make_tuple(4, 4, &convolve10_sse2), |
| 1669 | make_tuple(8, 4, &convolve10_sse2), |
| 1670 | make_tuple(4, 8, &convolve10_sse2), |
| 1671 | make_tuple(8, 8, &convolve10_sse2), |
| 1672 | make_tuple(16, 8, &convolve10_sse2), |
| 1673 | make_tuple(8, 16, &convolve10_sse2), |
| 1674 | make_tuple(16, 16, &convolve10_sse2), |
| 1675 | make_tuple(32, 16, &convolve10_sse2), |
| 1676 | make_tuple(16, 32, &convolve10_sse2), |
| 1677 | make_tuple(32, 32, &convolve10_sse2), |
| 1678 | make_tuple(64, 32, &convolve10_sse2), |
| 1679 | make_tuple(32, 64, &convolve10_sse2), |
Deb Mukherjee | 27dce0f | 2014-11-07 10:19:46 -0800 | [diff] [blame] | 1680 | make_tuple(64, 64, &convolve10_sse2), |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1681 | make_tuple(4, 4, &convolve12_sse2), |
| 1682 | make_tuple(8, 4, &convolve12_sse2), |
| 1683 | make_tuple(4, 8, &convolve12_sse2), |
| 1684 | make_tuple(8, 8, &convolve12_sse2), |
| 1685 | make_tuple(16, 8, &convolve12_sse2), |
| 1686 | make_tuple(8, 16, &convolve12_sse2), |
| 1687 | make_tuple(16, 16, &convolve12_sse2), |
| 1688 | make_tuple(32, 16, &convolve12_sse2), |
| 1689 | make_tuple(16, 32, &convolve12_sse2), |
| 1690 | make_tuple(32, 32, &convolve12_sse2), |
| 1691 | make_tuple(64, 32, &convolve12_sse2), |
| 1692 | make_tuple(32, 64, &convolve12_sse2), |
| 1693 | make_tuple(64, 64, &convolve12_sse2))); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 1694 | #else |
Yunqing Wang | 3fb728c | 2013-10-10 13:51:35 -0700 | [diff] [blame] | 1695 | const ConvolveFunctions convolve8_sse2( |
Johann | ff8505a | 2015-06-29 16:44:30 -0700 | [diff] [blame^] | 1696 | #if CONFIG_USE_X86INC |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1697 | vp9_convolve_copy_sse2, vp9_convolve_avg_sse2, |
Johann | ff8505a | 2015-06-29 16:44:30 -0700 | [diff] [blame^] | 1698 | #else |
| 1699 | vp9_convolve_copy_c, vp9_convolve_avg_c, |
| 1700 | #endif // CONFIG_USE_X86INC |
Yunqing Wang | 3fb728c | 2013-10-10 13:51:35 -0700 | [diff] [blame] | 1701 | vp9_convolve8_horiz_sse2, vp9_convolve8_avg_horiz_sse2, |
| 1702 | vp9_convolve8_vert_sse2, vp9_convolve8_avg_vert_sse2, |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1703 | vp9_convolve8_sse2, vp9_convolve8_avg_sse2, 0); |
Yunqing Wang | 3fb728c | 2013-10-10 13:51:35 -0700 | [diff] [blame] | 1704 | |
| 1705 | INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values( |
| 1706 | make_tuple(4, 4, &convolve8_sse2), |
| 1707 | make_tuple(8, 4, &convolve8_sse2), |
| 1708 | make_tuple(4, 8, &convolve8_sse2), |
| 1709 | make_tuple(8, 8, &convolve8_sse2), |
| 1710 | make_tuple(16, 8, &convolve8_sse2), |
| 1711 | make_tuple(8, 16, &convolve8_sse2), |
| 1712 | make_tuple(16, 16, &convolve8_sse2), |
| 1713 | make_tuple(32, 16, &convolve8_sse2), |
| 1714 | make_tuple(16, 32, &convolve8_sse2), |
| 1715 | make_tuple(32, 32, &convolve8_sse2), |
| 1716 | make_tuple(64, 32, &convolve8_sse2), |
| 1717 | make_tuple(32, 64, &convolve8_sse2), |
| 1718 | make_tuple(64, 64, &convolve8_sse2))); |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1719 | #endif // CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 1720 | #endif |
Yunqing Wang | 3fb728c | 2013-10-10 13:51:35 -0700 | [diff] [blame] | 1721 | |
John Koleszar | 29d47ac | 2013-02-07 17:00:37 -0800 | [diff] [blame] | 1722 | #if HAVE_SSSE3 |
| 1723 | const ConvolveFunctions convolve8_ssse3( |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1724 | vp9_convolve_copy_c, vp9_convolve_avg_c, |
Jim Bankoski | c3809f3 | 2013-08-05 12:07:30 -0700 | [diff] [blame] | 1725 | vp9_convolve8_horiz_ssse3, vp9_convolve8_avg_horiz_ssse3, |
| 1726 | vp9_convolve8_vert_ssse3, vp9_convolve8_avg_vert_ssse3, |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1727 | vp9_convolve8_ssse3, vp9_convolve8_avg_ssse3, 0); |
John Koleszar | 29d47ac | 2013-02-07 17:00:37 -0800 | [diff] [blame] | 1728 | |
| 1729 | INSTANTIATE_TEST_CASE_P(SSSE3, ConvolveTest, ::testing::Values( |
| 1730 | make_tuple(4, 4, &convolve8_ssse3), |
| 1731 | make_tuple(8, 4, &convolve8_ssse3), |
John Koleszar | a9ebbcc | 2013-04-18 13:05:38 -0700 | [diff] [blame] | 1732 | make_tuple(4, 8, &convolve8_ssse3), |
John Koleszar | 29d47ac | 2013-02-07 17:00:37 -0800 | [diff] [blame] | 1733 | make_tuple(8, 8, &convolve8_ssse3), |
John Koleszar | 6a4f708 | 2013-02-08 17:49:44 -0800 | [diff] [blame] | 1734 | make_tuple(16, 8, &convolve8_ssse3), |
John Koleszar | a9ebbcc | 2013-04-18 13:05:38 -0700 | [diff] [blame] | 1735 | make_tuple(8, 16, &convolve8_ssse3), |
| 1736 | make_tuple(16, 16, &convolve8_ssse3), |
| 1737 | make_tuple(32, 16, &convolve8_ssse3), |
| 1738 | make_tuple(16, 32, &convolve8_ssse3), |
| 1739 | make_tuple(32, 32, &convolve8_ssse3), |
| 1740 | make_tuple(64, 32, &convolve8_ssse3), |
| 1741 | make_tuple(32, 64, &convolve8_ssse3), |
| 1742 | make_tuple(64, 64, &convolve8_ssse3))); |
John Koleszar | 29d47ac | 2013-02-07 17:00:37 -0800 | [diff] [blame] | 1743 | #endif |
Johann | 158c80c | 2013-05-23 12:50:41 -0700 | [diff] [blame] | 1744 | |
Johann | 8645a53 | 2014-09-10 10:27:58 -0700 | [diff] [blame] | 1745 | #if HAVE_AVX2 && HAVE_SSSE3 |
Yunqing Wang | 4f0943b | 2014-05-27 10:36:56 -0700 | [diff] [blame] | 1746 | const ConvolveFunctions convolve8_avx2( |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1747 | vp9_convolve_copy_c, vp9_convolve_avg_c, |
Yunqing Wang | 4f0943b | 2014-05-27 10:36:56 -0700 | [diff] [blame] | 1748 | vp9_convolve8_horiz_avx2, vp9_convolve8_avg_horiz_ssse3, |
| 1749 | vp9_convolve8_vert_avx2, vp9_convolve8_avg_vert_ssse3, |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1750 | vp9_convolve8_avx2, vp9_convolve8_avg_ssse3, 0); |
Yunqing Wang | 4f0943b | 2014-05-27 10:36:56 -0700 | [diff] [blame] | 1751 | |
| 1752 | INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest, ::testing::Values( |
| 1753 | make_tuple(4, 4, &convolve8_avx2), |
| 1754 | make_tuple(8, 4, &convolve8_avx2), |
| 1755 | make_tuple(4, 8, &convolve8_avx2), |
| 1756 | make_tuple(8, 8, &convolve8_avx2), |
levytamar82 | 839911f | 2014-07-27 16:45:55 -0700 | [diff] [blame] | 1757 | make_tuple(8, 16, &convolve8_avx2), |
Yunqing Wang | 4f0943b | 2014-05-27 10:36:56 -0700 | [diff] [blame] | 1758 | make_tuple(16, 8, &convolve8_avx2), |
Yunqing Wang | 4f0943b | 2014-05-27 10:36:56 -0700 | [diff] [blame] | 1759 | make_tuple(16, 16, &convolve8_avx2), |
| 1760 | make_tuple(32, 16, &convolve8_avx2), |
| 1761 | make_tuple(16, 32, &convolve8_avx2), |
| 1762 | make_tuple(32, 32, &convolve8_avx2), |
| 1763 | make_tuple(64, 32, &convolve8_avx2), |
| 1764 | make_tuple(32, 64, &convolve8_avx2), |
| 1765 | make_tuple(64, 64, &convolve8_avx2))); |
Johann | 8645a53 | 2014-09-10 10:27:58 -0700 | [diff] [blame] | 1766 | #endif // HAVE_AVX2 && HAVE_SSSE3 |
Yunqing Wang | 4f0943b | 2014-05-27 10:36:56 -0700 | [diff] [blame] | 1767 | |
Scott LaVarnway | 617382a | 2014-09-10 09:49:34 -0700 | [diff] [blame] | 1768 | #if HAVE_NEON |
Johann | ce23931 | 2014-05-07 11:01:31 -0700 | [diff] [blame] | 1769 | #if HAVE_NEON_ASM |
Johann | 158c80c | 2013-05-23 12:50:41 -0700 | [diff] [blame] | 1770 | const ConvolveFunctions convolve8_neon( |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1771 | vp9_convolve_copy_neon, vp9_convolve_avg_neon, |
Johann | a15bebf | 2013-07-12 16:12:58 -0700 | [diff] [blame] | 1772 | vp9_convolve8_horiz_neon, vp9_convolve8_avg_horiz_neon, |
| 1773 | vp9_convolve8_vert_neon, vp9_convolve8_avg_vert_neon, |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1774 | vp9_convolve8_neon, vp9_convolve8_avg_neon, 0); |
Scott LaVarnway | 617382a | 2014-09-10 09:49:34 -0700 | [diff] [blame] | 1775 | #else // HAVE_NEON |
| 1776 | const ConvolveFunctions convolve8_neon( |
James Yu | d12757f | 2014-01-21 17:23:27 +0800 | [diff] [blame] | 1777 | vp9_convolve_copy_neon, vp9_convolve_avg_neon, |
James Yu | 01fc6f5 | 2014-01-29 23:12:41 +0800 | [diff] [blame] | 1778 | vp9_convolve8_horiz_neon, vp9_convolve8_avg_horiz_neon, |
| 1779 | vp9_convolve8_vert_neon, vp9_convolve8_avg_vert_neon, |
| 1780 | vp9_convolve8_neon, vp9_convolve8_avg_neon, 0); |
Scott LaVarnway | 617382a | 2014-09-10 09:49:34 -0700 | [diff] [blame] | 1781 | #endif // HAVE_NEON_ASM |
Johann | 158c80c | 2013-05-23 12:50:41 -0700 | [diff] [blame] | 1782 | |
| 1783 | INSTANTIATE_TEST_CASE_P(NEON, ConvolveTest, ::testing::Values( |
| 1784 | make_tuple(4, 4, &convolve8_neon), |
| 1785 | make_tuple(8, 4, &convolve8_neon), |
| 1786 | make_tuple(4, 8, &convolve8_neon), |
| 1787 | make_tuple(8, 8, &convolve8_neon), |
| 1788 | make_tuple(16, 8, &convolve8_neon), |
| 1789 | make_tuple(8, 16, &convolve8_neon), |
| 1790 | make_tuple(16, 16, &convolve8_neon), |
| 1791 | make_tuple(32, 16, &convolve8_neon), |
| 1792 | make_tuple(16, 32, &convolve8_neon), |
| 1793 | make_tuple(32, 32, &convolve8_neon), |
| 1794 | make_tuple(64, 32, &convolve8_neon), |
| 1795 | make_tuple(32, 64, &convolve8_neon), |
| 1796 | make_tuple(64, 64, &convolve8_neon))); |
Scott LaVarnway | 617382a | 2014-09-10 09:49:34 -0700 | [diff] [blame] | 1797 | #endif // HAVE_NEON |
Parag Salasakar | 40edab5 | 2013-09-13 15:18:32 +0530 | [diff] [blame] | 1798 | |
| 1799 | #if HAVE_DSPR2 |
| 1800 | const ConvolveFunctions convolve8_dspr2( |
Johann | 1c3594c | 2014-12-09 12:05:15 -0800 | [diff] [blame] | 1801 | vp9_convolve_copy_dspr2, vp9_convolve_avg_dspr2, |
Parag Salasakar | 40edab5 | 2013-09-13 15:18:32 +0530 | [diff] [blame] | 1802 | vp9_convolve8_horiz_dspr2, vp9_convolve8_avg_horiz_dspr2, |
| 1803 | vp9_convolve8_vert_dspr2, vp9_convolve8_avg_vert_dspr2, |
Deb Mukherjee | 0d3c3d3 | 2014-09-16 12:47:18 -0700 | [diff] [blame] | 1804 | vp9_convolve8_dspr2, vp9_convolve8_avg_dspr2, 0); |
Parag Salasakar | 40edab5 | 2013-09-13 15:18:32 +0530 | [diff] [blame] | 1805 | |
| 1806 | INSTANTIATE_TEST_CASE_P(DSPR2, ConvolveTest, ::testing::Values( |
| 1807 | make_tuple(4, 4, &convolve8_dspr2), |
| 1808 | make_tuple(8, 4, &convolve8_dspr2), |
| 1809 | make_tuple(4, 8, &convolve8_dspr2), |
| 1810 | make_tuple(8, 8, &convolve8_dspr2), |
| 1811 | make_tuple(16, 8, &convolve8_dspr2), |
| 1812 | make_tuple(8, 16, &convolve8_dspr2), |
| 1813 | make_tuple(16, 16, &convolve8_dspr2), |
| 1814 | make_tuple(32, 16, &convolve8_dspr2), |
| 1815 | make_tuple(16, 32, &convolve8_dspr2), |
| 1816 | make_tuple(32, 32, &convolve8_dspr2), |
| 1817 | make_tuple(64, 32, &convolve8_dspr2), |
| 1818 | make_tuple(32, 64, &convolve8_dspr2), |
| 1819 | make_tuple(64, 64, &convolve8_dspr2))); |
| 1820 | #endif |
Parag Salasakar | 27d083c | 2015-04-16 11:03:24 +0530 | [diff] [blame] | 1821 | |
Parag Salasakar | ebf7466 | 2015-06-02 10:29:56 +0530 | [diff] [blame] | 1822 | #if HAVE_MSA |
Parag Salasakar | 27d083c | 2015-04-16 11:03:24 +0530 | [diff] [blame] | 1823 | const ConvolveFunctions convolve8_msa( |
Parag Salasakar | 2301d10 | 2015-04-27 12:26:10 +0530 | [diff] [blame] | 1824 | vp9_convolve_copy_msa, vp9_convolve_avg_msa, |
Parag Salasakar | b8c1cdc | 2015-06-03 11:33:42 +0530 | [diff] [blame] | 1825 | vp9_convolve8_horiz_msa, vp9_convolve8_avg_horiz_msa, |
Parag Salasakar | c543d38 | 2015-06-03 09:55:25 +0530 | [diff] [blame] | 1826 | vp9_convolve8_vert_msa, vp9_convolve8_avg_vert_msa, |
Parag Salasakar | bdfbc3e | 2015-06-04 08:11:01 +0530 | [diff] [blame] | 1827 | vp9_convolve8_msa, vp9_convolve8_avg_msa, 0); |
Parag Salasakar | 27d083c | 2015-04-16 11:03:24 +0530 | [diff] [blame] | 1828 | |
| 1829 | INSTANTIATE_TEST_CASE_P(MSA, ConvolveTest, ::testing::Values( |
| 1830 | make_tuple(4, 4, &convolve8_msa), |
| 1831 | make_tuple(8, 4, &convolve8_msa), |
| 1832 | make_tuple(4, 8, &convolve8_msa), |
| 1833 | make_tuple(8, 8, &convolve8_msa), |
| 1834 | make_tuple(16, 8, &convolve8_msa), |
| 1835 | make_tuple(8, 16, &convolve8_msa), |
| 1836 | make_tuple(16, 16, &convolve8_msa), |
| 1837 | make_tuple(32, 16, &convolve8_msa), |
| 1838 | make_tuple(16, 32, &convolve8_msa), |
| 1839 | make_tuple(32, 32, &convolve8_msa), |
| 1840 | make_tuple(64, 32, &convolve8_msa), |
| 1841 | make_tuple(32, 64, &convolve8_msa), |
| 1842 | make_tuple(64, 64, &convolve8_msa))); |
| 1843 | #endif // HAVE_MSA |
James Zern | 8fb48af | 2013-05-02 13:08:19 -0700 | [diff] [blame] | 1844 | } // namespace |