]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/BrotliCompress/enc/block_encoder_inc.h
BaseTools: Update Brotli Compress to the latest one 1.0.6
[mirror_edk2.git] / BaseTools / Source / C / BrotliCompress / enc / block_encoder_inc.h
index 50400626d1c0584da2c7a5f300396041d068556a..ce7fd20cb3f44e80143ddfa88e5fb4029ccbb791 100644 (file)
@@ -13,9 +13,9 @@
    stream. */\r
 static void FN(BuildAndStoreEntropyCodes)(MemoryManager* m, BlockEncoder* self,\r
     const HistogramType* histograms, const size_t histograms_size,\r
-    HuffmanTree* tree, size_t* storage_ix, uint8_t* storage) {\r
-  const size_t alphabet_size = self->alphabet_size_;\r
-  const size_t table_size = histograms_size * alphabet_size;\r
+    const size_t alphabet_size, HuffmanTree* tree,\r
+    size_t* storage_ix, uint8_t* storage) {\r
+  const size_t table_size = histograms_size * self->histogram_length_;\r
   self->depths_ = BROTLI_ALLOC(m, uint8_t, table_size);\r
   self->bits_ = BROTLI_ALLOC(m, uint16_t, table_size);\r
   if (BROTLI_IS_OOM(m)) return;\r
@@ -23,9 +23,10 @@ static void FN(BuildAndStoreEntropyCodes)(MemoryManager* m, BlockEncoder* self,
   {\r
     size_t i;\r
     for (i = 0; i < histograms_size; ++i) {\r
-      size_t ix = i * alphabet_size;\r
-      BuildAndStoreHuffmanTree(&histograms[i].data_[0], alphabet_size, tree,\r
-          &self->depths_[ix], &self->bits_[ix], storage_ix, storage);\r
+      size_t ix = i * self->histogram_length_;\r
+      BuildAndStoreHuffmanTree(&histograms[i].data_[0], self->histogram_length_,\r
+          alphabet_size, tree, &self->depths_[ix], &self->bits_[ix],\r
+          storage_ix, storage);\r
     }\r
   }\r
 }\r