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

Side by Side Diff: third_party/opus/src/silk/define.h

Issue 2962373002: [Opus] Update to v1.2.1 (Closed)
Patch Set: Include minor updates including fix for win_clang Created 3 years, 5 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) 2006-2011, Skype Limited. All rights reserved. 2 Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 Redistribution and use in source and binary forms, with or without 3 Redistribution and use in source and binary forms, with or without
4 modification, are permitted provided that the following conditions 4 modification, are permitted provided that the following conditions
5 are met: 5 are met:
6 - Redistributions of source code must retain the above copyright notice, 6 - Redistributions of source code must retain the above copyright notice,
7 this list of conditions and the following disclaimer. 7 this list of conditions and the following disclaimer.
8 - Redistributions in binary form must reproduce the above copyright 8 - Redistributions in binary form must reproduce the above copyright
9 notice, this list of conditions and the following disclaimer in the 9 notice, this list of conditions and the following disclaimer in the
10 documentation and/or other materials provided with the distribution. 10 documentation and/or other materials provided with the distribution.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #define TARGET_RATE_TAB_SZ 8 49 #define TARGET_RATE_TAB_SZ 8
50 50
51 /* LBRR thresholds */ 51 /* LBRR thresholds */
52 #define LBRR_NB_MIN_RATE_BPS 12000 52 #define LBRR_NB_MIN_RATE_BPS 12000
53 #define LBRR_MB_MIN_RATE_BPS 14000 53 #define LBRR_MB_MIN_RATE_BPS 14000
54 #define LBRR_WB_MIN_RATE_BPS 16000 54 #define LBRR_WB_MIN_RATE_BPS 16000
55 55
56 /* DTX settings */ 56 /* DTX settings */
57 #define NB_SPEECH_FRAMES_BEFORE_DTX 10 /* eq 200 ms */ 57 #define NB_SPEECH_FRAMES_BEFORE_DTX 10 /* eq 200 ms */
58 #define MAX_CONSECUTIVE_DTX 20 /* eq 400 ms */ 58 #define MAX_CONSECUTIVE_DTX 20 /* eq 400 ms */
59 #define DTX_ACTIVITY_THRESHOLD 0.1f
59 60
60 /* Maximum sampling frequency */ 61 /* Maximum sampling frequency */
61 #define MAX_FS_KHZ 16 62 #define MAX_FS_KHZ 16
62 #define MAX_API_FS_KHZ 48 63 #define MAX_API_FS_KHZ 48
63 64
64 /* Signal types */ 65 /* Signal types */
65 #define TYPE_NO_VOICE_ACTIVITY 0 66 #define TYPE_NO_VOICE_ACTIVITY 0
66 #define TYPE_UNVOICED 1 67 #define TYPE_UNVOICED 1
67 #define TYPE_VOICED 2 68 #define TYPE_VOICED 2
68 69
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 /* Find Pred Coef defines */ 141 /* Find Pred Coef defines */
141 #define LTP_ORDER 5 142 #define LTP_ORDER 5
142 143
143 /* LTP quantization settings */ 144 /* LTP quantization settings */
144 #define NB_LTP_CBKS 3 145 #define NB_LTP_CBKS 3
145 146
146 /* Flag to use harmonic noise shaping */ 147 /* Flag to use harmonic noise shaping */
147 #define USE_HARM_SHAPING 1 148 #define USE_HARM_SHAPING 1
148 149
149 /* Max LPC order of noise shaping filters */ 150 /* Max LPC order of noise shaping filters */
150 #define MAX_SHAPE_LPC_ORDER 16 151 #define MAX_SHAPE_LPC_ORDER 24
151 152
152 #define HARM_SHAPE_FIR_TAPS 3 153 #define HARM_SHAPE_FIR_TAPS 3
153 154
154 /* Maximum number of delayed decision states */ 155 /* Maximum number of delayed decision states */
155 #define MAX_DEL_DEC_STATES 4 156 #define MAX_DEL_DEC_STATES 4
156 157
157 #define LTP_BUF_LENGTH 512 158 #define LTP_BUF_LENGTH 512
158 #define LTP_MASK ( LTP_BUF_LENGTH - 1 ) 159 #define LTP_MASK ( LTP_BUF_LENGTH - 1 )
159 160
160 #define DECISION_DELAY 32 161 #define DECISION_DELAY 40
161 #define DECISION_DELAY_MASK ( DECISION_DELAY - 1 )
162 162
163 /* Number of subframes for excitation entropy coding */ 163 /* Number of subframes for excitation entropy coding */
164 #define SHELL_CODEC_FRAME_LENGTH 16 164 #define SHELL_CODEC_FRAME_LENGTH 16
165 #define LOG2_SHELL_CODEC_FRAME_LENGTH 4 165 #define LOG2_SHELL_CODEC_FRAME_LENGTH 4
166 #define MAX_NB_SHELL_BLOCKS ( MAX_FRAME_LENGTH / SHELL_CODEC _FRAME_LENGTH ) 166 #define MAX_NB_SHELL_BLOCKS ( MAX_FRAME_LENGTH / SHELL_CODEC _FRAME_LENGTH )
167 167
168 /* Number of rate levels, for entropy coding of excitation */ 168 /* Number of rate levels, for entropy coding of excitation */
169 #define N_RATE_LEVELS 10 169 #define N_RATE_LEVELS 10
170 170
171 /* Maximum sum of pulses per shell coding frame */ 171 /* Maximum sum of pulses per shell coding frame */
172 #define SILK_MAX_PULSES 16 172 #define SILK_MAX_PULSES 16
173 173
174 #define MAX_MATRIX_SIZE MAX_LPC_ORDER /* Max of LPC Orde r and LTP order */ 174 #define MAX_MATRIX_SIZE MAX_LPC_ORDER /* Max of LPC Orde r and LTP order */
175 175
176 #if( MAX_LPC_ORDER > DECISION_DELAY )
177 # define NSQ_LPC_BUF_LENGTH MAX_LPC_ORDER 176 # define NSQ_LPC_BUF_LENGTH MAX_LPC_ORDER
178 #else
179 # define NSQ_LPC_BUF_LENGTH DECISION_DELAY
180 #endif
181 177
182 /***************************/ 178 /***************************/
183 /* Voice activity detector */ 179 /* Voice activity detector */
184 /***************************/ 180 /***************************/
185 #define VAD_N_BANDS 4 181 #define VAD_N_BANDS 4
186 182
187 #define VAD_INTERNAL_SUBFRAMES_LOG2 2 183 #define VAD_INTERNAL_SUBFRAMES_LOG2 2
188 #define VAD_INTERNAL_SUBFRAMES ( 1 << VAD_INTERNAL_SUBFRAMES_LO G2 ) 184 #define VAD_INTERNAL_SUBFRAMES ( 1 << VAD_INTERNAL_SUBFRAMES_LO G2 )
189 185
190 #define VAD_NOISE_LEVEL_SMOOTH_COEF_Q16 1024 /* Must be < 4096 */ 186 #define VAD_NOISE_LEVEL_SMOOTH_COEF_Q16 1024 /* Must be < 4096 */
191 #define VAD_NOISE_LEVELS_BIAS 50 187 #define VAD_NOISE_LEVELS_BIAS 50
192 188
193 /* Sigmoid settings */ 189 /* Sigmoid settings */
194 #define VAD_NEGATIVE_OFFSET_Q5 128 /* sigmoid is 0 at -128 */ 190 #define VAD_NEGATIVE_OFFSET_Q5 128 /* sigmoid is 0 at -128 */
195 #define VAD_SNR_FACTOR_Q16 45000 191 #define VAD_SNR_FACTOR_Q16 45000
196 192
197 /* smoothing for SNR measurement */ 193 /* smoothing for SNR measurement */
198 #define VAD_SNR_SMOOTH_COEF_Q18 4096 194 #define VAD_SNR_SMOOTH_COEF_Q18 4096
199 195
200 /* Size of the piecewise linear cosine approximation table for the LSFs */ 196 /* Size of the piecewise linear cosine approximation table for the LSFs */
201 #define LSF_COS_TAB_SZ_FIX 128 197 #define LSF_COS_TAB_SZ_FIX 128
202 198
203 /******************/ 199 /******************/
204 /* NLSF quantizer */ 200 /* NLSF quantizer */
205 /******************/ 201 /******************/
206 #define NLSF_W_Q 2 202 #define NLSF_W_Q 2
207 #define NLSF_VQ_MAX_VECTORS 32 203 #define NLSF_VQ_MAX_VECTORS 32
208 #define NLSF_VQ_MAX_SURVIVORS 32
209 #define NLSF_QUANT_MAX_AMPLITUDE 4 204 #define NLSF_QUANT_MAX_AMPLITUDE 4
210 #define NLSF_QUANT_MAX_AMPLITUDE_EXT 10 205 #define NLSF_QUANT_MAX_AMPLITUDE_EXT 10
211 #define NLSF_QUANT_LEVEL_ADJ 0.1 206 #define NLSF_QUANT_LEVEL_ADJ 0.1
212 #define NLSF_QUANT_DEL_DEC_STATES_LOG2 2 207 #define NLSF_QUANT_DEL_DEC_STATES_LOG2 2
213 #define NLSF_QUANT_DEL_DEC_STATES ( 1 << NLSF_QUANT_DEL_DEC_STATES _LOG2 ) 208 #define NLSF_QUANT_DEL_DEC_STATES ( 1 << NLSF_QUANT_DEL_DEC_STATES _LOG2 )
214 209
215 /* Transition filtering for mode switching */ 210 /* Transition filtering for mode switching */
216 #define TRANSITION_TIME_MS 5120 /* 5120 = 64 * FRAME_LEN GTH_MS * ( TRANSITION_INT_NUM - 1 ) = 64*(20*4)*/ 211 #define TRANSITION_TIME_MS 5120 /* 5120 = 64 * FRAME_LEN GTH_MS * ( TRANSITION_INT_NUM - 1 ) = 64*(20*4)*/
217 #define TRANSITION_NB 3 /* Hardcoded in tables * / 212 #define TRANSITION_NB 3 /* Hardcoded in tables * /
218 #define TRANSITION_NA 2 /* Hardcoded in tables * / 213 #define TRANSITION_NA 2 /* Hardcoded in tables * /
219 #define TRANSITION_INT_NUM 5 /* Hardcoded in tables * / 214 #define TRANSITION_INT_NUM 5 /* Hardcoded in tables * /
220 #define TRANSITION_FRAMES ( TRANSITION_TIME_MS / MAX_FRAME _LENGTH_MS ) 215 #define TRANSITION_FRAMES ( TRANSITION_TIME_MS / MAX_FRAME _LENGTH_MS )
221 #define TRANSITION_INT_STEPS ( TRANSITION_FRAMES / ( TRANSIT ION_INT_NUM - 1 ) ) 216 #define TRANSITION_INT_STEPS ( TRANSITION_FRAMES / ( TRANSIT ION_INT_NUM - 1 ) )
222 217
223 /* BWE factors to apply after packet loss */ 218 /* BWE factors to apply after packet loss */
224 #define BWE_AFTER_LOSS_Q16 63570 219 #define BWE_AFTER_LOSS_Q16 63570
225 220
226 /* Defines for CN generation */ 221 /* Defines for CN generation */
227 #define CNG_BUF_MASK_MAX 255 /* 2^floor(log2(MAX_FRAM E_LENGTH))-1 */ 222 #define CNG_BUF_MASK_MAX 255 /* 2^floor(log2(MAX_FRAM E_LENGTH))-1 */
228 #define CNG_GAIN_SMTH_Q16 4634 /* 0.25^(1/4) */ 223 #define CNG_GAIN_SMTH_Q16 4634 /* 0.25^(1/4) */
229 #define CNG_NLSF_SMTH_Q16 16348 /* 0.25 */ 224 #define CNG_NLSF_SMTH_Q16 16348 /* 0.25 */
230 225
231 #ifdef __cplusplus 226 #ifdef __cplusplus
232 } 227 }
233 #endif 228 #endif
234 229
235 #endif 230 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698