blob: f885a34f58c2aa8e97e1963c8f195bab0eade270 [file] [log] [blame]
andrew@webrtc.org04c50982015-03-19 20:06:29 +00001/*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef COMMON_AUDIO_REAL_FOURIER_OOURA_H_
12#define COMMON_AUDIO_REAL_FOURIER_OOURA_H_
andrew@webrtc.org04c50982015-03-19 20:06:29 +000013
14#include <complex>
kwibergc2b785d2016-02-24 05:22:32 -080015#include <memory>
andrew@webrtc.org04c50982015-03-19 20:06:29 +000016
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "common_audio/real_fourier.h"
andrew@webrtc.org04c50982015-03-19 20:06:29 +000018
19namespace webrtc {
20
21class RealFourierOoura : public RealFourier {
22 public:
23 explicit RealFourierOoura(int fft_order);
24
25 void Forward(const float* src, std::complex<float>* dest) const override;
26 void Inverse(const std::complex<float>* src, float* dest) const override;
27
28 int order() const override {
29 return order_;
30 }
31
32 private:
33 const int order_;
Peter Kastingdce40cf2015-08-24 14:52:23 -070034 const size_t length_;
35 const size_t complex_length_;
andrew@webrtc.org04c50982015-03-19 20:06:29 +000036 // These are work arrays for Ooura. The names are based on the comments in
37 // fft4g.c.
kwibergc2b785d2016-02-24 05:22:32 -080038 const std::unique_ptr<size_t[]> work_ip_;
39 const std::unique_ptr<float[]> work_w_;
andrew@webrtc.org04c50982015-03-19 20:06:29 +000040};
41
42} // namespace webrtc
43
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020044#endif // COMMON_AUDIO_REAL_FOURIER_OOURA_H_
andrew@webrtc.org04c50982015-03-19 20:06:29 +000045