Git Product home page Git Product logo

grittibanzli's Introduction

Grittibanzli is a tool to compress a deflate stream to a smaller file, which can be decoded to the original deflate stream again. That is, it compresses not only the data inside the deflate stream, but also the deflate-related information such as LZ77 symbols and Huffman trees, to reproduce a gzip, png, ... file exactly.

Usually compressing a compressed file does not work well, and Grittibanzli aims to improve this situation for compressing deflate files.

Grittibanzli splits a deflate container into 2 or 3 streams: -uncompressed data: the original data -deflate choices needed to reproduce the exact deflate stream. It uses prediction to encode it well no matter what deflate compressor (gzip -1 to -9, zopfli, ...) was used. The prediction works best for gzip -6 to -9. -when applicable: container metadata (such as gzip header)

These different byte streams then need to be compressed to produce a new file smaller than the original deflate container. Suggested compression algorithms:

-uncompressed data: Brotli quality 11 -deflate choices: PPMd, or Brotli quality 10 or 11 -metadata: Brotli quality 11

Well compressed choices will be roughly 0.5-1% for gzip -6 to -9, 9% for zopfli, 21% for gzip -1. As long as this percentage is smaller than the gain from Brotli-compressing the rest, the deflate container can be losslessly reduced.

Performing the compression is not included in this API. Grittibanzli's main result is the deflate choices bytestream, which is large but has a lot of zeroes so that you can compress it well.

This is not an official Google product.

grittibanzli's People

Contributors

lvandeve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grittibanzli's Issues

"Failed to decode" for any gzip file compressed with Golang

Test file:
test3.gz

$ ./grittibanzli --input test3.gz --data=gbdata --choices=gbchoices --meta=gbmeta
input size: 9748653, uncompressed size: 34908953, metadata size: 18, choices size: 9243970 of which 1447788 non-zeroes
$ ./grittibanzli -d --data=gbdata --choices=gbchoices --meta=gbmeta --output=data3.gz
Failed to decode to data3.gz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.