Commit 1973b15a authored by vaillancour's avatar vaillancour
Browse files

Combine switches and clean-up

parent f324c4ac
Loading
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -284,7 +284,7 @@ void Ener_per_band_comp_fx(
    const Word16 Q_exc,         /* i  : frame length                      */
    const Word16 Mband,         /* i  : Max band                          */
    const Word16 Eflag          /* i  : flag of highest band              */
#ifdef HARM_GSC_ENC_PART3
#ifdef FIX_1904_HARM_GSC_ENC
    ,
    const Word16 L_frame /* i  : frame length                */
#endif
@@ -314,23 +314,18 @@ void Ener_per_band_comp_fx(
        move16();
        pt_fx += 32;
    }
#ifdef HARM_GSC_ENC_PART3
#ifdef FIX_1904_HARM_GSC_ENC
    IF( EQ_16( L_frame, L_FRAME16k ) )
    {
        y_gain4_fx[j + 2] = Comp_band_log_ener( pt_fx, 32, Q_exc, -1 ); /*Q12*/
        move16();
#ifdef FIX_BUG_IN_IVAS_GSC
        pt_fx += 32;
        y_gain4_fx[j + 3] = Comp_band_log_ener( pt_fx, 32, Q_exc, -1 ); /*Q12*/
#else
        y_gain4_fx[j + 3] = Comp_band_log_ener( pt_fx, 64, Q_exc, -1 ); /*Q12*/
#endif
        move16();
    }
#endif
    return;
}
#ifndef HARM_GSC_ENC_PART3
#ifndef FIX_1904_HARM_GSC_ENC
void Ener_per_band_comp_ivas_fx(
    const Word16 exc_diff_fx[], /* i  : target signal                     Q_exc_diff     */
    Word16 y_gain4_fx[],        /* o  : Energy per band to quantize       Q12            */
+3 −3
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ void Inac_switch_ematch_fx(
    test();
    IF( ( EQ_16( coder_type, AUDIO ) || ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) ) ) && bfi == 0 )
    {
#ifdef HARM_GSC_ENC_PART3
#ifdef FIX_1904_HARM_GSC_ENC
        Ener_per_band_comp_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame );
#else
        Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame );
@@ -94,7 +94,7 @@ void Inac_switch_ematch_fx(
        /* Find spectrum and energy per band for GC and VC frames */
        edct_16fx( exc2, dct_exc_tmp, L_frame, 5, element_mode );

#ifdef HARM_GSC_ENC_PART3
#ifdef FIX_1904_HARM_GSC_ENC
        Ener_per_band_comp_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame );
#else
        Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame );
@@ -110,7 +110,7 @@ void Inac_switch_ematch_fx(
    {
        /* Find spectrum and energy per band for inactive frames */
        edct_16fx( exc2, dct_exc_tmp, L_frame, 5, element_mode );
#ifdef HARM_GSC_ENC_PART3
#ifdef FIX_1904_HARM_GSC_ENC
        Ener_per_band_comp_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame );
#else
        Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame );
+5 −5
Original line number Diff line number Diff line
@@ -636,7 +636,7 @@ static void envelop_modify_fx(

    return;
}
#ifndef HARM_GSC_ENC_PART3
#ifndef FIX_1904_HARM_GSC_ENC
void highband_exc_dct_in_fx(
    const Word32 core_brate,         /* i  : core bitrate                            */
    const Word16 *mfreq_bindiv,      /* i  : bin per bands tables                    */
@@ -801,7 +801,7 @@ void highband_exc_dct_in_fx(
    test();
    IF( EQ_32( core_brate, ACELP_8k00 ) && NE_16( bwidth, NB ) )
    {
#ifdef HARM_GSC_ENC_PART3
#ifdef FIX_1904_HARM_GSC_ENC
        Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0, L_frame );
#else
        Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0 );
@@ -809,7 +809,7 @@ void highband_exc_dct_in_fx(
    }
    ELSE
    {
#ifdef HARM_GSC_ENC_PART3
#ifdef FIX_1904_HARM_GSC_ENC
        Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1, L_frame );
#else
        Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1 );
@@ -1183,7 +1183,7 @@ void highband_exc_dct_in_ivas_fx(
    test();
    IF( EQ_32( core_brate, ACELP_8k00 ) && NE_16( bwidth, NB ) )
    {
#ifdef HARM_GSC_ENC_PART3
#ifdef FIX_1904_HARM_GSC_ENC
        Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0, L_frame );
#else
        Ener_per_band_comp_ivas_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0, L_frame );
