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/common_audio/vad/vad_core.h" | 11 #include "webrtc/common_audio/vad/vad_core.h" |
12 | 12 |
13 #include "webrtc/base/sanitizer.h" | 13 #include "webrtc/rtc_base/sanitizer.h" |
14 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" | 14 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" |
15 #include "webrtc/common_audio/vad/vad_filterbank.h" | 15 #include "webrtc/common_audio/vad/vad_filterbank.h" |
16 #include "webrtc/common_audio/vad/vad_gmm.h" | 16 #include "webrtc/common_audio/vad/vad_gmm.h" |
17 #include "webrtc/common_audio/vad/vad_sp.h" | 17 #include "webrtc/common_audio/vad/vad_sp.h" |
18 #include "webrtc/typedefs.h" | 18 #include "webrtc/typedefs.h" |
19 | 19 |
20 // Spectrum Weighting | 20 // Spectrum Weighting |
21 static const int16_t kSpectrumWeight[kNumChannels] = { 6, 8, 10, 12, 14, 16 }; | 21 static const int16_t kSpectrumWeight[kNumChannels] = { 6, 8, 10, 12, 14, 16 }; |
22 static const int16_t kNoiseUpdateConst = 655; // Q15 | 22 static const int16_t kNoiseUpdateConst = 655; // Q15 |
23 static const int16_t kSpeechUpdateConst = 6554; // Q15 | 23 static const int16_t kSpeechUpdateConst = 6554; // Q15 |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 | 677 |
678 // Get power in the bands | 678 // Get power in the bands |
679 total_power = WebRtcVad_CalculateFeatures(inst, speech_frame, frame_length, | 679 total_power = WebRtcVad_CalculateFeatures(inst, speech_frame, frame_length, |
680 feature_vector); | 680 feature_vector); |
681 | 681 |
682 // Make a VAD | 682 // Make a VAD |
683 inst->vad = GmmProbability(inst, feature_vector, total_power, frame_length); | 683 inst->vad = GmmProbability(inst, feature_vector, total_power, frame_length); |
684 | 684 |
685 return inst->vad; | 685 return inst->vad; |
686 } | 686 } |
OLD | NEW |