diff --git a/lib_dec/init_dec.c b/lib_dec/init_dec.c index 1d9fe75ca2626fcb26650bccab0864a4e3752703..10e4d9f6940b2ba20dc857845784c41dbb36e896 100644 --- a/lib_dec/init_dec.c +++ b/lib_dec/init_dec.c @@ -607,11 +607,10 @@ ivas_error init_decoder( set_f( st->hTcxDec->FBTCXdelayBuf_float, 0.0f, 111 ); st->hTcxDec->old_synthFB = st->hTcxDec->synth_history + NS2SA( st->output_Fs, PH_ECU_MEM_NS ); -#ifdef IVAS_FLOAT_FIXED - st->hTcxDec->old_synthFB_fx = st->hTcxDec->synth_history_fx + NS2SA( st->output_Fs, PH_ECU_MEM_NS ); -#endif st->hTcxDec->prev_good_synth = st->hTcxDec->old_synthFB + NS2SA( st->output_Fs, PH_ECU_LOOKAHEAD_NS ); #ifdef IVAS_FLOAT_FIXED + set32_fx(st->hTcxDec->FBTCXdelayBuf, 0, 111); + st->hTcxDec->old_synthFB_fx = st->hTcxDec->synth_history_fx + NS2SA( st->output_Fs, PH_ECU_MEM_NS ); st->hTcxDec->prev_good_synth_fx = st->hTcxDec->old_synthFB_fx + NS2SA(st->output_Fs, PH_ECU_LOOKAHEAD_NS); #endif } diff --git a/lib_dec/ivas_cpe_dec_fx.c b/lib_dec/ivas_cpe_dec_fx.c index 653581bd6beca8877ce19d4dac537de84c5c5f0a..79a7c789a328b99503ffddbe19cca885e57cc979 100644 --- a/lib_dec/ivas_cpe_dec_fx.c +++ b/lib_dec/ivas_cpe_dec_fx.c @@ -527,7 +527,7 @@ ivas_error ivas_cpe_dec_fx( } } i_max_val_psd = (int)max_val; - sts[0]->hFdCngDec->q_smoothed_psd = norm_l(i_max_val_psd) - Q9; + sts[0]->hFdCngDec->q_smoothed_psd = norm_l(i_max_val_psd) - Q4; max_val = 0.0; for (int ii = 0; ii < sizeof(DFT) / sizeof(DFT[0]); ii++) { @@ -545,6 +545,7 @@ ivas_error ivas_cpe_dec_fx( { hCPE->hStereoDft->q_dft = Q15; } + hCPE->hStereoDft->q_dft = s_min(hCPE->hStereoDft->q_dft, sts[0]->hFdCngDec->q_smoothed_psd); IF (EQ_16(hCPE->hStereoDft->first_frame, 1)) { hCPE->hStereoDft->q_smoothed_nrg = hCPE->hStereoDft->q_dft; diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index e972bc7d8cd2835b5704d7929a14c7b6a426d6ec..ec9d619f54c0f4063ad8b42fccce7eeadaf16dbf 100644 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -768,7 +768,11 @@ ivas_error stereo_memory_dec( set_f( st->hTcxDec->FBTCXdelayBuf_float, 0.0f, 111 ); st->hTcxDec->old_synthFB = st->hTcxDec->synth_history + NS2SA( st->output_Fs, PH_ECU_MEM_NS ); st->hTcxDec->prev_good_synth = st->hTcxDec->old_synthFB + NS2SA( st->output_Fs, PH_ECU_LOOKAHEAD_NS ); - +#ifdef IVAS_FLOAT_FIXED + set32_fx(st->hTcxDec->FBTCXdelayBuf, 0, 111); + st->hTcxDec->old_synthFB_fx = st->hTcxDec->synth_history_fx + NS2SA(st->output_Fs, PH_ECU_MEM_NS); + st->hTcxDec->prev_good_synth_fx = st->hTcxDec->old_synthFB_fx + NS2SA(st->output_Fs, PH_ECU_LOOKAHEAD_NS); +#endif /* allocate and initialize MDCT stereo structure */ if ( ( hCPE->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) {