Commit a0e1755a authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'windows_crash_fix' into 'main'

Windows crash issue

See merge request !44
parents 353f62d6 0b76a8c2
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -163,7 +163,8 @@ void sns_compute_scf_fx(
    Word32 spectrum[],
    const PsychoacousticParameters *pPsychParams,
    const Word16 L_frame,
    Word32 *scf );
    Word32 *scf,
    Word16 q);

void sns_interpolate_scalefactors_fx(
    Word32 *scf_int,    /* o  : interpolated scalefactors for spectrum shaping                         */
+4 −3
Original line number Diff line number Diff line
@@ -54,7 +54,8 @@ void sns_compute_scf_fx(
    Word32 spectrum[],
    const PsychoacousticParameters *pPsychParams,
    const Word16 L_frame,
    Word32 *scf )
    Word32 *scf,
    Word16 q)
{
    Word16 i, n, k;
    Word32 x[FDNS_NPTS], xs[FDNS_NPTS], mean, xl4[SNS_NPTS], nf, xl[FDNS_NPTS];
@@ -163,7 +164,7 @@ void sns_compute_scf_fx(
    {
        Word16 e_tmp = norm_l( xs[i] );
        Word16 f_tmp = Log2_norm_lc( L_shl( xs[i], e_tmp ) );
        e_tmp = sub( sub( 30, e_tmp ), 12 );
        e_tmp = sub( sub( 30, e_tmp ), q );
        /* Note: Mpy_32_16 is used temporarily for this computation, It needs to be replaced with appropriate BASOP. */
        xl[i] = Mpy_32_16( e_tmp, f_tmp, 16384 ); /* Q16 */
    }
@@ -204,7 +205,7 @@ void sns_compute_scf_fx(
    /* Remove mean and scaling */
    sum = 0;
    for (Word16 ind = 0; ind < SNS_NPTS; ind++) {
        sum += (Word64)xl4[i];
        sum += (Word64)xl4[ind];
    }
    mean = (Word32)(sum >> 4);

+2 −2
Original line number Diff line number Diff line
@@ -1221,7 +1221,7 @@ void TonalMdctConceal_whiten_noise_shape_ivas(
            if(abs((Word32)whitenend_noise_shape[k])!=0) q = s_min(q, norm_l( whitenend_noise_shape[k] ));
        }

        q -= find_guarded_bits_fx(L_frame) + 2;
        q -= find_guarded_bits_fx(L_frame) - 2;
        //q -= 1;

        FOR( Word16 k = 0; k < L_FRAME16k; k++ )
@@ -1229,7 +1229,7 @@ void TonalMdctConceal_whiten_noise_shape_ivas(
            whitenend_noise_shape_fx[k] = q>=0 ? ((Word32) ( whitenend_noise_shape[k] *(1<< q) )):((Word32) ( whitenend_noise_shape[k] / (1<< q) ));
        }

        sns_compute_scf_fx( whitenend_noise_shape_fx, psychParams, L_frame, scf_fx );
        sns_compute_scf_fx( whitenend_noise_shape_fx, psychParams, L_frame, scf_fx, q );

        sns_interpolate_scalefactors_fx( scfs_int_fx, scf_fx, ENC );
        sns_interpolate_scalefactors_fx( scfs_bg_fx, scf_fx, DEC );