GNU Radio's DVBS2RX Package
ldpc_decoder_cb_impl.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2018,2019 Ahmet Inan, Ron Economos.
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef INCLUDED_DVBS2RX_LDPC_DECODER_CB_IMPL_H
22#define INCLUDED_DVBS2RX_LDPC_DECODER_CB_IMPL_H
23
24#include "algorithms.hh"
25#include "dvb_defines.h"
26#include "dvb_s2_tables.hh"
27#include "dvb_s2x_tables.hh"
28#include "dvb_t2_tables.hh"
29#include "ldpc.hh"
30#include "psk.hh"
31#include "qam.hh"
33
34#define FACTOR 2
35
36#ifdef __AVX2__
37const int SIZEOF_SIMD = 32;
38#else
39const int SIZEOF_SIMD = 16;
40#endif
41
42typedef int8_t code_type;
43const int SIMD_WIDTH = SIZEOF_SIMD / sizeof(code_type);
44typedef SIMD<code_type, SIMD_WIDTH> simd_type;
45
46#if 0
47#include "flooding_decoder.hh"
48typedef SelfCorrectedUpdate<simd_type> update_type;
49typedef MinSumAlgorithm<simd_type, update_type> algorithm_type;
50const int TRIALS = 50;
51#else
52#include "layered_decoder.hh"
53typedef NormalUpdate<simd_type> update_type;
54typedef OffsetMinSumAlgorithm<simd_type, update_type, FACTOR> algorithm_type;
55const int TRIALS = 25;
56#endif
57
58namespace gr {
59 namespace dvbs2rx {
60
62 {
63 private:
64 unsigned int frame_size;
65 unsigned int signal_constellation;
66 unsigned int code_rate;
67 unsigned int nbch;
68 unsigned int q_val;
69 unsigned int dvb_standard;
70 unsigned int output_mode;
71 unsigned int info_mode;
72 unsigned int frame;
73 unsigned int chunk;
74 unsigned int total_trials;
75 float snr;
76 float precision;
77 float total_snr;
78 unsigned int rowaddr0;
79 unsigned int rowaddr1;
80 unsigned int rowaddr2;
81 unsigned int rowaddr3;
82 unsigned int rowaddr4;
83 unsigned int rowaddr5;
84 unsigned int rowaddr6;
85 unsigned int rowaddr7;
86 LDPCInterface *ldpc;
87 Modulation<gr_complex, int8_t> *mod;
88 LDPCDecoder<simd_type, algorithm_type> decode;
89 int8_t *soft;
90 int8_t *dint;
91 int8_t *tempu;
92 int8_t *tempv;
93 void *aligned_buffer;
94
95 int interleave_lookup_table[FRAME_SIZE_NORMAL];
96 int deinterleave_lookup_table[FRAME_SIZE_NORMAL];
97
98 void
99 generate_interleave_lookup();
100 void
101 generate_deinterleave_lookup();
102 inline void
103 interleave_parity_bits(int *tempu, const int *&in);
104 inline void
105 twist_interleave_columns(
106 int *tempv, int *tempu, int rows, int mod, const int *twist);
107 inline void
108 twist_deinterleave_columns(
109 int *tempv, int *tempu, int rows, int mod, const int *twist);
110
111 const static int twist16n[8];
112 const static int twist64n[12];
113 const static int twist256n[16];
114
115 const static int twist16s[8];
116 const static int twist64s[12];
117 const static int twist256s[8];
118
119 const static int mux16[8];
120 const static int mux64[12];
121 const static int mux256[16];
122
123 const static int mux16_35[8];
124 const static int mux16_13[8];
125 const static int mux16_25[8];
126 const static int mux64_35[12];
127 const static int mux64_13[12];
128 const static int mux64_25[12];
129 const static int mux256_35[16];
130 const static int mux256_23[16];
131
132 const static int mux256s[8];
133 const static int mux256s_13[8];
134 const static int mux256s_25[8];
135
136 public:
138 dvb_framesize_t framesize,
139 dvb_code_rate_t rate,
140 dvb_constellation_t constellation,
141 dvb_outputmode_t outputmode,
142 dvb_infomode_t infomode);
144
145 void
146 forecast(int noutput_items, gr_vector_int &ninput_items_required);
147
148 int
149 general_work(int noutput_items,
150 gr_vector_int &ninput_items,
151 gr_vector_const_void_star &input_items,
152 gr_vector_void_star &output_items);
153 };
154
155 } // namespace dvbs2rx
156} // namespace gr
157
158#endif /* INCLUDED_DVBS2RX_LDPC_DECODER_CB_IMPL_H */
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
ldpc_decoder_cb_impl(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation, dvb_outputmode_t outputmode, dvb_infomode_t infomode)
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
<+description of block+>
Definition ldpc_decoder_cb.h:38
#define FRAME_SIZE_NORMAL
Definition dvb_defines.h:47
NormalUpdate< simd_type > update_type
Definition ldpc_decoder_cb_impl.h:53
int8_t code_type
Definition ldpc_decoder_cb_impl.h:42
OffsetMinSumAlgorithm< simd_type, update_type, FACTOR > algorithm_type
Definition ldpc_decoder_cb_impl.h:54
SIMD< code_type, SIMD_WIDTH > simd_type
Definition ldpc_decoder_cb_impl.h:44
const int SIZEOF_SIMD
Definition ldpc_decoder_cb_impl.h:39
const int SIMD_WIDTH
Definition ldpc_decoder_cb_impl.h:43
const int TRIALS
Definition ldpc_decoder_cb_impl.h:55
dvb_infomode_t
Definition dvb_config.h:129
dvb_framesize_t
Definition dvb_config.h:85
dvb_constellation_t
Definition dvb_config.h:91
dvb_outputmode_t
Definition dvb_config.h:124
dvb_code_rate_t
Definition dvb_config.h:31
dvb_standard_t
Definition dvb_config.h:26
Definition bbdeheader_bb.h:30