@@ -1191,7 +1191,7 @@ void highband_exc_dct_in_ivas_fx(
    }
    ELSE
    {
#ifdef HARM_GSC_ENC_PART3
#ifdef FIX_1904_HARM_GSC_ENC
        Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1, L_frame );
#else
        Ener_per_band_comp_ivas_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1, L_frame );
+5 −5
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ void pre_echo_att_fx(
    const Word16 Q_new,
    const Word16 last_coder_type, /* i  : Last coding mode        Q0*/
    const Word16 L_frame          /* i  : Frame length            Q0*/
#ifdef HARM_GSC_ENC_PART3
#ifdef FIX_1904_HARM_GSC_ENC
    ,
    const Word16 element_mode /* i  : Current IVAS element mode*/
#endif
@@ -72,7 +72,7 @@ void pre_echo_att_fx(
    Word16 tmp, n1, n2, exp, frac1, frac2;
    Word32 etmp1_fx;
    Word16 att_len;
#ifdef HARM_GSC_ENC_PART3
#ifdef FIX_1904_HARM_GSC_ENC
    Word16 etmp_e, tmp_e;
#endif
    test();
@@ -113,7 +113,7 @@ void pre_echo_att_fx(
        IF( GT_32( etmp_fx, *Last_frame_ener_fx ) && attack_pos_fx > 0 )
        {
            /* Find the average energy before the attack */
#ifdef HARM_GSC_ENC_PART3
#ifdef FIX_1904_HARM_GSC_ENC
            IF( NE_16( element_mode, EVS_MONO ) ) /* This could be harmonized with EVS, but won't be BE */
            {
                etmp_fx = sum32_fx( finc_fx, attack_pos_fx );
@@ -177,7 +177,7 @@ void pre_echo_att_fx(
        /*-------------------------------------------------------*
         * In normal cases, just compute the energy of the frame
         *-------------------------------------------------------*/
#ifdef HARM_GSC_ENC_PART3
#ifdef FIX_1904_HARM_GSC_ENC
        IF( NE_16( element_mode, EVS_MONO ) ) /* This could be harmonized with EVS, but won't be BE */
        {
            Word16 exp_etmp = sub( 15, Q_new );
@@ -202,7 +202,7 @@ void pre_echo_att_fx(
    return;
}

#ifndef HARM_GSC_ENC_PART3
#ifndef FIX_1904_HARM_GSC_ENC
void pre_echo_att_ivas_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*/
+1 −6
Original line number Diff line number Diff line
@@ -88,10 +88,7 @@
#define FIX_1435_MOVE_STEREO_PANNING                    /* VA: issue 1435: do the EVS stereo panning in the renderer */
#define FIX_2252_SCALING_SAVE_HB_SYNTH                  /* VA: issue 2252: fix use-of-uninit-value in save_hb_synth_fx[] scaling in FOA decoding with bitstream that starts with an SID */
#define FIX_2248_EVS_ASSERT                             /* VA: Include _sat in an EVS related part of the code */
#define HARM_GSC_ENC                                    /* VA: Harmonization of EVS and IVAS GSC code */
#define HARM_GSC_ENC_PART2
#define HARM_GSC_ENC_PART3
#define HARM_GSC_ENC_PART4
#define FIX_1904_HARM_GSC_ENC                           /* VA: #1904 Harmonization of EVS and IVAS GSC code */

/* #################### End BE switches ################################## */

@@ -102,8 +99,6 @@
#define FIX_1461_CNG_BW_SWITCHING                       /* Eri: float issue 1461: Stereo parameters are not updated when SID/NODATA forces BW to stay the same */
#define FIX_2041_SPECTRAL_GAPS_FOR_INACTIVE_FRAMES      /* FhG: Using rounding in multiplication to improve precision in cngNoiseLevel[] */
#define FIX_2264_OUT_OF_BOUND_READING_IN_LOG2_NORM_LC   /* VA: Fix issue 2264 by adding a proper safeguard in log2 and by adding a missing normalization in swb_pre_proc_ivas_fx()*/
//#define FIX_EVS_LR_PG_BUG                               /* VA: EVS bug on how the lowrate pitch gain is compared to threshold, not used in IVAS */
//#define FIX_BUG_IN_IVAS_GSC
/* ##################### End NON-BE switches ########################### */

/* ################## End MAINTENANCE switches ######################### */
Loading