Commit 1afe8395 authored by vaclav's avatar vaclav
Browse files

remove ADD_IVAS_BWE

parent 54426a49
Loading
Loading
Loading
Loading
+9 −26
Original line number Diff line number Diff line
@@ -6057,9 +6057,6 @@ void TBEreset_dec_fx(
void td_bwe_dec_init_fx(
    Decoder_State *st_fx,      /* i/o: SHB decoder structure */
    TD_BWE_DEC_HANDLE hBWE_TD, /* i/o: TD BWE data handle      */
#ifdef ADD_IVAS_BWE
    const Word16 extl, /* i  : BWE extension layer     */
#endif
    const Word32 output_Fs     /* i  : output sampling rate    */
);
@@ -7700,19 +7697,12 @@ Word16 WB_BWE_gain_deq_fx(
);
Word16 wb_bwe_dec_fx(
#ifdef ADD_IVAS_BWE
    const Word16 output[], /* i  : suntehsis @ internal Fs */
#endif
    Word16 *synth_fx,            /* i/o: ACELP core synthesis/final synthesis   Q0/Qpost */
    Word16 *hb_synth_fx,         /* o  : SHB synthesis/final synthesis          Q_syn_hb */
#ifdef ADD_IVAS_BWE
    const Word16 use_cldfb_for_dft, /* i  : flag to use of CLDFB for DFT Stereo     */
#endif
    const Word16 output_frame,   /* i  : frame length                            */
    Word16 *voice_factors_fx,    /* i  : voicing factors                 Q15        */
    const Word16 pitch_buf_fx[], /* i  : pitch buffer                      Q6      */
    Decoder_State *st_fx         /* i/o: decoder state structure                 */
    ,
    Decoder_State *st_fx,        /* i/o: decoder state structure                 */
    Word16 *Qpost );
Word16 swb_bwe_gain_deq_fx(                         /* o  : BWE class                           */
@@ -7725,17 +7715,10 @@ Word16 swb_bwe_gain_deq_fx( /* o : BWE class
);
Word16 swb_bwe_dec_fx(                            /*o :Q_syn_hb*/
#ifdef ADD_IVAS_BWE
                       const Word16 output[], /* i  : suntehsis @ internal Fs */
#endif
                       Decoder_State *st_fx,      /* i/o: decoder state structure                 */
                       Word16 *synth_fx,          /* i/o: ACELP core synthesis/final synthesis (might be rescaled inside wtda() )   Q0/Qpost */
                       Word16 *hb_synth_fx,       /* o  : SHB synthesis/final synthesis          Q_syn_hb */
#ifdef ADD_IVAS_BWE
                       const Word16 use_cldfb_for_dft, /* i  : flag to use of CLDFB for DFT Stereo     */
#endif
                       const Word16 output_frame /* i  : frame length                            */
                       ,
                       const Word16 output_frame, /* i  : frame length                            */
                       Word16 *Qpost );
void fd_bwe_dec_init(
+2 −2
Original line number Diff line number Diff line
@@ -681,12 +681,12 @@ void decision_matrix_dec_fx(
        st->nb_subfr = NB_SUBFR16k;
        move16();
    }
#if 1 // def ADD_IVAS_BWE  0> NEEDED for IO with conf_acelp1

    st->extl_orig = st->extl;
    move16();
    st->extl_brate_orig = st->extl_brate;
    move32();
#endif

    test();
    IF( EQ_32( st->output_Fs, 8000 ) )
    {
+2 −18
Original line number Diff line number Diff line
@@ -383,15 +383,7 @@ ivas_error evs_dec_fx(
        ELSE IF( EQ_16( st_fx->extl, WB_BWE ) && st_fx->bws_cnt == 0 )
        {
            /* WB BWE decoder */
            hb_synth_fx_exp = wb_bwe_dec_fx(
#ifdef ADD_IVAS_BWE
                NULL,
#endif
                synth_fx, hb_synth_fx,
#ifdef ADD_IVAS_BWE
                0,
#endif
                output_frame, voice_factors_fx, pitch_buf_fx, st_fx, &Qpostd ); /*Q0*/
            hb_synth_fx_exp = wb_bwe_dec_fx( synth_fx, hb_synth_fx, output_frame, voice_factors_fx, pitch_buf_fx, st_fx, &Qpostd ); /*Q0*/
        }

        /*---------------------------------------------------------------------*
@@ -434,15 +426,7 @@ ivas_error evs_dec_fx(
                 ( GE_32( st_fx->output_Fs, 32000 ) && EQ_16( st_fx->core, ACELP_CORE ) && GT_16( st_fx->bwidth, NB ) && st_fx->bws_cnt > 0 && !st_fx->ppp_mode_dec && !( EQ_16( st_fx->nelp_mode_dec, 1 ) && EQ_16( st_fx->bfi, 1 ) ) ) )
        {
            /* SWB BWE decoder */
            hb_synth_fx_exp = swb_bwe_dec_fx(
#ifdef ADD_IVAS_BWE
                NULL,
#endif
                st_fx, synth_fx, hb_synth_fx,
#ifdef ADD_IVAS_BWE
                0,
#endif
                output_frame, &Qpostd ); /*Q0*/
            hb_synth_fx_exp = swb_bwe_dec_fx( st_fx, synth_fx, hb_synth_fx, output_frame, &Qpostd ); /*Q0*/
        }
        ELSE IF( EQ_16( st_fx->extl, SWB_BWE_HIGHRATE ) || EQ_16( st_fx->extl, FB_BWE_HIGHRATE ) )
        {
+1 −5
Original line number Diff line number Diff line
@@ -532,11 +532,7 @@ ivas_error init_decoder_fx(
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD BWE\n" ) );
        }

        td_bwe_dec_init_fx( st_fx, st_fx->hBWE_TD,
#ifdef ADD_IVAS_BWE
                            st_fx->extl,
#endif
                            st_fx->output_Fs );
        td_bwe_dec_init_fx( st_fx, st_fx->hBWE_TD, st_fx->output_Fs );

#ifdef MSAN_FIX
        st_fx->hBWE_TD->prev_hb_synth_fx_exp = 31;
+13 −71
Original line number Diff line number Diff line
@@ -505,19 +505,12 @@ Word16 ivas_wb_bwe_dec_fx( /* o :
}

Word16 wb_bwe_dec_fx(
#ifdef ADD_IVAS_BWE
    const Word16 output[], /* i  : suntehsis @ internal Fs */
#endif
    Word16 *synth_fx,            /* i/o: ACELP core synthesis/final synthesis       Q0/Qpost */
    Word16 *hb_synth_fx,         /* o  : SHB synthesis/final synthesis              Q_syn_hb */
#ifdef ADD_IVAS_BWE
    const Word16 use_cldfb_for_dft, /* i  : flag to use of CLDFB for DFT Stereo      */
#endif
    const Word16 output_frame,   /* i  : frame length                                */
    Word16 *voice_factors_fx,    /* i  : voicing factors                   Q15       */
    const Word16 pitch_buf_fx[], /* i  : pitch buffer                      Q6        */
    Decoder_State *st_fx         /* i/o: decoder state structure                     */
    ,
    Decoder_State *st_fx,        /* i/o: decoder state structure                     */
    Word16 *Qpost )
{
    Word16 mode;
@@ -538,18 +531,7 @@ Word16 wb_bwe_dec_fx(

    new_input_fx_exp = *Qpost;
    move16();
#ifdef ADD_IVAS_BWE
    if ( st->element_mode == IVAS_CPE_DFT && !use_cldfb_for_dft )
    {
        /* IVAS_fmToDo: wtda() does not support L_FRAME length; thus temporarily resample the signal */
        /* IVAS_fmToDo: delay output[] by 1.25ms ? */
        lerp( output, ysynth, L_FRAME16k, st->L_frame );

        wtda( ysynth, wtda_synth, hBWE_FD->old_wtda_swb, ALDO_WINDOW, ALDO_WINDOW, /*st->L_frame*/ L_FRAME16k );
        direct_transform( wtda_synth, ysynth, 0, /*st->L_frame*/ L_FRAME16k, st->element_mode );
    }
    else
#endif
    {
        wtda_fx( synth_fx, &new_input_fx_exp, L_wtda_synth_fx, hBWE_FD->L_old_wtda_swb_fx,
                 &hBWE_FD->old_wtda_swb_fx_exp, ALDO_WINDOW, ALDO_WINDOW, /* window overlap of current frame (0: full, 2: none, or 3: half) */
@@ -574,11 +556,7 @@ Word16 wb_bwe_dec_fx(
    Q_syn = add( sub( new_input_fx_exp, 16 ), scl );
    IF( !st_fx->bfi )
    {
#ifdef ADD_IVAS_BWE
        IF( st_fx->extl_brate > 0 )
#else
        IF( EQ_32( st_fx->total_brate, ACELP_13k20 ) )
#endif
        {
            /* de-quantization */
            mode = WB_BWE_gain_deq_fx( st_fx, WB_fenv_fx );
@@ -654,20 +632,15 @@ Word16 wb_bwe_dec_fx(
    window_ola_fx( t_audio32_tmp, hb_synth_fx, &Q_syn_hb, hBWE_FD->mem_imdct_fx, &hBWE_FD->mem_imdct_exp_fx, output_frame,
                   ALDO_WINDOW, ALDO_WINDOW, 0, 0, 0 );

#ifdef ADD_IVAS_BWE
    test();
    IF( EQ_16( st_fx->element_mode, IVAS_CPE_DFT ) && !use_cldfb_for_dft )
    {
        /* add HB synth from hf_synth() */
        v_add( hb_synth, synth, hb_synth, output_frame );
    }
#endif
    hBWE_FD->prev_mode = mode;
    move16();
    st_fx->prev_Q_synth = Q_syn;
    move16();

    return Q_syn_hb;
}


/*-------------------------------------------------------------------*
 * swb_bwe_gain_deq()
 *
@@ -911,17 +884,10 @@ Word16 swb_bwe_gain_deq_fx( /* o : BWE class
 * SWB BWE decoder
 *-------------------------------------------------------------------*/
Word16 swb_bwe_dec_fx(                            /*o :Q_syn_hb*/
#ifdef ADD_IVAS_BWE
                       const Word16 output[], /* i  : suntehsis @ internal Fs                                                           */
#endif
                       Decoder_State *st_fx,      /* i/o: decoder state structure                                                            */
                       Word16 *synth_fx,          /* i/o: ACELP core synthesis/final synthesis (might be rescaled inside wtda() )   Q0/Qpost */
                       Word16 *hb_synth_fx,       /* o  : SHB synthesis/final synthesis                                             Q_syn_hb */
#ifdef ADD_IVAS_BWE
                       const Word16 use_cldfb_for_dft, /* i  : flag to use of CLDFB for DFT Stereo                                      */
#endif
                       const Word16 output_frame /* i  : frame length                                                                   */
                       ,
                       const Word16 output_frame, /* i  : frame length                                                                   */
                       Word16 *Qpost )
{
    Word16 i, l_subfr;
@@ -957,19 +923,7 @@ Word16 swb_bwe_dec_fx( /*o :Q_syn_hb*/
    /* windowing of the ACELP core synthesis */
    new_input_fx_exp = *Qpost;
    move16();
#ifdef ADD_IVAS_BWE
    if ( st->element_mode == IVAS_CPE_DFT && !use_cldfb_for_dft )
    {
        /* IVAS_fmToDo: wtda() does not support L_FRAME length; thus temporarily resample the signal */
        /* IVAS_fmToDo: delay output[] by 1.25ms ? */
        lerp( output, ysynthIfx, L_FRAME16k, st_fx->L_frame );

        wtda_fx( ysynth_fx, &new_input_fx_exp, L_wtda_synth_fx, hBWE_FD->L_old_wtda_swb_fx,
                 &hBWE_FD->old_wtda_swb_fx_exp, ALDO_WINDOW, ALDO_WINDOW, /*st->L_frame*/ L_FRAME16k );
        direct_transform_fx( L_wtda_synth_fx, ysynth_32, 0, /*st->L_frame*/ L_FRAME16k, &new_input_fx_exp, st_fx->element_mode );
    }
    else
#endif
    {
        wtda_fx( synth_fx, &new_input_fx_exp, L_wtda_synth_fx, hBWE_FD->L_old_wtda_swb_fx,
                 &hBWE_FD->old_wtda_swb_fx_exp,
@@ -1112,12 +1066,7 @@ Word16 swb_bwe_dec_fx( /*o :Q_syn_hb*/
        }
        fb_band_begin = FB_BAND_BEGIN;
        move16();
#ifdef ADD_IVAS_BWE
        IF( st_fx->L_frame == L_FRAME )
        {
            fb_band_begin = FB_BAND_BEGIN_12k8;
        }
#endif

        FOR( i = fb_band_begin; i < add( fb_band_begin, DE_OFFSET1 ); i++ )
        {
            tmp = sub( 32767, i_mult( j, 1024 ) );
@@ -1193,14 +1142,7 @@ Word16 swb_bwe_dec_fx( /*o :Q_syn_hb*/
            move16();
        }
    }
#ifdef ADD_IVAS_BWE
    test();
    IF( EQ_16( st_fx->element_mode, IVAS_CPE_DFT ) && !use_cldfb_for_dft )
    {
        /* add HB synth from hf_synth() */
        v_add( hb_synth, synth, hb_synth, output_frame );
    }
#endif

    hBWE_FD->prev_frica_flag = frica_flag;
    move16();
    hBWE_FD->prev_mode = mode;
Loading