Lines Matching refs:psEnc
38 …silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP …
45 …silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP … in silk_encode_do_VAD_FLP() argument
54 silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.arch ); in silk_encode_do_VAD_FLP()
56 if( activity == VAD_NO_ACTIVITY && psEnc->sCmn.speech_activity_Q8 >= activity_threshold ) { in silk_encode_do_VAD_FLP()
57 psEnc->sCmn.speech_activity_Q8 = activity_threshold - 1; in silk_encode_do_VAD_FLP()
63 if( psEnc->sCmn.speech_activity_Q8 < activity_threshold ) { in silk_encode_do_VAD_FLP()
64 psEnc->sCmn.indices.signalType = TYPE_NO_VOICE_ACTIVITY; in silk_encode_do_VAD_FLP()
65 psEnc->sCmn.noSpeechCounter++; in silk_encode_do_VAD_FLP()
66 if( psEnc->sCmn.noSpeechCounter <= NB_SPEECH_FRAMES_BEFORE_DTX ) { in silk_encode_do_VAD_FLP()
67 psEnc->sCmn.inDTX = 0; in silk_encode_do_VAD_FLP()
68 … } else if( psEnc->sCmn.noSpeechCounter > MAX_CONSECUTIVE_DTX + NB_SPEECH_FRAMES_BEFORE_DTX ) { in silk_encode_do_VAD_FLP()
69 psEnc->sCmn.noSpeechCounter = NB_SPEECH_FRAMES_BEFORE_DTX; in silk_encode_do_VAD_FLP()
70 psEnc->sCmn.inDTX = 0; in silk_encode_do_VAD_FLP()
72 psEnc->sCmn.VAD_flags[ psEnc->sCmn.nFramesEncoded ] = 0; in silk_encode_do_VAD_FLP()
74 psEnc->sCmn.noSpeechCounter = 0; in silk_encode_do_VAD_FLP()
75 psEnc->sCmn.inDTX = 0; in silk_encode_do_VAD_FLP()
76 psEnc->sCmn.indices.signalType = TYPE_UNVOICED; in silk_encode_do_VAD_FLP()
77 psEnc->sCmn.VAD_flags[ psEnc->sCmn.nFramesEncoded ] = 1; in silk_encode_do_VAD_FLP()
85 …silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP … in silk_encode_frame_FLP() argument
114 psEnc->sCmn.indices.Seed = psEnc->sCmn.frameCounter++ & 3; in silk_encode_frame_FLP()
120 x_frame = psEnc->x_buf + psEnc->sCmn.ltp_mem_length; /* start of frame to encode */ in silk_encode_frame_FLP()
121 …res_pitch_frame = res_pitch + psEnc->sCmn.ltp_mem_length; /* start of pitch LPC residual fra… in silk_encode_frame_FLP()
126 silk_LP_variable_cutoff( &psEnc->sCmn.sLP, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.frame_length ); in silk_encode_frame_FLP()
131 …silk_short2float_array( x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, psEnc->sCmn.inputBuf + 1, psEn… in silk_encode_frame_FLP()
135 …x_frame[ LA_SHAPE_MS * psEnc->sCmn.fs_kHz + i * ( psEnc->sCmn.frame_length >> 3 ) ] += ( 1 - ( i &… in silk_encode_frame_FLP()
138 if( !psEnc->sCmn.prefillFlag ) { in silk_encode_frame_FLP()
142 silk_find_pitch_lags_FLP( psEnc, &sEncCtrl, res_pitch, x_frame, psEnc->sCmn.arch ); in silk_encode_frame_FLP()
147 silk_noise_shape_analysis_FLP( psEnc, &sEncCtrl, res_pitch_frame, x_frame ); in silk_encode_frame_FLP()
152 silk_find_pred_coefs_FLP( psEnc, &sEncCtrl, res_pitch_frame, x_frame, condCoding ); in silk_encode_frame_FLP()
157 silk_process_gains_FLP( psEnc, &sEncCtrl, condCoding ); in silk_encode_frame_FLP()
162 silk_LBRR_encode_FLP( psEnc, &sEncCtrl, x_frame, condCoding ); in silk_encode_frame_FLP()
169 gainsID = silk_gains_ID( psEnc->sCmn.indices.GainsIndices, psEnc->sCmn.nb_subfr ); in silk_encode_frame_FLP()
174 silk_memcpy( &sNSQ_copy, &psEnc->sCmn.sNSQ, sizeof( silk_nsq_state ) ); in silk_encode_frame_FLP()
175 seed_copy = psEnc->sCmn.indices.Seed; in silk_encode_frame_FLP()
176 ec_prevLagIndex_copy = psEnc->sCmn.ec_prevLagIndex; in silk_encode_frame_FLP()
177 ec_prevSignalType_copy = psEnc->sCmn.ec_prevSignalType; in silk_encode_frame_FLP()
187 silk_memcpy( &psEnc->sCmn.sNSQ, &sNSQ_copy, sizeof( silk_nsq_state ) ); in silk_encode_frame_FLP()
188 psEnc->sCmn.indices.Seed = seed_copy; in silk_encode_frame_FLP()
189 psEnc->sCmn.ec_prevLagIndex = ec_prevLagIndex_copy; in silk_encode_frame_FLP()
190 psEnc->sCmn.ec_prevSignalType = ec_prevSignalType_copy; in silk_encode_frame_FLP()
196 …silk_NSQ_wrapper_FLP( psEnc, &sEncCtrl, &psEnc->sCmn.indices, &psEnc->sCmn.sNSQ, psEnc->sCmn.pulse… in silk_encode_frame_FLP()
205 … silk_encode_indices( &psEnc->sCmn, psRangeEnc, psEnc->sCmn.nFramesEncoded, 0, condCoding ); in silk_encode_frame_FLP()
210 …silk_encode_pulses( psRangeEnc, psEnc->sCmn.indices.signalType, psEnc->sCmn.indices.quantOffsetTyp… in silk_encode_frame_FLP()
211 psEnc->sCmn.pulses, psEnc->sCmn.frame_length ); in silk_encode_frame_FLP()
220 psEnc->sShape.LastGainIndex = sEncCtrl.lastGainIndexPrev; in silk_encode_frame_FLP()
221 for ( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) { in silk_encode_frame_FLP()
222 psEnc->sCmn.indices.GainsIndices[ i ] = 4; in silk_encode_frame_FLP()
225 psEnc->sCmn.indices.GainsIndices[ 0 ] = sEncCtrl.lastGainIndexPrev; in silk_encode_frame_FLP()
227 psEnc->sCmn.ec_prevLagIndex = ec_prevLagIndex_copy; in silk_encode_frame_FLP()
228 psEnc->sCmn.ec_prevSignalType = ec_prevSignalType_copy; in silk_encode_frame_FLP()
230 for ( i = 0; i < psEnc->sCmn.frame_length; i++ ) { in silk_encode_frame_FLP()
231 psEnc->sCmn.pulses[ i ] = 0; in silk_encode_frame_FLP()
234 … silk_encode_indices( &psEnc->sCmn, psRangeEnc, psEnc->sCmn.nFramesEncoded, 0, condCoding ); in silk_encode_frame_FLP()
236 …silk_encode_pulses( psRangeEnc, psEnc->sCmn.indices.signalType, psEnc->sCmn.indices.quantOffsetTyp… in silk_encode_frame_FLP()
237 psEnc->sCmn.pulses, psEnc->sCmn.frame_length ); in silk_encode_frame_FLP()
253 silk_memcpy( &psEnc->sCmn.sNSQ, &sNSQ_copy2, sizeof( silk_nsq_state ) ); in silk_encode_frame_FLP()
254 psEnc->sShape.LastGainIndex = LastGainIndex_copy2; in silk_encode_frame_FLP()
264 psEnc->sCmn.indices.quantOffsetType = 0; in silk_encode_frame_FLP()
283 silk_memcpy( &sNSQ_copy2, &psEnc->sCmn.sNSQ, sizeof( silk_nsq_state ) ); in silk_encode_frame_FLP()
284 LastGainIndex_copy2 = psEnc->sShape.LastGainIndex; in silk_encode_frame_FLP()
293 for ( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) { in silk_encode_frame_FLP()
295 … for ( j = i*psEnc->sCmn.subfr_length; j < (i+1)*psEnc->sCmn.subfr_length; j++ ) { in silk_encode_frame_FLP()
296 sum += abs( psEnc->sCmn.pulses[j] ); in silk_encode_frame_FLP()
316 …gain_factor_Q16 = silk_log2lin( silk_LSHIFT( nBits - maxBits, 7 ) / psEnc->sCmn.frame_length + SIL… in silk_encode_frame_FLP()
331 for( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) { in silk_encode_frame_FLP()
342 psEnc->sShape.LastGainIndex = sEncCtrl.lastGainIndexPrev; in silk_encode_frame_FLP()
343 silk_gains_quant( psEnc->sCmn.indices.GainsIndices, pGains_Q16, in silk_encode_frame_FLP()
344 … &psEnc->sShape.LastGainIndex, condCoding == CODE_CONDITIONALLY, psEnc->sCmn.nb_subfr ); in silk_encode_frame_FLP()
347 gainsID = silk_gains_ID( psEnc->sCmn.indices.GainsIndices, psEnc->sCmn.nb_subfr ); in silk_encode_frame_FLP()
350 for( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) { in silk_encode_frame_FLP()
357 silk_memmove( psEnc->x_buf, &psEnc->x_buf[ psEnc->sCmn.frame_length ], in silk_encode_frame_FLP()
358 ( psEnc->sCmn.ltp_mem_length + LA_SHAPE_MS * psEnc->sCmn.fs_kHz ) * sizeof( silk_float ) ); in silk_encode_frame_FLP()
361 if( psEnc->sCmn.prefillFlag ) { in silk_encode_frame_FLP()
368 psEnc->sCmn.prevLag = sEncCtrl.pitchL[ psEnc->sCmn.nb_subfr - 1 ]; in silk_encode_frame_FLP()
369 psEnc->sCmn.prevSignalType = psEnc->sCmn.indices.signalType; in silk_encode_frame_FLP()
374 psEnc->sCmn.first_frame_after_reset = 0; in silk_encode_frame_FLP()
383 …silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP … in silk_LBRR_encode_FLP() argument
392 SideInfoIndices *psIndices_LBRR = &psEnc->sCmn.indices_LBRR[ psEnc->sCmn.nFramesEncoded ]; in silk_LBRR_encode_FLP()
398 …if( psEnc->sCmn.LBRR_enabled && psEnc->sCmn.speech_activity_Q8 > SILK_FIX_CONST( LBRR_SPEECH_ACTIV… in silk_LBRR_encode_FLP()
399 psEnc->sCmn.LBRR_flags[ psEnc->sCmn.nFramesEncoded ] = 1; in silk_LBRR_encode_FLP()
402 silk_memcpy( &sNSQ_LBRR, &psEnc->sCmn.sNSQ, sizeof( silk_nsq_state ) ); in silk_LBRR_encode_FLP()
403 silk_memcpy( psIndices_LBRR, &psEnc->sCmn.indices, sizeof( SideInfoIndices ) ); in silk_LBRR_encode_FLP()
406 silk_memcpy( TempGains, psEncCtrl->Gains, psEnc->sCmn.nb_subfr * sizeof( silk_float ) ); in silk_LBRR_encode_FLP()
408 …if( psEnc->sCmn.nFramesEncoded == 0 || psEnc->sCmn.LBRR_flags[ psEnc->sCmn.nFramesEncoded - 1 ] ==… in silk_LBRR_encode_FLP()
410 psEnc->sCmn.LBRRprevLastGainIndex = psEnc->sShape.LastGainIndex; in silk_LBRR_encode_FLP()
413 psIndices_LBRR->GainsIndices[ 0 ] += psEnc->sCmn.LBRR_GainIncreases; in silk_LBRR_encode_FLP()
419 … &psEnc->sCmn.LBRRprevLastGainIndex, condCoding == CODE_CONDITIONALLY, psEnc->sCmn.nb_subfr ); in silk_LBRR_encode_FLP()
422 for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) { in silk_LBRR_encode_FLP()
429 silk_NSQ_wrapper_FLP( psEnc, psEncCtrl, psIndices_LBRR, &sNSQ_LBRR, in silk_LBRR_encode_FLP()
430 psEnc->sCmn.pulses_LBRR[ psEnc->sCmn.nFramesEncoded ], xfw ); in silk_LBRR_encode_FLP()
433 silk_memcpy( psEncCtrl->Gains, TempGains, psEnc->sCmn.nb_subfr * sizeof( silk_float ) ); in silk_LBRR_encode_FLP()