blob: 962d24402348db10d69ba2e07de38f4e9dd69462 [file] [log] [blame]
Yi Luo229690a2016-06-13 17:01:17 -07001/*
Yaowu Xu2ab7ff02016-09-02 12:04:54 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Yi Luo229690a2016-06-13 17:01:17 -07003 *
Yaowu Xu2ab7ff02016-09-02 12:04:54 -07004 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 * Media Patent License 1.0 was not distributed with this source code in the
9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
Yi Luo229690a2016-06-13 17:01:17 -070010 */
11
Tom Finegan7a07ece2017-02-07 17:14:05 -080012#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
Yi Luo229690a2016-06-13 17:01:17 -070013
Yaowu Xuf883b422016-08-30 14:01:10 -070014#include "./av1_rtcd.h"
Yi Luo229690a2016-06-13 17:01:17 -070015#include "test/acm_random.h"
16#include "test/clear_system_state.h"
17#include "test/register_state_check.h"
18#include "test/util.h"
19
20namespace {
21
22using std::tr1::tuple;
Yaowu Xuc27fc142016-08-22 16:08:15 -070023using libaom_test::ACMRandom;
Yi Luo229690a2016-06-13 17:01:17 -070024
Angie Chiangb2ff17f2017-01-11 17:30:20 -080025typedef void (*ConvInit)();
clang-format3a826f12016-08-11 17:46:05 -070026typedef void (*conv_filter_t)(const uint8_t *, int, uint8_t *, int, int, int,
Angie Chiang674bffd2017-01-11 16:15:55 -080027 const InterpFilterParams, const int, int,
28 ConvolveParams *);
Yaowu Xuf883b422016-08-30 14:01:10 -070029#if CONFIG_AOM_HIGHBITDEPTH
clang-format3a826f12016-08-11 17:46:05 -070030typedef void (*hbd_conv_filter_t)(const uint16_t *, int, uint16_t *, int, int,
31 int, const InterpFilterParams, const int, int,
32 int, int);
Yi Luo8cacca72016-07-08 15:41:59 -070033#endif
34
Yi Luo229690a2016-06-13 17:01:17 -070035// Test parameter list:
Yi Luo81ad9532016-06-21 12:17:39 -070036// <convolve_horiz_func, convolve_vert_func,
37// <width, height>, filter_params, subpel_x_q4, avg>
Yi Luo229690a2016-06-13 17:01:17 -070038typedef tuple<int, int> BlockDimension;
Angie Chiangb2ff17f2017-01-11 17:30:20 -080039typedef tuple<ConvInit, conv_filter_t, conv_filter_t, BlockDimension,
40 InterpFilter, int, int>
clang-format67948d32016-09-07 22:40:40 -070041 ConvParams;
Yaowu Xuf883b422016-08-30 14:01:10 -070042#if CONFIG_AOM_HIGHBITDEPTH
Yi Luo8cacca72016-07-08 15:41:59 -070043// Test parameter list:
44// <convolve_horiz_func, convolve_vert_func,
45// <width, height>, filter_params, subpel_x_q4, avg, bit_dpeth>
46typedef tuple<hbd_conv_filter_t, hbd_conv_filter_t, BlockDimension,
clang-format67948d32016-09-07 22:40:40 -070047 InterpFilter, int, int, int>
48 HbdConvParams;
Yi Luo8cacca72016-07-08 15:41:59 -070049#endif
Yi Luo229690a2016-06-13 17:01:17 -070050
51// Note:
52// src_ and src_ref_ have special boundary requirement
53// dst_ and dst_ref_ don't
54const size_t maxWidth = 256;
55const size_t maxHeight = 256;
56const size_t maxBlockSize = maxWidth * maxHeight;
57const int horizOffset = 32;
58const int vertiOffset = 32;
59const int stride = 128;
60const int x_step_q4 = 16;
61
Yaowu Xuf883b422016-08-30 14:01:10 -070062class AV1ConvolveOptimzTest : public ::testing::TestWithParam<ConvParams> {
Yi Luo229690a2016-06-13 17:01:17 -070063 public:
Yaowu Xuf883b422016-08-30 14:01:10 -070064 virtual ~AV1ConvolveOptimzTest() {}
Yi Luo229690a2016-06-13 17:01:17 -070065 virtual void SetUp() {
Angie Chiangb2ff17f2017-01-11 17:30:20 -080066 ConvInit conv_init = GET_PARAM(0);
67 conv_init();
68 conv_horiz_ = GET_PARAM(1);
69 conv_vert_ = GET_PARAM(2);
70 BlockDimension block = GET_PARAM(3);
Yi Luo229690a2016-06-13 17:01:17 -070071 width_ = std::tr1::get<0>(block);
72 height_ = std::tr1::get<1>(block);
Angie Chiangb2ff17f2017-01-11 17:30:20 -080073 filter_ = GET_PARAM(4);
74 subpel_ = GET_PARAM(5);
Angie Chiang9f45bc42017-01-13 16:27:54 -080075 int ref = GET_PARAM(6);
Angie Chiange3a4c1c2017-02-10 16:26:49 -080076 const int plane = 0;
77 conv_params_ = get_conv_params(ref, plane);
Yi Luo229690a2016-06-13 17:01:17 -070078
79 alloc_ = new uint8_t[maxBlockSize * 4];
80 src_ = alloc_ + (vertiOffset * maxWidth);
81 src_ += horizOffset;
82 src_ref_ = src_ + maxBlockSize;
83
84 dst_ = alloc_ + 2 * maxBlockSize;
85 dst_ref_ = alloc_ + 3 * maxBlockSize;
86 }
87
88 virtual void TearDown() {
89 delete[] alloc_;
Yaowu Xuc27fc142016-08-22 16:08:15 -070090 libaom_test::ClearSystemState();
Yi Luo229690a2016-06-13 17:01:17 -070091 }
92
93 protected:
94 void RunHorizFilterBitExactCheck();
Yi Luo81ad9532016-06-21 12:17:39 -070095 void RunVertFilterBitExactCheck();
Yi Luo229690a2016-06-13 17:01:17 -070096
97 private:
Urvang Joshid71a2312016-07-14 12:33:48 -070098 void PrepFilterBuffer();
Yi Luo8cacca72016-07-08 15:41:59 -070099 void DiffFilterBuffer();
Yi Luo81ad9532016-06-21 12:17:39 -0700100 conv_filter_t conv_horiz_;
101 conv_filter_t conv_vert_;
Yi Luo229690a2016-06-13 17:01:17 -0700102 uint8_t *alloc_;
103 uint8_t *src_;
104 uint8_t *dst_;
105 uint8_t *src_ref_;
106 uint8_t *dst_ref_;
107 int width_;
108 int height_;
Urvang Joshia9b174b2017-02-17 11:50:12 -0800109 InterpFilter filter_;
Yi Luo229690a2016-06-13 17:01:17 -0700110 int subpel_;
Angie Chiang674bffd2017-01-11 16:15:55 -0800111 ConvolveParams conv_params_;
Yi Luo229690a2016-06-13 17:01:17 -0700112};
113
Urvang Joshid71a2312016-07-14 12:33:48 -0700114void AV1ConvolveOptimzTest::PrepFilterBuffer() {
Yi Luo229690a2016-06-13 17:01:17 -0700115 int r, c;
116 ACMRandom rnd(ACMRandom::DeterministicSeed());
117
Yi Luo81ad9532016-06-21 12:17:39 -0700118 memset(alloc_, 0, 4 * maxBlockSize * sizeof(alloc_[0]));
Yi Luo229690a2016-06-13 17:01:17 -0700119
Yi Luo8cacca72016-07-08 15:41:59 -0700120 uint8_t *src_ptr = src_;
121 uint8_t *dst_ptr = dst_;
122 uint8_t *src_ref_ptr = src_ref_;
123 uint8_t *dst_ref_ptr = dst_ref_;
Yi Luo229690a2016-06-13 17:01:17 -0700124
125 for (r = 0; r < height_; ++r) {
126 for (c = 0; c < width_; ++c) {
127 src_ptr[c] = rnd.Rand8();
128 src_ref_ptr[c] = src_ptr[c];
129 dst_ptr[c] = rnd.Rand8();
130 dst_ref_ptr[c] = dst_ptr[c];
131 }
132 src_ptr += stride;
133 src_ref_ptr += stride;
134 dst_ptr += stride;
135 dst_ref_ptr += stride;
136 }
137}
138
Yaowu Xuf883b422016-08-30 14:01:10 -0700139void AV1ConvolveOptimzTest::DiffFilterBuffer() {
Yi Luo229690a2016-06-13 17:01:17 -0700140 int r, c;
Yi Luo8cacca72016-07-08 15:41:59 -0700141 const uint8_t *dst_ptr = dst_;
142 const uint8_t *dst_ref_ptr = dst_ref_;
143 for (r = 0; r < height_; ++r) {
144 for (c = 0; c < width_; ++c) {
Yi Luo229690a2016-06-13 17:01:17 -0700145 EXPECT_EQ((uint8_t)dst_ref_ptr[c], (uint8_t)dst_ptr[c])
clang-format3a826f12016-08-11 17:46:05 -0700146 << "Error at row: " << r << " col: " << c << " "
147 << "w = " << width_ << " "
148 << "h = " << height_ << " "
149 << "filter group index = " << filter_ << " "
150 << "filter index = " << subpel_;
Yi Luo229690a2016-06-13 17:01:17 -0700151 }
152 dst_ptr += stride;
153 dst_ref_ptr += stride;
154 }
155}
156
Yaowu Xuf883b422016-08-30 14:01:10 -0700157void AV1ConvolveOptimzTest::RunHorizFilterBitExactCheck() {
Urvang Joshid71a2312016-07-14 12:33:48 -0700158 PrepFilterBuffer();
Yi Luo229690a2016-06-13 17:01:17 -0700159
Yaowu Xuf883b422016-08-30 14:01:10 -0700160 InterpFilterParams filter_params = av1_get_interp_filter_params(filter_);
Yi Luo229690a2016-06-13 17:01:17 -0700161
Yaowu Xuf883b422016-08-30 14:01:10 -0700162 av1_convolve_horiz_c(src_ref_, stride, dst_ref_, stride, width_, height_,
Angie Chiang674bffd2017-01-11 16:15:55 -0800163 filter_params, subpel_, x_step_q4, &conv_params_);
Yi Luo229690a2016-06-13 17:01:17 -0700164
clang-format3a826f12016-08-11 17:46:05 -0700165 conv_horiz_(src_, stride, dst_, stride, width_, height_, filter_params,
Angie Chiang674bffd2017-01-11 16:15:55 -0800166 subpel_, x_step_q4, &conv_params_);
Yi Luo229690a2016-06-13 17:01:17 -0700167
Yi Luo8cacca72016-07-08 15:41:59 -0700168 DiffFilterBuffer();
Yi Luo229690a2016-06-13 17:01:17 -0700169
170 // Note:
171 // Here we need calculate a height which is different from the specified one
172 // and test again.
173 int intermediate_height =
174 (((height_ - 1) * 16 + subpel_) >> SUBPEL_BITS) + filter_params.taps;
Urvang Joshid71a2312016-07-14 12:33:48 -0700175 PrepFilterBuffer();
Yi Luo229690a2016-06-13 17:01:17 -0700176
Yaowu Xuf883b422016-08-30 14:01:10 -0700177 av1_convolve_horiz_c(src_ref_, stride, dst_ref_, stride, width_,
178 intermediate_height, filter_params, subpel_, x_step_q4,
Angie Chiang674bffd2017-01-11 16:15:55 -0800179 &conv_params_);
Yi Luo229690a2016-06-13 17:01:17 -0700180
clang-format3a826f12016-08-11 17:46:05 -0700181 conv_horiz_(src_, stride, dst_, stride, width_, intermediate_height,
Angie Chiang674bffd2017-01-11 16:15:55 -0800182 filter_params, subpel_, x_step_q4, &conv_params_);
Yi Luo229690a2016-06-13 17:01:17 -0700183
Yi Luo8cacca72016-07-08 15:41:59 -0700184 DiffFilterBuffer();
Yi Luo229690a2016-06-13 17:01:17 -0700185}
186
Yaowu Xuf883b422016-08-30 14:01:10 -0700187void AV1ConvolveOptimzTest::RunVertFilterBitExactCheck() {
Urvang Joshid71a2312016-07-14 12:33:48 -0700188 PrepFilterBuffer();
Yi Luo81ad9532016-06-21 12:17:39 -0700189
Yaowu Xuf883b422016-08-30 14:01:10 -0700190 InterpFilterParams filter_params = av1_get_interp_filter_params(filter_);
Yi Luo81ad9532016-06-21 12:17:39 -0700191
Yaowu Xuf883b422016-08-30 14:01:10 -0700192 av1_convolve_vert_c(src_ref_, stride, dst_ref_, stride, width_, height_,
Angie Chiang674bffd2017-01-11 16:15:55 -0800193 filter_params, subpel_, x_step_q4, &conv_params_);
Yi Luo81ad9532016-06-21 12:17:39 -0700194
clang-format3a826f12016-08-11 17:46:05 -0700195 conv_vert_(src_, stride, dst_, stride, width_, height_, filter_params,
Angie Chiang674bffd2017-01-11 16:15:55 -0800196 subpel_, x_step_q4, &conv_params_);
Yi Luo81ad9532016-06-21 12:17:39 -0700197
Yi Luo8cacca72016-07-08 15:41:59 -0700198 DiffFilterBuffer();
Yi Luo81ad9532016-06-21 12:17:39 -0700199}
200
Yaowu Xuf883b422016-08-30 14:01:10 -0700201TEST_P(AV1ConvolveOptimzTest, HorizBitExactCheck) {
Yi Luo229690a2016-06-13 17:01:17 -0700202 RunHorizFilterBitExactCheck();
203}
Yaowu Xuf883b422016-08-30 14:01:10 -0700204TEST_P(AV1ConvolveOptimzTest, VerticalBitExactCheck) {
Yi Luo81ad9532016-06-21 12:17:39 -0700205 RunVertFilterBitExactCheck();
206}
Yi Luo229690a2016-06-13 17:01:17 -0700207
208using std::tr1::make_tuple;
209
Angie Chiang1733f6b2017-01-05 09:52:20 -0800210#if (HAVE_SSSE3 || HAVE_SSE4_1) && CONFIG_DUAL_FILTER
Yi Luo229690a2016-06-13 17:01:17 -0700211const BlockDimension kBlockDim[] = {
clang-format3a826f12016-08-11 17:46:05 -0700212 make_tuple(2, 2), make_tuple(2, 4), make_tuple(4, 4),
213 make_tuple(4, 8), make_tuple(8, 4), make_tuple(8, 8),
214 make_tuple(8, 16), make_tuple(16, 8), make_tuple(16, 16),
215 make_tuple(16, 32), make_tuple(32, 16), make_tuple(32, 32),
216 make_tuple(32, 64), make_tuple(64, 32), make_tuple(64, 64),
217 make_tuple(64, 128), make_tuple(128, 64), make_tuple(128, 128),
Yi Luo229690a2016-06-13 17:01:17 -0700218};
Sarah Parker95763742016-06-28 17:13:03 -0700219
Yi Luo229690a2016-06-13 17:01:17 -0700220// 10/12-tap filters
Urvang Joshia9b174b2017-02-17 11:50:12 -0800221const InterpFilter kFilter[] = { FILTER_REGULAR_UV, BILINEAR, MULTITAP_SHARP };
Yi Luo229690a2016-06-13 17:01:17 -0700222
clang-format3a826f12016-08-11 17:46:05 -0700223const int kSubpelQ4[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
Yi Luo229690a2016-06-13 17:01:17 -0700224
clang-format3a826f12016-08-11 17:46:05 -0700225const int kAvg[] = { 0, 1 };
Yi Luo8cacca72016-07-08 15:41:59 -0700226#endif
Yi Luo229690a2016-06-13 17:01:17 -0700227
Angie Chiang1733f6b2017-01-05 09:52:20 -0800228#if HAVE_SSSE3 && CONFIG_DUAL_FILTER
Yi Luo229690a2016-06-13 17:01:17 -0700229INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -0700230 SSSE3, AV1ConvolveOptimzTest,
Angie Chiangb2ff17f2017-01-11 17:30:20 -0800231 ::testing::Combine(::testing::Values(av1_convolve_init_ssse3),
232 ::testing::Values(av1_convolve_horiz_ssse3),
Yaowu Xuf883b422016-08-30 14:01:10 -0700233 ::testing::Values(av1_convolve_vert_ssse3),
clang-format3a826f12016-08-11 17:46:05 -0700234 ::testing::ValuesIn(kBlockDim),
235 ::testing::ValuesIn(kFilter),
236 ::testing::ValuesIn(kSubpelQ4),
237 ::testing::ValuesIn(kAvg)));
Angie Chiang1733f6b2017-01-05 09:52:20 -0800238#endif // HAVE_SSSE3 && CONFIG_DUAL_FILTER
Yi Luo8cacca72016-07-08 15:41:59 -0700239
Yaowu Xuf883b422016-08-30 14:01:10 -0700240#if CONFIG_AOM_HIGHBITDEPTH
Yi Luo8cacca72016-07-08 15:41:59 -0700241typedef ::testing::TestWithParam<HbdConvParams> TestWithHbdConvParams;
Yaowu Xuf883b422016-08-30 14:01:10 -0700242class AV1HbdConvolveOptimzTest : public TestWithHbdConvParams {
Yi Luo8cacca72016-07-08 15:41:59 -0700243 public:
Yaowu Xuf883b422016-08-30 14:01:10 -0700244 virtual ~AV1HbdConvolveOptimzTest() {}
Yi Luo8cacca72016-07-08 15:41:59 -0700245 virtual void SetUp() {
246 conv_horiz_ = GET_PARAM(0);
247 conv_vert_ = GET_PARAM(1);
248 BlockDimension block = GET_PARAM(2);
249 width_ = std::tr1::get<0>(block);
250 height_ = std::tr1::get<1>(block);
251 filter_ = GET_PARAM(3);
252 subpel_ = GET_PARAM(4);
253 avg_ = GET_PARAM(5);
254 bit_depth_ = GET_PARAM(6);
255
256 alloc_ = new uint16_t[maxBlockSize * 4];
257 src_ = alloc_ + (vertiOffset * maxWidth);
258 src_ += horizOffset;
259 src_ref_ = src_ + maxBlockSize;
260
261 dst_ = alloc_ + 2 * maxBlockSize;
262 dst_ref_ = alloc_ + 3 * maxBlockSize;
263 }
264
265 virtual void TearDown() {
266 delete[] alloc_;
Yaowu Xuc27fc142016-08-22 16:08:15 -0700267 libaom_test::ClearSystemState();
Yi Luo8cacca72016-07-08 15:41:59 -0700268 }
269
270 protected:
271 void RunHorizFilterBitExactCheck();
272 void RunVertFilterBitExactCheck();
273
274 private:
Urvang Joshid71a2312016-07-14 12:33:48 -0700275 void PrepFilterBuffer();
Yi Luo8cacca72016-07-08 15:41:59 -0700276 void DiffFilterBuffer();
277 hbd_conv_filter_t conv_horiz_;
278 hbd_conv_filter_t conv_vert_;
279 uint16_t *alloc_;
280 uint16_t *src_;
281 uint16_t *dst_;
282 uint16_t *src_ref_;
283 uint16_t *dst_ref_;
284 int width_;
285 int height_;
Urvang Joshia9b174b2017-02-17 11:50:12 -0800286 InterpFilter filter_;
Yi Luo8cacca72016-07-08 15:41:59 -0700287 int subpel_;
288 int avg_;
289 int bit_depth_;
290};
291
Urvang Joshid71a2312016-07-14 12:33:48 -0700292void AV1HbdConvolveOptimzTest::PrepFilterBuffer() {
Yi Luo8cacca72016-07-08 15:41:59 -0700293 int r, c;
294 ACMRandom rnd(ACMRandom::DeterministicSeed());
295
296 memset(alloc_, 0, 4 * maxBlockSize * sizeof(alloc_[0]));
297
298 uint16_t *src_ptr = src_;
299 uint16_t *dst_ptr = dst_;
300 uint16_t *dst_ref_ptr = dst_ref_;
301 uint16_t hbd_mask = (1 << bit_depth_) - 1;
302
303 for (r = 0; r < height_; ++r) {
304 for (c = 0; c < width_; ++c) {
305 src_ptr[c] = rnd.Rand16() & hbd_mask;
306 dst_ptr[c] = rnd.Rand16() & hbd_mask;
307 dst_ref_ptr[c] = dst_ptr[c];
308 }
309 src_ptr += stride;
310 dst_ptr += stride;
311 dst_ref_ptr += stride;
312 }
313}
314
Yaowu Xuf883b422016-08-30 14:01:10 -0700315void AV1HbdConvolveOptimzTest::DiffFilterBuffer() {
Yi Luo8cacca72016-07-08 15:41:59 -0700316 int r, c;
317 const uint16_t *dst_ptr = dst_;
318 const uint16_t *dst_ref_ptr = dst_ref_;
319 for (r = 0; r < height_; ++r) {
320 for (c = 0; c < width_; ++c) {
321 EXPECT_EQ((uint16_t)dst_ref_ptr[c], (uint16_t)dst_ptr[c])
clang-format3a826f12016-08-11 17:46:05 -0700322 << "Error at row: " << r << " col: " << c << " "
323 << "w = " << width_ << " "
324 << "h = " << height_ << " "
325 << "filter group index = " << filter_ << " "
326 << "filter index = " << subpel_ << " "
327 << "bit depth = " << bit_depth_;
Yi Luo8cacca72016-07-08 15:41:59 -0700328 }
329 dst_ptr += stride;
330 dst_ref_ptr += stride;
331 }
332}
333
Yaowu Xuf883b422016-08-30 14:01:10 -0700334void AV1HbdConvolveOptimzTest::RunHorizFilterBitExactCheck() {
Urvang Joshid71a2312016-07-14 12:33:48 -0700335 PrepFilterBuffer();
Yi Luo8cacca72016-07-08 15:41:59 -0700336
Yaowu Xuf883b422016-08-30 14:01:10 -0700337 InterpFilterParams filter_params = av1_get_interp_filter_params(filter_);
Yi Luo8cacca72016-07-08 15:41:59 -0700338
Yaowu Xuf883b422016-08-30 14:01:10 -0700339 av1_highbd_convolve_horiz_c(src_, stride, dst_ref_, stride, width_, height_,
340 filter_params, subpel_, x_step_q4, avg_,
341 bit_depth_);
Yi Luo8cacca72016-07-08 15:41:59 -0700342
clang-format3a826f12016-08-11 17:46:05 -0700343 conv_horiz_(src_, stride, dst_, stride, width_, height_, filter_params,
344 subpel_, x_step_q4, avg_, bit_depth_);
Yi Luo8cacca72016-07-08 15:41:59 -0700345
346 DiffFilterBuffer();
347
348 // Note:
349 // Here we need calculate a height which is different from the specified one
350 // and test again.
351 int intermediate_height =
352 (((height_ - 1) * 16 + subpel_) >> SUBPEL_BITS) + filter_params.taps;
Urvang Joshid71a2312016-07-14 12:33:48 -0700353 PrepFilterBuffer();
Yi Luo8cacca72016-07-08 15:41:59 -0700354
Yaowu Xuf883b422016-08-30 14:01:10 -0700355 av1_highbd_convolve_horiz_c(src_, stride, dst_ref_, stride, width_,
356 intermediate_height, filter_params, subpel_,
357 x_step_q4, avg_, bit_depth_);
Yi Luo8cacca72016-07-08 15:41:59 -0700358
359 conv_horiz_(src_, stride, dst_, stride, width_, intermediate_height,
360 filter_params, subpel_, x_step_q4, avg_, bit_depth_);
361
362 DiffFilterBuffer();
363}
364
Yaowu Xuf883b422016-08-30 14:01:10 -0700365void AV1HbdConvolveOptimzTest::RunVertFilterBitExactCheck() {
Urvang Joshid71a2312016-07-14 12:33:48 -0700366 PrepFilterBuffer();
Yi Luo8cacca72016-07-08 15:41:59 -0700367
Yaowu Xuf883b422016-08-30 14:01:10 -0700368 InterpFilterParams filter_params = av1_get_interp_filter_params(filter_);
Yi Luo8cacca72016-07-08 15:41:59 -0700369
Yaowu Xuf883b422016-08-30 14:01:10 -0700370 av1_highbd_convolve_vert_c(src_, stride, dst_ref_, stride, width_, height_,
371 filter_params, subpel_, x_step_q4, avg_,
372 bit_depth_);
Yi Luo8cacca72016-07-08 15:41:59 -0700373
clang-format3a826f12016-08-11 17:46:05 -0700374 conv_vert_(src_, stride, dst_, stride, width_, height_, filter_params,
375 subpel_, x_step_q4, avg_, bit_depth_);
Yi Luo8cacca72016-07-08 15:41:59 -0700376
377 DiffFilterBuffer();
378}
379
Yaowu Xuf883b422016-08-30 14:01:10 -0700380TEST_P(AV1HbdConvolveOptimzTest, HorizBitExactCheck) {
Yi Luo8cacca72016-07-08 15:41:59 -0700381 RunHorizFilterBitExactCheck();
382}
Yaowu Xuf883b422016-08-30 14:01:10 -0700383TEST_P(AV1HbdConvolveOptimzTest, VertBitExactCheck) {
Yi Luo8cacca72016-07-08 15:41:59 -0700384 RunVertFilterBitExactCheck();
385}
386
Angie Chiang1733f6b2017-01-05 09:52:20 -0800387#if HAVE_SSE4_1 && CONFIG_DUAL_FILTER
Yi Luo8cacca72016-07-08 15:41:59 -0700388
clang-format3a826f12016-08-11 17:46:05 -0700389const int kBitdepth[] = { 10, 12 };
Yi Luo8cacca72016-07-08 15:41:59 -0700390
391INSTANTIATE_TEST_CASE_P(
Yaowu Xuf883b422016-08-30 14:01:10 -0700392 SSE4_1, AV1HbdConvolveOptimzTest,
393 ::testing::Combine(::testing::Values(av1_highbd_convolve_horiz_sse4_1),
394 ::testing::Values(av1_highbd_convolve_vert_sse4_1),
clang-format3a826f12016-08-11 17:46:05 -0700395 ::testing::ValuesIn(kBlockDim),
396 ::testing::ValuesIn(kFilter),
397 ::testing::ValuesIn(kSubpelQ4),
398 ::testing::ValuesIn(kAvg),
399 ::testing::ValuesIn(kBitdepth)));
Angie Chiang1733f6b2017-01-05 09:52:20 -0800400#endif // HAVE_SSE4_1 && CONFIG_DUAL_FILTER
Yaowu Xuf883b422016-08-30 14:01:10 -0700401#endif // CONFIG_AOM_HIGHBITDEPTH
Yi Luo229690a2016-06-13 17:01:17 -0700402} // namespace