Loading lib_com/options.h +3 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,9 @@ #define FIX_854_HILBERT_SCALING /* VA: reduce lost of precision due to unnecessary scaling, reduce a lot the 2 kHz tone */ #define FIX_856_EXTRACT_L /* VA: Fix undesirable wrap-around */ #define FIX_835_PARAMMC_BUFFER_VALUES /* FhG: issue 835: wide range of buffer values for cx in ParamMC */ #define FIX_860_FER_CRASH /* VA: fix crash issues caused by saturation within shl */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ Loading lib_com/tools_fx.c +11 −1 Original line number Diff line number Diff line Loading @@ -4474,12 +4474,22 @@ void v_add_fixed_me( Word16 x1_shift = sub( s_max( x1_e, x2_e ), x1_e ); Word16 x2_shift = sub( s_max( x1_e, x2_e ), x2_e ); #if 1//def IMPRO_PRECISION Word32 hdrm_x1_shift = L_shl_sat( 1, add( hdrm, sub( 31, x1_shift ) ) ); Word32 hdrm_x2_shift = L_shl_sat( 1, add( hdrm, sub( 31, x2_shift ) ) ); FOR( i = 0; i < N; i++ ) { y[i] = L_add( L_shr( x1[i], hdrm + x1_shift ), L_shr( x2[i], hdrm + x2_shift ) ); y[i] = W_round64_L( W_mac_32_32( W_mult_32_32( x1[i], hdrm_x1_shift ), x2[i], hdrm_x2_shift ) ); move32(); } #else FOR( i = 0; i < N; i++ ) { y[i] = L_add( L_shr( x1[i], hdrm + x1_shift ), L_shr( x2[i], hdrm + x2_shift ) ); move32(); } #endif *y_e = add( s_max( x1_e, x2_e ), hdrm ); move16(); Loading lib_dec/ivas_stereo_dft_dec_fx.c +12 −0 Original line number Diff line number Diff line Loading @@ -3676,7 +3676,11 @@ void stereo_dft_dec_read_BS_fx( { hStereoDft->side_gain_index_previous[b] = ind1[b]; move16(); #ifdef FIX_860_FER_CRASH hStereoDft->res_gains_ind_fx[0][b + STEREO_DFT_BAND_MAX] = L_shl_sat( ind1[b], 26 ); #else hStereoDft->res_gains_ind_fx[0][b + STEREO_DFT_BAND_MAX] = L_shl( ind1[b], 26 ); #endif move32(); } Loading Loading @@ -3866,7 +3870,11 @@ void stereo_dft_dec_read_BS_fx( stereo_dft_dequantize_res_gains_fx( ind1 + b, &I, hStereoDft->side_gain_fx + add( i_mult( add( k, k_offset ), STEREO_DFT_BAND_MAX ), b ), hStereoDft->res_pred_gain_fx + add( i_mult( add( k, k_offset ), STEREO_DFT_BAND_MAX ), b ), 1 ); hStereoDft->res_pred_index_previous[b] = I; move16(); #ifdef FIX_860_FER_CRASH hStereoDft->res_gains_ind_fx[1][b + STEREO_DFT_BAND_MAX] = L_shl_sat( I, 26 ); #else hStereoDft->res_gains_ind_fx[1][b + STEREO_DFT_BAND_MAX] = L_shl( I, 26 ); #endif move32(); } Loading @@ -3891,7 +3899,11 @@ void stereo_dft_dec_read_BS_fx( stereo_dft_dequantize_res_gains_fx( ind1 + b, &I, hStereoDft->side_gain_fx + add( i_mult( add( k, k_offset ), STEREO_DFT_BAND_MAX ), b ), hStereoDft->res_pred_gain_fx + add( i_mult( add( k, k_offset ), STEREO_DFT_BAND_MAX ), b ), 1 ); hStereoDft->res_pred_index_previous[b] = I; move16(); #ifdef FIX_860_FER_CRASH hStereoDft->res_gains_ind_fx[1][b + STEREO_DFT_BAND_MAX] = L_shl_sat( I, 26 ); #else hStereoDft->res_gains_ind_fx[1][b + STEREO_DFT_BAND_MAX] = L_shl( I, 26 ); #endif move32(); } } Loading lib_dec/ivas_stereo_icbwe_dec.c +8 −0 Original line number Diff line number Diff line Loading @@ -1209,7 +1209,11 @@ void stereo_icBWE_dec_fx( tmp = shl( tmp, 2 ); icbweM2Ref_fx = Sqrt16( sub( 16384, tmp ), &temp1_fx ); icbweM2Ref_fx = BASOP_Util_Divide1616_Scale( icbweM2Ref_fx, ratio_L_fx, &temp2_fx ); #ifdef FIX_860_FER_CRASH icbweM2Ref_fx = shl_sat( icbweM2Ref_fx, add( temp2_fx, sub( temp1_fx, 1 ) ) ); // Q14 #else icbweM2Ref_fx = shl( icbweM2Ref_fx, add( temp2_fx, sub( temp1_fx, 1 ) ) ); // Q14 #endif } ELSE { Loading Loading @@ -1238,7 +1242,11 @@ void stereo_icBWE_dec_fx( tmp = shl( tmp, 2 ); icbweM2Ref_fx = Sqrt16( sub( 16384, tmp ), &temp1_fx ); icbweM2Ref_fx = BASOP_Util_Divide1616_Scale( icbweM2Ref_fx, sub( 32767, ratio_L_fx ), &temp2_fx ); #ifdef FIX_860_FER_CRASH icbweM2Ref_fx = shl_sat( icbweM2Ref_fx, add( temp2_fx, sub( temp1_fx, 1 ) ) ); // Q14 #else icbweM2Ref_fx = shl( icbweM2Ref_fx, add( temp2_fx, sub( temp1_fx, 1 ) ) ); // Q14 #endif } ELSE { Loading Loading
lib_com/options.h +3 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,9 @@ #define FIX_854_HILBERT_SCALING /* VA: reduce lost of precision due to unnecessary scaling, reduce a lot the 2 kHz tone */ #define FIX_856_EXTRACT_L /* VA: Fix undesirable wrap-around */ #define FIX_835_PARAMMC_BUFFER_VALUES /* FhG: issue 835: wide range of buffer values for cx in ParamMC */ #define FIX_860_FER_CRASH /* VA: fix crash issues caused by saturation within shl */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ Loading
lib_com/tools_fx.c +11 −1 Original line number Diff line number Diff line Loading @@ -4474,12 +4474,22 @@ void v_add_fixed_me( Word16 x1_shift = sub( s_max( x1_e, x2_e ), x1_e ); Word16 x2_shift = sub( s_max( x1_e, x2_e ), x2_e ); #if 1//def IMPRO_PRECISION Word32 hdrm_x1_shift = L_shl_sat( 1, add( hdrm, sub( 31, x1_shift ) ) ); Word32 hdrm_x2_shift = L_shl_sat( 1, add( hdrm, sub( 31, x2_shift ) ) ); FOR( i = 0; i < N; i++ ) { y[i] = L_add( L_shr( x1[i], hdrm + x1_shift ), L_shr( x2[i], hdrm + x2_shift ) ); y[i] = W_round64_L( W_mac_32_32( W_mult_32_32( x1[i], hdrm_x1_shift ), x2[i], hdrm_x2_shift ) ); move32(); } #else FOR( i = 0; i < N; i++ ) { y[i] = L_add( L_shr( x1[i], hdrm + x1_shift ), L_shr( x2[i], hdrm + x2_shift ) ); move32(); } #endif *y_e = add( s_max( x1_e, x2_e ), hdrm ); move16(); Loading
lib_dec/ivas_stereo_dft_dec_fx.c +12 −0 Original line number Diff line number Diff line Loading @@ -3676,7 +3676,11 @@ void stereo_dft_dec_read_BS_fx( { hStereoDft->side_gain_index_previous[b] = ind1[b]; move16(); #ifdef FIX_860_FER_CRASH hStereoDft->res_gains_ind_fx[0][b + STEREO_DFT_BAND_MAX] = L_shl_sat( ind1[b], 26 ); #else hStereoDft->res_gains_ind_fx[0][b + STEREO_DFT_BAND_MAX] = L_shl( ind1[b], 26 ); #endif move32(); } Loading Loading @@ -3866,7 +3870,11 @@ void stereo_dft_dec_read_BS_fx( stereo_dft_dequantize_res_gains_fx( ind1 + b, &I, hStereoDft->side_gain_fx + add( i_mult( add( k, k_offset ), STEREO_DFT_BAND_MAX ), b ), hStereoDft->res_pred_gain_fx + add( i_mult( add( k, k_offset ), STEREO_DFT_BAND_MAX ), b ), 1 ); hStereoDft->res_pred_index_previous[b] = I; move16(); #ifdef FIX_860_FER_CRASH hStereoDft->res_gains_ind_fx[1][b + STEREO_DFT_BAND_MAX] = L_shl_sat( I, 26 ); #else hStereoDft->res_gains_ind_fx[1][b + STEREO_DFT_BAND_MAX] = L_shl( I, 26 ); #endif move32(); } Loading @@ -3891,7 +3899,11 @@ void stereo_dft_dec_read_BS_fx( stereo_dft_dequantize_res_gains_fx( ind1 + b, &I, hStereoDft->side_gain_fx + add( i_mult( add( k, k_offset ), STEREO_DFT_BAND_MAX ), b ), hStereoDft->res_pred_gain_fx + add( i_mult( add( k, k_offset ), STEREO_DFT_BAND_MAX ), b ), 1 ); hStereoDft->res_pred_index_previous[b] = I; move16(); #ifdef FIX_860_FER_CRASH hStereoDft->res_gains_ind_fx[1][b + STEREO_DFT_BAND_MAX] = L_shl_sat( I, 26 ); #else hStereoDft->res_gains_ind_fx[1][b + STEREO_DFT_BAND_MAX] = L_shl( I, 26 ); #endif move32(); } } Loading
lib_dec/ivas_stereo_icbwe_dec.c +8 −0 Original line number Diff line number Diff line Loading @@ -1209,7 +1209,11 @@ void stereo_icBWE_dec_fx( tmp = shl( tmp, 2 ); icbweM2Ref_fx = Sqrt16( sub( 16384, tmp ), &temp1_fx ); icbweM2Ref_fx = BASOP_Util_Divide1616_Scale( icbweM2Ref_fx, ratio_L_fx, &temp2_fx ); #ifdef FIX_860_FER_CRASH icbweM2Ref_fx = shl_sat( icbweM2Ref_fx, add( temp2_fx, sub( temp1_fx, 1 ) ) ); // Q14 #else icbweM2Ref_fx = shl( icbweM2Ref_fx, add( temp2_fx, sub( temp1_fx, 1 ) ) ); // Q14 #endif } ELSE { Loading Loading @@ -1238,7 +1242,11 @@ void stereo_icBWE_dec_fx( tmp = shl( tmp, 2 ); icbweM2Ref_fx = Sqrt16( sub( 16384, tmp ), &temp1_fx ); icbweM2Ref_fx = BASOP_Util_Divide1616_Scale( icbweM2Ref_fx, sub( 32767, ratio_L_fx ), &temp2_fx ); #ifdef FIX_860_FER_CRASH icbweM2Ref_fx = shl_sat( icbweM2Ref_fx, add( temp2_fx, sub( temp1_fx, 1 ) ) ); // Q14 #else icbweM2Ref_fx = shl( icbweM2Ref_fx, add( temp2_fx, sub( temp1_fx, 1 ) ) ); // Q14 #endif } ELSE { Loading