Skip to content
Permalink
Browse files
Upgrade Brotli to version 1.0.1 and WOFF2 to latest upstream
https://bugs.webkit.org/show_bug.cgi?id=177768

Patch by Frederic Wang <fwang@igalia.com> on 2017-10-05
Reviewed by Michael Catanzaro.

* brotli/CMakeLists.txt:
* brotli/README.webkit:
* brotli/common/constants.h: Added.
* brotli/common/dictionary.bin: Added.
* brotli/common/dictionary.c: Added.
* brotli/common/dictionary.h: Added.
* brotli/common/version.h: Added.
* brotli/dec/Makefile: Removed.
* brotli/dec/bit_reader.c:
* brotli/dec/bit_reader.h:
* brotli/dec/context.h:
* brotli/dec/decode.c:
* brotli/dec/decode.h: Removed.
* brotli/dec/dictionary.c: Removed.
* brotli/dec/dictionary.h: Removed.
* brotli/dec/huffman.c:
* brotli/dec/huffman.h:
* brotli/dec/port.h:
(BrotliDump):
(BrotliRBit):
* brotli/dec/prefix.h:
* brotli/dec/state.c:
* brotli/dec/state.h:
* brotli/dec/transform.h:
* brotli/dec/types.h: Removed.
* brotli/include/brotli/decode.h: Added.
* brotli/include/brotli/encode.h: Added.
* brotli/include/brotli/port.h: Added.
* brotli/include/brotli/types.h: Added.
* brotli/update.sh:
* woff2/CMakeLists.txt:
* woff2/README.webkit:
* woff2/src/buffer.h:
(woff2::Buffer::Buffer):
(woff2::Buffer::Read):
* woff2/src/convert_woff2ttf_*.cc: Added.
* woff2/src/font.cc:
* woff2/src/glyph.cc:
* woff2/src/normalize.cc:
* woff2/src/port.h:
* woff2/src/store_bytes.h:
(woff2::Store16):
* woff2/src/variable_length.cc:
* woff2/src/woff2_common.cc:
* woff2/src/woff2_dec.cc:
* woff2/src/woff2_decompress.cc:
* woff2/src/woff2_enc.cc:
* woff2/src/woff2_info.cc: Added.

Canonical link: https://commits.webkit.org/194178@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222903 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
fred-wang committed Oct 5, 2017
1 parent 6aec05e commit 2c4cc25fb4587fcb01399b7016594924a2a0b136
Showing with 8,706 additions and 10,648 deletions.
  1. +56 −0 Source/ThirdParty/ChangeLog
  2. +3 −1 Source/ThirdParty/brotli/CMakeLists.txt
  3. +1 −1 Source/ThirdParty/brotli/README.webkit
  4. +57 −0 Source/ThirdParty/brotli/common/constants.h
  5. +432 −0 Source/ThirdParty/brotli/common/dictionary.bin
  6. +5,905 −0 Source/ThirdParty/brotli/common/dictionary.c
  7. +64 −0 Source/ThirdParty/brotli/common/dictionary.h
  8. +19 −0 Source/ThirdParty/brotli/common/version.h
  9. +0 −12 Source/ThirdParty/brotli/dec/Makefile
  10. +6 −6 Source/ThirdParty/brotli/dec/bit_reader.c
  11. +25 −48 Source/ThirdParty/brotli/dec/bit_reader.h
  12. +1 −1 Source/ThirdParty/brotli/dec/context.h
  13. +710 −592 Source/ThirdParty/brotli/dec/decode.c
  14. +0 −162 Source/ThirdParty/brotli/dec/decode.h
  15. +0 −9,466 Source/ThirdParty/brotli/dec/dictionary.c
  16. +0 −38 Source/ThirdParty/brotli/dec/dictionary.h
  17. +28 −26 Source/ThirdParty/brotli/dec/huffman.c
  18. +4 −4 Source/ThirdParty/brotli/dec/huffman.h
  19. +20 −104 Source/ThirdParty/brotli/dec/port.h
  20. +5 −3 Source/ThirdParty/brotli/dec/prefix.h
  21. +31 −39 Source/ThirdParty/brotli/dec/state.c
  22. +35 −30 Source/ThirdParty/brotli/dec/state.h
  23. +2 −2 Source/ThirdParty/brotli/dec/transform.h
  24. +0 −38 Source/ThirdParty/brotli/dec/types.h
  25. +339 −0 Source/ThirdParty/brotli/include/brotli/decode.h
  26. +402 −0 Source/ThirdParty/brotli/include/brotli/encode.h
  27. +146 −0 Source/ThirdParty/brotli/include/brotli/port.h
  28. +90 −0 Source/ThirdParty/brotli/include/brotli/types.h
  29. +4 −2 Source/ThirdParty/brotli/update.sh
  30. +1 −1 Source/ThirdParty/woff2/CMakeLists.txt
  31. +1 −1 Source/ThirdParty/woff2/README.webkit
  32. +5 −5 Source/ThirdParty/woff2/src/buffer.h
  33. +13 −0 Source/ThirdParty/woff2/src/convert_woff2ttf_fuzzer.cc
  34. +12 −0 Source/ThirdParty/woff2/src/convert_woff2ttf_fuzzer_new_entry.cc
  35. +11 −2 Source/ThirdParty/woff2/src/font.cc
  36. +17 −15 Source/ThirdParty/woff2/src/glyph.cc
  37. +3 −6 Source/ThirdParty/woff2/src/normalize.cc
  38. +11 −0 Source/ThirdParty/woff2/src/port.h
  39. +6 −4 Source/ThirdParty/woff2/src/store_bytes.h
  40. +2 −2 Source/ThirdParty/woff2/src/variable_length.cc
  41. +4 −2 Source/ThirdParty/woff2/src/woff2_common.cc
  42. +62 −14 Source/ThirdParty/woff2/src/woff2_dec.cc
  43. +1 −0 Source/ThirdParty/woff2/src/woff2_decompress.cc
  44. +20 −21 Source/ThirdParty/woff2/src/woff2_enc.cc
  45. +152 −0 Source/ThirdParty/woff2/src/woff2_info.cc
