libsquashfs 1.3.0
A new set of tools and libraries for working with SquashFS images
Loading...
Searching...
No Matches
sqfs_compressor_config_t Struct Reference

Configuration parameters for instantiating a compressor backend. More...

#include <compressor.h>

Collaboration diagram for sqfs_compressor_config_t:
Collaboration graph

Data Fields

sqfs_u16 id
 An SQFS_COMPRESSOR identifier.
 
sqfs_u16 flags
 A combination of SQFS_COMP_FLAG flags.
 
sqfs_u32 block_size
 The intended data block size.
 
sqfs_u32 level
 Compression level.
 
union {
   struct {
      sqfs_u16   window_size
 Deflate window size. Value between 8 and 15. More...
 
      sqfs_u8   padd0 [14]
 
   }   gzip
 Options for the zlib compressor.
 
   struct {
      sqfs_u16   algorithm
 Which variant of lzo should be used. More...
 
      sqfs_u8   padd0 [14]
 
   }   lzo
 Options for the lzo compressor.
 
   struct {
      sqfs_u32   dict_size
 LZMA dictionary size. More...
 
      sqfs_u8   lc
 Number of literal context bits. More...
 
      sqfs_u8   lp
 Number of literal position bits. More...
 
      sqfs_u8   pb
 Number of position bits. More...
 
      sqfs_u8   padd0 [9]
 
   }   xz
 Options for the LZMA and XZ (LZMA v2) compressors.
 
   struct {
      sqfs_u32   dict_size
 LZMA dictionary size. More...
 
      sqfs_u8   lc
 Number of literal context bits. More...
 
      sqfs_u8   lp
 Number of literal position bits. More...
 
      sqfs_u8   pb
 Number of position bits. More...
 
      sqfs_u8   padd0 [9]
 
   }   lzma
 
   sqfs_u64   padd0 [2]
 
opt
 Backend specific options for fine tuing.
 

Detailed Description

Configuration parameters for instantiating a compressor backend.

The unused fields MUST be set to 0. The easiest way to do this is by always clearing the struct using memset before setting anything, or using sqfs_compressor_config_init to set defaults and then modify the struct from there.

Examples
list_files.c.

Definition at line 106 of file compressor.h.

Field Documentation

◆ algorithm

sqfs_u16 algorithm

Which variant of lzo should be used.

An SQFS_LZO_ALGORITHM value. Default is SQFS_LZO1X_999, i.e. best compression.

Definition at line 157 of file compressor.h.

◆ block_size

sqfs_u32 block_size

The intended data block size.

Definition at line 120 of file compressor.h.

◆ dict_size

sqfs_u32 dict_size

LZMA dictionary size.

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 block size.

Definition at line 175 of file compressor.h.

◆ flags

sqfs_u16 flags

A combination of SQFS_COMP_FLAG flags.

Definition at line 115 of file compressor.h.

◆ id

sqfs_u16 id

An SQFS_COMPRESSOR identifier.

Definition at line 110 of file compressor.h.

◆ lc

sqfs_u8 lc

Number of literal context bits.

How many of the highest bits of the previous uncompressed byte to take into account when predicting the bits of the next byte.

The sum lc + lp must be at MOST 4. Default value of lc is 3.

Definition at line 187 of file compressor.h.

◆ level

sqfs_u32 level

Compression level.

Valid range and default value depend on the selected compressor.

Definition at line 127 of file compressor.h.

◆ lp

sqfs_u8 lp

Number of literal position bits.

lp affects what kind of alignment in the uncompressed data is assumed when encoding bytes. See pb below for more information about alignment.

The sum lc + lp must be at MOST 4. Default value of lp is 0.

Definition at line 199 of file compressor.h.

◆ padd0 [1/2]

sqfs_u8 padd0[9]

Definition at line 144 of file compressor.h.

◆ padd0 [2/2]

sqfs_u64 padd0[2]

Definition at line 218 of file compressor.h.

◆ pb

sqfs_u8 pb

Number of position bits.

This is the log2 of the assumed underlying alignment of the input data, i.e. pb=0 means single byte allignment, pb=1 means 16 bit, 2 means 32 bit.

When the alignment is known, setting pb may reduce the file size.

The default value is 2, i.e. 32 bit alignment.

Definition at line 213 of file compressor.h.

◆ window_size

sqfs_u16 window_size

Deflate window size. Value between 8 and 15.

Default is 15, i.e. 32k window.

Definition at line 142 of file compressor.h.


The documentation for this struct was generated from the following file: