Commit 9b04ec3c authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch...

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

Apple Clang 16 release vs debug differences in stereo - second Part

See merge request !2323
parents ff68f8cc 6764d383
Loading
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -275,8 +275,14 @@ void edxt(
            {
                for ( k = Nm1 >> 1; k > 0; k-- )
                {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                    volatile float angle_tmp = scale * k;
                    const float wRe = cosf( angle_tmp );
                    const float wIm = sinf( angle_tmp );
#else
                    const float wRe = cosf( scale * k );
                    const float wIm = sinf( scale * k );
#endif

                    y[k] /*pt 1*/ = wRe * re[k] + wIm * im[k];
                    y[length - k] = wIm * re[k] - wRe * im[k];
@@ -287,8 +293,14 @@ void edxt(
            {
                for ( k = Nm1 >> 1; k > 0; k-- )
                {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                    volatile float angle_tmp = scale * k;
                    const float wRe = cosf( angle_tmp );
                    const float wIm = sinf( angle_tmp );
#else
                    const float wRe = cosf( scale * k );
                    const float wIm = sinf( scale * k );
#endif

                    y[Nm1 - k] = wRe * re[k] + wIm * im[k];
                    y[k - 1] = wIm * re[k] - wRe * im[k];
@@ -304,8 +316,14 @@ void edxt(
            {
                for ( k = Nm1 >> 1; k > 0; k-- )
                {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                    volatile float angle_tmp = scale * k;
                    const float wRe = cosf( angle_tmp ) * 0.5f;
                    const float wIm = sinf( angle_tmp ) * 0.5f;
#else
                    const float wRe = cosf( scale * k ) * 0.5f;
                    const float wIm = sinf( scale * k ) * 0.5f;
#endif

                    re[k] = wRe * x[k] + wIm * x[length - k];
                    im[k] = wRe * x[length - k] - wIm * x[k];
@@ -316,8 +334,14 @@ void edxt(
            {
                for ( k = Nm1 >> 1; k > 0; k-- )
                {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                    volatile float angle_tmp = scale * k;
                    const float wRe = cosf( angle_tmp ) * 0.5f;
                    const float wIm = sinf( angle_tmp ) * 0.5f;
#else
                    const float wRe = cosf( scale * k ) * 0.5f;
                    const float wIm = sinf( scale * k ) * 0.5f;
#endif

                    re[k] = wRe * x[Nm1 - k] + wIm * x[k - 1];
                    im[k] = wRe * x[k - 1] - wIm * x[Nm1 - k];
+1 −0
Original line number Diff line number Diff line
@@ -187,6 +187,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 */
#define NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2  /* FhG: fix even more non-BEnesses */

/*#define NONBE_1324_TC_BUFFER_MEMOERY_KEEP*/               /* VA: issue 1324: do not reset TSM memory in JBM bitrate switching */

+16 −0
Original line number Diff line number Diff line
@@ -1384,8 +1384,16 @@ void stereo_dft_dec(

                    if ( pgIpd[0] != 0.f )
                    {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                        volatile float pgIpd_tmp;

                        pgIpd_tmp = pgIpd[0];
                        c0 = cosf( pgIpd_tmp );
                        s0 = sinf( pgIpd_tmp );
#else
                        c0 = cosf( pgIpd[0] );
                        s0 = sinf( pgIpd[0] );
#endif
                        for ( i = hStereoDft->band_limits[b]; i < hStereoDft->band_limits[b + 1]; i++ )
                        {
                            /*rotate L*/
@@ -1566,8 +1574,16 @@ void stereo_dft_dec(
                    /* Active Upmix */
                    if ( pgIpd[0] != 0.f )
                    {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                        volatile float pgIpd_tmp;

                        pgIpd_tmp = pgIpd[0];
                        c0 = cosf( pgIpd_tmp );
                        s0 = sinf( pgIpd_tmp );
#else
                        c0 = cosf( pgIpd[0] );
                        s0 = sinf( pgIpd[0] );
#endif
                        for ( i = hStereoDft->band_limits[b]; i < hStereoDft->band_limits[b + 1]; i++ )
                        {
                            /*rotate L*/
+9 −0
Original line number Diff line number Diff line
@@ -251,6 +251,9 @@ void stereo_dft_res_subst_spec(
    /* Apply phase adjustment of identified peaks, including Np=1 peak neighbors on each side */
    for ( i = *num_plocs - 1; i >= 0; i-- )
    {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
        volatile float corr_phase_tmp;
#endif
        if ( k == 0 )
        {
            /* For 1st subframe, apply reversed time ECU to get correct analysis window */
@@ -268,8 +271,14 @@ void stereo_dft_res_subst_spec(
            conj_sign = 1.0f;
        }

#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
        corr_phase_tmp = corr_phase;
        cos_F = cosf( corr_phase_tmp );
        sin_F = sinf( corr_phase_tmp );
#else
        cos_F = cosf( corr_phase );
        sin_F = sinf( corr_phase );
#endif

        idx = max( 0, plocs[i] - Np ); /* Iterate over plocs[i]-1:plocs[i]+1, considering the edges of the spectrum */
        while ( ( idx < plocs[i] + Np + 1 ) && ( idx < L_res ) )

lib_enc/ivas_stereo_dft_enc.c

100755 → 100644
+8 −0
Original line number Diff line number Diff line
@@ -1453,8 +1453,16 @@ void stereo_dft_enc_process(

            if ( pgIpd[0] != 0.f )
            {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                volatile float pgIpd_tmp;

                pgIpd_tmp = pgIpd[0];
                c = cosf( pgIpd_tmp );
                s = sinf( pgIpd_tmp );
#else
                c = cosf( pgIpd[0] );
                s = sinf( pgIpd[0] );
#endif
                for ( i = hStereoDft->band_limits_dmx[b]; i < hStereoDft->band_limits_dmx[b + 1]; i++ )
                {
                    /*rotate L*/
Loading