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 
24 #include <satnogs/api.h>
25 #include <cstddef>
26 #include <cstdint>
27 
28 namespace gr {
29 namespace satnogs {
30 
31 /*!
32  * \brief SATNOGS compatible convolutional decoder with puncturing support
33  *
34  */
36 public:
37  typedef enum {
38  RATE_1_2 = 0,
42  RATE_7_8
43  } coding_rate_t;
44 
45  conv_decoder(coding_rate_t coding_rate, size_t max_frame_len);
46  virtual ~conv_decoder();
47 
48  void
49  reset();
50 
51  size_t
52  decode_trunc(uint8_t *out, const int8_t *in, size_t len);
53 
54  size_t
55  decode(uint8_t *out, const int8_t *in, size_t len);
56 
57 private:
58  const coding_rate_t d_rate;
59  size_t d_trunc_depth;
60  size_t d_long_trunc_depth;
61  uint8_t *d_syms;
62  uint8_t *d_unpacked;
63  bool d_first_block;
64  void *d_vp;
65  uint32_t d_last_state;
66 
67  size_t
68  decode_block(uint8_t *out, const int8_t *in, size_t len);
69 
70  size_t
71  decode_block_1_2(uint8_t *out, const int8_t *in, size_t len);
72 
73  size_t
74  decode_block_2_3(uint8_t *out, const int8_t *in, size_t len);
75 
76  size_t
77  decode_block_3_4(uint8_t *out, const int8_t *in, size_t len);
78 
79  size_t
80  decode_block_5_6(uint8_t *out, const int8_t *in, size_t len);
81 
82  size_t
83  decode_block_7_8(uint8_t *out, const int8_t *in, size_t len);
84 };
85 
86 } // namespace satnogs
87 } // namespace gr
88 
89 #endif /* INCLUDED_SATNOGS_CONV_DECODER_H */
Definition: conv_decoder.h:40
Definition: conv_decoder.h:41
coding_rate_t
Definition: conv_decoder.h:37
Definition: amsat_duv_decoder.h:29
Definition: conv_decoder.h:39
SATNOGS compatible convolutional decoder with puncturing support.
Definition: conv_decoder.h:35
#define SATNOGS_API
Definition: api.h:30