backward_references.h revision 26fa459c
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/* Function to find backward reference copies. */
826fa459cSmrg
926fa459cSmrg#ifndef BROTLI_ENC_BACKWARD_REFERENCES_H_
1026fa459cSmrg#define BROTLI_ENC_BACKWARD_REFERENCES_H_
1126fa459cSmrg
1226fa459cSmrg#include "../common/constants.h"
1326fa459cSmrg#include "../common/context.h"
1426fa459cSmrg#include "../common/dictionary.h"
1526fa459cSmrg#include "../common/platform.h"
1626fa459cSmrg#include <brotli/types.h>
1726fa459cSmrg#include "./command.h"
1826fa459cSmrg#include "./hash.h"
1926fa459cSmrg#include "./quality.h"
2026fa459cSmrg
2126fa459cSmrg#if defined(__cplusplus) || defined(c_plusplus)
2226fa459cSmrgextern "C" {
2326fa459cSmrg#endif
2426fa459cSmrg
2526fa459cSmrg/* "commands" points to the next output command to write to, "*num_commands" is
2626fa459cSmrg   initially the total amount of commands output by previous
2726fa459cSmrg   CreateBackwardReferences calls, and must be incremented by the amount written
2826fa459cSmrg   by this call. */
2926fa459cSmrgBROTLI_INTERNAL void BrotliCreateBackwardReferences(size_t num_bytes,
3026fa459cSmrg    size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask,
3126fa459cSmrg    ContextLut literal_context_lut, const BrotliEncoderParams* params,
3226fa459cSmrg    Hasher* hasher, int* dist_cache, size_t* last_insert_len,
3326fa459cSmrg    Command* commands, size_t* num_commands, size_t* num_literals);
3426fa459cSmrg
3526fa459cSmrg#if defined(__cplusplus) || defined(c_plusplus)
3626fa459cSmrg}  /* extern "C" */
3726fa459cSmrg#endif
3826fa459cSmrg
3926fa459cSmrg#endif  /* BROTLI_ENC_BACKWARD_REFERENCES_H_ */
40