Home | History | Annotate | Download | only in fixed

Lines Matching refs:psEnc

38     silk_encoder_state_FIX          *psEnc,                                 /* I/O  Pointer to Silk FIX encoder state                                           */
45 silk_encoder_state_FIX *psEnc /* I/O Pointer to Silk FIX encoder state */
51 silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf + 1 );
56 if( psEnc->sCmn.speech_activity_Q8 < SILK_FIX_CONST( SPEECH_ACTIVITY_DTX_THRES, 8 ) ) {
57 psEnc->sCmn.indices.signalType = TYPE_NO_VOICE_ACTIVITY;
58 psEnc->sCmn.noSpeechCounter++;
59 if( psEnc->sCmn.noSpeechCounter < NB_SPEECH_FRAMES_BEFORE_DTX ) {
60 psEnc->sCmn.inDTX = 0;
61 } else if( psEnc->sCmn.noSpeechCounter > MAX_CONSECUTIVE_DTX + NB_SPEECH_FRAMES_BEFORE_DTX ) {
62 psEnc->sCmn.noSpeechCounter = NB_SPEECH_FRAMES_BEFORE_DTX;
63 psEnc->sCmn.inDTX = 0;
65 psEnc->sCmn.VAD_flags[ psEnc->sCmn.nFramesEncoded ] = 0;
67 psEnc->sCmn.noSpeechCounter = 0;
68 psEnc->sCmn.inDTX = 0;
69 psEnc->sCmn.indices.signalType = TYPE_UNVOICED;
70 psEnc->sCmn.VAD_flags[ psEnc->sCmn.nFramesEncoded ] = 1;
78 silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk FIX encoder state */
102 psEnc->sCmn.indices.Seed = psEnc->sCmn.frameCounter++ & 3;
108 x_frame = psEnc->x_buf + psEnc->sCmn.ltp_mem_length;
113 silk_LP_variable_cutoff( &psEnc->sCmn.sLP, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.frame_length );
118 silk_memcpy( x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.frame_length * sizeof( opus_int16 ) );
120 if( !psEnc->sCmn.prefillFlag ) {
127 psEnc->sCmn.la_pitch + psEnc->sCmn.frame_length
128 + psEnc->sCmn.ltp_mem_length, opus_int16 );
130 res_pitch_frame = res_pitch + psEnc->sCmn.ltp_mem_length;
135 silk_find_pitch_lags_FIX( psEnc, &sEncCtrl, res_pitch, x_frame, psEnc->sCmn.arch );
140 silk_noise_shape_analysis_FIX( psEnc, &sEncCtrl, res_pitch_frame, x_frame, psEnc->sCmn.arch );
145 silk_find_pred_coefs_FIX( psEnc, &sEncCtrl, res_pitch, x_frame, condCoding );
150 silk_process_gains_FIX( psEnc, &sEncCtrl, condCoding );
155 ALLOC( xfw_Q3, psEnc->sCmn.frame_length, opus_int32 );
156 silk_prefilter_FIX( psEnc, &sEncCtrl, xfw_Q3, x_frame );
161 silk_LBRR_encode_FIX( psEnc, &sEncCtrl, xfw_Q3, condCoding );
168 gainsID = silk_gains_ID( psEnc->sCmn.indices.GainsIndices, psEnc->sCmn.nb_subfr );
173 silk_memcpy( &sNSQ_copy, &psEnc->sCmn.sNSQ, sizeof( silk_nsq_state ) );
174 seed_copy = psEnc->sCmn.indices.Seed;
175 ec_prevLagIndex_copy = psEnc->sCmn.ec_prevLagIndex;
176 ec_prevSignalType_copy = psEnc->sCmn.ec_prevSignalType;
187 silk_memcpy( &psEnc->sCmn.sNSQ, &sNSQ_copy, sizeof( silk_nsq_state ) );
188 psEnc->sCmn.indices.Seed = seed_copy;
189 psEnc->sCmn.ec_prevLagIndex = ec_prevLagIndex_copy;
190 psEnc->sCmn.ec_prevSignalType = ec_prevSignalType_copy;
196 if( psEnc->sCmn.nStatesDelayedDecision > 1 || psEnc->sCmn.warping_Q16 > 0 ) {
197 silk_NSQ_del_dec( &psEnc->sCmn, &psEnc->sCmn.sNSQ, &psEnc->sCmn.indices, xfw_Q3, psEnc->sCmn.pulses,
201 silk_NSQ( &psEnc->sCmn, &psEnc->sCmn.sNSQ, &psEnc->sCmn.indices, xfw_Q3, psEnc->sCmn.pulses,
209 silk_encode_indices( &psEnc->sCmn, psRangeEnc, psEnc->sCmn.nFramesEncoded, 0, condCoding );
214 silk_encode_pulses( psRangeEnc, psEnc->sCmn.indices.signalType, psEnc->sCmn.indices.quantOffsetType,
215 psEnc->sCmn.pulses, psEnc->sCmn.frame_length );
230 silk_memcpy( &psEnc->sCmn.sNSQ, &sNSQ_copy2, sizeof( silk_nsq_state ) );
231 psEnc->sShape.LastGainIndex = LastGainIndex_copy2;
258 silk_memcpy( &sNSQ_copy2, &psEnc->sCmn.sNSQ, sizeof( silk_nsq_state ) );
259 LastGainIndex_copy2 = psEnc->sShape.LastGainIndex;
269 gain_factor_Q16 = silk_log2lin( silk_LSHIFT( nBits - maxBits, 7 ) / psEnc->sCmn.frame_length + SILK_FIX_CONST( 16, 7 ) );
287 for( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) {
292 psEnc->sShape.LastGainIndex = sEncCtrl.lastGainIndexPrev;
293 silk_gains_quant( psEnc->sCmn.indices.GainsIndices, sEncCtrl.Gains_Q16,
294 &psEnc->sShape.LastGainIndex, condCoding == CODE_CONDITIONALLY, psEnc->sCmn.nb_subfr );
297 gainsID = silk_gains_ID( psEnc->sCmn.indices.GainsIndices, psEnc->sCmn.nb_subfr );
302 silk_memmove( psEnc->x_buf, &psEnc->x_buf[ psEnc->sCmn.frame_length ],
303 ( psEncpsEnc->sCmn.fs_kHz ) * sizeof( opus_int16 ) );
306 if( psEnc->sCmn.prefillFlag ) {
314 psEnc->sCmn.prevLag = sEncCtrl.pitchL[ psEnc->sCmn.nb_subfr - 1 ];
315 psEnc->sCmn.prevSignalType = psEnc->sCmn.indices.signalType;
320 psEnc->sCmn.first_frame_after_reset = 0;
330 silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk FIX encoder state */
337 SideInfoIndices *psIndices_LBRR = &psEnc->sCmn.indices_LBRR[ psEnc->sCmn.nFramesEncoded ];
343 if( psEnc->sCmn.LBRR_enabled && psEnc->sCmn.speech_activity_Q8 > SILK_FIX_CONST( LBRR_SPEECH_ACTIVITY_THRES, 8 ) ) {
344 psEnc->sCmn.LBRR_flags[ psEnc->sCmn.nFramesEncoded ] = 1;
347 silk_memcpy( &sNSQ_LBRR, &psEnc->sCmn.sNSQ, sizeof( silk_nsq_state ) );
348 silk_memcpy( psIndices_LBRR, &psEnc->sCmn.indices, sizeof( SideInfoIndices ) );
351 silk_memcpy( TempGains_Q16, psEncCtrl->Gains_Q16, psEnc->sCmn.nb_subfr * sizeof( opus_int32 ) );
353 if( psEnc->sCmn.nFramesEncoded == 0 || psEnc->sCmn.LBRR_flags[ psEnc->sCmn.nFramesEncoded - 1 ] == 0 ) {
355 psEnc->sCmn.LBRRprevLastGainIndex = psEnc->sShape.LastGainIndex;
358 psIndices_LBRR->GainsIndices[ 0 ] = psIndices_LBRR->GainsIndices[ 0 ] + psEnc->sCmn.LBRR_GainIncreases;
365 &psEnc->sCmn.LBRRprevLastGainIndex, condCoding == CODE_CONDITIONALLY, psEnc->sCmn.nb_subfr );
370 if( psEnc->sCmn.nStatesDelayedDecision > 1 || psEnc->sCmn.warping_Q16 > 0 ) {
371 silk_NSQ_del_dec( &psEnc->sCmn, &sNSQ_LBRR, psIndices_LBRR, xfw_Q3,
372 psEnc->sCmn.pulses_LBRR[ psEnc->sCmn.nFramesEncoded ], psEncCtrl->PredCoef_Q12[ 0 ], psEncCtrl->LTPCoef_Q14,
376 silk_NSQ( &psEnc->sCmn, &sNSQ_LBRR, psIndices_LBRR, xfw_Q3,
377 psEnc->sCmn.pulses_LBRR[ psEnc->sCmn.nFramesEncoded ], psEncCtrl->PredCoef_Q12[ 0 ], psEncCtrl->LTPCoef_Q14,
383 silk_memcpy( psEncCtrl->Gains_Q16, TempGains_Q16, psEnc->sCmn.nb_subfr * sizeof( opus_int32 ) );