Commit 1ecb9137 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch '1397-apple-clang-16-release-vs-debug-differences-in-stereo-v2' into 'main'

[non-BE] [split-non-BE] Fix non-BE between optimization levels in dft stereo for Apple Clang - Alternative Version

See merge request !2318
parents 8d2fe124 6492937c
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@

#define NONBE_1412_AVOID_ROUNDING_AZ_ELEV              /* FhG:  Avoid rounding when passing azimuth and elevation to efap_determine_gains() */
#define NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG       /* FhG: Fix MDCT-Stereo comfort noise for certain noise types */
#define NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS    /* FhG: fix non-BE in DFT stereo encoder between optimization levels */

/* ##################### End NON-BE switches ########################### */

+12 −0
Original line number Diff line number Diff line
@@ -1316,12 +1316,24 @@ void stereo_dft_enc_process(

        if ( hStereoDft->hItd->deltaItd[k_offset] != 0 && hStereoDft->hConfig->dmx_active )
        {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS
            /* Note: this variable is used as an in-between step when passing the angle to the trig functions.
             *       this keeps the compilter from applying optimizations at higher optimizaton levels which can break bit-exactness */
            volatile float alpha_tmp;
#endif
            /*time shift channels*/
            alpha = -2.0f * EVS_PI * hStereoDft->hItd->deltaItd[k_offset] / hStereoDft->NFFT;
            c = 1.f; /*cos(0)*/
            s = 0.f; /*sin(0)*/
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS

            alpha_tmp = alpha;
            c1 = cosf( alpha_tmp );
            s1 = sinf( alpha_tmp );
#else
            c1 = cosf( alpha );
            s1 = sinf( alpha );
#endif

            if ( alpha >= 0 )
            {