Commit 99cb359a authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[cleanup] accept NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX

parent a3fa5fa4
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -95,7 +95,6 @@
#define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM   /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */
#define FIX_963_USAN_ERROR                              /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */

#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_973_HODIRAC_BAND_GROUPING                   /* FhG: issue 973: empty parameter band in DirAC */

//#define USE_NEW_HRTF_BINARY_FILE_FORMAT                 /* Orange: to activate when decided to change the hrtf binary file format */
+0 −30
Original line number Diff line number Diff line
@@ -171,7 +171,6 @@ void ivas_ism_render_sf_fx(
    Word32 gain_fx, prev_gain_fx;
    Word32 tc_local_fx[MAX_NUM_OBJECTS][L_FRAME48k];
    Word32 *p_tc_fx[MAX_NUM_OBJECTS];
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
    Word16 ism_md_subframe_update_jbm, slots_to_render, first_sf, last_sf, subframe_idx;
    Word16 n_samples_rendered_loop;

@@ -189,7 +188,6 @@ void ivas_ism_render_sf_fx(
        slots_to_render = sub( slots_to_render, st_ivas->hTcBuffer->subframe_nbslots[last_sf] );
        last_sf = add( last_sf, 1 );
    }
#endif

    num_objects = st_ivas->nchan_transport;
    move16();
@@ -207,7 +205,6 @@ void ivas_ism_render_sf_fx(
    interp_offset = st_ivas->hTcBuffer->n_samples_rendered;
    move16();

#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 )
    {
@@ -217,7 +214,6 @@ void ivas_ism_render_sf_fx(
    {
        ism_md_subframe_update_jbm = sub( st_ivas->hTcBuffer->nb_subframes, 2 );
    }
#endif

    IF( st_ivas->hDecoderConfig->Opt_tsm )
    {
@@ -241,21 +237,15 @@ void ivas_ism_render_sf_fx(
    }


#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
        test();
        IF( st_ivas->hCombinedOrientationData && EQ_16( 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_fx( n_samples_in_subframe, n_samples_in_subframe, st_ivas->hIsmRendererData->interpolator_fx );
#else
        ivas_jbm_dec_get_adapted_linear_interpolator_fx( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator_fx );
#endif
            interp_offset = 0;
            move16();
        }
@@ -266,7 +256,6 @@ void ivas_ism_render_sf_fx(
            test();
            IF( st_ivas->hCombinedOrientationData != NULL && EQ_16( st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx], 1 ) )
            {
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
                if ( GE_16( subframe_idx, ism_md_subframe_update_jbm ) )
                {
                    rotateAziEle_fx( extract_l( L_shr( st_ivas->hIsmMetaData[i]->azimuth_fx, 22 ) ), extract_l( L_shr( st_ivas->hIsmMetaData[i]->elevation_fx, 22 ) ), &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat_fx[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup );
@@ -275,9 +264,6 @@ void ivas_ism_render_sf_fx(
                {
                    rotateAziEle_fx( extract_l( L_shr( st_ivas->hIsmMetaData[i]->last_azimuth_fx, 22 ) ), extract_l( L_shr( st_ivas->hIsmMetaData[i]->last_elevation_fx, 22 ) ), &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat_fx[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup );
                }
#else
            rotateAziEle_fx( extract_l( L_shr( st_ivas->hIsmMetaData[i]->azimuth_fx, 22 ) ), extract_l( L_shr( st_ivas->hIsmMetaData[i]->elevation_fx, 22 ) ), &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat_fx[0], st_ivas->hIntSetup.is_planar_setup );
#endif

                IF( st_ivas->hEFAPdata != NULL )
                {
@@ -313,18 +299,10 @@ void ivas_ism_render_sf_fx(
                {
                    g1_fx = &st_ivas->hIsmRendererData->interpolator_fx[interp_offset];
                    tc_fx = p_tc_fx[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_fx = sub( 32767, *g1_fx ); // 32767 = (1.0f in Q15) - 1
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
                        output_fx[j2][k + n_samples_rendered_loop] = L_add( output_fx[j2][k + n_samples_rendered_loop], L_shl( Mpy_32_32( L_add( Mpy_32_16_1( gain_fx, *( g1_fx++ ) ), Mpy_32_16_1( prev_gain_fx, g2_fx ) ), *( tc_fx++ ) ), 1 ) ); // Q11( (30+15+1-16) + 11 -31 +1)
#else
                    output_fx[j2][k] = L_add( output_fx[j2][k], L_shl( Mpy_32_32( L_add( Mpy_32_16_1( gain_fx, *( g1_fx++ ) ), Mpy_32_16_1( prev_gain_fx, g2_fx ) ), *( tc_fx++ ) ), 1 ) ); // Q11( (30+15+1-16) + 11 -31 +1)
#endif
                        move16();
                    }
                }
@@ -337,19 +315,12 @@ void ivas_ism_render_sf_fx(
                    move32();
                }
            }
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
            p_tc_fx[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 = add( n_samples_rendered_loop, n_samples_in_subframe );
        IF( EQ_16( st_ivas->renderer_type, RENDERER_TD_PANNING ) )
        {
@@ -359,7 +330,6 @@ void ivas_ism_render_sf_fx(
        tc_offset = add( tc_offset, n_samples_in_subframe );
        interp_offset = add( interp_offset, n_samples_in_subframe );
    }
#endif

    return;
}