Commit d3643d9f authored by vaillancour's avatar vaillancour
Browse files

Fix proposal for 774, and removing some unecessary code at the same time...

Fix proposal for 774, and removing some unecessary code at the same time (related to the part of code being fixed)
parent 1e9291df
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@
#define FIX_680_CNG_FRAME_BOUNDARIES_ISSUE /* Step was right shift by 2, which made the OVA wrong */
#define NONBE_FIX_1069_SVD_TUNING                       /* FhG: issue 1069: tune SVD constants */
#define FIX_778_STEREO_BRATE_SWITCHING
#define FIX_774_ENERGY_BURST                    /* Fix 0 bit BWE */
/* ################## End DEVELOPMENT switches ######################### */

/* clang-format on */
+2 −1
Original line number Diff line number Diff line
@@ -819,7 +819,7 @@ void hf_synth(
    float *synth,                  /* i/o: 12.8kHz synthesis signal    */
    float *synth16k                /* i/o: 16kHz synthesis signal      */
);
#ifndef FIX_774_ENERGY_BURST
#ifdef IVAS_FLOAT_FIXED
void hf_synth_ivas_fx(
    ZERO_BWE_DEC_HANDLE hBWE_zero, /* i/o: handle to 0 bit BWE parameters */
@@ -838,6 +838,7 @@ void hf_synth_ivas_fx(
    const Word16 CNG_mode,         /* i  : CNG_mode                       */
    Word16 element_mode );
#endif
#endif
int16_t lsp_convert_poly(
    float w[],              /* i/o: LSP or ISP parameters          */
    const int16_t L_frame,  /* i  : flag for up or down conversion */
+5 −0
Original line number Diff line number Diff line
@@ -1787,8 +1787,13 @@ ivas_error acelp_core_dec_fx(
        IF( ( EQ_16( st_fx->L_frame, L_FRAME ) && NE_16( st_fx->bwidth, NB ) && GE_16( output_frame, L_FRAME16k ) &&
              ( EQ_16( st_fx->extl, -1 ) || EQ_16( st_fx->extl, SWB_CNG ) || ( EQ_16( st_fx->extl, WB_BWE ) && st_fx->extl_brate == 0 && NE_16( st_fx->coder_type, AUDIO ) ) ) ) )
        {
#ifdef FIX_774_ENERGY_BURST
            hf_synth_fx( st_fx->hBWE_zero, st_fx->core_brate, output_frame, Aq_fx, exc2_fx, syn_fx, synth_out, st_fx->Q_exc,
                         st_fx->Q_syn2, st_fx->hBWE_zero->delay_syn_hf_fx, &st_fx->hBWE_zero->memExp1, st_fx->hBWE_zero->mem_hp_interp_fx, st_fx->extl, st_fx->CNG_mode );
#else
            hf_synth_fx( st_fx->hBWE_zero, st_fx->core_brate, output_frame, Aq_fx, exc2_fx, syn_fx, synth_out, st_fx->Q_exc,
                         st_fx->Q_syn2, st_fx->hBWE_zero->delay_syn_hf_fx, &hBWE_FD->memExp1, st_fx->hBWE_zero->mem_hp_interp_fx, st_fx->extl, st_fx->CNG_mode );
#endif
        }
        ELSE
        {
+12 −4
Original line number Diff line number Diff line
@@ -1882,22 +1882,29 @@ ivas_error acelp_core_dec_ivas_fx(
            IF( ( EQ_16( st->L_frame, L_FRAME ) && NE_16( st->bwidth, NB ) && GE_16( output_frame, L_FRAME16k ) &&
                  ( EQ_16( st->extl, -1 ) || EQ_16( st->extl, SWB_CNG ) || ( EQ_16( st->extl, WB_BWE ) && st->extl_brate == 0 && NE_16( st->coder_type, AUDIO ) ) ) ) )
            {
#ifndef FIX_774_ENERGY_BURST
                Word16 tmp_exp = 0;
#endif
#ifdef MSAN_FIX
                Copy_Scale_sig_32_16( synth_fx, synth_fx16, output_frame, 0 );
#else
                Copy_Scale_sig_32_16( synth_fx, synth_fx16, L_FRAME48k, 0 );
#endif

#ifdef FIX_774_ENERGY_BURST
                hf_synth_fx( st->hBWE_zero, st->core_brate, output_frame, Aq_fx, exc_fx,
                             psyn_fx, synth_fx16, st->Q_exc, st->Q_syn2, st->hBWE_zero->delay_syn_hf_fx, &st->hBWE_zero->memExp1,
                             st->hBWE_zero->mem_hp_interp_fx, st->extl, st->CNG_mode );
#else
                hf_synth_ivas_fx( st->hBWE_zero, st->core_brate, output_frame, Aq_fx, exc_fx,
                                  psyn_fx, synth_fx16, st->Q_exc, st->Q_syn2, st->hBWE_zero->delay_syn_hf_fx, &tmp_exp,
                                  st->hBWE_zero->mem_hp_interp_fx, st->extl, st->CNG_mode, st->element_mode );
#endif
#ifdef MSAN_FIX
                Copy_Scale_sig_16_32( synth_fx16, synth_fx, output_frame, 0 );
#else
                Copy_Scale_sig_16_32( synth_fx16, synth_fx, L_FRAME48k, 0 );
#endif

#ifndef FIX_774_ENERGY_BURST
                IF( st->hBWE_FD != NULL )
                {
                    st->hBWE_FD->memExp1 = tmp_exp;
@@ -1906,6 +1913,7 @@ ivas_error acelp_core_dec_ivas_fx(
                {
                    Scale_sig( st->hBWE_zero->mem_hf_fx, L_FIR - 1, -tmp_exp );
                }
#endif
            }
            ELSE
            {
+14 −4
Original line number Diff line number Diff line
@@ -24,9 +24,11 @@
static void filt_6k_7k_scale_fx( Word16 signal[], Word16 lg, Word16 mem[], Word16 fact, Word16 exp );

static void hf_synthesis_fx( ZERO_BWE_DEC_HANDLE hBWE_zero, const Word32 core_brate, const Word16 output_subfr, const Word16 Aq[], const Word16 exc[], const Word16 Q_exc, Word16 synth[], Word16 synth16k[], const Word16 Q_syn, Word16 *delay_syn_hf, Word16 *memExp1, Word16 *mem_hp_interp, const Word16 extl, const Word16 CNG_mode );
#ifndef FIX_774_ENERGY_BURST
#ifdef IVAS_FLOAT_FIXED
static void hf_synthesis_ivas_fx( ZERO_BWE_DEC_HANDLE hBWE_zero, const Word32 core_brate, const Word16 output_subfr, const Word16 Aq[], const Word16 exc[], const Word16 Q_exc, Word16 synth[], Word16 synth16k[], const Word16 Q_syn, Word16 *delay_syn_hf, Word16 *memExp1, Word16 *mem_hp_interp, const Word16 extl, const Word16 CNG_mode, Word16 element_mode );
#endif
#endif

static void hf_synthesis_amr_wb_fx( const Word32 core_brate, const Word16 output_subfr, const Word16 Ap[], Word16 exc16k[], Word16 synth_out[], Word16 *mem_syn_hf, Word16 *delay_syn_hf, Word16 *mem_hp_interp, Word16 p_r, Word16 HF_corr_gain, Word16 til, Word16 voice_factors, const Word16 exc[], const Word16 Q_exc, const Word16 Q_out, Word16 qhf );
static void envelope_fx( AMRWB_IO_DEC_HANDLE hAmrwb_IO, const Word32 core_brate, const Word16 Aq[], Word16 Ap[], Word16 *r, Word16 tilt0, Word16 tilt, Word16 voice_factor );
@@ -51,7 +53,10 @@ void hf_synth_init_fx(
    set16_fx( hBWE_zero->mem_hp400_fx, 0, 4 );
    set16_fx( hBWE_zero->delay_syn_hf_fx, 0, NS2SA( 16000, DELAY_CLDFB_NS ) );
    set16_fx( hBWE_zero->mem_hp_interp_fx, 0, INTERP_3_1_MEM_LEN );

#ifdef FIX_774_ENERGY_BURST
    hBWE_zero->memExp1 = 0;
    move16();
#endif
    return;
}
void hf_synth_reset_fx(
@@ -71,7 +76,10 @@ void hf_synth_reset_fx(

    set16_fx( hBWE_zero->delay_syn_hf_fx, 0, NS2SA( 16000, DELAY_CLDFB_NS ) );
    set16_fx( hBWE_zero->mem_hp_interp_fx, 0, INTERP_3_1_MEM_LEN );

#ifdef FIX_774_ENERGY_BURST
    hBWE_zero->memExp1 = 0;
    move16();
#endif
    return;
}

@@ -117,7 +125,7 @@ void hf_synth_fx(

    return;
}

#ifndef FIX_774_ENERGY_BURST
#ifdef IVAS_FLOAT_FIXED
void hf_synth_ivas_fx(
    ZERO_BWE_DEC_HANDLE hBWE_zero, /* i/o: handle to 0 bit BWE parameters */
@@ -156,6 +164,7 @@ void hf_synth_ivas_fx(
    return;
}
#endif
#endif
/*-----------------------------------------------------------------------------------*
 * hf_synthesis()
 *
@@ -384,7 +393,7 @@ static void hf_synthesis_fx(

    return;
}

#ifndef FIX_774_ENERGY_BURST
#ifdef IVAS_FLOAT_FIXED
static void hf_synthesis_ivas_fx(
    ZERO_BWE_DEC_HANDLE hBWE_zero,
@@ -611,6 +620,7 @@ static void hf_synthesis_ivas_fx(
    return;
}
#endif
#endif

/*-------------------------------------------------------------------*
 * filt_6k_7k:
Loading