-/* Decodes the Huffman-encoded matches and literal bytes in a block of
- * XPRESS-encoded data. */
-static int
-xpress_decompress_block(struct input_bitstream *istream,
- u8 uncompressed_data[],
- unsigned uncompressed_len,
- const u8 lens[],
- const u16 decode_table[])
-{
- unsigned curpos;
- unsigned huffsym;
- int ret;
- int match_len;
-
- curpos = 0;
- while (curpos < uncompressed_len) {
- ret = read_huffsym(istream, decode_table, lens,
- XPRESS_NUM_SYMBOLS, XPRESS_TABLEBITS,
- &huffsym, XPRESS_MAX_CODEWORD_LEN);
- if (ret)
- return ret;
-
- if (huffsym < XPRESS_NUM_CHARS) {
- uncompressed_data[curpos++] = huffsym;
- } else {
- match_len = xpress_decode_match(huffsym,
- curpos,
- uncompressed_len,
- uncompressed_data,
- istream);
- if (match_len < 0)
- return match_len;
- curpos += match_len;
- }
+ lz_copy(window_ptr, match_len, match_offset, window_end);
+
+ window_ptr += match_len;