xref: /dflybsd-src/contrib/xz/src/liblzma/api/lzma/delta.h (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino /**
286d7f5d3SJohn Marino  * \file        lzma/delta.h
386d7f5d3SJohn Marino  * \brief       Delta filter
486d7f5d3SJohn Marino  */
586d7f5d3SJohn Marino 
686d7f5d3SJohn Marino /*
786d7f5d3SJohn Marino  * Author: Lasse Collin
886d7f5d3SJohn Marino  *
986d7f5d3SJohn Marino  * This file has been put into the public domain.
1086d7f5d3SJohn Marino  * You can do whatever you want with this file.
1186d7f5d3SJohn Marino  *
1286d7f5d3SJohn Marino  * See ../lzma.h for information about liblzma as a whole.
1386d7f5d3SJohn Marino  */
1486d7f5d3SJohn Marino 
1586d7f5d3SJohn Marino #ifndef LZMA_H_INTERNAL
1686d7f5d3SJohn Marino #	error Never include this file directly. Use <lzma.h> instead.
1786d7f5d3SJohn Marino #endif
1886d7f5d3SJohn Marino 
1986d7f5d3SJohn Marino 
2086d7f5d3SJohn Marino /**
2186d7f5d3SJohn Marino  * \brief       Filter ID
2286d7f5d3SJohn Marino  *
2386d7f5d3SJohn Marino  * Filter ID of the Delta filter. This is used as lzma_filter.id.
2486d7f5d3SJohn Marino  */
2586d7f5d3SJohn Marino #define LZMA_FILTER_DELTA       LZMA_VLI_C(0x03)
2686d7f5d3SJohn Marino 
2786d7f5d3SJohn Marino 
2886d7f5d3SJohn Marino /**
2986d7f5d3SJohn Marino  * \brief       Type of the delta calculation
3086d7f5d3SJohn Marino  *
3186d7f5d3SJohn Marino  * Currently only byte-wise delta is supported. Other possible types could
3286d7f5d3SJohn Marino  * be, for example, delta of 16/32/64-bit little/big endian integers, but
3386d7f5d3SJohn Marino  * these are not currently planned since byte-wise delta is almost as good.
3486d7f5d3SJohn Marino  */
3586d7f5d3SJohn Marino typedef enum {
3686d7f5d3SJohn Marino 	LZMA_DELTA_TYPE_BYTE
3786d7f5d3SJohn Marino } lzma_delta_type;
3886d7f5d3SJohn Marino 
3986d7f5d3SJohn Marino 
4086d7f5d3SJohn Marino /**
4186d7f5d3SJohn Marino  * \brief       Options for the Delta filter
4286d7f5d3SJohn Marino  *
4386d7f5d3SJohn Marino  * These options are needed by both encoder and decoder.
4486d7f5d3SJohn Marino  */
4586d7f5d3SJohn Marino typedef struct {
4686d7f5d3SJohn Marino 	/** For now, this must always be LZMA_DELTA_TYPE_BYTE. */
4786d7f5d3SJohn Marino 	lzma_delta_type type;
4886d7f5d3SJohn Marino 
4986d7f5d3SJohn Marino 	/**
5086d7f5d3SJohn Marino 	 * \brief       Delta distance
5186d7f5d3SJohn Marino 	 *
5286d7f5d3SJohn Marino 	 * With the only currently supported type, LZMA_DELTA_TYPE_BYTE,
5386d7f5d3SJohn Marino 	 * the distance is as bytes.
5486d7f5d3SJohn Marino 	 *
5586d7f5d3SJohn Marino 	 * Examples:
5686d7f5d3SJohn Marino 	 *  - 16-bit stereo audio: distance = 4 bytes
5786d7f5d3SJohn Marino 	 *  - 24-bit RGB image data: distance = 3 bytes
5886d7f5d3SJohn Marino 	 */
5986d7f5d3SJohn Marino 	uint32_t dist;
6086d7f5d3SJohn Marino #	define LZMA_DELTA_DIST_MIN 1
6186d7f5d3SJohn Marino #	define LZMA_DELTA_DIST_MAX 256
6286d7f5d3SJohn Marino 
6386d7f5d3SJohn Marino 	/*
6486d7f5d3SJohn Marino 	 * Reserved space to allow possible future extensions without
6586d7f5d3SJohn Marino 	 * breaking the ABI. You should not touch these, because the names
6686d7f5d3SJohn Marino 	 * of these variables may change. These are and will never be used
6786d7f5d3SJohn Marino 	 * when type is LZMA_DELTA_TYPE_BYTE, so it is safe to leave these
6886d7f5d3SJohn Marino 	 * uninitialized.
6986d7f5d3SJohn Marino 	 */
7086d7f5d3SJohn Marino 	uint32_t reserved_int1;
7186d7f5d3SJohn Marino 	uint32_t reserved_int2;
7286d7f5d3SJohn Marino 	uint32_t reserved_int3;
7386d7f5d3SJohn Marino 	uint32_t reserved_int4;
7486d7f5d3SJohn Marino 	void *reserved_ptr1;
7586d7f5d3SJohn Marino 	void *reserved_ptr2;
7686d7f5d3SJohn Marino 
7786d7f5d3SJohn Marino } lzma_options_delta;
78