GNU Radio's SATNOGS Package
conv_decoder.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module
4 *
5 * Copyright (C) 2021, Libre Space Foundation <http://libre.space>
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef INCLUDED_SATNOGS_CONV_DECODER_H
22#define INCLUDED_SATNOGS_CONV_DECODER_H
23
25#include <cstddef>
26#include <cstdint>
27
28namespace gr {
29namespace satnogs {
30
31/*!
32 * \brief SATNOGS compatible convolutional decoder with puncturing support
33 *
34 */
36{
37public:
38 typedef enum { RATE_1_2 = 0, RATE_2_3, RATE_3_4, RATE_5_6, RATE_7_8 } coding_rate_t;
39
40 conv_decoder(coding_rate_t coding_rate, size_t max_frame_len);
41 virtual ~conv_decoder();
42
43 void reset();
44
45 size_t decode_trunc(uint8_t* out, const int8_t* in, size_t len);
46
47 size_t decode(uint8_t* out, const int8_t* in, size_t len);
48
49private:
50 const coding_rate_t d_rate;
51 size_t d_trunc_depth;
52 size_t d_long_trunc_depth;
53 uint8_t* d_syms;
54 uint8_t* d_unpacked;
55 bool d_first_block;
56 void* d_vp;
57 uint32_t d_last_state;
58
59 size_t decode_block(uint8_t* out, const int8_t* in, size_t len);
60
61 size_t decode_block_1_2(uint8_t* out, const int8_t* in, size_t len);
62
63 size_t decode_block_2_3(uint8_t* out, const int8_t* in, size_t len);
64
65 size_t decode_block_3_4(uint8_t* out, const int8_t* in, size_t len);
66
67 size_t decode_block_5_6(uint8_t* out, const int8_t* in, size_t len);
68
69 size_t decode_block_7_8(uint8_t* out, const int8_t* in, size_t len);
70};
71
72} // namespace satnogs
73} // namespace gr
74
75#endif /* INCLUDED_SATNOGS_CONV_DECODER_H */
#define SATNOGS_API
Definition: api.h:19
SATNOGS compatible convolutional decoder with puncturing support.
Definition: conv_decoder.h:36
conv_decoder(coding_rate_t coding_rate, size_t max_frame_len)
size_t decode_trunc(uint8_t *out, const int8_t *in, size_t len)
size_t decode(uint8_t *out, const int8_t *in, size_t len)
coding_rate_t
Definition: conv_decoder.h:38
Definition: amsat_duv_decoder.h:29