summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2007-11-05 00:17:29 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2007-11-05 00:17:29 +0000
commit807508d2835434424b1a9b4ff449247de67abb5e (patch)
tree82e12f7944552ddbee8fd3747e0acaad0779e686
parente9b7a83f6578c78422460eb291021722dc97c534 (diff)
audio encoding conversion cleanup
- the endianness of the conversions don't depend on the endianness of machine the conversions are built on, but the endianness of the audio data itself. choose encoding conversions explicitly, instead of relying on #defines based on the endianness of the machine. - replace home-grown conversions with comparable conversions in auconv.c and mulaw.c - use the proper conversion for ulinear_be:16 -> slinear_le:16 in auixp(4) thanks ajacoutot@ and sthen@ for !x86 testing
-rw-r--r--sys/arch/macppc/dev/awacs.c52
-rw-r--r--sys/arch/macppc/dev/i2s.c47
-rw-r--r--sys/arch/zaurus/dev/zaurus_audio.c38
-rw-r--r--sys/dev/isa/ad1848.c8
-rw-r--r--sys/dev/isa/ess.c6
-rw-r--r--sys/dev/isa/sbdsp.c12
-rw-r--r--sys/dev/pci/auixp.c38
-rw-r--r--sys/dev/pci/cs4280.c10
-rw-r--r--sys/dev/pci/neo.c12
-rw-r--r--sys/dev/pci/sv.c8
-rw-r--r--sys/dev/usb/uaudio.c8
11 files changed, 79 insertions, 160 deletions
diff --git a/sys/arch/macppc/dev/awacs.c b/sys/arch/macppc/dev/awacs.c
index 380b4a79e9e..b7dcfd723fd 100644
--- a/sys/arch/macppc/dev/awacs.c
+++ b/sys/arch/macppc/dev/awacs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: awacs.c,v 1.20 2007/09/17 01:33:33 krw Exp $ */
+/* $OpenBSD: awacs.c,v 1.21 2007/11/05 00:17:28 jakemsr Exp $ */
/* $NetBSD: awacs.c,v 1.4 2001/02/26 21:07:51 wiz Exp $ */
/*-
@@ -122,10 +122,6 @@ void awacs_write_codec(struct awacs_softc *, int);
void awacs_set_speaker_volume(struct awacs_softc *, int, int);
void awacs_set_ext_volume(struct awacs_softc *, int, int);
void awacs_set_rate(struct awacs_softc *, struct audio_params *);
-void awacs_mono16_to_stereo16(void *, u_char *, int);
-void awacs_swap_bytes_mono16_to_stereo16(void *, u_char *, int);
-void awacs_cvt_ulinear_mono_16_be(void *, u_char *, int);
-void awacs_cvt_ulinear_mono_16_le(void *, u_char *, int);
struct cfattach awacs_ca = {
sizeof(struct awacs_softc), awacs_match, awacs_attach
@@ -555,43 +551,6 @@ awacs_query_encoding(void *h, struct audio_encoding *ae)
return (0);
}
-void
-awacs_mono16_to_stereo16(void *v, u_char *p, int cc)
-{
- int x;
- int16_t *src, *dst;
-
- src = (void *)(p + cc);
- dst = (void *)(p + cc * 2);
- while (cc > 0) {
- x = *--src;
- *--dst = x;
- *--dst = x;
- cc -= 2;
- }
-}
-
-void
-awacs_swap_bytes_mono16_to_stereo16(void *v, u_char *p, int cc)
-{
- swap_bytes(v, p, cc);
- awacs_mono16_to_stereo16(v, p, cc);
-}
-
-void
-awacs_cvt_ulinear_mono_16_le(void *v, u_char *p, int cc)
-{
- swap_bytes_change_sign16_be(v, p, cc);
- awacs_mono16_to_stereo16(v, p, cc);
-}
-
-void
-awacs_cvt_ulinear_mono_16_be(void *v, u_char *p, int cc)
-{
- change_sign16_be(v, p, cc);
- awacs_mono16_to_stereo16(v, p, cc);
-}
-
int
awacs_set_params(void *h, int setmode, int usemode, struct audio_params *play,
struct audio_params *rec)
@@ -640,8 +599,7 @@ awacs_set_params(void *h, int setmode, int usemode, struct audio_params *play,
}
if (p->channels == 1 && p->precision == 16) {
p->factor = 2;
- p->sw_code =
- awacs_swap_bytes_mono16_to_stereo16;
+ p->sw_code = swap_bytes_mts;
break;
}
return (EINVAL);
@@ -650,7 +608,7 @@ awacs_set_params(void *h, int setmode, int usemode, struct audio_params *play,
break;
if (p->channels == 1 && p->precision == 16) {
p->factor = 2;
- p->sw_code = awacs_mono16_to_stereo16;
+ p->sw_code = noswap_bytes_mts;
break;
}
return (EINVAL);
@@ -661,7 +619,7 @@ awacs_set_params(void *h, int setmode, int usemode, struct audio_params *play,
}
if (p->channels == 1 && p->precision == 16) {
p->factor = 2;
- p->sw_code = awacs_cvt_ulinear_mono_16_le;
+ p->sw_code = swap_bytes_change_sign16_be_mts;
break;
}
return (EINVAL);
@@ -672,7 +630,7 @@ awacs_set_params(void *h, int setmode, int usemode, struct audio_params *play,
}
if (p->channels == 1 && p->precision == 16) {
p->factor = 2;
- p->sw_code = awacs_cvt_ulinear_mono_16_be;
+ p->sw_code = change_sign16_be_mts;
break;
}
return (EINVAL);
diff --git a/sys/arch/macppc/dev/i2s.c b/sys/arch/macppc/dev/i2s.c
index c82529f87fe..aafcdab4f00 100644
--- a/sys/arch/macppc/dev/i2s.c
+++ b/sys/arch/macppc/dev/i2s.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2s.c,v 1.9 2007/09/17 01:33:33 krw Exp $ */
+/* $OpenBSD: i2s.c,v 1.10 2007/11/05 00:17:28 jakemsr Exp $ */
/* $NetBSD: i2s.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */
/*-
@@ -54,7 +54,6 @@
#endif
struct i2s_mode *i2s_find_mode(u_int, u_int, u_int);
-void i2s_cs16mts(void *, u_char *, int);
static int gpio_read(char *);
static void gpio_write(char *, int);
@@ -65,9 +64,6 @@ int i2s_cint(void *);
u_char *i2s_gpio_map(struct i2s_softc *, char *, int *);
void i2s_init(struct i2s_softc *, int);
-static void mono16_to_stereo16(void *, u_char *, int);
-static void swap_bytes_mono16_to_stereo16(void *, u_char *, int);
-
/* XXX */
void keylargo_fcr_enable(int, u_int32_t);
void keylargo_fcr_disable(int, u_int32_t);
@@ -271,41 +267,6 @@ i2s_query_encoding(h, ae)
return (err);
}
-static void
-mono16_to_stereo16(v, p, cc)
- void *v;
- u_char *p;
- int cc;
-{
- int x;
- int16_t *src, *dst;
-
- src = (void *)(p + cc);
- dst = (void *)(p + cc * 2);
- while (cc > 0) {
- x = *--src;
- *--dst = x;
- *--dst = x;
- cc -= 2;
- }
-}
-
-static void
-swap_bytes_mono16_to_stereo16(v, p, cc)
- void *v;
- u_char *p;
- int cc;
-{
- swap_bytes(v, p, cc);
- mono16_to_stereo16(v, p, cc);
-}
-
-void
-i2s_cs16mts(void *v, u_char *p, int cc)
-{
- mono16_to_stereo16(v, p, cc);
- change_sign16_be(v, p, cc * 2);
-}
struct i2s_mode {
u_int encoding;
@@ -316,11 +277,11 @@ struct i2s_mode {
} i2s_modes[] = {
{ AUDIO_ENCODING_SLINEAR_LE, 8, 1, linear8_to_linear16_be_mts, 4 },
{ AUDIO_ENCODING_SLINEAR_LE, 8, 2, linear8_to_linear16_be, 2 },
- { AUDIO_ENCODING_SLINEAR_LE, 16, 1, swap_bytes_mono16_to_stereo16, 2 },
+ { AUDIO_ENCODING_SLINEAR_LE, 16, 1, swap_bytes_mts, 2 },
{ AUDIO_ENCODING_SLINEAR_LE, 16, 2, swap_bytes, 1 },
{ AUDIO_ENCODING_SLINEAR_BE, 8, 1, linear8_to_linear16_be_mts, 4 },
{ AUDIO_ENCODING_SLINEAR_BE, 8, 2, linear8_to_linear16_be, 2 },
- { AUDIO_ENCODING_SLINEAR_BE, 16, 1, mono16_to_stereo16, 2 },
+ { AUDIO_ENCODING_SLINEAR_BE, 16, 1, noswap_bytes_mts, 2 },
{ AUDIO_ENCODING_SLINEAR_BE, 16, 2, NULL, 1 },
{ AUDIO_ENCODING_ULINEAR_LE, 8, 1, ulinear8_to_linear16_be_mts, 4 },
{ AUDIO_ENCODING_ULINEAR_LE, 8, 2, ulinear8_to_linear16_be, 2 },
@@ -328,7 +289,7 @@ struct i2s_mode {
{ AUDIO_ENCODING_ULINEAR_LE, 16, 2, swap_bytes_change_sign16_be, 1 },
{ AUDIO_ENCODING_ULINEAR_BE, 8, 1, ulinear8_to_linear16_be_mts, 4 },
{ AUDIO_ENCODING_ULINEAR_BE, 8, 2, ulinear8_to_linear16_be, 2 },
- { AUDIO_ENCODING_ULINEAR_BE, 16, 1, i2s_cs16mts, 2 },
+ { AUDIO_ENCODING_ULINEAR_BE, 16, 1, change_sign16_be_mts, 2 },
{ AUDIO_ENCODING_ULINEAR_BE, 16, 2, change_sign16_be, 1 }
};
diff --git a/sys/arch/zaurus/dev/zaurus_audio.c b/sys/arch/zaurus/dev/zaurus_audio.c
index dbe3b5004b5..d8ce681a6a5 100644
--- a/sys/arch/zaurus/dev/zaurus_audio.c
+++ b/sys/arch/zaurus/dev/zaurus_audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_audio.c,v 1.8 2005/08/18 13:23:02 robert Exp $ */
+/* $OpenBSD: zaurus_audio.c,v 1.9 2007/11/05 00:17:28 jakemsr Exp $ */
/*
* Copyright (c) 2005 Christopher Pascoe <pascoe@openbsd.org>
@@ -553,11 +553,11 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 4;
- play->sw_code = mulaw_to_slinear16_mts;
+ play->sw_code = mulaw_to_slinear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = mulaw_to_slinear16;
+ play->sw_code = mulaw_to_slinear16_le;
break;
default:
return (EINVAL);
@@ -569,11 +569,11 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 4;
- play->sw_code = linear8_to_linear16_mts;
+ play->sw_code = linear8_to_linear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = linear8_to_linear16;
+ play->sw_code = linear8_to_linear16_le;
break;
default:
return (EINVAL);
@@ -602,11 +602,11 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
case 1:
play->factor = 4;
play->sw_code =
- ulinear8_to_linear16_mts;
+ ulinear8_to_linear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = ulinear8_to_linear16;
+ play->sw_code = ulinear8_to_linear16_le;
break;
default:
return (EINVAL);
@@ -616,10 +616,10 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 2;
- play->sw_code = change_sign16_mts;
+ play->sw_code = change_sign16_le_mts;
break;
case 2:
- play->sw_code = change_sign16;
+ play->sw_code = change_sign16_le;
break;
default:
return (EINVAL);
@@ -633,10 +633,10 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 4;
- play->sw_code = alaw_to_slinear16_mts;
+ play->sw_code = alaw_to_slinear16_le_mts;
case 2:
play->factor = 2;
- play->sw_code = alaw_to_slinear16;
+ play->sw_code = alaw_to_slinear16_le;
default:
return (EINVAL);
}
@@ -648,11 +648,11 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
case 1:
play->factor = 4;
play->sw_code =
- linear8_to_linear16_mts;
+ linear8_to_linear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = linear8_to_linear16;
+ play->sw_code = linear8_to_linear16_le;
break;
default:
return (EINVAL);
@@ -682,11 +682,11 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
case 1:
play->factor = 4;
play->sw_code =
- ulinear8_to_linear16_mts;
+ ulinear8_to_linear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = ulinear8_to_linear16;
+ play->sw_code = ulinear8_to_linear16_le;
break;
default:
return (EINVAL);
@@ -697,11 +697,11 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
case 1:
play->factor = 2;
play->sw_code =
- change_sign16_swap_bytes_mts;
+ swap_bytes_change_sign16_le_mts;
break;
case 2:
play->sw_code =
- change_sign16_swap_bytes;
+ swap_bytes_change_sign16_le;
break;
default:
return (EINVAL);
@@ -732,7 +732,7 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
break;
case AUDIO_ENCODING_ULINEAR_LE:
if (rec->precision == 16)
- rec->sw_code = change_sign16;
+ rec->sw_code = change_sign16_le;
break;
case AUDIO_ENCODING_ALAW:
rec->sw_code = ulinear8_to_alaw;
@@ -745,7 +745,7 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
break;
case AUDIO_ENCODING_ULINEAR_BE:
if (rec->precision == 16)
- rec->sw_code = swap_bytes_change_sign16;
+ rec->sw_code = change_sign16_swap_bytes_le;
break;
default:
return (EINVAL);
diff --git a/sys/dev/isa/ad1848.c b/sys/dev/isa/ad1848.c
index d2cdfad6a39..caf499d2e54 100644
--- a/sys/dev/isa/ad1848.c
+++ b/sys/dev/isa/ad1848.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ad1848.c,v 1.32 2005/05/22 19:40:51 art Exp $ */
+/* $OpenBSD: ad1848.c,v 1.33 2007/11/05 00:17:28 jakemsr Exp $ */
/* $NetBSD: ad1848.c,v 1.45 1998/01/30 02:02:38 augustss Exp $ */
/*
@@ -1040,14 +1040,14 @@ ad1848_set_params(addr, setmode, usemode, p, r)
case AUDIO_ENCODING_ULINEAR_LE:
if (p->precision == 16) {
enc = AUDIO_ENCODING_SLINEAR_LE;
- pswcode = rswcode = change_sign16;
+ pswcode = rswcode = change_sign16_le;
}
break;
case AUDIO_ENCODING_ULINEAR_BE:
if (p->precision == 16) {
enc = AUDIO_ENCODING_SLINEAR_LE;
- pswcode = swap_bytes_change_sign16;
- rswcode = change_sign16_swap_bytes;
+ pswcode = swap_bytes_change_sign16_le;
+ rswcode = change_sign16_swap_bytes_le;
}
break;
}
diff --git a/sys/dev/isa/ess.c b/sys/dev/isa/ess.c
index 1f7ddbb7569..b661ad8abb8 100644
--- a/sys/dev/isa/ess.c
+++ b/sys/dev/isa/ess.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ess.c,v 1.11 2006/02/22 19:43:42 miod Exp $ */
+/* $OpenBSD: ess.c,v 1.12 2007/11/05 00:17:28 jakemsr Exp $ */
/* $NetBSD: ess.c,v 1.44.4.1 1999/06/21 01:18:00 thorpej Exp $ */
/*
@@ -1247,14 +1247,14 @@ ess_set_params(addr, setmode, usemode, play, rec)
case AUDIO_ENCODING_ULAW:
if (mode == AUMODE_PLAY) {
p->factor = 2;
- p->sw_code = mulaw_to_ulinear16;
+ p->sw_code = mulaw_to_ulinear16_le;
} else
p->sw_code = ulinear8_to_mulaw;
break;
case AUDIO_ENCODING_ALAW:
if (mode == AUMODE_PLAY) {
p->factor = 2;
- p->sw_code = alaw_to_ulinear16;
+ p->sw_code = alaw_to_ulinear16_le;
} else
p->sw_code = ulinear8_to_alaw;
break;
diff --git a/sys/dev/isa/sbdsp.c b/sys/dev/isa/sbdsp.c
index 37eb608932c..c7a2a2a43f9 100644
--- a/sys/dev/isa/sbdsp.c
+++ b/sys/dev/isa/sbdsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbdsp.c,v 1.25 2006/12/29 13:04:37 pedro Exp $ */
+/* $OpenBSD: sbdsp.c,v 1.26 2007/11/05 00:17:28 jakemsr Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@@ -597,7 +597,7 @@ sbdsp_set_params(addr, setmode, usemode, play, rec)
break;
case AUDIO_ENCODING_ULAW:
if (mode == AUMODE_PLAY) {
- swcode = mulaw_to_ulinear16;
+ swcode = mulaw_to_ulinear16_le;
factor = 2;
m = &sbpmodes[PLAY16];
} else
@@ -606,7 +606,7 @@ sbdsp_set_params(addr, setmode, usemode, play, rec)
break;
case AUDIO_ENCODING_ALAW:
if (mode == AUMODE_PLAY) {
- swcode = alaw_to_ulinear16;
+ swcode = alaw_to_ulinear16_le;
factor = 2;
m = &sbpmodes[PLAY16];
} else
@@ -623,14 +623,14 @@ sbdsp_set_params(addr, setmode, usemode, play, rec)
case AUDIO_ENCODING_SLINEAR_LE:
break;
case AUDIO_ENCODING_ULINEAR_LE:
- swcode = change_sign16;
+ swcode = change_sign16_le;
break;
case AUDIO_ENCODING_SLINEAR_BE:
swcode = swap_bytes;
break;
case AUDIO_ENCODING_ULINEAR_BE:
swcode = mode == AUMODE_PLAY ?
- swap_bytes_change_sign16 : change_sign16_swap_bytes;
+ swap_bytes_change_sign16_le : change_sign16_swap_bytes_le;
break;
case AUDIO_ENCODING_ULAW:
swcode = mode == AUMODE_PLAY ?
@@ -705,7 +705,7 @@ sbdsp_set_params(addr, setmode, usemode, play, rec)
DPRINTF(("sbdsp_set_params: fd=%d, usemode=%d, idma=%d, odma=%d\n", sc->sc_fullduplex, usemode, sc->sc_i.dmachan, sc->sc_o.dmachan));
if (sc->sc_o.dmachan == sc->sc_drq8) {
/* Use 16 bit DMA for playing by expanding the samples. */
- play->sw_code = linear8_to_linear16;
+ play->sw_code = linear8_to_linear16_le;
play->factor = 2;
sc->sc_o.modep = &sbpmodes[PLAY16];
sc->sc_o.dmachan = sc->sc_drq16;
diff --git a/sys/dev/pci/auixp.c b/sys/dev/pci/auixp.c
index 3c0c8a716d7..6c535acafa1 100644
--- a/sys/dev/pci/auixp.c
+++ b/sys/dev/pci/auixp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auixp.c,v 1.12 2007/10/22 03:16:35 fgsch Exp $ */
+/* $OpenBSD: auixp.c,v 1.13 2007/11/05 00:17:28 jakemsr Exp $ */
/* $NetBSD: auixp.c,v 1.9 2005/06/27 21:13:09 thorpej Exp $ */
/*
@@ -375,11 +375,11 @@ auixp_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 4;
- play->sw_code = mulaw_to_slinear16_mts;
+ play->sw_code = mulaw_to_slinear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = mulaw_to_slinear16;
+ play->sw_code = mulaw_to_slinear16_le;
break;
default:
return (EINVAL);
@@ -391,11 +391,11 @@ auixp_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 4;
- play->sw_code = linear8_to_linear16_mts;
+ play->sw_code = linear8_to_linear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = linear8_to_linear16;
+ play->sw_code = linear8_to_linear16_le;
break;
default:
return (EINVAL);
@@ -423,11 +423,11 @@ auixp_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 4;
- play->sw_code = ulinear8_to_linear16_mts;
+ play->sw_code = ulinear8_to_linear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = ulinear8_to_linear16;
+ play->sw_code = ulinear8_to_linear16_le;
break;
default:
return (EINVAL);
@@ -437,10 +437,10 @@ auixp_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 2;
- play->sw_code = change_sign16_mts;
+ play->sw_code = change_sign16_le_mts;
break;
case 2:
- play->sw_code = change_sign16;
+ play->sw_code = change_sign16_le;
break;
default:
return (EINVAL);
@@ -454,11 +454,11 @@ auixp_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 4;
- play->sw_code = alaw_to_slinear16_mts;
+ play->sw_code = alaw_to_slinear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = alaw_to_slinear16;
+ play->sw_code = alaw_to_slinear16_le;
break;
default:
return (EINVAL);
@@ -470,11 +470,11 @@ auixp_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 4;
- play->sw_code = linear8_to_linear16_mts;
+ play->sw_code = linear8_to_linear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = linear8_to_linear16;
+ play->sw_code = linear8_to_linear16_le;
break;
default:
return (EINVAL);
@@ -503,11 +503,11 @@ auixp_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 4;
- play->sw_code = ulinear8_to_linear16_mts;
+ play->sw_code = ulinear8_to_linear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = ulinear8_to_linear16;
+ play->sw_code = ulinear8_to_linear16_le;
break;
default:
return (EINVAL);
@@ -517,10 +517,10 @@ auixp_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 2;
- play->sw_code = change_sign16_swap_bytes_mts;
+ play->sw_code = swap_bytes_change_sign16_le_mts;
break;
case 2:
- play->sw_code = change_sign16_swap_bytes;
+ play->sw_code = swap_bytes_change_sign16_le;
break;
default:
return (EINVAL);
@@ -552,7 +552,7 @@ auixp_set_params(void *hdl, int setmode, int usemode,
break;
case AUDIO_ENCODING_ULINEAR_LE:
if (rec->precision == 16)
- rec->sw_code = change_sign16;
+ rec->sw_code = change_sign16_le;
break;
case AUDIO_ENCODING_ALAW:
rec->sw_code = ulinear8_to_alaw;
@@ -565,7 +565,7 @@ auixp_set_params(void *hdl, int setmode, int usemode,
break;
case AUDIO_ENCODING_ULINEAR_BE:
if (rec->precision == 16)
- rec->sw_code = swap_bytes_change_sign16;
+ rec->sw_code = swap_bytes_change_sign16_le;
break;
default:
return (EINVAL);
diff --git a/sys/dev/pci/cs4280.c b/sys/dev/pci/cs4280.c
index 9485f5f37e6..28ec6c39829 100644
--- a/sys/dev/pci/cs4280.c
+++ b/sys/dev/pci/cs4280.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cs4280.c,v 1.28 2007/10/22 03:16:35 fgsch Exp $ */
+/* $OpenBSD: cs4280.c,v 1.29 2007/11/05 00:17:28 jakemsr Exp $ */
/* $NetBSD: cs4280.c,v 1.5 2000/06/26 04:56:23 simonb Exp $ */
/*
@@ -1162,7 +1162,7 @@ cs4280_set_params(addr, setmode, usemode, play, rec)
case AUDIO_ENCODING_ULINEAR_BE:
if (mode == AUMODE_RECORD) {
if (p->precision == 16)
- p->sw_code = change_sign16_swap_bytes;
+ p->sw_code = change_sign16_swap_bytes_le;
else
p->sw_code = change_sign8;
}
@@ -1170,7 +1170,7 @@ cs4280_set_params(addr, setmode, usemode, play, rec)
case AUDIO_ENCODING_ULINEAR_LE:
if (mode == AUMODE_RECORD) {
if (p->precision == 16)
- p->sw_code = change_sign16;
+ p->sw_code = change_sign16_le;
else
p->sw_code = change_sign8;
}
@@ -1178,7 +1178,7 @@ cs4280_set_params(addr, setmode, usemode, play, rec)
case AUDIO_ENCODING_ULAW:
if (mode == AUMODE_PLAY) {
p->factor = 2;
- p->sw_code = mulaw_to_slinear16;
+ p->sw_code = mulaw_to_slinear16_le;
} else {
p->sw_code = slinear8_to_mulaw;
}
@@ -1186,7 +1186,7 @@ cs4280_set_params(addr, setmode, usemode, play, rec)
case AUDIO_ENCODING_ALAW:
if (mode == AUMODE_PLAY) {
p->factor = 2;
- p->sw_code = alaw_to_slinear16;
+ p->sw_code = alaw_to_slinear16_le;
} else {
p->sw_code = slinear8_to_alaw;
}
diff --git a/sys/dev/pci/neo.c b/sys/dev/pci/neo.c
index a0b8f3e877b..13181e502f2 100644
--- a/sys/dev/pci/neo.c
+++ b/sys/dev/pci/neo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: neo.c,v 1.19 2005/08/09 04:10:13 mickey Exp $ */
+/* $OpenBSD: neo.c,v 1.20 2007/11/05 00:17:28 jakemsr Exp $ */
/*
* Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
@@ -884,26 +884,26 @@ neo_set_params(addr, setmode, usemode, play, rec)
case AUDIO_ENCODING_ULINEAR_BE:
if (p->precision == 16) {
if (mode == AUMODE_PLAY)
- p->sw_code = swap_bytes_change_sign16;
+ p->sw_code = swap_bytes_change_sign16_le;
else
- p->sw_code = change_sign16_swap_bytes;
+ p->sw_code = change_sign16_swap_bytes_le;
}
break;
case AUDIO_ENCODING_ULINEAR_LE:
if (p->precision == 16)
- p->sw_code = change_sign16;
+ p->sw_code = change_sign16_le;
break;
case AUDIO_ENCODING_ULAW:
if (mode == AUMODE_PLAY) {
p->factor = 2;
- p->sw_code = mulaw_to_slinear16;
+ p->sw_code = mulaw_to_slinear16_le;
} else
p->sw_code = ulinear8_to_mulaw;
break;
case AUDIO_ENCODING_ALAW:
if (mode == AUMODE_PLAY) {
p->factor = 2;
- p->sw_code = alaw_to_slinear16;
+ p->sw_code = alaw_to_slinear16_le;
} else
p->sw_code = ulinear8_to_alaw;
break;
diff --git a/sys/dev/pci/sv.c b/sys/dev/pci/sv.c
index 07002c45f64..78a2888cec8 100644
--- a/sys/dev/pci/sv.c
+++ b/sys/dev/pci/sv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sv.c,v 1.21 2005/09/11 18:17:08 mickey Exp $ */
+/* $OpenBSD: sv.c,v 1.22 2007/11/05 00:17:28 jakemsr Exp $ */
/*
* Copyright (c) 1998 Constantine Paul Sapuntzakis
@@ -684,13 +684,13 @@ sv_set_params(addr, setmode, usemode, p, r)
break;
case AUDIO_ENCODING_ULINEAR_BE:
if (p->precision == 16) {
- pswcode = swap_bytes_change_sign16;
- rswcode = change_sign16_swap_bytes;
+ pswcode = swap_bytes_change_sign16_le;
+ rswcode = change_sign16_swap_bytes_le;
}
break;
case AUDIO_ENCODING_ULINEAR_LE:
if (p->precision == 16)
- pswcode = rswcode = change_sign16;
+ pswcode = rswcode = change_sign16_le;
break;
case AUDIO_ENCODING_ULAW:
pswcode = mulaw_to_ulinear8;
diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c
index d69fcd12780..1f4aa281f7d 100644
--- a/sys/dev/usb/uaudio.c
+++ b/sys/dev/usb/uaudio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uaudio.c,v 1.54 2007/10/11 18:33:14 deraadt Exp $ */
+/* $OpenBSD: uaudio.c,v 1.55 2007/11/05 00:17:28 jakemsr Exp $ */
/* $NetBSD: uaudio.c,v 1.90 2004/10/29 17:12:53 kent Exp $ */
/*
@@ -3088,11 +3088,11 @@ uaudio_set_params(void *addr, int setmode, int usemode,
case AUDIO_ENCODING_ULINEAR_LE:
if (pre == 16) {
if (enc == AUDIO_ENCODING_ULINEAR_LE)
- swcode = change_sign16;
+ swcode = change_sign16_le;
else if (mode == AUMODE_PLAY)
- swcode = swap_bytes_change_sign16;
+ swcode = swap_bytes_change_sign16_le;
else
- swcode = change_sign16_swap_bytes;
+ swcode = change_sign16_swap_bytes_le;
enc = AUDIO_ENCODING_SLINEAR_LE;
} else if (pre == 8) {
if (flags & HAS_8U) {