Commit 6568718f authored by bayers's avatar bayers
Browse files

Fixed most BE problems

parent c4a5465f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@
/*#define TDREND_HRTF_TABLE_METHODS*/           /* Enable HRTF lookup from tables, for testing & evaluation. Supply file in table format to use. Note that a suitable HR filter lookup method should be written if the filters sample point grids are not in the formats. */
/*#define TDREND_STANDALONE*/                   /* Used when renderer is built in standalone form, without IVAS encoding/decoding (see scripts/object_renderer_standalone). This is just here to ensure this is cleaned out by prepare_instrumentation.sh */

#define DEBUG_SBA                               /* debug DIRAC/SPAR in-out */
/*#define DEBUG_SBA*/                           /* debug DIRAC/SPAR in-out */
#ifdef DEBUG_SBA
/*#define DEBUG_SBA_AUDIO_DUMP */               /* SBA intermediate audio wav file dumping */
/*#define DEBUG_SBA_MD_DUMP*/                   /* SBA metadata and variable file dumping */
@@ -156,7 +156,7 @@
#ifdef JBM_TSM_ON_TCS
#define TEST_BIN_RENDERER_BE
#define TMP_FIX_ISM_BR_SWITCHING                        /* */
/*#define JBM_DIRAC_DEBUG_BE*/
#define JBM_DIRAC_DEBUG_BE
#endif
/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+12 −36
Original line number Diff line number Diff line
@@ -1934,7 +1934,9 @@ void ivas_qmetadata_to_dirac(
                        {
                            hDirAC->elevation[tmp_write_idx_band][b] = 0;
                            hDirAC->azimuth[tmp_write_idx_band][b] = 0;
#if 0
                            hDirAC->diffuseness_vector[tmp_write_idx_band][b] = 0.f;
#endif
                            hDirAC->spreadCoherence[tmp_write_idx_band][b] = 0.0f;
                            hDirAC->surroundingCoherence[tmp_write_idx_band][b] = 0.0f;
                            hDirAC->energy_ratio1[tmp_write_idx_band][b] = 0;
@@ -2557,39 +2559,16 @@ void ivas_dirac_dec_render_sf(
#endif
                }
            }

            if ( st_ivas->hDecoderConfig->Opt_Headrotation && st_ivas->hHeadTrackData->shd_rot_max_order == 1 )
            {
                ivas_dirac_dec_compute_directional_responses( hDirAC,
                                                              st_ivas->hVBAPdata,
                                                              st_ivas->hMasa,
                                                              surCohRatio,
                                                              st_ivas->hHeadTrackData->shd_rot_max_order,
                                                              p_Rmat );
        }
            else
            {
                ivas_dirac_dec_compute_directional_responses( hDirAC,
                                                              st_ivas->hVBAPdata,
                                                              st_ivas->hMasa,
                                                              surCohRatio,
                                                              0,
                                                              0 );
            }
        }

        if ( st_ivas->hDecoderConfig->Opt_Headrotation && st_ivas->hHeadTrackData->shd_rot_max_order == 1 )
        {
            ivas_dirac_dec_compute_directional_responses( hDirAC,
                                                          st_ivas->hVBAPdata,
                                                          st_ivas->hMasa,
#ifdef JBM_TSM_ON_TCS
                                                          azimuth[0],
                                                          elevation[0],
                                                          hDirAC->azimuth[md_idx],
                                                          hDirAC->elevation[md_idx],
                                                          md_idx,
#else
                                                          subframe_idx,
                                                          subframe_idx,
#endif
                                                          surCohRatio,
                                                          st_ivas->hHeadTrackData->shd_rot_max_order,
@@ -2601,12 +2580,9 @@ void ivas_dirac_dec_render_sf(
                                                          st_ivas->hVBAPdata,
                                                          st_ivas->hMasa,
#ifdef JBM_TSM_ON_TCS
                                                          azimuth[0],
                                                          elevation[0],
                                                          hDirAC->azimuth[md_idx],
                                                          hDirAC->elevation[md_idx],
                                                          md_idx,
#else
                                                          subframe_idx,
                                                          subframe_idx,
#endif
                                                          surCohRatio,
                                                          0,
@@ -2986,7 +2962,7 @@ void ivas_dirac_dec_render_sf(
                                                              hDirAC,
                                                              st_ivas->hMasa,
                                                              0,
                                                              p_Rmat,
                                                              0,
                                                              st_ivas->hVBAPdata,
                                                              hDirAC->hOutSetup,
                                                              nchan_transport,
@@ -3039,7 +3015,7 @@ void ivas_dirac_dec_render_sf(
            qualityBasedSmFactor *= qualityBasedSmFactor;
        }
#ifdef JBM_TSM_ON_TCS
        /* Workaround for BE */
        /* Workaround for BE (should be gone when #393 is adressed) */
        if ( hDirAC->hConfig->dec_param_estim == 1 )
        {
            num_freq_bands = hDirAC->band_grouping[hDirAC->hConfig->enc_param_start_band];
@@ -3056,11 +3032,11 @@ void ivas_dirac_dec_render_sf(
            /* we are at the end, get the next one using the normal dirac read idx...*/
            if ( st_ivas->hDirAC->hConfig->dec_param_estim == 1 )
            {
                diff_md_idx = ( hDirAC->dirac_read_idx + DEFAULT_JBM_CLDFB_TIMESLOTS + 1 ) % hDirAC->dirac_md_buffer_length;
                diff_md_idx = ( hDirAC->dirac_read_idx + DEFAULT_JBM_CLDFB_TIMESLOTS ) % hDirAC->dirac_md_buffer_length;
            }
            else
            {
                diff_md_idx = ( hDirAC->dirac_read_idx + DEFAULT_JBM_SUBFRAMES_5MS + 1 ) % hDirAC->dirac_md_buffer_length;
                diff_md_idx = ( hDirAC->dirac_read_idx + DEFAULT_JBM_SUBFRAMES_5MS ) % hDirAC->dirac_md_buffer_length;
            }
        }
        else
+11 −3
Original line number Diff line number Diff line
@@ -846,7 +846,11 @@ 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( JBM_DIRAC_DEBUG_BE )
#if defined( JBM_DIRAC_DEBUG_BE )
    if ( hDirAC->hConfig->dec_param_estim == TRUE || hDirAC->voip_active == 1)
#else
    if ( hDirAC->hConfig->dec_param_estim == TRUE )
#endif
#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 );
@@ -1165,7 +1169,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls(
    float qualityBasedSmFactor )
{
    int16_t buf_idx, num_freq_bands;
#ifndef JBM_TSM_ON_TCS
#if !defined( JBM_TSM_ON_TCS ) || defined( JBM_DIRAC_DEBUG_BE )
    int16_t diff_start_band;
#endif
    int16_t k, l;
@@ -1188,7 +1192,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls(
    float subtract_target_ratio;
    float subtract_target_ratio_db;
    float a, b;
#ifndef JBM_TSM_ON_TCS
#if !defined( JBM_TSM_ON_TCS ) || defined( JBM_DIRAC_DEBUG_BE )
    uint16_t nchan_target_psds;
#endif
    float alpha[CLDFB_NO_CHANNELS_MAX];
@@ -1211,8 +1215,12 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls(
    /*-----------------------------------------------------------------*
     * compute target PSDs
     *-----------------------------------------------------------------*/
#ifndef JBM_TSM_ON_TCS
#if !defined( JBM_TSM_ON_TCS ) || defined( JBM_DIRAC_DEBUG_BE )
#ifdef JBM_DIRAC_DEBUG_BE
    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;

+6 −1
Original line number Diff line number Diff line
@@ -1469,7 +1469,12 @@ void ivas_param_mc_dec_digest_tc(
    hParamMC->slots_rendered = 0;
    hParamMC->subframes_rendered = 0;
    ivas_jbm_dec_get_adapted_subframes( nCldfbSlots, hParamMC->subframe_nbslots, &hParamMC->nb_subframes );

    /* BE Workaround */
    if ( !st_ivas->bfi && st_ivas->hDecoderConfig->voip_active == 0 )
    {
        ivas_param_mc_dec_compute_interpolator( hParamMC->hMetadataPMC->bAttackPresent, hParamMC->hMetadataPMC->attackIndex, nCldfbSlots, hParamMC->h_output_synthesis_params.interpolator );
    }

    for ( param_band_idx = 0; param_band_idx < PARAM_MC_MAX_PARAMETER_BANDS; param_band_idx++ )
    {
+17 −10
Original line number Diff line number Diff line
@@ -430,13 +430,17 @@ void ivas_sba_upmixer_renderer(
)
{

    int16_t i, nchan_internal;
    int16_t nchan_internal;
#ifndef JBM_TSM_ON_TCS
    int16_t i;
    float temp;
#endif

    push_wmops( "ivas_sba_upmixer_renderer" );

    nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order );

#ifndef JBM_TSM_ON_TCS
    if ( st_ivas->nchan_transport >= 3 )
    {
        /*convert WYZX downmix to WYXZ*/
@@ -447,10 +451,13 @@ void ivas_sba_upmixer_renderer(
            output[3][i] = temp;
        }
    }
#endif

    /* Upmixer + Renderer */
    ivas_spar_dec_upmixer( st_ivas, output, nchan_internal, output_frame );

    if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC )
    {
#ifdef JBM_TSM_ON_TCS
        float *output_f[MAX_OUTPUT_CHANNELS];
        int16_t ch;
@@ -462,7 +469,7 @@ void ivas_sba_upmixer_renderer(
#else
        ivas_sba_linear_renderer( output, output_frame, st_ivas->hIntSetup.nchan_out_woLFE, st_ivas->hDecoderConfig->output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx );
#endif

    }
    pop_wmops();

    return;