Assertion errors triggered when float code is compiled with "-funsafe-math-optimizations" option
We have observed 2 assertion errors when IVAS float code (08cd8642) is compiled with "-O3 -funsafe-math-optimizations" options. One of them is for bitrate switching case of stereo encoder mode and other is for binaural decoder.
Error observed for encoder -
IVAS_cod: lib_enc/ivas_stereo_dft_td_itd.c:295: void stereo_td_itd(ITD_DATA *, float (*)[420], const int16_t, const int16_t, Encoder_State **, const int16_t, float **):
Assertion `( fabsf( hITD->itd[k_offset] ) <= itd_max ) && "ITD value is too high!"' failed.
Error observed for decoder -
IVAS_dec: lib_dec/ivas_mdct_core_dec.c:621: void ivas_mdct_core_invQ(CPE_DEC_HANDLE, int16_t (*)[2], int16_t (*)[2], int16_t (*)[136], int16_t (*)[1460], int16_t (*)[2], STnsData (*)[2], float *(*)[2], float *(*)[2], float (*)[102], int16_t (*)[70], const int16_t):
Assertion `st->BER_detect != 1' failed.
As mentioned earlier, we do not anticipate a conformance pass when using the -funsafe-math-optimizations option; however, the code should not result in a crash. Steps to reproduce are listed below :
make all VERBOSE=1 RELEASE=1 OPTIM=3 CC=clang (clang version-18.1.6)
Run encoder command : ./IVAS_cod -q -dtx -stereo testvec/switchPaths/sw_13k2_to_128k_10fr.bin 48 testvec/testv/stvST48c.wav stvST48c.wav_stereo_bitrate_switching_from_13_2_kbps_to_128_kbps_48kHz_in_48kHz_out_DTX_on_EXT_out.192
Run decoder command : ./IVAS_dec -q -fr 20 -hrtf testvec/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 testvec/testv/ref/param_file/enc/stvOSBA_4ISM_FOA48c.wav_OSBA_FOA_4ISM_at_br_sw_13_2_to_512_kbps_48kHz_in_16kHz_out_BINAURAL_out_Model_from_file_FER_at_5_bandwidth_switching.fer.192 stvOSBA_4ISM_FOA48c.wav_OSBA_FOA_4ISM_at_br_sw_13_2_to_512_kbps_48kHz_in_16kHz_out_BINAURAL_out_Model_from_file_FER_at_5_bandwidth_switching.dec.wav