@@ -1,3 +1,59 @@
2017-10-05 Frederic Wang <fwang@igalia.com>

Upgrade Brotli to version 1.0.1 and WOFF2 to latest upstream
https://bugs.webkit.org/show_bug.cgi?id=177768

Reviewed by Michael Catanzaro.

* brotli/CMakeLists.txt:
* brotli/README.webkit:
* brotli/common/constants.h: Added.
* brotli/common/dictionary.bin: Added.
* brotli/common/dictionary.c: Added.
* brotli/common/dictionary.h: Added.
* brotli/common/version.h: Added.
* brotli/dec/Makefile: Removed.
* brotli/dec/bit_reader.c:
* brotli/dec/bit_reader.h:
* brotli/dec/context.h:
* brotli/dec/decode.c:
* brotli/dec/decode.h: Removed.
* brotli/dec/dictionary.c: Removed.
* brotli/dec/dictionary.h: Removed.
* brotli/dec/huffman.c:
* brotli/dec/huffman.h:
* brotli/dec/port.h:
(BrotliDump):
(BrotliRBit):
* brotli/dec/prefix.h:
* brotli/dec/state.c:
* brotli/dec/state.h:
* brotli/dec/transform.h:
* brotli/dec/types.h: Removed.
* brotli/include/brotli/decode.h: Added.
* brotli/include/brotli/encode.h: Added.
* brotli/include/brotli/port.h: Added.
* brotli/include/brotli/types.h: Added.
* brotli/update.sh:
* woff2/CMakeLists.txt:
* woff2/README.webkit:
* woff2/src/buffer.h:
(woff2::Buffer::Buffer):
(woff2::Buffer::Read):
* woff2/src/convert_woff2ttf_*.cc: Added.
* woff2/src/font.cc:
* woff2/src/glyph.cc:
* woff2/src/normalize.cc:
* woff2/src/port.h:
* woff2/src/store_bytes.h:
(woff2::Store16):
* woff2/src/variable_length.cc:
* woff2/src/woff2_common.cc:
* woff2/src/woff2_dec.cc:
* woff2/src/woff2_decompress.cc:
* woff2/src/woff2_enc.cc:
* woff2/src/woff2_info.cc: Added.

2017-08-08 Michael Catanzaro <mcatanzaro@igalia.com>

