Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: source/libvpx/test/sad_test.cc

Issue 341293003: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/test/resize_util.sh ('k') | source/libvpx/test/simple_decoder.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 11 matching lines...) Expand all
22 #endif 22 #endif
23 #include "vpx_mem/vpx_mem.h" 23 #include "vpx_mem/vpx_mem.h"
24 24
25 #include "test/acm_random.h" 25 #include "test/acm_random.h"
26 #include "test/clear_system_state.h" 26 #include "test/clear_system_state.h"
27 #include "test/register_state_check.h" 27 #include "test/register_state_check.h"
28 #include "test/util.h" 28 #include "test/util.h"
29 #include "third_party/googletest/src/include/gtest/gtest.h" 29 #include "third_party/googletest/src/include/gtest/gtest.h"
30 30
31 31
32 #if CONFIG_VP8_ENCODER
32 typedef unsigned int (*sad_m_by_n_fn_t)(const unsigned char *source_ptr, 33 typedef unsigned int (*sad_m_by_n_fn_t)(const unsigned char *source_ptr,
33 int source_stride, 34 int source_stride,
34 const unsigned char *reference_ptr, 35 const unsigned char *reference_ptr,
35 int reference_stride, 36 int reference_stride,
36 unsigned int max_sad); 37 unsigned int max_sad);
37 typedef std::tr1::tuple<int, int, sad_m_by_n_fn_t> sad_m_by_n_test_param_t; 38 typedef std::tr1::tuple<int, int, sad_m_by_n_fn_t> sad_m_by_n_test_param_t;
39 #endif
40 #if CONFIG_VP9_ENCODER
41 typedef unsigned int (*sad_m_by_n_fn_vp9_t)(const unsigned char *source_ptr,
42 int source_stride,
43 const unsigned char *reference_ptr,
44 int reference_stride);
45 typedef std::tr1::tuple<int, int, sad_m_by_n_fn_vp9_t>
46 sad_m_by_n_test_param_vp9_t;
47 #endif
38 48
39 typedef void (*sad_n_by_n_by_4_fn_t)(const uint8_t *src_ptr, 49 typedef void (*sad_n_by_n_by_4_fn_t)(const uint8_t *src_ptr,
40 int src_stride, 50 int src_stride,
41 const unsigned char * const ref_ptr[], 51 const unsigned char * const ref_ptr[],
42 int ref_stride, 52 int ref_stride,
43 unsigned int *sad_array); 53 unsigned int *sad_array);
44 typedef std::tr1::tuple<int, int, sad_n_by_n_by_4_fn_t> 54 typedef std::tr1::tuple<int, int, sad_n_by_n_by_4_fn_t>
45 sad_n_by_n_by_4_test_param_t; 55 sad_n_by_n_by_4_test_param_t;
46 56
47 using libvpx_test::ACMRandom; 57 using libvpx_test::ACMRandom;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 reference_stride_ = width_ * 2; 90 reference_stride_ = width_ * 2;
81 rnd_.Reset(ACMRandom::DeterministicSeed()); 91 rnd_.Reset(ACMRandom::DeterministicSeed());
82 } 92 }
83 93
84 virtual uint8_t* GetReference(int block_idx) { 94 virtual uint8_t* GetReference(int block_idx) {
85 return reference_data_ + block_idx * kDataBlockSize; 95 return reference_data_ + block_idx * kDataBlockSize;
86 } 96 }
87 97
88 // Sum of Absolute Differences. Given two blocks, calculate the absolute 98 // Sum of Absolute Differences. Given two blocks, calculate the absolute
89 // difference between two pixels in the same relative location; accumulate. 99 // difference between two pixels in the same relative location; accumulate.
90 unsigned int ReferenceSAD(unsigned int max_sad, int block_idx = 0) { 100 unsigned int ReferenceSAD(unsigned int max_sad, int block_idx) {
91 unsigned int sad = 0; 101 unsigned int sad = 0;
92 const uint8_t* const reference = GetReference(block_idx); 102 const uint8_t* const reference = GetReference(block_idx);
93 103
94 for (int h = 0; h < height_; ++h) { 104 for (int h = 0; h < height_; ++h) {
95 for (int w = 0; w < width_; ++w) { 105 for (int w = 0; w < width_; ++w) {
96 sad += abs(source_data_[h * source_stride_ + w] 106 sad += abs(source_data_[h * source_stride_ + w]
97 - reference[h * reference_stride_ + w]); 107 - reference[h * reference_stride_ + w]);
98 } 108 }
99 if (sad > max_sad) { 109 if (sad > max_sad) {
100 break; 110 break;
(...skipping 20 matching lines...) Expand all
121 131
122 int width_, height_; 132 int width_, height_;
123 static uint8_t* source_data_; 133 static uint8_t* source_data_;
124 int source_stride_; 134 int source_stride_;
125 static uint8_t* reference_data_; 135 static uint8_t* reference_data_;
126 int reference_stride_; 136 int reference_stride_;
127 137
128 ACMRandom rnd_; 138 ACMRandom rnd_;
129 }; 139 };
130 140
131 class SADTest : public SADTestBase, 141 class SADx4Test
132 public ::testing::WithParamInterface<sad_m_by_n_test_param_t> { 142 : public SADTestBase,
143 public ::testing::WithParamInterface<sad_n_by_n_by_4_test_param_t> {
144 public:
145 SADx4Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1)) {}
146
147 protected:
148 void SADs(unsigned int *results) {
149 const uint8_t* refs[] = {GetReference(0), GetReference(1),
150 GetReference(2), GetReference(3)};
151
152 REGISTER_STATE_CHECK(GET_PARAM(2)(source_data_, source_stride_,
153 refs, reference_stride_,
154 results));
155 }
156
157 void CheckSADs() {
158 unsigned int reference_sad, exp_sad[4];
159
160 SADs(exp_sad);
161 for (int block = 0; block < 4; ++block) {
162 reference_sad = ReferenceSAD(UINT_MAX, block);
163
164 EXPECT_EQ(reference_sad, exp_sad[block]) << "block " << block;
165 }
166 }
167 };
168
169 #if CONFIG_VP8_ENCODER
170 class SADTest
171 : public SADTestBase,
172 public ::testing::WithParamInterface<sad_m_by_n_test_param_t> {
133 public: 173 public:
134 SADTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1)) {} 174 SADTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1)) {}
135 175
136 protected: 176 protected:
137 unsigned int SAD(unsigned int max_sad, int block_idx = 0) { 177 unsigned int SAD(unsigned int max_sad, int block_idx) {
138 unsigned int ret; 178 unsigned int ret;
139 const uint8_t* const reference = GetReference(block_idx); 179 const uint8_t* const reference = GetReference(block_idx);
140 180
141 REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, 181 REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_,
142 reference, reference_stride_, 182 reference, reference_stride_,
143 max_sad)); 183 max_sad));
144 return ret; 184 return ret;
145 } 185 }
146 186
147 void CheckSad(unsigned int max_sad) { 187 void CheckSAD(unsigned int max_sad) {
148 unsigned int reference_sad, exp_sad; 188 const unsigned int reference_sad = ReferenceSAD(max_sad, 0);
149 189 const unsigned int exp_sad = SAD(max_sad, 0);
150 reference_sad = ReferenceSAD(max_sad);
151 exp_sad = SAD(max_sad);
152 190
153 if (reference_sad <= max_sad) { 191 if (reference_sad <= max_sad) {
154 ASSERT_EQ(exp_sad, reference_sad); 192 ASSERT_EQ(exp_sad, reference_sad);
155 } else { 193 } else {
156 // Alternative implementations are not required to check max_sad 194 // Alternative implementations are not required to check max_sad
157 ASSERT_GE(exp_sad, reference_sad); 195 ASSERT_GE(exp_sad, reference_sad);
158 } 196 }
159 } 197 }
160 }; 198 };
199 #endif // CONFIG_VP8_ENCODER
161 200
162 class SADx4Test : public SADTestBase, 201 #if CONFIG_VP9_ENCODER
163 public ::testing::WithParamInterface<sad_n_by_n_by_4_test_param_t> { 202 class SADVP9Test
203 : public SADTestBase,
204 public ::testing::WithParamInterface<sad_m_by_n_test_param_vp9_t> {
164 public: 205 public:
165 SADx4Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1)) {} 206 SADVP9Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1)) {}
166 207
167 protected: 208 protected:
168 void SADs(unsigned int *results) { 209 unsigned int SAD(int block_idx) {
169 const uint8_t* refs[] = {GetReference(0), GetReference(1), 210 unsigned int ret;
170 GetReference(2), GetReference(3)}; 211 const uint8_t* const reference = GetReference(block_idx);
171 212
172 REGISTER_STATE_CHECK(GET_PARAM(2)(source_data_, source_stride_, 213 REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_,
173 refs, reference_stride_, 214 reference, reference_stride_));
174 results)); 215 return ret;
175 } 216 }
176 217
177 void CheckSADs() { 218 void CheckSAD() {
178 unsigned int reference_sad, exp_sad[4]; 219 const unsigned int reference_sad = ReferenceSAD(UINT_MAX, 0);
220 const unsigned int exp_sad = SAD(0);
179 221
180 SADs(exp_sad); 222 ASSERT_EQ(reference_sad, exp_sad);
181 for (int block = 0; block < 4; block++) {
182 reference_sad = ReferenceSAD(UINT_MAX, block);
183
184 EXPECT_EQ(exp_sad[block], reference_sad) << "block " << block;
185 }
186 } 223 }
187 }; 224 };
225 #endif // CONFIG_VP9_ENCODER
188 226
189 uint8_t* SADTestBase::source_data_ = NULL; 227 uint8_t* SADTestBase::source_data_ = NULL;
190 uint8_t* SADTestBase::reference_data_ = NULL; 228 uint8_t* SADTestBase::reference_data_ = NULL;
191 229
230 #if CONFIG_VP8_ENCODER
192 TEST_P(SADTest, MaxRef) { 231 TEST_P(SADTest, MaxRef) {
193 FillConstant(source_data_, source_stride_, 0); 232 FillConstant(source_data_, source_stride_, 0);
194 FillConstant(reference_data_, reference_stride_, 255); 233 FillConstant(reference_data_, reference_stride_, 255);
195 CheckSad(UINT_MAX); 234 CheckSAD(UINT_MAX);
196 } 235 }
197 236
237 TEST_P(SADTest, MaxSrc) {
238 FillConstant(source_data_, source_stride_, 255);
239 FillConstant(reference_data_, reference_stride_, 0);
240 CheckSAD(UINT_MAX);
241 }
242
243 TEST_P(SADTest, ShortRef) {
244 int tmp_stride = reference_stride_;
245 reference_stride_ >>= 1;
246 FillRandom(source_data_, source_stride_);
247 FillRandom(reference_data_, reference_stride_);
248 CheckSAD(UINT_MAX);
249 reference_stride_ = tmp_stride;
250 }
251
252 TEST_P(SADTest, UnalignedRef) {
253 // The reference frame, but not the source frame, may be unaligned for
254 // certain types of searches.
255 const int tmp_stride = reference_stride_;
256 reference_stride_ -= 1;
257 FillRandom(source_data_, source_stride_);
258 FillRandom(reference_data_, reference_stride_);
259 CheckSAD(UINT_MAX);
260 reference_stride_ = tmp_stride;
261 }
262
263 TEST_P(SADTest, ShortSrc) {
264 const int tmp_stride = source_stride_;
265 source_stride_ >>= 1;
266 FillRandom(source_data_, source_stride_);
267 FillRandom(reference_data_, reference_stride_);
268 CheckSAD(UINT_MAX);
269 source_stride_ = tmp_stride;
270 }
271
272 TEST_P(SADTest, MaxSAD) {
273 // Verify that, when max_sad is set, the implementation does not return a
274 // value lower than the reference.
275 FillConstant(source_data_, source_stride_, 255);
276 FillConstant(reference_data_, reference_stride_, 0);
277 CheckSAD(128);
278 }
279 #endif // CONFIG_VP8_ENCODER
280
281 #if CONFIG_VP9_ENCODER
282 TEST_P(SADVP9Test, MaxRef) {
283 FillConstant(source_data_, source_stride_, 0);
284 FillConstant(reference_data_, reference_stride_, 255);
285 CheckSAD();
286 }
287
288 TEST_P(SADVP9Test, MaxSrc) {
289 FillConstant(source_data_, source_stride_, 255);
290 FillConstant(reference_data_, reference_stride_, 0);
291 CheckSAD();
292 }
293
294 TEST_P(SADVP9Test, ShortRef) {
295 const int tmp_stride = reference_stride_;
296 reference_stride_ >>= 1;
297 FillRandom(source_data_, source_stride_);
298 FillRandom(reference_data_, reference_stride_);
299 CheckSAD();
300 reference_stride_ = tmp_stride;
301 }
302
303 TEST_P(SADVP9Test, UnalignedRef) {
304 // The reference frame, but not the source frame, may be unaligned for
305 // certain types of searches.
306 const int tmp_stride = reference_stride_;
307 reference_stride_ -= 1;
308 FillRandom(source_data_, source_stride_);
309 FillRandom(reference_data_, reference_stride_);
310 CheckSAD();
311 reference_stride_ = tmp_stride;
312 }
313
314 TEST_P(SADVP9Test, ShortSrc) {
315 const int tmp_stride = source_stride_;
316 source_stride_ >>= 1;
317 FillRandom(source_data_, source_stride_);
318 FillRandom(reference_data_, reference_stride_);
319 CheckSAD();
320 source_stride_ = tmp_stride;
321 }
322 #endif // CONFIG_VP9_ENCODER
323
198 TEST_P(SADx4Test, MaxRef) { 324 TEST_P(SADx4Test, MaxRef) {
199 FillConstant(source_data_, source_stride_, 0); 325 FillConstant(source_data_, source_stride_, 0);
200 FillConstant(GetReference(0), reference_stride_, 255); 326 FillConstant(GetReference(0), reference_stride_, 255);
201 FillConstant(GetReference(1), reference_stride_, 255); 327 FillConstant(GetReference(1), reference_stride_, 255);
202 FillConstant(GetReference(2), reference_stride_, 255); 328 FillConstant(GetReference(2), reference_stride_, 255);
203 FillConstant(GetReference(3), reference_stride_, 255); 329 FillConstant(GetReference(3), reference_stride_, 255);
204 CheckSADs(); 330 CheckSADs();
205 } 331 }
206 332
207 TEST_P(SADTest, MaxSrc) {
208 FillConstant(source_data_, source_stride_, 255);
209 FillConstant(reference_data_, reference_stride_, 0);
210 CheckSad(UINT_MAX);
211 }
212
213 TEST_P(SADx4Test, MaxSrc) { 333 TEST_P(SADx4Test, MaxSrc) {
214 FillConstant(source_data_, source_stride_, 255); 334 FillConstant(source_data_, source_stride_, 255);
215 FillConstant(GetReference(0), reference_stride_, 0); 335 FillConstant(GetReference(0), reference_stride_, 0);
216 FillConstant(GetReference(1), reference_stride_, 0); 336 FillConstant(GetReference(1), reference_stride_, 0);
217 FillConstant(GetReference(2), reference_stride_, 0); 337 FillConstant(GetReference(2), reference_stride_, 0);
218 FillConstant(GetReference(3), reference_stride_, 0); 338 FillConstant(GetReference(3), reference_stride_, 0);
219 CheckSADs(); 339 CheckSADs();
220 } 340 }
221 341
222 TEST_P(SADTest, ShortRef) {
223 int tmp_stride = reference_stride_;
224 reference_stride_ >>= 1;
225 FillRandom(source_data_, source_stride_);
226 FillRandom(reference_data_, reference_stride_);
227 CheckSad(UINT_MAX);
228 reference_stride_ = tmp_stride;
229 }
230
231 TEST_P(SADx4Test, ShortRef) { 342 TEST_P(SADx4Test, ShortRef) {
232 int tmp_stride = reference_stride_; 343 int tmp_stride = reference_stride_;
233 reference_stride_ >>= 1; 344 reference_stride_ >>= 1;
234 FillRandom(source_data_, source_stride_); 345 FillRandom(source_data_, source_stride_);
235 FillRandom(GetReference(0), reference_stride_); 346 FillRandom(GetReference(0), reference_stride_);
236 FillRandom(GetReference(1), reference_stride_); 347 FillRandom(GetReference(1), reference_stride_);
237 FillRandom(GetReference(2), reference_stride_); 348 FillRandom(GetReference(2), reference_stride_);
238 FillRandom(GetReference(3), reference_stride_); 349 FillRandom(GetReference(3), reference_stride_);
239 CheckSADs(); 350 CheckSADs();
240 reference_stride_ = tmp_stride; 351 reference_stride_ = tmp_stride;
241 } 352 }
242 353
243 TEST_P(SADTest, UnalignedRef) {
244 // The reference frame, but not the source frame, may be unaligned for
245 // certain types of searches.
246 int tmp_stride = reference_stride_;
247 reference_stride_ -= 1;
248 FillRandom(source_data_, source_stride_);
249 FillRandom(reference_data_, reference_stride_);
250 CheckSad(UINT_MAX);
251 reference_stride_ = tmp_stride;
252 }
253
254 TEST_P(SADx4Test, UnalignedRef) { 354 TEST_P(SADx4Test, UnalignedRef) {
255 // The reference frame, but not the source frame, may be unaligned for 355 // The reference frame, but not the source frame, may be unaligned for
256 // certain types of searches. 356 // certain types of searches.
257 int tmp_stride = reference_stride_; 357 int tmp_stride = reference_stride_;
258 reference_stride_ -= 1; 358 reference_stride_ -= 1;
259 FillRandom(source_data_, source_stride_); 359 FillRandom(source_data_, source_stride_);
260 FillRandom(GetReference(0), reference_stride_); 360 FillRandom(GetReference(0), reference_stride_);
261 FillRandom(GetReference(1), reference_stride_); 361 FillRandom(GetReference(1), reference_stride_);
262 FillRandom(GetReference(2), reference_stride_); 362 FillRandom(GetReference(2), reference_stride_);
263 FillRandom(GetReference(3), reference_stride_); 363 FillRandom(GetReference(3), reference_stride_);
264 CheckSADs(); 364 CheckSADs();
265 reference_stride_ = tmp_stride; 365 reference_stride_ = tmp_stride;
266 } 366 }
267 367
268 TEST_P(SADTest, ShortSrc) {
269 int tmp_stride = source_stride_;
270 source_stride_ >>= 1;
271 FillRandom(source_data_, source_stride_);
272 FillRandom(reference_data_, reference_stride_);
273 CheckSad(UINT_MAX);
274 source_stride_ = tmp_stride;
275 }
276
277 TEST_P(SADx4Test, ShortSrc) { 368 TEST_P(SADx4Test, ShortSrc) {
278 int tmp_stride = source_stride_; 369 int tmp_stride = source_stride_;
279 source_stride_ >>= 1; 370 source_stride_ >>= 1;
280 FillRandom(source_data_, source_stride_); 371 FillRandom(source_data_, source_stride_);
281 FillRandom(GetReference(0), reference_stride_); 372 FillRandom(GetReference(0), reference_stride_);
282 FillRandom(GetReference(1), reference_stride_); 373 FillRandom(GetReference(1), reference_stride_);
283 FillRandom(GetReference(2), reference_stride_); 374 FillRandom(GetReference(2), reference_stride_);
284 FillRandom(GetReference(3), reference_stride_); 375 FillRandom(GetReference(3), reference_stride_);
285 CheckSADs(); 376 CheckSADs();
286 source_stride_ = tmp_stride; 377 source_stride_ = tmp_stride;
287 } 378 }
288 379
289 TEST_P(SADTest, MaxSAD) {
290 // Verify that, when max_sad is set, the implementation does not return a
291 // value lower than the reference.
292 FillConstant(source_data_, source_stride_, 255);
293 FillConstant(reference_data_, reference_stride_, 0);
294 CheckSad(128);
295 }
296
297 using std::tr1::make_tuple; 380 using std::tr1::make_tuple;
298 381
299 //------------------------------------------------------------------------------ 382 //------------------------------------------------------------------------------
300 // C functions 383 // C functions
301 #if CONFIG_VP8_ENCODER 384 #if CONFIG_VP8_ENCODER
302 const sad_m_by_n_fn_t sad_16x16_c = vp8_sad16x16_c; 385 const sad_m_by_n_fn_t sad_16x16_c = vp8_sad16x16_c;
303 const sad_m_by_n_fn_t sad_8x16_c = vp8_sad8x16_c; 386 const sad_m_by_n_fn_t sad_8x16_c = vp8_sad8x16_c;
304 const sad_m_by_n_fn_t sad_16x8_c = vp8_sad16x8_c; 387 const sad_m_by_n_fn_t sad_16x8_c = vp8_sad16x8_c;
305 const sad_m_by_n_fn_t sad_8x8_c = vp8_sad8x8_c; 388 const sad_m_by_n_fn_t sad_8x8_c = vp8_sad8x8_c;
306 const sad_m_by_n_fn_t sad_4x4_c = vp8_sad4x4_c; 389 const sad_m_by_n_fn_t sad_4x4_c = vp8_sad4x4_c;
307 #endif
308 #if CONFIG_VP9_ENCODER
309 const sad_m_by_n_fn_t sad_64x64_c_vp9 = vp9_sad64x64_c;
310 const sad_m_by_n_fn_t sad_32x32_c_vp9 = vp9_sad32x32_c;
311 const sad_m_by_n_fn_t sad_16x16_c_vp9 = vp9_sad16x16_c;
312 const sad_m_by_n_fn_t sad_8x16_c_vp9 = vp9_sad8x16_c;
313 const sad_m_by_n_fn_t sad_16x8_c_vp9 = vp9_sad16x8_c;
314 const sad_m_by_n_fn_t sad_8x8_c_vp9 = vp9_sad8x8_c;
315 const sad_m_by_n_fn_t sad_8x4_c_vp9 = vp9_sad8x4_c;
316 const sad_m_by_n_fn_t sad_4x8_c_vp9 = vp9_sad4x8_c;
317 const sad_m_by_n_fn_t sad_4x4_c_vp9 = vp9_sad4x4_c;
318 #endif
319 const sad_m_by_n_test_param_t c_tests[] = { 390 const sad_m_by_n_test_param_t c_tests[] = {
320 #if CONFIG_VP8_ENCODER
321 make_tuple(16, 16, sad_16x16_c), 391 make_tuple(16, 16, sad_16x16_c),
322 make_tuple(8, 16, sad_8x16_c), 392 make_tuple(8, 16, sad_8x16_c),
323 make_tuple(16, 8, sad_16x8_c), 393 make_tuple(16, 8, sad_16x8_c),
324 make_tuple(8, 8, sad_8x8_c), 394 make_tuple(8, 8, sad_8x8_c),
325 make_tuple(4, 4, sad_4x4_c), 395 make_tuple(4, 4, sad_4x4_c),
326 #endif 396 };
397 INSTANTIATE_TEST_CASE_P(C, SADTest, ::testing::ValuesIn(c_tests));
398 #endif // CONFIG_VP8_ENCODER
399
327 #if CONFIG_VP9_ENCODER 400 #if CONFIG_VP9_ENCODER
401 const sad_m_by_n_fn_vp9_t sad_64x64_c_vp9 = vp9_sad64x64_c;
402 const sad_m_by_n_fn_vp9_t sad_32x32_c_vp9 = vp9_sad32x32_c;
403 const sad_m_by_n_fn_vp9_t sad_16x16_c_vp9 = vp9_sad16x16_c;
404 const sad_m_by_n_fn_vp9_t sad_8x16_c_vp9 = vp9_sad8x16_c;
405 const sad_m_by_n_fn_vp9_t sad_16x8_c_vp9 = vp9_sad16x8_c;
406 const sad_m_by_n_fn_vp9_t sad_8x8_c_vp9 = vp9_sad8x8_c;
407 const sad_m_by_n_fn_vp9_t sad_8x4_c_vp9 = vp9_sad8x4_c;
408 const sad_m_by_n_fn_vp9_t sad_4x8_c_vp9 = vp9_sad4x8_c;
409 const sad_m_by_n_fn_vp9_t sad_4x4_c_vp9 = vp9_sad4x4_c;
410 const sad_m_by_n_test_param_vp9_t c_vp9_tests[] = {
328 make_tuple(64, 64, sad_64x64_c_vp9), 411 make_tuple(64, 64, sad_64x64_c_vp9),
329 make_tuple(32, 32, sad_32x32_c_vp9), 412 make_tuple(32, 32, sad_32x32_c_vp9),
330 make_tuple(16, 16, sad_16x16_c_vp9), 413 make_tuple(16, 16, sad_16x16_c_vp9),
331 make_tuple(8, 16, sad_8x16_c_vp9), 414 make_tuple(8, 16, sad_8x16_c_vp9),
332 make_tuple(16, 8, sad_16x8_c_vp9), 415 make_tuple(16, 8, sad_16x8_c_vp9),
333 make_tuple(8, 8, sad_8x8_c_vp9), 416 make_tuple(8, 8, sad_8x8_c_vp9),
334 make_tuple(8, 4, sad_8x4_c_vp9), 417 make_tuple(8, 4, sad_8x4_c_vp9),
335 make_tuple(4, 8, sad_4x8_c_vp9), 418 make_tuple(4, 8, sad_4x8_c_vp9),
336 make_tuple(4, 4, sad_4x4_c_vp9), 419 make_tuple(4, 4, sad_4x4_c_vp9),
337 #endif
338 }; 420 };
339 INSTANTIATE_TEST_CASE_P(C, SADTest, ::testing::ValuesIn(c_tests)); 421 INSTANTIATE_TEST_CASE_P(C, SADVP9Test, ::testing::ValuesIn(c_vp9_tests));
340 422
341 #if CONFIG_VP9_ENCODER
342 const sad_n_by_n_by_4_fn_t sad_64x64x4d_c = vp9_sad64x64x4d_c; 423 const sad_n_by_n_by_4_fn_t sad_64x64x4d_c = vp9_sad64x64x4d_c;
343 const sad_n_by_n_by_4_fn_t sad_64x32x4d_c = vp9_sad64x32x4d_c; 424 const sad_n_by_n_by_4_fn_t sad_64x32x4d_c = vp9_sad64x32x4d_c;
344 const sad_n_by_n_by_4_fn_t sad_32x64x4d_c = vp9_sad32x64x4d_c; 425 const sad_n_by_n_by_4_fn_t sad_32x64x4d_c = vp9_sad32x64x4d_c;
345 const sad_n_by_n_by_4_fn_t sad_32x32x4d_c = vp9_sad32x32x4d_c; 426 const sad_n_by_n_by_4_fn_t sad_32x32x4d_c = vp9_sad32x32x4d_c;
346 const sad_n_by_n_by_4_fn_t sad_32x16x4d_c = vp9_sad32x16x4d_c; 427 const sad_n_by_n_by_4_fn_t sad_32x16x4d_c = vp9_sad32x16x4d_c;
347 const sad_n_by_n_by_4_fn_t sad_16x32x4d_c = vp9_sad16x32x4d_c; 428 const sad_n_by_n_by_4_fn_t sad_16x32x4d_c = vp9_sad16x32x4d_c;
348 const sad_n_by_n_by_4_fn_t sad_16x16x4d_c = vp9_sad16x16x4d_c; 429 const sad_n_by_n_by_4_fn_t sad_16x16x4d_c = vp9_sad16x16x4d_c;
349 const sad_n_by_n_by_4_fn_t sad_16x8x4d_c = vp9_sad16x8x4d_c; 430 const sad_n_by_n_by_4_fn_t sad_16x8x4d_c = vp9_sad16x8x4d_c;
350 const sad_n_by_n_by_4_fn_t sad_8x16x4d_c = vp9_sad8x16x4d_c; 431 const sad_n_by_n_by_4_fn_t sad_8x16x4d_c = vp9_sad8x16x4d_c;
351 const sad_n_by_n_by_4_fn_t sad_8x8x4d_c = vp9_sad8x8x4d_c; 432 const sad_n_by_n_by_4_fn_t sad_8x8x4d_c = vp9_sad8x8x4d_c;
(...skipping 16 matching lines...) Expand all
368 make_tuple(4, 4, sad_4x4x4d_c))); 449 make_tuple(4, 4, sad_4x4x4d_c)));
369 #endif // CONFIG_VP9_ENCODER 450 #endif // CONFIG_VP9_ENCODER
370 451
371 //------------------------------------------------------------------------------ 452 //------------------------------------------------------------------------------
372 // ARM functions 453 // ARM functions
373 #if HAVE_MEDIA 454 #if HAVE_MEDIA
374 #if CONFIG_VP8_ENCODER 455 #if CONFIG_VP8_ENCODER
375 const sad_m_by_n_fn_t sad_16x16_armv6 = vp8_sad16x16_armv6; 456 const sad_m_by_n_fn_t sad_16x16_armv6 = vp8_sad16x16_armv6;
376 INSTANTIATE_TEST_CASE_P(MEDIA, SADTest, ::testing::Values( 457 INSTANTIATE_TEST_CASE_P(MEDIA, SADTest, ::testing::Values(
377 make_tuple(16, 16, sad_16x16_armv6))); 458 make_tuple(16, 16, sad_16x16_armv6)));
378 #endif 459 #endif // CONFIG_VP8_ENCODER
379 #endif 460 #endif // HAVE_MEDIA
380 461
381 #if HAVE_NEON 462 #if HAVE_NEON
382 #if CONFIG_VP8_ENCODER 463 #if CONFIG_VP8_ENCODER
383 const sad_m_by_n_fn_t sad_16x16_neon = vp8_sad16x16_neon; 464 const sad_m_by_n_fn_t sad_16x16_neon = vp8_sad16x16_neon;
384 const sad_m_by_n_fn_t sad_8x16_neon = vp8_sad8x16_neon; 465 const sad_m_by_n_fn_t sad_8x16_neon = vp8_sad8x16_neon;
385 const sad_m_by_n_fn_t sad_16x8_neon = vp8_sad16x8_neon; 466 const sad_m_by_n_fn_t sad_16x8_neon = vp8_sad16x8_neon;
386 const sad_m_by_n_fn_t sad_8x8_neon = vp8_sad8x8_neon; 467 const sad_m_by_n_fn_t sad_8x8_neon = vp8_sad8x8_neon;
387 const sad_m_by_n_fn_t sad_4x4_neon = vp8_sad4x4_neon; 468 const sad_m_by_n_fn_t sad_4x4_neon = vp8_sad4x4_neon;
388 INSTANTIATE_TEST_CASE_P(NEON, SADTest, ::testing::Values( 469 INSTANTIATE_TEST_CASE_P(NEON, SADTest, ::testing::Values(
389 make_tuple(16, 16, sad_16x16_neon), 470 make_tuple(16, 16, sad_16x16_neon),
390 make_tuple(8, 16, sad_8x16_neon), 471 make_tuple(8, 16, sad_8x16_neon),
391 make_tuple(16, 8, sad_16x8_neon), 472 make_tuple(16, 8, sad_16x8_neon),
392 make_tuple(8, 8, sad_8x8_neon), 473 make_tuple(8, 8, sad_8x8_neon),
393 make_tuple(4, 4, sad_4x4_neon))); 474 make_tuple(4, 4, sad_4x4_neon)));
394 #endif 475 #endif // CONFIG_VP8_ENCODER
395 #endif 476 #endif // HAVE_NEON
396 477
397 //------------------------------------------------------------------------------ 478 //------------------------------------------------------------------------------
398 // x86 functions 479 // x86 functions
399 #if HAVE_MMX 480 #if HAVE_MMX
400 #if CONFIG_VP8_ENCODER 481 #if CONFIG_VP8_ENCODER
401 const sad_m_by_n_fn_t sad_16x16_mmx = vp8_sad16x16_mmx; 482 const sad_m_by_n_fn_t sad_16x16_mmx = vp8_sad16x16_mmx;
402 const sad_m_by_n_fn_t sad_8x16_mmx = vp8_sad8x16_mmx; 483 const sad_m_by_n_fn_t sad_8x16_mmx = vp8_sad8x16_mmx;
403 const sad_m_by_n_fn_t sad_16x8_mmx = vp8_sad16x8_mmx; 484 const sad_m_by_n_fn_t sad_16x8_mmx = vp8_sad16x8_mmx;
404 const sad_m_by_n_fn_t sad_8x8_mmx = vp8_sad8x8_mmx; 485 const sad_m_by_n_fn_t sad_8x8_mmx = vp8_sad8x8_mmx;
405 const sad_m_by_n_fn_t sad_4x4_mmx = vp8_sad4x4_mmx; 486 const sad_m_by_n_fn_t sad_4x4_mmx = vp8_sad4x4_mmx;
406 #endif
407 #if CONFIG_VP9_ENCODER
408 const sad_m_by_n_fn_t sad_16x16_mmx_vp9 = vp9_sad16x16_mmx;
409 const sad_m_by_n_fn_t sad_8x16_mmx_vp9 = vp9_sad8x16_mmx;
410 const sad_m_by_n_fn_t sad_16x8_mmx_vp9 = vp9_sad16x8_mmx;
411 const sad_m_by_n_fn_t sad_8x8_mmx_vp9 = vp9_sad8x8_mmx;
412 const sad_m_by_n_fn_t sad_4x4_mmx_vp9 = vp9_sad4x4_mmx;
413 #endif
414
415 const sad_m_by_n_test_param_t mmx_tests[] = { 487 const sad_m_by_n_test_param_t mmx_tests[] = {
416 #if CONFIG_VP8_ENCODER
417 make_tuple(16, 16, sad_16x16_mmx), 488 make_tuple(16, 16, sad_16x16_mmx),
418 make_tuple(8, 16, sad_8x16_mmx), 489 make_tuple(8, 16, sad_8x16_mmx),
419 make_tuple(16, 8, sad_16x8_mmx), 490 make_tuple(16, 8, sad_16x8_mmx),
420 make_tuple(8, 8, sad_8x8_mmx), 491 make_tuple(8, 8, sad_8x8_mmx),
421 make_tuple(4, 4, sad_4x4_mmx), 492 make_tuple(4, 4, sad_4x4_mmx),
422 #endif 493 };
494 INSTANTIATE_TEST_CASE_P(MMX, SADTest, ::testing::ValuesIn(mmx_tests));
495 #endif // CONFIG_VP8_ENCODER
496
423 #if CONFIG_VP9_ENCODER 497 #if CONFIG_VP9_ENCODER
498 const sad_m_by_n_fn_vp9_t sad_16x16_mmx_vp9 = vp9_sad16x16_mmx;
499 const sad_m_by_n_fn_vp9_t sad_8x16_mmx_vp9 = vp9_sad8x16_mmx;
500 const sad_m_by_n_fn_vp9_t sad_16x8_mmx_vp9 = vp9_sad16x8_mmx;
501 const sad_m_by_n_fn_vp9_t sad_8x8_mmx_vp9 = vp9_sad8x8_mmx;
502 const sad_m_by_n_fn_vp9_t sad_4x4_mmx_vp9 = vp9_sad4x4_mmx;
503 const sad_m_by_n_test_param_vp9_t mmx_vp9_tests[] = {
424 make_tuple(16, 16, sad_16x16_mmx_vp9), 504 make_tuple(16, 16, sad_16x16_mmx_vp9),
425 make_tuple(8, 16, sad_8x16_mmx_vp9), 505 make_tuple(8, 16, sad_8x16_mmx_vp9),
426 make_tuple(16, 8, sad_16x8_mmx_vp9), 506 make_tuple(16, 8, sad_16x8_mmx_vp9),
427 make_tuple(8, 8, sad_8x8_mmx_vp9), 507 make_tuple(8, 8, sad_8x8_mmx_vp9),
428 make_tuple(4, 4, sad_4x4_mmx_vp9), 508 make_tuple(4, 4, sad_4x4_mmx_vp9),
429 #endif
430 }; 509 };
431 INSTANTIATE_TEST_CASE_P(MMX, SADTest, ::testing::ValuesIn(mmx_tests)); 510 INSTANTIATE_TEST_CASE_P(MMX, SADVP9Test, ::testing::ValuesIn(mmx_vp9_tests));
432 #endif 511 #endif // CONFIG_VP9_ENCODER
512 #endif // HAVE_MMX
433 513
434 #if HAVE_SSE 514 #if HAVE_SSE
435 #if CONFIG_VP9_ENCODER 515 #if CONFIG_VP9_ENCODER
436 #if CONFIG_USE_X86INC 516 #if CONFIG_USE_X86INC
437 const sad_m_by_n_fn_t sad_4x4_sse_vp9 = vp9_sad4x4_sse; 517 const sad_m_by_n_fn_vp9_t sad_4x4_sse_vp9 = vp9_sad4x4_sse;
438 const sad_m_by_n_fn_t sad_4x8_sse_vp9 = vp9_sad4x8_sse; 518 const sad_m_by_n_fn_vp9_t sad_4x8_sse_vp9 = vp9_sad4x8_sse;
439 INSTANTIATE_TEST_CASE_P(SSE, SADTest, ::testing::Values( 519 INSTANTIATE_TEST_CASE_P(SSE, SADVP9Test, ::testing::Values(
440 make_tuple(4, 4, sad_4x4_sse_vp9), 520 make_tuple(4, 4, sad_4x4_sse_vp9),
441 make_tuple(4, 8, sad_4x8_sse_vp9))); 521 make_tuple(4, 8, sad_4x8_sse_vp9)));
442 522
443 const sad_n_by_n_by_4_fn_t sad_4x8x4d_sse = vp9_sad4x8x4d_sse; 523 const sad_n_by_n_by_4_fn_t sad_4x8x4d_sse = vp9_sad4x8x4d_sse;
444 const sad_n_by_n_by_4_fn_t sad_4x4x4d_sse = vp9_sad4x4x4d_sse; 524 const sad_n_by_n_by_4_fn_t sad_4x4x4d_sse = vp9_sad4x4x4d_sse;
445 INSTANTIATE_TEST_CASE_P(SSE, SADx4Test, ::testing::Values( 525 INSTANTIATE_TEST_CASE_P(SSE, SADx4Test, ::testing::Values(
446 make_tuple(4, 8, sad_4x8x4d_sse), 526 make_tuple(4, 8, sad_4x8x4d_sse),
447 make_tuple(4, 4, sad_4x4x4d_sse))); 527 make_tuple(4, 4, sad_4x4x4d_sse)));
448 #endif // CONFIG_USE_X86INC 528 #endif // CONFIG_USE_X86INC
449 #endif // CONFIG_VP9_ENCODER 529 #endif // CONFIG_VP9_ENCODER
450 #endif // HAVE_SSE 530 #endif // HAVE_SSE
451 531
452 #if HAVE_SSE2 532 #if HAVE_SSE2
453 #if CONFIG_VP8_ENCODER 533 #if CONFIG_VP8_ENCODER
454 const sad_m_by_n_fn_t sad_16x16_wmt = vp8_sad16x16_wmt; 534 const sad_m_by_n_fn_t sad_16x16_wmt = vp8_sad16x16_wmt;
455 const sad_m_by_n_fn_t sad_8x16_wmt = vp8_sad8x16_wmt; 535 const sad_m_by_n_fn_t sad_8x16_wmt = vp8_sad8x16_wmt;
456 const sad_m_by_n_fn_t sad_16x8_wmt = vp8_sad16x8_wmt; 536 const sad_m_by_n_fn_t sad_16x8_wmt = vp8_sad16x8_wmt;
457 const sad_m_by_n_fn_t sad_8x8_wmt = vp8_sad8x8_wmt; 537 const sad_m_by_n_fn_t sad_8x8_wmt = vp8_sad8x8_wmt;
458 const sad_m_by_n_fn_t sad_4x4_wmt = vp8_sad4x4_wmt; 538 const sad_m_by_n_fn_t sad_4x4_wmt = vp8_sad4x4_wmt;
459 #endif
460 #if CONFIG_VP9_ENCODER
461 #if CONFIG_USE_X86INC
462 const sad_m_by_n_fn_t sad_64x64_sse2_vp9 = vp9_sad64x64_sse2;
463 const sad_m_by_n_fn_t sad_64x32_sse2_vp9 = vp9_sad64x32_sse2;
464 const sad_m_by_n_fn_t sad_32x64_sse2_vp9 = vp9_sad32x64_sse2;
465 const sad_m_by_n_fn_t sad_32x32_sse2_vp9 = vp9_sad32x32_sse2;
466 const sad_m_by_n_fn_t sad_32x16_sse2_vp9 = vp9_sad32x16_sse2;
467 const sad_m_by_n_fn_t sad_16x32_sse2_vp9 = vp9_sad16x32_sse2;
468 const sad_m_by_n_fn_t sad_16x16_sse2_vp9 = vp9_sad16x16_sse2;
469 const sad_m_by_n_fn_t sad_16x8_sse2_vp9 = vp9_sad16x8_sse2;
470 const sad_m_by_n_fn_t sad_8x16_sse2_vp9 = vp9_sad8x16_sse2;
471 const sad_m_by_n_fn_t sad_8x8_sse2_vp9 = vp9_sad8x8_sse2;
472 const sad_m_by_n_fn_t sad_8x4_sse2_vp9 = vp9_sad8x4_sse2;
473 #endif
474 #endif
475 const sad_m_by_n_test_param_t sse2_tests[] = { 539 const sad_m_by_n_test_param_t sse2_tests[] = {
476 #if CONFIG_VP8_ENCODER
477 make_tuple(16, 16, sad_16x16_wmt), 540 make_tuple(16, 16, sad_16x16_wmt),
478 make_tuple(8, 16, sad_8x16_wmt), 541 make_tuple(8, 16, sad_8x16_wmt),
479 make_tuple(16, 8, sad_16x8_wmt), 542 make_tuple(16, 8, sad_16x8_wmt),
480 make_tuple(8, 8, sad_8x8_wmt), 543 make_tuple(8, 8, sad_8x8_wmt),
481 make_tuple(4, 4, sad_4x4_wmt), 544 make_tuple(4, 4, sad_4x4_wmt),
482 #endif 545 };
546 INSTANTIATE_TEST_CASE_P(SSE2, SADTest, ::testing::ValuesIn(sse2_tests));
547 #endif // CONFIG_VP8_ENCODER
548
483 #if CONFIG_VP9_ENCODER 549 #if CONFIG_VP9_ENCODER
484 #if CONFIG_USE_X86INC 550 #if CONFIG_USE_X86INC
551 const sad_m_by_n_fn_vp9_t sad_64x64_sse2_vp9 = vp9_sad64x64_sse2;
552 const sad_m_by_n_fn_vp9_t sad_64x32_sse2_vp9 = vp9_sad64x32_sse2;
553 const sad_m_by_n_fn_vp9_t sad_32x64_sse2_vp9 = vp9_sad32x64_sse2;
554 const sad_m_by_n_fn_vp9_t sad_32x32_sse2_vp9 = vp9_sad32x32_sse2;
555 const sad_m_by_n_fn_vp9_t sad_32x16_sse2_vp9 = vp9_sad32x16_sse2;
556 const sad_m_by_n_fn_vp9_t sad_16x32_sse2_vp9 = vp9_sad16x32_sse2;
557 const sad_m_by_n_fn_vp9_t sad_16x16_sse2_vp9 = vp9_sad16x16_sse2;
558 const sad_m_by_n_fn_vp9_t sad_16x8_sse2_vp9 = vp9_sad16x8_sse2;
559 const sad_m_by_n_fn_vp9_t sad_8x16_sse2_vp9 = vp9_sad8x16_sse2;
560 const sad_m_by_n_fn_vp9_t sad_8x8_sse2_vp9 = vp9_sad8x8_sse2;
561 const sad_m_by_n_fn_vp9_t sad_8x4_sse2_vp9 = vp9_sad8x4_sse2;
562 const sad_m_by_n_test_param_vp9_t sse2_vp9_tests[] = {
485 make_tuple(64, 64, sad_64x64_sse2_vp9), 563 make_tuple(64, 64, sad_64x64_sse2_vp9),
486 make_tuple(64, 32, sad_64x32_sse2_vp9), 564 make_tuple(64, 32, sad_64x32_sse2_vp9),
487 make_tuple(32, 64, sad_32x64_sse2_vp9), 565 make_tuple(32, 64, sad_32x64_sse2_vp9),
488 make_tuple(32, 32, sad_32x32_sse2_vp9), 566 make_tuple(32, 32, sad_32x32_sse2_vp9),
489 make_tuple(32, 16, sad_32x16_sse2_vp9), 567 make_tuple(32, 16, sad_32x16_sse2_vp9),
490 make_tuple(16, 32, sad_16x32_sse2_vp9), 568 make_tuple(16, 32, sad_16x32_sse2_vp9),
491 make_tuple(16, 16, sad_16x16_sse2_vp9), 569 make_tuple(16, 16, sad_16x16_sse2_vp9),
492 make_tuple(16, 8, sad_16x8_sse2_vp9), 570 make_tuple(16, 8, sad_16x8_sse2_vp9),
493 make_tuple(8, 16, sad_8x16_sse2_vp9), 571 make_tuple(8, 16, sad_8x16_sse2_vp9),
494 make_tuple(8, 8, sad_8x8_sse2_vp9), 572 make_tuple(8, 8, sad_8x8_sse2_vp9),
495 make_tuple(8, 4, sad_8x4_sse2_vp9), 573 make_tuple(8, 4, sad_8x4_sse2_vp9),
496 #endif
497 #endif
498 }; 574 };
499 INSTANTIATE_TEST_CASE_P(SSE2, SADTest, ::testing::ValuesIn(sse2_tests)); 575 INSTANTIATE_TEST_CASE_P(SSE2, SADVP9Test, ::testing::ValuesIn(sse2_vp9_tests));
500 576
501 #if CONFIG_VP9_ENCODER
502 #if CONFIG_USE_X86INC
503 const sad_n_by_n_by_4_fn_t sad_64x64x4d_sse2 = vp9_sad64x64x4d_sse2; 577 const sad_n_by_n_by_4_fn_t sad_64x64x4d_sse2 = vp9_sad64x64x4d_sse2;
504 const sad_n_by_n_by_4_fn_t sad_64x32x4d_sse2 = vp9_sad64x32x4d_sse2; 578 const sad_n_by_n_by_4_fn_t sad_64x32x4d_sse2 = vp9_sad64x32x4d_sse2;
505 const sad_n_by_n_by_4_fn_t sad_32x64x4d_sse2 = vp9_sad32x64x4d_sse2; 579 const sad_n_by_n_by_4_fn_t sad_32x64x4d_sse2 = vp9_sad32x64x4d_sse2;
506 const sad_n_by_n_by_4_fn_t sad_32x32x4d_sse2 = vp9_sad32x32x4d_sse2; 580 const sad_n_by_n_by_4_fn_t sad_32x32x4d_sse2 = vp9_sad32x32x4d_sse2;
507 const sad_n_by_n_by_4_fn_t sad_32x16x4d_sse2 = vp9_sad32x16x4d_sse2; 581 const sad_n_by_n_by_4_fn_t sad_32x16x4d_sse2 = vp9_sad32x16x4d_sse2;
508 const sad_n_by_n_by_4_fn_t sad_16x32x4d_sse2 = vp9_sad16x32x4d_sse2; 582 const sad_n_by_n_by_4_fn_t sad_16x32x4d_sse2 = vp9_sad16x32x4d_sse2;
509 const sad_n_by_n_by_4_fn_t sad_16x16x4d_sse2 = vp9_sad16x16x4d_sse2; 583 const sad_n_by_n_by_4_fn_t sad_16x16x4d_sse2 = vp9_sad16x16x4d_sse2;
510 const sad_n_by_n_by_4_fn_t sad_16x8x4d_sse2 = vp9_sad16x8x4d_sse2; 584 const sad_n_by_n_by_4_fn_t sad_16x8x4d_sse2 = vp9_sad16x8x4d_sse2;
511 const sad_n_by_n_by_4_fn_t sad_8x16x4d_sse2 = vp9_sad8x16x4d_sse2; 585 const sad_n_by_n_by_4_fn_t sad_8x16x4d_sse2 = vp9_sad8x16x4d_sse2;
512 const sad_n_by_n_by_4_fn_t sad_8x8x4d_sse2 = vp9_sad8x8x4d_sse2; 586 const sad_n_by_n_by_4_fn_t sad_8x8x4d_sse2 = vp9_sad8x8x4d_sse2;
513 const sad_n_by_n_by_4_fn_t sad_8x4x4d_sse2 = vp9_sad8x4x4d_sse2; 587 const sad_n_by_n_by_4_fn_t sad_8x4x4d_sse2 = vp9_sad8x4x4d_sse2;
514 INSTANTIATE_TEST_CASE_P(SSE2, SADx4Test, ::testing::Values( 588 INSTANTIATE_TEST_CASE_P(SSE2, SADx4Test, ::testing::Values(
515 make_tuple(64, 64, sad_64x64x4d_sse2), 589 make_tuple(64, 64, sad_64x64x4d_sse2),
516 make_tuple(64, 32, sad_64x32x4d_sse2), 590 make_tuple(64, 32, sad_64x32x4d_sse2),
517 make_tuple(32, 64, sad_32x64x4d_sse2), 591 make_tuple(32, 64, sad_32x64x4d_sse2),
518 make_tuple(32, 32, sad_32x32x4d_sse2), 592 make_tuple(32, 32, sad_32x32x4d_sse2),
519 make_tuple(32, 16, sad_32x16x4d_sse2), 593 make_tuple(32, 16, sad_32x16x4d_sse2),
520 make_tuple(16, 32, sad_16x32x4d_sse2), 594 make_tuple(16, 32, sad_16x32x4d_sse2),
521 make_tuple(16, 16, sad_16x16x4d_sse2), 595 make_tuple(16, 16, sad_16x16x4d_sse2),
522 make_tuple(16, 8, sad_16x8x4d_sse2), 596 make_tuple(16, 8, sad_16x8x4d_sse2),
523 make_tuple(8, 16, sad_8x16x4d_sse2), 597 make_tuple(8, 16, sad_8x16x4d_sse2),
524 make_tuple(8, 8, sad_8x8x4d_sse2), 598 make_tuple(8, 8, sad_8x8x4d_sse2),
525 make_tuple(8, 4, sad_8x4x4d_sse2))); 599 make_tuple(8, 4, sad_8x4x4d_sse2)));
526 #endif 600 #endif // CONFIG_USE_X86INC
527 #endif 601 #endif // CONFIG_VP9_ENCODER
528 #endif 602 #endif // HAVE_SSE2
529 603
530 #if HAVE_SSE3 604 #if HAVE_SSE3
531 #if CONFIG_VP8_ENCODER 605 #if CONFIG_VP8_ENCODER
532 const sad_n_by_n_by_4_fn_t sad_16x16x4d_sse3 = vp8_sad16x16x4d_sse3; 606 const sad_n_by_n_by_4_fn_t sad_16x16x4d_sse3 = vp8_sad16x16x4d_sse3;
533 const sad_n_by_n_by_4_fn_t sad_16x8x4d_sse3 = vp8_sad16x8x4d_sse3; 607 const sad_n_by_n_by_4_fn_t sad_16x8x4d_sse3 = vp8_sad16x8x4d_sse3;
534 const sad_n_by_n_by_4_fn_t sad_8x16x4d_sse3 = vp8_sad8x16x4d_sse3; 608 const sad_n_by_n_by_4_fn_t sad_8x16x4d_sse3 = vp8_sad8x16x4d_sse3;
535 const sad_n_by_n_by_4_fn_t sad_8x8x4d_sse3 = vp8_sad8x8x4d_sse3; 609 const sad_n_by_n_by_4_fn_t sad_8x8x4d_sse3 = vp8_sad8x8x4d_sse3;
536 const sad_n_by_n_by_4_fn_t sad_4x4x4d_sse3 = vp8_sad4x4x4d_sse3; 610 const sad_n_by_n_by_4_fn_t sad_4x4x4d_sse3 = vp8_sad4x4x4d_sse3;
537 INSTANTIATE_TEST_CASE_P(SSE3, SADx4Test, ::testing::Values( 611 INSTANTIATE_TEST_CASE_P(SSE3, SADx4Test, ::testing::Values(
538 make_tuple(16, 16, sad_16x16x4d_sse3), 612 make_tuple(16, 16, sad_16x16x4d_sse3),
539 make_tuple(16, 8, sad_16x8x4d_sse3), 613 make_tuple(16, 8, sad_16x8x4d_sse3),
540 make_tuple(8, 16, sad_8x16x4d_sse3), 614 make_tuple(8, 16, sad_8x16x4d_sse3),
541 make_tuple(8, 8, sad_8x8x4d_sse3), 615 make_tuple(8, 8, sad_8x8x4d_sse3),
542 make_tuple(4, 4, sad_4x4x4d_sse3))); 616 make_tuple(4, 4, sad_4x4x4d_sse3)));
543 #endif 617 #endif // CONFIG_VP8_ENCODER
544 #endif 618 #endif // HAVE_SSE3
545 619
546 #if HAVE_SSSE3 620 #if HAVE_SSSE3
547 #if CONFIG_USE_X86INC 621 #if CONFIG_USE_X86INC
548 #if CONFIG_VP8_ENCODER 622 #if CONFIG_VP8_ENCODER
549 const sad_m_by_n_fn_t sad_16x16_sse3 = vp8_sad16x16_sse3; 623 const sad_m_by_n_fn_t sad_16x16_sse3 = vp8_sad16x16_sse3;
550 INSTANTIATE_TEST_CASE_P(SSE3, SADTest, ::testing::Values( 624 INSTANTIATE_TEST_CASE_P(SSE3, SADTest, ::testing::Values(
551 make_tuple(16, 16, sad_16x16_sse3))); 625 make_tuple(16, 16, sad_16x16_sse3)));
552 #endif 626 #endif // CONFIG_VP8_ENCODER
553 #endif 627 #endif // CONFIG_USE_X86INC
554 #endif 628 #endif // HAVE_SSSE3
629
630 #if HAVE_AVX2
631 #if CONFIG_VP9_ENCODER
632 // TODO(jzern): these prototypes can be removed after the avx2 versions are
633 // reenabled in vp9_rtcd_defs.pl.
634 extern "C" {
635 void vp9_sad32x32x4d_avx2(const uint8_t *src_ptr, int src_stride,
636 const uint8_t *const ref_ptr[], int ref_stride,
637 unsigned int *sad_array);
638 void vp9_sad64x64x4d_avx2(const uint8_t *src_ptr, int src_stride,
639 const uint8_t *const ref_ptr[], int ref_stride,
640 unsigned int *sad_array);
641 }
642 const sad_n_by_n_by_4_fn_t sad_64x64x4d_avx2 = vp9_sad64x64x4d_avx2;
643 const sad_n_by_n_by_4_fn_t sad_32x32x4d_avx2 = vp9_sad32x32x4d_avx2;
644 INSTANTIATE_TEST_CASE_P(DISABLED_AVX2, SADx4Test, ::testing::Values(
645 make_tuple(32, 32, sad_32x32x4d_avx2),
646 make_tuple(64, 64, sad_64x64x4d_avx2)));
647 #endif // CONFIG_VP9_ENCODER
648 #endif // HAVE_AVX2
555 649
556 } // namespace 650 } // namespace
OLDNEW
« no previous file with comments | « source/libvpx/test/resize_util.sh ('k') | source/libvpx/test/simple_decoder.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698