Commit 66a31275 authored by Rivukanta Bhattacharya's avatar Rivukanta Bhattacharya
Browse files

Review comment changes - Part 2

parent 13827795
Loading
Loading
Loading
Loading
Loading
+4 −27
Original line number Diff line number Diff line
@@ -73,9 +73,6 @@ ivas_error ivas_spar_dec_open(
    int16_t i, j, b, active_w_mixing;
    int32_t output_Fs;
    int16_t num_decor_chs;
#ifdef FIX_501_TABLE_IDX_INIT
    int16_t table_idx;
#endif

    error = IVAS_ERR_OK;
    sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER );
@@ -116,32 +113,12 @@ ivas_error ivas_spar_dec_open(
    }
    hSpar->hMdDec->td_decorr_flag = 1;
#ifdef FIX_501_TABLE_IDX_INIT

    if ( st_ivas->ini_frame == 0 && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_SID_5k2 )
    {
        if ( st_ivas->sid_format == SID_SBA_2TC )
        {
            table_idx = ivas_get_spar_table_idx( IVAS_48k, sba_order_internal, SPAR_CONFIG_BW, NULL, NULL );
        }
        else
        {
            table_idx = ivas_get_spar_table_idx( IVAS_24k4, sba_order_internal, SPAR_CONFIG_BW, NULL, NULL );
        }

        if ( hSpar->hMdDec->table_idx != table_idx )
    if ( st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 )
    {
            hSpar->hMdDec->table_idx = table_idx;
        hSpar->hTdDecorr->ducking_flag = ivas_spar_br_table_consts[hSpar->hMdDec->table_idx].td_ducking;

            ivas_spar_md_dec_init( hSpar->hMdDec, st_ivas->hDecoderConfig, num_channels_internal, sba_order_internal );
    }
    }
    else
    {
#endif
#else
    hSpar->hMdDec->table_idx = -1;
#ifdef FIX_501_TABLE_IDX_INIT
    }
#endif

    /* set FB config. */
+19 −0
Original line number Diff line number Diff line
@@ -292,11 +292,29 @@ ivas_error ivas_spar_md_dec_open(
        return error;
    }

#ifdef FIX_501_TABLE_IDX_INIT
    if ( hDecoderConfig->ivas_total_brate == IVAS_SID_5k2 )
    {
        if ( sid_format == SID_SBA_2TC )
        {
            hMdDec->table_idx = ivas_get_spar_table_idx( IVAS_48k, sba_order, SPAR_CONFIG_BW, NULL, NULL );
        }
        else
        {
            hMdDec->table_idx = ivas_get_spar_table_idx( IVAS_24k4, sba_order, SPAR_CONFIG_BW, NULL, NULL );
        }
    }
    else
    {
        hMdDec->table_idx = ivas_get_spar_table_idx( hDecoderConfig->ivas_total_brate, sba_order, SPAR_CONFIG_BW, NULL, NULL );
    }
#else
    hMdDec->table_idx = 0; /* just to initialize state variables*/
    if ( ( hDecoderConfig->ivas_total_brate == IVAS_SID_5k2 ) && ( sid_format == SID_SBA_2TC ) )
    {
        hMdDec->table_idx = ivas_get_spar_table_idx( IVAS_48k, sba_order, SPAR_CONFIG_BW, NULL, NULL );
    }
#endif
    if ( ( error = ivas_spar_md_dec_init( hMdDec, hDecoderConfig, num_channels, sba_order ) ) != IVAS_ERR_OK )
    {
        return error;
@@ -1836,6 +1854,7 @@ static void ivas_spar_dec_parse_md_bs(
            *nB = num_bands / *bands_bw;
        }
#endif

        return;
    }