mirror of
https://github.com/google/brotli.git
synced 2024-11-21 19:20:09 +00:00
Internal change
PiperOrigin-RevId: 623073126
This commit is contained in:
parent
cdbe7fc739
commit
f964a1e8ac
@ -17,24 +17,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BROTLI_REPORTING
|
|
||||||
/* When BROTLI_REPORTING is defined extra reporting module have to be linked. */
|
|
||||||
void BrotliDecoderOnStart(const BrotliDecoderState* s);
|
|
||||||
void BrotliDecoderOnFinish(const BrotliDecoderState* s);
|
|
||||||
#define BROTLI_DECODER_ON_START(s) BrotliDecoderOnStart(s);
|
|
||||||
#define BROTLI_DECODER_ON_FINISH(s) BrotliDecoderOnFinish(s);
|
|
||||||
#else
|
|
||||||
#if !defined(BROTLI_DECODER_ON_START)
|
|
||||||
#define BROTLI_DECODER_ON_START(s) (void)(s);
|
|
||||||
#endif
|
|
||||||
#if !defined(BROTLI_DECODER_ON_FINISH)
|
|
||||||
#define BROTLI_DECODER_ON_FINISH(s) (void)(s);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BROTLI_BOOL BrotliDecoderStateInit(BrotliDecoderState* s,
|
BROTLI_BOOL BrotliDecoderStateInit(BrotliDecoderState* s,
|
||||||
brotli_alloc_func alloc_func, brotli_free_func free_func, void* opaque) {
|
brotli_alloc_func alloc_func, brotli_free_func free_func, void* opaque) {
|
||||||
BROTLI_DECODER_ON_START(s);
|
|
||||||
if (!alloc_func) {
|
if (!alloc_func) {
|
||||||
s->alloc_func = BrotliDefaultAllocFunc;
|
s->alloc_func = BrotliDefaultAllocFunc;
|
||||||
s->free_func = BrotliDefaultFreeFunc;
|
s->free_func = BrotliDefaultFreeFunc;
|
||||||
@ -151,6 +135,16 @@ void BrotliDecoderStateCleanupAfterMetablock(BrotliDecoderState* s) {
|
|||||||
BROTLI_DECODER_FREE(s, s->distance_hgroup.htrees);
|
BROTLI_DECODER_FREE(s, s->distance_hgroup.htrees);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef BROTLI_REPORTING
|
||||||
|
/* When BROTLI_REPORTING is defined extra reporting module have to be linked. */
|
||||||
|
void BrotliDecoderOnFinish(const BrotliDecoderState* s);
|
||||||
|
#define BROTLI_DECODER_ON_FINISH(s) BrotliDecoderOnFinish(s);
|
||||||
|
#else
|
||||||
|
#if !defined(BROTLI_DECODER_ON_FINISH)
|
||||||
|
#define BROTLI_DECODER_ON_FINISH(s) (void)(s);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
void BrotliDecoderStateCleanup(BrotliDecoderState* s) {
|
void BrotliDecoderStateCleanup(BrotliDecoderState* s) {
|
||||||
BrotliDecoderStateCleanupAfterMetablock(s);
|
BrotliDecoderStateCleanupAfterMetablock(s);
|
||||||
|
|
||||||
|
@ -687,23 +687,7 @@ static void BrotliEncoderCleanupParams(MemoryManager* m,
|
|||||||
BrotliCleanupSharedEncoderDictionary(m, ¶ms->dictionary);
|
BrotliCleanupSharedEncoderDictionary(m, ¶ms->dictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef BROTLI_REPORTING
|
|
||||||
/* When BROTLI_REPORTING is defined extra reporting module have to be linked. */
|
|
||||||
void BrotliEncoderOnStart(const BrotliEncoderState* s);
|
|
||||||
void BrotliEncoderOnFinish(const BrotliEncoderState* s);
|
|
||||||
#define BROTLI_ENCODER_ON_START(s) BrotliEncoderOnStart(s);
|
|
||||||
#define BROTLI_ENCODER_ON_FINISH(s) BrotliEncoderOnFinish(s);
|
|
||||||
#else
|
|
||||||
#if !defined(BROTLI_ENCODER_ON_START)
|
|
||||||
#define BROTLI_ENCODER_ON_START(s) (void)(s);
|
|
||||||
#endif
|
|
||||||
#if !defined(BROTLI_ENCODER_ON_FINISH)
|
|
||||||
#define BROTLI_ENCODER_ON_FINISH(s) (void)(s);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void BrotliEncoderInitState(BrotliEncoderState* s) {
|
static void BrotliEncoderInitState(BrotliEncoderState* s) {
|
||||||
BROTLI_ENCODER_ON_START(s);
|
|
||||||
BrotliEncoderInitParams(&s->params);
|
BrotliEncoderInitParams(&s->params);
|
||||||
s->input_pos_ = 0;
|
s->input_pos_ = 0;
|
||||||
s->num_commands_ = 0;
|
s->num_commands_ = 0;
|
||||||
@ -759,6 +743,16 @@ BrotliEncoderState* BrotliEncoderCreateInstance(
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef BROTLI_REPORTING
|
||||||
|
/* When BROTLI_REPORTING is defined extra reporting module have to be linked. */
|
||||||
|
void BrotliEncoderOnFinish(const BrotliEncoderState* s);
|
||||||
|
#define BROTLI_ENCODER_ON_FINISH(s) BrotliEncoderOnFinish(s);
|
||||||
|
#else
|
||||||
|
#if !defined(BROTLI_ENCODER_ON_FINISH)
|
||||||
|
#define BROTLI_ENCODER_ON_FINISH(s) (void)(s);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
static void BrotliEncoderCleanupState(BrotliEncoderState* s) {
|
static void BrotliEncoderCleanupState(BrotliEncoderState* s) {
|
||||||
MemoryManager* m = &s->memory_manager_;
|
MemoryManager* m = &s->memory_manager_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user