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