Eugene Klyuchnikov | 771eb10 | 2015-11-27 11:27:11 +0100 | [diff] [blame] | 1 | /* Copyright 2013 Google Inc. All Rights Reserved. |
| 2 | |
Eugene Klyuchnikov | 24ffa78 | 2015-12-11 11:11:51 +0100 | [diff] [blame] | 3 | Distributed under MIT license. |
Eugene Klyuchnikov | 771eb10 | 2015-11-27 11:27:11 +0100 | [diff] [blame] | 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
| 5 | */ |
| 6 | |
Eugene Kliuchnikov | 352b0b2 | 2016-06-03 11:19:23 +0200 | [diff] [blame] | 7 | /* Literal cost model to allow backward reference replacement to be efficient. |
| 8 | */ |
Zoltan Szabadka | c66e4e3 | 2013-10-23 13:06:13 +0200 | [diff] [blame] | 9 | |
| 10 | #ifndef BROTLI_ENC_LITERAL_COST_H_ |
| 11 | #define BROTLI_ENC_LITERAL_COST_H_ |
| 12 | |
Eugene Kliuchnikov | 8148001 | 2016-08-23 14:40:33 +0200 | [diff] [blame] | 13 | #include <brotli/types.h> |
Eugene Kliuchnikov | b972c67 | 2016-06-13 11:01:04 +0200 | [diff] [blame] | 14 | #include "./port.h" |
Zoltan Szabadka | c66e4e3 | 2013-10-23 13:06:13 +0200 | [diff] [blame] | 15 | |
Eugene Kliuchnikov | b972c67 | 2016-06-13 11:01:04 +0200 | [diff] [blame] | 16 | #if defined(__cplusplus) || defined(c_plusplus) |
| 17 | extern "C" { |
| 18 | #endif |
Zoltan Szabadka | c66e4e3 | 2013-10-23 13:06:13 +0200 | [diff] [blame] | 19 | |
Eugene Kliuchnikov | 352b0b2 | 2016-06-03 11:19:23 +0200 | [diff] [blame] | 20 | /* Estimates how many bits the literals in the interval [pos, pos + len) in the |
Eugene Kliuchnikov | e9b278a | 2016-10-31 14:33:59 +0100 | [diff] [blame] | 21 | ring-buffer (data, mask) will take entropy coded and writes these estimates |
Eugene Kliuchnikov | 352b0b2 | 2016-06-03 11:19:23 +0200 | [diff] [blame] | 22 | to the cost[0..len) array. */ |
Eugene Kliuchnikov | b972c67 | 2016-06-13 11:01:04 +0200 | [diff] [blame] | 23 | BROTLI_INTERNAL void BrotliEstimateBitCostsForLiterals( |
| 24 | size_t pos, size_t len, size_t mask, const uint8_t *data, float *cost); |
Zoltan Szabadka | c66e4e3 | 2013-10-23 13:06:13 +0200 | [diff] [blame] | 25 | |
Eugene Kliuchnikov | b972c67 | 2016-06-13 11:01:04 +0200 | [diff] [blame] | 26 | #if defined(__cplusplus) || defined(c_plusplus) |
| 27 | } /* extern "C" */ |
| 28 | #endif |
Zoltan Szabadka | c66e4e3 | 2013-10-23 13:06:13 +0200 | [diff] [blame] | 29 | |
Eugene Kliuchnikov | 352b0b2 | 2016-06-03 11:19:23 +0200 | [diff] [blame] | 30 | #endif /* BROTLI_ENC_LITERAL_COST_H_ */ |