Commit 1c41671d authored by multrus's avatar multrus
Browse files

[cleanup] accept NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX

parent 96d8c66f
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -161,7 +161,6 @@
/* all switches in this category should start with "NONBE_" */

#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES             /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */
#define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX      /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/
#define NONBE_FIX_977_OSBA_GAIN_MISMATCH                      /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */
#define NONBE_FIX_973_HODIRAC_BAND_GROUPING                   /* FhG: issue 973: empty parameter band in DirAC */
#define NONBE_FIX_951_MCMASA_5MS_RENDERING                    /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */
+0 −32
Original line number Diff line number Diff line
@@ -154,12 +154,9 @@ void ivas_ism_render_sf(
    float gain, prev_gain;
    float tc_local[MAX_NUM_OBJECTS][L_FRAME48k];
    float *p_tc[MAX_NUM_OBJECTS];
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
    int16_t ism_md_subframe_update_jbm, slots_to_render, first_sf, last_sf, subframe_idx;
    int16_t n_samples_rendered_loop;
#endif

#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
    /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */
    slots_to_render = min( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered, n_samples_to_render / st_ivas->hTcBuffer->n_samples_granularity );
    first_sf = st_ivas->hTcBuffer->subframes_rendered;
@@ -171,7 +168,6 @@ void ivas_ism_render_sf(
        slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf];
        last_sf++;
    }
#endif

    num_objects = st_ivas->nchan_transport;
    if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
@@ -184,7 +180,6 @@ void ivas_ism_render_sf(
    tc_offset = st_ivas->hTcBuffer->n_samples_rendered;
    interp_offset = st_ivas->hTcBuffer->n_samples_rendered;

#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
    /* Number of subframes to delay metadata to sync with audio */
    if ( st_ivas->hDecoderConfig->Opt_delay_comp )
    {
@@ -194,7 +189,6 @@ void ivas_ism_render_sf(
    {
        ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2;
    }
#endif

    if ( st_ivas->hDecoderConfig->Opt_tsm )
    {
@@ -217,21 +211,15 @@ void ivas_ism_render_sf(
        set_f( output_f[i], 0.0f, n_samples_to_render );
    }

#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
    for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ )
    {
        int16_t n_samples_in_subframe;

        n_samples_in_subframe = st_ivas->hTcBuffer->n_samples_granularity * st_ivas->hTcBuffer->subframe_nbslots[subframe_idx];
#endif

        if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 )
        {
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
            ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_in_subframe, n_samples_in_subframe, st_ivas->hIsmRendererData->interpolator );
#else
        ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator );
#endif
            interp_offset = 0;
        }

@@ -240,7 +228,6 @@ void ivas_ism_render_sf(
            /* Combined rotation: rotate the object positions depending the head and external orientations */
            if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 )
            {
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
                if ( subframe_idx >= ism_md_subframe_update_jbm )
                {
                    rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup );
@@ -249,9 +236,6 @@ void ivas_ism_render_sf(
                {
                    rotateAziEle( st_ivas->hIsmMetaData[i]->last_azimuth, st_ivas->hIsmMetaData[i]->last_elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup );
                }
#else
            rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup );
#endif
                if ( st_ivas->hEFAPdata != NULL )
                {
                    efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP );
@@ -272,18 +256,10 @@ void ivas_ism_render_sf(
                {
                    g1 = &st_ivas->hIsmRendererData->interpolator[interp_offset];
                    tc = p_tc[i];
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
                    for ( k = 0; k < n_samples_in_subframe; k++ )
#else
                for ( k = 0; k < n_samples_to_render; k++ )
#endif
                    {
                        g2 = 1.0f - *g1;
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
                        output_f[j2][k + n_samples_rendered_loop] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ );
#else
                    output_f[j2][k] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ );
#endif
                    }
                }

@@ -293,19 +269,12 @@ void ivas_ism_render_sf(
                    st_ivas->hIsmRendererData->prev_gains[i][j] = gain;
                }
            }
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
            p_tc[i] += n_samples_in_subframe;
#endif
        }

        /* update combined orientation access index */
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
        ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_in_subframe );
#else
    ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_to_render );
#endif

#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
        n_samples_rendered_loop += n_samples_in_subframe;
        if ( st_ivas->renderer_type == RENDERER_TD_PANNING )
        {
@@ -315,7 +284,6 @@ void ivas_ism_render_sf(
        tc_offset += n_samples_in_subframe;
        interp_offset += n_samples_in_subframe;
    }
#endif

    return;
}