Loading lib_com/ivas_sns_com_fx.c +12 −5 Original line number Diff line number Diff line Loading @@ -57,7 +57,8 @@ void sns_compute_scf_fx( Word32 *scf ) { Word16 i, n, k; Word32 x[FDNS_NPTS], xs[FDNS_NPTS], sum, mean, xl4[SNS_NPTS], nf, xl[FDNS_NPTS]; Word32 x[FDNS_NPTS], xs[FDNS_NPTS], mean, xl4[SNS_NPTS], nf, xl[FDNS_NPTS]; Word64 sum; Word32 L_tmp; const Word16 *pow_tilt; const UWord8 nBands = pPsychParams->nBands; Loading Loading @@ -139,8 +140,11 @@ void sns_compute_scf_fx( } /* Noise floor at -40dB */ sum = sum32_fx( xs, FDNS_NPTS ); mean = L_shr( sum, 6 ); sum = 0; for (Word16 ind = 0; ind < FDNS_NPTS; ind++) { sum += (Word64)xs[i]; } mean = (Word32)(sum >> 6); nf = Mpy_32_16_1( mean, 3 ); // 3 => powf( 10.0f, -4.0f ) in Q15 nf = L_max( nf, 0 ); // 0 => powf( 2.0f, -32.0f ) in Q15 Loading Loading @@ -198,8 +202,11 @@ void sns_compute_scf_fx( xl4[SNS_NPTS - 1] = L_tmp; /* Remove mean and scaling */ sum = sum32_fx( xl4, SNS_NPTS ); mean = L_shr( sum, 4 ); sum = 0; for (Word16 ind = 0; ind < SNS_NPTS; ind++) { sum += (Word64)xl4[i]; } mean = (Word32)(sum >> 4); FOR( i = 0; i < SNS_NPTS; i++ ) { Loading lib_dec/tonalMDCTconcealment.c +11 −1 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ #include "wmc_auto.h" #ifdef IVAS_FLOAT_FIXED #include "ivas_prot_fx.h" #include "prot_fx2.h" #endif // IVAS_FLOAT_FIXED Loading Loading @@ -1214,9 +1215,18 @@ void TonalMdctConceal_whiten_noise_shape_ivas( Word32 whitenend_noise_shape_fx[L_FRAME16k]; Word32 scfs_int_fx[FDNS_NPTS], scfs_bg_fx[FDNS_NPTS]; Word16 q = 31; FOR( Word16 k = 0; k < L_FRAME16k; k++ ) { whitenend_noise_shape_fx[k] = (Word32) ( whitenend_noise_shape[k] * ONE_IN_Q7 ); 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 -= 1; FOR( Word16 k = 0; k < L_FRAME16k; k++ ) { 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 ); Loading Loading
lib_com/ivas_sns_com_fx.c +12 −5 Original line number Diff line number Diff line Loading @@ -57,7 +57,8 @@ void sns_compute_scf_fx( Word32 *scf ) { Word16 i, n, k; Word32 x[FDNS_NPTS], xs[FDNS_NPTS], sum, mean, xl4[SNS_NPTS], nf, xl[FDNS_NPTS]; Word32 x[FDNS_NPTS], xs[FDNS_NPTS], mean, xl4[SNS_NPTS], nf, xl[FDNS_NPTS]; Word64 sum; Word32 L_tmp; const Word16 *pow_tilt; const UWord8 nBands = pPsychParams->nBands; Loading Loading @@ -139,8 +140,11 @@ void sns_compute_scf_fx( } /* Noise floor at -40dB */ sum = sum32_fx( xs, FDNS_NPTS ); mean = L_shr( sum, 6 ); sum = 0; for (Word16 ind = 0; ind < FDNS_NPTS; ind++) { sum += (Word64)xs[i]; } mean = (Word32)(sum >> 6); nf = Mpy_32_16_1( mean, 3 ); // 3 => powf( 10.0f, -4.0f ) in Q15 nf = L_max( nf, 0 ); // 0 => powf( 2.0f, -32.0f ) in Q15 Loading Loading @@ -198,8 +202,11 @@ void sns_compute_scf_fx( xl4[SNS_NPTS - 1] = L_tmp; /* Remove mean and scaling */ sum = sum32_fx( xl4, SNS_NPTS ); mean = L_shr( sum, 4 ); sum = 0; for (Word16 ind = 0; ind < SNS_NPTS; ind++) { sum += (Word64)xl4[i]; } mean = (Word32)(sum >> 4); FOR( i = 0; i < SNS_NPTS; i++ ) { Loading
lib_dec/tonalMDCTconcealment.c +11 −1 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ #include "wmc_auto.h" #ifdef IVAS_FLOAT_FIXED #include "ivas_prot_fx.h" #include "prot_fx2.h" #endif // IVAS_FLOAT_FIXED Loading Loading @@ -1214,9 +1215,18 @@ void TonalMdctConceal_whiten_noise_shape_ivas( Word32 whitenend_noise_shape_fx[L_FRAME16k]; Word32 scfs_int_fx[FDNS_NPTS], scfs_bg_fx[FDNS_NPTS]; Word16 q = 31; FOR( Word16 k = 0; k < L_FRAME16k; k++ ) { whitenend_noise_shape_fx[k] = (Word32) ( whitenend_noise_shape[k] * ONE_IN_Q7 ); 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 -= 1; FOR( Word16 k = 0; k < L_FRAME16k; k++ ) { 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 ); Loading