diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-06-04 07:24:52 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-06-04 07:24:52 +0200 |
commit | b6d0bcbf1fa9c8088578c959f442e219f590ebf9 (patch) | |
tree | 2aaffddd7c46e1850b651796797c8df18622b14e /include/sqfs/compressor.h | |
parent | 30597cc7c5d566f671c84c025de97cb1fc2d242e (diff) |
Cleanup: Pull compression level parameter out into compressor config
Every compressor (except LC4) has a compression level parameter. This
commit pulls the compression level field out into the generic
configuration structure and applies some code clean ups as a result
from this.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/sqfs/compressor.h')
-rw-r--r-- | include/sqfs/compressor.h | 52 |
1 files changed, 10 insertions, 42 deletions
diff --git a/include/sqfs/compressor.h b/include/sqfs/compressor.h index 7e687f6..87ecc9d 100644 --- a/include/sqfs/compressor.h +++ b/include/sqfs/compressor.h @@ -120,6 +120,13 @@ struct sqfs_compressor_config_t { sqfs_u32 block_size; /** + * @brief Compression level. + * + * Valid range and default value depend on the selected compressor. + */ + sqfs_u32 level; + + /** * @brief Backend specific options for fine tuing. */ union { @@ -128,37 +135,16 @@ struct sqfs_compressor_config_t { */ struct { /** - * @brief Compression level. Value between 1 and 9. - * - * Default is 9, i.e. best compression. - */ - sqfs_u16 level; - - /** * @brief Deflate window size. Value between 8 and 15. * * Default is 15, i.e. 32k window. */ sqfs_u16 window_size; - sqfs_u32 padd0[3]; + sqfs_u8 padd0[14]; } gzip; /** - * @brief Options for the zstd compressor. - */ - struct { - /** - * @brief Compression level. Value between 1 and 22. - * - * Default is 15. - */ - sqfs_u16 level; - - sqfs_u16 padd0[7]; - } zstd; - - /** * @brief Options for the lzo compressor. */ struct { @@ -170,18 +156,7 @@ struct sqfs_compressor_config_t { */ sqfs_u16 algorithm; - /** - * @brief Compression level for @ref SQFS_LZO1X_999. - * - * If the selected algorithm is @ref SQFS_LZO1X_999, - * this can be a value between 0 and 9. For all other - * algorithms it has to be 0. - * - * Defaults to 9, i.e. best compression. - */ - sqfs_u16 level; - - sqfs_u32 padd0[3]; + sqfs_u8 padd0[14]; } lzo; /** @@ -200,13 +175,6 @@ struct sqfs_compressor_config_t { sqfs_u32 dict_size; /** - * @brief Compression level. Maximum 9. - * - * For LZMA, the default is 5, for XZ the default is 6. - */ - sqfs_u8 level; - - /** * @brief Number of literal context bits. * * How many of the highest bits of the previous @@ -244,7 +212,7 @@ struct sqfs_compressor_config_t { */ sqfs_u8 pb; - sqfs_u32 padd0[2]; + sqfs_u8 padd0[9]; } xz, lzma; sqfs_u64 padd0[2]; |