From 0327bd75163e05387238c99321995a007cf4fc65 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Tue, 14 May 2024 19:56:15 +0530 Subject: [PATCH] Fix for msan crashes observed for mc streams --- lib_dec/acelp_core_dec_ivas_fx.c | 8 ++++++ lib_dec/ivas_dirac_dec.c | 4 +++ lib_dec/ivas_jbm_dec.c | 29 ++++++++++++++++++++ lib_dec/ivas_mc_param_dec.c | 9 ++++++ lib_dec/ivas_mct_dec.c | 8 +++--- lib_dec/ivas_sba_dirac_stereo_dec_fx.c | 8 ++++++ lib_dec/ivas_stat_dec.h | 3 ++ lib_dec/ivas_stereo_dft_dec_fx.c | 3 ++ lib_rend/ivas_dirac_dec_binaural_functions.c | 20 ++++++-------- lib_rend/ivas_dirac_decorr_dec.c | 6 ++-- lib_rend/ivas_dirac_rend.c | 14 ++++++++++ lib_rend/ivas_objectRenderer_hrFilt.c | 3 ++ lib_rend/ivas_reverb.c | 7 +++++ 13 files changed, 104 insertions(+), 18 deletions(-) diff --git a/lib_dec/acelp_core_dec_ivas_fx.c b/lib_dec/acelp_core_dec_ivas_fx.c index d45b381a9..810a04adc 100644 --- a/lib_dec/acelp_core_dec_ivas_fx.c +++ b/lib_dec/acelp_core_dec_ivas_fx.c @@ -86,14 +86,22 @@ ivas_error acelp_core_dec_ivas_fx( Word16 lsf_new_fx[M]; /* LSFs at the end of the frame Qlog2(2.56) */ Word16 lsp_new_fx[M]; /* LSPs at the end of the frame Q15 */ Word16 lsp_mid_fx[M]; /* LSPs in the middle of the frame */ +#ifdef MSAN_FIX + Word16 Aq_fx[NB_SUBFR16k * ( M + 1 )] = { 0 }; /* A(q) quantized for the 4 subframes */ +#else Word16 Aq_fx[NB_SUBFR16k * ( M + 1 )]; /* A(q) quantized for the 4 subframes */ +#endif Word16 old_exc2_fx[L_FRAME16k + L_EXC_MEM], *exc2_fx; /* total excitation buffer */ Word16 mem_tmp_fx[M]; /* temporary synthesis filter memory */ Word32 enr_q_fx; /* E information for FER protection */ Word16 tmp_noise_fx; /* Long term temporary noise energy */ Word16 Es_pred_fx; /* predicted scaled innov. energy Q8 */ Word16 FEC_pitch_fx; /* FEC pitch */ +#ifdef MSAN_FIX + Word16 old_bwe_exc_fx[( ( PIT16k_MAX + ( L_FRAME16k + 1 ) + L_SUBFR16k ) * 2 )] = { 0 }; /* excitation buffer */ +#else Word16 old_bwe_exc_fx[( ( PIT16k_MAX + ( L_FRAME16k + 1 ) + L_SUBFR16k ) * 2 )]; /* excitation buffer */ +#endif Word16 *bwe_exc_fx; /* Excitation for SWB TBE */ int16_t i, j, int_fs; int16_t tc_subfr; diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index b7ae00511..cbb08a046 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -3399,7 +3399,11 @@ void ivas_dirac_dec_render_fx( Word16 temp = 0; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; float *output_f_local[MAX_OUTPUT_CHANNELS]; +#ifdef MSAN_FIX + float output_f_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k] = { 0 }; // VE2SB: TBV +#else float output_f_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k]; // VE2SB: TBV +#endif Word32 *output_f_local_fx[MAX_OUTPUT_CHANNELS]; Word32 output_f_local_buff_fx[MAX_OUTPUT_CHANNELS][L_FRAME48k]; // VE2SB: TBV diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 339d4009d..1400daddf 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -157,6 +157,9 @@ ivas_error ivas_jbm_dec_tc( #endif #endif } +#ifdef MSAN_FIX + st_ivas->hTcBuffer->no_channels = ivas_get_nchan_buffers_dec(st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate); +#endif } /*----------------------------------------------------------------* @@ -1264,14 +1267,24 @@ ivas_error ivas_jbm_dec_tc( scale_sig32( hCPE->output_mem_fx[ii], NS2SA_fx2( st_ivas->hDecoderConfig->output_Fs, STEREO_DFT32MS_OVL_NS ), sub( hCPE->hStereoDft->q_dft, Q11 ) ); hCPE->q_output_mem_fx[ii] = hCPE->hStereoDft->q_dft; } +#ifdef MSAN_FIX + FOR( i = 0; i < CPE_CHANNELS; i++ ) + Scale_sig32( hCPE->prev_synth_fx[i], NS2SA_fx2( output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ), hCPE->q_prev_synth_fx - 11 ); +#else Scale_sig32( &hCPE->prev_synth_fx[0][0], sizeof( hCPE->prev_synth_fx) / sizeof(hCPE->prev_synth_fx[0][0]), hCPE->q_prev_synth_fx - 11); +#endif ivas_sba_dirac_stereo_dec_fx(st_ivas, &p_output_fx[sba_ch_idx], output_frame, 0); FOR(i = 0; i < 2; i++) { Scale_sig32(p_output_fx[sba_ch_idx + i], L_FRAME48k, negate(s)); } +#ifdef MSAN_FIX + FOR( i = 0; i < CPE_CHANNELS; i++ ) + Scale_sig32( hCPE->prev_synth_fx[i], NS2SA_fx2( output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ), 11 - hCPE->q_prev_synth_fx ); +#else Scale_sig32(&hCPE->prev_synth_fx[0][0], sizeof(hCPE->prev_synth_fx) / sizeof(hCPE->prev_synth_fx[0][0] ), 11 - hCPE->q_prev_synth_fx ); +#endif scale_sig32( hCPE->input_mem_BPF_fx[0], STEREO_DFT32MS_OVL_16k, sub( Q11, hCPE->hStereoDft->q_dft ) ); FOR( i = 0; i < CPE_CHANNELS; ++i ) @@ -2166,13 +2179,23 @@ ivas_error ivas_jbm_dec_tc( scale_sig32( hCPE->output_mem_fx[ii], NS2SA_fx2( st_ivas->hDecoderConfig->output_Fs, STEREO_DFT32MS_OVL_NS ), sub( hCPE->hStereoDft->q_dft, Q11 ) ); hCPE->q_output_mem_fx[ii] = hCPE->hStereoDft->q_dft; } +#ifdef MSAN_FIX + FOR ( i = 0; i < CPE_CHANNELS; i++ ) + Scale_sig32( hCPE->prev_synth_fx[i], NS2SA_fx2( output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ), hCPE->q_prev_synth_fx - 11 ); +#else Scale_sig32( &hCPE->prev_synth_fx[0][0], sizeof( hCPE->prev_synth_fx) / sizeof(hCPE->prev_synth_fx[0][0]), hCPE->q_prev_synth_fx - 11); +#endif ivas_sba_dirac_stereo_dec_fx(st_ivas, p_output_fx, output_frame, 1); FOR(i = 0; i < 2; i++) { Scale_sig32(p_output_fx[i], L_FRAME48k, negate(s)); } +#ifdef MSAN_FIX + FOR ( i = 0; i < CPE_CHANNELS; i++ ) + Scale_sig32( hCPE->prev_synth_fx[i], NS2SA_fx2( output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ), 11 - hCPE->q_prev_synth_fx); +#else Scale_sig32(&hCPE->prev_synth_fx[0][0], sizeof(hCPE->prev_synth_fx) / sizeof(hCPE->prev_synth_fx[0][0] ), 11 - hCPE->q_prev_synth_fx ); +#endif // MSAN_FIX scale_sig32( hCPE->input_mem_BPF_fx[0], STEREO_DFT32MS_OVL_16k, sub( Q11, hCPE->hStereoDft->q_dft ) ); FOR( i = 0; i < CPE_CHANNELS; ++i ) @@ -4233,6 +4256,9 @@ ivas_error ivas_jbm_dec_render( } } +#ifdef MSAN_FIX + st_ivas->hTcBuffer->no_channels = st_ivas->hTcBuffer->nchan_buffer_full; +#endif // MSAN_FIX /*----------------------------------------------------------------* * Update combined orientation access index *----------------------------------------------------------------*/ @@ -8084,6 +8110,9 @@ ivas_error ivas_jbm_dec_tc_buffer_open( hTcBuffer->tc_fx[ch_idx] = NULL; #endif } +#ifdef MSAN_FIX + st_ivas->hTcBuffer->no_channels = hTcBuffer->nchan_transport_internal; +#endif // MSAN_FIX } else { diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 7474cd375..033e4ad46 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -3619,12 +3619,21 @@ void ivas_param_mc_dec_render_fx( /* set everything to zero that will not be decoded */ nband_synth = hParamMC->band_grouping[hParamMC->num_param_bands_synth]; nbands_to_zero = sub(hParamMC->num_freq_bands , nband_synth); +#ifdef MSAN_FIX + FOR ( ch = 0; ch < MAX_OUTPUT_CHANNELS; ch++ ) +#else FOR ( ch = 0; ch < nchan_out_init; ch++ ) +#endif { FOR ( slot_idx = 0; slot_idx < JBM_CLDFB_SLOTS_IN_SUBFRAME; slot_idx++ ) { +#ifdef MSAN_FIX + set32_fx( &( Cldfb_RealBuffer_fx[ch][slot_idx][0] ), 0, CLDFB_NO_CHANNELS_MAX); + set32_fx( &( Cldfb_ImagBuffer_fx[ch][slot_idx][0] ), 0, CLDFB_NO_CHANNELS_MAX); +#else set32_fx( &( Cldfb_RealBuffer_fx[ch][slot_idx][nband_synth] ), 0, nbands_to_zero ); set32_fx( &( Cldfb_ImagBuffer_fx[ch][slot_idx][nband_synth] ), 0, nbands_to_zero ); +#endif } } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index ea952616c..0aa255316 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1443,9 +1443,9 @@ ivas_error ivas_mc_dec_config( if ( hParamMC->h_output_synthesis_cov_state.cx_old[i] ) { - floatToFixed_arrL( hParamMC->h_output_synthesis_cov_state.cx_old[i], hParamMC->h_output_synthesis_cov_state.cx_old_fx[i], 31 - cx_e, s_min(st_ivas->hParamMC->h_output_synthesis_cov_state.cx_old_len, nchan_transport_old * nchan_transport_old )); + floatToFixed_arrL( hParamMC->h_output_synthesis_cov_state.cx_old[i], hParamMC->h_output_synthesis_cov_state.cx_old_fx[i], 31 - cx_e, nchan_transport_old * nchan_transport_old ); floatToFixed_arrL( hParamMC->h_output_synthesis_cov_state.cy_old[i], hParamMC->h_output_synthesis_cov_state.cy_old_fx[i], 31 - cy_e, nchan_out_cov * nchan_out_cov ); - floatToFixed_arrL( hParamMC->h_output_synthesis_cov_state.mixing_matrix_old[i], hParamMC->h_output_synthesis_cov_state.mixing_matrix_old_fx[i], 31 - mmo_e, s_min(hParamMC->h_output_synthesis_cov_state.mixing_matrix_old_len, nchan_transport_old * nchan_out_cov) ); + floatToFixed_arrL( hParamMC->h_output_synthesis_cov_state.mixing_matrix_old[i], hParamMC->h_output_synthesis_cov_state.mixing_matrix_old_fx[i], 31 - mmo_e, nchan_transport_old * nchan_out_cov ); } } for ( int i = 0; i < CLDFB_NO_CHANNELS_MAX; i++ ) @@ -1518,9 +1518,9 @@ ivas_error ivas_mc_dec_config( { if ( hParamMC->h_output_synthesis_cov_state.cx_old[i] ) { - fixedToFloat_arrL( hParamMC->h_output_synthesis_cov_state.cx_old_fx[i], hParamMC->h_output_synthesis_cov_state.cx_old[i], 31 - cx_e, s_min(st_ivas->hParamMC->h_output_synthesis_cov_state.cx_old_len, nchan_transport_old * nchan_transport_old) ); + fixedToFloat_arrL( hParamMC->h_output_synthesis_cov_state.cx_old_fx[i], hParamMC->h_output_synthesis_cov_state.cx_old[i], 31 - cx_e, nchan_transport_old * nchan_transport_old ); fixedToFloat_arrL( hParamMC->h_output_synthesis_cov_state.cy_old_fx[i], hParamMC->h_output_synthesis_cov_state.cy_old[i], 31 - cy_e, nchan_out_cov * nchan_out_cov ); - fixedToFloat_arrL( hParamMC->h_output_synthesis_cov_state.mixing_matrix_old_fx[i], hParamMC->h_output_synthesis_cov_state.mixing_matrix_old[i], 31 - mmo_e, s_min(hParamMC->h_output_synthesis_cov_state.mixing_matrix_old_len, nchan_transport_old * nchan_out_cov) ); + fixedToFloat_arrL( hParamMC->h_output_synthesis_cov_state.mixing_matrix_old_fx[i], hParamMC->h_output_synthesis_cov_state.mixing_matrix_old[i], 31 - mmo_e, nchan_transport_old * nchan_out_cov ); } } for ( int i = 0; i < CLDFB_NO_CHANNELS_MAX; i++ ) diff --git a/lib_dec/ivas_sba_dirac_stereo_dec_fx.c b/lib_dec/ivas_sba_dirac_stereo_dec_fx.c index 2d0aa25e5..7339afde7 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec_fx.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec_fx.c @@ -1271,7 +1271,11 @@ void ivas_sba_dirac_stereo_dec_fx( #endif IF( hSCE != NULL ) { +#ifdef MSAN_FIX + Scale_sig32( hSCE->prev_hb_synth_fx, NS2SA_fx2(st_ivas->hDecoderConfig->output_Fs, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS),-( Q11 - hCPE->hStereoDft->q_dft ) ); +#else Scale_sig32( hSCE->prev_hb_synth_fx, NS2SA_fx2( 48000, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS ), -( Q11 - hCPE->hStereoDft->q_dft ) ); +#endif // MSAN_FIX hSCE->q_prev_hb_synth_fx = hCPE->hStereoDft->q_dft; } @@ -1384,7 +1388,11 @@ void ivas_sba_dirac_stereo_dec_fx( #endif IF( hSCE != NULL ) { +#ifdef MSAN_FIX + Scale_sig32( hSCE->prev_hb_synth_fx, NS2SA_fx2(st_ivas->hDecoderConfig->output_Fs, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS ), ( Q11 - hCPE->hStereoDft->q_dft ) ); +#else Scale_sig32( hSCE->prev_hb_synth_fx, NS2SA_fx2( 48000, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS ), ( Q11 - hCPE->hStereoDft->q_dft ) ); +#endif // MSAN_FIX hSCE->q_prev_hb_synth_fx = Q11; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 43c23da67..246d2b1fb 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1414,6 +1414,9 @@ typedef struct decoder_tc_buffer_structure Word32 *tc_buffer_fx; /* the buffer itself */ Word16 tc_buff_len;/*stores memory length of tc buffer*/ Word32 *tc_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; /* pointers into the buffer to the beginning of each tc Q11 for ivas */ // VE2SB: TBV +#ifdef MSAN_FIX + Word16 no_channels; /*Stores no of channels in tc_fx with values*/ +#endif Word16 q_tc_fx; #endif TC_BUFFER_MODE tc_buffer_mode; /* mode of the buffer (no buffering, render buffering, out buffering) */ diff --git a/lib_dec/ivas_stereo_dft_dec_fx.c b/lib_dec/ivas_stereo_dft_dec_fx.c index c76c8ce0e..03bb0f511 100644 --- a/lib_dec/ivas_stereo_dft_dec_fx.c +++ b/lib_dec/ivas_stereo_dft_dec_fx.c @@ -97,6 +97,9 @@ void stereo_dft_dec_reset_fx( { Word16 i; Word16 j, b; +#ifdef MSAN_FIX + set_zero_fx( hStereoDft->buff_LBTCX_mem_fx, NS2SA( 16000, STEREO_DFT32MS_OVL_NS ) ); +#endif /*Configuration*/ set_s( hStereoDft->prm_res, hStereoDft->hConfig->prm_res, STEREO_DFT_DEC_DFT_NB ); diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index a36599cf0..04e02ca10 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -1138,13 +1138,9 @@ static void ivas_dirac_dec_binaural_internal( nchan_tc = add( nchan_tc, ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ) ); #endif - IF( st_ivas->hTcBuffer->tc[nchan_transport] ) - FOR( Word16 ind = 0; ind < st_ivas->cldfbAnaDec[1]->no_channels * st_ivas->cldfbAnaDec[1]->no_col; ind++ ) - { - st_ivas->hTcBuffer->tc_fx[nchan_transport][ind] = (Word32) ( st_ivas->hTcBuffer->tc[nchan_transport][ind] * ( 1 << q_input ) ); - } -#ifdef MSAN_FIX_ - FOR( Word16 cha = 0; cha < nchan_tc; cha++ ) +#ifdef MSAN_FIX + // FOR( Word16 cha = 0; cha < nchan_tc; cha++ ) + FOR( Word16 cha = 0; cha < st_ivas->hTcBuffer->no_channels; cha++ ) #else FOR( Word16 cha = 0; cha < 3 + max( 1, st_ivas->nchan_ism ); cha++ ) #endif @@ -1156,8 +1152,9 @@ static void ivas_dirac_dec_binaural_internal( } } -#ifdef MSAN_FIX_ - FOR( Word16 cha = 0; cha < nchan_tc; cha++ ) +#ifdef MSAN_FIX + // FOR( Word16 cha = 0; cha < nchan_tc; cha++ ) + FOR( Word16 cha = 0; cha < MAX_INTERN_CHANNELS; cha++ ) #else FOR( Word16 cha = 0; cha < 3 + max( 1, st_ivas->nchan_ism ); cha++ ) #endif @@ -1559,8 +1556,9 @@ static void ivas_dirac_dec_binaural_internal( } fixedToFloat_arrL( hDiracDecBin->frameMeanDiffuseness_fx, hDiracDecBin->frameMeanDiffuseness, 29, CLDFB_NO_CHANNELS_MAX ); -#ifdef MSAN_FIX_ - FOR( Word16 cha = 0; cha < nchan_tc; cha++ ) +#ifdef MSAN_FIX + // FOR( Word16 cha = 0; cha < nchan_tc; cha++ ) + FOR( Word16 cha = 0; cha < MAX_INTERN_CHANNELS; cha++ ) #else FOR( Word16 cha = 0; cha < 3 + max( 1, st_ivas->nchan_ism ); cha++ ) #endif diff --git a/lib_rend/ivas_dirac_decorr_dec.c b/lib_rend/ivas_dirac_decorr_dec.c index b6511652a..1e2fc6930 100644 --- a/lib_rend/ivas_dirac_decorr_dec.c +++ b/lib_rend/ivas_dirac_decorr_dec.c @@ -1274,7 +1274,7 @@ void ivas_dirac_dec_decorr_process_fx( e_direct_energy_smooth = sub( 31, h_freq_domain_decorr_ap_state->q_direct_energy_smooth ); // scaling to get max precision for aux_buffer values// -#ifdef MSAN_FIX_ +#ifdef MSAN_FIX q_shift = Q31; move16(); FOR( ch_idx = 0; ch_idx < num_channels; ++ch_idx ) @@ -1362,7 +1362,7 @@ void ivas_dirac_dec_decorr_process_fx( e_direct_energy_smooth = sub(31 , h_freq_domain_decorr_ap_state->q_direct_energy_smooth); // this step is b/c we are left shifting frame_dec_fx at the end of below for loop/ -#ifdef MSAN_FIX_ +#ifdef MSAN_FIX q_shift = Q31; move16(); FOR( ch_idx = 0; ch_idx < num_channels; ++ch_idx ) @@ -1439,7 +1439,7 @@ void ivas_dirac_dec_decorr_process_fx( *-----------------------------------------------------------------*/ q_shift = q_input_frame - q_frame_f; -#ifdef MSAN_FIX_ +#ifdef MSAN_FIX // scaling it to input q FOR( ch_idx = 0; ch_idx < num_channels; ++ch_idx ) { diff --git a/lib_rend/ivas_dirac_rend.c b/lib_rend/ivas_dirac_rend.c index f52a9f0b8..ecd3571db 100644 --- a/lib_rend/ivas_dirac_rend.c +++ b/lib_rend/ivas_dirac_rend.c @@ -1560,6 +1560,9 @@ ivas_error ivas_dirac_alloc_mem( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); } +#ifdef MSAN_FIX + set_zero_fx( hDirAC_mem->frame_dec_f_fx, 2 * num_outputs_diff * num_freq_bands ); +#endif hDirAC_mem->frame_dec_f_len = 2 * num_outputs_diff * num_freq_bands; #endif } @@ -1802,6 +1805,9 @@ ivas_error ivas_dirac_alloc_mem( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); } +#ifdef MSAN_FIX + set_zero_fx( hDirAC_mem->onset_filter_fx, num_outputs_diff * num_freq_bands ); +#endif #endif } } @@ -1833,6 +1839,9 @@ ivas_error ivas_dirac_alloc_mem( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); } +#ifdef MSAN_FIX + set_zero_fx( hDirAC_mem->onset_filter_fx, 2 * num_freq_bands ); +#endif #endif } } @@ -4365,8 +4374,13 @@ void ivas_dirac_dec_compute_diffuse_proto_fx( Word16 new_diff_e = s_max( diff_e, old_diff_e ); Scale_sig32( h_dirac_output_synthesis_state->proto_diffuse_buffer_f_fx, diffuse_start, sub( old_diff_e, new_diff_e ) ); +#ifdef MSAN_FIX + Scale_sig32( h_dirac_output_synthesis_state->proto_diffuse_buffer_f_fx + diffuse_start, + sub(2*num_freq_bands_diff*hDirACRend->hOutSetup.nchan_out_woLFE, diffuse_start ), sub( diff_e, new_diff_e ) ); +#else Scale_sig32( h_dirac_output_synthesis_state->proto_diffuse_buffer_f_fx + diffuse_start, sub( h_dirac_output_synthesis_state->proto_diffuse_buffer_f_len, diffuse_start ), sub( diff_e, new_diff_e ) ); +#endif h_dirac_output_synthesis_state->proto_diffuse_buffer_f_q = sub( 31, new_diff_e ); return; diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index bf59d928e..681a407bb 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt.c +++ b/lib_rend/ivas_objectRenderer_hrFilt.c @@ -683,6 +683,9 @@ static void GenerateITD_fx( Word16 num_az_idx, num_ev_idx; Word16 BM_idx[HRTF_MODEL_BSPLINE_NUM_COEFFS_SQ]; Word16 itdMod_e; +#ifdef MSAN_FIX + set16_fx( AzIdx, 0, HRTF_MODEL_BSPLINE_NUM_COEFFS ); +#endif // MSAN_FIX /* Wrap the requested azimuth to the range of the BSplines */ azim_fx = L_add( azim_fx, model->azimKSeq_fx[0] ); diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 4a2e6b7ce..ef477db36 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -2487,9 +2487,16 @@ ivas_error ivas_reverb_open_fx( pFft_wf_filter_ch1_fx[i][0] = L_shl_sat(pFft_wf_filter_ch1_fx[i][0] ,8); pFft_wf_filter_ch1_fx[i][1] = L_shl_sat(pFft_wf_filter_ch1_fx[i][1] ,8); } +#ifdef MSAN_FIX + FOR( int i = 0; i < shl(sub(nr_fc_fft_filter, 1), 1); i++ ) + { + pTime_window_fx[i] = L_shr( pTime_window_fx[i], 1 ); /*Scaling signal down to 30*/ + } +#else FOR (int i = 0; i < RV_FILTER_MAX_FFT_SIZE; i++) { pTime_window_fx[i] = L_shr( pTime_window_fx[i], 1 );/*Scaling signal down to 30*/ } +#endif // MSAN_FIX Word32* pHrtf_inter_aural_coherence_const = (Word32*)malloc(nr_fc_fft_filter * sizeof(Word32)); FOR (int i = 0; i < nr_fc_fft_filter; i++) { -- GitLab