delta.h revision 207753
1189251Ssam/**
2214734Srpaulo * \file        lzma/delta.h
3214734Srpaulo * \brief       Delta filter
4189251Ssam */
5252726Srpaulo
6252726Srpaulo/*
7189251Ssam * Author: Lasse Collin
8189251Ssam *
9189251Ssam * This file has been put into the public domain.
10189251Ssam * You can do whatever you want with this file.
11189251Ssam *
12189251Ssam * See ../lzma.h for information about liblzma as a whole.
13189251Ssam */
14189251Ssam
15189251Ssam#ifndef LZMA_H_INTERNAL
16189251Ssam#	error Never include this file directly. Use <lzma.h> instead.
17189251Ssam#endif
18214734Srpaulo
19214734Srpaulo
20214734Srpaulo/**
21214734Srpaulo * \brief       Filter ID
22189251Ssam *
23214734Srpaulo * Filter ID of the Delta filter. This is used as lzma_filter.id.
24214734Srpaulo */
25214734Srpaulo#define LZMA_FILTER_DELTA       LZMA_VLI_C(0x03)
26214734Srpaulo
27214734Srpaulo
28214734Srpaulo/**
29214734Srpaulo * \brief       Type of the delta calculation
30214734Srpaulo *
31214734Srpaulo * Currently only byte-wise delta is supported. Other possible types could
32214734Srpaulo * be, for example, delta of 16/32/64-bit little/big endian integers, but
33214734Srpaulo * these are not currently planned since byte-wise delta is almost as good.
34214734Srpaulo */
35214734Srpaulotypedef enum {
36214734Srpaulo	LZMA_DELTA_TYPE_BYTE
37214734Srpaulo} lzma_delta_type;
38214734Srpaulo
39214734Srpaulo
40214734Srpaulo/**
41214734Srpaulo * \brief       Options for the Delta filter
42214734Srpaulo *
43214734Srpaulo * These options are needed by both encoder and decoder.
44214734Srpaulo */
45214734Srpaulotypedef struct {
46214734Srpaulo	/** For now, this must always be LZMA_DELTA_TYPE_BYTE. */
47214734Srpaulo	lzma_delta_type type;
48214734Srpaulo
49214734Srpaulo	/**
50214734Srpaulo	 * \brief       Delta distance
51214734Srpaulo	 *
52214734Srpaulo	 * With the only currently supported type, LZMA_DELTA_TYPE_BYTE,
53214734Srpaulo	 * the distance is as bytes.
54214734Srpaulo	 *
55214734Srpaulo	 * Examples:
56214734Srpaulo	 *  - 16-bit stereo audio: distance = 4 bytes
57214734Srpaulo	 *  - 24-bit RGB image data: distance = 3 bytes
58214734Srpaulo	 */
59214734Srpaulo	uint32_t dist;
60214734Srpaulo#	define LZMA_DELTA_DIST_MIN 1
61189251Ssam#	define LZMA_DELTA_DIST_MAX 256
62214734Srpaulo
63214734Srpaulo	/*
64214734Srpaulo	 * Reserved space to allow possible future extensions without
65189251Ssam	 * breaking the ABI. You should not touch these, because the names
66189251Ssam	 * of these variables may change. These are and will never be used
67189251Ssam	 * when type is LZMA_DELTA_TYPE_BYTE, so it is safe to leave these
68189251Ssam	 * uninitialized.
69189251Ssam	 */
70214734Srpaulo	uint32_t reserved_int1;
71214734Srpaulo	uint32_t reserved_int2;
72214734Srpaulo	uint32_t reserved_int3;
73214734Srpaulo	uint32_t reserved_int4;
74189251Ssam	void *reserved_ptr1;
75189251Ssam	void *reserved_ptr2;
76189251Ssam
77189251Ssam} lzma_options_delta;
78214734Srpaulo