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