MeterLogger
|
Go to the source code of this file.
Data Structures | |
struct | output_info |
Macros | |
#define | LOG(...) /* no-op */ |
#define | ASSERT(X) /* no-op */ |
#define | MATCH_NOT_FOUND ((uint16_t)-1) |
Enumerations | |
enum | HSE_state { HSES_NOT_FULL, HSES_FILLED, HSES_SEARCH, HSES_YIELD_TAG_BIT, HSES_YIELD_LITERAL, HSES_YIELD_BR_INDEX, HSES_YIELD_BR_LENGTH, HSES_SAVE_BACKLOG, HSES_FLUSH_BITS, HSES_DONE } |
enum | { FLAG_IS_FINISHING = 0x01, FLAG_HAS_LITERAL = 0x02, FLAG_ON_FINAL_LITERAL = 0x04, FLAG_BACKLOG_IS_PARTIAL = 0x08, FLAG_BACKLOG_IS_FILLED = 0x10 } |
#define ASSERT | ( | X | ) | /* no-op */ |
Definition at line 39 of file heatshrink_encoder.c.
Referenced by push_bits(), and st_step_search().
#define LOG | ( | ... | ) | /* no-op */ |
Definition at line 38 of file heatshrink_encoder.c.
Referenced by add_tag_bit(), find_longest_match(), heatshrink_encoder_alloc(), heatshrink_encoder_finish(), heatshrink_encoder_poll(), heatshrink_encoder_sink(), push_bits(), push_literal_byte(), push_outgoing_bits(), st_flush_bit_buffer(), st_save_backlog(), st_step_search(), st_yield_br_index(), and st_yield_br_length().
#define MATCH_NOT_FOUND ((uint16_t)-1) |
Definition at line 57 of file heatshrink_encoder.c.
Referenced by find_longest_match(), and st_step_search().
anonymous enum |
Enumerator | |
---|---|
FLAG_IS_FINISHING | |
FLAG_HAS_LITERAL | |
FLAG_ON_FINAL_LITERAL | |
FLAG_BACKLOG_IS_PARTIAL | |
FLAG_BACKLOG_IS_FILLED |
Definition at line 43 of file heatshrink_encoder.c.
enum HSE_state |
Enumerator | |
---|---|
HSES_NOT_FULL | |
HSES_FILLED | |
HSES_SEARCH | |
HSES_YIELD_TAG_BIT | |
HSES_YIELD_LITERAL | |
HSES_YIELD_BR_INDEX | |
HSES_YIELD_BR_LENGTH | |
HSES_SAVE_BACKLOG | |
HSES_FLUSH_BITS | |
HSES_DONE |
Definition at line 6 of file heatshrink_encoder.c.
|
static |
Definition at line 413 of file heatshrink_encoder.c.
References LOG, and push_bits().
Referenced by st_yield_tag_bit().
|
static |
Definition at line 479 of file heatshrink_encoder.c.
References FLAG_BACKLOG_IS_FILLED, and heatshrink_encoder::flags.
Referenced by st_step_search().
|
static |
Definition at line 475 of file heatshrink_encoder.c.
References FLAG_BACKLOG_IS_PARTIAL, and heatshrink_encoder::flags.
Referenced by save_backlog(), and st_step_search().
|
static |
Definition at line 491 of file heatshrink_encoder.c.
References output_info::buf_size, and output_info::output_size.
Referenced by st_flush_bit_buffer(), st_yield_br_index(), st_yield_br_length(), st_yield_literal(), and st_yield_tag_bit().
|
static |
Definition at line 432 of file heatshrink_encoder.c.
References heatshrink_encoder::buffer, get_input_offset(), HEATSHRINK_ENCODER_INDEX, hs_index::index, heatshrink_encoder::input_size, and memset.
Referenced by heatshrink_encoder_poll(), and heatshrink_encoder_sink().
|
static |
Definition at line 497 of file heatshrink_encoder.c.
References heatshrink_encoder::buffer, HEATSHRINK_ENCODER_INDEX, hs_index::index, LOG, and MATCH_NOT_FOUND.
Referenced by heatshrink_encoder_sink(), and st_step_search().
|
static |
Definition at line 422 of file heatshrink_encoder.c.
References HEATSHRINK_ENCODER_WINDOW_BITS.
Referenced by get_input_offset(), heatshrink_encoder_alloc(), heatshrink_encoder_sink(), save_backlog(), and st_step_search().
|
static |
Definition at line 418 of file heatshrink_encoder.c.
References get_input_buffer_size().
Referenced by do_indexing(), heatshrink_encoder_sink(), push_literal_byte(), and st_step_search().
|
static |
Definition at line 427 of file heatshrink_encoder.c.
References HEATSHRINK_ENCODER_LOOKAHEAD_BITS.
Referenced by st_step_search().
|
static |
Definition at line 487 of file heatshrink_encoder.c.
References FLAG_HAS_LITERAL, and heatshrink_encoder::flags.
Referenced by st_save_backlog().
heatshrink_encoder* heatshrink_encoder_alloc | ( | uint8_t | window_sz2, |
uint8_t | lookahead_sz2 | ||
) |
Definition at line 78 of file heatshrink_encoder.c.
References get_input_buffer_size(), heatshrink_encoder_reset(), HEATSHRINK_FREE, HEATSHRINK_MALLOC, HEATSHRINK_MAX_WINDOW_BITS, HEATSHRINK_MIN_LOOKAHEAD_BITS, HEATSHRINK_MIN_WINDOW_BITS, hse, LOG, heatshrink_encoder::lookahead_sz2, NULL, heatshrink_encoder::search_index, hs_index::size, and heatshrink_encoder::window_sz2.
Referenced by compress_and_expand_and_check(), data_with_simple_repetition_should_match_with_absurdly_tiny_buffers(), data_without_duplication_should_match_with_absurdly_tiny_buffers(), encode(), encoder_alloc_should_reject_invalid_arguments(), encoder_poll_should_detect_repeated_substring(), encoder_poll_should_detect_repeated_substring_and_preserve_trailing_literal(), encoder_poll_should_indicate_when_no_input_is_provided(), encoder_poll_should_reject_nulls(), encoder_should_emit_data_without_repetitions_as_literal_sequence(), encoder_should_emit_series_of_same_byte_as_literal_then_backref(), encoder_sink_should_accept_input_when_it_will_fit(), encoder_sink_should_accept_partial_input_when_some_will_fit(), encoder_sink_should_reject_nulls(), and gen().
HSE_finish_res heatshrink_encoder_finish | ( | heatshrink_encoder * | hse | ) |
Definition at line 260 of file heatshrink_encoder.c.
References FLAG_IS_FINISHING, heatshrink_encoder::flags, HSER_FINISH_DONE, HSER_FINISH_ERROR_NULL, HSER_FINISH_MORE, HSES_DONE, HSES_FILLED, HSES_NOT_FULL, LOG, NULL, and heatshrink_encoder::state.
Referenced by compress_and_expand_and_check(), data_with_simple_repetition_should_match_with_absurdly_tiny_buffers(), data_without_duplication_should_match_with_absurdly_tiny_buffers(), encoder_finish_should_reject_nulls(), encoder_poll_should_detect_repeated_substring(), encoder_poll_should_detect_repeated_substring_and_preserve_trailing_literal(), encoder_should_emit_data_without_repetitions_as_literal_sequence(), encoder_should_emit_series_of_same_byte_as_literal_then_backref(), encoder_sink_read(), and gen().
void heatshrink_encoder_free | ( | heatshrink_encoder * | hse | ) |
Definition at line 114 of file heatshrink_encoder.c.
References HEATSHRINK_ENCODER_WINDOW_BITS, and HEATSHRINK_FREE.
Referenced by compress_and_expand_and_check(), data_with_simple_repetition_should_match_with_absurdly_tiny_buffers(), data_without_duplication_should_match_with_absurdly_tiny_buffers(), encode(), encoder_poll_should_detect_repeated_substring(), encoder_poll_should_detect_repeated_substring_and_preserve_trailing_literal(), encoder_poll_should_indicate_when_no_input_is_provided(), encoder_poll_should_reject_nulls(), encoder_should_emit_data_without_repetitions_as_literal_sequence(), encoder_should_emit_series_of_same_byte_as_literal_then_backref(), encoder_sink_should_accept_input_when_it_will_fit(), encoder_sink_should_accept_partial_input_when_some_will_fit(), encoder_sink_should_reject_nulls(), and gen().
HSE_poll_res heatshrink_encoder_poll | ( | heatshrink_encoder * | hse, |
uint8_t * | out_buf, | ||
size_t | out_buf_size, | ||
size_t * | output_size | ||
) |
Definition at line 198 of file heatshrink_encoder.c.
References output_info::buf, output_info::buf_size, do_indexing(), heatshrink_encoder::flags, HSER_POLL_EMPTY, HSER_POLL_ERROR_MISUSE, HSER_POLL_ERROR_NULL, HSER_POLL_MORE, HSES_DONE, HSES_FILLED, HSES_FLUSH_BITS, HSES_NOT_FULL, HSES_SAVE_BACKLOG, HSES_SEARCH, HSES_YIELD_BR_INDEX, HSES_YIELD_BR_LENGTH, HSES_YIELD_LITERAL, HSES_YIELD_TAG_BIT, LOG, NULL, output_info::output_size, st_flush_bit_buffer(), st_save_backlog(), st_step_search(), st_yield_br_index(), st_yield_br_length(), st_yield_literal(), st_yield_tag_bit(), and heatshrink_encoder::state.
Referenced by compress_and_expand_and_check(), data_with_simple_repetition_should_match_with_absurdly_tiny_buffers(), data_without_duplication_should_match_with_absurdly_tiny_buffers(), encoder_poll_should_detect_repeated_substring(), encoder_poll_should_detect_repeated_substring_and_preserve_trailing_literal(), encoder_poll_should_indicate_when_no_input_is_provided(), encoder_poll_should_reject_nulls(), encoder_should_emit_data_without_repetitions_as_literal_sequence(), encoder_should_emit_series_of_same_byte_as_literal_then_backref(), encoder_sink_read(), and gen().
void heatshrink_encoder_reset | ( | heatshrink_encoder * | hse | ) |
Definition at line 126 of file heatshrink_encoder.c.
References heatshrink_encoder::bit_index, heatshrink_encoder::buffer, heatshrink_encoder::current_byte, heatshrink_encoder::flags, HEATSHRINK_ENCODER_WINDOW_BITS, HSES_NOT_FULL, heatshrink_encoder::input_size, heatshrink_encoder::match_length, heatshrink_encoder::match_scan_index, memset, heatshrink_encoder::outgoing_bits, heatshrink_encoder::outgoing_bits_count, and heatshrink_encoder::state.
Referenced by compress_and_expand_and_check(), and heatshrink_encoder_alloc().
HSE_sink_res heatshrink_encoder_sink | ( | heatshrink_encoder * | hse, |
uint8_t * | in_buf, | ||
size_t | size, | ||
size_t * | input_size | ||
) |
Definition at line 145 of file heatshrink_encoder.c.
References heatshrink_encoder::buffer, do_indexing(), find_longest_match(), get_input_buffer_size(), get_input_offset(), hse, HSER_SINK_ERROR_MISUSE, HSER_SINK_ERROR_NULL, HSER_SINK_OK, HSES_FILLED, HSES_NOT_FULL, heatshrink_encoder::input_size, is_finishing(), LOG, memcpy, NULL, hs_index::size, st_flush_bit_buffer(), st_save_backlog(), st_step_search(), st_yield_br_index(), st_yield_br_length(), st_yield_literal(), st_yield_tag_bit(), and heatshrink_encoder::state.
Referenced by compress_and_expand_and_check(), data_with_simple_repetition_should_match_with_absurdly_tiny_buffers(), data_without_duplication_should_match_with_absurdly_tiny_buffers(), encoder_poll_should_detect_repeated_substring(), encoder_poll_should_detect_repeated_substring_and_preserve_trailing_literal(), encoder_should_emit_data_without_repetitions_as_literal_sequence(), encoder_should_emit_series_of_same_byte_as_literal_then_backref(), encoder_sink_read(), encoder_sink_should_accept_input_when_it_will_fit(), encoder_sink_should_accept_partial_input_when_some_will_fit(), encoder_sink_should_reject_nulls(), and gen().
|
static |
Definition at line 471 of file heatshrink_encoder.c.
References FLAG_IS_FINISHING, and heatshrink_encoder::flags.
Referenced by heatshrink_encoder_sink(), st_save_backlog(), and st_step_search().
|
static |
Definition at line 483 of file heatshrink_encoder.c.
References FLAG_ON_FINAL_LITERAL, and heatshrink_encoder::flags.
Referenced by st_yield_literal().
|
static |
Definition at line 587 of file heatshrink_encoder.c.
References ASSERT, heatshrink_encoder::bit_index, output_info::buf, heatshrink_encoder::current_byte, LOG, and output_info::output_size.
Referenced by add_tag_bit(), push_literal_byte(), and push_outgoing_bits().
|
static |
Definition at line 615 of file heatshrink_encoder.c.
References heatshrink_encoder::buffer, get_input_offset(), isprint, LOG, heatshrink_encoder::match_scan_index, and push_bits().
Referenced by st_yield_literal().
|
static |
Definition at line 566 of file heatshrink_encoder.c.
References LOG, heatshrink_encoder::outgoing_bits, heatshrink_encoder::outgoing_bits_count, and push_bits().
Referenced by st_yield_br_index(), and st_yield_br_length().
|
static |
Definition at line 624 of file heatshrink_encoder.c.
References backlog_is_partial(), heatshrink_encoder::buffer, FLAG_BACKLOG_IS_FILLED, FLAG_BACKLOG_IS_PARTIAL, heatshrink_encoder::flags, get_input_buffer_size(), heatshrink_encoder::input_size, and heatshrink_encoder::match_scan_index.
Referenced by st_save_backlog().
|
static |
Definition at line 398 of file heatshrink_encoder.c.
References heatshrink_encoder::bit_index, output_info::buf, can_take_byte(), heatshrink_encoder::current_byte, HSES_DONE, HSES_FLUSH_BITS, LOG, and output_info::output_size.
Referenced by heatshrink_encoder_poll(), and heatshrink_encoder_sink().
|
static |
Definition at line 382 of file heatshrink_encoder.c.
References FLAG_ON_FINAL_LITERAL, heatshrink_encoder::flags, has_literal(), HSES_FLUSH_BITS, HSES_NOT_FULL, HSES_YIELD_TAG_BIT, is_finishing(), LOG, and save_backlog().
Referenced by heatshrink_encoder_poll(), and heatshrink_encoder_sink().
|
static |
Definition at line 268 of file heatshrink_encoder.c.
References ASSERT, backlog_is_filled(), backlog_is_partial(), find_longest_match(), FLAG_HAS_LITERAL, heatshrink_encoder::flags, get_input_buffer_size(), get_input_offset(), get_lookahead_size(), HSES_SAVE_BACKLOG, HSES_YIELD_TAG_BIT, heatshrink_encoder::input_size, is_finishing(), LOG, heatshrink_encoder::match_length, MATCH_NOT_FOUND, heatshrink_encoder::match_pos, heatshrink_encoder::match_scan_index, and heatshrink_encoder::window_sz2.
Referenced by heatshrink_encoder_poll(), and heatshrink_encoder_sink().
|
static |
Definition at line 350 of file heatshrink_encoder.c.
References can_take_byte(), HEATSHRINK_ENCODER_LOOKAHEAD_BITS, HSES_YIELD_BR_INDEX, HSES_YIELD_BR_LENGTH, LOG, heatshrink_encoder::match_length, heatshrink_encoder::match_pos, heatshrink_encoder::outgoing_bits, heatshrink_encoder::outgoing_bits_count, and push_outgoing_bits().
Referenced by heatshrink_encoder_poll(), and heatshrink_encoder_sink().
|
static |
Definition at line 366 of file heatshrink_encoder.c.
References can_take_byte(), HSES_SEARCH, HSES_YIELD_BR_LENGTH, LOG, heatshrink_encoder::match_length, heatshrink_encoder::match_scan_index, and push_outgoing_bits().
Referenced by heatshrink_encoder_poll(), and heatshrink_encoder_sink().
|
static |
Definition at line 338 of file heatshrink_encoder.c.
References can_take_byte(), FLAG_HAS_LITERAL, heatshrink_encoder::flags, HSES_FLUSH_BITS, HSES_SEARCH, HSES_YIELD_LITERAL, HSES_YIELD_TAG_BIT, heatshrink_encoder::match_length, on_final_literal(), and push_literal_byte().
Referenced by heatshrink_encoder_poll(), and heatshrink_encoder_sink().
|
static |
Definition at line 321 of file heatshrink_encoder.c.
References add_tag_bit(), can_take_byte(), HEATSHRINK_BACKREF_MARKER, HEATSHRINK_ENCODER_WINDOW_BITS, HEATSHRINK_LITERAL_MARKER, HSES_YIELD_BR_INDEX, HSES_YIELD_LITERAL, HSES_YIELD_TAG_BIT, heatshrink_encoder::match_length, heatshrink_encoder::match_pos, heatshrink_encoder::outgoing_bits, and heatshrink_encoder::outgoing_bits_count.
Referenced by heatshrink_encoder_poll(), and heatshrink_encoder_sink().