Talk:Jazz Jackrabbit RLE compression

From ModdingWiki
Jump to navigation Jump to search

RLE length calculation

I am not sure the description given on this page is correct; as far as I understand it, it suggests that a control byte value larger than 127 copies the next byte this value PLUS 127 times, which is thus a number between 128 + 127 and 255 + 127. In the implementation I am familiar with, a value larger than 127 means repeat the next byte value MINUS 127 times, a value between 128 -127 and 255 - 127, which makes more sense to me.

I have added the implementation I use at the bottom of the page, I think it is shorter, and though less technical, easier to understand. -Levellass (talk) 13:55, 21 January 2009‎ (GMT)

RLE should simply not be seen in terms of "value ranges" on the control byte at all. In reality, it's bit-wise; the highest bit in the byte indicates whether it is a repeat command, and to get the value, you simply use the remaining 7 bits. -Nyerguds (talk) 08:48, 26 April 2022 (GMT)