Commit b69164d2 authored by bayers's avatar bayers
Browse files

accept define MASA_PARAMBIN_SF_MAP, fix compile error when JBM_TSM_ON_TCS is deactivated

parent 3f78adfc
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -3814,15 +3814,9 @@ void ivas_dirac_dec_output_synthesis_process_slot(
    const int16_t *azimuth,
    const int16_t *elevation,
    const float *diffuseness,
#ifndef MASA_PARAMBIN_SF_MAP
    const uint16_t coherence_flag,
#endif
#endif
    DIRAC_DEC_HANDLE hDirAC,                                    /* i/o: DirAC handle                                */
#ifdef JBM_TSM_ON_TCS
#ifndef MASA_PARAMBIN_SF_MAP
    MASA_DECODER_HANDLE hMasa,
#endif
    const int16_t sh_rot_max_order,
#endif
    const float *p_Rmat,                                        /* i  : rotation matrix                             */
@@ -5198,19 +5192,11 @@ void ivas_masa_prerender(
#ifndef FIX_355_REFACTOR_PARAMBIN_TO_5MS
void ivas_spar_param_to_masa_param_mapping_sf(
    Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct               */
#ifdef MASA_PARAMBIN_SF_MAP
    int16_t azimuth[CLDFB_NO_CHANNELS_MAX],
    int16_t elevation[CLDFB_NO_CHANNELS_MAX],
    float energy_ratio1[CLDFB_NO_CHANNELS_MAX],
    float spreadCoherence[CLDFB_NO_CHANNELS_MAX],
    float surroundingCoherence[CLDFB_NO_CHANNELS_MAX],
#else
    int16_t azimuth[][CLDFB_NO_CHANNELS_MAX],
    int16_t elevation[][CLDFB_NO_CHANNELS_MAX],
    float energy_ratio1[][CLDFB_NO_CHANNELS_MAX],
    float spreadCoherence[][CLDFB_NO_CHANNELS_MAX],
    float surroundingCoherence[][CLDFB_NO_CHANNELS_MAX],
#endif
    float inRe[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i  : Input audio in CLDFB domain, real */
    float inIm[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]  /* i  : Input audio in CLDFB domain, imag */
);
+0 −3
Original line number Diff line number Diff line
@@ -218,9 +218,6 @@

#define VARIABLE_SPEED_DECODING                         /* FhG: variable speed decoding employing the JBM functioniality */
#define JBM_TSM_ON_TCS                                  /* FhG: run the TSM part of JBM on the TCs instead of the final output pcm waveforms */
#ifdef JBM_TSM_ON_TCS
#define MASA_PARAMBIN_SF_MAP
#endif
/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */

+64 −138
Original line number Diff line number Diff line
@@ -183,10 +183,6 @@ ivas_error ivas_dirac_dec_config(
    num_outputs_diff_old = 0;
    num_protos_diff_old = 0;

#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
    hDirAC->voip_active = st_ivas->hDecoderConfig->voip_active;
#endif

    nchan_transport_orig = st_ivas->nchan_transport;
    if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR && !( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) )
    {
@@ -950,17 +946,10 @@ ivas_error ivas_dirac_dec_config(
            {
                int16_t map_idx;
                set_s( hDirAC->render_to_md_map, 0, MAX_JBM_SUBFRAMES_5MS * JBM_CLDFB_SLOTS_IN_SUBFRAME );
#ifdef MASA_PARAMBIN_SF_MAP
                for ( map_idx = 0; map_idx < DEFAULT_JBM_SUBFRAMES_5MS; map_idx++ )
                {
                    hDirAC->render_to_md_map[map_idx] = map_idx;
                }
#else
                for ( map_idx = 0; map_idx < DEFAULT_JBM_CLDFB_TIMESLOTS; map_idx++ )
                {
                    hDirAC->render_to_md_map[map_idx] = map_idx / JBM_CLDFB_SLOTS_IN_SUBFRAME;
                }
#endif
            }
#endif
        }
@@ -972,17 +961,10 @@ ivas_error ivas_dirac_dec_config(
            {
                int16_t map_idx;
                set_s( hDirAC->render_to_md_map, 0, MAX_JBM_SUBFRAMES_5MS * JBM_CLDFB_SLOTS_IN_SUBFRAME );
#ifdef MASA_PARAMBIN_SF_MAP
                for ( map_idx = 0; map_idx < DEFAULT_JBM_SUBFRAMES_5MS; map_idx++ )
                {
                    hDirAC->render_to_md_map[map_idx] = map_idx;
                }
#else
                for ( map_idx = 0; map_idx < DEFAULT_JBM_CLDFB_TIMESLOTS; map_idx++ )
                {
                    hDirAC->render_to_md_map[map_idx] = map_idx / JBM_CLDFB_SLOTS_IN_SUBFRAME;
                }
#endif
            }
#endif
        }
@@ -2646,20 +2628,16 @@ void ivas_dirac_dec_set_md_map(
    /* set mapping according to dirac_read_idx */

    set_s( hDirAC->render_to_md_map, 0, MAX_JBM_SUBFRAMES_5MS * JBM_CLDFB_SLOTS_IN_SUBFRAME );
#ifdef MASA_PARAMBIN_SF_MAP

    if ( hDirAC->hConfig == NULL || hDirAC->hConfig->dec_param_estim == 0 )
    {
        ivas_jbm_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, num_slots_in_subfr, 0, hDirAC->dirac_md_buffer_length, hDirAC->render_to_md_map );
    }
    else
    {
#endif
        ivas_jbm_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, num_slots_in_subfr, hDirAC->dirac_read_idx, hDirAC->dirac_md_buffer_length, hDirAC->render_to_md_map );
#ifdef MASA_PARAMBIN_SF_MAP
    }
#endif

#ifdef MASA_PARAMBIN_SF_MAP
    if ( hDirAC->hConfig == NULL || hDirAC->hConfig->dec_param_estim == 0 )
    {
        float tmp;
@@ -2677,7 +2655,6 @@ void ivas_dirac_dec_set_md_map(
        }
        set_s( &hDirAC->render_to_md_map[hDirAC->nb_subframes], 0, MAX_JBM_SUBFRAMES_5MS * JBM_CLDFB_SLOTS_IN_SUBFRAME - hDirAC->nb_subframes );
    }
#endif

    return;
}
@@ -2934,7 +2911,6 @@ void ivas_dirac_dec_render_sf(
    {
#endif
#ifdef JBM_TSM_ON_TCS
#ifdef MASA_PARAMBIN_SF_MAP
    if ( hDirAC->hConfig->dec_param_estim == FALSE )
    {
        md_idx = hDirAC->render_to_md_map[subframe_idx];
@@ -2943,13 +2919,8 @@ void ivas_dirac_dec_render_sf(
    {
        md_idx = hDirAC->render_to_md_map[slot_idx_start];
    }
#else
    md_idx = hDirAC->render_to_md_map[slot_idx_start];
#endif
#endif
#ifdef JBM_TSM_ON_TCS


    /* Another workaround for self test BE */
    if ( st_ivas->hHeadTrackData && st_ivas->hDecoderConfig->voip_active == 0 )
    {
@@ -2973,17 +2944,15 @@ void ivas_dirac_dec_render_sf(
    }

    /* copy parameters into local buffers*/
#ifdef MASA_PARAMBIN_SF_MAP

    if ( hDirAC->hConfig->dec_param_estim == TRUE )
    {
#endif
        for ( slot_idx = 0; slot_idx < hDirAC->subframe_nbslots[subframe_idx]; slot_idx++ )
        {
            mvs2s( hDirAC->azimuth[hDirAC->render_to_md_map[slot_idx + slot_idx_start]], azimuth[slot_idx], hDirAC->num_freq_bands );
            mvs2s( hDirAC->elevation[hDirAC->render_to_md_map[slot_idx + slot_idx_start]], elevation[slot_idx], hDirAC->num_freq_bands );
            mvr2r( hDirAC->diffuseness_vector[hDirAC->render_to_md_map[slot_idx + slot_idx_start]], diffuseness_vector[slot_idx], hDirAC->num_freq_bands );
        }
#ifdef MASA_PARAMBIN_SF_MAP
    }
    else
    {
@@ -2994,7 +2963,7 @@ void ivas_dirac_dec_render_sf(
            mvr2r( hDirAC->diffuseness_vector[hDirAC->render_to_md_map[subframe_idx]], diffuseness_vector[slot_idx], hDirAC->num_freq_bands );
        }
    }
#endif

#endif

    if ( hDirAC->synthesisConf != DIRAC_SYNTHESIS_GAIN_SHD )
@@ -3046,11 +3015,7 @@ void ivas_dirac_dec_render_sf(
        p_Rmat = 0;
    }

#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
    if ( st_ivas->hDecoderConfig->voip_active == 0 && hDirAC->hConfig->dec_param_estim == FALSE )
#else
    if ( hDirAC->hConfig->dec_param_estim == FALSE )
#endif
    {

        /* compute response */
@@ -3091,11 +3056,7 @@ void ivas_dirac_dec_render_sf(
        {
            ivas_dirac_dec_compute_gain_factors( hDirAC->num_freq_bands,
#ifdef JBM_TSM_ON_TCS
#ifdef MASA_PARAMBIN_SF_MAP
                                                 hDirAC->diffuseness_vector[md_idx],
#else
                                                 diffuseness_vector[0],
#endif
#else
                                                     hDirAC->diffuseness_vector[hDirAC->dirac_read_idx],
#endif
@@ -3224,7 +3185,6 @@ void ivas_dirac_dec_render_sf(
                                      st_ivas->cldfbAnaDec[ch] );

#endif
                }
#endif
            }
        }
@@ -3566,13 +3526,7 @@ void ivas_dirac_dec_render_sf(
                                                              azimuth[slot_idx],
                                                              elevation[slot_idx],
                                                              diffuseness_vector[slot_idx],
#ifndef MASA_PARAMBIN_SF_MAP
                                                          coherence_flag,
#endif
                                                              hDirAC,
#ifndef MASA_PARAMBIN_SF_MAP
                                                          st_ivas->hMasa,
#endif
                                                              st_ivas->hHeadTrackData->shd_rot_max_order,
                                                              p_Rmat,
                                                              st_ivas->hVBAPdata,
@@ -3593,13 +3547,7 @@ void ivas_dirac_dec_render_sf(
                                                              azimuth[slot_idx],
                                                              elevation[slot_idx],
                                                              diffuseness_vector[slot_idx],
#ifndef MASA_PARAMBIN_SF_MAP
                                                          coherence_flag,
#endif
                                                              hDirAC,
#ifndef MASA_PARAMBIN_SF_MAP
                                                          st_ivas->hMasa,
#endif
                                                              0,
                                                              0,
                                                              st_ivas->hVBAPdata,
@@ -3634,7 +3582,7 @@ void ivas_dirac_dec_render_sf(
#endif
#ifdef JBM_TSM_ON_TCS
    ivas_dirac_dec_output_synthesis_get_interpolator( &hDirAC->h_output_synthesis_psd_params, hDirAC->subframe_nbslots[subframe_idx] );
#ifdef MASA_PARAMBIN_SF_MAP

    if ( hDirAC->hConfig->dec_param_estim == FALSE )
    {
        md_idx = hDirAC->render_to_md_map[subframe_idx];
@@ -3643,11 +3591,7 @@ void ivas_dirac_dec_render_sf(
    {
        md_idx = hDirAC->render_to_md_map[slot_idx_start];
    }
#else
    md_idx = hDirAC->render_to_md_map[slot_idx_start];
#endif

#ifdef MASA_PARAMBIN_SF_MAP
    /* Workaround for BE (should be gone when #393 is adressed and diffuseness index in the gain SHD renderer with HO-DirAC is fixed) */
    /* :TODO: remove */
    /* get the correct md index for the diffuseness in direction smoothing and HO-DirAC, it is always the first slot of the next subframe*/
@@ -3674,24 +3618,7 @@ void ivas_dirac_dec_render_sf(
            md_idx = hDirAC->render_to_md_map[subframe_idx + 1];
        }
    }
#else
    if ( slot_idx_start + hDirAC->subframe_nbslots[subframe_idx] == hDirAC->num_slots )
    {
        /* we are at the end, get the next one using the normal dirac read idx...*/
        if ( st_ivas->hDirAC->hConfig->dec_param_estim == 1 )
        {
            md_idx = ( hDirAC->dirac_read_idx + DEFAULT_JBM_CLDFB_TIMESLOTS ) % hDirAC->dirac_md_buffer_length;
        }
        else
        {
            md_idx = ( hDirAC->dirac_read_idx + DEFAULT_JBM_SUBFRAMES_5MS ) % hDirAC->dirac_md_buffer_length;
        }
    }
    else
    {
        md_idx = hDirAC->render_to_md_map[slot_idx_start + hDirAC->subframe_nbslots[subframe_idx]];
    }
#endif

#endif
    if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD )
    {
@@ -3972,7 +3899,6 @@ void ivas_dirac_dec_render_sf(
}
#endif


pop_wmops();

return;
+11 −176
Original line number Diff line number Diff line
@@ -581,15 +581,9 @@ void ivas_dirac_dec_output_synthesis_process_slot(
    const int16_t *azimuth,
    const int16_t *elevation,
    const float *diffuseness,
#ifndef MASA_PARAMBIN_SF_MAP
    const uint16_t coherence_flag,
#endif
#endif
    DIRAC_DEC_HANDLE hDirAC, /* i/o: DirAC handle                */
#ifdef JBM_TSM_ON_TCS
#ifndef MASA_PARAMBIN_SF_MAP
    MASA_DECODER_HANDLE hMasa,
#endif
    const int16_t sh_rot_max_order,
#endif
    const float *p_Rmat,               /* i  : rotation matrix             */
@@ -613,12 +607,6 @@ void ivas_dirac_dec_output_synthesis_process_slot(
    int16_t diff_start_band;
#ifndef JBM_TSM_ON_TCS
    const float *diffuseness;
#endif
#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
    float dirEne;
    float surCohEner;
    float surCohRatio[CLDFB_NO_CHANNELS_MAX];
    int16_t i, l;
#endif
    DIRAC_OUTPUT_SYNTHESIS_PARAMS *h_dirac_output_synthesis_params;
    DIRAC_OUTPUT_SYNTHESIS_STATE *h_dirac_output_synthesis_state;
@@ -723,90 +711,18 @@ void ivas_dirac_dec_output_synthesis_process_slot(
    }
    else // ( hDirAC->hConfig->dec_param_estim == TRUE )
#endif
#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
        if ( hDirAC->hConfig->dec_param_estim == TRUE || hDirAC->voip_active == 1 )
#else
    if ( hDirAC->hConfig->dec_param_estim == TRUE )
#endif
    {
#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
        if ( hDirAC->voip_active == 1 )
        {
            if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD )
    {
                ivas_dirac_dec_compute_gain_factors( num_freq_bands,
                                                     diffuseness,
                                                     h_dirac_output_synthesis_params->max_band_decorr,
                                                     h_dirac_output_synthesis_state->direct_power_factor,
                                                     h_dirac_output_synthesis_state->diffuse_power_factor );

                v_multc( h_dirac_output_synthesis_state->direct_power_factor,
                         0.25f,
                         h_dirac_output_synthesis_state->direct_power_factor,
                         num_freq_bands );
                v_multc( h_dirac_output_synthesis_state->diffuse_power_factor,
                         0.25f,
                         h_dirac_output_synthesis_state->diffuse_power_factor,
                         num_freq_bands );
                if ( coherence_flag )
                {
                    for ( i = 0; i < hDirAC->num_freq_bands; i++ )
                    {
                        surCohRatio[i] = hDirAC->surroundingCoherence[md_idx][i];
                    }
                }
                else
                {
                    set_zero( surCohRatio, hDirAC->num_freq_bands );
                }
            }
            else
            {


                /* compute reference and diffuse power factor for this frame */

                ivas_dirac_dec_compute_power_factors( num_freq_bands,
                                                      diffuseness,
                                                      h_dirac_output_synthesis_params->max_band_decorr,
                                                      h_dirac_output_synthesis_state->direct_power_factor,
                                                      h_dirac_output_synthesis_state->diffuse_power_factor );

                if ( coherence_flag )
                {
                    for ( i = 0; i < hDirAC->num_freq_bands; i++ )
                    {
                        dirEne = hDirAC->h_output_synthesis_psd_state.direct_power_factor[i];
                        surCohEner = hDirAC->h_output_synthesis_psd_state.diffuse_power_factor[i] * hDirAC->surroundingCoherence[md_idx][i];
                        hDirAC->h_output_synthesis_psd_state.diffuse_power_factor[i] -= surCohEner;
                        hDirAC->h_output_synthesis_psd_state.direct_power_factor[i] += surCohEner;

                        surCohRatio[i] = surCohEner / ( 1e-12f + dirEne + surCohEner );
                    }
                }
                else
                {
                    set_zero( surCohRatio, hDirAC->num_freq_bands );
                }
            }
        }
#endif /* compute direct responses */
        /* compute direct responses */
#ifdef JBM_TSM_ON_TCS
        ivas_dirac_dec_compute_directional_responses( hDirAC,
                                                      hVBAPdata,
#ifdef MASA_PARAMBIN_SF_MAP
                                                      NULL,
#else
                                                      hMasa,
#endif
                                                      azimuth,
                                                      elevation,
                                                      md_idx,
#ifdef MASA_PARAMBIN_SF_MAP
                                                      NULL,
#else
                                                      coherence_flag ? surCohRatio : NULL,
#endif
                                                      sh_rot_max_order,
                                                      p_Rmat
#ifdef HODIRAC
@@ -830,10 +746,6 @@ void ivas_dirac_dec_output_synthesis_process_slot(

        if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD )
        {
#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
            if ( hDirAC->voip_active == 0 )
            {
#endif
                ivas_dirac_dec_compute_gain_factors( num_freq_bands,
                                                     diffuseness,
                                                     h_dirac_output_synthesis_params->max_band_decorr,
@@ -849,16 +761,8 @@ void ivas_dirac_dec_output_synthesis_process_slot(
                         0.25f,
                         h_dirac_output_synthesis_state->diffuse_power_factor,
                         num_freq_bands );
#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
            }
#endif


            /*Direct gain*/
#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
            if ( hDirAC->hConfig->dec_param_estim == TRUE )
            {
#endif
                for ( ch_idx = 0; ch_idx < min( 4, nchan_transport ); ch_idx++ )
                {
                    int16_t k;
@@ -895,34 +799,7 @@ void ivas_dirac_dec_output_synthesis_process_slot(
                        }
                    }
                }
#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
            }
            else
            {
                for ( ch_idx = 0; ch_idx < min( 4, nchan_transport ); ch_idx++ )
                {
                    v_multc( h_dirac_output_synthesis_state->diffuse_power_factor, 4.0f, aux_buf, num_freq_bands );
                    v_mult( aux_buf,
                            aux_buf,
                            aux_buf,
                            num_freq_bands );
                    v_multc( aux_buf,
                             h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr - 1.f,
                             aux_buf,
                             num_freq_bands_diff );
                    v_multc( &aux_buf[num_freq_bands_diff],
                             h_dirac_output_synthesis_params->diffuse_compensation_factor - 1.f,
                             &aux_buf[num_freq_bands_diff],
                             num_freq_bands - num_freq_bands_diff );

                    for ( l = 0; l < num_freq_bands; l++ )
                    {
                        aux_buf[l] = 0.25f * sqrtf( 1.f + aux_buf[l] );
                    }
                    v_add( aux_buf, &h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands], &h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands], num_freq_bands );
                }
            }
#endif
            /*Directional gain (panning)*/
            for ( ch_idx = min( 4, nchan_transport ); ch_idx < num_channels_dir; ch_idx++ )
            {
@@ -956,18 +833,11 @@ void ivas_dirac_dec_output_synthesis_process_slot(
        else
        {
            /* compute reference and diffuse power factor for this frame */
#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
            if ( hDirAC->voip_active == 0 )
            {
#endif
                ivas_dirac_dec_compute_power_factors( num_freq_bands,
                                                      diffuseness,
                                                      h_dirac_output_synthesis_params->max_band_decorr,
                                                      h_dirac_output_synthesis_state->direct_power_factor,
                                                      h_dirac_output_synthesis_state->diffuse_power_factor );
#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
            }
#endif
        }
    }

@@ -987,11 +857,7 @@ void ivas_dirac_dec_output_synthesis_process_slot(
    }

    /* process other PSDs only slot wise for 4 transport channels */
#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
    if ( hDirAC->hConfig->dec_param_estim == TRUE || hDirAC->voip_active == 1 )
#else
    if ( hDirAC->hConfig->dec_param_estim == TRUE )
#endif
    {
        computeTargetPSDs_direct( num_channels_dir, num_freq_bands, h_dirac_output_synthesis_state->direct_power_factor, reference_power, h_dirac_output_synthesis_state->direct_responses, h_dirac_output_synthesis_state->direct_responses_square, h_dirac_output_synthesis_state->cy_auto_dir_smooth, h_dirac_output_synthesis_state->cy_cross_dir_smooth );

@@ -1130,11 +996,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd(
    }
    else
#endif
#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
        if ( hDirAC->voip_active == 0 && hDirAC->hConfig->dec_param_estim == FALSE )
#else
    if ( hDirAC->hConfig->dec_param_estim == FALSE )
#endif
    {
        /*Direct gain*/
        for ( ch_idx = 0; ch_idx < nchan_transport_foa; ch_idx++ )
@@ -1556,11 +1418,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls(
    /*-----------------------------------------------------------------*
     * compute target PSDs
     *-----------------------------------------------------------------*/
#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
    if ( hDirAC->hConfig->enc_param_start_band == 0 && hDirAC->voip_active == 0 )
#else
    if ( hDirAC->hConfig->enc_param_start_band == 0 )
#endif
    {
        diff_start_band = h_dirac_output_synthesis_params->use_onset_filters == 1 ? h_dirac_output_synthesis_params->max_band_decorr : 0;

@@ -1842,27 +1700,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls(
     *-----------------------------------------------------------------*/

    /* store estimates for next synthesis block */
#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
    if ( hDirAC->voip_active == 1 )
    {
        mvr2r( gains_dir, h_dirac_output_synthesis_state->gains_dir_prev, num_freq_bands * hDirAC->num_outputs_dir );
        mvr2r( gains_diff, h_dirac_output_synthesis_state->gains_diff_prev, num_freq_bands * hDirAC->num_outputs_dir );

        /* reset values */
        set_zero( h_dirac_output_synthesis_state->proto_power_smooth, num_freq_bands * hDirAC->num_outputs_dir );

        if ( h_dirac_output_synthesis_state->proto_power_diff_smooth != NULL )
        {
            set_zero( h_dirac_output_synthesis_state->proto_power_diff_smooth, h_dirac_output_synthesis_params->max_band_decorr * hDirAC->num_outputs_dir );
        }

        set_zero( h_dirac_output_synthesis_state->cy_auto_dir_smooth, num_freq_bands * hDirAC->num_outputs_dir );
        set_zero( h_dirac_output_synthesis_state->cy_cross_dir_smooth, num_freq_bands * hDirAC->num_outputs_dir );
        set_zero( h_dirac_output_synthesis_state->cy_auto_diff_smooth, num_freq_bands * hDirAC->num_outputs_dir );
    }
    else
    {
#endif
    mvr2r( gains_dir, h_dirac_output_synthesis_state->gains_dir_prev, num_freq_bands * nchan_out_woLFE );
    mvr2r( gains_diff, h_dirac_output_synthesis_state->gains_diff_prev, num_freq_bands * nchan_out_woLFE );

@@ -1877,9 +1714,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls(
    set_zero( h_dirac_output_synthesis_state->cy_auto_dir_smooth, num_freq_bands * nchan_out_woLFE );
    set_zero( h_dirac_output_synthesis_state->cy_cross_dir_smooth, num_freq_bands * nchan_out_woLFE );
    set_zero( h_dirac_output_synthesis_state->cy_auto_diff_smooth, num_freq_bands * nchan_out_woLFE );
#if defined( JBM_TSM_ON_TCS ) && !defined( MASA_PARAMBIN_SF_MAP )
    }
#endif

    pop_wmops();

    return;
+0 −27
Original line number Diff line number Diff line
@@ -1300,19 +1300,11 @@ ivas_error ivas_masa_dec_reconfigure(
 *-------------------------------------------------------------------*/
void ivas_spar_param_to_masa_param_mapping_sf(
    Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct               */
#ifdef MASA_PARAMBIN_SF_MAP
    int16_t azimuth[CLDFB_NO_CHANNELS_MAX],
    int16_t elevation[CLDFB_NO_CHANNELS_MAX],
    float energy_ratio1[CLDFB_NO_CHANNELS_MAX],
    float spreadCoherence[CLDFB_NO_CHANNELS_MAX],
    float surroundingCoherence[CLDFB_NO_CHANNELS_MAX],
#else
    int16_t azimuth[][CLDFB_NO_CHANNELS_MAX],
    int16_t elevation[][CLDFB_NO_CHANNELS_MAX],
    float energy_ratio1[][CLDFB_NO_CHANNELS_MAX],
    float spreadCoherence[][CLDFB_NO_CHANNELS_MAX],
    float surroundingCoherence[][CLDFB_NO_CHANNELS_MAX],
#endif
    float inRe[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i  : Input audio in CLDFB domain, real */
    float inIm[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]  /* i  : Input audio in CLDFB domain, imag */
)
@@ -1493,21 +1485,13 @@ void ivas_spar_param_to_masa_param_mapping_sf(
        ratio = I / fmaxf( 1e-12f, E );                                                                                   /* Energy ratio */
        ratio = fmaxf( 0.0f, fminf( 1.0f, ratio ) );

#ifdef MASA_PARAMBIN_SF_MAP
        azimuth[bin] = (int16_t) roundf( azi / PI_OVER_180 );
        elevation[bin] = (int16_t) roundf( ele / PI_OVER_180 );
        energy_ratio1[bin] = ratio;

        spreadCoherence[bin] = 0.0f;
        surroundingCoherence[bin] = 0.0f;
#else
        azimuth[0][bin] = (int16_t) roundf( azi / PI_OVER_180 );
        elevation[0][bin] = (int16_t) roundf( ele / PI_OVER_180 );
        energy_ratio1[0][bin] = ratio;

        spreadCoherence[0][bin] = 0.0f;
        surroundingCoherence[0][bin] = 0.0f;
#endif
        /* Determine directional distribution of the indirect audio based on the SPAR mixing matrices (and the transport audio signals when 2 TC) */
        if ( hDiffuseDist != NULL )
        {
@@ -1547,17 +1531,6 @@ void ivas_spar_param_to_masa_param_mapping_sf(
        }
    }

#ifndef MASA_PARAMBIN_SF_MAP
    for ( slot_idx = 1; slot_idx < hDirAC->subframe_nbslots[subframe_idx]; slot_idx++ )
    {
        mvs2s( azimuth[0], azimuth[slot_idx], nBins );
        mvs2s( elevation[0], elevation[slot_idx], nBins );
        mvr2r( spreadCoherence[0], spreadCoherence[slot_idx], nBins );
        mvr2r( surroundingCoherence[0], surroundingCoherence[slot_idx], nBins );
        mvr2r( energy_ratio1[0], energy_ratio1[slot_idx], nBins );
    }
#endif

    return;
}
#endif
Loading