9#ifndef INCLUDED_GR_BCH_H
10#define INCLUDED_GR_BCH_H
14#include "bose_chaudhuri_hocquenghem_decoder.hh"
15#include "galois_field.hh"
20#define MAX_BCH_PARITY_BITS 192
25typedef CODE::GaloisField<16, 0b10000000000101101, uint16_t>
GF_NORMAL;
26typedef CODE::GaloisField<15, 0b1000000000101101, uint16_t>
GF_MEDIUM;
27typedef CODE::GaloisField<14, 0b100000000101011, uint16_t>
GF_SHORT;
28typedef CODE::BoseChaudhuriHocquenghemDecoder<24, 1, 65343, GF_NORMAL>
BCH_NORMAL_12;
29typedef CODE::BoseChaudhuriHocquenghemDecoder<20, 1, 65375, GF_NORMAL>
BCH_NORMAL_10;
30typedef CODE::BoseChaudhuriHocquenghemDecoder<16, 1, 65407, GF_NORMAL>
BCH_NORMAL_8;
31typedef CODE::BoseChaudhuriHocquenghemDecoder<24, 1, 32587, GF_MEDIUM>
BCH_MEDIUM_12;
32typedef CODE::BoseChaudhuriHocquenghemDecoder<24, 1, 16215, GF_SHORT>
BCH_SHORT_12;
46 std::bitset<MAX_BCH_PARITY_BITS> m_crc_table[256];
47 std::bitset<MAX_BCH_PARITY_BITS> m_gen_poly;
49 void compute_gen_poly(
bool normal_fecframe);
50 void compute_crc_table();
54 void encode(
const std::vector<int>& ref_bits, std::vector<int>& enc_bits);
67 std::unique_ptr<GF_NORMAL> m_gf_normal;
68 std::unique_ptr<GF_SHORT> m_gf_short;
69 std::unique_ptr<BCH_NORMAL_12> m_dvbs2rx_decoder_n12;
70 std::unique_ptr<BCH_NORMAL_10> m_dvbs2rx_decoder_n10;
71 std::unique_ptr<BCH_NORMAL_8> m_dvbs2rx_decoder_n8;
72 std::unique_ptr<BCH_SHORT_12> m_dvbs2rx_decoder_s12;
73 std::array<uint8_t, 8192> m_packed_code;
74 std::array<uint8_t, 24> m_packed_parity;
82 void pack_bits(
const std::vector<int>& in_bits);
89 void unpack_bits(std::vector<int>& dec_bits);
93 void decode(
const std::vector<int>& in_bits, std::vector<int>& dec_bits);
105 std::vector<uint8_t> m_packed_msg;
106 std::vector<uint8_t> m_packed_codeword;
110 void encode(
const std::vector<int>& ref_bits, std::vector<int>& enc_bits);
111 void decode(
const std::vector<int>& in_bits, std::vector<int>& dec_bits);
#define DVBS2_GR_BCH_BENCH_API
Definition bench/fec/src/gr_bch/api.h:4
Wrapper for gr-dvbs2rx's original BCH Decoder.
Definition gr_bch.h:62
GrBchDecoder(int k, int n, int t)
void decode(const std::vector< int > &in_bits, std::vector< int > &dec_bits)
Wrapper for GNU Radio's in-tree BCH Encoder.
Definition gr_bch.h:40
GrBchEncoder(int k, int n, int t)
void encode(const std::vector< int > &ref_bits, std::vector< int > &enc_bits)
Wrapper for the new BCH Codec implementation.
Definition gr_bch.h:101
void decode(const std::vector< int > &in_bits, std::vector< int > &dec_bits)
void encode(const std::vector< int > &ref_bits, std::vector< int > &enc_bits)
NewBchCodec(int N, int t)
BCH coder/decoder.
Definition bch.h:29
Galois Field GF(2^m).
Definition gf.h:66
CODE::GaloisField< 16, 0b10000000000101101, uint16_t > GF_NORMAL
Definition gr_bch.h:25
CODE::BoseChaudhuriHocquenghemDecoder< 24, 1, 32587, GF_MEDIUM > BCH_MEDIUM_12
Definition gr_bch.h:31
CODE::GaloisField< 14, 0b100000000101011, uint16_t > GF_SHORT
Definition gr_bch.h:27
CODE::BoseChaudhuriHocquenghemDecoder< 16, 1, 65407, GF_NORMAL > BCH_NORMAL_8
Definition gr_bch.h:30
CODE::BoseChaudhuriHocquenghemDecoder< 24, 1, 16215, GF_SHORT > BCH_SHORT_12
Definition gr_bch.h:32
CODE::BoseChaudhuriHocquenghemDecoder< 20, 1, 65375, GF_NORMAL > BCH_NORMAL_10
Definition gr_bch.h:29
CODE::BoseChaudhuriHocquenghemDecoder< 24, 1, 65343, GF_NORMAL > BCH_NORMAL_12
Definition gr_bch.h:28
CODE::GaloisField< 15, 0b1000000000101101, uint16_t > GF_MEDIUM
Definition gr_bch.h:26
Fixed-length double-ended queue with contiguous volk-aligned elements.
Definition gr_bch.h:22