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

Review comment changes

parent 103a056f
Loading
Loading
Loading
Loading
Loading
+31 −31
Original line number Diff line number Diff line
@@ -73,6 +73,9 @@ 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 );
@@ -112,7 +115,34 @@ ivas_error ivas_spar_dec_open(
        return error;
    }
    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 )
        {
            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
        hSpar->hMdDec->table_idx = -1;
#ifdef FIX_501_TABLE_IDX_INIT
    }
#endif

    /* set FB config. */
    active_w_mixing = -1;
@@ -736,37 +766,7 @@ static void ivas_spar_dec_MD(
                ivas_spar_md_dec_init( hSpar->hMdDec, hDecoderConfig, num_channels, sba_order );
            }
        }
#ifdef FIX_501_TABLE_IDX_INIT
        else if ( st_ivas->ini_frame == 0 )
        {
            if ( st_ivas->sid_format == SID_SBA_2TC )
            {
                table_idx = ivas_get_spar_table_idx( IVAS_48k, sba_order, SPAR_CONFIG_BW, NULL, NULL );
            }
            else
            {
                table_idx = ivas_get_spar_table_idx( IVAS_24k4, sba_order, SPAR_CONFIG_BW, NULL, NULL );
            }

            hSpar->hMdDec->table_idx = table_idx;
            if ( hSpar->hMdDec->spar_hoa_md_flag )
            {
                hSpar->hMdDec->spar_md.num_bands = IVAS_MAX_NUM_BANDS;
            }
            else
            {
                hSpar->hMdDec->spar_md.num_bands = min( SPAR_DIRAC_SPLIT_START_BAND, IVAS_MAX_NUM_BANDS );
            }

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

                ivas_spar_md_dec_init( hSpar->hMdDec, hDecoderConfig, num_channels, sba_order );
            }
        }
#endif
        /*---------------------------------------------------------------------*
         * Decode MD
         *---------------------------------------------------------------------*/
+21 −16
Original line number Diff line number Diff line
@@ -1803,6 +1803,10 @@ static void ivas_spar_dec_parse_md_bs(

        ivas_parse_parameter_bitstream_dtx( &hMdDec->spar_md, st0, *bands_bw, *nB, hMdDec->spar_md_cfg.num_dmx_chans_per_band, hMdDec->spar_md_cfg.num_decorr_per_band );

#ifdef FIX_501_TABLE_IDX_INIT
        if ( last_active_brate >= IVAS_24k4 )
        {
#endif
            for ( i = *nB - 1; i >= 0; i-- )
            {
                ndec = hMdDec->spar_md_cfg.num_decorr_per_band[( *bands_bw ) * i];
@@ -1825,7 +1829,8 @@ static void ivas_spar_dec_parse_md_bs(
            *nB = num_bands;
            *bands_bw = 1;
#ifdef FIX_501_TABLE_IDX_INIT
        if ( ( ivas_total_brate < IVAS_24k4 ) && ( last_active_brate < IVAS_24k4 ) )
        }
        else
        {
            *bands_bw = 2;
            *nB = num_bands / *bands_bw;