Commit Graph

150 Commits

Author SHA1 Message Date
Eugene Kliuchnikov
222564a95d Fix encoder (#472)
* fix undefined behavior introduced with PR #468
2016-12-02 13:32:20 +01:00
Piotr Sikora
6a4bf43968 Fix build with -Wconditional-uninitialized. (#471)
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2016-12-02 09:52:54 +01:00
Eugene Kliuchnikov
396309a529 Update (#470)
* condense generated `static_dict_lut.h`
 * implement BrotliInputStream.close()
2016-11-30 13:36:20 +01:00
Eugene Kliuchnikov
5db62dcc9d Fixes: (#468)
* fix slow-down after a long copy (q10-11)
 * more thorough hashing for long ranges (q10-11)
 * minor documentation fixes
 * bazel.io -> bazel.build
2016-11-09 14:04:09 +01:00
Eugene Kliuchnikov
e9b278ac6e Update docs and add more java tests (#463)
* doxygenize and update API documentation
 * fix spelling
 * add "fuzz" corpus for java decoder to improve coverage
 * use upper-case-snake names for dictionary constant definitions
 * use `LDFLAGS` in conventional `Makefile`
2016-10-31 14:33:59 +01:00
Eugene Kliuchnikov
4e157c409a Update API (#457)
* explicitly define `BROTLI_BOOL` to be `int`
 * add `BROTLI_` prefix to `MAKE_UINT64_T` macros
 * replace `true`/`false`/`1`/`0` mentions with `BROTLI_TRUE`/`FALSE`
 * add `BrotliEncoderSetParameter` documentation
 * add explicit caution to `BrotliEncoderMaxCompressedSize`
 * fix formatting in `port.h`
2016-10-25 16:02:05 +02:00
Eugene Kliuchnikov
8bcaabb0d1 Fix "take output" flush workflow. 2016-10-19 16:19:26 +02:00
Eugene Kliuchnikov
f5ba0b6c17 (compress_fragment_two_pass) 2016-10-18 16:56:39 +02:00
Eugene Kliuchnikov
69982c25f1 Build shared libraries by default
* Declare `BUILD_SHARED_LIBS` option for CMake
* Define `${LIB}_SHARED_COMPILATION` when compiling shared library
* Define and use BROTLI_xxx_API
* Fix remaining unprefixed defines in port.h
2016-10-18 16:45:32 +02:00
Eugene Kliuchnikov
9521d968f3 Eliminate more magic constants.
Author: Ivan Nikulin
2016-10-17 17:33:12 +02:00
Eugene Kliuchnikov
0a63f99db9 Update encoder
* move `common/port.h` to `includes/port.h`
 * replace magic more magic numbers with constants
 * artificially limit window size to 2^18 for quality 0 and 1
 * use fixed shifts for quality 0 and 1 hashes
 * removed `BrotliEncoderWriteMetadata`
 * added `BROTLI_OPERATION_EMIT_METADATA` instead
 * deprecated low-level API
 * fixed MSVC warnings
2016-09-21 17:20:36 +02:00
Eugene Kliuchnikov
8148001158 Move "public" to "include/brotli" 2016-08-23 14:40:33 +02:00
Eugene Kliuchnikov
801f5f37ee * rename macros with preceding underscore
* add Brotli*TakeOutput methods
* * flushing now doesn't require additional call
* add Brotli*Version methods
* moved public headers to 'public' directory
* removed C++ API
* do not assume STDC_VERSION is defined
2016-08-22 13:28:22 +02:00
Eugene Kliuchnikov
e0af054d9e Fix ubsan warning. 2016-07-27 11:02:27 +02:00
Eugene Kliuchnikov
058cd1ac7a cleanup 2016-07-26 14:51:51 +02:00
Eugene Kliuchnikov
2048189048 Update encoder:
* booleanification
 * integer BR scores, may improve performance if FPU is slow
 * condense speed-quality constants in quality.h
 * code massage to calm down CoverityScan
 * hashers refactoring
 * new hasher - improved speed, compression and reduced memory usage for q:5-9 w:10-16
 * reduced static recources -> binary size
2016-07-26 14:41:59 +02:00
Evgenii Kliuchnikov
52ff81717b Update build systems 2016-06-24 15:32:51 +02:00
Eugene Kliuchnikov
6a078b17d7 Update encoder
* reorganize premake artifacts
* remove deprecated methods/struct
2016-06-20 17:20:17 +02:00
Eugene Kliuchnikov
378485b097 Update build system. Now libraries are produced as build artifacts.
There are currently 3 ways to build:
* Easy: `./configure; make`
* Simple: use Bazel
* Portable: use premake5 to generate XCode / MSVS projects
2016-06-16 10:52:57 +02:00
Piotr Sikora
629d01cc7e Restore C++ constants in "brotli" namespace.
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2016-06-15 14:25:46 -07:00
eustas
e96b7db0c2 Fix: declare variables before code 2016-06-14 13:54:11 +02:00
Eugene Kliuchnikov
be1a53a61b Fix VS compilation warnings; cleanup API. 2016-06-14 13:42:47 +02:00
eustas
48da49b097 Fix declaration / instruction mixture 2016-06-13 16:46:25 +02:00
eustas
40101bb9bf Fix implicit 32->64 bit conversion 2016-06-13 16:44:52 +02:00
eustas
85712c66d4 Fix implicit 32->64 bit conversion 2016-06-13 16:30:17 +02:00
eustas
a08c36bd86 Fix implicit 32->64 bit conversion 2016-06-13 16:28:19 +02:00
eustas
bc7f0f831d Fix double constant literal 2016-06-13 15:54:57 +02:00
eustas
8d14bed24a Backport MSVC log2 fix 2016-06-13 15:50:15 +02:00
eustas
18dc8eabe1 Fix kInfinity definition
INFINITY is legal only in C++11
2016-06-13 15:40:45 +02:00
Eugene Kliuchnikov
b972c67780 Convert encoder to plain C. 2016-06-13 11:01:04 +02:00
Eugene Kliuchnikov
582ecab380 Step 3: change file extension C++ -> C
This will break the build.
2016-06-03 16:29:37 +02:00
Eugene Kliuchnikov
352b0b2836 Transform most of C++ comments to C-style. 2016-06-03 11:19:23 +02:00
Eugene Kliuchnikov
028291865d Extract common parts: constants, dictionary, etc. 2016-06-03 10:51:04 +02:00
Sebastien Marchand
a33fc249ab Fix 2016-06-01 10:29:15 -04:00
Sebastien Marchand
7fd82d4605 Fix an unitialized variable warning in encode.cc 2016-05-28 12:12:20 -04:00
eustas
f40caec7d1 Fix C -> C++ 2016-05-18 11:13:01 +02:00
eustas
8c5ab0f342 Make encoder API more safe
Track and use "last_block_emitted" state flag
2016-05-18 11:04:50 +02:00
eustas
226d21c403 Make encoder API more safe
Add flag to check if "last" block has been already processed
2016-05-18 11:01:16 +02:00
Frank Aurich
d9a268c60c Fix compilation with VS2012 2016-04-22 10:55:31 +02:00
Eugene Kliuchnikov
e7e3849835 Update decoder. Add encoder interface wrapper.
* condense printf in port.h; use BROTLI_LOG everywhere
 * mark non-exported functions with BROTLI_INTERNAL
 * use BROTLI_DUMP instead of (void)(BROTLI_FAILURE())
 * fix problems with CustomDictionary
 * make decode.h independent of state.h
 * fix "double-new-lines"
 * fix some strict compilation warnings
 * fix bro.cc compilation for MSVS
 * added compressor.h as a replacement for encode.h + streams.h
2016-04-19 16:29:10 +02:00
Piotr Sikora
501cb86172 Fix build with -Wmissing-declarations.
While there, add -Wmissing-prototypes and -Wmissing-declarations
to shared.mk in order to catch similar errors in the future.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2016-03-18 19:18:59 -07:00
Zoltan Szabadka
846575ff6c Fix TODO formatting. 2016-03-15 11:13:07 +01:00
Zoltan Szabadka
b820c39bd9 Reduce memory usage of brotli encoder at quality 10 and 11. 2016-03-15 10:50:16 +01:00
Eugene Kliuchnikov
25e3796f83 Fix most of ()->(void) and some missing includes. 2016-02-29 14:41:24 +01:00
Zoltan Szabadka
dbb53e6434 Use a hash-to-binary-tree data structure for quality 11 as suggested by Issue #180. 2016-01-27 09:50:39 +01:00
Zoltan Szabadka
14d6ae74a9 Reorder members of the Command struct plus fix some warnings.
This may save 8 bytes of padding per Command (32 -> 24 bytes).
2016-01-26 11:25:53 +01:00
Zoltan Szabadka
82c9e1972d Relax the prerequisites of WriteBrotliData().
Instead of returning false, if it is called with no
new input for a non-last block, just check if it has
any already processed data to flush, and if not,
return true with empty output.
2016-01-12 14:45:35 +01:00
Zoltan Szabadka
b4c223cf27 Add missing headers. 2016-01-11 12:17:44 +01:00
Zoltan Szabadka
417107b3dd Add two more fast modes to the brotli compressor.
The new modes process the input data in independent blocks,
using backward references only from within an input block.

The new modes can be used by specifying quality 0 or quality 1,
the old quality 1 and quality 2 modes are renamed quality 2 and
quality 3, respectively, and the old quality 3 mode is removed.
2016-01-11 11:21:42 +01:00
Zoltan Szabadka
1bf1b0a598 Faster entropy coding phase for quality 1.
In quality 1, use static Huffman codes for distance
and command histograms with <= 128 symbols and dynamic
Huffman codes with static code length codes for the other
histograms.
2016-01-08 10:10:22 +01:00