mirror of
https://github.com/firewalkwithm3/qmk_firmware.git
synced 2024-11-23 03:50:28 +08:00
872 B
872 B
QMK QGF/QFF RLE data schema
There are two "modes" to the RLE algorithm used in both QGF/QFF:
- Non-repeating sections of octets, with associated length of up to
128
octetslength
=marker - 128
- A corresponding
length
number of octets follow directly after the marker octet
- Repeated octet with associated length, with associated length of up to
128
length
=marker
- A single octet follows the marker that should be repeated
length
times.
Decoder pseudocode:
while !EOF
marker = READ_OCTET()
if marker >= 128
length = marker - 128
for i = 0 ... length-1
c = READ_OCTET()
WRITE_OCTET(c)
else
length = marker
c = READ_OCTET()
for i = 0 ... length-1
WRITE_OCTET(c)