xrif
A fast lossless compression system
|
The xrif library configuration structure, organizing various parameters used by the functions.
This structure provides for setup and management of memory allocation, though externally allocated buffers can be used when desired.
Options related to compression level and speed are also provided.
It is intended that this structure be interacted with via the xrif_t typedef, which is a pointer to xrif_handle. Values of this structure should generally be changed by one of the xrif_set_*() functions, to allow for error checking and consistency. Unless you know what you're doing, of course.
#include <xrif.h>
Data Fields | |
xrif_dimension_t | width |
The width of a single image, in pixels. | |
xrif_dimension_t | height |
The height of a single image, in pixels. | |
xrif_dimension_t | depth |
The depth of a single image, in pixels. | |
xrif_dimension_t | frames |
The number of frames in the stream. | |
xrif_typecode_t | type_code |
The code specifying the data type of the pixels. | |
size_t | data_size |
The size of the pixels, bytes. This corresponds to sizeof(type) . | |
size_t | raw_size |
Size of the stream before compression. Set dynamically by xrif_set_size or from header. | |
size_t | compressed_size |
Size of the stream after compression. Set dynamically by compression functions or from header. | |
int | difference_method |
The difference method to use. | |
int | reorder_method |
The method to use for bit reordering. | |
int | compress_method |
The compression method used. | |
int | lz4_acceleration |
LZ4 acceleration parameter, >=1, higher is faster with less comporession. Default is 1. | |
int | omp_parallel |
int | omp_numthreads |
unsigned char | compress_on_raw |
Flag (true/false) indicating whether the raw buffer is used for compression. Default on initializeation is true. | |
unsigned char | own_raw |
Flag (true/false) indicating whether the raw_buffer pointer is managed by this handle. | |
char * | raw_buffer |
The raw buffer pointer, contains the image data, and if compress_on_raw == true the compressed data. | |
size_t | raw_buffer_size |
unsigned char | own_reordered |
Flag (true/false) indicating whether the reordered_buffer pointer is managed by this handle. | |
char * | reordered_buffer |
The reordered buffer pointer, contains the reordered data. | |
size_t | reordered_buffer_size |
unsigned char | own_compressed |
Flag (true/false) indicating whether the compressed_buffer pointer is managed by this handle. More... | |
char * | compressed_buffer |
The compressed buffer pointer, contains the compressed data. | |
size_t | compressed_buffer_size |
Performance Measurements | |
unsigned char | calc_performance |
Flag (true/false) controlling whether performance metrics are calculated. Default is true. | |
double | compression_ratio |
The compression ratio, calculated as output-size/input-size. | |
double | encode_time |
Time in seconds taken to encode the data. | |
double | encode_rate |
Rate at which the data was encoded in bytes per second. | |
double | difference_time |
Time in seconds taken to difference the data. | |
double | difference_rate |
Rate at which the data was differenced in bytes per second. | |
double | reorder_time |
Time in seconds taken to reorder the data. | |
double | reorder_rate |
Rate at which the data was reordered in bytes per second. | |
double | compress_time |
Time in seconds taken to compress the data. | |
double | compress_rate |
Rate at which the data was compressed in bytes per second. | |
struct timespec | ts_difference_start |
Timespec used to mark the beginning of differencing, which is also the beginning of encoding. | |
struct timespec | ts_reorder_start |
Timespec used to mark the beginning of reordering, which is the end of differencing. | |
struct timespec | ts_compress_start |
Timespec used to mark the beginning of compression, which is the end of reordering. | |
struct timespec | ts_compress_done |
Timespec used to mark the end of compression and encoding. | |
struct timespec | ts_decompress_start |
Timespec used to mark the beginning of decompression, which is also the beginning of decoding. | |
struct timespec | ts_unreorder_start |
Timespec used to mark the beginning of unreordering, which is the end of decompression. | |
struct timespec | ts_undifference_start |
Timespec used to mark the beginning of undifferencing, which is the end of unreordering. | |
struct timespec | ts_undifference_done |
Timespec used to mark the end of undifferencing and decoding. | |
size_t xrif_handle::compressed_buffer_size |
The size of the compressed_buffer pointer. In principle should be at least LZ4_compressBound(width*height*depth*frames*data_size) in size, but this is not a strict requirement in practice for most streams. It must be at least width*height*depth*frames*data_size.
If this library is used to allocate it, it will be the larger of the two.
Definition at line 350 of file xrif.h.
Referenced by xrif_allocate_compressed(), xrif_compress_lz4(), xrif_compress_none(), and xrif_set_compressed().
int xrif_handle::omp_numthreads |
int xrif_handle::omp_parallel |
unsigned char xrif_handle::own_compressed |
Flag (true/false) indicating whether the compressed_buffer pointer is managed by this handle.
Definition at line 348 of file xrif.h.
Referenced by xrif_allocate_compressed(), xrif_reset(), and xrif_set_compressed().
size_t xrif_handle::raw_buffer_size |
The size of the raw_buffer pointer. If compress_on_raw
is false, then this must be at least width*height*depth*frames*data_size. If compress_on_raw
is true, this should be at least LZ4_compressBound(width*height*depth*frames*data_size) in size, but this is not a strict requirement in practice for most streams. If this library is used to allocate it, it will be the larger of the two possibilities.
Definition at line 338 of file xrif.h.
Referenced by xrif_allocate_raw(), xrif_compress_lz4(), xrif_compress_none(), xrif_difference_first(), xrif_difference_pixel(), xrif_difference_previous(), xrif_reorder_none(), xrif_set_raw(), xrif_undifference_first(), xrif_undifference_pixel(), xrif_undifference_previous(), and xrif_unreorder_none().
size_t xrif_handle::reordered_buffer_size |
The size of the reordered_buffer pointer. It must be at least width*height*depth*frames*data_size.
Definition at line 344 of file xrif.h.
Referenced by xrif_allocate_reordered(), xrif_compress_none(), xrif_decompress_lz4(), xrif_decompress_none(), xrif_reorder_none(), xrif_set_reordered(), and xrif_unreorder_none().