OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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/agc/loudness_histogram.h" | 11 #include "webrtc/modules/audio_processing/agc/loudness_histogram.h" |
12 | 12 |
13 #include <cmath> | 13 #include <cmath> |
14 #include <cstring> | 14 #include <cstring> |
15 | 15 |
| 16 #include "webrtc/base/checks.h" |
16 #include "webrtc/modules/include/module_common_types.h" | 17 #include "webrtc/modules/include/module_common_types.h" |
17 #include "webrtc/rtc_base/checks.h" | |
18 | 18 |
19 namespace webrtc { | 19 namespace webrtc { |
20 | 20 |
21 static const double kHistBinCenters[] = { | 21 static const double kHistBinCenters[] = { |
22 7.59621091765857e-02, 9.02036021061016e-02, 1.07115112009343e-01, | 22 7.59621091765857e-02, 9.02036021061016e-02, 1.07115112009343e-01, |
23 1.27197217770508e-01, 1.51044347572047e-01, 1.79362373905283e-01, | 23 1.27197217770508e-01, 1.51044347572047e-01, 1.79362373905283e-01, |
24 2.12989507320644e-01, 2.52921107370304e-01, 3.00339145144454e-01, | 24 2.12989507320644e-01, 2.52921107370304e-01, 3.00339145144454e-01, |
25 3.56647189489147e-01, 4.23511952494003e-01, 5.02912623991786e-01, | 25 3.56647189489147e-01, 4.23511952494003e-01, 5.02912623991786e-01, |
26 5.97199455365749e-01, 7.09163326739184e-01, 8.42118356728544e-01, | 26 5.97199455365749e-01, 7.09163326739184e-01, 8.42118356728544e-01, |
27 1.00000000000000e+00, 1.18748153630660e+00, 1.41011239906908e+00, | 27 1.00000000000000e+00, 1.18748153630660e+00, 1.41011239906908e+00, |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 p = static_cast<double>(bin_count_q10_[n]) * p_total_inverse; | 220 p = static_cast<double>(bin_count_q10_[n]) * p_total_inverse; |
221 mean_val += p * kHistBinCenters[n]; | 221 mean_val += p * kHistBinCenters[n]; |
222 } | 222 } |
223 } else { | 223 } else { |
224 mean_val = kHistBinCenters[0]; | 224 mean_val = kHistBinCenters[0]; |
225 } | 225 } |
226 return mean_val; | 226 return mean_val; |
227 } | 227 } |
228 | 228 |
229 } // namespace webrtc | 229 } // namespace webrtc |
OLD | NEW |