Commit 9813762d authored by fotopoulou's avatar fotopoulou
Browse files

Merge branch...

Merge branch '2171_ref_avoid_rounding_when_passing_angular_information_to_efap_determine_gains' into 'ivas-float-update'

[non-BE] port MR 2288 from float

See merge request !2501
parents ad7ef6ce e0376bc9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -197,6 +197,7 @@
#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() */

// object-editing feature porting
#define FIX_HRTF_LOAD_API                               // solves API conflicts between HRTF and object-editing features
+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 ) );