11cb0ef41Sopenharmony_ci/* Copyright 2013 Google Inc. All Rights Reserved. 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ci Distributed under MIT license. 41cb0ef41Sopenharmony_ci See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 51cb0ef41Sopenharmony_ci*/ 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ci/* Literal cost model to allow backward reference replacement to be efficient. 81cb0ef41Sopenharmony_ci*/ 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ci#ifndef BROTLI_ENC_LITERAL_COST_H_ 111cb0ef41Sopenharmony_ci#define BROTLI_ENC_LITERAL_COST_H_ 121cb0ef41Sopenharmony_ci 131cb0ef41Sopenharmony_ci#include "../common/platform.h" 141cb0ef41Sopenharmony_ci#include <brotli/types.h> 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ci#if defined(__cplusplus) || defined(c_plusplus) 171cb0ef41Sopenharmony_ciextern "C" { 181cb0ef41Sopenharmony_ci#endif 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_ci/* Estimates how many bits the literals in the interval [pos, pos + len) in the 211cb0ef41Sopenharmony_ci ring-buffer (data, mask) will take entropy coded and writes these estimates 221cb0ef41Sopenharmony_ci to the cost[0..len) array. */ 231cb0ef41Sopenharmony_ciBROTLI_INTERNAL void BrotliEstimateBitCostsForLiterals( 241cb0ef41Sopenharmony_ci size_t pos, size_t len, size_t mask, const uint8_t* data, float* cost); 251cb0ef41Sopenharmony_ci 261cb0ef41Sopenharmony_ci#if defined(__cplusplus) || defined(c_plusplus) 271cb0ef41Sopenharmony_ci} /* extern "C" */ 281cb0ef41Sopenharmony_ci#endif 291cb0ef41Sopenharmony_ci 301cb0ef41Sopenharmony_ci#endif /* BROTLI_ENC_LITERAL_COST_H_ */ 31