chromium/third_party/libaom/source/libaom/test/fft_test.cc

/*
 * Copyright (c) 2018, Alliance for Open Media. All rights reserved.
 *
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed with this source code in the LICENSE file, you can
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 */

#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;

// Simple 1D FFT implementation
template <typename InputType>
void fft(const InputType *data, std::complex<float> *result, int n) {}

void transpose(std::vector<std::complex<float> > *data, int n) {}

// Simple 2D FFT implementation
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  // HAVE_SSE2
#if HAVE_AVX2
INSTANTIATE_TEST_SUITE_P();
#endif  // HAVE_AVX2
#endif  // AOM_ARCH_X86 || AOM_ARCH_X86_64

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  // HAVE_SSE2

#if HAVE_AVX2
INSTANTIATE_TEST_SUITE_P();
#endif  // HAVE_AVX2
#endif  // AOM_ARCH_X86 || AOM_ARCH_X86_64

}  // namespace