-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compact bitmap animation #10
Comments
Size reduction log:
The felix refactoring actually added 496 bytes. Maybe due to initialization via copy? Switching from int16_t to uint8_t enum size didn't make a difference. Let's try alphabet, we expect an improvement of about 20KB. |
Alphabet size:
That's an increase of 400 bytes. Was expecting a much greater reduction. OK, changed the ColorIndex to int16_t Ahh, reduction of 1584. And then, take ColorIndex to uin8_t: That reduced by 2556 (over the Felix) |
Outputting the assembly code by adding But the initialization is weird. It's broken into chunks somehow. |
Using a static pixelIndexes[52][64]: Reduction from Felix is 4144. Still expecting better. By reducing each pixel from 4 bytes to 1 byte saves 3 bytes. Over a total of 52 x 64 pixels, that should reduce by 9984 The assembly code does have |
Using [][] instead of vector provides reduction, but not as much as theoretically possible. I think it's best to leave it at that for now. The main test would be if after turning of -Os, the program can fit. |
After refactoring dice animation: With ColorIndex : uint16_t, size was 0xdeb80, with uint32_t, size was 0xdee70 |
After refactoring EmojiAnimation: Reduction over Felix was 7104 |
Did not refactor all the animations becuse it got difficult. See #18. Did do the worst ones, Emoji and alphabet. |
Currently, bitmap animations are defined with
std::vector<uint32_t>
. This gobbles up memory. Indeed, have to compile with-Os
.We propose a color table model like that used in Felix. Use
std::vector<uint8_t>
orstd::vector<uint16_t> along with a color table of
uint32_t[]``.Comverting existing data should be easy using search and replace.
The text was updated successfully, but these errors were encountered: