diff options
author | Nathan Binkert <nate@cvs.openbsd.org> | 2002-05-06 02:34:58 +0000 |
---|---|---|
committer | Nathan Binkert <nate@cvs.openbsd.org> | 2002-05-06 02:34:58 +0000 |
commit | 9a246c4046ced8d85023c972ac802cf402278351 (patch) | |
tree | 9411fe8f751d1fbd94d2ff7f18af4a20811a2475 /sys/dev/mulaw.c | |
parent | d48ead95a323d7195eb30b6ef442207a313b4d0f (diff) |
new conversion functions from NetBSD for uaudio
Diffstat (limited to 'sys/dev/mulaw.c')
-rw-r--r-- | sys/dev/mulaw.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/dev/mulaw.c b/sys/dev/mulaw.c index e049f3e571b..ed48659fe39 100644 --- a/sys/dev/mulaw.c +++ b/sys/dev/mulaw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mulaw.c,v 1.8 2001/12/31 04:14:00 mickey Exp $ */ +/* $OpenBSD: mulaw.c,v 1.9 2002/05/06 02:34:57 nate Exp $ */ /* $NetBSD: mulaw.c,v 1.15 2001/01/18 20:28:20 jdolecek Exp $ */ /* @@ -347,6 +347,17 @@ mulaw_to_slinear16_be(v, p, cc) } void +slinear16_to_mulaw_le(void *v, u_char* p, int cc) +{ + u_char *q = p + 1; /* q points higher byte. */ + + while (--cc >= 0) { + *p++ = lintomulaw[*q ^ 0x80]; + q +=2 ; + } +} + +void ulinear8_to_mulaw(v, p, cc) void *v; u_char *p; |