xref: /aosp_15_r20/external/libgav1/src/dsp/intra_edge_test.cc (revision 095378508e87ed692bf8dfeb34008b65b3735891)
1*09537850SAkhilesh Sanikop // Copyright 2021 The libgav1 Authors
2*09537850SAkhilesh Sanikop //
3*09537850SAkhilesh Sanikop // Licensed under the Apache License, Version 2.0 (the "License");
4*09537850SAkhilesh Sanikop // you may not use this file except in compliance with the License.
5*09537850SAkhilesh Sanikop // You may obtain a copy of the License at
6*09537850SAkhilesh Sanikop //
7*09537850SAkhilesh Sanikop //      http://www.apache.org/licenses/LICENSE-2.0
8*09537850SAkhilesh Sanikop //
9*09537850SAkhilesh Sanikop // Unless required by applicable law or agreed to in writing, software
10*09537850SAkhilesh Sanikop // distributed under the License is distributed on an "AS IS" BASIS,
11*09537850SAkhilesh Sanikop // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*09537850SAkhilesh Sanikop // See the License for the specific language governing permissions and
13*09537850SAkhilesh Sanikop // limitations under the License.
14*09537850SAkhilesh Sanikop 
15*09537850SAkhilesh Sanikop #include "src/dsp/intra_edge.h"
16*09537850SAkhilesh Sanikop 
17*09537850SAkhilesh Sanikop #include <cstdint>
18*09537850SAkhilesh Sanikop #include <cstdio>
19*09537850SAkhilesh Sanikop #include <ostream>
20*09537850SAkhilesh Sanikop 
21*09537850SAkhilesh Sanikop #include "absl/strings/match.h"
22*09537850SAkhilesh Sanikop #include "absl/strings/string_view.h"
23*09537850SAkhilesh Sanikop #include "absl/time/clock.h"
24*09537850SAkhilesh Sanikop #include "absl/time/time.h"
25*09537850SAkhilesh Sanikop #include "gtest/gtest.h"
26*09537850SAkhilesh Sanikop #include "src/dsp/dsp.h"
27*09537850SAkhilesh Sanikop #include "src/utils/compiler_attributes.h"
28*09537850SAkhilesh Sanikop #include "src/utils/constants.h"
29*09537850SAkhilesh Sanikop #include "src/utils/cpu.h"
30*09537850SAkhilesh Sanikop #include "tests/third_party/libvpx/acm_random.h"
31*09537850SAkhilesh Sanikop #include "tests/utils.h"
32*09537850SAkhilesh Sanikop 
33*09537850SAkhilesh Sanikop namespace libgav1 {
34*09537850SAkhilesh Sanikop namespace dsp {
35*09537850SAkhilesh Sanikop namespace {
36*09537850SAkhilesh Sanikop 
37*09537850SAkhilesh Sanikop const char kIntraEdge[] = "IntraEdge";
38*09537850SAkhilesh Sanikop const char kIntraEdgeFilterName[] = "Intra Edge Filter";
39*09537850SAkhilesh Sanikop const char kIntraEdgeUpsamplerName[] = "Intra Edge Upsampler";
40*09537850SAkhilesh Sanikop 
41*09537850SAkhilesh Sanikop constexpr int kIntraEdgeBufferSize = 144;  // see Tile::IntraPrediction.
42*09537850SAkhilesh Sanikop constexpr int kIntraEdgeFilterTestMaxSize = 129;
43*09537850SAkhilesh Sanikop constexpr int kIntraEdgeFilterTestFixedInput[kIntraEdgeFilterTestMaxSize] = {
44*09537850SAkhilesh Sanikop     159, 208, 54,  136, 205, 124, 125, 165, 164, 63,  171, 143, 210, 236, 253,
45*09537850SAkhilesh Sanikop     233, 139, 113, 66,  211, 133, 61,  91,  123, 187, 76,  110, 172, 61,  103,
46*09537850SAkhilesh Sanikop     239, 147, 247, 120, 18,  106, 180, 159, 208, 54,  136, 205, 124, 125, 165,
47*09537850SAkhilesh Sanikop     164, 63,  171, 143, 210, 236, 253, 233, 139, 113, 66,  211, 133, 61,  91,
48*09537850SAkhilesh Sanikop     123, 187, 76,  110, 172, 61,  103, 239, 147, 247, 120, 18,  106, 180, 159,
49*09537850SAkhilesh Sanikop     208, 54,  136, 205, 124, 125, 165, 164, 63,  171, 143, 210, 236, 253, 233,
50*09537850SAkhilesh Sanikop     139, 113, 66,  211, 133, 61,  91,  123, 187, 76,  110, 172, 61,  103, 239,
51*09537850SAkhilesh Sanikop     147, 247, 120, 18,  106, 180, 159, 208, 54,  136, 205, 124, 125, 165, 164,
52*09537850SAkhilesh Sanikop     63,  171, 143, 210, 236, 253, 233, 139, 113,
53*09537850SAkhilesh Sanikop };
54*09537850SAkhilesh Sanikop constexpr int kIntraEdgeUpsamplerTestFixedInput[] = {
55*09537850SAkhilesh Sanikop     208, 54,  136, 205, 124, 125, 165, 164, 63,
56*09537850SAkhilesh Sanikop     171, 143, 210, 236, 208, 54,  136, 205};
57*09537850SAkhilesh Sanikop 
58*09537850SAkhilesh Sanikop struct EdgeFilterParams {
59*09537850SAkhilesh Sanikop   int size;
60*09537850SAkhilesh Sanikop   int strength;
61*09537850SAkhilesh Sanikop };
62*09537850SAkhilesh Sanikop 
operator <<(std::ostream & os,const EdgeFilterParams & param)63*09537850SAkhilesh Sanikop std::ostream& operator<<(std::ostream& os, const EdgeFilterParams& param) {
64*09537850SAkhilesh Sanikop   return os << "size: " << param.size << ", strength: " << param.strength;
65*09537850SAkhilesh Sanikop }
66*09537850SAkhilesh Sanikop 
67*09537850SAkhilesh Sanikop // Each size is paired with strength 1, 2, and 3.
68*09537850SAkhilesh Sanikop // In general, the size is expressible as 2^n+1, but all sizes up to 129 are
69*09537850SAkhilesh Sanikop // permissible.
70*09537850SAkhilesh Sanikop constexpr EdgeFilterParams kIntraEdgeFilterParamList[] = {
71*09537850SAkhilesh Sanikop     {1, 1},  {1, 2},  {1, 3},  {2, 1},   {2, 2},   {2, 3},  {5, 1},  {5, 2},
72*09537850SAkhilesh Sanikop     {5, 3},  {9, 1},  {9, 2},  {9, 3},   {17, 1},  {17, 2}, {17, 3}, {33, 1},
73*09537850SAkhilesh Sanikop     {33, 2}, {33, 3}, {50, 1}, {50, 2},  {50, 3},  {55, 1}, {55, 2}, {55, 3},
74*09537850SAkhilesh Sanikop     {65, 1}, {65, 2}, {65, 3}, {129, 1}, {129, 2}, {129, 3}};
75*09537850SAkhilesh Sanikop 
76*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
77*09537850SAkhilesh Sanikop class IntraEdgeFilterTest : public testing::TestWithParam<EdgeFilterParams> {
78*09537850SAkhilesh Sanikop  public:
79*09537850SAkhilesh Sanikop   static_assert(bitdepth >= kBitdepth8 && bitdepth <= LIBGAV1_MAX_BITDEPTH, "");
80*09537850SAkhilesh Sanikop   IntraEdgeFilterTest() = default;
81*09537850SAkhilesh Sanikop   IntraEdgeFilterTest(const IntraEdgeFilterTest&) = delete;
82*09537850SAkhilesh Sanikop   IntraEdgeFilterTest& operator=(const IntraEdgeFilterTest&) = delete;
83*09537850SAkhilesh Sanikop   ~IntraEdgeFilterTest() override = default;
84*09537850SAkhilesh Sanikop 
85*09537850SAkhilesh Sanikop  protected:
SetUp()86*09537850SAkhilesh Sanikop   void SetUp() override {
87*09537850SAkhilesh Sanikop     test_utils::ResetDspTable(bitdepth);
88*09537850SAkhilesh Sanikop     IntraEdgeInit_C();
89*09537850SAkhilesh Sanikop 
90*09537850SAkhilesh Sanikop     const Dsp* const dsp = GetDspTable(bitdepth);
91*09537850SAkhilesh Sanikop     ASSERT_NE(dsp, nullptr);
92*09537850SAkhilesh Sanikop     base_intra_edge_filter_ = dsp->intra_edge_filter;
93*09537850SAkhilesh Sanikop 
94*09537850SAkhilesh Sanikop     const testing::TestInfo* const test_info =
95*09537850SAkhilesh Sanikop         testing::UnitTest::GetInstance()->current_test_info();
96*09537850SAkhilesh Sanikop     const absl::string_view test_case = test_info->test_suite_name();
97*09537850SAkhilesh Sanikop     if (absl::StartsWith(test_case, "C/")) {
98*09537850SAkhilesh Sanikop       base_intra_edge_filter_ = nullptr;
99*09537850SAkhilesh Sanikop     } else if (absl::StartsWith(test_case, "SSE41/")) {
100*09537850SAkhilesh Sanikop       if ((GetCpuInfo() & kSSE4_1) == 0) GTEST_SKIP() << "No SSE4.1 support!";
101*09537850SAkhilesh Sanikop       IntraEdgeInit_SSE4_1();
102*09537850SAkhilesh Sanikop     } else if (absl::StartsWith(test_case, "NEON/")) {
103*09537850SAkhilesh Sanikop       IntraEdgeInit_NEON();
104*09537850SAkhilesh Sanikop     } else {
105*09537850SAkhilesh Sanikop       FAIL() << "Unrecognized architecture prefix in test case name: "
106*09537850SAkhilesh Sanikop              << test_case;
107*09537850SAkhilesh Sanikop     }
108*09537850SAkhilesh Sanikop 
109*09537850SAkhilesh Sanikop #if LIBGAV1_MSAN
110*09537850SAkhilesh Sanikop     // Match the behavior of Tile::IntraPrediction to prevent warnings due to
111*09537850SAkhilesh Sanikop     // assembly code (safely) overreading to fill a register.
112*09537850SAkhilesh Sanikop     memset(buffer_, 0, sizeof(buffer_));
113*09537850SAkhilesh Sanikop #endif  // LIBGAV1_MSAN
114*09537850SAkhilesh Sanikop     cur_intra_edge_filter_ = dsp->intra_edge_filter;
115*09537850SAkhilesh Sanikop   }
116*09537850SAkhilesh Sanikop 
117*09537850SAkhilesh Sanikop   void TestFixedValues(const char* digest);
118*09537850SAkhilesh Sanikop   void TestRandomValues(int num_runs);
119*09537850SAkhilesh Sanikop 
120*09537850SAkhilesh Sanikop   Pixel buffer_[kIntraEdgeBufferSize];
121*09537850SAkhilesh Sanikop   Pixel base_buffer_[kIntraEdgeBufferSize];
122*09537850SAkhilesh Sanikop   int strength_ = GetParam().strength;
123*09537850SAkhilesh Sanikop   int size_ = GetParam().size;
124*09537850SAkhilesh Sanikop 
125*09537850SAkhilesh Sanikop   IntraEdgeFilterFunc base_intra_edge_filter_;
126*09537850SAkhilesh Sanikop   IntraEdgeFilterFunc cur_intra_edge_filter_;
127*09537850SAkhilesh Sanikop };
128*09537850SAkhilesh Sanikop 
129*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
TestFixedValues(const char * const digest)130*09537850SAkhilesh Sanikop void IntraEdgeFilterTest<bitdepth, Pixel>::TestFixedValues(
131*09537850SAkhilesh Sanikop     const char* const digest) {
132*09537850SAkhilesh Sanikop   if (cur_intra_edge_filter_ == nullptr) return;
133*09537850SAkhilesh Sanikop   for (int i = 0; i < kIntraEdgeFilterTestMaxSize; ++i) {
134*09537850SAkhilesh Sanikop     buffer_[i] = kIntraEdgeFilterTestFixedInput[i];
135*09537850SAkhilesh Sanikop   }
136*09537850SAkhilesh Sanikop   const absl::Time start = absl::Now();
137*09537850SAkhilesh Sanikop   cur_intra_edge_filter_(buffer_, size_, strength_);
138*09537850SAkhilesh Sanikop   const absl::Duration elapsed_time = absl::Now() - start;
139*09537850SAkhilesh Sanikop   test_utils::CheckMd5Digest(kIntraEdge, kIntraEdgeFilterName, digest, buffer_,
140*09537850SAkhilesh Sanikop                              kIntraEdgeFilterTestMaxSize * sizeof(buffer_[0]),
141*09537850SAkhilesh Sanikop                              elapsed_time);
142*09537850SAkhilesh Sanikop }
143*09537850SAkhilesh Sanikop 
144*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
TestRandomValues(int num_runs)145*09537850SAkhilesh Sanikop void IntraEdgeFilterTest<bitdepth, Pixel>::TestRandomValues(int num_runs) {
146*09537850SAkhilesh Sanikop   if (base_intra_edge_filter_ == nullptr) return;
147*09537850SAkhilesh Sanikop   if (cur_intra_edge_filter_ == nullptr) return;
148*09537850SAkhilesh Sanikop   libvpx_test::ACMRandom rnd(libvpx_test::ACMRandom::DeterministicSeed());
149*09537850SAkhilesh Sanikop   absl::Duration elapsed_time;
150*09537850SAkhilesh Sanikop   absl::Duration base_elapsed_time;
151*09537850SAkhilesh Sanikop   memset(base_buffer_, 0, sizeof(base_buffer_));
152*09537850SAkhilesh Sanikop   memset(buffer_, 0, sizeof(buffer_));
153*09537850SAkhilesh Sanikop   for (int num_tests = 0; num_tests < num_runs; ++num_tests) {
154*09537850SAkhilesh Sanikop     for (int i = 0; i < size_; ++i) {
155*09537850SAkhilesh Sanikop       const Pixel val = rnd(1 << bitdepth);
156*09537850SAkhilesh Sanikop       buffer_[i] = val;
157*09537850SAkhilesh Sanikop       base_buffer_[i] = val;
158*09537850SAkhilesh Sanikop     }
159*09537850SAkhilesh Sanikop     const absl::Time base_start = absl::Now();
160*09537850SAkhilesh Sanikop     base_intra_edge_filter_(base_buffer_, size_, strength_);
161*09537850SAkhilesh Sanikop     base_elapsed_time += absl::Now() - base_start;
162*09537850SAkhilesh Sanikop     const absl::Time start = absl::Now();
163*09537850SAkhilesh Sanikop     cur_intra_edge_filter_(buffer_, size_, strength_);
164*09537850SAkhilesh Sanikop     elapsed_time += absl::Now() - start;
165*09537850SAkhilesh Sanikop   }
166*09537850SAkhilesh Sanikop   if (num_runs > 1) {
167*09537850SAkhilesh Sanikop     printf("Mode %s[%31s] Size %3d Strength %d C: %5d us SIMD: %5d us %2.2fx\n",
168*09537850SAkhilesh Sanikop            kIntraEdge, kIntraEdgeFilterName, size_, strength_,
169*09537850SAkhilesh Sanikop            static_cast<int>(absl::ToInt64Microseconds(base_elapsed_time)),
170*09537850SAkhilesh Sanikop            static_cast<int>(absl::ToInt64Microseconds(elapsed_time)),
171*09537850SAkhilesh Sanikop            absl::ToDoubleMicroseconds(base_elapsed_time) /
172*09537850SAkhilesh Sanikop                absl::ToDoubleMicroseconds(elapsed_time));
173*09537850SAkhilesh Sanikop   } else {
174*09537850SAkhilesh Sanikop     printf("Mode %s[%31s] Size %3d Strength %d\n", kIntraEdge,
175*09537850SAkhilesh Sanikop            kIntraEdgeFilterName, size_, strength_);
176*09537850SAkhilesh Sanikop   }
177*09537850SAkhilesh Sanikop   for (int i = 0; i < kIntraEdgeFilterTestMaxSize; ++i) {
178*09537850SAkhilesh Sanikop     EXPECT_EQ(buffer_[i], base_buffer_[i]) << "Mismatch in index: " << i;
179*09537850SAkhilesh Sanikop   }
180*09537850SAkhilesh Sanikop }
181*09537850SAkhilesh Sanikop 
182*09537850SAkhilesh Sanikop using IntraEdgeFilterTest8bpp = IntraEdgeFilterTest<8, uint8_t>;
183*09537850SAkhilesh Sanikop 
GetIntraEdgeFilterDigest8bpp(int strength,int size)184*09537850SAkhilesh Sanikop const char* GetIntraEdgeFilterDigest8bpp(int strength, int size) {
185*09537850SAkhilesh Sanikop   static const char* const kDigestsSize1[3] = {
186*09537850SAkhilesh Sanikop       "f7f681cf7047602fafc7fb416ecf46e1", "f7f681cf7047602fafc7fb416ecf46e1",
187*09537850SAkhilesh Sanikop       "f7f681cf7047602fafc7fb416ecf46e1"};
188*09537850SAkhilesh Sanikop   static const char* const kDigestsSize2[3] = {
189*09537850SAkhilesh Sanikop       "cb24cc54900fb75d767f3de797451e43", "380c80c89e1e8cda81ee0d3d4b29b8b7",
190*09537850SAkhilesh Sanikop       "a7eb3dba95ff35c2df45a274afbc9772"};
191*09537850SAkhilesh Sanikop   static const char* const kDigestsSize5[3] = {
192*09537850SAkhilesh Sanikop       "23380cb37688d4c3a8f70a276be65eed", "ec1e23d5b996a527ed3d45c0d552bf22",
193*09537850SAkhilesh Sanikop       "d313523d3b7646fdbb873c61ffe7a51a"};
194*09537850SAkhilesh Sanikop   static const char* const kDigestsSize9[3] = {
195*09537850SAkhilesh Sanikop       "e79597e9d62893754fc77d80ca86329a", "f7644e9748984914100e7031c6432272",
196*09537850SAkhilesh Sanikop       "bdf4f16734c86338716fb436c196ecc6"};
197*09537850SAkhilesh Sanikop   static const char* const kDigestsSize17[3] = {
198*09537850SAkhilesh Sanikop       "13ad15c833e850348eecb9fea4f3cadb", "e5988a72391250c702a8192893df40dd",
199*09537850SAkhilesh Sanikop       "8f68603598638fa33203fe1233d273b1"};
200*09537850SAkhilesh Sanikop   static const char* const kDigestsSize33[3] = {
201*09537850SAkhilesh Sanikop       "51156da8f4d527e0c011040769987dbd", "eff17eaf73a7bb7fd4c921510ade9f67",
202*09537850SAkhilesh Sanikop       "aca87680e0649d0728091c92c6de8871"};
203*09537850SAkhilesh Sanikop   static const char* const kDigestsSize50[3] = {
204*09537850SAkhilesh Sanikop       "87c1d43751125f1ea4987517a90d378d", "942a9d056231683bdfc52346b6b032c2",
205*09537850SAkhilesh Sanikop       "16a9148daf0e5f69808b9f0caa1ef110"};
206*09537850SAkhilesh Sanikop   static const char* const kDigestsSize55[3] = {
207*09537850SAkhilesh Sanikop       "833480d74957fb0356dec5b09412eefa", "a307ef31f10affc3b7fb262d05f1b80a",
208*09537850SAkhilesh Sanikop       "0318b2fde088c472215fe155f3b48d36"};
209*09537850SAkhilesh Sanikop   static const char* const kDigestsSize65[3] = {
210*09537850SAkhilesh Sanikop       "5000dada34ed2e6692bb44a4398ddf53", "8da6c776d897064ecd4a1e84aae92dd3",
211*09537850SAkhilesh Sanikop       "d7c71db339c28d33119974987b2f9d85"};
212*09537850SAkhilesh Sanikop   static const char* const kDigestsSize129[3] = {
213*09537850SAkhilesh Sanikop       "bf174d8b45b8131404fd4a4686f8c117", "e81518d6d85eed2f1b18c59424561d6b",
214*09537850SAkhilesh Sanikop       "7306715602b0f5536771724a2f0a39bc"};
215*09537850SAkhilesh Sanikop 
216*09537850SAkhilesh Sanikop   switch (size) {
217*09537850SAkhilesh Sanikop     case 1:
218*09537850SAkhilesh Sanikop       return kDigestsSize1[strength - 1];
219*09537850SAkhilesh Sanikop     case 2:
220*09537850SAkhilesh Sanikop       return kDigestsSize2[strength - 1];
221*09537850SAkhilesh Sanikop     case 5:
222*09537850SAkhilesh Sanikop       return kDigestsSize5[strength - 1];
223*09537850SAkhilesh Sanikop     case 9:
224*09537850SAkhilesh Sanikop       return kDigestsSize9[strength - 1];
225*09537850SAkhilesh Sanikop     case 17:
226*09537850SAkhilesh Sanikop       return kDigestsSize17[strength - 1];
227*09537850SAkhilesh Sanikop     case 33:
228*09537850SAkhilesh Sanikop       return kDigestsSize33[strength - 1];
229*09537850SAkhilesh Sanikop     case 50:
230*09537850SAkhilesh Sanikop       return kDigestsSize50[strength - 1];
231*09537850SAkhilesh Sanikop     case 55:
232*09537850SAkhilesh Sanikop       return kDigestsSize55[strength - 1];
233*09537850SAkhilesh Sanikop     case 65:
234*09537850SAkhilesh Sanikop       return kDigestsSize65[strength - 1];
235*09537850SAkhilesh Sanikop     case 129:
236*09537850SAkhilesh Sanikop       return kDigestsSize129[strength - 1];
237*09537850SAkhilesh Sanikop     default:
238*09537850SAkhilesh Sanikop       ADD_FAILURE() << "Unknown edge size: " << size;
239*09537850SAkhilesh Sanikop       return nullptr;
240*09537850SAkhilesh Sanikop   }
241*09537850SAkhilesh Sanikop }
242*09537850SAkhilesh Sanikop 
TEST_P(IntraEdgeFilterTest8bpp,Correctness)243*09537850SAkhilesh Sanikop TEST_P(IntraEdgeFilterTest8bpp, Correctness) {
244*09537850SAkhilesh Sanikop   TestFixedValues(GetIntraEdgeFilterDigest8bpp(strength_, size_));
245*09537850SAkhilesh Sanikop   TestRandomValues(1);
246*09537850SAkhilesh Sanikop }
247*09537850SAkhilesh Sanikop 
TEST_P(IntraEdgeFilterTest8bpp,DISABLED_Speed)248*09537850SAkhilesh Sanikop TEST_P(IntraEdgeFilterTest8bpp, DISABLED_Speed) { TestRandomValues(1e7); }
249*09537850SAkhilesh Sanikop 
250*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH >= 10
251*09537850SAkhilesh Sanikop using IntraEdgeFilterTest10bpp = IntraEdgeFilterTest<10, uint16_t>;
252*09537850SAkhilesh Sanikop 
GetIntraEdgeFilterDigest10bpp(int strength,int size)253*09537850SAkhilesh Sanikop const char* GetIntraEdgeFilterDigest10bpp(int strength, int size) {
254*09537850SAkhilesh Sanikop   static const char* const kDigestsSize1[3] = {
255*09537850SAkhilesh Sanikop       "2d2088560e3ccb5b809c97f5299bb1c0", "2d2088560e3ccb5b809c97f5299bb1c0",
256*09537850SAkhilesh Sanikop       "2d2088560e3ccb5b809c97f5299bb1c0"};
257*09537850SAkhilesh Sanikop   static const char* const kDigestsSize2[3] = {
258*09537850SAkhilesh Sanikop       "db3e785852e98fba18a1fb531f68466c", "8caea330489bc6ed0f99fbf769f53181",
259*09537850SAkhilesh Sanikop       "bcdd1b21f3baf5f6f29caea9ef93fb0c"};
260*09537850SAkhilesh Sanikop   static const char* const kDigestsSize5[3] = {
261*09537850SAkhilesh Sanikop       "326f4193a62f5a959b86d95f5204608e", "4673e453203f75eae97ef44f43f098f2",
262*09537850SAkhilesh Sanikop       "48d516b06313683aca30e975ce6a3cad"};
263*09537850SAkhilesh Sanikop   static const char* const kDigestsSize9[3] = {
264*09537850SAkhilesh Sanikop       "79217575a32e36a51d9dd40621af9c2d", "ccec1c16bc09b28ad6513c5e4c48b6d2",
265*09537850SAkhilesh Sanikop       "bb61aa9c5fa720c667a053769e7b7d08"};
266*09537850SAkhilesh Sanikop   static const char* const kDigestsSize17[3] = {
267*09537850SAkhilesh Sanikop       "46d90e99ba46e89326a5fa547bcd9361", "824aee8950aecb356d5f4a91dbc90a7d",
268*09537850SAkhilesh Sanikop       "37d44d10a2545385af1da55f8c08564f"};
269*09537850SAkhilesh Sanikop   static const char* const kDigestsSize33[3] = {
270*09537850SAkhilesh Sanikop       "c95108e06eb2aef61ecb6839af306edd", "832c695460b4dd2b85c5f8726e4470d1",
271*09537850SAkhilesh Sanikop       "994902f549eefd83fbcbf7ecb7dc5cca"};
272*09537850SAkhilesh Sanikop   static const char* const kDigestsSize50[3] = {
273*09537850SAkhilesh Sanikop       "48119ef1436c3a4fe69d275bbaafedf8", "72c221c91c3df0a324ccbc9acea35f89",
274*09537850SAkhilesh Sanikop       "84e40aadcc416ef3f51cea3cc23b30c7"};
275*09537850SAkhilesh Sanikop   static const char* const kDigestsSize55[3] = {
276*09537850SAkhilesh Sanikop       "6b68e4e0b00c4eb38a6d0d83c0f34658", "43a919f928a80379df5c9e07c9d8000d",
277*09537850SAkhilesh Sanikop       "7c320d55b11f93185b811bdaa379f2db"};
278*09537850SAkhilesh Sanikop   static const char* const kDigestsSize65[3] = {
279*09537850SAkhilesh Sanikop       "c28de89cf9f3bc5a904647ab2c64caf7", "7ce63b1b28dce0624fc7586e8fb3ab8f",
280*09537850SAkhilesh Sanikop       "d06e6b88585f7f1a1f6af5bb59ee2180"};
281*09537850SAkhilesh Sanikop   static const char* const kDigestsSize129[3] = {
282*09537850SAkhilesh Sanikop       "79160902c5c85004382d5ffa549b43cc", "3b0df95c3ca7b0b559b79234cf434738",
283*09537850SAkhilesh Sanikop       "500786d8561effec283d4f3d13886f8c"};
284*09537850SAkhilesh Sanikop 
285*09537850SAkhilesh Sanikop   switch (size) {
286*09537850SAkhilesh Sanikop     case 1:
287*09537850SAkhilesh Sanikop       return kDigestsSize1[strength - 1];
288*09537850SAkhilesh Sanikop     case 2:
289*09537850SAkhilesh Sanikop       return kDigestsSize2[strength - 1];
290*09537850SAkhilesh Sanikop     case 5:
291*09537850SAkhilesh Sanikop       return kDigestsSize5[strength - 1];
292*09537850SAkhilesh Sanikop     case 9:
293*09537850SAkhilesh Sanikop       return kDigestsSize9[strength - 1];
294*09537850SAkhilesh Sanikop     case 17:
295*09537850SAkhilesh Sanikop       return kDigestsSize17[strength - 1];
296*09537850SAkhilesh Sanikop     case 33:
297*09537850SAkhilesh Sanikop       return kDigestsSize33[strength - 1];
298*09537850SAkhilesh Sanikop     case 50:
299*09537850SAkhilesh Sanikop       return kDigestsSize50[strength - 1];
300*09537850SAkhilesh Sanikop     case 55:
301*09537850SAkhilesh Sanikop       return kDigestsSize55[strength - 1];
302*09537850SAkhilesh Sanikop     case 65:
303*09537850SAkhilesh Sanikop       return kDigestsSize65[strength - 1];
304*09537850SAkhilesh Sanikop     case 129:
305*09537850SAkhilesh Sanikop       return kDigestsSize129[strength - 1];
306*09537850SAkhilesh Sanikop     default:
307*09537850SAkhilesh Sanikop       ADD_FAILURE() << "Unknown edge size: " << size;
308*09537850SAkhilesh Sanikop       return nullptr;
309*09537850SAkhilesh Sanikop   }
310*09537850SAkhilesh Sanikop }
311*09537850SAkhilesh Sanikop 
TEST_P(IntraEdgeFilterTest10bpp,FixedInput)312*09537850SAkhilesh Sanikop TEST_P(IntraEdgeFilterTest10bpp, FixedInput) {
313*09537850SAkhilesh Sanikop   TestFixedValues(GetIntraEdgeFilterDigest10bpp(strength_, size_));
314*09537850SAkhilesh Sanikop   TestRandomValues(1);
315*09537850SAkhilesh Sanikop }
316*09537850SAkhilesh Sanikop 
TEST_P(IntraEdgeFilterTest10bpp,DISABLED_Speed)317*09537850SAkhilesh Sanikop TEST_P(IntraEdgeFilterTest10bpp, DISABLED_Speed) { TestRandomValues(1e7); }
318*09537850SAkhilesh Sanikop #endif  // LIBGAV1_MAX_BITDEPTH >= 10
319*09537850SAkhilesh Sanikop 
320*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH == 12
321*09537850SAkhilesh Sanikop using IntraEdgeFilterTest12bpp = IntraEdgeFilterTest<12, uint16_t>;
322*09537850SAkhilesh Sanikop 
GetIntraEdgeFilterDigest12bpp(int strength,int size)323*09537850SAkhilesh Sanikop const char* GetIntraEdgeFilterDigest12bpp(int strength, int size) {
324*09537850SAkhilesh Sanikop   return GetIntraEdgeFilterDigest10bpp(strength, size);
325*09537850SAkhilesh Sanikop }
326*09537850SAkhilesh Sanikop 
TEST_P(IntraEdgeFilterTest12bpp,FixedInput)327*09537850SAkhilesh Sanikop TEST_P(IntraEdgeFilterTest12bpp, FixedInput) {
328*09537850SAkhilesh Sanikop   TestFixedValues(GetIntraEdgeFilterDigest12bpp(strength_, size_));
329*09537850SAkhilesh Sanikop   TestRandomValues(1);
330*09537850SAkhilesh Sanikop }
331*09537850SAkhilesh Sanikop 
TEST_P(IntraEdgeFilterTest12bpp,DISABLED_Speed)332*09537850SAkhilesh Sanikop TEST_P(IntraEdgeFilterTest12bpp, DISABLED_Speed) { TestRandomValues(1e7); }
333*09537850SAkhilesh Sanikop #endif  // LIBGAV1_MAX_BITDEPTH == 12
334*09537850SAkhilesh Sanikop 
335*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
336*09537850SAkhilesh Sanikop class IntraEdgeUpsamplerTest : public testing::TestWithParam<int> {
337*09537850SAkhilesh Sanikop  public:
338*09537850SAkhilesh Sanikop   static_assert(bitdepth >= kBitdepth8 && bitdepth <= LIBGAV1_MAX_BITDEPTH, "");
339*09537850SAkhilesh Sanikop   IntraEdgeUpsamplerTest() = default;
340*09537850SAkhilesh Sanikop   IntraEdgeUpsamplerTest(const IntraEdgeUpsamplerTest&) = delete;
341*09537850SAkhilesh Sanikop   IntraEdgeUpsamplerTest& operator=(const IntraEdgeUpsamplerTest&) = delete;
342*09537850SAkhilesh Sanikop   ~IntraEdgeUpsamplerTest() override = default;
343*09537850SAkhilesh Sanikop 
344*09537850SAkhilesh Sanikop  protected:
SetUp()345*09537850SAkhilesh Sanikop   void SetUp() override {
346*09537850SAkhilesh Sanikop     test_utils::ResetDspTable(bitdepth);
347*09537850SAkhilesh Sanikop     IntraEdgeInit_C();
348*09537850SAkhilesh Sanikop 
349*09537850SAkhilesh Sanikop     const Dsp* const dsp = GetDspTable(bitdepth);
350*09537850SAkhilesh Sanikop     ASSERT_NE(dsp, nullptr);
351*09537850SAkhilesh Sanikop     base_intra_edge_upsampler_ = dsp->intra_edge_upsampler;
352*09537850SAkhilesh Sanikop     const testing::TestInfo* const test_info =
353*09537850SAkhilesh Sanikop         testing::UnitTest::GetInstance()->current_test_info();
354*09537850SAkhilesh Sanikop     const absl::string_view test_case = test_info->test_suite_name();
355*09537850SAkhilesh Sanikop     if (absl::StartsWith(test_case, "C/")) {
356*09537850SAkhilesh Sanikop       base_intra_edge_upsampler_ = nullptr;
357*09537850SAkhilesh Sanikop     } else if (absl::StartsWith(test_case, "SSE41/")) {
358*09537850SAkhilesh Sanikop       if ((GetCpuInfo() & kSSE4_1) == 0) GTEST_SKIP() << "No SSE4.1 support!";
359*09537850SAkhilesh Sanikop       IntraEdgeInit_SSE4_1();
360*09537850SAkhilesh Sanikop     } else if (absl::StartsWith(test_case, "NEON/")) {
361*09537850SAkhilesh Sanikop       IntraEdgeInit_NEON();
362*09537850SAkhilesh Sanikop     } else {
363*09537850SAkhilesh Sanikop       FAIL() << "Unrecognized architecture prefix in test case name: "
364*09537850SAkhilesh Sanikop              << test_case;
365*09537850SAkhilesh Sanikop     }
366*09537850SAkhilesh Sanikop     cur_intra_edge_upsampler_ = dsp->intra_edge_upsampler;
367*09537850SAkhilesh Sanikop #if LIBGAV1_MSAN
368*09537850SAkhilesh Sanikop     // Match the behavior of Tile::IntraPrediction to prevent warnings due to
369*09537850SAkhilesh Sanikop     // assembly code (safely) overreading to fill a register.
370*09537850SAkhilesh Sanikop     memset(buffer_, 0, sizeof(buffer_));
371*09537850SAkhilesh Sanikop #endif
372*09537850SAkhilesh Sanikop   }
373*09537850SAkhilesh Sanikop 
374*09537850SAkhilesh Sanikop   void TestFixedValues(const char* digest);
375*09537850SAkhilesh Sanikop   void TestRandomValues(int num_runs);
376*09537850SAkhilesh Sanikop 
377*09537850SAkhilesh Sanikop   Pixel buffer_[128];
378*09537850SAkhilesh Sanikop   Pixel base_buffer_[128];
379*09537850SAkhilesh Sanikop   int size_ = GetParam();
380*09537850SAkhilesh Sanikop 
381*09537850SAkhilesh Sanikop   IntraEdgeUpsamplerFunc base_intra_edge_upsampler_;
382*09537850SAkhilesh Sanikop   IntraEdgeUpsamplerFunc cur_intra_edge_upsampler_;
383*09537850SAkhilesh Sanikop };
384*09537850SAkhilesh Sanikop 
385*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
TestFixedValues(const char * const digest)386*09537850SAkhilesh Sanikop void IntraEdgeUpsamplerTest<bitdepth, Pixel>::TestFixedValues(
387*09537850SAkhilesh Sanikop     const char* const digest) {
388*09537850SAkhilesh Sanikop   if (cur_intra_edge_upsampler_ == nullptr) return;
389*09537850SAkhilesh Sanikop   buffer_[0] = 0;
390*09537850SAkhilesh Sanikop   for (int i = 0; i < size_ + 1; ++i) {
391*09537850SAkhilesh Sanikop     buffer_[i + 1] = kIntraEdgeUpsamplerTestFixedInput[i];
392*09537850SAkhilesh Sanikop   }
393*09537850SAkhilesh Sanikop   const absl::Time start = absl::Now();
394*09537850SAkhilesh Sanikop   cur_intra_edge_upsampler_(buffer_ + 2, size_);
395*09537850SAkhilesh Sanikop   const absl::Duration elapsed_time = absl::Now() - start;
396*09537850SAkhilesh Sanikop   test_utils::CheckMd5Digest(kIntraEdge, kIntraEdgeUpsamplerName, digest,
397*09537850SAkhilesh Sanikop                              buffer_, (size_ * 2 + 1) * sizeof(buffer_[0]),
398*09537850SAkhilesh Sanikop                              elapsed_time);
399*09537850SAkhilesh Sanikop }
400*09537850SAkhilesh Sanikop 
401*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
TestRandomValues(int num_runs)402*09537850SAkhilesh Sanikop void IntraEdgeUpsamplerTest<bitdepth, Pixel>::TestRandomValues(int num_runs) {
403*09537850SAkhilesh Sanikop   if (base_intra_edge_upsampler_ == nullptr) return;
404*09537850SAkhilesh Sanikop   if (cur_intra_edge_upsampler_ == nullptr) return;
405*09537850SAkhilesh Sanikop   libvpx_test::ACMRandom rnd(libvpx_test::ACMRandom::DeterministicSeed());
406*09537850SAkhilesh Sanikop   absl::Duration base_elapsed_time;
407*09537850SAkhilesh Sanikop   absl::Duration elapsed_time;
408*09537850SAkhilesh Sanikop   for (int num_tests = 0; num_tests < num_runs; ++num_tests) {
409*09537850SAkhilesh Sanikop     // Populate what will be buffer[-2..size] when passed to the upsample
410*09537850SAkhilesh Sanikop     // function.
411*09537850SAkhilesh Sanikop     buffer_[0] = 0;
412*09537850SAkhilesh Sanikop     base_buffer_[0] = 0;
413*09537850SAkhilesh Sanikop     for (int i = 1; i < size_ + 2; ++i) {
414*09537850SAkhilesh Sanikop       const Pixel val = rnd(1 << bitdepth);
415*09537850SAkhilesh Sanikop       buffer_[i] = val;
416*09537850SAkhilesh Sanikop       base_buffer_[i] = val;
417*09537850SAkhilesh Sanikop     }
418*09537850SAkhilesh Sanikop     const absl::Time base_start = absl::Now();
419*09537850SAkhilesh Sanikop     base_intra_edge_upsampler_(base_buffer_ + 2, size_);
420*09537850SAkhilesh Sanikop     base_elapsed_time += absl::Now() - base_start;
421*09537850SAkhilesh Sanikop     const absl::Time start = absl::Now();
422*09537850SAkhilesh Sanikop     cur_intra_edge_upsampler_(buffer_ + 2, size_);
423*09537850SAkhilesh Sanikop     elapsed_time += absl::Now() - start;
424*09537850SAkhilesh Sanikop   }
425*09537850SAkhilesh Sanikop   if (num_runs > 1) {
426*09537850SAkhilesh Sanikop     printf("Mode %s[%31s] size %d C: %5d us SIMD: %5d us %2.2fx\n", kIntraEdge,
427*09537850SAkhilesh Sanikop            kIntraEdgeUpsamplerName, size_,
428*09537850SAkhilesh Sanikop            static_cast<int>(absl::ToInt64Microseconds(base_elapsed_time)),
429*09537850SAkhilesh Sanikop            static_cast<int>(absl::ToInt64Microseconds(elapsed_time)),
430*09537850SAkhilesh Sanikop            absl::ToDoubleMicroseconds(base_elapsed_time) /
431*09537850SAkhilesh Sanikop                absl::ToDoubleMicroseconds(elapsed_time));
432*09537850SAkhilesh Sanikop   } else {
433*09537850SAkhilesh Sanikop     printf("Mode %s[%31s]: size %d \n", kIntraEdge, kIntraEdgeUpsamplerName,
434*09537850SAkhilesh Sanikop            size_);
435*09537850SAkhilesh Sanikop   }
436*09537850SAkhilesh Sanikop 
437*09537850SAkhilesh Sanikop   for (int i = 0; i < size_ * 2 + 1; ++i) {
438*09537850SAkhilesh Sanikop     EXPECT_EQ(buffer_[i], base_buffer_[i]) << "Mismatch in index: " << i;
439*09537850SAkhilesh Sanikop   }
440*09537850SAkhilesh Sanikop }
441*09537850SAkhilesh Sanikop 
442*09537850SAkhilesh Sanikop using IntraEdgeUpsamplerTest8bpp = IntraEdgeUpsamplerTest<8, uint8_t>;
443*09537850SAkhilesh Sanikop 
444*09537850SAkhilesh Sanikop constexpr int kIntraEdgeUpsampleSizes[] = {4, 8, 12, 16};
445*09537850SAkhilesh Sanikop 
GetIntraEdgeUpsampleDigest8bpp(int size)446*09537850SAkhilesh Sanikop const char* GetIntraEdgeUpsampleDigest8bpp(int size) {
447*09537850SAkhilesh Sanikop   switch (size) {
448*09537850SAkhilesh Sanikop     case 4:
449*09537850SAkhilesh Sanikop       return "aa9002e03f8d15eb26bbee76f40bb923";
450*09537850SAkhilesh Sanikop     case 8:
451*09537850SAkhilesh Sanikop       return "cacfca86d65eff0d951eb21fc15f242a";
452*09537850SAkhilesh Sanikop     case 12:
453*09537850SAkhilesh Sanikop       return "0529e00a1fa80bc866fa7662ad2d7b9f";
454*09537850SAkhilesh Sanikop     case 16:
455*09537850SAkhilesh Sanikop       return "03e3b3e0ea438ea48ef05651c0a54986";
456*09537850SAkhilesh Sanikop     default:
457*09537850SAkhilesh Sanikop       ADD_FAILURE() << "Unknown upsample size: " << size;
458*09537850SAkhilesh Sanikop       return "";
459*09537850SAkhilesh Sanikop   }
460*09537850SAkhilesh Sanikop }
461*09537850SAkhilesh Sanikop 
TEST_P(IntraEdgeUpsamplerTest8bpp,Correctness)462*09537850SAkhilesh Sanikop TEST_P(IntraEdgeUpsamplerTest8bpp, Correctness) {
463*09537850SAkhilesh Sanikop   TestFixedValues(GetIntraEdgeUpsampleDigest8bpp(size_));
464*09537850SAkhilesh Sanikop   TestRandomValues(1);
465*09537850SAkhilesh Sanikop }
466*09537850SAkhilesh Sanikop 
TEST_P(IntraEdgeUpsamplerTest8bpp,DISABLED_Speed)467*09537850SAkhilesh Sanikop TEST_P(IntraEdgeUpsamplerTest8bpp, DISABLED_Speed) { TestRandomValues(5e7); }
468*09537850SAkhilesh Sanikop 
469*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH >= 10
470*09537850SAkhilesh Sanikop using IntraEdgeUpsamplerTest10bpp = IntraEdgeUpsamplerTest<10, uint16_t>;
471*09537850SAkhilesh Sanikop 
GetIntraEdgeUpsampleDigest10bpp(int size)472*09537850SAkhilesh Sanikop const char* GetIntraEdgeUpsampleDigest10bpp(int size) {
473*09537850SAkhilesh Sanikop   switch (size) {
474*09537850SAkhilesh Sanikop     case 4:
475*09537850SAkhilesh Sanikop       return "341c6bb705a02bba65b34f92d8ca83cf";
476*09537850SAkhilesh Sanikop     case 8:
477*09537850SAkhilesh Sanikop       return "fdbe4b3b341921dcb0edf00dfc4d7667";
478*09537850SAkhilesh Sanikop     case 12:
479*09537850SAkhilesh Sanikop       return "ad69a491287495ec9973d4006d5ac461";
480*09537850SAkhilesh Sanikop     case 16:
481*09537850SAkhilesh Sanikop       return "04acf32e517d80ce4c4958e711b9b890";
482*09537850SAkhilesh Sanikop     default:
483*09537850SAkhilesh Sanikop       ADD_FAILURE() << "Unknown upsample size: " << size;
484*09537850SAkhilesh Sanikop       return "";
485*09537850SAkhilesh Sanikop   }
486*09537850SAkhilesh Sanikop }
487*09537850SAkhilesh Sanikop 
TEST_P(IntraEdgeUpsamplerTest10bpp,FixedInput)488*09537850SAkhilesh Sanikop TEST_P(IntraEdgeUpsamplerTest10bpp, FixedInput) {
489*09537850SAkhilesh Sanikop   TestFixedValues(GetIntraEdgeUpsampleDigest10bpp(size_));
490*09537850SAkhilesh Sanikop   TestRandomValues(1);
491*09537850SAkhilesh Sanikop }
492*09537850SAkhilesh Sanikop 
TEST_P(IntraEdgeUpsamplerTest10bpp,DISABLED_Speed)493*09537850SAkhilesh Sanikop TEST_P(IntraEdgeUpsamplerTest10bpp, DISABLED_Speed) { TestRandomValues(5e7); }
494*09537850SAkhilesh Sanikop #endif  // LIBGAV1_MAX_BITDEPTH >= 10
495*09537850SAkhilesh Sanikop 
496*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH == 12
497*09537850SAkhilesh Sanikop using IntraEdgeUpsamplerTest12bpp = IntraEdgeUpsamplerTest<12, uint16_t>;
498*09537850SAkhilesh Sanikop 
GetIntraEdgeUpsampleDigest12bpp(int size)499*09537850SAkhilesh Sanikop const char* GetIntraEdgeUpsampleDigest12bpp(int size) {
500*09537850SAkhilesh Sanikop   return GetIntraEdgeUpsampleDigest10bpp(size);
501*09537850SAkhilesh Sanikop }
502*09537850SAkhilesh Sanikop 
TEST_P(IntraEdgeUpsamplerTest12bpp,FixedInput)503*09537850SAkhilesh Sanikop TEST_P(IntraEdgeUpsamplerTest12bpp, FixedInput) {
504*09537850SAkhilesh Sanikop   TestFixedValues(GetIntraEdgeUpsampleDigest12bpp(size_));
505*09537850SAkhilesh Sanikop   TestRandomValues(1);
506*09537850SAkhilesh Sanikop }
507*09537850SAkhilesh Sanikop 
TEST_P(IntraEdgeUpsamplerTest12bpp,DISABLED_Speed)508*09537850SAkhilesh Sanikop TEST_P(IntraEdgeUpsamplerTest12bpp, DISABLED_Speed) { TestRandomValues(5e7); }
509*09537850SAkhilesh Sanikop #endif  // LIBGAV1_MAX_BITDEPTH == 12
510*09537850SAkhilesh Sanikop 
511*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(C, IntraEdgeFilterTest8bpp,
512*09537850SAkhilesh Sanikop                          testing::ValuesIn(kIntraEdgeFilterParamList));
513*09537850SAkhilesh Sanikop #if LIBGAV1_ENABLE_SSE4_1
514*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(SSE41, IntraEdgeFilterTest8bpp,
515*09537850SAkhilesh Sanikop                          testing::ValuesIn(kIntraEdgeFilterParamList));
516*09537850SAkhilesh Sanikop #endif
517*09537850SAkhilesh Sanikop #if LIBGAV1_ENABLE_NEON
518*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(NEON, IntraEdgeFilterTest8bpp,
519*09537850SAkhilesh Sanikop                          testing::ValuesIn(kIntraEdgeFilterParamList));
520*09537850SAkhilesh Sanikop #endif
521*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(C, IntraEdgeUpsamplerTest8bpp,
522*09537850SAkhilesh Sanikop                          testing::ValuesIn(kIntraEdgeUpsampleSizes));
523*09537850SAkhilesh Sanikop #if LIBGAV1_ENABLE_SSE4_1
524*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(SSE41, IntraEdgeUpsamplerTest8bpp,
525*09537850SAkhilesh Sanikop                          testing::ValuesIn(kIntraEdgeUpsampleSizes));
526*09537850SAkhilesh Sanikop #endif
527*09537850SAkhilesh Sanikop #if LIBGAV1_ENABLE_NEON
528*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(NEON, IntraEdgeUpsamplerTest8bpp,
529*09537850SAkhilesh Sanikop                          testing::ValuesIn(kIntraEdgeUpsampleSizes));
530*09537850SAkhilesh Sanikop #endif
531*09537850SAkhilesh Sanikop 
532*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH >= 10
533*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(C, IntraEdgeFilterTest10bpp,
534*09537850SAkhilesh Sanikop                          testing::ValuesIn(kIntraEdgeFilterParamList));
535*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(C, IntraEdgeUpsamplerTest10bpp,
536*09537850SAkhilesh Sanikop                          testing::ValuesIn(kIntraEdgeUpsampleSizes));
537*09537850SAkhilesh Sanikop 
538*09537850SAkhilesh Sanikop #if LIBGAV1_ENABLE_NEON
539*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(NEON, IntraEdgeFilterTest10bpp,
540*09537850SAkhilesh Sanikop                          testing::ValuesIn(kIntraEdgeFilterParamList));
541*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(NEON, IntraEdgeUpsamplerTest10bpp,
542*09537850SAkhilesh Sanikop                          testing::ValuesIn(kIntraEdgeUpsampleSizes));
543*09537850SAkhilesh Sanikop #endif
544*09537850SAkhilesh Sanikop 
545*09537850SAkhilesh Sanikop #endif  // LIBGAV1_MAX_BITDEPTH >= 10
546*09537850SAkhilesh Sanikop 
547*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH == 12
548*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(C, IntraEdgeFilterTest12bpp,
549*09537850SAkhilesh Sanikop                          testing::ValuesIn(kIntraEdgeFilterParamList));
550*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(C, IntraEdgeUpsamplerTest12bpp,
551*09537850SAkhilesh Sanikop                          testing::ValuesIn(kIntraEdgeUpsampleSizes));
552*09537850SAkhilesh Sanikop #endif  // LIBGAV1_MAX_BITDEPTH == 12
553*09537850SAkhilesh Sanikop 
554*09537850SAkhilesh Sanikop }  // namespace
555*09537850SAkhilesh Sanikop }  // namespace dsp
556*09537850SAkhilesh Sanikop }  // namespace libgav1
557