Commit Graph

154 Commits

Author SHA1 Message Date
Zoltan Szabadka
84a7687453 Merge remote-tracking branch 'upstream/master' 2015-04-22 14:38:26 +02:00
Zoltan Szabadka
28b1f7a6b1 Implement some stricter format checks in the decoder.
- Reject brotli streams where the number of
    nibbles is too large for the size of the
    meta-block
  - Reject brotli streams where the padding
    bits after a meta-block are not all zero
  - Reject brotli streams where the symbol
    in the simple prefix code is not in
    the symbol alphabet
2015-04-22 14:35:21 +02:00
szabadka
42b8c74d98 Merge pull request #77 from szabadka/master
Decoder support for new empty meta-block format.
2015-04-22 14:29:05 +02:00
Zoltan Szabadka
a81f2ef433 Decoder support for new empty meta-block format.
This change enforces the new 16MB limit on the
size of the meta-blocks and adds support for
empty meta-blocks with optional ignored metadata.
2015-04-22 14:25:08 +02:00
szabadka
f393bff2e3 Merge pull request #76 from szabadka/master
Support empty meta-blocks with optional ignored metadata.
2015-04-22 13:18:52 +02:00
Zoltan Szabadka
2d8b2ec12b Support empty meta-blocks with optional ignored metadata.
This is a partially backward incompatible format change,
that makes previously valid brotli streams that contain
larger than 16MB meta-blocks invalid.

The impact of this should be minimal, since the 'bro'
command-line tool does not create larger than 2MB
meta-blocks, so the only streams this change could
break are those created by a custom brotli encoder.

This commit contains only the specification update,
implementation in the decoder and encoder will
follow in later commits.
2015-04-22 12:41:57 +02:00
szabadka
d941130e59 Merge pull request #75 from szabadka/master
Change the specification to be less strict in some cases.
2015-04-22 12:27:08 +02:00
Zoltan Szabadka
5b80ef0fd1 Change the specification to be less strict in some cases.
In the following three cases we allow more choices
for the compressor, which can potentially lead to
less compressed bits.

  (1) Allow brotli streams where the block counts
      do not count down to exactly zero at the end
      of the meta-block. This makes it possible
      for compressors to sometimes choose a block
      count which can be represented with less bits
      than the exact block count.

  (2) Remove the restriction that prefix code
      descriptions with exactly one non-zero
      length symbol in the code length alphabet
      must have 1 bit depth. This is because
      bit depth 1 requires the most bits to encode.

  (3) Allow any copy length value in the last
      command where the copy part is ignored.
      This makes it possible for a compressor
      to choose a copy length which can be
      represented with the least amount of bits.

In addition to the changes above, this commit also
has a wording clarification in the overview section
where the use of the 'context ID' expression is
changed to be consistent with the rest of the
specification, i.e. that it is a function of the
last two literals or the copy length.
2015-04-22 12:08:16 +02:00
szabadka
8fe88e4bae Merge pull request #74 from szabadka/master
Use consistent sentence spacing in the specification.
2015-04-22 11:57:26 +02:00
Zoltan Szabadka
206d067c4a Use consistent sentence spacing in the specification.
All sentence spacing was changed to one space, except
in the boilerplate which must be preserved verbatim.
2015-04-22 11:55:29 +02:00
szabadka
0c1a222159 Merge pull request #73 from szabadka/master
Add Mark Adler's edits to the specification.
2015-04-22 11:44:38 +02:00
Zoltan Szabadka
e9fd1a4f20 Add Mark Adler's edits to the specification.
The specification source is changed in this commit
to exactly mirror the specification edited by Mark Adler:

