32 bits processor and single bit bitmap
-
I am hoping I do not get flamed for asking this here, but I am looking for answer and "use blink without delay" is not it. I need to build, for emulation purpose, single bit B&W bitmap. I like to start with 100x100 size. Now since the processor I am using is 32 bits processor how should I organize the bits array - 8 bits wide or 32 bits wide or does it matter as long as I process it correctly? I do understand that "real" bitmap provides some fills to make the array fit into selected width. Thanks for your time. Cheers Vaclav
-
I am hoping I do not get flamed for asking this here, but I am looking for answer and "use blink without delay" is not it. I need to build, for emulation purpose, single bit B&W bitmap. I like to start with 100x100 size. Now since the processor I am using is 32 bits processor how should I organize the bits array - 8 bits wide or 32 bits wide or does it matter as long as I process it correctly? I do understand that "real" bitmap provides some fills to make the array fit into selected width. Thanks for your time. Cheers Vaclav
Vaclav_Sal wrote:
Now since the processor I am using is 32 bits processor how should I organize the bits array - 8 bits wide or 32 bits wide or does it matter as long as I process it correctly?
Doesn't really matter... the only thing that really matters is that it rests on an 8bit boundary, because computers can handle that more efficiently than anything else (since RAM is allocated on 8bit boundaries). edit: What I mean by resting on an 8bit boundary means that if the sample resolution you're dealing with is one bit (or three bits) you'd still want to pack that to 8bits (fill the non-used bits even though you're not using them).
-
I am hoping I do not get flamed for asking this here, but I am looking for answer and "use blink without delay" is not it. I need to build, for emulation purpose, single bit B&W bitmap. I like to start with 100x100 size. Now since the processor I am using is 32 bits processor how should I organize the bits array - 8 bits wide or 32 bits wide or does it matter as long as I process it correctly? I do understand that "real" bitmap provides some fills to make the array fit into selected width. Thanks for your time. Cheers Vaclav
-
I would suggest that you make it 100 bits wide, rounded to the nearest 32 (i.e. 4 words). That will ensure that each row is aligned on a 32-bit boundary which is most efficient for this architecture.
Well, if you have to access each bit independently (i.e. sample-wise), bit packing is still way more efficient than doing block-wise packing.
-
Well, if you have to access each bit independently (i.e. sample-wise), bit packing is still way more efficient than doing block-wise packing.