You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Compression/README.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -43,13 +43,13 @@ Used by ZX0 compressor
43
43
?a?b?c?d?e?f?g?h? = ? a ? b ? c ? d ? e ? f ? g ? h ? -> 1:abcdefgh
44
44
45
45
46
-
Reading from the bit stream is always 2 bits apart, so even. This makes it possible to solve the test whether the buffer in `A` is empty only in odd reading.
46
+
Reading from the bit stream is always 2 bits apart, so `even`. This makes it possible to solve the test whether the buffer in `A` is empty only in `odd` reading.
47
47
48
48
A stop bit with a value of 1 is loaded into the accumulator, indicating the end of the data in the buffer.
49
49
50
50
Each read means moving a bit from `A` to the carry register.
51
51
52
-
In the case of an odd reading, before using the carry, it is checked whether the accumulator is empty.
52
+
In the case of an `odd` reading, before using the carry, it is checked whether the accumulator is empty.
53
53
If there is, then there is no data in the carry, but a bit stop.
54
54
So, a new byte is read into the accumulator and a new bit is read rotation "rla" or "adc A,A" load a new bit and at the same time set the stop bit.
55
55
@@ -60,21 +60,21 @@ So `A` looks like this:
60
60
???s0000
61
61
?s000000
62
62
```
63
-
Where `?` is waiting data, `s` is stop bit and `0` is filled.
63
+
Where `?` is pending data, `s` is stop bit and `0` is filled.
64
64
65
-
So another even read is sure that there is data in the accumulator.
65
+
So another `even` read is sure that there is data in the accumulator.
66
66
67
-
All values stored in Elias gamma coding have an odd number of bits.
68
-
This, together with one bit specifying the type of the literal, means that the total read is always an even number of bits.
67
+
All values stored in Elias gamma coding have an `odd` number of bits.
68
+
This, together with one bit specifying the type of the Literal, means that the total read is always an `even` number of bits.
69
69
70
-
The only exception is the second read of the literal for the new offset.
70
+
The only exception is the second read of the Literal for the new offset.
71
71
72
72
So reading the length is called after the test of the first bit. This means that the stored value must be greater than 1.
73
73
74
-
That wouldn't be a problem, because the literal is effective from length 2...
74
+
That wouldn't be a problem, because the Literal is effective from length 2...
75
75
76
-
But the author decided to reduce this value by 1 when saving to possibly save space.
77
-
So it is solved in such a way that to solve the problem that the length is equal to two, one bit is added.
76
+
But the author decided to reduce this value by 1 when saving to possibly save one bit space.
77
+
So a way that to solve the problem that the length is equal to two, one bit is added...
78
78
It is placed in the LSB offset so that it does not add space.
79
79
If the lowest bit is non-zero then Elias is not read and the length is set to 2.
0 commit comments