Commit 255893b5 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '3gpp_issue_1288_fix' into 'main'

Fix for 3GPP issue 1288: Missing scaling in NB post-filter

See merge request !1119
parents f524c1a3 0f9b0399
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6641,7 +6641,7 @@ void nb_post_filt_fx(
    const Word16 tmp_noise,  /* i  : noise energy                       Q0   */
    Word16 *Synth,           /* i  : 12k8 synthesis                    Qsyn  */
    const Word16 *Aq,        /* i  : LP filter coefficient             Q12   */
    const Word16 *Pitch_buf, /* i  : Fractionnal subframe pitch buffer Q6    */
    const Word16 *Pitch_buf, /* i  : Fractionnal subframe pitch buffer Q0    */
    const Word16 coder_type, /* i  : coder_type                              */
    const Word16 BER_detect, /* i  : BER detect flag                         */
    const Word16 disable_hpf /* i  : flag to diabled HPF                     */
+3 −3
Original line number Diff line number Diff line
@@ -1247,7 +1247,7 @@ ivas_error acelp_core_dec_ivas_fx(
             *------------------------------------------------------------*/


            Copy_Scale_sig( pitch_buf_fx, pitch_buf_tmp, NB_SUBFR16k, -Q6 ); // Q0
            Copy_Scale_sig( pitch_buf_fx, pitch_buf_tmp, st->nb_subfr, -Q6 ); // Q0
            FEC_scale_syn_ivas_fx( st->L_frame, &update_flg, st->clas_dec, st->last_good, psyn_fx, pitch_buf_tmp, st->enr_old_fx, enr_q_fx, st->coder_type, LSF_Q_prediction,
                                   &st->scaling_flag, &st->lp_ener_FEC_av, &st->lp_ener_FEC_max, st->bfi, st->total_brate, st->prev_bfi, st->last_core_brate,
                                   exc_fx, exc2_fx, Aq_fx, &st->old_enr_LP, mem_tmp_fx, st->mem_syn2_fx, st->Q_exc, st->Q_syn, avoid_lpc_burst_on_recovery, 0 );
@@ -1405,7 +1405,7 @@ ivas_error acelp_core_dec_ivas_fx(
        test();
        IF( EQ_32( st->total_brate, ACELP_7k20 ) || EQ_32( st->total_brate, ACELP_8k00 ) )
        {
            Copy_Scale_sig( pitch_buf_fx, pitch_buf_tmp, NB_SUBFR16k, -Q6 ); // Q0
            Copy_Scale_sig( pitch_buf_fx, pitch_buf_tmp, st->nb_subfr, -Q6 ); // Q0

            FEC_scale_syn_ivas_fx( st->L_frame, &update_flg, st->clas_dec, st->last_good, psyn_fx, pitch_buf_tmp, st->enr_old_fx, enr_q_fx, st->coder_type, LSF_Q_prediction,
                                   &st->scaling_flag, &st->lp_ener_FEC_av, &st->lp_ener_FEC_max, st->bfi, st->total_brate, st->prev_bfi, st->last_core_brate,
@@ -1442,7 +1442,7 @@ ivas_error acelp_core_dec_ivas_fx(
    test();
    IF( st->last_bwidth == NB && st->hPFstat != NULL )
    {
        Copy( pitch_buf_fx, pitch_buf_tmp, NB_SUBFR16k );
        Copy_Scale_sig( pitch_buf_fx, pitch_buf_tmp, st->nb_subfr, -Q6 ); // Q0
        IF( st->bwidth == NB )
        {
            st->hPFstat->on = 1;
+4 −4
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ void nb_post_filt_fx(
    const Word16 tmp_noise,  /* i  : noise energy                       Q0   */
    Word16 *Synth,           /* i  : 12k8 synthesis                    Qsyn  */
    const Word16 *Aq,        /* i  : LP filter coefficient             Q12   */
    const Word16 *Pitch_buf, /* i  : Fractionnal subframe pitch buffer Q6    */
    const Word16 *Pitch_buf, /* i  : Fractionnal subframe pitch buffer Q0    */
    const Word16 coder_type, /* i  : coder_type                              */
    const Word16 BER_detect, /* i  : BER detect flag                         */
    const Word16 disable_hpf /* i  : flag to diabled HPF                     */
@@ -142,7 +142,7 @@ void nb_post_filt_fx(
    move16();
    FOR( i = 0; i < L_frame; i += L_SUBFR )
    {
        T0_first = Pitch_buf[j]; // Q6
        T0_first = Pitch_buf[j]; // Q0
        move16();
        Dec_postfilt_fx( hPFstat, T0_first, &Pf_in[i], p_Aq, &Synth[i], Post_G1, Post_G2, Gain_factor, disable_hpf );

@@ -179,7 +179,7 @@ void nb_post_filt_fx(
 *----------------------------------------------------------------------------*/
static void Dec_postfilt_fx(
    PFSTAT_HANDLE hPFstat,    /* i : core decoder parameters */
    const Word16 t0,          /* i  : pitch delay given by coder Q6                   */
    const Word16 t0,          /* i  : pitch delay given by coder Q0                   */
    const Word16 *signal_ptr, /* i  : input signal (pointer to current subframe Q0    */
    const Word16 *coeff,      /* i  : LPC coefficients for current subframe Q12        */
    Word16 *sig_out,          /* o  : postfiltered output                          Q15*/
@@ -749,7 +749,7 @@ static void modify_pst_param_fx(
 * Perform harmonic postfilter
 *----------------------------------------------------------------------------*/
static void pst_ltp_fx(
    Word16 t0,            /* i  : pitch delay given by coder Q6       */
    Word16 t0,            /* i  : pitch delay given by coder Q0       */
    Word16 *ptr_sig_in,   /* i  : postfilter i  filter (residu2) Qx   */
    Word16 *ptr_sig_pst0, /* o  : harmonic postfilter o Qx           */
    Word16 gain_factor    /* i  : Gain Factor (Q15)                */