Commit c4566af6 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch '1835_basop_fix_reverb_activation' into 'main-pc'

[non-BE] [renderer-non-BE] [split-non-BE] Fix for issue #1835: Decoder: Loudness difference ivas-float-update vs. float-pc for MC BINAURAL_ROOM_IR + Headrotation output

See merge request !1952
parents eb2df83a 20cd84fa
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@
#define FIX_1741_REVERB_TIMES_Q_FORMAT                  /* Philips: reverberation times in Q26 format instead of Q31 */
#define FIX_1831_REVERB_REGRESSION                      /* Philips: fixes reverb regression issues  */

#define FIX_1835_REVERB_ACTIVATION                      /* FhG: Modified reverberation activation logic and corrected factEQ calculation */
/* #################### End BASOP porting switches ############################ */

#endif
+8 −1
Original line number Diff line number Diff line
@@ -1012,7 +1012,6 @@ static void ivas_binaural_obtain_DMX_fx(
                        move32();
                        imagDMX[chOutIdx][k][bandIdx] = L_add( imagDMX[chOutIdx][k][bandIdx], temp2_fx ); // Q_in
                        move32();

                        P_in_fx[bandIdx] = L_add( P_in_fx[bandIdx], L_add( Mpy_32_32( temp1_fx, temp1_fx ), Mpy_32_32( temp2_fx, temp2_fx ) ) ); // Q31-2*Q_in
                        move32();
                    }
@@ -1040,7 +1039,11 @@ static void ivas_binaural_obtain_DMX_fx(
                ELSE
                {
                    Word16 div = divide3232( P_in_fx[bandIdx], P_out_fx );
#ifdef FIX_1835_REVERB_ACTIVATION
                    Word16 exp = 0; // divide3232 returns Q15 + following Q16 shift
#else
                    Word16 exp = norm_l( div );
#endif
                    factEQ_fx = Sqrt32( L_shl( div, Q16 ), &exp );
                    factEQ_fx = L_shl( factEQ_fx, sub( exp, 1 ) ); // Q30
                }
@@ -1405,7 +1408,11 @@ ivas_error ivas_binRenderer_open_fx(

    /* Allocate memories needed for reverb module */
    test();
#ifdef FIX_1835_REVERB_ACTIVATION
    IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) || ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) && EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) )
#else
    IF( ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) ) && EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
#endif
    {
        IF( NE_32( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes_fx, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) )
        {
+3 −0
Original line number Diff line number Diff line
@@ -1173,6 +1173,9 @@ void rotateFrame_sd_cldfb_fixed(
        IF( hEFAPdata != NULL && ( NE_16( extract_l( L_shr( hOutputSetup->ls_azimuth_fx[n], Q22 ) ), azimuth ) || NE_16( extract_l( L_shr( hOutputSetup->ls_elevation_fx[n], Q22 ) ), elevation ) ) )
        {
            efap_determine_gains_fx( hEFAPdata, gains_fx[n], L_shl( azimuth, Q22 ), L_shl( elevation, Q22 ), EFAP_MODE_EFAP );
#ifdef FIX_1835_REVERB_ACTIVATION
            scale_sig32( gains_fx[n], hEFAPdata->numSpk, Q1 ); // gains_fx: Q31
#endif
        }
        ELSE
        {