libosmocore 1.9.0.192-1c24
Osmocom core library
Convolutional encoding and decoding routines

Osmocom convolutional encoder and decoder. More...

Files

file  conv.h
 Osmocom convolutional encoder and decoder.
 
file  conv.c
 Generic convolutional encoding / decoding.
 

Data Structures

struct  osmo_conv_code
 structure describing a given convolutional code More...
 
struct  osmo_conv_encoder
 convolutional encoder state More...
 
struct  osmo_conv_decoder
 convolutional decoder state More...
 

Macros

#define MAX_AE   0x00ffffff
 

Enumerations

enum  osmo_conv_term {
  CONV_TERM_FLUSH = 0 ,
  CONV_TERM_TRUNCATION ,
  CONV_TERM_TAIL_BITING
}
 possibe termination types More...
 

Functions

int osmo_conv_get_input_length (const struct osmo_conv_code *code, int len)
 
int osmo_conv_get_output_length (const struct osmo_conv_code *code, int len)
 
void osmo_conv_encode_init (struct osmo_conv_encoder *encoder, const struct osmo_conv_code *code)
 Initialize a convolutional encoder. More...
 
void osmo_conv_encode_load_state (struct osmo_conv_encoder *encoder, const ubit_t *input)
 
int osmo_conv_encode_raw (struct osmo_conv_encoder *encoder, const ubit_t *input, ubit_t *output, int n)
 
int osmo_conv_encode_flush (struct osmo_conv_encoder *encoder, ubit_t *output)
 
int osmo_conv_encode (const struct osmo_conv_code *code, const ubit_t *input, ubit_t *output)
 All-in-one convolutional encoding function. More...
 
void osmo_conv_decode_init (struct osmo_conv_decoder *decoder, const struct osmo_conv_code *code, int len, int start_state)
 
void osmo_conv_decode_reset (struct osmo_conv_decoder *decoder, int start_state)
 
void osmo_conv_decode_rewind (struct osmo_conv_decoder *decoder)
 
void osmo_conv_decode_deinit (struct osmo_conv_decoder *decoder)
 
int osmo_conv_decode_scan (struct osmo_conv_decoder *decoder, const sbit_t *input, int n)
 
int osmo_conv_decode_flush (struct osmo_conv_decoder *decoder, const sbit_t *input)
 
int osmo_conv_decode_get_best_end_state (struct osmo_conv_decoder *decoder)
 
int osmo_conv_decode_get_output (struct osmo_conv_decoder *decoder, ubit_t *output, int has_flush, int end_state)
 
int osmo_conv_decode (const struct osmo_conv_code *code, const sbit_t *input, ubit_t *output)
 All-in-one convolutional decoding function. More...
 
static int _conv_encode_do_output (struct osmo_conv_encoder *encoder, uint8_t out, ubit_t *output)
 
int osmo_conv_decode_acc (const struct osmo_conv_code *code, const sbit_t *input, ubit_t *output)
 

Detailed Description

Osmocom convolutional encoder and decoder.

Macro Definition Documentation

◆ MAX_AE

#define MAX_AE   0x00ffffff

Enumeration Type Documentation

◆ osmo_conv_term

possibe termination types

The termination type will determine which state the encoder/decoder can start/end with. This is mostly taken care of in the high level API call. So if you use the low level API, you must take care of making the proper calls yourself.

Enumerator
CONV_TERM_FLUSH 

Flush encoder state.

CONV_TERM_TRUNCATION 

Direct truncation.

CONV_TERM_TAIL_BITING 

Tail biting.

Function Documentation

◆ _conv_encode_do_output()

static int _conv_encode_do_output ( struct osmo_conv_encoder encoder,
uint8_t  out,
ubit_t output 
)
inlinestatic

◆ osmo_conv_decode()

int osmo_conv_decode ( const struct osmo_conv_code code,
const sbit_t input,
ubit_t output 
)

◆ osmo_conv_decode_acc()

◆ osmo_conv_decode_deinit()

void osmo_conv_decode_deinit ( struct osmo_conv_decoder decoder)

◆ osmo_conv_decode_flush()

◆ osmo_conv_decode_get_best_end_state()

◆ osmo_conv_decode_get_output()

◆ osmo_conv_decode_init()

◆ osmo_conv_decode_reset()

void osmo_conv_decode_reset ( struct osmo_conv_decoder decoder,
int  start_state 
)

◆ osmo_conv_decode_rewind()

void osmo_conv_decode_rewind ( struct osmo_conv_decoder decoder)

◆ osmo_conv_decode_scan()

◆ osmo_conv_encode()

int osmo_conv_encode ( const struct osmo_conv_code code,
const ubit_t input,
ubit_t output 
)

All-in-one convolutional encoding function.

Parameters
[in]codedescription of convolutional code to be used
[in]inputarray of unpacked bits (uncoded)
[out]outputarray of unpacked bits (encoded)
Returns
Number of produced output bits

This is an all-in-one function, taking care of osmo_conv_init, osmo_conv_encode_load_state, osmo_conv_encode_raw and osmo_conv_encode_flush as needed.

References osmo_conv_encoder::code, CONV_TERM_FLUSH, CONV_TERM_TAIL_BITING, osmo_conv_code::K, l, osmo_conv_code::len, osmo_conv_encode_flush(), osmo_conv_encode_init(), osmo_conv_encode_load_state(), osmo_conv_encode_raw(), and osmo_conv_code::term.

◆ osmo_conv_encode_flush()

◆ osmo_conv_encode_init()

void osmo_conv_encode_init ( struct osmo_conv_encoder encoder,
const struct osmo_conv_code code 
)

Initialize a convolutional encoder.

Parameters
[in,out]encoderEncoder state to initialize
[in]codeDescription of convolutional code

References osmo_conv_encoder::code, and OSMO_ASSERT.

Referenced by osmo_conv_encode().

◆ osmo_conv_encode_load_state()

void osmo_conv_encode_load_state ( struct osmo_conv_encoder encoder,
const ubit_t input 
)

◆ osmo_conv_encode_raw()

int osmo_conv_encode_raw ( struct osmo_conv_encoder encoder,
const ubit_t input,
ubit_t output,
int  n 
)

◆ osmo_conv_get_input_length()

int osmo_conv_get_input_length ( const struct osmo_conv_code code,
int  len 
)

References len(), and osmo_conv_code::len.

Referenced by osmo_conv_get_output_length().

◆ osmo_conv_get_output_length()

int osmo_conv_get_output_length ( const struct osmo_conv_code code,
int  len 
)