Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Better solution to mulaw/alaw conversion on big endi...
details: https://anonhg.NetBSD.org/src/rev/039a1d9feff0
branches: trunk
changeset: 354711:039a1d9feff0
user: nat <nat%NetBSD.org@localhost>
date: Mon Jun 26 12:17:09 2017 +0000
description:
Better solution to mulaw/alaw conversion on big endian systems/sound
devices.
diffstat:
sys/dev/mulaw.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diffs (70 lines):
diff -r 834d528700d3 -r 039a1d9feff0 sys/dev/mulaw.c
--- a/sys/dev/mulaw.c Mon Jun 26 11:45:46 2017 +0000
+++ b/sys/dev/mulaw.c Mon Jun 26 12:17:09 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mulaw.c,v 1.31 2017/06/26 11:45:46 nat Exp $ */
+/* $NetBSD: mulaw.c,v 1.32 2017/06/26 12:17:09 nat 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.31 2017/06/26 11:45:46 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mulaw.c,v 1.32 2017/06/26 12:17:09 nat Exp $");
#include <sys/types.h>
#include <sys/systm.h>
@@ -321,10 +321,10 @@
break; \
case AUDIO_ENCODING_ULINEAR_BE: \
FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) { \
- j = hw - 2; \
+ j = 2; \
d[0] = mulawtolin16[s[0]][0]; \
d[1] = mulawtolin16[s[0]][1]; \
- while (j > 0 && j < hw) \
+ while (j < hw) \
d[j++] = 0; \
} FILTER_LOOP_EPILOGUE(this->src, dst); \
break; \
@@ -339,10 +339,10 @@
break; \
case AUDIO_ENCODING_SLINEAR_BE: \
FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) { \
- j = hw - 2; \
+ j = 2; \
d[0] = mulawtolin16[s[0]][0] ^ 0x80; \
d[1] = mulawtolin16[s[0]][1]; \
- while (j > 0 && j < hw) \
+ while (j < hw) \
d[j++] = 0; \
} FILTER_LOOP_EPILOGUE(this->src, dst); \
break; \
@@ -456,10 +456,10 @@
break; \
case AUDIO_ENCODING_ULINEAR_BE: \
FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) { \
- j = hw - 2; \
+ j = 2; \
d[0] = alawtolin16[s[0]][0]; \
d[1] = alawtolin16[s[0]][1]; \
- while (j > 0 && j < hw) \
+ while (j < hw) \
d[j++] = 0; \
} FILTER_LOOP_EPILOGUE(this->src, dst); \
break; \
@@ -474,10 +474,10 @@
break; \
case AUDIO_ENCODING_SLINEAR_BE: \
FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) { \
- j = hw - 2; \
+ j = 2; \
d[0] = alawtolin16[s[0]][0] ^ 0x80; \
d[1] = alawtolin16[s[0]][1]; \
- while (j > 0 && j < hw) \
+ while (j < hw) \
d[j++] = 0; \
} FILTER_LOOP_EPILOGUE(this->src, dst); \
break; \
Home |
Main Index |
Thread Index |
Old Index