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 29 matching lines...) Expand all Loading... |
40 opus_int condCoding /* I
The type of conditional coding used so far for this frame */ | 40 opus_int condCoding /* I
The type of conditional coding used so far for this frame */ |
41 ); | 41 ); |
42 | 42 |
43 void silk_encode_do_VAD_FLP( | 43 void silk_encode_do_VAD_FLP( |
44 silk_encoder_state_FLP *psEnc /* I/O
Encoder state FLP */ | 44 silk_encoder_state_FLP *psEnc /* I/O
Encoder state FLP */ |
45 ) | 45 ) |
46 { | 46 { |
47 /****************************/ | 47 /****************************/ |
48 /* Voice Activity Detection */ | 48 /* Voice Activity Detection */ |
49 /****************************/ | 49 /****************************/ |
50 silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf + 1 ); | 50 silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.arch
); |
51 | 51 |
52 /**************************************************/ | 52 /**************************************************/ |
53 /* Convert speech activity into VAD and DTX flags */ | 53 /* Convert speech activity into VAD and DTX flags */ |
54 /**************************************************/ | 54 /**************************************************/ |
55 if( psEnc->sCmn.speech_activity_Q8 < SILK_FIX_CONST( SPEECH_ACTIVITY_DTX_THR
ES, 8 ) ) { | 55 if( psEnc->sCmn.speech_activity_Q8 < SILK_FIX_CONST( SPEECH_ACTIVITY_DTX_THR
ES, 8 ) ) { |
56 psEnc->sCmn.indices.signalType = TYPE_NO_VOICE_ACTIVITY; | 56 psEnc->sCmn.indices.signalType = TYPE_NO_VOICE_ACTIVITY; |
57 psEnc->sCmn.noSpeechCounter++; | 57 psEnc->sCmn.noSpeechCounter++; |
58 if( psEnc->sCmn.noSpeechCounter < NB_SPEECH_FRAMES_BEFORE_DTX ) { | 58 if( psEnc->sCmn.noSpeechCounter < NB_SPEECH_FRAMES_BEFORE_DTX ) { |
59 psEnc->sCmn.inDTX = 0; | 59 psEnc->sCmn.inDTX = 0; |
60 } else if( psEnc->sCmn.noSpeechCounter > MAX_CONSECUTIVE_DTX + NB_SPEECH
_FRAMES_BEFORE_DTX ) { | 60 } else if( psEnc->sCmn.noSpeechCounter > MAX_CONSECUTIVE_DTX + NB_SPEECH
_FRAMES_BEFORE_DTX ) { |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 /*****************************************/ | 363 /*****************************************/ |
364 /* Noise shaping quantization */ | 364 /* Noise shaping quantization */ |
365 /*****************************************/ | 365 /*****************************************/ |
366 silk_NSQ_wrapper_FLP( psEnc, psEncCtrl, psIndices_LBRR, &sNSQ_LBRR, | 366 silk_NSQ_wrapper_FLP( psEnc, psEncCtrl, psIndices_LBRR, &sNSQ_LBRR, |
367 psEnc->sCmn.pulses_LBRR[ psEnc->sCmn.nFramesEncoded ], xfw ); | 367 psEnc->sCmn.pulses_LBRR[ psEnc->sCmn.nFramesEncoded ], xfw ); |
368 | 368 |
369 /* Restore original gains */ | 369 /* Restore original gains */ |
370 silk_memcpy( psEncCtrl->Gains, TempGains, psEnc->sCmn.nb_subfr * sizeof(
silk_float ) ); | 370 silk_memcpy( psEncCtrl->Gains, TempGains, psEnc->sCmn.nb_subfr * sizeof(
silk_float ) ); |
371 } | 371 } |
372 } | 372 } |
OLD | NEW |