Commit 3890d839 authored by vaclav's avatar vaclav
Browse files

Merge remote-tracking branch 'remotes/origin/ivas-float-update' into...

Merge remote-tracking branch 'remotes/origin/ivas-float-update' into 2054-ref-mr2140-from-float-keep-tsm-memory-in-jbm-bitrate-switching-2
parents 000ab0f2 35d3db79
Loading
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -275,8 +275,14 @@ void edxt(
            {
                for ( k = Nm1 >> 1; k > 0; k-- )
                {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                    volatile float angle_tmp = scale * k;
                    const float wRe = cosf( angle_tmp );
                    const float wIm = sinf( angle_tmp );
#else
                    const float wRe = cosf( scale * k );
                    const float wIm = sinf( scale * k );
#endif

                    y[k] /*pt 1*/ = wRe * re[k] + wIm * im[k];
                    y[length - k] = wIm * re[k] - wRe * im[k];
@@ -287,8 +293,14 @@ void edxt(
            {
                for ( k = Nm1 >> 1; k > 0; k-- )
                {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                    volatile float angle_tmp = scale * k;
                    const float wRe = cosf( angle_tmp );
                    const float wIm = sinf( angle_tmp );
#else
                    const float wRe = cosf( scale * k );
                    const float wIm = sinf( scale * k );
#endif

                    y[Nm1 - k] = wRe * re[k] + wIm * im[k];
                    y[k - 1] = wIm * re[k] - wRe * im[k];
@@ -304,8 +316,14 @@ void edxt(
            {
                for ( k = Nm1 >> 1; k > 0; k-- )
                {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                    volatile float angle_tmp = scale * k;
                    const float wRe = cosf( angle_tmp ) * 0.5f;
                    const float wIm = sinf( angle_tmp ) * 0.5f;
#else
                    const float wRe = cosf( scale * k ) * 0.5f;
                    const float wIm = sinf( scale * k ) * 0.5f;
#endif

                    re[k] = wRe * x[k] + wIm * x[length - k];
                    im[k] = wRe * x[length - k] - wIm * x[k];
@@ -316,8 +334,14 @@ void edxt(
            {
                for ( k = Nm1 >> 1; k > 0; k-- )
                {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                    volatile float angle_tmp = scale * k;
                    const float wRe = cosf( angle_tmp ) * 0.5f;
                    const float wIm = sinf( angle_tmp ) * 0.5f;
#else
                    const float wRe = cosf( scale * k ) * 0.5f;
                    const float wIm = sinf( scale * k ) * 0.5f;
#endif

                    re[k] = wRe * x[Nm1 - k] + wIm * x[k - 1];
                    im[k] = wRe * x[k - 1] - wIm * x[Nm1 - k];
+5 −0
Original line number Diff line number Diff line
@@ -196,6 +196,10 @@
#define FIX_1383_HEAD_TRACK_SANITIZER                   /* Nok: issue 1383: Fix head tracking struc values reading in renderer */
#define FIX_1411_IGF_CRASH_BW_SWITCHING                 /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/
#define NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG       /* FhG: Fix MDCT-Stereo comfort noise for certain noise types */
#define NONBE_1344_REND_MASA_LOW_FS                     /* Nokia: Issue 1344: Fix sanitizer errors when using IVAS_rend to render MASA with lower sampling rates */
#define NONBE_1412_AVOID_ROUNDING_AZ_ELEV              /* FhG:  Avoid rounding when passing azimuth and elevation to efap_determine_gains() */
#define NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS    /* FhG: fix non-BE in DFT stereo encoder between optimization levels */
#define NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2  /* FhG: fix even more non-BEnesses */

// object-editing feature porting
#define FIX_HRTF_LOAD_API                               // solves API conflicts between HRTF and object-editing features
@@ -203,6 +207,7 @@
#define TMP_FIX_OMASA_SR_BE                             // temporary fix to keep OMASA split-rendering BE
#define FIX_1372_OSBA_OBJECT_EDITING                    /* VA: issue 1372: Fix OSBA object-editing in BINAURAL_ROOM_IR */
#define NONBE_FIX_1172_OBJ_EDIT_JBM                     /* VA: issue 1172: fix OMASA object editing in JBM */
#define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES             /* Nokia: Fix for issues 1399: obj edit broken with MC/SBA output in VOIP, and 1400: negative energy estimate used for gaining. */

/* #################### End BASOP porting switches ############################ */

+23 −0
Original line number Diff line number Diff line
@@ -709,7 +709,9 @@ void ivas_ism_dec_digest_tc(
         ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->hDecoderConfig->Opt_Headrotation == 0 ) )
    {
        int16_t i;
#ifndef NONBE_1412_AVOID_ROUNDING_AZ_ELEV
        int16_t azimuth, elevation;
#endif

        /* we have a full frame interpolator, adapt it */
        /* for BE testing */
@@ -753,24 +755,38 @@ void ivas_ism_dec_digest_tc(
            }
            else
            {
#ifndef NONBE_1412_AVOID_ROUNDING_AZ_ELEV
                // TODO tmu review when #215 is resolved
                azimuth = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_azimuth + 0.5f );
                elevation = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_elevation + 0.5f );
#endif

                if ( ( st_ivas->renderer_type == RENDERER_TD_PANNING ||
                       st_ivas->renderer_type == RENDERER_OSBA_LS ||
                       st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) ) &&
                     st_ivas->hCombinedOrientationData == NULL )
                {
#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV
                    float elevation = st_ivas->hIsmMetaData[i]->edited_elevation;
#endif
                    if ( st_ivas->hIntSetup.is_planar_setup )
                    {
                        /* If no elevation support in output format, then rendering should be done with zero elevation */
#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV
                        elevation = 0.f;
#else
                        elevation = 0;
#endif
                    }

                    if ( st_ivas->hEFAPdata != NULL )
                    {

#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV
                        efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmMetaData[i]->edited_azimuth, elevation, EFAP_MODE_EFAP );
#else
                        efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP );
#endif
                        v_multc( st_ivas->hIsmRendererData->gains[i],
                                 st_ivas->hIsmMetaData[i]->edited_gain, st_ivas->hIsmRendererData->gains[i], st_ivas->hEFAPdata->numSpk );
                    }
@@ -779,6 +795,13 @@ void ivas_ism_dec_digest_tc(
                          st_ivas->renderer_type == RENDERER_OSBA_AMBI ||
                          st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
                {
#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV
                    // TODO tmu review when #215 is resolved
                    int16_t azimuth, elevation;

                    azimuth = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_azimuth + 0.5f );
                    elevation = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_elevation + 0.5f );
#endif
                    /*get HOA gets for direction (ACN/SN3D)*/
                    ivas_dirac_dec_get_response( azimuth, elevation, st_ivas->hIsmRendererData->gains[i], st_ivas->hIntSetup.ambisonics_order );
                    v_multc( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmMetaData[i]->edited_gain, st_ivas->hIsmRendererData->gains[i], ivas_sba_get_nchan( st_ivas->hIntSetup.ambisonics_order, 0 ) );
+15 −0
Original line number Diff line number Diff line
@@ -3178,6 +3178,21 @@ void ivas_dec_prepare_renderer(
                {
                    nchan_transport_ism = st_ivas->nchan_ism;
                }

#ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES
                if ( st_ivas->hDecoderConfig->Opt_tsm && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_DIRAC )
                {
                    /* Gain MASA part, if edited */
                    if ( st_ivas->hMasaIsmData->masa_gain_is_edited )
                    {
                        for ( n = 0; n < CPE_CHANNELS; n++ )
                        {
                            v_multc( st_ivas->hTcBuffer->tc[n], st_ivas->hMasaIsmData->gain_masa_edited, st_ivas->hTcBuffer->tc[n], st_ivas->hTcBuffer->n_samples_available );
                        }
                    }
                }
#endif

                for ( n = 0; n < nchan_transport_ism; n++ )
                {
                    if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC )
+13 −5
Original line number Diff line number Diff line
@@ -696,10 +696,14 @@ void ivas_omasa_dirac_rend_jbm(
        {
            mvr2r( &output_f[CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[0], *nSamplesRendered );

#ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES
            if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ )
#else
#ifdef FIX_1330_JBM_MEMORY
        if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ )
#else
        if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ )
#endif
#endif
            {
                /* Gain separated object, if edited */
@@ -719,26 +723,30 @@ void ivas_omasa_dirac_rend_jbm(
                mvr2r( &output_f[n + CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[n], *nSamplesRendered );

                /* Gain discrete objects, if edited */
#ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES
                if ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] )
#else
#ifdef FIX_1330_JBM_MEMORY
            if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->ism_gain_is_edited[n] )
#else
            if ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] )
#endif
#endif
                {
                    v_multc( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited[n], data_separated_objects[n], *nSamplesRendered );
                }
            }

            /* Gain MASA part, if edited */
            /* Gain MASA part, if edited in G192. MASA gaining with VOIP is done in ivas_dec_prepare_renderer() */
#ifdef FIX_1330_JBM_MEMORY
            if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->masa_gain_is_edited )
#else
        if ( st_ivas->hMasaIsmData->masa_gain_is_edited )
#endif
            {
                for ( int16_t ch = 0; ch < 2; ch++ )
                for ( n = 0; n < CPE_CHANNELS; n++ )
                {
                    v_multc( output_f[ch], st_ivas->hMasaIsmData->gain_masa_edited, output_f[ch], *nSamplesRendered );
                    v_multc( output_f[n], st_ivas->hMasaIsmData->gain_masa_edited, output_f[n], *nSamplesRendered );
                }
            }
        }
Loading