blob: 89727e9396f122baf36bdf895abd4be478ef88b3 [file] [log] [blame]
peah522d71b2017-02-23 05:16:26 -08001/*
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 Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_H_
12#define MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_H_
peah522d71b2017-02-23 05:16:26 -080013
14#include <array>
15
Per Åhgrene4db6a12018-07-26 15:32:24 +020016#include "api/array_view.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "modules/audio_processing/aec3/aec3_common.h"
18#include "modules/audio_processing/aec3/fft_data.h"
peah522d71b2017-02-23 05:16:26 -080019
20namespace webrtc {
21
22// Stores the values being returned from the echo subtractor.
23struct SubtractorOutput {
Per Åhgrene4db6a12018-07-26 15:32:24 +020024 SubtractorOutput();
25 ~SubtractorOutput();
26
peah29103572017-07-11 02:54:02 -070027 std::array<float, kBlockSize> s_main;
Per Åhgren78026752018-08-01 16:24:08 +020028 std::array<float, kBlockSize> s_shadow;
peah522d71b2017-02-23 05:16:26 -080029 std::array<float, kBlockSize> e_main;
30 std::array<float, kBlockSize> e_shadow;
31 FftData E_main;
peah522d71b2017-02-23 05:16:26 -080032 std::array<float, kFftLengthBy2Plus1> E2_main;
33 std::array<float, kFftLengthBy2Plus1> E2_shadow;
Per Åhgren78026752018-08-01 16:24:08 +020034 float s2_main = 0.f;
35 float s2_shadow = 0.f;
Per Åhgrene4db6a12018-07-26 15:32:24 +020036 float e2_main = 0.f;
37 float e2_shadow = 0.f;
38 float y2 = 0.f;
peah522d71b2017-02-23 05:16:26 -080039
Per Åhgrene4db6a12018-07-26 15:32:24 +020040 // Reset the struct content.
41 void Reset();
42
43 // Updates the powers of the signals.
44 void UpdatePowers(rtc::ArrayView<const float> y);
peah522d71b2017-02-23 05:16:26 -080045};
46
47} // namespace webrtc
48
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020049#endif // MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_H_