| 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/vad/pitch_based_vad.h" | 11 #include "webrtc/modules/audio_processing/vad/pitch_based_vad.h" |
| 12 | 12 |
| 13 #include <assert.h> | |
| 14 #include <math.h> | 13 #include <math.h> |
| 15 #include <string.h> | 14 #include <string.h> |
| 16 | 15 |
| 17 #include "webrtc/modules/audio_processing/vad/vad_circular_buffer.h" | 16 #include "webrtc/modules/audio_processing/vad/vad_circular_buffer.h" |
| 18 #include "webrtc/modules/audio_processing/vad/common.h" | 17 #include "webrtc/modules/audio_processing/vad/common.h" |
| 19 #include "webrtc/modules/audio_processing/vad/noise_gmm_tables.h" | 18 #include "webrtc/modules/audio_processing/vad/noise_gmm_tables.h" |
| 20 #include "webrtc/modules/audio_processing/vad/voice_gmm_tables.h" | 19 #include "webrtc/modules/audio_processing/vad/voice_gmm_tables.h" |
| 21 #include "webrtc/modules/include/module_common_types.h" | 20 #include "webrtc/modules/include/module_common_types.h" |
| 22 | 21 |
| 23 namespace webrtc { | 22 namespace webrtc { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 int PitchBasedVad::UpdatePrior(double p) { | 114 int PitchBasedVad::UpdatePrior(double p) { |
| 116 circular_buffer_->Insert(p); | 115 circular_buffer_->Insert(p); |
| 117 if (circular_buffer_->RemoveTransient(kTransientWidthThreshold, | 116 if (circular_buffer_->RemoveTransient(kTransientWidthThreshold, |
| 118 kLowProbabilityThreshold) < 0) | 117 kLowProbabilityThreshold) < 0) |
| 119 return -1; | 118 return -1; |
| 120 p_prior_ = circular_buffer_->Mean(); | 119 p_prior_ = circular_buffer_->Mean(); |
| 121 return 0; | 120 return 0; |
| 122 } | 121 } |
| 123 | 122 |
| 124 } // namespace webrtc | 123 } // namespace webrtc |
| OLD | NEW |