Lines Matching refs:code
257 int code; member
273 entries[i].code = Nil; in Dictionary()
278 int findIndex(const int code, const int value) const in findIndex()
280 if (code == Nil) return value; in findIndex()
285 if (entries[i].code == code && entries[i].value == value) return i; in findIndex()
290 bool add(const int code, const int value) in add()
293 entries[size].code = code; in add()
315 static bool outputByte(int code, uint8_t*& output, int outputSizeBytes, int& bytesDecodedSoFar) in outputByte() argument
318 *output++ = static_cast<uint8_t>(code); in outputByte()
324 static bool outputSequence(const Dictionary& dict, int code, uint8_t*& output, int outputSizeBytes,… in outputSequence() argument
332 sequence[i++] = dict.entries[code].value; in outputSequence()
333 code = dict.entries[code].code; in outputSequence()
334 } while (code >= 0); in outputSequence()
347 int code = Nil; in lzwDecode() local
363 code = static_cast<int>(bitStream.readBitsU64(codeBitsWidth)); in lzwDecode()
366 if (!outputByte(code, ptr, uncompressedSizeBytes, bytesDecoded)) break; in lzwDecode()
367 firstByte = code; in lzwDecode()
368 prevCode = code; in lzwDecode()
371 if (code >= dictionary.size) { in lzwDecode()
374 …} else if (!outputSequence(dictionary, code, ptr, uncompressedSizeBytes, bytesDecoded, firstByte))… in lzwDecode()
378 else prevCode = code; in lzwDecode()
388 int code = Nil; in lzwEncode() local
397 const int index = dictionary.findIndex(code, value); in lzwEncode()
400 code = index; in lzwEncode()
405 bitStream.appendBitsU64(code, codeBitsWidth); in lzwEncode()
410 dictionary.add(code, value); in lzwEncode()
412 code = value; in lzwEncode()
416 if (code != Nil) bitStream.appendBitsU64(code, codeBitsWidth); in lzwEncode()