Commit Graph

391 Commits

Author SHA1 Message Date
Cosimo Lupo
063009029e add support for Appveyor CI
test build on Windows 2.7 and 3.4 (both 32 and 64 bit);
compile wheel packages and upload artifacts to build report
2015-08-14 11:55:53 +01:00
szabadka
806e7317c7 Merge pull request #138 from anthrotype/travis
Travis support (OS X)
2015-08-14 12:55:22 +02:00
szabadka
84d0621e6c Merge pull request #137 from anthrotype/fix_macpython
[setup.py] pass extra compiler flags to clang on OS X to enable support for C+11
2015-08-14 12:54:26 +02:00
Cosimo Lupo
6dcb0dd1b1 [travis] add placeholder 'deploy' target for Github Releases 2015-08-14 11:35:02 +01:00
Cosimo Lupo
a5822da956 [travis] also compile for 'macpython' (official installers from Python.org);
override CC and CXX to use clang instead of gcc-4.2, which doesn't support C++11
2015-08-14 11:28:26 +01:00
Cosimo Lupo
bb3d9248c0 add support for Travis CI (OS X only for now)
Use 'terrify' utilities from MacPython to build precompiled wheel packages
2015-08-14 11:28:26 +01:00
Cosimo Lupo
e88fe7b248 [setup.py] pass extra compiler flags on OS X to enable support for C++11: -stdlib=libc++ -mmacosx-version-min=10.7 2015-08-14 11:06:59 +01:00
szabadka
d811b186c5 Merge pull request #133 from anthrotype/py27win
fix compilation on Windows Python 2.7 + support for MINGW32 and Cygwin
2015-08-11 13:49:55 +02:00
Cosimo Lupo
d2c8b2777d [setup.py] retrieve version string from brotlimodule.cc so we don't need to modify it more than once 2015-08-11 11:12:58 +01:00
Cosimo Lupo
8c7edd3e07 [bro.py] print --version as brotli.__version__ 2015-08-11 11:12:56 +01:00
Cosimo Lupo
ac33d35632 [brotlimodule.cc] add __version__ string attribute to brotli module 2015-08-11 11:12:54 +01:00
Cosimo Lupo
54baf43c70 [setup.py] support MINGW32 compiler: fix clashing 'hypot' definition; statically link libgcc and libstdc++ 2015-08-11 11:12:52 +01:00
Cosimo Lupo
c3540e2b7a [setup.py] use MSVC 10.0 when compiling for Windows Python 2.7
Python 2.7 for Windows is compiled using MS Visaul C++ 9.0 (Visual Studio 2008).
However the latter does not support many modern C++ features which are
required to compile the Brotli encoder. So we monkey-patch distutils
to always look for MSVC version 10.0 instead of 9.0.
2015-08-11 11:12:49 +01:00
Cosimo Lupo
f14172902b [brotlimodule.cc] fix RuntimeError on OS X: keyword list must be NULL terminated
Sorry, my fault...
2015-08-11 11:09:47 +01:00
szabadka
55a40ce214 Merge pull request #135 from szabadka/master
Fix malloc.h and stdlib.h includes.
2015-08-11 11:10:37 +02:00
Zoltan Szabadka
7de70dbcc7 Add missing <stdlib.h> to streams.cc 2015-08-11 11:09:04 +02:00
Zoltan Szabadka
944c3b8290 Remove non-standard <malloc.h> from decode.c
The already included <stdlib.h> is enough for the malloc/free calls.
2015-08-11 11:07:26 +02:00
szabadka
421e4ed436 Merge pull request #132 from szabadka/master
Brotli decoder optimizations.
2015-08-10 16:44:36 +02:00
Zoltan Szabadka
4b2fd00e24 Use a single lookup table for insert/copy offsets and extra bits.
Remove safe_malloc.c since all the bounds checking is done inside
decode.c now.
2015-08-10 16:39:50 +02:00
szabadka
da11e911a5 Merge pull request #131 from anthrotype/py-deprecated
[brotlimodule.cc] no longer expose deprecated BrotliParams
2015-08-10 15:51:56 +02:00
Cosimo Lupo
08212db733 [brotlimodule.cc] fix C++11 warning about conversion from string literal to 'char *' 2015-08-10 14:39:44 +01:00
Cosimo Lupo
d3dfc68922 [brotlimodule.cc] no longer expose deprecated BrotliParams: enable_dictionary, enable_transforms, greedy_block_split, enable_context_modeling 2015-08-10 14:38:17 +01:00
lvandeve
45c38936b7 Enable little endian support also for visual studio 2015-08-10 14:41:42 +02:00
lvandeve
ef186baffa Merge pull request #130 from lvandeve/master
fix brotli decoder MSVC compilation error
2015-08-10 14:19:10 +02:00
Lode Vandevenne
fee303fd87 fix brotli decoder MSVC compilation error 2015-08-10 14:18:37 +02:00
lvandeve
4c22a3dd4b Merge pull request #128 from lvandeve/master
brotli decoder performance improvements
2015-08-10 13:43:48 +02:00
Lode Vandevenne
94cd7085f7 brotli decoder performance improvements 2015-08-10 13:35:23 +02:00
lvandeve
06fff86bc3 Merge pull request #127 from lvandeve/master
msan bugfixes to the brotli encoder
2015-08-10 13:29:32 +02:00
Lode Vandevenne
17ed258993 msan bugfixes to the brotli encoder 2015-08-10 13:25:45 +02:00
lvandeve
afbec112a5 Add -O2 flag 2015-07-30 18:08:40 +02:00
szabadka
13f0a9b05b Merge pull request #124 from szabadka/master
Fix encoder bug.
2015-07-30 17:45:12 +02:00
Zoltan Szabadka
29c2679500 Fix encoder bug.
Under some circumstances CopyLiteralsToByteArray tried
to read begind ringbuffer.

