blob: 017e51826cdd2c6424ad3d5c2a99cd20ccb0745b [file] [log] [blame]
Gustaf Ullbergbffa3002018-02-14 15:12:00 +01001/*
2 * Copyright (c) 2018 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 API_AUDIO_ECHO_CANCELLER3_CONFIG_H_
12#define API_AUDIO_ECHO_CANCELLER3_CONFIG_H_
13
Gustaf Ullberg3646f972018-02-14 15:19:04 +010014#include <stddef.h> // size_t
15
Gustaf Ullbergbffa3002018-02-14 15:12:00 +010016namespace webrtc {
17
18// Configuration struct for EchoCanceller3
19struct EchoCanceller3Config {
20 struct Delay {
21 size_t default_delay = 5;
22 size_t down_sampling_factor = 4;
Per Ã…hgren75b57d32018-02-15 09:17:41 +010023 size_t num_filters = 5;
Gustaf Ullbergbffa3002018-02-14 15:12:00 +010024 size_t api_call_jitter_blocks = 26;
25 size_t min_echo_path_delay_blocks = 0;
26 size_t delay_headroom_blocks = 2;
27 size_t hysteresis_limit_1_blocks = 1;
28 size_t hysteresis_limit_2_blocks = 1;
29 } delay;
30
31 struct Filter {
32 struct MainConfiguration {
33 size_t length_blocks;
34 float leakage_converged;
35 float leakage_diverged;
36 float error_floor;
37 float noise_gate;
38 };
39
40 struct ShadowConfiguration {
41 size_t length_blocks;
42 float rate;
43 float noise_gate;
44 };
45
46 MainConfiguration main = {13, 0.005f, 0.1f, 0.001f, 20075344.f};
47 ShadowConfiguration shadow = {13, 0.7f, 20075344.f};
48
49 MainConfiguration main_initial = {12, 0.05f, 5.f, 0.001f, 20075344.f};
50 ShadowConfiguration shadow_initial = {12, 0.9f, 20075344.f};
51 } filter;
52
53 struct Erle {
54 float min = 1.f;
55 float max_l = 8.f;
56 float max_h = 1.5f;
57 } erle;
58
59 struct EpStrength {
60 float lf = 10.f;
61 float mf = 10.f;
62 float hf = 10.f;
63 float default_len = 0.f;
64 bool echo_can_saturate = true;
65 bool bounded_erl = false;
66 } ep_strength;
67
68 struct Mask {
69 float m1 = 0.01f;
70 float m2 = 0.0001f;
71 float m3 = 0.01f;
72 float m4 = 0.1f;
73 float m5 = 0.1f;
74 float m6 = 0.0001f;
75 float m7 = 0.01f;
76 float m8 = 0.0001f;
77 float m9 = 0.1f;
78 } gain_mask;
79
80 struct EchoAudibility {
81 float low_render_limit = 4 * 64.f;
82 float normal_render_limit = 64.f;
83 } echo_audibility;
84
85 struct RenderLevels {
86 float active_render_limit = 100.f;
87 float poor_excitation_render_limit = 150.f;
88 } render_levels;
89
90 struct GainUpdates {
91 struct GainChanges {
92 float max_inc;
93 float max_dec;
94 float rate_inc;
95 float rate_dec;
96 float min_inc;
97 float min_dec;
98 };
99
100 GainChanges low_noise = {2.f, 2.f, 1.4f, 1.4f, 1.1f, 1.1f};
101 GainChanges initial = {2.f, 2.f, 1.5f, 1.5f, 1.2f, 1.2f};
102 GainChanges normal = {2.f, 2.f, 1.5f, 1.5f, 1.2f, 1.2f};
103 GainChanges saturation = {1.2f, 1.2f, 1.5f, 1.5f, 1.f, 1.f};
104 GainChanges nonlinear = {1.5f, 1.5f, 1.2f, 1.2f, 1.1f, 1.1f};
105
106 float floor_first_increase = 0.00001f;
107 } gain_updates;
108};
109} // namespace webrtc
110
111#endif // API_AUDIO_ECHO_CANCELLER3_CONFIG_H_