What is the most efficient way to deinterlace bits from a 32 bit int? In this particular case, I only care about the odd bits, although I'm sure it's easy to generalize any solution to both sets.
For example, I want to convert 0b01000101 to 0b1011 . What is the fastest way?
EDIT:
In this application, I can guarantee that even bits are all zeros. Can I use this fact to improve speed or reduce space?
bit-manipulation integer z-order-curve
AShelly Jun 29 '10 at 1:32 2010-06-29 01:32
source share