In this patch we force it to read completely from range [0..mask]
2015-07-30 17:42:02 +02:00
szabadka
9c9bb00f7f Merge pull request #123 from szabadka/master
Fix some VS compilation errors in the encoder.
2015-06-29 14:25:50 +02:00
Zoltan Szabadka
95ddb48a11 Fix some VS compilation errors in the encoder.
- Use std::numeric_limits<double>::infinity() instead of 1.0 / 0.0
  - Use FastLog2() instead of log2() in cost model
2015-06-29 14:20:25 +02:00
lvandeve
9fa3016e66 Merge pull request #121 from lvandeve/master
Brotli Bug Fixes
2015-06-26 17:38:49 +02:00
Lode Vandevenne
bad0f4edf1 Brotli Bug Fixes 2015-06-26 17:37:00 +02:00
szabadka
67d26e0d46 Merge pull request #119 from szabadka/master
Deprecate greedy_block_split and enable_context_modeling brotli params.
2015-06-12 16:55:09 +02:00
Zoltan Szabadka
618287b373 Deprecate greedy_block_split and enable_context_modeling brotli params.
These affected only quality 11, and now it does not make sense
to disable block splitting or context modeling because most of
the time is spent in zopfli anyway.

Now all speed vs size compromises are controlled by the quality param.
2015-06-12 16:50:49 +02:00
szabadka
981ca6e561 Merge pull request #118 from szabadka/master
Use a static hash table to look up dictionary words and transforms.
2015-06-12 16:47:56 +02:00
Zoltan Szabadka
66098830a2 Use a static hash table to look up dictionary words and transforms.
This is used for quality 11, for qualities <= 9 we already
have a simpler hash table.

The static data size is 252 kB, and this removes the
need to initialize a huge hash map at startup, which was
the reason why transforms had to be disabled by default.
In comparison, the static dictionary itself is 120 kB.
This supports every transform, except the kOmitFirstN.
2015-06-12 16:45:17 +02:00
szabadka
0fd2df4f4d Merge pull request #117 from szabadka/master
Add "zopfli"-style backward reference search to brotli.
2015-06-12 16:37:17 +02:00
Zoltan Szabadka
b3d3723f62 Add "zopfli"-style backward reference search to brotli.
This commit adopts the backward reference search algorithm
from the zopfli project (see https://github.com/google/zopfli)
to brotli.

This slower backward reference search is run only in quality 11
and it runs two iterations of entropy cost modeling and
shortest path search.

As a result, the original backward reference search function can
be simplified a bit, since we can remove some heuristics that were
replaced with the zopfli-style search.
2015-06-12 16:25:41 +02:00
szabadka
94b337699f Merge pull request #116 from szabadka/master
Change the static dictionary hash table to take into account word frequency when there are hash collisions.
2015-06-12 16:16:04 +02:00
Zoltan Szabadka
835a77469e Change the static dictionary hash table to take into
account word frequency when there are hash collisions.
2015-06-12 16:14:06 +02:00
szabadka
a0d0ecfead Merge pull request #115 from szabadka/master
Bug fixes for the brotli encoder.
2015-06-12 16:12:38 +02:00
Zoltan Szabadka
65f3fc55f5 Bug fixes for the brotli encoder.
* Fix an out-of-bounds access to depth_histo in the
    bit cost calculation function.

  * Change type of distance symbol to uint16_t in block
    splitter, because if all postfix bits are used, there
    can be 520 distance symbols.

  * Save the distance cache between meta-blocks at the
    correct place. This fixes a roundtrip failure that
    can occur when there is an uncompressed metablock
    between two compressed metablocks.

  * Fix a bug when setting lgwin to 24 in the encoder parameters
    It ended up making metablocks larger than 24 bits in size.

  * Fix out-of-bounds memory accesses in parallel encoder.
    CreateBackwardReferences can read up to 4 bytes past end of
    input if the end of input is before mask.

  * Add missing header for memcpy() in port.h
2015-06-12 16:11:50 +02:00
szabadka
a13ea018f5 Merge pull request #114 from szabadka/master
Brotli custom LZ77 dictionary support.
2015-06-12 15:45:41 +02:00
Zoltan Szabadka
b43df8f699 Brotli custom LZ77 dictionary support.
Adds functions to prepend such dictionary to the
encoder and decoder, and twiddles their internal
parameters to do as if that was a previous part of
the input. This dictionary is just a prefilled LZ77
window, it is not related to the built in transformable
brotli dictionary.
2015-06-12 15:43:54 +02:00
szabadka
631184d40c Merge pull request #113 from szabadka/master
Speedups to brotli quality 11.
2015-06-12 15:32:31 +02:00
Zoltan Szabadka
667f70adcb Speedups to brotli quality 11.
* Cluster at most 64 histograms at a time in the first
    round of clustering.

  * Use a faster histogram cost estimation function.

  * Don't compute the log2(total) multiple times in the
    block splitter.
2015-06-12 15:29:06 +02:00