Commit d4d62a39 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[fix] float issue 1521: SBA loudness for binaural and stereo

parent e62955eb
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -172,6 +172,8 @@
/* any switch which is non-be wrt. TS 26.258 V3.0 */

#define USE_RTPDUMP                                     /* FhG: RTPDUMP format (rtptools standard) instead of custom format */
#define FIX_1521_SBA_LOUDNESS_STEREO                    /* FhG: issue 1521: Fix loudness for SBA to stereo rendering */
#define FIX_1521_SBA_LOUDNESS_BINAURAL                  /* FhG: issue 1521: Fix loudness for SBA to binaural rendering */
#define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API            /* Expose Payload Type setting in RTP Header */
#define FIX_BASOP_2023_TDREND_DISTATT_PRECISION         /* Eri: Basop issue 2023: Distance attenuation scaling, synch with BASOP updates and adding clamping of distance att input and listener position  */
#define FIX_1574_EFAP_CODE_LINT                         /* FhG: issue 1574: Code quality fixes in ivas_efap.c */
+11 −0
Original line number Diff line number Diff line
@@ -341,6 +341,17 @@ ivas_error ivas_dec_render(
                return error;
            }
        }
#ifdef FIX_1521_SBA_LOUDNESS_BINAURAL
        if ( st_ivas->ivas_format == SBA_FORMAT &&
             ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) )
        {
            /* loudness correction for SBA binaural rendering */
            for ( n = 0; n < BINAURAL_CHANNELS; n++ )
            {
                v_multc( p_output[n], INV_SQRT2, p_output[n], *nSamplesRendered );
            }
        }
#endif
    }
    else if ( st_ivas->ivas_format == MASA_ISM_FORMAT )
    {
+5 −0
Original line number Diff line number Diff line
@@ -912,8 +912,13 @@ void ivas_sba_dirac_stereo_dec(
    /* output scaling */
    if ( !sba_mono_flag && !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE ) )
    {
#ifdef FIX_1521_SBA_LOUDNESS_STEREO
        v_multc( output[0], INV_SQRT2, output[0], output_frame );
        v_multc( output[1], INV_SQRT2, output[1], output_frame );
#else
        v_multc( output[0], 0.5f, output[0], output_frame );
        v_multc( output[1], 0.5f, output[1], output_frame );
#endif
    }

    /* delay HB synth */
+7 −0
Original line number Diff line number Diff line
@@ -129,10 +129,17 @@ ivas_error ivas_sba_get_hoa_dec_matrix(
    }
    else if ( hOutSetup.output_config == IVAS_AUDIO_CONFIG_STEREO )
    {
#ifdef FIX_1521_SBA_LOUDNESS_STEREO
        ( *hoa_dec_mtx )[0] = INV_SQRT2;
        ( *hoa_dec_mtx )[1] = INV_SQRT2;
        ( *hoa_dec_mtx )[SBA_NHARM_HOA3] = INV_SQRT2;
        ( *hoa_dec_mtx )[SBA_NHARM_HOA3 + 1] = -INV_SQRT2;
#else
        ( *hoa_dec_mtx )[0] = 0.5f;
        ( *hoa_dec_mtx )[1] = 0.5f;
        ( *hoa_dec_mtx )[SBA_NHARM_HOA3] = 0.5f;
        ( *hoa_dec_mtx )[SBA_NHARM_HOA3 + 1] = -0.5f;
#endif
    }
    else if ( hOutSetup.is_loudspeaker_setup )
    {
+13 −1
Original line number Diff line number Diff line
@@ -1854,7 +1854,19 @@ ivas_error ivas_rend_crendProcessSubframe(
        for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
        {
            /* move to output */
#ifdef FIX_1521_SBA_LOUDNESS_BINAURAL
            if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS && outConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR )
            {
                /* loudness correction for SBA binaural rendering */
                v_multc( pcm_tmp[ch], INV_SQRT2, p_output[ch], subframe_len );
            }
            else
            {
#endif
                mvr2r( pcm_tmp[ch], p_output[ch], subframe_len );
#ifdef FIX_1521_SBA_LOUDNESS_BINAURAL
            }
#endif

            p_output[ch] += subframe_len;
        }