[CMake] Properly test if compiler supports compiler flags
@@ -1,13 +1,15 @@
set(BROTLI_DIR "${THIRDPARTY_DIR}/brotli")

set(BROTLI_INCLUDE_DIRECTORIES
"${BROTLI_DIR}/common"
"${BROTLI_DIR}/dec"
"${BROTLI_DIR}/include"
)

set(BROTLI_SOURCES
${BROTLI_DIR}/common/dictionary.c
${BROTLI_DIR}/dec/bit_reader.c
${BROTLI_DIR}/dec/decode.c
${BROTLI_DIR}/dec/dictionary.c
${BROTLI_DIR}/dec/huffman.c
${BROTLI_DIR}/dec/state.c
)
@@ -14,4 +14,4 @@ The in-tree copy is updated by running
sh update.sh
from within the modules/brotli directory.

Current version: [commit 29d31d5921b0a2b323ac24e7f7d0cdc9a3c0dd08].
Current version: [commit 4f8cd4c0f4443d51a9603790a445b06c073b7a4d].
@@ -0,0 +1,57 @@
/* Copyright 2016 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

#ifndef BROTLI_COMMON_CONSTANTS_H_
#define BROTLI_COMMON_CONSTANTS_H_

/* Specification: 7.3. Encoding of the context map */
#define BROTLI_CONTEXT_MAP_MAX_RLE 16

/* Specification: 2. Compressed representation overview */
#define BROTLI_MAX_NUMBER_OF_BLOCK_TYPES 256

/* Specification: 3.3. Alphabet sizes: insert-and-copy length */
#define BROTLI_NUM_LITERAL_SYMBOLS 256
#define BROTLI_NUM_COMMAND_SYMBOLS 704
#define BROTLI_NUM_BLOCK_LEN_SYMBOLS 26
#define BROTLI_MAX_CONTEXT_MAP_SYMBOLS (BROTLI_MAX_NUMBER_OF_BLOCK_TYPES + \
BROTLI_CONTEXT_MAP_MAX_RLE)
#define BROTLI_MAX_BLOCK_TYPE_SYMBOLS (BROTLI_MAX_NUMBER_OF_BLOCK_TYPES + 2)

/* Specification: 3.5. Complex prefix codes */
#define BROTLI_REPEAT_PREVIOUS_CODE_LENGTH 16
#define BROTLI_REPEAT_ZERO_CODE_LENGTH 17
#define BROTLI_CODE_LENGTH_CODES (BROTLI_REPEAT_ZERO_CODE_LENGTH + 1)
/* "code length of 8 is repeated" */
#define BROTLI_INITIAL_REPEATED_CODE_LENGTH 8

/* Specification: 4. Encoding of distances */
#define BROTLI_NUM_DISTANCE_SHORT_CODES 16
#define BROTLI_MAX_NPOSTFIX 3
#define BROTLI_MAX_NDIRECT 120
#define BROTLI_MAX_DISTANCE_BITS 24U
/* BROTLI_NUM_DISTANCE_SYMBOLS == 520 */
#define BROTLI_NUM_DISTANCE_SYMBOLS (BROTLI_NUM_DISTANCE_SHORT_CODES + \
BROTLI_MAX_NDIRECT + \
(BROTLI_MAX_DISTANCE_BITS << \
(BROTLI_MAX_NPOSTFIX + 1)))
/* Distance that is guaranteed to be representable in any stream. */
#define BROTLI_MAX_DISTANCE 0x3FFFFFC

/* 7.1. Context modes and context ID lookup for literals */
/* "context IDs for literals are in the range of 0..63" */
#define BROTLI_LITERAL_CONTEXT_BITS 6

/* 7.2. Context ID for distances */
#define BROTLI_DISTANCE_CONTEXT_BITS 2

/* 9.1. Format of the Stream Header */
/* Number of slack bytes for window size. Don't confuse
with BROTLI_NUM_DISTANCE_SHORT_CODES. */
#define BROTLI_WINDOW_GAP 16
#define BROTLI_MAX_BACKWARD_LIMIT(W) (((size_t)1 << (W)) - BROTLI_WINDOW_GAP)

#endif /* BROTLI_COMMON_CONSTANTS_H_ */

Large diffs are not rendered by default.

0 comments on commit 2c4cc25

Please sign in to comment.