andrew@webrtc.org | 04c5098 | 2015-03-19 20:06:29 +0000 | [diff] [blame] | 1 | /* |
| 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 Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef COMMON_AUDIO_REAL_FOURIER_OOURA_H_ |
| 12 | #define COMMON_AUDIO_REAL_FOURIER_OOURA_H_ |
andrew@webrtc.org | 04c5098 | 2015-03-19 20:06:29 +0000 | [diff] [blame] | 13 | |
Yves Gerey | 988cc08 | 2018-10-23 12:03:01 +0200 | [diff] [blame] | 14 | #include <stddef.h> |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 15 | |
andrew@webrtc.org | 04c5098 | 2015-03-19 20:06:29 +0000 | [diff] [blame] | 16 | #include <complex> |
kwiberg | c2b785d | 2016-02-24 05:22:32 -0800 | [diff] [blame] | 17 | #include <memory> |
andrew@webrtc.org | 04c5098 | 2015-03-19 20:06:29 +0000 | [diff] [blame] | 18 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 19 | #include "common_audio/real_fourier.h" |
andrew@webrtc.org | 04c5098 | 2015-03-19 20:06:29 +0000 | [diff] [blame] | 20 | |
| 21 | namespace webrtc { |
| 22 | |
| 23 | class RealFourierOoura : public RealFourier { |
| 24 | public: |
| 25 | explicit RealFourierOoura(int fft_order); |
Alex Loiko | 0520b0e | 2018-05-08 13:11:12 +0200 | [diff] [blame] | 26 | ~RealFourierOoura() override; |
andrew@webrtc.org | 04c5098 | 2015-03-19 20:06:29 +0000 | [diff] [blame] | 27 | |
| 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 Loiko | 0520b0e | 2018-05-08 13:11:12 +0200 | [diff] [blame] | 31 | int order() const override; |
andrew@webrtc.org | 04c5098 | 2015-03-19 20:06:29 +0000 | [diff] [blame] | 32 | |
| 33 | private: |
| 34 | const int order_; |
Peter Kasting | dce40cf | 2015-08-24 14:52:23 -0700 | [diff] [blame] | 35 | const size_t length_; |
| 36 | const size_t complex_length_; |
andrew@webrtc.org | 04c5098 | 2015-03-19 20:06:29 +0000 | [diff] [blame] | 37 | // These are work arrays for Ooura. The names are based on the comments in |
| 38 | // fft4g.c. |
kwiberg | c2b785d | 2016-02-24 05:22:32 -0800 | [diff] [blame] | 39 | const std::unique_ptr<size_t[]> work_ip_; |
| 40 | const std::unique_ptr<float[]> work_w_; |
andrew@webrtc.org | 04c5098 | 2015-03-19 20:06:29 +0000 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | } // namespace webrtc |
| 44 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 45 | #endif // COMMON_AUDIO_REAL_FOURIER_OOURA_H_ |