All Projects → jibsen → brieflz

jibsen / brieflz

Licence: Zlib license
Small fast Lempel-Ziv compression library

Programming Languages

c
50402 projects - #5 most used programming language
CMake
9771 projects
Makefile
30231 projects

Projects that are alternatives of or similar to brieflz

salvador
A free, open-source compressor for the ZX0 format
Stars: ✭ 35 (-58.33%)
Mutual labels:  compression, compression-algorithm
apultra
Free open-source compressor for apLib with 5-7% better ratios
Stars: ✭ 84 (+0%)
Mutual labels:  compression, compression-algorithm
Re-Pair
Offline Dictionary-based Compression (Re-Pair, Recursive Pairing)
Stars: ✭ 21 (-75%)
Mutual labels:  compression, compression-algorithm
Lepton
Lepton is a tool and file format for losslessly compressing JPEGs by an average of 22%.
Stars: ✭ 4,918 (+5754.76%)
Mutual labels:  compression, compression-algorithm
lzbase62
LZ77(LZSS) based compression algorithm in base62 for JavaScript.
Stars: ✭ 38 (-54.76%)
Mutual labels:  compression, compression-algorithm
x-compressor
x – minimalist data compressor
Stars: ✭ 42 (-50%)
Mutual labels:  compression, compression-algorithm
blz4
Example of LZ4 compression with optimal parsing using BriefLZ algorithms
Stars: ✭ 24 (-71.43%)
Mutual labels:  compression, compression-algorithm
django-brotli
Django middleware that compresses response using brotli algorithm.
Stars: ✭ 16 (-80.95%)
Mutual labels:  compression, compression-algorithm
image-comp-lib-rust
Image Compression Algorithm
Stars: ✭ 30 (-64.29%)
Mutual labels:  compression, compression-algorithm
Huffman-Coding
A C++ compression program based on Huffman's lossless compression algorithm and decoder.
Stars: ✭ 81 (-3.57%)
Mutual labels:  compression, compression-algorithm
FrameOfReference
C++ library to pack and unpack vectors of integers having a small range of values using a technique called Frame of Reference
Stars: ✭ 36 (-57.14%)
Mutual labels:  compression
Guetzling
Guetzling is a simple script for macOS and Linux written in Bash, to automate (recursively finding files) the compression of jpegs using the Guetzli algorithm.
Stars: ✭ 20 (-76.19%)
Mutual labels:  compression
xcdat
Fast compressed trie dictionary library
Stars: ✭ 51 (-39.29%)
Mutual labels:  compression
ruby-xz
Ruby bindings for liblzma, using fiddle
Stars: ✭ 33 (-60.71%)
Mutual labels:  compression
roadroller
Roadroller: Flattens Your JavaScript Demo
Stars: ✭ 253 (+201.19%)
Mutual labels:  compression
Turbo-Transpose
Transpose: SIMD Integer+Floating Point Compression Filter
Stars: ✭ 50 (-40.48%)
Mutual labels:  compression
pybashutils
Collection of Bash and Python scripts I've made that may be generally useful
Stars: ✭ 26 (-69.05%)
Mutual labels:  compression
GenuineChannels
Collection of custom .NET Remoting channels
Stars: ✭ 29 (-65.48%)
Mutual labels:  compression
ConvectionKernels
Fast, high-quality texture compression library for many formats
Stars: ✭ 40 (-52.38%)
Mutual labels:  compression
lz4ultra
Optimal LZ4 compressor, that produces files that decompress faster while keeping the best compression ratio
Stars: ✭ 49 (-41.67%)
Mutual labels:  compression

BriefLZ - small fast Lempel-Ziv

Version 1.3.0

Copyright (c) 2002-2020 Joergen Ibsen

http://www.ibsensoftware.com/

Build Status Build status codecov

About

BriefLZ is a small and fast open source implementation of a Lempel-Ziv style compression algorithm. The main focus is on speed and code footprint, but the ratios achieved are quite good compared to similar algorithms.

Why BriefLZ?

Two widely used types of Lempel-Ziv based compression libraries are those that employ entropy encoding to achieve good ratios (like Brotli, zlib, Zstd), and those that forgo entropy encoding to favor speed (like LZ4, LZO).

BriefLZ attempts to place itself somewhere between these two by using a universal code, which may improve compression ratios compared to no entropy encoding, while requiring little extra code.

Not counting the optional lookup tables, the compression function blz_pack is 147 LOC, and the decompression function blz_depack is 61 LOC (and can be implemented in 103 bytes of x86 machine code).

If you do not need the extra speed of libraries without entropy encoding, but want reasonable compression ratios, and the footprint of the compression or decompression code is a factor, BriefLZ might be an option.

Benchmark

Here are some results from running lzbench on the Silesia compression corpus on a Core i5-4570 @ 3.2GHz:

Compressor name Compression Decompress. Compr. size Ratio
brotli 2019-10-01 -9 5.80 MB/s 432 MB/s 56,697,015 26.75
zstd 1.4.3 -9 29 MB/s 848 MB/s 60,185,637 28.40
brieflz 1.3.0 -9 1.95 MB/s 415 MB/s 63,947,751 30.17
zstd 1.4.3 -3 199 MB/s 776 MB/s 66,681,182 31.46
brieflz 1.3.0 -6 17 MB/s 400 MB/s 67,208,420 31.71
brotli 2019-10-01 -3 95 MB/s 382 MB/s 67,369,244 31.79
zlib 1.2.11 -9 11 MB/s 320 MB/s 67,644,548 31.92
zlib 1.2.11 -3 63 MB/s 313 MB/s 72,967,040 34.43
brotli 2019-10-01 -1 220 MB/s 338 MB/s 73,499,222 34.68
zstd 1.4.3 -1 345 MB/s 880 MB/s 73,508,823 34.68
brieflz 1.3.0 -3 96 MB/s 369 MB/s 75,550,736 35.65
zlib 1.2.11 -1 91 MB/s 295 MB/s 77,259,029 36.45
lz4hc 1.9.2 -9 28 MB/s 3417 MB/s 77,884,448 36.75
brieflz 1.3.0 -1 164 MB/s 362 MB/s 81,138,803 38.28
lzo1x 2.10 -1 531 MB/s 702 MB/s 100,572,537 47.45
lz4 1.9.2 550 MB/s 3444 MB/s 100,880,800 47.60

Please note that this benchmark is not entirely fair because BriefLZ has no window size limit.

Usage

The include file include/brieflz.h contains documentation in the form of doxygen comments. A configuration file is included, so you can simply run doxygen to generate documentation in HTML format.

If you wish to compile BriefLZ on 16-bit systems, make sure to adjust the constants BLZ_HASH_BITS and DEFAULT_BLOCK_SIZE.

When using BriefLZ as a shared library (dll on Windows), define BLZ_DLL. When building BriefLZ as a shared library, define both BLZ_DLL and BLZ_DLL_EXPORTS.

The example folder contains a simple command-line program, blzpack, that can compress and decompress a file using BriefLZ. For convenience, the example comes with makefiles for GCC and MSVC.

BriefLZ uses CMake to generate build systems. To create one for the tools on your platform, and build BriefLZ, use something along the lines of:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release

You can also simply compile the source files and link them into your project. CMake just provides an easy way to build and test across various platforms and toolsets.

License

This projected is licensed under the zlib License (Zlib).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].