| OLD | NEW |
| 1 /* Copyright 2015 Google Inc. All Rights Reserved. | 1 /* Copyright 2015 Google Inc. All Rights Reserved. |
| 2 | 2 |
| 3 Distributed under MIT license. | 3 Distributed under MIT license. |
| 4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT | 4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #include "./state.h" | 7 #include "./state.h" |
| 8 | 8 |
| 9 #include <stdlib.h> /* free, malloc */ | 9 #include <stdlib.h> /* free, malloc */ |
| 10 | 10 |
| 11 #include "./huffman.h" | 11 #include "./huffman.h" |
| 12 #include "./types.h" | 12 #include "./types.h" |
| 13 | 13 |
| 14 #if defined(__cplusplus) || defined(c_plusplus) | 14 #if defined(__cplusplus) || defined(c_plusplus) |
| 15 extern "C" { | 15 extern "C" { |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 /* Declared in decode.h */ |
| 19 int BrotliStateIsStreamStart(const BrotliState* s); |
| 20 int BrotliStateIsStreamEnd(const BrotliState* s); |
| 21 |
| 18 static void* DefaultAllocFunc(void* opaque, size_t size) { | 22 static void* DefaultAllocFunc(void* opaque, size_t size) { |
| 19 BROTLI_UNUSED(opaque); | 23 BROTLI_UNUSED(opaque); |
| 20 return malloc(size); | 24 return malloc(size); |
| 21 } | 25 } |
| 22 | 26 |
| 23 static void DefaultFreeFunc(void* opaque, void* address) { | 27 static void DefaultFreeFunc(void* opaque, void* address) { |
| 24 BROTLI_UNUSED(opaque); | 28 BROTLI_UNUSED(opaque); |
| 25 free(address); | 29 free(address); |
| 26 } | 30 } |
| 27 | 31 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 73 |
| 70 s->sub_loop_counter = 0; | 74 s->sub_loop_counter = 0; |
| 71 | 75 |
| 72 s->literal_hgroup.codes = NULL; | 76 s->literal_hgroup.codes = NULL; |
| 73 s->literal_hgroup.htrees = NULL; | 77 s->literal_hgroup.htrees = NULL; |
| 74 s->insert_copy_hgroup.codes = NULL; | 78 s->insert_copy_hgroup.codes = NULL; |
| 75 s->insert_copy_hgroup.htrees = NULL; | 79 s->insert_copy_hgroup.htrees = NULL; |
| 76 s->distance_hgroup.codes = NULL; | 80 s->distance_hgroup.codes = NULL; |
| 77 s->distance_hgroup.htrees = NULL; | 81 s->distance_hgroup.htrees = NULL; |
| 78 | 82 |
| 79 | |
| 80 s->custom_dict = NULL; | 83 s->custom_dict = NULL; |
| 81 s->custom_dict_size = 0; | 84 s->custom_dict_size = 0; |
| 82 | 85 |
| 83 s->is_last_metablock = 0; | 86 s->is_last_metablock = 0; |
| 84 s->window_bits = 0; | 87 s->window_bits = 0; |
| 85 s->max_distance = 0; | 88 s->max_distance = 0; |
| 86 s->dist_rb[0] = 16; | 89 s->dist_rb[0] = 16; |
| 87 s->dist_rb[1] = 15; | 90 s->dist_rb[1] = 15; |
| 88 s->dist_rb[2] = 11; | 91 s->dist_rb[2] = 11; |
| 89 s->dist_rb[3] = 4; | 92 s->dist_rb[3] = 4; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 172 } |
| 170 | 173 |
| 171 void BrotliHuffmanTreeGroupRelease(BrotliState* s, HuffmanTreeGroup* group) { | 174 void BrotliHuffmanTreeGroupRelease(BrotliState* s, HuffmanTreeGroup* group) { |
| 172 BROTLI_FREE(s, group->codes); | 175 BROTLI_FREE(s, group->codes); |
| 173 group->htrees = NULL; | 176 group->htrees = NULL; |
| 174 } | 177 } |
| 175 | 178 |
| 176 #if defined(__cplusplus) || defined(c_plusplus) | 179 #if defined(__cplusplus) || defined(c_plusplus) |
| 177 } /* extern "C" */ | 180 } /* extern "C" */ |
| 178 #endif | 181 #endif |
| OLD | NEW |