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