diff --git a/lib_com/options.h b/lib_com/options.h index 4a5a53c9875ce1551eab189919b257c3f28c64e9..5257a5d6a276d9489f951ea7a5dbbf28aa138ef1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -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 diff --git a/lib_dec/ivas_binRenderer_internal_fx.c b/lib_dec/ivas_binRenderer_internal_fx.c index 68886c1baac85e6bed86c46fd0b0df026c325b63..d241cd145d313fe5c5ba8794c4dfc6e7406daa37 100644 --- a/lib_dec/ivas_binRenderer_internal_fx.c +++ b/lib_dec/ivas_binRenderer_internal_fx.c @@ -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 ) ) { diff --git a/lib_rend/ivas_rotation_fx.c b/lib_rend/ivas_rotation_fx.c index 92ad8d36f4f55496349855e354687c3a25a0a9b3..5d2f393bb7649b330e267aed27db447c4ef5b3d8 100644 --- a/lib_rend/ivas_rotation_fx.c +++ b/lib_rend/ivas_rotation_fx.c @@ -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 {