• 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 
14 #include "third_party/googletest/src/googletest/include/gtest/gtest.h"
15 
16 #include "config/aom_config.h"
17 #include "config/aom_dsp_rtcd.h"
18 
19 #include "aom_mem/aom_mem.h"
20 #include "aom_ports/aom_timer.h"
21 #include "av1/common/blockd.h"
22 #include "av1/common/pred_common.h"
23 #include "av1/common/reconintra.h"
24 #include "test/acm_random.h"
25 #include "test/register_state_check.h"
26 #include "test/util.h"
27 
28 namespace {
29 
30 const int kZ1Start = 0;
31 const int kZ2Start = 90;
32 const int kZ3Start = 180;
33 
34 const TX_SIZE kTxSize[] = { TX_4X4,   TX_8X8,   TX_16X16, TX_32X32, TX_64X64,
35                             TX_4X8,   TX_8X4,   TX_8X16,  TX_16X8,  TX_16X32,
36                             TX_32X16, TX_32X64, TX_64X32, TX_4X16,  TX_16X4,
37                             TX_8X32,  TX_32X8,  TX_16X64, TX_64X16 };
38 
39 const char *const kTxSizeStrings[] = {
40   "TX_4X4",   "TX_8X8",   "TX_16X16", "TX_32X32", "TX_64X64",
41   "TX_4X8",   "TX_8X4",   "TX_8X16",  "TX_16X8",  "TX_16X32",
42   "TX_32X16", "TX_32X64", "TX_64X32", "TX_4X16",  "TX_16X4",
43   "TX_8X32",  "TX_32X8",  "TX_16X64", "TX_64X16"
44 };
45 
46 using libaom_test::ACMRandom;
47 
48 typedef void (*DrPred_Hbd)(uint16_t *dst, ptrdiff_t stride, int bw, int bh,
49                            const uint16_t *above, const uint16_t *left,
50                            int upsample_above, int upsample_left, int dx,
51                            int dy, int bd);
52 
53 typedef void (*DrPred)(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
54                        const uint8_t *above, const uint8_t *left,
55                        int upsample_above, int upsample_left, int dx, int dy,
56                        int bd);
57 
58 typedef void (*Z1_Lbd)(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
59                        const uint8_t *above, const uint8_t *left,
60                        int upsample_above, int dx, int dy);
61 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)62 void z1_wrapper(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
63                 const uint8_t *above, const uint8_t *left, int upsample_above,
64                 int upsample_left, int dx, int dy, int bd) {
65   (void)bd;
66   (void)upsample_left;
67   fn(dst, stride, bw, bh, above, left, upsample_above, dx, dy);
68 }
69 
70 typedef void (*Z2_Lbd)(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
71                        const uint8_t *above, const uint8_t *left,
72                        int upsample_above, int upsample_left, int dx, int dy);
73 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)74 void z2_wrapper(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
75                 const uint8_t *above, const uint8_t *left, int upsample_above,
76                 int upsample_left, int dx, int dy, int bd) {
77   (void)bd;
78   (void)upsample_left;
79   fn(dst, stride, bw, bh, above, left, upsample_above, upsample_left, dx, dy);
80 }
81 
82 typedef void (*Z3_Lbd)(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
83                        const uint8_t *above, const uint8_t *left,
84                        int upsample_left, int dx, int dy);
85 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)86 void z3_wrapper(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
87                 const uint8_t *above, const uint8_t *left, int upsample_above,
88                 int upsample_left, int dx, int dy, int bd) {
89   (void)bd;
90   (void)upsample_above;
91   fn(dst, stride, bw, bh, above, left, upsample_left, dx, dy);
92 }
93 
94 typedef void (*Z1_Hbd)(uint16_t *dst, ptrdiff_t stride, int bw, int bh,
95                        const uint16_t *above, const uint16_t *left,
96                        int upsample_above, int dx, int dy, int bd);
97 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)98 void z1_wrapper_hbd(uint16_t *dst, ptrdiff_t stride, int bw, int bh,
99                     const uint16_t *above, const uint16_t *left,
100                     int upsample_above, int upsample_left, int dx, int dy,
101                     int bd) {
102   (void)bd;
103   (void)upsample_left;
104   fn(dst, stride, bw, bh, above, left, upsample_above, dx, dy, bd);
105 }
106 
107 typedef void (*Z2_Hbd)(uint16_t *dst, ptrdiff_t stride, int bw, int bh,
108                        const uint16_t *above, const uint16_t *left,
109                        int upsample_above, int upsample_left, int dx, int dy,
110                        int bd);
111 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)112 void z2_wrapper_hbd(uint16_t *dst, ptrdiff_t stride, int bw, int bh,
113                     const uint16_t *above, const uint16_t *left,
114                     int upsample_above, int upsample_left, int dx, int dy,
115                     int bd) {
116   (void)bd;
117   fn(dst, stride, bw, bh, above, left, upsample_above, upsample_left, dx, dy,
118      bd);
119 }
120 
121 typedef void (*Z3_Hbd)(uint16_t *dst, ptrdiff_t stride, int bw, int bh,
122                        const uint16_t *above, const uint16_t *left,
123                        int upsample_left, int dx, int dy, int bd);
124 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)125 void z3_wrapper_hbd(uint16_t *dst, ptrdiff_t stride, int bw, int bh,
126                     const uint16_t *above, const uint16_t *left,
127                     int upsample_above, int upsample_left, int dx, int dy,
128                     int bd) {
129   (void)bd;
130   (void)upsample_above;
131   fn(dst, stride, bw, bh, above, left, upsample_left, dx, dy, bd);
132 }
133 
134 template <typename FuncType>
135 struct DrPredFunc {
DrPredFunc__anon575b7e210111::DrPredFunc136   DrPredFunc(FuncType pred = nullptr, FuncType tst = nullptr,
137              int bit_depth_value = 0, int start_angle_value = 0)
138       : ref_fn(pred), tst_fn(tst), bit_depth(bit_depth_value),
139         start_angle(start_angle_value) {}
140 
141   FuncType ref_fn;
142   FuncType tst_fn;
143   int bit_depth;
144   int start_angle;
145 };
146 
147 template <typename Pixel, typename FuncType>
148 class DrPredTest : public ::testing::TestWithParam<DrPredFunc<FuncType> > {
149  protected:
150   static const int kMaxNumTests = 10000;
151   static const int kIterations = 10;
152   static const int kDstStride = 64;
153   static const int kDstSize = kDstStride * kDstStride;
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     dst_ref_ = &dst_ref_data_[0];
165     dst_tst_ = &dst_tst_data_[0];
166     dst_stride_ = kDstStride;
167     above_ = &above_data_[kOffset];
168     left_ = &left_data_[kOffset];
169 
170     for (int i = 0; i < kBufSize; ++i) {
171       above_data_[i] = rng_.Rand8();
172       left_data_[i] = rng_.Rand8();
173     }
174 
175     for (int i = 0; i < kDstSize; ++i) {
176       dst_ref_[i] = 0;
177       dst_tst_[i] = 0;
178     }
179   }
180 
~DrPredTest()181   virtual ~DrPredTest() {}
182 
Predict(bool speedtest,int tx)183   void Predict(bool speedtest, int tx) {
184     const int kNumTests = speedtest ? kMaxNumTests : 1;
185     aom_usec_timer timer;
186     int tst_time = 0;
187 
188     bd_ = params_.bit_depth;
189 
190     aom_usec_timer_start(&timer);
191     for (int k = 0; k < kNumTests; ++k) {
192       params_.ref_fn(dst_ref_, dst_stride_, bw_, bh_, above_, left_,
193                      upsample_above_, upsample_left_, dx_, dy_, bd_);
194     }
195     aom_usec_timer_mark(&timer);
196     const int ref_time = static_cast<int>(aom_usec_timer_elapsed(&timer));
197 
198     if (params_.tst_fn) {
199       aom_usec_timer_start(&timer);
200       for (int k = 0; k < kNumTests; ++k) {
201         API_REGISTER_STATE_CHECK(params_.tst_fn(dst_tst_, dst_stride_, bw_, bh_,
202                                                 above_, left_, upsample_above_,
203                                                 upsample_left_, dx_, dy_, bd_));
204       }
205       aom_usec_timer_mark(&timer);
206       tst_time = static_cast<int>(aom_usec_timer_elapsed(&timer));
207     } else {
208       for (int i = 0; i < kDstSize; ++i) {
209         dst_ref_[i] = dst_tst_[i];
210       }
211     }
212 
213     OutputTimes(kNumTests, ref_time, tst_time, tx);
214   }
215 
RunTest(bool speedtest,bool needsaturation,int p_angle)216   void RunTest(bool speedtest, bool needsaturation, int p_angle) {
217     bd_ = params_.bit_depth;
218 
219     if (needsaturation) {
220       for (int i = 0; i < kBufSize; ++i) {
221         above_data_[i] = left_data_[i] = (1 << bd_) - 1;
222       }
223     }
224     for (int tx = 0; tx < TX_SIZES_ALL; ++tx) {
225       if (params_.tst_fn == nullptr) {
226         for (int i = 0; i < kDstSize; ++i) {
227           dst_tst_[i] = (1 << bd_) - 1;
228           dst_ref_[i] = (1 << bd_) - 1;
229         }
230       } else {
231         for (int i = 0; i < kDstSize; ++i) {
232           dst_ref_[i] = 0;
233           dst_tst_[i] = 0;
234         }
235       }
236 
237       bw_ = tx_size_wide[kTxSize[tx]];
238       bh_ = tx_size_high[kTxSize[tx]];
239 
240       if (enable_upsample_) {
241         upsample_above_ =
242             av1_use_intra_edge_upsample(bw_, bh_, p_angle - 90, 0);
243         upsample_left_ =
244             av1_use_intra_edge_upsample(bw_, bh_, p_angle - 180, 0);
245       } else {
246         upsample_above_ = upsample_left_ = 0;
247       }
248 
249       Predict(speedtest, tx);
250 
251       for (int r = 0; r < bh_; ++r) {
252         for (int c = 0; c < bw_; ++c) {
253           ASSERT_EQ(dst_ref_[r * dst_stride_ + c],
254                     dst_tst_[r * dst_stride_ + c])
255               << bw_ << "x" << bh_ << " r: " << r << " c: " << c
256               << " dx: " << dx_ << " dy: " << dy_
257               << " upsample_above: " << upsample_above_
258               << " upsample_left: " << upsample_left_;
259         }
260       }
261     }
262   }
263 
OutputTimes(int num_tests,int ref_time,int tst_time,int tx)264   void OutputTimes(int num_tests, int ref_time, int tst_time, int tx) {
265     if (num_tests > 1) {
266       if (params_.tst_fn) {
267         const float x = static_cast<float>(ref_time) / tst_time;
268         printf("\t[%8s] :: ref time %6d, tst time %6d     %3.2f\n",
269                kTxSizeStrings[tx], ref_time, tst_time, x);
270       } else {
271         printf("\t[%8s] :: ref time %6d\n", kTxSizeStrings[tx], ref_time);
272       }
273     }
274   }
275 
RundrPredTest(const int speed)276   void RundrPredTest(const int speed) {
277     if (params_.tst_fn == nullptr) return;
278     const int angles[] = { 3, 45, 87 };
279     const int start_angle = speed ? 0 : start_angle_;
280     const int stop_angle = speed ? 3 : stop_angle_;
281     for (enable_upsample_ = 0; enable_upsample_ < 2; ++enable_upsample_) {
282       for (int i = start_angle; i < stop_angle; ++i) {
283         const int angle = speed ? angles[i] + start_angle_ : i;
284         dx_ = av1_get_dx(angle);
285         dy_ = av1_get_dy(angle);
286         if (speed) {
287           printf("enable_upsample: %d angle: %d ~~~~~~~~~~~~~~~\n",
288                  enable_upsample_, angle);
289         }
290         if (dx_ && dy_) RunTest(speed, false, angle);
291       }
292     }
293   }
294 
295   Pixel dst_ref_data_[kDstSize];
296   Pixel dst_tst_data_[kDstSize];
297 
298   Pixel left_data_[kBufSize];
299   Pixel dummy_data_[kBufSize];
300   Pixel above_data_[kBufSize];
301 
302   Pixel *dst_ref_;
303   Pixel *dst_tst_;
304   Pixel *above_;
305   Pixel *left_;
306   int dst_stride_;
307 
308   int enable_upsample_;
309   int upsample_above_;
310   int upsample_left_;
311   int bw_;
312   int bh_;
313   int dx_;
314   int dy_;
315   int bd_;
316   TX_SIZE txsize_;
317 
318   int start_angle_;
319   int stop_angle_;
320 
321   ACMRandom rng_;
322 
323   DrPredFunc<FuncType> params_;
324 };
325 
326 class LowbdDrPredTest : public DrPredTest<uint8_t, DrPred> {};
327 
TEST_P(LowbdDrPredTest,SaturatedValues)328 TEST_P(LowbdDrPredTest, SaturatedValues) {
329   for (enable_upsample_ = 0; enable_upsample_ < 2; ++enable_upsample_) {
330     for (int angle = start_angle_; angle < stop_angle_; ++angle) {
331       dx_ = av1_get_dx(angle);
332       dy_ = av1_get_dy(angle);
333       if (dx_ && dy_) RunTest(false, true, angle);
334     }
335   }
336 }
337 
338 using std::make_tuple;
339 
340 INSTANTIATE_TEST_SUITE_P(
341     C, LowbdDrPredTest,
342     ::testing::Values(DrPredFunc<DrPred>(&z1_wrapper<av1_dr_prediction_z1_c>,
343                                          nullptr, AOM_BITS_8, kZ1Start),
344                       DrPredFunc<DrPred>(&z2_wrapper<av1_dr_prediction_z2_c>,
345                                          nullptr, AOM_BITS_8, kZ2Start),
346                       DrPredFunc<DrPred>(&z3_wrapper<av1_dr_prediction_z3_c>,
347                                          nullptr, AOM_BITS_8, kZ3Start)));
348 
349 #if CONFIG_AV1_HIGHBITDEPTH
350 class HighbdDrPredTest : public DrPredTest<uint16_t, DrPred_Hbd> {};
351 
TEST_P(HighbdDrPredTest,SaturatedValues)352 TEST_P(HighbdDrPredTest, SaturatedValues) {
353   for (enable_upsample_ = 0; enable_upsample_ < 2; ++enable_upsample_) {
354     for (int angle = start_angle_; angle < stop_angle_; ++angle) {
355       dx_ = av1_get_dx(angle);
356       dy_ = av1_get_dy(angle);
357       if (dx_ && dy_) RunTest(false, true, angle);
358     }
359   }
360 }
361 
362 INSTANTIATE_TEST_SUITE_P(
363     C, HighbdDrPredTest,
364     ::testing::Values(
365         DrPredFunc<DrPred_Hbd>(&z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
366                                nullptr, AOM_BITS_8, kZ1Start),
367         DrPredFunc<DrPred_Hbd>(&z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
368                                nullptr, AOM_BITS_10, kZ1Start),
369         DrPredFunc<DrPred_Hbd>(&z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
370                                nullptr, AOM_BITS_12, kZ1Start),
371         DrPredFunc<DrPred_Hbd>(&z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
372                                nullptr, AOM_BITS_8, kZ2Start),
373         DrPredFunc<DrPred_Hbd>(&z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
374                                nullptr, AOM_BITS_10, kZ2Start),
375         DrPredFunc<DrPred_Hbd>(&z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
376                                nullptr, AOM_BITS_12, kZ2Start),
377         DrPredFunc<DrPred_Hbd>(&z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
378                                nullptr, AOM_BITS_8, kZ3Start),
379         DrPredFunc<DrPred_Hbd>(&z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
380                                nullptr, AOM_BITS_10, kZ3Start),
381         DrPredFunc<DrPred_Hbd>(&z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
382                                nullptr, AOM_BITS_12, kZ3Start)));
383 #endif  // CONFIG_AV1_HIGHBITDEPTH
384 
TEST_P(LowbdDrPredTest,OperationCheck)385 TEST_P(LowbdDrPredTest, OperationCheck) { RundrPredTest(0); }
386 
TEST_P(LowbdDrPredTest,DISABLED_Speed)387 TEST_P(LowbdDrPredTest, DISABLED_Speed) { RundrPredTest(1); }
388 
389 #if HAVE_SSE4_1
390 INSTANTIATE_TEST_SUITE_P(
391     SSE4_1, LowbdDrPredTest,
392     ::testing::Values(
393         DrPredFunc<DrPred>(&z1_wrapper<av1_dr_prediction_z1_c>,
394                            &z1_wrapper<av1_dr_prediction_z1_sse4_1>, AOM_BITS_8,
395                            kZ1Start),
396         DrPredFunc<DrPred>(&z2_wrapper<av1_dr_prediction_z2_c>,
397                            &z2_wrapper<av1_dr_prediction_z2_sse4_1>, AOM_BITS_8,
398                            kZ2Start),
399         DrPredFunc<DrPred>(&z3_wrapper<av1_dr_prediction_z3_c>,
400                            &z3_wrapper<av1_dr_prediction_z3_sse4_1>, AOM_BITS_8,
401                            kZ3Start)));
402 #endif  // HAVE_SSE4_1
403 
404 #if HAVE_AVX2
405 INSTANTIATE_TEST_SUITE_P(
406     AVX2, LowbdDrPredTest,
407     ::testing::Values(DrPredFunc<DrPred>(&z1_wrapper<av1_dr_prediction_z1_c>,
408                                          &z1_wrapper<av1_dr_prediction_z1_avx2>,
409                                          AOM_BITS_8, kZ1Start),
410                       DrPredFunc<DrPred>(&z2_wrapper<av1_dr_prediction_z2_c>,
411                                          &z2_wrapper<av1_dr_prediction_z2_avx2>,
412                                          AOM_BITS_8, kZ2Start),
413                       DrPredFunc<DrPred>(&z3_wrapper<av1_dr_prediction_z3_c>,
414                                          &z3_wrapper<av1_dr_prediction_z3_avx2>,
415                                          AOM_BITS_8, kZ3Start)));
416 
417 #if CONFIG_AV1_HIGHBITDEPTH
418 INSTANTIATE_TEST_SUITE_P(
419     AVX2, HighbdDrPredTest,
420     ::testing::Values(DrPredFunc<DrPred_Hbd>(
421                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
422                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_avx2>,
423                           AOM_BITS_8, kZ1Start),
424                       DrPredFunc<DrPred_Hbd>(
425                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
426                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_avx2>,
427                           AOM_BITS_10, kZ1Start),
428                       DrPredFunc<DrPred_Hbd>(
429                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_c>,
430                           &z1_wrapper_hbd<av1_highbd_dr_prediction_z1_avx2>,
431                           AOM_BITS_12, kZ1Start),
432                       DrPredFunc<DrPred_Hbd>(
433                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
434                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_avx2>,
435                           AOM_BITS_8, kZ2Start),
436                       DrPredFunc<DrPred_Hbd>(
437                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
438                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_avx2>,
439                           AOM_BITS_10, kZ2Start),
440                       DrPredFunc<DrPred_Hbd>(
441                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_c>,
442                           &z2_wrapper_hbd<av1_highbd_dr_prediction_z2_avx2>,
443                           AOM_BITS_12, kZ2Start),
444                       DrPredFunc<DrPred_Hbd>(
445                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
446                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_avx2>,
447                           AOM_BITS_8, kZ3Start),
448                       DrPredFunc<DrPred_Hbd>(
449                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
450                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_avx2>,
451                           AOM_BITS_10, kZ3Start),
452                       DrPredFunc<DrPred_Hbd>(
453                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_c>,
454                           &z3_wrapper_hbd<av1_highbd_dr_prediction_z3_avx2>,
455                           AOM_BITS_12, kZ3Start)));
456 
TEST_P(HighbdDrPredTest,DISABLED_Speed)457 TEST_P(HighbdDrPredTest, DISABLED_Speed) {
458   const int angles[] = { 3, 45, 87 };
459   for (enable_upsample_ = 0; enable_upsample_ < 2; ++enable_upsample_) {
460     for (int i = 0; i < 3; ++i) {
461       int angle = angles[i] + start_angle_;
462       dx_ = av1_get_dx(angle);
463       dy_ = av1_get_dy(angle);
464       printf("enable_upsample: %d angle: %d ~~~~~~~~~~~~~~~\n",
465              enable_upsample_, angle);
466       if (dx_ && dy_) RunTest(true, false, angle);
467     }
468   }
469 }
470 
TEST_P(HighbdDrPredTest,OperationCheck)471 TEST_P(HighbdDrPredTest, OperationCheck) {
472   if (params_.tst_fn == nullptr) return;
473   // const int angles[] = { 3, 45, 81, 87, 93, 100, 145, 187, 199, 260 };
474   for (enable_upsample_ = 0; enable_upsample_ < 2; ++enable_upsample_) {
475     for (int angle = start_angle_; angle < stop_angle_; angle++) {
476       dx_ = av1_get_dx(angle);
477       dy_ = av1_get_dy(angle);
478       if (dx_ && dy_) RunTest(false, false, angle);
479     }
480   }
481 }
482 #endif  // CONFIG_AV1_HIGHBITDEPTH
483 #endif  // HAVE_AVX2
484 
485 #if HAVE_NEON
486 INSTANTIATE_TEST_SUITE_P(
487     NEON, LowbdDrPredTest,
488     ::testing::Values(DrPredFunc<DrPred>(&z1_wrapper<av1_dr_prediction_z1_c>,
489                                          &z1_wrapper<av1_dr_prediction_z1_neon>,
490                                          AOM_BITS_8, kZ1Start),
491                       DrPredFunc<DrPred>(&z2_wrapper<av1_dr_prediction_z2_c>,
492                                          &z2_wrapper<av1_dr_prediction_z2_neon>,
493                                          AOM_BITS_8, kZ2Start),
494                       DrPredFunc<DrPred>(&z3_wrapper<av1_dr_prediction_z3_c>,
495                                          &z3_wrapper<av1_dr_prediction_z3_neon>,
496                                          AOM_BITS_8, kZ3Start)));
497 
498 #endif  // HAVE_NEON
499 
500 }  // namespace
501