peah | 522d71b | 2017-02-23 13:16:26 | [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 04:47:31 | [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 13:16:26 | [diff] [blame] | 13 | |
| 14 | #include <array> |
| 15 | |
Per Åhgren | e4db6a1 | 2018-07-26 13:32:24 | [diff] [blame] | 16 | #include "api/array_view.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [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 13:16:26 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | |
Sam Zackrisson | 8f736c0 | 2019-10-01 10:47:53 | [diff] [blame] | 22 | // Stores the values being returned from the echo subtractor for a single |
| 23 | // capture channel. |
peah | 522d71b | 2017-02-23 13:16:26 | [diff] [blame] | 24 | struct SubtractorOutput { |
Per Åhgren | e4db6a1 | 2018-07-26 13:32:24 | [diff] [blame] | 25 | SubtractorOutput(); |
| 26 | ~SubtractorOutput(); |
| 27 | |
Per Åhgren | ff04511 | 2020-03-20 10:20:39 | [diff] [blame] | 28 | std::array<float, kBlockSize> s_refined; |
Per Åhgren | 9d66198 | 2020-03-20 10:26:48 | [diff] [blame] | 29 | std::array<float, kBlockSize> s_coarse; |
Per Åhgren | ff04511 | 2020-03-20 10:20:39 | [diff] [blame] | 30 | std::array<float, kBlockSize> e_refined; |
Per Åhgren | 9d66198 | 2020-03-20 10:26:48 | [diff] [blame] | 31 | std::array<float, kBlockSize> e_coarse; |
Per Åhgren | ff04511 | 2020-03-20 10:20:39 | [diff] [blame] | 32 | FftData E_refined; |
| 33 | std::array<float, kFftLengthBy2Plus1> E2_refined; |
Per Åhgren | 9d66198 | 2020-03-20 10:26:48 | [diff] [blame] | 34 | std::array<float, kFftLengthBy2Plus1> E2_coarse; |
Per Åhgren | ff04511 | 2020-03-20 10:20:39 | [diff] [blame] | 35 | float s2_refined = 0.f; |
Per Åhgren | 9d66198 | 2020-03-20 10:26:48 | [diff] [blame] | 36 | float s2_coarse = 0.f; |
Per Åhgren | ff04511 | 2020-03-20 10:20:39 | [diff] [blame] | 37 | float e2_refined = 0.f; |
Per Åhgren | 9d66198 | 2020-03-20 10:26:48 | [diff] [blame] | 38 | float e2_coarse = 0.f; |
Per Åhgren | e4db6a1 | 2018-07-26 13:32:24 | [diff] [blame] | 39 | float y2 = 0.f; |
Per Åhgren | ff04511 | 2020-03-20 10:20:39 | [diff] [blame] | 40 | float s_refined_max_abs = 0.f; |
Per Åhgren | 9d66198 | 2020-03-20 10:26:48 | [diff] [blame] | 41 | float s_coarse_max_abs = 0.f; |
peah | 522d71b | 2017-02-23 13:16:26 | [diff] [blame] | 42 | |
Per Åhgren | e4db6a1 | 2018-07-26 13:32:24 | [diff] [blame] | 43 | // Reset the struct content. |
| 44 | void Reset(); |
| 45 | |
| 46 | // Updates the powers of the signals. |
Per Åhgren | 3e7b7b1 | 2018-10-16 12:38:10 | [diff] [blame] | 47 | void ComputeMetrics(rtc::ArrayView<const float> y); |
peah | 522d71b | 2017-02-23 13:16:26 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | } // namespace webrtc |
| 51 | |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 52 | #endif // MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_H_ |