Commit 2c1aa67f authored by Jan Kiene's avatar Jan Kiene
Browse files

Accept FIX_1585_ASAN_FORMAT_SW_ALT

parent b200fc93
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -162,7 +162,6 @@
#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_FLOAT_1539_G192_FORMAT_SWITCH               /* Nokia: reintroduce format switching for g192 bitstreams */
#define FIX_1585_ASAN_FORMAT_SW_ALT                     /* VA,FhG: float issues 1585,1593: alternative fix memory leaks with format switching */
#define FIX_2570_BUF_OVFL                               /* Orange: basop issue 2570: global-buffer-overflow in lib_rend/ivas_objectRenderer_sources_fx.c */
#define FIX_1594_TDM_LAST_RATIO                         /* VA: float issue 1594: remove obsolete argument 'tdm_last_ratio' from stereo_memory_enc () */
#define FIX_1550_WRONG_RENDER_FRAMESIZE_PRINTOUT        /* Dolby: float issue 1550: Wrong render framesize printout */
+0 −59
Original line number Diff line number Diff line
@@ -381,9 +381,6 @@ ivas_error ivas_hp20_dec_reconfig(
)
{
    int16_t i, nchan_hp20;
#ifndef FIX_1585_ASAN_FORMAT_SW_ALT
    float **old_mem_hp20_out;
#endif
    ivas_error error;

    error = IVAS_ERR_OK;
@@ -396,7 +393,6 @@ ivas_error ivas_hp20_dec_reconfig(

    if ( nchan_hp20 > nchan_hp20_old )
    {
#ifdef FIX_1585_ASAN_FORMAT_SW_ALT
        /* create additional hp20 memories */
        for ( i = nchan_hp20_old; i < nchan_hp20; i++ )
        {
@@ -407,70 +403,15 @@ ivas_error ivas_hp20_dec_reconfig(

            set_f( st_ivas->mem_hp20_out[i], 0.0f, L_HP20_MEM );
        }
#else
        /* save old mem_hp_20 pointer */
        old_mem_hp20_out = st_ivas->mem_hp20_out;
        st_ivas->mem_hp20_out = NULL;

        if ( ( st_ivas->mem_hp20_out = (float **) malloc( nchan_hp20 * sizeof( float * ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) );
        }

        for ( i = 0; i < nchan_hp20_old; i++ )
        {
            st_ivas->mem_hp20_out[i] = old_mem_hp20_out[i];
            old_mem_hp20_out[i] = NULL;
        }
        /* create additional hp20 memories */
        for ( ; i < nchan_hp20; i++ )
        {
            if ( ( st_ivas->mem_hp20_out[i] = (float *) malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL )
            {
                return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) );
            }

            set_f( st_ivas->mem_hp20_out[i], 0.0f, L_HP20_MEM );
        }

        free( old_mem_hp20_out );
        old_mem_hp20_out = NULL;
#endif
    }
    else if ( nchan_hp20 < nchan_hp20_old )
    {
#ifdef FIX_1585_ASAN_FORMAT_SW_ALT
        /* remove superfluous hp20 memories */
        for ( i = nchan_hp20; i < nchan_hp20_old; i++ )
        {
            free( st_ivas->mem_hp20_out[i] );
            st_ivas->mem_hp20_out[i] = NULL;
        }
#else
        /* save old mem_hp_20 pointer */
        old_mem_hp20_out = st_ivas->mem_hp20_out;
        st_ivas->mem_hp20_out = NULL;

        if ( ( st_ivas->mem_hp20_out = (float **) malloc( nchan_hp20 * sizeof( float * ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) );
        }

        for ( i = 0; i < nchan_hp20; i++ )
        {
            st_ivas->mem_hp20_out[i] = old_mem_hp20_out[i];
            old_mem_hp20_out[i] = NULL;
        }
        /* remove superfluous hp20 memories */
        for ( ; i < nchan_hp20_old; i++ )
        {
            free( old_mem_hp20_out[i] );
            old_mem_hp20_out[i] = NULL;
        }

        free( old_mem_hp20_out );
        old_mem_hp20_out = NULL;
#endif
    }

    return error;
+0 −31
Original line number Diff line number Diff line
@@ -2304,19 +2304,6 @@ ivas_error ivas_init_decoder(
    /* set number of output channels used for synthesis/decoding */
    n = getNumChanSynthesis( st_ivas );

#ifndef FIX_1585_ASAN_FORMAT_SW_ALT
    if ( n > 0 )
    {
        if ( ( st_ivas->mem_hp20_out = (float **) malloc( n * sizeof( float * ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) );
        }
    }
    else
    {
        st_ivas->mem_hp20_out = NULL;
    }
#endif
    for ( i = 0; i < n; i++ )
    {
        if ( ( st_ivas->mem_hp20_out[i] = (float *) malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL )
@@ -2823,9 +2810,6 @@ void ivas_initialize_handles_dec(
        st_ivas->bit_stream = NULL;
#ifdef FIX_FMSW_DEC
    }
#endif
#ifndef FIX_1585_ASAN_FORMAT_SW_ALT
    st_ivas->mem_hp20_out = NULL;
#endif
    st_ivas->hLimiter = NULL;

@@ -2899,9 +2883,7 @@ void ivas_initialize_handles_dec(
    for ( i = 0; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ )
    {
        st_ivas->p_output_f[i] = NULL;
#ifdef FIX_1585_ASAN_FORMAT_SW_ALT
        st_ivas->mem_hp20_out[i] = NULL;
#endif
    }

    return;
@@ -2971,7 +2953,6 @@ void ivas_destroy_dec(
    }

    /* HP20 filter handles */
#ifdef FIX_1585_ASAN_FORMAT_SW_ALT
    for ( i = 0; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ )
    {
        if ( st_ivas->mem_hp20_out[i] != NULL )
@@ -2980,18 +2961,6 @@ void ivas_destroy_dec(
            st_ivas->mem_hp20_out[i] = NULL;
        }
    }
#else
    if ( st_ivas->mem_hp20_out != NULL )
    {
        for ( i = 0; i < getNumChanSynthesis( st_ivas ); i++ )
        {
            free( st_ivas->mem_hp20_out[i] );
            st_ivas->mem_hp20_out[i] = NULL;
        }
        free( st_ivas->mem_hp20_out );
        st_ivas->mem_hp20_out = NULL;
    }
#endif

    /* ISM metadata handles */
    ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 );
+0 −4
Original line number Diff line number Diff line
@@ -1054,11 +1054,7 @@ typedef struct Decoder_Struct
    uint16_t *bit_stream;                                   /* Pointer to bitstream buffer */
    int16_t writeFECoffset;                                 /* parameter for debugging JBM stuff */

#ifdef FIX_1585_ASAN_FORMAT_SW_ALT
    float *mem_hp20_out[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; /* output signals HP filter memories */
#else
    float **mem_hp20_out;                                   /* output signals HP filter memories */
#endif
    IVAS_LIMITER_HANDLE hLimiter;                           /* Limiter handle */

    /* core-decoder modules */