aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/brotli/dec
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /contrib/libs/brotli/dec
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/brotli/dec')
-rw-r--r--contrib/libs/brotli/dec/bit_reader.c44
-rw-r--r--contrib/libs/brotli/dec/bit_reader.h232
-rw-r--r--contrib/libs/brotli/dec/decode.c1044
-rw-r--r--contrib/libs/brotli/dec/huffman.c312
-rw-r--r--contrib/libs/brotli/dec/huffman.h72
-rw-r--r--contrib/libs/brotli/dec/prefix.h1474
-rw-r--r--contrib/libs/brotli/dec/state.c168
-rw-r--r--contrib/libs/brotli/dec/state.h288
-rw-r--r--contrib/libs/brotli/dec/ya.make30
9 files changed, 1832 insertions, 1832 deletions
diff --git a/contrib/libs/brotli/dec/bit_reader.c b/contrib/libs/brotli/dec/bit_reader.c
index 722fd906dd..a685fca6c2 100644
--- a/contrib/libs/brotli/dec/bit_reader.c
+++ b/contrib/libs/brotli/dec/bit_reader.c
@@ -1,25 +1,25 @@
-/* Copyright 2013 Google Inc. All Rights Reserved.
-
+/* Copyright 2013 Google Inc. All Rights Reserved.
+
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
-*/
-
-/* Bit reading helpers */
-
+*/
+
+/* Bit reading helpers */
+
#include "./bit_reader.h"
-
+
#include "../common/platform.h"
#include <brotli/types.h>
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
void BrotliInitBitReader(BrotliBitReader* const br) {
- br->val_ = 0;
- br->bit_pos_ = sizeof(br->val_) << 3;
-}
-
+ br->val_ = 0;
+ br->bit_pos_ = sizeof(br->val_) << 3;
+}
+
BROTLI_BOOL BrotliWarmupBitReader(BrotliBitReader* const br) {
size_t aligned_read_mask = (sizeof(br->val_) >> 1) - 1;
/* Fixing alignment after unaligned BrotliFillWindow would result accumulator
@@ -31,8 +31,8 @@ BROTLI_BOOL BrotliWarmupBitReader(BrotliBitReader* const br) {
if (BrotliGetAvailableBits(br) == 0) {
if (!BrotliPullByte(br)) {
return BROTLI_FALSE;
- }
- }
+ }
+ }
while ((((size_t)br->next_in) & aligned_read_mask) != 0) {
if (!BrotliPullByte(br)) {
@@ -41,8 +41,8 @@ BROTLI_BOOL BrotliWarmupBitReader(BrotliBitReader* const br) {
}
}
return BROTLI_TRUE;
-}
-
-#if defined(__cplusplus) || defined(c_plusplus)
+}
+
+#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
-#endif
+#endif
diff --git a/contrib/libs/brotli/dec/bit_reader.h b/contrib/libs/brotli/dec/bit_reader.h
index c06e91419f..732072bfdd 100644
--- a/contrib/libs/brotli/dec/bit_reader.h
+++ b/contrib/libs/brotli/dec/bit_reader.h
@@ -1,25 +1,25 @@
-/* Copyright 2013 Google Inc. All Rights Reserved.
-
+/* Copyright 2013 Google Inc. All Rights Reserved.
+
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
-*/
-
-/* Bit reading helpers */
-
-#ifndef BROTLI_DEC_BIT_READER_H_
-#define BROTLI_DEC_BIT_READER_H_
-
+*/
+
+/* Bit reading helpers */
+
+#ifndef BROTLI_DEC_BIT_READER_H_
+#define BROTLI_DEC_BIT_READER_H_
+
#include <string.h> /* memcpy */
-
+
#include "../common/platform.h"
#include <brotli/types.h>
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
#define BROTLI_SHORT_FILL_BIT_WINDOW_READ (sizeof(brotli_reg_t) >> 1)
-
+
static const uint32_t kBitMask[33] = { 0x00000000,
0x00000001, 0x00000003, 0x00000007, 0x0000000F,
0x0000001F, 0x0000003F, 0x0000007F, 0x000000FF,
@@ -30,7 +30,7 @@ static const uint32_t kBitMask[33] = { 0x00000000,
0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF, 0x0FFFFFFF,
0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF, 0xFFFFFFFF
};
-
+
static BROTLI_INLINE uint32_t BitMask(uint32_t n) {
if (BROTLI_IS_CONSTANT(n) || BROTLI_HAS_UBFX) {
/* Masking with this expression turns to a single
@@ -41,20 +41,20 @@ static BROTLI_INLINE uint32_t BitMask(uint32_t n) {
}
}
-typedef struct {
+typedef struct {
brotli_reg_t val_; /* pre-fetched bits */
uint32_t bit_pos_; /* current bit-reading position in val_ */
const uint8_t* next_in; /* the byte we're reading from */
size_t avail_in;
-} BrotliBitReader;
-
+} BrotliBitReader;
+
typedef struct {
brotli_reg_t val_;
uint32_t bit_pos_;
const uint8_t* next_in;
size_t avail_in;
} BrotliBitReaderState;
-
+
/* Initializes the BrotliBitReader fields. */
BROTLI_INTERNAL void BrotliInitBitReader(BrotliBitReader* const br);
@@ -64,7 +64,7 @@ BROTLI_INTERNAL void BrotliInitBitReader(BrotliBitReader* const br);
For BROTLI_ALIGNED_READ this function also prepares bit reader for aligned
reading. */
BROTLI_INTERNAL BROTLI_BOOL BrotliWarmupBitReader(BrotliBitReader* const br);
-
+
static BROTLI_INLINE void BrotliBitReaderSaveState(
BrotliBitReader* const from, BrotliBitReaderState* to) {
to->val_ = from->val_;
@@ -72,7 +72,7 @@ static BROTLI_INLINE void BrotliBitReaderSaveState(
to->next_in = from->next_in;
to->avail_in = from->avail_in;
}
-
+
static BROTLI_INLINE void BrotliBitReaderRestoreState(
BrotliBitReader* const to, BrotliBitReaderState* from) {
to->val_ = from->val_;
@@ -80,15 +80,15 @@ static BROTLI_INLINE void BrotliBitReaderRestoreState(
to->next_in = from->next_in;
to->avail_in = from->avail_in;
}
-
+
static BROTLI_INLINE uint32_t BrotliGetAvailableBits(
const BrotliBitReader* br) {
return (BROTLI_64_BITS ? 64 : 32) - br->bit_pos_;
-}
-
-/* Returns amount of unread bytes the bit reader still has buffered from the
- BrotliInput, including whole bytes in br->val_. */
-static BROTLI_INLINE size_t BrotliGetRemainingBytes(BrotliBitReader* br) {
+}
+
+/* Returns amount of unread bytes the bit reader still has buffered from the
+ BrotliInput, including whole bytes in br->val_. */
+static BROTLI_INLINE size_t BrotliGetRemainingBytes(BrotliBitReader* br) {
return br->avail_in + (BrotliGetAvailableBits(br) >> 3);
}
@@ -100,59 +100,59 @@ static BROTLI_INLINE BROTLI_BOOL BrotliCheckInputAmount(
}
/* Guarantees that there are at least |n_bits| + 1 bits in accumulator.
- Precondition: accumulator contains at least 1 bit.
+ Precondition: accumulator contains at least 1 bit.
|n_bits| should be in the range [1..24] for regular build. For portable
non-64-bit little-endian build only 16 bits are safe to request. */
-static BROTLI_INLINE void BrotliFillBitWindow(
+static BROTLI_INLINE void BrotliFillBitWindow(
BrotliBitReader* const br, uint32_t n_bits) {
#if (BROTLI_64_BITS)
if (!BROTLI_ALIGNED_READ && BROTLI_IS_CONSTANT(n_bits) && (n_bits <= 8)) {
- if (br->bit_pos_ >= 56) {
- br->val_ >>= 56;
- br->bit_pos_ ^= 56; /* here same as -= 56 because of the if condition */
+ if (br->bit_pos_ >= 56) {
+ br->val_ >>= 56;
+ br->bit_pos_ ^= 56; /* here same as -= 56 because of the if condition */
br->val_ |= BROTLI_UNALIGNED_LOAD64LE(br->next_in) << 8;
- br->avail_in -= 7;
- br->next_in += 7;
- }
+ br->avail_in -= 7;
+ br->next_in += 7;
+ }
} else if (
!BROTLI_ALIGNED_READ && BROTLI_IS_CONSTANT(n_bits) && (n_bits <= 16)) {
- if (br->bit_pos_ >= 48) {
- br->val_ >>= 48;
- br->bit_pos_ ^= 48; /* here same as -= 48 because of the if condition */
+ if (br->bit_pos_ >= 48) {
+ br->val_ >>= 48;
+ br->bit_pos_ ^= 48; /* here same as -= 48 because of the if condition */
br->val_ |= BROTLI_UNALIGNED_LOAD64LE(br->next_in) << 16;
- br->avail_in -= 6;
- br->next_in += 6;
- }
- } else {
- if (br->bit_pos_ >= 32) {
- br->val_ >>= 32;
- br->bit_pos_ ^= 32; /* here same as -= 32 because of the if condition */
+ br->avail_in -= 6;
+ br->next_in += 6;
+ }
+ } else {
+ if (br->bit_pos_ >= 32) {
+ br->val_ >>= 32;
+ br->bit_pos_ ^= 32; /* here same as -= 32 because of the if condition */
br->val_ |= ((uint64_t)BROTLI_UNALIGNED_LOAD32LE(br->next_in)) << 32;
br->avail_in -= BROTLI_SHORT_FILL_BIT_WINDOW_READ;
br->next_in += BROTLI_SHORT_FILL_BIT_WINDOW_READ;
- }
- }
+ }
+ }
#else
if (!BROTLI_ALIGNED_READ && BROTLI_IS_CONSTANT(n_bits) && (n_bits <= 8)) {
- if (br->bit_pos_ >= 24) {
- br->val_ >>= 24;
- br->bit_pos_ ^= 24; /* here same as -= 24 because of the if condition */
+ if (br->bit_pos_ >= 24) {
+ br->val_ >>= 24;
+ br->bit_pos_ ^= 24; /* here same as -= 24 because of the if condition */
br->val_ |= BROTLI_UNALIGNED_LOAD32LE(br->next_in) << 8;
- br->avail_in -= 3;
- br->next_in += 3;
- }
- } else {
- if (br->bit_pos_ >= 16) {
- br->val_ >>= 16;
- br->bit_pos_ ^= 16; /* here same as -= 16 because of the if condition */
+ br->avail_in -= 3;
+ br->next_in += 3;
+ }
+ } else {
+ if (br->bit_pos_ >= 16) {
+ br->val_ >>= 16;
+ br->bit_pos_ ^= 16; /* here same as -= 16 because of the if condition */
br->val_ |= ((uint32_t)BROTLI_UNALIGNED_LOAD16LE(br->next_in)) << 16;
br->avail_in -= BROTLI_SHORT_FILL_BIT_WINDOW_READ;
br->next_in += BROTLI_SHORT_FILL_BIT_WINDOW_READ;
- }
- }
-#endif
-}
-
+ }
+ }
+#endif
+}
+
/* Mostly like BrotliFillBitWindow, but guarantees only 16 bits and reads no
more than BROTLI_SHORT_FILL_BIT_WINDOW_READ bytes of input. */
static BROTLI_INLINE void BrotliFillBitWindow16(BrotliBitReader* const br) {
@@ -165,25 +165,25 @@ static BROTLI_INLINE BROTLI_BOOL BrotliPullByte(BrotliBitReader* const br) {
if (br->avail_in == 0) {
return BROTLI_FALSE;
}
- br->val_ >>= 8;
+ br->val_ >>= 8;
#if (BROTLI_64_BITS)
br->val_ |= ((uint64_t)*br->next_in) << 56;
-#else
+#else
br->val_ |= ((uint32_t)*br->next_in) << 24;
-#endif
- br->bit_pos_ -= 8;
- --br->avail_in;
- ++br->next_in;
+#endif
+ br->bit_pos_ -= 8;
+ --br->avail_in;
+ ++br->next_in;
return BROTLI_TRUE;
-}
-
+}
+
/* Returns currently available bits.
The number of valid bits could be calculated by BrotliGetAvailableBits. */
static BROTLI_INLINE brotli_reg_t BrotliGetBitsUnmasked(
BrotliBitReader* const br) {
return br->val_ >> br->bit_pos_;
-}
-
+}
+
/* Like BrotliGetBits, but does not mask the result.
The result contains at least 16 valid bits. */
static BROTLI_INLINE uint32_t BrotliGet16BitsUnmasked(
@@ -194,12 +194,12 @@ static BROTLI_INLINE uint32_t BrotliGet16BitsUnmasked(
/* Returns the specified number of bits from |br| without advancing bit
position. */
-static BROTLI_INLINE uint32_t BrotliGetBits(
+static BROTLI_INLINE uint32_t BrotliGetBits(
BrotliBitReader* const br, uint32_t n_bits) {
- BrotliFillBitWindow(br, n_bits);
+ BrotliFillBitWindow(br, n_bits);
return (uint32_t)BrotliGetBitsUnmasked(br) & BitMask(n_bits);
-}
-
+}
+
/* Tries to peek the specified amount of bits. Returns BROTLI_FALSE, if there
is not enough input. */
static BROTLI_INLINE BROTLI_BOOL BrotliSafeGetBits(
@@ -214,11 +214,11 @@ static BROTLI_INLINE BROTLI_BOOL BrotliSafeGetBits(
}
/* Advances the bit pos by |n_bits|. */
-static BROTLI_INLINE void BrotliDropBits(
+static BROTLI_INLINE void BrotliDropBits(
BrotliBitReader* const br, uint32_t n_bits) {
br->bit_pos_ += n_bits;
-}
-
+}
+
static BROTLI_INLINE void BrotliBitReaderUnload(BrotliBitReader* br) {
uint32_t unused_bytes = BrotliGetAvailableBits(br) >> 3;
uint32_t unused_bits = unused_bytes << 3;
@@ -234,17 +234,17 @@ static BROTLI_INLINE void BrotliBitReaderUnload(BrotliBitReader* br) {
/* Reads the specified number of bits from |br| and advances the bit pos.
Precondition: accumulator MUST contain at least |n_bits|. */
-static BROTLI_INLINE void BrotliTakeBits(
+static BROTLI_INLINE void BrotliTakeBits(
BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) {
*val = (uint32_t)BrotliGetBitsUnmasked(br) & BitMask(n_bits);
BROTLI_LOG(("[BrotliReadBits] %d %d %d val: %6x\n",
(int)br->avail_in, (int)br->bit_pos_, (int)n_bits, (int)*val));
BrotliDropBits(br, n_bits);
-}
-
+}
+
/* Reads the specified number of bits from |br| and advances the bit pos.
- Assumes that there is enough input to perform BrotliFillBitWindow. */
-static BROTLI_INLINE uint32_t BrotliReadBits(
+ Assumes that there is enough input to perform BrotliFillBitWindow. */
+static BROTLI_INLINE uint32_t BrotliReadBits(
BrotliBitReader* const br, uint32_t n_bits) {
if (BROTLI_64_BITS || (n_bits <= 16)) {
uint32_t val;
@@ -260,8 +260,8 @@ static BROTLI_INLINE uint32_t BrotliReadBits(
BrotliTakeBits(br, n_bits - 16, &high_val);
return low_val | (high_val << 16);
}
-}
-
+}
+
/* Tries to read the specified amount of bits. Returns BROTLI_FALSE, if there
is not enough input. |n_bits| MUST be positive. */
static BROTLI_INLINE BROTLI_BOOL BrotliSafeReadBits(
@@ -269,41 +269,41 @@ static BROTLI_INLINE BROTLI_BOOL BrotliSafeReadBits(
while (BrotliGetAvailableBits(br) < n_bits) {
if (!BrotliPullByte(br)) {
return BROTLI_FALSE;
- }
- }
- BrotliTakeBits(br, n_bits, val);
+ }
+ }
+ BrotliTakeBits(br, n_bits, val);
return BROTLI_TRUE;
-}
-
-/* Advances the bit reader position to the next byte boundary and verifies
- that any skipped bits are set to zero. */
+}
+
+/* Advances the bit reader position to the next byte boundary and verifies
+ that any skipped bits are set to zero. */
static BROTLI_INLINE BROTLI_BOOL BrotliJumpToByteBoundary(BrotliBitReader* br) {
uint32_t pad_bits_count = BrotliGetAvailableBits(br) & 0x7;
- uint32_t pad_bits = 0;
- if (pad_bits_count != 0) {
- BrotliTakeBits(br, pad_bits_count, &pad_bits);
- }
+ uint32_t pad_bits = 0;
+ if (pad_bits_count != 0) {
+ BrotliTakeBits(br, pad_bits_count, &pad_bits);
+ }
return TO_BROTLI_BOOL(pad_bits == 0);
-}
-
-/* Copies remaining input bytes stored in the bit reader to the output. Value
+}
+
+/* Copies remaining input bytes stored in the bit reader to the output. Value
|num| may not be larger than BrotliGetRemainingBytes. The bit reader must be
- warmed up again after this. */
-static BROTLI_INLINE void BrotliCopyBytes(uint8_t* dest,
- BrotliBitReader* br, size_t num) {
+ warmed up again after this. */
+static BROTLI_INLINE void BrotliCopyBytes(uint8_t* dest,
+ BrotliBitReader* br, size_t num) {
while (BrotliGetAvailableBits(br) >= 8 && num > 0) {
*dest = (uint8_t)BrotliGetBitsUnmasked(br);
BrotliDropBits(br, 8);
- ++dest;
- --num;
- }
- memcpy(dest, br->next_in, num);
+ ++dest;
+ --num;
+ }
+ memcpy(dest, br->next_in, num);
br->avail_in -= num;
- br->next_in += num;
-}
-
-#if defined(__cplusplus) || defined(c_plusplus)
+ br->next_in += num;
+}
+
+#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
-#endif
-
-#endif /* BROTLI_DEC_BIT_READER_H_ */
+#endif
+
+#endif /* BROTLI_DEC_BIT_READER_H_ */
diff --git a/contrib/libs/brotli/dec/decode.c b/contrib/libs/brotli/dec/decode.c
index 08bd76ca16..ee898d4372 100644
--- a/contrib/libs/brotli/dec/decode.c
+++ b/contrib/libs/brotli/dec/decode.c
@@ -1,11 +1,11 @@
-/* Copyright 2013 Google Inc. All Rights Reserved.
-
+/* Copyright 2013 Google Inc. All Rights Reserved.
+
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
-
+
#include <brotli/decode.h>
-
+
#include <stdlib.h> /* free, malloc */
#include <string.h> /* memcpy, memset */
@@ -15,48 +15,48 @@
#include "../common/platform.h"
#include "../common/transform.h"
#include "../common/version.h"
-#include "./bit_reader.h"
+#include "./bit_reader.h"
#include "./huffman.h"
#include "./prefix.h"
#include "./state.h"
-
+
#if defined(BROTLI_TARGET_NEON)
#include <arm_neon.h>
#endif
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
#define BROTLI_FAILURE(CODE) (BROTLI_DUMP(), CODE)
-
+
#define BROTLI_LOG_UINT(name) \
BROTLI_LOG(("[%s] %s = %lu\n", __func__, #name, (unsigned long)(name)))
#define BROTLI_LOG_ARRAY_INDEX(array_name, idx) \
BROTLI_LOG(("[%s] %s[%lu] = %lu\n", __func__, #array_name, \
(unsigned long)(idx), (unsigned long)array_name[idx]))
-
+
#define HUFFMAN_TABLE_BITS 8U
#define HUFFMAN_TABLE_MASK 0xFF
-
+
/* We need the slack region for the following reasons:
- doing up to two 16-byte copies for fast backward copying
- inserting transformed dictionary word (5 prefix + 24 base + 8 suffix) */
static const uint32_t kRingBufferWriteAheadSlack = 42;
static const uint8_t kCodeLengthCodeOrder[BROTLI_CODE_LENGTH_CODES] = {
- 1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15,
-};
-
-/* Static prefix code for the complex code length code lengths. */
-static const uint8_t kCodeLengthPrefixLength[16] = {
- 2, 2, 2, 3, 2, 2, 2, 4, 2, 2, 2, 3, 2, 2, 2, 4,
-};
-
-static const uint8_t kCodeLengthPrefixValue[16] = {
- 0, 4, 3, 2, 0, 4, 3, 1, 0, 4, 3, 2, 0, 4, 3, 5,
-};
-
+ 1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+};
+
+/* Static prefix code for the complex code length code lengths. */
+static const uint8_t kCodeLengthPrefixLength[16] = {
+ 2, 2, 2, 3, 2, 2, 2, 4, 2, 2, 2, 3, 2, 2, 2, 4,
+};
+
+static const uint8_t kCodeLengthPrefixValue[16] = {
+ 0, 4, 3, 2, 0, 4, 3, 1, 0, 4, 3, 2, 0, 4, 3, 5,
+};
+
BROTLI_BOOL BrotliDecoderSetParameter(
BrotliDecoderState* state, BrotliDecoderParameter p, uint32_t value) {
if (state->state != BROTLI_STATE_UNINITED) return BROTLI_FALSE;
@@ -64,7 +64,7 @@ BROTLI_BOOL BrotliDecoderSetParameter(
case BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:
state->canny_ringbuffer_allocation = !!value ? 0 : 1;
return BROTLI_TRUE;
-
+
case BROTLI_DECODER_PARAM_LARGE_WINDOW:
state->large_window = TO_BROTLI_BOOL(!!value);
return BROTLI_TRUE;
@@ -132,20 +132,20 @@ static BROTLI_NOINLINE BrotliDecoderResult SaveErrorCode(
Precondition: bit-reader accumulator has at least 8 bits. */
static BrotliDecoderErrorCode DecodeWindowBits(BrotliDecoderState* s,
BrotliBitReader* br) {
- uint32_t n;
+ uint32_t n;
BROTLI_BOOL large_window = s->large_window;
s->large_window = BROTLI_FALSE;
- BrotliTakeBits(br, 1, &n);
- if (n == 0) {
+ BrotliTakeBits(br, 1, &n);
+ if (n == 0) {
s->window_bits = 16;
return BROTLI_DECODER_SUCCESS;
- }
- BrotliTakeBits(br, 3, &n);
- if (n != 0) {
+ }
+ BrotliTakeBits(br, 3, &n);
+ if (n != 0) {
s->window_bits = 17 + n;
return BROTLI_DECODER_SUCCESS;
- }
- BrotliTakeBits(br, 3, &n);
+ }
+ BrotliTakeBits(br, 3, &n);
if (n == 1) {
if (large_window) {
BrotliTakeBits(br, 1, &n);
@@ -158,188 +158,188 @@ static BrotliDecoderErrorCode DecodeWindowBits(BrotliDecoderState* s,
return BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS);
}
}
- if (n != 0) {
+ if (n != 0) {
s->window_bits = 8 + n;
return BROTLI_DECODER_SUCCESS;
- }
+ }
s->window_bits = 17;
return BROTLI_DECODER_SUCCESS;
-}
-
+}
+
static BROTLI_INLINE void memmove16(uint8_t* dst, uint8_t* src) {
#if defined(BROTLI_TARGET_NEON)
- vst1q_u8(dst, vld1q_u8(src));
-#else
+ vst1q_u8(dst, vld1q_u8(src));
+#else
uint32_t buffer[4];
memcpy(buffer, src, 16);
memcpy(dst, buffer, 16);
-#endif
-}
-
-/* Decodes a number in the range [0..255], by reading 1 - 11 bits. */
+#endif
+}
+
+/* Decodes a number in the range [0..255], by reading 1 - 11 bits. */
static BROTLI_NOINLINE BrotliDecoderErrorCode DecodeVarLenUint8(
BrotliDecoderState* s, BrotliBitReader* br, uint32_t* value) {
- uint32_t bits;
- switch (s->substate_decode_uint8) {
- case BROTLI_STATE_DECODE_UINT8_NONE:
+ uint32_t bits;
+ switch (s->substate_decode_uint8) {
+ case BROTLI_STATE_DECODE_UINT8_NONE:
if (BROTLI_PREDICT_FALSE(!BrotliSafeReadBits(br, 1, &bits))) {
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
- if (bits == 0) {
- *value = 0;
+ }
+ if (bits == 0) {
+ *value = 0;
return BROTLI_DECODER_SUCCESS;
- }
+ }
/* Fall through. */
-
- case BROTLI_STATE_DECODE_UINT8_SHORT:
+
+ case BROTLI_STATE_DECODE_UINT8_SHORT:
if (BROTLI_PREDICT_FALSE(!BrotliSafeReadBits(br, 3, &bits))) {
- s->substate_decode_uint8 = BROTLI_STATE_DECODE_UINT8_SHORT;
+ s->substate_decode_uint8 = BROTLI_STATE_DECODE_UINT8_SHORT;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
- if (bits == 0) {
- *value = 1;
- s->substate_decode_uint8 = BROTLI_STATE_DECODE_UINT8_NONE;
+ }
+ if (bits == 0) {
+ *value = 1;
+ s->substate_decode_uint8 = BROTLI_STATE_DECODE_UINT8_NONE;
return BROTLI_DECODER_SUCCESS;
- }
- /* Use output value as a temporary storage. It MUST be persisted. */
+ }
+ /* Use output value as a temporary storage. It MUST be persisted. */
*value = bits;
/* Fall through. */
-
- case BROTLI_STATE_DECODE_UINT8_LONG:
+
+ case BROTLI_STATE_DECODE_UINT8_LONG:
if (BROTLI_PREDICT_FALSE(!BrotliSafeReadBits(br, *value, &bits))) {
- s->substate_decode_uint8 = BROTLI_STATE_DECODE_UINT8_LONG;
+ s->substate_decode_uint8 = BROTLI_STATE_DECODE_UINT8_LONG;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
+ }
*value = (1U << *value) + bits;
- s->substate_decode_uint8 = BROTLI_STATE_DECODE_UINT8_NONE;
+ s->substate_decode_uint8 = BROTLI_STATE_DECODE_UINT8_NONE;
return BROTLI_DECODER_SUCCESS;
-
- default:
+
+ default:
return
BROTLI_FAILURE(BROTLI_DECODER_ERROR_UNREACHABLE);
- }
-}
-
-/* Decodes a metablock length and flags by reading 2 - 31 bits. */
+ }
+}
+
+/* Decodes a metablock length and flags by reading 2 - 31 bits. */
static BrotliDecoderErrorCode BROTLI_NOINLINE DecodeMetaBlockLength(
BrotliDecoderState* s, BrotliBitReader* br) {
- uint32_t bits;
- int i;
- for (;;) {
- switch (s->substate_metablock_header) {
- case BROTLI_STATE_METABLOCK_HEADER_NONE:
- if (!BrotliSafeReadBits(br, 1, &bits)) {
+ uint32_t bits;
+ int i;
+ for (;;) {
+ switch (s->substate_metablock_header) {
+ case BROTLI_STATE_METABLOCK_HEADER_NONE:
+ if (!BrotliSafeReadBits(br, 1, &bits)) {
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
+ }
s->is_last_metablock = bits ? 1 : 0;
- s->meta_block_remaining_len = 0;
- s->is_uncompressed = 0;
- s->is_metadata = 0;
- if (!s->is_last_metablock) {
- s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NIBBLES;
- break;
- }
- s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_EMPTY;
+ s->meta_block_remaining_len = 0;
+ s->is_uncompressed = 0;
+ s->is_metadata = 0;
+ if (!s->is_last_metablock) {
+ s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NIBBLES;
+ break;
+ }
+ s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_EMPTY;
/* Fall through. */
-
- case BROTLI_STATE_METABLOCK_HEADER_EMPTY:
- if (!BrotliSafeReadBits(br, 1, &bits)) {
+
+ case BROTLI_STATE_METABLOCK_HEADER_EMPTY:
+ if (!BrotliSafeReadBits(br, 1, &bits)) {
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
- if (bits) {
- s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NONE;
+ }
+ if (bits) {
+ s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NONE;
return BROTLI_DECODER_SUCCESS;
- }
- s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NIBBLES;
+ }
+ s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NIBBLES;
/* Fall through. */
-
- case BROTLI_STATE_METABLOCK_HEADER_NIBBLES:
- if (!BrotliSafeReadBits(br, 2, &bits)) {
+
+ case BROTLI_STATE_METABLOCK_HEADER_NIBBLES:
+ if (!BrotliSafeReadBits(br, 2, &bits)) {
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
- s->size_nibbles = (uint8_t)(bits + 4);
- s->loop_counter = 0;
- if (bits == 3) {
- s->is_metadata = 1;
- s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_RESERVED;
- break;
- }
- s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_SIZE;
+ }
+ s->size_nibbles = (uint8_t)(bits + 4);
+ s->loop_counter = 0;
+ if (bits == 3) {
+ s->is_metadata = 1;
+ s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_RESERVED;
+ break;
+ }
+ s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_SIZE;
/* Fall through. */
-
- case BROTLI_STATE_METABLOCK_HEADER_SIZE:
- i = s->loop_counter;
+
+ case BROTLI_STATE_METABLOCK_HEADER_SIZE:
+ i = s->loop_counter;
for (; i < (int)s->size_nibbles; ++i) {
- if (!BrotliSafeReadBits(br, 4, &bits)) {
- s->loop_counter = i;
+ if (!BrotliSafeReadBits(br, 4, &bits)) {
+ s->loop_counter = i;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
- if (i + 1 == s->size_nibbles && s->size_nibbles > 4 && bits == 0) {
+ }
+ if (i + 1 == s->size_nibbles && s->size_nibbles > 4 && bits == 0) {
return BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE);
- }
- s->meta_block_remaining_len |= (int)(bits << (i * 4));
- }
- s->substate_metablock_header =
- BROTLI_STATE_METABLOCK_HEADER_UNCOMPRESSED;
+ }
+ s->meta_block_remaining_len |= (int)(bits << (i * 4));
+ }
+ s->substate_metablock_header =
+ BROTLI_STATE_METABLOCK_HEADER_UNCOMPRESSED;
/* Fall through. */
-
- case BROTLI_STATE_METABLOCK_HEADER_UNCOMPRESSED:
+
+ case BROTLI_STATE_METABLOCK_HEADER_UNCOMPRESSED:
if (!s->is_last_metablock) {
- if (!BrotliSafeReadBits(br, 1, &bits)) {
+ if (!BrotliSafeReadBits(br, 1, &bits)) {
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
+ }
s->is_uncompressed = bits ? 1 : 0;
- }
- ++s->meta_block_remaining_len;
- s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NONE;
+ }
+ ++s->meta_block_remaining_len;
+ s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NONE;
return BROTLI_DECODER_SUCCESS;
-
- case BROTLI_STATE_METABLOCK_HEADER_RESERVED:
- if (!BrotliSafeReadBits(br, 1, &bits)) {
+
+ case BROTLI_STATE_METABLOCK_HEADER_RESERVED:
+ if (!BrotliSafeReadBits(br, 1, &bits)) {
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
- if (bits != 0) {
+ }
+ if (bits != 0) {
return BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_RESERVED);
- }
- s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_BYTES;
+ }
+ s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_BYTES;
/* Fall through. */
-
- case BROTLI_STATE_METABLOCK_HEADER_BYTES:
- if (!BrotliSafeReadBits(br, 2, &bits)) {
+
+ case BROTLI_STATE_METABLOCK_HEADER_BYTES:
+ if (!BrotliSafeReadBits(br, 2, &bits)) {
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
- if (bits == 0) {
- s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NONE;
+ }
+ if (bits == 0) {
+ s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NONE;
return BROTLI_DECODER_SUCCESS;
- }
- s->size_nibbles = (uint8_t)bits;
- s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_METADATA;
+ }
+ s->size_nibbles = (uint8_t)bits;
+ s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_METADATA;
/* Fall through. */
-
- case BROTLI_STATE_METABLOCK_HEADER_METADATA:
- i = s->loop_counter;
+
+ case BROTLI_STATE_METABLOCK_HEADER_METADATA:
+ i = s->loop_counter;
for (; i < (int)s->size_nibbles; ++i) {
- if (!BrotliSafeReadBits(br, 8, &bits)) {
- s->loop_counter = i;
+ if (!BrotliSafeReadBits(br, 8, &bits)) {
+ s->loop_counter = i;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
- if (i + 1 == s->size_nibbles && s->size_nibbles > 1 && bits == 0) {
+ }
+ if (i + 1 == s->size_nibbles && s->size_nibbles > 1 && bits == 0) {
return BROTLI_FAILURE(
BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE);
- }
- s->meta_block_remaining_len |= (int)(bits << (i * 8));
- }
+ }
+ s->meta_block_remaining_len |= (int)(bits << (i * 8));
+ }
++s->meta_block_remaining_len;
s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NONE;
return BROTLI_DECODER_SUCCESS;
-
- default:
+
+ default:
return
BROTLI_FAILURE(BROTLI_DECODER_ERROR_UNREACHABLE);
- }
- }
-}
-
+ }
+ }
+}
+
/* Decodes the Huffman code.
This method doesn't read data from the bit reader, BUT drops the amount of
bits that correspond to the decoded symbol.
@@ -351,15 +351,15 @@ static BROTLI_INLINE uint32_t DecodeSymbol(uint32_t bits,
BROTLI_HC_ADJUST_TABLE_INDEX(table, bits & HUFFMAN_TABLE_MASK);
if (BROTLI_HC_FAST_LOAD_BITS(table) > HUFFMAN_TABLE_BITS) {
uint32_t nbits = BROTLI_HC_FAST_LOAD_BITS(table) - HUFFMAN_TABLE_BITS;
- BrotliDropBits(br, HUFFMAN_TABLE_BITS);
+ BrotliDropBits(br, HUFFMAN_TABLE_BITS);
BROTLI_HC_ADJUST_TABLE_INDEX(table,
BROTLI_HC_FAST_LOAD_VALUE(table) +
((bits >> HUFFMAN_TABLE_BITS) & BitMask(nbits)));
- }
+ }
BrotliDropBits(br, BROTLI_HC_FAST_LOAD_BITS(table));
return BROTLI_HC_FAST_LOAD_VALUE(table);
-}
-
+}
+
/* Reads and decodes the next Huffman code from bit-stream.
This method peeks 16 bits of input and drops 0 - 15 of them. */
static BROTLI_INLINE uint32_t ReadSymbol(const HuffmanCode* table,
@@ -419,10 +419,10 @@ static BROTLI_INLINE BROTLI_BOOL SafeReadSymbol(
return SafeDecodeSymbol(table, br, result);
}
-/* Makes a look-up in first level Huffman table. Peeks 8 bits. */
+/* Makes a look-up in first level Huffman table. Peeks 8 bits. */
static BROTLI_INLINE void PreloadSymbol(int safe,
const HuffmanCode* table,
- BrotliBitReader* br,
+ BrotliBitReader* br,
uint32_t* bits,
uint32_t* value) {
if (safe) {
@@ -432,40 +432,40 @@ static BROTLI_INLINE void PreloadSymbol(int safe,
BROTLI_HC_ADJUST_TABLE_INDEX(table, BrotliGetBits(br, HUFFMAN_TABLE_BITS));
*bits = BROTLI_HC_FAST_LOAD_BITS(table);
*value = BROTLI_HC_FAST_LOAD_VALUE(table);
-}
-
-/* Decodes the next Huffman code using data prepared by PreloadSymbol.
- Reads 0 - 15 bits. Also peeks 8 following bits. */
+}
+
+/* Decodes the next Huffman code using data prepared by PreloadSymbol.
+ Reads 0 - 15 bits. Also peeks 8 following bits. */
static BROTLI_INLINE uint32_t ReadPreloadedSymbol(const HuffmanCode* table,
- BrotliBitReader* br,
+ BrotliBitReader* br,
uint32_t* bits,
uint32_t* value) {
uint32_t result = *value;
if (BROTLI_PREDICT_FALSE(*bits > HUFFMAN_TABLE_BITS)) {
uint32_t val = BrotliGet16BitsUnmasked(br);
- const HuffmanCode* ext = table + (val & HUFFMAN_TABLE_MASK) + *value;
+ const HuffmanCode* ext = table + (val & HUFFMAN_TABLE_MASK) + *value;
uint32_t mask = BitMask((*bits - HUFFMAN_TABLE_BITS));
BROTLI_HC_MARK_TABLE_FOR_FAST_LOAD(ext);
- BrotliDropBits(br, HUFFMAN_TABLE_BITS);
+ BrotliDropBits(br, HUFFMAN_TABLE_BITS);
BROTLI_HC_ADJUST_TABLE_INDEX(ext, (val >> HUFFMAN_TABLE_BITS) & mask);
BrotliDropBits(br, BROTLI_HC_FAST_LOAD_BITS(ext));
result = BROTLI_HC_FAST_LOAD_VALUE(ext);
- } else {
+ } else {
BrotliDropBits(br, *bits);
- }
+ }
PreloadSymbol(0, table, br, bits, value);
- return result;
-}
-
+ return result;
+}
+
static BROTLI_INLINE uint32_t Log2Floor(uint32_t x) {
uint32_t result = 0;
- while (x) {
- x >>= 1;
- ++result;
- }
- return result;
-}
-
+ while (x) {
+ x >>= 1;
+ ++result;
+ }
+ return result;
+}
+
/* Reads (s->symbol + 1) symbols.
Totally 1..4 symbols are read, 1..11 bits each.
The list of symbols MUST NOT contain duplicates. */
@@ -726,24 +726,24 @@ static BrotliDecoderErrorCode ReadCodeLengthCodeLengths(BrotliDecoderState* s) {
return BROTLI_DECODER_SUCCESS;
}
-/* Decodes the Huffman tables.
- There are 2 scenarios:
- A) Huffman code contains only few symbols (1..4). Those symbols are read
- directly; their code lengths are defined by the number of symbols.
+/* Decodes the Huffman tables.
+ There are 2 scenarios:
+ A) Huffman code contains only few symbols (1..4). Those symbols are read
+ directly; their code lengths are defined by the number of symbols.
For this scenario 4 - 49 bits will be read.
-
- B) 2-phase decoding:
- B.1) Small Huffman table is decoded; it is specified with code lengths
- encoded with predefined entropy code. 32 - 74 bits are used.
- B.2) Decoded table is used to decode code lengths of symbols in resulting
+
+ B) 2-phase decoding:
+ B.1) Small Huffman table is decoded; it is specified with code lengths
+ encoded with predefined entropy code. 32 - 74 bits are used.
+ B.2) Decoded table is used to decode code lengths of symbols in resulting
Huffman table. In worst case 3520 bits are read. */
static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size,
uint32_t max_symbol,
HuffmanCode* table,
uint32_t* opt_table_size,
BrotliDecoderState* s) {
- BrotliBitReader* br = &s->br;
- /* Unnecessary masking, but might be good for safety. */
+ BrotliBitReader* br = &s->br;
+ /* Unnecessary masking, but might be good for safety. */
alphabet_size &= 0x7FF;
/* State machine. */
for (;;) {
@@ -769,11 +769,11 @@ static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size,
/* Fall through. */
case BROTLI_STATE_HUFFMAN_SIMPLE_SIZE:
- /* Read symbols, codes & code lengths directly. */
+ /* Read symbols, codes & code lengths directly. */
if (!BrotliSafeReadBits(br, 2, &s->symbol)) { /* num_symbols */
s->substate_huffman = BROTLI_STATE_HUFFMAN_SIMPLE_SIZE;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
+ }
s->sub_loop_counter = 0;
/* Fall through. */
@@ -793,16 +793,16 @@ static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size,
if (!BrotliSafeReadBits(br, 1, &bits)) {
s->substate_huffman = BROTLI_STATE_HUFFMAN_SIMPLE_BUILD;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
+ }
s->symbol += bits;
- }
+ }
BROTLI_LOG_UINT(s->symbol);
table_size = BrotliBuildSimpleHuffmanTable(
table, HUFFMAN_TABLE_BITS, s->symbols_lists_array, s->symbol);
- if (opt_table_size) {
+ if (opt_table_size) {
*opt_table_size = table_size;
- }
- s->substate_huffman = BROTLI_STATE_HUFFMAN_NONE;
+ }
+ s->substate_huffman = BROTLI_STATE_HUFFMAN_NONE;
return BROTLI_DECODER_SUCCESS;
}
@@ -812,7 +812,7 @@ static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size,
BrotliDecoderErrorCode result = ReadCodeLengthCodeLengths(s);
if (result != BROTLI_DECODER_SUCCESS) {
return result;
- }
+ }
BrotliBuildCodeLengthsHuffmanTable(s->table,
s->code_length_code_lengths,
s->code_length_histo);
@@ -820,7 +820,7 @@ static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size,
for (i = 0; i <= BROTLI_HUFFMAN_MAX_CODE_LENGTH; ++i) {
s->next_symbol[i] = (int)i - (BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1);
s->symbol_lists[s->next_symbol[i]] = 0xFFFF;
- }
+ }
s->symbol = 0;
s->prev_code_len = BROTLI_INITIAL_REPEATED_CODE_LENGTH;
@@ -828,7 +828,7 @@ static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size,
s->repeat_code_len = 0;
s->space = 32768;
s->substate_huffman = BROTLI_STATE_HUFFMAN_LENGTH_SYMBOLS;
- }
+ }
/* Fall through. */
case BROTLI_STATE_HUFFMAN_LENGTH_SYMBOLS: {
@@ -840,37 +840,37 @@ static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size,
if (result != BROTLI_DECODER_SUCCESS) {
return result;
}
-
+
if (s->space != 0) {
BROTLI_LOG(("[ReadHuffmanCode] space = %d\n", (int)s->space));
return BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE);
- }
+ }
table_size = BrotliBuildHuffmanTable(
table, HUFFMAN_TABLE_BITS, s->symbol_lists, s->code_length_histo);
- if (opt_table_size) {
- *opt_table_size = table_size;
- }
+ if (opt_table_size) {
+ *opt_table_size = table_size;
+ }
s->substate_huffman = BROTLI_STATE_HUFFMAN_NONE;
return BROTLI_DECODER_SUCCESS;
- }
+ }
default:
return
BROTLI_FAILURE(BROTLI_DECODER_ERROR_UNREACHABLE);
- }
- }
-}
-
-/* Decodes a block length by reading 3..39 bits. */
+ }
+ }
+}
+
+/* Decodes a block length by reading 3..39 bits. */
static BROTLI_INLINE uint32_t ReadBlockLength(const HuffmanCode* table,
BrotliBitReader* br) {
uint32_t code;
uint32_t nbits;
- code = ReadSymbol(table, br);
+ code = ReadSymbol(table, br);
nbits = kBlockLengthPrefixCode[code].nbits; /* nbits == 2..24 */
return kBlockLengthPrefixCode[code].offset + BrotliReadBits(br, nbits);
-}
-
+}
+
/* WARNING: if state is not BROTLI_STATE_READ_BLOCK_LENGTH_NONE, then
reading can't be continued with ReadBlockLength. */
static BROTLI_INLINE BROTLI_BOOL SafeReadBlockLength(
@@ -898,114 +898,114 @@ static BROTLI_INLINE BROTLI_BOOL SafeReadBlockLength(
}
}
-/* Transform:
- 1) initialize list L with values 0, 1,... 255
- 2) For each input element X:
- 2.1) let Y = L[X]
- 2.2) remove X-th element from L
- 2.3) prepend Y to L
- 2.4) append Y to output
-
- In most cases max(Y) <= 7, so most of L remains intact.
- To reduce the cost of initialization, we reuse L, remember the upper bound
- of Y values, and reinitialize only first elements in L.
-
- Most of input values are 0 and 1. To reduce number of branches, we replace
+/* Transform:
+ 1) initialize list L with values 0, 1,... 255
+ 2) For each input element X:
+ 2.1) let Y = L[X]
+ 2.2) remove X-th element from L
+ 2.3) prepend Y to L
+ 2.4) append Y to output
+
+ In most cases max(Y) <= 7, so most of L remains intact.
+ To reduce the cost of initialization, we reuse L, remember the upper bound
+ of Y values, and reinitialize only first elements in L.
+
+ Most of input values are 0 and 1. To reduce number of branches, we replace
inner for loop with do-while. */
static BROTLI_NOINLINE void InverseMoveToFrontTransform(
uint8_t* v, uint32_t v_len, BrotliDecoderState* state) {
- /* Reinitialize elements that could have been changed. */
+ /* Reinitialize elements that could have been changed. */
uint32_t i = 1;
uint32_t upper_bound = state->mtf_upper_bound;
uint32_t* mtf = &state->mtf[1]; /* Make mtf[-1] addressable. */
uint8_t* mtf_u8 = (uint8_t*)mtf;
- /* Load endian-aware constant. */
- const uint8_t b0123[4] = {0, 1, 2, 3};
- uint32_t pattern;
- memcpy(&pattern, &b0123, 4);
-
- /* Initialize list using 4 consequent values pattern. */
+ /* Load endian-aware constant. */
+ const uint8_t b0123[4] = {0, 1, 2, 3};
+ uint32_t pattern;
+ memcpy(&pattern, &b0123, 4);
+
+ /* Initialize list using 4 consequent values pattern. */
mtf[0] = pattern;
- do {
+ do {
pattern += 0x04040404; /* Advance all 4 values by 4. */
mtf[i] = pattern;
i++;
- } while (i <= upper_bound);
-
- /* Transform the input. */
- upper_bound = 0;
- for (i = 0; i < v_len; ++i) {
- int index = v[i];
+ } while (i <= upper_bound);
+
+ /* Transform the input. */
+ upper_bound = 0;
+ for (i = 0; i < v_len; ++i) {
+ int index = v[i];
uint8_t value = mtf_u8[index];
upper_bound |= v[i];
- v[i] = value;
+ v[i] = value;
mtf_u8[-1] = value;
- do {
- index--;
+ do {
+ index--;
mtf_u8[index + 1] = mtf_u8[index];
} while (index >= 0);
- }
- /* Remember amount of elements to be reinitialized. */
+ }
+ /* Remember amount of elements to be reinitialized. */
state->mtf_upper_bound = upper_bound >> 2;
-}
-
-/* Decodes a series of Huffman table using ReadHuffmanCode function. */
+}
+
+/* Decodes a series of Huffman table using ReadHuffmanCode function. */
static BrotliDecoderErrorCode HuffmanTreeGroupDecode(
HuffmanTreeGroup* group, BrotliDecoderState* s) {
- if (s->substate_tree_group != BROTLI_STATE_TREE_GROUP_LOOP) {
- s->next = group->codes;
- s->htree_index = 0;
- s->substate_tree_group = BROTLI_STATE_TREE_GROUP_LOOP;
- }
- while (s->htree_index < group->num_htrees) {
+ if (s->substate_tree_group != BROTLI_STATE_TREE_GROUP_LOOP) {
+ s->next = group->codes;
+ s->htree_index = 0;
+ s->substate_tree_group = BROTLI_STATE_TREE_GROUP_LOOP;
+ }
+ while (s->htree_index < group->num_htrees) {
uint32_t table_size;
BrotliDecoderErrorCode result =
ReadHuffmanCode(group->alphabet_size, group->max_symbol,
s->next, &table_size, s);
if (result != BROTLI_DECODER_SUCCESS) return result;
- group->htrees[s->htree_index] = s->next;
- s->next += table_size;
- ++s->htree_index;
- }
- s->substate_tree_group = BROTLI_STATE_TREE_GROUP_NONE;
+ group->htrees[s->htree_index] = s->next;
+ s->next += table_size;
+ ++s->htree_index;
+ }
+ s->substate_tree_group = BROTLI_STATE_TREE_GROUP_NONE;
return BROTLI_DECODER_SUCCESS;
-}
-
-/* Decodes a context map.
- Decoding is done in 4 phases:
- 1) Read auxiliary information (6..16 bits) and allocate memory.
- In case of trivial context map, decoding is finished at this phase.
- 2) Decode Huffman table using ReadHuffmanCode function.
- This table will be used for reading context map items.
- 3) Read context map items; "0" values could be run-length encoded.
+}
+
+/* Decodes a context map.
+ Decoding is done in 4 phases:
+ 1) Read auxiliary information (6..16 bits) and allocate memory.
+ In case of trivial context map, decoding is finished at this phase.
+ 2) Decode Huffman table using ReadHuffmanCode function.
+ This table will be used for reading context map items.
+ 3) Read context map items; "0" values could be run-length encoded.
4) Optionally, apply InverseMoveToFront transform to the resulting map. */
static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size,
uint32_t* num_htrees,
uint8_t** context_map_arg,
BrotliDecoderState* s) {
- BrotliBitReader* br = &s->br;
+ BrotliBitReader* br = &s->br;
BrotliDecoderErrorCode result = BROTLI_DECODER_SUCCESS;
-
+
switch ((int)s->substate_context_map) {
- case BROTLI_STATE_CONTEXT_MAP_NONE:
- result = DecodeVarLenUint8(s, br, num_htrees);
+ case BROTLI_STATE_CONTEXT_MAP_NONE:
+ result = DecodeVarLenUint8(s, br, num_htrees);
if (result != BROTLI_DECODER_SUCCESS) {
- return result;
- }
- (*num_htrees)++;
- s->context_index = 0;
- BROTLI_LOG_UINT(context_map_size);
- BROTLI_LOG_UINT(*num_htrees);
+ return result;
+ }
+ (*num_htrees)++;
+ s->context_index = 0;
+ BROTLI_LOG_UINT(context_map_size);
+ BROTLI_LOG_UINT(*num_htrees);
*context_map_arg =
(uint8_t*)BROTLI_DECODER_ALLOC(s, (size_t)context_map_size);
- if (*context_map_arg == 0) {
+ if (*context_map_arg == 0) {
return BROTLI_FAILURE(BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP);
- }
- if (*num_htrees <= 1) {
- memset(*context_map_arg, 0, (size_t)context_map_size);
+ }
+ if (*num_htrees <= 1) {
+ memset(*context_map_arg, 0, (size_t)context_map_size);
return BROTLI_DECODER_SUCCESS;
- }
- s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_READ_PREFIX;
+ }
+ s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_READ_PREFIX;
/* Fall through. */
case BROTLI_STATE_CONTEXT_MAP_READ_PREFIX: {
@@ -1014,33 +1014,33 @@ static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size,
to peek 4 bits ahead. */
if (!BrotliSafeGetBits(br, 5, &bits)) {
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
+ }
if ((bits & 1) != 0) { /* Use RLE for zeros. */
s->max_run_length_prefix = (bits >> 1) + 1;
BrotliDropBits(br, 5);
- } else {
- s->max_run_length_prefix = 0;
+ } else {
+ s->max_run_length_prefix = 0;
BrotliDropBits(br, 1);
- }
- BROTLI_LOG_UINT(s->max_run_length_prefix);
- s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_HUFFMAN;
+ }
+ BROTLI_LOG_UINT(s->max_run_length_prefix);
+ s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_HUFFMAN;
}
/* Fall through. */
case BROTLI_STATE_CONTEXT_MAP_HUFFMAN: {
uint32_t alphabet_size = *num_htrees + s->max_run_length_prefix;
result = ReadHuffmanCode(alphabet_size, alphabet_size,
- s->context_map_table, NULL, s);
+ s->context_map_table, NULL, s);
if (result != BROTLI_DECODER_SUCCESS) return result;
s->code = 0xFFFF;
- s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_DECODE;
+ s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_DECODE;
}
/* Fall through. */
- case BROTLI_STATE_CONTEXT_MAP_DECODE: {
+ case BROTLI_STATE_CONTEXT_MAP_DECODE: {
uint32_t context_index = s->context_index;
uint32_t max_run_length_prefix = s->max_run_length_prefix;
- uint8_t* context_map = *context_map_arg;
+ uint8_t* context_map = *context_map_arg;
uint32_t code = s->code;
BROTLI_BOOL skip_preamble = (code != 0xFFFF);
while (context_index < context_map_size || skip_preamble) {
@@ -1063,7 +1063,7 @@ static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size,
}
} else {
skip_preamble = BROTLI_FALSE;
- }
+ }
/* RLE sub-stage. */
{
uint32_t reps;
@@ -1073,16 +1073,16 @@ static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size,
return BROTLI_DECODER_NEEDS_MORE_INPUT;
}
reps += 1U << code;
- BROTLI_LOG_UINT(reps);
- if (context_index + reps > context_map_size) {
+ BROTLI_LOG_UINT(reps);
+ if (context_index + reps > context_map_size) {
return
BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT);
- }
- do {
- context_map[context_index++] = 0;
- } while (--reps);
- }
- }
+ }
+ do {
+ context_map[context_index++] = 0;
+ } while (--reps);
+ }
+ }
}
/* Fall through. */
@@ -1091,20 +1091,20 @@ static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size,
if (!BrotliSafeReadBits(br, 1, &bits)) {
s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_TRANSFORM;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
+ }
if (bits != 0) {
InverseMoveToFrontTransform(*context_map_arg, context_map_size, s);
}
- s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_NONE;
+ s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_NONE;
return BROTLI_DECODER_SUCCESS;
- }
+ }
default:
return
BROTLI_FAILURE(BROTLI_DECODER_ERROR_UNREACHABLE);
- }
-}
-
+ }
+}
+
/* Decodes a command or literal and updates block type ring-buffer.
Reads 3..54 bits. */
static BROTLI_INLINE BROTLI_BOOL DecodeBlockTypeAndLength(
@@ -1137,20 +1137,20 @@ static BROTLI_INLINE BROTLI_BOOL DecodeBlockTypeAndLength(
}
if (block_type == 1) {
- block_type = ringbuffer[1] + 1;
+ block_type = ringbuffer[1] + 1;
} else if (block_type == 0) {
- block_type = ringbuffer[0];
+ block_type = ringbuffer[0];
} else {
block_type -= 2;
- }
- if (block_type >= max_block_type) {
- block_type -= max_block_type;
- }
- ringbuffer[0] = ringbuffer[1];
- ringbuffer[1] = block_type;
+ }
+ if (block_type >= max_block_type) {
+ block_type -= max_block_type;
+ }
+ ringbuffer[0] = ringbuffer[1];
+ ringbuffer[1] = block_type;
return BROTLI_TRUE;
-}
-
+}
+
static BROTLI_INLINE void DetectTrivialLiteralBlockTypes(
BrotliDecoderState* s) {
size_t i;
@@ -1170,18 +1170,18 @@ static BROTLI_INLINE void DetectTrivialLiteralBlockTypes(
}
static BROTLI_INLINE void PrepareLiteralDecoding(BrotliDecoderState* s) {
- uint8_t context_mode;
+ uint8_t context_mode;
size_t trivial;
uint32_t block_type = s->block_type_rb[1];
uint32_t context_offset = block_type << BROTLI_LITERAL_CONTEXT_BITS;
- s->context_map_slice = s->context_map + context_offset;
+ s->context_map_slice = s->context_map + context_offset;
trivial = s->trivial_literal_contexts[block_type >> 5];
s->trivial_literal_context = (trivial >> (block_type & 31)) & 1;
s->literal_htree = s->literal_hgroup.htrees[s->context_map_slice[0]];
context_mode = s->context_modes[block_type] & 3;
s->context_lookup = BROTLI_CONTEXT_LUT(context_mode);
-}
-
+}
+
/* Decodes the block type and updates the state for literal context.
Reads 3..54 bits. */
static BROTLI_INLINE BROTLI_BOOL DecodeLiteralBlockSwitchInternal(
@@ -1264,9 +1264,9 @@ static BrotliDecoderErrorCode BROTLI_NOINLINE WriteRingBuffer(
if (num_written > to_write) {
num_written = to_write;
}
- if (s->meta_block_remaining_len < 0) {
+ if (s->meta_block_remaining_len < 0) {
return BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1);
- }
+ }
if (next_out && !*next_out) {
*next_out = start;
} else {
@@ -1277,18 +1277,18 @@ static BrotliDecoderErrorCode BROTLI_NOINLINE WriteRingBuffer(
}
*available_out -= num_written;
BROTLI_LOG_UINT(to_write);
- BROTLI_LOG_UINT(num_written);
+ BROTLI_LOG_UINT(num_written);
s->partial_pos_out += num_written;
if (total_out) {
*total_out = s->partial_pos_out;
- }
+ }
if (num_written < to_write) {
if (s->ringbuffer_size == (1 << s->window_bits) || force) {
return BROTLI_DECODER_NEEDS_MORE_OUTPUT;
} else {
return BROTLI_DECODER_SUCCESS;
}
- }
+ }
/* Wrap ring buffer only if it has reached its maximal size. */
if (s->ringbuffer_size == (1 << s->window_bits) &&
s->pos >= s->ringbuffer_size) {
@@ -1297,8 +1297,8 @@ static BrotliDecoderErrorCode BROTLI_NOINLINE WriteRingBuffer(
s->should_wrap_ringbuffer = (size_t)s->pos != 0 ? 1 : 0;
}
return BROTLI_DECODER_SUCCESS;
-}
-
+}
+
static void BROTLI_NOINLINE WrapRingBuffer(BrotliDecoderState* s) {
if (s->should_wrap_ringbuffer) {
memcpy(s->ringbuffer, s->ringbuffer_end, (size_t)s->pos);
@@ -1350,17 +1350,17 @@ static BrotliDecoderErrorCode BROTLI_NOINLINE CopyUncompressedBlockToOutput(
return BROTLI_FAILURE(BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1);
}
- /* State machine */
- for (;;) {
+ /* State machine */
+ for (;;) {
switch (s->substate_uncompressed) {
case BROTLI_STATE_UNCOMPRESSED_NONE: {
int nbytes = (int)BrotliGetRemainingBytes(&s->br);
if (nbytes > s->meta_block_remaining_len) {
nbytes = s->meta_block_remaining_len;
- }
+ }
if (s->pos + nbytes > s->ringbuffer_size) {
nbytes = s->ringbuffer_size - s->pos;
- }
+ }
/* Copy remaining bytes from s->br.buf_ to ring-buffer. */
BrotliCopyBytes(&s->ringbuffer[s->pos], &s->br, (size_t)nbytes);
s->pos += nbytes;
@@ -1368,9 +1368,9 @@ static BrotliDecoderErrorCode BROTLI_NOINLINE CopyUncompressedBlockToOutput(
if (s->pos < 1 << s->window_bits) {
if (s->meta_block_remaining_len == 0) {
return BROTLI_DECODER_SUCCESS;
- }
+ }
return BROTLI_DECODER_NEEDS_MORE_INPUT;
- }
+ }
s->substate_uncompressed = BROTLI_STATE_UNCOMPRESSED_WRITE;
}
/* Fall through. */
@@ -1380,19 +1380,19 @@ static BrotliDecoderErrorCode BROTLI_NOINLINE CopyUncompressedBlockToOutput(
result = WriteRingBuffer(
s, available_out, next_out, total_out, BROTLI_FALSE);
if (result != BROTLI_DECODER_SUCCESS) {
- return result;
- }
+ return result;
+ }
if (s->ringbuffer_size == 1 << s->window_bits) {
s->max_distance = s->max_backward_distance;
- }
+ }
s->substate_uncompressed = BROTLI_STATE_UNCOMPRESSED_NONE;
- break;
+ break;
}
- }
- }
+ }
+ }
BROTLI_DCHECK(0); /* Unreachable */
-}
-
+}
+
/* Calculates the smallest feasible ring buffer.
If we know the data size is small, do not allocate more ring buffer
@@ -1411,18 +1411,18 @@ static void BROTLI_NOINLINE BrotliCalculateRingBufferSize(
/* If maximum is already reached, no further extension is retired. */
if (s->ringbuffer_size == window_size) {
return;
- }
+ }
/* Metadata blocks does not touch ring buffer. */
if (s->is_metadata) {
return;
- }
+ }
if (!s->ringbuffer) {
output_size = 0;
} else {
output_size = s->pos;
- }
+ }
output_size += s->meta_block_remaining_len;
min_size = min_size < output_size ? output_size : min_size;
@@ -1433,16 +1433,16 @@ static void BROTLI_NOINLINE BrotliCalculateRingBufferSize(
while ((new_ringbuffer_size >> 1) >= min_size) {
new_ringbuffer_size >>= 1;
}
- }
+ }
s->new_ringbuffer_size = new_ringbuffer_size;
-}
-
+}
+
/* Reads 1..256 2-bit context modes. */
static BrotliDecoderErrorCode ReadContextModes(BrotliDecoderState* s) {
BrotliBitReader* br = &s->br;
int i = s->loop_counter;
-
+
while (i < (int)s->num_block_types[0]) {
uint32_t bits;
if (!BrotliSafeReadBits(br, 2, &bits)) {
@@ -1455,7 +1455,7 @@ static BrotliDecoderErrorCode ReadContextModes(BrotliDecoderState* s) {
}
return BROTLI_DECODER_SUCCESS;
}
-
+
static BROTLI_INLINE void TakeDistanceFromRingBuffer(BrotliDecoderState* s) {
if (s->distance_code == 0) {
--s->dist_rb_idx;
@@ -1482,11 +1482,11 @@ static BROTLI_INLINE void TakeDistanceFromRingBuffer(BrotliDecoderState* s) {
/* A huge distance will cause a BROTLI_FAILURE() soon.
This is a little faster than failing here. */
s->distance_code = 0x7FFFFFFF;
- }
- }
- }
+ }
+ }
+ }
}
-
+
static BROTLI_INLINE BROTLI_BOOL SafeReadBits(
BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) {
if (n_bits != 0) {
@@ -1494,9 +1494,9 @@ static BROTLI_INLINE BROTLI_BOOL SafeReadBits(
} else {
*val = 0;
return BROTLI_TRUE;
- }
+ }
}
-
+
/* Precondition: s->distance_code < 0. */
static BROTLI_INLINE BROTLI_BOOL ReadDistanceInternal(
int safe, BrotliDecoderState* s, BrotliBitReader* br) {
@@ -1512,7 +1512,7 @@ static BROTLI_INLINE BROTLI_BOOL ReadDistanceInternal(
return BROTLI_FALSE;
}
s->distance_code = (int)code;
- }
+ }
/* Convert the distance code to the actual distance by possibly
looking up past distances from the s->ringbuffer. */
s->distance_context = 0;
@@ -1555,7 +1555,7 @@ static BROTLI_INLINE BROTLI_BOOL ReadDistanceInternal(
--s->block_length[2];
return BROTLI_TRUE;
}
-
+
static BROTLI_INLINE void ReadDistance(
BrotliDecoderState* s, BrotliBitReader* br) {
ReadDistanceInternal(0, s, br);
@@ -1580,7 +1580,7 @@ static BROTLI_INLINE BROTLI_BOOL ReadCommandInternal(
if (!SafeReadSymbol(s->htree_command, br, &cmd_code)) {
return BROTLI_FALSE;
}
- }
+ }
v = kCmdLut[cmd_code];
s->distance_code = v.distance_code;
s->distance_context = v.context;
@@ -1597,28 +1597,28 @@ static BROTLI_INLINE BROTLI_BOOL ReadCommandInternal(
BrotliBitReaderRestoreState(br, &memento);
return BROTLI_FALSE;
}
- }
+ }
s->copy_length = (int)copy_length + v.copy_len_offset;
--s->block_length[1];
*insert_length += (int)insert_len_extra;
return BROTLI_TRUE;
}
-
+
static BROTLI_INLINE void ReadCommand(
BrotliDecoderState* s, BrotliBitReader* br, int* insert_length) {
ReadCommandInternal(0, s, br, insert_length);
-}
-
+}
+
static BROTLI_INLINE BROTLI_BOOL SafeReadCommand(
BrotliDecoderState* s, BrotliBitReader* br, int* insert_length) {
return ReadCommandInternal(1, s, br, insert_length);
-}
-
+}
+
static BROTLI_INLINE BROTLI_BOOL CheckInputAmount(
int safe, BrotliBitReader* const br, size_t num) {
if (safe) {
return BROTLI_TRUE;
- }
+ }
return BrotliCheckInputAmount(br, num);
}
@@ -1920,9 +1920,9 @@ CommandPostWrapCopy:
saveStateAndReturn:
s->pos = pos;
s->loop_counter = i;
- return result;
-}
-
+ return result;
+}
+
#undef BROTLI_SAFE
static BROTLI_NOINLINE BrotliDecoderErrorCode ProcessCommands(
@@ -1970,9 +1970,9 @@ BrotliDecoderResult BrotliDecoderDecompress(
if (result != BROTLI_DECODER_RESULT_SUCCESS) {
result = BROTLI_DECODER_RESULT_ERROR;
}
- return result;
-}
-
+ return result;
+}
+
/* Invariant: input stream is never overconsumed:
- invalid input implies that the whole stream is invalid -> any amount of
input could be read and discarded
@@ -1988,7 +1988,7 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
BrotliDecoderState* s, size_t* available_in, const uint8_t** next_in,
size_t* available_out, uint8_t** next_out, size_t* total_out) {
BrotliDecoderErrorCode result = BROTLI_DECODER_SUCCESS;
- BrotliBitReader* br = &s->br;
+ BrotliBitReader* br = &s->br;
/* Ensure that |total_out| is set, even if no data will ever be pushed out. */
if (total_out) {
*total_out = s->partial_pos_out;
@@ -2012,8 +2012,8 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
result = BROTLI_DECODER_NEEDS_MORE_INPUT;
br->next_in = &s->buffer.u8[0];
}
- /* State machine */
- for (;;) {
+ /* State machine */
+ for (;;) {
if (result != BROTLI_DECODER_SUCCESS) {
/* Error, needs more input/output. */
if (result == BROTLI_DECODER_NEEDS_MORE_INPUT) {
@@ -2025,7 +2025,7 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
result = intermediate_result;
break;
}
- }
+ }
if (s->buffer_length != 0) { /* Used with internal buffer. */
if (br->avail_in == 0) {
/* Successfully finished read transaction.
@@ -2062,9 +2062,9 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
(*available_in)--;
}
break;
- }
+ }
/* Unreachable. */
- }
+ }
/* Fail or needs more output. */
@@ -2081,15 +2081,15 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
*next_in = br->next_in;
}
break;
- }
- switch (s->state) {
- case BROTLI_STATE_UNINITED:
- /* Prepare to the first read. */
- if (!BrotliWarmupBitReader(br)) {
+ }
+ switch (s->state) {
+ case BROTLI_STATE_UNINITED:
+ /* Prepare to the first read. */
+ if (!BrotliWarmupBitReader(br)) {
result = BROTLI_DECODER_NEEDS_MORE_INPUT;
- break;
- }
- /* Decode window size. */
+ break;
+ }
+ /* Decode window size. */
result = DecodeWindowBits(s, br); /* Reads 1..8 bits. */
if (result != BROTLI_DECODER_SUCCESS) {
break;
@@ -2109,8 +2109,8 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
if (s->window_bits < BROTLI_LARGE_MIN_WBITS ||
s->window_bits > BROTLI_LARGE_MAX_WBITS) {
result = BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS);
- break;
- }
+ break;
+ }
s->state = BROTLI_STATE_INITIALIZE;
/* Fall through. */
@@ -2118,99 +2118,99 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
BROTLI_LOG_UINT(s->window_bits);
/* Maximum distance, see section 9.1. of the spec. */
s->max_backward_distance = (1 << s->window_bits) - BROTLI_WINDOW_GAP;
-
- /* Allocate memory for both block_type_trees and block_len_trees. */
+
+ /* Allocate memory for both block_type_trees and block_len_trees. */
s->block_type_trees = (HuffmanCode*)BROTLI_DECODER_ALLOC(s,
sizeof(HuffmanCode) * 3 *
(BROTLI_HUFFMAN_MAX_SIZE_258 + BROTLI_HUFFMAN_MAX_SIZE_26));
if (s->block_type_trees == 0) {
result = BROTLI_FAILURE(BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES);
- break;
- }
+ break;
+ }
s->block_len_trees =
s->block_type_trees + 3 * BROTLI_HUFFMAN_MAX_SIZE_258;
-
- s->state = BROTLI_STATE_METABLOCK_BEGIN;
+
+ s->state = BROTLI_STATE_METABLOCK_BEGIN;
/* Fall through. */
- case BROTLI_STATE_METABLOCK_BEGIN:
+ case BROTLI_STATE_METABLOCK_BEGIN:
BrotliDecoderStateMetablockBegin(s);
BROTLI_LOG_UINT(s->pos);
- s->state = BROTLI_STATE_METABLOCK_HEADER;
+ s->state = BROTLI_STATE_METABLOCK_HEADER;
/* Fall through. */
- case BROTLI_STATE_METABLOCK_HEADER:
+ case BROTLI_STATE_METABLOCK_HEADER:
result = DecodeMetaBlockLength(s, br); /* Reads 2 - 31 bits. */
if (result != BROTLI_DECODER_SUCCESS) {
- break;
- }
- BROTLI_LOG_UINT(s->is_last_metablock);
- BROTLI_LOG_UINT(s->meta_block_remaining_len);
- BROTLI_LOG_UINT(s->is_metadata);
- BROTLI_LOG_UINT(s->is_uncompressed);
- if (s->is_metadata || s->is_uncompressed) {
- if (!BrotliJumpToByteBoundary(br)) {
+ break;
+ }
+ BROTLI_LOG_UINT(s->is_last_metablock);
+ BROTLI_LOG_UINT(s->meta_block_remaining_len);
+ BROTLI_LOG_UINT(s->is_metadata);
+ BROTLI_LOG_UINT(s->is_uncompressed);
+ if (s->is_metadata || s->is_uncompressed) {
+ if (!BrotliJumpToByteBoundary(br)) {
result = BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_PADDING_1);
- break;
- }
- }
- if (s->is_metadata) {
- s->state = BROTLI_STATE_METADATA;
- break;
- }
- if (s->meta_block_remaining_len == 0) {
- s->state = BROTLI_STATE_METABLOCK_DONE;
- break;
- }
+ break;
+ }
+ }
+ if (s->is_metadata) {
+ s->state = BROTLI_STATE_METADATA;
+ break;
+ }
+ if (s->meta_block_remaining_len == 0) {
+ s->state = BROTLI_STATE_METABLOCK_DONE;
+ break;
+ }
BrotliCalculateRingBufferSize(s);
- if (s->is_uncompressed) {
- s->state = BROTLI_STATE_UNCOMPRESSED;
- break;
- }
+ if (s->is_uncompressed) {
+ s->state = BROTLI_STATE_UNCOMPRESSED;
+ break;
+ }
s->loop_counter = 0;
- s->state = BROTLI_STATE_HUFFMAN_CODE_0;
- break;
+ s->state = BROTLI_STATE_HUFFMAN_CODE_0;
+ break;
case BROTLI_STATE_UNCOMPRESSED: {
result = CopyUncompressedBlockToOutput(
available_out, next_out, total_out, s);
if (result != BROTLI_DECODER_SUCCESS) {
- break;
- }
- s->state = BROTLI_STATE_METABLOCK_DONE;
- break;
+ break;
+ }
+ s->state = BROTLI_STATE_METABLOCK_DONE;
+ break;
}
- case BROTLI_STATE_METADATA:
- for (; s->meta_block_remaining_len > 0; --s->meta_block_remaining_len) {
- uint32_t bits;
- /* Read one byte and ignore it. */
- if (!BrotliSafeReadBits(br, 8, &bits)) {
+ case BROTLI_STATE_METADATA:
+ for (; s->meta_block_remaining_len > 0; --s->meta_block_remaining_len) {
+ uint32_t bits;
+ /* Read one byte and ignore it. */
+ if (!BrotliSafeReadBits(br, 8, &bits)) {
result = BROTLI_DECODER_NEEDS_MORE_INPUT;
- break;
- }
- }
+ break;
+ }
+ }
if (result == BROTLI_DECODER_SUCCESS) {
- s->state = BROTLI_STATE_METABLOCK_DONE;
- }
- break;
+ s->state = BROTLI_STATE_METABLOCK_DONE;
+ }
+ break;
- case BROTLI_STATE_HUFFMAN_CODE_0:
+ case BROTLI_STATE_HUFFMAN_CODE_0:
if (s->loop_counter >= 3) {
s->state = BROTLI_STATE_METABLOCK_HEADER_2;
- break;
- }
- /* Reads 1..11 bits. */
+ break;
+ }
+ /* Reads 1..11 bits. */
result = DecodeVarLenUint8(s, br, &s->num_block_types[s->loop_counter]);
if (result != BROTLI_DECODER_SUCCESS) {
- break;
- }
+ break;
+ }
s->num_block_types[s->loop_counter]++;
BROTLI_LOG_UINT(s->num_block_types[s->loop_counter]);
if (s->num_block_types[s->loop_counter] < 2) {
s->loop_counter++;
- break;
- }
+ break;
+ }
s->state = BROTLI_STATE_HUFFMAN_CODE_1;
/* Fall through. */
@@ -2230,7 +2230,7 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
result = ReadHuffmanCode(alphabet_size, alphabet_size,
&s->block_len_trees[tree_offset], NULL, s);
if (result != BROTLI_DECODER_SUCCESS) break;
- s->state = BROTLI_STATE_HUFFMAN_CODE_3;
+ s->state = BROTLI_STATE_HUFFMAN_CODE_3;
}
/* Fall through. */
@@ -2239,33 +2239,33 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
if (!SafeReadBlockLength(s, &s->block_length[s->loop_counter],
&s->block_len_trees[tree_offset], br)) {
result = BROTLI_DECODER_NEEDS_MORE_INPUT;
- break;
- }
+ break;
+ }
BROTLI_LOG_UINT(s->block_length[s->loop_counter]);
s->loop_counter++;
- s->state = BROTLI_STATE_HUFFMAN_CODE_0;
- break;
+ s->state = BROTLI_STATE_HUFFMAN_CODE_0;
+ break;
}
case BROTLI_STATE_METABLOCK_HEADER_2: {
uint32_t bits;
if (!BrotliSafeReadBits(br, 6, &bits)) {
result = BROTLI_DECODER_NEEDS_MORE_INPUT;
- break;
- }
+ break;
+ }
s->distance_postfix_bits = bits & BitMask(2);
bits >>= 2;
s->num_direct_distance_codes = BROTLI_NUM_DISTANCE_SHORT_CODES +
(bits << s->distance_postfix_bits);
- BROTLI_LOG_UINT(s->num_direct_distance_codes);
- BROTLI_LOG_UINT(s->distance_postfix_bits);
- s->distance_postfix_mask = (int)BitMask(s->distance_postfix_bits);
+ BROTLI_LOG_UINT(s->num_direct_distance_codes);
+ BROTLI_LOG_UINT(s->distance_postfix_bits);
+ s->distance_postfix_mask = (int)BitMask(s->distance_postfix_bits);
s->context_modes =
(uint8_t*)BROTLI_DECODER_ALLOC(s, (size_t)s->num_block_types[0]);
- if (s->context_modes == 0) {
+ if (s->context_modes == 0) {
result = BROTLI_FAILURE(BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES);
- break;
- }
+ break;
+ }
s->loop_counter = 0;
s->state = BROTLI_STATE_CONTEXT_MODES;
}
@@ -2275,19 +2275,19 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
result = ReadContextModes(s);
if (result != BROTLI_DECODER_SUCCESS) {
break;
- }
- s->state = BROTLI_STATE_CONTEXT_MAP_1;
+ }
+ s->state = BROTLI_STATE_CONTEXT_MAP_1;
/* Fall through. */
- case BROTLI_STATE_CONTEXT_MAP_1:
+ case BROTLI_STATE_CONTEXT_MAP_1:
result = DecodeContextMap(
s->num_block_types[0] << BROTLI_LITERAL_CONTEXT_BITS,
&s->num_literal_htrees, &s->context_map, s);
if (result != BROTLI_DECODER_SUCCESS) {
- break;
- }
+ break;
+ }
DetectTrivialLiteralBlockTypes(s);
- s->state = BROTLI_STATE_CONTEXT_MAP_2;
+ s->state = BROTLI_STATE_CONTEXT_MAP_2;
/* Fall through. */
case BROTLI_STATE_CONTEXT_MAP_2: {
@@ -2307,7 +2307,7 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
&s->num_dist_htrees, &s->dist_context_map, s);
if (result != BROTLI_DECODER_SUCCESS) {
break;
- }
+ }
allocation_success &= BrotliDecoderHuffmanTreeGroupInit(
s, &s->literal_hgroup, BROTLI_NUM_LITERAL_SYMBOLS,
BROTLI_NUM_LITERAL_SYMBOLS, s->num_literal_htrees);
@@ -2322,7 +2322,7 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
BROTLI_FAILURE(BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS));
}
s->loop_counter = 0;
- s->state = BROTLI_STATE_TREE_GROUP;
+ s->state = BROTLI_STATE_TREE_GROUP;
}
/* Fall through. */
@@ -2334,83 +2334,83 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
case 2: hgroup = &s->distance_hgroup; break;
default: return SaveErrorCode(s, BROTLI_FAILURE(
BROTLI_DECODER_ERROR_UNREACHABLE));
- }
+ }
result = HuffmanTreeGroupDecode(hgroup, s);
if (result != BROTLI_DECODER_SUCCESS) break;
s->loop_counter++;
if (s->loop_counter >= 3) {
PrepareLiteralDecoding(s);
- s->dist_context_map_slice = s->dist_context_map;
- s->htree_command = s->insert_copy_hgroup.htrees[0];
+ s->dist_context_map_slice = s->dist_context_map;
+ s->htree_command = s->insert_copy_hgroup.htrees[0];
if (!BrotliEnsureRingBuffer(s)) {
result = BROTLI_FAILURE(BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2);
break;
}
- s->state = BROTLI_STATE_COMMAND_BEGIN;
- }
- break;
+ s->state = BROTLI_STATE_COMMAND_BEGIN;
+ }
+ break;
}
- case BROTLI_STATE_COMMAND_BEGIN:
+ case BROTLI_STATE_COMMAND_BEGIN:
/* Fall through. */
- case BROTLI_STATE_COMMAND_INNER:
+ case BROTLI_STATE_COMMAND_INNER:
/* Fall through. */
case BROTLI_STATE_COMMAND_POST_DECODE_LITERALS:
/* Fall through. */
- case BROTLI_STATE_COMMAND_POST_WRAP_COPY:
+ case BROTLI_STATE_COMMAND_POST_WRAP_COPY:
result = ProcessCommands(s);
if (result == BROTLI_DECODER_NEEDS_MORE_INPUT) {
result = SafeProcessCommands(s);
- }
- break;
+ }
+ break;
- case BROTLI_STATE_COMMAND_INNER_WRITE:
+ case BROTLI_STATE_COMMAND_INNER_WRITE:
/* Fall through. */
- case BROTLI_STATE_COMMAND_POST_WRITE_1:
+ case BROTLI_STATE_COMMAND_POST_WRITE_1:
/* Fall through. */
- case BROTLI_STATE_COMMAND_POST_WRITE_2:
+ case BROTLI_STATE_COMMAND_POST_WRITE_2:
result = WriteRingBuffer(
s, available_out, next_out, total_out, BROTLI_FALSE);
if (result != BROTLI_DECODER_SUCCESS) {
- break;
- }
+ break;
+ }
WrapRingBuffer(s);
if (s->ringbuffer_size == 1 << s->window_bits) {
s->max_distance = s->max_backward_distance;
}
- if (s->state == BROTLI_STATE_COMMAND_POST_WRITE_1) {
+ if (s->state == BROTLI_STATE_COMMAND_POST_WRITE_1) {
if (s->meta_block_remaining_len == 0) {
/* Next metablock, if any. */
- s->state = BROTLI_STATE_METABLOCK_DONE;
- } else {
+ s->state = BROTLI_STATE_METABLOCK_DONE;
+ } else {
s->state = BROTLI_STATE_COMMAND_BEGIN;
- }
+ }
break;
- } else if (s->state == BROTLI_STATE_COMMAND_POST_WRITE_2) {
- s->state = BROTLI_STATE_COMMAND_POST_WRAP_COPY;
- } else { /* BROTLI_STATE_COMMAND_INNER_WRITE */
+ } else if (s->state == BROTLI_STATE_COMMAND_POST_WRITE_2) {
+ s->state = BROTLI_STATE_COMMAND_POST_WRAP_COPY;
+ } else { /* BROTLI_STATE_COMMAND_INNER_WRITE */
if (s->loop_counter == 0) {
if (s->meta_block_remaining_len == 0) {
- s->state = BROTLI_STATE_METABLOCK_DONE;
+ s->state = BROTLI_STATE_METABLOCK_DONE;
} else {
s->state = BROTLI_STATE_COMMAND_POST_DECODE_LITERALS;
- }
+ }
break;
- }
- s->state = BROTLI_STATE_COMMAND_INNER;
- }
- break;
+ }
+ s->state = BROTLI_STATE_COMMAND_INNER;
+ }
+ break;
- case BROTLI_STATE_METABLOCK_DONE:
+ case BROTLI_STATE_METABLOCK_DONE:
if (s->meta_block_remaining_len < 0) {
result = BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2);
break;
}
BrotliDecoderStateCleanupAfterMetablock(s);
- if (!s->is_last_metablock) {
- s->state = BROTLI_STATE_METABLOCK_BEGIN;
- break;
- }
+ if (!s->is_last_metablock) {
+ s->state = BROTLI_STATE_METABLOCK_BEGIN;
+ break;
+ }
if (!BrotliJumpToByteBoundary(br)) {
result = BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_PADDING_2);
break;
@@ -2420,20 +2420,20 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
*available_in = br->avail_in;
*next_in = br->next_in;
}
- s->state = BROTLI_STATE_DONE;
+ s->state = BROTLI_STATE_DONE;
/* Fall through. */
- case BROTLI_STATE_DONE:
- if (s->ringbuffer != 0) {
+ case BROTLI_STATE_DONE:
+ if (s->ringbuffer != 0) {
result = WriteRingBuffer(
s, available_out, next_out, total_out, BROTLI_TRUE);
if (result != BROTLI_DECODER_SUCCESS) {
- break;
- }
- }
+ break;
+ }
+ }
return SaveErrorCode(s, result);
- }
- }
+ }
+ }
return SaveErrorCode(s, result);
}
@@ -2468,19 +2468,19 @@ const uint8_t* BrotliDecoderTakeOutput(BrotliDecoderState* s, size_t* size) {
*size = 0;
result = 0;
}
- return result;
-}
-
+ return result;
+}
+
BROTLI_BOOL BrotliDecoderIsUsed(const BrotliDecoderState* s) {
return TO_BROTLI_BOOL(s->state != BROTLI_STATE_UNINITED ||
BrotliGetAvailableBits(&s->br) != 0);
-}
-
+}
+
BROTLI_BOOL BrotliDecoderIsFinished(const BrotliDecoderState* s) {
return TO_BROTLI_BOOL(s->state == BROTLI_STATE_DONE) &&
!BrotliDecoderHasMoreOutput(s);
}
-
+
BrotliDecoderErrorCode BrotliDecoderGetErrorCode(const BrotliDecoderState* s) {
return (BrotliDecoderErrorCode)s->error_code;
}
@@ -2501,6 +2501,6 @@ uint32_t BrotliDecoderVersion() {
return BROTLI_VERSION;
}
-#if defined(__cplusplus) || defined(c_plusplus)
+#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
-#endif
+#endif
diff --git a/contrib/libs/brotli/dec/huffman.c b/contrib/libs/brotli/dec/huffman.c
index 30c40d33f2..02e5b15c22 100644
--- a/contrib/libs/brotli/dec/huffman.c
+++ b/contrib/libs/brotli/dec/huffman.c
@@ -1,29 +1,29 @@
-/* Copyright 2013 Google Inc. All Rights Reserved.
-
+/* Copyright 2013 Google Inc. All Rights Reserved.
+
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
-*/
-
-/* Utilities for building Huffman decoding tables. */
-
-#include "./huffman.h"
+*/
+
+/* Utilities for building Huffman decoding tables. */
+
+#include "./huffman.h"
#include <string.h> /* memcpy, memset */
#include "../common/constants.h"
#include "../common/platform.h"
#include <brotli/types.h>
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
#define BROTLI_REVERSE_BITS_MAX 8
#if defined(BROTLI_RBIT)
#define BROTLI_REVERSE_BITS_BASE \
((sizeof(brotli_reg_t) << 3) - BROTLI_REVERSE_BITS_MAX)
-#else
+#else
#define BROTLI_REVERSE_BITS_BASE 0
static uint8_t kReverseBits[1 << BROTLI_REVERSE_BITS_MAX] = {
0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0,
@@ -72,37 +72,37 @@ static BROTLI_INLINE brotli_reg_t BrotliReverseBits(brotli_reg_t num) {
return BROTLI_RBIT(num);
#else
return kReverseBits[num];
-#endif
-}
-
-/* Stores code in table[0], table[step], table[2*step], ..., table[end] */
-/* Assumes that end is an integer multiple of step */
-static BROTLI_INLINE void ReplicateValue(HuffmanCode* table,
- int step, int end,
- HuffmanCode code) {
- do {
- end -= step;
- table[end] = code;
- } while (end > 0);
-}
-
+#endif
+}
+
+/* Stores code in table[0], table[step], table[2*step], ..., table[end] */
+/* Assumes that end is an integer multiple of step */
+static BROTLI_INLINE void ReplicateValue(HuffmanCode* table,
+ int step, int end,
+ HuffmanCode code) {
+ do {
+ end -= step;
+ table[end] = code;
+ } while (end > 0);
+}
+
/* Returns the table width of the next 2nd level table. |count| is the histogram
of bit lengths for the remaining symbols, |len| is the code length of the
next processed symbol. */
-static BROTLI_INLINE int NextTableBitSize(const uint16_t* const count,
- int len, int root_bits) {
- int left = 1 << (len - root_bits);
- while (len < BROTLI_HUFFMAN_MAX_CODE_LENGTH) {
- left -= count[len];
- if (left <= 0) break;
- ++len;
- left <<= 1;
- }
- return len - root_bits;
-}
-
-void BrotliBuildCodeLengthsHuffmanTable(HuffmanCode* table,
- const uint8_t* const code_lengths,
+static BROTLI_INLINE int NextTableBitSize(const uint16_t* const count,
+ int len, int root_bits) {
+ int left = 1 << (len - root_bits);
+ while (len < BROTLI_HUFFMAN_MAX_CODE_LENGTH) {
+ left -= count[len];
+ if (left <= 0) break;
+ ++len;
+ left <<= 1;
+ }
+ return len - root_bits;
+}
+
+void BrotliBuildCodeLengthsHuffmanTable(HuffmanCode* table,
+ const uint8_t* const code_lengths,
uint16_t* count) {
HuffmanCode code; /* current table entry */
int symbol; /* symbol index in original or sorted table */
@@ -111,61 +111,61 @@ void BrotliBuildCodeLengthsHuffmanTable(HuffmanCode* table,
int step; /* step size to replicate values in current table */
int table_size; /* size of current table */
int sorted[BROTLI_CODE_LENGTH_CODES]; /* symbols sorted by code length */
- /* offsets in sorted table for each length */
- int offset[BROTLI_HUFFMAN_MAX_CODE_LENGTH_CODE_LENGTH + 1];
- int bits;
- int bits_count;
+ /* offsets in sorted table for each length */
+ int offset[BROTLI_HUFFMAN_MAX_CODE_LENGTH_CODE_LENGTH + 1];
+ int bits;
+ int bits_count;
BROTLI_DCHECK(BROTLI_HUFFMAN_MAX_CODE_LENGTH_CODE_LENGTH <=
BROTLI_REVERSE_BITS_MAX);
-
+
/* Generate offsets into sorted symbol table by code length. */
- symbol = -1;
- bits = 1;
- BROTLI_REPEAT(BROTLI_HUFFMAN_MAX_CODE_LENGTH_CODE_LENGTH, {
- symbol += count[bits];
- offset[bits] = symbol;
- bits++;
- });
+ symbol = -1;
+ bits = 1;
+ BROTLI_REPEAT(BROTLI_HUFFMAN_MAX_CODE_LENGTH_CODE_LENGTH, {
+ symbol += count[bits];
+ offset[bits] = symbol;
+ bits++;
+ });
/* Symbols with code length 0 are placed after all other symbols. */
offset[0] = BROTLI_CODE_LENGTH_CODES - 1;
-
+
/* Sort symbols by length, by symbol order within each length. */
symbol = BROTLI_CODE_LENGTH_CODES;
- do {
- BROTLI_REPEAT(6, {
- symbol--;
- sorted[offset[code_lengths[symbol]]--] = symbol;
- });
- } while (symbol != 0);
-
- table_size = 1 << BROTLI_HUFFMAN_MAX_CODE_LENGTH_CODE_LENGTH;
-
+ do {
+ BROTLI_REPEAT(6, {
+ symbol--;
+ sorted[offset[code_lengths[symbol]]--] = symbol;
+ });
+ } while (symbol != 0);
+
+ table_size = 1 << BROTLI_HUFFMAN_MAX_CODE_LENGTH_CODE_LENGTH;
+
/* Special case: all symbols but one have 0 code length. */
if (offset[0] == 0) {
code = ConstructHuffmanCode(0, (uint16_t)sorted[0]);
for (key = 0; key < (brotli_reg_t)table_size; ++key) {
- table[key] = code;
- }
- return;
- }
-
+ table[key] = code;
+ }
+ return;
+ }
+
/* Fill in table. */
- key = 0;
+ key = 0;
key_step = BROTLI_REVERSE_BITS_LOWEST;
- symbol = 0;
- bits = 1;
- step = 2;
- do {
- for (bits_count = count[bits]; bits_count != 0; --bits_count) {
+ symbol = 0;
+ bits = 1;
+ step = 2;
+ do {
+ for (bits_count = count[bits]; bits_count != 0; --bits_count) {
code = ConstructHuffmanCode((uint8_t)bits, (uint16_t)sorted[symbol++]);
ReplicateValue(&table[BrotliReverseBits(key)], step, table_size, code);
key += key_step;
- }
- step <<= 1;
+ }
+ step <<= 1;
key_step >>= 1;
- } while (++bits <= BROTLI_HUFFMAN_MAX_CODE_LENGTH_CODE_LENGTH);
-}
-
+ } while (++bits <= BROTLI_HUFFMAN_MAX_CODE_LENGTH_CODE_LENGTH);
+}
+
uint32_t BrotliBuildHuffmanTable(HuffmanCode* root_table,
int root_bits,
const uint16_t* const symbol_lists,
@@ -182,114 +182,114 @@ uint32_t BrotliBuildHuffmanTable(HuffmanCode* root_table,
int table_bits; /* key length of current table */
int table_size; /* size of current table */
int total_size; /* sum of root table size and 2nd level table sizes */
- int max_length = -1;
- int bits;
- int bits_count;
-
+ int max_length = -1;
+ int bits;
+ int bits_count;
+
BROTLI_DCHECK(root_bits <= BROTLI_REVERSE_BITS_MAX);
BROTLI_DCHECK(BROTLI_HUFFMAN_MAX_CODE_LENGTH - root_bits <=
BROTLI_REVERSE_BITS_MAX);
- while (symbol_lists[max_length] == 0xFFFF) max_length--;
- max_length += BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1;
-
- table = root_table;
- table_bits = root_bits;
- table_size = 1 << table_bits;
- total_size = table_size;
-
+ while (symbol_lists[max_length] == 0xFFFF) max_length--;
+ max_length += BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1;
+
+ table = root_table;
+ table_bits = root_bits;
+ table_size = 1 << table_bits;
+ total_size = table_size;
+
/* Fill in the root table. Reduce the table size to if possible,
and create the repetitions by memcpy. */
- if (table_bits > max_length) {
- table_bits = max_length;
- table_size = 1 << table_bits;
- }
- key = 0;
+ if (table_bits > max_length) {
+ table_bits = max_length;
+ table_size = 1 << table_bits;
+ }
+ key = 0;
key_step = BROTLI_REVERSE_BITS_LOWEST;
- bits = 1;
- step = 2;
- do {
- symbol = bits - (BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1);
- for (bits_count = count[bits]; bits_count != 0; --bits_count) {
- symbol = symbol_lists[symbol];
+ bits = 1;
+ step = 2;
+ do {
+ symbol = bits - (BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1);
+ for (bits_count = count[bits]; bits_count != 0; --bits_count) {
+ symbol = symbol_lists[symbol];
code = ConstructHuffmanCode((uint8_t)bits, (uint16_t)symbol);
ReplicateValue(&table[BrotliReverseBits(key)], step, table_size, code);
key += key_step;
- }
- step <<= 1;
+ }
+ step <<= 1;
key_step >>= 1;
- } while (++bits <= table_bits);
-
+ } while (++bits <= table_bits);
+
/* If root_bits != table_bits then replicate to fill the remaining slots. */
- while (total_size != table_size) {
- memcpy(&table[table_size], &table[0],
- (size_t)table_size * sizeof(table[0]));
- table_size <<= 1;
- }
-
+ while (total_size != table_size) {
+ memcpy(&table[table_size], &table[0],
+ (size_t)table_size * sizeof(table[0]));
+ table_size <<= 1;
+ }
+
/* Fill in 2nd level tables and add pointers to root table. */
key_step = BROTLI_REVERSE_BITS_LOWEST >> (root_bits - 1);
sub_key = (BROTLI_REVERSE_BITS_LOWEST << 1);
sub_key_step = BROTLI_REVERSE_BITS_LOWEST;
for (len = root_bits + 1, step = 2; len <= max_length; ++len) {
- symbol = len - (BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1);
- for (; count[len] != 0; --count[len]) {
+ symbol = len - (BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1);
+ for (; count[len] != 0; --count[len]) {
if (sub_key == (BROTLI_REVERSE_BITS_LOWEST << 1U)) {
- table += table_size;
- table_bits = NextTableBitSize(count, len, root_bits);
- table_size = 1 << table_bits;
- total_size += table_size;
+ table += table_size;
+ table_bits = NextTableBitSize(count, len, root_bits);
+ table_size = 1 << table_bits;
+ total_size += table_size;
sub_key = BrotliReverseBits(key);
key += key_step;
root_table[sub_key] = ConstructHuffmanCode(
(uint8_t)(table_bits + root_bits),
(uint16_t)(((size_t)(table - root_table)) - sub_key));
sub_key = 0;
- }
- symbol = symbol_lists[symbol];
+ }
+ symbol = symbol_lists[symbol];
code = ConstructHuffmanCode((uint8_t)(len - root_bits), (uint16_t)symbol);
ReplicateValue(
&table[BrotliReverseBits(sub_key)], step, table_size, code);
sub_key += sub_key_step;
- }
+ }
step <<= 1;
sub_key_step >>= 1;
- }
+ }
return (uint32_t)total_size;
-}
-
+}
+
uint32_t BrotliBuildSimpleHuffmanTable(HuffmanCode* table,
int root_bits,
uint16_t* val,
uint32_t num_symbols) {
uint32_t table_size = 1;
const uint32_t goal_size = 1U << root_bits;
- switch (num_symbols) {
- case 0:
+ switch (num_symbols) {
+ case 0:
table[0] = ConstructHuffmanCode(0, val[0]);
- break;
- case 1:
- if (val[1] > val[0]) {
+ break;
+ case 1:
+ if (val[1] > val[0]) {
table[0] = ConstructHuffmanCode(1, val[0]);
table[1] = ConstructHuffmanCode(1, val[1]);
- } else {
+ } else {
table[0] = ConstructHuffmanCode(1, val[1]);
table[1] = ConstructHuffmanCode(1, val[0]);
- }
- table_size = 2;
- break;
- case 2:
+ }
+ table_size = 2;
+ break;
+ case 2:
table[0] = ConstructHuffmanCode(1, val[0]);
table[2] = ConstructHuffmanCode(1, val[0]);
- if (val[2] > val[1]) {
+ if (val[2] > val[1]) {
table[1] = ConstructHuffmanCode(2, val[1]);
table[3] = ConstructHuffmanCode(2, val[2]);
- } else {
+ } else {
table[1] = ConstructHuffmanCode(2, val[2]);
table[3] = ConstructHuffmanCode(2, val[1]);
- }
- table_size = 4;
- break;
+ }
+ table_size = 4;
+ break;
case 3: {
int i, k;
for (i = 0; i < 3; ++i) {
@@ -298,22 +298,22 @@ uint32_t BrotliBuildSimpleHuffmanTable(HuffmanCode* table,
uint16_t t = val[k];
val[k] = val[i];
val[i] = t;
- }
- }
- }
+ }
+ }
+ }
table[0] = ConstructHuffmanCode(2, val[0]);
table[2] = ConstructHuffmanCode(2, val[1]);
table[1] = ConstructHuffmanCode(2, val[2]);
table[3] = ConstructHuffmanCode(2, val[3]);
table_size = 4;
- break;
+ break;
}
case 4: {
if (val[3] < val[2]) {
uint16_t t = val[3];
val[3] = val[2];
val[2] = t;
- }
+ }
table[0] = ConstructHuffmanCode(1, val[0]);
table[1] = ConstructHuffmanCode(2, val[1]);
table[2] = ConstructHuffmanCode(1, val[0]);
@@ -323,17 +323,17 @@ uint32_t BrotliBuildSimpleHuffmanTable(HuffmanCode* table,
table[6] = ConstructHuffmanCode(1, val[0]);
table[7] = ConstructHuffmanCode(3, val[3]);
table_size = 8;
- break;
+ break;
}
- }
- while (table_size != goal_size) {
- memcpy(&table[table_size], &table[0],
- (size_t)table_size * sizeof(table[0]));
- table_size <<= 1;
- }
- return goal_size;
-}
-
-#if defined(__cplusplus) || defined(c_plusplus)
+ }
+ while (table_size != goal_size) {
+ memcpy(&table[table_size], &table[0],
+ (size_t)table_size * sizeof(table[0]));
+ table_size <<= 1;
+ }
+ return goal_size;
+}
+
+#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
-#endif
+#endif
diff --git a/contrib/libs/brotli/dec/huffman.h b/contrib/libs/brotli/dec/huffman.h
index b9f0716c16..9951f8e15d 100644
--- a/contrib/libs/brotli/dec/huffman.h
+++ b/contrib/libs/brotli/dec/huffman.h
@@ -1,23 +1,23 @@
-/* Copyright 2013 Google Inc. All Rights Reserved.
-
+/* Copyright 2013 Google Inc. All Rights Reserved.
+
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
-*/
-
-/* Utilities for building Huffman decoding tables. */
-
-#ifndef BROTLI_DEC_HUFFMAN_H_
-#define BROTLI_DEC_HUFFMAN_H_
-
+*/
+
+/* Utilities for building Huffman decoding tables. */
+
+#ifndef BROTLI_DEC_HUFFMAN_H_
+#define BROTLI_DEC_HUFFMAN_H_
+
#include "../common/platform.h"
#include <brotli/types.h>
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#define BROTLI_HUFFMAN_MAX_CODE_LENGTH 15
-
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#define BROTLI_HUFFMAN_MAX_CODE_LENGTH 15
+
/* Maximum possible Huffman table size for an alphabet size of (index * 32),
max code length 15 and root table bits 8. */
static const uint16_t kMaxHuffmanTableSize[] = {
@@ -30,9 +30,9 @@ static const uint16_t kMaxHuffmanTableSize[] = {
#define BROTLI_HUFFMAN_MAX_SIZE_258 632
/* BROTLI_MAX_CONTEXT_MAP_SYMBOLS == 272 */
#define BROTLI_HUFFMAN_MAX_SIZE_272 646
-
-#define BROTLI_HUFFMAN_MAX_CODE_LENGTH_CODE_LENGTH 5
-
+
+#define BROTLI_HUFFMAN_MAX_CODE_LENGTH_CODE_LENGTH 5
+
#if ((defined(BROTLI_TARGET_ARMV7) || defined(BROTLI_TARGET_ARMV8_32)) && \
BROTLI_GNUC_HAS_ATTRIBUTE(aligned, 2, 7, 0))
#define BROTLI_HUFFMAN_CODE_FAST_LOAD
@@ -41,11 +41,11 @@ static const uint16_t kMaxHuffmanTableSize[] = {
#if !defined(BROTLI_HUFFMAN_CODE_FAST_LOAD)
/* Do not create this struct directly - use the ConstructHuffmanCode
* constructor below! */
-typedef struct {
+typedef struct {
uint8_t bits; /* number of bits used for this symbol */
uint16_t value; /* symbol value or table offset */
-} HuffmanCode;
-
+} HuffmanCode;
+
static BROTLI_INLINE HuffmanCode ConstructHuffmanCode(const uint8_t bits,
const uint16_t value) {
HuffmanCode h;
@@ -93,35 +93,35 @@ static BROTLI_INLINE HuffmanCode ConstructHuffmanCode(const uint8_t bits,
#define BROTLI_HC_FAST_LOAD_VALUE(H) ((__fastload_##H) >> 16)
#endif /* BROTLI_HUFFMAN_CODE_FAST_LOAD */
-/* Builds Huffman lookup table assuming code lengths are in symbol order. */
+/* Builds Huffman lookup table assuming code lengths are in symbol order. */
BROTLI_INTERNAL void BrotliBuildCodeLengthsHuffmanTable(HuffmanCode* root_table,
const uint8_t* const code_lengths, uint16_t* count);
-
+
/* Builds Huffman lookup table assuming code lengths are in symbol order.
Returns size of resulting table. */
BROTLI_INTERNAL uint32_t BrotliBuildHuffmanTable(HuffmanCode* root_table,
int root_bits, const uint16_t* const symbol_lists, uint16_t* count_arg);
-
+
/* Builds a simple Huffman table. The |num_symbols| parameter is to be
interpreted as follows: 0 means 1 symbol, 1 means 2 symbols,
2 means 3 symbols, 3 means 4 symbols with lengths [2, 2, 2, 2],
4 means 4 symbols with lengths [1, 2, 3, 3]. */
BROTLI_INTERNAL uint32_t BrotliBuildSimpleHuffmanTable(HuffmanCode* table,
int root_bits, uint16_t* symbols, uint32_t num_symbols);
-
-/* Contains a collection of Huffman trees with the same alphabet size. */
+
+/* Contains a collection of Huffman trees with the same alphabet size. */
/* max_symbol is needed due to simple codes since log2(alphabet_size) could be
greater than log2(max_symbol). */
-typedef struct {
- HuffmanCode** htrees;
- HuffmanCode* codes;
+typedef struct {
+ HuffmanCode** htrees;
+ HuffmanCode* codes;
uint16_t alphabet_size;
uint16_t max_symbol;
uint16_t num_htrees;
-} HuffmanTreeGroup;
-
-#if defined(__cplusplus) || defined(c_plusplus)
+} HuffmanTreeGroup;
+
+#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
-#endif
-
-#endif /* BROTLI_DEC_HUFFMAN_H_ */
+#endif
+
+#endif /* BROTLI_DEC_HUFFMAN_H_ */
diff --git a/contrib/libs/brotli/dec/prefix.h b/contrib/libs/brotli/dec/prefix.h
index 3ea062d84a..b4ceebfbd4 100644
--- a/contrib/libs/brotli/dec/prefix.h
+++ b/contrib/libs/brotli/dec/prefix.h
@@ -1,750 +1,750 @@
-/* Copyright 2013 Google Inc. All Rights Reserved.
-
+/* Copyright 2013 Google Inc. All Rights Reserved.
+
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
-*/
-
-/* Lookup tables to map prefix codes to value ranges. This is used during
+*/
+
+/* Lookup tables to map prefix codes to value ranges. This is used during
decoding of the block lengths, literal insertion lengths and copy lengths. */
-
-#ifndef BROTLI_DEC_PREFIX_H_
-#define BROTLI_DEC_PREFIX_H_
-
+
+#ifndef BROTLI_DEC_PREFIX_H_
+#define BROTLI_DEC_PREFIX_H_
+
#include "../common/constants.h"
#include <brotli/types.h>
/* Represents the range of values belonging to a prefix code:
[offset, offset + 2^nbits) */
-struct PrefixCodeRange {
+struct PrefixCodeRange {
uint16_t offset;
uint8_t nbits;
-};
-
+};
+
static const struct PrefixCodeRange
kBlockLengthPrefixCode[BROTLI_NUM_BLOCK_LEN_SYMBOLS] = {
- { 1, 2}, { 5, 2}, { 9, 2}, { 13, 2},
- { 17, 3}, { 25, 3}, { 33, 3}, { 41, 3},
- { 49, 4}, { 65, 4}, { 81, 4}, { 97, 4},
- { 113, 5}, { 145, 5}, { 177, 5}, { 209, 5},
- { 241, 6}, { 305, 6}, { 369, 7}, { 497, 8},
- { 753, 9}, { 1265, 10}, {2289, 11}, {4337, 12},
- {8433, 13}, {16625, 24}
-};
-
-typedef struct CmdLutElement {
- uint8_t insert_len_extra_bits;
- uint8_t copy_len_extra_bits;
- int8_t distance_code;
- uint8_t context;
- uint16_t insert_len_offset;
- uint16_t copy_len_offset;
-} CmdLutElement;
-
+ { 1, 2}, { 5, 2}, { 9, 2}, { 13, 2},
+ { 17, 3}, { 25, 3}, { 33, 3}, { 41, 3},
+ { 49, 4}, { 65, 4}, { 81, 4}, { 97, 4},
+ { 113, 5}, { 145, 5}, { 177, 5}, { 209, 5},
+ { 241, 6}, { 305, 6}, { 369, 7}, { 497, 8},
+ { 753, 9}, { 1265, 10}, {2289, 11}, {4337, 12},
+ {8433, 13}, {16625, 24}
+};
+
+typedef struct CmdLutElement {
+ uint8_t insert_len_extra_bits;
+ uint8_t copy_len_extra_bits;
+ int8_t distance_code;
+ uint8_t context;
+ uint16_t insert_len_offset;
+ uint16_t copy_len_offset;
+} CmdLutElement;
+
static const CmdLutElement kCmdLut[BROTLI_NUM_COMMAND_SYMBOLS] = {
- { 0x00, 0x00, 0, 0x00, 0x0000, 0x0002 },
- { 0x00, 0x00, 0, 0x01, 0x0000, 0x0003 },
- { 0x00, 0x00, 0, 0x02, 0x0000, 0x0004 },
- { 0x00, 0x00, 0, 0x03, 0x0000, 0x0005 },
- { 0x00, 0x00, 0, 0x03, 0x0000, 0x0006 },
- { 0x00, 0x00, 0, 0x03, 0x0000, 0x0007 },
- { 0x00, 0x00, 0, 0x03, 0x0000, 0x0008 },
- { 0x00, 0x00, 0, 0x03, 0x0000, 0x0009 },
- { 0x00, 0x00, 0, 0x00, 0x0001, 0x0002 },
- { 0x00, 0x00, 0, 0x01, 0x0001, 0x0003 },
- { 0x00, 0x00, 0, 0x02, 0x0001, 0x0004 },
- { 0x00, 0x00, 0, 0x03, 0x0001, 0x0005 },
- { 0x00, 0x00, 0, 0x03, 0x0001, 0x0006 },
- { 0x00, 0x00, 0, 0x03, 0x0001, 0x0007 },
- { 0x00, 0x00, 0, 0x03, 0x0001, 0x0008 },
- { 0x00, 0x00, 0, 0x03, 0x0001, 0x0009 },
- { 0x00, 0x00, 0, 0x00, 0x0002, 0x0002 },
- { 0x00, 0x00, 0, 0x01, 0x0002, 0x0003 },
- { 0x00, 0x00, 0, 0x02, 0x0002, 0x0004 },
- { 0x00, 0x00, 0, 0x03, 0x0002, 0x0005 },
- { 0x00, 0x00, 0, 0x03, 0x0002, 0x0006 },
- { 0x00, 0x00, 0, 0x03, 0x0002, 0x0007 },
- { 0x00, 0x00, 0, 0x03, 0x0002, 0x0008 },
- { 0x00, 0x00, 0, 0x03, 0x0002, 0x0009 },
- { 0x00, 0x00, 0, 0x00, 0x0003, 0x0002 },
- { 0x00, 0x00, 0, 0x01, 0x0003, 0x0003 },
- { 0x00, 0x00, 0, 0x02, 0x0003, 0x0004 },
- { 0x00, 0x00, 0, 0x03, 0x0003, 0x0005 },
- { 0x00, 0x00, 0, 0x03, 0x0003, 0x0006 },
- { 0x00, 0x00, 0, 0x03, 0x0003, 0x0007 },
- { 0x00, 0x00, 0, 0x03, 0x0003, 0x0008 },
- { 0x00, 0x00, 0, 0x03, 0x0003, 0x0009 },
- { 0x00, 0x00, 0, 0x00, 0x0004, 0x0002 },
- { 0x00, 0x00, 0, 0x01, 0x0004, 0x0003 },
- { 0x00, 0x00, 0, 0x02, 0x0004, 0x0004 },
- { 0x00, 0x00, 0, 0x03, 0x0004, 0x0005 },
- { 0x00, 0x00, 0, 0x03, 0x0004, 0x0006 },
- { 0x00, 0x00, 0, 0x03, 0x0004, 0x0007 },
- { 0x00, 0x00, 0, 0x03, 0x0004, 0x0008 },
- { 0x00, 0x00, 0, 0x03, 0x0004, 0x0009 },
- { 0x00, 0x00, 0, 0x00, 0x0005, 0x0002 },
- { 0x00, 0x00, 0, 0x01, 0x0005, 0x0003 },
- { 0x00, 0x00, 0, 0x02, 0x0005, 0x0004 },
- { 0x00, 0x00, 0, 0x03, 0x0005, 0x0005 },
- { 0x00, 0x00, 0, 0x03, 0x0005, 0x0006 },
- { 0x00, 0x00, 0, 0x03, 0x0005, 0x0007 },
- { 0x00, 0x00, 0, 0x03, 0x0005, 0x0008 },
- { 0x00, 0x00, 0, 0x03, 0x0005, 0x0009 },
- { 0x01, 0x00, 0, 0x00, 0x0006, 0x0002 },
- { 0x01, 0x00, 0, 0x01, 0x0006, 0x0003 },
- { 0x01, 0x00, 0, 0x02, 0x0006, 0x0004 },
- { 0x01, 0x00, 0, 0x03, 0x0006, 0x0005 },
- { 0x01, 0x00, 0, 0x03, 0x0006, 0x0006 },
- { 0x01, 0x00, 0, 0x03, 0x0006, 0x0007 },
- { 0x01, 0x00, 0, 0x03, 0x0006, 0x0008 },
- { 0x01, 0x00, 0, 0x03, 0x0006, 0x0009 },
- { 0x01, 0x00, 0, 0x00, 0x0008, 0x0002 },
- { 0x01, 0x00, 0, 0x01, 0x0008, 0x0003 },
- { 0x01, 0x00, 0, 0x02, 0x0008, 0x0004 },
- { 0x01, 0x00, 0, 0x03, 0x0008, 0x0005 },
- { 0x01, 0x00, 0, 0x03, 0x0008, 0x0006 },
- { 0x01, 0x00, 0, 0x03, 0x0008, 0x0007 },
- { 0x01, 0x00, 0, 0x03, 0x0008, 0x0008 },
- { 0x01, 0x00, 0, 0x03, 0x0008, 0x0009 },
- { 0x00, 0x01, 0, 0x03, 0x0000, 0x000a },
- { 0x00, 0x01, 0, 0x03, 0x0000, 0x000c },
- { 0x00, 0x02, 0, 0x03, 0x0000, 0x000e },
- { 0x00, 0x02, 0, 0x03, 0x0000, 0x0012 },
- { 0x00, 0x03, 0, 0x03, 0x0000, 0x0016 },
- { 0x00, 0x03, 0, 0x03, 0x0000, 0x001e },
- { 0x00, 0x04, 0, 0x03, 0x0000, 0x0026 },
- { 0x00, 0x04, 0, 0x03, 0x0000, 0x0036 },
- { 0x00, 0x01, 0, 0x03, 0x0001, 0x000a },
- { 0x00, 0x01, 0, 0x03, 0x0001, 0x000c },
- { 0x00, 0x02, 0, 0x03, 0x0001, 0x000e },
- { 0x00, 0x02, 0, 0x03, 0x0001, 0x0012 },
- { 0x00, 0x03, 0, 0x03, 0x0001, 0x0016 },
- { 0x00, 0x03, 0, 0x03, 0x0001, 0x001e },
- { 0x00, 0x04, 0, 0x03, 0x0001, 0x0026 },
- { 0x00, 0x04, 0, 0x03, 0x0001, 0x0036 },
- { 0x00, 0x01, 0, 0x03, 0x0002, 0x000a },
- { 0x00, 0x01, 0, 0x03, 0x0002, 0x000c },
- { 0x00, 0x02, 0, 0x03, 0x0002, 0x000e },
- { 0x00, 0x02, 0, 0x03, 0x0002, 0x0012 },
- { 0x00, 0x03, 0, 0x03, 0x0002, 0x0016 },
- { 0x00, 0x03, 0, 0x03, 0x0002, 0x001e },
- { 0x00, 0x04, 0, 0x03, 0x0002, 0x0026 },
- { 0x00, 0x04, 0, 0x03, 0x0002, 0x0036 },
- { 0x00, 0x01, 0, 0x03, 0x0003, 0x000a },
- { 0x00, 0x01, 0, 0x03, 0x0003, 0x000c },
- { 0x00, 0x02, 0, 0x03, 0x0003, 0x000e },
- { 0x00, 0x02, 0, 0x03, 0x0003, 0x0012 },
- { 0x00, 0x03, 0, 0x03, 0x0003, 0x0016 },
- { 0x00, 0x03, 0, 0x03, 0x0003, 0x001e },
- { 0x00, 0x04, 0, 0x03, 0x0003, 0x0026 },
- { 0x00, 0x04, 0, 0x03, 0x0003, 0x0036 },
- { 0x00, 0x01, 0, 0x03, 0x0004, 0x000a },
- { 0x00, 0x01, 0, 0x03, 0x0004, 0x000c },
- { 0x00, 0x02, 0, 0x03, 0x0004, 0x000e },
- { 0x00, 0x02, 0, 0x03, 0x0004, 0x0012 },
- { 0x00, 0x03, 0, 0x03, 0x0004, 0x0016 },
- { 0x00, 0x03, 0, 0x03, 0x0004, 0x001e },
- { 0x00, 0x04, 0, 0x03, 0x0004, 0x0026 },
- { 0x00, 0x04, 0, 0x03, 0x0004, 0x0036 },
- { 0x00, 0x01, 0, 0x03, 0x0005, 0x000a },
- { 0x00, 0x01, 0, 0x03, 0x0005, 0x000c },
- { 0x00, 0x02, 0, 0x03, 0x0005, 0x000e },
- { 0x00, 0x02, 0, 0x03, 0x0005, 0x0012 },
- { 0x00, 0x03, 0, 0x03, 0x0005, 0x0016 },
- { 0x00, 0x03, 0, 0x03, 0x0005, 0x001e },
- { 0x00, 0x04, 0, 0x03, 0x0005, 0x0026 },
- { 0x00, 0x04, 0, 0x03, 0x0005, 0x0036 },
- { 0x01, 0x01, 0, 0x03, 0x0006, 0x000a },
- { 0x01, 0x01, 0, 0x03, 0x0006, 0x000c },
- { 0x01, 0x02, 0, 0x03, 0x0006, 0x000e },
- { 0x01, 0x02, 0, 0x03, 0x0006, 0x0012 },
- { 0x01, 0x03, 0, 0x03, 0x0006, 0x0016 },
- { 0x01, 0x03, 0, 0x03, 0x0006, 0x001e },
- { 0x01, 0x04, 0, 0x03, 0x0006, 0x0026 },
- { 0x01, 0x04, 0, 0x03, 0x0006, 0x0036 },
- { 0x01, 0x01, 0, 0x03, 0x0008, 0x000a },
- { 0x01, 0x01, 0, 0x03, 0x0008, 0x000c },
- { 0x01, 0x02, 0, 0x03, 0x0008, 0x000e },
- { 0x01, 0x02, 0, 0x03, 0x0008, 0x0012 },
- { 0x01, 0x03, 0, 0x03, 0x0008, 0x0016 },
- { 0x01, 0x03, 0, 0x03, 0x0008, 0x001e },
- { 0x01, 0x04, 0, 0x03, 0x0008, 0x0026 },
- { 0x01, 0x04, 0, 0x03, 0x0008, 0x0036 },
- { 0x00, 0x00, -1, 0x00, 0x0000, 0x0002 },
- { 0x00, 0x00, -1, 0x01, 0x0000, 0x0003 },
- { 0x00, 0x00, -1, 0x02, 0x0000, 0x0004 },
- { 0x00, 0x00, -1, 0x03, 0x0000, 0x0005 },
- { 0x00, 0x00, -1, 0x03, 0x0000, 0x0006 },
- { 0x00, 0x00, -1, 0x03, 0x0000, 0x0007 },
- { 0x00, 0x00, -1, 0x03, 0x0000, 0x0008 },
- { 0x00, 0x00, -1, 0x03, 0x0000, 0x0009 },
- { 0x00, 0x00, -1, 0x00, 0x0001, 0x0002 },
- { 0x00, 0x00, -1, 0x01, 0x0001, 0x0003 },
- { 0x00, 0x00, -1, 0x02, 0x0001, 0x0004 },
- { 0x00, 0x00, -1, 0x03, 0x0001, 0x0005 },
- { 0x00, 0x00, -1, 0x03, 0x0001, 0x0006 },
- { 0x00, 0x00, -1, 0x03, 0x0001, 0x0007 },
- { 0x00, 0x00, -1, 0x03, 0x0001, 0x0008 },
- { 0x00, 0x00, -1, 0x03, 0x0001, 0x0009 },
- { 0x00, 0x00, -1, 0x00, 0x0002, 0x0002 },
- { 0x00, 0x00, -1, 0x01, 0x0002, 0x0003 },
- { 0x00, 0x00, -1, 0x02, 0x0002, 0x0004 },
- { 0x00, 0x00, -1, 0x03, 0x0002, 0x0005 },
- { 0x00, 0x00, -1, 0x03, 0x0002, 0x0006 },
- { 0x00, 0x00, -1, 0x03, 0x0002, 0x0007 },
- { 0x00, 0x00, -1, 0x03, 0x0002, 0x0008 },
- { 0x00, 0x00, -1, 0x03, 0x0002, 0x0009 },
- { 0x00, 0x00, -1, 0x00, 0x0003, 0x0002 },
- { 0x00, 0x00, -1, 0x01, 0x0003, 0x0003 },
- { 0x00, 0x00, -1, 0x02, 0x0003, 0x0004 },
- { 0x00, 0x00, -1, 0x03, 0x0003, 0x0005 },
- { 0x00, 0x00, -1, 0x03, 0x0003, 0x0006 },
- { 0x00, 0x00, -1, 0x03, 0x0003, 0x0007 },
- { 0x00, 0x00, -1, 0x03, 0x0003, 0x0008 },
- { 0x00, 0x00, -1, 0x03, 0x0003, 0x0009 },
- { 0x00, 0x00, -1, 0x00, 0x0004, 0x0002 },
- { 0x00, 0x00, -1, 0x01, 0x0004, 0x0003 },
- { 0x00, 0x00, -1, 0x02, 0x0004, 0x0004 },
- { 0x00, 0x00, -1, 0x03, 0x0004, 0x0005 },
- { 0x00, 0x00, -1, 0x03, 0x0004, 0x0006 },
- { 0x00, 0x00, -1, 0x03, 0x0004, 0x0007 },
- { 0x00, 0x00, -1, 0x03, 0x0004, 0x0008 },
- { 0x00, 0x00, -1, 0x03, 0x0004, 0x0009 },
- { 0x00, 0x00, -1, 0x00, 0x0005, 0x0002 },
- { 0x00, 0x00, -1, 0x01, 0x0005, 0x0003 },
- { 0x00, 0x00, -1, 0x02, 0x0005, 0x0004 },
- { 0x00, 0x00, -1, 0x03, 0x0005, 0x0005 },
- { 0x00, 0x00, -1, 0x03, 0x0005, 0x0006 },
- { 0x00, 0x00, -1, 0x03, 0x0005, 0x0007 },
- { 0x00, 0x00, -1, 0x03, 0x0005, 0x0008 },
- { 0x00, 0x00, -1, 0x03, 0x0005, 0x0009 },
- { 0x01, 0x00, -1, 0x00, 0x0006, 0x0002 },
- { 0x01, 0x00, -1, 0x01, 0x0006, 0x0003 },
- { 0x01, 0x00, -1, 0x02, 0x0006, 0x0004 },
- { 0x01, 0x00, -1, 0x03, 0x0006, 0x0005 },
- { 0x01, 0x00, -1, 0x03, 0x0006, 0x0006 },
- { 0x01, 0x00, -1, 0x03, 0x0006, 0x0007 },
- { 0x01, 0x00, -1, 0x03, 0x0006, 0x0008 },
- { 0x01, 0x00, -1, 0x03, 0x0006, 0x0009 },
- { 0x01, 0x00, -1, 0x00, 0x0008, 0x0002 },
- { 0x01, 0x00, -1, 0x01, 0x0008, 0x0003 },
- { 0x01, 0x00, -1, 0x02, 0x0008, 0x0004 },
- { 0x01, 0x00, -1, 0x03, 0x0008, 0x0005 },
- { 0x01, 0x00, -1, 0x03, 0x0008, 0x0006 },
- { 0x01, 0x00, -1, 0x03, 0x0008, 0x0007 },
- { 0x01, 0x00, -1, 0x03, 0x0008, 0x0008 },
- { 0x01, 0x00, -1, 0x03, 0x0008, 0x0009 },
- { 0x00, 0x01, -1, 0x03, 0x0000, 0x000a },
- { 0x00, 0x01, -1, 0x03, 0x0000, 0x000c },
- { 0x00, 0x02, -1, 0x03, 0x0000, 0x000e },
- { 0x00, 0x02, -1, 0x03, 0x0000, 0x0012 },
- { 0x00, 0x03, -1, 0x03, 0x0000, 0x0016 },
- { 0x00, 0x03, -1, 0x03, 0x0000, 0x001e },
- { 0x00, 0x04, -1, 0x03, 0x0000, 0x0026 },
- { 0x00, 0x04, -1, 0x03, 0x0000, 0x0036 },
- { 0x00, 0x01, -1, 0x03, 0x0001, 0x000a },
- { 0x00, 0x01, -1, 0x03, 0x0001, 0x000c },
- { 0x00, 0x02, -1, 0x03, 0x0001, 0x000e },
- { 0x00, 0x02, -1, 0x03, 0x0001, 0x0012 },
- { 0x00, 0x03, -1, 0x03, 0x0001, 0x0016 },
- { 0x00, 0x03, -1, 0x03, 0x0001, 0x001e },
- { 0x00, 0x04, -1, 0x03, 0x0001, 0x0026 },
- { 0x00, 0x04, -1, 0x03, 0x0001, 0x0036 },
- { 0x00, 0x01, -1, 0x03, 0x0002, 0x000a },
- { 0x00, 0x01, -1, 0x03, 0x0002, 0x000c },
- { 0x00, 0x02, -1, 0x03, 0x0002, 0x000e },
- { 0x00, 0x02, -1, 0x03, 0x0002, 0x0012 },
- { 0x00, 0x03, -1, 0x03, 0x0002, 0x0016 },
- { 0x00, 0x03, -1, 0x03, 0x0002, 0x001e },
- { 0x00, 0x04, -1, 0x03, 0x0002, 0x0026 },
- { 0x00, 0x04, -1, 0x03, 0x0002, 0x0036 },
- { 0x00, 0x01, -1, 0x03, 0x0003, 0x000a },
- { 0x00, 0x01, -1, 0x03, 0x0003, 0x000c },
- { 0x00, 0x02, -1, 0x03, 0x0003, 0x000e },
- { 0x00, 0x02, -1, 0x03, 0x0003, 0x0012 },
- { 0x00, 0x03, -1, 0x03, 0x0003, 0x0016 },
- { 0x00, 0x03, -1, 0x03, 0x0003, 0x001e },
- { 0x00, 0x04, -1, 0x03, 0x0003, 0x0026 },
- { 0x00, 0x04, -1, 0x03, 0x0003, 0x0036 },
- { 0x00, 0x01, -1, 0x03, 0x0004, 0x000a },
- { 0x00, 0x01, -1, 0x03, 0x0004, 0x000c },
- { 0x00, 0x02, -1, 0x03, 0x0004, 0x000e },
- { 0x00, 0x02, -1, 0x03, 0x0004, 0x0012 },
- { 0x00, 0x03, -1, 0x03, 0x0004, 0x0016 },
- { 0x00, 0x03, -1, 0x03, 0x0004, 0x001e },
- { 0x00, 0x04, -1, 0x03, 0x0004, 0x0026 },
- { 0x00, 0x04, -1, 0x03, 0x0004, 0x0036 },
- { 0x00, 0x01, -1, 0x03, 0x0005, 0x000a },
- { 0x00, 0x01, -1, 0x03, 0x0005, 0x000c },
- { 0x00, 0x02, -1, 0x03, 0x0005, 0x000e },
- { 0x00, 0x02, -1, 0x03, 0x0005, 0x0012 },
- { 0x00, 0x03, -1, 0x03, 0x0005, 0x0016 },
- { 0x00, 0x03, -1, 0x03, 0x0005, 0x001e },
- { 0x00, 0x04, -1, 0x03, 0x0005, 0x0026 },
- { 0x00, 0x04, -1, 0x03, 0x0005, 0x0036 },
- { 0x01, 0x01, -1, 0x03, 0x0006, 0x000a },
- { 0x01, 0x01, -1, 0x03, 0x0006, 0x000c },
- { 0x01, 0x02, -1, 0x03, 0x0006, 0x000e },
- { 0x01, 0x02, -1, 0x03, 0x0006, 0x0012 },
- { 0x01, 0x03, -1, 0x03, 0x0006, 0x0016 },
- { 0x01, 0x03, -1, 0x03, 0x0006, 0x001e },
- { 0x01, 0x04, -1, 0x03, 0x0006, 0x0026 },
- { 0x01, 0x04, -1, 0x03, 0x0006, 0x0036 },
- { 0x01, 0x01, -1, 0x03, 0x0008, 0x000a },
- { 0x01, 0x01, -1, 0x03, 0x0008, 0x000c },
- { 0x01, 0x02, -1, 0x03, 0x0008, 0x000e },
- { 0x01, 0x02, -1, 0x03, 0x0008, 0x0012 },
- { 0x01, 0x03, -1, 0x03, 0x0008, 0x0016 },
- { 0x01, 0x03, -1, 0x03, 0x0008, 0x001e },
- { 0x01, 0x04, -1, 0x03, 0x0008, 0x0026 },
- { 0x01, 0x04, -1, 0x03, 0x0008, 0x0036 },
- { 0x02, 0x00, -1, 0x00, 0x000a, 0x0002 },
- { 0x02, 0x00, -1, 0x01, 0x000a, 0x0003 },
- { 0x02, 0x00, -1, 0x02, 0x000a, 0x0004 },
- { 0x02, 0x00, -1, 0x03, 0x000a, 0x0005 },
- { 0x02, 0x00, -1, 0x03, 0x000a, 0x0006 },
- { 0x02, 0x00, -1, 0x03, 0x000a, 0x0007 },
- { 0x02, 0x00, -1, 0x03, 0x000a, 0x0008 },
- { 0x02, 0x00, -1, 0x03, 0x000a, 0x0009 },
- { 0x02, 0x00, -1, 0x00, 0x000e, 0x0002 },
- { 0x02, 0x00, -1, 0x01, 0x000e, 0x0003 },
- { 0x02, 0x00, -1, 0x02, 0x000e, 0x0004 },
- { 0x02, 0x00, -1, 0x03, 0x000e, 0x0005 },
- { 0x02, 0x00, -1, 0x03, 0x000e, 0x0006 },
- { 0x02, 0x00, -1, 0x03, 0x000e, 0x0007 },
- { 0x02, 0x00, -1, 0x03, 0x000e, 0x0008 },
- { 0x02, 0x00, -1, 0x03, 0x000e, 0x0009 },
- { 0x03, 0x00, -1, 0x00, 0x0012, 0x0002 },
- { 0x03, 0x00, -1, 0x01, 0x0012, 0x0003 },
- { 0x03, 0x00, -1, 0x02, 0x0012, 0x0004 },
- { 0x03, 0x00, -1, 0x03, 0x0012, 0x0005 },
- { 0x03, 0x00, -1, 0x03, 0x0012, 0x0006 },
- { 0x03, 0x00, -1, 0x03, 0x0012, 0x0007 },
- { 0x03, 0x00, -1, 0x03, 0x0012, 0x0008 },
- { 0x03, 0x00, -1, 0x03, 0x0012, 0x0009 },
- { 0x03, 0x00, -1, 0x00, 0x001a, 0x0002 },
- { 0x03, 0x00, -1, 0x01, 0x001a, 0x0003 },
- { 0x03, 0x00, -1, 0x02, 0x001a, 0x0004 },
- { 0x03, 0x00, -1, 0x03, 0x001a, 0x0005 },
- { 0x03, 0x00, -1, 0x03, 0x001a, 0x0006 },
- { 0x03, 0x00, -1, 0x03, 0x001a, 0x0007 },
- { 0x03, 0x00, -1, 0x03, 0x001a, 0x0008 },
- { 0x03, 0x00, -1, 0x03, 0x001a, 0x0009 },
- { 0x04, 0x00, -1, 0x00, 0x0022, 0x0002 },
- { 0x04, 0x00, -1, 0x01, 0x0022, 0x0003 },
- { 0x04, 0x00, -1, 0x02, 0x0022, 0x0004 },
- { 0x04, 0x00, -1, 0x03, 0x0022, 0x0005 },
- { 0x04, 0x00, -1, 0x03, 0x0022, 0x0006 },
- { 0x04, 0x00, -1, 0x03, 0x0022, 0x0007 },
- { 0x04, 0x00, -1, 0x03, 0x0022, 0x0008 },
- { 0x04, 0x00, -1, 0x03, 0x0022, 0x0009 },
- { 0x04, 0x00, -1, 0x00, 0x0032, 0x0002 },
- { 0x04, 0x00, -1, 0x01, 0x0032, 0x0003 },
- { 0x04, 0x00, -1, 0x02, 0x0032, 0x0004 },
- { 0x04, 0x00, -1, 0x03, 0x0032, 0x0005 },
- { 0x04, 0x00, -1, 0x03, 0x0032, 0x0006 },
- { 0x04, 0x00, -1, 0x03, 0x0032, 0x0007 },
- { 0x04, 0x00, -1, 0x03, 0x0032, 0x0008 },
- { 0x04, 0x00, -1, 0x03, 0x0032, 0x0009 },
- { 0x05, 0x00, -1, 0x00, 0x0042, 0x0002 },
- { 0x05, 0x00, -1, 0x01, 0x0042, 0x0003 },
- { 0x05, 0x00, -1, 0x02, 0x0042, 0x0004 },
- { 0x05, 0x00, -1, 0x03, 0x0042, 0x0005 },
- { 0x05, 0x00, -1, 0x03, 0x0042, 0x0006 },
- { 0x05, 0x00, -1, 0x03, 0x0042, 0x0007 },
- { 0x05, 0x00, -1, 0x03, 0x0042, 0x0008 },
- { 0x05, 0x00, -1, 0x03, 0x0042, 0x0009 },
- { 0x05, 0x00, -1, 0x00, 0x0062, 0x0002 },
- { 0x05, 0x00, -1, 0x01, 0x0062, 0x0003 },
- { 0x05, 0x00, -1, 0x02, 0x0062, 0x0004 },
- { 0x05, 0x00, -1, 0x03, 0x0062, 0x0005 },
- { 0x05, 0x00, -1, 0x03, 0x0062, 0x0006 },
- { 0x05, 0x00, -1, 0x03, 0x0062, 0x0007 },
- { 0x05, 0x00, -1, 0x03, 0x0062, 0x0008 },
- { 0x05, 0x00, -1, 0x03, 0x0062, 0x0009 },
- { 0x02, 0x01, -1, 0x03, 0x000a, 0x000a },
- { 0x02, 0x01, -1, 0x03, 0x000a, 0x000c },
- { 0x02, 0x02, -1, 0x03, 0x000a, 0x000e },
- { 0x02, 0x02, -1, 0x03, 0x000a, 0x0012 },
- { 0x02, 0x03, -1, 0x03, 0x000a, 0x0016 },
- { 0x02, 0x03, -1, 0x03, 0x000a, 0x001e },
- { 0x02, 0x04, -1, 0x03, 0x000a, 0x0026 },
- { 0x02, 0x04, -1, 0x03, 0x000a, 0x0036 },
- { 0x02, 0x01, -1, 0x03, 0x000e, 0x000a },
- { 0x02, 0x01, -1, 0x03, 0x000e, 0x000c },
- { 0x02, 0x02, -1, 0x03, 0x000e, 0x000e },
- { 0x02, 0x02, -1, 0x03, 0x000e, 0x0012 },
- { 0x02, 0x03, -1, 0x03, 0x000e, 0x0016 },
- { 0x02, 0x03, -1, 0x03, 0x000e, 0x001e },
- { 0x02, 0x04, -1, 0x03, 0x000e, 0x0026 },
- { 0x02, 0x04, -1, 0x03, 0x000e, 0x0036 },
- { 0x03, 0x01, -1, 0x03, 0x0012, 0x000a },
- { 0x03, 0x01, -1, 0x03, 0x0012, 0x000c },
- { 0x03, 0x02, -1, 0x03, 0x0012, 0x000e },
- { 0x03, 0x02, -1, 0x03, 0x0012, 0x0012 },
- { 0x03, 0x03, -1, 0x03, 0x0012, 0x0016 },
- { 0x03, 0x03, -1, 0x03, 0x0012, 0x001e },
- { 0x03, 0x04, -1, 0x03, 0x0012, 0x0026 },
- { 0x03, 0x04, -1, 0x03, 0x0012, 0x0036 },
- { 0x03, 0x01, -1, 0x03, 0x001a, 0x000a },
- { 0x03, 0x01, -1, 0x03, 0x001a, 0x000c },
- { 0x03, 0x02, -1, 0x03, 0x001a, 0x000e },
- { 0x03, 0x02, -1, 0x03, 0x001a, 0x0012 },
- { 0x03, 0x03, -1, 0x03, 0x001a, 0x0016 },
- { 0x03, 0x03, -1, 0x03, 0x001a, 0x001e },
- { 0x03, 0x04, -1, 0x03, 0x001a, 0x0026 },
- { 0x03, 0x04, -1, 0x03, 0x001a, 0x0036 },
- { 0x04, 0x01, -1, 0x03, 0x0022, 0x000a },
- { 0x04, 0x01, -1, 0x03, 0x0022, 0x000c },
- { 0x04, 0x02, -1, 0x03, 0x0022, 0x000e },
- { 0x04, 0x02, -1, 0x03, 0x0022, 0x0012 },
- { 0x04, 0x03, -1, 0x03, 0x0022, 0x0016 },
- { 0x04, 0x03, -1, 0x03, 0x0022, 0x001e },
- { 0x04, 0x04, -1, 0x03, 0x0022, 0x0026 },
- { 0x04, 0x04, -1, 0x03, 0x0022, 0x0036 },
- { 0x04, 0x01, -1, 0x03, 0x0032, 0x000a },
- { 0x04, 0x01, -1, 0x03, 0x0032, 0x000c },
- { 0x04, 0x02, -1, 0x03, 0x0032, 0x000e },
- { 0x04, 0x02, -1, 0x03, 0x0032, 0x0012 },
- { 0x04, 0x03, -1, 0x03, 0x0032, 0x0016 },
- { 0x04, 0x03, -1, 0x03, 0x0032, 0x001e },
- { 0x04, 0x04, -1, 0x03, 0x0032, 0x0026 },
- { 0x04, 0x04, -1, 0x03, 0x0032, 0x0036 },
- { 0x05, 0x01, -1, 0x03, 0x0042, 0x000a },
- { 0x05, 0x01, -1, 0x03, 0x0042, 0x000c },
- { 0x05, 0x02, -1, 0x03, 0x0042, 0x000e },
- { 0x05, 0x02, -1, 0x03, 0x0042, 0x0012 },
- { 0x05, 0x03, -1, 0x03, 0x0042, 0x0016 },
- { 0x05, 0x03, -1, 0x03, 0x0042, 0x001e },
- { 0x05, 0x04, -1, 0x03, 0x0042, 0x0026 },
- { 0x05, 0x04, -1, 0x03, 0x0042, 0x0036 },
- { 0x05, 0x01, -1, 0x03, 0x0062, 0x000a },
- { 0x05, 0x01, -1, 0x03, 0x0062, 0x000c },
- { 0x05, 0x02, -1, 0x03, 0x0062, 0x000e },
- { 0x05, 0x02, -1, 0x03, 0x0062, 0x0012 },
- { 0x05, 0x03, -1, 0x03, 0x0062, 0x0016 },
- { 0x05, 0x03, -1, 0x03, 0x0062, 0x001e },
- { 0x05, 0x04, -1, 0x03, 0x0062, 0x0026 },
- { 0x05, 0x04, -1, 0x03, 0x0062, 0x0036 },
- { 0x00, 0x05, -1, 0x03, 0x0000, 0x0046 },
- { 0x00, 0x05, -1, 0x03, 0x0000, 0x0066 },
- { 0x00, 0x06, -1, 0x03, 0x0000, 0x0086 },
- { 0x00, 0x07, -1, 0x03, 0x0000, 0x00c6 },
- { 0x00, 0x08, -1, 0x03, 0x0000, 0x0146 },
- { 0x00, 0x09, -1, 0x03, 0x0000, 0x0246 },
- { 0x00, 0x0a, -1, 0x03, 0x0000, 0x0446 },
- { 0x00, 0x18, -1, 0x03, 0x0000, 0x0846 },
- { 0x00, 0x05, -1, 0x03, 0x0001, 0x0046 },
- { 0x00, 0x05, -1, 0x03, 0x0001, 0x0066 },
- { 0x00, 0x06, -1, 0x03, 0x0001, 0x0086 },
- { 0x00, 0x07, -1, 0x03, 0x0001, 0x00c6 },
- { 0x00, 0x08, -1, 0x03, 0x0001, 0x0146 },
- { 0x00, 0x09, -1, 0x03, 0x0001, 0x0246 },
- { 0x00, 0x0a, -1, 0x03, 0x0001, 0x0446 },
- { 0x00, 0x18, -1, 0x03, 0x0001, 0x0846 },
- { 0x00, 0x05, -1, 0x03, 0x0002, 0x0046 },
- { 0x00, 0x05, -1, 0x03, 0x0002, 0x0066 },
- { 0x00, 0x06, -1, 0x03, 0x0002, 0x0086 },
- { 0x00, 0x07, -1, 0x03, 0x0002, 0x00c6 },
- { 0x00, 0x08, -1, 0x03, 0x0002, 0x0146 },
- { 0x00, 0x09, -1, 0x03, 0x0002, 0x0246 },
- { 0x00, 0x0a, -1, 0x03, 0x0002, 0x0446 },
- { 0x00, 0x18, -1, 0x03, 0x0002, 0x0846 },
- { 0x00, 0x05, -1, 0x03, 0x0003, 0x0046 },
- { 0x00, 0x05, -1, 0x03, 0x0003, 0x0066 },
- { 0x00, 0x06, -1, 0x03, 0x0003, 0x0086 },
- { 0x00, 0x07, -1, 0x03, 0x0003, 0x00c6 },
- { 0x00, 0x08, -1, 0x03, 0x0003, 0x0146 },
- { 0x00, 0x09, -1, 0x03, 0x0003, 0x0246 },
- { 0x00, 0x0a, -1, 0x03, 0x0003, 0x0446 },
- { 0x00, 0x18, -1, 0x03, 0x0003, 0x0846 },
- { 0x00, 0x05, -1, 0x03, 0x0004, 0x0046 },
- { 0x00, 0x05, -1, 0x03, 0x0004, 0x0066 },
- { 0x00, 0x06, -1, 0x03, 0x0004, 0x0086 },
- { 0x00, 0x07, -1, 0x03, 0x0004, 0x00c6 },
- { 0x00, 0x08, -1, 0x03, 0x0004, 0x0146 },
- { 0x00, 0x09, -1, 0x03, 0x0004, 0x0246 },
- { 0x00, 0x0a, -1, 0x03, 0x0004, 0x0446 },
- { 0x00, 0x18, -1, 0x03, 0x0004, 0x0846 },
- { 0x00, 0x05, -1, 0x03, 0x0005, 0x0046 },
- { 0x00, 0x05, -1, 0x03, 0x0005, 0x0066 },
- { 0x00, 0x06, -1, 0x03, 0x0005, 0x0086 },
- { 0x00, 0x07, -1, 0x03, 0x0005, 0x00c6 },
- { 0x00, 0x08, -1, 0x03, 0x0005, 0x0146 },
- { 0x00, 0x09, -1, 0x03, 0x0005, 0x0246 },
- { 0x00, 0x0a, -1, 0x03, 0x0005, 0x0446 },
- { 0x00, 0x18, -1, 0x03, 0x0005, 0x0846 },
- { 0x01, 0x05, -1, 0x03, 0x0006, 0x0046 },
- { 0x01, 0x05, -1, 0x03, 0x0006, 0x0066 },
- { 0x01, 0x06, -1, 0x03, 0x0006, 0x0086 },
- { 0x01, 0x07, -1, 0x03, 0x0006, 0x00c6 },
- { 0x01, 0x08, -1, 0x03, 0x0006, 0x0146 },
- { 0x01, 0x09, -1, 0x03, 0x0006, 0x0246 },
- { 0x01, 0x0a, -1, 0x03, 0x0006, 0x0446 },
- { 0x01, 0x18, -1, 0x03, 0x0006, 0x0846 },
- { 0x01, 0x05, -1, 0x03, 0x0008, 0x0046 },
- { 0x01, 0x05, -1, 0x03, 0x0008, 0x0066 },
- { 0x01, 0x06, -1, 0x03, 0x0008, 0x0086 },
- { 0x01, 0x07, -1, 0x03, 0x0008, 0x00c6 },
- { 0x01, 0x08, -1, 0x03, 0x0008, 0x0146 },
- { 0x01, 0x09, -1, 0x03, 0x0008, 0x0246 },
- { 0x01, 0x0a, -1, 0x03, 0x0008, 0x0446 },
- { 0x01, 0x18, -1, 0x03, 0x0008, 0x0846 },
- { 0x06, 0x00, -1, 0x00, 0x0082, 0x0002 },
- { 0x06, 0x00, -1, 0x01, 0x0082, 0x0003 },
- { 0x06, 0x00, -1, 0x02, 0x0082, 0x0004 },
- { 0x06, 0x00, -1, 0x03, 0x0082, 0x0005 },
- { 0x06, 0x00, -1, 0x03, 0x0082, 0x0006 },
- { 0x06, 0x00, -1, 0x03, 0x0082, 0x0007 },
- { 0x06, 0x00, -1, 0x03, 0x0082, 0x0008 },
- { 0x06, 0x00, -1, 0x03, 0x0082, 0x0009 },
- { 0x07, 0x00, -1, 0x00, 0x00c2, 0x0002 },
- { 0x07, 0x00, -1, 0x01, 0x00c2, 0x0003 },
- { 0x07, 0x00, -1, 0x02, 0x00c2, 0x0004 },
- { 0x07, 0x00, -1, 0x03, 0x00c2, 0x0005 },
- { 0x07, 0x00, -1, 0x03, 0x00c2, 0x0006 },
- { 0x07, 0x00, -1, 0x03, 0x00c2, 0x0007 },
- { 0x07, 0x00, -1, 0x03, 0x00c2, 0x0008 },
- { 0x07, 0x00, -1, 0x03, 0x00c2, 0x0009 },
- { 0x08, 0x00, -1, 0x00, 0x0142, 0x0002 },
- { 0x08, 0x00, -1, 0x01, 0x0142, 0x0003 },
- { 0x08, 0x00, -1, 0x02, 0x0142, 0x0004 },
- { 0x08, 0x00, -1, 0x03, 0x0142, 0x0005 },
- { 0x08, 0x00, -1, 0x03, 0x0142, 0x0006 },
- { 0x08, 0x00, -1, 0x03, 0x0142, 0x0007 },
- { 0x08, 0x00, -1, 0x03, 0x0142, 0x0008 },
- { 0x08, 0x00, -1, 0x03, 0x0142, 0x0009 },
- { 0x09, 0x00, -1, 0x00, 0x0242, 0x0002 },
- { 0x09, 0x00, -1, 0x01, 0x0242, 0x0003 },
- { 0x09, 0x00, -1, 0x02, 0x0242, 0x0004 },
- { 0x09, 0x00, -1, 0x03, 0x0242, 0x0005 },
- { 0x09, 0x00, -1, 0x03, 0x0242, 0x0006 },
- { 0x09, 0x00, -1, 0x03, 0x0242, 0x0007 },
- { 0x09, 0x00, -1, 0x03, 0x0242, 0x0008 },
- { 0x09, 0x00, -1, 0x03, 0x0242, 0x0009 },
- { 0x0a, 0x00, -1, 0x00, 0x0442, 0x0002 },
- { 0x0a, 0x00, -1, 0x01, 0x0442, 0x0003 },
- { 0x0a, 0x00, -1, 0x02, 0x0442, 0x0004 },
- { 0x0a, 0x00, -1, 0x03, 0x0442, 0x0005 },
- { 0x0a, 0x00, -1, 0x03, 0x0442, 0x0006 },
- { 0x0a, 0x00, -1, 0x03, 0x0442, 0x0007 },
- { 0x0a, 0x00, -1, 0x03, 0x0442, 0x0008 },
- { 0x0a, 0x00, -1, 0x03, 0x0442, 0x0009 },
- { 0x0c, 0x00, -1, 0x00, 0x0842, 0x0002 },
- { 0x0c, 0x00, -1, 0x01, 0x0842, 0x0003 },
- { 0x0c, 0x00, -1, 0x02, 0x0842, 0x0004 },
- { 0x0c, 0x00, -1, 0x03, 0x0842, 0x0005 },
- { 0x0c, 0x00, -1, 0x03, 0x0842, 0x0006 },
- { 0x0c, 0x00, -1, 0x03, 0x0842, 0x0007 },
- { 0x0c, 0x00, -1, 0x03, 0x0842, 0x0008 },
- { 0x0c, 0x00, -1, 0x03, 0x0842, 0x0009 },
- { 0x0e, 0x00, -1, 0x00, 0x1842, 0x0002 },
- { 0x0e, 0x00, -1, 0x01, 0x1842, 0x0003 },
- { 0x0e, 0x00, -1, 0x02, 0x1842, 0x0004 },
- { 0x0e, 0x00, -1, 0x03, 0x1842, 0x0005 },
- { 0x0e, 0x00, -1, 0x03, 0x1842, 0x0006 },
- { 0x0e, 0x00, -1, 0x03, 0x1842, 0x0007 },
- { 0x0e, 0x00, -1, 0x03, 0x1842, 0x0008 },
- { 0x0e, 0x00, -1, 0x03, 0x1842, 0x0009 },
- { 0x18, 0x00, -1, 0x00, 0x5842, 0x0002 },
- { 0x18, 0x00, -1, 0x01, 0x5842, 0x0003 },
- { 0x18, 0x00, -1, 0x02, 0x5842, 0x0004 },
- { 0x18, 0x00, -1, 0x03, 0x5842, 0x0005 },
- { 0x18, 0x00, -1, 0x03, 0x5842, 0x0006 },
- { 0x18, 0x00, -1, 0x03, 0x5842, 0x0007 },
- { 0x18, 0x00, -1, 0x03, 0x5842, 0x0008 },
- { 0x18, 0x00, -1, 0x03, 0x5842, 0x0009 },
- { 0x02, 0x05, -1, 0x03, 0x000a, 0x0046 },
- { 0x02, 0x05, -1, 0x03, 0x000a, 0x0066 },
- { 0x02, 0x06, -1, 0x03, 0x000a, 0x0086 },
- { 0x02, 0x07, -1, 0x03, 0x000a, 0x00c6 },
- { 0x02, 0x08, -1, 0x03, 0x000a, 0x0146 },
- { 0x02, 0x09, -1, 0x03, 0x000a, 0x0246 },
- { 0x02, 0x0a, -1, 0x03, 0x000a, 0x0446 },
- { 0x02, 0x18, -1, 0x03, 0x000a, 0x0846 },
- { 0x02, 0x05, -1, 0x03, 0x000e, 0x0046 },
- { 0x02, 0x05, -1, 0x03, 0x000e, 0x0066 },
- { 0x02, 0x06, -1, 0x03, 0x000e, 0x0086 },
- { 0x02, 0x07, -1, 0x03, 0x000e, 0x00c6 },
- { 0x02, 0x08, -1, 0x03, 0x000e, 0x0146 },
- { 0x02, 0x09, -1, 0x03, 0x000e, 0x0246 },
- { 0x02, 0x0a, -1, 0x03, 0x000e, 0x0446 },
- { 0x02, 0x18, -1, 0x03, 0x000e, 0x0846 },
- { 0x03, 0x05, -1, 0x03, 0x0012, 0x0046 },
- { 0x03, 0x05, -1, 0x03, 0x0012, 0x0066 },
- { 0x03, 0x06, -1, 0x03, 0x0012, 0x0086 },
- { 0x03, 0x07, -1, 0x03, 0x0012, 0x00c6 },
- { 0x03, 0x08, -1, 0x03, 0x0012, 0x0146 },
- { 0x03, 0x09, -1, 0x03, 0x0012, 0x0246 },
- { 0x03, 0x0a, -1, 0x03, 0x0012, 0x0446 },
- { 0x03, 0x18, -1, 0x03, 0x0012, 0x0846 },
- { 0x03, 0x05, -1, 0x03, 0x001a, 0x0046 },
- { 0x03, 0x05, -1, 0x03, 0x001a, 0x0066 },
- { 0x03, 0x06, -1, 0x03, 0x001a, 0x0086 },
- { 0x03, 0x07, -1, 0x03, 0x001a, 0x00c6 },
- { 0x03, 0x08, -1, 0x03, 0x001a, 0x0146 },
- { 0x03, 0x09, -1, 0x03, 0x001a, 0x0246 },
- { 0x03, 0x0a, -1, 0x03, 0x001a, 0x0446 },
- { 0x03, 0x18, -1, 0x03, 0x001a, 0x0846 },
- { 0x04, 0x05, -1, 0x03, 0x0022, 0x0046 },
- { 0x04, 0x05, -1, 0x03, 0x0022, 0x0066 },
- { 0x04, 0x06, -1, 0x03, 0x0022, 0x0086 },
- { 0x04, 0x07, -1, 0x03, 0x0022, 0x00c6 },
- { 0x04, 0x08, -1, 0x03, 0x0022, 0x0146 },
- { 0x04, 0x09, -1, 0x03, 0x0022, 0x0246 },
- { 0x04, 0x0a, -1, 0x03, 0x0022, 0x0446 },
- { 0x04, 0x18, -1, 0x03, 0x0022, 0x0846 },
- { 0x04, 0x05, -1, 0x03, 0x0032, 0x0046 },
- { 0x04, 0x05, -1, 0x03, 0x0032, 0x0066 },
- { 0x04, 0x06, -1, 0x03, 0x0032, 0x0086 },
- { 0x04, 0x07, -1, 0x03, 0x0032, 0x00c6 },
- { 0x04, 0x08, -1, 0x03, 0x0032, 0x0146 },
- { 0x04, 0x09, -1, 0x03, 0x0032, 0x0246 },
- { 0x04, 0x0a, -1, 0x03, 0x0032, 0x0446 },
- { 0x04, 0x18, -1, 0x03, 0x0032, 0x0846 },
- { 0x05, 0x05, -1, 0x03, 0x0042, 0x0046 },
- { 0x05, 0x05, -1, 0x03, 0x0042, 0x0066 },
- { 0x05, 0x06, -1, 0x03, 0x0042, 0x0086 },
- { 0x05, 0x07, -1, 0x03, 0x0042, 0x00c6 },
- { 0x05, 0x08, -1, 0x03, 0x0042, 0x0146 },
- { 0x05, 0x09, -1, 0x03, 0x0042, 0x0246 },
- { 0x05, 0x0a, -1, 0x03, 0x0042, 0x0446 },
- { 0x05, 0x18, -1, 0x03, 0x0042, 0x0846 },
- { 0x05, 0x05, -1, 0x03, 0x0062, 0x0046 },
- { 0x05, 0x05, -1, 0x03, 0x0062, 0x0066 },
- { 0x05, 0x06, -1, 0x03, 0x0062, 0x0086 },
- { 0x05, 0x07, -1, 0x03, 0x0062, 0x00c6 },
- { 0x05, 0x08, -1, 0x03, 0x0062, 0x0146 },
- { 0x05, 0x09, -1, 0x03, 0x0062, 0x0246 },
- { 0x05, 0x0a, -1, 0x03, 0x0062, 0x0446 },
- { 0x05, 0x18, -1, 0x03, 0x0062, 0x0846 },
- { 0x06, 0x01, -1, 0x03, 0x0082, 0x000a },
- { 0x06, 0x01, -1, 0x03, 0x0082, 0x000c },
- { 0x06, 0x02, -1, 0x03, 0x0082, 0x000e },
- { 0x06, 0x02, -1, 0x03, 0x0082, 0x0012 },
- { 0x06, 0x03, -1, 0x03, 0x0082, 0x0016 },
- { 0x06, 0x03, -1, 0x03, 0x0082, 0x001e },
- { 0x06, 0x04, -1, 0x03, 0x0082, 0x0026 },
- { 0x06, 0x04, -1, 0x03, 0x0082, 0x0036 },
- { 0x07, 0x01, -1, 0x03, 0x00c2, 0x000a },
- { 0x07, 0x01, -1, 0x03, 0x00c2, 0x000c },
- { 0x07, 0x02, -1, 0x03, 0x00c2, 0x000e },
- { 0x07, 0x02, -1, 0x03, 0x00c2, 0x0012 },
- { 0x07, 0x03, -1, 0x03, 0x00c2, 0x0016 },
- { 0x07, 0x03, -1, 0x03, 0x00c2, 0x001e },
- { 0x07, 0x04, -1, 0x03, 0x00c2, 0x0026 },
- { 0x07, 0x04, -1, 0x03, 0x00c2, 0x0036 },
- { 0x08, 0x01, -1, 0x03, 0x0142, 0x000a },
- { 0x08, 0x01, -1, 0x03, 0x0142, 0x000c },
- { 0x08, 0x02, -1, 0x03, 0x0142, 0x000e },
- { 0x08, 0x02, -1, 0x03, 0x0142, 0x0012 },
- { 0x08, 0x03, -1, 0x03, 0x0142, 0x0016 },
- { 0x08, 0x03, -1, 0x03, 0x0142, 0x001e },
- { 0x08, 0x04, -1, 0x03, 0x0142, 0x0026 },
- { 0x08, 0x04, -1, 0x03, 0x0142, 0x0036 },
- { 0x09, 0x01, -1, 0x03, 0x0242, 0x000a },
- { 0x09, 0x01, -1, 0x03, 0x0242, 0x000c },
- { 0x09, 0x02, -1, 0x03, 0x0242, 0x000e },
- { 0x09, 0x02, -1, 0x03, 0x0242, 0x0012 },
- { 0x09, 0x03, -1, 0x03, 0x0242, 0x0016 },
- { 0x09, 0x03, -1, 0x03, 0x0242, 0x001e },
- { 0x09, 0x04, -1, 0x03, 0x0242, 0x0026 },
- { 0x09, 0x04, -1, 0x03, 0x0242, 0x0036 },
- { 0x0a, 0x01, -1, 0x03, 0x0442, 0x000a },
- { 0x0a, 0x01, -1, 0x03, 0x0442, 0x000c },
- { 0x0a, 0x02, -1, 0x03, 0x0442, 0x000e },
- { 0x0a, 0x02, -1, 0x03, 0x0442, 0x0012 },
- { 0x0a, 0x03, -1, 0x03, 0x0442, 0x0016 },
- { 0x0a, 0x03, -1, 0x03, 0x0442, 0x001e },
- { 0x0a, 0x04, -1, 0x03, 0x0442, 0x0026 },
- { 0x0a, 0x04, -1, 0x03, 0x0442, 0x0036 },
- { 0x0c, 0x01, -1, 0x03, 0x0842, 0x000a },
- { 0x0c, 0x01, -1, 0x03, 0x0842, 0x000c },
- { 0x0c, 0x02, -1, 0x03, 0x0842, 0x000e },
- { 0x0c, 0x02, -1, 0x03, 0x0842, 0x0012 },
- { 0x0c, 0x03, -1, 0x03, 0x0842, 0x0016 },
- { 0x0c, 0x03, -1, 0x03, 0x0842, 0x001e },
- { 0x0c, 0x04, -1, 0x03, 0x0842, 0x0026 },
- { 0x0c, 0x04, -1, 0x03, 0x0842, 0x0036 },
- { 0x0e, 0x01, -1, 0x03, 0x1842, 0x000a },
- { 0x0e, 0x01, -1, 0x03, 0x1842, 0x000c },
- { 0x0e, 0x02, -1, 0x03, 0x1842, 0x000e },
- { 0x0e, 0x02, -1, 0x03, 0x1842, 0x0012 },
- { 0x0e, 0x03, -1, 0x03, 0x1842, 0x0016 },
- { 0x0e, 0x03, -1, 0x03, 0x1842, 0x001e },
- { 0x0e, 0x04, -1, 0x03, 0x1842, 0x0026 },
- { 0x0e, 0x04, -1, 0x03, 0x1842, 0x0036 },
- { 0x18, 0x01, -1, 0x03, 0x5842, 0x000a },
- { 0x18, 0x01, -1, 0x03, 0x5842, 0x000c },
- { 0x18, 0x02, -1, 0x03, 0x5842, 0x000e },
- { 0x18, 0x02, -1, 0x03, 0x5842, 0x0012 },
- { 0x18, 0x03, -1, 0x03, 0x5842, 0x0016 },
- { 0x18, 0x03, -1, 0x03, 0x5842, 0x001e },
- { 0x18, 0x04, -1, 0x03, 0x5842, 0x0026 },
- { 0x18, 0x04, -1, 0x03, 0x5842, 0x0036 },
- { 0x06, 0x05, -1, 0x03, 0x0082, 0x0046 },
- { 0x06, 0x05, -1, 0x03, 0x0082, 0x0066 },
- { 0x06, 0x06, -1, 0x03, 0x0082, 0x0086 },
- { 0x06, 0x07, -1, 0x03, 0x0082, 0x00c6 },
- { 0x06, 0x08, -1, 0x03, 0x0082, 0x0146 },
- { 0x06, 0x09, -1, 0x03, 0x0082, 0x0246 },
- { 0x06, 0x0a, -1, 0x03, 0x0082, 0x0446 },
- { 0x06, 0x18, -1, 0x03, 0x0082, 0x0846 },
- { 0x07, 0x05, -1, 0x03, 0x00c2, 0x0046 },
- { 0x07, 0x05, -1, 0x03, 0x00c2, 0x0066 },
- { 0x07, 0x06, -1, 0x03, 0x00c2, 0x0086 },
- { 0x07, 0x07, -1, 0x03, 0x00c2, 0x00c6 },
- { 0x07, 0x08, -1, 0x03, 0x00c2, 0x0146 },
- { 0x07, 0x09, -1, 0x03, 0x00c2, 0x0246 },
- { 0x07, 0x0a, -1, 0x03, 0x00c2, 0x0446 },
- { 0x07, 0x18, -1, 0x03, 0x00c2, 0x0846 },
- { 0x08, 0x05, -1, 0x03, 0x0142, 0x0046 },
- { 0x08, 0x05, -1, 0x03, 0x0142, 0x0066 },
- { 0x08, 0x06, -1, 0x03, 0x0142, 0x0086 },
- { 0x08, 0x07, -1, 0x03, 0x0142, 0x00c6 },
- { 0x08, 0x08, -1, 0x03, 0x0142, 0x0146 },
- { 0x08, 0x09, -1, 0x03, 0x0142, 0x0246 },
- { 0x08, 0x0a, -1, 0x03, 0x0142, 0x0446 },
- { 0x08, 0x18, -1, 0x03, 0x0142, 0x0846 },
- { 0x09, 0x05, -1, 0x03, 0x0242, 0x0046 },
- { 0x09, 0x05, -1, 0x03, 0x0242, 0x0066 },
- { 0x09, 0x06, -1, 0x03, 0x0242, 0x0086 },
- { 0x09, 0x07, -1, 0x03, 0x0242, 0x00c6 },
- { 0x09, 0x08, -1, 0x03, 0x0242, 0x0146 },
- { 0x09, 0x09, -1, 0x03, 0x0242, 0x0246 },
- { 0x09, 0x0a, -1, 0x03, 0x0242, 0x0446 },
- { 0x09, 0x18, -1, 0x03, 0x0242, 0x0846 },
- { 0x0a, 0x05, -1, 0x03, 0x0442, 0x0046 },
- { 0x0a, 0x05, -1, 0x03, 0x0442, 0x0066 },
- { 0x0a, 0x06, -1, 0x03, 0x0442, 0x0086 },
- { 0x0a, 0x07, -1, 0x03, 0x0442, 0x00c6 },
- { 0x0a, 0x08, -1, 0x03, 0x0442, 0x0146 },
- { 0x0a, 0x09, -1, 0x03, 0x0442, 0x0246 },
- { 0x0a, 0x0a, -1, 0x03, 0x0442, 0x0446 },
- { 0x0a, 0x18, -1, 0x03, 0x0442, 0x0846 },
- { 0x0c, 0x05, -1, 0x03, 0x0842, 0x0046 },
- { 0x0c, 0x05, -1, 0x03, 0x0842, 0x0066 },
- { 0x0c, 0x06, -1, 0x03, 0x0842, 0x0086 },
- { 0x0c, 0x07, -1, 0x03, 0x0842, 0x00c6 },
- { 0x0c, 0x08, -1, 0x03, 0x0842, 0x0146 },
- { 0x0c, 0x09, -1, 0x03, 0x0842, 0x0246 },
- { 0x0c, 0x0a, -1, 0x03, 0x0842, 0x0446 },
- { 0x0c, 0x18, -1, 0x03, 0x0842, 0x0846 },
- { 0x0e, 0x05, -1, 0x03, 0x1842, 0x0046 },
- { 0x0e, 0x05, -1, 0x03, 0x1842, 0x0066 },
- { 0x0e, 0x06, -1, 0x03, 0x1842, 0x0086 },
- { 0x0e, 0x07, -1, 0x03, 0x1842, 0x00c6 },
- { 0x0e, 0x08, -1, 0x03, 0x1842, 0x0146 },
- { 0x0e, 0x09, -1, 0x03, 0x1842, 0x0246 },
- { 0x0e, 0x0a, -1, 0x03, 0x1842, 0x0446 },
- { 0x0e, 0x18, -1, 0x03, 0x1842, 0x0846 },
- { 0x18, 0x05, -1, 0x03, 0x5842, 0x0046 },
- { 0x18, 0x05, -1, 0x03, 0x5842, 0x0066 },
- { 0x18, 0x06, -1, 0x03, 0x5842, 0x0086 },
- { 0x18, 0x07, -1, 0x03, 0x5842, 0x00c6 },
- { 0x18, 0x08, -1, 0x03, 0x5842, 0x0146 },
- { 0x18, 0x09, -1, 0x03, 0x5842, 0x0246 },
- { 0x18, 0x0a, -1, 0x03, 0x5842, 0x0446 },
- { 0x18, 0x18, -1, 0x03, 0x5842, 0x0846 },
-};
-
-#endif /* BROTLI_DEC_PREFIX_H_ */
+ { 0x00, 0x00, 0, 0x00, 0x0000, 0x0002 },
+ { 0x00, 0x00, 0, 0x01, 0x0000, 0x0003 },
+ { 0x00, 0x00, 0, 0x02, 0x0000, 0x0004 },
+ { 0x00, 0x00, 0, 0x03, 0x0000, 0x0005 },
+ { 0x00, 0x00, 0, 0x03, 0x0000, 0x0006 },
+ { 0x00, 0x00, 0, 0x03, 0x0000, 0x0007 },
+ { 0x00, 0x00, 0, 0x03, 0x0000, 0x0008 },
+ { 0x00, 0x00, 0, 0x03, 0x0000, 0x0009 },
+ { 0x00, 0x00, 0, 0x00, 0x0001, 0x0002 },
+ { 0x00, 0x00, 0, 0x01, 0x0001, 0x0003 },
+ { 0x00, 0x00, 0, 0x02, 0x0001, 0x0004 },
+ { 0x00, 0x00, 0, 0x03, 0x0001, 0x0005 },
+ { 0x00, 0x00, 0, 0x03, 0x0001, 0x0006 },
+ { 0x00, 0x00, 0, 0x03, 0x0001, 0x0007 },
+ { 0x00, 0x00, 0, 0x03, 0x0001, 0x0008 },
+ { 0x00, 0x00, 0, 0x03, 0x0001, 0x0009 },
+ { 0x00, 0x00, 0, 0x00, 0x0002, 0x0002 },
+ { 0x00, 0x00, 0, 0x01, 0x0002, 0x0003 },
+ { 0x00, 0x00, 0, 0x02, 0x0002, 0x0004 },
+ { 0x00, 0x00, 0, 0x03, 0x0002, 0x0005 },
+ { 0x00, 0x00, 0, 0x03, 0x0002, 0x0006 },
+ { 0x00, 0x00, 0, 0x03, 0x0002, 0x0007 },
+ { 0x00, 0x00, 0, 0x03, 0x0002, 0x0008 },
+ { 0x00, 0x00, 0, 0x03, 0x0002, 0x0009 },
+ { 0x00, 0x00, 0, 0x00, 0x0003, 0x0002 },
+ { 0x00, 0x00, 0, 0x01, 0x0003, 0x0003 },
+ { 0x00, 0x00, 0, 0x02, 0x0003, 0x0004 },
+ { 0x00, 0x00, 0, 0x03, 0x0003, 0x0005 },
+ { 0x00, 0x00, 0, 0x03, 0x0003, 0x0006 },
+ { 0x00, 0x00, 0, 0x03, 0x0003, 0x0007 },
+ { 0x00, 0x00, 0, 0x03, 0x0003, 0x0008 },
+ { 0x00, 0x00, 0, 0x03, 0x0003, 0x0009 },
+ { 0x00, 0x00, 0, 0x00, 0x0004, 0x0002 },
+ { 0x00, 0x00, 0, 0x01, 0x0004, 0x0003 },
+ { 0x00, 0x00, 0, 0x02, 0x0004, 0x0004 },
+ { 0x00, 0x00, 0, 0x03, 0x0004, 0x0005 },
+ { 0x00, 0x00, 0, 0x03, 0x0004, 0x0006 },
+ { 0x00, 0x00, 0, 0x03, 0x0004, 0x0007 },
+ { 0x00, 0x00, 0, 0x03, 0x0004, 0x0008 },
+ { 0x00, 0x00, 0, 0x03, 0x0004, 0x0009 },
+ { 0x00, 0x00, 0, 0x00, 0x0005, 0x0002 },
+ { 0x00, 0x00, 0, 0x01, 0x0005, 0x0003 },
+ { 0x00, 0x00, 0, 0x02, 0x0005, 0x0004 },
+ { 0x00, 0x00, 0, 0x03, 0x0005, 0x0005 },
+ { 0x00, 0x00, 0, 0x03, 0x0005, 0x0006 },
+ { 0x00, 0x00, 0, 0x03, 0x0005, 0x0007 },
+ { 0x00, 0x00, 0, 0x03, 0x0005, 0x0008 },
+ { 0x00, 0x00, 0, 0x03, 0x0005, 0x0009 },
+ { 0x01, 0x00, 0, 0x00, 0x0006, 0x0002 },
+ { 0x01, 0x00, 0, 0x01, 0x0006, 0x0003 },
+ { 0x01, 0x00, 0, 0x02, 0x0006, 0x0004 },
+ { 0x01, 0x00, 0, 0x03, 0x0006, 0x0005 },
+ { 0x01, 0x00, 0, 0x03, 0x0006, 0x0006 },
+ { 0x01, 0x00, 0, 0x03, 0x0006, 0x0007 },
+ { 0x01, 0x00, 0, 0x03, 0x0006, 0x0008 },
+ { 0x01, 0x00, 0, 0x03, 0x0006, 0x0009 },
+ { 0x01, 0x00, 0, 0x00, 0x0008, 0x0002 },
+ { 0x01, 0x00, 0, 0x01, 0x0008, 0x0003 },
+ { 0x01, 0x00, 0, 0x02, 0x0008, 0x0004 },
+ { 0x01, 0x00, 0, 0x03, 0x0008, 0x0005 },
+ { 0x01, 0x00, 0, 0x03, 0x0008, 0x0006 },
+ { 0x01, 0x00, 0, 0x03, 0x0008, 0x0007 },
+ { 0x01, 0x00, 0, 0x03, 0x0008, 0x0008 },
+ { 0x01, 0x00, 0, 0x03, 0x0008, 0x0009 },
+ { 0x00, 0x01, 0, 0x03, 0x0000, 0x000a },
+ { 0x00, 0x01, 0, 0x03, 0x0000, 0x000c },
+ { 0x00, 0x02, 0, 0x03, 0x0000, 0x000e },
+ { 0x00, 0x02, 0, 0x03, 0x0000, 0x0012 },
+ { 0x00, 0x03, 0, 0x03, 0x0000, 0x0016 },
+ { 0x00, 0x03, 0, 0x03, 0x0000, 0x001e },
+ { 0x00, 0x04, 0, 0x03, 0x0000, 0x0026 },
+ { 0x00, 0x04, 0, 0x03, 0x0000, 0x0036 },
+ { 0x00, 0x01, 0, 0x03, 0x0001, 0x000a },
+ { 0x00, 0x01, 0, 0x03, 0x0001, 0x000c },
+ { 0x00, 0x02, 0, 0x03, 0x0001, 0x000e },
+ { 0x00, 0x02, 0, 0x03, 0x0001, 0x0012 },
+ { 0x00, 0x03, 0, 0x03, 0x0001, 0x0016 },
+ { 0x00, 0x03, 0, 0x03, 0x0001, 0x001e },
+ { 0x00, 0x04, 0, 0x03, 0x0001, 0x0026 },
+ { 0x00, 0x04, 0, 0x03, 0x0001, 0x0036 },
+ { 0x00, 0x01, 0, 0x03, 0x0002, 0x000a },
+ { 0x00, 0x01, 0, 0x03, 0x0002, 0x000c },
+ { 0x00, 0x02, 0, 0x03, 0x0002, 0x000e },
+ { 0x00, 0x02, 0, 0x03, 0x0002, 0x0012 },
+ { 0x00, 0x03, 0, 0x03, 0x0002, 0x0016 },
+ { 0x00, 0x03, 0, 0x03, 0x0002, 0x001e },
+ { 0x00, 0x04, 0, 0x03, 0x0002, 0x0026 },
+ { 0x00, 0x04, 0, 0x03, 0x0002, 0x0036 },
+ { 0x00, 0x01, 0, 0x03, 0x0003, 0x000a },
+ { 0x00, 0x01, 0, 0x03, 0x0003, 0x000c },
+ { 0x00, 0x02, 0, 0x03, 0x0003, 0x000e },
+ { 0x00, 0x02, 0, 0x03, 0x0003, 0x0012 },
+ { 0x00, 0x03, 0, 0x03, 0x0003, 0x0016 },
+ { 0x00, 0x03, 0, 0x03, 0x0003, 0x001e },
+ { 0x00, 0x04, 0, 0x03, 0x0003, 0x0026 },
+ { 0x00, 0x04, 0, 0x03, 0x0003, 0x0036 },
+ { 0x00, 0x01, 0, 0x03, 0x0004, 0x000a },
+ { 0x00, 0x01, 0, 0x03, 0x0004, 0x000c },
+ { 0x00, 0x02, 0, 0x03, 0x0004, 0x000e },
+ { 0x00, 0x02, 0, 0x03, 0x0004, 0x0012 },
+ { 0x00, 0x03, 0, 0x03, 0x0004, 0x0016 },
+ { 0x00, 0x03, 0, 0x03, 0x0004, 0x001e },
+ { 0x00, 0x04, 0, 0x03, 0x0004, 0x0026 },
+ { 0x00, 0x04, 0, 0x03, 0x0004, 0x0036 },
+ { 0x00, 0x01, 0, 0x03, 0x0005, 0x000a },
+ { 0x00, 0x01, 0, 0x03, 0x0005, 0x000c },
+ { 0x00, 0x02, 0, 0x03, 0x0005, 0x000e },
+ { 0x00, 0x02, 0, 0x03, 0x0005, 0x0012 },
+ { 0x00, 0x03, 0, 0x03, 0x0005, 0x0016 },
+ { 0x00, 0x03, 0, 0x03, 0x0005, 0x001e },
+ { 0x00, 0x04, 0, 0x03, 0x0005, 0x0026 },
+ { 0x00, 0x04, 0, 0x03, 0x0005, 0x0036 },
+ { 0x01, 0x01, 0, 0x03, 0x0006, 0x000a },
+ { 0x01, 0x01, 0, 0x03, 0x0006, 0x000c },
+ { 0x01, 0x02, 0, 0x03, 0x0006, 0x000e },
+ { 0x01, 0x02, 0, 0x03, 0x0006, 0x0012 },
+ { 0x01, 0x03, 0, 0x03, 0x0006, 0x0016 },
+ { 0x01, 0x03, 0, 0x03, 0x0006, 0x001e },
+ { 0x01, 0x04, 0, 0x03, 0x0006, 0x0026 },
+ { 0x01, 0x04, 0, 0x03, 0x0006, 0x0036 },
+ { 0x01, 0x01, 0, 0x03, 0x0008, 0x000a },
+ { 0x01, 0x01, 0, 0x03, 0x0008, 0x000c },
+ { 0x01, 0x02, 0, 0x03, 0x0008, 0x000e },
+ { 0x01, 0x02, 0, 0x03, 0x0008, 0x0012 },
+ { 0x01, 0x03, 0, 0x03, 0x0008, 0x0016 },
+ { 0x01, 0x03, 0, 0x03, 0x0008, 0x001e },
+ { 0x01, 0x04, 0, 0x03, 0x0008, 0x0026 },
+ { 0x01, 0x04, 0, 0x03, 0x0008, 0x0036 },
+ { 0x00, 0x00, -1, 0x00, 0x0000, 0x0002 },
+ { 0x00, 0x00, -1, 0x01, 0x0000, 0x0003 },
+ { 0x00, 0x00, -1, 0x02, 0x0000, 0x0004 },
+ { 0x00, 0x00, -1, 0x03, 0x0000, 0x0005 },
+ { 0x00, 0x00, -1, 0x03, 0x0000, 0x0006 },
+ { 0x00, 0x00, -1, 0x03, 0x0000, 0x0007 },
+ { 0x00, 0x00, -1, 0x03, 0x0000, 0x0008 },
+ { 0x00, 0x00, -1, 0x03, 0x0000, 0x0009 },
+ { 0x00, 0x00, -1, 0x00, 0x0001, 0x0002 },
+ { 0x00, 0x00, -1, 0x01, 0x0001, 0x0003 },
+ { 0x00, 0x00, -1, 0x02, 0x0001, 0x0004 },
+ { 0x00, 0x00, -1, 0x03, 0x0001, 0x0005 },
+ { 0x00, 0x00, -1, 0x03, 0x0001, 0x0006 },
+ { 0x00, 0x00, -1, 0x03, 0x0001, 0x0007 },
+ { 0x00, 0x00, -1, 0x03, 0x0001, 0x0008 },
+ { 0x00, 0x00, -1, 0x03, 0x0001, 0x0009 },
+ { 0x00, 0x00, -1, 0x00, 0x0002, 0x0002 },
+ { 0x00, 0x00, -1, 0x01, 0x0002, 0x0003 },
+ { 0x00, 0x00, -1, 0x02, 0x0002, 0x0004 },
+ { 0x00, 0x00, -1, 0x03, 0x0002, 0x0005 },
+ { 0x00, 0x00, -1, 0x03, 0x0002, 0x0006 },
+ { 0x00, 0x00, -1, 0x03, 0x0002, 0x0007 },
+ { 0x00, 0x00, -1, 0x03, 0x0002, 0x0008 },
+ { 0x00, 0x00, -1, 0x03, 0x0002, 0x0009 },
+ { 0x00, 0x00, -1, 0x00, 0x0003, 0x0002 },
+ { 0x00, 0x00, -1, 0x01, 0x0003, 0x0003 },
+ { 0x00, 0x00, -1, 0x02, 0x0003, 0x0004 },
+ { 0x00, 0x00, -1, 0x03, 0x0003, 0x0005 },
+ { 0x00, 0x00, -1, 0x03, 0x0003, 0x0006 },
+ { 0x00, 0x00, -1, 0x03, 0x0003, 0x0007 },
+ { 0x00, 0x00, -1, 0x03, 0x0003, 0x0008 },
+ { 0x00, 0x00, -1, 0x03, 0x0003, 0x0009 },
+ { 0x00, 0x00, -1, 0x00, 0x0004, 0x0002 },
+ { 0x00, 0x00, -1, 0x01, 0x0004, 0x0003 },
+ { 0x00, 0x00, -1, 0x02, 0x0004, 0x0004 },
+ { 0x00, 0x00, -1, 0x03, 0x0004, 0x0005 },
+ { 0x00, 0x00, -1, 0x03, 0x0004, 0x0006 },
+ { 0x00, 0x00, -1, 0x03, 0x0004, 0x0007 },
+ { 0x00, 0x00, -1, 0x03, 0x0004, 0x0008 },
+ { 0x00, 0x00, -1, 0x03, 0x0004, 0x0009 },
+ { 0x00, 0x00, -1, 0x00, 0x0005, 0x0002 },
+ { 0x00, 0x00, -1, 0x01, 0x0005, 0x0003 },
+ { 0x00, 0x00, -1, 0x02, 0x0005, 0x0004 },
+ { 0x00, 0x00, -1, 0x03, 0x0005, 0x0005 },
+ { 0x00, 0x00, -1, 0x03, 0x0005, 0x0006 },
+ { 0x00, 0x00, -1, 0x03, 0x0005, 0x0007 },
+ { 0x00, 0x00, -1, 0x03, 0x0005, 0x0008 },
+ { 0x00, 0x00, -1, 0x03, 0x0005, 0x0009 },
+ { 0x01, 0x00, -1, 0x00, 0x0006, 0x0002 },
+ { 0x01, 0x00, -1, 0x01, 0x0006, 0x0003 },
+ { 0x01, 0x00, -1, 0x02, 0x0006, 0x0004 },
+ { 0x01, 0x00, -1, 0x03, 0x0006, 0x0005 },
+ { 0x01, 0x00, -1, 0x03, 0x0006, 0x0006 },
+ { 0x01, 0x00, -1, 0x03, 0x0006, 0x0007 },
+ { 0x01, 0x00, -1, 0x03, 0x0006, 0x0008 },
+ { 0x01, 0x00, -1, 0x03, 0x0006, 0x0009 },
+ { 0x01, 0x00, -1, 0x00, 0x0008, 0x0002 },
+ { 0x01, 0x00, -1, 0x01, 0x0008, 0x0003 },
+ { 0x01, 0x00, -1, 0x02, 0x0008, 0x0004 },
+ { 0x01, 0x00, -1, 0x03, 0x0008, 0x0005 },
+ { 0x01, 0x00, -1, 0x03, 0x0008, 0x0006 },
+ { 0x01, 0x00, -1, 0x03, 0x0008, 0x0007 },
+ { 0x01, 0x00, -1, 0x03, 0x0008, 0x0008 },
+ { 0x01, 0x00, -1, 0x03, 0x0008, 0x0009 },
+ { 0x00, 0x01, -1, 0x03, 0x0000, 0x000a },
+ { 0x00, 0x01, -1, 0x03, 0x0000, 0x000c },
+ { 0x00, 0x02, -1, 0x03, 0x0000, 0x000e },
+ { 0x00, 0x02, -1, 0x03, 0x0000, 0x0012 },
+ { 0x00, 0x03, -1, 0x03, 0x0000, 0x0016 },
+ { 0x00, 0x03, -1, 0x03, 0x0000, 0x001e },
+ { 0x00, 0x04, -1, 0x03, 0x0000, 0x0026 },
+ { 0x00, 0x04, -1, 0x03, 0x0000, 0x0036 },
+ { 0x00, 0x01, -1, 0x03, 0x0001, 0x000a },
+ { 0x00, 0x01, -1, 0x03, 0x0001, 0x000c },
+ { 0x00, 0x02, -1, 0x03, 0x0001, 0x000e },
+ { 0x00, 0x02, -1, 0x03, 0x0001, 0x0012 },
+ { 0x00, 0x03, -1, 0x03, 0x0001, 0x0016 },
+ { 0x00, 0x03, -1, 0x03, 0x0001, 0x001e },
+ { 0x00, 0x04, -1, 0x03, 0x0001, 0x0026 },
+ { 0x00, 0x04, -1, 0x03, 0x0001, 0x0036 },
+ { 0x00, 0x01, -1, 0x03, 0x0002, 0x000a },
+ { 0x00, 0x01, -1, 0x03, 0x0002, 0x000c },
+ { 0x00, 0x02, -1, 0x03, 0x0002, 0x000e },
+ { 0x00, 0x02, -1, 0x03, 0x0002, 0x0012 },
+ { 0x00, 0x03, -1, 0x03, 0x0002, 0x0016 },
+ { 0x00, 0x03, -1, 0x03, 0x0002, 0x001e },
+ { 0x00, 0x04, -1, 0x03, 0x0002, 0x0026 },
+ { 0x00, 0x04, -1, 0x03, 0x0002, 0x0036 },
+ { 0x00, 0x01, -1, 0x03, 0x0003, 0x000a },
+ { 0x00, 0x01, -1, 0x03, 0x0003, 0x000c },
+ { 0x00, 0x02, -1, 0x03, 0x0003, 0x000e },
+ { 0x00, 0x02, -1, 0x03, 0x0003, 0x0012 },
+ { 0x00, 0x03, -1, 0x03, 0x0003, 0x0016 },
+ { 0x00, 0x03, -1, 0x03, 0x0003, 0x001e },
+ { 0x00, 0x04, -1, 0x03, 0x0003, 0x0026 },
+ { 0x00, 0x04, -1, 0x03, 0x0003, 0x0036 },
+ { 0x00, 0x01, -1, 0x03, 0x0004, 0x000a },
+ { 0x00, 0x01, -1, 0x03, 0x0004, 0x000c },
+ { 0x00, 0x02, -1, 0x03, 0x0004, 0x000e },
+ { 0x00, 0x02, -1, 0x03, 0x0004, 0x0012 },
+ { 0x00, 0x03, -1, 0x03, 0x0004, 0x0016 },
+ { 0x00, 0x03, -1, 0x03, 0x0004, 0x001e },
+ { 0x00, 0x04, -1, 0x03, 0x0004, 0x0026 },
+ { 0x00, 0x04, -1, 0x03, 0x0004, 0x0036 },
+ { 0x00, 0x01, -1, 0x03, 0x0005, 0x000a },
+ { 0x00, 0x01, -1, 0x03, 0x0005, 0x000c },
+ { 0x00, 0x02, -1, 0x03, 0x0005, 0x000e },
+ { 0x00, 0x02, -1, 0x03, 0x0005, 0x0012 },
+ { 0x00, 0x03, -1, 0x03, 0x0005, 0x0016 },
+ { 0x00, 0x03, -1, 0x03, 0x0005, 0x001e },
+ { 0x00, 0x04, -1, 0x03, 0x0005, 0x0026 },
+ { 0x00, 0x04, -1, 0x03, 0x0005, 0x0036 },
+ { 0x01, 0x01, -1, 0x03, 0x0006, 0x000a },
+ { 0x01, 0x01, -1, 0x03, 0x0006, 0x000c },
+ { 0x01, 0x02, -1, 0x03, 0x0006, 0x000e },
+ { 0x01, 0x02, -1, 0x03, 0x0006, 0x0012 },
+ { 0x01, 0x03, -1, 0x03, 0x0006, 0x0016 },
+ { 0x01, 0x03, -1, 0x03, 0x0006, 0x001e },
+ { 0x01, 0x04, -1, 0x03, 0x0006, 0x0026 },
+ { 0x01, 0x04, -1, 0x03, 0x0006, 0x0036 },
+ { 0x01, 0x01, -1, 0x03, 0x0008, 0x000a },
+ { 0x01, 0x01, -1, 0x03, 0x0008, 0x000c },
+ { 0x01, 0x02, -1, 0x03, 0x0008, 0x000e },
+ { 0x01, 0x02, -1, 0x03, 0x0008, 0x0012 },
+ { 0x01, 0x03, -1, 0x03, 0x0008, 0x0016 },
+ { 0x01, 0x03, -1, 0x03, 0x0008, 0x001e },
+ { 0x01, 0x04, -1, 0x03, 0x0008, 0x0026 },
+ { 0x01, 0x04, -1, 0x03, 0x0008, 0x0036 },
+ { 0x02, 0x00, -1, 0x00, 0x000a, 0x0002 },
+ { 0x02, 0x00, -1, 0x01, 0x000a, 0x0003 },
+ { 0x02, 0x00, -1, 0x02, 0x000a, 0x0004 },
+ { 0x02, 0x00, -1, 0x03, 0x000a, 0x0005 },
+ { 0x02, 0x00, -1, 0x03, 0x000a, 0x0006 },
+ { 0x02, 0x00, -1, 0x03, 0x000a, 0x0007 },
+ { 0x02, 0x00, -1, 0x03, 0x000a, 0x0008 },
+ { 0x02, 0x00, -1, 0x03, 0x000a, 0x0009 },
+ { 0x02, 0x00, -1, 0x00, 0x000e, 0x0002 },
+ { 0x02, 0x00, -1, 0x01, 0x000e, 0x0003 },
+ { 0x02, 0x00, -1, 0x02, 0x000e, 0x0004 },
+ { 0x02, 0x00, -1, 0x03, 0x000e, 0x0005 },
+ { 0x02, 0x00, -1, 0x03, 0x000e, 0x0006 },
+ { 0x02, 0x00, -1, 0x03, 0x000e, 0x0007 },
+ { 0x02, 0x00, -1, 0x03, 0x000e, 0x0008 },
+ { 0x02, 0x00, -1, 0x03, 0x000e, 0x0009 },
+ { 0x03, 0x00, -1, 0x00, 0x0012, 0x0002 },
+ { 0x03, 0x00, -1, 0x01, 0x0012, 0x0003 },
+ { 0x03, 0x00, -1, 0x02, 0x0012, 0x0004 },
+ { 0x03, 0x00, -1, 0x03, 0x0012, 0x0005 },
+ { 0x03, 0x00, -1, 0x03, 0x0012, 0x0006 },
+ { 0x03, 0x00, -1, 0x03, 0x0012, 0x0007 },
+ { 0x03, 0x00, -1, 0x03, 0x0012, 0x0008 },
+ { 0x03, 0x00, -1, 0x03, 0x0012, 0x0009 },
+ { 0x03, 0x00, -1, 0x00, 0x001a, 0x0002 },
+ { 0x03, 0x00, -1, 0x01, 0x001a, 0x0003 },
+ { 0x03, 0x00, -1, 0x02, 0x001a, 0x0004 },
+ { 0x03, 0x00, -1, 0x03, 0x001a, 0x0005 },
+ { 0x03, 0x00, -1, 0x03, 0x001a, 0x0006 },
+ { 0x03, 0x00, -1, 0x03, 0x001a, 0x0007 },
+ { 0x03, 0x00, -1, 0x03, 0x001a, 0x0008 },
+ { 0x03, 0x00, -1, 0x03, 0x001a, 0x0009 },
+ { 0x04, 0x00, -1, 0x00, 0x0022, 0x0002 },
+ { 0x04, 0x00, -1, 0x01, 0x0022, 0x0003 },
+ { 0x04, 0x00, -1, 0x02, 0x0022, 0x0004 },
+ { 0x04, 0x00, -1, 0x03, 0x0022, 0x0005 },
+ { 0x04, 0x00, -1, 0x03, 0x0022, 0x0006 },
+ { 0x04, 0x00, -1, 0x03, 0x0022, 0x0007 },
+ { 0x04, 0x00, -1, 0x03, 0x0022, 0x0008 },
+ { 0x04, 0x00, -1, 0x03, 0x0022, 0x0009 },
+ { 0x04, 0x00, -1, 0x00, 0x0032, 0x0002 },
+ { 0x04, 0x00, -1, 0x01, 0x0032, 0x0003 },
+ { 0x04, 0x00, -1, 0x02, 0x0032, 0x0004 },
+ { 0x04, 0x00, -1, 0x03, 0x0032, 0x0005 },
+ { 0x04, 0x00, -1, 0x03, 0x0032, 0x0006 },
+ { 0x04, 0x00, -1, 0x03, 0x0032, 0x0007 },
+ { 0x04, 0x00, -1, 0x03, 0x0032, 0x0008 },
+ { 0x04, 0x00, -1, 0x03, 0x0032, 0x0009 },
+ { 0x05, 0x00, -1, 0x00, 0x0042, 0x0002 },
+ { 0x05, 0x00, -1, 0x01, 0x0042, 0x0003 },
+ { 0x05, 0x00, -1, 0x02, 0x0042, 0x0004 },
+ { 0x05, 0x00, -1, 0x03, 0x0042, 0x0005 },
+ { 0x05, 0x00, -1, 0x03, 0x0042, 0x0006 },
+ { 0x05, 0x00, -1, 0x03, 0x0042, 0x0007 },
+ { 0x05, 0x00, -1, 0x03, 0x0042, 0x0008 },
+ { 0x05, 0x00, -1, 0x03, 0x0042, 0x0009 },
+ { 0x05, 0x00, -1, 0x00, 0x0062, 0x0002 },
+ { 0x05, 0x00, -1, 0x01, 0x0062, 0x0003 },
+ { 0x05, 0x00, -1, 0x02, 0x0062, 0x0004 },
+ { 0x05, 0x00, -1, 0x03, 0x0062, 0x0005 },
+ { 0x05, 0x00, -1, 0x03, 0x0062, 0x0006 },
+ { 0x05, 0x00, -1, 0x03, 0x0062, 0x0007 },
+ { 0x05, 0x00, -1, 0x03, 0x0062, 0x0008 },
+ { 0x05, 0x00, -1, 0x03, 0x0062, 0x0009 },
+ { 0x02, 0x01, -1, 0x03, 0x000a, 0x000a },
+ { 0x02, 0x01, -1, 0x03, 0x000a, 0x000c },
+ { 0x02, 0x02, -1, 0x03, 0x000a, 0x000e },
+ { 0x02, 0x02, -1, 0x03, 0x000a, 0x0012 },
+ { 0x02, 0x03, -1, 0x03, 0x000a, 0x0016 },
+ { 0x02, 0x03, -1, 0x03, 0x000a, 0x001e },
+ { 0x02, 0x04, -1, 0x03, 0x000a, 0x0026 },
+ { 0x02, 0x04, -1, 0x03, 0x000a, 0x0036 },
+ { 0x02, 0x01, -1, 0x03, 0x000e, 0x000a },
+ { 0x02, 0x01, -1, 0x03, 0x000e, 0x000c },
+ { 0x02, 0x02, -1, 0x03, 0x000e, 0x000e },
+ { 0x02, 0x02, -1, 0x03, 0x000e, 0x0012 },
+ { 0x02, 0x03, -1, 0x03, 0x000e, 0x0016 },
+ { 0x02, 0x03, -1, 0x03, 0x000e, 0x001e },
+ { 0x02, 0x04, -1, 0x03, 0x000e, 0x0026 },
+ { 0x02, 0x04, -1, 0x03, 0x000e, 0x0036 },
+ { 0x03, 0x01, -1, 0x03, 0x0012, 0x000a },
+ { 0x03, 0x01, -1, 0x03, 0x0012, 0x000c },
+ { 0x03, 0x02, -1, 0x03, 0x0012, 0x000e },
+ { 0x03, 0x02, -1, 0x03, 0x0012, 0x0012 },
+ { 0x03, 0x03, -1, 0x03, 0x0012, 0x0016 },
+ { 0x03, 0x03, -1, 0x03, 0x0012, 0x001e },
+ { 0x03, 0x04, -1, 0x03, 0x0012, 0x0026 },
+ { 0x03, 0x04, -1, 0x03, 0x0012, 0x0036 },
+ { 0x03, 0x01, -1, 0x03, 0x001a, 0x000a },
+ { 0x03, 0x01, -1, 0x03, 0x001a, 0x000c },
+ { 0x03, 0x02, -1, 0x03, 0x001a, 0x000e },
+ { 0x03, 0x02, -1, 0x03, 0x001a, 0x0012 },
+ { 0x03, 0x03, -1, 0x03, 0x001a, 0x0016 },
+ { 0x03, 0x03, -1, 0x03, 0x001a, 0x001e },
+ { 0x03, 0x04, -1, 0x03, 0x001a, 0x0026 },
+ { 0x03, 0x04, -1, 0x03, 0x001a, 0x0036 },
+ { 0x04, 0x01, -1, 0x03, 0x0022, 0x000a },
+ { 0x04, 0x01, -1, 0x03, 0x0022, 0x000c },
+ { 0x04, 0x02, -1, 0x03, 0x0022, 0x000e },
+ { 0x04, 0x02, -1, 0x03, 0x0022, 0x0012 },
+ { 0x04, 0x03, -1, 0x03, 0x0022, 0x0016 },
+ { 0x04, 0x03, -1, 0x03, 0x0022, 0x001e },
+ { 0x04, 0x04, -1, 0x03, 0x0022, 0x0026 },
+ { 0x04, 0x04, -1, 0x03, 0x0022, 0x0036 },
+ { 0x04, 0x01, -1, 0x03, 0x0032, 0x000a },
+ { 0x04, 0x01, -1, 0x03, 0x0032, 0x000c },
+ { 0x04, 0x02, -1, 0x03, 0x0032, 0x000e },
+ { 0x04, 0x02, -1, 0x03, 0x0032, 0x0012 },
+ { 0x04, 0x03, -1, 0x03, 0x0032, 0x0016 },
+ { 0x04, 0x03, -1, 0x03, 0x0032, 0x001e },
+ { 0x04, 0x04, -1, 0x03, 0x0032, 0x0026 },
+ { 0x04, 0x04, -1, 0x03, 0x0032, 0x0036 },
+ { 0x05, 0x01, -1, 0x03, 0x0042, 0x000a },
+ { 0x05, 0x01, -1, 0x03, 0x0042, 0x000c },
+ { 0x05, 0x02, -1, 0x03, 0x0042, 0x000e },
+ { 0x05, 0x02, -1, 0x03, 0x0042, 0x0012 },
+ { 0x05, 0x03, -1, 0x03, 0x0042, 0x0016 },
+ { 0x05, 0x03, -1, 0x03, 0x0042, 0x001e },
+ { 0x05, 0x04, -1, 0x03, 0x0042, 0x0026 },
+ { 0x05, 0x04, -1, 0x03, 0x0042, 0x0036 },
+ { 0x05, 0x01, -1, 0x03, 0x0062, 0x000a },
+ { 0x05, 0x01, -1, 0x03, 0x0062, 0x000c },
+ { 0x05, 0x02, -1, 0x03, 0x0062, 0x000e },
+ { 0x05, 0x02, -1, 0x03, 0x0062, 0x0012 },
+ { 0x05, 0x03, -1, 0x03, 0x0062, 0x0016 },
+ { 0x05, 0x03, -1, 0x03, 0x0062, 0x001e },
+ { 0x05, 0x04, -1, 0x03, 0x0062, 0x0026 },
+ { 0x05, 0x04, -1, 0x03, 0x0062, 0x0036 },
+ { 0x00, 0x05, -1, 0x03, 0x0000, 0x0046 },
+ { 0x00, 0x05, -1, 0x03, 0x0000, 0x0066 },
+ { 0x00, 0x06, -1, 0x03, 0x0000, 0x0086 },
+ { 0x00, 0x07, -1, 0x03, 0x0000, 0x00c6 },
+ { 0x00, 0x08, -1, 0x03, 0x0000, 0x0146 },
+ { 0x00, 0x09, -1, 0x03, 0x0000, 0x0246 },
+ { 0x00, 0x0a, -1, 0x03, 0x0000, 0x0446 },
+ { 0x00, 0x18, -1, 0x03, 0x0000, 0x0846 },
+ { 0x00, 0x05, -1, 0x03, 0x0001, 0x0046 },
+ { 0x00, 0x05, -1, 0x03, 0x0001, 0x0066 },
+ { 0x00, 0x06, -1, 0x03, 0x0001, 0x0086 },
+ { 0x00, 0x07, -1, 0x03, 0x0001, 0x00c6 },
+ { 0x00, 0x08, -1, 0x03, 0x0001, 0x0146 },
+ { 0x00, 0x09, -1, 0x03, 0x0001, 0x0246 },
+ { 0x00, 0x0a, -1, 0x03, 0x0001, 0x0446 },
+ { 0x00, 0x18, -1, 0x03, 0x0001, 0x0846 },
+ { 0x00, 0x05, -1, 0x03, 0x0002, 0x0046 },
+ { 0x00, 0x05, -1, 0x03, 0x0002, 0x0066 },
+ { 0x00, 0x06, -1, 0x03, 0x0002, 0x0086 },
+ { 0x00, 0x07, -1, 0x03, 0x0002, 0x00c6 },
+ { 0x00, 0x08, -1, 0x03, 0x0002, 0x0146 },
+ { 0x00, 0x09, -1, 0x03, 0x0002, 0x0246 },
+ { 0x00, 0x0a, -1, 0x03, 0x0002, 0x0446 },
+ { 0x00, 0x18, -1, 0x03, 0x0002, 0x0846 },
+ { 0x00, 0x05, -1, 0x03, 0x0003, 0x0046 },
+ { 0x00, 0x05, -1, 0x03, 0x0003, 0x0066 },
+ { 0x00, 0x06, -1, 0x03, 0x0003, 0x0086 },
+ { 0x00, 0x07, -1, 0x03, 0x0003, 0x00c6 },
+ { 0x00, 0x08, -1, 0x03, 0x0003, 0x0146 },
+ { 0x00, 0x09, -1, 0x03, 0x0003, 0x0246 },
+ { 0x00, 0x0a, -1, 0x03, 0x0003, 0x0446 },
+ { 0x00, 0x18, -1, 0x03, 0x0003, 0x0846 },
+ { 0x00, 0x05, -1, 0x03, 0x0004, 0x0046 },
+ { 0x00, 0x05, -1, 0x03, 0x0004, 0x0066 },
+ { 0x00, 0x06, -1, 0x03, 0x0004, 0x0086 },
+ { 0x00, 0x07, -1, 0x03, 0x0004, 0x00c6 },
+ { 0x00, 0x08, -1, 0x03, 0x0004, 0x0146 },
+ { 0x00, 0x09, -1, 0x03, 0x0004, 0x0246 },
+ { 0x00, 0x0a, -1, 0x03, 0x0004, 0x0446 },
+ { 0x00, 0x18, -1, 0x03, 0x0004, 0x0846 },
+ { 0x00, 0x05, -1, 0x03, 0x0005, 0x0046 },
+ { 0x00, 0x05, -1, 0x03, 0x0005, 0x0066 },
+ { 0x00, 0x06, -1, 0x03, 0x0005, 0x0086 },
+ { 0x00, 0x07, -1, 0x03, 0x0005, 0x00c6 },
+ { 0x00, 0x08, -1, 0x03, 0x0005, 0x0146 },
+ { 0x00, 0x09, -1, 0x03, 0x0005, 0x0246 },
+ { 0x00, 0x0a, -1, 0x03, 0x0005, 0x0446 },
+ { 0x00, 0x18, -1, 0x03, 0x0005, 0x0846 },
+ { 0x01, 0x05, -1, 0x03, 0x0006, 0x0046 },
+ { 0x01, 0x05, -1, 0x03, 0x0006, 0x0066 },
+ { 0x01, 0x06, -1, 0x03, 0x0006, 0x0086 },
+ { 0x01, 0x07, -1, 0x03, 0x0006, 0x00c6 },
+ { 0x01, 0x08, -1, 0x03, 0x0006, 0x0146 },
+ { 0x01, 0x09, -1, 0x03, 0x0006, 0x0246 },
+ { 0x01, 0x0a, -1, 0x03, 0x0006, 0x0446 },
+ { 0x01, 0x18, -1, 0x03, 0x0006, 0x0846 },
+ { 0x01, 0x05, -1, 0x03, 0x0008, 0x0046 },
+ { 0x01, 0x05, -1, 0x03, 0x0008, 0x0066 },
+ { 0x01, 0x06, -1, 0x03, 0x0008, 0x0086 },
+ { 0x01, 0x07, -1, 0x03, 0x0008, 0x00c6 },
+ { 0x01, 0x08, -1, 0x03, 0x0008, 0x0146 },
+ { 0x01, 0x09, -1, 0x03, 0x0008, 0x0246 },
+ { 0x01, 0x0a, -1, 0x03, 0x0008, 0x0446 },
+ { 0x01, 0x18, -1, 0x03, 0x0008, 0x0846 },
+ { 0x06, 0x00, -1, 0x00, 0x0082, 0x0002 },
+ { 0x06, 0x00, -1, 0x01, 0x0082, 0x0003 },
+ { 0x06, 0x00, -1, 0x02, 0x0082, 0x0004 },
+ { 0x06, 0x00, -1, 0x03, 0x0082, 0x0005 },
+ { 0x06, 0x00, -1, 0x03, 0x0082, 0x0006 },
+ { 0x06, 0x00, -1, 0x03, 0x0082, 0x0007 },
+ { 0x06, 0x00, -1, 0x03, 0x0082, 0x0008 },
+ { 0x06, 0x00, -1, 0x03, 0x0082, 0x0009 },
+ { 0x07, 0x00, -1, 0x00, 0x00c2, 0x0002 },
+ { 0x07, 0x00, -1, 0x01, 0x00c2, 0x0003 },
+ { 0x07, 0x00, -1, 0x02, 0x00c2, 0x0004 },
+ { 0x07, 0x00, -1, 0x03, 0x00c2, 0x0005 },
+ { 0x07, 0x00, -1, 0x03, 0x00c2, 0x0006 },
+ { 0x07, 0x00, -1, 0x03, 0x00c2, 0x0007 },
+ { 0x07, 0x00, -1, 0x03, 0x00c2, 0x0008 },
+ { 0x07, 0x00, -1, 0x03, 0x00c2, 0x0009 },
+ { 0x08, 0x00, -1, 0x00, 0x0142, 0x0002 },
+ { 0x08, 0x00, -1, 0x01, 0x0142, 0x0003 },
+ { 0x08, 0x00, -1, 0x02, 0x0142, 0x0004 },
+ { 0x08, 0x00, -1, 0x03, 0x0142, 0x0005 },
+ { 0x08, 0x00, -1, 0x03, 0x0142, 0x0006 },
+ { 0x08, 0x00, -1, 0x03, 0x0142, 0x0007 },
+ { 0x08, 0x00, -1, 0x03, 0x0142, 0x0008 },
+ { 0x08, 0x00, -1, 0x03, 0x0142, 0x0009 },
+ { 0x09, 0x00, -1, 0x00, 0x0242, 0x0002 },
+ { 0x09, 0x00, -1, 0x01, 0x0242, 0x0003 },
+ { 0x09, 0x00, -1, 0x02, 0x0242, 0x0004 },
+ { 0x09, 0x00, -1, 0x03, 0x0242, 0x0005 },
+ { 0x09, 0x00, -1, 0x03, 0x0242, 0x0006 },
+ { 0x09, 0x00, -1, 0x03, 0x0242, 0x0007 },
+ { 0x09, 0x00, -1, 0x03, 0x0242, 0x0008 },
+ { 0x09, 0x00, -1, 0x03, 0x0242, 0x0009 },
+ { 0x0a, 0x00, -1, 0x00, 0x0442, 0x0002 },
+ { 0x0a, 0x00, -1, 0x01, 0x0442, 0x0003 },
+ { 0x0a, 0x00, -1, 0x02, 0x0442, 0x0004 },
+ { 0x0a, 0x00, -1, 0x03, 0x0442, 0x0005 },
+ { 0x0a, 0x00, -1, 0x03, 0x0442, 0x0006 },
+ { 0x0a, 0x00, -1, 0x03, 0x0442, 0x0007 },
+ { 0x0a, 0x00, -1, 0x03, 0x0442, 0x0008 },
+ { 0x0a, 0x00, -1, 0x03, 0x0442, 0x0009 },
+ { 0x0c, 0x00, -1, 0x00, 0x0842, 0x0002 },
+ { 0x0c, 0x00, -1, 0x01, 0x0842, 0x0003 },
+ { 0x0c, 0x00, -1, 0x02, 0x0842, 0x0004 },
+ { 0x0c, 0x00, -1, 0x03, 0x0842, 0x0005 },
+ { 0x0c, 0x00, -1, 0x03, 0x0842, 0x0006 },
+ { 0x0c, 0x00, -1, 0x03, 0x0842, 0x0007 },
+ { 0x0c, 0x00, -1, 0x03, 0x0842, 0x0008 },
+ { 0x0c, 0x00, -1, 0x03, 0x0842, 0x0009 },
+ { 0x0e, 0x00, -1, 0x00, 0x1842, 0x0002 },
+ { 0x0e, 0x00, -1, 0x01, 0x1842, 0x0003 },
+ { 0x0e, 0x00, -1, 0x02, 0x1842, 0x0004 },
+ { 0x0e, 0x00, -1, 0x03, 0x1842, 0x0005 },
+ { 0x0e, 0x00, -1, 0x03, 0x1842, 0x0006 },
+ { 0x0e, 0x00, -1, 0x03, 0x1842, 0x0007 },
+ { 0x0e, 0x00, -1, 0x03, 0x1842, 0x0008 },
+ { 0x0e, 0x00, -1, 0x03, 0x1842, 0x0009 },
+ { 0x18, 0x00, -1, 0x00, 0x5842, 0x0002 },
+ { 0x18, 0x00, -1, 0x01, 0x5842, 0x0003 },
+ { 0x18, 0x00, -1, 0x02, 0x5842, 0x0004 },
+ { 0x18, 0x00, -1, 0x03, 0x5842, 0x0005 },
+ { 0x18, 0x00, -1, 0x03, 0x5842, 0x0006 },
+ { 0x18, 0x00, -1, 0x03, 0x5842, 0x0007 },
+ { 0x18, 0x00, -1, 0x03, 0x5842, 0x0008 },
+ { 0x18, 0x00, -1, 0x03, 0x5842, 0x0009 },
+ { 0x02, 0x05, -1, 0x03, 0x000a, 0x0046 },
+ { 0x02, 0x05, -1, 0x03, 0x000a, 0x0066 },
+ { 0x02, 0x06, -1, 0x03, 0x000a, 0x0086 },
+ { 0x02, 0x07, -1, 0x03, 0x000a, 0x00c6 },
+ { 0x02, 0x08, -1, 0x03, 0x000a, 0x0146 },
+ { 0x02, 0x09, -1, 0x03, 0x000a, 0x0246 },
+ { 0x02, 0x0a, -1, 0x03, 0x000a, 0x0446 },
+ { 0x02, 0x18, -1, 0x03, 0x000a, 0x0846 },
+ { 0x02, 0x05, -1, 0x03, 0x000e, 0x0046 },
+ { 0x02, 0x05, -1, 0x03, 0x000e, 0x0066 },
+ { 0x02, 0x06, -1, 0x03, 0x000e, 0x0086 },
+ { 0x02, 0x07, -1, 0x03, 0x000e, 0x00c6 },
+ { 0x02, 0x08, -1, 0x03, 0x000e, 0x0146 },
+ { 0x02, 0x09, -1, 0x03, 0x000e, 0x0246 },
+ { 0x02, 0x0a, -1, 0x03, 0x000e, 0x0446 },
+ { 0x02, 0x18, -1, 0x03, 0x000e, 0x0846 },
+ { 0x03, 0x05, -1, 0x03, 0x0012, 0x0046 },
+ { 0x03, 0x05, -1, 0x03, 0x0012, 0x0066 },
+ { 0x03, 0x06, -1, 0x03, 0x0012, 0x0086 },
+ { 0x03, 0x07, -1, 0x03, 0x0012, 0x00c6 },
+ { 0x03, 0x08, -1, 0x03, 0x0012, 0x0146 },
+ { 0x03, 0x09, -1, 0x03, 0x0012, 0x0246 },
+ { 0x03, 0x0a, -1, 0x03, 0x0012, 0x0446 },
+ { 0x03, 0x18, -1, 0x03, 0x0012, 0x0846 },
+ { 0x03, 0x05, -1, 0x03, 0x001a, 0x0046 },
+ { 0x03, 0x05, -1, 0x03, 0x001a, 0x0066 },
+ { 0x03, 0x06, -1, 0x03, 0x001a, 0x0086 },
+ { 0x03, 0x07, -1, 0x03, 0x001a, 0x00c6 },
+ { 0x03, 0x08, -1, 0x03, 0x001a, 0x0146 },
+ { 0x03, 0x09, -1, 0x03, 0x001a, 0x0246 },
+ { 0x03, 0x0a, -1, 0x03, 0x001a, 0x0446 },
+ { 0x03, 0x18, -1, 0x03, 0x001a, 0x0846 },
+ { 0x04, 0x05, -1, 0x03, 0x0022, 0x0046 },
+ { 0x04, 0x05, -1, 0x03, 0x0022, 0x0066 },
+ { 0x04, 0x06, -1, 0x03, 0x0022, 0x0086 },
+ { 0x04, 0x07, -1, 0x03, 0x0022, 0x00c6 },
+ { 0x04, 0x08, -1, 0x03, 0x0022, 0x0146 },
+ { 0x04, 0x09, -1, 0x03, 0x0022, 0x0246 },
+ { 0x04, 0x0a, -1, 0x03, 0x0022, 0x0446 },
+ { 0x04, 0x18, -1, 0x03, 0x0022, 0x0846 },
+ { 0x04, 0x05, -1, 0x03, 0x0032, 0x0046 },
+ { 0x04, 0x05, -1, 0x03, 0x0032, 0x0066 },
+ { 0x04, 0x06, -1, 0x03, 0x0032, 0x0086 },
+ { 0x04, 0x07, -1, 0x03, 0x0032, 0x00c6 },
+ { 0x04, 0x08, -1, 0x03, 0x0032, 0x0146 },
+ { 0x04, 0x09, -1, 0x03, 0x0032, 0x0246 },
+ { 0x04, 0x0a, -1, 0x03, 0x0032, 0x0446 },
+ { 0x04, 0x18, -1, 0x03, 0x0032, 0x0846 },
+ { 0x05, 0x05, -1, 0x03, 0x0042, 0x0046 },
+ { 0x05, 0x05, -1, 0x03, 0x0042, 0x0066 },
+ { 0x05, 0x06, -1, 0x03, 0x0042, 0x0086 },
+ { 0x05, 0x07, -1, 0x03, 0x0042, 0x00c6 },
+ { 0x05, 0x08, -1, 0x03, 0x0042, 0x0146 },
+ { 0x05, 0x09, -1, 0x03, 0x0042, 0x0246 },
+ { 0x05, 0x0a, -1, 0x03, 0x0042, 0x0446 },
+ { 0x05, 0x18, -1, 0x03, 0x0042, 0x0846 },
+ { 0x05, 0x05, -1, 0x03, 0x0062, 0x0046 },
+ { 0x05, 0x05, -1, 0x03, 0x0062, 0x0066 },
+ { 0x05, 0x06, -1, 0x03, 0x0062, 0x0086 },
+ { 0x05, 0x07, -1, 0x03, 0x0062, 0x00c6 },
+ { 0x05, 0x08, -1, 0x03, 0x0062, 0x0146 },
+ { 0x05, 0x09, -1, 0x03, 0x0062, 0x0246 },
+ { 0x05, 0x0a, -1, 0x03, 0x0062, 0x0446 },
+ { 0x05, 0x18, -1, 0x03, 0x0062, 0x0846 },
+ { 0x06, 0x01, -1, 0x03, 0x0082, 0x000a },
+ { 0x06, 0x01, -1, 0x03, 0x0082, 0x000c },
+ { 0x06, 0x02, -1, 0x03, 0x0082, 0x000e },
+ { 0x06, 0x02, -1, 0x03, 0x0082, 0x0012 },
+ { 0x06, 0x03, -1, 0x03, 0x0082, 0x0016 },
+ { 0x06, 0x03, -1, 0x03, 0x0082, 0x001e },
+ { 0x06, 0x04, -1, 0x03, 0x0082, 0x0026 },
+ { 0x06, 0x04, -1, 0x03, 0x0082, 0x0036 },
+ { 0x07, 0x01, -1, 0x03, 0x00c2, 0x000a },
+ { 0x07, 0x01, -1, 0x03, 0x00c2, 0x000c },
+ { 0x07, 0x02, -1, 0x03, 0x00c2, 0x000e },
+ { 0x07, 0x02, -1, 0x03, 0x00c2, 0x0012 },
+ { 0x07, 0x03, -1, 0x03, 0x00c2, 0x0016 },
+ { 0x07, 0x03, -1, 0x03, 0x00c2, 0x001e },
+ { 0x07, 0x04, -1, 0x03, 0x00c2, 0x0026 },
+ { 0x07, 0x04, -1, 0x03, 0x00c2, 0x0036 },
+ { 0x08, 0x01, -1, 0x03, 0x0142, 0x000a },
+ { 0x08, 0x01, -1, 0x03, 0x0142, 0x000c },
+ { 0x08, 0x02, -1, 0x03, 0x0142, 0x000e },
+ { 0x08, 0x02, -1, 0x03, 0x0142, 0x0012 },
+ { 0x08, 0x03, -1, 0x03, 0x0142, 0x0016 },
+ { 0x08, 0x03, -1, 0x03, 0x0142, 0x001e },
+ { 0x08, 0x04, -1, 0x03, 0x0142, 0x0026 },
+ { 0x08, 0x04, -1, 0x03, 0x0142, 0x0036 },
+ { 0x09, 0x01, -1, 0x03, 0x0242, 0x000a },
+ { 0x09, 0x01, -1, 0x03, 0x0242, 0x000c },
+ { 0x09, 0x02, -1, 0x03, 0x0242, 0x000e },
+ { 0x09, 0x02, -1, 0x03, 0x0242, 0x0012 },
+ { 0x09, 0x03, -1, 0x03, 0x0242, 0x0016 },
+ { 0x09, 0x03, -1, 0x03, 0x0242, 0x001e },
+ { 0x09, 0x04, -1, 0x03, 0x0242, 0x0026 },
+ { 0x09, 0x04, -1, 0x03, 0x0242, 0x0036 },
+ { 0x0a, 0x01, -1, 0x03, 0x0442, 0x000a },
+ { 0x0a, 0x01, -1, 0x03, 0x0442, 0x000c },
+ { 0x0a, 0x02, -1, 0x03, 0x0442, 0x000e },
+ { 0x0a, 0x02, -1, 0x03, 0x0442, 0x0012 },
+ { 0x0a, 0x03, -1, 0x03, 0x0442, 0x0016 },
+ { 0x0a, 0x03, -1, 0x03, 0x0442, 0x001e },
+ { 0x0a, 0x04, -1, 0x03, 0x0442, 0x0026 },
+ { 0x0a, 0x04, -1, 0x03, 0x0442, 0x0036 },
+ { 0x0c, 0x01, -1, 0x03, 0x0842, 0x000a },
+ { 0x0c, 0x01, -1, 0x03, 0x0842, 0x000c },
+ { 0x0c, 0x02, -1, 0x03, 0x0842, 0x000e },
+ { 0x0c, 0x02, -1, 0x03, 0x0842, 0x0012 },
+ { 0x0c, 0x03, -1, 0x03, 0x0842, 0x0016 },
+ { 0x0c, 0x03, -1, 0x03, 0x0842, 0x001e },
+ { 0x0c, 0x04, -1, 0x03, 0x0842, 0x0026 },
+ { 0x0c, 0x04, -1, 0x03, 0x0842, 0x0036 },
+ { 0x0e, 0x01, -1, 0x03, 0x1842, 0x000a },
+ { 0x0e, 0x01, -1, 0x03, 0x1842, 0x000c },
+ { 0x0e, 0x02, -1, 0x03, 0x1842, 0x000e },
+ { 0x0e, 0x02, -1, 0x03, 0x1842, 0x0012 },
+ { 0x0e, 0x03, -1, 0x03, 0x1842, 0x0016 },
+ { 0x0e, 0x03, -1, 0x03, 0x1842, 0x001e },
+ { 0x0e, 0x04, -1, 0x03, 0x1842, 0x0026 },
+ { 0x0e, 0x04, -1, 0x03, 0x1842, 0x0036 },
+ { 0x18, 0x01, -1, 0x03, 0x5842, 0x000a },
+ { 0x18, 0x01, -1, 0x03, 0x5842, 0x000c },
+ { 0x18, 0x02, -1, 0x03, 0x5842, 0x000e },
+ { 0x18, 0x02, -1, 0x03, 0x5842, 0x0012 },
+ { 0x18, 0x03, -1, 0x03, 0x5842, 0x0016 },
+ { 0x18, 0x03, -1, 0x03, 0x5842, 0x001e },
+ { 0x18, 0x04, -1, 0x03, 0x5842, 0x0026 },
+ { 0x18, 0x04, -1, 0x03, 0x5842, 0x0036 },
+ { 0x06, 0x05, -1, 0x03, 0x0082, 0x0046 },
+ { 0x06, 0x05, -1, 0x03, 0x0082, 0x0066 },
+ { 0x06, 0x06, -1, 0x03, 0x0082, 0x0086 },
+ { 0x06, 0x07, -1, 0x03, 0x0082, 0x00c6 },
+ { 0x06, 0x08, -1, 0x03, 0x0082, 0x0146 },
+ { 0x06, 0x09, -1, 0x03, 0x0082, 0x0246 },
+ { 0x06, 0x0a, -1, 0x03, 0x0082, 0x0446 },
+ { 0x06, 0x18, -1, 0x03, 0x0082, 0x0846 },
+ { 0x07, 0x05, -1, 0x03, 0x00c2, 0x0046 },
+ { 0x07, 0x05, -1, 0x03, 0x00c2, 0x0066 },
+ { 0x07, 0x06, -1, 0x03, 0x00c2, 0x0086 },
+ { 0x07, 0x07, -1, 0x03, 0x00c2, 0x00c6 },
+ { 0x07, 0x08, -1, 0x03, 0x00c2, 0x0146 },
+ { 0x07, 0x09, -1, 0x03, 0x00c2, 0x0246 },
+ { 0x07, 0x0a, -1, 0x03, 0x00c2, 0x0446 },
+ { 0x07, 0x18, -1, 0x03, 0x00c2, 0x0846 },
+ { 0x08, 0x05, -1, 0x03, 0x0142, 0x0046 },
+ { 0x08, 0x05, -1, 0x03, 0x0142, 0x0066 },
+ { 0x08, 0x06, -1, 0x03, 0x0142, 0x0086 },
+ { 0x08, 0x07, -1, 0x03, 0x0142, 0x00c6 },
+ { 0x08, 0x08, -1, 0x03, 0x0142, 0x0146 },
+ { 0x08, 0x09, -1, 0x03, 0x0142, 0x0246 },
+ { 0x08, 0x0a, -1, 0x03, 0x0142, 0x0446 },
+ { 0x08, 0x18, -1, 0x03, 0x0142, 0x0846 },
+ { 0x09, 0x05, -1, 0x03, 0x0242, 0x0046 },
+ { 0x09, 0x05, -1, 0x03, 0x0242, 0x0066 },
+ { 0x09, 0x06, -1, 0x03, 0x0242, 0x0086 },
+ { 0x09, 0x07, -1, 0x03, 0x0242, 0x00c6 },
+ { 0x09, 0x08, -1, 0x03, 0x0242, 0x0146 },
+ { 0x09, 0x09, -1, 0x03, 0x0242, 0x0246 },
+ { 0x09, 0x0a, -1, 0x03, 0x0242, 0x0446 },
+ { 0x09, 0x18, -1, 0x03, 0x0242, 0x0846 },
+ { 0x0a, 0x05, -1, 0x03, 0x0442, 0x0046 },
+ { 0x0a, 0x05, -1, 0x03, 0x0442, 0x0066 },
+ { 0x0a, 0x06, -1, 0x03, 0x0442, 0x0086 },
+ { 0x0a, 0x07, -1, 0x03, 0x0442, 0x00c6 },
+ { 0x0a, 0x08, -1, 0x03, 0x0442, 0x0146 },
+ { 0x0a, 0x09, -1, 0x03, 0x0442, 0x0246 },
+ { 0x0a, 0x0a, -1, 0x03, 0x0442, 0x0446 },
+ { 0x0a, 0x18, -1, 0x03, 0x0442, 0x0846 },
+ { 0x0c, 0x05, -1, 0x03, 0x0842, 0x0046 },
+ { 0x0c, 0x05, -1, 0x03, 0x0842, 0x0066 },
+ { 0x0c, 0x06, -1, 0x03, 0x0842, 0x0086 },
+ { 0x0c, 0x07, -1, 0x03, 0x0842, 0x00c6 },
+ { 0x0c, 0x08, -1, 0x03, 0x0842, 0x0146 },
+ { 0x0c, 0x09, -1, 0x03, 0x0842, 0x0246 },
+ { 0x0c, 0x0a, -1, 0x03, 0x0842, 0x0446 },
+ { 0x0c, 0x18, -1, 0x03, 0x0842, 0x0846 },
+ { 0x0e, 0x05, -1, 0x03, 0x1842, 0x0046 },
+ { 0x0e, 0x05, -1, 0x03, 0x1842, 0x0066 },
+ { 0x0e, 0x06, -1, 0x03, 0x1842, 0x0086 },
+ { 0x0e, 0x07, -1, 0x03, 0x1842, 0x00c6 },
+ { 0x0e, 0x08, -1, 0x03, 0x1842, 0x0146 },
+ { 0x0e, 0x09, -1, 0x03, 0x1842, 0x0246 },
+ { 0x0e, 0x0a, -1, 0x03, 0x1842, 0x0446 },
+ { 0x0e, 0x18, -1, 0x03, 0x1842, 0x0846 },
+ { 0x18, 0x05, -1, 0x03, 0x5842, 0x0046 },
+ { 0x18, 0x05, -1, 0x03, 0x5842, 0x0066 },
+ { 0x18, 0x06, -1, 0x03, 0x5842, 0x0086 },
+ { 0x18, 0x07, -1, 0x03, 0x5842, 0x00c6 },
+ { 0x18, 0x08, -1, 0x03, 0x5842, 0x0146 },
+ { 0x18, 0x09, -1, 0x03, 0x5842, 0x0246 },
+ { 0x18, 0x0a, -1, 0x03, 0x5842, 0x0446 },
+ { 0x18, 0x18, -1, 0x03, 0x5842, 0x0846 },
+};
+
+#endif /* BROTLI_DEC_PREFIX_H_ */
diff --git a/contrib/libs/brotli/dec/state.c b/contrib/libs/brotli/dec/state.c
index e0b37c2dcd..aebdee19c4 100644
--- a/contrib/libs/brotli/dec/state.c
+++ b/contrib/libs/brotli/dec/state.c
@@ -1,20 +1,20 @@
-/* Copyright 2015 Google Inc. All Rights Reserved.
-
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
-
+
#include "./state.h"
-
+
#include <stdlib.h> /* free, malloc */
-
+
#include <brotli/types.h>
-#include "./huffman.h"
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
+#include "./huffman.h"
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
BROTLI_BOOL BrotliDecoderStateInit(BrotliDecoderState* s,
brotli_alloc_func alloc_func, brotli_free_func free_func, void* opaque) {
if (!alloc_func) {
@@ -30,101 +30,101 @@ BROTLI_BOOL BrotliDecoderStateInit(BrotliDecoderState* s,
s->error_code = 0; /* BROTLI_DECODER_NO_ERROR */
BrotliInitBitReader(&s->br);
- s->state = BROTLI_STATE_UNINITED;
+ s->state = BROTLI_STATE_UNINITED;
s->large_window = 0;
- s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NONE;
- s->substate_tree_group = BROTLI_STATE_TREE_GROUP_NONE;
- s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_NONE;
- s->substate_uncompressed = BROTLI_STATE_UNCOMPRESSED_NONE;
- s->substate_huffman = BROTLI_STATE_HUFFMAN_NONE;
- s->substate_decode_uint8 = BROTLI_STATE_DECODE_UINT8_NONE;
+ s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NONE;
+ s->substate_tree_group = BROTLI_STATE_TREE_GROUP_NONE;
+ s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_NONE;
+ s->substate_uncompressed = BROTLI_STATE_UNCOMPRESSED_NONE;
+ s->substate_huffman = BROTLI_STATE_HUFFMAN_NONE;
+ s->substate_decode_uint8 = BROTLI_STATE_DECODE_UINT8_NONE;
s->substate_read_block_length = BROTLI_STATE_READ_BLOCK_LENGTH_NONE;
-
+
s->buffer_length = 0;
s->loop_counter = 0;
s->pos = 0;
s->rb_roundtrips = 0;
s->partial_pos_out = 0;
- s->block_type_trees = NULL;
- s->block_len_trees = NULL;
- s->ringbuffer = NULL;
+ s->block_type_trees = NULL;
+ s->block_len_trees = NULL;
+ s->ringbuffer = NULL;
s->ringbuffer_size = 0;
s->new_ringbuffer_size = 0;
s->ringbuffer_mask = 0;
-
- s->context_map = NULL;
- s->context_modes = NULL;
- s->dist_context_map = NULL;
- s->context_map_slice = NULL;
- s->dist_context_map_slice = NULL;
-
+
+ s->context_map = NULL;
+ s->context_modes = NULL;
+ s->dist_context_map = NULL;
+ s->context_map_slice = NULL;
+ s->dist_context_map_slice = NULL;
+
s->sub_loop_counter = 0;
- s->literal_hgroup.codes = NULL;
- s->literal_hgroup.htrees = NULL;
- s->insert_copy_hgroup.codes = NULL;
- s->insert_copy_hgroup.htrees = NULL;
- s->distance_hgroup.codes = NULL;
- s->distance_hgroup.htrees = NULL;
-
+ s->literal_hgroup.codes = NULL;
+ s->literal_hgroup.htrees = NULL;
+ s->insert_copy_hgroup.codes = NULL;
+ s->insert_copy_hgroup.htrees = NULL;
+ s->distance_hgroup.codes = NULL;
+ s->distance_hgroup.htrees = NULL;
+
s->is_last_metablock = 0;
s->is_uncompressed = 0;
s->is_metadata = 0;
s->should_wrap_ringbuffer = 0;
s->canny_ringbuffer_allocation = 1;
-
- s->window_bits = 0;
- s->max_distance = 0;
- s->dist_rb[0] = 16;
- s->dist_rb[1] = 15;
- s->dist_rb[2] = 11;
- s->dist_rb[3] = 4;
- s->dist_rb_idx = 0;
- s->block_type_trees = NULL;
- s->block_len_trees = NULL;
-
- /* Make small negative indexes addressable. */
- s->symbol_lists = &s->symbols_lists_array[BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1];
-
+
+ s->window_bits = 0;
+ s->max_distance = 0;
+ s->dist_rb[0] = 16;
+ s->dist_rb[1] = 15;
+ s->dist_rb[2] = 11;
+ s->dist_rb[3] = 4;
+ s->dist_rb_idx = 0;
+ s->block_type_trees = NULL;
+ s->block_len_trees = NULL;
+
+ /* Make small negative indexes addressable. */
+ s->symbol_lists = &s->symbols_lists_array[BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1];
+
s->mtf_upper_bound = 63;
s->dictionary = BrotliGetDictionary();
s->transforms = BrotliGetTransforms();
return BROTLI_TRUE;
-}
-
+}
+
void BrotliDecoderStateMetablockBegin(BrotliDecoderState* s) {
- s->meta_block_remaining_len = 0;
+ s->meta_block_remaining_len = 0;
s->block_length[0] = 1U << 24;
s->block_length[1] = 1U << 24;
s->block_length[2] = 1U << 24;
- s->num_block_types[0] = 1;
- s->num_block_types[1] = 1;
- s->num_block_types[2] = 1;
- s->block_type_rb[0] = 1;
- s->block_type_rb[1] = 0;
- s->block_type_rb[2] = 1;
- s->block_type_rb[3] = 0;
- s->block_type_rb[4] = 1;
- s->block_type_rb[5] = 0;
- s->context_map = NULL;
- s->context_modes = NULL;
- s->dist_context_map = NULL;
- s->context_map_slice = NULL;
- s->literal_htree = NULL;
- s->dist_context_map_slice = NULL;
- s->dist_htree_index = 0;
+ s->num_block_types[0] = 1;
+ s->num_block_types[1] = 1;
+ s->num_block_types[2] = 1;
+ s->block_type_rb[0] = 1;
+ s->block_type_rb[1] = 0;
+ s->block_type_rb[2] = 1;
+ s->block_type_rb[3] = 0;
+ s->block_type_rb[4] = 1;
+ s->block_type_rb[5] = 0;
+ s->context_map = NULL;
+ s->context_modes = NULL;
+ s->dist_context_map = NULL;
+ s->context_map_slice = NULL;
+ s->literal_htree = NULL;
+ s->dist_context_map_slice = NULL;
+ s->dist_htree_index = 0;
s->context_lookup = NULL;
- s->literal_hgroup.codes = NULL;
- s->literal_hgroup.htrees = NULL;
- s->insert_copy_hgroup.codes = NULL;
- s->insert_copy_hgroup.htrees = NULL;
- s->distance_hgroup.codes = NULL;
- s->distance_hgroup.htrees = NULL;
-}
-
+ s->literal_hgroup.codes = NULL;
+ s->literal_hgroup.htrees = NULL;
+ s->insert_copy_hgroup.codes = NULL;
+ s->insert_copy_hgroup.htrees = NULL;
+ s->distance_hgroup.codes = NULL;
+ s->distance_hgroup.htrees = NULL;
+}
+
void BrotliDecoderStateCleanupAfterMetablock(BrotliDecoderState* s) {
BROTLI_DECODER_FREE(s, s->context_modes);
BROTLI_DECODER_FREE(s, s->context_map);
@@ -132,15 +132,15 @@ void BrotliDecoderStateCleanupAfterMetablock(BrotliDecoderState* s) {
BROTLI_DECODER_FREE(s, s->literal_hgroup.htrees);
BROTLI_DECODER_FREE(s, s->insert_copy_hgroup.htrees);
BROTLI_DECODER_FREE(s, s->distance_hgroup.htrees);
-}
-
+}
+
void BrotliDecoderStateCleanup(BrotliDecoderState* s) {
BrotliDecoderStateCleanupAfterMetablock(s);
-
+
BROTLI_DECODER_FREE(s, s->ringbuffer);
BROTLI_DECODER_FREE(s, s->block_type_trees);
-}
-
+}
+
BROTLI_BOOL BrotliDecoderHuffmanTreeGroupInit(BrotliDecoderState* s,
HuffmanTreeGroup* group, uint32_t alphabet_size, uint32_t max_symbol,
uint32_t ntrees) {
@@ -159,6 +159,6 @@ BROTLI_BOOL BrotliDecoderHuffmanTreeGroupInit(BrotliDecoderState* s,
return !!p;
}
-#if defined(__cplusplus) || defined(c_plusplus)
+#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
-#endif
+#endif
diff --git a/contrib/libs/brotli/dec/state.h b/contrib/libs/brotli/dec/state.h
index d28b63920e..b21553ee72 100644
--- a/contrib/libs/brotli/dec/state.h
+++ b/contrib/libs/brotli/dec/state.h
@@ -1,110 +1,110 @@
-/* Copyright 2015 Google Inc. All Rights Reserved.
-
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
-*/
-
-/* Brotli state for partial streaming decoding. */
-
-#ifndef BROTLI_DEC_STATE_H_
-#define BROTLI_DEC_STATE_H_
-
+*/
+
+/* Brotli state for partial streaming decoding. */
+
+#ifndef BROTLI_DEC_STATE_H_
+#define BROTLI_DEC_STATE_H_
+
#include "../common/constants.h"
#include "../common/dictionary.h"
#include "../common/platform.h"
#include "../common/transform.h"
#include <brotli/types.h>
-#include "./bit_reader.h"
-#include "./huffman.h"
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-typedef enum {
- BROTLI_STATE_UNINITED,
+#include "./bit_reader.h"
+#include "./huffman.h"
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+typedef enum {
+ BROTLI_STATE_UNINITED,
BROTLI_STATE_LARGE_WINDOW_BITS,
BROTLI_STATE_INITIALIZE,
- BROTLI_STATE_METABLOCK_BEGIN,
- BROTLI_STATE_METABLOCK_HEADER,
+ BROTLI_STATE_METABLOCK_BEGIN,
+ BROTLI_STATE_METABLOCK_HEADER,
BROTLI_STATE_METABLOCK_HEADER_2,
- BROTLI_STATE_CONTEXT_MODES,
- BROTLI_STATE_COMMAND_BEGIN,
- BROTLI_STATE_COMMAND_INNER,
+ BROTLI_STATE_CONTEXT_MODES,
+ BROTLI_STATE_COMMAND_BEGIN,
+ BROTLI_STATE_COMMAND_INNER,
BROTLI_STATE_COMMAND_POST_DECODE_LITERALS,
BROTLI_STATE_COMMAND_POST_WRAP_COPY,
- BROTLI_STATE_UNCOMPRESSED,
- BROTLI_STATE_METADATA,
- BROTLI_STATE_COMMAND_INNER_WRITE,
- BROTLI_STATE_METABLOCK_DONE,
- BROTLI_STATE_COMMAND_POST_WRITE_1,
- BROTLI_STATE_COMMAND_POST_WRITE_2,
- BROTLI_STATE_HUFFMAN_CODE_0,
- BROTLI_STATE_HUFFMAN_CODE_1,
- BROTLI_STATE_HUFFMAN_CODE_2,
- BROTLI_STATE_HUFFMAN_CODE_3,
- BROTLI_STATE_CONTEXT_MAP_1,
- BROTLI_STATE_CONTEXT_MAP_2,
- BROTLI_STATE_TREE_GROUP,
- BROTLI_STATE_DONE
-} BrotliRunningState;
-
-typedef enum {
- BROTLI_STATE_METABLOCK_HEADER_NONE,
- BROTLI_STATE_METABLOCK_HEADER_EMPTY,
- BROTLI_STATE_METABLOCK_HEADER_NIBBLES,
- BROTLI_STATE_METABLOCK_HEADER_SIZE,
- BROTLI_STATE_METABLOCK_HEADER_UNCOMPRESSED,
- BROTLI_STATE_METABLOCK_HEADER_RESERVED,
- BROTLI_STATE_METABLOCK_HEADER_BYTES,
- BROTLI_STATE_METABLOCK_HEADER_METADATA
-} BrotliRunningMetablockHeaderState;
-
-typedef enum {
- BROTLI_STATE_UNCOMPRESSED_NONE,
+ BROTLI_STATE_UNCOMPRESSED,
+ BROTLI_STATE_METADATA,
+ BROTLI_STATE_COMMAND_INNER_WRITE,
+ BROTLI_STATE_METABLOCK_DONE,
+ BROTLI_STATE_COMMAND_POST_WRITE_1,
+ BROTLI_STATE_COMMAND_POST_WRITE_2,
+ BROTLI_STATE_HUFFMAN_CODE_0,
+ BROTLI_STATE_HUFFMAN_CODE_1,
+ BROTLI_STATE_HUFFMAN_CODE_2,
+ BROTLI_STATE_HUFFMAN_CODE_3,
+ BROTLI_STATE_CONTEXT_MAP_1,
+ BROTLI_STATE_CONTEXT_MAP_2,
+ BROTLI_STATE_TREE_GROUP,
+ BROTLI_STATE_DONE
+} BrotliRunningState;
+
+typedef enum {
+ BROTLI_STATE_METABLOCK_HEADER_NONE,
+ BROTLI_STATE_METABLOCK_HEADER_EMPTY,
+ BROTLI_STATE_METABLOCK_HEADER_NIBBLES,
+ BROTLI_STATE_METABLOCK_HEADER_SIZE,
+ BROTLI_STATE_METABLOCK_HEADER_UNCOMPRESSED,
+ BROTLI_STATE_METABLOCK_HEADER_RESERVED,
+ BROTLI_STATE_METABLOCK_HEADER_BYTES,
+ BROTLI_STATE_METABLOCK_HEADER_METADATA
+} BrotliRunningMetablockHeaderState;
+
+typedef enum {
+ BROTLI_STATE_UNCOMPRESSED_NONE,
BROTLI_STATE_UNCOMPRESSED_WRITE
-} BrotliRunningUncompressedState;
-
-typedef enum {
- BROTLI_STATE_TREE_GROUP_NONE,
- BROTLI_STATE_TREE_GROUP_LOOP
-} BrotliRunningTreeGroupState;
-
-typedef enum {
- BROTLI_STATE_CONTEXT_MAP_NONE,
- BROTLI_STATE_CONTEXT_MAP_READ_PREFIX,
- BROTLI_STATE_CONTEXT_MAP_HUFFMAN,
+} BrotliRunningUncompressedState;
+
+typedef enum {
+ BROTLI_STATE_TREE_GROUP_NONE,
+ BROTLI_STATE_TREE_GROUP_LOOP
+} BrotliRunningTreeGroupState;
+
+typedef enum {
+ BROTLI_STATE_CONTEXT_MAP_NONE,
+ BROTLI_STATE_CONTEXT_MAP_READ_PREFIX,
+ BROTLI_STATE_CONTEXT_MAP_HUFFMAN,
BROTLI_STATE_CONTEXT_MAP_DECODE,
BROTLI_STATE_CONTEXT_MAP_TRANSFORM
-} BrotliRunningContextMapState;
-
-typedef enum {
- BROTLI_STATE_HUFFMAN_NONE,
+} BrotliRunningContextMapState;
+
+typedef enum {
+ BROTLI_STATE_HUFFMAN_NONE,
BROTLI_STATE_HUFFMAN_SIMPLE_SIZE,
BROTLI_STATE_HUFFMAN_SIMPLE_READ,
BROTLI_STATE_HUFFMAN_SIMPLE_BUILD,
BROTLI_STATE_HUFFMAN_COMPLEX,
- BROTLI_STATE_HUFFMAN_LENGTH_SYMBOLS
-} BrotliRunningHuffmanState;
-
-typedef enum {
- BROTLI_STATE_DECODE_UINT8_NONE,
- BROTLI_STATE_DECODE_UINT8_SHORT,
- BROTLI_STATE_DECODE_UINT8_LONG
-} BrotliRunningDecodeUint8State;
-
+ BROTLI_STATE_HUFFMAN_LENGTH_SYMBOLS
+} BrotliRunningHuffmanState;
+
+typedef enum {
+ BROTLI_STATE_DECODE_UINT8_NONE,
+ BROTLI_STATE_DECODE_UINT8_SHORT,
+ BROTLI_STATE_DECODE_UINT8_LONG
+} BrotliRunningDecodeUint8State;
+
typedef enum {
BROTLI_STATE_READ_BLOCK_LENGTH_NONE,
BROTLI_STATE_READ_BLOCK_LENGTH_SUFFIX
} BrotliRunningReadBlockLengthState;
struct BrotliDecoderStateStruct {
- BrotliRunningState state;
+ BrotliRunningState state;
- /* This counter is reused for several disjoint loops. */
+ /* This counter is reused for several disjoint loops. */
int loop_counter;
- BrotliBitReader br;
+ BrotliBitReader br;
brotli_alloc_func alloc_func;
brotli_free_func free_func;
@@ -117,99 +117,99 @@ struct BrotliDecoderStateStruct {
} buffer;
uint32_t buffer_length;
- int pos;
- int max_backward_distance;
- int max_distance;
- int ringbuffer_size;
- int ringbuffer_mask;
- int dist_rb_idx;
- int dist_rb[4];
+ int pos;
+ int max_backward_distance;
+ int max_distance;
+ int ringbuffer_size;
+ int ringbuffer_mask;
+ int dist_rb_idx;
+ int dist_rb[4];
int error_code;
uint32_t sub_loop_counter;
- uint8_t* ringbuffer;
- uint8_t* ringbuffer_end;
- HuffmanCode* htree_command;
+ uint8_t* ringbuffer;
+ uint8_t* ringbuffer_end;
+ HuffmanCode* htree_command;
const uint8_t* context_lookup;
- uint8_t* context_map_slice;
- uint8_t* dist_context_map_slice;
-
+ uint8_t* context_map_slice;
+ uint8_t* dist_context_map_slice;
+
/* This ring buffer holds a few past copy distances that will be used by
some special distance codes. */
- HuffmanTreeGroup literal_hgroup;
- HuffmanTreeGroup insert_copy_hgroup;
- HuffmanTreeGroup distance_hgroup;
- HuffmanCode* block_type_trees;
- HuffmanCode* block_len_trees;
- /* This is true if the literal context map histogram type always matches the
+ HuffmanTreeGroup literal_hgroup;
+ HuffmanTreeGroup insert_copy_hgroup;
+ HuffmanTreeGroup distance_hgroup;
+ HuffmanCode* block_type_trees;
+ HuffmanCode* block_len_trees;
+ /* This is true if the literal context map histogram type always matches the
block type. It is then not needed to keep the context (faster decoding). */
- int trivial_literal_context;
+ int trivial_literal_context;
/* Distance context is actual after command is decoded and before distance is
computed. After distance computation it is used as a temporary variable. */
- int distance_context;
- int meta_block_remaining_len;
+ int distance_context;
+ int meta_block_remaining_len;
uint32_t block_length_index;
uint32_t block_length[3];
uint32_t num_block_types[3];
uint32_t block_type_rb[6];
uint32_t distance_postfix_bits;
uint32_t num_direct_distance_codes;
- int distance_postfix_mask;
+ int distance_postfix_mask;
uint32_t num_dist_htrees;
- uint8_t* dist_context_map;
+ uint8_t* dist_context_map;
HuffmanCode* literal_htree;
- uint8_t dist_htree_index;
+ uint8_t dist_htree_index;
uint32_t repeat_code_len;
uint32_t prev_code_len;
-
- int copy_length;
- int distance_code;
-
+
+ int copy_length;
+ int distance_code;
+
/* For partial write operations. */
size_t rb_roundtrips; /* how many times we went around the ring-buffer */
size_t partial_pos_out; /* how much output to the user in total */
-
+
/* For ReadHuffmanCode. */
- uint32_t symbol;
- uint32_t repeat;
- uint32_t space;
-
- HuffmanCode table[32];
+ uint32_t symbol;
+ uint32_t repeat;
+ uint32_t space;
+
+ HuffmanCode table[32];
/* List of heads of symbol chains. */
- uint16_t* symbol_lists;
- /* Storage from symbol_lists. */
- uint16_t symbols_lists_array[BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1 +
+ uint16_t* symbol_lists;
+ /* Storage from symbol_lists. */
+ uint16_t symbols_lists_array[BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1 +
BROTLI_NUM_COMMAND_SYMBOLS];
- /* Tails of symbol chains. */
- int next_symbol[32];
+ /* Tails of symbol chains. */
+ int next_symbol[32];
uint8_t code_length_code_lengths[BROTLI_CODE_LENGTH_CODES];
/* Population counts for the code lengths. */
- uint16_t code_length_histo[16];
-
+ uint16_t code_length_histo[16];
+
/* For HuffmanTreeGroupDecode. */
- int htree_index;
- HuffmanCode* next;
-
+ int htree_index;
+ HuffmanCode* next;
+
/* For DecodeContextMap. */
uint32_t context_index;
uint32_t max_run_length_prefix;
uint32_t code;
HuffmanCode context_map_table[BROTLI_HUFFMAN_MAX_SIZE_272];
-
+
/* For InverseMoveToFrontTransform. */
uint32_t mtf_upper_bound;
uint32_t mtf[64 + 1];
-
+
/* Less used attributes are at the end of this struct. */
/* States inside function calls. */
- BrotliRunningMetablockHeaderState substate_metablock_header;
- BrotliRunningTreeGroupState substate_tree_group;
- BrotliRunningContextMapState substate_context_map;
- BrotliRunningUncompressedState substate_uncompressed;
- BrotliRunningHuffmanState substate_huffman;
- BrotliRunningDecodeUint8State substate_decode_uint8;
+ BrotliRunningMetablockHeaderState substate_metablock_header;
+ BrotliRunningTreeGroupState substate_tree_group;
+ BrotliRunningContextMapState substate_context_map;
+ BrotliRunningUncompressedState substate_uncompressed;
+ BrotliRunningHuffmanState substate_huffman;
+ BrotliRunningDecodeUint8State substate_decode_uint8;
BrotliRunningReadBlockLengthState substate_read_block_length;
-
+
unsigned int is_last_metablock : 1;
unsigned int is_uncompressed : 1;
unsigned int is_metadata : 1;
@@ -217,20 +217,20 @@ struct BrotliDecoderStateStruct {
unsigned int canny_ringbuffer_allocation : 1;
unsigned int large_window : 1;
unsigned int size_nibbles : 8;
- uint32_t window_bits;
-
+ uint32_t window_bits;
+
int new_ringbuffer_size;
-
+
uint32_t num_literal_htrees;
- uint8_t* context_map;
- uint8_t* context_modes;
+ uint8_t* context_map;
+ uint8_t* context_modes;
const BrotliDictionary* dictionary;
const BrotliTransforms* transforms;
-
+
uint32_t trivial_literal_contexts[8]; /* 256 bits */
};
-
+
typedef struct BrotliDecoderStateStruct BrotliDecoderStateInternal;
#define BrotliDecoderState BrotliDecoderStateInternal
@@ -251,8 +251,8 @@ BROTLI_INTERNAL BROTLI_BOOL BrotliDecoderHuffmanTreeGroupInit(
X = NULL; \
}
-#if defined(__cplusplus) || defined(c_plusplus)
+#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
-#endif
-
-#endif /* BROTLI_DEC_STATE_H_ */
+#endif
+
+#endif /* BROTLI_DEC_STATE_H_ */
diff --git a/contrib/libs/brotli/dec/ya.make b/contrib/libs/brotli/dec/ya.make
index 0f482f36ed..c510ee5a5d 100644
--- a/contrib/libs/brotli/dec/ya.make
+++ b/contrib/libs/brotli/dec/ya.make
@@ -1,6 +1,6 @@
-LIBRARY()
-
-LICENSE(MIT)
+LIBRARY()
+
+LICENSE(MIT)
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
@@ -9,22 +9,22 @@ OWNER(
g:contrib
g:cpp-contrib
)
+
+NO_UTIL()
-NO_UTIL()
-
-NO_COMPILER_WARNINGS()
-
+NO_COMPILER_WARNINGS()
+
ADDINCL(GLOBAL contrib/libs/brotli/include)
PEERDIR(
contrib/libs/brotli/common
)
-SRCS(
- bit_reader.c
- decode.c
- huffman.c
- state.c
-)
-
-END()
+SRCS(
+ bit_reader.c
+ decode.c
+ huffman.c
+ state.c
+)
+
+END()