aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-06-04 04:57:08 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-06-04 04:57:08 +0200
commit0f23f0396aede08a5d0c95d75b272f1b1787a365 (patch)
tree2e0eda82a0a4151cd01b129bb404db2cd3e95581 /include
parentad73b9440422c06805764da6058ebeb6d41a4f04 (diff)
lzma compressor: support micro management options
The LZMA compressor (through the xz-utils library) supports basically the same options for micro management as the XZ compressor. This commit enables support for those options in the compressor, the option parser and adds an option field to the configuration structure. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/sqfs/compressor.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/include/sqfs/compressor.h b/include/sqfs/compressor.h
index a257c3a..c8cab02 100644
--- a/include/sqfs/compressor.h
+++ b/include/sqfs/compressor.h
@@ -185,13 +185,13 @@ struct sqfs_compressor_config_t {
} lzo;
/**
- * @brief Options for the xz compressor.
+ * @brief Options for the LZMA and XZ (LZMA v2) compressors.
*/
struct {
/**
* @brief LZMA dictionary size.
*
- * This value must either be a power of two or the sumo
+ * This value must either be a power of two or the sum
* of two consecutive powers of two.
*
* Default is setting this to the same as the
@@ -200,7 +200,9 @@ struct sqfs_compressor_config_t {
sqfs_u32 dict_size;
/**
- * @brief Compression level. Maximum 9, default is 6.
+ * @brief Compression level. Maximum 9.
+ *
+ * For LZMA, the default is 5, for XZ the default is 6.
*/
sqfs_u8 level;
@@ -243,7 +245,7 @@ struct sqfs_compressor_config_t {
sqfs_u8 pb;
sqfs_u32 padd0[2];
- } xz;
+ } xz, lzma;
sqfs_u64 padd0[2];
} opt;
@@ -392,6 +394,22 @@ typedef enum {
#define SQFS_XZ_MAX_PB 4
#define SQFS_XZ_DEFAULT_PB 2
+#define SQFS_LZMA_MIN_LEVEL (0)
+#define SQFS_LZMA_MAX_LEVEL (9)
+#define SQFS_LZMA_DEFAULT_LEVEL (5)
+
+#define SQFS_LZMA_MIN_LC 0
+#define SQFS_LZMA_MAX_LC 4
+#define SQFS_LZMA_DEFAULT_LC 3
+
+#define SQFS_LZMA_MIN_LP 0
+#define SQFS_LZMA_MAX_LP 4
+#define SQFS_LZMA_DEFAULT_LP 0
+
+#define SQFS_LZMA_MIN_PB 0
+#define SQFS_LZMA_MAX_PB 4
+#define SQFS_LZMA_DEFAULT_PB 2
+
#ifdef __cplusplus
extern "C" {
#endif