Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
encode.h
Go to the documentation of this file.
1/* Copyright 2013 Google Inc. All Rights Reserved.
2
3 Distributed under MIT license.
4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5*/
6
12#ifndef BROTLI_ENC_ENCODE_H_
13#define BROTLI_ENC_ENCODE_H_
14
15#include <brotli/port.h>
16#include <brotli/shared_dictionary.h>
17#include <brotli/types.h>
18
19#if defined(__cplusplus) || defined(c_plusplus)
20extern "C" {
21#endif
22
24#define BROTLI_MIN_WINDOW_BITS 10
30#define BROTLI_MAX_WINDOW_BITS 24
35#define BROTLI_LARGE_MAX_WINDOW_BITS 30
37#define BROTLI_MIN_INPUT_BLOCK_BITS 16
39#define BROTLI_MAX_INPUT_BLOCK_BITS 24
41#define BROTLI_MIN_QUALITY 0
43#define BROTLI_MAX_QUALITY 11
44
59
61#define BROTLI_DEFAULT_QUALITY 11
63#define BROTLI_DEFAULT_WINDOW 22
65#define BROTLI_DEFAULT_MODE BROTLI_MODE_GENERIC
66
133
223
231
247 BrotliEncoderState* state, BrotliEncoderParameter param, uint32_t value);
248
264 brotli_alloc_func alloc_func, brotli_free_func free_func, void* opaque);
265
272
273/* Opaque type for pointer to different possible internal structures containing
274 dictionary prepared for the encoder */
275typedef struct BrotliEncoderPreparedDictionaryStruct
277
297 size_t data_size, const uint8_t data[BROTLI_ARRAY_PARAM(data_size)],
298 int quality,
299 brotli_alloc_func alloc_func, brotli_free_func free_func, void* opaque);
300
303
315 BrotliEncoderState* state,
317
328BROTLI_ENC_API size_t BrotliEncoderMaxCompressedSize(size_t input_size);
329
359 int quality, int lgwin, BrotliEncoderMode mode, size_t input_size,
360 const uint8_t input_buffer[BROTLI_ARRAY_PARAM(input_size)],
361 size_t* encoded_size,
362 uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(*encoded_size)]);
363
427 BrotliEncoderState* state, BrotliEncoderOperation op, size_t* available_in,
428 const uint8_t** next_in, size_t* available_out, uint8_t** next_out,
429 size_t* total_out);
430
440
449 BrotliEncoderState* state);
450
480 BrotliEncoderState* state, size_t* size);
481
482/* Returns the estimated peak memory usage (in bytes) of the BrotliCompress()
483 function, not counting the memory needed for the input and output. */
485 int quality, int lgwin, size_t input_size);
486/* Returns 0 if dictionary is not valid; otherwise returns allocation size. */
489
496
497#if defined(__cplusplus) || defined(c_plusplus)
498} /* extern "C" */
499#endif
500
501#endif /* BROTLI_ENC_ENCODE_H_ */
BROTLI_ENC_API BROTLI_BOOL BrotliEncoderSetParameter(BrotliEncoderState *state, BrotliEncoderParameter param, uint32_t value)
Definition encode.c:146
BROTLI_ENC_API BROTLI_BOOL BrotliEncoderHasMoreOutput(BrotliEncoderState *state)
Definition encode.c:1904
BROTLI_ENC_API BROTLI_BOOL BrotliEncoderIsFinished(BrotliEncoderState *state)
Definition encode.c:1899
BROTLI_ENC_API size_t BrotliEncoderMaxCompressedSize(size_t input_size)
Definition encode.c:1426
BROTLI_ENC_API BrotliEncoderState * BrotliEncoderCreateInstance(brotli_alloc_func alloc_func, brotli_free_func free_func, void *opaque)
Definition encode.c:797
BROTLI_ENC_API const uint8_t * BrotliEncoderTakeOutput(BrotliEncoderState *state, size_t *size)
Definition encode.c:1908
BROTLI_ENC_API BROTLI_BOOL BrotliEncoderCompress(int quality, int lgwin, BrotliEncoderMode mode, size_t input_size, const uint8_t input_buffer[BROTLI_ARRAY_PARAM(input_size)], size_t *encoded_size, uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(*encoded_size)])
Definition encode.c:1247
BROTLI_ENC_API void BrotliEncoderDestroyInstance(BrotliEncoderState *state)
Definition encode.c:831
BROTLI_ENC_API uint32_t BrotliEncoderVersion(void)
Definition encode.c:1927
BrotliEncoderParameter
Definition encode.h:134
@ BROTLI_PARAM_QUALITY
Definition encode.h:147
@ BROTLI_PARAM_NDIRECT
Definition encode.h:204
@ BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING
Definition encode.h:178
@ BROTLI_PARAM_STREAM_OFFSET
Definition encode.h:220
@ BROTLI_PARAM_LARGE_WINDOW
Definition encode.h:188
@ BROTLI_PARAM_NPOSTFIX
Definition encode.h:196
@ BROTLI_PARAM_LGBLOCK
Definition encode.h:172
@ BROTLI_PARAM_SIZE_HINT
Definition encode.h:184
@ BROTLI_PARAM_LGWIN
Definition encode.h:158
@ BROTLI_PARAM_MODE
Definition encode.h:140
BrotliEncoderMode
Definition encode.h:45
@ BROTLI_MODE_TEXT
Definition encode.h:54
@ BROTLI_MODE_GENERIC
Definition encode.h:52
@ BROTLI_MODE_FONT
Definition encode.h:56
BROTLI_ENC_API BROTLI_BOOL BrotliEncoderCompressStream(BrotliEncoderState *state, BrotliEncoderOperation op, size_t *available_in, const uint8_t **next_in, size_t *available_out, uint8_t **next_out, size_t *total_out)
Definition encode.c:1810
BrotliEncoderOperation
Definition encode.h:67
@ BROTLI_OPERATION_FLUSH
Definition encode.h:90
@ BROTLI_OPERATION_EMIT_METADATA
Definition encode.h:130
@ BROTLI_OPERATION_FINISH
Definition encode.h:109
@ BROTLI_OPERATION_PROCESS
Definition encode.h:73
#define BROTLI_ENC_API
Definition port.h:285
#define BROTLI_ARRAY_PARAM(name)
Definition port.h:255
struct BrotliEncoderPreparedDictionaryStruct BrotliEncoderPreparedDictionary
Definition encode.h:275
BROTLI_ENC_API void BrotliEncoderDestroyPreparedDictionary(BrotliEncoderPreparedDictionary *dictionary)
Definition encode.c:1753
BROTLI_ENC_EXTRA_API size_t BrotliEncoderEstimatePeakMemoryUsage(int quality, int lgwin, size_t input_size)
Definition encode.c:1836
BROTLI_ENC_API BROTLI_BOOL BrotliEncoderAttachPreparedDictionary(BrotliEncoderState *state, const BrotliEncoderPreparedDictionary *dictionary)
Definition encode.c:1779
BROTLI_ENC_API BrotliEncoderPreparedDictionary * BrotliEncoderPrepareDictionary(BrotliSharedDictionaryType type, size_t data_size, const uint8_t data[BROTLI_ARRAY_PARAM(data_size)], int quality, brotli_alloc_func alloc_func, brotli_free_func free_func, void *opaque)
BROTLI_ENC_EXTRA_API size_t BrotliEncoderGetPreparedDictionarySize(const BrotliEncoderPreparedDictionary *dictionary)
Definition encode.c:1904
#define BROTLI_ENC_EXTRA_API
Definition port.h:302
BrotliSharedDictionaryType
Definition shared_dictionary.h:35
#define op
Definition encode.c:65
Definition poolTests.c:28
Definition zstd_decompress.c:306
size_t size
Definition platform.h:559
void *(* brotli_alloc_func)(void *opaque, size_t size)
Definition types.h:71
void(* brotli_free_func)(void *opaque, void *address)
Definition types.h:81
#define BROTLI_BOOL
Definition types.h:49