Skip to content
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

Improve RLE encoders and compliancy #6

Merged
merged 2 commits into from
Sep 2, 2023
Merged

Improve RLE encoders and compliancy #6

merged 2 commits into from
Sep 2, 2023

Conversation

cubicibo
Copy link
Owner

@cubicibo cubicibo commented Sep 2, 2023

BD specs claims that the length of all run-length encoded lines must be smaller than the width of the image + 16 (some "coding overhead").

The RLE method described in US7912305B1 may only produce RLE lines longer than the bitmap width when color 0x00 alternates with another every other pixel. If the situtation arises with a color other than 0x00, the encoded line length will equal the width, at worst.

This MR prevents the usage of color 0x00 in the bitmap, but not for padding.
Additionally, the RLE encoders and decoders have been rewritten from scratch to improve the logic and efficiency.

@cubicibo cubicibo merged commit 945de80 into main Sep 2, 2023
@cubicibo cubicibo deleted the MR/lineoverhead branch September 6, 2023 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant