Commit e11a7665 authored by vaclav's avatar vaclav
Browse files

recycle parameters

parent dce38c53
Loading
Loading
Loading
Loading
+14 −13
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ ivas_error ivas_jbm_dec_tc(

    if ( !st_ivas->hDecoderConfig->Opt_tsm )
    {
        for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ )
        for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate ); n++ )
        {
            st_ivas->hTcBuffer->tc[n] = st_ivas->p_output_f[n];
        }
@@ -312,7 +312,7 @@ ivas_error ivas_jbm_dec_tc(
            ivas_masa_prerender( st_ivas, p_output, output_frame, nchan_remapped );

            /* external output */
            if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT )
            if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT )
            {
                for ( n = 0; n < st_ivas->nchan_ism; n++ )
                {
@@ -476,10 +476,10 @@ ivas_error ivas_jbm_dec_tc(

            if ( st_ivas->hSpar->hPCA != NULL )
            {
                ivas_pca_dec( st_ivas->hSpar->hPCA, output_frame, st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->bfi, &p_output[sba_ch_idx] );
                ivas_pca_dec( st_ivas->hSpar->hPCA, output_frame, st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->bfi, &p_output[sba_ch_idx] );
            }

            ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi, ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ) );
            ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi, ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, ivas_total_brate, st_ivas->last_active_ivas_total_brate ) );

            ivas_sba_dirac_stereo_dec( st_ivas, &p_output[sba_ch_idx], output_frame, 0 );
        }
@@ -508,7 +508,7 @@ ivas_error ivas_jbm_dec_tc(
#endif
        if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM )
        {
            num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate );
            num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, ivas_total_brate, st_ivas->last_active_ivas_total_brate );

            ivas_sba_mix_matrix_determiner( st_ivas->hSpar, &p_output[sba_ch_idx], st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames );
        }
@@ -847,7 +847,6 @@ void ivas_jbm_dec_feed_tc_to_renderer(
    }
    else if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
    {

        if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC )
        {
            ivas_ism_dec_digest_tc( st_ivas );
@@ -1245,7 +1244,7 @@ ivas_error ivas_jbm_dec_render(
                    return error;
                }
            }
            else if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) /*EXT output = individual objects + HOA3*/
            else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) /*EXT output = individual objects + HOA3*/
            {
                if ( ( error = ivas_sba_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, &p_output[st_ivas->nchan_ism] ) ) != IVAS_ERR_OK )
                {
@@ -1276,7 +1275,7 @@ ivas_error ivas_jbm_dec_render(
                return error;
            }

            if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
            if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
            {
#ifdef DEBUGGING
                assert( st_ivas->ism_mode == ISM_MODE_NONE );
@@ -1303,6 +1302,7 @@ ivas_error ivas_jbm_dec_render(
        {
            int16_t crendInPlaceRotation = FALSE;
            *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal );

            if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) )
            {
                if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) < ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ) )
@@ -1406,6 +1406,7 @@ ivas_error ivas_jbm_dec_render(
        {
            int16_t offset = hSpatParamRendCom->slots_rendered * hSpatParamRendCom->slot_size;
            nchan_remapped = st_ivas->nchan_transport;

            if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
            {
                ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output );
@@ -1752,6 +1753,7 @@ ivas_error ivas_jbm_dec_flush_renderer(
        {
            return IVAS_ERROR( IVAS_ERR_WRONG_MODE, "Wrong IVAS format in VoIP renderer flushing!" );
        }

        hTcBuffer->n_samples_rendered = hTcBuffer->n_samples_granularity;
    }

@@ -2044,7 +2046,6 @@ int16_t ivas_jbm_dec_get_num_tc_channels(
    int32_t ivas_total_brate;
    AUDIO_CONFIG output_config;


    if ( st_ivas->renderer_type == RENDERER_DISABLE )
    {
        num_tc = st_ivas->hDecoderConfig->nchan_out;
@@ -2083,7 +2084,7 @@ int16_t ivas_jbm_dec_get_num_tc_channels(
            num_tc = 1; /* Only one channel transported */
        }

        if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->nchan_transport == 2 && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 )
        if ( st_ivas->ivas_format == MASA_FORMAT && output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->nchan_transport == 2 && ivas_total_brate < MASA_STEREO_MIN_BITRATE && ivas_total_brate > IVAS_SID_5k2 )
        {
            num_tc = CPE_CHANNELS;
        }
@@ -2098,7 +2099,7 @@ int16_t ivas_jbm_dec_get_num_tc_channels(
    }
    else if ( st_ivas->ivas_format == MASA_ISM_FORMAT )
    {
        if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL )
        if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL )
        {
            if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ )
            {
@@ -2127,11 +2128,11 @@ int16_t ivas_jbm_dec_get_num_tc_channels(
    }
    else if ( st_ivas->ivas_format == MC_FORMAT )
    {
        if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO )
        if ( output_config == IVAS_AUDIO_CONFIG_MONO )
        {
            num_tc = 1;
        }
        else if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO )
        else if ( output_config == IVAS_AUDIO_CONFIG_STEREO )
        {
            num_tc = 2;
        }