]> icculus.org git repositories - icculus/xz.git/blob - src/liblzma/api/lzma/alignment.h
Renamed constants:
[icculus/xz.git] / src / liblzma / api / lzma / alignment.h
1 /**
2  * \file        lzma/alignment.h
3  * \brief       Calculating input and output alignment of filter chains
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       Calculates the preferred alignment of the input data
26  *
27  * FIXME desc
28  */
29 extern uint32_t lzma_alignment_input(
30                 const lzma_filter *filters, uint32_t guess);
31
32
33 /**
34  * \brief       Calculates the alignment of the encoded output
35  *
36  * Knowing the alignment of the output data is useful e.g. in the Block
37  * encoder which tries to align the Compressed Data field optimally.
38  *
39  * \param       filters   Pointer to lzma_filter array, whose last
40  *                        member must have .id = LZMA_VLI_UNKNOWN.
41  * \param       guess     The value to return if the alignment of the output
42  *                        is the same as the alignment of the input data.
43  *                        If you want to always detect this special case,
44  *                        this guess to zero; this function never returns
45  *                        zero unless guess is zero.
46  *
47  * \return      In most cases, a small positive integer is returned;
48  *              for optimal use, the encoded output of this filter
49  *              chain should start at on offset that is a multiple of
50  *              the returned integer value.
51  *
52  *              If the alignment of the output is the same as the input
53  *              data (which this function cannot know), \a guess is
54  *              returned.
55  *
56  *              If an error occurs (that is, unknown Filter IDs or filter
57  *              options), UINT32_MAX is returned.
58  */
59 extern uint32_t lzma_alignment_output(
60                 const lzma_filter *filters, uint32_t guess);