mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
Spell std/deflate's "literal/length" consistently
This commit is contained in:
1 parent
098cad9c95
commit
dc1218fec0
4 files changed
+7
-7
No files matched your search
@@ -245,7 +245,7 @@ var deflateGlobals struct {
|
|||||||
|
|
||||||
// Dynamic Huffman state.
|
// Dynamic Huffman state.
|
||||||
whichHuffman uint32
|
whichHuffman uint32
|
||||||
// 0=Unused, 1=CodeLength, 2=Length/Literal, 3=Distance.
|
// 0=Unused, 1=CodeLength, 2=Literal/Length, 3=Distance.
|
||||||
huffmans [4]deflateHuffmanTable
|
huffmans [4]deflateHuffmanTable
|
||||||
|
|
||||||
// DHH (Dynamic Huffman, inside a Huffman table) state.
|
// DHH (Dynamic Huffman, inside a Huffman table) state.
|
||||||
@@ -325,7 +325,7 @@ func deflateGlobalsWriteDynamicHuffmanTables() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write the Huffman tables for Length/Literal and Distance.
|
// Write the Huffman tables for Literal/Length and Distance.
|
||||||
{
|
{
|
||||||
numZeroes := uint32(0)
|
numZeroes := uint32(0)
|
||||||
for i := uint32(0); i < numLCodes+numDCodes; i++ {
|
for i := uint32(0); i < numLCodes+numDCodes; i++ {
|
||||||
@@ -419,7 +419,7 @@ func parseDeflateWhichHuffman(s string) (num uint32, remaining string, ok bool)
|
|||||||
switch s {
|
switch s {
|
||||||
case "CodeLength":
|
case "CodeLength":
|
||||||
return 1, remaining, true
|
return 1, remaining, true
|
||||||
case "Length/Literal":
|
case "Literal/Length":
|
||||||
return 2, remaining, true
|
return 2, remaining, true
|
||||||
case "Distance":
|
case "Distance":
|
||||||
return 3, remaining, true
|
return 3, remaining, true
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ pri func decoder.decode_huffman_fast!(dst: base.io_writer, src: base.io_reader)
|
|||||||
// RFC section 3.2.5. Compressed blocks (length and distance codes).
|
// RFC section 3.2.5. Compressed blocks (length and distance codes).
|
||||||
//
|
//
|
||||||
// For reading, strictly speaking, we only need 6 bytes (48 bits) of
|
// For reading, strictly speaking, we only need 6 bytes (48 bits) of
|
||||||
// available input, because the H-L length/literal code is up to 15 bits
|
// available input, because the H-L Literal/Length code is up to 15 bits
|
||||||
// plus up to 5 extra bits, the H-D distance code is up to 15 bits plus up
|
// plus up to 5 extra bits, the H-D Distance code is up to 15 bits plus up
|
||||||
// to 13 extra bits and 15 + 5 + 15 + 13 == 48. However,
|
// to 13 extra bits and 15 + 5 + 15 + 13 == 48. However,
|
||||||
// args.src.available() assertions are made in terms of bytes, not bits.
|
// args.src.available() assertions are made in terms of bytes, not bits.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ blockDynamicHuffman (final) {
|
|||||||
18 11
|
18 11
|
||||||
}
|
}
|
||||||
|
|
||||||
huffman Length/Literal {
|
huffman Literal/Length {
|
||||||
# 102='f', 111='o', 256=EOB
|
# 102='f', 111='o', 256=EOB
|
||||||
111 0
|
111 0
|
||||||
102 10
|
102 10
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ blockDynamicHuffman (final) {
|
|||||||
# primLen 9: 852 entries = 512 prim + 340 seco
|
# primLen 9: 852 entries = 512 prim + 340 seco
|
||||||
# @1 @2 @3 @4 @5 @6 @7 @8 @9 @10 @11 @12 @13 @14 @15
|
# @1 @2 @3 @4 @5 @6 @7 @8 @9 @10 @11 @12 @13 @14 @15
|
||||||
# 1 1 1 0 0 0 0 0 0; 1 229 49 1 1 2
|
# 1 1 1 0 0 0 0 0 0; 1 229 49 1 1 2
|
||||||
huffman Length/Literal {
|
huffman Literal/Length {
|
||||||
0 0
|
0 0
|
||||||
1 10
|
1 10
|
||||||
2 110
|
2 110
|
||||||
|
|||||||
Reference in new issue
Block a user