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