3 ms·
Some RLE encodings use negative values for a block of non-repeating data. So in its simple form AAABCD would be encoded as 3A -3BCD . Without negative values
by hyperman1 5y ago
Some RLE encodings use negative values for a block of non-repeating data. So in its simple form AAABCD would be encoded as 3A -3BCD . Without negative values this would be encoded as 3A 1B 1C 1D. The .TGA RLE format worked roughly like this. All of this means you need the length before you can look at the next bytes.
See e.g. page 24/27 of
https://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf https://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tg...