X7ROOT File Manager
Current Path:
/opt/alt/tests/alt-php85-pecl-brotli_0.18.3-2.el8/brotli/c/enc
opt
/
alt
/
tests
/
alt-php85-pecl-brotli_0.18.3-2.el8
/
brotli
/
c
/
enc
/
??
..
??
.libs
??
backward_references.c
(6.13 KB)
??
backward_references.dep
(2.56 KB)
??
backward_references.h
(1.18 KB)
??
backward_references.lo
(303 B)
??
backward_references_hq.c
(35.88 KB)
??
backward_references_hq.dep
(2.56 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.dep
(1.64 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.dep
(1.84 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.dep
(1.94 KB)
??
brotli_bit_stream.h
(3.26 KB)
??
brotli_bit_stream.lo
(299 B)
??
cluster.c
(1.42 KB)
??
cluster.dep
(1.7 KB)
??
cluster.h
(997 B)
??
cluster.lo
(279 B)
??
cluster_inc.h
(11.55 KB)
??
command.c
(1 KB)
??
command.dep
(1.24 KB)
??
command.h
(6.77 KB)
??
command.lo
(279 B)
??
compound_dictionary.c
(6.5 KB)
??
compound_dictionary.dep
(543 B)
??
compound_dictionary.h
(2.38 KB)
??
compound_dictionary.lo
(303 B)
??
compress_fragment.c
(32.1 KB)
??
compress_fragment.dep
(2 KB)
??
compress_fragment.h
(3.49 KB)
??
compress_fragment.lo
(299 B)
??
compress_fragment_two_pass.c
(26.18 KB)
??
compress_fragment_two_pass.dep
(2.08 KB)
??
compress_fragment_two_pass.h
(2.79 KB)
??
compress_fragment_two_pass.lo
(317 B)
??
dictionary_hash.c
(7.75 KB)
??
dictionary_hash.dep
(537 B)
??
dictionary_hash.h
(1.5 KB)
??
dictionary_hash.lo
(295 B)
??
dictionary_hash_inc.h
(143.28 KB)
??
encode.c
(76.58 KB)
??
encode.dep
(3.59 KB)
??
encode.lo
(277 B)
??
encoder_dict.c
(22.83 KB)
??
encoder_dict.dep
(2.58 KB)
??
encoder_dict.h
(4.9 KB)
??
encoder_dict.lo
(289 B)
??
entropy_encode.c
(14.23 KB)
??
entropy_encode.dep
(531 B)
??
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.dep
(366 B)
??
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.dep
(1.51 KB)
??
histogram.h
(1.77 KB)
??
histogram.lo
(283 B)
??
histogram_inc.h
(1.37 KB)
??
literal_cost.c
(5.74 KB)
??
literal_cost.dep
(505 B)
??
literal_cost.h
(889 B)
??
literal_cost.lo
(289 B)
??
matching_tag_mask.h
(2.29 KB)
??
memory.c
(5.39 KB)
??
memory.dep
(360 B)
??
memory.h
(4.2 KB)
??
memory.lo
(277 B)
??
metablock.c
(26.07 KB)
??
metablock.dep
(1.9 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.dep
(1.14 KB)
??
static_dict.h
(1.19 KB)
??
static_dict.lo
(287 B)
??
static_dict_lut.c
(7.25 KB)
??
static_dict_lut.dep
(685 B)
??
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.dep
(451 B)
??
static_init.h
(840 B)
??
static_init.lo
(287 B)
??
utf8_util.c
(2.22 KB)
??
utf8_util.dep
(369 B)
??
utf8_util.h
(878 B)
??
utf8_util.lo
(283 B)
??
write_bits.h
(2.77 KB)
Editing: metablock_inc.h
/* NOLINT(build/header_guard) */ /* Copyright 2015 Google Inc. All Rights Reserved. Distributed under MIT license. See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ /* template parameters: FN */ #define HistogramType FN(Histogram) /* Greedy block splitter for one block category (literal, command or distance). */ typedef struct FN(BlockSplitter) { /* Alphabet size of particular block category. */ size_t alphabet_size_; /* We collect at least this many symbols for each block. */ size_t min_block_size_; /* We merge histograms A and B if entropy(A+B) < entropy(A) + entropy(B) + split_threshold_, where A is the current histogram and B is the histogram of the last or the second last block type. */ double split_threshold_; size_t num_blocks_; BlockSplit* split_; /* not owned */ HistogramType* histograms_; /* not owned */ size_t* histograms_size_; /* not owned */ /* Temporary storage for BlockSplitterFinishBlock. */ HistogramType combined_histo[2]; /* The number of symbols that we want to collect before deciding on whether or not to merge the block with a previous one or emit a new block. */ size_t target_block_size_; /* The number of symbols in the current histogram. */ size_t block_size_; /* Offset of the current histogram. */ size_t curr_histogram_ix_; /* Offset of the histograms of the previous two block types. */ size_t last_histogram_ix_[2]; /* Entropy of the previous two block types. */ double last_entropy_[2]; /* The number of times we merged the current block with the last one. */ size_t merge_last_count_; } FN(BlockSplitter); static void FN(InitBlockSplitter)( MemoryManager* m, FN(BlockSplitter)* self, size_t alphabet_size, size_t min_block_size, double split_threshold, size_t num_symbols, BlockSplit* split, HistogramType** histograms, size_t* histograms_size) { size_t max_num_blocks = num_symbols / min_block_size + 1; /* We have to allocate one more histogram than the maximum number of block types for the current histogram when the meta-block is too big. */ size_t max_num_types = BROTLI_MIN(size_t, max_num_blocks, BROTLI_MAX_NUMBER_OF_BLOCK_TYPES + 1); self->alphabet_size_ = alphabet_size; self->min_block_size_ = min_block_size; self->split_threshold_ = split_threshold; self->num_blocks_ = 0; self->split_ = split; self->histograms_size_ = histograms_size; self->target_block_size_ = min_block_size; self->block_size_ = 0; self->curr_histogram_ix_ = 0; self->merge_last_count_ = 0; BROTLI_ENSURE_CAPACITY(m, uint8_t, split->types, split->types_alloc_size, max_num_blocks); BROTLI_ENSURE_CAPACITY(m, uint32_t, split->lengths, split->lengths_alloc_size, max_num_blocks); if (BROTLI_IS_OOM(m)) return; self->split_->num_blocks = max_num_blocks; BROTLI_DCHECK(*histograms == 0); *histograms_size = max_num_types; *histograms = BROTLI_ALLOC(m, HistogramType, *histograms_size); self->histograms_ = *histograms; if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(*histograms)) return; /* Clear only current histogram. */ FN(HistogramClear)(&self->histograms_[0]); self->last_histogram_ix_[0] = self->last_histogram_ix_[1] = 0; } /* Does either of three things: (1) emits the current block with a new block type; (2) emits the current block with the type of the second last block; (3) merges the current block with the last block. */ static void FN(BlockSplitterFinishBlock)( FN(BlockSplitter)* self, BROTLI_BOOL is_final) { BlockSplit* split = self->split_; double* last_entropy = self->last_entropy_; HistogramType* histograms = self->histograms_; self->block_size_ = BROTLI_MAX(size_t, self->block_size_, self->min_block_size_); if (self->num_blocks_ == 0) { /* Create first block. */ split->lengths[0] = (uint32_t)self->block_size_; split->types[0] = 0; last_entropy[0] = BrotliBitsEntropy(histograms[0].data_, self->alphabet_size_); last_entropy[1] = last_entropy[0]; ++self->num_blocks_; ++split->num_types; ++self->curr_histogram_ix_; if (self->curr_histogram_ix_ < *self->histograms_size_) FN(HistogramClear)(&histograms[self->curr_histogram_ix_]); self->block_size_ = 0; } else if (self->block_size_ > 0) { double entropy = BrotliBitsEntropy( histograms[self->curr_histogram_ix_].data_, self->alphabet_size_); double combined_entropy[2]; double diff[2]; size_t j; for (j = 0; j < 2; ++j) { size_t last_histogram_ix = self->last_histogram_ix_[j]; self->combined_histo[j] = histograms[self->curr_histogram_ix_]; FN(HistogramAddHistogram)(&self->combined_histo[j], &histograms[last_histogram_ix]); combined_entropy[j] = BrotliBitsEntropy( &self->combined_histo[j].data_[0], self->alphabet_size_); diff[j] = combined_entropy[j] - entropy - last_entropy[j]; } if (split->num_types < BROTLI_MAX_NUMBER_OF_BLOCK_TYPES && diff[0] > self->split_threshold_ && diff[1] > self->split_threshold_) { /* Create new block. */ split->lengths[self->num_blocks_] = (uint32_t)self->block_size_; split->types[self->num_blocks_] = (uint8_t)split->num_types; self->last_histogram_ix_[1] = self->last_histogram_ix_[0]; self->last_histogram_ix_[0] = (uint8_t)split->num_types; last_entropy[1] = last_entropy[0]; last_entropy[0] = entropy; ++self->num_blocks_; ++split->num_types; ++self->curr_histogram_ix_; if (self->curr_histogram_ix_ < *self->histograms_size_) FN(HistogramClear)(&histograms[self->curr_histogram_ix_]); self->block_size_ = 0; self->merge_last_count_ = 0; self->target_block_size_ = self->min_block_size_; } else if (diff[1] < diff[0] - 20.0) { /* Combine this block with second last block. */ split->lengths[self->num_blocks_] = (uint32_t)self->block_size_; split->types[self->num_blocks_] = split->types[self->num_blocks_ - 2]; BROTLI_SWAP(size_t, self->last_histogram_ix_, 0, 1); histograms[self->last_histogram_ix_[0]] = self->combined_histo[1]; last_entropy[1] = last_entropy[0]; last_entropy[0] = combined_entropy[1]; ++self->num_blocks_; self->block_size_ = 0; FN(HistogramClear)(&histograms[self->curr_histogram_ix_]); self->merge_last_count_ = 0; self->target_block_size_ = self->min_block_size_; } else { /* Combine this block with last block. */ split->lengths[self->num_blocks_ - 1] += (uint32_t)self->block_size_; histograms[self->last_histogram_ix_[0]] = self->combined_histo[0]; last_entropy[0] = combined_entropy[0]; if (split->num_types == 1) { last_entropy[1] = last_entropy[0]; } self->block_size_ = 0; FN(HistogramClear)(&histograms[self->curr_histogram_ix_]); if (++self->merge_last_count_ > 1) { self->target_block_size_ += self->min_block_size_; } } } if (is_final) { *self->histograms_size_ = split->num_types; split->num_blocks = self->num_blocks_; } } /* Adds the next symbol to the current histogram. When the current histogram reaches the target size, decides on merging the block. */ static void FN(BlockSplitterAddSymbol)(FN(BlockSplitter)* self, size_t symbol) { FN(HistogramAdd)(&self->histograms_[self->curr_histogram_ix_], symbol); ++self->block_size_; if (self->block_size_ == self->target_block_size_) { FN(BlockSplitterFinishBlock)(self, /* is_final = */ BROTLI_FALSE); } } #undef HistogramType
Upload File
Create Folder