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 |
11 #include "webrtc/modules/audio_processing/aec3/echo_remover_metrics.h" | 11 #include "webrtc/modules/audio_processing/aec3/echo_remover_metrics.h" |
12 | 12 |
13 #include <math.h> | 13 #include <math.h> |
14 #include <algorithm> | 14 #include <algorithm> |
15 #include <numeric> | 15 #include <numeric> |
16 | 16 |
17 #include "webrtc/rtc_base/safe_minmax.h" | 17 #include "webrtc/base/safe_minmax.h" |
18 #include "webrtc/system_wrappers/include/metrics.h" | 18 #include "webrtc/system_wrappers/include/metrics.h" |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 constexpr float kOneByMetricsCollectionBlocks = 1.f / kMetricsCollectionBlocks; | 24 constexpr float kOneByMetricsCollectionBlocks = 1.f / kMetricsCollectionBlocks; |
25 | 25 |
26 } // namespace | 26 } // namespace |
27 | 27 |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 float new_value = 10.f * log10(value * scaling + 1e-10f) + offset; | 273 float new_value = 10.f * log10(value * scaling + 1e-10f) + offset; |
274 if (negate) { | 274 if (negate) { |
275 new_value = -new_value; | 275 new_value = -new_value; |
276 } | 276 } |
277 return static_cast<int>(rtc::SafeClamp(new_value, min_value, max_value)); | 277 return static_cast<int>(rtc::SafeClamp(new_value, min_value, max_value)); |
278 } | 278 } |
279 | 279 |
280 } // namespace aec3 | 280 } // namespace aec3 |
281 | 281 |
282 } // namespace webrtc | 282 } // namespace webrtc |
OLD | NEW |