]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/BrotliCompress/enc/literal_cost.h
BaseTools: Copy Brotli algorithm 3rd party source code for tool
[mirror_edk2.git] / BaseTools / Source / C / BrotliCompress / enc / literal_cost.h
diff --git a/BaseTools/Source/C/BrotliCompress/enc/literal_cost.h b/BaseTools/Source/C/BrotliCompress/enc/literal_cost.h
new file mode 100644 (file)
index 0000000..6573b2d
--- /dev/null
@@ -0,0 +1,30 @@
+/* Copyright 2013 Google Inc. All Rights Reserved.\r
+\r
+   Distributed under MIT license.\r
+   See file LICENSE for detail or copy at https://opensource.org/licenses/MIT\r
+*/\r
+\r
+/* Literal cost model to allow backward reference replacement to be efficient.\r
+*/\r
+\r
+#ifndef BROTLI_ENC_LITERAL_COST_H_\r
+#define BROTLI_ENC_LITERAL_COST_H_\r
+\r
+#include "../common/types.h"\r
+#include "./port.h"\r
+\r
+#if defined(__cplusplus) || defined(c_plusplus)\r
+extern "C" {\r
+#endif\r
+\r
+/* Estimates how many bits the literals in the interval [pos, pos + len) in the\r
+   ringbuffer (data, mask) will take entropy coded and writes these estimates\r
+   to the cost[0..len) array. */\r
+BROTLI_INTERNAL void BrotliEstimateBitCostsForLiterals(\r
+    size_t pos, size_t len, size_t mask, const uint8_t *data, float *cost);\r
+\r
+#if defined(__cplusplus) || defined(c_plusplus)\r
+}  /* extern "C" */\r
+#endif\r
+\r
+#endif  /* BROTLI_ENC_LITERAL_COST_H_ */\r