peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 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 MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_H_ |
| 12 | #define MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_H_ |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 13 | |
| 14 | #include <array> |
| 15 | |
Per Åhgren | e4db6a1 | 2018-07-26 15:32:24 +0200 | [diff] [blame^] | 16 | #include "api/array_view.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 17 | #include "modules/audio_processing/aec3/aec3_common.h" |
| 18 | #include "modules/audio_processing/aec3/fft_data.h" |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | |
| 22 | // Stores the values being returned from the echo subtractor. |
| 23 | struct SubtractorOutput { |
Per Åhgren | e4db6a1 | 2018-07-26 15:32:24 +0200 | [diff] [blame^] | 24 | SubtractorOutput(); |
| 25 | ~SubtractorOutput(); |
| 26 | |
peah | 2910357 | 2017-07-11 02:54:02 -0700 | [diff] [blame] | 27 | std::array<float, kBlockSize> s_main; |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 28 | std::array<float, kBlockSize> e_main; |
| 29 | std::array<float, kBlockSize> e_shadow; |
| 30 | FftData E_main; |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 31 | std::array<float, kFftLengthBy2Plus1> E2_main; |
| 32 | std::array<float, kFftLengthBy2Plus1> E2_shadow; |
Per Åhgren | e4db6a1 | 2018-07-26 15:32:24 +0200 | [diff] [blame^] | 33 | float e2_main = 0.f; |
| 34 | float e2_shadow = 0.f; |
| 35 | float y2 = 0.f; |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 36 | |
Per Åhgren | e4db6a1 | 2018-07-26 15:32:24 +0200 | [diff] [blame^] | 37 | // Reset the struct content. |
| 38 | void Reset(); |
| 39 | |
| 40 | // Updates the powers of the signals. |
| 41 | void UpdatePowers(rtc::ArrayView<const float> y); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | } // namespace webrtc |
| 45 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 46 | #endif // MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_H_ |