Eugene Kliuchnikov
9fa1ad5a91
Fix "zero-distance-code", take 2 ( #506 )
2017-02-08 21:14:01 +01:00
Eugene Kliuchnikov
0749d9ca8b
Fix #502 decoder bug ( #505 )
...
Decoder may have produced invalid output if:
* at offset 0..3 dictionary word with index 3..0 for some length N is used
and distance is encoded with direct distance code 0, and
* at least one of next 4 commands use value from distance ringbuffer
2017-02-07 15:35:03 +01:00
Eugene Kliuchnikov
ccabf811ff
Added fuzzer and updated decoder ( #475 )
...
* log dictionary usage
* remove dead assignment
* added fuzzer for https://github.com/google/oss-fuzz
* added standalone test for fuzzer
2016-12-08 12:55:18 +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
Mo DeJong
3b9d4a227d
enable rbit instruction for arm64 ( #459 )
2016-10-27 17:21:12 +02:00
Eugene Kliuchnikov
b1db6f149a
Fix -Wcast-align
warnings
2016-10-20 10:28:44 +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
4219fece59
Merge pull request #424 from mdejong/master
...
check for __ARM64_ARCH_8__ in dec/port.h so that arm64 arch under cla…
2016-10-17 15:44:39 +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
f20b3eeb2f
Update decoder:
...
* use BROTLI_MAX_DISTANCE_BITS instead of magic constant
* introduce BROTLI_DEPRECATED
* move BROTLI_RESTRICT to common/port.h
* promote reg_t to dec/port.h
* remove deprecated decoder API
* more optimistic ring-buffer allocation
* fix MSVC warnings
* fix (not tested) for ARM 64-bit RBIT
2016-09-21 15:05:12 +02:00
Mo DeJong
214629ccd7
check for __ARM64_ARCH_8__ in dec/port.h so that arm64 arch under clang is detected, check for __ARM_ARCH being exactly equal to 7 so that arm64 arch does not define BROTLI_TARGET_ARMV7
2016-08-30 12:35:40 -07:00
Eugene Kliuchnikov
8148001158
Move "public" to "include/brotli"
2016-08-23 14:40:33 +02:00
Sylvestre Ledru
5ad715e445
Remove some deadcode
2016-08-22 18:22:24 +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
0ef4edacab
Do not use "static inline" for deprecated API.
2016-07-25 10:36:36 +02:00
Eugene Kliuchnikov
d2b17196f2
Fix DecodeContextMap
2016-07-25 10:22:33 +02:00
Eugene Kliuchnikov
43d4f45b6e
Update decoder API:
...
* replace prefix Brotli -> BrotliDecoder
* add HasMoreOutput
* make instance pointer the first argument
* use boolean instead of int
2016-07-25 10:17:04 +02:00
Evgenii Kliuchnikov
52ff81717b
Update build systems
2016-06-24 15:32:51 +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
Eugene Kliuchnikov
b972c67780
Convert encoder to plain C.
2016-06-13 11:01:04 +02:00
eustas
63111b21e8
Merge pull request #367 from google/master
...
Merge upstream changes
2016-06-06 12:00:07 +02:00
Eugene Kliuchnikov
639fdaf62d
Fix "unused function" warning.
2016-06-06 11:19:09 +02:00
Eugene Kliuchnikov
028291865d
Extract common parts: constants, dictionary, etc.
2016-06-03 10:51:04 +02:00
eustas
384c595d19
Remove "inline" specification
...
BrotliErrorString is an utility method. It is used in very specific cases -> should not be included in library.
MSVC doesn't allow "inline" for C code...
2016-05-31 16:19:59 +02:00
Eugene Kliuchnikov
755b909424
Update decoder
...
* More discreet trivial literal context detection
* Make total_out parameter nullable
* More strict stream validity check
* Added BrotliErrorString
2016-05-31 15:40:59 +02:00
eustas
f4376d0802
Add BROTLI_LAST_ERROR_CODE definition
2016-05-20 10:22:03 +02:00
Eugene Kliuchnikov
021f6fe37d
Update decoder:
...
* Added BrotliGetErrorCode
* fixed check of padding bits after last block
2016-05-11 15:23:07 +02:00
Eugene Kliuchnikov
043a99e07e
Update decoder:
...
* make InverseMoveToFrontTransform more standards compliant
* simplify BrotliCalculateRingBufferSize
2016-04-29 13:44:16 +02:00
Eugene Kliuchnikov
ab858a9f1e
Limit |size| in BrotliSetCustomDictionary
2016-04-27 16:52:24 +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
Frédéric Wang
2fcb2321d9
Use double exclamation marks in declarations of IS_CONSTANT and BROTLI_HAS_UBFX to force C compilers to interpret them as booleans and avoid constant-logical-operand warnings.
2016-03-01 09:39:04 +01:00
Eugene Kliuchnikov
23934731f5
Update decoder:
...
* More clear/safe "copy" command stage implementation
* Enable unaligned memory access only on whitelisted CPUs
* Remove unused streams.{c|h}
* Add "default" to all switches
* Fix includes
* Fix spacing everywhere
2016-02-18 15:03:44 +01:00
eustas
68f5bbda76
Update decode.c
2016-02-04 15:42:53 +01:00
eustas
37a320dd81
Fix possible pointer underflow
2016-02-04 15:35:44 +01:00
eustas
28867aa4e7
Remove unused definitions
2016-01-28 16:34:41 +01:00
eustas
ee9464e3b0
Remove NO_ASAN annotation
2016-01-28 16:32:38 +01:00
eustas
02c606d444
Make memmove16 safe.
2016-01-28 16:28:36 +01:00
Eugene Kliuchnikov
92e3023914
Update decoder.
...
* Reduce memory usage
* Update API documentation
* Remove deprecated API
* Move non-API declatarions from decode.h
* Remove streams
* Add more debug logging
* Fix shift in BrotliBitReaderUnload
* Allocate ringbuffer at later stages
* Sort / fix includes
* Fix whitespaces
* Eliminate dead code
* Drive-by code simplifications
2016-01-22 10:19:41 +01:00
Eugene Klyuchnikov
24ffa78414
Fix headers
2015-12-11 11:11:51 +01:00
Eugene Klyuchnikov
771eb10798
Update license statement in source files.
2015-11-27 11:27:11 +01:00
Eugene Klyuchnikov
b693812271
Decoder: implement custom allocator feature
...
Drive-by: conform stricter compilation flags; cleanup shared.mk
2015-11-23 10:21:09 +01:00
Eugene Klyuchnikov
152e33c3a0
Add more explicit type conversions.
...
Remove dead code.
Fix includes.
2015-11-17 13:45:41 +01:00
eustas
65b4baf0b8
Fix implicit type conversion
2015-11-07 11:52:13 +01:00
Eugene Klyuchnikov
c0ba6d6f5e
Brotli decoder: implement new streaming API
2015-11-06 11:46:04 +01:00
Tim Rühsen
b9e413faa6
Make internal decoder functions static
...
Affected functions: WriteRingBuffer, CopyUncompressedBlockToOutput,
BrotliAllocateRingBuffer
2015-10-27 11:22:16 +01:00
Tim Rühsen
f769ba85bf
Fix function prototypes
2015-10-26 21:04:12 +01:00
Zoltan Szabadka
47835c6089
Fix build for SPARK.
2015-10-06 11:11:42 +02:00
Cosimo Lupo
66fa4ff403
[types.h] make std ints types for _MSC_VER compatible with CFFI
...
As defined in _cffi_include.h: 21fef94ca0/cffi/_cffi_include.h (_cffi_include.h-15)
2015-10-05 11:32:12 +01:00
Zoltan Szabadka
bacc734997
Fix some more compiler warnings in the decoder.
2015-10-05 10:23:32 +02:00