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

Side by Side Diff: third_party/lzma_sdk/LzmaEnc.h

Issue 10025017: [OTS] Add lzma_sdk (Closed) Base URL: http://ots.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 8 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 | « third_party/lzma_sdk/LzmaDec.cc ('k') | third_party/lzma_sdk/LzmaEnc.cc » ('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 /* LzmaEnc.h -- LZMA Encoder
2 2009-02-07 : Igor Pavlov : Public domain */
3
4 #ifndef __LZMA_ENC_H
5 #define __LZMA_ENC_H
6
7 #include "Types.h"
8
9 namespace ots {
10 namespace lzma {
11
12 #define LZMA_PROPS_SIZE 5
13
14 typedef struct _CLzmaEncProps
15 {
16 int level; /* 0 <= level <= 9 */
17 UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
18 (1 << 12) <= dictSize <= (1 << 30) for 64-bit version
19 default = (1 << 24) */
20 int lc; /* 0 <= lc <= 8, default = 3 */
21 int lp; /* 0 <= lp <= 4, default = 0 */
22 int pb; /* 0 <= pb <= 4, default = 2 */
23 int algo; /* 0 - fast, 1 - normal, default = 1 */
24 int fb; /* 5 <= fb <= 273, default = 32 */
25 int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
26 int numHashBytes; /* 2, 3 or 4, default = 4 */
27 UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */
28 unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
29 int numThreads; /* 1 or 2, default = 2 */
30 } CLzmaEncProps;
31
32 void LzmaEncProps_Init(CLzmaEncProps *p);
33 void LzmaEncProps_Normalize(CLzmaEncProps *p);
34 UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
35
36
37 /* ---------- CLzmaEncHandle Interface ---------- */
38
39 /* LzmaEnc_* functions can return the following exit codes:
40 Returns:
41 SZ_OK - OK
42 SZ_ERROR_MEM - Memory allocation error
43 SZ_ERROR_PARAM - Incorrect paramater in props
44 SZ_ERROR_WRITE - Write callback error.
45 SZ_ERROR_PROGRESS - some break from progress callback
46 SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
47 */
48
49 typedef void * CLzmaEncHandle;
50
51 CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc);
52 void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig);
53 SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
54 SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
55 SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *in Stream,
56 ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
57 SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
58 int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *al locBig);
59
60 /* ---------- One Call Interface ---------- */
61
62 /* LzmaEncode
63 Return code:
64 SZ_OK - OK
65 SZ_ERROR_MEM - Memory allocation error
66 SZ_ERROR_PARAM - Incorrect paramater
67 SZ_ERROR_OUTPUT_EOF - output buffer overflow
68 SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
69 */
70
71 SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
72 const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeE ndMark,
73 ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
74
75 } // namespace lzma
76 } // namespace ots
77
78 #endif
OLDNEW
« no previous file with comments | « third_party/lzma_sdk/LzmaDec.cc ('k') | third_party/lzma_sdk/LzmaEnc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698