Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: webrtc/common_audio/vad/vad_core.h

Issue 2683033004: Enable cpplint and fix cpplint errors in webrtc/*audio (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 11
12 /* 12 /*
13 * This header file includes the descriptions of the core VAD calls. 13 * This header file includes the descriptions of the core VAD calls.
14 */ 14 */
15 15
16 #ifndef WEBRTC_COMMON_AUDIO_VAD_VAD_CORE_H_ 16 #ifndef WEBRTC_COMMON_AUDIO_VAD_VAD_CORE_H_
17 #define WEBRTC_COMMON_AUDIO_VAD_VAD_CORE_H_ 17 #define WEBRTC_COMMON_AUDIO_VAD_VAD_CORE_H_
18 18
19 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar y.h" 19 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar y.h"
20 #include "webrtc/typedefs.h" 20 #include "webrtc/typedefs.h"
21 21
22 enum { kNumChannels = 6 }; // Number of frequency bands (named channels). 22 enum { kNumChannels = 6 }; // Number of frequency bands (named channels).
23 enum { kNumGaussians = 2 }; // Number of Gaussians per channel in the GMM. 23 enum { kNumGaussians = 2 }; // Number of Gaussians per channel in the GMM.
24 enum { kTableSize = kNumChannels * kNumGaussians }; 24 enum { kTableSize = kNumChannels * kNumGaussians };
25 enum { kMinEnergy = 10 }; // Minimum energy required to trigger audio signal. 25 enum { kMinEnergy = 10 }; // Minimum energy required to trigger audio signal.
26 26
27 typedef struct VadInstT_ 27 typedef struct VadInstT_ {
28 {
29
30 int vad; 28 int vad;
31 int32_t downsampling_filter_states[4]; 29 int32_t downsampling_filter_states[4];
32 WebRtcSpl_State48khzTo8khz state_48_to_8; 30 WebRtcSpl_State48khzTo8khz state_48_to_8;
33 int16_t noise_means[kTableSize]; 31 int16_t noise_means[kTableSize];
34 int16_t speech_means[kTableSize]; 32 int16_t speech_means[kTableSize];
35 int16_t noise_stds[kTableSize]; 33 int16_t noise_stds[kTableSize];
36 int16_t speech_stds[kTableSize]; 34 int16_t speech_stds[kTableSize];
37 // TODO(bjornv): Change to |frame_count|. 35 // TODO(bjornv): Change to |frame_count|.
38 int32_t frame_counter; 36 int32_t frame_counter;
39 int16_t over_hang; // Over Hang 37 int16_t over_hang; // Over Hang
40 int16_t num_of_speech; 38 int16_t num_of_speech;
41 // TODO(bjornv): Change to |age_vector|. 39 // TODO(bjornv): Change to |age_vector|.
42 int16_t index_vector[16 * kNumChannels]; 40 int16_t index_vector[16 * kNumChannels];
43 int16_t low_value_vector[16 * kNumChannels]; 41 int16_t low_value_vector[16 * kNumChannels];
44 // TODO(bjornv): Change to |median|. 42 // TODO(bjornv): Change to |median|.
45 int16_t mean_value[kNumChannels]; 43 int16_t mean_value[kNumChannels];
46 int16_t upper_state[5]; 44 int16_t upper_state[5];
47 int16_t lower_state[5]; 45 int16_t lower_state[5];
48 int16_t hp_filter_state[4]; 46 int16_t hp_filter_state[4];
49 int16_t over_hang_max_1[3]; 47 int16_t over_hang_max_1[3];
50 int16_t over_hang_max_2[3]; 48 int16_t over_hang_max_2[3];
51 int16_t individual[3]; 49 int16_t individual[3];
52 int16_t total[3]; 50 int16_t total[3];
53 51
54 int init_flag; 52 int init_flag;
55
56 } VadInstT; 53 } VadInstT;
57 54
58 // Initializes the core VAD component. The default aggressiveness mode is 55 // Initializes the core VAD component. The default aggressiveness mode is
59 // controlled by |kDefaultMode| in vad_core.c. 56 // controlled by |kDefaultMode| in vad_core.c.
60 // 57 //
61 // - self [i/o] : Instance that should be initialized 58 // - self [i/o] : Instance that should be initialized
62 // 59 //
63 // returns : 0 (OK), -1 (null pointer in or if the default mode can't be 60 // returns : 0 (OK), -1 (null pointer in or if the default mode can't be
64 // set) 61 // set)
65 int WebRtcVad_InitCore(VadInstT* self); 62 int WebRtcVad_InitCore(VadInstT* self);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 int WebRtcVad_CalcVad48khz(VadInstT* inst, const int16_t* speech_frame, 103 int WebRtcVad_CalcVad48khz(VadInstT* inst, const int16_t* speech_frame,
107 size_t frame_length); 104 size_t frame_length);
108 int WebRtcVad_CalcVad32khz(VadInstT* inst, const int16_t* speech_frame, 105 int WebRtcVad_CalcVad32khz(VadInstT* inst, const int16_t* speech_frame,
109 size_t frame_length); 106 size_t frame_length);
110 int WebRtcVad_CalcVad16khz(VadInstT* inst, const int16_t* speech_frame, 107 int WebRtcVad_CalcVad16khz(VadInstT* inst, const int16_t* speech_frame,
111 size_t frame_length); 108 size_t frame_length);
112 int WebRtcVad_CalcVad8khz(VadInstT* inst, const int16_t* speech_frame, 109 int WebRtcVad_CalcVad8khz(VadInstT* inst, const int16_t* speech_frame,
113 size_t frame_length); 110 size_t frame_length);
114 111
115 #endif // WEBRTC_COMMON_AUDIO_VAD_VAD_CORE_H_ 112 #endif // WEBRTC_COMMON_AUDIO_VAD_VAD_CORE_H_
OLDNEW
« no previous file with comments | « webrtc/common_audio/signal_processing/signal_processing_unittest.cc ('k') | webrtc/common_audio/vad/vad_core_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698