From ac199ae97a1b88e4dd0041c74a3bb944e6a51788 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Sat, 2 Mar 2024 22:43:07 +0530 Subject: [PATCH] Integrated decoder_tcx_tns_fx function in decoder_tcx_fx --- lib_dec/dec_tcx_fx.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index 4249fd1b6..994546a0f 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 ); -- GitLab