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.
96 lines
4.0 KiB
C
96 lines
4.0 KiB
C
6 years ago
|
/*
|
||
5 years ago
|
* Copyright 2013-2020 Software Radio Systems Limited
|
||
11 years ago
|
*
|
||
6 years ago
|
* This file is part of srsLTE.
|
||
11 years ago
|
*
|
||
10 years ago
|
* srsLTE is free software: you can redistribute it and/or modify
|
||
10 years ago
|
* it under the terms of the GNU Affero General Public License as
|
||
11 years ago
|
* published by the Free Software Foundation, either version 3 of
|
||
|
* the License, or (at your option) any later version.
|
||
|
*
|
||
10 years ago
|
* srsLTE is distributed in the hope that it will be useful,
|
||
11 years ago
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
10 years ago
|
* GNU Affero General Public License for more details.
|
||
11 years ago
|
*
|
||
10 years ago
|
* A copy of the GNU Affero General Public License can be found in
|
||
11 years ago
|
* the LICENSE file in the top-level directory of this distribution
|
||
|
* and at http://www.gnu.org/licenses/.
|
||
|
*
|
||
11 years ago
|
*/
|
||
|
|
||
10 years ago
|
/******************************************************************************
|
||
4 years ago
|
* File: convolutional.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
|
|
||
7 years ago
|
#ifndef SRSLTE_VITERBI_H
|
||
|
#define SRSLTE_VITERBI_H
|
||
11 years ago
|
|
||
4 years ago
|
#include "../../../../../../../../../../usr/lib/gcc/x86_64-linux-gnu/7/include/stdbool.h"
|
||
|
#include "../../../config.h"
|
||
11 years ago
|
|
||
5 years ago
|
typedef enum { SRSLTE_VITERBI_27 = 0, SRSLTE_VITERBI_29, SRSLTE_VITERBI_37, SRSLTE_VITERBI_39 } srslte_viterbi_type_t;
|
||
9 years ago
|
|
||
5 years ago
|
typedef struct SRSLTE_API {
|
||
|
void* ptr;
|
||
10 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;
|
||
|
} srslte_viterbi_t;
|
||
|
|
||
|
SRSLTE_API int srslte_viterbi_init(srslte_viterbi_t* q,
|
||
|
srslte_viterbi_type_t type,
|
||
|
int poly[3],
|
||
|
uint32_t max_frame_length,
|
||
|
bool tail_bitting);
|
||
|
|
||
|
SRSLTE_API void srslte_viterbi_set_gain_quant(srslte_viterbi_t* q, float gain_quant);
|
||
|
|
||
|
SRSLTE_API void srslte_viterbi_set_gain_quant_s(srslte_viterbi_t* q, int16_t gain_quant);
|
||
|
|
||
|
SRSLTE_API void srslte_viterbi_free(srslte_viterbi_t* q);
|
||
|
|
||
|
SRSLTE_API int srslte_viterbi_decode_f(srslte_viterbi_t* q, float* symbols, uint8_t* data, uint32_t frame_length);
|
||
|
|
||
|
SRSLTE_API int srslte_viterbi_decode_s(srslte_viterbi_t* q, int16_t* symbols, uint8_t* data, uint32_t frame_length);
|
||
|
|
||
|
SRSLTE_API int srslte_viterbi_decode_us(srslte_viterbi_t* q, uint16_t* symbols, uint8_t* data, uint32_t frame_length);
|
||
|
|
||
|
SRSLTE_API int srslte_viterbi_decode_uc(srslte_viterbi_t* q, uint8_t* symbols, uint8_t* data, uint32_t frame_length);
|
||
|
|
||
|
SRSLTE_API int srslte_viterbi_init_sse(srslte_viterbi_t* q,
|
||
|
srslte_viterbi_type_t type,
|
||
|
int poly[3],
|
||
|
uint32_t max_frame_length,
|
||
|
bool tail_bitting);
|
||
|
|
||
|
SRSLTE_API int srslte_viterbi_init_neon(srslte_viterbi_t* q,
|
||
|
srslte_viterbi_type_t type,
|
||
|
int poly[3],
|
||
|
uint32_t max_frame_length,
|
||
|
bool tail_bitting);
|
||
|
|
||
|
SRSLTE_API int srslte_viterbi_init_avx2(srslte_viterbi_t* q,
|
||
|
srslte_viterbi_type_t type,
|
||
|
int poly[3],
|
||
|
uint32_t max_frame_length,
|
||
|
bool tail_bitting);
|
||
9 years ago
|
|
||
7 years ago
|
#endif // SRSLTE_VITERBI_H
|