OLD | NEW |
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 15 matching lines...) Expand all Loading... |
26 ***********************************************************************/ | 26 ***********************************************************************/ |
27 | 27 |
28 #ifdef HAVE_CONFIG_H | 28 #ifdef HAVE_CONFIG_H |
29 #include "config.h" | 29 #include "config.h" |
30 #endif | 30 #endif |
31 | 31 |
32 #include "main.h" | 32 #include "main.h" |
33 #include "stack_alloc.h" | 33 #include "stack_alloc.h" |
34 | 34 |
35 /* Silk VAD noise level estimation */ | 35 /* Silk VAD noise level estimation */ |
36 static inline void silk_VAD_GetNoiseLevels( | 36 static OPUS_INLINE void silk_VAD_GetNoiseLevels( |
37 const opus_int32 pX[ VAD_N_BANDS ], /* I subband energies
*/ | 37 const opus_int32 pX[ VAD_N_BANDS ], /* I subband energies
*/ |
38 silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD
state */ | 38 silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD
state */ |
39 ); | 39 ); |
40 | 40 |
41 /**********************************/ | 41 /**********************************/ |
42 /* Initialization of the Silk VAD */ | 42 /* Initialization of the Silk VAD */ |
43 /**********************************/ | 43 /**********************************/ |
44 opus_int silk_VAD_Init( /* O Return v
alue, 0 if success */ | 44 opus_int silk_VAD_Init( /* O Return v
alue, 0 if success */ |
45 silk_VAD_state *psSilk_VAD /* I/O Pointer
to Silk VAD state */ | 45 silk_VAD_state *psSilk_VAD /* I/O Pointer
to Silk VAD state */ |
46 ) | 46 ) |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 psEncC->input_quality_bands_Q15[ b ] = silk_sigm_Q15( silk_RSHIFT( SNR_Q
7 - 16 * 128, 4 ) ); | 289 psEncC->input_quality_bands_Q15[ b ] = silk_sigm_Q15( silk_RSHIFT( SNR_Q
7 - 16 * 128, 4 ) ); |
290 } | 290 } |
291 | 291 |
292 RESTORE_STACK; | 292 RESTORE_STACK; |
293 return( ret ); | 293 return( ret ); |
294 } | 294 } |
295 | 295 |
296 /**************************/ | 296 /**************************/ |
297 /* Noise level estimation */ | 297 /* Noise level estimation */ |
298 /**************************/ | 298 /**************************/ |
299 static inline void silk_VAD_GetNoiseLevels( | 299 static OPUS_INLINE void silk_VAD_GetNoiseLevels( |
300 const opus_int32 pX[ VAD_N_BANDS ], /* I subband energies
*/ | 300 const opus_int32 pX[ VAD_N_BANDS ], /* I subband energies
*/ |
301 silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD
state */ | 301 silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD
state */ |
302 ) | 302 ) |
303 { | 303 { |
304 opus_int k; | 304 opus_int k; |
305 opus_int32 nl, nrg, inv_nrg; | 305 opus_int32 nl, nrg, inv_nrg; |
306 opus_int coef, min_coef; | 306 opus_int coef, min_coef; |
307 | 307 |
308 /* Initially faster smoothing */ | 308 /* Initially faster smoothing */ |
309 if( psSilk_VAD->counter < 1000 ) { /* 1000 = 20 sec */ | 309 if( psSilk_VAD->counter < 1000 ) { /* 1000 = 20 sec */ |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 /* Limit noise levels (guarantee 7 bits of head room) */ | 348 /* Limit noise levels (guarantee 7 bits of head room) */ |
349 nl = silk_min( nl, 0x00FFFFFF ); | 349 nl = silk_min( nl, 0x00FFFFFF ); |
350 | 350 |
351 /* Store as part of state */ | 351 /* Store as part of state */ |
352 psSilk_VAD->NL[ k ] = nl; | 352 psSilk_VAD->NL[ k ] = nl; |
353 } | 353 } |
354 | 354 |
355 /* Increment frame counter */ | 355 /* Increment frame counter */ |
356 psSilk_VAD->counter++; | 356 psSilk_VAD->counter++; |
357 } | 357 } |
OLD | NEW |