summaryrefslogtreecommitdiffstats
path: root/src/g711.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-10-01 20:16:28 +0000
committerLennart Poettering <lennart@poettering.net>2007-10-01 20:16:28 +0000
commit7d83e5c7816b5e343695a75ba58b32dbe1be969a (patch)
treebfd1dfc9b7c8f4a2aaf66c1b30e78355dee8c88a /src/g711.h
parent762196328ab7e60f1d2908fd5a337d2ca99726dd (diff)
move all sources down to a seperate src/ tree
git-svn-id: file:///home/lennart/svn/public/libsydney/trunk@34 9ba3c220-e4d3-45a2-8aa3-73fcc9aff6ce
Diffstat (limited to 'src/g711.h')
-rw-r--r--src/g711.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/g711.h b/src/g711.h
new file mode 100644
index 0000000..ef43e3f
--- /dev/null
+++ b/src/g711.h
@@ -0,0 +1,40 @@
+#ifndef foosydneyg711hfoo
+#define foosydneyg711hfoo
+
+/* g711.h - include for G711 u-law and a-law conversion routines
+**
+** Copyright (C) 2001 Chris Bagwell
+**
+** Permission to use, copy, modify, and distribute this software and its
+** documentation for any purpose and without fee is hereby granted, provided
+** that the above copyright notice appear in all copies and that both that
+** copyright notice and this permission notice appear in supporting
+** documentation. This software is provided "as is" without express or
+** implied warranty.
+*/
+
+/** Copied from sox */
+
+#include <inttypes.h>
+
+#ifdef FAST_ALAW_CONVERSION
+extern uint8_t _sa_13linear2alaw[0x2000];
+extern int16_t _sa_alaw2linear16[256];
+#define sa_13linear2alaw(sw) (_sa_13linear2alaw[(sw + 0x1000)])
+#define sa_alaw2linear16(uc) (_sa_alaw2linear16[uc])
+#else
+unsigned char sa_13linear2alaw(int16_t pcm_val);
+int16_t sa_alaw2linear16(unsigned char);
+#endif
+
+#ifdef FAST_ULAW_CONVERSION
+extern uint8_t _sa_14linear2ulaw[0x4000];
+extern int16_t _sa_ulaw2linear16[256];
+#define sa_14linear2ulaw(sw) (_sa_14linear2ulaw[(sw + 0x2000)])
+#define sa_ulaw2linear16(uc) (_sa_ulaw2linear16[uc])
+#else
+unsigned char sa_14linear2ulaw(int16_t pcm_val);
+int16_t sa_ulaw2linear16(unsigned char);
+#endif
+
+#endif