aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgenii Kliuchnikov <eustas@google.com>2023-10-26 02:02:51 -0700
committerCopybara-Service <copybara-worker@google.com>2023-10-26 02:03:20 -0700
commit9b83be233e0ec867d91bcd451717c881eaf35ca2 (patch)
treed46cbec995dc96ab0627384448ae05d2763ca881
parent53947c15f57774f34f31c0dc485e5a7f5fd9794c (diff)
downloadbrotli-9b83be233e0ec867d91bcd451717c881eaf35ca2.zip
brotli-9b83be233e0ec867d91bcd451717c881eaf35ca2.tar.gz
brotli-9b83be233e0ec867d91bcd451717c881eaf35ca2.tar.bz2
fix wording
PiperOrigin-RevId: 576788685
-rw-r--r--c/enc/encode.c18
-rw-r--r--c/enc/encoder_dict.c4
-rw-r--r--research/brotlidump.py2
3 files changed, 12 insertions, 12 deletions
diff --git a/c/enc/encode.c b/c/enc/encode.c
index 95ff2ea..6b39707 100644
--- a/c/enc/encode.c
+++ b/c/enc/encode.c
@@ -271,18 +271,18 @@ static void ChooseContextMap(int quality,
uint32_t two_prefix_histo[6] = { 0 };
size_t total;
size_t i;
- size_t dummy;
+ size_t sink;
double entropy[4];
for (i = 0; i < 9; ++i) {
monogram_histo[i % 3] += bigram_histo[i];
two_prefix_histo[i % 6] += bigram_histo[i];
}
- entropy[1] = ShannonEntropy(monogram_histo, 3, &dummy);
- entropy[2] = (ShannonEntropy(two_prefix_histo, 3, &dummy) +
- ShannonEntropy(two_prefix_histo + 3, 3, &dummy));
+ entropy[1] = ShannonEntropy(monogram_histo, 3, &sink);
+ entropy[2] = (ShannonEntropy(two_prefix_histo, 3, &sink) +
+ ShannonEntropy(two_prefix_histo + 3, 3, &sink));
entropy[3] = 0;
for (i = 0; i < 3; ++i) {
- entropy[3] += ShannonEntropy(bigram_histo + 3 * i, 3, &dummy);
+ entropy[3] += ShannonEntropy(bigram_histo + 3 * i, 3, &sink);
}
total = monogram_histo[0] + monogram_histo[1] + monogram_histo[2];
@@ -348,7 +348,7 @@ static BROTLI_BOOL ShouldUseComplexStaticContextMap(const uint8_t* input,
uint32_t* BROTLI_RESTRICT const context_histo = arena + 32;
uint32_t total = 0;
double entropy[3];
- size_t dummy;
+ size_t sink;
size_t i;
ContextLut utf8_lut = BROTLI_CONTEXT_LUT(CONTEXT_UTF8);
memset(arena, 0, sizeof(arena[0]) * 32 * 14);
@@ -370,10 +370,10 @@ static BROTLI_BOOL ShouldUseComplexStaticContextMap(const uint8_t* input,
prev1 = literal;
}
}
- entropy[1] = ShannonEntropy(combined_histo, 32, &dummy);
+ entropy[1] = ShannonEntropy(combined_histo, 32, &sink);
entropy[2] = 0;
for (i = 0; i < 13; ++i) {
- entropy[2] += ShannonEntropy(context_histo + (i << 5), 32, &dummy);
+ entropy[2] += ShannonEntropy(context_histo + (i << 5), 32, &sink);
}
entropy[0] = 1.0 / (double)total;
entropy[1] *= entropy[0];
@@ -817,7 +817,7 @@ static void CopyInputToRingBuffer(BrotliEncoderState* s,
reading new bytes from the input. However, at the last few indexes of
the ring buffer, there are not enough bytes to build full-length
substrings from. Since the hash table always contains full-length
- substrings, we erase with dummy zeros here to make sure that those
+ substrings, we overwrite with zeros here to make sure that those
substrings will contain zeros at the end instead of uninitialized
data.
diff --git a/c/enc/encoder_dict.c b/c/enc/encoder_dict.c
index 6602c55..0984281 100644
--- a/c/enc/encoder_dict.c
+++ b/c/enc/encoder_dict.c
@@ -118,8 +118,8 @@ static uint32_t BrotliTrieAlloc(MemoryManager* m, size_t num, BrotliTrie* trie,
keep_index = (uint32_t)(*keep - trie->pool);
}
if (trie->pool_size == 0) {
- /* Have a dummy node in the front. We do not want the result to be 0, it
- must be at least 1, 0 represents "null pointer" */
+ /* Have a placeholder node in the front. We do not want the result to be 0,
+ it must be at least 1, 0 represents "null pointer" */
trie->pool_size = 1;
}
BROTLI_ENSURE_CAPACITY(m, BrotliTrieNode, trie->pool, trie->pool_capacity,
diff --git a/research/brotlidump.py b/research/brotlidump.py
index ccdec61..c2fcaa1 100644
--- a/research/brotlidump.py
+++ b/research/brotlidump.py
@@ -2240,7 +2240,7 @@ __test__ = {
'file': """
>>> try: Layout(BitStream(
- ... open("H:/Downloads/brotli-master/tests/testdata/10x10y.compressed",'rb')
+ ... open("./tests/testdata/10x10y.compressed",'rb')
... .read())).processStream()
... except NotImplementedError: pass
addr hex binary context explanation