Commit 187213dc authored by vaclav's avatar vaclav
Browse files

Merge branch 'basop-2338-harmonise-duplication-of-comp_and_apply_gain_fx' into 'main'

basop-2338-harmonise-duplication-of-comp_and_apply_gain_fx[non-BE] [allow-regression] [split-non-BE]

See merge request !2719
parents fc410247 f3f52229
Loading
Loading
Loading
Loading
Loading
+19 −11
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ void Comp_and_apply_gain_fx(

    return;
}
#ifndef FIX_2338_HARM_GSC_GAIN_COMP


void Comp_and_apply_gain_ivas_fx(
@@ -238,6 +239,7 @@ void Comp_and_apply_gain_ivas_fx(

    return;
}
#endif


/*========================================================================*/
@@ -258,7 +260,6 @@ void Comp_and_apply_gain_ivas_fx(
/* _ (Word32*) etmp14    : Energy band 14                  Q_exc_diff*2+1 */
/* _ (Word32*) etmp15    : Energy band 15                  Q_exc_diff*2+1 */
/*------------------------------------------------------------------------*/

/*------------------------------------------------------------------------*/
/* RETURN ARGUMENTS :                                                     */
/* _ None                                                                 */
@@ -285,6 +286,7 @@ static Word16 Comp_band_log_ener(
    return tmp16;
}


void Ener_per_band_comp_fx(
    const Word16 exc_diff_fx[], /* i  : target signal                     Q_exc_diff     */
    Word16 y_gain4_fx[],        /* o  : Energy per band to quantize       Q12            */
@@ -403,6 +405,7 @@ static void GSC_gain_adj(
    /* Gain adjustment to fit ACELP generic inactive coding gain at low rate */
    Word16 Gain_off, i;
    Word16 Fac_div;

    Fac_div = 102;
    move16();

@@ -540,6 +543,7 @@ Word16 gsc_gaindec_fx(
            idx_g_fx = (Word16) get_next_indice_fx( st_fx, 7 );
            VDQ_vec_fx( y_gainQ_fx + 6, Mean_dic_NB_fx + 6, Gain_dic3_NBHR_fx, idx_g_fx, 4 );
        }

        test();
        IF( LE_32( core_brate_fx, ACELP_9k60 ) && ( coder_type == INACTIVE ) )
        {
@@ -576,7 +580,9 @@ Word16 gsc_gaindec_fx(
             *--------------------------------------------------------------------------------------*/

            idx_g_fx = (Word16) get_next_indice_fx( st_fx, 5 );

            VDQ_vec_fx( y_gainQ_fx, YGain_mean_LR_fx, YGain_dic1_LR_fx, idx_g_fx, 3 );

            IF( !( coder_type == INACTIVE && st_fx->tdm_LRTD_flag == 0 && EQ_16( st_fx->idchan, 1 ) ) || GT_32( st_fx->core_brate, GSC_LRES_GAINQ_LIMIT ) )
            {
                idx_g_fx = (Word16) get_next_indice_fx( st_fx, 5 );
@@ -600,7 +606,9 @@ Word16 gsc_gaindec_fx(
                move16();
                y_gainQ_fx[11] = 0;
                move16();

                ifft_rel_fx( y_gainQ_fx + 8, 8, 3 );

                FOR( i = 8; i < 16; i++ )
                {
                    y_gainQ_fx[i] = round_fx( L_shl( L_mult( y_gainQ_fx[i], 23101 ), 1 ) ); /*Q12 */
+4 −2
Original line number Diff line number Diff line
@@ -1364,9 +1364,10 @@ void highband_exc_dct_in_ivas_fx(
            move16();
        }
    }

#ifndef FIX_2338_HARM_GSC_GAIN_COMP
    IF( EQ_16( element_mode, EVS_MONO ) )
    {
#endif
        Comp_and_apply_gain_fx( exc_diffQ, Ener_per_bd_iQ, Ener_per_bd_yQ, last_bin, 0, Qexc_diffQ, *Q_exc );

        IF( exc_wo_nf != NULL )
@@ -1374,6 +1375,7 @@ void highband_exc_dct_in_ivas_fx(
            Comp_and_apply_gain_fx( exc_wo_nf, Ener_per_bd_iQ, Ener_per_bd_yQ, last_bin, 1, Qexc_diffQ, *Q_exc );
            Vr_add( exc_dct_in, exc_wo_nf, exc_wo_nf, L_frame );
        }
#ifndef FIX_2338_HARM_GSC_GAIN_COMP
    }
    ELSE
    {
@@ -1404,7 +1406,7 @@ void highband_exc_dct_in_ivas_fx(
            Scale_sig( exc_dct_in, L_frame, sub( *Q_exc, Q_old ) );
        }
    }

#endif
    /*--------------------------------------------------------------------------------------*
     * add the correction layer to the LF bins,
     * and add the quantized pulses or the noise for the higher part of the spectrum
+1 −0
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@
#define FIX_2302_LSF_CDBK_THRESHOLD                     /* VA: basop issue 2302: fix threshold for LSF Q codebook-type decision  */
#define FIX_1500_ISM_MD_DTX                             /* VA: float issue 1500: fix ISM elevation metadata smoothing in DTX */
#define FIX_2348_REPLACE_FEC_ENC                        /* VA: basop issue 2348: replace FEC_encode_ivas_fx with FEC_encode_fx  */
#define FIX_2338_HARM_GSC_GAIN_COMP                     /* VA: basop issue 2338: harmonization of band gain computation for both EVS and IVAS */

/* ##################### End NON-BE switches ########################### */

+2 −2
Original line number Diff line number Diff line
@@ -1711,7 +1711,7 @@ void Comp_and_apply_gain_fx(
    const Word16 ReUseGain,  /* i  : Reuse the gain in Ener_per_bd_yQ     */
    Word16 Qexc_diff,
    Word16 Q_exc );
#ifndef FIX_2338_HARM_GSC_GAIN_COMP
void Comp_and_apply_gain_ivas_fx(
    Word16 exc_diffQ[],      /* i/o: Quantized excitation                  */
    Word16 Ener_per_bd_iQ[], /* i  : Target ener per band              Q13 */
@@ -1720,7 +1720,7 @@ void Comp_and_apply_gain_ivas_fx(
    const Word16 ReUseGain,  /* i  : Reuse the gain in Ener_per_bd_yQ      */
    Word16 Qexc_diff,
    Word16 *Q_exc );
#endif
void pre_echo_att_fx(
    Word32 *Last_frame_ener_fx,      /* i/o: Energy of the last frame         2*Q_new+1*/
    Word16 *exc_fx,                  /* i/o: Excitation of the current frame  Q_new*/