126fa459cSmrg/* Copyright 2013 Google Inc. All Rights Reserved. 226fa459cSmrg 326fa459cSmrg Distributed under MIT license. 426fa459cSmrg See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 526fa459cSmrg*/ 626fa459cSmrg 726fa459cSmrg/* Literal cost model to allow backward reference replacement to be efficient. 826fa459cSmrg*/ 926fa459cSmrg 1026fa459cSmrg#ifndef BROTLI_ENC_LITERAL_COST_H_ 1126fa459cSmrg#define BROTLI_ENC_LITERAL_COST_H_ 1226fa459cSmrg 1326fa459cSmrg#include "../common/platform.h" 1426fa459cSmrg#include <brotli/types.h> 1526fa459cSmrg 1626fa459cSmrg#if defined(__cplusplus) || defined(c_plusplus) 1726fa459cSmrgextern "C" { 1826fa459cSmrg#endif 1926fa459cSmrg 2026fa459cSmrg/* Estimates how many bits the literals in the interval [pos, pos + len) in the 2126fa459cSmrg ring-buffer (data, mask) will take entropy coded and writes these estimates 2226fa459cSmrg to the cost[0..len) array. */ 2326fa459cSmrgBROTLI_INTERNAL void BrotliEstimateBitCostsForLiterals( 2426fa459cSmrg size_t pos, size_t len, size_t mask, const uint8_t* data, float* cost); 2526fa459cSmrg 2626fa459cSmrg#if defined(__cplusplus) || defined(c_plusplus) 2726fa459cSmrg} /* extern "C" */ 2826fa459cSmrg#endif 2926fa459cSmrg 3026fa459cSmrg#endif /* BROTLI_ENC_LITERAL_COST_H_ */ 31