| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 const std::array<float, kBlockSize>& s, | 122 const std::array<float, kBlockSize>& s, |
| 123 bool echo_leakage_detected) { | 123 bool echo_leakage_detected) { |
| 124 // Update the echo audibility evaluator. | 124 // Update the echo audibility evaluator. |
| 125 echo_audibility_.Update(x, s); | 125 echo_audibility_.Update(x, s); |
| 126 | 126 |
| 127 // Store input parameters. | 127 // Store input parameters. |
| 128 echo_leakage_detected_ = echo_leakage_detected; | 128 echo_leakage_detected_ = echo_leakage_detected; |
| 129 | 129 |
| 130 // Update counters. | 130 // Update counters. |
| 131 const float x_energy = std::inner_product(x.begin(), x.end(), x.begin(), 0.f); | 131 const float x_energy = std::inner_product(x.begin(), x.end(), x.begin(), 0.f); |
| 132 const bool active_render_block = x_energy > 10000.f * kFftLengthBy2; | 132 |
| 133 const bool active_render_block = |
| 134 x_energy > (config_.param.render_levels.active_render_limit * |
| 135 config_.param.render_levels.active_render_limit) * |
| 136 kFftLengthBy2; |
| 133 if (active_render_block) { | 137 if (active_render_block) { |
| 134 render_received_ = true; | 138 render_received_ = true; |
| 135 } | 139 } |
| 136 blocks_with_filter_adaptation_ += | 140 blocks_with_filter_adaptation_ += |
| 137 (active_render_block && (!SaturatedCapture()) ? 1 : 0); | 141 (active_render_block && (!SaturatedCapture()) ? 1 : 0); |
| 138 --echo_path_change_counter_; | 142 --echo_path_change_counter_; |
| 139 | 143 |
| 140 // Force zero echo suppression gain after an echo path change to allow at | 144 // Force zero echo suppression gain after an echo path change to allow at |
| 141 // least some render data to be collected in order to avoid an initial echo | 145 // least some render data to be collected in order to avoid an initial echo |
| 142 // burst. | 146 // burst. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 max_nearend_ = e_abs; | 309 max_nearend_ = e_abs; |
| 306 max_nearend_counter_ = 0; | 310 max_nearend_counter_ = 0; |
| 307 } else { | 311 } else { |
| 308 if (++max_nearend_counter_ > 5 * kNumBlocksPerSecond) { | 312 if (++max_nearend_counter_ > 5 * kNumBlocksPerSecond) { |
| 309 max_nearend_ *= 0.995f; | 313 max_nearend_ *= 0.995f; |
| 310 } | 314 } |
| 311 } | 315 } |
| 312 } | 316 } |
| 313 | 317 |
| 314 } // namespace webrtc | 318 } // namespace webrtc |
| OLD | NEW |