Commit 27f77119 authored by vaclav's avatar vaclav
Browse files

remove buffer L_mem_hp_out_fx[]

parent 1a882818
Loading
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -7344,8 +7344,14 @@ void core_switching_hq_prepare_dec_fx(
);

ivas_error amr_wb_dec_fx(
#ifdef FIX_2431_AVOID_CALLOC
    Decoder_State *st_fx,  /* i/o: Decoder static variables structure      */
    Word16 output_sp[],    /* o  : synthesis output                        */
    Word32 *mem_hp20_in_fx /* i/o: hp20 filter memory                    Qx*/
#else
    Word16 output_sp[],  /* o  : synthesis output                        */
    Decoder_State *st_fx /* o  : Decoder static variables structure      */
#endif
);

void amr_wb_dec_init_fx(
@@ -8708,6 +8714,9 @@ void d_gain_pred_fx(
ivas_error evs_dec_fx(
    Decoder_State *st_fx, /* i/o  : Decoder state structure  */
    Word16 output_sp[],   /* o    : output synthesis signal  */
#ifdef FIX_2431_AVOID_CALLOC
    Word32 *mem_hp20_in_fx, /* i/o: hp20 filter memory       Qx*/
#endif
    FRAME_MODE frameMode /* i    : Decoder frame mode       */
);

+15 −1
Original line number Diff line number Diff line
@@ -7,7 +7,8 @@
#include "cnst.h"
#include "rom_com.h"
#include "prot_fx.h"
#include "basop_util.h" /* Function prototypes                    */


/*-------------------------------------------------------------------*
 * amr_wb_dec_fx()
 *
@@ -15,8 +16,14 @@
 *-------------------------------------------------------------------*/

ivas_error amr_wb_dec_fx(
#ifdef FIX_2431_AVOID_CALLOC
    Decoder_State *st_fx,  /* i/o: Decoder static variables structure      */
    Word16 output_sp[],    /* o  : synthesis output                        */
    Word32 *mem_hp20_in_fx /* i/o: hp20 filter memory                    Qx*/
#else
    Word16 output_sp[],  /* o  : synthesis output                Q_syn2*/
    Decoder_State *st_fx /* o  : Decoder static variables structure */
#endif
)
{
    Word16 i;
@@ -1072,10 +1079,17 @@ ivas_error amr_wb_dec_fx(
    }

    /* HP filter */
#ifdef FIX_2431_AVOID_CALLOC
    Scale_sig32( mem_hp20_in_fx, 4, sub( st_fx->Q_syn2, st_fx->Qprev_synth_buffer_fx ) );
    st_fx->Qprev_synth_buffer_fx = st_fx->Q_syn2;
    move16();
    hp20( synth_out_fx, 1 /*stride*/, output_frame, mem_hp20_in_fx, st_fx->output_Fs );
#else
    Scale_sig32( st_fx->L_mem_hp_out_fx, 4, sub( st_fx->Q_syn2, st_fx->Qprev_synth_buffer_fx ) );
    st_fx->Qprev_synth_buffer_fx = st_fx->Q_syn2;
    move16();
    hp20( synth_out_fx, 1 /*stride*/, output_frame, st_fx->L_mem_hp_out_fx, L_mult0( output_frame, 50 ) );
#endif

    /* save synthesis for core switching */
    Copy_Scale_sig( synth_out_fx + NS2SA_FX2( st_fx->output_Fs, ACELP_LOOK_NS + DELAY_BWE_TOTAL_NS ), st_fx->old_synth_sw_fx, NS2SA_FX2( st_fx->output_Fs, FRAME_SIZE_NS - ACELP_LOOK_NS - DELAY_BWE_TOTAL_NS ), sub( hHQ_core->Q_old_postdec, st_fx->Q_syn2 ) );
+10 −2
Original line number Diff line number Diff line
@@ -18,6 +18,9 @@
ivas_error evs_dec_fx(
    Decoder_State *st_fx, /* i/o  : Decoder state structure  */
    Word16 output_sp[],   /* o    : output synthesis signal  Q0*/
#ifdef FIX_2431_AVOID_CALLOC
    Word32 *mem_hp20_in_fx, /* i/o: hp20 filter memory       Qx*/
#endif
    FRAME_MODE frameMode /* i    : Decoder frame mode       */
)
{
@@ -1337,8 +1340,13 @@ ivas_error evs_dec_fx(

    st_fx->Qprev_synth_buffer_fx = Qpostd;
    move16();
#ifdef FIX_2431_AVOID_CALLOC
    Scale_sig32( mem_hp20_in_fx, 4, sub( Qpostd, Qpostd_prev ) ); /*Qpostd*/
    hp20( synth_fx, 1 /*stride*/, output_frame, mem_hp20_in_fx, st_fx->output_Fs );
#else
    Scale_sig32( st_fx->L_mem_hp_out_fx, 4, sub( Qpostd, Qpostd_prev ) );                                                           /*Qpostd*/
    hp20( synth_fx, 1 /*stride*/, output_frame, st_fx->L_mem_hp_out_fx, L_mult0( output_frame, 50 ) );
#endif

    /*----------------------------------------------------------------*
     * Synthesis output
+20 −0
Original line number Diff line number Diff line
@@ -5601,14 +5601,22 @@ static ivas_error evs_dec_main_fx(
    {
        IF( hCoreCoder[0]->Opt_AMR_WB )
        {
#ifdef FIX_2431_AVOID_CALLOC
            IF( NE_32( ( error = amr_wb_dec_fx( hCoreCoder[0], output_16, st_ivas->mem_hp20_out_fx[0] ) ), IVAS_ERR_OK ) )
#else
            IF( NE_32( ( error = amr_wb_dec_fx( output_16, hCoreCoder[0] ) ), IVAS_ERR_OK ) )
#endif
            {
                return error;
            }
        }
        ELSE
        {
#ifdef FIX_2431_AVOID_CALLOC
            IF( NE_32( ( error = evs_dec_fx( hCoreCoder[0], output_16, st_ivas->mem_hp20_out_fx[0], FRAMEMODE_NORMAL ) ), IVAS_ERR_OK ) )
#else
            IF( NE_32( ( error = evs_dec_fx( hCoreCoder[0], output_16, FRAMEMODE_NORMAL ) ), IVAS_ERR_OK ) )
#endif
            {
                return error;
            }
@@ -5618,21 +5626,33 @@ static ivas_error evs_dec_main_fx(
    {
        IF( hCoreCoder[0]->bfi == 0 )
        {
#ifdef FIX_2431_AVOID_CALLOC
            IF( NE_32( ( error = evs_dec_fx( hCoreCoder[0], output_16, st_ivas->mem_hp20_out_fx[0], FRAMEMODE_NORMAL ) ), IVAS_ERR_OK ) )
#else
            IF( NE_32( ( error = evs_dec_fx( hCoreCoder[0], output_16, FRAMEMODE_NORMAL ) ), IVAS_ERR_OK ) )
#endif
            {
                return error;
            }
        }
        ELSE IF( EQ_16( hCoreCoder[0]->bfi, 2 ) )
        {
#ifdef FIX_2431_AVOID_CALLOC
            IF( NE_32( ( error = evs_dec_fx( hCoreCoder[0], output_16, st_ivas->mem_hp20_out_fx[0], FRAMEMODE_FUTURE ) ), IVAS_ERR_OK ) )
#else
            IF( NE_32( ( error = evs_dec_fx( hCoreCoder[0], output_16, FRAMEMODE_FUTURE ) ), IVAS_ERR_OK ) )
#endif
            {
                return error;
            }
        }
        ELSE
        {
#ifdef FIX_2431_AVOID_CALLOC
            IF( NE_32( ( error = evs_dec_fx( hCoreCoder[0], output_16, st_ivas->mem_hp20_out_fx[0], FRAMEMODE_MISSING ) ), IVAS_ERR_OK ) )
#else
            IF( NE_32( ( error = evs_dec_fx( hCoreCoder[0], output_16, FRAMEMODE_MISSING ) ), IVAS_ERR_OK ) )
#endif
            {
                return error;
            }
+3 −1
Original line number Diff line number Diff line
@@ -1093,7 +1093,9 @@ typedef struct Decoder_State
    Word32 offset_scale2_p_fx[MAX_NO_MODES_p + 1][MAX_NO_SCALES + 1]; /* offsets for LSF LVQ structure, pred. case, 2nd 8-dim subvector*/
    Word16 no_scales_fx[MAX_NO_MODES][2];                             /* LSF LVQ structure Q0*/
    Word16 no_scales_p_fx[MAX_NO_MODES_p][2];                         /* LSF LVQ structure Q0*/
#ifndef FIX_2431_AVOID_CALLOC
    Word32 L_mem_hp_out_fx[5]; /* hp filter memory for synthesis */
#endif

    Word16 GSC_noisy_speech;           /* AC mode (GSC) - flag to indicate GSC on SWB noisy speech */
    Word16 GSC_IVAS_mode;              /* AC mode (GSC) - GSC IVAS mode */