diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 32403b11a032c798ae52da7a70721396466c7f6f..b34ce0c56d09f1ddc1a27c93089460bf8b4243c9 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -398,7 +398,7 @@ ivas_error ivas_mct_dec_fx( test(); IF( ( st_ivas->sba_dirac_stereo_flag != 0 ) && ( NE_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) || GE_16( cpe_id, sub( nCPE, 2 ) ) ) ) { - Copy_Scale_sig_16_32_no_sat( synth_fx[n], synth_fx_32[n], L_FRAME48k, sub( Q11, ( sub( 15, e_sig[n] ) ) ) ); // Q11 + Copy_Scale_sig_16_32_no_sat( synth_fx[n], synth_fx_32[n], output_frame, sub( Q11, ( sub( 15, e_sig[n] ) ) ) ); // Q11 Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[n]->hHQ_core->old_out_fx, hCPE->hCoreCoder[n]->hHQ_core->old_out_fx32, output_frame, sub( Q11, hCPE->hCoreCoder[n]->hHQ_core->Q_old_wtda ) ); ivas_post_proc_fx( NULL, hCPE, n, synth_fx_32[n], NULL, output_frame, 1, Q11 ); Copy_Scale_sig_32_16( synth_fx_32[n], synth_fx[n], output_frame, sub( sub( 15, e_sig[n] ), Q11 ) ); // Q0 diff --git a/lib_dec/ivas_stereo_dft_dec_dmx_fx.c b/lib_dec/ivas_stereo_dft_dec_dmx_fx.c index e82005965b6a452c7d327e89d07b42b082048c7b..cdb64e46c62c5c73343b11c8a202d9623923088b 100644 --- a/lib_dec/ivas_stereo_dft_dec_dmx_fx.c +++ b/lib_dec/ivas_stereo_dft_dec_dmx_fx.c @@ -102,6 +102,8 @@ void stereo_dft_unify_dmx_fx( Word16 num_plocs; Word32 plocsi[STEREO_DFT_RES_N_PEAKS_MAX]; + set32_fx( DFT_PRED_RES, 0, STEREO_DFT32MS_N_32k ); + output_frame = extract_l( Mult_32_16( st0->output_Fs, INV_FRAME_PER_SEC_Q15 ) ); /* Q0 */ samp_ratio = BASOP_Util_Divide3232_Scale( st0->sr_core, st0->output_Fs, &q_samp_ratio ); samp_ratio = shr( samp_ratio, sub( Q15 - Q12, q_samp_ratio ) ); diff --git a/lib_enc/acelp_enc_util_fx.c b/lib_enc/acelp_enc_util_fx.c index 181583e91d23686fd8a753128ec344665e4e27a2..7f57b55da9f685b3d5800308105bf66c623742fe 100644 --- a/lib_enc/acelp_enc_util_fx.c +++ b/lib_enc/acelp_enc_util_fx.c @@ -180,9 +180,9 @@ void E_ACELP_conv( } void E_ACELP_conv_ivas_fx( - const Word16 xn2[], /* i Qx*/ + const Word16 xn2[], /* i Qnew - 1*/ const Word16 h2[], /* i Q12*/ - Word16 cn2[] /* o Q0*/ + Word16 cn2[] /* o Qnew*/ ) { Word16 i, k; @@ -194,14 +194,14 @@ void E_ACELP_conv_ivas_fx( { /*cn2[k] = xn2[k]; */ Word64 L_tmp_64; - L_tmp_64 = W_deposit32_l( L_mult0( xn2[k], 0x800 ) ); /* 4Q11 */ + L_tmp_64 = W_deposit32_l( L_mult0( xn2[k], 0x800 ) ); /* Qnew -1 + 12 */ FOR( i = 0; i < k; i++ ) { /*cn2[k]-=cn2[i]*h2[k-i];*/ - L_tmp_64 = W_msu0_16_16( L_tmp_64, cn2[i], h2[k - i] ); /*h2 4Q11*/ + L_tmp_64 = W_msu0_16_16( L_tmp_64, cn2[i], h2[k - i] ); /*Qnew + 11*/ } - L_tmp = W_sat_l( L_tmp_64 ); /* 4Q11 */ - cn2[k] = round_fx_o( L_shl_o( L_tmp, 5, &Overflow ), &Overflow ); /* Q0*/ + L_tmp = W_sat_l( L_tmp_64 ); /* Qnew + 11 */ + cn2[k] = round_fx_o( L_shl_o( L_tmp, 5, &Overflow ), &Overflow ); /* Qnew*/ move16(); } } diff --git a/lib_enc/enc_tran_fx.c b/lib_enc/enc_tran_fx.c index 394b22c3099bdde32fdaadc97f5e26bfa97f35fa..86597281931a736784ce3393fd769ad28ba416c4 100644 --- a/lib_enc/enc_tran_fx.c +++ b/lib_enc/enc_tran_fx.c @@ -545,8 +545,8 @@ Word16 encod_tran_ivas_fx( Copy( &res_fx[i_subfr], &exc_fx[i_subfr], L_SUBFR ); /* Q_new */ - find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq, - res_fx, L_SUBFR, p_Aw, st_fx->preemph_fac, xn, cn, h1 ); + find_targets_ivas_new_fx( speech_fx, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq, + res_fx, L_SUBFR, p_Aw, st_fx->preemph_fac, xn, cn, h1 ); q_h1 = sub( 14, norm_s( h1[0] ) ); Copy_Scale_sig( h1, h2_fx, L_SUBFR, sub( 11, q_h1 ) ); /*Q11*/ @@ -555,6 +555,7 @@ Word16 encod_tran_ivas_fx( #else Scale_sig( h1, L_SUBFR, sub( 13, q_h1 ) ); #endif + /* scaling of xn[] to limit dynamic at 12 bits */ Scale_sig( xn, L_SUBFR, shift ); diff --git a/lib_enc/ivas_core_pre_proc_fx.c b/lib_enc/ivas_core_pre_proc_fx.c index 6fe6b6720d17c1fd68c743c3fecdf2d309c8bc0f..e2c099cd2048d287e34a996b6cfb2a812b1c9e8f 100644 --- a/lib_enc/ivas_core_pre_proc_fx.c +++ b/lib_enc/ivas_core_pre_proc_fx.c @@ -1174,11 +1174,8 @@ ivas_error ivas_compute_core_buffers_fx( ELSE IF( GT_32( input_Fs, 8000 ) && EQ_32( sr_core, INT_FS_16k ) ) { Copy( &old_inp_16k_fx[L_frame_tmp], st->old_inp_16k_fx, L_INP_MEM ); - IF( Q_new ) - { - st->exp_old_inp_16k = sub( Q16, *Q_new ); //(*Q_new - 1) - move16(); - } + st->exp_old_inp_16k = sub( Q16, *Q_new ); //(*Q_new - 1) + move16(); } ELSE IF( GT_32( input_Fs, 8000 ) ) { diff --git a/lib_enc/transition_enc_fx.c b/lib_enc/transition_enc_fx.c index 5e50cac15b457c299b6af0828b4ac56c07497197..c724ffd6c228d4441fdbae27526ddf6faf631270 100644 --- a/lib_enc/transition_enc_fx.c +++ b/lib_enc/transition_enc_fx.c @@ -924,8 +924,6 @@ void transition_enc_ivas_fx( /* set limit_flag to 0 for restrained limits, and 1 for extended limits */ limit_flag = 0; move16(); - Word16 h1_fx_q15[L_SUBFR + ( M + 1 )]; - Copy_Scale_sig( h1_fx, h1_fx_q15, L_SUBFR + ( M + 1 ), 0 ); pit_start = PIT_MIN; move16(); @@ -1443,12 +1441,7 @@ void transition_enc_ivas_fx( *clip_gain = gp_clip_fx( st_fx->element_mode, st_fx->core_brate, st_fx->voicing_fx, i_subfr, TRANSITION, xn_fx, gp_cl_fx, ( Q_new + shift - 1 ) ); move16(); -#ifdef TEST_HR - Copy( h1_fx, h1_fx_q15, L_SUBFR + ( M + 1 ) ); -#else - Copy_Scale_sig( h1_fx, h1_fx_q15, L_SUBFR + ( M + 1 ), 1 ); -#endif - lp_select = lp_filt_exc_enc_ivas_fx( MODE1, TRANSITION, i_subfr, exc_fx, h1_fx_q15, + lp_select = lp_filt_exc_enc_ivas_fx( MODE1, TRANSITION, i_subfr, exc_fx, h1_fx, xn_fx, y1_fx, xn2_fx, L_SUBFR, st_fx->L_frame, g_corr_fx, *clip_gain, gain_pit_fx, &lp_flag ); IF( EQ_16( lp_flag, NORMAL_OPERATION ) ) @@ -1684,12 +1677,7 @@ void transition_enc_ivas_fx( *clip_gain = gp_clip_fx( st_fx->element_mode, st_fx->core_brate, st_fx->voicing_fx, i_subfr, TRANSITION, xn_fx, gp_cl_fx, Q_new ); move16(); -#ifdef TEST_HR - Copy( h1_fx, h1_fx_q15, L_SUBFR + ( M + 1 ) ); -#else - Copy_Scale_sig( h1_fx, h1_fx_q15, L_SUBFR + ( M + 1 ), 1 ); -#endif - lp_select = lp_filt_exc_enc_ivas_fx( MODE1, TRANSITION, i_subfr, exc_fx, h1_fx_q15, + lp_select = lp_filt_exc_enc_ivas_fx( MODE1, TRANSITION, i_subfr, exc_fx, h1_fx, xn_fx, y1_fx, xn2_fx, L_SUBFR, st_fx->L_frame, g_corr_fx, *clip_gain, gain_pit_fx, &lp_flag ); IF( EQ_16( lp_flag, NORMAL_OPERATION ) ) {