Home | History | Annotate | Download | only in lzw

Lines Matching refs:code

2 // Use of this source code is governed by a BSD-style
34 // A code is a 12 bit value, stored as a uint32 when encoding to avoid
43 // lower 12 bits of a valid entry must be a non-literal code.
52 // converting a code stream into a byte stream.
60 // hi is the code implied by the next code emission.
61 // overflow is the code at which hi overflows the code width.
63 // savedCode is the accumulated code at the end of the most recent Write
71 // The keys consist of a 12-bit code prefix and an 8-bit byte suffix.
72 // The values are a 12-bit code.
76 // writeLSB writes the code c for "Least Significant Bits first" data.
90 // writeMSB writes the code c for "Most Significant Bits first" data.
105 // of unused codes and a clear code needs to be sent next.
109 // unused codes. In the latter case, incHi sends a clear code, resets the
150 code := e.savedCode
151 if code == invalidCode {
152 // The first code sent is always a literal code.
153 code, p = uint32(p[0]), p[1:]
158 key := code<<8 | literal
160 // and do not emit a code yet.
164 code = t & maxCode
170 // Otherwise, write the current code, and literal becomes the start of
171 // the next emitted code.
172 if e.err = e.write(e, code); e.err != nil {
175 code = literal
176 // Increment e.hi, the next implied code. If we run out of codes, reset
194 e.savedCode = code
218 // Write the eof code.