#include <math.h>
#include <algorithm>
#include <complex>
#include <ostream>
#include <vector>
#include "aom_dsp/fft_common.h"
#include "aom_mem/aom_mem.h"
#include "av1/common/common.h"
#include "config/aom_dsp_rtcd.h"
#include "gtest/gtest.h"
#include "test/acm_random.h"
namespace {
tform_fun_t;
template <typename InputType>
void fft(const InputType *data, std::complex<float> *result, int n) { … }
void transpose(std::vector<std::complex<float> > *data, int n) { … }
template <class InputType>
std::vector<std::complex<float> > fft2d(const InputType *input, int n) { … }
struct FFTTestArg { … };
std::ostream &operator<<(std::ostream &os, const FFTTestArg &test_arg) { … }
class FFT2DTest : public ::testing::TestWithParam<FFTTestArg> { … };
TEST_P(FFT2DTest, Correct) { … }
TEST_P(FFT2DTest, Benchmark) { … }
INSTANTIATE_TEST_SUITE_P(…);
#if AOM_ARCH_X86 || AOM_ARCH_X86_64
#if HAVE_SSE2
INSTANTIATE_TEST_SUITE_P(…);
#endif
#if HAVE_AVX2
INSTANTIATE_TEST_SUITE_P(…);
#endif
#endif
struct IFFTTestArg { … };
std::ostream &operator<<(std::ostream &os, const IFFTTestArg &test_arg) { … }
class IFFT2DTest : public ::testing::TestWithParam<IFFTTestArg> { … };
TEST_P(IFFT2DTest, Correctness) { … }
TEST_P(IFFT2DTest, Benchmark) { … }
INSTANTIATE_TEST_SUITE_P(…);
#if AOM_ARCH_X86 || AOM_ARCH_X86_64
#if HAVE_SSE2
INSTANTIATE_TEST_SUITE_P(…);
#endif
#if HAVE_AVX2
INSTANTIATE_TEST_SUITE_P(…);
#endif
#endif
}