diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index 4249fd1b690169deb09a07d14e17e15743598073..994546a0ff5a46a72de876f9c1d2a96d8802bd62 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -2481,7 +2481,7 @@ void decoder_tcx_fx( const Word16 frame_cnt, const Word16 sba_dirac_stereo_flag ) { - float x[N_MAX]; + float x[N_MAX] = { 0 }; Word32 x_fx[N_MAX]; Word16 x_e; float gainlpc2[FDNS_NPTS]; @@ -2691,7 +2691,18 @@ void decoder_tcx_fx( decoder_tcx_noiseshaping_igf( st, L_spec, L_frame, L_frameTCX, left_rect, &x[0], &gainlpc2[0], &tmp_concealment_method, bfi ); #endif +#ifdef IVAS_FLOAT_FIXED + Word32 x_fx_[1200]; + Word16 q = 26; + float maximum = 0; + FOR(Word16 ind = 0; ind < 1200; ind++) maximum = fmaxf(maximum, fabsf(x[ind])); + if(maximum>=1.f) q = norm_l((Word32)maximum) - 5; + FOR(Word16 ind = 0; ind < 1200; ind++) x_fx_[ind] = (Word32)(x[ind] * (1 << q)); + decoder_tcx_tns_fx( st, L_frame_glob, L_spec, L_frame, L_frameTCX, x_fx_, fUseTns, &tnsData, bfi, frame_cnt, 0 ); + FOR(Word16 ind = 0; ind < 1200; ind++) x[ind] = (float)(x_fx_[ind]) / (float)(1 << q); +#else decoder_tcx_tns( st, L_frame_glob, L_spec, L_frame, L_frameTCX, &x[0], fUseTns, &tnsData, bfi, frame_cnt, 0 ); +#endif decoder_tcx_imdct( st, L_frame_glob, L_frameTCX_glob, L_spec, tcx_offset, tcx_offsetFB, L_frame, L_frameTCX, left_rect, &x[0], &xn_buf[0], MDCT_IV, fUseTns, &synth[0], &synthFB[0], bfi, frame_cnt, sba_dirac_stereo_flag );