Ignore:
Timestamp:
Nov 23, 2006 10:19:46 AM (17 years ago)
Author:
bennylp
Message:

Updated Speex to their latest SVN (1.2-beta). AEC seems
to work much better now and take less CPU, so I increased
default tail length in PJSUA to 800ms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-codec/speex/fixed_debug.h

    r628 r823  
    9292   if (!VERIFY_SHORT(x)) 
    9393   { 
    94       fprintf (stderr, "EXTRACT16: input is not short: %d\n", x); 
     94      fprintf (stderr, "EXTEND32: input is not short: %d\n", x); 
    9595   } 
    9696   res = x; 
     
    117117   if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift)) 
    118118   { 
    119       fprintf (stderr, "SHR16: inputs are not short: %d %d\n", a, shift); 
     119      fprintf (stderr, "SHL16: inputs are not short: %d %d\n", a, shift); 
    120120   } 
    121121   res = a<<shift; 
    122122   if (!VERIFY_SHORT(res)) 
    123       fprintf (stderr, "SHR16: output is not short: %d\n", res); 
     123      fprintf (stderr, "SHL16: output is not short: %d\n", res); 
    124124   spx_mips++; 
    125125   return res; 
     
    135135   res = a>>shift; 
    136136   if (!VERIFY_INT(res)) 
     137   { 
    137138      fprintf (stderr, "SHR32: output is not int: %d\n", (int)res); 
     139   } 
    138140   spx_mips++; 
    139141   return res; 
     
    144146   if (!VERIFY_INT(a) || !VERIFY_SHORT(shift)) 
    145147   { 
    146       fprintf (stderr, "SHR32: inputs are not int: %d %d\n", (int)a, shift); 
     148      fprintf (stderr, "SHL32: inputs are not int: %d %d\n", (int)a, shift); 
    147149   } 
    148150   res = a<<shift; 
    149151   if (!VERIFY_INT(res)) 
    150       fprintf (stderr, "SHR32: output is not int: %d\n", (int)res); 
    151    spx_mips++; 
    152    return res; 
    153 } 
    154  
    155  
    156 #define PSHR16(a,shift) (SHR16(ADD16(a,(1<<((shift)-1))),shift)) 
    157 #define PSHR32(a,shift) (SHR32(ADD32(a,(1<<((shift)-1))),shift)) 
     152   { 
     153      fprintf (stderr, "SHL32: output is not int: %d\n", (int)res); 
     154   } 
     155   spx_mips++; 
     156   return res; 
     157} 
     158 
     159#define PSHR16(a,shift) (SHR16((a)+((1<<((shift))>>1)),shift)) 
     160#define PSHR32(a,shift) (SHR32((a)+((1<<((shift))>>1)),shift)) 
     161#define VSHR32(a, shift) (((shift)>0) ? SHR32(a, shift) : SHL32(a, -(shift))) 
     162 
    158163#define SATURATE16(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) 
    159164#define SATURATE32(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) 
     
    171176   res = a+b; 
    172177   if (!VERIFY_SHORT(res)) 
    173       fprintf (stderr, "ADD16: output is not short: %d+%d=%d\n", a,b,res); 
     178   { 
     179     fprintf (stderr, "ADD16: output is not short: %d+%d=%d\n", a,b,res); 
     180   } 
    174181   spx_mips++; 
    175182   return res; 
     
    221228#define ADD64(a,b) (MIPS_INC(a)+(b)) 
    222229 
    223 #define PSHR(a,shift) (SHR((a)+(1<<((shift)-1)),shift)) 
    224  
     230#define PSHR(a,shift) (SHR((a)+((1<<((shift))>>1)),shift)) 
    225231/* result fits in 16 bits */ 
    226232static inline short MULT16_16_16(int a, int b)  
     
    265271      fprintf (stderr, "MULT16_32_Q%d: inputs are not short+int: %d %d\n", Q, (int)a, (int)b); 
    266272   } 
     273   if (ABS32(b)>=(1<<(15+Q))) 
     274      fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d\n", Q, (int)a, (int)b);       
    267275   res = (((long long)a)*(long long)b) >> Q; 
    268276   if (!VERIFY_INT(res)) 
    269277      fprintf (stderr, "MULT16_32_Q%d: output is not int: %d*%d=%d\n", Q, (int)a, (int)b,(int)res); 
     278   spx_mips+=5; 
     279   return res; 
     280} 
     281 
     282static inline int MULT16_32_PX(int a, long long b, int Q) 
     283{ 
     284   long long res; 
     285   if (!VERIFY_SHORT(a) || !VERIFY_INT(b)) 
     286   { 
     287      fprintf (stderr, "MULT16_32_P%d: inputs are not short+int: %d %d\n", Q, (int)a, (int)b); 
     288   } 
     289   if (ABS32(b)>=(1<<(15+Q))) 
     290      fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d\n", Q, (int)a, (int)b);       
     291   res = ((((long long)a)*(long long)b) + ((1<<Q)>>1))>> Q; 
     292   if (!VERIFY_INT(res)) 
     293      fprintf (stderr, "MULT16_32_P%d: output is not int: %d*%d=%d\n", Q, (int)a, (int)b,(int)res); 
    270294   spx_mips+=5; 
    271295   return res; 
     
    279303#define MULT16_32_Q14(a,b) MULT16_32_QX(a,b,14) 
    280304#define MULT16_32_Q15(a,b) MULT16_32_QX(a,b,15) 
     305#define MULT16_32_P15(a,b) MULT16_32_PX(a,b,15) 
    281306#define MAC16_32_Q15(c,a,b) ADD32((c),MULT16_32_Q15((a),(b))) 
    282307 
     
    342367   res >>= 15; 
    343368   if (!VERIFY_SHORT(res)) 
     369   { 
    344370      fprintf (stderr, "MULT16_16_Q15: output is not short: %d\n", (int)res); 
     371   } 
    345372   spx_mips+=3; 
    346373   return res; 
Note: See TracChangeset for help on using the changeset viewer.