[xiph-commits] r12150 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Tue Nov 28 06:22:58 PST 2006


Author: jm
Date: 2006-11-28 06:22:55 -0800 (Tue, 28 Nov 2006)
New Revision: 12150

Modified:
   trunk/speex/libspeex/fixed_debug.h
Log:
better fixed-point debug info


Modified: trunk/speex/libspeex/fixed_debug.h
===================================================================
--- trunk/speex/libspeex/fixed_debug.h	2006-11-27 05:04:04 UTC (rev 12149)
+++ trunk/speex/libspeex/fixed_debug.h	2006-11-28 14:22:55 UTC (rev 12150)
@@ -159,8 +159,8 @@
    return res;
 }
 
-#define PSHR16(a,shift) (SHR16((a)+((1<<((shift))>>1)),shift))
-#define PSHR32(a,shift) (SHR32((a)+((1<<((shift))>>1)),shift))
+#define PSHR16(a,shift) (SHR16(ADD16((a),((1<<((shift))>>1))),shift))
+#define PSHR32(a,shift) (SHR32(ADD32((a),((1<<((shift))>>1))),shift))
 #define VSHR32(a, shift) (((shift)>0) ? SHR32(a, shift) : SHL32(a, -(shift)))
 
 #define SATURATE16(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
@@ -247,16 +247,17 @@
    return res;
 }
 
-static inline int MULT16_16(int a, int b) 
+#define MULT16_16(a, b) _MULT16_16(a, b, __FILE__, __LINE__)
+static inline int _MULT16_16(int a, int b, char *file, int line) 
 {
    long long res;
    if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
    {
-      fprintf (stderr, "MULT16_16: inputs are not short: %d %d\n", a, b);
+      fprintf (stderr, "MULT16_16: inputs are not short: %d %d in %s: line %d\n", a, b, file, line);
    }
    res = ((long long)a)*b;
    if (!VERIFY_INT(res))
-      fprintf (stderr, "MULT16_16: output is not int: %d\n", (int)res);
+      fprintf (stderr, "MULT16_16: output is not int: %d in %s: line %d\n", (int)res, file, line);
    spx_mips++;
    return res;
 }
@@ -429,23 +430,24 @@
    return res;
 }
 
+#define DIV32_16(a, b) _DIV32_16(a, b, __FILE__, __LINE__)
 
-static inline int DIV32_16(long long a, long long b) 
+static inline int _DIV32_16(long long a, long long b, char *file, int line) 
 {
    long long res;
    if (b==0)
    {
-      fprintf(stderr, "DIV32_16: divide by zero: %d/%d\n", (int)a, (int)b);
+      fprintf(stderr, "DIV32_16: divide by zero: %d/%d in %s: line %d\n", (int)a, (int)b, file, line);
       return 0;
    }
    if (!VERIFY_INT(a) || !VERIFY_SHORT(b))
    {
-      fprintf (stderr, "DIV32_16: inputs are not int/short: %d %d\n", (int)a, (int)b);
+      fprintf (stderr, "DIV32_16: inputs are not int/short: %d %d in %s: line %d\n", (int)a, (int)b, file, line);
    }
    res = a/b;
    if (!VERIFY_SHORT(res))
    {
-      fprintf (stderr, "DIV32_16: output is not short: %d / %d = %d\n", (int)a,(int)b,(int)res);
+      fprintf (stderr, "DIV32_16: output is not short: %d / %d = %d in %s: line %d\n", (int)a,(int)b,(int)res, file, line);
       if (res>32767)
          res = 32767;
       if (res<-32768)



More information about the commits mailing list