Commit fe9bb515 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

harmonized generate_comfort_noise_enc_fx and generate_comfort_noise_enc_ivas_fx

parent 2133f18c
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@
#define FIX_FLOAT_1536_INIT_NO_PARAM_LPC                /* FhG: make sure no_param_lpc is initialized in core_encode_twodiv() */
#define FIX_BASOP_2871_INIT_Q_SYN_FACTOR                /* FhG: make sure, st_fx->Q_syn_factor gets initialized during decoder startup */
#define FIX_BASOP_2470_POWER_SPEC_E_INIT                /* FhG: make sure powerSpec_e is always initialized in core_signal_analysis_high_bitrate_fx() */
#define FIX_2455_HARMONIZE_generate_comfort_noise_enc   /* FhG: harmonize generate_comfort_noise_enc and generate_comfort_noise_enc_ivas */

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

+8 −1
Original line number Diff line number Diff line
@@ -366,8 +366,11 @@ ivas_error acelp_core_enc_fx(
                    st->hDtxEnc->last_CNG_L_frame = st->L_frame;
                    move16();
                }

#ifdef FIX_2455_HARMONIZE_generate_comfort_noise_enc
                generate_comfort_noise_enc_fx( st, Q_new, 1, st->element_mode );
#else
                generate_comfort_noise_enc_fx( st, Q_new, 1 );
#endif

                FdCng_exc( st->hFdCngEnc->hFdCngCom, &st->hDtxEnc->CNG_mode, st->L_frame, st->lsp_old_fx,
                           st->hDtxEnc->first_CNG, st->hDtxEnc->lspCNG_fx, Aq, lsp_new, lsf_new_fx, exc_fx, exc2_fx, bwe_exc_fx );
@@ -423,7 +426,11 @@ ivas_error acelp_core_enc_fx(
                st->hFdCngEnc->hFdCngCom->cngNoiseLevelExp = sub( st->hFdCngEnc->hFdCngCom->cngNoiseLevelExp, Q_cngNoise );
                move16();

#ifdef FIX_2455_HARMONIZE_generate_comfort_noise_enc
                generate_comfort_noise_enc_fx( st, Q_new, 1, st->element_mode );
#else
                generate_comfort_noise_enc_ivas_fx( st, Q_new, 1 );
#endif
                st->hTcxEnc->q_Txnq = Q_new;
                move16();

+4 −0
Original line number Diff line number Diff line
@@ -92,7 +92,11 @@ void enc_acelp_tcx_main_fx(
        }

        /* Generate Comfort Noise */
#ifdef FIX_2455_HARMONIZE_generate_comfort_noise_enc
        generate_comfort_noise_enc_fx( st, *Q_new, 1, EVS_MONO );
#else
        generate_comfort_noise_enc_fx( st, *Q_new, 1 );
#endif

        /* Update Core Encoder */
        core_encode_update_cng_fx( st, st->hFdCngEnc->hFdCngCom->timeDomainBuffer, st->hFdCngEnc->hFdCngCom->A_cng, Aw, *Q_new, *shift );
+21 −5
Original line number Diff line number Diff line
@@ -1268,7 +1268,7 @@ void FdCng_encodeSID_fx(
    return;
}


#ifndef FIX_2455_HARMONIZE_generate_comfort_noise_enc
void generate_comfort_noise_enc_fx(
    Encoder_State *stcod,
    Word16 Q_new,
@@ -1651,12 +1651,20 @@ void generate_comfort_noise_enc_fx(

    return;
}
#endif


#ifdef FIX_2455_HARMONIZE_generate_comfort_noise_enc
void generate_comfort_noise_enc_fx(
    Encoder_State *stcod,
    Word16 Q_new,
    Word16 gen_exc,
    int element_mode )
#else
void generate_comfort_noise_enc_ivas_fx(
    Encoder_State *stcod,
    Word16 Q_new,
    Word16 gen_exc )
#endif
{
    Word16 i, s, sn, cnt;
    Word16 startBand2;
@@ -1779,9 +1787,17 @@ void generate_comfort_noise_enc_ivas_fx(
    }

    /* Perform STFT synthesis */
    IF( element_mode == EVS_MONO )
    {
        SynthesisSTFT( fftBuffer, fftBufferExp, timeDomainOutput, st->olapBufferSynth, st->olapWinSyn,
                       tcx_transition, st, gen_exc, &Q_new, -1, -1 );
    }
    ELSE
    {
        SynthesisSTFT_enc_ivas_fx( fftBuffer, fftBufferExp, timeDomainOutput, st->olapBufferSynth, st->olapWinSyn,
                                   tcx_transition, st, gen_exc, &Q_new, -1, -1 );
    IF( hTdCngEnc != NULL )
    }
    IF( ( ( hTdCngEnc != NULL ) && ( element_mode != EVS_MONO ) ) || ( element_mode == EVS_MONO ) )
    {
        Word32 Lener, att;
        Word16 exp;
+11 −0
Original line number Diff line number Diff line
@@ -1586,11 +1586,20 @@ void FdCng_encodeSID_fx(
    Word16 preemph_fac /* i  : preemphase factor */
);

#ifdef FIX_2455_HARMONIZE_generate_comfort_noise_enc
/* Generate the comfort noise based on the target noise level */
void generate_comfort_noise_enc_fx(
    Encoder_State *stcod,
    Word16 Q_new,
    Word16 gen_exc,
    int element_mode );
#else
/* Generate the comfort noise based on the target noise level */
void generate_comfort_noise_enc_fx(
    Encoder_State *stcod,
    Word16 Q_new,
    Word16 gen_exc );
#endif

Word16 cng_energy_fx(
    const Word16 element_mode, /* i  : element mode                 Q0*/
@@ -4185,10 +4194,12 @@ Word16 cng_energy_ivas_fx(
    const Word16 Q_new         /* i  : Input scaling                  */
);

#ifndef FIX_2455_HARMONIZE_generate_comfort_noise_enc
void generate_comfort_noise_enc_ivas_fx(
    Encoder_State *stcod,
    Word16 Q_new,
    Word16 gen_exc );
#endif

void SynthesisSTFT_enc_ivas_fx(
    Word32 *fftBuffer,        /* i    : pointer to FFT bins */