Commit 4a26af63 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Update td_stereo_param_updt_fx to avoid a crash

[x] Update td_stereo_param_updt_fx function to resolve a crash
[x] getTCXparam fixed function call reverted to float as some
dependency observed which leads to crash.
parent d5ad8367
Loading
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -521,14 +521,24 @@ void td_stereo_param_updt_fx(
    }

    /* This is only to keep the buffer up-to-date */
    Word16 mult_factor = float_to_fix16( 0.8f, 15 );

    Word16 mult_factor = 26214/*0.8f in Q15*/;
    Word16 min_tdm_Pri_pitch_buf_fx = 0;
    Word16 Flag = 0;
    IF( flag_ACELP16k == 1 )
    {
        FOR(i = 0; i < NB_SUBFR; i++)
        {
            tdm_Pri_pitch_buf_fx[i] = mult(pitch_buf_PCh_fx[i], mult_factor);
            tdm_Pri_pitch_buf_fx[i] = max( tdm_Pri_pitch_buf_fx[i], float_to_fix16( PIT_MIN, Q_var ) );
            min_tdm_Pri_pitch_buf_fx = s_min(tdm_Pri_pitch_buf_fx[i], min_tdm_Pri_pitch_buf_fx);
        }
        Flag = BASOP_Util_Cmp_Mant32Exp( L_deposit_l(min_tdm_Pri_pitch_buf_fx), 31 - Q_var, PIT_MIN, 31 );
        IF(Flag == -1)
        {
            FOR(i = 0; i < NB_SUBFR; i++)
            {

                tdm_Pri_pitch_buf_fx[i] = s_max(tdm_Pri_pitch_buf_fx[i], shr(PIT_MIN, Q_var));
            }
        }
    }
    ELSE
+1 −6
Original line number Diff line number Diff line
@@ -895,12 +895,7 @@ static void dec_prm_tcx(

    if ( st->use_partial_copy == 0 )
    {
        getTCXparam( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 );
        // Q-factor for hTcxLtpDec->tcxltp_gain is 15
        // To be removed later
        st->hTcxLtpDec->tcxltp_gain_float = fixedToFloat( st->hTcxLtpDec->tcxltp_gain, 15 );
        st->hTcxDec->tcxltp_last_gain_unmodified_float = st->hTcxLtpDec->tcxltp_gain_float;
        //
        getTCXparam_ivas( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 );
    }

    if ( !st->use_partial_copy )