Convolutional encoding and decoding routines

## Files

file | conv.h
file | conv.c

## 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_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)

## Detailed Description

## Enumeration Type Documentation

enum 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

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

All-in-one convolutional decoding function.

Parameters

  [in] | code | description of convolutional code to be used
  [in] | input | array of soft bits (coded)
  [out] | output | array of unpacked bits (decoded)

This is an all-in-one function, taking care of osmo_conv_decode_init, osmo_conv_decode_scan, osmo_conv_decode_flush, osmo_conv_decode_get_output and osmo_conv_decode_deinit.

References CONV_TERM_FLUSH, CONV_TERM_TAIL_BITING, osmo_conv_code::len, and osmo_conv_code::term.

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] | code | description of convolutional code to be used
  [in] | input | array of unpacked bits (uncoded)
  [out] | output | array 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_decoder::ae, osmo_conv_decoder::ae_next, osmo_conv_encoder::code, osmo_conv_decoder::code, CONV_TERM_FLUSH, CONV_TERM_TAIL_BITING, osmo_conv_code::K, osmo_conv_code::len, osmo_conv_decoder::len, osmo_conv_code::N, osmo_conv_decoder::n_states, osmo_conv_code::next_output, osmo_conv_code::next_state, osmo_conv_code::next_term_output, osmo_conv_code::next_term_state, osmo_conv_decoder::o_idx, osmo_conv_encode_init(), osmo_conv_decoder::p_idx, osmo_conv_code::puncture, osmo_conv_decoder::state_history, and osmo_conv_code::term.

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

Initialize a convolutional encoder.

Parameters

  [in,out] | encoder | Encoder state to initialize
  [in] | code | Description of convolutional code

References osmo_conv_encoder::code, osmo_conv_encoder::i_idx, osmo_conv_code::K, osmo_conv_code::N, osmo_conv_code::next_output, osmo_conv_code::next_state, osmo_conv_code::next_term_output, osmo_conv_code::next_term_state, log_target::output, osmo_conv_encoder::p_idx, osmo_conv_code::puncture, and osmo_conv_encoder::state.

Referenced by osmo_conv_encode().