mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
3.4 KiB
C
87 lines
3.4 KiB
C
4 years ago
|
/**
|
||
11 years ago
|
*
|
||
4 years ago
|
* \section COPYRIGHT
|
||
11 years ago
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
11 years ago
|
*
|
||
4 years ago
|
* By using this file, you agree to the terms and conditions set
|
||
|
* forth in the LICENSE file which can be found at the top level of
|
||
|
* the distribution.
|
||
11 years ago
|
*
|
||
11 years ago
|
*/
|
||
|
|
||
10 years ago
|
/******************************************************************************
|
||
4 years ago
|
* File: viterbi.h
|
||
10 years ago
|
*
|
||
|
* Description: Viterbi decoder for convolutionally encoded data.
|
||
|
* Used for decoding of PBCH and PDCCH (type 37 decoder).
|
||
|
*
|
||
|
* Reference:
|
||
|
*****************************************************************************/
|
||
11 years ago
|
|
||
4 years ago
|
#ifndef SRSRAN_VITERBI_H
|
||
|
#define SRSRAN_VITERBI_H
|
||
11 years ago
|
|
||
4 years ago
|
#include "srsran/config.h"
|
||
4 years ago
|
#include <stdbool.h>
|
||
11 years ago
|
|
||
4 years ago
|
typedef enum { SRSRAN_VITERBI_27 = 0, SRSRAN_VITERBI_29, SRSRAN_VITERBI_37, SRSRAN_VITERBI_39 } srsran_viterbi_type_t;
|
||
9 years ago
|
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
5 years ago
|
void* ptr;
|
||
11 years ago
|
uint32_t R;
|
||
|
uint32_t K;
|
||
10 years ago
|
uint32_t framebits;
|
||
5 years ago
|
bool tail_biting;
|
||
|
float gain_quant;
|
||
|
int16_t gain_quant_s;
|
||
|
int (*decode)(void*, uint8_t*, uint8_t*, uint32_t);
|
||
|
int (*decode_s)(void*, uint16_t*, uint8_t*, uint32_t);
|
||
|
int (*decode_f)(void*, float*, uint8_t*, uint32_t);
|
||
|
void (*free)(void*);
|
||
|
uint8_t* tmp;
|
||
|
uint16_t* tmp_s;
|
||
|
uint8_t* symbols_uc;
|
||
|
uint16_t* symbols_us;
|
||
4 years ago
|
} srsran_viterbi_t;
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_viterbi_init(srsran_viterbi_t* q,
|
||
|
srsran_viterbi_type_t type,
|
||
5 years ago
|
int poly[3],
|
||
|
uint32_t max_frame_length,
|
||
|
bool tail_bitting);
|
||
|
|
||
4 years ago
|
SRSRAN_API void srsran_viterbi_set_gain_quant(srsran_viterbi_t* q, float gain_quant);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_viterbi_set_gain_quant_s(srsran_viterbi_t* q, int16_t gain_quant);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_viterbi_free(srsran_viterbi_t* q);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_viterbi_decode_f(srsran_viterbi_t* q, float* symbols, uint8_t* data, uint32_t frame_length);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_viterbi_decode_s(srsran_viterbi_t* q, int16_t* symbols, uint8_t* data, uint32_t frame_length);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_viterbi_decode_us(srsran_viterbi_t* q, uint16_t* symbols, uint8_t* data, uint32_t frame_length);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_viterbi_decode_uc(srsran_viterbi_t* q, uint8_t* symbols, uint8_t* data, uint32_t frame_length);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_viterbi_init_sse(srsran_viterbi_t* q,
|
||
|
srsran_viterbi_type_t type,
|
||
5 years ago
|
int poly[3],
|
||
|
uint32_t max_frame_length,
|
||
|
bool tail_bitting);
|
||
|
|
||
4 years ago
|
SRSRAN_API int srsran_viterbi_init_neon(srsran_viterbi_t* q,
|
||
|
srsran_viterbi_type_t type,
|
||
5 years ago
|
int poly[3],
|
||
|
uint32_t max_frame_length,
|
||
|
bool tail_bitting);
|
||
|
|
||
4 years ago
|
SRSRAN_API int srsran_viterbi_init_avx2(srsran_viterbi_t* q,
|
||
|
srsran_viterbi_type_t type,
|
||
5 years ago
|
int poly[3],
|
||
|
uint32_t max_frame_length,
|
||
|
bool tail_bitting);
|
||
9 years ago
|
|
||
4 years ago
|
#endif // SRSRAN_VITERBI_H
|