Commit 8194f1ca authored by eichenseer's avatar eichenseer
Browse files

Fix remaining ASAN/MSAN issue. Still needs a proper fix instead of PARAM_ISM_JBM_HACK.

parent 009aa8ee
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -163,6 +163,9 @@

#define FIX_RAM_COUNTING_5MS_RENDERING                  /* FhG: fix for correct RAM reporting with 5ms rendering */
#define PARAM_ISM_REFACTOR                              /* FhG: Issue 768: Refactoring to decouple hDirAC and hParamISM */
#ifdef PARAM_ISM_REFACTOR
#define PARAM_ISM_JBM_HACK                              /* FhG: To do. hDirAC is not available there; needs proper solution. */
#endif

/* #################### End BE switches ################################## */

+14 −0
Original line number Diff line number Diff line
@@ -1538,10 +1538,16 @@ void ivas_dirac_dec_set_md_map(
    DIRAC_DEC_HANDLE hDirAC;
    SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom;

#ifndef PARAM_ISM_JBM_HACK
    hDirAC = st_ivas->hDirAC;
#else
    hDirAC = NULL;
#endif
    hSpatParamRendCom = st_ivas->hSpatParamRendCom;
#ifdef DEBUGGING
#ifndef PARAM_ISM_JBM_HACK
    assert( hDirAC );
#endif
    assert( hSpatParamRendCom );
#endif

@@ -1568,7 +1574,11 @@ void ivas_dirac_dec_set_md_map(
    {
        ivas_jbm_dec_get_md_map_even_spacing( nCldfbTs, num_slots_in_subfr, 0, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map );
    }
#ifndef PARAM_ISM_JBM_HACK
    else if ( hDirAC->hConfig == NULL || hDirAC->hConfig->dec_param_estim == 0 )
#else
    else if ( hDirAC == NULL || hDirAC->hConfig == NULL || hDirAC->hConfig->dec_param_estim == 0 )
#endif
    {
        ivas_jbm_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, num_slots_in_subfr, 0, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map );
    }
@@ -1577,7 +1587,11 @@ void ivas_dirac_dec_set_md_map(
        ivas_jbm_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, num_slots_in_subfr, hSpatParamRendCom->dirac_read_idx, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map );
    }

#ifndef PARAM_ISM_JBM_HACK
    if ( hDirAC->hConfig == NULL || hDirAC->hConfig->dec_param_estim == 0 )
#else
    if ( hDirAC == NULL || hDirAC->hConfig == NULL || hDirAC->hConfig->dec_param_estim == 0 )
#endif
    {
        float tmp;
        int16_t sf_idx, slot_idx, slot_idx_abs;
+0 −9
Original line number Diff line number Diff line
@@ -2022,7 +2022,6 @@ ivas_error ivas_param_ism_dec_open(
)
{
    int16_t i;
    DIRAC_DEC_HANDLE hDirAC;
    PARAM_ISM_DEC_HANDLE hParamIsmDec;
    IVAS_OUTPUT_SETUP hOutSetup;
    SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom;
@@ -2038,11 +2037,6 @@ ivas_error ivas_param_ism_dec_open(
     * prepare library opening
     *-----------------------------------------------------------------*/

    if ( ( hDirAC = (DIRAC_DEC_HANDLE) malloc( sizeof( DIRAC_DEC_DATA ) ) ) == NULL )
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) );
    }

    if ( ( hParamIsmDec = (PARAM_ISM_DEC_HANDLE) malloc( sizeof( PARAM_ISM_DEC_DATA ) ) ) == NULL )
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ParamISM\n" ) );
@@ -2074,7 +2068,6 @@ ivas_error ivas_param_ism_dec_open(
     *-----------------------------------------------------------------*/

    hSpatParamRendCom->slot_size = (int16_t) ( ( output_Fs / FRAMES_PER_SEC ) / CLDFB_NO_COL_MAX );
    hDirAC->hConfig = NULL;
    set_s( hSpatParamRendCom->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS );
    set_s( hSpatParamRendCom->subframe_nbslots, JBM_CLDFB_SLOTS_IN_SUBFRAME, DEFAULT_JBM_SUBFRAMES_5MS );
    hSpatParamRendCom->nb_subframes = DEFAULT_JBM_SUBFRAMES_5MS;
@@ -2150,7 +2143,6 @@ ivas_error ivas_param_ism_dec_open(
    hSpatParamRendCom->dirac_md_buffer_length = MAX_PARAM_SPATIAL_SUBFRAMES;
    hSpatParamRendCom->dirac_bs_md_write_idx = 0;
    hSpatParamRendCom->dirac_read_idx = 0;
    hDirAC->spar_to_dirac_write_idx = 0;

#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
    if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
@@ -2172,7 +2164,6 @@ ivas_error ivas_param_ism_dec_open(
    st_ivas->hISMDTX.dtx_flag = 0;

    st_ivas->hParamIsmDec = hParamIsmDec;
    st_ivas->hDirAC = hDirAC;
    st_ivas->hSpatParamRendCom = hSpatParamRendCom;

    if ( st_ivas->hDecoderConfig->Opt_5ms )
+2 −0
Original line number Diff line number Diff line
@@ -1098,9 +1098,11 @@ void ivas_destroy_enc(
)
{
    int16_t i, n, nchan_inp;
#ifndef PARAM_ISM_REFACTOR
    IVAS_FORMAT ivas_format;

    ivas_format = st_ivas->hEncoderConfig->ivas_format;
#endif
    nchan_inp = st_ivas->hEncoderConfig->nchan_inp;

    /* SCE handles */