lzma.txt 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. LZMA SDK 4.57
  2. -------------
  3. LZMA SDK Copyright (C) 1999-2007 Igor Pavlov
  4. LZMA SDK provides the documentation, samples, header files, libraries,
  5. and tools you need to develop applications that use LZMA compression.
  6. LZMA is default and general compression method of 7z format
  7. in 7-Zip compression program (www.7-zip.org). LZMA provides high
  8. compression ratio and very fast decompression.
  9. LZMA is an improved version of famous LZ77 compression algorithm.
  10. It was improved in way of maximum increasing of compression ratio,
  11. keeping high decompression speed and low memory requirements for
  12. decompressing.
  13. LICENSE
  14. -------
  15. LZMA SDK is available under any of the following licenses:
  16. 1) GNU Lesser General Public License (GNU LGPL)
  17. 2) Common Public License (CPL)
  18. 3) Simplified license for unmodified code (read SPECIAL EXCEPTION)
  19. 4) Proprietary license
  20. It means that you can select one of these four options and follow rules of that license.
  21. 1,2) GNU LGPL and CPL licenses are pretty similar and both these
  22. licenses are classified as
  23. - "Free software licenses" at http://www.gnu.org/
  24. - "OSI-approved" at http://www.opensource.org/
  25. 3) SPECIAL EXCEPTION
  26. Igor Pavlov, as the author of this code, expressly permits you
  27. to statically or dynamically link your code (or bind by name)
  28. to the files from LZMA SDK without subjecting your linked
  29. code to the terms of the CPL or GNU LGPL.
  30. Any modifications or additions to files from LZMA SDK, however,
  31. are subject to the GNU LGPL or CPL terms.
  32. SPECIAL EXCEPTION allows you to use LZMA SDK in applications with closed code,
  33. while you keep LZMA SDK code unmodified.
  34. SPECIAL EXCEPTION #2: Igor Pavlov, as the author of this code, expressly permits
  35. you to use this code under the same terms and conditions contained in the License
  36. Agreement you have for any previous version of LZMA SDK developed by Igor Pavlov.
  37. SPECIAL EXCEPTION #2 allows owners of proprietary licenses to use latest version
  38. of LZMA SDK as update for previous versions.
  39. SPECIAL EXCEPTION #3: Igor Pavlov, as the author of this code, expressly permits
  40. you to use code of the following files:
  41. BranchTypes.h, LzmaTypes.h, LzmaTest.c, LzmaStateTest.c, LzmaAlone.cpp,
  42. LzmaAlone.cs, LzmaAlone.java
  43. as public domain code.
  44. 4) Proprietary license
  45. LZMA SDK also can be available under a proprietary license which
  46. can include:
  47. 1) Right to modify code without subjecting modified code to the
  48. terms of the CPL or GNU LGPL
  49. 2) Technical support for code
  50. To request such proprietary license or any additional consultations,
  51. send email message from that page:
  52. http://www.7-zip.org/support.html
  53. You should have received a copy of the GNU Lesser General Public
  54. License along with this library; if not, write to the Free Software
  55. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  56. You should have received a copy of the Common Public License
  57. along with this library.
  58. LZMA SDK Contents
  59. -----------------
  60. LZMA SDK includes:
  61. - C++ source code of LZMA compressing and decompressing
  62. - ANSI-C compatible source code for LZMA decompressing
  63. - C# source code for LZMA compressing and decompressing
  64. - Java source code for LZMA compressing and decompressing
  65. - Compiled file->file LZMA compressing/decompressing program for Windows system
  66. ANSI-C LZMA decompression code was ported from original C++ sources to C.
  67. Also it was simplified and optimized for code size.
  68. But it is fully compatible with LZMA from 7-Zip.
  69. UNIX/Linux version
  70. ------------------
  71. To compile C++ version of file->file LZMA, go to directory
  72. C/7zip/Compress/LZMA_Alone
  73. and type "make" or "make clean all" to recompile all.
  74. In some UNIX/Linux versions you must compile LZMA with static libraries.
  75. To compile with static libraries, change string in makefile
  76. LIB = -lm
  77. to string
  78. LIB = -lm -static
  79. Files
  80. ---------------------
  81. C - C source code
  82. CPP - CPP source code
  83. CS - C# source code
  84. Java - Java source code
  85. lzma.txt - LZMA SDK description (this file)
  86. 7zFormat.txt - 7z Format description
  87. 7zC.txt - 7z ANSI-C Decoder description (this file)
  88. methods.txt - Compression method IDs for .7z
  89. LGPL.txt - GNU Lesser General Public License
  90. CPL.html - Common Public License
  91. lzma.exe - Compiled file->file LZMA encoder/decoder for Windows
  92. history.txt - history of the LZMA SDK
  93. Source code structure
  94. ---------------------
  95. C - C files
  96. Compress - files related to compression/decompression
  97. Lz - files related to LZ (Lempel-Ziv) compression algorithm
  98. Lzma - ANSI-C compatible LZMA decompressor
  99. LzmaDecode.h - interface for LZMA decoding on ANSI-C
  100. LzmaDecode.c - LZMA decoding on ANSI-C (new fastest version)
  101. LzmaDecodeSize.c - LZMA decoding on ANSI-C (old size-optimized version)
  102. LzmaTest.c - test application that decodes LZMA encoded file
  103. LzmaTypes.h - basic types for LZMA Decoder
  104. LzmaStateDecode.h - interface for LZMA decoding (State version)
  105. LzmaStateDecode.c - LZMA decoding on ANSI-C (State version)
  106. LzmaStateTest.c - test application (State version)
  107. Branch - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code
  108. Archive - files related to archiving
  109. 7z_C - 7z ANSI-C Decoder
  110. CPP -- CPP files
  111. Common - common files for C++ projects
  112. Windows - common files for Windows related code
  113. 7zip - files related to 7-Zip Project
  114. Common - common files for 7-Zip
  115. Compress - files related to compression/decompression
  116. LZ - files related to LZ (Lempel-Ziv) compression algorithm
  117. Copy - Copy coder
  118. RangeCoder - Range Coder (special code of compression/decompression)
  119. LZMA - LZMA compression/decompression on C++
  120. LZMA_Alone - file->file LZMA compression/decompression
  121. Branch - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code
  122. Archive - files related to archiving
  123. Common - common files for archive handling
  124. 7z - 7z C++ Encoder/Decoder
  125. Bundles - Modules that are bundles of other modules
  126. Alone7z - 7zr.exe: Standalone version of 7z.exe that supports only 7z/LZMA/BCJ/BCJ2
  127. Format7zR - 7zr.dll: Reduced version of 7za.dll: extracting/compressing to 7z/LZMA/BCJ/BCJ2
  128. Format7zExtractR - 7zxr.dll: Reduced version of 7zxa.dll: extracting from 7z/LZMA/BCJ/BCJ2.
  129. UI - User Interface files
  130. Client7z - Test application for 7za.dll, 7zr.dll, 7zxr.dll
  131. Common - Common UI files
  132. Console - Code for console archiver
  133. CS - C# files
  134. 7zip
  135. Common - some common files for 7-Zip
  136. Compress - files related to compression/decompression
  137. LZ - files related to LZ (Lempel-Ziv) compression algorithm
  138. LZMA - LZMA compression/decompression
  139. LzmaAlone - file->file LZMA compression/decompression
  140. RangeCoder - Range Coder (special code of compression/decompression)
  141. Java - Java files
  142. SevenZip
  143. Compression - files related to compression/decompression
  144. LZ - files related to LZ (Lempel-Ziv) compression algorithm
  145. LZMA - LZMA compression/decompression
  146. RangeCoder - Range Coder (special code of compression/decompression)
  147. C/C++ source code of LZMA SDK is part of 7-Zip project.
  148. You can find ANSI-C LZMA decompressing code at folder
  149. C/7zip/Compress/Lzma
  150. 7-Zip doesn't use that ANSI-C LZMA code and that code was developed
  151. specially for this SDK. And files from C/7zip/Compress/Lzma do not need
  152. files from other directories of SDK for compiling.
  153. 7-Zip source code can be downloaded from 7-Zip's SourceForge page:
  154. http://sourceforge.net/projects/sevenzip/
  155. LZMA features
  156. -------------
  157. - Variable dictionary size (up to 1 GB)
  158. - Estimated compressing speed: about 1 MB/s on 1 GHz CPU
  159. - Estimated decompressing speed:
  160. - 8-12 MB/s on 1 GHz Intel Pentium 3 or AMD Athlon
  161. - 500-1000 KB/s on 100 MHz ARM, MIPS, PowerPC or other simple RISC
  162. - Small memory requirements for decompressing (8-32 KB + DictionarySize)
  163. - Small code size for decompressing: 2-8 KB (depending from
  164. speed optimizations)
  165. LZMA decoder uses only integer operations and can be
  166. implemented in any modern 32-bit CPU (or on 16-bit CPU with some conditions).
  167. Some critical operations that affect to speed of LZMA decompression:
  168. 1) 32*16 bit integer multiply
  169. 2) Misspredicted branches (penalty mostly depends from pipeline length)
  170. 3) 32-bit shift and arithmetic operations
  171. Speed of LZMA decompressing mostly depends from CPU speed.
  172. Memory speed has no big meaning. But if your CPU has small data cache,
  173. overall weight of memory speed will slightly increase.
  174. How To Use
  175. ----------
  176. Using LZMA encoder/decoder executable
  177. --------------------------------------
  178. Usage: LZMA <e|d> inputFile outputFile [<switches>...]
  179. e: encode file
  180. d: decode file
  181. b: Benchmark. There are two tests: compressing and decompressing
  182. with LZMA method. Benchmark shows rating in MIPS (million
  183. instructions per second). Rating value is calculated from
  184. measured speed and it is normalized with AMD Athlon 64 X2 CPU
  185. results. Also Benchmark checks possible hardware errors (RAM
  186. errors in most cases). Benchmark uses these settings:
  187. (-a1, -d21, -fb32, -mfbt4). You can change only -d. Also you
  188. can change number of iterations. Example for 30 iterations:
  189. LZMA b 30
  190. Default number of iterations is 10.
  191. <Switches>
  192. -a{N}: set compression mode 0 = fast, 1 = normal
  193. default: 1 (normal)
  194. d{N}: Sets Dictionary size - [0, 30], default: 23 (8MB)
  195. The maximum value for dictionary size is 1 GB = 2^30 bytes.
  196. Dictionary size is calculated as DictionarySize = 2^N bytes.
  197. For decompressing file compressed by LZMA method with dictionary
  198. size D = 2^N you need about D bytes of memory (RAM).
  199. -fb{N}: set number of fast bytes - [5, 273], default: 128
  200. Usually big number gives a little bit better compression ratio
  201. and slower compression process.
  202. -lc{N}: set number of literal context bits - [0, 8], default: 3
  203. Sometimes lc=4 gives gain for big files.
  204. -lp{N}: set number of literal pos bits - [0, 4], default: 0
  205. lp switch is intended for periodical data when period is
  206. equal 2^N. For example, for 32-bit (4 bytes)
  207. periodical data you can use lp=2. Often it's better to set lc0,
  208. if you change lp switch.
  209. -pb{N}: set number of pos bits - [0, 4], default: 2
  210. pb switch is intended for periodical data
  211. when period is equal 2^N.
  212. -mf{MF_ID}: set Match Finder. Default: bt4.
  213. Algorithms from hc* group doesn't provide good compression
  214. ratio, but they often works pretty fast in combination with
  215. fast mode (-a0).
  216. Memory requirements depend from dictionary size
  217. (parameter "d" in table below).
  218. MF_ID Memory Description
  219. bt2 d * 9.5 + 4MB Binary Tree with 2 bytes hashing.
  220. bt3 d * 11.5 + 4MB Binary Tree with 3 bytes hashing.
  221. bt4 d * 11.5 + 4MB Binary Tree with 4 bytes hashing.
  222. hc4 d * 7.5 + 4MB Hash Chain with 4 bytes hashing.
  223. -eos: write End Of Stream marker. By default LZMA doesn't write
  224. eos marker, since LZMA decoder knows uncompressed size
  225. stored in .lzma file header.
  226. -si: Read data from stdin (it will write End Of Stream marker).
  227. -so: Write data to stdout
  228. Examples:
  229. 1) LZMA e file.bin file.lzma -d16 -lc0
  230. compresses file.bin to file.lzma with 64 KB dictionary (2^16=64K)
  231. and 0 literal context bits. -lc0 allows to reduce memory requirements
  232. for decompression.
  233. 2) LZMA e file.bin file.lzma -lc0 -lp2
  234. compresses file.bin to file.lzma with settings suitable
  235. for 32-bit periodical data (for example, ARM or MIPS code).
  236. 3) LZMA d file.lzma file.bin
  237. decompresses file.lzma to file.bin.
  238. Compression ratio hints
  239. -----------------------
  240. Recommendations
  241. ---------------
  242. To increase compression ratio for LZMA compressing it's desirable
  243. to have aligned data (if it's possible) and also it's desirable to locate
  244. data in such order, where code is grouped in one place and data is
  245. grouped in other place (it's better than such mixing: code, data, code,
  246. data, ...).
  247. Using Filters
  248. -------------
  249. You can increase compression ratio for some data types, using
  250. special filters before compressing. For example, it's possible to
  251. increase compression ratio on 5-10% for code for those CPU ISAs:
  252. x86, IA-64, ARM, ARM-Thumb, PowerPC, SPARC.
  253. You can find C/C++ source code of such filters in folder "7zip/Compress/Branch"
  254. You can check compression ratio gain of these filters with such
  255. 7-Zip commands (example for ARM code):
  256. No filter:
  257. 7z a a1.7z a.bin -m0=lzma
  258. With filter for little-endian ARM code:
  259. 7z a a2.7z a.bin -m0=bc_arm -m1=lzma
  260. With filter for big-endian ARM code (using additional Swap4 filter):
  261. 7z a a3.7z a.bin -m0=swap4 -m1=bc_arm -m2=lzma
  262. It works in such manner:
  263. Compressing = Filter_encoding + LZMA_encoding
  264. Decompressing = LZMA_decoding + Filter_decoding
  265. Compressing and decompressing speed of such filters is very high,
  266. so it will not increase decompressing time too much.
  267. Moreover, it reduces decompression time for LZMA_decoding,
  268. since compression ratio with filtering is higher.
  269. These filters convert CALL (calling procedure) instructions
  270. from relative offsets to absolute addresses, so such data becomes more
  271. compressible. Source code of these CALL filters is pretty simple
  272. (about 20 lines of C++), so you can convert it from C++ version yourself.
  273. For some ISAs (for example, for MIPS) it's impossible to get gain from such filter.
  274. LZMA compressed file format
  275. ---------------------------
  276. Offset Size Description
  277. 0 1 Special LZMA properties for compressed data
  278. 1 4 Dictionary size (little endian)
  279. 5 8 Uncompressed size (little endian). -1 means unknown size
  280. 13 Compressed data
  281. ANSI-C LZMA Decoder
  282. ~~~~~~~~~~~~~~~~~~~
  283. To compile ANSI-C LZMA Decoder you can use one of the following files sets:
  284. 1) LzmaDecode.h + LzmaDecode.c + LzmaTest.c (fastest version)
  285. 2) LzmaDecode.h + LzmaDecodeSize.c + LzmaTest.c (old size-optimized version)
  286. 3) LzmaStateDecode.h + LzmaStateDecode.c + LzmaStateTest.c (zlib-like interface)
  287. Memory requirements for LZMA decoding
  288. -------------------------------------
  289. LZMA decoder doesn't allocate memory itself, so you must
  290. allocate memory and send it to LZMA.
  291. Stack usage of LZMA decoding function for local variables is not
  292. larger than 200 bytes.
  293. How To decompress data
  294. ----------------------
  295. LZMA Decoder (ANSI-C version) now supports 5 interfaces:
  296. 1) Single-call Decompressing
  297. 2) Single-call Decompressing with input stream callback
  298. 3) Multi-call Decompressing with output buffer
  299. 4) Multi-call Decompressing with input callback and output buffer
  300. 5) Multi-call State Decompressing (zlib-like interface)
  301. Variant-5 is similar to Variant-4, but Variant-5 doesn't use callback functions.
  302. Decompressing steps
  303. -------------------
  304. 1) read LZMA properties (5 bytes):
  305. unsigned char properties[LZMA_PROPERTIES_SIZE];
  306. 2) read uncompressed size (8 bytes, little-endian)
  307. 3) Decode properties:
  308. CLzmaDecoderState state; /* it's 24-140 bytes structure, if int is 32-bit */
  309. if (LzmaDecodeProperties(&state.Properties, properties, LZMA_PROPERTIES_SIZE) != LZMA_RESULT_OK)
  310. return PrintError(rs, "Incorrect stream properties");
  311. 4) Allocate memory block for internal Structures:
  312. state.Probs = (CProb *)malloc(LzmaGetNumProbs(&state.Properties) * sizeof(CProb));
  313. if (state.Probs == 0)
  314. return PrintError(rs, kCantAllocateMessage);
  315. LZMA decoder uses array of CProb variables as internal structure.
  316. By default, CProb is unsigned_short. But you can define _LZMA_PROB32 to make
  317. it unsigned_int. It can increase speed on some 32-bit CPUs, but memory
  318. usage will be doubled in that case.
  319. 5) Main Decompressing
  320. You must use one of the following interfaces:
  321. 5.1 Single-call Decompressing
  322. -----------------------------
  323. When to use: RAM->RAM decompressing
  324. Compile files: LzmaDecode.h, LzmaDecode.c
  325. Compile defines: no defines
  326. Memory Requirements:
  327. - Input buffer: compressed size
  328. - Output buffer: uncompressed size
  329. - LZMA Internal Structures (~16 KB for default settings)
  330. Interface:
  331. int res = LzmaDecode(&state,
  332. inStream, compressedSize, &inProcessed,
  333. outStream, outSize, &outProcessed);
  334. 5.2 Single-call Decompressing with input stream callback
  335. --------------------------------------------------------
  336. When to use: File->RAM or Flash->RAM decompressing.
  337. Compile files: LzmaDecode.h, LzmaDecode.c
  338. Compile defines: _LZMA_IN_CB
  339. Memory Requirements:
  340. - Buffer for input stream: any size (for example, 16 KB)
  341. - Output buffer: uncompressed size
  342. - LZMA Internal Structures (~16 KB for default settings)
  343. Interface:
  344. typedef struct _CBuffer
  345. {
  346. ILzmaInCallback InCallback;
  347. FILE *File;
  348. unsigned char Buffer[kInBufferSize];
  349. } CBuffer;
  350. int LzmaReadCompressed(void *object, const unsigned char **buffer, SizeT *size)
  351. {
  352. CBuffer *bo = (CBuffer *)object;
  353. *buffer = bo->Buffer;
  354. *size = MyReadFile(bo->File, bo->Buffer, kInBufferSize);
  355. return LZMA_RESULT_OK;
  356. }
  357. CBuffer g_InBuffer;
  358. g_InBuffer.File = inFile;
  359. g_InBuffer.InCallback.Read = LzmaReadCompressed;
  360. int res = LzmaDecode(&state,
  361. &g_InBuffer.InCallback,
  362. outStream, outSize, &outProcessed);
  363. 5.3 Multi-call decompressing with output buffer
  364. -----------------------------------------------
  365. When to use: RAM->File decompressing
  366. Compile files: LzmaDecode.h, LzmaDecode.c
  367. Compile defines: _LZMA_OUT_READ
  368. Memory Requirements:
  369. - Input buffer: compressed size
  370. - Buffer for output stream: any size (for example, 16 KB)
  371. - LZMA Internal Structures (~16 KB for default settings)
  372. - LZMA dictionary (dictionary size is encoded in stream properties)
  373. Interface:
  374. state.Dictionary = (unsigned char *)malloc(state.Properties.DictionarySize);
  375. LzmaDecoderInit(&state);
  376. do
  377. {
  378. LzmaDecode(&state,
  379. inBuffer, inAvail, &inProcessed,
  380. g_OutBuffer, outAvail, &outProcessed);
  381. inAvail -= inProcessed;
  382. inBuffer += inProcessed;
  383. }
  384. while you need more bytes
  385. see LzmaTest.c for more details.
  386. 5.4 Multi-call decompressing with input callback and output buffer
  387. ------------------------------------------------------------------
  388. When to use: File->File decompressing
  389. Compile files: LzmaDecode.h, LzmaDecode.c
  390. Compile defines: _LZMA_IN_CB, _LZMA_OUT_READ
  391. Memory Requirements:
  392. - Buffer for input stream: any size (for example, 16 KB)
  393. - Buffer for output stream: any size (for example, 16 KB)
  394. - LZMA Internal Structures (~16 KB for default settings)
  395. - LZMA dictionary (dictionary size is encoded in stream properties)
  396. Interface:
  397. state.Dictionary = (unsigned char *)malloc(state.Properties.DictionarySize);
  398. LzmaDecoderInit(&state);
  399. do
  400. {
  401. LzmaDecode(&state,
  402. &bo.InCallback,
  403. g_OutBuffer, outAvail, &outProcessed);
  404. }
  405. while you need more bytes
  406. see LzmaTest.c for more details:
  407. 5.5 Multi-call State Decompressing (zlib-like interface)
  408. ------------------------------------------------------------------
  409. When to use: file->file decompressing
  410. Compile files: LzmaStateDecode.h, LzmaStateDecode.c
  411. Compile defines:
  412. Memory Requirements:
  413. - Buffer for input stream: any size (for example, 16 KB)
  414. - Buffer for output stream: any size (for example, 16 KB)
  415. - LZMA Internal Structures (~16 KB for default settings)
  416. - LZMA dictionary (dictionary size is encoded in stream properties)
  417. Interface:
  418. state.Dictionary = (unsigned char *)malloc(state.Properties.DictionarySize);
  419. LzmaDecoderInit(&state);
  420. do
  421. {
  422. res = LzmaDecode(&state,
  423. inBuffer, inAvail, &inProcessed,
  424. g_OutBuffer, outAvail, &outProcessed,
  425. finishDecoding);
  426. inAvail -= inProcessed;
  427. inBuffer += inProcessed;
  428. }
  429. while you need more bytes
  430. see LzmaStateTest.c for more details:
  431. 6) Free all allocated blocks
  432. Note
  433. ----
  434. LzmaDecodeSize.c is size-optimized version of LzmaDecode.c.
  435. But compiled code of LzmaDecodeSize.c can be larger than
  436. compiled code of LzmaDecode.c. So it's better to use
  437. LzmaDecode.c in most cases.
  438. EXIT codes
  439. -----------
  440. LZMA decoder can return one of the following codes:
  441. #define LZMA_RESULT_OK 0
  442. #define LZMA_RESULT_DATA_ERROR 1
  443. If you use callback function for input data and you return some
  444. error code, LZMA Decoder also returns that code.
  445. LZMA Defines
  446. ------------
  447. _LZMA_IN_CB - Use callback for input data
  448. _LZMA_OUT_READ - Use read function for output data
  449. _LZMA_LOC_OPT - Enable local speed optimizations inside code.
  450. _LZMA_LOC_OPT is only for LzmaDecodeSize.c (size-optimized version).
  451. _LZMA_LOC_OPT doesn't affect LzmaDecode.c (speed-optimized version)
  452. and LzmaStateDecode.c
  453. _LZMA_PROB32 - It can increase speed on some 32-bit CPUs,
  454. but memory usage will be doubled in that case
  455. _LZMA_UINT32_IS_ULONG - Define it if int is 16-bit on your compiler
  456. and long is 32-bit.
  457. _LZMA_SYSTEM_SIZE_T - Define it if you want to use system's size_t.
  458. You can use it to enable 64-bit sizes supporting
  459. C++ LZMA Encoder/Decoder
  460. ~~~~~~~~~~~~~~~~~~~~~~~~
  461. C++ LZMA code use COM-like interfaces. So if you want to use it,
  462. you can study basics of COM/OLE.
  463. By default, LZMA Encoder contains all Match Finders.
  464. But for compressing it's enough to have just one of them.
  465. So for reducing size of compressing code you can define:
  466. #define COMPRESS_MF_BT
  467. #define COMPRESS_MF_BT4
  468. and it will use only bt4 match finder.
  469. ---
  470. http://www.7-zip.org
  471. http://www.7-zip.org/support.html