Lode Vandevenne | b50b7ef | 2013-01-16 10:30:56 +0100 | [diff] [blame] | 1 | Zopfli Compression Algorithm is a compression library programmed in C to perform |
| 2 | very good, but slow, deflate or zlib compression. |
| 3 | |
Lode Vandevenne | 4975aa5 | 2013-04-25 16:00:01 +0200 | [diff] [blame] | 4 | The basic function to compress data is ZopfliCompress in zopfli.h. Use the |
| 5 | ZopfliOptions object to set parameters that affect the speed and compression. |
| 6 | Use the ZopfliInitOptions function to place the default values in the |
| 7 | ZopfliOptions first. |
Lode Vandevenne | b50b7ef | 2013-01-16 10:30:56 +0100 | [diff] [blame] | 8 | |
Lode Vandevenne | 4975aa5 | 2013-04-25 16:00:01 +0200 | [diff] [blame] | 9 | ZopfliCompress supports deflate, gzip and zlib output format with a parameter. |
| 10 | To support only one individual format, you can instead use ZopfliDeflate in |
| 11 | deflate.h, ZopfliZlibCompress in zlib_container.h or ZopfliGzipCompress in |
| 12 | gzip_container.h. |
Lode Vandevenne | b50b7ef | 2013-01-16 10:30:56 +0100 | [diff] [blame] | 13 | |
Lode Vandevenne | 4975aa5 | 2013-04-25 16:00:01 +0200 | [diff] [blame] | 14 | ZopfliDeflate creates a valid deflate stream in memory, see: |
Lode Vandevenne | d5eb5f5 | 2013-02-14 14:41:44 +0100 | [diff] [blame] | 15 | http://www.ietf.org/rfc/rfc1951.txt |
Lode Vandevenne | 4975aa5 | 2013-04-25 16:00:01 +0200 | [diff] [blame] | 16 | ZopfliZlibCompress creates a valid zlib stream in memory, see: |
Lode Vandevenne | d5eb5f5 | 2013-02-14 14:41:44 +0100 | [diff] [blame] | 17 | http://www.ietf.org/rfc/rfc1950.txt |
Lode Vandevenne | 4975aa5 | 2013-04-25 16:00:01 +0200 | [diff] [blame] | 18 | ZopfliGzipCompress creates a valid gzip stream in memory, see: |
Lode Vandevenne | d5eb5f5 | 2013-02-14 14:41:44 +0100 | [diff] [blame] | 19 | http://www.ietf.org/rfc/rfc1952.txt |
Lode Vandevenne | b50b7ef | 2013-01-16 10:30:56 +0100 | [diff] [blame] | 20 | |
| 21 | This library can only compress, not decompress. Existing zlib or deflate |
| 22 | libraries can decompress the data. |
| 23 | |
Lode Vandevenne | 4975aa5 | 2013-04-25 16:00:01 +0200 | [diff] [blame] | 24 | zopfli_bin.c is separate from the library and contains an example program to |
| 25 | create very well compressed gzip files. Currently the makefile builds this |
| 26 | program with the library statically linked in. |
| 27 | |
Lode Vandevenne | 9bc747b | 2016-02-08 17:51:18 +0100 | [diff] [blame] | 28 | The source code of Zopfli is under src/zopfli. Build instructions: |
Lode Vandevenne | a8a723d | 2016-02-08 17:50:09 +0100 | [diff] [blame] | 29 | |
| 30 | To build zopfli, compile all .c source files under src/zopfli to a single binary |
| 31 | with C, and link to the standard C math library, e.g.: |
Lode Vandevenne | 975ac80 | 2016-04-25 13:27:46 +0200 | [diff] [blame] | 32 | gcc src/zopfli/*.c -O2 -W -Wall -Wextra -Wno-unused-function -ansi -pedantic -lm -o zopfli |
Lode Vandevenne | a8a723d | 2016-02-08 17:50:09 +0100 | [diff] [blame] | 33 | |
| 34 | A makefile is provided as well, but only for linux. Use "make" to build the |
| 35 | binary, "make libzopfli" to build it as a shared library. For other platforms, |
| 36 | please use the build instructions above instead. |
| 37 | |
Lode Vandevenne | b50b7ef | 2013-01-16 10:30:56 +0100 | [diff] [blame] | 38 | Zopfli Compression Algorithm was created by Lode Vandevenne and Jyrki |
| 39 | Alakuijala, based on an algorithm by Jyrki Alakuijala. |