xref: /freebsd/contrib/xz/src/liblzma/api/lzma/delta.h (revision 2a58b312)
1 /**
2  * \file        lzma/delta.h
3  * \brief       Delta filter
4  * \note        Never include this file directly. Use <lzma.h> instead.
5  */
6 
7 /*
8  * Author: Lasse Collin
9  *
10  * This file has been put into the public domain.
11  * You can do whatever you want with this file.
12  */
13 
14 #ifndef LZMA_H_INTERNAL
15 #	error Never include this file directly. Use <lzma.h> instead.
16 #endif
17 
18 
19 /**
20  * \brief       Filter ID
21  *
22  * Filter ID of the Delta filter. This is used as lzma_filter.id.
23  */
24 #define LZMA_FILTER_DELTA       LZMA_VLI_C(0x03)
25 
26 
27 /**
28  * \brief       Type of the delta calculation
29  *
30  * Currently only byte-wise delta is supported. Other possible types could
31  * be, for example, delta of 16/32/64-bit little/big endian integers, but
32  * these are not currently planned since byte-wise delta is almost as good.
33  */
34 typedef enum {
35 	LZMA_DELTA_TYPE_BYTE
36 } lzma_delta_type;
37 
38 
39 /**
40  * \brief       Options for the Delta filter
41  *
42  * These options are needed by both encoder and decoder.
43  */
44 typedef struct {
45 	/** For now, this must always be LZMA_DELTA_TYPE_BYTE. */
46 	lzma_delta_type type;
47 
48 	/**
49 	 * \brief       Delta distance
50 	 *
51 	 * With the only currently supported type, LZMA_DELTA_TYPE_BYTE,
52 	 * the distance is as bytes.
53 	 *
54 	 * Examples:
55 	 *  - 16-bit stereo audio: distance = 4 bytes
56 	 *  - 24-bit RGB image data: distance = 3 bytes
57 	 */
58 	uint32_t dist;
59 
60 	/**
61 	 * \brief       Minimum value for lzma_options_delta.dist.
62 	 */
63 #	define LZMA_DELTA_DIST_MIN 1
64 
65 	/**
66 	 * \brief       Maximum value for lzma_options_delta.dist.
67 	 */
68 #	define LZMA_DELTA_DIST_MAX 256
69 
70 	/*
71 	 * Reserved space to allow possible future extensions without
72 	 * breaking the ABI. You should not touch these, because the names
73 	 * of these variables may change. These are and will never be used
74 	 * when type is LZMA_DELTA_TYPE_BYTE, so it is safe to leave these
75 	 * uninitialized.
76 	 */
77 
78 	/** \private     Reserved member. */
79 	uint32_t reserved_int1;
80 
81 	/** \private     Reserved member. */
82 	uint32_t reserved_int2;
83 
84 	/** \private     Reserved member. */
85 	uint32_t reserved_int3;
86 
87 	/** \private     Reserved member. */
88 	uint32_t reserved_int4;
89 
90 	/** \private     Reserved member. */
91 	void *reserved_ptr1;
92 
93 	/** \private     Reserved member. */
94 	void *reserved_ptr2;
95 
96 } lzma_options_delta;
97