Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: xz/src/liblzma/common/block_encoder.h

Issue 2869016: Add an unpatched version of xz, XZ Utils, to /trunk/deps/third_party (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « xz/src/liblzma/common/block_decoder.c ('k') | xz/src/liblzma/common/block_encoder.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file block_encoder.h
4 /// \brief Encodes .xz Blocks
5 //
6 // Author: Lasse Collin
7 //
8 // This file has been put into the public domain.
9 // You can do whatever you want with this file.
10 //
11 ///////////////////////////////////////////////////////////////////////////////
12
13 #ifndef LZMA_BLOCK_ENCODER_H
14 #define LZMA_BLOCK_ENCODER_H
15
16 #include "common.h"
17
18
19 /// \brief Biggest Compressed Size value that the Block encoder supports
20 ///
21 /// The maximum size of a single Block is limited by the maximum size of
22 /// a Stream, which in theory is 2^63 - 3 bytes (i.e. LZMA_VLI_MAX - 3).
23 /// While the size is really big and no one should hit it in practice, we
24 /// take it into account in some places anyway to catch some errors e.g. if
25 /// application passes insanely big value to some function.
26 ///
27 /// We could take into account the headers etc. to determine the exact
28 /// maximum size of the Compressed Data field, but the complexity would give
29 /// us nothing useful. Instead, limit the size of Compressed Data so that
30 /// even with biggest possible Block Header and Check fields the total
31 /// encoded size of the Block stays as a valid VLI. This doesn't guarantee
32 /// that the size of the Stream doesn't grow too big, but that problem is
33 /// taken care outside the Block handling code.
34 ///
35 /// ~LZMA_VLI_C(3) is to guarantee that if we need padding at the end of
36 /// the Compressed Data field, it will still stay in the proper limit.
37 ///
38 /// This constant is in this file because it is needed in both
39 /// block_encoder.c and block_buffer_encoder.c.
40 #define COMPRESSED_SIZE_MAX ((LZMA_VLI_MAX - LZMA_BLOCK_HEADER_SIZE_MAX \
41 - LZMA_CHECK_SIZE_MAX) & ~LZMA_VLI_C(3))
42
43
44 extern lzma_ret lzma_block_encoder_init(lzma_next_coder *next,
45 lzma_allocator *allocator, lzma_block *block);
46
47 #endif
OLDNEW
« no previous file with comments | « xz/src/liblzma/common/block_decoder.c ('k') | xz/src/liblzma/common/block_encoder.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698