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

Classes

struct  output_info

Macros

#define LOG(...)
#define ASSERT(X)
#define NO_BITS   ((uint16_t)-1)
#define BACKREF_COUNT_BITS(HSD)
#define BACKREF_INDEX_BITS(HSD)

Enumerations

enum  HSD_state {
  HSDS_TAG_BIT , HSDS_YIELD_LITERAL , HSDS_BACKREF_INDEX_MSB , HSDS_BACKREF_INDEX_LSB ,
  HSDS_BACKREF_COUNT_MSB , HSDS_BACKREF_COUNT_LSB , HSDS_YIELD_BACKREF
}

Functions

static uint16_t get_bits (heatshrink_decoder *hsd, uint8_t count)
static void push_byte (heatshrink_decoder *hsd, output_info *oi, uint8_t byte)
heatshrink_decoderheatshrink_decoder_alloc (uint16_t input_buffer_size, uint8_t window_sz2, uint8_t lookahead_sz2)
void heatshrink_decoder_free (heatshrink_decoder *hsd)
void heatshrink_decoder_reset (heatshrink_decoder *hsd)
HSD_sink_res heatshrink_decoder_sink (heatshrink_decoder *hsd, uint8_t *in_buf, size_t size, size_t *input_size)
static HSD_state st_tag_bit (heatshrink_decoder *hsd)
static HSD_state st_yield_literal (heatshrink_decoder *hsd, output_info *oi)
static HSD_state st_backref_index_msb (heatshrink_decoder *hsd)
static HSD_state st_backref_index_lsb (heatshrink_decoder *hsd)
static HSD_state st_backref_count_msb (heatshrink_decoder *hsd)
static HSD_state st_backref_count_lsb (heatshrink_decoder *hsd)
static HSD_state st_yield_backref (heatshrink_decoder *hsd, output_info *oi)
HSD_poll_res heatshrink_decoder_poll (heatshrink_decoder *hsd, uint8_t *out_buf, size_t out_buf_size, size_t *output_size)
HSD_finish_res heatshrink_decoder_finish (heatshrink_decoder *hsd)

Macro Definition Documentation

◆ ASSERT

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

◆ BACKREF_COUNT_BITS

#define BACKREF_COUNT_BITS ( HSD)
Value:
#define HEATSHRINK_DECODER_LOOKAHEAD_BITS(BUF)
Definition heatshrink_decoder.h:33

◆ BACKREF_INDEX_BITS

#define BACKREF_INDEX_BITS ( HSD)
Value:
#define HEATSHRINK_DECODER_WINDOW_BITS(BUF)
Definition heatshrink_decoder.h:31

◆ LOG

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

◆ NO_BITS

#define NO_BITS   ((uint16_t)-1)

Enumeration Type Documentation

◆ HSD_state

enum HSD_state
Enumerator
HSDS_TAG_BIT 
HSDS_YIELD_LITERAL 
HSDS_BACKREF_INDEX_MSB 
HSDS_BACKREF_INDEX_LSB 
HSDS_BACKREF_COUNT_MSB 
HSDS_BACKREF_COUNT_LSB 
HSDS_YIELD_BACKREF 

Function Documentation

◆ get_bits()

uint16_t get_bits ( heatshrink_decoder * hsd,
uint8_t count )
static
Here is the caller graph for this function:

◆ heatshrink_decoder_alloc()

heatshrink_decoder * heatshrink_decoder_alloc ( uint16_t input_buffer_size,
uint8_t window_sz2,
uint8_t lookahead_sz2 )
Here is the call graph for this function:

◆ heatshrink_decoder_finish()

HSD_finish_res heatshrink_decoder_finish ( heatshrink_decoder * hsd)

◆ heatshrink_decoder_free()

void heatshrink_decoder_free ( heatshrink_decoder * hsd)

◆ heatshrink_decoder_poll()

HSD_poll_res heatshrink_decoder_poll ( heatshrink_decoder * hsd,
uint8_t * out_buf,
size_t out_buf_size,
size_t * output_size )
Here is the call graph for this function:

◆ heatshrink_decoder_reset()

void heatshrink_decoder_reset ( heatshrink_decoder * hsd)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ heatshrink_decoder_sink()

HSD_sink_res heatshrink_decoder_sink ( heatshrink_decoder * hsd,
uint8_t * in_buf,
size_t size,
size_t * input_size )

◆ push_byte()

void push_byte ( heatshrink_decoder * hsd,
output_info * oi,
uint8_t byte )
static
Here is the caller graph for this function:

◆ st_backref_count_lsb()

HSD_state st_backref_count_lsb ( heatshrink_decoder * hsd)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ st_backref_count_msb()

HSD_state st_backref_count_msb ( heatshrink_decoder * hsd)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ st_backref_index_lsb()

HSD_state st_backref_index_lsb ( heatshrink_decoder * hsd)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ st_backref_index_msb()

HSD_state st_backref_index_msb ( heatshrink_decoder * hsd)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ st_tag_bit()

HSD_state st_tag_bit ( heatshrink_decoder * hsd)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ st_yield_backref()

HSD_state st_yield_backref ( heatshrink_decoder * hsd,
output_info * oi )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ st_yield_literal()

HSD_state st_yield_literal ( heatshrink_decoder * hsd,
output_info * oi )
static
Here is the call graph for this function:
Here is the caller graph for this function: