Commit 9e4b55ae authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_2431_AVOID_CALLOC

parent 537d685e
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -1598,27 +1598,17 @@ ivas_error cldfb_save_memory(
    }
    hs->memory_length = cldfb_get_memory_length( hs );
    move16();
#ifdef FIX_2431_AVOID_CALLOC
    hs->memory = (Word16 *) malloc( ( hs->memory_length + CLDFB_MEM_EXPONENTS + 1 ) * sizeof( Word16 ) );
    IF( hs->memory == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB\n" );
    }
#else
    hs->memory = (Word16 *) calloc( hs->memory_length + CLDFB_MEM_EXPONENTS + 1, sizeof( Word16 ) );
#endif

    /* save the memory */
    Copy( hs->FilterStates, hs->memory, hs->memory_length );
    Copy( hs->FilterStates_e, hs->memory + hs->memory_length, CLDFB_MEM_EXPONENTS );
    hs->memory[hs->memory_length + CLDFB_MEM_EXPONENTS] = hs->FilterStates_eg;
    move16();
#ifndef FIX_2431_AVOID_CALLOC
    IF( hs->memory == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB\n" );
    }
#endif

    return IVAS_ERR_OK;
}
+0 −10
Original line number Diff line number Diff line
@@ -366,11 +366,7 @@ Word16 modify_Fs_intcub3m_sup_fx(
    const Word16( *cu )[3] = 0;
    Word16 *sigin_sr, *sigOutptr, *cptr;
    const Word16 *uptr, *ctptr;
#ifdef FIX_2431_AVOID_CALLOC
    Word16 sigin_sr_tab[NS2SA( 16000, DELAY_CLDFB_NS ) + 2];
#else
    Word16 *sigin_sr_tab;
#endif
    Word16 lim, inc, lim2, lim3;
    Word32 vv32;
#define QSR 2 /* right shift to avoid overflow, 2 is OK */
@@ -396,9 +392,6 @@ Word16 modify_Fs_intcub3m_sup_fx(
    }
    ELSE
    {
#ifndef FIX_2431_AVOID_CALLOC
        sigin_sr_tab = (Word16 *) calloc( lg + 2, sizeof( *sigin_sr ) ); /*shift right*/
#endif
        sigin_sr = sigin_sr_tab + 2;
        FOR( i = -2; i < lg; i++ )
        {
@@ -636,9 +629,6 @@ Word16 modify_Fs_intcub3m_sup_fx(
        }
    }

#ifndef FIX_2431_AVOID_CALLOC
    free( sigin_sr_tab );
#endif
    return lg_out;
}

+0 −1
Original line number Diff line number Diff line
@@ -83,7 +83,6 @@
#define FIX_1990_SANITIZER_IN_REVERB_LOAD               /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_2431_AVOID_CALLOC                           /* VA: basp issue 2431: avoid use of calloc() */
#define FIX_2424_REMOVE_GAUSS_L2_ENC                    /* VA: basop issue 2424: Remove duplicated code in gauss_L2_ivas_fx() */
#define FIX_MDCT_STEREO_ENC_STACK                       /* VA: basop issue 2428: Move IGF temporary buffers out of the highest stack */
#define HARMONIZE_TBE3                                  /* VA: basop issue 2399: Remove duplicated code: TBE, step 3 */
+0 −7
Original line number Diff line number Diff line
@@ -7215,14 +7215,9 @@ 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(
@@ -8546,9 +8541,7 @@ 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       */
);

+0 −4
Original line number Diff line number Diff line
@@ -44,11 +44,7 @@ ivas_error DTFS_new_fx(
{
    Word16 i;
    DTFS_STRUCTURE *dtfs_fx = NULL;
#ifdef FIX_2431_AVOID_CALLOC
    dtfs_fx = (DTFS_STRUCTURE *) malloc( sizeof( DTFS_STRUCTURE ) );
#else
    dtfs_fx = (DTFS_STRUCTURE *) calloc( 1, sizeof( DTFS_STRUCTURE ) );
#endif
    IF( dtfs_fx == NULL )
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DTFS (SC-VBR) structure\n" ) );
Loading