blob: ae85dfd0dd6cc2f5bb2af59789da5328fcc349f3 [file] [log] [blame]
andrew@webrtc.org04c50982015-03-19 20:06:291/*
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 04:47:3111#ifndef COMMON_AUDIO_REAL_FOURIER_OOURA_H_
12#define COMMON_AUDIO_REAL_FOURIER_OOURA_H_
andrew@webrtc.org04c50982015-03-19 20:06:2913
Yves Gerey988cc082018-10-23 10:03:0114#include <stddef.h>
Jonas Olssona4d87372019-07-05 17:08:3315
andrew@webrtc.org04c50982015-03-19 20:06:2916#include <complex>
kwibergc2b785d2016-02-24 13:22:3217#include <memory>
andrew@webrtc.org04c50982015-03-19 20:06:2918
Mirko Bonadei92ea95e2017-09-15 04:47:3119#include "common_audio/real_fourier.h"
andrew@webrtc.org04c50982015-03-19 20:06:2920
21namespace webrtc {
22
23class RealFourierOoura : public RealFourier {
24 public:
25 explicit RealFourierOoura(int fft_order);
Alex Loiko0520b0e2018-05-08 11:11:1226 ~RealFourierOoura() override;
andrew@webrtc.org04c50982015-03-19 20:06:2927
28 void Forward(const float* src, std::complex<float>* dest) const override;
29 void Inverse(const std::complex<float>* src, float* dest) const override;
30
Alex Loiko0520b0e2018-05-08 11:11:1231 int order() const override;
andrew@webrtc.org04c50982015-03-19 20:06:2932
33 private:
34 const int order_;
Peter Kastingdce40cf2015-08-24 21:52:2335 const size_t length_;
36 const size_t complex_length_;
andrew@webrtc.org04c50982015-03-19 20:06:2937 // These are work arrays for Ooura. The names are based on the comments in
Mirko Bonadeif0d64a52020-04-17 10:25:1938 // common_audio/third_party/ooura/fft_size_256/fft4g.cc.
kwibergc2b785d2016-02-24 13:22:3239 const std::unique_ptr<size_t[]> work_ip_;
40 const std::unique_ptr<float[]> work_w_;
andrew@webrtc.org04c50982015-03-19 20:06:2941};
42
43} // namespace webrtc
44
Mirko Bonadei92ea95e2017-09-15 04:47:3145#endif // COMMON_AUDIO_REAL_FOURIER_OOURA_H_