Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Jaroslav Kysela <perex@suse.cz>
To: linux-sound@vger.kernel.org
Subject: Re: [linux-audio-dev] Re: streaming from disk to terminatorX added
Date: Tue, 26 Oct 1999 12:31:06 +0000	[thread overview]
Message-ID: <marc-linux-sound-94094100806564@msgid-missing> (raw)
In-Reply-To: <marc-linux-sound-94081664808533@msgid-missing>

On Mon, 25 Oct 1999, Paul Barton-Davis wrote:

> In message <38151885.7A650570@42.fht-esslingen.de>you write:
> >Paul Barton-Davis wrote:
> >> just FYI: my C++ libsoundfile uses mmap(), but still requires
> >> applications to "read" the data. it is significantly faster than using
> >> read(2) internally, however, so there might be an argument for using
> >> mmap regardless of the endianness, and then using arch-dependent
> >> macros to fetch the data from the mmapped area. for example, on a
> >> little endian machine reading from a little endian RIFF/WAV file, the
> >> macros are essentially no-ops.
> >
> >No-ops? Do you mean you don't generate ANY code for this? If so: HOW?
> 
> sorry, not very accurate. for example:
> 
>        int16 foo;
>        unsigned char *p;
> 
>        foo = get_little_endian_int16 (p)
> 
> on an LE machine, this is just:
> 
>        foo = *((int16 *) p);
> 
> on a BE machine, its a bit more complex.

Not very much:

	#include <byteswap.h>

	foo = bswap_16(*((int16 *)p));

The defined macros from GLIBC already does byte swapping in the best way
for given architecture.

							Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
SuSE Linux    http://www.suse.com
ALSA project  http://www.alsa-project.org

  parent reply	other threads:[~1999-10-26 12:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-25  1:57 [linux-audio-dev] Re: streaming from disk to terminatorX added (via mmap) Paul Barton-Davis
1999-10-25 21:15 ` [linux-audio-dev] Re: streaming from disk to terminatorX added (via Alexander König
1999-10-25 21:56 ` [linux-audio-dev] Re: streaming from disk to terminatorX added (via mmap) Paul Barton-Davis
1999-10-26  0:33 ` David Olofson
1999-10-26  5:11 ` [linux-audio-dev] Re: streaming from disk to terminatorX added (via Alexander König
1999-10-26  7:04 ` [linux-audio-dev] Re: streaming from disk to terminatorX added Andy Lo A Foe
1999-10-26 12:31 ` Jaroslav Kysela [this message]
1999-10-27 14:45 ` [linux-audio-dev] Re: streaming from disk to terminatorX added (via mmap) Maarten de Boer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-sound-94094100806564@msgid-missing \
    --to=perex@suse.cz \
    --cc=linux-sound@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox