COMPRESSION RATIO
wimlib (and wimlib-imagex) can create XPRESS, LZX, or LZMS compressed WIM files.
-wimlib includes its own compression codecs and does not use the compression API
-available on some versions of Windows.
-
-I have gradually been improving the compression codecs in wimlib. For all three
-codecs, they now usually outperform and outcompress the equivalent Microsoft
-implementations. Although results will vary depending on the data being
-compressed, in the table below I present the results for a common use case:
-compressing an x86 Windows PE image. Each row displays the compression type,
-the size of the resulting WIM file in bytes, and how many seconds it took to
-create the file. When applicable, the results with the equivalent Microsoft
-implementation in WIMGAPI is included.
+wimlib's compression codecs usually outperform and outcompress their Microsoft
+equivalents. Although results will vary depending on the data being compressed,
+the table below shows results for a common use case: creating an x86 Windows PE
+image ("boot.wim"). Each row shows the compression type, the size of the
+resulting WIM file in bytes, and the time it took to create the file. When
+possible, the results with the Microsoft equivalent are included.
=============================================================================
| Compression || wimlib (v1.8.0) | WIMGAPI (Windows 8.1) |
WIM files was released with Windows 8, and the first version of DISM to do so
was released with Windows 8.1.
.IP ""
-If you want to create an "ESD" file, then use this option. An (unencrypted)
-"ESD" file is a solid WIM file.
+If you want to create an "ESD file", then use this option. An (unencrypted)
+"ESD file" is a solid WIM file.
.IP ""
By default, this option has an effect equivalent to DISM's option
\fB/compress:recovery\fR. The options for wimlib-imagex are different because
Like \fB--chunk-size\fR, but set the chunk size used in solid resources. The
default, assuming LZMS compression, is 64MiB (67108864); this requires about
640MiB of memory per thread. This option only has an effect when \fB--solid\fR
-is also specified. For maximum compatibility with the Microsoft implementation,
-do not use this option.
+is also specified. Note: Microsoft's implementation is not compatible with LZMS
+chunk sizes larger than 64MiB.
.TP
\fB--solid-compress\fR=\fITYPE\fR[:\fILEVEL\fR]
Like \fB--compress\fR, but set the compression type used in solid resources.
The default is LZMS compression. This option only has an effect when
-\fB--solid\fR is also specified. For maximum compatibility with the Microsoft
-implementation, do not use this option.
+\fB--solid\fR is also specified.
.TP
\fB--threads\fR=\fINUM_THREADS\fR
Number of threads to use for compressing data. Default: autodetect (number of
#define WIMLIB_WRITE_FLAG_RETAIN_GUID 0x00000800
/**
- * When writing streams in the resulting WIM file, combine multiple streams into
+ * When writing streams to the resulting WIM file, combine multiple streams into
* a single compressed resource instead of compressing them independently. This
* is also known as creating a "solid archive". This tends to produce a better
* compression ratio at the cost of much slower random access.
* the WIM's main compression type and chunk size; you can have a WIM that
* nominally uses LZX compression and 32768 byte chunks but actually contains
* LZMS-compressed solid resources, for example. However, if including solid
- * blocks, I suggest that you set the WIM's main compression type to LZMS as
+ * resources, I suggest that you set the WIM's main compression type to LZMS as
* well, either by creating the WIM with
* ::wimlib_create_new_wim(::WIMLIB_COMPRESSION_TYPE_LZMS, ...) or by calling
* ::wimlib_set_output_compression_type(..., ::WIMLIB_COMPRESSION_TYPE_LZMS).
/* Version number used for WIMs that allow multiple streams combined into one
* resource ("solid resources", marked by WIM_RESHDR_FLAG_SOLID) and also a new
* compression format (LZMS). This version is new as of Windows 8 WIMGAPI.
- * Although it is used by Windows 8 web downloader, it is not yet properly
- * documented by Microsoft. */
+ * Although it is used by Windows 8 web downloader, it is not yet documented by
+ * Microsoft. */
#define WIM_VERSION_SOLID 0xe00
/* Note: there is another WIM version from Vista pre-releases, but it is not
extern const u32 lzx_offset_slot_base[LZX_MAX_OFFSET_SLOTS + 1];
-extern const u8 lzx_extra_offset_bits[LZX_MAX_OFFSET_SLOTS + 1];
+extern const u8 lzx_extra_offset_bits[LZX_MAX_OFFSET_SLOTS];
/*
* Return the offset slot for the specified match offset.
* decompressor can be used for all data --- and that decompressor will
* be cached here. However, if we do encounter any data with a
* different compression type or chunk size (this is possible in solid
- * blocks), then this cached decompressor will be replaced with a new
+ * resources), then this cached decompressor will be replaced with a new
* one.
*/
struct wimlib_decompressor *decompressor;
/* Mapping: offset slot => how many extra bits must be read and added to the
* corresponding offset slot base to decode the match offset. */
-const u8 lzx_extra_offset_bits[LZX_MAX_OFFSET_SLOTS + 1] = {
+const u8 lzx_extra_offset_bits[LZX_MAX_OFFSET_SLOTS] = {
0 , 0 , 0 , 0 , 1 ,
1 , 2 , 2 , 3 , 3 ,
4 , 4 , 5 , 5 , 6 ,
16, 17, 17, 17, 17,
17, 17, 17, 17, 17,
17, 17, 17, 17, 17,
- 17
};
/* Round the specified buffer size up to the next valid LZX window size, and
/*
* LZX_BIT_COST is a scaling factor that represents the cost to output one bit.
- * THis makes it possible to consider fractional bit costs.
+ * This makes it possible to consider fractional bit costs.
*
* Note: this is only useful as a statistical trick for when the true costs are
* unknown. In reality, each token in LZX requires a whole number of bits to
/*
* LZX_HASH2_ORDER is the log base 2 of the number of entries in the hash table
* for finding length 2 matches. This can be as high as 16 (in which case the
- * hash function is trivial), but using a smaller hash table actually speeds up
+ * hash function is trivial), but using a smaller hash table speeds up
* compression due to reduced cache pressure.
*/
#define LZX_HASH2_ORDER 12
max_len = in_end - in_next;
nice_len = min(max_len, nice_len);
- /* This extra check is needed to ensure that
- * reading the next 3 bytes when looking for a
- * length 2 match is valid. In addition, we
- * cannot allow ourselves to find a length 2
- * match of the very last two bytes with the
- * very first two bytes, since such a match has
- * an offset too large to be represented. */
+ /* This extra check is needed to ensure that we
+ * never output a length 2 match of the very
+ * last two bytes with the very first two bytes,
+ * since such a match has an offset too large to
+ * be represented. */
if (unlikely(max_len < 3)) {
in_next++;
cache_ptr->length = 0;
ret = for_image(wims[i], WIMLIB_ALL_IMAGES,
image_fill_in_solid_sort_names);
if (ret)
- goto out_free_lookup_table;
+ goto out;
deselect_current_wim_image(wims[i]);
}
write_streams_list),
cmp_streams_by_solid_sort_name);
+out:
list_for_each_entry(lte, stream_list, write_streams_list)
FREE(lte->solid_sort_name);
-out_free_lookup_table:
FREE(lookup_table.table);
return ret;
}