Skip to content

Commit

Permalink
Update zopfli to current google state.
Browse files Browse the repository at this point in the history
git clone https://code.google.com/p/zopfli/

Files not needed in the pigz distribution were removed.
  • Loading branch information
madler committed Jan 11, 2015
1 parent 7605adf commit 0ff4f00
Show file tree
Hide file tree
Showing 17 changed files with 407 additions and 696 deletions.
1 change: 1 addition & 0 deletions zopfli/CONTRIBUTORS
@@ -1,5 +1,6 @@
Mark Adler
Jyrki Alakuijala
Frédéric Kayser
Daniel Reed
Huzaifa Sidhpurwala
Péter Szabó
Expand Down
5 changes: 0 additions & 5 deletions zopfli/Makefile

This file was deleted.

28 changes: 18 additions & 10 deletions zopfli/README
@@ -1,24 +1,32 @@
Zopfli Compression Algorithm is a compression library programmed in C to perform
very good, but slow, deflate or zlib compression.

zopfli.c is separate from the library and contains an example program to create
very well compressed gzip files.
The basic function to compress data is ZopfliCompress in zopfli.h. Use the
ZopfliOptions object to set parameters that affect the speed and compression.
Use the ZopfliInitOptions function to place the default values in the
ZopfliOptions first.

The basic functions to compress data are ZopfliDeflate in deflate.h,
ZopfliZlibCompress in zlib_container.h and ZopfliGzipCompress in
gzip_container.h. Use the ZopfliOptions object to set parameters that affect the
speed and compression. Use the ZopfliInitOptions function to place the default
values in the ZopfliOptions first.
ZopfliCompress supports deflate, gzip and zlib output format with a parameter.
To support only one individual format, you can instead use ZopfliDeflate in
deflate.h, ZopfliZlibCompress in zlib_container.h or ZopfliGzipCompress in
gzip_container.h.

Deflate creates a valid deflate stream in memory, see:
ZopfliDeflate creates a valid deflate stream in memory, see:
http://www.ietf.org/rfc/rfc1951.txt
ZlibCompress creates a valid zlib stream in memory, see:
ZopfliZlibCompress creates a valid zlib stream in memory, see:
http://www.ietf.org/rfc/rfc1950.txt
GzipCompress creates a valid gzip stream in memory, see:
ZopfliGzipCompress creates a valid gzip stream in memory, see:
http://www.ietf.org/rfc/rfc1952.txt

This library can only compress, not decompress. Existing zlib or deflate
libraries can decompress the data.

zopfli_bin.c is separate from the library and contains an example program to
create very well compressed gzip files. Currently the makefile builds this
program with the library statically linked in.

To build the binary, use "make". To build the library as a shared Linux library,
use "make libzopfli". The source code of Zopfli is under src/zopfli.

Zopfli Compression Algorithm was created by Lode Vandevenne and Jyrki
Alakuijala, based on an algorithm by Jyrki Alakuijala.
16 changes: 7 additions & 9 deletions zopfli/src/zopfli/blocksplitter.c
Expand Up @@ -132,16 +132,14 @@ static double SplitCost(size_t i, void* context) {
static void AddSorted(size_t value, size_t** out, size_t* outsize) {
size_t i;
ZOPFLI_APPEND_DATA(value, out, outsize);
if (*outsize > 0) {
for (i = 0; i < *outsize - 1; i++) {
if ((*out)[i] > value) {
size_t j;
for (j = *outsize - 1; j > i; j--) {
(*out)[j] = (*out)[j - 1];
}
(*out)[i] = value;
break;
for (i = 0; i + 1 < *outsize; i++) {
if ((*out)[i] > value) {
size_t j;
for (j = *outsize - 1; j > i; j--) {
(*out)[j] = (*out)[j - 1];
}
(*out)[i] = value;
break;
}
}
}
Expand Down

0 comments on commit 0ff4f00

Please sign in to comment.