Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

fxc

FXC - Adaptive Context Compressor [A recursive multi-layer adaptive context compressor developed in Lazarus/Free Pascal, utilizing Order-1 Context Modeling and Golomb-Rice coding]

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

FXC - Adaptive Context Compressor

FXC is a high-performance command-line compression utility developed in Lazarus/Free Pascal. It employs a recursive multi-layer approach based on Order-1 Context Modeling, Move-To-Front (MTF) transforms, and Golomb-Rice coding.

Author

How it Works

The compressor uses a context-based statistical model. For every byte, it predicts the next one based on the previous symbol (Order-1). The symbols are then ranked via MTF and encoded using adaptive Golomb-Rice codes.

If the -9 flag is used, the program will perform Recursive Compression:

  1. It compresses the input file (Layer 1).
  2. If the result is smaller, it treats Layer 1 as a new input and compresses it again (Layer 2).
  3. This continues until the file stops shrinking or reaches the 255-layer limit.

Installation

Prerequisites

You need the Lazarus IDE or Free Pascal Compiler installed.

Compiling via Terminal

lazbuild fxc.lpi

Usage

Once compiled, you can use the executable from the command line:

fxc [arguments] [input-file] [output-file]

Arguments:

Flag,Description

-0,Store: Only adds the header without compressing. -1,Fast: Performs a single compression pass (Default). -9,Max: Performs recursive multi-pass compression. -d,Decompress: Forces decompression mode. -z,Compress: Forces compression mode. -f,Force: Overwrites the output file if it already exists.

Examples:

Compressing a file with maximum effort:

./fxc -9 documents.tar documents.tar.x

Decompressing and overwriting:

./fxc -d -f documents.tar.x documents.tar

License

This project is licensed under the GNU General Public License (GPL) v3.0. See the LICENSE file for the full text.