Commit 4a48efe9 authored by bayers's avatar bayers
Browse files

small fixes for HO-DirAC, still not BE

parent c14f98a3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3850,6 +3850,9 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd(
    const float *onset_filter 
#ifdef HODIRAC                                                      
    ,
#ifdef JBM_TSM_ON_TCS
    const int16_t md_idx,
#endif
    const int16_t hodirac                                       /* i: flag for sector-based processing */
#endif
);
+3 −0
Original line number Diff line number Diff line
@@ -3626,6 +3626,9 @@ void ivas_dirac_dec_render_sf(
                                                                   p_onset_filter
#ifdef HODIRAC
                                                                   ,
#ifdef JBM_TSM_ON_TCS
                                                                   md_idx,
#endif
                                                                   st_ivas->sba_analysis_order > 1 && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_256k
#endif
        );
+42 −7
Original line number Diff line number Diff line
@@ -598,7 +598,7 @@ void ivas_dirac_dec_output_synthesis_process_slot(
    const int16_t nchan_transport      /* i  : number of transport channels*/
#if !defined( HODIRAC ) || defined( JBM_TSM_ON_TCS )
    ,
    const int16_t index_slot
    const int16_t md_idx
#endif
#ifdef HODIRAC
    ,
@@ -655,7 +655,7 @@ void ivas_dirac_dec_output_synthesis_process_slot(
#ifdef JBM_TSM_ON_TCS
                                                      azimuth,
                                                      elevation,
                                                      index_slot,
                                                      md_idx,
#endif
                                                      NULL,
                                                      2,
@@ -666,6 +666,25 @@ void ivas_dirac_dec_output_synthesis_process_slot(
    {
        if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD )
        {
#ifdef JBM_TSM_ON_TCS
            v_multc( hDirAC->energy_ratio1[md_idx], -1.f, aux_buf, num_freq_bands );
            v_addc( aux_buf, 1.f, aux_buf, num_freq_bands );
            mvr2r( hDirAC->energy_ratio1[md_idx],
                   h_dirac_output_synthesis_state->direct_power_factor,
                   num_freq_bands );
            mvr2r( aux_buf,
                   h_dirac_output_synthesis_state->diffuse_power_factor,
                   num_freq_bands );

            v_multc( hDirAC->energy_ratio2[md_idx], -1.f, aux_buf, num_freq_bands );
            v_addc( aux_buf, 1.f, aux_buf, num_freq_bands );
            mvr2r( hDirAC->energy_ratio2[md_idx],
                   &h_dirac_output_synthesis_state->direct_power_factor[hDirAC->num_freq_bands],
                   num_freq_bands );
            mvr2r( aux_buf,
                   &h_dirac_output_synthesis_state->diffuse_power_factor[hDirAC->num_freq_bands],
                   num_freq_bands );
#else
            v_multc( hDirAC->energy_ratio1[hDirAC->dirac_read_idx], -1.f, aux_buf, num_freq_bands );
            v_addc( aux_buf, 1.f, aux_buf, num_freq_bands );
            mvr2r( hDirAC->energy_ratio1[hDirAC->dirac_read_idx],
@@ -683,14 +702,23 @@ void ivas_dirac_dec_output_synthesis_process_slot(
            mvr2r( aux_buf,
                   &h_dirac_output_synthesis_state->diffuse_power_factor[hDirAC->num_freq_bands],
                   num_freq_bands );
#endif
        }
        else
        {
#ifdef JBM_TSM_ON_TCS
            ivas_dirac_dec_compute_gain_factors( num_freq_bands,
                                                 hDirAC->diffuseness_vector[md_idx],
                                                 h_dirac_output_synthesis_params->max_band_decorr,
                                                 h_dirac_output_synthesis_state->direct_power_factor,
                                                 h_dirac_output_synthesis_state->diffuse_power_factor );
#else
            ivas_dirac_dec_compute_gain_factors( num_freq_bands,
                                                 hDirAC->diffuseness_vector[hDirAC->dirac_read_idx],
                                                 h_dirac_output_synthesis_params->max_band_decorr,
                                                 h_dirac_output_synthesis_state->direct_power_factor,
                                                 h_dirac_output_synthesis_state->diffuse_power_factor );
#endif
        }
    }
    else // ( hDirAC->hConfig->dec_param_estim == TRUE )
@@ -724,7 +752,7 @@ void ivas_dirac_dec_output_synthesis_process_slot(
                {
                    for ( i = 0; i < hDirAC->num_freq_bands; i++ )
                    {
                        surCohRatio[i] = hDirAC->surroundingCoherence[index_slot][i];
                        surCohRatio[i] = hDirAC->surroundingCoherence[md_idx][i];
                    }
                }
                else
@@ -749,7 +777,7 @@ void ivas_dirac_dec_output_synthesis_process_slot(
                    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[index_slot][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;

@@ -773,7 +801,7 @@ void ivas_dirac_dec_output_synthesis_process_slot(
#endif
                                                      azimuth,
                                                      elevation,
                                                      index_slot,
                                                      md_idx,
#ifdef MASA_PARAMBIN_SF_MAP
                                                      NULL,
#else
@@ -991,6 +1019,9 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd(
    const float *onset_filter
#ifdef HODIRAC
    ,
#ifdef JBM_TSM_ON_TCS
    const int16_t md_idx,
#endif
    const int16_t hodirac /* i: flag for sector-based processing */
#endif
)
@@ -1032,7 +1063,11 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd(
    nchan_transport_foa = min( 4, nchan_transport );

#ifdef HODIRAC
#ifdef JBM_TSM_ON_TCS
    diffuseness = hDirAC->diffuseness_vector[md_idx];
#else
    diffuseness = hDirAC->diffuseness_vector[hDirAC->dirac_read_idx];
#endif
#endif

    /*-----------------------------------------------------------------*
+22 −1
Original line number Diff line number Diff line
@@ -1227,7 +1227,7 @@ void ivas_spar_dec_set_render_params(
    ivas_spar_dec_gen_umx_mat( hSpar->hMdDec, nchan_transport, num_bands_out, st_ivas->bfi
#ifdef SPAR_TUNING
                               ,
                               MAX_PARAM_SPATIAL_SUBFRAMES
                               ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate )
#endif
    );

@@ -1350,10 +1350,31 @@ void ivas_spar_dec_upmixer(
    if ( hSpar->hMdDec->td_decorr_flag )
    {
        ivas_td_decorr_process( hSpar->hTdDecorr, st_ivas->hTcBuffer->tc, pPcm_tmp, output_frame );
#ifdef SPAR_TUNING
        if ( hSpar->hTdDecorr->num_apd_outputs >= ( nchan_internal - nchan_transport ) )
        {
            for ( i = 0; i < nchan_internal - nchan_transport; i++ )
            {
                mvr2r( pPcm_tmp[hSpar->hTdDecorr->num_apd_outputs - 1 - i], st_ivas->hTcBuffer->tc[nchan_internal - 1 - i], output_frame );
            }
        }
        else
        {
            for ( i = 0; i < nchan_internal - nchan_transport; i++ )
            {
                set_zero( st_ivas->hTcBuffer->tc[nchan_internal - 1 - i], output_frame );
            }
            for ( i = 0; i < hSpar->hTdDecorr->num_apd_outputs; i++ )
            {
                mvr2r( pPcm_tmp[hSpar->hTdDecorr->num_apd_outputs - 1 - i], st_ivas->hTcBuffer->tc[nchan_internal - 1 - i], output_frame );
            }
        }
#else
        for ( i = 0; i < nchan_internal - nchan_transport; i++ )
        {
            mvr2r( pPcm_tmp[hSpar->hTdDecorr->num_apd_outputs - 1 - i], st_ivas->hTcBuffer->tc[nchan_internal - 1 - i], output_frame );
        }
#endif
    }