xref: /aosp_15_r20/external/libaom/test/intrapred_test.cc (revision 77c1e3ccc04c968bd2bc212e87364f250e820521)
1*77c1e3ccSAndroid Build Coastguard Worker /*
2*77c1e3ccSAndroid Build Coastguard Worker  * Copyright (c) 2016, Alliance for Open Media. All rights reserved.
3*77c1e3ccSAndroid Build Coastguard Worker  *
4*77c1e3ccSAndroid Build Coastguard Worker  * This source code is subject to the terms of the BSD 2 Clause License and
5*77c1e3ccSAndroid Build Coastguard Worker  * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6*77c1e3ccSAndroid Build Coastguard Worker  * was not distributed with this source code in the LICENSE file, you can
7*77c1e3ccSAndroid Build Coastguard Worker  * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8*77c1e3ccSAndroid Build Coastguard Worker  * Media Patent License 1.0 was not distributed with this source code in the
9*77c1e3ccSAndroid Build Coastguard Worker  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10*77c1e3ccSAndroid Build Coastguard Worker  */
11*77c1e3ccSAndroid Build Coastguard Worker 
12*77c1e3ccSAndroid Build Coastguard Worker #include <string>
13*77c1e3ccSAndroid Build Coastguard Worker 
14*77c1e3ccSAndroid Build Coastguard Worker #include "gtest/gtest.h"
15*77c1e3ccSAndroid Build Coastguard Worker 
16*77c1e3ccSAndroid Build Coastguard Worker #include "config/aom_config.h"
17*77c1e3ccSAndroid Build Coastguard Worker #include "config/aom_dsp_rtcd.h"
18*77c1e3ccSAndroid Build Coastguard Worker 
19*77c1e3ccSAndroid Build Coastguard Worker #include "test/acm_random.h"
20*77c1e3ccSAndroid Build Coastguard Worker #include "test/register_state_check.h"
21*77c1e3ccSAndroid Build Coastguard Worker #include "test/util.h"
22*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/blockd.h"
23*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/common.h"
24*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/pred_common.h"
25*77c1e3ccSAndroid Build Coastguard Worker #include "aom_mem/aom_mem.h"
26*77c1e3ccSAndroid Build Coastguard Worker 
27*77c1e3ccSAndroid Build Coastguard Worker namespace {
28*77c1e3ccSAndroid Build Coastguard Worker 
29*77c1e3ccSAndroid Build Coastguard Worker using libaom_test::ACMRandom;
30*77c1e3ccSAndroid Build Coastguard Worker 
31*77c1e3ccSAndroid Build Coastguard Worker const int count_test_block = 100000;
32*77c1e3ccSAndroid Build Coastguard Worker 
33*77c1e3ccSAndroid Build Coastguard Worker typedef void (*HighbdIntraPred)(uint16_t *dst, ptrdiff_t stride,
34*77c1e3ccSAndroid Build Coastguard Worker                                 const uint16_t *above, const uint16_t *left,
35*77c1e3ccSAndroid Build Coastguard Worker                                 int bps);
36*77c1e3ccSAndroid Build Coastguard Worker typedef void (*IntraPred)(uint8_t *dst, ptrdiff_t stride, const uint8_t *above,
37*77c1e3ccSAndroid Build Coastguard Worker                           const uint8_t *left);
38*77c1e3ccSAndroid Build Coastguard Worker 
39*77c1e3ccSAndroid Build Coastguard Worker }  // namespace
40*77c1e3ccSAndroid Build Coastguard Worker 
41*77c1e3ccSAndroid Build Coastguard Worker // NOTE: Under gcc version 7.3.0 (Debian 7.3.0-5), if this template is in the
42*77c1e3ccSAndroid Build Coastguard Worker // anonymous namespace, then we get a strange compiler warning in
43*77c1e3ccSAndroid Build Coastguard Worker // the begin() and end() methods of the ParamGenerator template class in
44*77c1e3ccSAndroid Build Coastguard Worker // gtest/internal/gtest-param-util.h:
45*77c1e3ccSAndroid Build Coastguard Worker //   warning: ‘<anonymous>’ is used uninitialized in this function
46*77c1e3ccSAndroid Build Coastguard Worker // As a workaround, put this template outside the anonymous namespace.
47*77c1e3ccSAndroid Build Coastguard Worker // See bug aomedia:2003.
48*77c1e3ccSAndroid Build Coastguard Worker template <typename FuncType>
49*77c1e3ccSAndroid Build Coastguard Worker struct IntraPredFunc {
IntraPredFuncIntraPredFunc50*77c1e3ccSAndroid Build Coastguard Worker   IntraPredFunc(FuncType pred = nullptr, FuncType ref = nullptr,
51*77c1e3ccSAndroid Build Coastguard Worker                 int block_width_value = 0, int block_height_value = 0,
52*77c1e3ccSAndroid Build Coastguard Worker                 int bit_depth_value = 0)
53*77c1e3ccSAndroid Build Coastguard Worker       : pred_fn(pred), ref_fn(ref), block_width(block_width_value),
54*77c1e3ccSAndroid Build Coastguard Worker         block_height(block_height_value), bit_depth(bit_depth_value) {}
55*77c1e3ccSAndroid Build Coastguard Worker 
56*77c1e3ccSAndroid Build Coastguard Worker   FuncType pred_fn;
57*77c1e3ccSAndroid Build Coastguard Worker   FuncType ref_fn;
58*77c1e3ccSAndroid Build Coastguard Worker   int block_width;
59*77c1e3ccSAndroid Build Coastguard Worker   int block_height;
60*77c1e3ccSAndroid Build Coastguard Worker   int bit_depth;
61*77c1e3ccSAndroid Build Coastguard Worker };
62*77c1e3ccSAndroid Build Coastguard Worker 
63*77c1e3ccSAndroid Build Coastguard Worker namespace {
64*77c1e3ccSAndroid Build Coastguard Worker 
65*77c1e3ccSAndroid Build Coastguard Worker template <typename FuncType, typename Pixel>
66*77c1e3ccSAndroid Build Coastguard Worker class AV1IntraPredTest
67*77c1e3ccSAndroid Build Coastguard Worker     : public ::testing::TestWithParam<IntraPredFunc<FuncType> > {
68*77c1e3ccSAndroid Build Coastguard Worker  public:
RunTest(Pixel * left_col,Pixel * above_data,Pixel * dst,Pixel * ref_dst)69*77c1e3ccSAndroid Build Coastguard Worker   void RunTest(Pixel *left_col, Pixel *above_data, Pixel *dst, Pixel *ref_dst) {
70*77c1e3ccSAndroid Build Coastguard Worker     ACMRandom rnd(ACMRandom::DeterministicSeed());
71*77c1e3ccSAndroid Build Coastguard Worker     const int block_width = params_.block_width;
72*77c1e3ccSAndroid Build Coastguard Worker     const int block_height = params_.block_height;
73*77c1e3ccSAndroid Build Coastguard Worker     above_row_ = above_data + 16;
74*77c1e3ccSAndroid Build Coastguard Worker     left_col_ = left_col;
75*77c1e3ccSAndroid Build Coastguard Worker     dst_ = dst;
76*77c1e3ccSAndroid Build Coastguard Worker     ref_dst_ = ref_dst;
77*77c1e3ccSAndroid Build Coastguard Worker     int error_count = 0;
78*77c1e3ccSAndroid Build Coastguard Worker     for (int i = 0; i < count_test_block; ++i) {
79*77c1e3ccSAndroid Build Coastguard Worker       // Fill edges with random data, try first with saturated values.
80*77c1e3ccSAndroid Build Coastguard Worker       for (int x = -1; x <= block_width * 2; x++) {
81*77c1e3ccSAndroid Build Coastguard Worker         if (i == 0) {
82*77c1e3ccSAndroid Build Coastguard Worker           above_row_[x] = mask_;
83*77c1e3ccSAndroid Build Coastguard Worker         } else {
84*77c1e3ccSAndroid Build Coastguard Worker           above_row_[x] = rnd.Rand16() & mask_;
85*77c1e3ccSAndroid Build Coastguard Worker         }
86*77c1e3ccSAndroid Build Coastguard Worker       }
87*77c1e3ccSAndroid Build Coastguard Worker       for (int y = 0; y < block_height; y++) {
88*77c1e3ccSAndroid Build Coastguard Worker         if (i == 0) {
89*77c1e3ccSAndroid Build Coastguard Worker           left_col_[y] = mask_;
90*77c1e3ccSAndroid Build Coastguard Worker         } else {
91*77c1e3ccSAndroid Build Coastguard Worker           left_col_[y] = rnd.Rand16() & mask_;
92*77c1e3ccSAndroid Build Coastguard Worker         }
93*77c1e3ccSAndroid Build Coastguard Worker       }
94*77c1e3ccSAndroid Build Coastguard Worker       Predict();
95*77c1e3ccSAndroid Build Coastguard Worker       CheckPrediction(i, &error_count);
96*77c1e3ccSAndroid Build Coastguard Worker     }
97*77c1e3ccSAndroid Build Coastguard Worker     ASSERT_EQ(0, error_count);
98*77c1e3ccSAndroid Build Coastguard Worker   }
RunSpeedTest(Pixel * left_col,Pixel * above_data,Pixel * dst,Pixel * ref_dst)99*77c1e3ccSAndroid Build Coastguard Worker   void RunSpeedTest(Pixel *left_col, Pixel *above_data, Pixel *dst,
100*77c1e3ccSAndroid Build Coastguard Worker                     Pixel *ref_dst) {
101*77c1e3ccSAndroid Build Coastguard Worker     ACMRandom rnd(ACMRandom::DeterministicSeed());
102*77c1e3ccSAndroid Build Coastguard Worker     const int block_width = params_.block_width;
103*77c1e3ccSAndroid Build Coastguard Worker     const int block_height = params_.block_height;
104*77c1e3ccSAndroid Build Coastguard Worker     above_row_ = above_data + 16;
105*77c1e3ccSAndroid Build Coastguard Worker     left_col_ = left_col;
106*77c1e3ccSAndroid Build Coastguard Worker     dst_ = dst;
107*77c1e3ccSAndroid Build Coastguard Worker     ref_dst_ = ref_dst;
108*77c1e3ccSAndroid Build Coastguard Worker     int error_count = 0;
109*77c1e3ccSAndroid Build Coastguard Worker     const int numIter = 100;
110*77c1e3ccSAndroid Build Coastguard Worker 
111*77c1e3ccSAndroid Build Coastguard Worker     int c_sum_time = 0;
112*77c1e3ccSAndroid Build Coastguard Worker     int simd_sum_time = 0;
113*77c1e3ccSAndroid Build Coastguard Worker     for (int i = 0; i < count_test_block; ++i) {
114*77c1e3ccSAndroid Build Coastguard Worker       // Fill edges with random data, try first with saturated values.
115*77c1e3ccSAndroid Build Coastguard Worker       for (int x = -1; x <= block_width * 2; x++) {
116*77c1e3ccSAndroid Build Coastguard Worker         if (i == 0) {
117*77c1e3ccSAndroid Build Coastguard Worker           above_row_[x] = mask_;
118*77c1e3ccSAndroid Build Coastguard Worker         } else {
119*77c1e3ccSAndroid Build Coastguard Worker           above_row_[x] = rnd.Rand16() & mask_;
120*77c1e3ccSAndroid Build Coastguard Worker         }
121*77c1e3ccSAndroid Build Coastguard Worker       }
122*77c1e3ccSAndroid Build Coastguard Worker       for (int y = 0; y < block_height; y++) {
123*77c1e3ccSAndroid Build Coastguard Worker         if (i == 0) {
124*77c1e3ccSAndroid Build Coastguard Worker           left_col_[y] = mask_;
125*77c1e3ccSAndroid Build Coastguard Worker         } else {
126*77c1e3ccSAndroid Build Coastguard Worker           left_col_[y] = rnd.Rand16() & mask_;
127*77c1e3ccSAndroid Build Coastguard Worker         }
128*77c1e3ccSAndroid Build Coastguard Worker       }
129*77c1e3ccSAndroid Build Coastguard Worker 
130*77c1e3ccSAndroid Build Coastguard Worker       aom_usec_timer c_timer_;
131*77c1e3ccSAndroid Build Coastguard Worker       aom_usec_timer_start(&c_timer_);
132*77c1e3ccSAndroid Build Coastguard Worker 
133*77c1e3ccSAndroid Build Coastguard Worker       PredictRefSpeedTest(numIter);
134*77c1e3ccSAndroid Build Coastguard Worker 
135*77c1e3ccSAndroid Build Coastguard Worker       aom_usec_timer_mark(&c_timer_);
136*77c1e3ccSAndroid Build Coastguard Worker 
137*77c1e3ccSAndroid Build Coastguard Worker       aom_usec_timer simd_timer_;
138*77c1e3ccSAndroid Build Coastguard Worker       aom_usec_timer_start(&simd_timer_);
139*77c1e3ccSAndroid Build Coastguard Worker 
140*77c1e3ccSAndroid Build Coastguard Worker       PredictFncSpeedTest(numIter);
141*77c1e3ccSAndroid Build Coastguard Worker 
142*77c1e3ccSAndroid Build Coastguard Worker       aom_usec_timer_mark(&simd_timer_);
143*77c1e3ccSAndroid Build Coastguard Worker 
144*77c1e3ccSAndroid Build Coastguard Worker       c_sum_time += static_cast<int>(aom_usec_timer_elapsed(&c_timer_));
145*77c1e3ccSAndroid Build Coastguard Worker       simd_sum_time += static_cast<int>(aom_usec_timer_elapsed(&simd_timer_));
146*77c1e3ccSAndroid Build Coastguard Worker 
147*77c1e3ccSAndroid Build Coastguard Worker       CheckPrediction(i, &error_count);
148*77c1e3ccSAndroid Build Coastguard Worker     }
149*77c1e3ccSAndroid Build Coastguard Worker 
150*77c1e3ccSAndroid Build Coastguard Worker     printf(
151*77c1e3ccSAndroid Build Coastguard Worker         "blockWxH = %d x %d c_time = %d \t simd_time = %d \t Gain = %4.2f \n",
152*77c1e3ccSAndroid Build Coastguard Worker         block_width, block_height, c_sum_time, simd_sum_time,
153*77c1e3ccSAndroid Build Coastguard Worker         (static_cast<float>(c_sum_time) / static_cast<float>(simd_sum_time)));
154*77c1e3ccSAndroid Build Coastguard Worker     ASSERT_EQ(0, error_count);
155*77c1e3ccSAndroid Build Coastguard Worker   }
156*77c1e3ccSAndroid Build Coastguard Worker 
157*77c1e3ccSAndroid Build Coastguard Worker  protected:
SetUp()158*77c1e3ccSAndroid Build Coastguard Worker   void SetUp() override {
159*77c1e3ccSAndroid Build Coastguard Worker     params_ = this->GetParam();
160*77c1e3ccSAndroid Build Coastguard Worker     stride_ = params_.block_width * 3;
161*77c1e3ccSAndroid Build Coastguard Worker     mask_ = (1 << params_.bit_depth) - 1;
162*77c1e3ccSAndroid Build Coastguard Worker   }
163*77c1e3ccSAndroid Build Coastguard Worker 
164*77c1e3ccSAndroid Build Coastguard Worker   virtual void Predict() = 0;
165*77c1e3ccSAndroid Build Coastguard Worker 
166*77c1e3ccSAndroid Build Coastguard Worker   virtual void PredictRefSpeedTest(int num) = 0;
167*77c1e3ccSAndroid Build Coastguard Worker   virtual void PredictFncSpeedTest(int num) = 0;
168*77c1e3ccSAndroid Build Coastguard Worker 
CheckPrediction(int test_case_number,int * error_count) const169*77c1e3ccSAndroid Build Coastguard Worker   void CheckPrediction(int test_case_number, int *error_count) const {
170*77c1e3ccSAndroid Build Coastguard Worker     // For each pixel ensure that the calculated value is the same as reference.
171*77c1e3ccSAndroid Build Coastguard Worker     const int block_width = params_.block_width;
172*77c1e3ccSAndroid Build Coastguard Worker     const int block_height = params_.block_height;
173*77c1e3ccSAndroid Build Coastguard Worker     for (int y = 0; y < block_height; y++) {
174*77c1e3ccSAndroid Build Coastguard Worker       for (int x = 0; x < block_width; x++) {
175*77c1e3ccSAndroid Build Coastguard Worker         *error_count += ref_dst_[x + y * stride_] != dst_[x + y * stride_];
176*77c1e3ccSAndroid Build Coastguard Worker         if (*error_count == 1) {
177*77c1e3ccSAndroid Build Coastguard Worker           ASSERT_EQ(ref_dst_[x + y * stride_], dst_[x + y * stride_])
178*77c1e3ccSAndroid Build Coastguard Worker               << " Failed on Test Case Number " << test_case_number
179*77c1e3ccSAndroid Build Coastguard Worker               << " location: x = " << x << " y = " << y;
180*77c1e3ccSAndroid Build Coastguard Worker         }
181*77c1e3ccSAndroid Build Coastguard Worker       }
182*77c1e3ccSAndroid Build Coastguard Worker     }
183*77c1e3ccSAndroid Build Coastguard Worker   }
184*77c1e3ccSAndroid Build Coastguard Worker 
185*77c1e3ccSAndroid Build Coastguard Worker   Pixel *above_row_;
186*77c1e3ccSAndroid Build Coastguard Worker   Pixel *left_col_;
187*77c1e3ccSAndroid Build Coastguard Worker   Pixel *dst_;
188*77c1e3ccSAndroid Build Coastguard Worker   Pixel *ref_dst_;
189*77c1e3ccSAndroid Build Coastguard Worker   ptrdiff_t stride_;
190*77c1e3ccSAndroid Build Coastguard Worker   int mask_;
191*77c1e3ccSAndroid Build Coastguard Worker 
192*77c1e3ccSAndroid Build Coastguard Worker   IntraPredFunc<FuncType> params_;
193*77c1e3ccSAndroid Build Coastguard Worker };
194*77c1e3ccSAndroid Build Coastguard Worker 
195*77c1e3ccSAndroid Build Coastguard Worker #if CONFIG_AV1_HIGHBITDEPTH
196*77c1e3ccSAndroid Build Coastguard Worker class HighbdIntraPredTest : public AV1IntraPredTest<HighbdIntraPred, uint16_t> {
197*77c1e3ccSAndroid Build Coastguard Worker  protected:
Predict()198*77c1e3ccSAndroid Build Coastguard Worker   void Predict() override {
199*77c1e3ccSAndroid Build Coastguard Worker     const int bit_depth = params_.bit_depth;
200*77c1e3ccSAndroid Build Coastguard Worker     params_.ref_fn(ref_dst_, stride_, above_row_, left_col_, bit_depth);
201*77c1e3ccSAndroid Build Coastguard Worker     API_REGISTER_STATE_CHECK(
202*77c1e3ccSAndroid Build Coastguard Worker         params_.pred_fn(dst_, stride_, above_row_, left_col_, bit_depth));
203*77c1e3ccSAndroid Build Coastguard Worker   }
PredictRefSpeedTest(int num)204*77c1e3ccSAndroid Build Coastguard Worker   void PredictRefSpeedTest(int num) override {
205*77c1e3ccSAndroid Build Coastguard Worker     const int bit_depth = params_.bit_depth;
206*77c1e3ccSAndroid Build Coastguard Worker     for (int i = 0; i < num; i++) {
207*77c1e3ccSAndroid Build Coastguard Worker       params_.ref_fn(ref_dst_, stride_, above_row_, left_col_, bit_depth);
208*77c1e3ccSAndroid Build Coastguard Worker     }
209*77c1e3ccSAndroid Build Coastguard Worker   }
PredictFncSpeedTest(int num)210*77c1e3ccSAndroid Build Coastguard Worker   void PredictFncSpeedTest(int num) override {
211*77c1e3ccSAndroid Build Coastguard Worker     const int bit_depth = params_.bit_depth;
212*77c1e3ccSAndroid Build Coastguard Worker     for (int i = 0; i < num; i++) {
213*77c1e3ccSAndroid Build Coastguard Worker       params_.pred_fn(dst_, stride_, above_row_, left_col_, bit_depth);
214*77c1e3ccSAndroid Build Coastguard Worker     }
215*77c1e3ccSAndroid Build Coastguard Worker   }
216*77c1e3ccSAndroid Build Coastguard Worker };
217*77c1e3ccSAndroid Build Coastguard Worker GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(HighbdIntraPredTest);
218*77c1e3ccSAndroid Build Coastguard Worker 
219*77c1e3ccSAndroid Build Coastguard Worker #endif
220*77c1e3ccSAndroid Build Coastguard Worker 
221*77c1e3ccSAndroid Build Coastguard Worker class LowbdIntraPredTest : public AV1IntraPredTest<IntraPred, uint8_t> {
222*77c1e3ccSAndroid Build Coastguard Worker  protected:
Predict()223*77c1e3ccSAndroid Build Coastguard Worker   void Predict() override {
224*77c1e3ccSAndroid Build Coastguard Worker     params_.ref_fn(ref_dst_, stride_, above_row_, left_col_);
225*77c1e3ccSAndroid Build Coastguard Worker     API_REGISTER_STATE_CHECK(
226*77c1e3ccSAndroid Build Coastguard Worker         params_.pred_fn(dst_, stride_, above_row_, left_col_));
227*77c1e3ccSAndroid Build Coastguard Worker   }
PredictRefSpeedTest(int num)228*77c1e3ccSAndroid Build Coastguard Worker   void PredictRefSpeedTest(int num) override {
229*77c1e3ccSAndroid Build Coastguard Worker     for (int i = 0; i < num; i++) {
230*77c1e3ccSAndroid Build Coastguard Worker       params_.ref_fn(ref_dst_, stride_, above_row_, left_col_);
231*77c1e3ccSAndroid Build Coastguard Worker     }
232*77c1e3ccSAndroid Build Coastguard Worker   }
PredictFncSpeedTest(int num)233*77c1e3ccSAndroid Build Coastguard Worker   void PredictFncSpeedTest(int num) override {
234*77c1e3ccSAndroid Build Coastguard Worker     for (int i = 0; i < num; i++) {
235*77c1e3ccSAndroid Build Coastguard Worker       params_.pred_fn(dst_, stride_, above_row_, left_col_);
236*77c1e3ccSAndroid Build Coastguard Worker     }
237*77c1e3ccSAndroid Build Coastguard Worker   }
238*77c1e3ccSAndroid Build Coastguard Worker };
239*77c1e3ccSAndroid Build Coastguard Worker GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(LowbdIntraPredTest);
240*77c1e3ccSAndroid Build Coastguard Worker 
241*77c1e3ccSAndroid Build Coastguard Worker #if CONFIG_AV1_HIGHBITDEPTH
TEST_P(HighbdIntraPredTest,Bitexact)242*77c1e3ccSAndroid Build Coastguard Worker TEST_P(HighbdIntraPredTest, Bitexact) {
243*77c1e3ccSAndroid Build Coastguard Worker   // max block size is 64
244*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint16_t, left_col[2 * 64]);
245*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint16_t, above_data[2 * 64 + 64]);
246*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint16_t, dst[3 * 64 * 64]);
247*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint16_t, ref_dst[3 * 64 * 64]);
248*77c1e3ccSAndroid Build Coastguard Worker   av1_zero(left_col);
249*77c1e3ccSAndroid Build Coastguard Worker   av1_zero(above_data);
250*77c1e3ccSAndroid Build Coastguard Worker   RunTest(left_col, above_data, dst, ref_dst);
251*77c1e3ccSAndroid Build Coastguard Worker }
252*77c1e3ccSAndroid Build Coastguard Worker 
TEST_P(HighbdIntraPredTest,DISABLED_Speed)253*77c1e3ccSAndroid Build Coastguard Worker TEST_P(HighbdIntraPredTest, DISABLED_Speed) {
254*77c1e3ccSAndroid Build Coastguard Worker   // max block size is 64
255*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint16_t, left_col[2 * 64]);
256*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint16_t, above_data[2 * 64 + 64]);
257*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint16_t, dst[3 * 64 * 64]);
258*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint16_t, ref_dst[3 * 64 * 64]);
259*77c1e3ccSAndroid Build Coastguard Worker   av1_zero(left_col);
260*77c1e3ccSAndroid Build Coastguard Worker   av1_zero(above_data);
261*77c1e3ccSAndroid Build Coastguard Worker   RunSpeedTest(left_col, above_data, dst, ref_dst);
262*77c1e3ccSAndroid Build Coastguard Worker }
263*77c1e3ccSAndroid Build Coastguard Worker #endif
264*77c1e3ccSAndroid Build Coastguard Worker 
TEST_P(LowbdIntraPredTest,Bitexact)265*77c1e3ccSAndroid Build Coastguard Worker TEST_P(LowbdIntraPredTest, Bitexact) {
266*77c1e3ccSAndroid Build Coastguard Worker   // max block size is 64
267*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint8_t, left_col[2 * 64]);
268*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint8_t, above_data[2 * 64 + 64]);
269*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint8_t, dst[3 * 64 * 64]);
270*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint8_t, ref_dst[3 * 64 * 64]);
271*77c1e3ccSAndroid Build Coastguard Worker   av1_zero(left_col);
272*77c1e3ccSAndroid Build Coastguard Worker   av1_zero(above_data);
273*77c1e3ccSAndroid Build Coastguard Worker   RunTest(left_col, above_data, dst, ref_dst);
274*77c1e3ccSAndroid Build Coastguard Worker }
TEST_P(LowbdIntraPredTest,DISABLED_Speed)275*77c1e3ccSAndroid Build Coastguard Worker TEST_P(LowbdIntraPredTest, DISABLED_Speed) {
276*77c1e3ccSAndroid Build Coastguard Worker   // max block size is 64
277*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint8_t, left_col[2 * 64]);
278*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint8_t, above_data[2 * 64 + 64]);
279*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint8_t, dst[3 * 64 * 64]);
280*77c1e3ccSAndroid Build Coastguard Worker   DECLARE_ALIGNED(16, uint8_t, ref_dst[3 * 64 * 64]);
281*77c1e3ccSAndroid Build Coastguard Worker   av1_zero(left_col);
282*77c1e3ccSAndroid Build Coastguard Worker   av1_zero(above_data);
283*77c1e3ccSAndroid Build Coastguard Worker   RunSpeedTest(left_col, above_data, dst, ref_dst);
284*77c1e3ccSAndroid Build Coastguard Worker }
285*77c1e3ccSAndroid Build Coastguard Worker 
286*77c1e3ccSAndroid Build Coastguard Worker #if CONFIG_AV1_HIGHBITDEPTH
287*77c1e3ccSAndroid Build Coastguard Worker // -----------------------------------------------------------------------------
288*77c1e3ccSAndroid Build Coastguard Worker // High Bit Depth Tests
289*77c1e3ccSAndroid Build Coastguard Worker #define highbd_entry(type, width, height, opt, bd)                          \
290*77c1e3ccSAndroid Build Coastguard Worker   IntraPredFunc<HighbdIntraPred>(                                           \
291*77c1e3ccSAndroid Build Coastguard Worker       &aom_highbd_##type##_predictor_##width##x##height##_##opt,            \
292*77c1e3ccSAndroid Build Coastguard Worker       &aom_highbd_##type##_predictor_##width##x##height##_c, width, height, \
293*77c1e3ccSAndroid Build Coastguard Worker       bd)
294*77c1e3ccSAndroid Build Coastguard Worker 
295*77c1e3ccSAndroid Build Coastguard Worker #if !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
296*77c1e3ccSAndroid Build Coastguard Worker #define highbd_intrapred(type, opt, bd)                                        \
297*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(type, 4, 4, opt, bd), highbd_entry(type, 4, 8, opt, bd),        \
298*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 4, 16, opt, bd), highbd_entry(type, 8, 4, opt, bd),   \
299*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 8, 8, opt, bd), highbd_entry(type, 8, 16, opt, bd),   \
300*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 8, 32, opt, bd), highbd_entry(type, 16, 4, opt, bd),  \
301*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 16, 8, opt, bd), highbd_entry(type, 16, 16, opt, bd), \
302*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 16, 32, opt, bd),                                     \
303*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 16, 64, opt, bd), highbd_entry(type, 32, 8, opt, bd), \
304*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 32, 16, opt, bd),                                     \
305*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 32, 32, opt, bd),                                     \
306*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 32, 64, opt, bd),                                     \
307*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 64, 16, opt, bd),                                     \
308*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 64, 32, opt, bd), highbd_entry(type, 64, 64, opt, bd)
309*77c1e3ccSAndroid Build Coastguard Worker #else
310*77c1e3ccSAndroid Build Coastguard Worker #define highbd_intrapred(type, opt, bd)                                       \
311*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(type, 4, 4, opt, bd), highbd_entry(type, 4, 8, opt, bd),       \
312*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 8, 4, opt, bd), highbd_entry(type, 8, 8, opt, bd),   \
313*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 8, 16, opt, bd), highbd_entry(type, 16, 8, opt, bd), \
314*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 16, 16, opt, bd),                                    \
315*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 16, 32, opt, bd),                                    \
316*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 32, 16, opt, bd),                                    \
317*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 32, 32, opt, bd),                                    \
318*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 32, 64, opt, bd),                                    \
319*77c1e3ccSAndroid Build Coastguard Worker       highbd_entry(type, 64, 32, opt, bd), highbd_entry(type, 64, 64, opt, bd)
320*77c1e3ccSAndroid Build Coastguard Worker #endif  // !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
321*77c1e3ccSAndroid Build Coastguard Worker #endif  // CONFIG_AV1_HIGHBITDEPTH
322*77c1e3ccSAndroid Build Coastguard Worker 
323*77c1e3ccSAndroid Build Coastguard Worker // ---------------------------------------------------------------------------
324*77c1e3ccSAndroid Build Coastguard Worker // Low Bit Depth Tests
325*77c1e3ccSAndroid Build Coastguard Worker 
326*77c1e3ccSAndroid Build Coastguard Worker #define lowbd_entry(type, width, height, opt)                                  \
327*77c1e3ccSAndroid Build Coastguard Worker   IntraPredFunc<IntraPred>(&aom_##type##_predictor_##width##x##height##_##opt, \
328*77c1e3ccSAndroid Build Coastguard Worker                            &aom_##type##_predictor_##width##x##height##_c,     \
329*77c1e3ccSAndroid Build Coastguard Worker                            width, height, 8)
330*77c1e3ccSAndroid Build Coastguard Worker 
331*77c1e3ccSAndroid Build Coastguard Worker #if !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
332*77c1e3ccSAndroid Build Coastguard Worker #define lowbd_intrapred(type, opt)                                    \
333*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(type, 4, 4, opt), lowbd_entry(type, 4, 8, opt),         \
334*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 4, 16, opt), lowbd_entry(type, 8, 4, opt),    \
335*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 8, 8, opt), lowbd_entry(type, 8, 16, opt),    \
336*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 8, 32, opt), lowbd_entry(type, 16, 4, opt),   \
337*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 16, 8, opt), lowbd_entry(type, 16, 16, opt),  \
338*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 16, 32, opt), lowbd_entry(type, 16, 64, opt), \
339*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 32, 8, opt), lowbd_entry(type, 32, 16, opt),  \
340*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 32, 32, opt), lowbd_entry(type, 32, 64, opt), \
341*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 64, 16, opt), lowbd_entry(type, 64, 32, opt), \
342*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 64, 64, opt)
343*77c1e3ccSAndroid Build Coastguard Worker #else
344*77c1e3ccSAndroid Build Coastguard Worker #define lowbd_intrapred(type, opt)                                    \
345*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(type, 4, 4, opt), lowbd_entry(type, 4, 8, opt),         \
346*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 8, 4, opt), lowbd_entry(type, 8, 8, opt),     \
347*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 8, 16, opt), lowbd_entry(type, 16, 8, opt),   \
348*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 16, 16, opt), lowbd_entry(type, 16, 32, opt), \
349*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 32, 16, opt), lowbd_entry(type, 32, 32, opt), \
350*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 32, 64, opt), lowbd_entry(type, 64, 32, opt), \
351*77c1e3ccSAndroid Build Coastguard Worker       lowbd_entry(type, 64, 64, opt)
352*77c1e3ccSAndroid Build Coastguard Worker #endif  // !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
353*77c1e3ccSAndroid Build Coastguard Worker 
354*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_SSE2
355*77c1e3ccSAndroid Build Coastguard Worker const IntraPredFunc<IntraPred> LowbdIntraPredTestVector[] = {
356*77c1e3ccSAndroid Build Coastguard Worker   lowbd_intrapred(dc, sse2),      lowbd_intrapred(dc_top, sse2),
357*77c1e3ccSAndroid Build Coastguard Worker   lowbd_intrapred(dc_left, sse2), lowbd_intrapred(dc_128, sse2),
358*77c1e3ccSAndroid Build Coastguard Worker   lowbd_intrapred(v, sse2),       lowbd_intrapred(h, sse2),
359*77c1e3ccSAndroid Build Coastguard Worker };
360*77c1e3ccSAndroid Build Coastguard Worker 
361*77c1e3ccSAndroid Build Coastguard Worker INSTANTIATE_TEST_SUITE_P(SSE2, LowbdIntraPredTest,
362*77c1e3ccSAndroid Build Coastguard Worker                          ::testing::ValuesIn(LowbdIntraPredTestVector));
363*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_SSE2
364*77c1e3ccSAndroid Build Coastguard Worker 
365*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON
366*77c1e3ccSAndroid Build Coastguard Worker const IntraPredFunc<IntraPred> LowbdIntraPredTestVectorNeon[] = {
367*77c1e3ccSAndroid Build Coastguard Worker   lowbd_intrapred(dc, neon),       lowbd_intrapred(dc_top, neon),
368*77c1e3ccSAndroid Build Coastguard Worker   lowbd_intrapred(dc_left, neon),  lowbd_intrapred(dc_128, neon),
369*77c1e3ccSAndroid Build Coastguard Worker   lowbd_intrapred(v, neon),        lowbd_intrapred(h, neon),
370*77c1e3ccSAndroid Build Coastguard Worker   lowbd_intrapred(smooth, neon),   lowbd_intrapred(smooth_v, neon),
371*77c1e3ccSAndroid Build Coastguard Worker   lowbd_intrapred(smooth_h, neon), lowbd_intrapred(paeth, neon),
372*77c1e3ccSAndroid Build Coastguard Worker };
373*77c1e3ccSAndroid Build Coastguard Worker 
374*77c1e3ccSAndroid Build Coastguard Worker INSTANTIATE_TEST_SUITE_P(NEON, LowbdIntraPredTest,
375*77c1e3ccSAndroid Build Coastguard Worker                          ::testing::ValuesIn(LowbdIntraPredTestVectorNeon));
376*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON
377*77c1e3ccSAndroid Build Coastguard Worker 
378*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_SSSE3
379*77c1e3ccSAndroid Build Coastguard Worker const IntraPredFunc<IntraPred> LowbdIntraPredTestVectorSsse3[] = {
380*77c1e3ccSAndroid Build Coastguard Worker   lowbd_intrapred(paeth, ssse3),
381*77c1e3ccSAndroid Build Coastguard Worker   lowbd_intrapred(smooth, ssse3),
382*77c1e3ccSAndroid Build Coastguard Worker   lowbd_intrapred(smooth_v, ssse3),
383*77c1e3ccSAndroid Build Coastguard Worker   lowbd_intrapred(smooth_h, ssse3),
384*77c1e3ccSAndroid Build Coastguard Worker };
385*77c1e3ccSAndroid Build Coastguard Worker 
386*77c1e3ccSAndroid Build Coastguard Worker INSTANTIATE_TEST_SUITE_P(SSSE3, LowbdIntraPredTest,
387*77c1e3ccSAndroid Build Coastguard Worker                          ::testing::ValuesIn(LowbdIntraPredTestVectorSsse3));
388*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_SSSE3
389*77c1e3ccSAndroid Build Coastguard Worker 
390*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_AVX2
391*77c1e3ccSAndroid Build Coastguard Worker const IntraPredFunc<IntraPred> LowbdIntraPredTestVectorAvx2[] = {
392*77c1e3ccSAndroid Build Coastguard Worker #if !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
393*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc, 32, 16, avx2),      lowbd_entry(dc, 32, 32, avx2),
394*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc, 32, 64, avx2),      lowbd_entry(dc, 64, 16, avx2),
395*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc, 64, 32, avx2),      lowbd_entry(dc, 64, 64, avx2),
396*77c1e3ccSAndroid Build Coastguard Worker 
397*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_top, 32, 16, avx2),  lowbd_entry(dc_top, 32, 32, avx2),
398*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_top, 32, 64, avx2),  lowbd_entry(dc_top, 64, 16, avx2),
399*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_top, 64, 32, avx2),  lowbd_entry(dc_top, 64, 64, avx2),
400*77c1e3ccSAndroid Build Coastguard Worker 
401*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_left, 32, 16, avx2), lowbd_entry(dc_left, 32, 32, avx2),
402*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_left, 32, 64, avx2), lowbd_entry(dc_left, 64, 16, avx2),
403*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_left, 64, 32, avx2), lowbd_entry(dc_left, 64, 64, avx2),
404*77c1e3ccSAndroid Build Coastguard Worker 
405*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_128, 32, 16, avx2),  lowbd_entry(dc_128, 32, 32, avx2),
406*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_128, 32, 64, avx2),  lowbd_entry(dc_128, 64, 16, avx2),
407*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_128, 64, 32, avx2),  lowbd_entry(dc_128, 64, 64, avx2),
408*77c1e3ccSAndroid Build Coastguard Worker 
409*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(v, 32, 16, avx2),       lowbd_entry(v, 32, 32, avx2),
410*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(v, 32, 64, avx2),       lowbd_entry(v, 64, 16, avx2),
411*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(v, 64, 32, avx2),       lowbd_entry(v, 64, 64, avx2),
412*77c1e3ccSAndroid Build Coastguard Worker 
413*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(h, 32, 32, avx2),
414*77c1e3ccSAndroid Build Coastguard Worker 
415*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(paeth, 16, 8, avx2),    lowbd_entry(paeth, 16, 16, avx2),
416*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(paeth, 16, 32, avx2),   lowbd_entry(paeth, 32, 16, avx2),
417*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(paeth, 32, 32, avx2),   lowbd_entry(paeth, 32, 64, avx2),
418*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(paeth, 64, 32, avx2),   lowbd_entry(paeth, 64, 64, avx2),
419*77c1e3ccSAndroid Build Coastguard Worker #else
420*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc, 32, 16, avx2),      lowbd_entry(dc, 32, 32, avx2),
421*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc, 32, 64, avx2),      lowbd_entry(dc, 64, 32, avx2),
422*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc, 64, 64, avx2),
423*77c1e3ccSAndroid Build Coastguard Worker 
424*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_top, 32, 16, avx2),  lowbd_entry(dc_top, 32, 32, avx2),
425*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_top, 32, 64, avx2),  lowbd_entry(dc_top, 64, 32, avx2),
426*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_top, 64, 64, avx2),
427*77c1e3ccSAndroid Build Coastguard Worker 
428*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_left, 32, 16, avx2), lowbd_entry(dc_left, 32, 32, avx2),
429*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_left, 32, 64, avx2), lowbd_entry(dc_left, 64, 32, avx2),
430*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_left, 64, 64, avx2),
431*77c1e3ccSAndroid Build Coastguard Worker 
432*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_128, 32, 16, avx2),  lowbd_entry(dc_128, 32, 32, avx2),
433*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_128, 32, 64, avx2),  lowbd_entry(dc_128, 64, 32, avx2),
434*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(dc_128, 64, 64, avx2),
435*77c1e3ccSAndroid Build Coastguard Worker 
436*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(v, 32, 16, avx2),       lowbd_entry(v, 32, 32, avx2),
437*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(v, 32, 64, avx2),       lowbd_entry(v, 64, 32, avx2),
438*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(v, 64, 64, avx2),
439*77c1e3ccSAndroid Build Coastguard Worker 
440*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(h, 32, 32, avx2),
441*77c1e3ccSAndroid Build Coastguard Worker 
442*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(paeth, 16, 8, avx2),    lowbd_entry(paeth, 16, 16, avx2),
443*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(paeth, 16, 32, avx2),   lowbd_entry(paeth, 32, 16, avx2),
444*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(paeth, 32, 32, avx2),   lowbd_entry(paeth, 32, 64, avx2),
445*77c1e3ccSAndroid Build Coastguard Worker   lowbd_entry(paeth, 64, 32, avx2),   lowbd_entry(paeth, 64, 64, avx2),
446*77c1e3ccSAndroid Build Coastguard Worker #endif  // !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
447*77c1e3ccSAndroid Build Coastguard Worker };
448*77c1e3ccSAndroid Build Coastguard Worker 
449*77c1e3ccSAndroid Build Coastguard Worker INSTANTIATE_TEST_SUITE_P(AVX2, LowbdIntraPredTest,
450*77c1e3ccSAndroid Build Coastguard Worker                          ::testing::ValuesIn(LowbdIntraPredTestVectorAvx2));
451*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_AVX2
452*77c1e3ccSAndroid Build Coastguard Worker 
453*77c1e3ccSAndroid Build Coastguard Worker #if CONFIG_AV1_HIGHBITDEPTH
454*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON
455*77c1e3ccSAndroid Build Coastguard Worker const IntraPredFunc<HighbdIntraPred> HighbdIntraPredTestVectorNeon[] = {
456*77c1e3ccSAndroid Build Coastguard Worker   highbd_intrapred(dc, neon, 12),       highbd_intrapred(dc_top, neon, 12),
457*77c1e3ccSAndroid Build Coastguard Worker   highbd_intrapred(dc_left, neon, 12),  highbd_intrapred(dc_128, neon, 12),
458*77c1e3ccSAndroid Build Coastguard Worker   highbd_intrapred(v, neon, 12),        highbd_intrapred(h, neon, 12),
459*77c1e3ccSAndroid Build Coastguard Worker   highbd_intrapred(paeth, neon, 12),    highbd_intrapred(smooth, neon, 12),
460*77c1e3ccSAndroid Build Coastguard Worker   highbd_intrapred(smooth_v, neon, 12), highbd_intrapred(smooth_h, neon, 12),
461*77c1e3ccSAndroid Build Coastguard Worker };
462*77c1e3ccSAndroid Build Coastguard Worker 
463*77c1e3ccSAndroid Build Coastguard Worker INSTANTIATE_TEST_SUITE_P(NEON, HighbdIntraPredTest,
464*77c1e3ccSAndroid Build Coastguard Worker                          ::testing::ValuesIn(HighbdIntraPredTestVectorNeon));
465*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON
466*77c1e3ccSAndroid Build Coastguard Worker 
467*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_SSE2
468*77c1e3ccSAndroid Build Coastguard Worker const IntraPredFunc<HighbdIntraPred> HighbdIntraPredTestVectorSse2[] = {
469*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc, 4, 4, sse2, 12),
470*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc, 4, 8, sse2, 12),
471*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc, 8, 4, sse2, 12),
472*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc, 8, 8, sse2, 12),
473*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc, 8, 16, sse2, 12),
474*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc, 16, 8, sse2, 12),
475*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc, 16, 16, sse2, 12),
476*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc, 16, 32, sse2, 12),
477*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc, 32, 16, sse2, 12),
478*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc, 32, 32, sse2, 12),
479*77c1e3ccSAndroid Build Coastguard Worker 
480*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_top, 4, 4, sse2, 12),
481*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_top, 4, 8, sse2, 12),
482*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_top, 8, 4, sse2, 12),
483*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_top, 8, 8, sse2, 12),
484*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_top, 8, 16, sse2, 12),
485*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_top, 16, 8, sse2, 12),
486*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_top, 16, 16, sse2, 12),
487*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_top, 16, 32, sse2, 12),
488*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_top, 32, 16, sse2, 12),
489*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_top, 32, 32, sse2, 12),
490*77c1e3ccSAndroid Build Coastguard Worker 
491*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_left, 4, 4, sse2, 12),
492*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_left, 4, 8, sse2, 12),
493*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_left, 8, 4, sse2, 12),
494*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_left, 8, 8, sse2, 12),
495*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_left, 8, 16, sse2, 12),
496*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_left, 16, 8, sse2, 12),
497*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_left, 16, 16, sse2, 12),
498*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_left, 16, 32, sse2, 12),
499*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_left, 32, 16, sse2, 12),
500*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_left, 32, 32, sse2, 12),
501*77c1e3ccSAndroid Build Coastguard Worker 
502*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_128, 4, 4, sse2, 12),
503*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_128, 4, 8, sse2, 12),
504*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_128, 8, 4, sse2, 12),
505*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_128, 8, 8, sse2, 12),
506*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_128, 8, 16, sse2, 12),
507*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_128, 16, 8, sse2, 12),
508*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_128, 16, 16, sse2, 12),
509*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_128, 16, 32, sse2, 12),
510*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_128, 32, 16, sse2, 12),
511*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(dc_128, 32, 32, sse2, 12),
512*77c1e3ccSAndroid Build Coastguard Worker 
513*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(v, 4, 4, sse2, 12),
514*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(v, 4, 8, sse2, 12),
515*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(v, 8, 4, sse2, 12),
516*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(v, 8, 8, sse2, 12),
517*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(v, 8, 16, sse2, 12),
518*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(v, 16, 8, sse2, 12),
519*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(v, 16, 16, sse2, 12),
520*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(v, 16, 32, sse2, 12),
521*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(v, 32, 16, sse2, 12),
522*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(v, 32, 32, sse2, 12),
523*77c1e3ccSAndroid Build Coastguard Worker 
524*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(h, 4, 4, sse2, 12),
525*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(h, 4, 8, sse2, 12),
526*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(h, 8, 4, sse2, 12),
527*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(h, 8, 8, sse2, 12),
528*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(h, 8, 16, sse2, 12),
529*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(h, 16, 8, sse2, 12),
530*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(h, 16, 16, sse2, 12),
531*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(h, 16, 32, sse2, 12),
532*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(h, 32, 16, sse2, 12),
533*77c1e3ccSAndroid Build Coastguard Worker   highbd_entry(h, 32, 32, sse2, 12),
534*77c1e3ccSAndroid Build Coastguard Worker };
535*77c1e3ccSAndroid Build Coastguard Worker 
536*77c1e3ccSAndroid Build Coastguard Worker INSTANTIATE_TEST_SUITE_P(SSE2, HighbdIntraPredTest,
537*77c1e3ccSAndroid Build Coastguard Worker                          ::testing::ValuesIn(HighbdIntraPredTestVectorSse2));
538*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_SSE2
539*77c1e3ccSAndroid Build Coastguard Worker #endif  // CONFIG_AV1_HIGHBITDEPTH
540*77c1e3ccSAndroid Build Coastguard Worker }  // namespace
541