Commit 0611b16b authored by Jan Kiene's avatar Jan Kiene
Browse files

Accept FIX_FMSW_DEC

parent 550141ad
Loading
Loading
Loading
Loading
+0 −183
Original line number Diff line number Diff line
@@ -180,20 +180,13 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS
#else
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
#endif
#ifdef FIX_FMSW_DEC
static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf );
#else
static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_RENDER_CONFIG_DATA *renderConfig, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf );
#endif
static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs );
#ifdef DEBUGGING
static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec );
static int16_t app_own_random( int16_t *seed );
#endif
static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader );
#ifndef FIX_FMSW_DEC
static ivas_error restartDecoder( IVAS_DEC_HANDLE *phIvasDec, const IVAS_DEC_MODE decMode, DecArguments *arg, IVAS_RENDER_CONFIG_DATA *renderConfig, IVAS_CUSTOM_LS_DATA *hLsCustomData );
#endif


/*------------------------------------------------------------------------------------------*
@@ -784,11 +777,7 @@ int main(

    if ( arg.voipMode )
    {
#ifdef FIX_FMSW_DEC
        error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, &hIvasDec, pcmBuf );
#else
        error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, &renderConfig, &hIvasDec, pcmBuf );
#endif
    }
    else
    {
@@ -2628,34 +2617,11 @@ static ivas_error decodeG192(

                if ( restartNeeded )
                {
#ifdef FIX_FMSW_DEC
                    if ( ( error = IVAS_DEC_Restart( hIvasDec, IVAS_DEC_MODE_IVAS ) ) != IVAS_ERR_OK ) /* note: only switching within IVAS formats is supported in G.192 */
                    {
                        fprintf( stderr, "\nIVAS_DEC_Restart restart failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }
#else
                    IVAS_DEC_BS_FORMAT tempFormat;
                    if ( ( error = IVAS_DEC_GetFormat( hIvasDec, &tempFormat ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError in IVAS_DEC_GetFormat, code: %d\n", error );
                        goto cleanup;
                    }
                    IVAS_DEC_MODE codecMode = ( tempFormat == IVAS_DEC_BS_MONO ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS;
                    error = restartDecoder(
                        &hIvasDec,
                        codecMode,
                        &arg,
                        NULL, /* ToDo : Provide rendererConfig */
                        NULL  /* ToDo : Provide LS Custom Data */
                    );
                    if ( error != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nFailed to restart decoder\n" );
                        goto cleanup;
                    }
                    *phIvasDec = hIvasDec; /* Update for main()' s free */
#endif
                }
#endif

@@ -3230,9 +3196,6 @@ static ivas_error decodeVoIP(
    Vector3PairFileReader *referenceVectorReader,
    ObjectEditFileReader *objectEditFileReader,
    ISAR_SPLIT_REND_BITS_DATA *splitRendBits,
#ifndef FIX_FMSW_DEC
    IVAS_RENDER_CONFIG_DATA *renderConfig,
#endif
    IVAS_DEC_HANDLE *phIvasDec,
    int16_t *pcmBuf )
{
@@ -3432,29 +3395,12 @@ static ivas_error decodeVoIP(
        /* restart decoder in case of format switching */
        if ( ivasRtp.restartNeeded )
        {
#ifdef FIX_FMSW_DEC
            arg.decMode = ( ivasRtp.codecId == IVAS_RTP_EVS ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS;
            if ( ( error = IVAS_DEC_Restart( hIvasDec, arg.decMode ) ) != IVAS_ERR_OK ) /* note: switching between EVS and IVAS is supported in RTP */
            {
                fprintf( stderr, "\nIVAS_DEC_Restart restart failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                goto cleanup;
            }
#else
            IVAS_DEC_MODE newDecModeInPacket = ( ivasRtp.codecId == IVAS_RTP_EVS ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS;
            if ( ( error = restartDecoder(
                       &hIvasDec,
                       newDecModeInPacket,
                       &arg,
                       renderConfig,
                       NULL /* ToDo : Provide LS Custom Data */
                       ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nFailed to restart decoder from %d to %d\n", arg.decMode, newDecModeInPacket );
                goto cleanup;
            }

            *phIvasDec = hIvasDec; /* Update for main()' s free */
#endif
            ivasRtp.restartNeeded = false;
            bitstreamReadDone = false;
            parametersAvailableForEditing = false;
@@ -3686,34 +3632,11 @@ static ivas_error decodeVoIP(

                if ( restartNeeded )
                {
#ifdef FIX_FMSW_DEC
                    if ( ( error = IVAS_DEC_Restart( hIvasDec, IVAS_DEC_MODE_IVAS ) ) != IVAS_ERR_OK ) /* note: only switching within IVAS formats is supported in non-RTP VoIP */
                    {
                        fprintf( stderr, "\nIVAS_DEC_Restart restart failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }
#else
                    IVAS_DEC_BS_FORMAT tempBsFormat;
                    if ( ( error = IVAS_DEC_GetFormat( hIvasDec, &tempBsFormat ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError in IVAS_DEC_GetFormat, code: %d\n", error );
                        goto cleanup;
                    }

                    IVAS_DEC_MODE newDecModeInPacket = ( tempBsFormat == IVAS_DEC_BS_MONO ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS;
                    if ( ( error = restartDecoder(
                               &hIvasDec,
                               newDecModeInPacket,
                               &arg,
                               NULL, /* ToDo : Provide rendererConfig */
                               NULL  /* ToDo : Provide LS Custom Data */
                               ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nFailed to restart decoder\n" );
                        goto cleanup;
                    }
                    *phIvasDec = hIvasDec; /* Update for main()' s free */
#endif
                    bitstreamReadDone = false;
                    parametersAvailableForEditing = false;
                }
@@ -4401,110 +4324,4 @@ static ivas_error load_hrtf_from_file(
    return IVAS_ERR_OK;
}

#ifndef FIX_FMSW_DEC
/*---------------------------------------------------------------------*
 * restartDecoder()
 *
 * Restart decoder in case of IVAS format switching
 *---------------------------------------------------------------------*/

static ivas_error restartDecoder(
    IVAS_DEC_HANDLE *phIvasDec,
    const IVAS_DEC_MODE decMode,
    DecArguments *arg,
    IVAS_RENDER_CONFIG_DATA *renderConfig,
    IVAS_CUSTOM_LS_DATA *hLsCustomData )
{
    ivas_error error = IVAS_ERR_OK;
    IVAS_DEC_HANDLE hIvasDec;

    if ( phIvasDec == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

    if ( NULL != *phIvasDec )
    {
        IVAS_DEC_Close( phIvasDec );
    }

    if ( ( error = IVAS_DEC_Open( phIvasDec, decMode ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Open failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }

    arg->decMode = decMode;

    hIvasDec = *phIvasDec;

    uint16_t aeID = arg->aeSequence.count > 0 ? arg->aeSequence.pID[0] : IVAS_DEFAULT_AEID;

    IVAS_AUDIO_CONFIG outputConfig = ( decMode == IVAS_DEC_MODE_IVAS ) ? arg->outputConfig : IVAS_AUDIO_CONFIG_MONO;

    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg->output_Fs, outputConfig, arg->render_num_subframes, arg->customLsOutputEnabled, arg->hrtfReaderEnabled,
                                       arg->enableHeadRotation, arg->enableExternalOrientation, arg->orientation_tracking, arg->renderConfigEnabled, arg->roomSize, arg->non_diegetic_pan_enabled,
                                       arg->non_diegetic_pan_gain, arg->dpidEnabled, aeID, arg->objEditEnabled, arg->delayCompensationEnabled ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }

    if ( arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nSplit rendering configure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }
    }

    if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &arg->render_num_subframes ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nIVAS_DEC_GetRenderNumSubfr failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }

    if ( arg->voipMode )
    {
        if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, 60, arg->inputFormat ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nCould not enable VOIP: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }
    }

    /* ISAR frame size is set from command line, not renderer config file.
     * This will be ignored if output format is not split rendering. */
    if ( renderConfig != NULL )
    {
        renderConfig->split_rend_config.isar_frame_size_ms = (int16_t) arg->render_num_subframes * 5;
    }

    if ( arg->renderConfigEnabled && renderConfig != NULL )
    {
        if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, *renderConfig ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }
    }

    if ( arg->customLsOutputEnabled && hLsCustomData != NULL )
    {
        if ( ( error = IVAS_DEC_FeedCustomLsData( hIvasDec, *hLsCustomData ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nIVAS_DEC_FeedCustomLsData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }
    }

    return IVAS_ERR_OK;

cleanup:
    IVAS_DEC_Close( phIvasDec );
    return error;
}

#endif
#undef WMC_TOOL_SKIP
+0 −17
Original line number Diff line number Diff line
@@ -367,7 +367,6 @@ int main(
        }
    }

#ifdef FIX_FMSW_DEC
    /*------------------------------------------------------------------------------------------*
     * Open remote requests file for rtp packing (E-bytes)
     *------------------------------------------------------------------------------------------*/
@@ -387,7 +386,6 @@ int main(
            goto cleanup;
        }
    }
#endif

    /*------------------------------------------------------------------------------------------*
     * Handle Channel-aware mode
@@ -682,21 +680,6 @@ int main(
        }
    }

#ifndef FIX_FMSW_DEC
#ifdef FIX_1527_CMR_BITRATE_IDX
    /*------------------------------------------------------------------------------------------*
     * Open remote requests file for rtp packing (E-bytes)
     *------------------------------------------------------------------------------------------*/
    if ( arg.requestsFileName != NULL )
    {
        if ( ( error = RequestsFileReader_open( arg.requestsFileName, &requestsFileReader ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError: Can't open requests file %s \n\n", arg.requestsFileName );
            goto cleanup;
        }
    }
#endif
#endif
    /*------------------------------------------------------------------------------------------*
     * Run the encoder
     *------------------------------------------------------------------------------------------*/
+0 −4
Original line number Diff line number Diff line
@@ -434,11 +434,7 @@ void destroy_core_dec(
);

void ivas_destroy_dec(
#ifdef FIX_FMSW_DEC
    Decoder_Struct **st_ivas                                    /* i/o: IVAS decoder structure                  */
#else
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                  */
#endif
);

void ivas_initialize_handles_dec(
+0 −2
Original line number Diff line number Diff line
@@ -169,8 +169,6 @@
/* any switch which is non-be wrt. TS 26.258 V3.0 */

#define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE  /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */
#define FIX_FMSW_DEC                                    /* float issue 1542: fix JBM issue in format switching */
#define FIX_FMSW_DEC_2                                  /* float issue 1575: fix crash for format switching when bitsream starts with EVS */
#define FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW     /* Orange: float issue 1548: Harmonize non diegetic panning law in ISM and renderers */
#define FIX_FLOAT_1578_OMASA_REND_SPIKES                /* Nokia: Float issue 1578: Fix spikes and collapsed perception in OMASA/MASA rendering to FOA/HOA */
#define FIX_2585_BIT_ALLOCATION_DIFF                    /* VA : issue 2585, bit allocation different behaviors between float and fixed-point for corner cases */
+0 −51
Original line number Diff line number Diff line
@@ -1330,11 +1330,7 @@ ivas_error ivas_init_decoder_front(
     * Allocate and initialize Custom loudspeaker layout handle
     *--------------------------------------------------------------------*/

#ifdef FIX_FMSW_DEC
    if ( st_ivas->hDecoderConfig->Opt_LsCustom && st_ivas->hLsSetupCustom == NULL )
#else
    if ( st_ivas->hDecoderConfig->Opt_LsCustom )
#endif
    {
        if ( ( error = ivas_ls_custom_open( &( st_ivas->hLsSetupCustom ) ) ) != IVAS_ERR_OK )
        {
@@ -1346,11 +1342,7 @@ ivas_error ivas_init_decoder_front(
     * Allocate and initialize Head-Tracking handle
     *--------------------------------------------------------------------*/

#ifdef FIX_FMSW_DEC
    if ( st_ivas->hDecoderConfig->Opt_Headrotation && st_ivas->hHeadTrackData == NULL )
#else
    if ( st_ivas->hDecoderConfig->Opt_Headrotation )
#endif
    {
        if ( ( error = ivas_headTrack_open( &( st_ivas->hHeadTrackData ) ) ) != IVAS_ERR_OK )
        {
@@ -1366,11 +1358,7 @@ ivas_error ivas_init_decoder_front(
     * Allocate and initialize external orientation handle
     *--------------------------------------------------------------------*/

#ifdef FIX_FMSW_DEC
    if ( st_ivas->hDecoderConfig->Opt_ExternalOrientation && st_ivas->hExtOrientationData == NULL )
#else
    if ( st_ivas->hDecoderConfig->Opt_ExternalOrientation )
#endif
    {
        if ( ( error = ivas_external_orientation_open( &( st_ivas->hExtOrientationData ), st_ivas->hDecoderConfig->render_num_subframes ) ) != IVAS_ERR_OK )
        {
@@ -1382,11 +1370,7 @@ ivas_error ivas_init_decoder_front(
     * Allocate and initialize combined orientation handle
     *--------------------------------------------------------------------*/

#ifdef FIX_FMSW_DEC
    if ( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && st_ivas->hCombinedOrientationData == NULL )
#else
    if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation )
#endif
    {
        if ( ( error = ivas_combined_orientation_open( &( st_ivas->hCombinedOrientationData ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hDecoderConfig->render_num_subframes ) ) != IVAS_ERR_OK )
        {
@@ -1398,14 +1382,9 @@ ivas_error ivas_init_decoder_front(
     * Allocate and initialize Binaural Renderer configuration handle
     *--------------------------------------------------------------------*/

#ifdef FIX_FMSW_DEC
    if ( ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ||
           ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) ) &&
         st_ivas->hRenderConfig == NULL )
#else
    if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ||
         ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) )
#endif
    {
        if ( ( error = ivas_render_config_open( &( st_ivas->hRenderConfig ) ) ) != IVAS_ERR_OK )
        {
@@ -2803,14 +2782,10 @@ void ivas_initialize_handles_dec(
        st_ivas->hCPE[i] = NULL;
    }

#ifdef FIX_FMSW_DEC
    if ( !st_ivas->restartNeeded )
    {
#endif
        st_ivas->bit_stream = NULL;
#ifdef FIX_FMSW_DEC
    }
#endif
    st_ivas->hLimiter = NULL;

    /* ISM metadata handles */
@@ -2854,10 +2829,8 @@ void ivas_initialize_handles_dec(
    st_ivas->hMasaIsmData = NULL;
    st_ivas->hSbaIsmData = NULL;

#ifdef FIX_FMSW_DEC
    if ( !st_ivas->restartNeeded )
    {
#endif
        st_ivas->hHeadTrackData = NULL;
        st_ivas->hHrtfTD = NULL;
        st_ivas->hLsSetupCustom = NULL;
@@ -2866,9 +2839,7 @@ void ivas_initialize_handles_dec(
        st_ivas->hCombinedOrientationData = NULL;
        st_ivas->acousticEnvironmentsCount = 0;
        st_ivas->pAcousticEnvironments = NULL;
#ifdef FIX_FMSW_DEC
    }
#endif

    st_ivas->hSplitBinRend = NULL;
    for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i )
@@ -2897,17 +2868,11 @@ void ivas_initialize_handles_dec(
 *-------------------------------------------------------------------------*/

void ivas_destroy_dec(
#ifdef FIX_FMSW_DEC
    Decoder_Struct **st_ivas_out /* i/o: IVAS decoder handle      */
#else
    Decoder_Struct *st_ivas /* i/o: IVAS decoder handle      */
#endif
)
{
    int16_t i;
#ifdef FIX_FMSW_DEC
    Decoder_Struct *st_ivas = *st_ivas_out;
#endif

    /* CLDFB handles */
    for ( i = 0; i < MAX_INTERN_CHANNELS; i++ )
@@ -3035,19 +3000,15 @@ void ivas_destroy_dec(
    /* LS config converter handle */
    ivas_ls_setup_conversion_close( &st_ivas->hLsSetUpConversion );

#ifdef FIX_FMSW_DEC
    if ( !st_ivas->restartNeeded )
    {
#endif
        /* Custom LS configuration handle */
        if ( st_ivas->hLsSetupCustom != NULL )
        {
            free( st_ivas->hLsSetupCustom );
            st_ivas->hLsSetupCustom = NULL;
        }
#ifdef FIX_FMSW_DEC
    }
#endif

    /* Mono downmix structure */
    ivas_mono_dmx_renderer_close( &st_ivas->hMonoDmxRenderer );
@@ -3084,13 +3045,11 @@ void ivas_destroy_dec(
    /* HRTF statistics */
    ivas_HRTF_statistics_binary_close( &st_ivas->hHrtfStatistics );

#ifdef FIX_FMSW_DEC
    /* Limiter struct */
    ivas_limiter_close( &( st_ivas->hLimiter ) );

    if ( !st_ivas->restartNeeded )
    {
#endif
        /* Config. Renderer */
        ivas_render_config_close( &( st_ivas->hRenderConfig ) );

@@ -3101,17 +3060,12 @@ void ivas_destroy_dec(
            st_ivas->pAcousticEnvironments = NULL;
        }

#ifndef FIX_FMSW_DEC
        /* Limiter struct */
        ivas_limiter_close( &( st_ivas->hLimiter ) );
#endif
        /* Decoder configuration structure */
        if ( st_ivas->hDecoderConfig != NULL )
        {
            free( st_ivas->hDecoderConfig );
            st_ivas->hDecoderConfig = NULL;
        }
#ifdef FIX_FMSW_DEC
    }
    else
    {
@@ -3121,7 +3075,6 @@ void ivas_destroy_dec(
        st_ivas->mc_mode = MC_MODE_NONE;
        st_ivas->sba_dirac_stereo_flag = 0;
    }
#endif

    /* TC buffer structure */
    ivas_dec_tc_buffer_close( &st_ivas->hTcBuffer );
@@ -3139,15 +3092,11 @@ void ivas_destroy_dec(
    }

    /* main IVAS handle */
#ifdef FIX_FMSW_DEC
    if ( !st_ivas->restartNeeded )
    {
        free( *st_ivas_out );
        *st_ivas_out = NULL;
    }
#else
    free( st_ivas );
#endif

    return;
}
Loading