blob: d2d12082c6c0b93f7485d09a1eed606c1b7118cf [file] [log] [blame]
peah522d71b2017-02-23 13:16:261/*
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 04:47:3111#ifndef MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_H_
12#define MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_H_
peah522d71b2017-02-23 13:16:2613
14#include <array>
15
Per Åhgrene4db6a12018-07-26 13:32:2416#include "api/array_view.h"
Mirko Bonadei92ea95e2017-09-15 04:47:3117#include "modules/audio_processing/aec3/aec3_common.h"
18#include "modules/audio_processing/aec3/fft_data.h"
peah522d71b2017-02-23 13:16:2619
20namespace webrtc {
21
Sam Zackrisson8f736c02019-10-01 10:47:5322// Stores the values being returned from the echo subtractor for a single
23// capture channel.
peah522d71b2017-02-23 13:16:2624struct SubtractorOutput {
Per Åhgrene4db6a12018-07-26 13:32:2425 SubtractorOutput();
26 ~SubtractorOutput();
27
Per Åhgrenff045112020-03-20 10:20:3928 std::array<float, kBlockSize> s_refined;
Per Åhgren9d661982020-03-20 10:26:4829 std::array<float, kBlockSize> s_coarse;
Per Åhgrenff045112020-03-20 10:20:3930 std::array<float, kBlockSize> e_refined;
Per Åhgren9d661982020-03-20 10:26:4831 std::array<float, kBlockSize> e_coarse;
Per Åhgrenff045112020-03-20 10:20:3932 FftData E_refined;
33 std::array<float, kFftLengthBy2Plus1> E2_refined;
Per Åhgren9d661982020-03-20 10:26:4834 std::array<float, kFftLengthBy2Plus1> E2_coarse;
Per Åhgrenff045112020-03-20 10:20:3935 float s2_refined = 0.f;
Per Åhgren9d661982020-03-20 10:26:4836 float s2_coarse = 0.f;
Per Åhgrenff045112020-03-20 10:20:3937 float e2_refined = 0.f;
Per Åhgren9d661982020-03-20 10:26:4838 float e2_coarse = 0.f;
Per Åhgrene4db6a12018-07-26 13:32:2439 float y2 = 0.f;
Per Åhgrenff045112020-03-20 10:20:3940 float s_refined_max_abs = 0.f;
Per Åhgren9d661982020-03-20 10:26:4841 float s_coarse_max_abs = 0.f;
peah522d71b2017-02-23 13:16:2642
Per Åhgrene4db6a12018-07-26 13:32:2443 // Reset the struct content.
44 void Reset();
45
46 // Updates the powers of the signals.
Per Åhgren3e7b7b12018-10-16 12:38:1047 void ComputeMetrics(rtc::ArrayView<const float> y);
peah522d71b2017-02-23 13:16:2648};
49
50} // namespace webrtc
51
Mirko Bonadei92ea95e2017-09-15 04:47:3152#endif // MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_H_