X7ROOT File Manager
Current Path:
/opt/alt/tests/alt-php80-pecl-brotli_0.18.3-2.el8/brotli/c/enc
opt
/
alt
/
tests
/
alt-php80-pecl-brotli_0.18.3-2.el8
/
brotli
/
c
/
enc
/
??
..
??
.libs
??
backward_references.c
(6.13 KB)
??
backward_references.h
(1.18 KB)
??
backward_references.lo
(303 B)
??
backward_references_hq.c
(35.88 KB)
??
backward_references_hq.h
(3.68 KB)
??
backward_references_hq.lo
(309 B)
??
backward_references_inc.h
(7.99 KB)
??
bit_cost.c
(1.39 KB)
??
bit_cost.h
(896 B)
??
bit_cost.lo
(281 B)
??
bit_cost_inc.h
(4.02 KB)
??
block_encoder_inc.h
(1.11 KB)
??
block_splitter.c
(7.16 KB)
??
block_splitter.h
(1.59 KB)
??
block_splitter.lo
(293 B)
??
block_splitter_inc.h
(18.44 KB)
??
brotli_bit_stream.c
(49.72 KB)
??
brotli_bit_stream.h
(3.26 KB)
??
brotli_bit_stream.lo
(299 B)
??
cluster.c
(1.42 KB)
??
cluster.h
(997 B)
??
cluster.lo
(279 B)
??
cluster_inc.h
(11.55 KB)
??
command.c
(1 KB)
??
command.h
(6.77 KB)
??
command.lo
(279 B)
??
compound_dictionary.c
(6.5 KB)
??
compound_dictionary.h
(2.38 KB)
??
compound_dictionary.lo
(303 B)
??
compress_fragment.c
(32.1 KB)
??
compress_fragment.h
(3.49 KB)
??
compress_fragment.lo
(299 B)
??
compress_fragment_two_pass.c
(26.18 KB)
??
compress_fragment_two_pass.h
(2.79 KB)
??
compress_fragment_two_pass.lo
(317 B)
??
dictionary_hash.c
(7.75 KB)
??
dictionary_hash.h
(1.5 KB)
??
dictionary_hash.lo
(295 B)
??
dictionary_hash_inc.h
(143.28 KB)
??
encode.c
(76.58 KB)
??
encode.lo
(277 B)
??
encoder_dict.c
(22.83 KB)
??
encoder_dict.h
(4.9 KB)
??
encoder_dict.lo
(289 B)
??
entropy_encode.c
(14.23 KB)
??
entropy_encode.h
(3.96 KB)
??
entropy_encode.lo
(293 B)
??
entropy_encode_static.h
(32.37 KB)
??
fast_log.c
(5.9 KB)
??
fast_log.h
(1.61 KB)
??
fast_log.lo
(281 B)
??
find_match_length.h
(2.12 KB)
??
hash.h
(23.73 KB)
??
hash_base.h
(1.34 KB)
??
hash_composite_inc.h
(4.98 KB)
??
hash_forgetful_chain_inc.h
(11.05 KB)
??
hash_longest_match64_inc.h
(10.41 KB)
??
hash_longest_match64_simd_inc.h
(11.56 KB)
??
hash_longest_match_inc.h
(10.34 KB)
??
hash_longest_match_quickly_inc.h
(9.26 KB)
??
hash_longest_match_simd_inc.h
(11.48 KB)
??
hash_rolling_inc.h
(7.06 KB)
??
hash_to_binary_tree_inc.h
(12.77 KB)
??
histogram.c
(3.18 KB)
??
histogram.h
(1.77 KB)
??
histogram.lo
(283 B)
??
histogram_inc.h
(1.37 KB)
??
literal_cost.c
(5.74 KB)
??
literal_cost.h
(889 B)
??
literal_cost.lo
(289 B)
??
matching_tag_mask.h
(2.29 KB)
??
memory.c
(5.39 KB)
??
memory.h
(4.2 KB)
??
memory.lo
(277 B)
??
metablock.c
(26.07 KB)
??
metablock.h
(3.93 KB)
??
metablock.lo
(283 B)
??
metablock_inc.h
(7.46 KB)
??
params.h
(1.14 KB)
??
prefix.h
(1.9 KB)
??
quality.h
(7.68 KB)
??
ringbuffer.h
(5.83 KB)
??
state.h
(3.01 KB)
??
static_dict.c
(20.39 KB)
??
static_dict.h
(1.19 KB)
??
static_dict.lo
(287 B)
??
static_dict_lut.c
(7.25 KB)
??
static_dict_lut.h
(1.55 KB)
??
static_dict_lut.lo
(295 B)
??
static_dict_lut_inc.h
(457.82 KB)
??
static_init.c
(1.74 KB)
??
static_init.h
(840 B)
??
static_init.lo
(287 B)
??
utf8_util.c
(2.22 KB)
??
utf8_util.h
(878 B)
??
utf8_util.lo
(283 B)
??
write_bits.h
(2.77 KB)
Editing: static_dict_lut.c
/* Copyright 2025 Google Inc. All Rights Reserved. Distributed under MIT license. See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ /* Lookup table for static dictionary and transforms. */ #include "static_dict_lut.h" #include "../common/platform.h" /* IWYU pragma: keep */ #include "../common/static_init.h" #if (BROTLI_STATIC_INIT != BROTLI_STATIC_INIT_NONE) #include "../common/dictionary.h" #include "../common/transform.h" #include "hash_base.h" #endif #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #if (BROTLI_STATIC_INIT != BROTLI_STATIC_INIT_NONE) /* TODO(eustas): deal with largest bucket(s). Not it contains 163 items. */ static BROTLI_BOOL BROTLI_COLD DoBrotliEncoderInitStaticDictionaryLut( const BrotliDictionary* dict, uint16_t* buckets, DictWord* words, void* arena) { DictWord* slots = (DictWord*)arena; uint16_t* heads = (uint16_t*)(slots + BROTLI_ENC_STATIC_DICT_LUT_NUM_ITEMS); uint16_t* counts = heads + BROTLI_ENC_STATIC_DICT_LUT_NUM_BUCKETS; uint16_t* prev = counts + BROTLI_ENC_STATIC_DICT_LUT_NUM_BUCKETS; size_t next_slot = 0; uint8_t transformed_word[24]; uint8_t transformed_other_word[24]; size_t l; size_t pos; size_t i; memset(counts, 0, BROTLI_ENC_STATIC_DICT_LUT_NUM_BUCKETS * sizeof(uint16_t)); memset(heads, 0, BROTLI_ENC_STATIC_DICT_LUT_NUM_BUCKETS * sizeof(uint16_t)); memset(prev, 0, BROTLI_ENC_STATIC_DICT_LUT_NUM_ITEMS * sizeof(uint16_t)); for (l = 4; l <= 24; ++l) { size_t n = 1u << dict->size_bits_by_length[l]; const uint8_t* dict_words = dict->data + dict->offsets_by_length[l]; for (i = 0; i < n; ++i) { const uint8_t* dict_word = dict_words + l * i; uint32_t key = Hash15(dict_word); slots[next_slot].len = (uint8_t)l; slots[next_slot].transform = BROTLI_TRANSFORM_IDENTITY; slots[next_slot].idx = (uint16_t)i; prev[next_slot] = heads[key]; heads[key] = (uint16_t)next_slot; counts[key]++; ++next_slot; } for (i = 0; i < n; ++i) { uint32_t key; uint32_t prefix; BROTLI_BOOL found; size_t curr; const uint8_t* dict_word = dict_words + l * i; if (dict_word[0] < 'a' || dict_word[0] > 'z') continue; memcpy(transformed_word, dict_word, l); transformed_word[0] = transformed_word[0] - 32; key = Hash15(transformed_word); prefix = BROTLI_UNALIGNED_LOAD32LE(transformed_word) & ~0x20202020u; found = BROTLI_FALSE; curr = heads[key]; while (curr != 0) { const uint8_t* other_word; uint32_t other_prefix; if (slots[curr].len != l) break; other_word = dict_words + l * slots[curr].idx; other_prefix = BROTLI_UNALIGNED_LOAD32LE(other_word) & ~0x20202020u; if (prefix == other_prefix) { if (memcmp(transformed_word, other_word, l) == 0) { found = BROTLI_TRUE; break; } } curr = prev[curr]; } if (found) continue; slots[next_slot].len = (uint8_t)l; slots[next_slot].transform = BROTLI_TRANSFORM_UPPERCASE_FIRST; slots[next_slot].idx = (uint16_t)i; prev[next_slot] = heads[key]; heads[key] = (uint16_t)next_slot; counts[key]++; ++next_slot; } for (i = 0; i < n; ++i) { const uint8_t* dict_word = dict_words + l * i; BROTLI_BOOL is_ascii = BROTLI_TRUE; BROTLI_BOOL has_lower = BROTLI_FALSE; size_t k; uint32_t prefix; uint32_t key; size_t curr; BROTLI_BOOL found; for (k = 0; k < l; ++k) { if (dict_word[k] >= 128) is_ascii = BROTLI_FALSE; if (k > 0 && dict_word[k] >= 'a' && dict_word[k] <= 'z') has_lower = BROTLI_TRUE; } if (!is_ascii || !has_lower) continue; memcpy(transformed_word, dict_word, l); prefix = BROTLI_UNALIGNED_LOAD32LE(transformed_word) & ~0x20202020u; for (k = 0; k < l; ++k) { if (transformed_word[k] >= 'a' && transformed_word[k] <= 'z') { transformed_word[k] = transformed_word[k] - 32; } } key = Hash15(transformed_word); found = BROTLI_FALSE; curr = heads[key]; while (curr != 0) { const uint8_t* other_word; uint32_t other_prefix; if (slots[curr].len != l) break; other_word = dict_words + l * slots[curr].idx; other_prefix = BROTLI_UNALIGNED_LOAD32LE(other_word) & ~0x20202020u; if (prefix == other_prefix) { if (slots[curr].transform == BROTLI_TRANSFORM_IDENTITY) { if (memcmp(transformed_word, other_word, l) == 0) { found = BROTLI_TRUE; break; } } else if (slots[curr].transform == BROTLI_TRANSFORM_UPPERCASE_FIRST) { if ((transformed_word[0] == (other_word[0] - 32)) && memcmp(transformed_word + 1, other_word + 1, l - 1) == 0) { found = BROTLI_TRUE; break; } } else { for (k = 0; k < l; ++k) { if (other_word[k] >= 'a' && other_word[k] <= 'z') { transformed_other_word[k] = other_word[k] - 32; } else { transformed_other_word[k] = other_word[k]; } } if (memcmp(transformed_word, transformed_other_word, l) == 0) { found = BROTLI_TRUE; break; } } } curr = prev[curr]; } if (found) { continue; } slots[next_slot].len = (uint8_t)l; slots[next_slot].transform = BROTLI_TRANSFORM_UPPERCASE_ALL; slots[next_slot].idx = (uint16_t)i; prev[next_slot] = heads[key]; heads[key] = (uint16_t)next_slot; counts[key]++; ++next_slot; } } if (next_slot != 31704) return BROTLI_FALSE; pos = 0; /* Unused; makes offsets start from 1. */ words[pos].len = 0; words[pos].transform = 0; words[pos].idx = 0; pos++; for (i = 0; i < BROTLI_ENC_STATIC_DICT_LUT_NUM_BUCKETS; ++i) { size_t num_words = counts[i]; size_t curr; if (num_words == 0) { buckets[i] = 0; continue; } buckets[i] = (uint16_t)pos; curr = heads[i]; pos += num_words; for (size_t k = 0; k < num_words; ++k) { words[pos - 1 - k] = slots[curr]; curr = prev[curr]; } words[pos - 1].len |= 0x80; } return BROTLI_TRUE; } BROTLI_BOOL BrotliEncoderInitStaticDictionaryLut( const BrotliDictionary* dict, uint16_t* buckets, DictWord* words) { size_t arena_size = BROTLI_ENC_STATIC_DICT_LUT_NUM_ITEMS * (sizeof(uint16_t) + sizeof(DictWord)) + BROTLI_ENC_STATIC_DICT_LUT_NUM_BUCKETS * 2 * sizeof(uint16_t); void* arena = malloc(arena_size); BROTLI_BOOL ok; if (arena == NULL) { return BROTLI_FALSE; } ok = DoBrotliEncoderInitStaticDictionaryLut(dict, buckets, words, arena); free(arena); return ok; } BROTLI_MODEL("small") uint16_t kStaticDictionaryBuckets[BROTLI_ENC_STATIC_DICT_LUT_NUM_BUCKETS]; BROTLI_MODEL("small") DictWord kStaticDictionaryWords[BROTLI_ENC_STATIC_DICT_LUT_NUM_ITEMS]; #else /* BROTLI_STATIC_INIT */ /* Embed kStaticDictionaryBuckets and kStaticDictionaryWords. */ #include "static_dict_lut_inc.h" #endif /* BROTLI_STATIC_INIT */ #if defined(__cplusplus) || defined(c_plusplus) } /* extern "C" */ #endif
Upload File
Create Folder