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/* Function to find backward reference copies. */ 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_ci#ifndef BROTLI_ENC_BACKWARD_REFERENCES_H_ 101cb0ef41Sopenharmony_ci#define BROTLI_ENC_BACKWARD_REFERENCES_H_ 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci#include "../common/constants.h" 131cb0ef41Sopenharmony_ci#include "../common/context.h" 141cb0ef41Sopenharmony_ci#include "../common/dictionary.h" 151cb0ef41Sopenharmony_ci#include "../common/platform.h" 161cb0ef41Sopenharmony_ci#include <brotli/types.h> 171cb0ef41Sopenharmony_ci#include "./command.h" 181cb0ef41Sopenharmony_ci#include "./hash.h" 191cb0ef41Sopenharmony_ci#include "./quality.h" 201cb0ef41Sopenharmony_ci 211cb0ef41Sopenharmony_ci#if defined(__cplusplus) || defined(c_plusplus) 221cb0ef41Sopenharmony_ciextern "C" { 231cb0ef41Sopenharmony_ci#endif 241cb0ef41Sopenharmony_ci 251cb0ef41Sopenharmony_ci/* "commands" points to the next output command to write to, "*num_commands" is 261cb0ef41Sopenharmony_ci initially the total amount of commands output by previous 271cb0ef41Sopenharmony_ci CreateBackwardReferences calls, and must be incremented by the amount written 281cb0ef41Sopenharmony_ci by this call. */ 291cb0ef41Sopenharmony_ciBROTLI_INTERNAL void BrotliCreateBackwardReferences(size_t num_bytes, 301cb0ef41Sopenharmony_ci size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask, 311cb0ef41Sopenharmony_ci ContextLut literal_context_lut, const BrotliEncoderParams* params, 321cb0ef41Sopenharmony_ci Hasher* hasher, int* dist_cache, size_t* last_insert_len, 331cb0ef41Sopenharmony_ci Command* commands, size_t* num_commands, size_t* num_literals); 341cb0ef41Sopenharmony_ci 351cb0ef41Sopenharmony_ci#if defined(__cplusplus) || defined(c_plusplus) 361cb0ef41Sopenharmony_ci} /* extern "C" */ 371cb0ef41Sopenharmony_ci#endif 381cb0ef41Sopenharmony_ci 391cb0ef41Sopenharmony_ci#endif /* BROTLI_ENC_BACKWARD_REFERENCES_H_ */ 40