2.6.4 Converting Match Length into Length Header and Length Footer Values
The match length is converted into a length header and a length footer. The length header can have one of eight possible values, with a range of [0, 7], indicating a match of length 2, 3, 4, 5, 6, 7, 8, or a length greater than 8. If the match length is 8 or less, there is no length footer. Otherwise, the value of the length footer is equal to the match length minus 9. The following is a pseudocode example of obtaining the length header and footer.
-
if match_length <= 8 length_header ← match_length-2 length_footer ← null else length_header ← 7 length_footer ← match_length-9 endif
Match length |
Length header |
Length footer value |
---|---|---|
2 |
0 |
None |
3 |
1 |
None |
4 |
2 |
None |
5 |
3 |
None |
6 |
4 |
None |
7 |
5 |
None |
8 |
6 |
None |
9 |
7 |
0 |
10 |
7 |
1 |
… |
7 |
… |
n |
7 |
n-9 |