1207753Smm/**
2207753Smm * \file        lzma/delta.h
3207753Smm * \brief       Delta filter
4207753Smm */
5207753Smm
6207753Smm/*
7207753Smm * Author: Lasse Collin
8207753Smm *
9207753Smm * This file has been put into the public domain.
10207753Smm * You can do whatever you want with this file.
11207753Smm *
12207753Smm * See ../lzma.h for information about liblzma as a whole.
13207753Smm */
14207753Smm
15207753Smm#ifndef LZMA_H_INTERNAL
16207753Smm#	error Never include this file directly. Use <lzma.h> instead.
17207753Smm#endif
18207753Smm
19207753Smm
20207753Smm/**
21207753Smm * \brief       Filter ID
22207753Smm *
23207753Smm * Filter ID of the Delta filter. This is used as lzma_filter.id.
24207753Smm */
25207753Smm#define LZMA_FILTER_DELTA       LZMA_VLI_C(0x03)
26207753Smm
27207753Smm
28207753Smm/**
29207753Smm * \brief       Type of the delta calculation
30207753Smm *
31207753Smm * Currently only byte-wise delta is supported. Other possible types could
32207753Smm * be, for example, delta of 16/32/64-bit little/big endian integers, but
33207753Smm * these are not currently planned since byte-wise delta is almost as good.
34207753Smm */
35207753Smmtypedef enum {
36207753Smm	LZMA_DELTA_TYPE_BYTE
37207753Smm} lzma_delta_type;
38207753Smm
39207753Smm
40207753Smm/**
41207753Smm * \brief       Options for the Delta filter
42207753Smm *
43207753Smm * These options are needed by both encoder and decoder.
44207753Smm */
45207753Smmtypedef struct {
46207753Smm	/** For now, this must always be LZMA_DELTA_TYPE_BYTE. */
47207753Smm	lzma_delta_type type;
48207753Smm
49207753Smm	/**
50207753Smm	 * \brief       Delta distance
51207753Smm	 *
52207753Smm	 * With the only currently supported type, LZMA_DELTA_TYPE_BYTE,
53207753Smm	 * the distance is as bytes.
54207753Smm	 *
55207753Smm	 * Examples:
56207753Smm	 *  - 16-bit stereo audio: distance = 4 bytes
57207753Smm	 *  - 24-bit RGB image data: distance = 3 bytes
58207753Smm	 */
59207753Smm	uint32_t dist;
60207753Smm#	define LZMA_DELTA_DIST_MIN 1
61207753Smm#	define LZMA_DELTA_DIST_MAX 256
62207753Smm
63207753Smm	/*
64207753Smm	 * Reserved space to allow possible future extensions without
65207753Smm	 * breaking the ABI. You should not touch these, because the names
66207753Smm	 * of these variables may change. These are and will never be used
67207753Smm	 * when type is LZMA_DELTA_TYPE_BYTE, so it is safe to leave these
68207753Smm	 * uninitialized.
69207753Smm	 */
70207753Smm	uint32_t reserved_int1;
71207753Smm	uint32_t reserved_int2;
72207753Smm	uint32_t reserved_int3;
73207753Smm	uint32_t reserved_int4;
74207753Smm	void *reserved_ptr1;
75207753Smm	void *reserved_ptr2;
76207753Smm
77207753Smm} lzma_options_delta;
78