Commit 42068a47 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'msan_asan_ltv_crash_fix' into 'main'

ASAN and MSAN fixes, LTV crash fix for -10dB stereo stream

See merge request !454
parents 4902d37e cda92559
Loading
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -312,6 +312,12 @@ void hq2_bit_alloc_har_fx(

    Word16 exp_shift;

#ifdef BASOP_NOGLOB
    Flag Overflow;
    Overflow = 0;
    move32();
#endif

    L_THR1 = L_shl( L_deposit_l( THR1 ), SWB_BWE_LR_QRk );
    L_THR2 = L_shl( L_deposit_l( THR2 ), SWB_BWE_LR_QRk );
    L_THR3 = L_shl( L_deposit_l( THR3 ), SWB_BWE_LR_QRk );
@@ -566,7 +572,13 @@ void hq2_bit_alloc_har_fx(

    L_temp = Mult_32_16( L_Ravg_sub[GRP_SB - 1], sub( GRP_SB, 1 ) ); /* Qbe+0+1 */
    L_temp = Mult_32_16( L_temp, Inv_norm_sum_fx );                  /* Qbe+1+QIpb+1 */
#ifdef BASOP_NOGLOB
    lf_hf_ge_r_fx = round_fx_o( L_shl_o( L_temp, sub( 15 + 16, sub( add( SWB_BWE_LR_Qbe, QIns ), 30 ) ), &Overflow ), &Overflow );
    Overflow = 0; /* reset BASOP Overflow */
    move32();
#else
    lf_hf_ge_r_fx = round_fx( L_shl( L_temp, sub( 15 + 16, sub( add( SWB_BWE_LR_Qbe, QIns ), 30 ) ) ) );
#endif

    exp_normn = norm_s( norm_sum_fx );
    exp_normn = sub( exp_normn, 1 );
+7 −7
Original line number Diff line number Diff line
@@ -5527,7 +5527,7 @@ void ivas_sba_mix_matrix_determiner_fx(
    const Word16 nchan_remapped,    /* i  : num channels after remapping of TCs */
    const Word16 output_frame,      /* i  : output frame length                 */
    const Word16 num_md_sub_frames, /* i  : number of subframes in mixing matrix*/
    const Word16 Q_p_Output                             /* i  : number of subframes in mixing matrix    */
    const Word16 Q_output           /* i  : Q of transport/output audio channels */
);
#endif // IVAS_FLOAT_FIXED

+3 −2
Original line number Diff line number Diff line
@@ -861,7 +861,7 @@ void ivas_sba_mix_matrix_determiner_fx(
    const Word16 nchan_remapped,    /* i  : num channels after remapping of TCs */
    const Word16 output_frame,      /* i  : output frame length                 */
    const Word16 num_md_sub_frames, /* i  : number of subframes in mixing matrix*/
    const Word16 Q_output           /* i  : number of subframes in mixing matrix*/
    const Word16 Q_output           /* i  : Q of transport/output audio channels */
)
{
    Word16 i, ch;
@@ -899,6 +899,7 @@ void ivas_sba_mix_matrix_determiner_fx(
    nchan_out = nchan_transport;
    move16();
    ivas_agc_dec_process_fx( hSpar->hAgcDec, ( output_fx ), ( output_fx ), nchan_transport, output_frame );
    Q_p_output = sub( Q_p_output, 3 );
#ifdef DUMPS_ENABLED
    dbgwrite_txt( &output[0][0], output_frame, "fix_ivas_agc_dec_process_output.txt", NULL );
#endif // DUMPS_ENABLED
@@ -908,7 +909,7 @@ void ivas_sba_mix_matrix_determiner_fx(
    {
        FOR( i = 0; i < output_frame; i++ )
        {
            output_fx[ch][i] = Mult_32_32( L_shl_sat( output_fx[ch][i], sub( 18, Q_p_output ) ), L_shl_sat( PCM16_TO_FLT_FAC_FX, 16 ) ); /*Q-0*/
            output_fx[ch][i] = Mult_32_32( L_shl_sat( output_fx[ch][i], sub( 15, Q_p_output ) ), L_shl_sat( PCM16_TO_FLT_FAC_FX, 16 ) ); /* Q0 */
        }
    }

+3 −0
Original line number Diff line number Diff line
@@ -490,6 +490,9 @@ ivas_error init_encoder(

    st->lp_speech = 45.0f; /* Initialize the long-term active speech level in dB */
    st->lp_noise = 0.0f;
#ifdef IVAS_FLOAT_FIXED
    st->lp_noise_fx = 0;
#endif
    st->flag_noisy_speech_snr = 0;
    st->fd_cng_reset_flag = 0;
    st->cng_type = -1;
+1 −0
Original line number Diff line number Diff line
@@ -1730,6 +1730,7 @@ ivas_error pre_proc_front_ivas_fx(
        st->lt_mean_NB_fx = (Word16) st->lt_mean_NB * ( 1 << 11 );
        st->lt_mean_WB_fx = (Word16) st->lt_mean_WB * ( 1 << 11 );
        st->lt_mean_SWB_fx = (Word16) st->lt_mean_SWB * ( 1 << 11 );
        st->lp_noise_fx = (Word16) st->lp_noise * ( 1 << 8 ); // have taken Q8 as above one functions uses Q8
#endif

        bw_detect_fx( st, st->input_fx, NULL, enerBuffer_fx, sf_energySum, ivas_format, 0 );
Loading