blob: 7b3d030d2eef3c628f0f3648ac591ad8185770e9 [file] [log] [blame]
Eugene Klyuchnikov771eb102015-11-27 11:27:11 +01001/* Copyright 2013 Google Inc. All Rights Reserved.
2
Eugene Klyuchnikov24ffa782015-12-11 11:11:51 +01003 Distributed under MIT license.
Eugene Klyuchnikov771eb102015-11-27 11:27:11 +01004 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5*/
6
Eugene Kliuchnikov352b0b22016-06-03 11:19:23 +02007/* Literal cost model to allow backward reference replacement to be efficient.
8*/
Zoltan Szabadkac66e4e32013-10-23 13:06:13 +02009
10#ifndef BROTLI_ENC_LITERAL_COST_H_
11#define BROTLI_ENC_LITERAL_COST_H_
12
Eugene Kliuchnikov81480012016-08-23 14:40:33 +020013#include <brotli/types.h>
Eugene Kliuchnikovb972c672016-06-13 11:01:04 +020014#include "./port.h"
Zoltan Szabadkac66e4e32013-10-23 13:06:13 +020015
Eugene Kliuchnikovb972c672016-06-13 11:01:04 +020016#if defined(__cplusplus) || defined(c_plusplus)
17extern "C" {
18#endif
Zoltan Szabadkac66e4e32013-10-23 13:06:13 +020019
Eugene Kliuchnikov352b0b22016-06-03 11:19:23 +020020/* Estimates how many bits the literals in the interval [pos, pos + len) in the
Eugene Kliuchnikove9b278a2016-10-31 14:33:59 +010021 ring-buffer (data, mask) will take entropy coded and writes these estimates
Eugene Kliuchnikov352b0b22016-06-03 11:19:23 +020022 to the cost[0..len) array. */
Eugene Kliuchnikovb972c672016-06-13 11:01:04 +020023BROTLI_INTERNAL void BrotliEstimateBitCostsForLiterals(
24 size_t pos, size_t len, size_t mask, const uint8_t *data, float *cost);
Zoltan Szabadkac66e4e32013-10-23 13:06:13 +020025
Eugene Kliuchnikovb972c672016-06-13 11:01:04 +020026#if defined(__cplusplus) || defined(c_plusplus)
27} /* extern "C" */
28#endif
Zoltan Szabadkac66e4e32013-10-23 13:06:13 +020029
Eugene Kliuchnikov352b0b22016-06-03 11:19:23 +020030#endif /* BROTLI_ENC_LITERAL_COST_H_ */