• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 
12 /*
13  * This header file includes the macros used in VAD.
14  */
15 
16 #ifndef WEBRTC_VAD_DEFINES_H_
17 #define WEBRTC_VAD_DEFINES_H_
18 
19 #define NUM_CHANNELS        6   // Eight frequency bands
20 #define NUM_MODELS          2   // Number of Gaussian models
21 #define NUM_TABLE_VALUES    NUM_CHANNELS * NUM_MODELS
22 
23 #define MIN_ENERGY          10
24 #define ALPHA1              6553    // 0.2 in Q15
25 #define ALPHA2              32439   // 0.99 in Q15
26 #define NSP_MAX             6       // Maximum number of VAD=1 frames in a row counted
27 #define MIN_STD             384     // Minimum standard deviation
28 // Mode 0, Quality thresholds - Different thresholds for the different frame lengths
29 #define INDIVIDUAL_10MS_Q   24
30 #define INDIVIDUAL_20MS_Q   21      // (log10(2)*66)<<2 ~=16
31 #define INDIVIDUAL_30MS_Q   24
32 
33 #define TOTAL_10MS_Q        57
34 #define TOTAL_20MS_Q        48
35 #define TOTAL_30MS_Q        57
36 
37 #define OHMAX1_10MS_Q       8  // Max Overhang 1
38 #define OHMAX2_10MS_Q       14 // Max Overhang 2
39 #define OHMAX1_20MS_Q       4  // Max Overhang 1
40 #define OHMAX2_20MS_Q       7  // Max Overhang 2
41 #define OHMAX1_30MS_Q       3
42 #define OHMAX2_30MS_Q       5
43 
44 // Mode 1, Low bitrate thresholds - Different thresholds for the different frame lengths
45 #define INDIVIDUAL_10MS_LBR 37
46 #define INDIVIDUAL_20MS_LBR 32
47 #define INDIVIDUAL_30MS_LBR 37
48 
49 #define TOTAL_10MS_LBR      100
50 #define TOTAL_20MS_LBR      80
51 #define TOTAL_30MS_LBR      100
52 
53 #define OHMAX1_10MS_LBR     8  // Max Overhang 1
54 #define OHMAX2_10MS_LBR     14 // Max Overhang 2
55 #define OHMAX1_20MS_LBR     4
56 #define OHMAX2_20MS_LBR     7
57 
58 #define OHMAX1_30MS_LBR     3
59 #define OHMAX2_30MS_LBR     5
60 
61 // Mode 2, Very aggressive thresholds - Different thresholds for the different frame lengths
62 #define INDIVIDUAL_10MS_AGG 82
63 #define INDIVIDUAL_20MS_AGG 78
64 #define INDIVIDUAL_30MS_AGG 82
65 
66 #define TOTAL_10MS_AGG      285 //580
67 #define TOTAL_20MS_AGG      260
68 #define TOTAL_30MS_AGG      285
69 
70 #define OHMAX1_10MS_AGG     6  // Max Overhang 1
71 #define OHMAX2_10MS_AGG     9  // Max Overhang 2
72 #define OHMAX1_20MS_AGG     3
73 #define OHMAX2_20MS_AGG     5
74 
75 #define OHMAX1_30MS_AGG     2
76 #define OHMAX2_30MS_AGG     3
77 
78 // Mode 3, Super aggressive thresholds - Different thresholds for the different frame lengths
79 #define INDIVIDUAL_10MS_VAG 94
80 #define INDIVIDUAL_20MS_VAG 94
81 #define INDIVIDUAL_30MS_VAG 94
82 
83 #define TOTAL_10MS_VAG      1100 //1700
84 #define TOTAL_20MS_VAG      1050
85 #define TOTAL_30MS_VAG      1100
86 
87 #define OHMAX1_10MS_VAG     6  // Max Overhang 1
88 #define OHMAX2_10MS_VAG     9  // Max Overhang 2
89 #define OHMAX1_20MS_VAG     3
90 #define OHMAX2_20MS_VAG     5
91 
92 #define OHMAX1_30MS_VAG     2
93 #define OHMAX2_30MS_VAG     3
94 
95 #endif // WEBRTC_VAD_DEFINES_H_
96