• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2018, Alliance for Open Media. All rights reserved
3  *
4  * This source code is subject to the terms of the BSD 2 Clause License and
5  * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6  * was not distributed with this source code in the LICENSE file, you can
7  * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8  * Media Patent License 1.0 was not distributed with this source code in the
9  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10  */
11 
12 #include <tuple>
13 #include <vector>
14 
15 #include "third_party/googletest/src/googletest/include/gtest/gtest.h"
16 
17 #include "config/aom_config.h"
18 #include "config/aom_dsp_rtcd.h"
19 
20 #include "aom_mem/aom_mem.h"
21 #include "aom_ports/aom_timer.h"
22 #include "aom_ports/sanitizer.h"
23 #include "av1/common/blockd.h"
24 #include "av1/common/pred_common.h"
25 #include "av1/common/reconintra.h"
26 #include "test/acm_random.h"
27 #include "test/register_state_check.h"
28 #include "test/util.h"
29 
30 namespace {
31 
32 const int kZ1Start = 0;
33 const int kZ2Start = 90;
34 const int kZ3Start = 180;
35 
36 const TX_SIZE kTxSize[] = { TX_4X4,   TX_8X8,   TX_16X16, TX_32X32, TX_64X64,
37                             TX_4X8,   TX_8X4,   TX_8X16,  TX_16X8,  TX_16X32,
38                             TX_32X16, TX_32X64, TX_64X32, TX_4X16,  TX_16X4,
39                             TX_8X32,  TX_32X8,  TX_16X64, TX_64X16 };
40 
41 const char *const kTxSizeStrings[] = {
42   "TX_4X4",   "TX_8X8",   "TX_16X16", "TX_32X32", "TX_64X64",
43   "TX_4X8",   "TX_8X4",   "TX_8X16",  "TX_16X8",  "TX_16X32",
44   "TX_32X16", "TX_32X64", "TX_64X32", "TX_4X16",  "TX_16X4",
45   "TX_8X32",  "TX_32X8",  "TX_16X64", "TX_64X16"
46 };
47 
48 using libaom_test::ACMRandom;
49 
50 typedef void (*DrPred_Hbd)(uint16_t *dst, ptrdiff_t stride, int bw, int bh,
51                            const uint16_t *above, const uint16_t *left,
52                            int upsample_above, int upsample_left, int dx,
53                            int dy, int bd);
54 
55 typedef void (*DrPred)(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
56                        const uint8_t *above, const uint8_t *left,
57                        int upsample_above, int upsample_left, int dx, int dy,
58                        int bd);
59 
60 typedef void (*Z1_Lbd)(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
61                        const uint8_t *above, const uint8_t *left,
62                        int upsample_above, int dx, int dy);
63 template <Z1_Lbd fn>
z1_wrapper(uint8_t * dst,ptrdiff_t stride,int bw,int bh,const uint8_t * above,const uint8_t * left,int upsample_above,int upsample_left,int dx,int dy,int bd)64 void z1_wrapper(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
65                 const uint8_t *above, const uint8_t *left, int upsample_above,
66                 int upsample_left, int dx, int dy, int bd) {
67   (void)bd;
68   (void)upsample_left;
69   fn(dst, stride, bw, bh, above, left, upsample_above, dx, dy);
70 }
71 
72 typedef void (*Z2_Lbd)(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
73                        const uint8_t *above, const uint8_t *left,
74                        int upsample_above, int upsample_left, int dx, int dy);
75 template <Z2_Lbd fn>
z2_wrapper(uint8_t * dst,ptrdiff_t stride,int bw,int bh,const uint8_t * above,const uint8_t * left,int upsample_above,int upsample_left,int dx,int dy,int bd)76 void z2_wrapper(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
77                 const uint8_t *above, const uint8_t *left, int upsample_above,
78                 int upsample_left, int dx, int dy, int bd) {
79   (void)bd;
80   (void)upsample_left;
81   fn(dst, stride, bw, bh, above, left, upsample_above, upsample_left, dx, dy);
82 }
83 
84 typedef void (*Z3_Lbd)(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
85                        const uint8_t *above, const uint8_t *left,
86                        int upsample_left, int dx, int dy);
87 template <Z3_Lbd fn>
z3_wrapper(uint8_t * dst,ptrdiff_t stride,int bw,int bh,const uint8_t * above,const uint8_t * left,int upsample_above,int upsample_left,int dx,int dy,int bd)88 void z3_wrapper(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
89                 const uint8_t *above, const uint8_t *left, int upsample_above,
90                 int upsample_left, int dx, int dy, int bd) {
91   (void)bd;
92   (void)upsample_above;
93   fn(dst, stride, bw, bh, above, left, upsample_left, dx, dy);
94 }
95 
96 typedef void (*Z1_Hbd)(uint16_t *dst, ptrdiff_t stride, int bw, int bh,
97                        const uint16_t *above, const uint16_t *left,
98                        int upsample_above, int dx, int dy, int bd);
99 template <Z1_Hbd fn>
z1_wrapper_hbd(uint16_t * dst,ptrdiff_t stride,int bw,int bh,const uint16_t * above,const uint16_t * left,int upsample_above,int upsample_left,int dx,int dy,int bd)100 void z1_wrapper_hbd(uint16_t *dst, ptrdiff_t stride, int bw, int bh,
101                     const uint16_t *above, const uint16_t *left,
102                     int upsample_above, int upsample_left, int dx, int dy,
103                     int bd) {
104   (void)bd;
105   (void)upsample_left;
106   fn(dst, stride, bw, bh, above, left, upsample_above, dx, dy, bd);
107 }
108 
109 typedef void (*Z2_Hbd)(uint16_t *dst, ptrdiff_t stride, int bw, int bh,
110                        const uint16_t *above, const uint16_t *left,
111                        int upsample_above, int upsample_left, int dx, int dy,
112                        int bd);
113 template <Z2_Hbd fn>
z2_wrapper_hbd(uint16_t * dst,ptrdiff_t stride,int bw,int bh,const uint16_t * above,const uint16_t * left,int upsample_above,int upsample_left,int dx,int dy,int bd)114 void z2_wrapper_hbd(uint16_t *dst, ptrdiff_t stride, int bw, int bh,
115                     const uint16_t *above, const uint16_t *left,
116                     int upsample_above, int upsample_left, int dx, int dy,
117                     int bd) {
118   (void)bd;
119   fn(dst, stride, bw, bh, above, left, upsample_above, upsample_left, dx, dy,
120      bd);
121 }
122 
123 typedef void (*Z3_Hbd)(uint16_t *dst, ptrdiff_t stride, int bw, int bh,
124                        const uint16_t *above, const uint16_t *left,
125                        int upsample_left, int dx, int dy, int bd);
126 template <Z3_Hbd fn>
z3_wrapper_hbd(uint16_t * dst,ptrdiff_t stride,int bw,int bh,const uint16_t * above,const uint16_t * left,int upsample_above,int upsample_left,int dx,int dy,int bd)127 void z3_wrapper_hbd(uint16_t *dst, ptrdiff_t stride, int bw, int bh,
128                     const uint16_t *above, const uint16_t *left,
129                     int upsample_above, int upsample_left, int dx, int dy,
130                     int bd) {
131   (void)bd;
132   (void)upsample_above;
133   fn(dst, stride, bw, bh, above, left, upsample_left, dx, dy, bd);
134 }
135 
136 template <typename FuncType>
137 struct DrPredFunc {
DrPredFunc__anonbb524af00111::DrPredFunc138   DrPredFunc(FuncType pred = nullptr, FuncType tst = nullptr,
139              int bit_depth_value = 0, int start_angle_value = 0)
140       : ref_fn(pred), tst_fn(tst), bit_depth(bit_depth_value),
141         start_angle(start_angle_value) {}
142 
143   FuncType ref_fn;
144   FuncType tst_fn;
145   int bit_depth;
146   int start_angle;
147 };
148 
149 template <typename Pixel, typename FuncType>
150 class DrPredTest : public ::testing::TestWithParam<DrPredFunc<FuncType> > {
151  protected:
152   static const int kMaxNumTests = 10000;
153   static const int kIterations = 10;
154   static const int kOffset = 16;
155   static const int kBufSize = ((2 * MAX_TX_SIZE) << 1) + 16;
156 
DrPredTest()157   DrPredTest()
158       : enable_upsample_(0), upsample_above_(0), upsample_left_(0), bw_(0),
159         bh_(0), dx_(1), dy_(1), bd_(8), txsize_(TX_4X4) {
160     params_ = this->GetParam();
161     start_angle_ = params_.start_angle;
162     stop_angle_ = start_angle_ + 90;
163 
164     above_ = &above_data_[kOffset];
165     left_ = &left_data_[kOffset];
166 
167     for (int i = 0; i < kBufSize; ++i) {
168       above_data_[i] = rng_.Rand8();
169       left_data_[i] = rng_.Rand8();
170     }
171   }
172 
173   ~DrPredTest() override = default;
174 
Predict(bool speedtest,int tx,Pixel * dst_ref,Pixel * dst_tst,int dst_stride)175   void Predict(bool speedtest, int tx, Pixel *dst_ref, Pixel *dst_tst,
176                int dst_stride) {
177     const int kNumTests = speedtest ? kMaxNumTests : 1;
178     aom_usec_timer timer;
179     int tst_time = 0;
180 
181     bd_ = params_.bit_depth;
182 
183     aom_usec_timer_start(&timer);
184     for (int k = 0; k < kNumTests; ++k) {
185       params_.ref_fn(dst_ref, dst_stride, bw_, bh_, above_, left_,
186                      upsample_above_, upsample_left_, dx_, dy_, bd_);
187     }
188     aom_usec_timer_mark(&timer);
189     const int ref_time = static_cast<int>(aom_usec_timer_elapsed(&timer));
190 
191     if (params_.tst_fn) {
192       aom_usec_timer_start(&timer);
193       for (int k = 0; k < kNumTests; ++k) {
194         API_REGISTER_STATE_CHECK(params_.tst_fn(dst_tst, dst_stride, bw_, bh_,
195                                                 above_, left_, upsample_above_,
196                                                 upsample_left_, dx_, dy_, bd_));
197       }
198       aom_usec_timer_mark(&timer);
199       tst_time = static_cast<int>(aom_usec_timer_elapsed(&timer));
200     } else {
201       for (int r = 0; r < bh_; ++r) {
202         for (int c = 0; c < bw_; ++c) {
203           dst_tst[r * dst_stride + c] = dst_ref[r * dst_stride + c];
204         }
205       }
206     }
207 
208     OutputTimes(kNumTests, ref_time, tst_time, tx);
209   }
210 
RunTest(bool speedtest,bool needsaturation,int p_angle)211   void RunTest(bool speedtest, bool needsaturation, int p_angle) {
212     bd_ = params_.bit_depth;
213 
214     if (needsaturation) {
215       for (int i = 0; i < kBufSize; ++i) {
216         above_data_[i] = left_data_[i] = (1 << bd_) - 1;
217       }
218     }
219     for (int tx = 0; tx < TX_SIZES_ALL; ++tx) {
220       bw_ = tx_size_wide[kTxSize[tx]];
221       bh_ = tx_size_high[kTxSize[tx]];
222 
223       if (enable_upsample_) {
224         upsample_above_ =
225             av1_use_intra_edge_upsample(bw_, bh_, p_angle - 90, 0);
226         upsample_left_ =
227             av1_use_intra_edge_upsample(bw_, bh_, p_angle - 180, 0);
228       } else {
229         upsample_above_ = upsample_left_ = 0;
230       }
231 
232       // Add additional padding to allow detection of over reads/writes when
233       // the transform width is equal to MAX_TX_SIZE.
234       const int dst_stride = MAX_TX_SIZE + 16;
235       std::vector<Pixel> dst_ref(dst_stride * bh_);
236       std::vector<Pixel> dst_tst(dst_stride * bh_);
237 
238       for (int r = 0; r < bh_; ++r) {
239         ASAN_POISON_MEMORY_REGION(&dst_ref[r * dst_stride + bw_],
240                                   (dst_stride - bw_) * sizeof(Pixel));
241         ASAN_POISON_MEMORY_REGION(&dst_tst[r * dst_stride + bw_],
242                                   (dst_stride - bw_) * sizeof(Pixel));
243       }
244 
245       Predict(speedtest, tx, dst_ref.data(), dst_tst.data(), dst_stride);
246 
247       for (int r = 0; r < bh_; ++r) {
248         ASAN_UNPOISON_MEMORY_REGION(&dst_ref[r * dst_stride + bw_],
249                                     (dst_stride - bw_) * sizeof(Pixel));
250         ASAN_UNPOISON_MEMORY_REGION(&dst_tst[r * dst_stride + bw_],
251                                     (dst_stride - bw_) * sizeof(Pixel));
252       }
253 
254       for (int r = 0; r < bh_; ++r) {
255         for (int c = 0; c < bw_; ++c) {
256           ASSERT_EQ(dst_ref[r * dst_stride + c], dst_tst[r * dst_stride + c])
257               << bw_ << "x" << bh_ << " r: " << r << " c: " << c
258               << " dx: " << dx_ << " dy: " << dy_
259               << " upsample_above: " << upsample_above_
260               << " upsample_left: " << upsample_left_;
261         }
262       }
263     }
264   }
265 
OutputTimes(int num_tests,int ref_time,int tst_time,int tx)266   void OutputTimes(int num_tests, int ref_time, int tst_time, int tx) {
267     if (num_tests > 1) {
268       if (params_.tst_fn) {
269         const float x = static_cast<float>(ref_time) / tst_time;
270         printf("\t[%8s] :: ref time %6d, tst time %6d     %3.2f\n",
271                kTxSizeStrings[tx], ref_time, tst_time, x);
272       } else {
273         printf("\t[%8s] :: ref time %6d\n", kTxSizeStrings[tx], ref_time);
274       }
275     }
276   }
277 
RundrPredTest(const int speed)278   void RundrPredTest(const int speed) {
279     if (params_.tst_fn == nullptr) return;
280     const int angles[] = { 3, 45, 87 };
281     const int start_angle = speed ? 0 : start_angle_;
282     const int stop_angle = speed ? 3 : stop_angle_;
283     for (enable_upsample_ = 0; enable_upsample_ < 2; ++enable_upsample_) {
284       for (int i = start_angle; i < stop_angle; ++i) {
285         const int angle = speed ? angles[i] + start_angle_ : i;
286         dx_ = av1_get_dx(angle);
287         dy_ = av1_get_dy(angle);
288         if (speed) {
289           printf("enable_upsample: %d angle: %d ~~~~~~~~~~~~~~~\n",
290                  enable_upsample_, angle);
291         }
292         if (dx_ && dy_) RunTest(speed, false, angle);
293       }
294     }
295   }
296 
297   Pixel left_data_[kBufSize];
298   Pixel dummy_data_[kBufSize];
299   Pixel above_data_[kBufSize];
300 
301   Pixel *above_;
302   Pixel *left_;
303 
304   int enable_upsample_;
305   int upsample_above_;
306   int upsample_left_;
307   int bw_;
308   int bh_;
309   int dx_;
310   int dy_;
311   int bd_;
312   TX_SIZE txsize_;
313 
314   int start_angle_;
315   int stop_angle_;
316 
317   ACMRandom rng_;
318 
319   DrPredFunc<FuncType> params_;
320 };
321 
322 class LowbdDrPredTest : public DrPredTest<uint8_t, DrPred> {};
323 
TEST_P(LowbdDrPredTest,SaturatedValues)324 TEST_P(LowbdDrPredTest, SaturatedValues) {
325   for (enable_upsample_ = 0; enable_upsample_ < 2; ++enable_upsample_) {
326     for (int angle = start_angle_; angle < stop_angle_; ++angle) {
327       dx_ = av1_get_dx(angle);
328       dy_ = av1_get_dy(angle);
329       if (dx_ && dy_) RunTest(false, true, angle);
330     }
331   }
332 }
333 
334 using std::make_tuple;
335 
336 INSTANTIATE_TEST_SUITE_P(
337     C, LowbdDrPredTest,
338     ::testing::Values(DrPredFunc<DrPred>(&z1_wrapper<av1_dr_prediction_z1_c>,
339                                          nullptr, AOM_BITS_8, kZ1Start),
340                       DrPredFunc<DrPred>(&z2_wrapper<av1_dr_prediction_z2_c>,
341                                          nullptr, AOM_BITS_8, kZ2Start),
342                       DrPredFunc<DrPred>(&z3_wrapper<av1_dr_prediction_z3_c>,
343                                          nullptr, AOM_BITS_8, kZ3Start)));
344 
345 #if CONFIG_AV1_HIGHBITDEPTH
346 class HighbdDrPredTest : public DrPredTest<uint16_t, DrPred_Hbd> {};
347 
TEST_P(HighbdDrPredTest,SaturatedValues)348 TEST_P(HighbdDrPredTest, SaturatedValues) {
349   for (enable_upsample_ = 0; enable_upsample_ < 2; ++enable_upsample_) {
350     for (int angle = start_angle_; angle < stop_angle_; ++angle) {
351       dx_ = av1_get_dx(angle);
352       dy_ = av1_get_dy(angle);
353       if (dx_ && dy_) RunTest(false, true, angle);
354     }
355   }
356 }
357 
358 INSTANTIATE_TEST_SUITE_P(
359     C, HighbdDrPredTest,
360     ::testing::Values(
361         DrPredFunc<DrPred_Hbd>(&z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
362                                nullptr, AOM_BITS_8, kZ1Start),
363         DrPredFunc<DrPred_Hbd>(&z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
364                                nullptr, AOM_BITS_10, kZ1Start),
365         DrPredFunc<DrPred_Hbd>(&z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
366                                nullptr, AOM_BITS_12, kZ1Start),
367         DrPredFunc<DrPred_Hbd>(&z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
368                                nullptr, AOM_BITS_8, kZ2Start),
369         DrPredFunc<DrPred_Hbd>(&z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
370                                nullptr, AOM_BITS_10, kZ2Start),
371         DrPredFunc<DrPred_Hbd>(&z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
372                                nullptr, AOM_BITS_12, kZ2Start),
373         DrPredFunc<DrPred_Hbd>(&z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
374                                nullptr, AOM_BITS_8, kZ3Start),
375         DrPredFunc<DrPred_Hbd>(&z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
376                                nullptr, AOM_BITS_10, kZ3Start),
377         DrPredFunc<DrPred_Hbd>(&z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
378                                nullptr, AOM_BITS_12, kZ3Start)));
379 #endif  // CONFIG_AV1_HIGHBITDEPTH
380 
TEST_P(LowbdDrPredTest,OperationCheck)381 TEST_P(LowbdDrPredTest, OperationCheck) { RundrPredTest(0); }
382 
TEST_P(LowbdDrPredTest,DISABLED_Speed)383 TEST_P(LowbdDrPredTest, DISABLED_Speed) { RundrPredTest(1); }
384 
385 #if CONFIG_AV1_HIGHBITDEPTH
TEST_P(HighbdDrPredTest,OperationCheck)386 TEST_P(HighbdDrPredTest, OperationCheck) {
387   if (params_.tst_fn == nullptr) return;
388   for (enable_upsample_ = 0; enable_upsample_ < 2; ++enable_upsample_) {
389     for (int angle = start_angle_; angle < stop_angle_; angle++) {
390       dx_ = av1_get_dx(angle);
391       dy_ = av1_get_dy(angle);
392       if (dx_ && dy_) RunTest(false, false, angle);
393     }
394   }
395 }
396 
TEST_P(HighbdDrPredTest,DISABLED_Speed)397 TEST_P(HighbdDrPredTest, DISABLED_Speed) {
398   const int angles[] = { 3, 45, 87 };
399   for (enable_upsample_ = 0; enable_upsample_ < 2; ++enable_upsample_) {
400     for (int i = 0; i < 3; ++i) {
401       int angle = angles[i] + start_angle_;
402       dx_ = av1_get_dx(angle);
403       dy_ = av1_get_dy(angle);
404       printf("enable_upsample: %d angle: %d ~~~~~~~~~~~~~~~\n",
405              enable_upsample_, angle);
406       if (dx_ && dy_) RunTest(true, false, angle);
407     }
408   }
409 }
410 #endif  // CONFIG_AV1_HIGHBITDEPTH
411 
412 #if HAVE_SSE4_1
413 INSTANTIATE_TEST_SUITE_P(
414     SSE4_1, LowbdDrPredTest,
415     ::testing::Values(
416         DrPredFunc<DrPred>(&z1_wrapper<av1_dr_prediction_z1_c>,
417                            &z1_wrapper<av1_dr_prediction_z1_sse4_1>, AOM_BITS_8,
418                            kZ1Start),
419         DrPredFunc<DrPred>(&z2_wrapper<av1_dr_prediction_z2_c>,
420                            &z2_wrapper<av1_dr_prediction_z2_sse4_1>, AOM_BITS_8,
421                            kZ2Start),
422         DrPredFunc<DrPred>(&z3_wrapper<av1_dr_prediction_z3_c>,
423                            &z3_wrapper<av1_dr_prediction_z3_sse4_1>, AOM_BITS_8,
424                            kZ3Start)));
425 #endif  // HAVE_SSE4_1
426 
427 #if HAVE_AVX2
428 INSTANTIATE_TEST_SUITE_P(
429     AVX2, LowbdDrPredTest,
430     ::testing::Values(DrPredFunc<DrPred>(&z1_wrapper<av1_dr_prediction_z1_c>,
431                                          &z1_wrapper<av1_dr_prediction_z1_avx2>,
432                                          AOM_BITS_8, kZ1Start),
433                       DrPredFunc<DrPred>(&z2_wrapper<av1_dr_prediction_z2_c>,
434                                          &z2_wrapper<av1_dr_prediction_z2_avx2>,
435                                          AOM_BITS_8, kZ2Start),
436                       DrPredFunc<DrPred>(&z3_wrapper<av1_dr_prediction_z3_c>,
437                                          &z3_wrapper<av1_dr_prediction_z3_avx2>,
438                                          AOM_BITS_8, kZ3Start)));
439 
440 #if CONFIG_AV1_HIGHBITDEPTH
441 INSTANTIATE_TEST_SUITE_P(
442     AVX2, HighbdDrPredTest,
443     ::testing::Values(DrPredFunc<DrPred_Hbd>(
444                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
445                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_avx2>,
446                           AOM_BITS_8, kZ1Start),
447                       DrPredFunc<DrPred_Hbd>(
448                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
449                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_avx2>,
450                           AOM_BITS_10, kZ1Start),
451                       DrPredFunc<DrPred_Hbd>(
452                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
453                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_avx2>,
454                           AOM_BITS_12, kZ1Start),
455                       DrPredFunc<DrPred_Hbd>(
456                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
457                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_avx2>,
458                           AOM_BITS_8, kZ2Start),
459                       DrPredFunc<DrPred_Hbd>(
460                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
461                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_avx2>,
462                           AOM_BITS_10, kZ2Start),
463                       DrPredFunc<DrPred_Hbd>(
464                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
465                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_avx2>,
466                           AOM_BITS_12, kZ2Start),
467                       DrPredFunc<DrPred_Hbd>(
468                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
469                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_avx2>,
470                           AOM_BITS_8, kZ3Start),
471                       DrPredFunc<DrPred_Hbd>(
472                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
473                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_avx2>,
474                           AOM_BITS_10, kZ3Start),
475                       DrPredFunc<DrPred_Hbd>(
476                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
477                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_avx2>,
478                           AOM_BITS_12, kZ3Start)));
479 #endif  // CONFIG_AV1_HIGHBITDEPTH
480 #endif  // HAVE_AVX2
481 
482 #if HAVE_NEON
483 #if AOM_ARCH_AARCH64
484 INSTANTIATE_TEST_SUITE_P(
485     NEON, LowbdDrPredTest,
486     ::testing::Values(DrPredFunc<DrPred>(&z1_wrapper<av1_dr_prediction_z1_c>,
487                                          &z1_wrapper<av1_dr_prediction_z1_neon>,
488                                          AOM_BITS_8, kZ1Start),
489                       DrPredFunc<DrPred>(&z2_wrapper<av1_dr_prediction_z2_c>,
490                                          &z2_wrapper<av1_dr_prediction_z2_neon>,
491                                          AOM_BITS_8, kZ2Start),
492                       DrPredFunc<DrPred>(&z3_wrapper<av1_dr_prediction_z3_c>,
493                                          &z3_wrapper<av1_dr_prediction_z3_neon>,
494                                          AOM_BITS_8, kZ3Start)));
495 #else
496 // TODO(aomedia:349428506): enable av1_highbd_dr_prediction_z2_neon for armv7
497 // after SIGBUS is fixed.
498 INSTANTIATE_TEST_SUITE_P(
499     NEON, LowbdDrPredTest,
500     ::testing::Values(DrPredFunc<DrPred>(&z1_wrapper<av1_dr_prediction_z1_c>,
501                                          &z1_wrapper<av1_dr_prediction_z1_neon>,
502                                          AOM_BITS_8, kZ1Start),
503                       DrPredFunc<DrPred>(&z3_wrapper<av1_dr_prediction_z3_c>,
504                                          &z3_wrapper<av1_dr_prediction_z3_neon>,
505                                          AOM_BITS_8, kZ3Start)));
506 #endif
507 
508 #if CONFIG_AV1_HIGHBITDEPTH
509 #if AOM_ARCH_AARCH64
510 INSTANTIATE_TEST_SUITE_P(
511     NEON, HighbdDrPredTest,
512     ::testing::Values(DrPredFunc<DrPred_Hbd>(
513                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
514                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_neon>,
515                           AOM_BITS_8, kZ1Start),
516                       DrPredFunc<DrPred_Hbd>(
517                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
518                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_neon>,
519                           AOM_BITS_10, kZ1Start),
520                       DrPredFunc<DrPred_Hbd>(
521                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
522                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_neon>,
523                           AOM_BITS_12, kZ1Start),
524                       DrPredFunc<DrPred_Hbd>(
525                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
526                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_neon>,
527                           AOM_BITS_8, kZ2Start),
528                       DrPredFunc<DrPred_Hbd>(
529                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
530                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_neon>,
531                           AOM_BITS_10, kZ2Start),
532                       DrPredFunc<DrPred_Hbd>(
533                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
534                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_neon>,
535                           AOM_BITS_12, kZ2Start),
536                       DrPredFunc<DrPred_Hbd>(
537                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
538                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_neon>,
539                           AOM_BITS_8, kZ3Start),
540                       DrPredFunc<DrPred_Hbd>(
541                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
542                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_neon>,
543                           AOM_BITS_10, kZ3Start),
544                       DrPredFunc<DrPred_Hbd>(
545                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
546                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_neon>,
547                           AOM_BITS_12, kZ3Start)));
548 #else   // !AOM_ARCH_AARCH64
549 // TODO(aomedia:349428506): enable av1_highbd_dr_prediction_z2_neon for armv7
550 // after SIGBUS is fixed.
551 INSTANTIATE_TEST_SUITE_P(
552     NEON, HighbdDrPredTest,
553     ::testing::Values(DrPredFunc<DrPred_Hbd>(
554                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
555                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_neon>,
556                           AOM_BITS_8, kZ1Start),
557                       DrPredFunc<DrPred_Hbd>(
558                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
559                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_neon>,
560                           AOM_BITS_10, kZ1Start),
561                       DrPredFunc<DrPred_Hbd>(
562                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
563                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_neon>,
564                           AOM_BITS_12, kZ1Start),
565                       DrPredFunc<DrPred_Hbd>(
566                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
567                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_neon>,
568                           AOM_BITS_8, kZ3Start),
569                       DrPredFunc<DrPred_Hbd>(
570                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
571                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_neon>,
572                           AOM_BITS_10, kZ3Start),
573                       DrPredFunc<DrPred_Hbd>(
574                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
575                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_neon>,
576                           AOM_BITS_12, kZ3Start)));
577 #endif  // AOM_ARCH_AARCH64
578 #endif  // CONFIG_AV1_HIGHBITDEPTH
579 
580 #endif  // HAVE_NEON
581 
582 }  // namespace
583