Article View: comp.compression.research
Article #45Re: Algorithm for finding set bits in a bit-string.
From: Eric Praetzel
Date: Tue, 28 Jul 1992 16:40
Date: Tue, 28 Jul 1992 16:40
22 lines
2004 bytes
2004 bytes
In article <MOSS.92Jul25222337@ibis.cs.umass.edu> moss@cs.umass.edu writes: >The "find first set bit" operation was recently discussed at length in >comp.arch, and could be relevant, especially if the one bits are sparse. If An interesting application is to locate point sources on a CCD scaned image. In a virtual reality case here the sources of IR light are 4 LED emitters mounted on the back of the helmet that holds 2 cameras. The LEDs are not in one plane so location of full spatial postion is possible. By using a run length encoding the 300 * 400 CCD map can be "compressed" and processed so that when the data is read by the program most of the background 0's have been compressed into a # representing the count. The result is that in real time (60 Hz) the computer (with a very limited input bandwidth) can take in the compressed image, find the sources, refine their location to about 1/3000 (center extraction) and do it in real time. This is the only real world application I know of where data compression actually aided in processing of the data. And getting back around to square one. All that this thing is, is a glorified set bit searcher :-) As for S/W solutions, the best would be an array (assuming its a smallish 8 or maby 10 bit #) but that can vary depending upon architecture. If its a bigger number then just divide it into byte sized pieces and work your way up thru the bytes. This may or may not be faster than bit shift/test carry. - Eric
Technical Details
Message-ID:
<Bs3yBx.7AA@watserv1.uwaterloo.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!utcsri!torn!watserv1!marconi.waterloo.edu!praetzelReferences:
<1992Jul26.010325.9885@infonode.ingr.com> <MOSS.92Jul25222337@ibis.cs.umass.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.compression.research Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!torn!watserv1!marconi.waterloo.edu!praetzel From: praetzel@marconi.waterloo.edu (Eric Praetzel) Subject: Re: Algorithm for finding set bits in a bit-string. Message-ID: <Bs3yBx.7AA@watserv1.uwaterloo.ca> Sender: news@watserv1.uwaterloo.ca Organization: University of Waterloo References: <1992Jul26.010325.9885@infonode.ingr.com> <MOSS.92Jul25222337@ibis.cs.umass.edu> Date: Tue, 28 Jul 1992 16:40:45 GMT Lines: 23