Ignore:
Timestamp:
Jul 26, 2006 5:04:54 PM (18 years ago)
Author:
bennylp
Message:
  • Bring speex codec up to date with their SVN trunk
  • Speex codec should work in FIXED_POINT mode when PJ_HAS_FLOATING_POINT is set to zero.
  • ulaw2linear will return zero if zero is given (this would make the VAD works better, and it also fixed click noise when call is established/hangup).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-codec/speex/misc.c

    r278 r628  
    197197 
    198198#ifdef FIXED_POINT 
    199 spx_word32_t speex_rand(spx_word16_t std, spx_int32_t *seed) 
     199spx_word16_t speex_rand(spx_word16_t std, spx_int32_t *seed) 
    200200{ 
    201201   spx_word32_t res; 
    202202   *seed = 1664525 * *seed + 1013904223; 
    203203   res = MULT16_16(EXTRACT16(SHR32(*seed,16)),std); 
    204    return SUB32(res, SHR(res, 3)); 
     204   return PSHR32(SUB32(res, SHR(res, 3)),14); 
    205205} 
    206206#else 
     
    217217#endif 
    218218 
    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  
    232219#ifndef OVERRIDE_SPEEX_PUTC 
    233220void _speex_putc(int ch, void *file) 
Note: See TracChangeset for help on using the changeset viewer.