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