1
0
mirror of https://github.com/chylex/Brotli-Builder.git synced 2024-12-30 13:42:46 +01:00
Libraries & utilities that help understand Brotli compression, and experiment with algorithms to build or modify compressed files.
Go to file
2019-10-04 15:30:15 +02:00
BrotliBuilder Add menu item to save generated output as a file 2019-10-04 03:27:38 +02:00
BrotliCalc Implement dictionary-only & mixed greedy search Brotli encoder 2019-10-03 21:57:34 +02:00
BrotliImpl Implement dictionary-only & mixed greedy search Brotli encoder 2019-10-03 21:57:34 +02:00
BrotliLib Fix off-by-x bug when generating dictionary references after hitting window size 2019-10-04 15:30:15 +02:00
UnitTests Optimize complex distance codes (with no postfix) w/ unit tests 2019-07-09 15:00:21 +02:00
.gitignore Add Resources folder to BrotliCalc intended for brotli.exe & dict files 2019-03-11 10:33:14 +01:00
BrotliBuilder.sln Add BrotliImpl project for Brotli encoder & transformer algorithms 2019-05-17 23:06:30 +02:00
LICENSE Add MIT license 2019-05-30 18:46:58 +02:00
README.md Add README file 2019-06-04 12:51:48 +02:00

This is a WIP university project that implements libraries and applications that work with Brotli compression. Do not consider all APIs to be stable yet, refactoring and improvements to the API and serialization will come later this year.

Before documentation and the APIs themselves reach a more finished state, I would recommend exploring compressed files in BrotliBuilder, and understanding the example implementations in BrotliImpl.

Projects

Project Type Framework Description
BrotliLib Library .NET Standard 2.0 APIs for Brotli structure and serialization; main dependency
BrotliImpl Library .NET Standard 2.0 Example implementations of encoders and transformers
BrotliBuilder WinForms App .NET Framework 4.7.1 GUI for analysis of Brotli-compressed files & static dictionary
BrotliCalc Console App .NET Core 2.0 CLI for batch file processing, analysis, and statistics

The key principle behind BrotliLib is representing the structure of a compressed file using a structure of objects, which is easy to analyze and manipulate.

A cursory glance at the Brotli format specification is recommended before looking into this project. Classes in BrotliLib representing the object structure, as well as the labeled bit stream in BrotliBuilder, can greatly help understand the specification and the principles behind how Brotli and its decompression process works.

The main library can regenerate parts of the object structure, and serialize it into a Brotli bit stream. Note that some of these processes don't follow the official compressor - the library has no concept of compression levels, and some information is lost during the conversion between the bit stream and its object structure, which may not be regenerated in the same way. There is more work to be done in improvements to the serialization process, and allowing some parts of it to be controlled.

Guide to Brotli Builder

The application lets you open a compressed file or use one of the example encoders from BrotliImpl, as well as apply any of the example transformers once the file is loaded.

Image of main window

All text fields in the main window support common shortcuts for navigation and selection. Additional shortcuts include:

  • Ctrl + F to search in text
  • Ctrl + Mouse Wheel Up/Down to change font size
  • Ctrl + +/- to change font size
  • Ctrl + 0 to reset font size

The bit stream text fields let you navigate the color-coded bit groups:

  • Ctrl + Left Arrow to jump to previous bit group
  • Ctrl + Right Arrow to jump to next bit group

Build Instructions

The project is written primarily in C# and built using Visual Studio 2019. Make sure you have the following components:

  • .NET Framework 4.7.1 SDK
  • .NET Core 2.0 SDK
  • F# desktop language support (optional, only required for unit tests)