]> icculus.org git repositories - icculus/xz.git/blob - src/liblzma/api/lzma/delta.h
963c7c0f5e64b95883004211f0af7d70f7b2a79a
[icculus/xz.git] / src / liblzma / api / lzma / delta.h
1 /**
2  * \file        lzma/delta.h
3  * \brief       Delta filter
4  *
5  * \author      Copyright (C) 1999-2006 Igor Pavlov
6  * \author      Copyright (C) 2007 Lasse Collin
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  */
18
19 #ifndef LZMA_H_INTERNAL
20 #       error Never include this file directly. Use <lzma.h> instead.
21 #endif
22
23
24 /**
25  * \brief       Filter ID
26  *
27  * Filter ID of the Delta filter. This is used as lzma_filter.id.
28  */
29 #define LZMA_FILTER_DELTA       LZMA_VLI_C(0x03)
30
31
32 /**
33  * \brief       Type of the delta calculation
34  *
35  * Currently only byte-wise delta is supported. Other possible types could
36  * be, for example, delta of 16/32/64-bit little/big endian integers, but
37  * these are not currently planned since byte-wise delta is almost as good.
38  */
39 typedef enum {
40         LZMA_DELTA_TYPE_BYTE
41 } lzma_delta_type;
42
43
44 /**
45  * \brief       Options for the Delta filter
46  *
47  * These options are needed by both encoder and decoder.
48  */
49 typedef struct {
50         /** For now, this must always be LZMA_DELTA_TYPE_BYTE. */
51         lzma_delta_type type;
52
53         /**
54          * \brief       Delta distance
55          *
56          * With the only currently supported type, LZMA_DELTA_TYPE_BYTE,
57          * the distance is as bytes.
58          *
59          * Examples:
60          *  - 16-bit stereo audio: distance = 4 bytes
61          *  - 24-bit RGB image data: distance = 3 bytes
62          */
63         uint32_t dist;
64 #       define LZMA_DELTA_DIST_MIN 1
65 #       define LZMA_DELTA_DIST_MAX 256
66
67         /*
68          * Reserved space to allow possible future extensions without
69          * breaking the ABI. You should not touch these, because the names
70          * of these variables may change. These are and will never be used
71          * when type is LZMA_DELTA_TYPE_BYTE, so it is safe to leave these
72          * uninitialized.
73          */
74         uint32_t reserved_int1;
75         uint32_t reserved_int2;
76         uint32_t reserved_int3;
77         uint32_t reserved_int4;
78         void *reserved_ptr1;
79         void *reserved_ptr2;
80
81 } lzma_options_delta;