summaryrefslogtreecommitdiffstats
path: root/src/g711.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-01-23 02:43:43 +0000
committerLennart Poettering <lennart@poettering.net>2005-01-23 02:43:43 +0000
commiteba917e0f52c45e06ba46ff374987ae19179cc30 (patch)
tree1717260157cd0efd16274e531ea41d7063c365cc /src/g711.h
parent038c4e790c1e7fb8f6a6b264913ae534d247cf93 (diff)
add softmodem support
git-svn-id: file:///home/lennart/svn/public/ivcall/trunk@22 e0b13411-74c3-0310-b366-a0654dd0340f
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..259417c
--- /dev/null
+++ b/src/g711.h
@@ -0,0 +1,40 @@
+#ifndef foog711hfoo
+#define foog711hfoo
+
+/* 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 -- Lennart Poettring */
+
+#include <inttypes.h>
+
+#ifdef FAST_ALAW_CONVERSION
+extern uint8_t _st_13linear2alaw[0x2000];
+extern int16_t _st_alaw2linear16[256];
+#define st_13linear2alaw(sw) (_st_13linear2alaw[(sw + 0x1000)])
+#define st_alaw2linear16(uc) (_st_alaw2linear16[uc])
+#else
+unsigned char st_13linear2alaw(int16_t pcm_val);
+int16_t st_alaw2linear16(unsigned char);
+#endif
+
+#ifdef FAST_ULAW_CONVERSION
+extern uint8_t _st_14linear2ulaw[0x4000];
+extern int16_t _st_ulaw2linear16[256];
+#define st_14linear2ulaw(sw) (_st_14linear2ulaw[(sw + 0x2000)])
+#define st_ulaw2linear16(uc) (_st_ulaw2linear16[uc])
+#else
+unsigned char st_14linear2ulaw(int16_t pcm_val);
+int16_t st_ulaw2linear16(unsigned char);
+#endif
+
+#endif