Commit f43119fc authored by Rivukanta Bhattacharya's avatar Rivukanta Bhattacharya
Browse files

Failure fixes

parent 65e4155a
Loading
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -4307,10 +4307,6 @@ void ivas_spar_dec_close(
    SPAR_DEC_HANDLE *hSpar,                                     /* i/o: SPAR decoder handle                     */
    const int32_t output_Fs,                                    /* i  : output sampling rate                    */
    const int16_t spar_reconfig_flag                            /* i  : SPAR reconfiguration flag               */
#ifdef FIX_163_SBA_TD_DECORR_OPT
    ,
    const int16_t td_decorr_flag                                  /* i  : Disable malloc for td_decorr structure flag */
#endif
);

ivas_error ivas_spar_dec(
@@ -5740,8 +5736,7 @@ int16_t ivas_get_num_bands_from_bw_idx(

#ifdef FIX_163_SBA_TD_DECORR_OPT
void ivas_get_td_decorr_flag(
    const int32_t ivas_total_brate,                               /* i  : IVAS total bitrate                         */
    AUDIO_CONFIG output_config,                                   /* i  : output config.                             */
    SPAR_DEC_HANDLE hSpar,                                      /* i/o  : IVAS SPAR handle structure              */
    Decoder_Struct *st_ivas                                     /* i/o  : IVAS decoder structure                  */
);
#endif
+9 −5
Original line number Diff line number Diff line
@@ -532,26 +532,30 @@ void ivas_td_decorr_process(
    return;
}

#ifdef FIX_163_SBA_TD_DECORR_OPT
/*-----------------------------------------------------------------------------------------*
 * Function ivas_get_td_decorr_flag()
 *
 * TD decorr bitrate and outfit_config check call
 *-----------------------------------------------------------------------------------------*/

#ifdef FIX_163_SBA_TD_DECORR_OPT
void ivas_get_td_decorr_flag(
    const int32_t ivas_total_brate, /* i  : IVAS total bitrate                         */
    AUDIO_CONFIG output_config,     /* i  : output config.                             */
    SPAR_DEC_HANDLE hSpar,          /* i/o  : IVAS SPAR handle structure              */
    Decoder_Struct *st_ivas         /* i/o  : IVAS decoder structure                  */
)
{
    int32_t ivas_total_brate;
    AUDIO_CONFIG output_config;

    ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
    output_config = st_ivas->hDecoderConfig->output_config;
    if ( ( st_ivas->ivas_format == SBA_FORMAT ) && ( ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) || ( ivas_total_brate >= IVAS_256k && output_config == AUDIO_CONFIG_FOA ) ) )
    {
        st_ivas->hSpar->td_decorr_flag = 0;
        hSpar->td_decorr_flag = 0;
    }
    else
    {
        st_ivas->hSpar->td_decorr_flag = 1;
        hSpar->td_decorr_flag = 1;
    }
}
#endif
+2 −17
Original line number Diff line number Diff line
@@ -694,9 +694,6 @@ ivas_error ivas_init_decoder(

    hDecoderConfig->last_ivas_total_brate = ivas_total_brate;
    st_ivas->last_active_ivas_total_brate = ivas_total_brate;
#ifdef FIX_163_SBA_TD_DECORR_OPT
    ivas_get_td_decorr_flag( ivas_total_brate, output_config, st_ivas );
#endif

    if ( output_config == AUDIO_CONFIG_EXTERNAL )
    {
@@ -1827,12 +1824,7 @@ void ivas_destroy_dec(
    }

    /* SPAR handle */
    ivas_spar_dec_close( &( st_ivas->hSpar ), st_ivas->hDecoderConfig->output_Fs, 0
#ifdef FIX_163_SBA_TD_DECORR_OPT
                         ,
                         st_ivas->hSpar->td_decorr_flag
#endif
    );
    ivas_spar_dec_close( &( st_ivas->hSpar ), st_ivas->hDecoderConfig->output_Fs, 0 );

    /* HOA decoder matrix */
    if ( st_ivas->hoa_dec_mtx != NULL )
@@ -1854,14 +1846,7 @@ void ivas_destroy_dec(
    ivas_lfe_dec_close( &( st_ivas->hLFE ) );

    /* Param-Upmix MC handle */
#ifdef FIX_163_SBA_TD_DECORR_OPT
    if ( st_ivas->hSpar->td_decorr_flag )
    {
#endif
    ivas_mc_paramupmix_dec_close( &( st_ivas->hMCParamUpmix ) );
#ifdef FIX_163_SBA_TD_DECORR_OPT
    }
#endif

    /* Parametric MC handle */
    ivas_param_mc_dec_close( &st_ivas->hParamMC );
+2 −6
Original line number Diff line number Diff line
@@ -175,12 +175,8 @@ ivas_error ivas_sba_dec_reconfigure(
        if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) )
        {

            ivas_spar_dec_close( &( st_ivas->hSpar ), hDecoderConfig->output_Fs, 1
#ifdef FIX_163_SBA_TD_DECORR_OPT
                                 ,
                                 st_ivas->hSpar->td_decorr_flag
#endif
            );
            ivas_spar_dec_close( &( st_ivas->hSpar ), hDecoderConfig->output_Fs, 1 );

            if ( ( error = ivas_spar_dec_open( st_ivas, 1 ) ) != IVAS_ERR_OK )
            {
                return error;
+13 −17
Original line number Diff line number Diff line
@@ -88,6 +88,9 @@ ivas_error ivas_spar_dec_open(
        {
            return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR decoder" );
        }
#ifdef FIX_163_SBA_TD_DECORR_OPT
        ivas_get_td_decorr_flag( hSpar, st_ivas );
#endif
    }

    output_Fs = st_ivas->hDecoderConfig->output_Fs;
@@ -102,16 +105,19 @@ ivas_error ivas_spar_dec_open(

    /* TD decorr. */
#ifdef FIX_163_SBA_TD_DECORR_OPT
    if ( st_ivas->hSpar->td_decorr_flag )
    if ( hSpar->td_decorr_flag )
    {
#endif
        if ( ( error = ivas_td_decorr_dec_open( &hSpar->hTdDecorr, output_Fs, num_decor_chs + 1, 1 ) ) != IVAS_ERR_OK )
        {
            hSpar->hTdDecorr = NULL;
            return error;
        }
#ifdef FIX_163_SBA_TD_DECORR_OPT
    }
    else
    {
        hSpar->hTdDecorr = NULL;
    }
#endif

    /* MD handle */
@@ -255,10 +261,6 @@ void ivas_spar_dec_close(
    SPAR_DEC_HANDLE *hSpar,          /* i/o: SPAR decoder handle        */
    const int32_t output_Fs,         /* i  : output sampling rate       */
    const int16_t spar_reconfig_flag /* i  : SPAR reconfiguration flag  */
#ifdef FIX_163_SBA_TD_DECORR_OPT
    ,
    const int16_t td_decorr_flag /* i  : Disable malloc for td_decorr structure flag  */
#endif
)
{
    if ( *hSpar == NULL || hSpar == NULL )
@@ -270,14 +272,8 @@ void ivas_spar_dec_close(
    ivas_spar_md_dec_close( &( *hSpar )->hMdDec );

    /* TD decorrelator handle */
#ifdef FIX_163_SBA_TD_DECORR_OPT
    if ( td_decorr_flag && &( *hSpar )->hTdDecorr != NULL )
    {
#endif
    ivas_td_decorr_dec_close( &( *hSpar )->hTdDecorr );
#ifdef FIX_163_SBA_TD_DECORR_OPT
    }
#endif

    /* FB mixer handle */
    ivas_FB_mixer_close( &( *hSpar )->hFbMixer, output_Fs, spar_reconfig_flag );

@@ -750,7 +746,7 @@ static void ivas_spar_dec_MD(
            {
                hSpar->hMdDec->table_idx = table_idx;
#ifdef FIX_163_SBA_TD_DECORR_OPT
                if ( st_ivas->hSpar->td_decorr_flag )
                if ( hSpar->td_decorr_flag )
                {
#endif
                    hSpar->hTdDecorr->ducking_flag = ivas_spar_br_table_consts[table_idx].td_ducking;
@@ -1255,7 +1251,7 @@ void ivas_spar_dec_digest_tc(
        {
            int16_t nSamplesToDecorr = min( nSamplesLeftForTD, default_frame );
#ifdef FIX_163_SBA_TD_DECORR_OPT
            if ( st_ivas->hSpar->td_decorr_flag )
            if ( hSpar->td_decorr_flag )
            {
#endif
                ivas_td_decorr_process( hSpar->hTdDecorr, p_tc, pPcm_tmp, nSamplesToDecorr );
@@ -1343,7 +1339,7 @@ void ivas_spar_dec_upmixer(
    if ( hSpar->hMdDec->td_decorr_flag )
    {
#ifdef FIX_163_SBA_TD_DECORR_OPT
        if ( st_ivas->hSpar->td_decorr_flag )
        if ( hSpar->td_decorr_flag )
        {
#endif
            ivas_td_decorr_process( hSpar->hTdDecorr, st_ivas->hTcBuffer->tc, pPcm_tmp, output_frame );
Loading