aboutsummaryrefslogtreecommitdiff
path: root/c/enc/block_encoder_inc.h
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-09-11 03:21:35 +0000
committerTao Bao <tbao@google.com>2018-09-10 20:25:06 -0700
commitc4af2b09ada22257ff12967537264627a3936822 (patch)
treebbbd0739556711089201e0448c444e8cf8bc547f /c/enc/block_encoder_inc.h
parent885730d69b5f844f1c59f6de809495726290ae22 (diff)
downloadbrotli-c4af2b09ada22257ff12967537264627a3936822.tar.gz
Revert "Merge tag 'v1.0.5' into HEAD"
This reverts commit 885730d69b5f844f1c59f6de809495726290ae22. Reason for revert: b/114832768 (32-bit recovery_component_test.UpdaterTest#brotli_new_data on marlin is broken). Bug: 114832768 Test: The above test passes w/ the revert. Change-Id: I9d6ad3ce44069a94bc78020ed28c5aa1a6d10ce8
Diffstat (limited to 'c/enc/block_encoder_inc.h')
-rw-r--r--c/enc/block_encoder_inc.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/c/enc/block_encoder_inc.h b/c/enc/block_encoder_inc.h
index 8cbd5ea..2a08f90 100644
--- a/c/enc/block_encoder_inc.h
+++ b/c/enc/block_encoder_inc.h
@@ -13,9 +13,9 @@
stream. */
static void FN(BuildAndStoreEntropyCodes)(MemoryManager* m, BlockEncoder* self,
const HistogramType* histograms, const size_t histograms_size,
- const size_t alphabet_size, HuffmanTree* tree,
- size_t* storage_ix, uint8_t* storage) {
- const size_t table_size = histograms_size * self->histogram_length_;
+ HuffmanTree* tree, size_t* storage_ix, uint8_t* storage) {
+ const size_t alphabet_size = self->alphabet_size_;
+ const size_t table_size = histograms_size * alphabet_size;
self->depths_ = BROTLI_ALLOC(m, uint8_t, table_size);
self->bits_ = BROTLI_ALLOC(m, uint16_t, table_size);
if (BROTLI_IS_OOM(m)) return;
@@ -23,10 +23,9 @@ static void FN(BuildAndStoreEntropyCodes)(MemoryManager* m, BlockEncoder* self,
{
size_t i;
for (i = 0; i < histograms_size; ++i) {
- size_t ix = i * self->histogram_length_;
- BuildAndStoreHuffmanTree(&histograms[i].data_[0], self->histogram_length_,
- alphabet_size, tree, &self->depths_[ix], &self->bits_[ix],
- storage_ix, storage);
+ size_t ix = i * alphabet_size;
+ BuildAndStoreHuffmanTree(&histograms[i].data_[0], alphabet_size, tree,
+ &self->depths_[ix], &self->bits_[ix], storage_ix, storage);
}
}
}