]> granicus.if.org Git - libvpx/blob - test/sad_test.cc
Add vp9_sad32x32x4d_neon Neon intrinsic function.
[libvpx] / test / sad_test.cc
1 /*
2  *  Copyright (c) 2012 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
11
12 #include <string.h>
13 #include <limits.h>
14 #include <stdio.h>
15
16 #include "./vpx_config.h"
17 #if CONFIG_VP8_ENCODER
18 #include "./vp8_rtcd.h"
19 #endif
20 #if CONFIG_VP9_ENCODER
21 #include "./vp9_rtcd.h"
22 #endif
23 #include "vpx_mem/vpx_mem.h"
24
25 #include "test/acm_random.h"
26 #include "test/clear_system_state.h"
27 #include "test/register_state_check.h"
28 #include "test/util.h"
29 #include "third_party/googletest/src/include/gtest/gtest.h"
30 #include "vpx/vpx_codec.h"
31
32
33 #if CONFIG_VP8_ENCODER
34 typedef unsigned int (*SadMxNFunc)(const unsigned char *source_ptr,
35                                    int source_stride,
36                                    const unsigned char *reference_ptr,
37                                    int reference_stride,
38                                    unsigned int max_sad);
39 typedef std::tr1::tuple<int, int, SadMxNFunc, int> SadMxNParam;
40 #endif
41 #if CONFIG_VP9_ENCODER
42 typedef unsigned int (*SadMxNVp9Func)(const unsigned char *source_ptr,
43                                       int source_stride,
44                                       const unsigned char *reference_ptr,
45                                       int reference_stride);
46 typedef std::tr1::tuple<int, int, SadMxNVp9Func, int> SadMxNVp9Param;
47 typedef uint32_t (*SadMxNAvgVp9Func)(const uint8_t *source_ptr,
48                                      int source_stride,
49                                      const uint8_t *reference_ptr,
50                                      int reference_stride,
51                                      const uint8_t *second_pred);
52 typedef std::tr1::tuple<int, int, SadMxNAvgVp9Func, int> SadMxNAvgVp9Param;
53 #endif
54
55 typedef void (*SadMxNx4Func)(const uint8_t *src_ptr,
56                              int src_stride,
57                              const uint8_t *const ref_ptr[],
58                              int ref_stride,
59                              uint32_t *sad_array);
60 typedef std::tr1::tuple<int, int, SadMxNx4Func, int> SadMxNx4Param;
61
62 using libvpx_test::ACMRandom;
63
64 namespace {
65 class SADTestBase : public ::testing::Test {
66  public:
67   SADTestBase(int width, int height, int bit_depth) :
68       width_(width), height_(height), bd_(bit_depth) {}
69
70   static void SetUpTestCase() {
71 #if CONFIG_VP9_HIGHBITDEPTH
72     source_data8_ = reinterpret_cast<uint8_t*>(
73         vpx_memalign(kDataAlignment, kDataBlockSize));
74     reference_data8_ = reinterpret_cast<uint8_t*>(
75         vpx_memalign(kDataAlignment, kDataBufferSize));
76     second_pred8_ = reinterpret_cast<uint8_t*>(
77         vpx_memalign(kDataAlignment, 64*64));
78     source_data16_ = reinterpret_cast<uint16_t*>(
79         vpx_memalign(kDataAlignment, kDataBlockSize*sizeof(uint16_t)));
80     reference_data16_ = reinterpret_cast<uint16_t*>(
81         vpx_memalign(kDataAlignment, kDataBufferSize*sizeof(uint16_t)));
82     second_pred16_ = reinterpret_cast<uint16_t*>(
83         vpx_memalign(kDataAlignment, 64*64*sizeof(uint16_t)));
84 #else
85     source_data_ = reinterpret_cast<uint8_t*>(
86         vpx_memalign(kDataAlignment, kDataBlockSize));
87     reference_data_ = reinterpret_cast<uint8_t*>(
88         vpx_memalign(kDataAlignment, kDataBufferSize));
89     second_pred_ = reinterpret_cast<uint8_t*>(
90         vpx_memalign(kDataAlignment, 64*64));
91 #endif
92   }
93
94   static void TearDownTestCase() {
95 #if CONFIG_VP9_HIGHBITDEPTH
96     vpx_free(source_data8_);
97     source_data8_ = NULL;
98     vpx_free(reference_data8_);
99     reference_data8_ = NULL;
100     vpx_free(second_pred8_);
101     second_pred8_ = NULL;
102     vpx_free(source_data16_);
103     source_data16_ = NULL;
104     vpx_free(reference_data16_);
105     reference_data16_ = NULL;
106     vpx_free(second_pred16_);
107     second_pred16_ = NULL;
108 #else
109     vpx_free(source_data_);
110     source_data_ = NULL;
111     vpx_free(reference_data_);
112     reference_data_ = NULL;
113     vpx_free(second_pred_);
114     second_pred_ = NULL;
115 #endif
116   }
117
118   virtual void TearDown() {
119     libvpx_test::ClearSystemState();
120   }
121
122  protected:
123   // Handle blocks up to 4 blocks 64x64 with stride up to 128
124   static const int kDataAlignment = 16;
125   static const int kDataBlockSize = 64 * 128;
126   static const int kDataBufferSize = 4 * kDataBlockSize;
127
128   virtual void SetUp() {
129 #if CONFIG_VP9_HIGHBITDEPTH
130     if (bd_ == -1) {
131       use_high_bit_depth_ = false;
132       bit_depth_ = VPX_BITS_8;
133       source_data_ = source_data8_;
134       reference_data_ = reference_data8_;
135       second_pred_ = second_pred8_;
136     } else {
137       use_high_bit_depth_ = true;
138       bit_depth_ = static_cast<vpx_bit_depth_t>(bd_);
139       source_data_ = CONVERT_TO_BYTEPTR(source_data16_);
140       reference_data_ = CONVERT_TO_BYTEPTR(reference_data16_);
141       second_pred_ = CONVERT_TO_BYTEPTR(second_pred16_);
142     }
143 #else
144     bit_depth_ = VPX_BITS_8;
145 #endif
146     mask_ = (1 << bit_depth_) - 1;
147     source_stride_ = (width_ + 31) & ~31;
148     reference_stride_ = width_ * 2;
149     rnd_.Reset(ACMRandom::DeterministicSeed());
150   }
151
152   virtual uint8_t *GetReference(int block_idx) {
153 #if CONFIG_VP9_HIGHBITDEPTH
154     if (!use_high_bit_depth_) {
155       return reference_data_ + block_idx * kDataBlockSize;
156     } else {
157       return CONVERT_TO_BYTEPTR(CONVERT_TO_SHORTPTR(reference_data_) +
158                                 block_idx * kDataBlockSize);
159     }
160 #else
161     return reference_data_ + block_idx * kDataBlockSize;
162 #endif
163   }
164
165   // Sum of Absolute Differences. Given two blocks, calculate the absolute
166   // difference between two pixels in the same relative location; accumulate.
167   unsigned int ReferenceSAD(unsigned int max_sad, int block_idx) {
168     unsigned int sad = 0;
169 #if CONFIG_VP9_HIGHBITDEPTH
170       const uint8_t *const reference8 = GetReference(block_idx);
171       const uint8_t *const source8 = source_data_;
172       const uint16_t *const reference16 =
173           CONVERT_TO_SHORTPTR(GetReference(block_idx));
174       const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_);
175 #else
176     const uint8_t *const reference = GetReference(block_idx);
177     const uint8_t *const source = source_data_;
178 #endif
179     for (int h = 0; h < height_; ++h) {
180       for (int w = 0; w < width_; ++w) {
181 #if CONFIG_VP9_HIGHBITDEPTH
182         if (!use_high_bit_depth_) {
183           sad +=
184               abs(source8[h * source_stride_ + w] -
185                   reference8[h * reference_stride_ + w]);
186         } else {
187           sad +=
188               abs(source16[h * source_stride_ + w] -
189                   reference16[h * reference_stride_ + w]);
190         }
191 #else
192         sad +=
193             abs(source[h * source_stride_ + w] -
194                 reference[h * reference_stride_ + w]);
195 #endif
196       }
197       if (sad > max_sad) {
198         break;
199       }
200     }
201     return sad;
202   }
203
204   // Sum of Absolute Differences Average. Given two blocks, and a prediction
205   // calculate the absolute difference between one pixel and average of the
206   // corresponding and predicted pixels; accumulate.
207   unsigned int ReferenceSADavg(unsigned int max_sad, int block_idx) {
208     unsigned int sad = 0;
209 #if CONFIG_VP9_HIGHBITDEPTH
210       const uint8_t *const reference8 = GetReference(block_idx);
211       const uint8_t *const source8 = source_data_;
212       const uint8_t *const second_pred8 = second_pred_;
213       const uint16_t *const reference16 =
214           CONVERT_TO_SHORTPTR(GetReference(block_idx));
215       const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_);
216       const uint16_t *const second_pred16 = CONVERT_TO_SHORTPTR(second_pred_);
217 #else
218     const uint8_t *const reference = GetReference(block_idx);
219     const uint8_t *const source = source_data_;
220     const uint8_t *const second_pred = second_pred_;
221 #endif
222     for (int h = 0; h < height_; ++h) {
223       for (int w = 0; w < width_; ++w) {
224 #if CONFIG_VP9_HIGHBITDEPTH
225         if (!use_high_bit_depth_) {
226           const int tmp = second_pred8[h * width_ + w] +
227               reference8[h * reference_stride_ + w];
228           const uint8_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1);
229           sad += abs(source8[h * source_stride_ + w] - comp_pred);
230         } else {
231           const int tmp = second_pred16[h * width_ + w] +
232               reference16[h * reference_stride_ + w];
233           const uint16_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1);
234           sad += abs(source16[h * source_stride_ + w] - comp_pred);
235         }
236 #else
237         const int tmp = second_pred[h * width_ + w] +
238             reference[h * reference_stride_ + w];
239         const uint8_t comp_pred = (tmp + 1) >> 1;
240         sad += abs(source[h * source_stride_ + w] - comp_pred);
241 #endif
242       }
243       if (sad > max_sad) {
244         break;
245       }
246     }
247     return sad;
248   }
249
250   void FillConstant(uint8_t *data, int stride, uint16_t fill_constant) {
251 #if CONFIG_VP9_HIGHBITDEPTH
252     uint8_t *data8 = data;
253     uint16_t *data16 = CONVERT_TO_SHORTPTR(data);
254 #endif
255     for (int h = 0; h < height_; ++h) {
256       for (int w = 0; w < width_; ++w) {
257 #if CONFIG_VP9_HIGHBITDEPTH
258         if (!use_high_bit_depth_) {
259           data8[h * stride + w] = static_cast<uint8_t>(fill_constant);
260         } else {
261           data16[h * stride + w] = fill_constant;
262         }
263 #else
264         data[h * stride + w] = static_cast<uint8_t>(fill_constant);
265 #endif
266       }
267     }
268   }
269
270   void FillRandom(uint8_t *data, int stride) {
271 #if CONFIG_VP9_HIGHBITDEPTH
272     uint8_t *data8 = data;
273     uint16_t *data16 = CONVERT_TO_SHORTPTR(data);
274 #endif
275     for (int h = 0; h < height_; ++h) {
276       for (int w = 0; w < width_; ++w) {
277 #if CONFIG_VP9_HIGHBITDEPTH
278         if (!use_high_bit_depth_) {
279           data8[h * stride + w] = rnd_.Rand8();
280         } else {
281           data16[h * stride + w] = rnd_.Rand16() & mask_;
282         }
283 #else
284         data[h * stride + w] = rnd_.Rand8();
285 #endif
286       }
287     }
288   }
289
290   int width_, height_, mask_, bd_;
291   vpx_bit_depth_t bit_depth_;
292   static uint8_t *source_data_;
293   static uint8_t *reference_data_;
294   static uint8_t *second_pred_;
295   int source_stride_;
296 #if CONFIG_VP9_HIGHBITDEPTH
297   bool use_high_bit_depth_;
298   static uint8_t *source_data8_;
299   static uint8_t *reference_data8_;
300   static uint8_t *second_pred8_;
301   static uint16_t *source_data16_;
302   static uint16_t *reference_data16_;
303   static uint16_t *second_pred16_;
304 #endif
305   int reference_stride_;
306
307   ACMRandom rnd_;
308 };
309
310 class SADx4Test
311     : public SADTestBase,
312       public ::testing::WithParamInterface<SadMxNx4Param> {
313  public:
314   SADx4Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {}
315
316  protected:
317   void SADs(unsigned int *results) {
318     const uint8_t *refs[] = {GetReference(0), GetReference(1),
319                              GetReference(2), GetReference(3)};
320
321     ASM_REGISTER_STATE_CHECK(GET_PARAM(2)(source_data_, source_stride_,
322                                           refs, reference_stride_,
323                                           results));
324   }
325
326   void CheckSADs() {
327     unsigned int reference_sad, exp_sad[4];
328
329     SADs(exp_sad);
330     for (int block = 0; block < 4; ++block) {
331       reference_sad = ReferenceSAD(UINT_MAX, block);
332
333       EXPECT_EQ(reference_sad, exp_sad[block]) << "block " << block;
334     }
335   }
336 };
337
338 #if CONFIG_VP8_ENCODER
339 class SADTest
340     : public SADTestBase,
341       public ::testing::WithParamInterface<SadMxNParam> {
342  public:
343   SADTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {}
344
345  protected:
346   unsigned int SAD(unsigned int max_sad, int block_idx) {
347     unsigned int ret;
348     const uint8_t *const reference = GetReference(block_idx);
349
350     ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_,
351                                                 reference, reference_stride_,
352                                                 max_sad));
353     return ret;
354   }
355
356   void CheckSAD(unsigned int max_sad) {
357     const unsigned int reference_sad = ReferenceSAD(max_sad, 0);
358     const unsigned int exp_sad = SAD(max_sad, 0);
359
360     if (reference_sad <= max_sad) {
361       ASSERT_EQ(exp_sad, reference_sad);
362     } else {
363       // Alternative implementations are not required to check max_sad
364       ASSERT_GE(exp_sad, reference_sad);
365     }
366   }
367 };
368 #endif  // CONFIG_VP8_ENCODER
369
370 #if CONFIG_VP9_ENCODER
371 class SADVP9Test
372     : public SADTestBase,
373       public ::testing::WithParamInterface<SadMxNVp9Param> {
374  public:
375   SADVP9Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {}
376
377  protected:
378   unsigned int SAD(int block_idx) {
379     unsigned int ret;
380     const uint8_t *const reference = GetReference(block_idx);
381
382     ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_,
383                                                 reference, reference_stride_));
384     return ret;
385   }
386
387   void CheckSAD() {
388     const unsigned int reference_sad = ReferenceSAD(UINT_MAX, 0);
389     const unsigned int exp_sad = SAD(0);
390
391     ASSERT_EQ(reference_sad, exp_sad);
392   }
393 };
394
395 class SADavgVP9Test
396     : public SADTestBase,
397       public ::testing::WithParamInterface<SadMxNAvgVp9Param> {
398  public:
399   SADavgVP9Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {}
400
401  protected:
402   unsigned int SAD_avg(int block_idx) {
403     unsigned int ret;
404     const uint8_t *const reference = GetReference(block_idx);
405
406     ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_,
407                                                 reference, reference_stride_,
408                                                 second_pred_));
409     return ret;
410   }
411
412   void CheckSAD() {
413     const unsigned int reference_sad = ReferenceSADavg(UINT_MAX, 0);
414     const unsigned int exp_sad = SAD_avg(0);
415
416     ASSERT_EQ(reference_sad, exp_sad);
417   }
418 };
419 #endif  // CONFIG_VP9_ENCODER
420
421 uint8_t *SADTestBase::source_data_ = NULL;
422 uint8_t *SADTestBase::reference_data_ = NULL;
423 uint8_t *SADTestBase::second_pred_ = NULL;
424 #if CONFIG_VP9_ENCODER && CONFIG_VP9_HIGHBITDEPTH
425 uint8_t *SADTestBase::source_data8_ = NULL;
426 uint8_t *SADTestBase::reference_data8_ = NULL;
427 uint8_t *SADTestBase::second_pred8_ = NULL;
428 uint16_t *SADTestBase::source_data16_ = NULL;
429 uint16_t *SADTestBase::reference_data16_ = NULL;
430 uint16_t *SADTestBase::second_pred16_ = NULL;
431 #endif
432
433 #if CONFIG_VP8_ENCODER
434 TEST_P(SADTest, MaxRef) {
435   FillConstant(source_data_, source_stride_, 0);
436   FillConstant(reference_data_, reference_stride_, mask_);
437   CheckSAD(UINT_MAX);
438 }
439
440 TEST_P(SADTest, MaxSrc) {
441   FillConstant(source_data_, source_stride_, mask_);
442   FillConstant(reference_data_, reference_stride_, 0);
443   CheckSAD(UINT_MAX);
444 }
445
446 TEST_P(SADTest, ShortRef) {
447   int tmp_stride = reference_stride_;
448   reference_stride_ >>= 1;
449   FillRandom(source_data_, source_stride_);
450   FillRandom(reference_data_, reference_stride_);
451   CheckSAD(UINT_MAX);
452   reference_stride_ = tmp_stride;
453 }
454
455 TEST_P(SADTest, UnalignedRef) {
456   // The reference frame, but not the source frame, may be unaligned for
457   // certain types of searches.
458   const int tmp_stride = reference_stride_;
459   reference_stride_ -= 1;
460   FillRandom(source_data_, source_stride_);
461   FillRandom(reference_data_, reference_stride_);
462   CheckSAD(UINT_MAX);
463   reference_stride_ = tmp_stride;
464 }
465
466 TEST_P(SADTest, ShortSrc) {
467   const int tmp_stride = source_stride_;
468   source_stride_ >>= 1;
469   FillRandom(source_data_, source_stride_);
470   FillRandom(reference_data_, reference_stride_);
471   CheckSAD(UINT_MAX);
472   source_stride_ = tmp_stride;
473 }
474
475 TEST_P(SADTest, MaxSAD) {
476   // Verify that, when max_sad is set, the implementation does not return a
477   // value lower than the reference.
478   FillConstant(source_data_, source_stride_, mask_);
479   FillConstant(reference_data_, reference_stride_, 0);
480   CheckSAD(128);
481 }
482 #endif  // CONFIG_VP8_ENCODER
483
484 #if CONFIG_VP9_ENCODER
485 TEST_P(SADVP9Test, MaxRef) {
486   FillConstant(source_data_, source_stride_, 0);
487   FillConstant(reference_data_, reference_stride_, mask_);
488   CheckSAD();
489 }
490
491 TEST_P(SADVP9Test, MaxSrc) {
492   FillConstant(source_data_, source_stride_, mask_);
493   FillConstant(reference_data_, reference_stride_, 0);
494   CheckSAD();
495 }
496
497 TEST_P(SADVP9Test, ShortRef) {
498   const int tmp_stride = reference_stride_;
499   reference_stride_ >>= 1;
500   FillRandom(source_data_, source_stride_);
501   FillRandom(reference_data_, reference_stride_);
502   CheckSAD();
503   reference_stride_ = tmp_stride;
504 }
505
506 TEST_P(SADVP9Test, UnalignedRef) {
507   // The reference frame, but not the source frame, may be unaligned for
508   // certain types of searches.
509   const int tmp_stride = reference_stride_;
510   reference_stride_ -= 1;
511   FillRandom(source_data_, source_stride_);
512   FillRandom(reference_data_, reference_stride_);
513   CheckSAD();
514   reference_stride_ = tmp_stride;
515 }
516
517 TEST_P(SADVP9Test, ShortSrc) {
518   const int tmp_stride = source_stride_;
519   source_stride_ >>= 1;
520   FillRandom(source_data_, source_stride_);
521   FillRandom(reference_data_, reference_stride_);
522   CheckSAD();
523   source_stride_ = tmp_stride;
524 }
525
526 TEST_P(SADavgVP9Test, MaxRef) {
527   FillConstant(source_data_, source_stride_, 0);
528   FillConstant(reference_data_, reference_stride_, mask_);
529   FillConstant(second_pred_, width_, 0);
530   CheckSAD();
531 }
532 TEST_P(SADavgVP9Test, MaxSrc) {
533   FillConstant(source_data_, source_stride_, mask_);
534   FillConstant(reference_data_, reference_stride_, 0);
535   FillConstant(second_pred_, width_, 0);
536   CheckSAD();
537 }
538
539 TEST_P(SADavgVP9Test, ShortRef) {
540   const int tmp_stride = reference_stride_;
541   reference_stride_ >>= 1;
542   FillRandom(source_data_, source_stride_);
543   FillRandom(reference_data_, reference_stride_);
544   FillRandom(second_pred_, width_);
545   CheckSAD();
546   reference_stride_ = tmp_stride;
547 }
548
549 TEST_P(SADavgVP9Test, UnalignedRef) {
550   // The reference frame, but not the source frame, may be unaligned for
551   // certain types of searches.
552   const int tmp_stride = reference_stride_;
553   reference_stride_ -= 1;
554   FillRandom(source_data_, source_stride_);
555   FillRandom(reference_data_, reference_stride_);
556   FillRandom(second_pred_, width_);
557   CheckSAD();
558   reference_stride_ = tmp_stride;
559 }
560
561 TEST_P(SADavgVP9Test, ShortSrc) {
562   const int tmp_stride = source_stride_;
563   source_stride_ >>= 1;
564   FillRandom(source_data_, source_stride_);
565   FillRandom(reference_data_, reference_stride_);
566   FillRandom(second_pred_, width_);
567   CheckSAD();
568   source_stride_ = tmp_stride;
569 }
570 #endif  // CONFIG_VP9_ENCODER
571
572 TEST_P(SADx4Test, MaxRef) {
573   FillConstant(source_data_, source_stride_, 0);
574   FillConstant(GetReference(0), reference_stride_, mask_);
575   FillConstant(GetReference(1), reference_stride_, mask_);
576   FillConstant(GetReference(2), reference_stride_, mask_);
577   FillConstant(GetReference(3), reference_stride_, mask_);
578   CheckSADs();
579 }
580
581 TEST_P(SADx4Test, MaxSrc) {
582   FillConstant(source_data_, source_stride_, mask_);
583   FillConstant(GetReference(0), reference_stride_, 0);
584   FillConstant(GetReference(1), reference_stride_, 0);
585   FillConstant(GetReference(2), reference_stride_, 0);
586   FillConstant(GetReference(3), reference_stride_, 0);
587   CheckSADs();
588 }
589
590 TEST_P(SADx4Test, ShortRef) {
591   int tmp_stride = reference_stride_;
592   reference_stride_ >>= 1;
593   FillRandom(source_data_, source_stride_);
594   FillRandom(GetReference(0), reference_stride_);
595   FillRandom(GetReference(1), reference_stride_);
596   FillRandom(GetReference(2), reference_stride_);
597   FillRandom(GetReference(3), reference_stride_);
598   CheckSADs();
599   reference_stride_ = tmp_stride;
600 }
601
602 TEST_P(SADx4Test, UnalignedRef) {
603   // The reference frame, but not the source frame, may be unaligned for
604   // certain types of searches.
605   int tmp_stride = reference_stride_;
606   reference_stride_ -= 1;
607   FillRandom(source_data_, source_stride_);
608   FillRandom(GetReference(0), reference_stride_);
609   FillRandom(GetReference(1), reference_stride_);
610   FillRandom(GetReference(2), reference_stride_);
611   FillRandom(GetReference(3), reference_stride_);
612   CheckSADs();
613   reference_stride_ = tmp_stride;
614 }
615
616 TEST_P(SADx4Test, ShortSrc) {
617   int tmp_stride = source_stride_;
618   source_stride_ >>= 1;
619   FillRandom(source_data_, source_stride_);
620   FillRandom(GetReference(0), reference_stride_);
621   FillRandom(GetReference(1), reference_stride_);
622   FillRandom(GetReference(2), reference_stride_);
623   FillRandom(GetReference(3), reference_stride_);
624   CheckSADs();
625   source_stride_ = tmp_stride;
626 }
627
628 TEST_P(SADx4Test, SrcAlignedByWidth) {
629   uint8_t * tmp_source_data = source_data_;
630   source_data_ += width_;
631   FillRandom(source_data_, source_stride_);
632   FillRandom(GetReference(0), reference_stride_);
633   FillRandom(GetReference(1), reference_stride_);
634   FillRandom(GetReference(2), reference_stride_);
635   FillRandom(GetReference(3), reference_stride_);
636   CheckSADs();
637   source_data_ = tmp_source_data;
638 }
639
640 using std::tr1::make_tuple;
641
642 //------------------------------------------------------------------------------
643 // C functions
644 #if CONFIG_VP8_ENCODER
645 const SadMxNFunc sad_16x16_c = vp8_sad16x16_c;
646 const SadMxNFunc sad_8x16_c = vp8_sad8x16_c;
647 const SadMxNFunc sad_16x8_c = vp8_sad16x8_c;
648 const SadMxNFunc sad_8x8_c = vp8_sad8x8_c;
649 const SadMxNFunc sad_4x4_c = vp8_sad4x4_c;
650 const SadMxNParam c_tests[] = {
651   make_tuple(16, 16, sad_16x16_c, -1),
652   make_tuple(8, 16, sad_8x16_c, -1),
653   make_tuple(16, 8, sad_16x8_c, -1),
654   make_tuple(8, 8, sad_8x8_c, -1),
655   make_tuple(4, 4, sad_4x4_c, -1),
656 };
657 INSTANTIATE_TEST_CASE_P(C, SADTest, ::testing::ValuesIn(c_tests));
658 #endif  // CONFIG_VP8_ENCODER
659
660 #if CONFIG_VP9_ENCODER
661 const SadMxNVp9Func sad_64x64_c_vp9 = vp9_sad64x64_c;
662 const SadMxNVp9Func sad_32x32_c_vp9 = vp9_sad32x32_c;
663 const SadMxNVp9Func sad_16x16_c_vp9 = vp9_sad16x16_c;
664 const SadMxNVp9Func sad_8x16_c_vp9 = vp9_sad8x16_c;
665 const SadMxNVp9Func sad_16x8_c_vp9 = vp9_sad16x8_c;
666 const SadMxNVp9Func sad_8x8_c_vp9 = vp9_sad8x8_c;
667 const SadMxNVp9Func sad_8x4_c_vp9 = vp9_sad8x4_c;
668 const SadMxNVp9Func sad_4x8_c_vp9 = vp9_sad4x8_c;
669 const SadMxNVp9Func sad_4x4_c_vp9 = vp9_sad4x4_c;
670 const SadMxNVp9Param c_vp9_tests[] = {
671   make_tuple(64, 64, sad_64x64_c_vp9, -1),
672   make_tuple(32, 32, sad_32x32_c_vp9, -1),
673   make_tuple(16, 16, sad_16x16_c_vp9, -1),
674   make_tuple(8, 16, sad_8x16_c_vp9, -1),
675   make_tuple(16, 8, sad_16x8_c_vp9, -1),
676   make_tuple(8, 8, sad_8x8_c_vp9, -1),
677   make_tuple(8, 4, sad_8x4_c_vp9, -1),
678   make_tuple(4, 8, sad_4x8_c_vp9, -1),
679   make_tuple(4, 4, sad_4x4_c_vp9, -1),
680 };
681 INSTANTIATE_TEST_CASE_P(C, SADVP9Test, ::testing::ValuesIn(c_vp9_tests));
682
683 const SadMxNx4Func sad_64x64x4d_c = vp9_sad64x64x4d_c;
684 const SadMxNx4Func sad_64x32x4d_c = vp9_sad64x32x4d_c;
685 const SadMxNx4Func sad_32x64x4d_c = vp9_sad32x64x4d_c;
686 const SadMxNx4Func sad_32x32x4d_c = vp9_sad32x32x4d_c;
687 const SadMxNx4Func sad_32x16x4d_c = vp9_sad32x16x4d_c;
688 const SadMxNx4Func sad_16x32x4d_c = vp9_sad16x32x4d_c;
689 const SadMxNx4Func sad_16x16x4d_c = vp9_sad16x16x4d_c;
690 const SadMxNx4Func sad_16x8x4d_c = vp9_sad16x8x4d_c;
691 const SadMxNx4Func sad_8x16x4d_c = vp9_sad8x16x4d_c;
692 const SadMxNx4Func sad_8x8x4d_c = vp9_sad8x8x4d_c;
693 const SadMxNx4Func sad_8x4x4d_c = vp9_sad8x4x4d_c;
694 const SadMxNx4Func sad_4x8x4d_c = vp9_sad4x8x4d_c;
695 const SadMxNx4Func sad_4x4x4d_c = vp9_sad4x4x4d_c;
696 INSTANTIATE_TEST_CASE_P(C, SADx4Test, ::testing::Values(
697                         make_tuple(64, 64, sad_64x64x4d_c, -1),
698                         make_tuple(64, 32, sad_64x32x4d_c, -1),
699                         make_tuple(32, 64, sad_32x64x4d_c, -1),
700                         make_tuple(32, 32, sad_32x32x4d_c, -1),
701                         make_tuple(32, 16, sad_32x16x4d_c, -1),
702                         make_tuple(16, 32, sad_16x32x4d_c, -1),
703                         make_tuple(16, 16, sad_16x16x4d_c, -1),
704                         make_tuple(16, 8, sad_16x8x4d_c, -1),
705                         make_tuple(8, 16, sad_8x16x4d_c, -1),
706                         make_tuple(8, 8, sad_8x8x4d_c, -1),
707                         make_tuple(8, 4, sad_8x4x4d_c, -1),
708                         make_tuple(4, 8, sad_4x8x4d_c, -1),
709                         make_tuple(4, 4, sad_4x4x4d_c, -1)));
710
711 #if CONFIG_VP9_HIGHBITDEPTH
712 const SadMxNVp9Func highbd_sad_64x64_c_vp9 = vp9_highbd_sad64x64_c;
713 const SadMxNVp9Func highbd_sad_32x32_c_vp9 = vp9_highbd_sad32x32_c;
714 const SadMxNVp9Func highbd_sad_16x16_c_vp9 = vp9_highbd_sad16x16_c;
715 const SadMxNVp9Func highbd_sad_8x16_c_vp9 = vp9_highbd_sad8x16_c;
716 const SadMxNVp9Func highbd_sad_16x8_c_vp9 = vp9_highbd_sad16x8_c;
717 const SadMxNVp9Func highbd_sad_8x8_c_vp9 = vp9_highbd_sad8x8_c;
718 const SadMxNVp9Func highbd_sad_8x4_c_vp9 = vp9_highbd_sad8x4_c;
719 const SadMxNVp9Func highbd_sad_4x8_c_vp9 = vp9_highbd_sad4x8_c;
720 const SadMxNVp9Func highbd_sad_4x4_c_vp9 = vp9_highbd_sad4x4_c;
721 const SadMxNVp9Param c_vp9_highbd_8_tests[] = {
722   make_tuple(64, 64, highbd_sad_64x64_c_vp9, 8),
723   make_tuple(32, 32, highbd_sad_32x32_c_vp9, 8),
724   make_tuple(16, 16, highbd_sad_16x16_c_vp9, 8),
725   make_tuple(8, 16, highbd_sad_8x16_c_vp9, 8),
726   make_tuple(16, 8, highbd_sad_16x8_c_vp9, 8),
727   make_tuple(8, 8, highbd_sad_8x8_c_vp9, 8),
728   make_tuple(8, 4, highbd_sad_8x4_c_vp9, 8),
729   make_tuple(4, 8, highbd_sad_4x8_c_vp9, 8),
730   make_tuple(4, 4, highbd_sad_4x4_c_vp9, 8),
731 };
732 INSTANTIATE_TEST_CASE_P(C_8, SADVP9Test,
733                         ::testing::ValuesIn(c_vp9_highbd_8_tests));
734
735 const SadMxNVp9Param c_vp9_highbd_10_tests[] = {
736   make_tuple(64, 64, highbd_sad_64x64_c_vp9, 10),
737   make_tuple(32, 32, highbd_sad_32x32_c_vp9, 10),
738   make_tuple(16, 16, highbd_sad_16x16_c_vp9, 10),
739   make_tuple(8, 16, highbd_sad_8x16_c_vp9, 10),
740   make_tuple(16, 8, highbd_sad_16x8_c_vp9, 10),
741   make_tuple(8, 8, highbd_sad_8x8_c_vp9, 10),
742   make_tuple(8, 4, highbd_sad_8x4_c_vp9, 10),
743   make_tuple(4, 8, highbd_sad_4x8_c_vp9, 10),
744   make_tuple(4, 4, highbd_sad_4x4_c_vp9, 10),
745 };
746 INSTANTIATE_TEST_CASE_P(C_10, SADVP9Test,
747                         ::testing::ValuesIn(c_vp9_highbd_10_tests));
748
749 const SadMxNVp9Param c_vp9_highbd_12_tests[] = {
750   make_tuple(64, 64, highbd_sad_64x64_c_vp9, 12),
751   make_tuple(32, 32, highbd_sad_32x32_c_vp9, 12),
752   make_tuple(16, 16, highbd_sad_16x16_c_vp9, 12),
753   make_tuple(8, 16, highbd_sad_8x16_c_vp9, 12),
754   make_tuple(16, 8, highbd_sad_16x8_c_vp9, 12),
755   make_tuple(8, 8, highbd_sad_8x8_c_vp9, 12),
756   make_tuple(8, 4, highbd_sad_8x4_c_vp9, 12),
757   make_tuple(4, 8, highbd_sad_4x8_c_vp9, 12),
758   make_tuple(4, 4, highbd_sad_4x4_c_vp9, 12),
759 };
760 INSTANTIATE_TEST_CASE_P(C_12, SADVP9Test,
761                         ::testing::ValuesIn(c_vp9_highbd_12_tests));
762
763 const SadMxNAvgVp9Func highbd_sad8x4_avg_c_vp9 = vp9_highbd_sad8x4_avg_c;
764 const SadMxNAvgVp9Func highbd_sad8x8_avg_c_vp9 = vp9_highbd_sad8x8_avg_c;
765 const SadMxNAvgVp9Func highbd_sad8x16_avg_c_vp9 = vp9_highbd_sad8x16_avg_c;
766 const SadMxNAvgVp9Func highbd_sad16x8_avg_c_vp9 = vp9_highbd_sad16x8_avg_c;
767 const SadMxNAvgVp9Func highbd_sad16x16_avg_c_vp9 = vp9_highbd_sad16x16_avg_c;
768 const SadMxNAvgVp9Func highbd_sad16x32_avg_c_vp9 = vp9_highbd_sad16x32_avg_c;
769 const SadMxNAvgVp9Func highbd_sad32x16_avg_c_vp9 = vp9_highbd_sad32x16_avg_c;
770 const SadMxNAvgVp9Func highbd_sad32x32_avg_c_vp9 = vp9_highbd_sad32x32_avg_c;
771 const SadMxNAvgVp9Func highbd_sad32x64_avg_c_vp9 = vp9_highbd_sad32x64_avg_c;
772 const SadMxNAvgVp9Func highbd_sad64x32_avg_c_vp9 = vp9_highbd_sad64x32_avg_c;
773 const SadMxNAvgVp9Func highbd_sad64x64_avg_c_vp9 = vp9_highbd_sad64x64_avg_c;
774 SadMxNAvgVp9Param avg_c_vp9_highbd_8_tests[] = {
775   make_tuple(8, 4, highbd_sad8x4_avg_c_vp9, 8),
776   make_tuple(8, 8, highbd_sad8x8_avg_c_vp9, 8),
777   make_tuple(8, 16, highbd_sad8x16_avg_c_vp9, 8),
778   make_tuple(16, 8, highbd_sad16x8_avg_c_vp9, 8),
779   make_tuple(16, 16, highbd_sad16x16_avg_c_vp9, 8),
780   make_tuple(16, 32, highbd_sad16x32_avg_c_vp9, 8),
781   make_tuple(32, 16, highbd_sad32x16_avg_c_vp9, 8),
782   make_tuple(32, 32, highbd_sad32x32_avg_c_vp9, 8),
783   make_tuple(32, 64, highbd_sad32x64_avg_c_vp9, 8),
784   make_tuple(64, 32, highbd_sad64x32_avg_c_vp9, 8),
785   make_tuple(64, 64, highbd_sad64x64_avg_c_vp9, 8)};
786 INSTANTIATE_TEST_CASE_P(C_8, SADavgVP9Test,
787                         ::testing::ValuesIn(avg_c_vp9_highbd_8_tests));
788
789 SadMxNAvgVp9Param avg_c_vp9_highbd_10_tests[] = {
790   make_tuple(8, 4, highbd_sad8x4_avg_c_vp9, 10),
791   make_tuple(8, 8, highbd_sad8x8_avg_c_vp9, 10),
792   make_tuple(8, 16, highbd_sad8x16_avg_c_vp9, 10),
793   make_tuple(16, 8, highbd_sad16x8_avg_c_vp9, 10),
794   make_tuple(16, 16, highbd_sad16x16_avg_c_vp9, 10),
795   make_tuple(16, 32, highbd_sad16x32_avg_c_vp9, 10),
796   make_tuple(32, 16, highbd_sad32x16_avg_c_vp9, 10),
797   make_tuple(32, 32, highbd_sad32x32_avg_c_vp9, 10),
798   make_tuple(32, 64, highbd_sad32x64_avg_c_vp9, 10),
799   make_tuple(64, 32, highbd_sad64x32_avg_c_vp9, 10),
800   make_tuple(64, 64, highbd_sad64x64_avg_c_vp9, 10)};
801 INSTANTIATE_TEST_CASE_P(C_10, SADavgVP9Test,
802                         ::testing::ValuesIn(avg_c_vp9_highbd_10_tests));
803
804 SadMxNAvgVp9Param avg_c_vp9_highbd_12_tests[] = {
805   make_tuple(8, 4, highbd_sad8x4_avg_c_vp9, 12),
806   make_tuple(8, 8, highbd_sad8x8_avg_c_vp9, 12),
807   make_tuple(8, 16, highbd_sad8x16_avg_c_vp9, 12),
808   make_tuple(16, 8, highbd_sad16x8_avg_c_vp9, 12),
809   make_tuple(16, 16, highbd_sad16x16_avg_c_vp9, 12),
810   make_tuple(16, 32, highbd_sad16x32_avg_c_vp9, 12),
811   make_tuple(32, 16, highbd_sad32x16_avg_c_vp9, 12),
812   make_tuple(32, 32, highbd_sad32x32_avg_c_vp9, 12),
813   make_tuple(32, 64, highbd_sad32x64_avg_c_vp9, 12),
814   make_tuple(64, 32, highbd_sad64x32_avg_c_vp9, 12),
815   make_tuple(64, 64, highbd_sad64x64_avg_c_vp9, 12)};
816 INSTANTIATE_TEST_CASE_P(C_12, SADavgVP9Test,
817                         ::testing::ValuesIn(avg_c_vp9_highbd_12_tests));
818
819 const SadMxNx4Func highbd_sad_64x64x4d_c = vp9_highbd_sad64x64x4d_c;
820 const SadMxNx4Func highbd_sad_64x32x4d_c = vp9_highbd_sad64x32x4d_c;
821 const SadMxNx4Func highbd_sad_32x64x4d_c = vp9_highbd_sad32x64x4d_c;
822 const SadMxNx4Func highbd_sad_32x32x4d_c = vp9_highbd_sad32x32x4d_c;
823 const SadMxNx4Func highbd_sad_32x16x4d_c = vp9_highbd_sad32x16x4d_c;
824 const SadMxNx4Func highbd_sad_16x32x4d_c = vp9_highbd_sad16x32x4d_c;
825 const SadMxNx4Func highbd_sad_16x16x4d_c = vp9_highbd_sad16x16x4d_c;
826 const SadMxNx4Func highbd_sad_16x8x4d_c  = vp9_highbd_sad16x8x4d_c;
827 const SadMxNx4Func highbd_sad_8x16x4d_c  = vp9_highbd_sad8x16x4d_c;
828 const SadMxNx4Func highbd_sad_8x8x4d_c   = vp9_highbd_sad8x8x4d_c;
829 const SadMxNx4Func highbd_sad_8x4x4d_c   = vp9_highbd_sad8x4x4d_c;
830 const SadMxNx4Func highbd_sad_4x8x4d_c   = vp9_highbd_sad4x8x4d_c;
831 const SadMxNx4Func highbd_sad_4x4x4d_c   = vp9_highbd_sad4x4x4d_c;
832 INSTANTIATE_TEST_CASE_P(C_8, SADx4Test, ::testing::Values(
833                         make_tuple(64, 64, highbd_sad_64x64x4d_c, 8),
834                         make_tuple(64, 32, highbd_sad_64x32x4d_c, 8),
835                         make_tuple(32, 64, highbd_sad_32x64x4d_c, 8),
836                         make_tuple(32, 32, highbd_sad_32x32x4d_c, 8),
837                         make_tuple(32, 16, highbd_sad_32x16x4d_c, 8),
838                         make_tuple(16, 32, highbd_sad_16x32x4d_c, 8),
839                         make_tuple(16, 16, highbd_sad_16x16x4d_c, 8),
840                         make_tuple(16, 8,  highbd_sad_16x8x4d_c,  8),
841                         make_tuple(8,  16, highbd_sad_8x16x4d_c,  8),
842                         make_tuple(8,  8,  highbd_sad_8x8x4d_c,   8),
843                         make_tuple(8,  4,  highbd_sad_8x4x4d_c,   8),
844                         make_tuple(4,  8,  highbd_sad_4x8x4d_c,   8),
845                         make_tuple(4,  4,  highbd_sad_4x4x4d_c,   8)));
846
847 INSTANTIATE_TEST_CASE_P(C_10, SADx4Test, ::testing::Values(
848                         make_tuple(64, 64, highbd_sad_64x64x4d_c, 10),
849                         make_tuple(64, 32, highbd_sad_64x32x4d_c, 10),
850                         make_tuple(32, 64, highbd_sad_32x64x4d_c, 10),
851                         make_tuple(32, 32, highbd_sad_32x32x4d_c, 10),
852                         make_tuple(32, 16, highbd_sad_32x16x4d_c, 10),
853                         make_tuple(16, 32, highbd_sad_16x32x4d_c, 10),
854                         make_tuple(16, 16, highbd_sad_16x16x4d_c, 10),
855                         make_tuple(16, 8,  highbd_sad_16x8x4d_c,  10),
856                         make_tuple(8,  16, highbd_sad_8x16x4d_c,  10),
857                         make_tuple(8,  8,  highbd_sad_8x8x4d_c,   10),
858                         make_tuple(8,  4,  highbd_sad_8x4x4d_c,   10),
859                         make_tuple(4,  8,  highbd_sad_4x8x4d_c,   10),
860                         make_tuple(4,  4,  highbd_sad_4x4x4d_c,   10)));
861
862 INSTANTIATE_TEST_CASE_P(C_12, SADx4Test, ::testing::Values(
863                         make_tuple(64, 64, highbd_sad_64x64x4d_c, 12),
864                         make_tuple(64, 32, highbd_sad_64x32x4d_c, 12),
865                         make_tuple(32, 64, highbd_sad_32x64x4d_c, 12),
866                         make_tuple(32, 32, highbd_sad_32x32x4d_c, 12),
867                         make_tuple(32, 16, highbd_sad_32x16x4d_c, 12),
868                         make_tuple(16, 32, highbd_sad_16x32x4d_c, 12),
869                         make_tuple(16, 16, highbd_sad_16x16x4d_c, 12),
870                         make_tuple(16, 8,  highbd_sad_16x8x4d_c,  12),
871                         make_tuple(8,  16, highbd_sad_8x16x4d_c,  12),
872                         make_tuple(8,  8,  highbd_sad_8x8x4d_c,   12),
873                         make_tuple(8,  4,  highbd_sad_8x4x4d_c,   12),
874                         make_tuple(4,  8,  highbd_sad_4x8x4d_c,   12),
875                         make_tuple(4,  4,  highbd_sad_4x4x4d_c,   12)));
876 #endif  // CONFIG_VP9_HIGHBITDEPTH
877 #endif  // CONFIG_VP9_ENCODER
878
879 //------------------------------------------------------------------------------
880 // ARM functions
881 #if HAVE_MEDIA
882 #if CONFIG_VP8_ENCODER
883 const SadMxNFunc sad_16x16_armv6 = vp8_sad16x16_armv6;
884 INSTANTIATE_TEST_CASE_P(MEDIA, SADTest, ::testing::Values(
885                         make_tuple(16, 16, sad_16x16_armv6, -1)));
886 #endif  // CONFIG_VP8_ENCODER
887 #endif  // HAVE_MEDIA
888
889 #if HAVE_NEON
890 #if CONFIG_VP8_ENCODER
891 const SadMxNFunc sad_16x16_neon = vp8_sad16x16_neon;
892 const SadMxNFunc sad_8x16_neon = vp8_sad8x16_neon;
893 const SadMxNFunc sad_16x8_neon = vp8_sad16x8_neon;
894 const SadMxNFunc sad_8x8_neon = vp8_sad8x8_neon;
895 const SadMxNFunc sad_4x4_neon = vp8_sad4x4_neon;
896 INSTANTIATE_TEST_CASE_P(NEON, SADTest, ::testing::Values(
897                         make_tuple(16, 16, sad_16x16_neon, -1),
898                         make_tuple(8, 16, sad_8x16_neon, -1),
899                         make_tuple(16, 8, sad_16x8_neon, -1),
900                         make_tuple(8, 8, sad_8x8_neon, -1),
901                         make_tuple(4, 4, sad_4x4_neon, -1)));
902 #endif  // CONFIG_VP8_ENCODER
903 #if CONFIG_VP9_ENCODER
904 const SadMxNVp9Func sad_64x64_neon_vp9 = vp9_sad64x64_neon;
905 const SadMxNVp9Func sad_32x32_neon_vp9 = vp9_sad32x32_neon;
906 const SadMxNVp9Func sad_16x16_neon_vp9 = vp9_sad16x16_neon;
907 const SadMxNVp9Func sad_8x8_neon_vp9 = vp9_sad8x8_neon;
908 const SadMxNVp9Param neon_vp9_tests[] = {
909   make_tuple(64, 64, sad_64x64_neon_vp9, -1),
910   make_tuple(32, 32, sad_32x32_neon_vp9, -1),
911   make_tuple(16, 16, sad_16x16_neon_vp9, -1),
912   make_tuple(8, 8, sad_8x8_neon_vp9, -1),
913 };
914 INSTANTIATE_TEST_CASE_P(NEON, SADVP9Test, ::testing::ValuesIn(neon_vp9_tests));
915 #endif  // CONFIG_VP9_ENCODER
916 #endif  // HAVE_NEON
917
918 //------------------------------------------------------------------------------
919 // x86 functions
920 #if HAVE_MMX
921 #if CONFIG_VP8_ENCODER
922 const SadMxNFunc sad_16x16_mmx = vp8_sad16x16_mmx;
923 const SadMxNFunc sad_8x16_mmx = vp8_sad8x16_mmx;
924 const SadMxNFunc sad_16x8_mmx = vp8_sad16x8_mmx;
925 const SadMxNFunc sad_8x8_mmx = vp8_sad8x8_mmx;
926 const SadMxNFunc sad_4x4_mmx = vp8_sad4x4_mmx;
927 const SadMxNParam mmx_tests[] = {
928   make_tuple(16, 16, sad_16x16_mmx, -1),
929   make_tuple(8, 16, sad_8x16_mmx, -1),
930   make_tuple(16, 8, sad_16x8_mmx, -1),
931   make_tuple(8, 8, sad_8x8_mmx, -1),
932   make_tuple(4, 4, sad_4x4_mmx, -1),
933 };
934 INSTANTIATE_TEST_CASE_P(MMX, SADTest, ::testing::ValuesIn(mmx_tests));
935 #endif  // CONFIG_VP8_ENCODER
936
937 #endif  // HAVE_MMX
938
939 #if HAVE_SSE
940 #if CONFIG_VP9_ENCODER
941 #if CONFIG_USE_X86INC
942 const SadMxNVp9Func sad_4x4_sse_vp9 = vp9_sad4x4_sse;
943 const SadMxNVp9Func sad_4x8_sse_vp9 = vp9_sad4x8_sse;
944 INSTANTIATE_TEST_CASE_P(SSE, SADVP9Test, ::testing::Values(
945                         make_tuple(4, 4, sad_4x4_sse_vp9, -1),
946                         make_tuple(4, 8, sad_4x8_sse_vp9, -1)));
947
948 const SadMxNx4Func sad_4x8x4d_sse = vp9_sad4x8x4d_sse;
949 const SadMxNx4Func sad_4x4x4d_sse = vp9_sad4x4x4d_sse;
950 INSTANTIATE_TEST_CASE_P(SSE, SADx4Test, ::testing::Values(
951                         make_tuple(4, 8, sad_4x8x4d_sse, -1),
952                         make_tuple(4, 4, sad_4x4x4d_sse, -1)));
953 #endif  // CONFIG_USE_X86INC
954 #endif  // CONFIG_VP9_ENCODER
955 #endif  // HAVE_SSE
956
957 #if HAVE_SSE2
958 #if CONFIG_VP8_ENCODER
959 const SadMxNFunc sad_16x16_wmt = vp8_sad16x16_wmt;
960 const SadMxNFunc sad_8x16_wmt = vp8_sad8x16_wmt;
961 const SadMxNFunc sad_16x8_wmt = vp8_sad16x8_wmt;
962 const SadMxNFunc sad_8x8_wmt = vp8_sad8x8_wmt;
963 const SadMxNFunc sad_4x4_wmt = vp8_sad4x4_wmt;
964 const SadMxNParam sse2_tests[] = {
965   make_tuple(16, 16, sad_16x16_wmt, -1),
966   make_tuple(8, 16, sad_8x16_wmt, -1),
967   make_tuple(16, 8, sad_16x8_wmt, -1),
968   make_tuple(8, 8, sad_8x8_wmt, -1),
969   make_tuple(4, 4, sad_4x4_wmt, -1),
970 };
971 INSTANTIATE_TEST_CASE_P(SSE2, SADTest, ::testing::ValuesIn(sse2_tests));
972 #endif  // CONFIG_VP8_ENCODER
973
974 #if CONFIG_VP9_ENCODER
975 #if CONFIG_USE_X86INC
976 const SadMxNVp9Func sad_64x64_sse2_vp9 = vp9_sad64x64_sse2;
977 const SadMxNVp9Func sad_64x32_sse2_vp9 = vp9_sad64x32_sse2;
978 const SadMxNVp9Func sad_32x64_sse2_vp9 = vp9_sad32x64_sse2;
979 const SadMxNVp9Func sad_32x32_sse2_vp9 = vp9_sad32x32_sse2;
980 const SadMxNVp9Func sad_32x16_sse2_vp9 = vp9_sad32x16_sse2;
981 const SadMxNVp9Func sad_16x32_sse2_vp9 = vp9_sad16x32_sse2;
982 const SadMxNVp9Func sad_16x16_sse2_vp9 = vp9_sad16x16_sse2;
983 const SadMxNVp9Func sad_16x8_sse2_vp9 = vp9_sad16x8_sse2;
984 const SadMxNVp9Func sad_8x16_sse2_vp9 = vp9_sad8x16_sse2;
985 const SadMxNVp9Func sad_8x8_sse2_vp9 = vp9_sad8x8_sse2;
986 const SadMxNVp9Func sad_8x4_sse2_vp9 = vp9_sad8x4_sse2;
987
988 const SadMxNx4Func sad_64x64x4d_sse2 = vp9_sad64x64x4d_sse2;
989 const SadMxNx4Func sad_64x32x4d_sse2 = vp9_sad64x32x4d_sse2;
990 const SadMxNx4Func sad_32x64x4d_sse2 = vp9_sad32x64x4d_sse2;
991 const SadMxNx4Func sad_32x32x4d_sse2 = vp9_sad32x32x4d_sse2;
992 const SadMxNx4Func sad_32x16x4d_sse2 = vp9_sad32x16x4d_sse2;
993 const SadMxNx4Func sad_16x32x4d_sse2 = vp9_sad16x32x4d_sse2;
994 const SadMxNx4Func sad_16x16x4d_sse2 = vp9_sad16x16x4d_sse2;
995 const SadMxNx4Func sad_16x8x4d_sse2 = vp9_sad16x8x4d_sse2;
996 const SadMxNx4Func sad_8x16x4d_sse2 = vp9_sad8x16x4d_sse2;
997 const SadMxNx4Func sad_8x8x4d_sse2 = vp9_sad8x8x4d_sse2;
998 const SadMxNx4Func sad_8x4x4d_sse2 = vp9_sad8x4x4d_sse2;
999
1000 #if CONFIG_VP9_HIGHBITDEPTH
1001 const SadMxNVp9Func highbd_sad8x4_sse2_vp9 = vp9_highbd_sad8x4_sse2;
1002 const SadMxNVp9Func highbd_sad8x8_sse2_vp9 = vp9_highbd_sad8x8_sse2;
1003 const SadMxNVp9Func highbd_sad8x16_sse2_vp9 = vp9_highbd_sad8x16_sse2;
1004 const SadMxNVp9Func highbd_sad16x8_sse2_vp9 = vp9_highbd_sad16x8_sse2;
1005 const SadMxNVp9Func highbd_sad16x16_sse2_vp9 = vp9_highbd_sad16x16_sse2;
1006 const SadMxNVp9Func highbd_sad16x32_sse2_vp9 = vp9_highbd_sad16x32_sse2;
1007 const SadMxNVp9Func highbd_sad32x16_sse2_vp9 = vp9_highbd_sad32x16_sse2;
1008 const SadMxNVp9Func highbd_sad32x32_sse2_vp9 = vp9_highbd_sad32x32_sse2;
1009 const SadMxNVp9Func highbd_sad32x64_sse2_vp9 = vp9_highbd_sad32x64_sse2;
1010 const SadMxNVp9Func highbd_sad64x32_sse2_vp9 = vp9_highbd_sad64x32_sse2;
1011 const SadMxNVp9Func highbd_sad64x64_sse2_vp9 = vp9_highbd_sad64x64_sse2;
1012
1013 INSTANTIATE_TEST_CASE_P(SSE2, SADVP9Test, ::testing::Values(
1014                         make_tuple(64, 64, sad_64x64_sse2_vp9, -1),
1015                         make_tuple(64, 32, sad_64x32_sse2_vp9, -1),
1016                         make_tuple(32, 64, sad_32x64_sse2_vp9, -1),
1017                         make_tuple(32, 32, sad_32x32_sse2_vp9, -1),
1018                         make_tuple(32, 16, sad_32x16_sse2_vp9, -1),
1019                         make_tuple(16, 32, sad_16x32_sse2_vp9, -1),
1020                         make_tuple(16, 16, sad_16x16_sse2_vp9, -1),
1021                         make_tuple(16, 8, sad_16x8_sse2_vp9, -1),
1022                         make_tuple(8, 16, sad_8x16_sse2_vp9, -1),
1023                         make_tuple(8, 8, sad_8x8_sse2_vp9, -1),
1024                         make_tuple(8, 4, sad_8x4_sse2_vp9, -1),
1025                         make_tuple(8, 4, highbd_sad8x4_sse2_vp9, 8),
1026                         make_tuple(8, 8, highbd_sad8x8_sse2_vp9, 8),
1027                         make_tuple(8, 16, highbd_sad8x16_sse2_vp9, 8),
1028                         make_tuple(16, 8, highbd_sad16x8_sse2_vp9, 8),
1029                         make_tuple(16, 16, highbd_sad16x16_sse2_vp9, 8),
1030                         make_tuple(16, 32, highbd_sad16x32_sse2_vp9, 8),
1031                         make_tuple(32, 16, highbd_sad32x16_sse2_vp9, 8),
1032                         make_tuple(32, 32, highbd_sad32x32_sse2_vp9, 8),
1033                         make_tuple(32, 64, highbd_sad32x64_sse2_vp9, 8),
1034                         make_tuple(64, 32, highbd_sad64x32_sse2_vp9, 8),
1035                         make_tuple(64, 64, highbd_sad64x64_sse2_vp9, 8),
1036                         make_tuple(8, 4, highbd_sad8x4_sse2_vp9, 10),
1037                         make_tuple(8, 8, highbd_sad8x8_sse2_vp9, 10),
1038                         make_tuple(8, 16, highbd_sad8x16_sse2_vp9, 10),
1039                         make_tuple(16, 8, highbd_sad16x8_sse2_vp9, 10),
1040                         make_tuple(16, 16, highbd_sad16x16_sse2_vp9, 10),
1041                         make_tuple(16, 32, highbd_sad16x32_sse2_vp9, 10),
1042                         make_tuple(32, 16, highbd_sad32x16_sse2_vp9, 10),
1043                         make_tuple(32, 32, highbd_sad32x32_sse2_vp9, 10),
1044                         make_tuple(32, 64, highbd_sad32x64_sse2_vp9, 10),
1045                         make_tuple(64, 32, highbd_sad64x32_sse2_vp9, 10),
1046                         make_tuple(64, 64, highbd_sad64x64_sse2_vp9, 10),
1047                         make_tuple(8, 4, highbd_sad8x4_sse2_vp9, 12),
1048                         make_tuple(8, 8, highbd_sad8x8_sse2_vp9, 12),
1049                         make_tuple(8, 16, highbd_sad8x16_sse2_vp9, 12),
1050                         make_tuple(16, 8, highbd_sad16x8_sse2_vp9, 12),
1051                         make_tuple(16, 16, highbd_sad16x16_sse2_vp9, 12),
1052                         make_tuple(16, 32, highbd_sad16x32_sse2_vp9, 12),
1053                         make_tuple(32, 16, highbd_sad32x16_sse2_vp9, 12),
1054                         make_tuple(32, 32, highbd_sad32x32_sse2_vp9, 12),
1055                         make_tuple(32, 64, highbd_sad32x64_sse2_vp9, 12),
1056                         make_tuple(64, 32, highbd_sad64x32_sse2_vp9, 12),
1057                         make_tuple(64, 64, highbd_sad64x64_sse2_vp9, 12)));
1058
1059 const SadMxNAvgVp9Func highbd_sad8x4_avg_sse2_vp9 = vp9_highbd_sad8x4_avg_sse2;
1060 const SadMxNAvgVp9Func highbd_sad8x8_avg_sse2_vp9 = vp9_highbd_sad8x8_avg_sse2;
1061 const SadMxNAvgVp9Func highbd_sad8x16_avg_sse2_vp9 =
1062   vp9_highbd_sad8x16_avg_sse2;
1063 const SadMxNAvgVp9Func highbd_sad16x8_avg_sse2_vp9 =
1064   vp9_highbd_sad16x8_avg_sse2;
1065 const SadMxNAvgVp9Func highbd_sad16x16_avg_sse2_vp9 =
1066   vp9_highbd_sad16x16_avg_sse2;
1067 const SadMxNAvgVp9Func highbd_sad16x32_avg_sse2_vp9 =
1068   vp9_highbd_sad16x32_avg_sse2;
1069 const SadMxNAvgVp9Func highbd_sad32x16_avg_sse2_vp9 =
1070   vp9_highbd_sad32x16_avg_sse2;
1071 const SadMxNAvgVp9Func highbd_sad32x32_avg_sse2_vp9 =
1072   vp9_highbd_sad32x32_avg_sse2;
1073 const SadMxNAvgVp9Func highbd_sad32x64_avg_sse2_vp9 =
1074   vp9_highbd_sad32x64_avg_sse2;
1075 const SadMxNAvgVp9Func highbd_sad64x32_avg_sse2_vp9 =
1076   vp9_highbd_sad64x32_avg_sse2;
1077 const SadMxNAvgVp9Func highbd_sad64x64_avg_sse2_vp9 =
1078   vp9_highbd_sad64x64_avg_sse2;
1079
1080 INSTANTIATE_TEST_CASE_P(SSE2, SADavgVP9Test, ::testing::Values(
1081                         make_tuple(8, 4, highbd_sad8x4_avg_sse2_vp9, 8),
1082                         make_tuple(8, 8, highbd_sad8x8_avg_sse2_vp9, 8),
1083                         make_tuple(8, 16, highbd_sad8x16_avg_sse2_vp9, 8),
1084                         make_tuple(16, 8, highbd_sad16x8_avg_sse2_vp9, 8),
1085                         make_tuple(16, 16, highbd_sad16x16_avg_sse2_vp9, 8),
1086                         make_tuple(16, 32, highbd_sad16x32_avg_sse2_vp9, 8),
1087                         make_tuple(32, 16, highbd_sad32x16_avg_sse2_vp9, 8),
1088                         make_tuple(32, 32, highbd_sad32x32_avg_sse2_vp9, 8),
1089                         make_tuple(32, 64, highbd_sad32x64_avg_sse2_vp9, 8),
1090                         make_tuple(64, 32, highbd_sad64x32_avg_sse2_vp9, 8),
1091                         make_tuple(64, 64, highbd_sad64x64_avg_sse2_vp9, 8),
1092                         make_tuple(8, 4, highbd_sad8x4_avg_sse2_vp9, 10),
1093                         make_tuple(8, 8, highbd_sad8x8_avg_sse2_vp9, 10),
1094                         make_tuple(8, 16, highbd_sad8x16_avg_sse2_vp9, 10),
1095                         make_tuple(16, 8, highbd_sad16x8_avg_sse2_vp9, 10),
1096                         make_tuple(16, 16, highbd_sad16x16_avg_sse2_vp9, 10),
1097                         make_tuple(16, 32, highbd_sad16x32_avg_sse2_vp9, 10),
1098                         make_tuple(32, 16, highbd_sad32x16_avg_sse2_vp9, 10),
1099                         make_tuple(32, 32, highbd_sad32x32_avg_sse2_vp9, 10),
1100                         make_tuple(32, 64, highbd_sad32x64_avg_sse2_vp9, 10),
1101                         make_tuple(64, 32, highbd_sad64x32_avg_sse2_vp9, 10),
1102                         make_tuple(64, 64, highbd_sad64x64_avg_sse2_vp9, 10),
1103                         make_tuple(8, 4, highbd_sad8x4_avg_sse2_vp9, 12),
1104                         make_tuple(8, 8, highbd_sad8x8_avg_sse2_vp9, 12),
1105                         make_tuple(8, 16, highbd_sad8x16_avg_sse2_vp9, 12),
1106                         make_tuple(16, 8, highbd_sad16x8_avg_sse2_vp9, 12),
1107                         make_tuple(16, 16, highbd_sad16x16_avg_sse2_vp9, 12),
1108                         make_tuple(16, 32, highbd_sad16x32_avg_sse2_vp9, 12),
1109                         make_tuple(32, 16, highbd_sad32x16_avg_sse2_vp9, 12),
1110                         make_tuple(32, 32, highbd_sad32x32_avg_sse2_vp9, 12),
1111                         make_tuple(32, 64, highbd_sad32x64_avg_sse2_vp9, 12),
1112                         make_tuple(64, 32, highbd_sad64x32_avg_sse2_vp9, 12),
1113                         make_tuple(64, 64, highbd_sad64x64_avg_sse2_vp9, 12)));
1114
1115 const SadMxNx4Func highbd_sad_64x64x4d_sse2 = vp9_highbd_sad64x64x4d_sse2;
1116 const SadMxNx4Func highbd_sad_64x32x4d_sse2 = vp9_highbd_sad64x32x4d_sse2;
1117 const SadMxNx4Func highbd_sad_32x64x4d_sse2 = vp9_highbd_sad32x64x4d_sse2;
1118 const SadMxNx4Func highbd_sad_32x32x4d_sse2 = vp9_highbd_sad32x32x4d_sse2;
1119 const SadMxNx4Func highbd_sad_32x16x4d_sse2 = vp9_highbd_sad32x16x4d_sse2;
1120 const SadMxNx4Func highbd_sad_16x32x4d_sse2 = vp9_highbd_sad16x32x4d_sse2;
1121 const SadMxNx4Func highbd_sad_16x16x4d_sse2 = vp9_highbd_sad16x16x4d_sse2;
1122 const SadMxNx4Func highbd_sad_16x8x4d_sse2 = vp9_highbd_sad16x8x4d_sse2;
1123 const SadMxNx4Func highbd_sad_8x16x4d_sse2 = vp9_highbd_sad8x16x4d_sse2;
1124 const SadMxNx4Func highbd_sad_8x8x4d_sse2 = vp9_highbd_sad8x8x4d_sse2;
1125 const SadMxNx4Func highbd_sad_8x4x4d_sse2 = vp9_highbd_sad8x4x4d_sse2;
1126 const SadMxNx4Func highbd_sad_4x8x4d_sse2 = vp9_highbd_sad4x8x4d_sse2;
1127 const SadMxNx4Func highbd_sad_4x4x4d_sse2 = vp9_highbd_sad4x4x4d_sse2;
1128
1129 INSTANTIATE_TEST_CASE_P(SSE2, SADx4Test, ::testing::Values(
1130                         make_tuple(64, 64, sad_64x64x4d_sse2, -1),
1131                         make_tuple(64, 32, sad_64x32x4d_sse2, -1),
1132                         make_tuple(32, 64, sad_32x64x4d_sse2, -1),
1133                         make_tuple(32, 32, sad_32x32x4d_sse2, -1),
1134                         make_tuple(32, 16, sad_32x16x4d_sse2, -1),
1135                         make_tuple(16, 32, sad_16x32x4d_sse2, -1),
1136                         make_tuple(16, 16, sad_16x16x4d_sse2, -1),
1137                         make_tuple(16, 8, sad_16x8x4d_sse2,  -1),
1138                         make_tuple(8, 16, sad_8x16x4d_sse2,  -1),
1139                         make_tuple(8, 8, sad_8x8x4d_sse2,   -1),
1140                         make_tuple(8, 4, sad_8x4x4d_sse2,   -1),
1141                         make_tuple(64, 64, highbd_sad_64x64x4d_sse2, 8),
1142                         make_tuple(64, 32, highbd_sad_64x32x4d_sse2, 8),
1143                         make_tuple(32, 64, highbd_sad_32x64x4d_sse2, 8),
1144                         make_tuple(32, 32, highbd_sad_32x32x4d_sse2, 8),
1145                         make_tuple(32, 16, highbd_sad_32x16x4d_sse2, 8),
1146                         make_tuple(16, 32, highbd_sad_16x32x4d_sse2, 8),
1147                         make_tuple(16, 16, highbd_sad_16x16x4d_sse2, 8),
1148                         make_tuple(16, 8, highbd_sad_16x8x4d_sse2,  8),
1149                         make_tuple(8, 16, highbd_sad_8x16x4d_sse2,  8),
1150                         make_tuple(8, 8, highbd_sad_8x8x4d_sse2,   8),
1151                         make_tuple(8, 4, highbd_sad_8x4x4d_sse2,   8),
1152                         make_tuple(4, 8, highbd_sad_4x8x4d_sse2,   8),
1153                         make_tuple(4, 4, highbd_sad_4x4x4d_sse2,   8),
1154                         make_tuple(64, 64, highbd_sad_64x64x4d_sse2, 10),
1155                         make_tuple(64, 32, highbd_sad_64x32x4d_sse2, 10),
1156                         make_tuple(32, 64, highbd_sad_32x64x4d_sse2, 10),
1157                         make_tuple(32, 32, highbd_sad_32x32x4d_sse2, 10),
1158                         make_tuple(32, 16, highbd_sad_32x16x4d_sse2, 10),
1159                         make_tuple(16, 32, highbd_sad_16x32x4d_sse2, 10),
1160                         make_tuple(16, 16, highbd_sad_16x16x4d_sse2, 10),
1161                         make_tuple(16, 8, highbd_sad_16x8x4d_sse2,  10),
1162                         make_tuple(8, 16, highbd_sad_8x16x4d_sse2,  10),
1163                         make_tuple(8, 8, highbd_sad_8x8x4d_sse2,   10),
1164                         make_tuple(8, 4, highbd_sad_8x4x4d_sse2,   10),
1165                         make_tuple(4, 8, highbd_sad_4x8x4d_sse2,   10),
1166                         make_tuple(4, 4, highbd_sad_4x4x4d_sse2,   10),
1167                         make_tuple(64, 64, highbd_sad_64x64x4d_sse2, 12),
1168                         make_tuple(64, 32, highbd_sad_64x32x4d_sse2, 12),
1169                         make_tuple(32, 64, highbd_sad_32x64x4d_sse2, 12),
1170                         make_tuple(32, 32, highbd_sad_32x32x4d_sse2, 12),
1171                         make_tuple(32, 16, highbd_sad_32x16x4d_sse2, 12),
1172                         make_tuple(16, 32, highbd_sad_16x32x4d_sse2, 12),
1173                         make_tuple(16, 16, highbd_sad_16x16x4d_sse2, 12),
1174                         make_tuple(16, 8, highbd_sad_16x8x4d_sse2,  12),
1175                         make_tuple(8, 16, highbd_sad_8x16x4d_sse2,  12),
1176                         make_tuple(8, 8, highbd_sad_8x8x4d_sse2,   12),
1177                         make_tuple(8, 4, highbd_sad_8x4x4d_sse2,   12),
1178                         make_tuple(4, 8, highbd_sad_4x8x4d_sse2,   12),
1179                         make_tuple(4, 4, highbd_sad_4x4x4d_sse2,   12)));
1180 #else
1181 INSTANTIATE_TEST_CASE_P(SSE2, SADVP9Test, ::testing::Values(
1182                         make_tuple(64, 64, sad_64x64_sse2_vp9, -1),
1183                         make_tuple(64, 32, sad_64x32_sse2_vp9, -1),
1184                         make_tuple(32, 64, sad_32x64_sse2_vp9, -1),
1185                         make_tuple(32, 32, sad_32x32_sse2_vp9, -1),
1186                         make_tuple(32, 16, sad_32x16_sse2_vp9, -1),
1187                         make_tuple(16, 32, sad_16x32_sse2_vp9, -1),
1188                         make_tuple(16, 16, sad_16x16_sse2_vp9, -1),
1189                         make_tuple(16, 8, sad_16x8_sse2_vp9, -1),
1190                         make_tuple(8, 16, sad_8x16_sse2_vp9, -1),
1191                         make_tuple(8, 8, sad_8x8_sse2_vp9, -1),
1192                         make_tuple(8, 4, sad_8x4_sse2_vp9, -1)));
1193
1194 INSTANTIATE_TEST_CASE_P(SSE2, SADx4Test, ::testing::Values(
1195                         make_tuple(64, 64, sad_64x64x4d_sse2, -1),
1196                         make_tuple(64, 32, sad_64x32x4d_sse2, -1),
1197                         make_tuple(32, 64, sad_32x64x4d_sse2, -1),
1198                         make_tuple(32, 32, sad_32x32x4d_sse2, -1),
1199                         make_tuple(32, 16, sad_32x16x4d_sse2, -1),
1200                         make_tuple(16, 32, sad_16x32x4d_sse2, -1),
1201                         make_tuple(16, 16, sad_16x16x4d_sse2, -1),
1202                         make_tuple(16, 8, sad_16x8x4d_sse2,  -1),
1203                         make_tuple(8, 16, sad_8x16x4d_sse2,  -1),
1204                         make_tuple(8, 8, sad_8x8x4d_sse2,   -1),
1205                         make_tuple(8, 4, sad_8x4x4d_sse2,   -1)));
1206 #endif  // CONFIG_VP9_HIGHBITDEPTH
1207 #endif  // CONFIG_USE_X86INC
1208 #endif  // CONFIG_VP9_ENCODER
1209 #endif  // HAVE_SSE2
1210
1211 #if HAVE_SSE3
1212 #if CONFIG_VP8_ENCODER
1213 const SadMxNx4Func sad_16x16x4d_sse3 = vp8_sad16x16x4d_sse3;
1214 const SadMxNx4Func sad_16x8x4d_sse3 = vp8_sad16x8x4d_sse3;
1215 const SadMxNx4Func sad_8x16x4d_sse3 = vp8_sad8x16x4d_sse3;
1216 const SadMxNx4Func sad_8x8x4d_sse3 = vp8_sad8x8x4d_sse3;
1217 const SadMxNx4Func sad_4x4x4d_sse3 = vp8_sad4x4x4d_sse3;
1218 INSTANTIATE_TEST_CASE_P(SSE3, SADx4Test, ::testing::Values(
1219                         make_tuple(16, 16, sad_16x16x4d_sse3, -1),
1220                         make_tuple(16, 8, sad_16x8x4d_sse3, -1),
1221                         make_tuple(8, 16, sad_8x16x4d_sse3, -1),
1222                         make_tuple(8, 8, sad_8x8x4d_sse3, -1),
1223                         make_tuple(4, 4, sad_4x4x4d_sse3, -1)));
1224 #endif  // CONFIG_VP8_ENCODER
1225 #endif  // HAVE_SSE3
1226
1227 #if HAVE_SSSE3
1228 #if CONFIG_USE_X86INC
1229 #if CONFIG_VP8_ENCODER
1230 const SadMxNFunc sad_16x16_sse3 = vp8_sad16x16_sse3;
1231 INSTANTIATE_TEST_CASE_P(SSE3, SADTest, ::testing::Values(
1232                         make_tuple(16, 16, sad_16x16_sse3, -1)));
1233 #endif  // CONFIG_VP8_ENCODER
1234 #endif  // CONFIG_USE_X86INC
1235 #endif  // HAVE_SSSE3
1236
1237 #if CONFIG_VP9_ENCODER
1238 #if HAVE_AVX2
1239 const SadMxNx4Func sad_64x64x4d_avx2 = vp9_sad64x64x4d_avx2;
1240 const SadMxNx4Func sad_32x32x4d_avx2 = vp9_sad32x32x4d_avx2;
1241 INSTANTIATE_TEST_CASE_P(AVX2, SADx4Test, ::testing::Values(
1242                         make_tuple(32, 32, sad_32x32x4d_avx2, -1),
1243                         make_tuple(64, 64, sad_64x64x4d_avx2, -1)));
1244 #endif  // HAVE_AVX2
1245
1246 #if HAVE_NEON
1247 const SadMxNx4Func sad_16x16x4d_neon = vp9_sad16x16x4d_neon;
1248 const SadMxNx4Func sad_32x32x4d_neon = vp9_sad32x32x4d_neon;
1249 const SadMxNx4Func sad_64x64x4d_neon = vp9_sad64x64x4d_neon;
1250 INSTANTIATE_TEST_CASE_P(NEON, SADx4Test, ::testing::Values(
1251                         make_tuple(16, 16, sad_16x16x4d_neon, -1),
1252                         make_tuple(32, 32, sad_32x32x4d_neon, -1),
1253                         make_tuple(64, 64, sad_64x64x4d_neon, -1)));
1254 #endif  // HAVE_NEON
1255 #endif  // CONFIG_VP9_ENCODER
1256
1257 }  // namespace