blob: b2bf42a04fb2228305cfeac267e3451af046ec53 [file] [log] [blame]
Geza Loreebc2d342016-07-12 11:41:54 +01001/*
Yaowu Xu2ab7ff02016-09-02 12:04:54 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Geza Loreebc2d342016-07-12 11:41:54 +01003 *
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.
Geza Loreebc2d342016-07-12 11:41:54 +010010 */
11
Tom Finegan7a07ece2017-02-07 17:14:05 -080012#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
Geza Loreebc2d342016-07-12 11:41:54 +010013#include "test/acm_random.h"
14
15#include "test/function_equivalence_test.h"
16#include "test/register_state_check.h"
17
Tom Finegan60e653d2018-05-22 11:34:58 -070018#include "config/aom_config.h"
Tom Finegan44702c82018-05-22 13:00:39 -070019#include "config/aom_dsp_rtcd.h"
Tom Finegan60e653d2018-05-22 11:34:58 -070020
Yaowu Xuf883b422016-08-30 14:01:10 -070021#include "aom/aom_integer.h"
Geza Loreebc2d342016-07-12 11:41:54 +010022
23#define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
24
Yaowu Xuc27fc142016-08-22 16:08:15 -070025using libaom_test::ACMRandom;
26using libaom_test::FunctionEquivalenceTest;
Geza Loreebc2d342016-07-12 11:41:54 +010027
28namespace {
29
30static const int kIterations = 1000;
31static const int kMaskMax = 64;
32
33typedef unsigned int (*ObmcVarF)(const uint8_t *pre, int pre_stride,
34 const int32_t *wsrc, const int32_t *mask,
35 unsigned int *sse);
Yaowu Xuc27fc142016-08-22 16:08:15 -070036typedef libaom_test::FuncParam<ObmcVarF> TestFuncs;
Geza Loreebc2d342016-07-12 11:41:54 +010037
38////////////////////////////////////////////////////////////////////////////////
39// 8 bit
40////////////////////////////////////////////////////////////////////////////////
41
42class ObmcVarianceTest : public FunctionEquivalenceTest<ObmcVarF> {};
chiyotsai9dfac722020-07-07 17:43:02 -070043GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ObmcVarianceTest);
Geza Loreebc2d342016-07-12 11:41:54 +010044
45TEST_P(ObmcVarianceTest, RandomValues) {
46 DECLARE_ALIGNED(32, uint8_t, pre[MAX_SB_SQUARE]);
47 DECLARE_ALIGNED(32, int32_t, wsrc[MAX_SB_SQUARE]);
48 DECLARE_ALIGNED(32, int32_t, mask[MAX_SB_SQUARE]);
49
clang-format3a826f12016-08-11 17:46:05 -070050 for (int iter = 0; iter < kIterations && !HasFatalFailure(); ++iter) {
Geza Loreebc2d342016-07-12 11:41:54 +010051 const int pre_stride = this->rng_(MAX_SB_SIZE + 1);
52
clang-format3a826f12016-08-11 17:46:05 -070053 for (int i = 0; i < MAX_SB_SQUARE; ++i) {
Geza Loreebc2d342016-07-12 11:41:54 +010054 pre[i] = this->rng_.Rand8();
55 wsrc[i] = this->rng_.Rand8() * this->rng_(kMaskMax * kMaskMax + 1);
56 mask[i] = this->rng_(kMaskMax * kMaskMax + 1);
57 }
58
59 unsigned int ref_sse, tst_sse;
clang-format3a826f12016-08-11 17:46:05 -070060 const unsigned int ref_res =
61 params_.ref_func(pre, pre_stride, wsrc, mask, &ref_sse);
Geza Loreebc2d342016-07-12 11:41:54 +010062 unsigned int tst_res;
chiyotsaief261062021-07-01 14:01:45 -070063 API_REGISTER_STATE_CHECK(
Geza Loreebc2d342016-07-12 11:41:54 +010064 tst_res = params_.tst_func(pre, pre_stride, wsrc, mask, &tst_sse));
65
66 ASSERT_EQ(ref_res, tst_res);
67 ASSERT_EQ(ref_sse, tst_sse);
68 }
69}
70
71TEST_P(ObmcVarianceTest, ExtremeValues) {
72 DECLARE_ALIGNED(32, uint8_t, pre[MAX_SB_SQUARE]);
73 DECLARE_ALIGNED(32, int32_t, wsrc[MAX_SB_SQUARE]);
74 DECLARE_ALIGNED(32, int32_t, mask[MAX_SB_SQUARE]);
75
clang-format3a826f12016-08-11 17:46:05 -070076 for (int iter = 0; iter < MAX_SB_SIZE && !HasFatalFailure(); ++iter) {
Geza Loreebc2d342016-07-12 11:41:54 +010077 const int pre_stride = iter;
78
clang-format3a826f12016-08-11 17:46:05 -070079 for (int i = 0; i < MAX_SB_SQUARE; ++i) {
Geza Loreebc2d342016-07-12 11:41:54 +010080 pre[i] = UINT8_MAX;
81 wsrc[i] = UINT8_MAX * kMaskMax * kMaskMax;
82 mask[i] = kMaskMax * kMaskMax;
83 }
84
85 unsigned int ref_sse, tst_sse;
clang-format3a826f12016-08-11 17:46:05 -070086 const unsigned int ref_res =
87 params_.ref_func(pre, pre_stride, wsrc, mask, &ref_sse);
Geza Loreebc2d342016-07-12 11:41:54 +010088 unsigned int tst_res;
chiyotsaief261062021-07-01 14:01:45 -070089 API_REGISTER_STATE_CHECK(
Geza Loreebc2d342016-07-12 11:41:54 +010090 tst_res = params_.tst_func(pre, pre_stride, wsrc, mask, &tst_sse));
91
92 ASSERT_EQ(ref_res, tst_res);
93 ASSERT_EQ(ref_sse, tst_sse);
94 }
95}
96
Venkatf9213442018-08-03 17:39:58 +053097TEST_P(ObmcVarianceTest, DISABLED_Speed) {
98 DECLARE_ALIGNED(32, uint8_t, pre[MAX_SB_SQUARE]);
99 DECLARE_ALIGNED(32, int32_t, wsrc[MAX_SB_SQUARE]);
100 DECLARE_ALIGNED(32, int32_t, mask[MAX_SB_SQUARE]);
101
102 const int pre_stride = this->rng_(MAX_SB_SIZE + 1);
103
104 for (int i = 0; i < MAX_SB_SQUARE; ++i) {
105 pre[i] = this->rng_.Rand8();
106 wsrc[i] = this->rng_.Rand8() * this->rng_(kMaskMax * kMaskMax + 1);
107 mask[i] = this->rng_(kMaskMax * kMaskMax + 1);
108 }
109
110 const int num_loops = 1000000;
111 unsigned int ref_sse, tst_sse;
112 aom_usec_timer ref_timer, test_timer;
113
114 aom_usec_timer_start(&ref_timer);
115 for (int i = 0; i < num_loops; ++i) {
116 params_.ref_func(pre, pre_stride, wsrc, mask, &ref_sse);
117 }
118 aom_usec_timer_mark(&ref_timer);
119 const int elapsed_time_c =
120 static_cast<int>(aom_usec_timer_elapsed(&ref_timer));
121
122 aom_usec_timer_start(&test_timer);
123 for (int i = 0; i < num_loops; ++i) {
124 params_.tst_func(pre, pre_stride, wsrc, mask, &tst_sse);
125 }
126 aom_usec_timer_mark(&test_timer);
127 const int elapsed_time_simd =
128 static_cast<int>(aom_usec_timer_elapsed(&test_timer));
129
James Zernb70593a2023-01-23 13:41:00 -0800130 printf("c_time=%d \t simd_time=%d \t gain=%f \n", elapsed_time_c,
131 elapsed_time_simd,
132 static_cast<double>(elapsed_time_c) / elapsed_time_simd);
Venkatf9213442018-08-03 17:39:58 +0530133}
134
Geza Loreebc2d342016-07-12 11:41:54 +0100135#if HAVE_SSE4_1
136const ObmcVarianceTest::ParamType sse4_functions[] = {
Yaowu Xuf883b422016-08-30 14:01:10 -0700137 TestFuncs(aom_obmc_variance128x128_c, aom_obmc_variance128x128_sse4_1),
138 TestFuncs(aom_obmc_variance128x64_c, aom_obmc_variance128x64_sse4_1),
139 TestFuncs(aom_obmc_variance64x128_c, aom_obmc_variance64x128_sse4_1),
Yaowu Xuf883b422016-08-30 14:01:10 -0700140 TestFuncs(aom_obmc_variance64x64_c, aom_obmc_variance64x64_sse4_1),
141 TestFuncs(aom_obmc_variance64x32_c, aom_obmc_variance64x32_sse4_1),
142 TestFuncs(aom_obmc_variance32x64_c, aom_obmc_variance32x64_sse4_1),
143 TestFuncs(aom_obmc_variance32x32_c, aom_obmc_variance32x32_sse4_1),
144 TestFuncs(aom_obmc_variance32x16_c, aom_obmc_variance32x16_sse4_1),
145 TestFuncs(aom_obmc_variance16x32_c, aom_obmc_variance16x32_sse4_1),
146 TestFuncs(aom_obmc_variance16x16_c, aom_obmc_variance16x16_sse4_1),
147 TestFuncs(aom_obmc_variance16x8_c, aom_obmc_variance16x8_sse4_1),
148 TestFuncs(aom_obmc_variance8x16_c, aom_obmc_variance8x16_sse4_1),
149 TestFuncs(aom_obmc_variance8x8_c, aom_obmc_variance8x8_sse4_1),
150 TestFuncs(aom_obmc_variance8x4_c, aom_obmc_variance8x4_sse4_1),
151 TestFuncs(aom_obmc_variance4x8_c, aom_obmc_variance4x8_sse4_1),
Debargha Mukherjee5427c0c2019-07-17 10:49:09 -0700152 TestFuncs(aom_obmc_variance4x4_c, aom_obmc_variance4x4_sse4_1),
153
154 TestFuncs(aom_obmc_variance64x16_c, aom_obmc_variance64x16_sse4_1),
155 TestFuncs(aom_obmc_variance16x64_c, aom_obmc_variance16x64_sse4_1),
156 TestFuncs(aom_obmc_variance32x8_c, aom_obmc_variance32x8_sse4_1),
157 TestFuncs(aom_obmc_variance8x32_c, aom_obmc_variance8x32_sse4_1),
158 TestFuncs(aom_obmc_variance16x4_c, aom_obmc_variance16x4_sse4_1),
159 TestFuncs(aom_obmc_variance4x16_c, aom_obmc_variance4x16_sse4_1),
Geza Loreebc2d342016-07-12 11:41:54 +0100160};
161
Cheng Chen96786fe2020-02-14 17:28:25 -0800162INSTANTIATE_TEST_SUITE_P(SSE4_1, ObmcVarianceTest,
163 ::testing::ValuesIn(sse4_functions));
Geza Loreebc2d342016-07-12 11:41:54 +0100164#endif // HAVE_SSE4_1
165
Venkatf9213442018-08-03 17:39:58 +0530166#if HAVE_AVX2
167const ObmcVarianceTest::ParamType avx2_functions[] = {
168 TestFuncs(aom_obmc_variance128x128_c, aom_obmc_variance128x128_avx2),
169 TestFuncs(aom_obmc_variance128x64_c, aom_obmc_variance128x64_avx2),
170 TestFuncs(aom_obmc_variance64x128_c, aom_obmc_variance64x128_avx2),
171 TestFuncs(aom_obmc_variance64x64_c, aom_obmc_variance64x64_avx2),
172 TestFuncs(aom_obmc_variance64x32_c, aom_obmc_variance64x32_avx2),
173 TestFuncs(aom_obmc_variance32x64_c, aom_obmc_variance32x64_avx2),
174 TestFuncs(aom_obmc_variance32x32_c, aom_obmc_variance32x32_avx2),
175 TestFuncs(aom_obmc_variance32x16_c, aom_obmc_variance32x16_avx2),
176 TestFuncs(aom_obmc_variance16x32_c, aom_obmc_variance16x32_avx2),
177 TestFuncs(aom_obmc_variance16x16_c, aom_obmc_variance16x16_avx2),
178 TestFuncs(aom_obmc_variance16x8_c, aom_obmc_variance16x8_avx2),
179 TestFuncs(aom_obmc_variance8x16_c, aom_obmc_variance8x16_avx2),
180 TestFuncs(aom_obmc_variance8x8_c, aom_obmc_variance8x8_avx2),
181 TestFuncs(aom_obmc_variance8x4_c, aom_obmc_variance8x4_avx2),
Debargha Mukherjee5427c0c2019-07-17 10:49:09 -0700182 TestFuncs(aom_obmc_variance4x8_c, aom_obmc_variance4x8_avx2),
183 TestFuncs(aom_obmc_variance4x4_c, aom_obmc_variance4x4_avx2),
184
185 TestFuncs(aom_obmc_variance64x16_c, aom_obmc_variance64x16_avx2),
186 TestFuncs(aom_obmc_variance16x64_c, aom_obmc_variance16x64_avx2),
187 TestFuncs(aom_obmc_variance32x8_c, aom_obmc_variance32x8_avx2),
188 TestFuncs(aom_obmc_variance8x32_c, aom_obmc_variance8x32_avx2),
189 TestFuncs(aom_obmc_variance16x4_c, aom_obmc_variance16x4_avx2),
190 TestFuncs(aom_obmc_variance4x16_c, aom_obmc_variance4x16_avx2),
Venkatf9213442018-08-03 17:39:58 +0530191};
192
Cheng Chen96786fe2020-02-14 17:28:25 -0800193INSTANTIATE_TEST_SUITE_P(AVX2, ObmcVarianceTest,
194 ::testing::ValuesIn(avx2_functions));
Venkatf9213442018-08-03 17:39:58 +0530195#endif // HAVE_AVX2
196
George Steed25c84792023-01-07 12:53:25 +0000197#if HAVE_NEON
198const ObmcVarianceTest::ParamType neon_functions[] = {
199 TestFuncs(aom_obmc_variance128x128_c, aom_obmc_variance128x128_neon),
200 TestFuncs(aom_obmc_variance128x64_c, aom_obmc_variance128x64_neon),
201 TestFuncs(aom_obmc_variance64x128_c, aom_obmc_variance64x128_neon),
202 TestFuncs(aom_obmc_variance64x64_c, aom_obmc_variance64x64_neon),
203 TestFuncs(aom_obmc_variance64x32_c, aom_obmc_variance64x32_neon),
204 TestFuncs(aom_obmc_variance32x64_c, aom_obmc_variance32x64_neon),
205 TestFuncs(aom_obmc_variance32x32_c, aom_obmc_variance32x32_neon),
206 TestFuncs(aom_obmc_variance32x16_c, aom_obmc_variance32x16_neon),
207 TestFuncs(aom_obmc_variance16x32_c, aom_obmc_variance16x32_neon),
208 TestFuncs(aom_obmc_variance16x16_c, aom_obmc_variance16x16_neon),
209 TestFuncs(aom_obmc_variance16x8_c, aom_obmc_variance16x8_neon),
210 TestFuncs(aom_obmc_variance8x16_c, aom_obmc_variance8x16_neon),
211 TestFuncs(aom_obmc_variance8x8_c, aom_obmc_variance8x8_neon),
212 TestFuncs(aom_obmc_variance8x4_c, aom_obmc_variance8x4_neon),
213 TestFuncs(aom_obmc_variance4x8_c, aom_obmc_variance4x8_neon),
214 TestFuncs(aom_obmc_variance4x4_c, aom_obmc_variance4x4_neon),
215
216 TestFuncs(aom_obmc_variance64x16_c, aom_obmc_variance64x16_neon),
217 TestFuncs(aom_obmc_variance16x64_c, aom_obmc_variance16x64_neon),
218 TestFuncs(aom_obmc_variance32x8_c, aom_obmc_variance32x8_neon),
219 TestFuncs(aom_obmc_variance8x32_c, aom_obmc_variance8x32_neon),
220 TestFuncs(aom_obmc_variance16x4_c, aom_obmc_variance16x4_neon),
221 TestFuncs(aom_obmc_variance4x16_c, aom_obmc_variance4x16_neon),
222};
223
224INSTANTIATE_TEST_SUITE_P(NEON, ObmcVarianceTest,
225 ::testing::ValuesIn(neon_functions));
226#endif // HAVE_NEON
227
Geza Loreebc2d342016-07-12 11:41:54 +0100228////////////////////////////////////////////////////////////////////////////////
229// High bit-depth
230////////////////////////////////////////////////////////////////////////////////
Jerome Jiangfa1d1732019-08-06 10:31:20 -0700231#if CONFIG_AV1_HIGHBITDEPTH
Jingning Hana387b192016-07-14 10:11:32 -0700232class ObmcVarianceHBDTest : public FunctionEquivalenceTest<ObmcVarF> {};
chiyotsai9dfac722020-07-07 17:43:02 -0700233GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ObmcVarianceHBDTest);
Geza Loreebc2d342016-07-12 11:41:54 +0100234
235TEST_P(ObmcVarianceHBDTest, RandomValues) {
236 DECLARE_ALIGNED(32, uint16_t, pre[MAX_SB_SQUARE]);
237 DECLARE_ALIGNED(32, int32_t, wsrc[MAX_SB_SQUARE]);
238 DECLARE_ALIGNED(32, int32_t, mask[MAX_SB_SQUARE]);
239
clang-format3a826f12016-08-11 17:46:05 -0700240 for (int iter = 0; iter < kIterations && !HasFatalFailure(); ++iter) {
Geza Loreebc2d342016-07-12 11:41:54 +0100241 const int pre_stride = this->rng_(MAX_SB_SIZE + 1);
242
clang-format3a826f12016-08-11 17:46:05 -0700243 for (int i = 0; i < MAX_SB_SQUARE; ++i) {
Jingning Hana387b192016-07-14 10:11:32 -0700244 pre[i] = this->rng_(1 << params_.bit_depth);
245 wsrc[i] = this->rng_(1 << params_.bit_depth) *
Geza Loreebc2d342016-07-12 11:41:54 +0100246 this->rng_(kMaskMax * kMaskMax + 1);
247 mask[i] = this->rng_(kMaskMax * kMaskMax + 1);
248 }
249
250 unsigned int ref_sse, tst_sse;
clang-format3a826f12016-08-11 17:46:05 -0700251 const unsigned int ref_res = params_.ref_func(
252 CONVERT_TO_BYTEPTR(pre), pre_stride, wsrc, mask, &ref_sse);
Geza Loreebc2d342016-07-12 11:41:54 +0100253 unsigned int tst_res;
chiyotsaief261062021-07-01 14:01:45 -0700254 API_REGISTER_STATE_CHECK(tst_res = params_.tst_func(CONVERT_TO_BYTEPTR(pre),
clang-format3a826f12016-08-11 17:46:05 -0700255 pre_stride, wsrc, mask,
256 &tst_sse));
Geza Loreebc2d342016-07-12 11:41:54 +0100257
258 ASSERT_EQ(ref_res, tst_res);
259 ASSERT_EQ(ref_sse, tst_sse);
260 }
261}
262
263TEST_P(ObmcVarianceHBDTest, ExtremeValues) {
264 DECLARE_ALIGNED(32, uint16_t, pre[MAX_SB_SQUARE]);
265 DECLARE_ALIGNED(32, int32_t, wsrc[MAX_SB_SQUARE]);
266 DECLARE_ALIGNED(32, int32_t, mask[MAX_SB_SQUARE]);
267
clang-format3a826f12016-08-11 17:46:05 -0700268 for (int iter = 0; iter < MAX_SB_SIZE && !HasFatalFailure(); ++iter) {
Geza Loreebc2d342016-07-12 11:41:54 +0100269 const int pre_stride = iter;
270
clang-format3a826f12016-08-11 17:46:05 -0700271 for (int i = 0; i < MAX_SB_SQUARE; ++i) {
Jingning Hana387b192016-07-14 10:11:32 -0700272 pre[i] = (1 << params_.bit_depth) - 1;
273 wsrc[i] = ((1 << params_.bit_depth) - 1) * kMaskMax * kMaskMax;
Geza Loreebc2d342016-07-12 11:41:54 +0100274 mask[i] = kMaskMax * kMaskMax;
275 }
276
277 unsigned int ref_sse, tst_sse;
clang-format3a826f12016-08-11 17:46:05 -0700278 const unsigned int ref_res = params_.ref_func(
279 CONVERT_TO_BYTEPTR(pre), pre_stride, wsrc, mask, &ref_sse);
Geza Loreebc2d342016-07-12 11:41:54 +0100280 unsigned int tst_res;
chiyotsaief261062021-07-01 14:01:45 -0700281 API_REGISTER_STATE_CHECK(tst_res = params_.tst_func(CONVERT_TO_BYTEPTR(pre),
clang-format3a826f12016-08-11 17:46:05 -0700282 pre_stride, wsrc, mask,
283 &tst_sse));
Geza Loreebc2d342016-07-12 11:41:54 +0100284
285 ASSERT_EQ(ref_res, tst_res);
286 ASSERT_EQ(ref_sse, tst_sse);
287 }
288}
289
290#if HAVE_SSE4_1
291ObmcVarianceHBDTest::ParamType sse4_functions_hbd[] = {
Yaowu Xuf883b422016-08-30 14:01:10 -0700292 TestFuncs(aom_highbd_obmc_variance128x128_c,
293 aom_highbd_obmc_variance128x128_sse4_1, 8),
294 TestFuncs(aom_highbd_obmc_variance128x64_c,
295 aom_highbd_obmc_variance128x64_sse4_1, 8),
296 TestFuncs(aom_highbd_obmc_variance64x128_c,
297 aom_highbd_obmc_variance64x128_sse4_1, 8),
Yaowu Xuf883b422016-08-30 14:01:10 -0700298 TestFuncs(aom_highbd_obmc_variance64x64_c,
299 aom_highbd_obmc_variance64x64_sse4_1, 8),
300 TestFuncs(aom_highbd_obmc_variance64x32_c,
301 aom_highbd_obmc_variance64x32_sse4_1, 8),
302 TestFuncs(aom_highbd_obmc_variance32x64_c,
303 aom_highbd_obmc_variance32x64_sse4_1, 8),
304 TestFuncs(aom_highbd_obmc_variance32x32_c,
305 aom_highbd_obmc_variance32x32_sse4_1, 8),
306 TestFuncs(aom_highbd_obmc_variance32x16_c,
307 aom_highbd_obmc_variance32x16_sse4_1, 8),
308 TestFuncs(aom_highbd_obmc_variance16x32_c,
309 aom_highbd_obmc_variance16x32_sse4_1, 8),
310 TestFuncs(aom_highbd_obmc_variance16x16_c,
311 aom_highbd_obmc_variance16x16_sse4_1, 8),
312 TestFuncs(aom_highbd_obmc_variance16x8_c, aom_highbd_obmc_variance16x8_sse4_1,
clang-format3a826f12016-08-11 17:46:05 -0700313 8),
Yaowu Xuf883b422016-08-30 14:01:10 -0700314 TestFuncs(aom_highbd_obmc_variance8x16_c, aom_highbd_obmc_variance8x16_sse4_1,
clang-format3a826f12016-08-11 17:46:05 -0700315 8),
Yaowu Xuf883b422016-08-30 14:01:10 -0700316 TestFuncs(aom_highbd_obmc_variance8x8_c, aom_highbd_obmc_variance8x8_sse4_1,
clang-format3a826f12016-08-11 17:46:05 -0700317 8),
Yaowu Xuf883b422016-08-30 14:01:10 -0700318 TestFuncs(aom_highbd_obmc_variance8x4_c, aom_highbd_obmc_variance8x4_sse4_1,
clang-format3a826f12016-08-11 17:46:05 -0700319 8),
Yaowu Xuf883b422016-08-30 14:01:10 -0700320 TestFuncs(aom_highbd_obmc_variance4x8_c, aom_highbd_obmc_variance4x8_sse4_1,
clang-format3a826f12016-08-11 17:46:05 -0700321 8),
Yaowu Xuf883b422016-08-30 14:01:10 -0700322 TestFuncs(aom_highbd_obmc_variance4x4_c, aom_highbd_obmc_variance4x4_sse4_1,
clang-format3a826f12016-08-11 17:46:05 -0700323 8),
Yaowu Xuf883b422016-08-30 14:01:10 -0700324 TestFuncs(aom_highbd_10_obmc_variance128x128_c,
325 aom_highbd_10_obmc_variance128x128_sse4_1, 10),
326 TestFuncs(aom_highbd_10_obmc_variance128x64_c,
327 aom_highbd_10_obmc_variance128x64_sse4_1, 10),
328 TestFuncs(aom_highbd_10_obmc_variance64x128_c,
329 aom_highbd_10_obmc_variance64x128_sse4_1, 10),
Yaowu Xuf883b422016-08-30 14:01:10 -0700330 TestFuncs(aom_highbd_10_obmc_variance64x64_c,
331 aom_highbd_10_obmc_variance64x64_sse4_1, 10),
332 TestFuncs(aom_highbd_10_obmc_variance64x32_c,
333 aom_highbd_10_obmc_variance64x32_sse4_1, 10),
334 TestFuncs(aom_highbd_10_obmc_variance32x64_c,
335 aom_highbd_10_obmc_variance32x64_sse4_1, 10),
336 TestFuncs(aom_highbd_10_obmc_variance32x32_c,
337 aom_highbd_10_obmc_variance32x32_sse4_1, 10),
338 TestFuncs(aom_highbd_10_obmc_variance32x16_c,
339 aom_highbd_10_obmc_variance32x16_sse4_1, 10),
340 TestFuncs(aom_highbd_10_obmc_variance16x32_c,
341 aom_highbd_10_obmc_variance16x32_sse4_1, 10),
342 TestFuncs(aom_highbd_10_obmc_variance16x16_c,
343 aom_highbd_10_obmc_variance16x16_sse4_1, 10),
344 TestFuncs(aom_highbd_10_obmc_variance16x8_c,
345 aom_highbd_10_obmc_variance16x8_sse4_1, 10),
346 TestFuncs(aom_highbd_10_obmc_variance8x16_c,
347 aom_highbd_10_obmc_variance8x16_sse4_1, 10),
348 TestFuncs(aom_highbd_10_obmc_variance8x8_c,
349 aom_highbd_10_obmc_variance8x8_sse4_1, 10),
350 TestFuncs(aom_highbd_10_obmc_variance8x4_c,
351 aom_highbd_10_obmc_variance8x4_sse4_1, 10),
352 TestFuncs(aom_highbd_10_obmc_variance4x8_c,
353 aom_highbd_10_obmc_variance4x8_sse4_1, 10),
354 TestFuncs(aom_highbd_10_obmc_variance4x4_c,
355 aom_highbd_10_obmc_variance4x4_sse4_1, 10),
Yaowu Xuf883b422016-08-30 14:01:10 -0700356 TestFuncs(aom_highbd_12_obmc_variance128x128_c,
357 aom_highbd_12_obmc_variance128x128_sse4_1, 12),
358 TestFuncs(aom_highbd_12_obmc_variance128x64_c,
359 aom_highbd_12_obmc_variance128x64_sse4_1, 12),
360 TestFuncs(aom_highbd_12_obmc_variance64x128_c,
361 aom_highbd_12_obmc_variance64x128_sse4_1, 12),
Yaowu Xuf883b422016-08-30 14:01:10 -0700362 TestFuncs(aom_highbd_12_obmc_variance64x64_c,
363 aom_highbd_12_obmc_variance64x64_sse4_1, 12),
364 TestFuncs(aom_highbd_12_obmc_variance64x32_c,
365 aom_highbd_12_obmc_variance64x32_sse4_1, 12),
366 TestFuncs(aom_highbd_12_obmc_variance32x64_c,
367 aom_highbd_12_obmc_variance32x64_sse4_1, 12),
368 TestFuncs(aom_highbd_12_obmc_variance32x32_c,
369 aom_highbd_12_obmc_variance32x32_sse4_1, 12),
370 TestFuncs(aom_highbd_12_obmc_variance32x16_c,
371 aom_highbd_12_obmc_variance32x16_sse4_1, 12),
372 TestFuncs(aom_highbd_12_obmc_variance16x32_c,
373 aom_highbd_12_obmc_variance16x32_sse4_1, 12),
374 TestFuncs(aom_highbd_12_obmc_variance16x16_c,
375 aom_highbd_12_obmc_variance16x16_sse4_1, 12),
376 TestFuncs(aom_highbd_12_obmc_variance16x8_c,
377 aom_highbd_12_obmc_variance16x8_sse4_1, 12),
378 TestFuncs(aom_highbd_12_obmc_variance8x16_c,
379 aom_highbd_12_obmc_variance8x16_sse4_1, 12),
380 TestFuncs(aom_highbd_12_obmc_variance8x8_c,
381 aom_highbd_12_obmc_variance8x8_sse4_1, 12),
382 TestFuncs(aom_highbd_12_obmc_variance8x4_c,
383 aom_highbd_12_obmc_variance8x4_sse4_1, 12),
384 TestFuncs(aom_highbd_12_obmc_variance4x8_c,
385 aom_highbd_12_obmc_variance4x8_sse4_1, 12),
386 TestFuncs(aom_highbd_12_obmc_variance4x4_c,
Debargha Mukherjee5427c0c2019-07-17 10:49:09 -0700387 aom_highbd_12_obmc_variance4x4_sse4_1, 12),
388
389 TestFuncs(aom_highbd_obmc_variance64x16_c,
390 aom_highbd_obmc_variance64x16_sse4_1, 8),
391 TestFuncs(aom_highbd_obmc_variance16x64_c,
392 aom_highbd_obmc_variance16x64_sse4_1, 8),
393 TestFuncs(aom_highbd_obmc_variance32x8_c, aom_highbd_obmc_variance32x8_sse4_1,
394 8),
395 TestFuncs(aom_highbd_obmc_variance8x32_c, aom_highbd_obmc_variance8x32_sse4_1,
396 8),
397 TestFuncs(aom_highbd_obmc_variance16x4_c, aom_highbd_obmc_variance16x4_sse4_1,
398 8),
399 TestFuncs(aom_highbd_obmc_variance4x16_c, aom_highbd_obmc_variance4x16_sse4_1,
400 8),
401 TestFuncs(aom_highbd_10_obmc_variance64x16_c,
402 aom_highbd_10_obmc_variance64x16_sse4_1, 10),
403 TestFuncs(aom_highbd_10_obmc_variance16x64_c,
404 aom_highbd_10_obmc_variance16x64_sse4_1, 10),
405 TestFuncs(aom_highbd_10_obmc_variance32x8_c,
406 aom_highbd_10_obmc_variance32x8_sse4_1, 10),
407 TestFuncs(aom_highbd_10_obmc_variance8x32_c,
408 aom_highbd_10_obmc_variance8x32_sse4_1, 10),
409 TestFuncs(aom_highbd_10_obmc_variance16x4_c,
410 aom_highbd_10_obmc_variance16x4_sse4_1, 10),
411 TestFuncs(aom_highbd_10_obmc_variance4x16_c,
412 aom_highbd_10_obmc_variance4x16_sse4_1, 10),
413 TestFuncs(aom_highbd_12_obmc_variance64x16_c,
414 aom_highbd_12_obmc_variance64x16_sse4_1, 12),
415 TestFuncs(aom_highbd_12_obmc_variance16x64_c,
416 aom_highbd_12_obmc_variance16x64_sse4_1, 12),
417 TestFuncs(aom_highbd_12_obmc_variance32x8_c,
418 aom_highbd_12_obmc_variance32x8_sse4_1, 12),
419 TestFuncs(aom_highbd_12_obmc_variance8x32_c,
420 aom_highbd_12_obmc_variance8x32_sse4_1, 12),
421 TestFuncs(aom_highbd_12_obmc_variance16x4_c,
422 aom_highbd_12_obmc_variance16x4_sse4_1, 12),
423 TestFuncs(aom_highbd_12_obmc_variance4x16_c,
424 aom_highbd_12_obmc_variance4x16_sse4_1, 12),
Geza Loreebc2d342016-07-12 11:41:54 +0100425};
426
Cheng Chen96786fe2020-02-14 17:28:25 -0800427INSTANTIATE_TEST_SUITE_P(SSE4_1, ObmcVarianceHBDTest,
428 ::testing::ValuesIn(sse4_functions_hbd));
Geza Loreebc2d342016-07-12 11:41:54 +0100429#endif // HAVE_SSE4_1
Jerome Jiangfa1d1732019-08-06 10:31:20 -0700430#endif // CONFIG_AV1_HIGHBITDEPTH
Geza Loreebc2d342016-07-12 11:41:54 +0100431} // namespace