comp.lang.ada
 help / color / mirror / Atom feed
From: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen)
Subject: Re: bitstreams
Date: 14 Jan 2001 10:10:11 -0500
Date: 2001-01-14T10:10:11-05:00	[thread overview]
Message-ID: <R9MKoHxn62qo@eisner.decus.org> (raw)
In-Reply-To: 93se2v$nen$1@eol.dd.chalmers.se

In article <93se2v$nen$1@eol.dd.chalmers.se>, "Daniel Nilsson" <danielnilsson@REMOVE_THIShem3.passagen.se> writes:

> In my mp3 decoder I will have to search for bit-patterns in a buffer of
> bytes, how is this best done, and How can I "shift" in a sequence of bits
> into a byte, or word efficiently? (I want ex. take 5 bits from a buffer and
> put them rightadjusted in a unsigned_32)

Step 1.	Use a sequence of statements that correctly describes what you want.
Step 2.	Use a computer that can accomplish your goal efficiently.
Step 3.	Use a compiler that will optimize your statements into efficient
	machine instructions.

If your choice of computer or compiler is limited by some other
constraint that you failed to mention, play with it to get the
best performance.  If a compiler is really great you will not
be able to affect performance by changing between reasonable
source code representations (other than those specifically
documented to affect performance, such as certain pragmas).
In theory the compiler _should_ choose the most efficient
representation that correctly implements your source statement.



  reply	other threads:[~2001-01-14 15:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-14 14:47 bitstreams Daniel Nilsson
2001-01-14 15:10 ` Larry Kilgallen [this message]
2001-01-14 16:15 ` bitstreams tmoran
2001-01-14 19:46 ` bitstreams srini
2001-01-15 19:56   ` bitstreams mark_lundquist
2001-01-15 21:54     ` bitstreams Tucker Taft
2001-01-16  0:41       ` bitstreams Robert Dewar
2001-01-16  0:39     ` bitstreams Robert Dewar
2001-01-16 23:26       ` bitstreams Rajagopalan Srinivasan
2001-01-15 19:21 ` bitstreams mark_lundquist
2001-01-15 20:43   ` bitstreams Pat Rogers
2001-01-15 21:15     ` bitstreams mark_lundquist
2001-01-16  0:59   ` bitstreams Robert Dewar
2001-01-16 17:36     ` bitstreams mark_lundquist
2001-01-16 20:08       ` bitstreams Pat Rogers
2001-01-17  2:15         ` bitstreams Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox