libosmocore 1.10.0.57-8972
Osmocom core library
|
Accelerated Viterbi decoder implementation. More...
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "config.h"
#include <osmocom/core/conv.h>
Data Structures | |
struct | vtrellis |
struct | vdecoder |
Macros | |
#define | BIT2NRZ(REG, N) (((REG >> N) & 0x01) * 2 - 1) * -1 |
#define | NUM_STATES(K) (K == 7 ? 64 : 16) |
#define | INIT_POINTERS(simd) |
Functions | |
__attribute__ ((visibility("hidden"))) | |
static int | conv_code_recursive (const struct osmo_conv_code *code) |
static unsigned | vstate_lshift (unsigned reg, int k, int val) |
static unsigned | bitswap2 (unsigned v) |
static unsigned | bitswap3 (unsigned v) |
static unsigned | bitswap4 (unsigned v) |
static unsigned | bitswap5 (unsigned v) |
static unsigned | bitswap6 (unsigned v) |
static unsigned | bitswap (unsigned v, unsigned n) |
static unsigned | gen_output (struct vstate *state, int val, const struct osmo_conv_code *code) |
static int | gen_state_info (uint8_t *val, unsigned reg, int16_t *output, const struct osmo_conv_code *code) |
static unsigned | gen_recursive_output (struct vstate *state, uint8_t *val, unsigned reg, const struct osmo_conv_code *code, int pos) |
static int | gen_recursive_state_info (uint8_t *val, unsigned reg, int16_t *output, const struct osmo_conv_code *code) |
static void | free_trellis (struct vtrellis *trellis) |
static int | generate_trellis (struct vdecoder *dec, const struct osmo_conv_code *code) |
static void | _traceback (struct vdecoder *dec, unsigned state, uint8_t *out, int len) |
static void | _traceback_rec (struct vdecoder *dec, unsigned state, uint8_t *out, int len) |
static int | traceback (struct vdecoder *dec, uint8_t *out, int term, int len) |
static void | vdec_deinit (struct vdecoder *dec) |
static int | vdec_init (struct vdecoder *dec, const struct osmo_conv_code *code) |
static int | depuncture (const int8_t *in, const int *punc, int8_t *out, int len) |
static void | forward_traverse (struct vdecoder *dec, const int8_t *seq) |
static int | conv_decode (struct vdecoder *dec, const int8_t *seq, const int *punc, uint8_t *out, int len, int term) |
static void | osmo_conv_init (void) |
int | osmo_conv_decode_acc (const struct osmo_conv_code *code, const sbit_t *input, ubit_t *output) |
Variables | |
static int | init_complete = 0 |
Accelerated Viterbi decoder implementation.
#define BIT2NRZ | ( | REG, | |
N | |||
) | (((REG >> N) & 0x01) * 2 - 1) * -1 |
#define INIT_POINTERS | ( | simd | ) |
__attribute__ | ( | (visibility("hidden")) | ) |
|
static |
References vdecoder::k, len(), vdecoder::paths, vdecoder::trellis, vtrellis::vals, and vstate_lshift().
Referenced by traceback().
|
static |
References vdecoder::k, len(), vdecoder::paths, vdecoder::trellis, vtrellis::vals, and vstate_lshift().
Referenced by traceback().
|
static |
References bitswap2(), bitswap3(), bitswap4(), bitswap5(), bitswap6(), and n.
Referenced by gen_output(), and gen_recursive_output().
|
inlinestatic |
Referenced by bitswap().
|
inlinestatic |
Referenced by bitswap().
|
inlinestatic |
Referenced by bitswap().
|
inlinestatic |
Referenced by bitswap().
|
inlinestatic |
Referenced by bitswap().
|
inlinestatic |
References osmo_conv_code::next_term_output.
Referenced by vdec_init().
|
static |
References CONV_TERM_TAIL_BITING, depuncture(), forward_traverse(), len(), vdecoder::len, vdecoder::n, and traceback().
Referenced by osmo_conv_decode_acc().
|
static |
Referenced by conv_decode().
|
static |
References vdecoder::intrvl, vdecoder::len, vdecoder::metric_func, vdecoder::n, vtrellis::outputs, vdecoder::paths, vtrellis::sums, and vdecoder::trellis.
Referenced by conv_decode().
|
static |
References vtrellis::outputs, vtrellis::sums, and vtrellis::vals.
Referenced by generate_trellis(), and vdec_deinit().
|
static |
References bitswap(), osmo_conv_code::K, osmo_conv_code::N, and osmo_conv_code::next_output.
Referenced by gen_state_info().
|
static |
References bitswap(), osmo_conv_code::K, osmo_conv_code::N, osmo_conv_code::next_output, osmo_conv_code::next_term_output, and vstate_lshift().
Referenced by gen_recursive_state_info().
|
static |
References BIT2NRZ, gen_recursive_output(), osmo_conv_code::K, osmo_conv_code::N, osmo_conv_code::next_output, NUM_STATES, and vstate_lshift().
Referenced by generate_trellis().
|
static |
References BIT2NRZ, gen_output(), osmo_conv_code::K, osmo_conv_code::N, and vstate_lshift().
Referenced by generate_trellis().
|
static |
For termination other than tail-biting, initialize the zero state as the encoder starting state. Initialize with the maximum accumulated sum at length equal to the constraint length.
References CONV_TERM_TAIL_BITING, free_trellis(), gen_recursive_state_info(), gen_state_info(), osmo_conv_code::K, osmo_conv_code::N, NUM_STATES, vtrellis::num_states, vtrellis::outputs, vdecoder::recursive, vtrellis::sums, osmo_conv_code::term, vdecoder::trellis, and vtrellis::vals.
Referenced by vdec_init().
|
static |
Usage of curly braces is mandatory, because we use multi-line define.
References init_complete, INIT_POINTERS, and sse41_supported.
Referenced by osmo_conv_decode_acc().
|
static |
References _traceback(), _traceback_rec(), CONV_TERM_FLUSH, CONV_TERM_TAIL_BITING, vdecoder::k, len(), vdecoder::len, vtrellis::num_states, vdecoder::paths, vdecoder::recursive, vtrellis::sums, vdecoder::trellis, and vstate_lshift().
Referenced by conv_decode().
|
static |
References free_trellis(), vdecoder::paths, and vdecoder::trellis.
Referenced by osmo_conv_decode_acc(), and vdec_init().
|
static |
References conv_code_recursive(), CONV_TERM_FLUSH, generate_trellis(), if(), vdecoder::intrvl, osmo_conv_code::K, vdecoder::k, osmo_conv_code::len, vdecoder::len, vdecoder::metric_func, osmo_conv_code::N, vdecoder::n, NUM_STATES, vdecoder::paths, vdecoder::recursive, osmo_conv_code::term, and vdec_deinit().
Referenced by osmo_conv_decode_acc().
|
static |
References k.
Referenced by _traceback(), _traceback_rec(), gen_recursive_output(), gen_recursive_state_info(), gen_state_info(), and traceback().
|
static |
Referenced by osmo_conv_decode_acc(), and osmo_conv_init().