CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
heatshrink_encoder.c File Reference
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "compression/heatshrink_lib/heatshrink_encoder.h"
Include dependency graph for heatshrink_encoder.c:

Classes

struct  output_info

Macros

#define LOG(...)
#define ASSERT(X)
#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 }

Functions

static uint16_t get_input_offset (heatshrink_encoder *hse)
static uint16_t get_input_buffer_size (heatshrink_encoder *hse)
static uint16_t get_lookahead_size (heatshrink_encoder *hse)
static void add_tag_bit (heatshrink_encoder *hse, output_info *oi, uint8_t tag)
static int can_take_byte (output_info *oi)
static int is_finishing (heatshrink_encoder *hse)
static void save_backlog (heatshrink_encoder *hse)
static void push_bits (heatshrink_encoder *hse, uint8_t count, uint8_t bits, output_info *oi)
static uint8_t push_outgoing_bits (heatshrink_encoder *hse, output_info *oi)
static void push_literal_byte (heatshrink_encoder *hse, output_info *oi)
void heatshrink_encoder_reset (heatshrink_encoder *hse)
HSE_sink_res heatshrink_encoder_sink (heatshrink_encoder *hse, uint8_t *in_buf, size_t size, size_t *input_size)
static uint16_t find_longest_match (heatshrink_encoder *hse, uint16_t start, uint16_t end, const uint16_t maxlen, uint16_t *match_length)
static void do_indexing (heatshrink_encoder *hse)
static HSE_state st_step_search (heatshrink_encoder *hse)
static HSE_state st_yield_tag_bit (heatshrink_encoder *hse, output_info *oi)
static HSE_state st_yield_literal (heatshrink_encoder *hse, output_info *oi)
static HSE_state st_yield_br_index (heatshrink_encoder *hse, output_info *oi)
static HSE_state st_yield_br_length (heatshrink_encoder *hse, output_info *oi)
static HSE_state st_save_backlog (heatshrink_encoder *hse)
static HSE_state st_flush_bit_buffer (heatshrink_encoder *hse, output_info *oi)
HSE_poll_res heatshrink_encoder_poll (heatshrink_encoder *hse, uint8_t *out_buf, size_t out_buf_size, size_t *output_size)
HSE_finish_res heatshrink_encoder_finish (heatshrink_encoder *hse)

Macro Definition Documentation

◆ ASSERT

#define ASSERT ( X)
Value:
/* no-op */

◆ LOG

#define LOG ( ...)
Value:
/* no-op */

◆ MATCH_NOT_FOUND

#define MATCH_NOT_FOUND   ((uint16_t)-1)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FLAG_IS_FINISHING 

◆ HSE_state

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 

Function Documentation

◆ add_tag_bit()

void add_tag_bit ( heatshrink_encoder * hse,
output_info * oi,
uint8_t tag )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ can_take_byte()

int can_take_byte ( output_info * oi)
static
Here is the caller graph for this function:

◆ do_indexing()

void do_indexing ( heatshrink_encoder * hse)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_longest_match()

uint16_t find_longest_match ( heatshrink_encoder * hse,
uint16_t start,
uint16_t end,
const uint16_t maxlen,
uint16_t * match_length )
static
Here is the caller graph for this function:

◆ get_input_buffer_size()

uint16_t get_input_buffer_size ( heatshrink_encoder * hse)
static
Here is the caller graph for this function:

◆ get_input_offset()

uint16_t get_input_offset ( heatshrink_encoder * hse)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_lookahead_size()

uint16_t get_lookahead_size ( heatshrink_encoder * hse)
static
Here is the caller graph for this function:

◆ heatshrink_encoder_finish()

HSE_finish_res heatshrink_encoder_finish ( heatshrink_encoder * hse)
Here is the caller graph for this function:

◆ heatshrink_encoder_poll()

HSE_poll_res heatshrink_encoder_poll ( heatshrink_encoder * hse,
uint8_t * out_buf,
size_t out_buf_size,
size_t * output_size )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ heatshrink_encoder_reset()

void heatshrink_encoder_reset ( heatshrink_encoder * hse)
Here is the call graph for this function:

◆ heatshrink_encoder_sink()

HSE_sink_res heatshrink_encoder_sink ( heatshrink_encoder * hse,
uint8_t * in_buf,
size_t size,
size_t * input_size )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_finishing()

int is_finishing ( heatshrink_encoder * hse)
static
Here is the caller graph for this function:

◆ push_bits()

void push_bits ( heatshrink_encoder * hse,
uint8_t count,
uint8_t bits,
output_info * oi )
static
Here is the caller graph for this function:

◆ push_literal_byte()

void push_literal_byte ( heatshrink_encoder * hse,
output_info * oi )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_outgoing_bits()

uint8_t push_outgoing_bits ( heatshrink_encoder * hse,
output_info * oi )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ save_backlog()

void save_backlog ( heatshrink_encoder * hse)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ st_flush_bit_buffer()

HSE_state st_flush_bit_buffer ( heatshrink_encoder * hse,
output_info * oi )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ st_save_backlog()

HSE_state st_save_backlog ( heatshrink_encoder * hse)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ st_step_search()

HSE_state st_step_search ( heatshrink_encoder * hse)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ st_yield_br_index()

HSE_state st_yield_br_index ( heatshrink_encoder * hse,
output_info * oi )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ st_yield_br_length()

HSE_state st_yield_br_length ( heatshrink_encoder * hse,
output_info * oi )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ st_yield_literal()

HSE_state st_yield_literal ( heatshrink_encoder * hse,
output_info * oi )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ st_yield_tag_bit()

HSE_state st_yield_tag_bit ( heatshrink_encoder * hse,
output_info * oi )
static
Here is the call graph for this function:
Here is the caller graph for this function: