GNU Radio's SATELLITES Package

ra_config.h
Go to the documentation of this file.
1/* -*- c -*- */
2/*
3 * Copyright 2015-2019 Miklos Maroti
4 * Copyright 2019 Daniel Estevez <daniel@destevez.net> (reentrant version)
5 *
6 * This file is part of gr-satellites
7 *
8 * SPDX-License-Identifier: GPL-3.0-or-later
9 *
10 */
11
12#ifndef RA_CONFIG_H
13#define RA_CONFIG_H
14
15#include <stdint.h>
16
17#ifdef __cplusplus
18 extern "C" {
19#endif
20
21 typedef uint16_t ra_word_t; /* use uint16_t for SSE4.1 soft decoder */
22 typedef uint16_t ra_index_t; /* use uint16_t for RA_PACKET_LENGTH >= 256 */
23
24 enum {
25 /* number of words, must be at least 4 */
26 RA_MAX_DATA_LENGTH = 2048,
27
28 /* 1 for rate 1/4, 2 for 2/5, 3 for 1/2, 5 for 5/8 */
29 RA_PUNCTURE_RATE = 3,
30
31 /* use the test program to verify it */
32 RA_MAX_CODE_LENGTH = RA_MAX_DATA_LENGTH * 2 + 3,
33};
34
35 enum { RA_BITCOUNT = 8 * sizeof(ra_word_t), RA_BITSHIFT = RA_BITCOUNT - 1 };
36
37 struct ra_context {
38 ra_index_t ra_data_length;
39 ra_index_t ra_code_length;
40 ra_index_t ra_chck_length;
41 uint16_t ra_lfsr_masks[4];
42 uint8_t ra_lfsr_highbit;
43
44 // for ra_lfsr
45 ra_index_t ra_lfsr_mask;
46 ra_index_t ra_lfsr_state;
47 ra_index_t ra_lfsr_offset;
48
49 // for ra_decoder_gen
50 float ra_dataword_gen[RA_MAX_DATA_LENGTH * RA_BITCOUNT];
51 float ra_codeword_gen[RA_MAX_CODE_LENGTH * RA_BITCOUNT];
52 float ra_forward_gen[RA_MAX_DATA_LENGTH * RA_BITCOUNT];
53
54 // for ra_encoder
55 const ra_word_t* ra_packet;
56 ra_word_t ra_nextword;
57 uint8_t ra_passno;
58};
59
60/* data length in words */
61 void ra_length_init(struct ra_context* ctx, ra_index_t data_length);
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif // RA_CONFIG_H
RA_MAX_DATA_LENGTH
@ RA_MAX_DATA_LENGTH
Definition ra_config.h:26
RA_PUNCTURE_RATE
@ RA_PUNCTURE_RATE
Definition ra_config.h:29
RA_MAX_CODE_LENGTH
@ RA_MAX_CODE_LENGTH
Definition ra_config.h:32
ra_length_init
void ra_length_init(struct ra_context *ctx, ra_index_t data_length)
ra_index_t
uint16_t ra_index_t
Definition ra_config.h:22
RA_BITCOUNT
@ RA_BITCOUNT
Definition ra_config.h:35
RA_BITSHIFT
@ RA_BITSHIFT
Definition ra_config.h:35
ra_word_t
uint16_t ra_word_t
Definition ra_config.h:21
ra_context
Definition ra_config.h:37
ra_context::ra_lfsr_highbit
uint8_t ra_lfsr_highbit
Definition ra_config.h:42
ra_context::ra_lfsr_offset
ra_index_t ra_lfsr_offset
Definition ra_config.h:47
ra_context::ra_lfsr_masks
uint16_t ra_lfsr_masks[4]
Definition ra_config.h:41
ra_context::ra_lfsr_mask
ra_index_t ra_lfsr_mask
Definition ra_config.h:45
ra_context::ra_passno
uint8_t ra_passno
Definition ra_config.h:57
ra_context::ra_packet
const ra_word_t * ra_packet
Definition ra_config.h:55
ra_context::ra_forward_gen
float ra_forward_gen[RA_MAX_DATA_LENGTH *RA_BITCOUNT]
Definition ra_config.h:52
ra_context::ra_chck_length
ra_index_t ra_chck_length
Definition ra_config.h:40
ra_context::ra_codeword_gen
float ra_codeword_gen[RA_MAX_CODE_LENGTH *RA_BITCOUNT]
Definition ra_config.h:51
ra_context::ra_nextword
ra_word_t ra_nextword
Definition ra_config.h:56
ra_context::ra_dataword_gen
float ra_dataword_gen[RA_MAX_DATA_LENGTH *RA_BITCOUNT]
Definition ra_config.h:50
ra_context::ra_data_length
ra_index_t ra_data_length
Definition ra_config.h:38
ra_context::ra_code_length
ra_index_t ra_code_length
Definition ra_config.h:39
ra_context::ra_lfsr_state
ra_index_t ra_lfsr_state
Definition ra_config.h:46