Loading lib_enc/core_enc_init_fx.c +12 −0 Original line number Diff line number Diff line Loading @@ -1355,6 +1355,10 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol Copy( st->old_wsp_fx, st->buf_wspeech_enc + st->L_frame + L_SUBFR - L_WSP_MEM, L_WSP_MEM ); st->exp_buf_wspeech_enc = st->exp_old_wsp; move16(); #ifdef NONBE_FIX_ISSUE_2206 st->mem_wsp_enc = st->buf_wspeech_enc[st->L_frame + L_SUBFR - 1]; move16(); #endif /*Resamp buffers needed only for ACELP*/ test(); Loading Loading @@ -1397,8 +1401,10 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol move16(); st->exp_mem_preemph_enc = st->exp_buf_speech_enc; move16(); #ifndef NONBE_FIX_ISSUE_2206 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(); #endif } /*coming from TCXonly modes*/ ELSE IF( !st->tcxonly && GE_32( last_total_brate, ACELP_32k ) ) Loading @@ -1407,6 +1413,10 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol Scale_sig( st->buf_wspeech_enc, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320, sub( 0, sub( st->exp_old_wsp, st->exp_buf_wspeech_enc ) ) ); Copy( st->old_wsp_fx, st->buf_wspeech_enc + st->L_frame + L_SUBFR - L_WSP_MEM, L_WSP_MEM ); // Copy_Scale_sig( st->old_wsp_fx, st->buf_wspeech_enc + st->L_frame + L_SUBFR - L_WSP_MEM, L_WSP_MEM, sub( st->prev_Q_new, st->prev_Q_old ) ); #ifdef NONBE_FIX_ISSUE_2206 st->mem_wsp_enc = st->buf_wspeech_enc[st->L_frame + L_SUBFR - 1]; move16(); #endif st->exp_buf_wspeech_enc = st->exp_old_wsp; move16(); /*Resamp buffers needed only for ACELP*/ IF( EQ_16( st->L_frame, L_FRAME16k ) ) Loading @@ -1415,8 +1425,10 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol } hLPDmem->mem_w0 = 0; move16(); #ifndef NONBE_FIX_ISSUE_2206 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(); #endif } } Loading lib_enc/ivas_core_pre_proc_front_fx.c +1 −4 Original line number Diff line number Diff line Loading @@ -1581,10 +1581,7 @@ ivas_error pre_proc_front_ivas_fx( *epsP_fx_q = add( Q_r[0], 1 ); move16(); #ifdef NONBE_FIX_ISSUE_2206 // st->mem_wsp_enc = shl( st->mem_wsp_enc, sub( 0, st->mem_wsp_q ) ); // Q0 // move16(); #else #ifndef NONBE_FIX_ISSUE_2206 st->mem_wsp_enc = shl( st->mem_wsp_enc, sub( 0, sub( Q15, st->exp_buf_wspeech_enc ) ) ); // Q0 move16(); #endif Loading lib_enc/ivas_core_pre_proc_fx.c +13 −5 Original line number Diff line number Diff line Loading @@ -704,6 +704,7 @@ ivas_error pre_proc_ivas_fx( tmp = s_min( tmp, norm_arr( st->buf_speech_enc_pe, st->L_frame ) ); tmp = s_min( tmp, norm_arr( st->buf_speech_enc_pe + st->L_frame + L_FRAME, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k - st->L_frame - L_FRAME ) ); tmp = add( s_min( sub( *Q_new, 1 ), sub( Q15, st->exp_buf_speech_enc_pe ) ), tmp ); tmp = s_min( tmp, sub( Q15, st->exp_buf_wspeech_enc ) ); // because of find_wsp() scale_sig( st->buf_speech_enc_pe, st->L_frame, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); scale_sig( st->buf_speech_enc_pe + st->L_frame + L_FRAME, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k - st->L_frame - L_FRAME, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); Copy_Scale_sig_nosat( new_inp_12k8_fx, st->buf_speech_enc_pe + st->L_frame, L_FRAME, sub( tmp, sub( *Q_new, 1 ) ) ); Loading Loading @@ -731,14 +732,14 @@ ivas_error pre_proc_ivas_fx( { #ifdef NONBE_FIX_ISSUE_2206 // L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320 ); tmp = norm_arr( wsp_fx, L_FRAME + L_LOOK_12k8 ); tmp = s_min( tmp, norm_arr( st->buf_wspeech_enc, (Word16) ( st->wspeech_enc - st->buf_wspeech_enc ) ) ); tmp = s_min( tmp, norm_arr( st->wspeech_enc + L_FRAME + L_LOOK_12k8, /* L_NEXT_MAX_16k + */ 320 ) ); tmp = add( s_min( sub( Q15, e_old_wsp ), sub( Q15, st->exp_buf_wspeech_enc ) ), tmp ); // scale_sig( st->buf_wspeech_enc, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320, tmp ); tmp = add( norm_arr( wsp_fx, L_FRAME + L_LOOK_12k8 ), sub( Q15, e_old_wsp ) ); tmp = s_min( tmp, add( norm_s( st->mem_wsp_enc ), sub( Q15, st->exp_buf_wspeech_enc ) ) ); tmp = s_min( tmp, add( norm_arr( st->buf_wspeech_enc, (Word16) ( st->wspeech_enc - st->buf_wspeech_enc ) ), sub( Q15, st->exp_buf_wspeech_enc ) ) ); tmp = s_min( tmp, add( norm_arr( st->wspeech_enc + L_FRAME + L_LOOK_12k8, /* L_NEXT_MAX_16k + */ 320 ), sub( Q15, st->exp_buf_wspeech_enc ) ) ); scale_sig( st->buf_wspeech_enc, (Word16) ( st->wspeech_enc - st->buf_wspeech_enc ), sub( tmp, sub( Q15, st->exp_buf_wspeech_enc ) ) ); scale_sig( st->wspeech_enc + L_FRAME + L_LOOK_12k8, /* L_NEXT_MAX_16k + */ 320, sub( tmp, sub( Q15, st->exp_buf_wspeech_enc ) ) ); Copy_Scale_sig_nosat( wsp_fx, st->wspeech_enc, L_FRAME + L_LOOK_12k8, sub( tmp, sub( Q15, e_old_wsp ) ) ); st->mem_wsp_enc = shl( st->mem_wsp_enc, sub( st->exp_buf_wspeech_enc, sub( Q15, tmp ) ) ); st->exp_buf_wspeech_enc = sub( Q15, tmp ); move16(); #else Loading Loading @@ -1467,6 +1468,7 @@ ivas_error ivas_compute_core_buffers_fx( tmp = s_min( tmp, norm_arr( st->buf_speech_enc_pe, L_FRAME16k - STEREO_DFT_OVL_16k ) ); tmp = s_min( tmp, norm_arr( st->buf_speech_enc_pe + L_FRAME16k + L_FRAME16k, L_PAST_MAX_32k + L_NEXT_MAX_32k ) ); tmp = add( s_min( sub( *Q_new, 1 ), sub( Q15, st->exp_buf_speech_enc_pe ) ), tmp ); tmp = s_min( tmp, sub( Q15, st->exp_buf_wspeech_enc ) ); // because of find_wsp() scale_sig( st->buf_speech_enc_pe, L_FRAME16k - STEREO_DFT_OVL_16k, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); scale_sig( st->buf_speech_enc_pe + L_FRAME16k + L_FRAME16k, L_PAST_MAX_32k + L_NEXT_MAX_32k, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); Copy_Scale_sig_nosat( new_inp_16k_fx - STEREO_DFT_OVL_16k, st->buf_speech_enc_pe + L_FRAME16k - STEREO_DFT_OVL_16k, L_FRAME16k + STEREO_DFT_OVL_16k, sub( tmp, sub( *Q_new, 1 ) ) ); Loading @@ -1480,6 +1482,7 @@ ivas_error ivas_compute_core_buffers_fx( tmp = s_min( tmp, norm_arr( st->buf_speech_enc_pe, L_FRAME16k - lMemRecalc_16k - L_FILT16k ) ); tmp = s_min( tmp, norm_arr( st->buf_speech_enc_pe + L_FRAME16k + L_FRAME16k, L_PAST_MAX_32k + L_NEXT_MAX_32k ) ); tmp = add( s_min( sub( *Q_new, 1 ), sub( Q15, st->exp_buf_speech_enc_pe ) ), tmp ); tmp = s_min( tmp, sub( Q15, st->exp_buf_wspeech_enc ) ); // because of find_wsp() scale_sig( st->buf_speech_enc_pe, L_FRAME16k - lMemRecalc_16k - L_FILT16k, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); scale_sig( st->buf_speech_enc_pe + L_FRAME16k + L_FRAME16k, L_PAST_MAX_32k + L_NEXT_MAX_32k, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); Copy_Scale_sig_nosat( new_inp_16k_fx - lMemRecalc_16k, st->buf_speech_enc_pe + L_FRAME16k - lMemRecalc_16k - L_FILT16k, L_FRAME16k + lMemRecalc_16k + L_FILT16k, sub( tmp, sub( *Q_new, 1 ) ) ); Loading @@ -1501,6 +1504,7 @@ ivas_error ivas_compute_core_buffers_fx( tmp = norm_arr( new_inp_16k_fx, L_FRAME16k ); tmp = s_min( tmp, norm_arr( st->buf_speech_enc_pe, L_FRAME16k ) ); tmp = add( s_min( sub( *Q_new, 1 ), sub( Q15, st->exp_buf_speech_enc_pe ) ), tmp ); tmp = s_min( tmp, sub( Q15, st->exp_buf_wspeech_enc ) ); // because of find_wsp() scale_sig( st->buf_speech_enc_pe, L_FRAME16k, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); Copy_Scale_sig_nosat( new_inp_16k_fx, st->buf_speech_enc_pe + L_FRAME16k, L_FRAME16k, sub( tmp, sub( *Q_new, 1 ) ) ); st->exp_buf_speech_enc_pe = sub( Q15, tmp ); Loading Loading @@ -1557,6 +1561,9 @@ ivas_error ivas_compute_core_buffers_fx( /*--------------------------------------------------------------* * Compute Weighted Input *---------------------------------------------------------------*/ #ifdef NONBE_FIX_ISSUE_2206 st->mem_wsp_enc = shl( st->mem_wsp_enc, sub( st->exp_buf_wspeech_enc, st->exp_buf_speech_enc_pe ) ); #endif ivas_find_wsp_fx( L_FRAME16k, L_SUBFR, NB_SUBFR16k, A_fx, Aw_fx, st->speech_enc_pe, PREEMPH_FAC_16k, st->wspeech_enc, &st->mem_wsp_enc, st->gamma, L_LOOK_16k ); #ifdef NONBE_FIX_ISSUE_2206 Loading @@ -1572,6 +1579,7 @@ ivas_error ivas_compute_core_buffers_fx( scale_sig( st->wspeech_enc, L_FRAME16k + L_LOOK_16k, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); scale_sig( st->wspeech_enc + L_FRAME16k + L_LOOK_16k, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320 - ( (Word16) ( st->wspeech_enc - st->buf_wspeech_enc ) + L_FRAME16k + L_LOOK_16k ), sub( tmp, sub( Q15, st->exp_buf_wspeech_enc ) ) ); st->exp_buf_wspeech_enc = sub( Q15, tmp ); st->mem_wsp_enc = shl( st->mem_wsp_enc, sub( st->exp_buf_speech_enc_pe, st->exp_buf_wspeech_enc ) ); move16(); #endif } Loading lib_enc/ivas_tcx_core_enc_fx.c +4 −7 Original line number Diff line number Diff line Loading @@ -559,10 +559,8 @@ void stereo_tcx_core_enc( IF( st->tcxonly == 0 ) { #ifdef NONBE_FIX_ISSUE_2206 // Is this a mixup with st->mem_wsp_enc ? s = s_min( s, add( norm_arr( st->buf_wspeech_enc, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320 ), sub( sub( Q15, st->exp_buf_wspeech_enc ), Q_new ) ) ); Scale_sig( st->buf_wspeech_enc, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320, sub( add( Q_new, s ), sub( Q15, st->exp_buf_wspeech_enc ) ) ); st->exp_buf_wspeech_enc = sub( Q15, add( Q_new, s ) ); s = s_min( s, add( norm_s( st->buf_wspeech_enc[st->L_frame - 1] ), sub( sub( Q15, st->exp_buf_wspeech_enc ), Q_new ) ) ); st->wspeech_enc[st->L_frame - 1] = shl( st->wspeech_enc[st->L_frame - 1], sub( add( Q_new, s ), sub( Q15, st->exp_buf_wspeech_enc ) ) ); #else s = s_min( s, norm_s( st->wspeech_enc[st->L_frame - 1] ) ); st->wspeech_enc[st->L_frame - 1] = shl( st->wspeech_enc[st->L_frame - 1], s ); Loading Loading @@ -720,9 +718,8 @@ void stereo_tcx_core_enc( IF( st->tcxonly == 0 ) { #ifdef NONBE_FIX_ISSUE_2206 // Is this a mixup with st->mem_wsp_enc ? Scale_sig( st->buf_wspeech_enc, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320, sub( 0, sub( Q15, st->exp_buf_wspeech_enc ) ) ); st->exp_buf_wspeech_enc = sub( Q15, 0 ); /* Revert scale change from above. */ st->wspeech_enc[st->L_frame - 1] = shl( st->wspeech_enc[st->L_frame - 1], sub( sub( Q15, st->exp_buf_wspeech_enc ), Q_new ) ); #else st->wspeech_enc[st->L_frame - 1] = shl( st->wspeech_enc[st->L_frame - 1], -st->Q_syn ); move16(); Loading Loading
lib_enc/core_enc_init_fx.c +12 −0 Original line number Diff line number Diff line Loading @@ -1355,6 +1355,10 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol Copy( st->old_wsp_fx, st->buf_wspeech_enc + st->L_frame + L_SUBFR - L_WSP_MEM, L_WSP_MEM ); st->exp_buf_wspeech_enc = st->exp_old_wsp; move16(); #ifdef NONBE_FIX_ISSUE_2206 st->mem_wsp_enc = st->buf_wspeech_enc[st->L_frame + L_SUBFR - 1]; move16(); #endif /*Resamp buffers needed only for ACELP*/ test(); Loading Loading @@ -1397,8 +1401,10 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol move16(); st->exp_mem_preemph_enc = st->exp_buf_speech_enc; move16(); #ifndef NONBE_FIX_ISSUE_2206 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(); #endif } /*coming from TCXonly modes*/ ELSE IF( !st->tcxonly && GE_32( last_total_brate, ACELP_32k ) ) Loading @@ -1407,6 +1413,10 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol Scale_sig( st->buf_wspeech_enc, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320, sub( 0, sub( st->exp_old_wsp, st->exp_buf_wspeech_enc ) ) ); Copy( st->old_wsp_fx, st->buf_wspeech_enc + st->L_frame + L_SUBFR - L_WSP_MEM, L_WSP_MEM ); // Copy_Scale_sig( st->old_wsp_fx, st->buf_wspeech_enc + st->L_frame + L_SUBFR - L_WSP_MEM, L_WSP_MEM, sub( st->prev_Q_new, st->prev_Q_old ) ); #ifdef NONBE_FIX_ISSUE_2206 st->mem_wsp_enc = st->buf_wspeech_enc[st->L_frame + L_SUBFR - 1]; move16(); #endif st->exp_buf_wspeech_enc = st->exp_old_wsp; move16(); /*Resamp buffers needed only for ACELP*/ IF( EQ_16( st->L_frame, L_FRAME16k ) ) Loading @@ -1415,8 +1425,10 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol } hLPDmem->mem_w0 = 0; move16(); #ifndef NONBE_FIX_ISSUE_2206 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(); #endif } } Loading
lib_enc/ivas_core_pre_proc_front_fx.c +1 −4 Original line number Diff line number Diff line Loading @@ -1581,10 +1581,7 @@ ivas_error pre_proc_front_ivas_fx( *epsP_fx_q = add( Q_r[0], 1 ); move16(); #ifdef NONBE_FIX_ISSUE_2206 // st->mem_wsp_enc = shl( st->mem_wsp_enc, sub( 0, st->mem_wsp_q ) ); // Q0 // move16(); #else #ifndef NONBE_FIX_ISSUE_2206 st->mem_wsp_enc = shl( st->mem_wsp_enc, sub( 0, sub( Q15, st->exp_buf_wspeech_enc ) ) ); // Q0 move16(); #endif Loading
lib_enc/ivas_core_pre_proc_fx.c +13 −5 Original line number Diff line number Diff line Loading @@ -704,6 +704,7 @@ ivas_error pre_proc_ivas_fx( tmp = s_min( tmp, norm_arr( st->buf_speech_enc_pe, st->L_frame ) ); tmp = s_min( tmp, norm_arr( st->buf_speech_enc_pe + st->L_frame + L_FRAME, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k - st->L_frame - L_FRAME ) ); tmp = add( s_min( sub( *Q_new, 1 ), sub( Q15, st->exp_buf_speech_enc_pe ) ), tmp ); tmp = s_min( tmp, sub( Q15, st->exp_buf_wspeech_enc ) ); // because of find_wsp() scale_sig( st->buf_speech_enc_pe, st->L_frame, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); scale_sig( st->buf_speech_enc_pe + st->L_frame + L_FRAME, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k - st->L_frame - L_FRAME, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); Copy_Scale_sig_nosat( new_inp_12k8_fx, st->buf_speech_enc_pe + st->L_frame, L_FRAME, sub( tmp, sub( *Q_new, 1 ) ) ); Loading Loading @@ -731,14 +732,14 @@ ivas_error pre_proc_ivas_fx( { #ifdef NONBE_FIX_ISSUE_2206 // L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320 ); tmp = norm_arr( wsp_fx, L_FRAME + L_LOOK_12k8 ); tmp = s_min( tmp, norm_arr( st->buf_wspeech_enc, (Word16) ( st->wspeech_enc - st->buf_wspeech_enc ) ) ); tmp = s_min( tmp, norm_arr( st->wspeech_enc + L_FRAME + L_LOOK_12k8, /* L_NEXT_MAX_16k + */ 320 ) ); tmp = add( s_min( sub( Q15, e_old_wsp ), sub( Q15, st->exp_buf_wspeech_enc ) ), tmp ); // scale_sig( st->buf_wspeech_enc, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320, tmp ); tmp = add( norm_arr( wsp_fx, L_FRAME + L_LOOK_12k8 ), sub( Q15, e_old_wsp ) ); tmp = s_min( tmp, add( norm_s( st->mem_wsp_enc ), sub( Q15, st->exp_buf_wspeech_enc ) ) ); tmp = s_min( tmp, add( norm_arr( st->buf_wspeech_enc, (Word16) ( st->wspeech_enc - st->buf_wspeech_enc ) ), sub( Q15, st->exp_buf_wspeech_enc ) ) ); tmp = s_min( tmp, add( norm_arr( st->wspeech_enc + L_FRAME + L_LOOK_12k8, /* L_NEXT_MAX_16k + */ 320 ), sub( Q15, st->exp_buf_wspeech_enc ) ) ); scale_sig( st->buf_wspeech_enc, (Word16) ( st->wspeech_enc - st->buf_wspeech_enc ), sub( tmp, sub( Q15, st->exp_buf_wspeech_enc ) ) ); scale_sig( st->wspeech_enc + L_FRAME + L_LOOK_12k8, /* L_NEXT_MAX_16k + */ 320, sub( tmp, sub( Q15, st->exp_buf_wspeech_enc ) ) ); Copy_Scale_sig_nosat( wsp_fx, st->wspeech_enc, L_FRAME + L_LOOK_12k8, sub( tmp, sub( Q15, e_old_wsp ) ) ); st->mem_wsp_enc = shl( st->mem_wsp_enc, sub( st->exp_buf_wspeech_enc, sub( Q15, tmp ) ) ); st->exp_buf_wspeech_enc = sub( Q15, tmp ); move16(); #else Loading Loading @@ -1467,6 +1468,7 @@ ivas_error ivas_compute_core_buffers_fx( tmp = s_min( tmp, norm_arr( st->buf_speech_enc_pe, L_FRAME16k - STEREO_DFT_OVL_16k ) ); tmp = s_min( tmp, norm_arr( st->buf_speech_enc_pe + L_FRAME16k + L_FRAME16k, L_PAST_MAX_32k + L_NEXT_MAX_32k ) ); tmp = add( s_min( sub( *Q_new, 1 ), sub( Q15, st->exp_buf_speech_enc_pe ) ), tmp ); tmp = s_min( tmp, sub( Q15, st->exp_buf_wspeech_enc ) ); // because of find_wsp() scale_sig( st->buf_speech_enc_pe, L_FRAME16k - STEREO_DFT_OVL_16k, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); scale_sig( st->buf_speech_enc_pe + L_FRAME16k + L_FRAME16k, L_PAST_MAX_32k + L_NEXT_MAX_32k, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); Copy_Scale_sig_nosat( new_inp_16k_fx - STEREO_DFT_OVL_16k, st->buf_speech_enc_pe + L_FRAME16k - STEREO_DFT_OVL_16k, L_FRAME16k + STEREO_DFT_OVL_16k, sub( tmp, sub( *Q_new, 1 ) ) ); Loading @@ -1480,6 +1482,7 @@ ivas_error ivas_compute_core_buffers_fx( tmp = s_min( tmp, norm_arr( st->buf_speech_enc_pe, L_FRAME16k - lMemRecalc_16k - L_FILT16k ) ); tmp = s_min( tmp, norm_arr( st->buf_speech_enc_pe + L_FRAME16k + L_FRAME16k, L_PAST_MAX_32k + L_NEXT_MAX_32k ) ); tmp = add( s_min( sub( *Q_new, 1 ), sub( Q15, st->exp_buf_speech_enc_pe ) ), tmp ); tmp = s_min( tmp, sub( Q15, st->exp_buf_wspeech_enc ) ); // because of find_wsp() scale_sig( st->buf_speech_enc_pe, L_FRAME16k - lMemRecalc_16k - L_FILT16k, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); scale_sig( st->buf_speech_enc_pe + L_FRAME16k + L_FRAME16k, L_PAST_MAX_32k + L_NEXT_MAX_32k, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); Copy_Scale_sig_nosat( new_inp_16k_fx - lMemRecalc_16k, st->buf_speech_enc_pe + L_FRAME16k - lMemRecalc_16k - L_FILT16k, L_FRAME16k + lMemRecalc_16k + L_FILT16k, sub( tmp, sub( *Q_new, 1 ) ) ); Loading @@ -1501,6 +1504,7 @@ ivas_error ivas_compute_core_buffers_fx( tmp = norm_arr( new_inp_16k_fx, L_FRAME16k ); tmp = s_min( tmp, norm_arr( st->buf_speech_enc_pe, L_FRAME16k ) ); tmp = add( s_min( sub( *Q_new, 1 ), sub( Q15, st->exp_buf_speech_enc_pe ) ), tmp ); tmp = s_min( tmp, sub( Q15, st->exp_buf_wspeech_enc ) ); // because of find_wsp() scale_sig( st->buf_speech_enc_pe, L_FRAME16k, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); Copy_Scale_sig_nosat( new_inp_16k_fx, st->buf_speech_enc_pe + L_FRAME16k, L_FRAME16k, sub( tmp, sub( *Q_new, 1 ) ) ); st->exp_buf_speech_enc_pe = sub( Q15, tmp ); Loading Loading @@ -1557,6 +1561,9 @@ ivas_error ivas_compute_core_buffers_fx( /*--------------------------------------------------------------* * Compute Weighted Input *---------------------------------------------------------------*/ #ifdef NONBE_FIX_ISSUE_2206 st->mem_wsp_enc = shl( st->mem_wsp_enc, sub( st->exp_buf_wspeech_enc, st->exp_buf_speech_enc_pe ) ); #endif ivas_find_wsp_fx( L_FRAME16k, L_SUBFR, NB_SUBFR16k, A_fx, Aw_fx, st->speech_enc_pe, PREEMPH_FAC_16k, st->wspeech_enc, &st->mem_wsp_enc, st->gamma, L_LOOK_16k ); #ifdef NONBE_FIX_ISSUE_2206 Loading @@ -1572,6 +1579,7 @@ ivas_error ivas_compute_core_buffers_fx( scale_sig( st->wspeech_enc, L_FRAME16k + L_LOOK_16k, sub( tmp, sub( Q15, st->exp_buf_speech_enc_pe ) ) ); scale_sig( st->wspeech_enc + L_FRAME16k + L_LOOK_16k, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320 - ( (Word16) ( st->wspeech_enc - st->buf_wspeech_enc ) + L_FRAME16k + L_LOOK_16k ), sub( tmp, sub( Q15, st->exp_buf_wspeech_enc ) ) ); st->exp_buf_wspeech_enc = sub( Q15, tmp ); st->mem_wsp_enc = shl( st->mem_wsp_enc, sub( st->exp_buf_speech_enc_pe, st->exp_buf_wspeech_enc ) ); move16(); #endif } Loading
lib_enc/ivas_tcx_core_enc_fx.c +4 −7 Original line number Diff line number Diff line Loading @@ -559,10 +559,8 @@ void stereo_tcx_core_enc( IF( st->tcxonly == 0 ) { #ifdef NONBE_FIX_ISSUE_2206 // Is this a mixup with st->mem_wsp_enc ? s = s_min( s, add( norm_arr( st->buf_wspeech_enc, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320 ), sub( sub( Q15, st->exp_buf_wspeech_enc ), Q_new ) ) ); Scale_sig( st->buf_wspeech_enc, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320, sub( add( Q_new, s ), sub( Q15, st->exp_buf_wspeech_enc ) ) ); st->exp_buf_wspeech_enc = sub( Q15, add( Q_new, s ) ); s = s_min( s, add( norm_s( st->buf_wspeech_enc[st->L_frame - 1] ), sub( sub( Q15, st->exp_buf_wspeech_enc ), Q_new ) ) ); st->wspeech_enc[st->L_frame - 1] = shl( st->wspeech_enc[st->L_frame - 1], sub( add( Q_new, s ), sub( Q15, st->exp_buf_wspeech_enc ) ) ); #else s = s_min( s, norm_s( st->wspeech_enc[st->L_frame - 1] ) ); st->wspeech_enc[st->L_frame - 1] = shl( st->wspeech_enc[st->L_frame - 1], s ); Loading Loading @@ -720,9 +718,8 @@ void stereo_tcx_core_enc( IF( st->tcxonly == 0 ) { #ifdef NONBE_FIX_ISSUE_2206 // Is this a mixup with st->mem_wsp_enc ? Scale_sig( st->buf_wspeech_enc, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320, sub( 0, sub( Q15, st->exp_buf_wspeech_enc ) ) ); st->exp_buf_wspeech_enc = sub( Q15, 0 ); /* Revert scale change from above. */ st->wspeech_enc[st->L_frame - 1] = shl( st->wspeech_enc[st->L_frame - 1], sub( sub( Q15, st->exp_buf_wspeech_enc ), Q_new ) ); #else st->wspeech_enc[st->L_frame - 1] = shl( st->wspeech_enc[st->L_frame - 1], -st->Q_syn ); move16(); Loading