Commit 88c2dd45 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

add changes from BE branch concerning elliptic_bpf_48k - deactivated STAGE2 and func1

parent 1e85b773
Loading
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -80,13 +80,8 @@
#define HARM_PUSH_BIT
#define HARM_ENC_INIT
//#define HARM_SCE_INIT
#define FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic              /*FhG: reduces maintenance complexity & reduces WMOPS & prepares STAGE2 patch*/
//#define FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2       /*FhG: reduces WMOPS* /
//#define FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_func1



#define FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_STAGE1       // nonbe                          //   |
#define FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_STAGE2       // nonbe                          //   |   3.1 WMOPS, pipe testing https://forge.3gpp.org/rep/sa4/audio/ivas-basop/-/pipelines/50562
#define FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_STAGE3       // nonbe                          //   |

//-----------------------------------------------------------------------
// OPT_STEREO_32KBPS_V1 switch is inactive - why? (3.2 WMOPS)
#endif
+15 −3
Original line number Diff line number Diff line
@@ -3258,7 +3258,15 @@ void interp_code_4over2_fx(
void wb_tbe_extras_reset_synth_fx( Word16 state_lsyn_filt_shb[], Word16 state_lsyn_filt_dwn_shb[], Word16 state_32and48k_WB_upsample[], Word16 state_resamp_HB[] );
void elliptic_bpf_48k_generic_fx(
    const Word16 input_fx[], /* i  : i   signal                              Q_input_fx  */
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
    int isIVAS;
#endif
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic
    Word16 IsUpsampled3,
    Word16 input_fx[], /* i  : input signal                             Q_input_fx*/
#else
    const Word16 input_fx[], /* i  : input signal                             Q_input_fx*/
#endif
    Word16 *Q_input_fx,
    Word16 output_fx[],    /* o  : output signal                               */
    Word32 memory_fx[][4], /* i/o: 4 arrays of 4 for memory                   memory_fx_Q */
@@ -3277,8 +3285,12 @@ void synthesise_fb_high_band_fx(
    Word16 *prev_fbbwe_ratio,   /* o  : previous frame energy for FEC                       */
    Word32 bpf_memory[][4],     /* i/o: memory for elliptic bpf 48k                         */
    Word16 bpf_memory_Q[],
    Word16 Qout );
    Word16 Qout
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
    ,
    Word16 isIVAS
#endif
);
void prep_tbe_exc_fx(
    const Word16 L_frame_fx, /* i : length of the frame */
#ifdef ADD_IVAS_TBE_CODE
+468 −120

File changed.

Preview size limit exceeded, changes collapsed.

+13 −2
Original line number Diff line number Diff line
@@ -4644,7 +4644,12 @@ void fb_tbe_dec_fx(
    fb_exc_energy = sum2_fx_mod( fb_exc, L_FRAME16k );

    /* FB TBE synthesis */
    synthesise_fb_high_band_fx( fb_exc, Q_fb_exc, fb_synth, fb_exc_energy, ratio, st->L_frame, st->bfi, &( hBWE_TD->prev_fbbwe_ratio_fx ), hBWE_TD->fbbwe_hpf_mem_fx, hBWE_TD->fbbwe_hpf_mem_fx_Q, hb_synth_exp );
    synthesise_fb_high_band_fx( fb_exc, Q_fb_exc, fb_synth, fb_exc_energy, ratio, st->L_frame, st->bfi, &( hBWE_TD->prev_fbbwe_ratio_fx ), hBWE_TD->fbbwe_hpf_mem_fx, hBWE_TD->fbbwe_hpf_mem_fx_Q, hb_synth_exp
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
                                ,
                                0 /*isIVAS*/
#endif
    );

    /* add the fb_synth component to the hb_synth component */
    /*  v_add_fx( hb_synth, fb_synth, hb_synth, L_FRAME48k );*/
@@ -4714,7 +4719,13 @@ void fb_tbe_dec_ivas_fx(

    /* FB TBE synthesis */
    push_wmops( "synthesise_fb_high_band" );
    synthesise_fb_high_band_fx( fb_exc, Q_fb_exc, fb_synth, fb_exc_energy, ratio, st->L_frame, st->bfi, &( hBWE_TD->prev_fbbwe_ratio_fx ), hBWE_TD->fbbwe_hpf_mem_fx, hBWE_TD->fbbwe_hpf_mem_fx_Q, hb_synth_exp );
    /* FB TBE synthesis */
    synthesise_fb_high_band_fx( fb_exc, Q_fb_exc, fb_synth, fb_exc_energy, ratio, st->L_frame, st->bfi, &( hBWE_TD->prev_fbbwe_ratio_fx ), hBWE_TD->fbbwe_hpf_mem_fx, hBWE_TD->fbbwe_hpf_mem_fx_Q, hb_synth_exp
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
                                ,
                                Word16 1 /*isIVAS*/
#endif
    );
    pop_wmops(); /*push_wmops( "synthesise_fb_high_band" );*/

    test();
+35 −4
Original line number Diff line number Diff line
@@ -7299,13 +7299,18 @@ void fb_tbe_enc_fx(
    Word16 ratio;
    Word16 tmp_vec[L_FRAME48k];
    Word16 idxGain;
    Word16 input_fhb[L_FRAME48k];
    Word16 Sample_Delay_HP;
    Word32 fb_exc_energy, temp2;
    Word32 L_tmp;
    Word16 tmp, tmp1, tmp2, exp, exp2, exp_norm;
    Word16 s_max_value, exp_temp, i;
    TD_BWE_ENC_HANDLE hBWE_TD = st->hBWE_TD;
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic
    Word16 input_fhb_buffer[L_FRAME48k + 4];
    Word16 *input_fhb = &input_fhb_buffer[0] + 4;
#else
    Word16 input_fhb[L_FRAME48k];
#endif
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move16();
@@ -7325,7 +7330,14 @@ void fb_tbe_enc_fx(

    Copy_Scale_sig( new_input, input_fhb, L_FRAME48k, exp_temp );

    elliptic_bpf_48k_generic_fx( input_fhb, &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx );
    elliptic_bpf_48k_generic_fx(
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
        0 // isIVAS - is this correct?
#endif
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic
        0, // IsUpsampled3
#endif
        input_fhb, &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx );
    Sample_Delay_HP = NS2SA( 48000, ACELP_LOOK_NS + DELAY_FD_BWE_ENC_12k8_NS + DELAY_FIR_RESAMPL_NS ) - L_FRAME48k / 2;

    IF( NE_16( st->last_extl, FB_TBE ) )
@@ -7422,7 +7434,12 @@ void fb_tbe_enc_ivas_fx(
    Word16 ratio;
    Word16 tmp_vec[L_FRAME48k];
    Word16 idxGain;
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic
    Word16 input_fhb_new_buffer[L_FRAME48k + NS2SA( 48000, DELAY_FIR_RESAMPL_NS ) + 4];
    Word16 *input_fhb_new = &input_fhb_new_buffer[0] + 4;
#else
    Word16 input_fhb_new[L_FRAME48k + NS2SA( 48000, DELAY_FIR_RESAMPL_NS )];
#endif
    Word16 input_fhb[L_FRAME48k];
    Word16 Sample_Delay_HP;
    Word64 fb_exc_energy;
@@ -7449,11 +7466,25 @@ void fb_tbe_enc_ivas_fx(

    IF( EQ_16( st->element_mode, IVAS_CPE_DFT ) )
    {
        elliptic_bpf_48k_generic_fx( input_fhb_new, &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx );
        elliptic_bpf_48k_generic_fx(
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
            1 // isIVAS - is this corret?
#endif
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic
            0, // IsUpsampled3
#endif
            input_fhb_new, &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx );
    }
    ELSE
    {
        elliptic_bpf_48k_generic_fx( input_fhb_new + NS2SA( 48000, DELAY_FIR_RESAMPL_NS ), &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx );
        elliptic_bpf_48k_generic_fx(
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
            1 // isIVAS - is this correct?
#endif
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic
            0, // IsUpsampled3
#endif
            input_fhb_new + NS2SA( 48000, DELAY_FIR_RESAMPL_NS ), &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx );
    }

    test();