blob: e4ad3fc71476d4d978115681d4e76dbf0e90a8c1 [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
11#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_GAIN_H_
12#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_GAIN_H_
13
14#include <array>
peah86afe9d2017-04-06 15:45:32 -070015#include <vector>
peah522d71b2017-02-23 05:16:26 -080016
17#include "webrtc/base/constructormagic.h"
18#include "webrtc/modules/audio_processing/aec3/aec3_common.h"
peah522d71b2017-02-23 05:16:26 -080019
20namespace webrtc {
peah522d71b2017-02-23 05:16:26 -080021
22class SuppressionGain {
23 public:
24 explicit SuppressionGain(Aec3Optimization optimization);
25 void GetGain(const std::array<float, kFftLengthBy2Plus1>& nearend_power,
26 const std::array<float, kFftLengthBy2Plus1>& residual_echo_power,
27 const std::array<float, kFftLengthBy2Plus1>& comfort_noise_power,
peah86afe9d2017-04-06 15:45:32 -070028 bool saturated_echo,
29 const std::vector<std::vector<float>>& render,
30 size_t num_capture_bands,
peah6d822ad2017-04-10 13:52:14 -070031 bool force_zero_gain,
peah86afe9d2017-04-06 15:45:32 -070032 float* high_bands_gain,
33 std::array<float, kFftLengthBy2Plus1>* low_band_gain);
peah522d71b2017-02-23 05:16:26 -080034
35 private:
36 const Aec3Optimization optimization_;
37 std::array<float, kFftLengthBy2 - 1> previous_gain_squared_;
38 std::array<float, kFftLengthBy2 - 1> previous_masker_;
39 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SuppressionGain);
40};
41
42} // namespace webrtc
43
44#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_GAIN_H_