diff --git a/lib_com/fd_cng_com_fx.c b/lib_com/fd_cng_com_fx.c index b024df61d454182445dcc924b6e6e369e66cb275..7ba5cf7c626edfac60ab0c4873908193479e769b 100644 --- a/lib_com/fd_cng_com_fx.c +++ b/lib_com/fd_cng_com_fx.c @@ -2227,7 +2227,21 @@ void scalebands_fx( move32(); FOR( ; i <= part[stopPartM1]; i++ ) { - val = L_shl( Mpy_32_16_1( val, delta ), s1 ); + test(); + IF( val != 0 && delta != 0 ) + { + val = L_shl( Mpy_32_16_1( val, delta ), s1 ); + IF( val == 0 ) + { + val = 1; + move32(); + } + } + ELSE + { + val = 0; + move32(); + } bandpow[i] = val; move32(); } diff --git a/lib_dec/dec_tcx.c b/lib_dec/dec_tcx.c index 17ce5672dfd8f0f696767082b1a5d104c292b148..06c9bc5ba28b812dedabedc296ea5705dacb9320 100644 --- a/lib_dec/dec_tcx.c +++ b/lib_dec/dec_tcx.c @@ -1571,7 +1571,7 @@ void decoder_tcx_tns_fx( const Word16 whitenedDomain, Word16 *length ) { - Word16 index, isTCX5, L; + Word16 index, isTCX5, L, tmp; TCX_CONFIG_HANDLE hTcxCfg = st->hTcxCfg; index = hTcxCfg->tcx_last_overlap_mode; /* backup last TCX overlap mode */ @@ -1581,6 +1581,8 @@ void decoder_tcx_tns_fx( move16(); L = L_frameTCX; move16(); + tmp = L; + move16(); test(); IF( EQ_16( L_frame, shr( st->L_frame, 1 ) ) && NE_16( st->tcxonly, 0 ) ) @@ -1601,6 +1603,8 @@ void decoder_tcx_tns_fx( { L = L_spec; move16(); + tmp = L; + move16(); } test(); @@ -1652,6 +1656,8 @@ void decoder_tcx_tns_fx( IF( EQ_16( st->element_mode, EVS_MONO ) || LT_16( L_spec, L_frameTCX ) ) /* todo: this is temporary to maintain EVS BE, this is a bug and should be fixed also for EVS (see issue 13) */ { tcx5TnsUngrouping_fx( shr( L_frameTCX, 1 ), shr( hTcxCfg->tnsConfig[0][0].iFilterBorders[0], 1 ), x_fx, DEC ); + tmp = L_frameTCX; + move16(); } ELSE { @@ -1679,7 +1685,7 @@ void decoder_tcx_tns_fx( if ( length != NULL ) { - *length = L; + *length = tmp; move16(); } diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 4c0e5b1d71a3c5383b5413555f2dce1845e0699c..f4cf173f5f12b0930f0b438d657e4db2ad9712c5 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -2907,7 +2907,22 @@ void perform_noise_estimation_dec_ivas_fx( } /* IIR smoothing */ - *ptr_per = Mpy_32_16_1( ( *ptr_per ), alpha ); + test(); + IF( *ptr_per != 0 && alpha != 0 ) + { + *ptr_per = Mpy_32_16_1( ( *ptr_per ), alpha ); + move32(); + IF( *ptr_per == 0 ) + { + *ptr_per = 1; + move32(); + } + } + ELSE + { + *ptr_per = 0; + move32(); + } *ptr_per = L_add( ( *ptr_per ), Mpy_32_16_1( temp, sub( MAX_16, alpha ) ) ); ptr_per++; } diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index 48cbad61d4bbc151e9d35089e22938f5ee41c369..1a894ce10b51e9a99a1136680712b875ddadc2f1 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -4469,7 +4469,15 @@ static void ivas_parse_parameter_bitstream_dtx( value = get_next_indice( st0, pr_pd_bits ); - pr = idiv1616( value, pd_q_lvls ); + IF( value != 0 ) + { + pr = idiv1616( value, pd_q_lvls ); + } + ELSE + { + pr = 0; + move16(); + } pd = extract_l( L_sub( value, i_mult( pr, pd_q_lvls ) ) ); val_fx = dtx_pd_real_min_max_fx[0]; move32(); diff --git a/lib_dec/ivas_stereo_dft_dec_fx.c b/lib_dec/ivas_stereo_dft_dec_fx.c index 87831a269676c1b007324a2ffc0caa8a4f58e873..1808c53844b969c79fed11080df6d0c4a0348b4d 100644 --- a/lib_dec/ivas_stereo_dft_dec_fx.c +++ b/lib_dec/ivas_stereo_dft_dec_fx.c @@ -2153,7 +2153,7 @@ void stereo_dft_dec_fx( move16(); } l_gamma = L_deposit_l( gamma ); - op1 = L_add( l_gamma, L_shr( L_deposit_l( sub( MAX_16, mult( g, g ) ) ), q_gamma ) ); + op1 = L_add( l_gamma, L_shr( L_deposit_l( sub( MAX_16, mult_sat( g, g ) ) ), q_gamma ) ); /*The mult_sat function is needed because -0.999979973 is being mapped to -32768. This value, when multiplied by -32768, is causing a crash.*/ q_loc2 = add( Q16, q_gamma ); q_loc1 = q_loc2; move16();