Commit 1db032e4 authored by vaclav's avatar vaclav
Browse files

FIX_FMSW_DEC

parent 7c02c866
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -4345,6 +4345,9 @@ static ivas_error restartDecoder(

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

#ifdef FIX_FMSW_DEC
    // the calling of following 3 functions could be avoided as well
#endif
    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 )
@@ -4368,7 +4371,7 @@ static ivas_error restartDecoder(
        goto cleanup;
    }

    if ( arg->voipMode )
#ifndef FIX_FMSW_DEC
    {
        if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, 60, arg->inputFormat ) ) != IVAS_ERR_OK )
        {
@@ -4376,7 +4379,7 @@ static ivas_error restartDecoder(
            goto cleanup;
        }
    }

#endif
    if ( ( error = IVAS_DEC_PrintConfig( hIvasDec, 1, arg->voipMode ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
+1 −0
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@
#define FIX_FLOAT_1493_MASA_ENCODE_STABILITY_IMPROVE    /* Nokia: float issue 1493: Improves float decision stability in MASA encoding by adjusting reduction code */
#define FIX_BASOP_2436_REUSED_CLDFB_IN_OMASA_SR         /* FhG: basop issue 2436 (related to basop 2283): fix garbage output for >1 object OMASA with extrend as ISAR prerenderer */
#define FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION  /* Nokia: float issue 1528: Fixes incorrect compensation for ISM metadata delay in 5ms TD rendering */
#define FIX_FMSW_DEC                                    /* float issue 1542: fix JBM issue in format switching */

/* ##################### End NON-BE switches ########################### */

+28 −0
Original line number Diff line number Diff line
@@ -2739,9 +2739,16 @@ void ivas_initialize_handles_dec(
        st_ivas->hCPE[i] = NULL;
    }

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

    /* ISM metadata handles */
    for ( i = 0; i < MAX_NUM_OBJECTS; i++ )
@@ -2867,6 +2874,10 @@ void ivas_destroy_dec(
        }
    }

#ifdef FIX_FMSW_DEC
    if ( st_ivas->restartNeeded == 0 )
    {
#endif
    /* HP20 filter handles */
    if ( st_ivas->mem_hp20_out != NULL )
    {
@@ -2878,6 +2889,9 @@ void ivas_destroy_dec(
        free( st_ivas->mem_hp20_out );
        st_ivas->mem_hp20_out = NULL;
    }
#ifdef FIX_FMSW_DEC
    }
#endif

    /* ISM metadata handles */
    ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 );
@@ -3004,6 +3018,10 @@ void ivas_destroy_dec(
        st_ivas->pAcousticEnvironments = NULL;
    }

#ifdef FIX_FMSW_DEC
    if ( st_ivas->restartNeeded == 0  )
    {
#endif
    /* Limiter struct */
    ivas_limiter_close( &( st_ivas->hLimiter ) );

@@ -3013,6 +3031,9 @@ void ivas_destroy_dec(
        free( st_ivas->hDecoderConfig );
        st_ivas->hDecoderConfig = NULL;
    }
#ifdef FIX_FMSW_DEC
    }
#endif

    /* TC buffer structure */
    ivas_dec_tc_buffer_close( &st_ivas->hTcBuffer );
@@ -3030,7 +3051,14 @@ void ivas_destroy_dec(
    }

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

    return;
}
+4242 −4206
Original line number Diff line number Diff line
@@ -150,6 +150,14 @@ ivas_error IVAS_DEC_Open(
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

#ifdef FIX_FMSW_DEC
    if ( ( *phIvasDec ) != NULL && ( *phIvasDec )->st_ivas != NULL && ( *phIvasDec )->st_ivas->restartNeeded != 0 )
    {
        hIvasDec = *phIvasDec;
    }
    else
    {
#endif
        /*-----------------------------------------------------------------*
         * Allocate and initialize IVAS application decoder handle
         *-----------------------------------------------------------------*/
@@ -203,6 +211,9 @@ ivas_error IVAS_DEC_Open(
        {
            return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for Decoder config structure" );
        }
#ifdef FIX_FMSW_DEC
    }
#endif

    /*-----------------------------------------------------------------*
     * Initialize IVAS-codec decoder state
@@ -211,7 +222,14 @@ ivas_error IVAS_DEC_Open(
    st_ivas = hIvasDec->st_ivas;

    /* initialize Decoder Config. handle */
#ifdef FIX_FMSW_DEC
    if ( st_ivas->restartNeeded == 0 )
    {
#endif
        init_decoder_config( hIvasDec->st_ivas->hDecoderConfig );
#ifdef FIX_FMSW_DEC
        }
#endif

        /* initialize pointers to handles to NULL */
        ivas_initialize_handles_dec( st_ivas );
@@ -336,7 +354,11 @@ void IVAS_DEC_Close(
            return;
        }

#ifdef FIX_FMSW_DEC
        if ( ( *phIvasDec )->st_ivas->restartNeeded == 0 && ( *phIvasDec )->hVoIP )
#else
    if ( ( *phIvasDec )->hVoIP )
#endif
        {
            ivas_destroy_handle_VoIP( ( *phIvasDec )->hVoIP );
            ( *phIvasDec )->hVoIP = NULL;
@@ -349,9 +371,20 @@ void IVAS_DEC_Close(

            /* destroy IVAS decoder handles */
            ivas_destroy_dec( ( *phIvasDec )->st_ivas );
#ifdef FIX_FMSW_DEC
            if ( ( *phIvasDec )->st_ivas->restartNeeded == 0 )
            {
#endif
                ( *phIvasDec )->st_ivas = NULL;
#ifdef FIX_FMSW_DEC
            }
#endif
        }

#ifdef FIX_FMSW_DEC
        if ( ( *phIvasDec )->st_ivas->restartNeeded == 0 )
        {
#endif
            apa_exit( &( *phIvasDec )->hTimeScaler );

            if ( ( *phIvasDec )->flushbuffer != NULL )
@@ -362,6 +395,9 @@ void IVAS_DEC_Close(
            free( *phIvasDec );
            *phIvasDec = NULL;
            phIvasDec = NULL;
#ifdef FIX_FMSW_DEC
        }
#endif

        return;
    }