From e1ce3fb898faed74c4001636436e7b89e6bb88bb Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Fri, 13 Jun 2025 18:29:27 +0530 Subject: [PATCH 1/3] Crash fix for [Multi-channel 7_1_4 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, HOA3 out] fxd enc fxd dec case and warning fix --- lib_dec/ivas_mc_param_dec_fx.c | 2 +- lib_dec/ivas_sba_rendering_internal_fx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index b6868dbb1..c25ec972f 100644 --- a/lib_dec/ivas_mc_param_dec_fx.c +++ b/lib_dec/ivas_mc_param_dec_fx.c @@ -106,7 +106,7 @@ static ivas_error param_mc_get_diff_proto_info_fx( const Word32 *proto_mtx, cons static void param_mc_update_mixing_matrices_fx( PARAM_MC_DEC_HANDLE hParamMC, Word32 *mixing_matrix[], Word16 *mixing_matrix_fx, Word32 *mixing_matrix_res[], Word16 *mixing_matrix_res_exp, const UWord16 nX, const UWord16 nY ); -static void param_mc_protoSignalComputation_fx( Word32 *RealBuffer_fx, Word32 *ImagBuffer_fx, Word32 *proto_frame_f_fx, const PARAM_MC_DIFF_PROTO_INFO *diff_proto_info, const Word16 num_freq_bands, Word16 Cldfb_Real_Imag_exp, Word16 *proto_frame_f_fx_q /* Word16 ImagBuffer_fx_e, Word16 *common_e*/ ); +static void param_mc_protoSignalComputation_fx( Word32 *RealBuffer_fx, Word32 *ImagBuffer_fx, Word32 *proto_frame_f_fx, const PARAM_MC_DIFF_PROTO_INFO *diff_proto_info, const Word16 num_freq_bands, const Word16 Cldfb_Real_Imag_exp, Word16 *proto_frame_f_fx_q /* Word16 ImagBuffer_fx_e, Word16 *common_e*/ ); /*------------------------------------------------------------------------- * ivas_param_mc_dec_open() diff --git a/lib_dec/ivas_sba_rendering_internal_fx.c b/lib_dec/ivas_sba_rendering_internal_fx.c index d9ee47c84..5a15a357e 100644 --- a/lib_dec/ivas_sba_rendering_internal_fx.c +++ b/lib_dec/ivas_sba_rendering_internal_fx.c @@ -211,7 +211,7 @@ void ivas_mc2sba_fx( FOR( k = 0; k < output_frame; k++ ) { #ifdef OPT_BIN_RENDERER_V2 - buffer_tmp_fx[j][k] = Madd_32_32( buffer_tmp_fx[j][k], L_shl( in_buffer_td_fx[i][k], 2 ), gains_fx[j] ); /*Q+29-31+2==Q*/ + buffer_tmp_fx[j][k] = Madd_32_32( buffer_tmp_fx[j][k], L_shl_sat( in_buffer_td_fx[i][k], 2 ), gains_fx[j] ); /*Q+29-31+2==Q*/ #else /* OPT_BIN_RENDERER_V2 */ buffer_tmp_fx[j][k] = L_add( buffer_tmp_fx[j][k], L_shl( Mult_32_32( in_buffer_td_fx[i][k], gains_fx[j] ), 2 ) ); /*Q+29-31+2==Q*/ #endif /* OPT_BIN_RENDERER_V2 */ -- GitLab From 79ae9a3cc39dc5e5be2cd87faae4be74ccf0b8b3 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Fri, 13 Jun 2025 18:34:27 +0530 Subject: [PATCH 2/3] Clang formatting changes --- lib_dec/ivas_sba_rendering_internal_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_sba_rendering_internal_fx.c b/lib_dec/ivas_sba_rendering_internal_fx.c index 5a15a357e..ba8c529d7 100644 --- a/lib_dec/ivas_sba_rendering_internal_fx.c +++ b/lib_dec/ivas_sba_rendering_internal_fx.c @@ -212,9 +212,9 @@ void ivas_mc2sba_fx( { #ifdef OPT_BIN_RENDERER_V2 buffer_tmp_fx[j][k] = Madd_32_32( buffer_tmp_fx[j][k], L_shl_sat( in_buffer_td_fx[i][k], 2 ), gains_fx[j] ); /*Q+29-31+2==Q*/ -#else /* OPT_BIN_RENDERER_V2 */ +#else /* OPT_BIN_RENDERER_V2 */ buffer_tmp_fx[j][k] = L_add( buffer_tmp_fx[j][k], L_shl( Mult_32_32( in_buffer_td_fx[i][k], gains_fx[j] ), 2 ) ); /*Q+29-31+2==Q*/ -#endif /* OPT_BIN_RENDERER_V2 */ +#endif /* OPT_BIN_RENDERER_V2 */ move32(); } } -- GitLab From 734b270395cda470643392d1ebabc9a7511fc97b Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Fri, 13 Jun 2025 18:36:00 +0530 Subject: [PATCH 3/3] Bug fix --- lib_enc/cod4t64_fast_fx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib_enc/cod4t64_fast_fx.c b/lib_enc/cod4t64_fast_fx.c index e24f3b678..7079f6597 100644 --- a/lib_enc/cod4t64_fast_fx.c +++ b/lib_enc/cod4t64_fast_fx.c @@ -145,7 +145,8 @@ void acelp_fast_fx( Word16 track_order[NB_TRACK_FCB_4T * MAX_NUM_INTER], m0_track[NB_TRACK_FCB_4T]; Word16 ind_stream[NPMAXPT * NB_TRACK_FCB_4T], idx; Word16 G, G1, G2, G3, Gn, Gd; - Word32 Gd32; + Word32 Gd32 = 0; + move32(); Word16 y_tmp[L_SUBFR_MAX]; Word32 dn[L_SUBFR_MAX]; Word32 crit_num, crit_den, crit_num_max, crit_den_max, L_tmp1, L_tmp2; @@ -718,8 +719,6 @@ void acelp_fast_fx( IF( GE_16( nb_pulse, 4 ) ) { Gn = add( Gn, i_mult( s[2], dn_orig[m[2]] ) ); // Q_dn - Gd32 = Gd; - move16(); temp1 = alp[0]; move32(); temp2 = L_mult0( i_mult( shl( s[0], 1 ), s[2] ), alp[m[0] - m[2]] ); @@ -770,8 +769,6 @@ void acelp_fast_fx( IF( GE_16( nb_pulse, 5 ) ) { Gn = add( Gn, i_mult( s[3], dn_orig[m[3]] ) ); // Q_dn - Gd32 = Gd; - move16(); temp1 = alp[0]; move32(); temp2 = L_mult0( i_mult( shl( s[0], 1 ), s[3] ), alp[m[0] - m[3]] ); -- GitLab