Changeset 628 for pjproject/trunk/pjmedia/src/pjmedia-codec/speex/misc.c
- Timestamp:
- Jul 26, 2006 5:04:54 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/speex/misc.c
r278 r628 197 197 198 198 #ifdef FIXED_POINT 199 spx_word 32_t speex_rand(spx_word16_t std, spx_int32_t *seed)199 spx_word16_t speex_rand(spx_word16_t std, spx_int32_t *seed) 200 200 { 201 201 spx_word32_t res; 202 202 *seed = 1664525 * *seed + 1013904223; 203 203 res = MULT16_16(EXTRACT16(SHR32(*seed,16)),std); 204 return SUB32(res, SHR(res, 3));204 return PSHR32(SUB32(res, SHR(res, 3)),14); 205 205 } 206 206 #else … … 217 217 #endif 218 218 219 void speex_rand_vec(float std, spx_sig_t *data, int len)220 {221 int i;222 for (i=0;i<len;i++)223 data[i]+=SIG_SCALING*3*std*((((float)rand())/RAND_MAX)-.5);224 }225 226 227 /*float speex_rand(float std)228 {229 return 3*std*((((float)rand())/RAND_MAX)-.5);230 }*/231 232 219 #ifndef OVERRIDE_SPEEX_PUTC 233 220 void _speex_putc(int ch, void *file)
Note: See TracChangeset
for help on using the changeset viewer.