read_huffsym_using_precode(struct input_bitstream *istream,
const u16 precode_decode_table[])
{
read_huffsym_using_precode(struct input_bitstream *istream,
const u16 precode_decode_table[])
{
read_huffsym_using_maincode(struct input_bitstream *istream,
const struct lzx_tables *tables)
{
read_huffsym_using_maincode(struct input_bitstream *istream,
const struct lzx_tables *tables)
{
read_huffsym_using_lencode(struct input_bitstream *istream,
const struct lzx_tables *tables)
{
read_huffsym_using_lencode(struct input_bitstream *istream,
const struct lzx_tables *tables)
{
read_huffsym_using_alignedcode(struct input_bitstream *istream,
const struct lzx_tables *tables)
{
read_huffsym_using_alignedcode(struct input_bitstream *istream,
const struct lzx_tables *tables)
{
- *
- * @block_size:
- * The size of the block, in bytes.
- *
- * @window:
- * Pointer to the beginning of the decompression window.
- *
- * @window_pos:
- * The position in the window at which the block starts.
- *
+ * @out_begin
+ * The beginning of the (uncompressed) output buffer.
+ * @out_next
+ * Pointer to the location in the (uncompressed) output buffer at which
+ * this block will start.
+ * @out_block_end
+ * Pointer to the location in the (uncompressed) output buffer at which
+ * this block will end.
* @istream:
* The input bitstream, positioned at the start of the block data.
*
* Returns 0 on success, or -1 if the data was invalid.
*/
static int
* @istream:
* The input bitstream, positioned at the start of the block data.
*
* Returns 0 on success, or -1 if the data was invalid.
*/
static int
-lzx_decompress_block(int block_type, u32 block_size,
- u8 *window, u32 window_pos,
+lzx_decompress_block(int block_type, u8 * const out_begin,
+ u8 * out_next, u8 * const out_block_end,
const struct lzx_tables *tables,
struct lzx_lru_queue *queue,
struct input_bitstream *istream)
{
const struct lzx_tables *tables,
struct lzx_lru_queue *queue,
struct input_bitstream *istream)
{
mainsym = read_huffsym_using_maincode(istream, tables);
if (mainsym < LZX_NUM_CHARS) {
/* Literal */
mainsym = read_huffsym_using_maincode(istream, tables);
if (mainsym < LZX_NUM_CHARS) {
/* Literal */
queue->R[2] = queue->R[1];
queue->R[1] = queue->R[0];
queue->R[0] = match_offset;
queue->R[2] = queue->R[1];
queue->R[1] = queue->R[0];
queue->R[0] = match_offset;
- lz_copy(window_ptr, match_len, match_offset, window_end,
+ lz_copy(out_next, match_len, match_offset, out_block_end,
-lzx_decompress(const void *compressed_data, size_t compressed_size,
- void *uncompressed_data, size_t uncompressed_size,
- void *_dec)
+lzx_decompress(const void *restrict compressed_data, size_t compressed_size,
+ void *restrict uncompressed_data, size_t uncompressed_size,
+ void *restrict _dec)
{
struct lzx_decompressor *dec = _dec;
struct input_bitstream istream;
struct lzx_lru_queue queue;
{
struct lzx_decompressor *dec = _dec;
struct input_bitstream istream;
struct lzx_lru_queue queue;
ret = lzx_read_block_header(&istream, dec->num_main_syms,
dec->window_order, &block_type,
&block_size, &dec->tables, &queue);
if (ret)
return ret;
ret = lzx_read_block_header(&istream, dec->num_main_syms,
dec->window_order, &block_type,
&block_size, &dec->tables, &queue);
if (ret)
return ret;