From 997665709a585ed6ca6380b16e147539c0ac7a0f Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Fri, 7 Feb 2025 08:29:08 -0500 Subject: [PATCH 1/2] fix saturation missing in EVS counter --- lib_enc/acelp_core_enc_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_enc/acelp_core_enc_fx.c b/lib_enc/acelp_core_enc_fx.c index 6449367c8..b9310dead 100644 --- a/lib_enc/acelp_core_enc_fx.c +++ b/lib_enc/acelp_core_enc_fx.c @@ -156,7 +156,7 @@ ivas_error acelp_core_enc_fx( st_fx->Nb_ACELP_frames = 0; move16(); } - st_fx->Nb_ACELP_frames = add( st_fx->Nb_ACELP_frames, 1 ); // Q0 + st_fx->Nb_ACELP_frames = add_sat( st_fx->Nb_ACELP_frames, 1 ); // Q0 move16(); int_fs_fx = INT_FS_16k_FX; @@ -967,7 +967,7 @@ ivas_error acelp_core_enc_ivas_fx( st->Nb_ACELP_frames = 0; move16(); } - st->Nb_ACELP_frames = add( st->Nb_ACELP_frames, 1 ); + st->Nb_ACELP_frames = add_sat( st->Nb_ACELP_frames, 1 ); move16(); IF( EQ_16( st->L_frame, L_FRAME ) ) -- GitLab From b0fc3fcdff86c8466d66d60f2cbad2121a0ed7bd Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Fri, 7 Feb 2025 10:55:55 -0500 Subject: [PATCH 2/2] fix saturation missing in EVS counter --- lib_enc/energy_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/energy_fx.c b/lib_enc/energy_fx.c index 6d81eb82a..7dc96a4e3 100644 --- a/lib_enc/energy_fx.c +++ b/lib_enc/energy_fx.c @@ -184,7 +184,7 @@ static void update_sb_bg_energy( Word32 sb_bg_energy_ti, tmp; Word16 tmpQ, i; - *tbg_energy_count = add( *tbg_energy_count, 1 ); /* Q0 */ + *tbg_energy_count = add_sat( *tbg_energy_count, 1 ); /* Q0 */ move16(); tmpQ = add( tmp_Q_add, frame_sb_energy_scale ); -- GitLab