diff --git a/lib_com/tcx_utils_fx.c b/lib_com/tcx_utils_fx.c index 1932730ac92be059df5d186a4333c3637f39ff50..74149f2bea571b767536bc948bced51dd3c12d00 100644 --- a/lib_com/tcx_utils_fx.c +++ b/lib_com/tcx_utils_fx.c @@ -1787,7 +1787,7 @@ void tcx_noise_filling( win = add( win, 1 ); } - seed = own_random2_fx( seed ); + Random( &seed ); Q[i] = L_mult0( mult( seed, fac_ns ), win ); move32(); @@ -1952,7 +1952,7 @@ void tcx_noise_filling_with_shift( Word16 nrm = 31; - seed = own_random2_fx( seed ); + Random( &seed ); Q[i] = L_mult0( mult( seed, fac_ns ), win ); IF( Q[i] ) { diff --git a/lib_dec/FEC_HQ_phase_ecu_fx.c b/lib_dec/FEC_HQ_phase_ecu_fx.c index bd6d018a64634539559f06ce6b51e49e8264bbb7..e43cf7f25c08a08096f04a7f1f6b73e8100c18e1 100644 --- a/lib_dec/FEC_HQ_phase_ecu_fx.c +++ b/lib_dec/FEC_HQ_phase_ecu_fx.c @@ -2382,9 +2382,9 @@ static void ivas_subst_spec_fx( move16(); IF( NE_16( ph_dith, 0 ) ) { - Xph = *pCorrPhase; /* in Q16. 2*PI is not included. */ - *seed = own_random2_fx( *seed ); /* in Q0 */ - acc = L_mult( *seed, ph_dith ); /* N.B. ph_dith[i] is in Q15, i.e., in between 0 and 1.0 (2*PI not included) */ + Xph = *pCorrPhase; /* in Q16. 2*PI is not included. */ + Random( seed ); /* in Q0 */ + acc = L_mult( *seed, ph_dith ); /* N.B. ph_dith[i] is in Q15, i.e., in between 0 and 1.0 (2*PI not included) */ acc = L_shr( acc, PHASE_DITH_SCALE_SHIFT ); Xph = L_add( Xph, acc ); /* in Q16. */ @@ -2782,9 +2782,9 @@ static void subst_spec_fx( move16(); IF( ph_dith != 0 ) { - Xph = *pCorrPhase; /* in Q16. 2*PI is not included. */ - *seed = own_random2_fx( *seed ); /* in Q0 */ - acc = L_mult( *seed, ph_dith ); /* N.B. ph_dith[i] is in Q15, i.e., in between 0 and 1.0 (2*PI not included) */ + Xph = *pCorrPhase; /* in Q16. 2*PI is not included. */ + Random( seed ); /* in Q0 */ + acc = L_mult( *seed, ph_dith ); /* N.B. ph_dith[i] is in Q15, i.e., in between 0 and 1.0 (2*PI not included) */ acc = L_shr( acc, PHASE_DITH_SCALE_SHIFT ); Xph = L_add( Xph, acc ); /* in Q16. */ diff --git a/lib_dec/er_dec_acelp_fx.c b/lib_dec/er_dec_acelp_fx.c index 11ada114183334cb1f1f0796e4332232c20e690d..eec1d3be82cd095dab1c71495ec32d26a74f8cc4 100644 --- a/lib_dec/er_dec_acelp_fx.c +++ b/lib_dec/er_dec_acelp_fx.c @@ -490,7 +490,7 @@ void con_acelp_fx( l = add( st->L_frame, sub( l_fir_fer, 1 ) ); FOR( i = 0; i < l; i++ ) { - tmpSeed = own_random2_fx( tmpSeed ); + Random( &tmpSeed ); noise_buf[i] = tmpSeed; /*Q0*/ move16(); } @@ -500,7 +500,7 @@ void con_acelp_fx( l = add( add( st->L_frame, shr( st->L_frame, 1 ) ), sub( l_fir_fer, 1 ) ); FOR( ; i < l; i++ ) { - tmpSeed = own_random2_fx( tmpSeed ); + Random( &tmpSeed ); noise_buf[i] = tmpSeed; /*Q0*/ move16(); } diff --git a/lib_dec/er_dec_tcx_fx.c b/lib_dec/er_dec_tcx_fx.c index e51721c82f8989f7f9bed4100372f8890a5c3b27..fa30326ca4bc5e48fbff9e868c2f105477a35dff 100644 --- a/lib_dec/er_dec_tcx_fx.c +++ b/lib_dec/er_dec_tcx_fx.c @@ -692,7 +692,7 @@ void con_tcx_fx( tmp_loop = add( L_frame, L_FIR_FER2 - 1 ); FOR( i = 0; i < tmp_loop; i++ ) { - tmpSeed = own_random2_fx( tmpSeed ); + Random( &tmpSeed ); noise[i] = shr( tmpSeed, noise_e ); move16(); } @@ -702,7 +702,7 @@ void con_tcx_fx( tmp_loop = add( add( L_frame, shr( L_frame, 1 ) ), shl( L_FIR_FER2, 1 ) ); FOR( ; i < tmp_loop; i++ ) { - tmpSeed = own_random2_fx( tmpSeed ); + Random( &tmpSeed ); noise[i] = shr( tmpSeed, noise_e ); move16(); } @@ -1622,7 +1622,7 @@ void con_tcx_ivas_fx( tmpSeed1 = *noise_seed; noise = buf; - noise_e = 1; + noise_e = 2; move16(); e = 0; move16(); @@ -1640,8 +1640,8 @@ void con_tcx_ivas_fx( FOR( i = 0; i < add( L_frame, L_FIR_FER2 - 1 ); i++ ) { - random1 = own_random2_fx( tmpSeed1 ); - random2 = own_random2_fx( tmpSeed1 ); + random1 = Random( &tmpSeed1 ); + random2 = Random( &tmpSeed1 ); noise[i] = add( shr( random1, noise_e ), shr( mult( alpha_coh, random2 ), noise_e ) ); move16(); } @@ -1655,8 +1655,8 @@ void con_tcx_ivas_fx( FOR( ; i < add( add( L_frame, shr( L_frame, 1 ) ), 2 * L_FIR_FER2 ); i++ ) { - random1 = own_random2_fx( tmpSeed1 ); - random2 = own_random2_fx( tmpSeed1 ); + random1 = Random( &tmpSeed1 ); + random2 = Random( &tmpSeed1 ); noise[i] = add( shr( random1, noise_e ), shr( mult( alpha_coh, random2 ), noise_e ) ); move16(); } @@ -1673,7 +1673,7 @@ void con_tcx_ivas_fx( tmp_loop = add( L_frame, L_FIR_FER2 - 1 ); FOR( i = 0; i < tmp_loop; i++ ) { - tmpSeed = own_random2_fx( tmpSeed ); + Random( &tmpSeed ); noise[i] = shr( tmpSeed, noise_e ); move16(); } @@ -1683,7 +1683,7 @@ void con_tcx_ivas_fx( tmp_loop = add( add( L_frame, shr( L_frame, 1 ) ), shl( L_FIR_FER2, 1 ) ); FOR( ; i < tmp_loop; i++ ) { - tmpSeed = own_random2_fx( tmpSeed ); + Random( &tmpSeed ); noise[i] = shr( tmpSeed, noise_e ); move16(); } diff --git a/lib_dec/gaus_dec_fx.c b/lib_dec/gaus_dec_fx.c index ae394105d5aca936dc51281a6fbafe8e0da48831..0dec8dbf632830dba87690961414f2c9e7eef50d 100644 --- a/lib_dec/gaus_dec_fx.c +++ b/lib_dec/gaus_dec_fx.c @@ -268,13 +268,13 @@ void gaus_L2_dec( move16(); FOR( i = 0; i < L_SUBFR; i++ ) { - seed = own_random2_fx( seed ); + Random( &seed ); tmp32 = L_mac( 0, seed, 1 << 9 ); - seed = own_random2_fx( seed ); + Random( &seed ); tmp32 = L_mac( tmp32, seed, 1 << 9 ); - seed = own_random2_fx( seed ); + Random( &seed ); code[i] = mac_r( tmp32, seed, 1 << 9 ); move16(); } diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index acb58e751be63381833405538f6ee7933558b1f0..f18e474e4faa9b20c7e2c05e0bea0f9ea04f49b3 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -883,9 +883,7 @@ static int16_t ivas_parse_spar_header( static Word16 get_random_number_fx( Word16 *seed ) { - Word16 x = own_random2_fx( *seed ); - *seed = x; - return x; + return Random( seed ); } #else static float get_random_number( diff --git a/lib_enc/cod_uv_fx.c b/lib_enc/cod_uv_fx.c index 5ebfe484031155ff8af52a94884c9b591eb95d40..bf20ecfd0d467de373c1764463f122307818071a 100644 --- a/lib_enc/cod_uv_fx.c +++ b/lib_enc/cod_uv_fx.c @@ -47,13 +47,13 @@ void gauss_L2_fx( /*Generate white gaussian noise using central limit theorem method (N only 4 as E_util_random is not purely uniform)*/ FOR( i = 0; i < L_SUBFR; i++ ) { - *seed_acelp = own_random2_fx( *seed_acelp ); + Random( seed_acelp ); tmp32 = L_mac( 0, *seed_acelp, 1 << 9 ); - *seed_acelp = own_random2_fx( *seed_acelp ); + Random( seed_acelp ); tmp32 = L_mac( tmp32, *seed_acelp, 1 << 9 ); - *seed_acelp = own_random2_fx( *seed_acelp ); + Random( seed_acelp ); code[i] = mac_r( tmp32, *seed_acelp, 1 << 9 ); move16(); }