https://github.com/madler/brotli/blob/master/brotli-02-edit.nroff
(version 70e53d7)
2015-04-22 11:33:38 +02:00
szabadka
7310f1b91f Merge pull request #71 from anthrotype/pypy_unbuffered
[python] fix unbuffered binary mode for I/O streams in Windows pypy
2015-04-16 14:35:55 +02:00
Cosimo Lupo
b316cb747a [python] fix unbuffered binary mode for I/O streams in Windows pypy 2015-04-16 12:41:40 +01:00
szabadka
9e53d522a3 Merge pull request #69 from szabadka/master
Spec clarifications for Section 7.
2015-04-08 16:16:22 +02:00
Zoltan Szabadka
f80ccecd0f Spec clarifications for Section 7.
Based on Mark Adler's review comments.
2015-04-08 16:15:09 +02:00
szabadka
653d9f9401 Merge pull request #68 from szabadka/master
Spec clarifications for Section 8.
2015-04-08 11:11:15 +02:00
Zoltan Szabadka
dcdc68e68b Spec clarifications for Section 8.
Based on Mark Adler's review comments.
2015-04-08 11:07:00 +02:00
szabadka
8618383b9b Merge pull request #67 from szabadka/master
Some wording changes to Section 2 of the spec.
2015-04-07 17:27:54 +02:00
Zoltan Szabadka
92b551734a Some wording changes to Section 2 of the spec. 2015-04-07 17:23:37 +02:00
szabadka
f9bb85eb92 Merge pull request #66 from szabadka/master
Add the current version of the brotli specification.
2015-04-07 17:01:20 +02:00
Zoltan Szabadka
707b78ae26 Add the current version of the brotli specification.
Add the .nroff source file and a python script to generate
the .txt version (requires the nroff command).
2015-04-07 16:58:07 +02:00
szabadka
570c295007 Merge pull request #64 from szabadka/master
Limit the max input meta-block size to 16MB.
2015-04-02 11:12:51 +02:00
Zoltan Szabadka
e377e65f11 Limit the max input meta-block size to 16MB. 2015-04-02 11:12:04 +02:00
szabadka
17025f2b3b Merge pull request #63 from szabadka/master
Proof-of-concept encoder for parallel compression.
2015-04-01 16:39:33 +02:00
Zoltan Szabadka
1428d54178 Proof-of-concept encoder for parallel compression.
Add a version of the brotli encoder that compresses
each meta-block independently, only using the
original input data from previous meta-blocks
and nothing from the compressor state.
This is a proof-of-concept to show that the
current format is flexible enough to support
parallel multi-threaded compression.
2015-04-01 16:35:52 +02:00
szabadka
f25f65ab4d Merge pull request #62 from szabadka/master
Add an input block size parameter to brotli.
2015-04-01 16:30:05 +02:00
Zoltan Szabadka
817a3edd52 Add an input block size parameter to brotli.
This will enable processing the input in smaller
chunks than the currently default 2MB for the
slow brotli, while still benefiting from the
larger sliding window.
2015-04-01 16:29:04 +02:00
szabadka
65ea6ef44f Merge pull request #61 from szabadka/master
Update the previous two bytes when decoding an uncompressed metablock.
2015-04-01 16:25:44 +02:00
Zoltan Szabadka
2a7bbfc553 Update the previous two bytes when decoding an
uncompressed metablock.
2015-04-01 16:23:18 +02:00
szabadka
28dea6a64d Merge pull request #60 from szabadka/master
Add a missing state transition to CopyUncompressedBlockToOutput().
2015-04-01 16:20:59 +02:00
Zoltan Szabadka
fac8993bef Add a missing state transition to CopyUncompressedBlockToOutput(). 2015-04-01 16:20:16 +02:00
szabadka
bdb4e33336 Merge pull request #59 from szabadka/master
Faster decoder for data with trivial context maps.
2015-04-01 16:17:25 +02:00
Zoltan Szabadka
fe6e5d1cd9 Faster decoder for data with trivial context maps.
This makes it 20% faster when decoding data with
trivial context map (where the histogram type
depends only on the block type and not the
context).
2015-04-01 16:15:39 +02:00
szabadka
872b058d27 Merge pull request #58 from szabadka/master
Add quality and lgwin to the BrotliParams.
2015-04-01 16:12:18 +02:00
Zoltan Szabadka
d6d69ec4ac Add quality and lgwin to the BrotliParams.
Remove the hard-coded constants for window size
and meta-block size.

Initialize internal storage for each metablock
separately and reserve only as much as needed
for the actual input.
2015-04-01 16:10:15 +02:00
szabadka
5e3e97e294 Merge pull request #57 from anthrotype/sdist
[python] moved setup.py to the root of repository
2015-03-31 17:40:53 +02:00
Cosimo Lupo
77c239952d [python] moved setup.py to the root of repository 2015-03-31 09:30:56 +01:00
lvandeve
d44a174a8f Merge pull request #56 from lvandeve/master
bugfixes affecting streaming decoding
2015-03-30 18:02:15 +02:00
Lode Vandevenne
f9e5a2d9f2 bugfixes affecting streaming decoding 2015-03-30 18:00:40 +02:00
szabadka
ad354af165 Merge pull request #54 from szabadka/master
Use FastLog2() instead of log() in BitsEntropy().
2015-03-30 13:47:00 +02:00
Zoltan Szabadka
ca3a7a98f2 Use FastLog2() instead of log() in BitsEntropy(). 2015-03-30 13:41:52 +02:00
szabadka
71d8786391 Merge pull request #53 from szabadka/master
Add some missing state transitions to DecodeContextMap().
2015-03-30 13:41:15 +02:00
Zoltan Szabadka
8f3092a0b1 Add some missing state transitions to DecodeContextMap().
Update the states in DecodeContextMap to the next one,
else it would continue at the wrong spot if exactly there
the partial input is split.
2015-03-30 13:39:20 +02:00
szabadka
44ca0e2cbe Merge pull request #51 from anthrotype/py_test
[python] add test command to setup.py
2015-03-30 12:06:11 +02:00
Cosimo Lupo
4865fd1d4f [python] add test command to setup.py 2015-03-30 10:20:50 +01:00
szabadka
fea88b8609 Merge pull request #49 from khaledhosny/fix-python-build
Fixing building Python module after 534654d
2015-03-30 09:59:48 +02:00
Khaled Hosny
fa7dd52da9 Fixing building Python module after 534654d 2015-03-27 18:56:18 +02:00
szabadka
8bda995564 Merge pull request #48 from szabadka/master
Add a faster but less dense compression mode.
2015-03-27 14:28:32 +01:00
Zoltan Szabadka
534654def1 Add a faster but less dense compression mode.
The new mode can be used by setting the greedy_block_split
field of BrotliParams to true.

This commit moves all the meta-block processing code
into its own library and moves the meta-block encoding
code to brotli_bit_stream.cc from encode.cc
2015-03-27 14:20:35 +01:00