-
Notifications
You must be signed in to change notification settings - Fork 1
/
ECL_ZeroDevourer.txt
38 lines (33 loc) · 1.07 KB
/
ECL_ZeroDevourer.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
ZeroDevourer stream format.
Refers to functionality from:
- ECL_JH.txt
- ECL_E_number_format.txt
1. Stream consists of independent blocks aligned with JumpingHeader.
2. Decompressor logic for each block (error conditions are not checked in this example):
not_zero = read bit from JumpingHeader
if not_zero == 0:
add zero byte to output stream
continue to next block
else:
opcode = read 2 bits from JumpingHeader
if opcode == 0:
count_x = read 2 bits from JumpingHeader
count_x = count_x + 1
count_0 = 1
else if opcode == 1:
count_x = read 4 bits from JumpingHeader
count_x = count_x + 5
count_0 = 1
else if opcode == 2:
count_x = 0
count_0 = read E4 number from JumpingHeader
count_0 = count_0 + 9
else: // opcode == 3
count_x = read E6E3 number from JumpingHeader
count_x = count_x + 1
count_0 = 0
src_pointer = JumpingHeader.next
JumpingHeader.jump(count_x)
copy count_x bytes from src_pointer to output
add count_0 zero bytes to output
That's it.