cannam@154
|
1 /***********************************************************************
|
cannam@154
|
2 Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
cannam@154
|
3 Redistribution and use in source and binary forms, with or without
|
cannam@154
|
4 modification, are permitted provided that the following conditions
|
cannam@154
|
5 are met:
|
cannam@154
|
6 - Redistributions of source code must retain the above copyright notice,
|
cannam@154
|
7 this list of conditions and the following disclaimer.
|
cannam@154
|
8 - Redistributions in binary form must reproduce the above copyright
|
cannam@154
|
9 notice, this list of conditions and the following disclaimer in the
|
cannam@154
|
10 documentation and/or other materials provided with the distribution.
|
cannam@154
|
11 - Neither the name of Internet Society, IETF or IETF Trust, nor the
|
cannam@154
|
12 names of specific contributors, may be used to endorse or promote
|
cannam@154
|
13 products derived from this software without specific prior written
|
cannam@154
|
14 permission.
|
cannam@154
|
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
cannam@154
|
16 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
cannam@154
|
17 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
cannam@154
|
18 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
cannam@154
|
19 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
cannam@154
|
20 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
cannam@154
|
21 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
cannam@154
|
22 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
cannam@154
|
23 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
cannam@154
|
24 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
cannam@154
|
25 POSSIBILITY OF SUCH DAMAGE.
|
cannam@154
|
26 ***********************************************************************/
|
cannam@154
|
27
|
cannam@154
|
28 #ifndef SILK_TUNING_PARAMETERS_H
|
cannam@154
|
29 #define SILK_TUNING_PARAMETERS_H
|
cannam@154
|
30
|
cannam@154
|
31 #ifdef __cplusplus
|
cannam@154
|
32 extern "C"
|
cannam@154
|
33 {
|
cannam@154
|
34 #endif
|
cannam@154
|
35
|
cannam@154
|
36 /* Decay time for bitreservoir */
|
cannam@154
|
37 #define BITRESERVOIR_DECAY_TIME_MS 500
|
cannam@154
|
38
|
cannam@154
|
39 /*******************/
|
cannam@154
|
40 /* Pitch estimator */
|
cannam@154
|
41 /*******************/
|
cannam@154
|
42
|
cannam@154
|
43 /* Level of noise floor for whitening filter LPC analysis in pitch analysis */
|
cannam@154
|
44 #define FIND_PITCH_WHITE_NOISE_FRACTION 1e-3f
|
cannam@154
|
45
|
cannam@154
|
46 /* Bandwidth expansion for whitening filter in pitch analysis */
|
cannam@154
|
47 #define FIND_PITCH_BANDWIDTH_EXPANSION 0.99f
|
cannam@154
|
48
|
cannam@154
|
49 /*********************/
|
cannam@154
|
50 /* Linear prediction */
|
cannam@154
|
51 /*********************/
|
cannam@154
|
52
|
cannam@154
|
53 /* LPC analysis regularization */
|
cannam@154
|
54 #define FIND_LPC_COND_FAC 1e-5f
|
cannam@154
|
55
|
cannam@154
|
56 /* Max cumulative LTP gain */
|
cannam@154
|
57 #define MAX_SUM_LOG_GAIN_DB 250.0f
|
cannam@154
|
58
|
cannam@154
|
59 /* LTP analysis defines */
|
cannam@154
|
60 #define LTP_CORR_INV_MAX 0.03f
|
cannam@154
|
61
|
cannam@154
|
62 /***********************/
|
cannam@154
|
63 /* High pass filtering */
|
cannam@154
|
64 /***********************/
|
cannam@154
|
65
|
cannam@154
|
66 /* Smoothing parameters for low end of pitch frequency range estimation */
|
cannam@154
|
67 #define VARIABLE_HP_SMTH_COEF1 0.1f
|
cannam@154
|
68 #define VARIABLE_HP_SMTH_COEF2 0.015f
|
cannam@154
|
69 #define VARIABLE_HP_MAX_DELTA_FREQ 0.4f
|
cannam@154
|
70
|
cannam@154
|
71 /* Min and max cut-off frequency values (-3 dB points) */
|
cannam@154
|
72 #define VARIABLE_HP_MIN_CUTOFF_HZ 60
|
cannam@154
|
73 #define VARIABLE_HP_MAX_CUTOFF_HZ 100
|
cannam@154
|
74
|
cannam@154
|
75 /***********/
|
cannam@154
|
76 /* Various */
|
cannam@154
|
77 /***********/
|
cannam@154
|
78
|
cannam@154
|
79 /* VAD threshold */
|
cannam@154
|
80 #define SPEECH_ACTIVITY_DTX_THRES 0.05f
|
cannam@154
|
81
|
cannam@154
|
82 /* Speech Activity LBRR enable threshold */
|
cannam@154
|
83 #define LBRR_SPEECH_ACTIVITY_THRES 0.3f
|
cannam@154
|
84
|
cannam@154
|
85 /*************************/
|
cannam@154
|
86 /* Perceptual parameters */
|
cannam@154
|
87 /*************************/
|
cannam@154
|
88
|
cannam@154
|
89 /* reduction in coding SNR during low speech activity */
|
cannam@154
|
90 #define BG_SNR_DECR_dB 2.0f
|
cannam@154
|
91
|
cannam@154
|
92 /* factor for reducing quantization noise during voiced speech */
|
cannam@154
|
93 #define HARM_SNR_INCR_dB 2.0f
|
cannam@154
|
94
|
cannam@154
|
95 /* factor for reducing quantization noise for unvoiced sparse signals */
|
cannam@154
|
96 #define SPARSE_SNR_INCR_dB 2.0f
|
cannam@154
|
97
|
cannam@154
|
98 /* threshold for sparseness measure above which to use lower quantization offset during unvoiced */
|
cannam@154
|
99 #define ENERGY_VARIATION_THRESHOLD_QNT_OFFSET 0.6f
|
cannam@154
|
100
|
cannam@154
|
101 /* warping control */
|
cannam@154
|
102 #define WARPING_MULTIPLIER 0.015f
|
cannam@154
|
103
|
cannam@154
|
104 /* fraction added to first autocorrelation value */
|
cannam@154
|
105 #define SHAPE_WHITE_NOISE_FRACTION 3e-5f
|
cannam@154
|
106
|
cannam@154
|
107 /* noise shaping filter chirp factor */
|
cannam@154
|
108 #define BANDWIDTH_EXPANSION 0.94f
|
cannam@154
|
109
|
cannam@154
|
110 /* harmonic noise shaping */
|
cannam@154
|
111 #define HARMONIC_SHAPING 0.3f
|
cannam@154
|
112
|
cannam@154
|
113 /* extra harmonic noise shaping for high bitrates or noisy input */
|
cannam@154
|
114 #define HIGH_RATE_OR_LOW_QUALITY_HARMONIC_SHAPING 0.2f
|
cannam@154
|
115
|
cannam@154
|
116 /* parameter for shaping noise towards higher frequencies */
|
cannam@154
|
117 #define HP_NOISE_COEF 0.25f
|
cannam@154
|
118
|
cannam@154
|
119 /* parameter for shaping noise even more towards higher frequencies during voiced speech */
|
cannam@154
|
120 #define HARM_HP_NOISE_COEF 0.35f
|
cannam@154
|
121
|
cannam@154
|
122 /* parameter for applying a high-pass tilt to the input signal */
|
cannam@154
|
123 #define INPUT_TILT 0.05f
|
cannam@154
|
124
|
cannam@154
|
125 /* parameter for extra high-pass tilt to the input signal at high rates */
|
cannam@154
|
126 #define HIGH_RATE_INPUT_TILT 0.1f
|
cannam@154
|
127
|
cannam@154
|
128 /* parameter for reducing noise at the very low frequencies */
|
cannam@154
|
129 #define LOW_FREQ_SHAPING 4.0f
|
cannam@154
|
130
|
cannam@154
|
131 /* less reduction of noise at the very low frequencies for signals with low SNR at low frequencies */
|
cannam@154
|
132 #define LOW_QUALITY_LOW_FREQ_SHAPING_DECR 0.5f
|
cannam@154
|
133
|
cannam@154
|
134 /* subframe smoothing coefficient for HarmBoost, HarmShapeGain, Tilt (lower -> more smoothing) */
|
cannam@154
|
135 #define SUBFR_SMTH_COEF 0.4f
|
cannam@154
|
136
|
cannam@154
|
137 /* parameters defining the R/D tradeoff in the residual quantizer */
|
cannam@154
|
138 #define LAMBDA_OFFSET 1.2f
|
cannam@154
|
139 #define LAMBDA_SPEECH_ACT -0.2f
|
cannam@154
|
140 #define LAMBDA_DELAYED_DECISIONS -0.05f
|
cannam@154
|
141 #define LAMBDA_INPUT_QUALITY -0.1f
|
cannam@154
|
142 #define LAMBDA_CODING_QUALITY -0.2f
|
cannam@154
|
143 #define LAMBDA_QUANT_OFFSET 0.8f
|
cannam@154
|
144
|
cannam@154
|
145 /* Compensation in bitrate calculations for 10 ms modes */
|
cannam@154
|
146 #define REDUCE_BITRATE_10_MS_BPS 2200
|
cannam@154
|
147
|
cannam@154
|
148 /* Maximum time before allowing a bandwidth transition */
|
cannam@154
|
149 #define MAX_BANDWIDTH_SWITCH_DELAY_MS 5000
|
cannam@154
|
150
|
cannam@154
|
151 #ifdef __cplusplus
|
cannam@154
|
152 }
|
cannam@154
|
153 #endif
|
cannam@154
|
154
|
cannam@154
|
155 #endif /* SILK_TUNING_PARAMETERS_H */
|