Commit 3c022b6d authored by vaclav's avatar vaclav
Browse files

remove redundant code under IVAS_CODE_CPE, IVAS_CODE_DFT, and IVAS_CODE_BWD

parent d716d99f
Loading
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -292,11 +292,7 @@ void amr_wb_enc_fx(
     * Detect NB spectrum in a 16kHz-sampled input
     *----------------------------------------------------------------*/

    analy_sp_fx( st->element_mode,
#ifdef IVAS_CODE_CPE
                 hCPE,
#endif
                 st->input_Fs, inp, Q_new, fr_bands, lf_E, &Etot, st->min_band, st->max_band, Le_min_scaled, Scale_fac, st->Bin_E_fx,
    analy_sp_fx( st->element_mode, inp, Q_new, fr_bands, lf_E, &Etot, st->min_band, st->max_band, Le_min_scaled, Scale_fac, st->Bin_E_fx,
                 st->Bin_E_old_fx, PS, st->lgBin_E_fx, st->band_energies, fft_buff );

    noise_est_pre_fx( Etot, st->ini_frame, hNoiseEst, 0, EVS_MONO, EVS_MONO );
+2 −22
Original line number Diff line number Diff line
@@ -19,9 +19,7 @@

static void find_enr( Word16 data[], Word32 band[], Word32 *ptE, Word32 *LEtot, const Word16 min_band, const Word16 max_band, const Word16 Q_new2, const Word32 e_min, Word32 *Bin_E, Word16 BIN_FREQ_FX, Word32 *band_energies );
static void ivas_find_enr( Word16 *data, Word16 q_data, Word32 *band, Word16 *q_band, Word32 *ptE, Word16 *q_ptE, Word64 *LEtot, const Word16 min_band, const Word16 max_band, Word32 *Bin_E, Word16 BIN_FREQ_FX, Word32 *band_energies );
#ifdef IVAS_CODE_CPE
static void find_enr_dft( CPE_ENC_HANDLE hCPE, const int32_t input_Fs, float DFT_past_DMX[], float band[], float *ptE, float *Etot, const int16_t min_band, const int16_t max_band, float *Bin_E, float *band_ener );
#endif


/*-------------------------------------------------------------------*
 * analy_sp_fx()
@@ -31,10 +29,6 @@ static void find_enr_dft( CPE_ENC_HANDLE hCPE, const int32_t input_Fs, float DFT

void analy_sp_fx(
    const Word16 element_mode, /* i  : element mode                                    */
#ifdef IVAS_CODE_CPE
    CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure                           */
#endif
    const Word32 input_Fs,     /* i  : input sampling rate                             */
    Word16 *speech,            /* i  : speech buffer                          Q_new - preemph_bits */
    const Word16 Q_new,        /* i  : current scaling exp                    Q0                 */
    Word32 *fr_bands,          /* o  : energy in critical frequency bands     Q_new + QSCALE    */
@@ -60,9 +54,7 @@ void analy_sp_fx(
    Word16 Min_val, Max_val;
    Word16 Scale_fac2;
    Word16 fft_temp[L_FFT];
#ifndef IVAS_CODE_CPE
    (void) input_Fs;
#endif

    /*-----------------------------------------------------------------*
     * Compute spectrum
     * find energy per critical frequency band and total energy in dB
@@ -134,18 +126,6 @@ void analy_sp_fx(
            pt_fft += L_FFT;
        }
    }
#ifdef IVAS_CODE_CPE
    ELSE
    {
        /* find energy per critical band */
        find_enr_dft( hCPE, input_Fs, hCPE->hStereoDft->DFT[0], pt_bands, lf_E, Etot, min_band, max_band, Bin_E, band_ener );
        mvr2r( lf_E, lf_E + VOIC_BINS, VOIC_BINS );
        mvr2r( Bin_E, Bin_E + ( L_FFT / 2 ), L_FFT / 2 );
        mvr2r( band_ener, band_ener + NB_BANDS, NB_BANDS );
        mvr2r( pt_bands, pt_bands + NB_BANDS, NB_BANDS );
        *Etot *= 2.f;
    }
#endif

    /* Average total log energy over both half-frames */
    frac_etot = 0;
+3 −8
Original line number Diff line number Diff line
@@ -67,12 +67,6 @@ void bw_detect_fx(
    const Word32 *pt32;
    Word32 max_NB32, max_WB32, max_SWB32, max_FB32, mean_NB32, mean_WB32, mean_SWB32, mean_FB32; /* Q11*/ /* we need Word32 for the new cldfb energy vectors */
    Word16 bwd_count_wider_bw;
#ifdef IVAS_CODE_DFT
    Word16 l_frame;
#endif
#ifndef IVAS_CODE_BWD
    (void) spectrum;
#endif
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
@@ -1046,7 +1040,7 @@ void set_bw_fx(
        move16();
    }
}
//#ifdef IVAS_CODE_BWD


/*-------------------------------------------------------------------*
 * set_bw_stereo()
@@ -1093,7 +1087,8 @@ void set_bw_stereo_fx(

    return;
}
//#endif


/*-------------------------------------------------------------------*
 * set_bw_mct()
 *
+1 −5
Original line number Diff line number Diff line
@@ -254,11 +254,7 @@ void pre_proc_fx(
     * Spectral analysis
     *--------------------------------------------------------------------------*/

    analy_sp_fx( -1,
#ifdef IVAS_CODE_CPE
                 NULL,
#endif
                 st->input_Fs, inp_12k8, *Q_new, fr_bands, lf_E, Etot, st->min_band, st->max_band, Le_min_scaled, Scale_fac, st->Bin_E_fx, st->Bin_E_old_fx,
    analy_sp_fx( -1, inp_12k8, *Q_new, fr_bands, lf_E, Etot, st->min_band, st->max_band, Le_min_scaled, Scale_fac, st->Bin_E_fx, st->Bin_E_old_fx,
                 PS, st->lgBin_E_fx, st->band_energies, fft_buff );

    st->band_energies_exp = sub( sub( WORD32_BITS - 1, *Q_new ), QSCALE );
+0 −4
Original line number Diff line number Diff line
@@ -2190,10 +2190,6 @@ void stat_noise_uv_enc_ivas_fx(

void analy_sp_fx(
    const Word16 element_mode, /* i  : element mode                                    */
#ifdef IVAS_CODE_CPE
    CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure                           */
#endif
    const Word32 input_Fs,     /* i  : i   sampling rate                             */
    Word16 *speech,            /* i  : speech buffer                          Q_new - preemph_bits */
    const Word16 Q_new,        /* i  : current scaling exp                    Q0                 */
    Word32 *fr_bands,          /* o  : energy in critical frequency bands     Q_new + QSCALE    */