Commit f9549819 authored by multrus's avatar multrus
Browse files

Merge branch...

Merge branch 'float-1544-assertion-errors-triggered-when-float-code-is-compiled-with-funsafe-math-optimizations-part01' into 'main'

Resolve "Assertion errors triggered when float code is compiled with "-funsafe-math-optimizations" option"

See merge request !2567
parents a048be5f 8e31c034
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@
#define FIX_BASOP_2469_OBJ_EDIT_TD_REND_GAIN            /* Eri: Basop issue 2469: TD renderer gain has wrong Q. In float this is just a synch of the cleanup done in BASOP */
#define FIX_ISSUE_1546_DEAD_CODE                        /* FhG: remove dead code reported in the issue*/
#define FIX_FLOAT_1544_SBA_META_IMPRECISION_UNSAFE_MATH /* FhG: float issue 1544: imprecision in ivas_get_dirac_sba_max_md_bits() with -funsafe-math-optimizations */
#define FIX_FLOAT_1544_ITD_IMPRECISION_UNSAFE_MATH      /* FhG: float issue 1544: Avoid assert() with -funsafe-math-optimizations in stereo_td_itd() */

/* #################### End BE switches ################################## */

+5 −1
Original line number Diff line number Diff line
@@ -291,9 +291,13 @@ void stereo_td_itd(
        size_ovl = dft_ovl;

        itd_max = ( STEREO_DFT_ITD_MAX * input_frame ) / L_FRAME32k;

#ifdef FIX_FLOAT_1544_ITD_IMPRECISION_UNSAFE_MATH
        assert( ( (int16_t) fabsf( hITD->itd[k_offset] ) <= itd_max ) && "ITD value is too high!" );
        assert( ( (int16_t) fabsf( hITD->itd[k_offset - 1] ) <= itd_max ) && "ITD value is too high!" );
#else
        assert( ( fabsf( hITD->itd[k_offset] ) <= itd_max ) && "ITD value is too high!" );
        assert( ( fabsf( hITD->itd[k_offset - 1] ) <= itd_max ) && "ITD value is too high!" );
#endif

        itd = hITD->td_itd[k_offset];