mirror of
https://git.tukaani.org/xz.git
synced 2025-03-31 12:50:56 +00:00
Originally the idea was that using LZMA_FULL_FLUSH with Stream encoder would read the filter chain from the same array that was used to intialize the Stream encoder. Since most apps wouldn't use LZMA_FULL_FLUSH, most apps wouldn't need to keep the filter chain available after initializing the Stream encoder. However, due to my mistake, it actually required keeping the array always available. Since setting the new filter chain via the array used at initialization time is not a nice way to do it for a couple of reasons, this commit ditches it and introduces lzma_filters_update(). This new function replaces also the "persistent" flag used by LZMA2 (and to-be-designed Subblock filter), which was also an ugly thing to do. Thanks to Alexey Tourbin for reminding me about the problem that Stream encoder used to require keeping the filter chain allocated.
38 lines
871 B
C
38 lines
871 B
C
///////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
/// \file delta_private.h
|
|
/// \brief Private common stuff for Delta encoder and decoder
|
|
//
|
|
// Author: Lasse Collin
|
|
//
|
|
// This file has been put into the public domain.
|
|
// You can do whatever you want with this file.
|
|
//
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef LZMA_DELTA_PRIVATE_H
|
|
#define LZMA_DELTA_PRIVATE_H
|
|
|
|
#include "delta_common.h"
|
|
|
|
struct lzma_coder_s {
|
|
/// Next coder in the chain
|
|
lzma_next_coder next;
|
|
|
|
/// Delta distance
|
|
size_t distance;
|
|
|
|
/// Position in history[]
|
|
uint8_t pos;
|
|
|
|
/// Buffer to hold history of the original data
|
|
uint8_t history[LZMA_DELTA_DIST_MAX];
|
|
};
|
|
|
|
|
|
extern lzma_ret lzma_delta_coder_init(
|
|
lzma_next_coder *next, lzma_allocator *allocator,
|
|
const lzma_filter_info *filters);
|
|
|
|
#endif
|