xref: /aosp_15_r20/external/libaom/test/fft_test.cc (revision 77c1e3ccc04c968bd2bc212e87364f250e820521)
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 <math.h>
13*77c1e3ccSAndroid Build Coastguard Worker 
14*77c1e3ccSAndroid Build Coastguard Worker #include <algorithm>
15*77c1e3ccSAndroid Build Coastguard Worker #include <complex>
16*77c1e3ccSAndroid Build Coastguard Worker #include <ostream>
17*77c1e3ccSAndroid Build Coastguard Worker #include <vector>
18*77c1e3ccSAndroid Build Coastguard Worker 
19*77c1e3ccSAndroid Build Coastguard Worker #include "aom_dsp/fft_common.h"
20*77c1e3ccSAndroid Build Coastguard Worker #include "aom_mem/aom_mem.h"
21*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/common.h"
22*77c1e3ccSAndroid Build Coastguard Worker #include "config/aom_dsp_rtcd.h"
23*77c1e3ccSAndroid Build Coastguard Worker #include "gtest/gtest.h"
24*77c1e3ccSAndroid Build Coastguard Worker #include "test/acm_random.h"
25*77c1e3ccSAndroid Build Coastguard Worker 
26*77c1e3ccSAndroid Build Coastguard Worker namespace {
27*77c1e3ccSAndroid Build Coastguard Worker 
28*77c1e3ccSAndroid Build Coastguard Worker typedef void (*tform_fun_t)(const float *input, float *temp, float *output);
29*77c1e3ccSAndroid Build Coastguard Worker 
30*77c1e3ccSAndroid Build Coastguard Worker // Simple 1D FFT implementation
31*77c1e3ccSAndroid Build Coastguard Worker template <typename InputType>
fft(const InputType * data,std::complex<float> * result,int n)32*77c1e3ccSAndroid Build Coastguard Worker void fft(const InputType *data, std::complex<float> *result, int n) {
33*77c1e3ccSAndroid Build Coastguard Worker   if (n == 1) {
34*77c1e3ccSAndroid Build Coastguard Worker     result[0] = data[0];
35*77c1e3ccSAndroid Build Coastguard Worker     return;
36*77c1e3ccSAndroid Build Coastguard Worker   }
37*77c1e3ccSAndroid Build Coastguard Worker   std::vector<InputType> temp(n);
38*77c1e3ccSAndroid Build Coastguard Worker   for (int k = 0; k < n / 2; ++k) {
39*77c1e3ccSAndroid Build Coastguard Worker     temp[k] = data[2 * k];
40*77c1e3ccSAndroid Build Coastguard Worker     temp[n / 2 + k] = data[2 * k + 1];
41*77c1e3ccSAndroid Build Coastguard Worker   }
42*77c1e3ccSAndroid Build Coastguard Worker   fft(&temp[0], result, n / 2);
43*77c1e3ccSAndroid Build Coastguard Worker   fft(&temp[n / 2], result + n / 2, n / 2);
44*77c1e3ccSAndroid Build Coastguard Worker   for (int k = 0; k < n / 2; ++k) {
45*77c1e3ccSAndroid Build Coastguard Worker     std::complex<float> w = std::complex<float>((float)cos(2. * PI * k / n),
46*77c1e3ccSAndroid Build Coastguard Worker                                                 (float)-sin(2. * PI * k / n));
47*77c1e3ccSAndroid Build Coastguard Worker     std::complex<float> a = result[k];
48*77c1e3ccSAndroid Build Coastguard Worker     std::complex<float> b = result[n / 2 + k];
49*77c1e3ccSAndroid Build Coastguard Worker     result[k] = a + w * b;
50*77c1e3ccSAndroid Build Coastguard Worker     result[n / 2 + k] = a - w * b;
51*77c1e3ccSAndroid Build Coastguard Worker   }
52*77c1e3ccSAndroid Build Coastguard Worker }
53*77c1e3ccSAndroid Build Coastguard Worker 
transpose(std::vector<std::complex<float>> * data,int n)54*77c1e3ccSAndroid Build Coastguard Worker void transpose(std::vector<std::complex<float> > *data, int n) {
55*77c1e3ccSAndroid Build Coastguard Worker   for (int y = 0; y < n; ++y) {
56*77c1e3ccSAndroid Build Coastguard Worker     for (int x = y + 1; x < n; ++x) {
57*77c1e3ccSAndroid Build Coastguard Worker       std::swap((*data)[y * n + x], (*data)[x * n + y]);
58*77c1e3ccSAndroid Build Coastguard Worker     }
59*77c1e3ccSAndroid Build Coastguard Worker   }
60*77c1e3ccSAndroid Build Coastguard Worker }
61*77c1e3ccSAndroid Build Coastguard Worker 
62*77c1e3ccSAndroid Build Coastguard Worker // Simple 2D FFT implementation
63*77c1e3ccSAndroid Build Coastguard Worker template <class InputType>
fft2d(const InputType * input,int n)64*77c1e3ccSAndroid Build Coastguard Worker std::vector<std::complex<float> > fft2d(const InputType *input, int n) {
65*77c1e3ccSAndroid Build Coastguard Worker   std::vector<std::complex<float> > rowfft(n * n);
66*77c1e3ccSAndroid Build Coastguard Worker   std::vector<std::complex<float> > result(n * n);
67*77c1e3ccSAndroid Build Coastguard Worker   for (int y = 0; y < n; ++y) {
68*77c1e3ccSAndroid Build Coastguard Worker     fft(input + y * n, &rowfft[y * n], n);
69*77c1e3ccSAndroid Build Coastguard Worker   }
70*77c1e3ccSAndroid Build Coastguard Worker   transpose(&rowfft, n);
71*77c1e3ccSAndroid Build Coastguard Worker   for (int y = 0; y < n; ++y) {
72*77c1e3ccSAndroid Build Coastguard Worker     fft(&rowfft[y * n], &result[y * n], n);
73*77c1e3ccSAndroid Build Coastguard Worker   }
74*77c1e3ccSAndroid Build Coastguard Worker   transpose(&result, n);
75*77c1e3ccSAndroid Build Coastguard Worker   return result;
76*77c1e3ccSAndroid Build Coastguard Worker }
77*77c1e3ccSAndroid Build Coastguard Worker 
78*77c1e3ccSAndroid Build Coastguard Worker struct FFTTestArg {
79*77c1e3ccSAndroid Build Coastguard Worker   int n;
80*77c1e3ccSAndroid Build Coastguard Worker   void (*fft)(const float *input, float *temp, float *output);
FFTTestArg__anone4177d4c0111::FFTTestArg81*77c1e3ccSAndroid Build Coastguard Worker   FFTTestArg(int n_in, tform_fun_t fft_in) : n(n_in), fft(fft_in) {}
82*77c1e3ccSAndroid Build Coastguard Worker };
83*77c1e3ccSAndroid Build Coastguard Worker 
operator <<(std::ostream & os,const FFTTestArg & test_arg)84*77c1e3ccSAndroid Build Coastguard Worker std::ostream &operator<<(std::ostream &os, const FFTTestArg &test_arg) {
85*77c1e3ccSAndroid Build Coastguard Worker   return os << "fft_arg { n:" << test_arg.n
86*77c1e3ccSAndroid Build Coastguard Worker             << " fft:" << reinterpret_cast<const void *>(test_arg.fft) << " }";
87*77c1e3ccSAndroid Build Coastguard Worker }
88*77c1e3ccSAndroid Build Coastguard Worker 
89*77c1e3ccSAndroid Build Coastguard Worker class FFT2DTest : public ::testing::TestWithParam<FFTTestArg> {
90*77c1e3ccSAndroid Build Coastguard Worker  protected:
SetUp()91*77c1e3ccSAndroid Build Coastguard Worker   void SetUp() override {
92*77c1e3ccSAndroid Build Coastguard Worker     int n = GetParam().n;
93*77c1e3ccSAndroid Build Coastguard Worker     input_ = (float *)aom_memalign(32, sizeof(*input_) * n * n);
94*77c1e3ccSAndroid Build Coastguard Worker     temp_ = (float *)aom_memalign(32, sizeof(*temp_) * n * n);
95*77c1e3ccSAndroid Build Coastguard Worker     output_ = (float *)aom_memalign(32, sizeof(*output_) * n * n * 2);
96*77c1e3ccSAndroid Build Coastguard Worker     ASSERT_NE(input_, nullptr);
97*77c1e3ccSAndroid Build Coastguard Worker     ASSERT_NE(temp_, nullptr);
98*77c1e3ccSAndroid Build Coastguard Worker     ASSERT_NE(output_, nullptr);
99*77c1e3ccSAndroid Build Coastguard Worker     memset(input_, 0, sizeof(*input_) * n * n);
100*77c1e3ccSAndroid Build Coastguard Worker     memset(temp_, 0, sizeof(*temp_) * n * n);
101*77c1e3ccSAndroid Build Coastguard Worker     memset(output_, 0, sizeof(*output_) * n * n * 2);
102*77c1e3ccSAndroid Build Coastguard Worker   }
TearDown()103*77c1e3ccSAndroid Build Coastguard Worker   void TearDown() override {
104*77c1e3ccSAndroid Build Coastguard Worker     aom_free(input_);
105*77c1e3ccSAndroid Build Coastguard Worker     aom_free(temp_);
106*77c1e3ccSAndroid Build Coastguard Worker     aom_free(output_);
107*77c1e3ccSAndroid Build Coastguard Worker   }
108*77c1e3ccSAndroid Build Coastguard Worker   float *input_;
109*77c1e3ccSAndroid Build Coastguard Worker   float *temp_;
110*77c1e3ccSAndroid Build Coastguard Worker   float *output_;
111*77c1e3ccSAndroid Build Coastguard Worker };
112*77c1e3ccSAndroid Build Coastguard Worker 
TEST_P(FFT2DTest,Correct)113*77c1e3ccSAndroid Build Coastguard Worker TEST_P(FFT2DTest, Correct) {
114*77c1e3ccSAndroid Build Coastguard Worker   int n = GetParam().n;
115*77c1e3ccSAndroid Build Coastguard Worker   for (int i = 0; i < n * n; ++i) {
116*77c1e3ccSAndroid Build Coastguard Worker     input_[i] = 1;
117*77c1e3ccSAndroid Build Coastguard Worker     std::vector<std::complex<float> > expected = fft2d<float>(&input_[0], n);
118*77c1e3ccSAndroid Build Coastguard Worker     GetParam().fft(&input_[0], &temp_[0], &output_[0]);
119*77c1e3ccSAndroid Build Coastguard Worker     for (int y = 0; y < n; ++y) {
120*77c1e3ccSAndroid Build Coastguard Worker       for (int x = 0; x < (n / 2) + 1; ++x) {
121*77c1e3ccSAndroid Build Coastguard Worker         EXPECT_NEAR(expected[y * n + x].real(), output_[2 * (y * n + x)], 1e-5);
122*77c1e3ccSAndroid Build Coastguard Worker         EXPECT_NEAR(expected[y * n + x].imag(), output_[2 * (y * n + x) + 1],
123*77c1e3ccSAndroid Build Coastguard Worker                     1e-5);
124*77c1e3ccSAndroid Build Coastguard Worker       }
125*77c1e3ccSAndroid Build Coastguard Worker     }
126*77c1e3ccSAndroid Build Coastguard Worker     input_[i] = 0;
127*77c1e3ccSAndroid Build Coastguard Worker   }
128*77c1e3ccSAndroid Build Coastguard Worker }
129*77c1e3ccSAndroid Build Coastguard Worker 
TEST_P(FFT2DTest,Benchmark)130*77c1e3ccSAndroid Build Coastguard Worker TEST_P(FFT2DTest, Benchmark) {
131*77c1e3ccSAndroid Build Coastguard Worker   int n = GetParam().n;
132*77c1e3ccSAndroid Build Coastguard Worker   float sum = 0;
133*77c1e3ccSAndroid Build Coastguard Worker   const int num_trials = 1000 * (64 - n);
134*77c1e3ccSAndroid Build Coastguard Worker   for (int i = 0; i < num_trials; ++i) {
135*77c1e3ccSAndroid Build Coastguard Worker     input_[i % (n * n)] = 1;
136*77c1e3ccSAndroid Build Coastguard Worker     GetParam().fft(&input_[0], &temp_[0], &output_[0]);
137*77c1e3ccSAndroid Build Coastguard Worker     sum += output_[0];
138*77c1e3ccSAndroid Build Coastguard Worker     input_[i % (n * n)] = 0;
139*77c1e3ccSAndroid Build Coastguard Worker   }
140*77c1e3ccSAndroid Build Coastguard Worker   EXPECT_NEAR(sum, num_trials, 1e-3);
141*77c1e3ccSAndroid Build Coastguard Worker }
142*77c1e3ccSAndroid Build Coastguard Worker 
143*77c1e3ccSAndroid Build Coastguard Worker INSTANTIATE_TEST_SUITE_P(C, FFT2DTest,
144*77c1e3ccSAndroid Build Coastguard Worker                          ::testing::Values(FFTTestArg(2, aom_fft2x2_float_c),
145*77c1e3ccSAndroid Build Coastguard Worker                                            FFTTestArg(4, aom_fft4x4_float_c),
146*77c1e3ccSAndroid Build Coastguard Worker                                            FFTTestArg(8, aom_fft8x8_float_c),
147*77c1e3ccSAndroid Build Coastguard Worker                                            FFTTestArg(16, aom_fft16x16_float_c),
148*77c1e3ccSAndroid Build Coastguard Worker                                            FFTTestArg(32,
149*77c1e3ccSAndroid Build Coastguard Worker                                                       aom_fft32x32_float_c)));
150*77c1e3ccSAndroid Build Coastguard Worker #if AOM_ARCH_X86 || AOM_ARCH_X86_64
151*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_SSE2
152*77c1e3ccSAndroid Build Coastguard Worker INSTANTIATE_TEST_SUITE_P(
153*77c1e3ccSAndroid Build Coastguard Worker     SSE2, FFT2DTest,
154*77c1e3ccSAndroid Build Coastguard Worker     ::testing::Values(FFTTestArg(4, aom_fft4x4_float_sse2),
155*77c1e3ccSAndroid Build Coastguard Worker                       FFTTestArg(8, aom_fft8x8_float_sse2),
156*77c1e3ccSAndroid Build Coastguard Worker                       FFTTestArg(16, aom_fft16x16_float_sse2),
157*77c1e3ccSAndroid Build Coastguard Worker                       FFTTestArg(32, aom_fft32x32_float_sse2)));
158*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_SSE2
159*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_AVX2
160*77c1e3ccSAndroid Build Coastguard Worker INSTANTIATE_TEST_SUITE_P(
161*77c1e3ccSAndroid Build Coastguard Worker     AVX2, FFT2DTest,
162*77c1e3ccSAndroid Build Coastguard Worker     ::testing::Values(FFTTestArg(8, aom_fft8x8_float_avx2),
163*77c1e3ccSAndroid Build Coastguard Worker                       FFTTestArg(16, aom_fft16x16_float_avx2),
164*77c1e3ccSAndroid Build Coastguard Worker                       FFTTestArg(32, aom_fft32x32_float_avx2)));
165*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_AVX2
166*77c1e3ccSAndroid Build Coastguard Worker #endif  // AOM_ARCH_X86 || AOM_ARCH_X86_64
167*77c1e3ccSAndroid Build Coastguard Worker 
168*77c1e3ccSAndroid Build Coastguard Worker struct IFFTTestArg {
169*77c1e3ccSAndroid Build Coastguard Worker   int n;
170*77c1e3ccSAndroid Build Coastguard Worker   tform_fun_t ifft;
IFFTTestArg__anone4177d4c0111::IFFTTestArg171*77c1e3ccSAndroid Build Coastguard Worker   IFFTTestArg(int n_in, tform_fun_t ifft_in) : n(n_in), ifft(ifft_in) {}
172*77c1e3ccSAndroid Build Coastguard Worker };
173*77c1e3ccSAndroid Build Coastguard Worker 
operator <<(std::ostream & os,const IFFTTestArg & test_arg)174*77c1e3ccSAndroid Build Coastguard Worker std::ostream &operator<<(std::ostream &os, const IFFTTestArg &test_arg) {
175*77c1e3ccSAndroid Build Coastguard Worker   return os << "ifft_arg { n:" << test_arg.n
176*77c1e3ccSAndroid Build Coastguard Worker             << " fft:" << reinterpret_cast<const void *>(test_arg.ifft) << " }";
177*77c1e3ccSAndroid Build Coastguard Worker }
178*77c1e3ccSAndroid Build Coastguard Worker 
179*77c1e3ccSAndroid Build Coastguard Worker class IFFT2DTest : public ::testing::TestWithParam<IFFTTestArg> {
180*77c1e3ccSAndroid Build Coastguard Worker  protected:
SetUp()181*77c1e3ccSAndroid Build Coastguard Worker   void SetUp() override {
182*77c1e3ccSAndroid Build Coastguard Worker     int n = GetParam().n;
183*77c1e3ccSAndroid Build Coastguard Worker     input_ = (float *)aom_memalign(32, sizeof(*input_) * n * n * 2);
184*77c1e3ccSAndroid Build Coastguard Worker     temp_ = (float *)aom_memalign(32, sizeof(*temp_) * n * n * 2);
185*77c1e3ccSAndroid Build Coastguard Worker     output_ = (float *)aom_memalign(32, sizeof(*output_) * n * n);
186*77c1e3ccSAndroid Build Coastguard Worker     ASSERT_NE(input_, nullptr);
187*77c1e3ccSAndroid Build Coastguard Worker     ASSERT_NE(temp_, nullptr);
188*77c1e3ccSAndroid Build Coastguard Worker     ASSERT_NE(output_, nullptr);
189*77c1e3ccSAndroid Build Coastguard Worker     memset(input_, 0, sizeof(*input_) * n * n * 2);
190*77c1e3ccSAndroid Build Coastguard Worker     memset(temp_, 0, sizeof(*temp_) * n * n * 2);
191*77c1e3ccSAndroid Build Coastguard Worker     memset(output_, 0, sizeof(*output_) * n * n);
192*77c1e3ccSAndroid Build Coastguard Worker   }
TearDown()193*77c1e3ccSAndroid Build Coastguard Worker   void TearDown() override {
194*77c1e3ccSAndroid Build Coastguard Worker     aom_free(input_);
195*77c1e3ccSAndroid Build Coastguard Worker     aom_free(temp_);
196*77c1e3ccSAndroid Build Coastguard Worker     aom_free(output_);
197*77c1e3ccSAndroid Build Coastguard Worker   }
198*77c1e3ccSAndroid Build Coastguard Worker   float *input_;
199*77c1e3ccSAndroid Build Coastguard Worker   float *temp_;
200*77c1e3ccSAndroid Build Coastguard Worker   float *output_;
201*77c1e3ccSAndroid Build Coastguard Worker };
202*77c1e3ccSAndroid Build Coastguard Worker 
TEST_P(IFFT2DTest,Correctness)203*77c1e3ccSAndroid Build Coastguard Worker TEST_P(IFFT2DTest, Correctness) {
204*77c1e3ccSAndroid Build Coastguard Worker   int n = GetParam().n;
205*77c1e3ccSAndroid Build Coastguard Worker   ASSERT_GE(n, 2);
206*77c1e3ccSAndroid Build Coastguard Worker   std::vector<float> expected(n * n);
207*77c1e3ccSAndroid Build Coastguard Worker   std::vector<float> actual(n * n);
208*77c1e3ccSAndroid Build Coastguard Worker   // Do forward transform then invert to make sure we get back expected
209*77c1e3ccSAndroid Build Coastguard Worker   for (int y = 0; y < n; ++y) {
210*77c1e3ccSAndroid Build Coastguard Worker     for (int x = 0; x < n; ++x) {
211*77c1e3ccSAndroid Build Coastguard Worker       expected[y * n + x] = 1;
212*77c1e3ccSAndroid Build Coastguard Worker       std::vector<std::complex<float> > input_c = fft2d(&expected[0], n);
213*77c1e3ccSAndroid Build Coastguard Worker       for (int i = 0; i < n * n; ++i) {
214*77c1e3ccSAndroid Build Coastguard Worker         input_[2 * i + 0] = input_c[i].real();
215*77c1e3ccSAndroid Build Coastguard Worker         input_[2 * i + 1] = input_c[i].imag();
216*77c1e3ccSAndroid Build Coastguard Worker       }
217*77c1e3ccSAndroid Build Coastguard Worker       GetParam().ifft(&input_[0], &temp_[0], &output_[0]);
218*77c1e3ccSAndroid Build Coastguard Worker 
219*77c1e3ccSAndroid Build Coastguard Worker       for (int yy = 0; yy < n; ++yy) {
220*77c1e3ccSAndroid Build Coastguard Worker         for (int xx = 0; xx < n; ++xx) {
221*77c1e3ccSAndroid Build Coastguard Worker           EXPECT_NEAR(expected[yy * n + xx], output_[yy * n + xx] / (n * n),
222*77c1e3ccSAndroid Build Coastguard Worker                       1e-5);
223*77c1e3ccSAndroid Build Coastguard Worker         }
224*77c1e3ccSAndroid Build Coastguard Worker       }
225*77c1e3ccSAndroid Build Coastguard Worker       expected[y * n + x] = 0;
226*77c1e3ccSAndroid Build Coastguard Worker     }
227*77c1e3ccSAndroid Build Coastguard Worker   }
228*77c1e3ccSAndroid Build Coastguard Worker }
229*77c1e3ccSAndroid Build Coastguard Worker 
TEST_P(IFFT2DTest,Benchmark)230*77c1e3ccSAndroid Build Coastguard Worker TEST_P(IFFT2DTest, Benchmark) {
231*77c1e3ccSAndroid Build Coastguard Worker   int n = GetParam().n;
232*77c1e3ccSAndroid Build Coastguard Worker   float sum = 0;
233*77c1e3ccSAndroid Build Coastguard Worker   const int num_trials = 1000 * (64 - n);
234*77c1e3ccSAndroid Build Coastguard Worker   for (int i = 0; i < num_trials; ++i) {
235*77c1e3ccSAndroid Build Coastguard Worker     input_[i % (n * n)] = 1;
236*77c1e3ccSAndroid Build Coastguard Worker     GetParam().ifft(&input_[0], &temp_[0], &output_[0]);
237*77c1e3ccSAndroid Build Coastguard Worker     sum += output_[0];
238*77c1e3ccSAndroid Build Coastguard Worker     input_[i % (n * n)] = 0;
239*77c1e3ccSAndroid Build Coastguard Worker   }
240*77c1e3ccSAndroid Build Coastguard Worker   EXPECT_GE(sum, num_trials / 2);
241*77c1e3ccSAndroid Build Coastguard Worker }
242*77c1e3ccSAndroid Build Coastguard Worker INSTANTIATE_TEST_SUITE_P(
243*77c1e3ccSAndroid Build Coastguard Worker     C, IFFT2DTest,
244*77c1e3ccSAndroid Build Coastguard Worker     ::testing::Values(IFFTTestArg(2, aom_ifft2x2_float_c),
245*77c1e3ccSAndroid Build Coastguard Worker                       IFFTTestArg(4, aom_ifft4x4_float_c),
246*77c1e3ccSAndroid Build Coastguard Worker                       IFFTTestArg(8, aom_ifft8x8_float_c),
247*77c1e3ccSAndroid Build Coastguard Worker                       IFFTTestArg(16, aom_ifft16x16_float_c),
248*77c1e3ccSAndroid Build Coastguard Worker                       IFFTTestArg(32, aom_ifft32x32_float_c)));
249*77c1e3ccSAndroid Build Coastguard Worker #if AOM_ARCH_X86 || AOM_ARCH_X86_64
250*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_SSE2
251*77c1e3ccSAndroid Build Coastguard Worker INSTANTIATE_TEST_SUITE_P(
252*77c1e3ccSAndroid Build Coastguard Worker     SSE2, IFFT2DTest,
253*77c1e3ccSAndroid Build Coastguard Worker     ::testing::Values(IFFTTestArg(4, aom_ifft4x4_float_sse2),
254*77c1e3ccSAndroid Build Coastguard Worker                       IFFTTestArg(8, aom_ifft8x8_float_sse2),
255*77c1e3ccSAndroid Build Coastguard Worker                       IFFTTestArg(16, aom_ifft16x16_float_sse2),
256*77c1e3ccSAndroid Build Coastguard Worker                       IFFTTestArg(32, aom_ifft32x32_float_sse2)));
257*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_SSE2
258*77c1e3ccSAndroid Build Coastguard Worker 
259*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_AVX2
260*77c1e3ccSAndroid Build Coastguard Worker INSTANTIATE_TEST_SUITE_P(
261*77c1e3ccSAndroid Build Coastguard Worker     AVX2, IFFT2DTest,
262*77c1e3ccSAndroid Build Coastguard Worker     ::testing::Values(IFFTTestArg(8, aom_ifft8x8_float_avx2),
263*77c1e3ccSAndroid Build Coastguard Worker                       IFFTTestArg(16, aom_ifft16x16_float_avx2),
264*77c1e3ccSAndroid Build Coastguard Worker                       IFFTTestArg(32, aom_ifft32x32_float_avx2)));
265*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_AVX2
266*77c1e3ccSAndroid Build Coastguard Worker #endif  // AOM_ARCH_X86 || AOM_ARCH_X86_64
267*77c1e3ccSAndroid Build Coastguard Worker 
268*77c1e3ccSAndroid Build Coastguard Worker }  // namespace
269