#ifndef SPEKFFT_H
#define SPEKFFT_H
#include
#include
extern "C" {
#include
}
class FFTPlan;
class FFT
{
public:
FFT() {}
std::unique_ptr create(int nbits);
};
class FFTPlan
{
public:
FFTPlan(int nbits) :
input_size(1 << nbits), output_size((1 << (nbits - 1)) + 1),
output(output_size)
{
// FFmpeg uses various assembly optimizations which expect
// input data to be aligned by up to 32 bytes (e.g. AVX)
this->input = (float*) av_malloc(sizeof(float) * input_size);
}
virtual ~FFTPlan()
{
av_freep(&this->input);
}
int get_input_size() const { return this->input_size; }
int get_output_size() const { return thi