Commit Graph

58 Commits

Author SHA1 Message Date
Evgenii Kliuchnikov
ffbe112328 JS: stronger typing
PiperOrigin-RevId: 526909255
2023-07-04 07:54:49 +00:00
Sean C. Sullivan
2ce0feba3c avoid array allocation in Encoder.Mode enum 2023-01-22 06:30:06 -08:00
Brotli
36533a866e Internal change
PiperOrigin-RevId: 502401179
2023-01-17 13:51:00 +00:00
Eugene Kliuchnikov
e3ea91d5c9
Java wrapper: allow using partial byte arrays (#999) 2023-01-04 15:38:17 +01:00
Eugene Kliuchnikov
c48ebca4a8
Fix bazel build (#989) 2022-12-20 12:25:26 +01:00
Aayush Atharva
3914999fcc
Fix typo (#951) 2022-11-17 14:49:55 +01:00
Evgenii Kliuchnikov
a8f5813b84 Update
Documentation:
  - add note that brotli is a "stream" format, not an archive-like
  - regenerate .1 with Pandoc
Build:
  - drop legacy "BROTLI_BUILD_PORTABLE" option
  - drop "BROTLI_SANITIZED" definition
Code:
  - c: comb includes
  - c/enc: extract encoder state into separate header
  - c/enc: drop designated q10 codepath
  - c/enc: dealing better with flushing of empty stream
  - fix MSVC compilation
API:
  - py: use library version instead of one in version.h
  - c: add plugable API to report consumed input / produced output
  - c/java: support "lean" prepared dictionaries (without copy of source)
2022-11-17 13:03:09 +00:00
Eugene Kliuchnikov
8376f72ed6
Prepare for copybara (#939)
Co-authored-by: Eugene Kliuchnikov <eustas@chromium.org>
2021-11-10 10:34:39 +01:00
Eugene Kliuchnikov
62662f87cd
Strip "./" in includes (#925)
Co-authored-by: Eugene Kliuchnikov <eustas@chromium.org>
2021-09-08 09:18:45 +02:00
Eugene Kliuchnikov
0e42caf359
Migrate to github actions (#920)
Not all combinations are migrated to the initial configuration; corresponding TODOs added.

Drive-by: additional combinations uncovered minor portability problems -> fixed
Drive-by: remove no-longer used "script" files.

Co-authored-by: Eugene Kliuchnikov <eustas@chromium.org>
2021-08-31 14:07:17 +02:00
Eugene Kliuchnikov
68f1b90ad0
Update (#918)
Prepare to use copybara worklow.
2021-08-18 19:15:07 +02:00
Eugene Kliuchnikov
19d86fb9a6
Merge-in SharedDictionary feature (#916)
Co-authored-by: Eugene Kliuchnikov <eustas@chromium.org>
2021-08-04 14:42:02 +02:00
Eugene Kliuchnikov
630b5084ee
Update (#914)
* slimmer stack frames in encoder
 * fix MSAN problem in hasher_composite
   (not dangerous, only in large_window mode)
 * fix JNI decoder wrapper - power-of-two payloads fail to decode sometimes
 * reformat polyfil.js and decode_test.js
2021-07-29 22:29:43 +02:00
Eugene Kliuchnikov
f8c6717745
Update (#908)
* re-enable Js build/test
  * improve decoder performance
  * rewrite dictionary data in Java/Js to a shorter uncompressed form
  * improve dictionary generation tool
2021-06-23 09:40:57 +02:00
Martin Grigorov
bbe5d72ba3
[Java] make it possible to set modes (generic, text, font) (#887)
* [Java] make it possible to set modes (generic, text, font)
2021-03-24 21:23:03 +01:00
Eugene Kliuchnikov
2f9277ff2f
Update bazel WORKSPACE files (#896)
* Update bazel WORKSPACE files

* Use fresh OSX image

* Cache homebrew dirs for faster startup
2021-03-24 15:05:23 +01:00
Eugene Kliuchnikov
5692e422da
Update (#852)
* Update

 * comments and clarifications in block_splitter
 * power-of-2 aligned allocations for Hasher
 * refresh decode.js from Java sources
 * disable JS build
2021-01-18 10:56:39 +01:00
Aayush Atharva
f16845614d
Fix typo in variable name (#854)
* Fix typo in variable name

* Fix compile error
2021-01-08 13:24:44 +01:00
dependabot[bot]
4969984a95
Bump junit from 4.12 to 4.13.1 in /java/org/brotli/dec (#853)
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-08 13:21:02 +01:00
Eugene Kliuchnikov
7f740f1308
Update (#807)
- fix formatting
 - fix type conversion
 - fix no-op arithmetic with null-pointer
 - improve performance of hash_longest_match64
 - go: detect read after close
 - java decoder: support compound dictionary
 - remove executable flag on non-scripts
2020-05-15 11:06:21 +02:00
Eugene Kliuchnikov
f83aa5169e
Update bazel to 2.2 + update config (#798)
Newer bazel does not support `maven_jar` rule anymore...
2020-03-31 14:38:01 +02:00
Eugene Kliuchnikov
ca21dac8e5
Add an option to avoid building shared libraries. (#766)
Add an option to avoid building shared libraries (for building with EMCC)

Drive-by:
* maven: ramp up java level to minimal required
* travis: replace deprecated clang-5.0 with clang-7
* maven: fallback to jdk10 to void javadoc bug
2019-08-07 10:51:55 +02:00
Eugene Kliuchnikov
c8b37e8fd1
Update (#762)
* put LICENSE file into .jar
 * fix typo
 * add clarification comment in PY wrapper
2019-07-17 14:39:56 +02:00
Eugene Kliuchnikov
40f0fdcdc1
Explicitly mark tests/testdata/* as binary. (#761)
Fixes #760

Drive-by:
 * update go_rules
 * modernize brotli_inc
 * fix wrapper build
 * update PY to 3 in Travis / OSX / Bazel build
 * upgrade JS Bazel rules.
2019-07-16 17:49:14 +02:00
Eugene Kliuchnikov
78e7bbc3c3
Update (#753)
* fix executable mode of decode.js
 * explain clang-analyser about non-nullability
 * fix "dead assignment"
 * rename proguard.cfg -> proguard.pgcfg
2019-05-03 11:51:11 +02:00
Eugene Kliuchnikov
4b2b2d4f83
Update (#749)
Update:

 * Bazel: fix MSVC configuration
 * C: common: extended documentation and helpers around distance codes
 * C: common: enable BROTLI_DCHECK in "debug" builds
 * C: common: fix implicit trailing zero in `kPrefixSuffix`
 * C: dec: fix possible bit reader discharge for "large-window" mode
 * C: dec: simplify distance decoding via lookup table
 * C: dec: reuse decoder state members memory via union with lookup table
 * C: dec: add decoder state diagram
 * C: enc: clarify access to static dictionary
 * C: enc: improve static dictionary hash
 * C: enc: add "stream offset" parameter for parallel encoding
 * C: enc: reorganize hasher; now Q2-Q3 require exactly 256KiB
           to avoid global TCMalloc lock
 * C: enc: fix rare access to uninitialized data in ring-buffer
 * C: enc: reorganize logging / checks in `write_bits.h`
 * Java: dec: add "large-window" support
 * Java: dec: improve speed
 * Java: dec: debug and 32-bit mode are now activated via system properties
 * Java: dec: demystify some state variables (use better names)
 * Dictionary generator: add single input mode
 * Java: dec: modernize tests
 * Bazel: js: pick working commit for closure rules
2019-04-12 13:57:42 +02:00
Eugene Kliuchnikov
d0ffe60b87
Verbose CLI + start pulling "Shared-Brotli" (#722)
* Verbose CLI + start pulling "Shared-Brotli"

 * vesbose CLI output; fix #666
 * pull `SHIFT` transforms; currently this is semantically dead code;
   later it will be used by "Shared-Brotli"
2018-10-24 16:06:09 +02:00
Eugene Kliuchnikov
a799e34c7f
Remove dependency to full JDK. This should speedup clean builds. (#719)
* Remove dependency to full JDK. This should speedup clean builds.

* Upgrade appveyor bazel
2018-10-18 17:25:05 +02:00
Eugene Kliuchnikov
2216a0dd63
Update (#706)
Update
 * add ASAN/MSAN unaligned read specializations
 * add "brotli" prefix to u_uint64 type
 * increment version to 1.0.06
 * fix CoverityScan "unused assignment" warning
 * fix JDK 8<->9 incompatibility
 * add encoder optimization for empty input
 * regenerate JS decoder
 * unbreak Travis builds
2018-09-13 08:09:32 -04:00
Eugene Kliuchnikov
09cd3e877f
Update 2018-06-11 15:17:26 +02:00
Eugene Kliuchnikov
8544ae858d
Update (#680)
* fix MSVC warnings
 * cleanups
2018-06-09 11:17:13 +02:00
Eugene Kliuchnikov
1e7ea1d8e6
Inverse bazel project/workspace tree (#677)
* Inverse bazel workspace tree.

Now each subproject directly depends on root (c) project.

This helps to mitigate Bazel bug bazelbuild/bazel#2391; short summary:
Bazel does not work if referenced subproject `WORKSPACE` uses any
repositories that embedding project does not.

Bright side: building C project is much faster;
no need to download closure, go and JDK...
2018-06-04 17:53:16 +02:00
Eugene Kliuchnikov
6000396155
Remove unprefixed macros from public headers (#662) 2018-04-20 14:10:55 +02:00
Eugene Kliuchnikov
533843e354
Update (#643)
Update
 * make the zopflification aware of `NDIRECT`, `NPOSTFIX`
   (better compression in `font` mode)
 * add small and simple decoder tool
 * fix typo
 * Java: wrapper: make decoder channel more async-friendly

Ramp up version to 1.0.3 / 1.0.3
2018-03-02 15:49:58 +01:00
Eugene Kliuchnikov
35e69fc7cf
New feature: "Large Window Brotli" (#640)
* New feature: "Large Window Brotli"

By setting special encoder/decoder flag it is now possible to extend
LZ-window up to 30 bits; though produced stream will not be RFC7932
compliant.

Added new dictionary generator - "DSH". It combines speed of "Sieve"
and quality of "DM". Plus utilities to prepare train corpora
(remove unique strings).

Improved compression ratio: now two sub-blocks could be stitched:
the last copy command could be extended to span the next sub-block.

Fixed compression ineffectiveness caused by floating numbers rounding and
wrong cost heuristic.

Other C changes:
 - combined / moved `context.h` to `common`
 - moved transforms to `common`
 - unified some aspects of code formatting
 - added an abstraction for encoder (static) dictionary
 - moved default allocator/deallocator functions to `common`

brotli CLI:
 - window size is auto-adjusted if not specified explicitly

Java:
 - added "eager" decoding both to JNI wrapper and pure decoder
 - huge speed-up of `DictionaryData` initialization

* Add dictionaryless compressed dictionary

* Fix `sources.lst`

* Fix `sources.lst` and add a note that `libtool` is also required.

* Update setup.py

* Fix `EagerStreamTest`

* Fix BUILD file

* Add missing `libdivsufsort` dependency

* Fix "unused parameter" warning.
2018-02-26 09:04:36 -05:00
Tomáš Popela
a0c7dafe28 Fix permissions of various files in project (#613)
Move from 755 to 644.
2017-10-10 11:24:13 +02:00
Eugene Kliuchnikov
42d78807bb Improve Bazel/JNI portability (#611)
* Improve Bazel/JNI portability
* Update go and closure bazel addons
2017-10-09 17:07:34 +02:00
Eugene Kliuchnikov
37fb83ec0d Update: (#600)
* encoder: relax backward references candidates asserts
 * encoder: make RNG more platform-independent
 * encoder: remove "unused" param (context mode)
 * CLI: improve first-encounter experience
 * Java: update SynthTest
 * Java: refine proguard config
 * Java/JNI: fix one-shot compression workflow
2017-09-19 15:57:15 +02:00
Eugene Kliuchnikov
6535435413 Update (#589)
* cleanup
 * fix `unbrotli` CLI
 * Java retouch for faster JS decoder
2017-08-24 13:29:48 +02:00
Eugene Kliuchnikov
d63e8f75f5 Update API, and more (#581)
Update API, and more:
 * remove "custom dictionary" support
 * c/encoder: fix #580: big-endian build
 * Java: reduce jar size
 * Java: speedup decoding
 * Java: add 32-bit CPU support
 * Java: make source code JS transpiler-ready
2017-08-04 10:02:56 +02:00
Eugene Kliuchnikov
a4d2956ded Update wrappers (#564)
* golang: add build information via `cgo.go`
* golang: fix lgwin parameter behavior
* Java: add proguard configuration
2017-06-21 10:59:38 +02:00
Eugene Kliuchnikov
19dc934e39 Add JNI wrappers. (#556) 2017-06-01 13:51:18 +02:00
Eugene Kliuchnikov
03739d2b11 Update (#555)
Update:
 * new CLI; bro -> brotli; + man page
 * JNI wrappers preparation (for bazel build)
 * add raw binary dictionary representation `dictionary.bin`
 * add ability to side-load brotli RFC dictionary
 * decoder persists last error now
 * fix `BrotliDecoderDecompress` documentation
 * go reader don't block until necessary
 * more consistent bazel target names
 * Java dictionary data compiled footprint reduced
 * Java tests refactoring
2017-05-29 17:55:14 +02:00
Eugene Kliuchnikov
4363f2d74b Speedup Java decoder. (#547)
* geo corpus decodes ~5% faster
 * fetchlogs corpus decodes ~25% faster
2017-05-07 17:13:03 +02:00
Stefan Bodewig
a015b42683 turn java library into an OSGi bundle (#545) 2017-05-04 20:27:42 +02:00
Eugene Kliuchnikov
66e798d46a Update API to v1.0.0 (#537)
Make Java decoder fully transpilable to C#.
2017-04-10 15:39:00 +02:00
Eugene Kliuchnikov
21c118ba77 Update c- and java-decoder: (#536)
* speedup java decoder
   * avoid masking
   * avoid excessive fillBits
   * streamline uncompressed block processing
 * make java decoder more transpilation-friendly
 * avoid non-essential goto in c-decoder
2017-04-05 18:50:01 +02:00
Eugene Kliuchnikov
a657d9969d Add go wrapper, streamline java decoder: (#524)
* add (c)brotli golang wrapper
 * remove (language-specific) enums in java decoder
2017-03-22 12:41:19 +01:00
Eugene Kliuchnikov
cdca91b6f5 Update common, decoder, encoder, java (#520)
Common:
 * wrap dictionary data into `BrotliDictionary` structure
 * replace public constant with getter `BrotliGetDictionary`
 * reformat dictionary data

Decoder:
 * adopt common changes
 * clarify acceptable instance usage patterns
 * hold reference to dictionary in state

Encoder:
 * adopt common changes
 * eliminate PIC spots in `CreateBackwardReferences`
 * add per-chunk ratio guards for q0 and q1
 * precompute relative distances to avoid repeated calculations
 * prostpone hasher allocation/initialization
 * refactor Hashers to be class-like structure
 * further improvements for 1MiB+ inputs
 * added new hasher type; made hashers more configurable

Java:
 * Pull byte->int magic to `IntReader` from `BitReader`
2017-03-06 14:22:45 +01:00
Eugene Kliuchnikov
c931e576d2 Move java/ to java/org/brotli/ to fix sources.jar structure (#517)
Also added man pages to `docs/`
2017-02-28 16:59:52 +01:00