Add slinear16_to_mulaw_le().

This commit is contained in:
kent 2002-02-10 06:27:06 +00:00
parent b47221844a
commit 29b73c4025
2 changed files with 16 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mulaw.c,v 1.18 2001/11/13 05:32:50 lukem Exp $ */
/* $NetBSD: mulaw.c,v 1.19 2002/02/10 06:27:06 kent Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mulaw.c,v 1.18 2001/11/13 05:32:50 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: mulaw.c,v 1.19 2002/02/10 06:27:06 kent Exp $");
#include <sys/types.h>
#include <sys/audioio.h>
@ -330,6 +330,17 @@ mulaw_to_slinear16_be(void *v, u_char *p, int 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(void *v, u_char *p, int cc)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: mulaw.h,v 1.12 2001/10/02 23:31:55 augustss Exp $ */
/* $NetBSD: mulaw.h,v 1.13 2002/02/10 06:27:06 kent Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -39,9 +39,10 @@
/* Convert 8-bit mu-law to 16 bit unsigned linear. */
extern void mulaw_to_ulinear16_le(void *, u_char *buf, int cnt);
extern void mulaw_to_ulinear16_be(void *, u_char *buf, int cnt);
/* Convert 8-bit mu-law to 16 bit signed linear. */
/* Convert 8-bit mu-law from/to 16 bit signed linear. */
extern void mulaw_to_slinear16_le(void *, u_char *buf, int cnt);
extern void mulaw_to_slinear16_be(void *, u_char *buf, int cnt);
extern void slinear16_to_mulaw_le(void *, u_char *buf, int cnt);
/* Convert 8-bit mu-law to/from 8 bit unsigned linear. */
extern void mulaw_to_ulinear8(void *, u_char *buf, int cnt);
extern void ulinear8_to_mulaw(void *, u_char *buf, int cnt);