literal_cost.h 892 B

123456789101112131415161718192021222324252627282930
  1. /* Copyright 2013 Google Inc. All Rights Reserved.
  2. Distributed under MIT license.
  3. See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
  4. */
  5. /* Literal cost model to allow backward reference replacement to be efficient.
  6. */
  7. #ifndef BROTLI_ENC_LITERAL_COST_H_
  8. #define BROTLI_ENC_LITERAL_COST_H_
  9. #include "../common/platform.h"
  10. #include <brotli/types.h>
  11. #if defined(__cplusplus) || defined(c_plusplus)
  12. extern "C" {
  13. #endif
  14. /* Estimates how many bits the literals in the interval [pos, pos + len) in the
  15. ring-buffer (data, mask) will take entropy coded and writes these estimates
  16. to the cost[0..len) array. */
  17. BROTLI_INTERNAL void BrotliEstimateBitCostsForLiterals(
  18. size_t pos, size_t len, size_t mask, const uint8_t* data, float* cost);
  19. #if defined(__cplusplus) || defined(c_plusplus)
  20. } /* extern "C" */
  21. #endif
  22. #endif /* BROTLI_ENC_LITERAL_COST_H_ */