diff --git a/Makefile b/Makefile index fdfd7b0126b463a51206bf34b1d909f8894f4bcd..9d992b6cf65d3c42db2ecd97bb00243ed6c143a5 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ CFLAGS += -std=c99 -pedantic -Wcast-qual -Wall -W -Wextra -Wno-long-long \ -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ -Werror-implicit-function-declaration \ -Wno-implicit-fallthrough -ffp-contract=off \ - -Winit-self -Wunused-but-set-variable + -Winit-self -Wunused-but-set-variable -funsafe-math-optimizations # to be uncommented in CI # CFLAGS += -Werror diff --git a/lib_com/options.h b/lib_com/options.h index bbea3aa1534059d14c1f9b80304d8ebe81ea7d42..fe6c29b89cc692a7cbdd26f22026948b1b6faddd 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ - +#define FIX_FLOAT_1544_ITD_IMPRECISION_UNSAFE_MATH /* FhG: Avoid imprecisions wih -funsafe-math-optimizations in stereo_dft_quantize_itd() */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c index f48fd9a667beedc99f03ce8829ca164fdac6f2a7..dc9b3e6021f071f430597e1037f3efc2f166f2f5 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -165,7 +165,11 @@ static void stereo_dft_quantize_itd( } /*Convert back @ fs*/ +#ifdef FIX_FLOAT_1544_ITD_IMPRECISION_UNSAFE_MATH + *out = (float) ( ( itd * input_Fs ) / ( (double) ( STEREO_DFT_ITD_FS ) ) ); /* use double arithmetic, to avoid imprecisions with optimizations using -funsafe-math-optimizations */ +#else *out = (float) ( itd * input_Fs ) / ( (float) ( STEREO_DFT_ITD_FS ) ); +#endif return; }