Loading lib_enc/acelp_core_enc.c +0 −2 Original line number Diff line number Diff line Loading @@ -556,8 +556,6 @@ ivas_error acelp_core_enc( { st->mem_deemp_preQ_fx = 0; move16(); st->mem_preemp_preQ = 0.0f; st->last_code_preq = 0; move16(); st->last_nq_preQ = 0; Loading lib_enc/core_enc_init.c +47 −22 Original line number Diff line number Diff line Loading @@ -823,9 +823,14 @@ static void init_sig_buffers( /* Initialize Signal Buffers and Pointers at encoder-sampling-rate */ if ( st->ini_frame == 0 ) { #ifdef IVAS_FLOAT_FIXED set16_fx( st->buf_speech_enc_pe, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); st->exp_buf_speech_enc_pe = 0; set16_fx( st->buf_speech_enc, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); st->exp_buf_speech_enc = 0; #else set_zero( st->buf_speech_enc_flt, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); set_zero( st->buf_speech_enc_pe_flt, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); #ifndef IVAS_FLOAT_FIXED set_zero( st->buf_wspeech_enc_flt, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320 ); #endif if ( hTcxEnc != NULL ) Loading @@ -836,33 +841,50 @@ static void init_sig_buffers( else if ( st->L_frame != L_frame_old && !( ( total_brate >= ACELP_16k40 && total_brate <= ACELP_24k40 ) && ( total_brate == last_total_brate ) && ( st->last_bwidth == st->bwidth ) ) ) { #ifndef IVAS_FLOAT_FIXED lerp_flt( st->buf_speech_enc_flt, st->buf_speech_enc_flt, st->L_frame, L_frame_old ); if ( ( st->last_core != TCX_20_CORE ) && ( st->last_core != TCX_10_CORE ) ) { #ifdef IVAS_FLOAT_FIXED floatToFixed_arr( st->buf_speech_enc_flt, st->buf_speech_enc, 0, st->L_frame ); #endif } #ifndef IVAS_FLOAT_FIXED mvr2r( st->old_wsp, st->buf_wspeech_enc_flt + st->L_frame + L_SUBFR - L_WSP_MEM, L_WSP_MEM ); #endif /*Resamp buffers needed only for ACELP*/ if ( st->L_frame == L_FRAME && !st->tcxonly ) { #ifndef IVAS_FLOAT_FIXED // Need to remove after cleanup of old_inp_12k8 mvr2r( st->old_inp_12k8, st->buf_speech_enc_pe_flt + st->L_frame - L_INP_MEM, L_INP_MEM ); #else Word16 tmp; f2me_buf_16( st->old_inp_12k8, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, &tmp, L_INP_MEM ); /* SCaling to common exponent*/ Scale_sig( st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM, sub( tmp, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe, st->L_frame - L_INP_MEM, sub( st->exp_buf_speech_enc_pe, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe + st->L_frame, sub( L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k, st->L_frame ), sub( st->exp_buf_speech_enc_pe, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); st->exp_buf_speech_enc_pe = s_max( tmp, st->exp_buf_speech_enc_pe ); #endif } else if ( st->L_frame == L_FRAME16k && !st->tcxonly ) { #ifndef IVAS_FLOAT_FIXED lerp_flt( st->buf_wspeech_enc_flt + st->L_frame + L_SUBFR - L_WSP_MEM, st->buf_wspeech_enc_flt + st->L_frame + L_SUBFR - 310, 310, L_WSP_MEM ); #endif #ifndef IVAS_FLOAT_FIXED // Need to remove after cleanup of old_inp_12k8 mvr2r( st->old_inp_16k, st->buf_speech_enc_pe_flt + st->L_frame - L_INP_MEM, L_INP_MEM ); #else Word16 tmp; f2me_buf_16( st->old_inp_12k8, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, &tmp, L_INP_MEM ); /* SCaling to common exponent*/ Scale_sig( st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM, sub( tmp, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe, st->L_frame - L_INP_MEM, sub( st->exp_buf_speech_enc_pe, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe + st->L_frame, sub( L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k, st->L_frame ), sub( st->exp_buf_speech_enc_pe, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); st->exp_buf_speech_enc_pe = s_max( tmp, st->exp_buf_speech_enc_pe ); #endif } st->mem_preemph_enc_flt = st->buf_speech_enc_flt[st->L_frame - 1]; #ifndef IVAS_FLOAT_FIXED st->mem_preemph_enc_flt = st->buf_speech_enc_flt[st->L_frame - 1]; st->mem_wsp_enc_flt = st->buf_wspeech_enc_flt[st->L_frame + L_SUBFR - 1]; #endif } Loading @@ -881,23 +903,11 @@ static void init_sig_buffers( #endif } #ifndef IVAS_FLOAT_FIXED st->new_speech_enc_flt = st->buf_speech_enc_flt + st->encoderPastSamples_enc + st->encoderLookahead_enc; st->new_speech_enc_pe_flt = st->buf_speech_enc_pe_flt + st->encoderPastSamples_enc + st->encoderLookahead_enc; if ( hTcxEnc != NULL ) { // hTcxEnc->new_speech_ltp_flt = hTcxEnc->buf_speech_ltp_flt + st->encoderPastSamples_enc + st->encoderLookahead_enc; } st->speech_enc_flt = st->buf_speech_enc_flt + st->encoderPastSamples_enc; st->speech_enc_pe_flt = st->buf_speech_enc_pe_flt + st->encoderPastSamples_enc; if ( hTcxEnc != NULL ) { // hTcxEnc->speech_ltp_flt = hTcxEnc->buf_speech_ltp_flt + st->encoderPastSamples_enc; } #ifndef IVAS_FLOAT_FIXED if ( st->element_mode > EVS_MONO ) { st->wspeech_enc_flt = st->buf_wspeech_enc_flt + st->L_frame + L_SUBFR; Loading Loading @@ -932,7 +942,11 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol IF( st->ini_frame == 0 ) { set16_fx( st->buf_speech_enc, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); st->exp_buf_speech_enc = 0; move16(); set16_fx( st->buf_speech_enc_pe, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); st->exp_buf_speech_enc_pe = 0; move16(); if ( hTcxEnc != NULL ) { set16_fx( hTcxEnc->buf_speech_ltp, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); Loading @@ -955,7 +969,9 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol IF( NE_16( st->last_core, TCX_20_CORE ) && NE_16( st->last_core, TCX_10_CORE ) ) /* condition should be checked again */ { Copy( st->buf_speech_enc, hTcxEnc->buf_speech_ltp, st->L_frame ); hTcxEnc->exp_buf_speech_ltp = st->exp_buf_speech_enc; Scale_sig( hTcxEnc->buf_speech_ltp, st->L_frame, sub( st->exp_buf_speech_enc, s_max( st->exp_buf_speech_enc, hTcxEnc->exp_buf_speech_ltp ) ) ); Scale_sig( hTcxEnc->buf_speech_ltp + st->L_frame, sub( L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k, st->L_frame ), sub( hTcxEnc->exp_buf_speech_ltp, s_max( st->exp_buf_speech_enc, hTcxEnc->exp_buf_speech_ltp ) ) ); hTcxEnc->exp_buf_speech_ltp = s_max( hTcxEnc->exp_buf_speech_ltp, st->exp_buf_speech_enc ); move16(); } Loading @@ -971,19 +987,28 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol { // Copy_Scale_sig( st->old_inp_12k8_fx, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM, sub( st->prev_Q_new, st->prev_Q_old ) ); Copy( st->old_inp_12k8_fx, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM ); st->exp_buf_speech_enc_pe = st->exp_old_inp_12k8; /* SCaling to common exponent*/ Scale_sig( st->buf_speech_enc_pe + sub( st->L_frame, L_INP_MEM ), L_INP_MEM, sub( st->exp_old_inp_12k8, s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe, sub( st->L_frame, L_INP_MEM ), sub( st->exp_buf_speech_enc_pe, s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe + st->L_frame, sub( L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k, st->L_frame ), sub( st->exp_buf_speech_enc_pe, s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ) ) ); st->exp_buf_speech_enc_pe = s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ); move16(); } ELSE IF( EQ_16( st->L_frame, L_FRAME16k ) && !st->tcxonly ) { lerp( st->buf_wspeech_enc + st->L_frame + L_SUBFR - L_WSP_MEM, st->buf_wspeech_enc + st->L_frame + L_SUBFR - 310, 310, L_WSP_MEM ); Copy( st->old_inp_16k_fx, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM ); st->exp_buf_speech_enc_pe = st->exp_old_inp_16k; /* SCaling to common exponent*/ Scale_sig( st->buf_speech_enc_pe + sub( st->L_frame, L_INP_MEM ), L_INP_MEM, sub( st->exp_old_inp_12k8, s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe, sub( st->L_frame, L_INP_MEM ), sub( st->exp_buf_speech_enc_pe, s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe + st->L_frame, sub( L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k, st->L_frame ), sub( st->exp_buf_speech_enc_pe, s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ) ) ); st->exp_buf_speech_enc_pe = s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ); move16(); } st->mem_preemph_enc = st->buf_speech_enc[st->encoderPastSamples_enc + st->encoderLookahead_enc - 1]; move16(); st->exp_mem_preemph_enc = st->exp_buf_speech_enc; st->mem_wsp_enc = shr( st->buf_wspeech_enc[st->L_frame + L_SUBFR - 1], sub( Q16, st->exp_buf_wspeech_enc ) ); // Q-1 move16(); } Loading lib_enc/core_enc_init_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -462,7 +462,11 @@ void init_sig_buffers_fx( Encoder_State *st, const Word16 L_frame_old, const Wor IF( st->ini_frame == 0 ) { set16_fx( st->buf_speech_enc, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); st->exp_buf_speech_enc = 0; move16(); set16_fx( st->buf_speech_enc_pe, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); st->exp_buf_speech_enc_pe = 0; move16(); set16_fx( hTcxEnc->buf_speech_ltp, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); set16_fx( st->buf_wspeech_enc, 0, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k ); } Loading lib_enc/core_enc_switch.c +0 −1 Original line number Diff line number Diff line Loading @@ -207,7 +207,6 @@ void core_coder_mode_switch_ivas_fx( move32(); /* Initialize Signal Buffers */ f2me_buf_16( st->buf_speech_enc_flt, st->buf_speech_enc, &st->exp_buf_speech_enc, st->L_frame ); f2me_buf_16( st->old_wsp, st->old_wsp_fx, &st->exp_old_wsp, L_WSP_MEM ); f2me_buf_16( st->old_inp_12k8, st->old_inp_12k8_fx, &st->exp_old_inp_12k8, L_INP_MEM ); f2me_buf_16( st->old_inp_16k, st->old_inp_16k_fx, &st->exp_old_inp_16k, L_INP_MEM ); Loading lib_enc/init_enc.c +14 −24 Original line number Diff line number Diff line Loading @@ -177,19 +177,21 @@ ivas_error init_encoder( #ifdef IVAS_FLOAT_FIXED set16_fx( st->old_wsp_fx, 0, L_WSP_MEM ); #endif #ifndef IVAS_FLOAT_FIXED set_f( st->old_wsp2, 0, ( L_WSP_MEM - L_INTERPOL ) / OPL_DECIM ); st->mem_preemph = 0.0f; st->mem_preemph16k = 0.0f; st->mem_preemph_enc_flt = 0.0; #endif st->mem_preemph = 0.0f; #ifdef IVAS_FLOAT_FIXED st->mem_preemph_fx = 0; st->mem_preemph16k_fx = 0; st->mem_preemph_enc = 0; st->exp_mem_preemph_enc = 0; st->mem_deemp_preQ_fx = 0; #endif /* AVQ pre-quantizer memory */ st->mem_preemp_preQ = 0.0f; st->last_nq_preQ = 0; st->last_code_preq = 0; st->use_acelp_preq = 0; Loading @@ -197,11 +199,12 @@ ivas_error init_encoder( /* (Decimated) Weighted Speech Memory */ #ifndef IVAS_FLOAT_FIXED st->mem_preemp_preQ = 0.0f; st->mem_wsp_enc_flt = 0.0; #endif st->mem_wsp = 0.0f; set_f( st->mem_decim2, 0, 3 ); #endif #ifndef IVAS_FLOAT_FIXED set_f( st->Bin_E, 0, L_FFT ); Loading Loading @@ -427,12 +430,9 @@ ivas_error init_encoder( st->old_inp_12k8_fx = st->hSignalBuf->old_inp_12k8_fx; st->old_inp_16k_fx = st->hSignalBuf->old_inp_16k_fx; #endif st->buf_speech_enc_pe_flt = st->hSignalBuf->buf_speech_enc_pe_flt; #ifndef IVAS_FLOAT_FIXED st->buf_synth_flt = st->hSignalBuf->buf_synth_flt; #endif st->buf_speech_enc_flt = st->hSignalBuf->buf_speech_enc_flt; #ifndef IVAS_FLOAT_FIXED st->buf_wspeech_enc_flt = st->hSignalBuf->buf_wspeech_enc_flt; #endif Loading Loading @@ -502,12 +502,9 @@ ivas_error init_encoder( st->mem_decim16k = NULL; st->old_inp_12k8 = NULL; st->old_inp_16k = NULL; st->buf_speech_enc_pe_flt = NULL; #ifndef IVAS_FLOAT_FIXED st->buf_synth_flt = NULL; #endif st->buf_speech_enc_flt = NULL; #ifdef IVAS_FLOAT_FIXED st->buf_speech_enc = NULL; #endif #ifndef IVAS_FLOAT_FIXED Loading Loading @@ -1363,6 +1360,8 @@ ivas_error init_encoder_ivas_fx( pitch_ol_init_fx( &st->old_thres_fx, &st->old_pitch, &st->delta_pit, &st->old_corr_fx ); set16_fx( st->old_wsp_fx, 0, L_WSP_MEM ); set16_fx( st->old_wsp2_fx, 0, ( L_WSP_MEM - L_INTERPOL ) / OPL_DECIM ); // Needs to change depending on usage. st->Q_old_wsp2 = 0; move16(); st->mem_preemph_fx = 0; move16(); Loading @@ -1370,16 +1369,12 @@ ivas_error init_encoder_ivas_fx( move16(); st->mem_preemph_enc = 0; move16(); st->exp_mem_preemph_enc = 0; move16(); #if 1 // TODO: Float Initializations. To be removed later set_f( st->old_wsp, 0, L_WSP_MEM ); set_f( st->old_wsp2, 0, ( L_WSP_MEM - L_INTERPOL ) / OPL_DECIM ); // Needs to change depending on usage. st->mem_preemph = 0.0f; st->mem_preemph16k = 0.0f; st->mem_preemph_enc_flt = 0.0; st->mem_preemp_preQ = 0.0f; st->mem_wsp = 0.0f; set_f( st->mem_decim2, 0, 3 ); st->mem_preemph_DFT = 0.0f; set_f( st->inp_12k8_mem_stereo_sw, 0, STEREO_DFT_OVL_12k8 - L_MEM_RECALC_12K8 - L_FILT ); st->mem_preemph16k_DFT = 0.0f; Loading Loading @@ -1583,6 +1578,8 @@ ivas_error init_encoder_ivas_fx( st->buf_wspeech_enc = st->hSignalBuf->buf_wspeech_enc; set16_fx( st->hSignalBuf->buf_speech_enc, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); st->exp_buf_speech_enc = 0; move16(); set16_fx( st->hSignalBuf->buf_wspeech_enc, 0, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320 ); st->exp_buf_wspeech_enc = 0; move16(); Loading Loading @@ -1624,20 +1621,17 @@ ivas_error init_encoder_ivas_fx( st->mem_decim16k = st->hSignalBuf->mem_decim16k_flt; st->old_inp_12k8 = st->hSignalBuf->old_inp_12k8_flt; st->old_inp_16k = st->hSignalBuf->old_inp_16k_flt; st->buf_speech_enc_pe_flt = st->hSignalBuf->buf_speech_enc_pe_flt; #ifndef IVAS_FLOAT_FIXED st->buf_synth_flt = st->hSignalBuf->buf_synth_flt; #endif st->buf_speech_enc_flt = st->hSignalBuf->buf_speech_enc_flt; #ifndef IVAS_FLOAT_FIXED st->buf_wspeech_enc_flt = st->hSignalBuf->buf_wspeech_enc_flt; #endif set_f( st->mem_decim, 0, 2 * L_FILT_MAX ); set_f( st->mem_decim16k, 0, 2 * L_FILT_MAX ); set_f( st->old_inp_12k8, 0, L_INP_MEM ); set_f( st->old_inp_16k, 0, L_INP_MEM ); set_f( st->hSignalBuf->buf_speech_enc_flt, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); #ifndef IVAS_FLOAT_FIXED set_f( st->hSignalBuf->buf_speech_enc_flt, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); set_f( st->hSignalBuf->buf_wspeech_enc_flt, 0, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320 ); #endif #endif Loading @@ -1660,12 +1654,9 @@ ivas_error init_encoder_ivas_fx( st->mem_decim16k = NULL; st->old_inp_12k8 = NULL; st->old_inp_16k = NULL; st->buf_speech_enc_pe_flt = NULL; #ifndef IVAS_FLOAT_FIXED st->buf_synth_flt = NULL; #endif st->buf_speech_enc_flt = NULL; #ifndef IVAS_FLOAT_FIXED st->buf_wspeech_enc_flt = NULL; #endif #endif Loading Loading @@ -2299,7 +2290,6 @@ ivas_error init_encoder_ivas_fx( #endif /* Initialize Signal Buffers */ f2me_buf_16( st->buf_speech_enc_flt, st->buf_speech_enc, &st->exp_buf_speech_enc, st->L_frame ); f2me_buf_16( st->old_wsp, st->old_wsp_fx, &st->exp_old_wsp, L_WSP_MEM ); f2me_buf_16( st->old_inp_12k8, st->old_inp_12k8_fx, &st->exp_old_inp_12k8, L_INP_MEM ); f2me_buf_16( st->old_inp_16k, st->old_inp_16k_fx, &st->exp_old_inp_16k, L_INP_MEM ); Loading Loading
lib_enc/acelp_core_enc.c +0 −2 Original line number Diff line number Diff line Loading @@ -556,8 +556,6 @@ ivas_error acelp_core_enc( { st->mem_deemp_preQ_fx = 0; move16(); st->mem_preemp_preQ = 0.0f; st->last_code_preq = 0; move16(); st->last_nq_preQ = 0; Loading
lib_enc/core_enc_init.c +47 −22 Original line number Diff line number Diff line Loading @@ -823,9 +823,14 @@ static void init_sig_buffers( /* Initialize Signal Buffers and Pointers at encoder-sampling-rate */ if ( st->ini_frame == 0 ) { #ifdef IVAS_FLOAT_FIXED set16_fx( st->buf_speech_enc_pe, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); st->exp_buf_speech_enc_pe = 0; set16_fx( st->buf_speech_enc, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); st->exp_buf_speech_enc = 0; #else set_zero( st->buf_speech_enc_flt, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); set_zero( st->buf_speech_enc_pe_flt, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); #ifndef IVAS_FLOAT_FIXED set_zero( st->buf_wspeech_enc_flt, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320 ); #endif if ( hTcxEnc != NULL ) Loading @@ -836,33 +841,50 @@ static void init_sig_buffers( else if ( st->L_frame != L_frame_old && !( ( total_brate >= ACELP_16k40 && total_brate <= ACELP_24k40 ) && ( total_brate == last_total_brate ) && ( st->last_bwidth == st->bwidth ) ) ) { #ifndef IVAS_FLOAT_FIXED lerp_flt( st->buf_speech_enc_flt, st->buf_speech_enc_flt, st->L_frame, L_frame_old ); if ( ( st->last_core != TCX_20_CORE ) && ( st->last_core != TCX_10_CORE ) ) { #ifdef IVAS_FLOAT_FIXED floatToFixed_arr( st->buf_speech_enc_flt, st->buf_speech_enc, 0, st->L_frame ); #endif } #ifndef IVAS_FLOAT_FIXED mvr2r( st->old_wsp, st->buf_wspeech_enc_flt + st->L_frame + L_SUBFR - L_WSP_MEM, L_WSP_MEM ); #endif /*Resamp buffers needed only for ACELP*/ if ( st->L_frame == L_FRAME && !st->tcxonly ) { #ifndef IVAS_FLOAT_FIXED // Need to remove after cleanup of old_inp_12k8 mvr2r( st->old_inp_12k8, st->buf_speech_enc_pe_flt + st->L_frame - L_INP_MEM, L_INP_MEM ); #else Word16 tmp; f2me_buf_16( st->old_inp_12k8, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, &tmp, L_INP_MEM ); /* SCaling to common exponent*/ Scale_sig( st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM, sub( tmp, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe, st->L_frame - L_INP_MEM, sub( st->exp_buf_speech_enc_pe, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe + st->L_frame, sub( L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k, st->L_frame ), sub( st->exp_buf_speech_enc_pe, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); st->exp_buf_speech_enc_pe = s_max( tmp, st->exp_buf_speech_enc_pe ); #endif } else if ( st->L_frame == L_FRAME16k && !st->tcxonly ) { #ifndef IVAS_FLOAT_FIXED lerp_flt( st->buf_wspeech_enc_flt + st->L_frame + L_SUBFR - L_WSP_MEM, st->buf_wspeech_enc_flt + st->L_frame + L_SUBFR - 310, 310, L_WSP_MEM ); #endif #ifndef IVAS_FLOAT_FIXED // Need to remove after cleanup of old_inp_12k8 mvr2r( st->old_inp_16k, st->buf_speech_enc_pe_flt + st->L_frame - L_INP_MEM, L_INP_MEM ); #else Word16 tmp; f2me_buf_16( st->old_inp_12k8, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, &tmp, L_INP_MEM ); /* SCaling to common exponent*/ Scale_sig( st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM, sub( tmp, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe, st->L_frame - L_INP_MEM, sub( st->exp_buf_speech_enc_pe, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe + st->L_frame, sub( L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k, st->L_frame ), sub( st->exp_buf_speech_enc_pe, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); st->exp_buf_speech_enc_pe = s_max( tmp, st->exp_buf_speech_enc_pe ); #endif } st->mem_preemph_enc_flt = st->buf_speech_enc_flt[st->L_frame - 1]; #ifndef IVAS_FLOAT_FIXED st->mem_preemph_enc_flt = st->buf_speech_enc_flt[st->L_frame - 1]; st->mem_wsp_enc_flt = st->buf_wspeech_enc_flt[st->L_frame + L_SUBFR - 1]; #endif } Loading @@ -881,23 +903,11 @@ static void init_sig_buffers( #endif } #ifndef IVAS_FLOAT_FIXED st->new_speech_enc_flt = st->buf_speech_enc_flt + st->encoderPastSamples_enc + st->encoderLookahead_enc; st->new_speech_enc_pe_flt = st->buf_speech_enc_pe_flt + st->encoderPastSamples_enc + st->encoderLookahead_enc; if ( hTcxEnc != NULL ) { // hTcxEnc->new_speech_ltp_flt = hTcxEnc->buf_speech_ltp_flt + st->encoderPastSamples_enc + st->encoderLookahead_enc; } st->speech_enc_flt = st->buf_speech_enc_flt + st->encoderPastSamples_enc; st->speech_enc_pe_flt = st->buf_speech_enc_pe_flt + st->encoderPastSamples_enc; if ( hTcxEnc != NULL ) { // hTcxEnc->speech_ltp_flt = hTcxEnc->buf_speech_ltp_flt + st->encoderPastSamples_enc; } #ifndef IVAS_FLOAT_FIXED if ( st->element_mode > EVS_MONO ) { st->wspeech_enc_flt = st->buf_wspeech_enc_flt + st->L_frame + L_SUBFR; Loading Loading @@ -932,7 +942,11 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol IF( st->ini_frame == 0 ) { set16_fx( st->buf_speech_enc, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); st->exp_buf_speech_enc = 0; move16(); set16_fx( st->buf_speech_enc_pe, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); st->exp_buf_speech_enc_pe = 0; move16(); if ( hTcxEnc != NULL ) { set16_fx( hTcxEnc->buf_speech_ltp, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); Loading @@ -955,7 +969,9 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol IF( NE_16( st->last_core, TCX_20_CORE ) && NE_16( st->last_core, TCX_10_CORE ) ) /* condition should be checked again */ { Copy( st->buf_speech_enc, hTcxEnc->buf_speech_ltp, st->L_frame ); hTcxEnc->exp_buf_speech_ltp = st->exp_buf_speech_enc; Scale_sig( hTcxEnc->buf_speech_ltp, st->L_frame, sub( st->exp_buf_speech_enc, s_max( st->exp_buf_speech_enc, hTcxEnc->exp_buf_speech_ltp ) ) ); Scale_sig( hTcxEnc->buf_speech_ltp + st->L_frame, sub( L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k, st->L_frame ), sub( hTcxEnc->exp_buf_speech_ltp, s_max( st->exp_buf_speech_enc, hTcxEnc->exp_buf_speech_ltp ) ) ); hTcxEnc->exp_buf_speech_ltp = s_max( hTcxEnc->exp_buf_speech_ltp, st->exp_buf_speech_enc ); move16(); } Loading @@ -971,19 +987,28 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol { // Copy_Scale_sig( st->old_inp_12k8_fx, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM, sub( st->prev_Q_new, st->prev_Q_old ) ); Copy( st->old_inp_12k8_fx, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM ); st->exp_buf_speech_enc_pe = st->exp_old_inp_12k8; /* SCaling to common exponent*/ Scale_sig( st->buf_speech_enc_pe + sub( st->L_frame, L_INP_MEM ), L_INP_MEM, sub( st->exp_old_inp_12k8, s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe, sub( st->L_frame, L_INP_MEM ), sub( st->exp_buf_speech_enc_pe, s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe + st->L_frame, sub( L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k, st->L_frame ), sub( st->exp_buf_speech_enc_pe, s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ) ) ); st->exp_buf_speech_enc_pe = s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ); move16(); } ELSE IF( EQ_16( st->L_frame, L_FRAME16k ) && !st->tcxonly ) { lerp( st->buf_wspeech_enc + st->L_frame + L_SUBFR - L_WSP_MEM, st->buf_wspeech_enc + st->L_frame + L_SUBFR - 310, 310, L_WSP_MEM ); Copy( st->old_inp_16k_fx, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM ); st->exp_buf_speech_enc_pe = st->exp_old_inp_16k; /* SCaling to common exponent*/ Scale_sig( st->buf_speech_enc_pe + sub( st->L_frame, L_INP_MEM ), L_INP_MEM, sub( st->exp_old_inp_12k8, s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe, sub( st->L_frame, L_INP_MEM ), sub( st->exp_buf_speech_enc_pe, s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe + st->L_frame, sub( L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k, st->L_frame ), sub( st->exp_buf_speech_enc_pe, s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ) ) ); st->exp_buf_speech_enc_pe = s_max( st->exp_old_inp_12k8, st->exp_buf_speech_enc_pe ); move16(); } st->mem_preemph_enc = st->buf_speech_enc[st->encoderPastSamples_enc + st->encoderLookahead_enc - 1]; move16(); st->exp_mem_preemph_enc = st->exp_buf_speech_enc; st->mem_wsp_enc = shr( st->buf_wspeech_enc[st->L_frame + L_SUBFR - 1], sub( Q16, st->exp_buf_wspeech_enc ) ); // Q-1 move16(); } Loading
lib_enc/core_enc_init_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -462,7 +462,11 @@ void init_sig_buffers_fx( Encoder_State *st, const Word16 L_frame_old, const Wor IF( st->ini_frame == 0 ) { set16_fx( st->buf_speech_enc, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); st->exp_buf_speech_enc = 0; move16(); set16_fx( st->buf_speech_enc_pe, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); st->exp_buf_speech_enc_pe = 0; move16(); set16_fx( hTcxEnc->buf_speech_ltp, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); set16_fx( st->buf_wspeech_enc, 0, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k ); } Loading
lib_enc/core_enc_switch.c +0 −1 Original line number Diff line number Diff line Loading @@ -207,7 +207,6 @@ void core_coder_mode_switch_ivas_fx( move32(); /* Initialize Signal Buffers */ f2me_buf_16( st->buf_speech_enc_flt, st->buf_speech_enc, &st->exp_buf_speech_enc, st->L_frame ); f2me_buf_16( st->old_wsp, st->old_wsp_fx, &st->exp_old_wsp, L_WSP_MEM ); f2me_buf_16( st->old_inp_12k8, st->old_inp_12k8_fx, &st->exp_old_inp_12k8, L_INP_MEM ); f2me_buf_16( st->old_inp_16k, st->old_inp_16k_fx, &st->exp_old_inp_16k, L_INP_MEM ); Loading
lib_enc/init_enc.c +14 −24 Original line number Diff line number Diff line Loading @@ -177,19 +177,21 @@ ivas_error init_encoder( #ifdef IVAS_FLOAT_FIXED set16_fx( st->old_wsp_fx, 0, L_WSP_MEM ); #endif #ifndef IVAS_FLOAT_FIXED set_f( st->old_wsp2, 0, ( L_WSP_MEM - L_INTERPOL ) / OPL_DECIM ); st->mem_preemph = 0.0f; st->mem_preemph16k = 0.0f; st->mem_preemph_enc_flt = 0.0; #endif st->mem_preemph = 0.0f; #ifdef IVAS_FLOAT_FIXED st->mem_preemph_fx = 0; st->mem_preemph16k_fx = 0; st->mem_preemph_enc = 0; st->exp_mem_preemph_enc = 0; st->mem_deemp_preQ_fx = 0; #endif /* AVQ pre-quantizer memory */ st->mem_preemp_preQ = 0.0f; st->last_nq_preQ = 0; st->last_code_preq = 0; st->use_acelp_preq = 0; Loading @@ -197,11 +199,12 @@ ivas_error init_encoder( /* (Decimated) Weighted Speech Memory */ #ifndef IVAS_FLOAT_FIXED st->mem_preemp_preQ = 0.0f; st->mem_wsp_enc_flt = 0.0; #endif st->mem_wsp = 0.0f; set_f( st->mem_decim2, 0, 3 ); #endif #ifndef IVAS_FLOAT_FIXED set_f( st->Bin_E, 0, L_FFT ); Loading Loading @@ -427,12 +430,9 @@ ivas_error init_encoder( st->old_inp_12k8_fx = st->hSignalBuf->old_inp_12k8_fx; st->old_inp_16k_fx = st->hSignalBuf->old_inp_16k_fx; #endif st->buf_speech_enc_pe_flt = st->hSignalBuf->buf_speech_enc_pe_flt; #ifndef IVAS_FLOAT_FIXED st->buf_synth_flt = st->hSignalBuf->buf_synth_flt; #endif st->buf_speech_enc_flt = st->hSignalBuf->buf_speech_enc_flt; #ifndef IVAS_FLOAT_FIXED st->buf_wspeech_enc_flt = st->hSignalBuf->buf_wspeech_enc_flt; #endif Loading Loading @@ -502,12 +502,9 @@ ivas_error init_encoder( st->mem_decim16k = NULL; st->old_inp_12k8 = NULL; st->old_inp_16k = NULL; st->buf_speech_enc_pe_flt = NULL; #ifndef IVAS_FLOAT_FIXED st->buf_synth_flt = NULL; #endif st->buf_speech_enc_flt = NULL; #ifdef IVAS_FLOAT_FIXED st->buf_speech_enc = NULL; #endif #ifndef IVAS_FLOAT_FIXED Loading Loading @@ -1363,6 +1360,8 @@ ivas_error init_encoder_ivas_fx( pitch_ol_init_fx( &st->old_thres_fx, &st->old_pitch, &st->delta_pit, &st->old_corr_fx ); set16_fx( st->old_wsp_fx, 0, L_WSP_MEM ); set16_fx( st->old_wsp2_fx, 0, ( L_WSP_MEM - L_INTERPOL ) / OPL_DECIM ); // Needs to change depending on usage. st->Q_old_wsp2 = 0; move16(); st->mem_preemph_fx = 0; move16(); Loading @@ -1370,16 +1369,12 @@ ivas_error init_encoder_ivas_fx( move16(); st->mem_preemph_enc = 0; move16(); st->exp_mem_preemph_enc = 0; move16(); #if 1 // TODO: Float Initializations. To be removed later set_f( st->old_wsp, 0, L_WSP_MEM ); set_f( st->old_wsp2, 0, ( L_WSP_MEM - L_INTERPOL ) / OPL_DECIM ); // Needs to change depending on usage. st->mem_preemph = 0.0f; st->mem_preemph16k = 0.0f; st->mem_preemph_enc_flt = 0.0; st->mem_preemp_preQ = 0.0f; st->mem_wsp = 0.0f; set_f( st->mem_decim2, 0, 3 ); st->mem_preemph_DFT = 0.0f; set_f( st->inp_12k8_mem_stereo_sw, 0, STEREO_DFT_OVL_12k8 - L_MEM_RECALC_12K8 - L_FILT ); st->mem_preemph16k_DFT = 0.0f; Loading Loading @@ -1583,6 +1578,8 @@ ivas_error init_encoder_ivas_fx( st->buf_wspeech_enc = st->hSignalBuf->buf_wspeech_enc; set16_fx( st->hSignalBuf->buf_speech_enc, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); st->exp_buf_speech_enc = 0; move16(); set16_fx( st->hSignalBuf->buf_wspeech_enc, 0, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320 ); st->exp_buf_wspeech_enc = 0; move16(); Loading Loading @@ -1624,20 +1621,17 @@ ivas_error init_encoder_ivas_fx( st->mem_decim16k = st->hSignalBuf->mem_decim16k_flt; st->old_inp_12k8 = st->hSignalBuf->old_inp_12k8_flt; st->old_inp_16k = st->hSignalBuf->old_inp_16k_flt; st->buf_speech_enc_pe_flt = st->hSignalBuf->buf_speech_enc_pe_flt; #ifndef IVAS_FLOAT_FIXED st->buf_synth_flt = st->hSignalBuf->buf_synth_flt; #endif st->buf_speech_enc_flt = st->hSignalBuf->buf_speech_enc_flt; #ifndef IVAS_FLOAT_FIXED st->buf_wspeech_enc_flt = st->hSignalBuf->buf_wspeech_enc_flt; #endif set_f( st->mem_decim, 0, 2 * L_FILT_MAX ); set_f( st->mem_decim16k, 0, 2 * L_FILT_MAX ); set_f( st->old_inp_12k8, 0, L_INP_MEM ); set_f( st->old_inp_16k, 0, L_INP_MEM ); set_f( st->hSignalBuf->buf_speech_enc_flt, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); #ifndef IVAS_FLOAT_FIXED set_f( st->hSignalBuf->buf_speech_enc_flt, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); set_f( st->hSignalBuf->buf_wspeech_enc_flt, 0, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320 ); #endif #endif Loading @@ -1660,12 +1654,9 @@ ivas_error init_encoder_ivas_fx( st->mem_decim16k = NULL; st->old_inp_12k8 = NULL; st->old_inp_16k = NULL; st->buf_speech_enc_pe_flt = NULL; #ifndef IVAS_FLOAT_FIXED st->buf_synth_flt = NULL; #endif st->buf_speech_enc_flt = NULL; #ifndef IVAS_FLOAT_FIXED st->buf_wspeech_enc_flt = NULL; #endif #endif Loading Loading @@ -2299,7 +2290,6 @@ ivas_error init_encoder_ivas_fx( #endif /* Initialize Signal Buffers */ f2me_buf_16( st->buf_speech_enc_flt, st->buf_speech_enc, &st->exp_buf_speech_enc, st->L_frame ); f2me_buf_16( st->old_wsp, st->old_wsp_fx, &st->exp_old_wsp, L_WSP_MEM ); f2me_buf_16( st->old_inp_12k8, st->old_inp_12k8_fx, &st->exp_old_inp_12k8, L_INP_MEM ); f2me_buf_16( st->old_inp_16k, st->old_inp_16k_fx, &st->exp_old_inp_16k, L_INP_MEM ); Loading