diff options
author | Marcus Müller <mmueller@gnuradio.org> | 2019-08-07 21:45:12 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2019-08-09 23:04:28 +0200 |
commit | f7bbf2c1d8d780294f3e016aff239ca35eb6516e (patch) | |
tree | e09ab6112e02b2215b2d59ac24d3d6ea2edac745 /gr-dtv | |
parent | 78431dc6941e3acc67c858277dfe4a0ed583643c (diff) |
Tree: clang-format without the include sorting
Diffstat (limited to 'gr-dtv')
181 files changed, 34112 insertions, 27931 deletions
diff --git a/gr-dtv/include/gnuradio/dtv/api.h b/gr-dtv/include/gnuradio/dtv/api.h index 14fd46981a..3d11a62cae 100644 --- a/gr-dtv/include/gnuradio/dtv/api.h +++ b/gr-dtv/include/gnuradio/dtv/api.h @@ -25,9 +25,9 @@ #include <gnuradio/attributes.h> #ifdef gnuradio_dtv_EXPORTS -# define DTV_API __GR_ATTR_EXPORT +#define DTV_API __GR_ATTR_EXPORT #else -# define DTV_API __GR_ATTR_IMPORT +#define DTV_API __GR_ATTR_IMPORT #endif #endif /* INCLUDED_DTV_API_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_consts.h b/gr-dtv/include/gnuradio/dtv/atsc_consts.h index 12b594788d..291bc7ed62 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_consts.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_consts.h @@ -26,22 +26,22 @@ #include <gnuradio/dtv/api.h> namespace gr { - namespace dtv { +namespace dtv { - // These will go into an mpeg_consts.h once other mod/demods are done - static const int ATSC_MPEG_DATA_LENGTH = 187; - static const int ATSC_MPEG_PKT_LENGTH = 188; // sync + data - static const int ATSC_MPEG_RS_ENCODED_LENGTH = 207; - static const int MPEG_SYNC_BYTE = 0x47; - static const int MPEG_TRANSPORT_ERROR_BIT = 0x80; // top bit of byte after SYNC +// These will go into an mpeg_consts.h once other mod/demods are done +static const int ATSC_MPEG_DATA_LENGTH = 187; +static const int ATSC_MPEG_PKT_LENGTH = 188; // sync + data +static const int ATSC_MPEG_RS_ENCODED_LENGTH = 207; +static const int MPEG_SYNC_BYTE = 0x47; +static const int MPEG_TRANSPORT_ERROR_BIT = 0x80; // top bit of byte after SYNC - // ATSC specific constants - static const double ATSC_SYMBOL_RATE = 4.5e6/286*684; // ~10.76 MHz - static const double ATSC_DATA_SEGMENT_RATE = ATSC_SYMBOL_RATE/832; // ~12.935 kHz - static const int ATSC_DATA_SEGMENT_LENGTH = 832; // includes 4 sync symbols at beginning - static const int ATSC_DSEGS_PER_FIELD = 312; // regular data segs / field +// ATSC specific constants +static const double ATSC_SYMBOL_RATE = 4.5e6 / 286 * 684; // ~10.76 MHz +static const double ATSC_DATA_SEGMENT_RATE = ATSC_SYMBOL_RATE / 832; // ~12.935 kHz +static const int ATSC_DATA_SEGMENT_LENGTH = 832; // includes 4 sync symbols at beginning +static const int ATSC_DSEGS_PER_FIELD = 312; // regular data segs / field - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_CONSTS_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_deinterleaver.h b/gr-dtv/include/gnuradio/dtv/atsc_deinterleaver.h index 658aa47a96..4bd0f68ae3 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_deinterleaver.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_deinterleaver.h @@ -27,28 +27,27 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief ATSC deinterleave RS encoded ATSC data ( atsc_mpeg_packet_rs_encoded --> + * atsc_mpeg_packet_rs_encoded) \ingroup dtv_atsc + * + * input: atsc_mpeg_packet_rs_encoded; output: atsc_mpeg_packet_rs_encoded + */ +class DTV_API atsc_deinterleaver : virtual public gr::sync_block +{ +public: + // gr::dtv::atsc_deinterleaver::sptr + typedef boost::shared_ptr<atsc_deinterleaver> sptr; /*! - * \brief ATSC deinterleave RS encoded ATSC data ( atsc_mpeg_packet_rs_encoded --> atsc_mpeg_packet_rs_encoded) - * \ingroup dtv_atsc - * - * input: atsc_mpeg_packet_rs_encoded; output: atsc_mpeg_packet_rs_encoded + * \brief Make a new instance of gr::dtv::atsc_deinterleaver. */ - class DTV_API atsc_deinterleaver : virtual public gr::sync_block - { - public: - - // gr::dtv::atsc_deinterleaver::sptr - typedef boost::shared_ptr<atsc_deinterleaver> sptr; - - /*! - * \brief Make a new instance of gr::dtv::atsc_deinterleaver. - */ - static sptr make(); - }; + static sptr make(); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_DEINTERLEAVER_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_depad.h b/gr-dtv/include/gnuradio/dtv/atsc_depad.h index 4dfe21a6f9..f6a8a86136 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_depad.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_depad.h @@ -27,28 +27,27 @@ #include <gnuradio/sync_interpolator.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief ATSC depad mpeg ts packets from 256 byte atsc_mpeg_packet to 188 byte char + * \ingroup dtv_atsc + * + * input: atsc_mpeg_packet; output: unsigned char + */ +class DTV_API atsc_depad : virtual public gr::sync_interpolator +{ +public: + // gr::dtv::atsc_depad::sptr + typedef boost::shared_ptr<atsc_depad> sptr; /*! - * \brief ATSC depad mpeg ts packets from 256 byte atsc_mpeg_packet to 188 byte char - * \ingroup dtv_atsc - * - * input: atsc_mpeg_packet; output: unsigned char + * \brief Make a new instance of gr::dtv::atsc_depad. */ - class DTV_API atsc_depad : virtual public gr::sync_interpolator - { - public: - - // gr::dtv::atsc_depad::sptr - typedef boost::shared_ptr<atsc_depad> sptr; - - /*! - * \brief Make a new instance of gr::dtv::atsc_depad. - */ - static sptr make(); - }; + static sptr make(); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_DEPAD_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_derandomizer.h b/gr-dtv/include/gnuradio/dtv/atsc_derandomizer.h index d941cae004..d7969d31e3 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_derandomizer.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_derandomizer.h @@ -27,28 +27,27 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief ATSC "dewhiten" incoming mpeg transport stream packets + * \ingroup dtv_atsc + * + * input: atsc_mpeg_packet_no_sync; output: atsc_mpeg_packet; + */ +class DTV_API atsc_derandomizer : virtual public gr::sync_block +{ +public: + // gr::dtv::atsc_derandomizer::sptr + typedef boost::shared_ptr<atsc_derandomizer> sptr; /*! - * \brief ATSC "dewhiten" incoming mpeg transport stream packets - * \ingroup dtv_atsc - * - * input: atsc_mpeg_packet_no_sync; output: atsc_mpeg_packet; + * \brief Make a new instance of gr::dtv::atsc_derandomizer. */ - class DTV_API atsc_derandomizer : virtual public gr::sync_block - { - public: - - // gr::dtv::atsc_derandomizer::sptr - typedef boost::shared_ptr<atsc_derandomizer> sptr; - - /*! - * \brief Make a new instance of gr::dtv::atsc_derandomizer. - */ - static sptr make(); - }; + static sptr make(); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_DERANDOMIZER_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_equalizer.h b/gr-dtv/include/gnuradio/dtv/atsc_equalizer.h index 17f2e8f768..cc605cb99c 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_equalizer.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_equalizer.h @@ -27,30 +27,29 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief ATSC Receiver Equalizer + * + * \ingroup dtv_atsc + */ +class DTV_API atsc_equalizer : virtual public gr::block +{ +public: + // gr::dtv::atsc_equalizer::sptr + typedef boost::shared_ptr<atsc_equalizer> sptr; /*! - * \brief ATSC Receiver Equalizer - * - * \ingroup dtv_atsc + * \brief Make a new instance of gr::dtv::atsc_equalizer. */ - class DTV_API atsc_equalizer : virtual public gr::block - { - public: - - // gr::dtv::atsc_equalizer::sptr - typedef boost::shared_ptr<atsc_equalizer> sptr; - - /*! - * \brief Make a new instance of gr::dtv::atsc_equalizer. - */ - static sptr make(); + static sptr make(); - virtual std::vector<float> taps() const = 0; - virtual std::vector<float> data() const = 0; - }; + virtual std::vector<float> taps() const = 0; + virtual std::vector<float> data() const = 0; +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_EQUALIZER_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_field_sync_mux.h b/gr-dtv/include/gnuradio/dtv/atsc_field_sync_mux.h index 3b34e5ab9f..2ea3432b05 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_field_sync_mux.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_field_sync_mux.h @@ -25,25 +25,25 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief <+description of block+> + * \ingroup dtv + * + */ +class DTV_API atsc_field_sync_mux : virtual public gr::block +{ +public: + typedef boost::shared_ptr<atsc_field_sync_mux> sptr; /*! - * \brief <+description of block+> - * \ingroup dtv - * + * \brief Return a shared_ptr to a new instance of dtv::atsc_field_sync_mux. */ - class DTV_API atsc_field_sync_mux : virtual public gr::block - { - public: - typedef boost::shared_ptr<atsc_field_sync_mux> sptr; - - /*! - * \brief Return a shared_ptr to a new instance of dtv::atsc_field_sync_mux. - */ - static sptr make(); - }; + static sptr make(); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_FIELD_SYNC_MUX_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_fpll.h b/gr-dtv/include/gnuradio/dtv/atsc_fpll.h index 6dc30413da..5e2ab3cba0 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_fpll.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_fpll.h @@ -27,44 +27,43 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief ATSC Receiver FPLL + * + * This block is takes in a complex I/Q baseband stream from the + * receive filter and outputs the 8-level symbol stream. + * + * It does this by first locally generating a pilot tone and + * complex mixing with the input signal. This results in the + * pilot tone shifting to DC and places the signal in the upper + * sideband. + * + * As no information is encoded in the phase of the waveform, the + * Q channel is then discarded, producing a real signal with the + * lower sideband restored. + * + * The 8-level symbol stream still has a DC offset, and still + * requires symbol timing recovery. + * + * \ingroup dtv_atsc + */ +class DTV_API atsc_fpll : virtual public gr::sync_block +{ +public: + // gr::dtv::atsc_fpll::sptr + typedef boost::shared_ptr<atsc_fpll> sptr; /*! - * \brief ATSC Receiver FPLL + * \brief Make a new instance of gr::dtv::atsc_fpll. * - * This block is takes in a complex I/Q baseband stream from the - * receive filter and outputs the 8-level symbol stream. - * - * It does this by first locally generating a pilot tone and - * complex mixing with the input signal. This results in the - * pilot tone shifting to DC and places the signal in the upper - * sideband. - * - * As no information is encoded in the phase of the waveform, the - * Q channel is then discarded, producing a real signal with the - * lower sideband restored. - * - * The 8-level symbol stream still has a DC offset, and still - * requires symbol timing recovery. - * - * \ingroup dtv_atsc + * param rate Sample rate of incoming stream */ - class DTV_API atsc_fpll : virtual public gr::sync_block - { - public: - - // gr::dtv::atsc_fpll::sptr - typedef boost::shared_ptr<atsc_fpll> sptr; - - /*! - * \brief Make a new instance of gr::dtv::atsc_fpll. - * - * param rate Sample rate of incoming stream - */ - static sptr make(float rate); - }; + static sptr make(float rate); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_FPLL_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_fs_checker.h b/gr-dtv/include/gnuradio/dtv/atsc_fs_checker.h index d5a4a7d083..7cfc882765 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_fs_checker.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_fs_checker.h @@ -27,27 +27,26 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief ATSC Receiver FS_CHECKER + * + * \ingroup dtv_atsc + */ +class DTV_API atsc_fs_checker : virtual public gr::block +{ +public: + // gr::dtv::atsc_fs_checker::sptr + typedef boost::shared_ptr<atsc_fs_checker> sptr; /*! - * \brief ATSC Receiver FS_CHECKER - * - * \ingroup dtv_atsc + * \brief Make a new instance of gr::dtv::atsc_fs_checker. */ - class DTV_API atsc_fs_checker : virtual public gr::block - { - public: - - // gr::dtv::atsc_fs_checker::sptr - typedef boost::shared_ptr<atsc_fs_checker> sptr; - - /*! - * \brief Make a new instance of gr::dtv::atsc_fs_checker. - */ - static sptr make(); - }; + static sptr make(); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_FS_CHECKER_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_interleaver.h b/gr-dtv/include/gnuradio/dtv/atsc_interleaver.h index 5882fd2ec0..67a8c60713 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_interleaver.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_interleaver.h @@ -25,25 +25,25 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief <+description of block+> + * \ingroup dtv + * + */ +class DTV_API atsc_interleaver : virtual public gr::sync_block +{ +public: + typedef boost::shared_ptr<atsc_interleaver> sptr; /*! - * \brief <+description of block+> - * \ingroup dtv - * + * \brief Return a shared_ptr to a new instance of dtv::atsc_interleaver. */ - class DTV_API atsc_interleaver : virtual public gr::sync_block - { - public: - typedef boost::shared_ptr<atsc_interleaver> sptr; - - /*! - * \brief Return a shared_ptr to a new instance of dtv::atsc_interleaver. - */ - static sptr make(); - }; + static sptr make(); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_INTERLEAVER_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_pad.h b/gr-dtv/include/gnuradio/dtv/atsc_pad.h index b14f2e7c5e..6716d23a88 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_pad.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_pad.h @@ -25,25 +25,25 @@ #include <gnuradio/sync_decimator.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief <+description of block+> + * \ingroup dtv + * + */ +class DTV_API atsc_pad : virtual public gr::sync_decimator +{ +public: + typedef boost::shared_ptr<atsc_pad> sptr; /*! - * \brief <+description of block+> - * \ingroup dtv - * + * \brief Return a shared_ptr to a new instance of dtv::atsc_pad. */ - class DTV_API atsc_pad : virtual public gr::sync_decimator - { - public: - typedef boost::shared_ptr<atsc_pad> sptr; - - /*! - * \brief Return a shared_ptr to a new instance of dtv::atsc_pad. - */ - static sptr make(); - }; + static sptr make(); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_PAD_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_randomizer.h b/gr-dtv/include/gnuradio/dtv/atsc_randomizer.h index e938f61614..63d2630caa 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_randomizer.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_randomizer.h @@ -26,25 +26,25 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief <+description of block+> + * \ingroup dtv + * + */ +class DTV_API atsc_randomizer : virtual public gr::sync_block +{ +public: + typedef boost::shared_ptr<atsc_randomizer> sptr; /*! - * \brief <+description of block+> - * \ingroup dtv - * + * \brief Return a shared_ptr to a new instance of dtv::atsc_randomizer. */ - class DTV_API atsc_randomizer : virtual public gr::sync_block - { - public: - typedef boost::shared_ptr<atsc_randomizer> sptr; - - /*! - * \brief Return a shared_ptr to a new instance of dtv::atsc_randomizer. - */ - static sptr make(); - }; - - } // namespace dtv + static sptr make(); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_RANDOMIZER_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_rs_decoder.h b/gr-dtv/include/gnuradio/dtv/atsc_rs_decoder.h index c2b7d0defa..8de71bbb6a 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_rs_decoder.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_rs_decoder.h @@ -27,42 +27,41 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief ATSC Receiver Reed-Solomon Decoder + * + * \ingroup dtv_atsc + */ +class DTV_API atsc_rs_decoder : virtual public gr::sync_block +{ +public: + // gr::dtv::atsc_rs_decoder::sptr + typedef boost::shared_ptr<atsc_rs_decoder> sptr; /*! - * \brief ATSC Receiver Reed-Solomon Decoder - * - * \ingroup dtv_atsc + * Returns the number of errors corrected by the decoder. */ - class DTV_API atsc_rs_decoder : virtual public gr::sync_block - { - public: + virtual int num_errors_corrected() const = 0; - // gr::dtv::atsc_rs_decoder::sptr - typedef boost::shared_ptr<atsc_rs_decoder> sptr; - - /*! - * Returns the number of errors corrected by the decoder. - */ - virtual int num_errors_corrected() const = 0; - - /*! - * Returns the number of bad packets rejected by the decoder. - */ - virtual int num_bad_packets() const = 0; + /*! + * Returns the number of bad packets rejected by the decoder. + */ + virtual int num_bad_packets() const = 0; - /*! - * Returns the total number of packets seen by the decoder. - */ - virtual int num_packets() const = 0; + /*! + * Returns the total number of packets seen by the decoder. + */ + virtual int num_packets() const = 0; - /*! - * \brief Make a new instance of gr::dtv::atsc_rs_decoder. - */ - static sptr make(); - }; + /*! + * \brief Make a new instance of gr::dtv::atsc_rs_decoder. + */ + static sptr make(); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_RS_DECODER_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_rs_encoder.h b/gr-dtv/include/gnuradio/dtv/atsc_rs_encoder.h index 53889c73f8..51d7f07a37 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_rs_encoder.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_rs_encoder.h @@ -26,25 +26,25 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief <+description of block+> + * \ingroup dtv + * + */ +class DTV_API atsc_rs_encoder : virtual public gr::sync_block +{ +public: + typedef boost::shared_ptr<atsc_rs_encoder> sptr; /*! - * \brief <+description of block+> - * \ingroup dtv - * + * \brief Return a shared_ptr to a new instance of dtv::atsc_rs_encoder. */ - class DTV_API atsc_rs_encoder : virtual public gr::sync_block - { - public: - typedef boost::shared_ptr<atsc_rs_encoder> sptr; - - /*! - * \brief Return a shared_ptr to a new instance of dtv::atsc_rs_encoder. - */ - static sptr make(); - }; - - } // namespace dtv + static sptr make(); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_RS_ENCODER_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_sync.h b/gr-dtv/include/gnuradio/dtv/atsc_sync.h index 8a2aded60d..527e028fd8 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_sync.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_sync.h @@ -27,29 +27,28 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief ATSC Receiver SYNC + * + * \ingroup dtv_atsc + */ +class DTV_API atsc_sync : virtual public gr::block +{ +public: + // gr::dtv::atsc_sync::sptr + typedef boost::shared_ptr<atsc_sync> sptr; /*! - * \brief ATSC Receiver SYNC + * \brief Make a new instance of gr::dtv::atsc_sync. * - * \ingroup dtv_atsc + * param rate Sample rate of incoming stream */ - class DTV_API atsc_sync : virtual public gr::block - { - public: - - // gr::dtv::atsc_sync::sptr - typedef boost::shared_ptr<atsc_sync> sptr; - - /*! - * \brief Make a new instance of gr::dtv::atsc_sync. - * - * param rate Sample rate of incoming stream - */ - static sptr make(float rate); - }; + static sptr make(float rate); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_SYNC_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_trellis_encoder.h b/gr-dtv/include/gnuradio/dtv/atsc_trellis_encoder.h index 925e9c21bd..6873df013c 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_trellis_encoder.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_trellis_encoder.h @@ -25,25 +25,25 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief <+description of block+> + * \ingroup dtv + * + */ +class DTV_API atsc_trellis_encoder : virtual public gr::sync_block +{ +public: + typedef boost::shared_ptr<atsc_trellis_encoder> sptr; /*! - * \brief <+description of block+> - * \ingroup dtv - * + * \brief Return a shared_ptr to a new instance of dtv::atsc_trellis_encoder. */ - class DTV_API atsc_trellis_encoder : virtual public gr::sync_block - { - public: - typedef boost::shared_ptr<atsc_trellis_encoder> sptr; - - /*! - * \brief Return a shared_ptr to a new instance of dtv::atsc_trellis_encoder. - */ - static sptr make(); - }; + static sptr make(); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_TRELLIS_ENCODER_H */ diff --git a/gr-dtv/include/gnuradio/dtv/atsc_viterbi_decoder.h b/gr-dtv/include/gnuradio/dtv/atsc_viterbi_decoder.h index 8efece4c43..636c659eca 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_viterbi_decoder.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_viterbi_decoder.h @@ -27,33 +27,32 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief ATSC Viterbi Decoder + * + * \ingroup dtv_atsc + */ +class DTV_API atsc_viterbi_decoder : virtual public gr::sync_block +{ +public: + // gr::dtv::atsc_viterbi_decoder::sptr + typedef boost::shared_ptr<atsc_viterbi_decoder> sptr; /*! - * \brief ATSC Viterbi Decoder - * - * \ingroup dtv_atsc + * \brief Make a new instance of gr::dtv::atsc_viterbi_decoder. */ - class DTV_API atsc_viterbi_decoder : virtual public gr::sync_block - { - public: - - // gr::dtv::atsc_viterbi_decoder::sptr - typedef boost::shared_ptr<atsc_viterbi_decoder> sptr; - - /*! - * \brief Make a new instance of gr::dtv::atsc_viterbi_decoder. - */ - static sptr make(); - - /*! - * For each decoder, returns the current best state of the - * decoding metrics. - */ - virtual std::vector<float> decoder_metrics() const = 0; - }; - - } /* namespace dtv */ + static sptr make(); + + /*! + * For each decoder, returns the current best state of the + * decoding metrics. + */ + virtual std::vector<float> decoder_metrics() const = 0; +}; + +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_VITERBI_DECODER_H */ diff --git a/gr-dtv/include/gnuradio/dtv/catv_config.h b/gr-dtv/include/gnuradio/dtv/catv_config.h index a5da46cb5d..db15e5c010 100644 --- a/gr-dtv/include/gnuradio/dtv/catv_config.h +++ b/gr-dtv/include/gnuradio/dtv/catv_config.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -22,16 +22,15 @@ #define INCLUDED_DTV_CATV_CONFIG_H namespace gr { - namespace dtv { - enum catv_constellation_t { - CATV_MOD_64QAM = 0, - CATV_MOD_256QAM, - }; +namespace dtv { +enum catv_constellation_t { + CATV_MOD_64QAM = 0, + CATV_MOD_256QAM, +}; - } // namespace dtv +} // namespace dtv } // namespace gr typedef gr::dtv::catv_constellation_t catv_constellation_t; #endif /* INCLUDED_DTV_CATV_CONFIG_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/catv_frame_sync_enc_bb.h b/gr-dtv/include/gnuradio/dtv/catv_frame_sync_enc_bb.h index 5f75af8c00..946075ac1c 100644 --- a/gr-dtv/include/gnuradio/dtv/catv_frame_sync_enc_bb.h +++ b/gr-dtv/include/gnuradio/dtv/catv_frame_sync_enc_bb.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,31 +26,31 @@ #include <gnuradio/dtv/catv_config.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Frame Sync Encoder. Adds a 42-bit (64QAM) or 40-bit (256QAM) frame sync pattern + * with control word. \ingroup dtv + * + * Input: Scrambled FEC Frame packets of 60 * 128 (64QAM) or 88 * 128 (256QAM) 7-bit + * symbols.\n Output: Scrambled FEC Frame packets of 60 * 128 (64QAM) or 88 * 128 (256QAM) + * 7-bit symbols with 42-bit (64QAM) or 40-bit (256QAM) FSYNC word. + */ +class DTV_API catv_frame_sync_enc_bb : virtual public gr::block +{ +public: + typedef boost::shared_ptr<catv_frame_sync_enc_bb> sptr; /*! - * \brief Frame Sync Encoder. Adds a 42-bit (64QAM) or 40-bit (256QAM) frame sync pattern with control word. - * \ingroup dtv + * \brief Create an ITU-T J.83B Frame Sync Encoder. * - * Input: Scrambled FEC Frame packets of 60 * 128 (64QAM) or 88 * 128 (256QAM) 7-bit symbols.\n - * Output: Scrambled FEC Frame packets of 60 * 128 (64QAM) or 88 * 128 (256QAM) 7-bit symbols with 42-bit (64QAM) or 40-bit (256QAM) FSYNC word. + * \param constellation 64QAM or 256QAM constellation. \n + * \param ctrlword convolutional interleaver control word. */ - class DTV_API catv_frame_sync_enc_bb : virtual public gr::block - { - public: - typedef boost::shared_ptr<catv_frame_sync_enc_bb> sptr; - - /*! - * \brief Create an ITU-T J.83B Frame Sync Encoder. - * - * \param constellation 64QAM or 256QAM constellation. \n - * \param ctrlword convolutional interleaver control word. - */ - static sptr make(catv_constellation_t constellation, int ctrlword); - }; + static sptr make(catv_constellation_t constellation, int ctrlword); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_CATV_FRAME_SYNC_ENC_BB_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/catv_randomizer_bb.h b/gr-dtv/include/gnuradio/dtv/catv_randomizer_bb.h index a088153510..3229d87553 100644 --- a/gr-dtv/include/gnuradio/dtv/catv_randomizer_bb.h +++ b/gr-dtv/include/gnuradio/dtv/catv_randomizer_bb.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,30 +26,30 @@ #include <gnuradio/dtv/catv_config.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Randomizer, x^3 + x + alpha^3, 7-bit symbols. + * \ingroup dtv + * + * Input: Interleaved MPEG-2 + RS parity bitstream packets of 128 7-bit symbols.\n + * Output: Scrambled FEC Frame packets of 60 * 128 (64QAM) or 88 * 128 (256QAM) 7-bit + * symbols. + */ +class DTV_API catv_randomizer_bb : virtual public gr::sync_block +{ +public: + typedef boost::shared_ptr<catv_randomizer_bb> sptr; /*! - * \brief Randomizer, x^3 + x + alpha^3, 7-bit symbols. - * \ingroup dtv + * \brief Create an ITU-T J.83B randomizer. * - * Input: Interleaved MPEG-2 + RS parity bitstream packets of 128 7-bit symbols.\n - * Output: Scrambled FEC Frame packets of 60 * 128 (64QAM) or 88 * 128 (256QAM) 7-bit symbols. + * \param constellation 64QAM or 256QAM constellation. */ - class DTV_API catv_randomizer_bb : virtual public gr::sync_block - { - public: - typedef boost::shared_ptr<catv_randomizer_bb> sptr; - - /*! - * \brief Create an ITU-T J.83B randomizer. - * - * \param constellation 64QAM or 256QAM constellation. - */ - static sptr make(catv_constellation_t constellation); - }; + static sptr make(catv_constellation_t constellation); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_CATV_RANDOMIZER_BB_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/catv_reed_solomon_enc_bb.h b/gr-dtv/include/gnuradio/dtv/catv_reed_solomon_enc_bb.h index b661f0da7f..d5f8bb5ff3 100644 --- a/gr-dtv/include/gnuradio/dtv/catv_reed_solomon_enc_bb.h +++ b/gr-dtv/include/gnuradio/dtv/catv_reed_solomon_enc_bb.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,29 +25,28 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Reed Solomon Encoder, t=3, (128,122), 7-bit symbols. + * \ingroup dtv + * + * Input: MPEG-2 bitstream packets of 122 7-bit symbols.\n + * Output: MPEG-2 + RS parity bitstream packets of 128 7-bit symbols. + */ +class DTV_API catv_reed_solomon_enc_bb : virtual public gr::block +{ +public: + typedef boost::shared_ptr<catv_reed_solomon_enc_bb> sptr; /*! - * \brief Reed Solomon Encoder, t=3, (128,122), 7-bit symbols. - * \ingroup dtv + * \brief Create an ITU-T J.83B Reed Solomon encoder. * - * Input: MPEG-2 bitstream packets of 122 7-bit symbols.\n - * Output: MPEG-2 + RS parity bitstream packets of 128 7-bit symbols. */ - class DTV_API catv_reed_solomon_enc_bb : virtual public gr::block - { - public: - typedef boost::shared_ptr<catv_reed_solomon_enc_bb> sptr; - - /*! - * \brief Create an ITU-T J.83B Reed Solomon encoder. - * - */ - static sptr make(); - }; + static sptr make(); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_CATV_REED_SOLOMON_ENC_BB_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/catv_transport_framing_enc_bb.h b/gr-dtv/include/gnuradio/dtv/catv_transport_framing_enc_bb.h index 7df100d990..198db91355 100644 --- a/gr-dtv/include/gnuradio/dtv/catv_transport_framing_enc_bb.h +++ b/gr-dtv/include/gnuradio/dtv/catv_transport_framing_enc_bb.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,29 +25,28 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Transport Framing Encoder. Adds a parity checksum to MPEG-2 packets. + * \ingroup dtv + * + * Input: MPEG-2 Transport Stream.\n + * Output: MPEG-2 Transport Stream with parity checksum byte. + */ +class DTV_API catv_transport_framing_enc_bb : virtual public gr::sync_block +{ +public: + typedef boost::shared_ptr<catv_transport_framing_enc_bb> sptr; /*! - * \brief Transport Framing Encoder. Adds a parity checksum to MPEG-2 packets. - * \ingroup dtv + * \brief Create an ITU-T J.83B Transport Framing Encoder. * - * Input: MPEG-2 Transport Stream.\n - * Output: MPEG-2 Transport Stream with parity checksum byte. */ - class DTV_API catv_transport_framing_enc_bb : virtual public gr::sync_block - { - public: - typedef boost::shared_ptr<catv_transport_framing_enc_bb> sptr; - - /*! - * \brief Create an ITU-T J.83B Transport Framing Encoder. - * - */ - static sptr make(); - }; + static sptr make(); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_CATV_TRANSPORT_FRAMING_ENC_BB_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/catv_trellis_enc_bb.h b/gr-dtv/include/gnuradio/dtv/catv_trellis_enc_bb.h index 3f9d0fc927..3c324340eb 100644 --- a/gr-dtv/include/gnuradio/dtv/catv_trellis_enc_bb.h +++ b/gr-dtv/include/gnuradio/dtv/catv_trellis_enc_bb.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,30 +26,31 @@ #include <gnuradio/dtv/catv_config.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Trellis Encoder. 14/15 (64QAM) or 19/20 (256QAM) code rate. + * \ingroup dtv + * + * Input: Scrambled FEC Frame packets of 60 * 128 (64QAM) or 88 * 128 (256QAM) 7-bit + * symbols with 42-bit (64QAM) or 40-bit (256QAM) FSYNC word.\n Output: Four 7-bit symbols + * (28 bits) Trellis encoded to 30 bits (64QAM, 14/15 code rate) or 38 data bits Trellis + * encoded to 40 bits (256QAM, 19/20 code rate). + */ +class DTV_API catv_trellis_enc_bb : virtual public gr::block +{ +public: + typedef boost::shared_ptr<catv_trellis_enc_bb> sptr; /*! - * \brief Trellis Encoder. 14/15 (64QAM) or 19/20 (256QAM) code rate. - * \ingroup dtv + * \brief Create an ITU-T J.83B Trellis Encoder. * - * Input: Scrambled FEC Frame packets of 60 * 128 (64QAM) or 88 * 128 (256QAM) 7-bit symbols with 42-bit (64QAM) or 40-bit (256QAM) FSYNC word.\n - * Output: Four 7-bit symbols (28 bits) Trellis encoded to 30 bits (64QAM, 14/15 code rate) or 38 data bits Trellis encoded to 40 bits (256QAM, 19/20 code rate). + * \param constellation 64QAM or 256QAM constellation. */ - class DTV_API catv_trellis_enc_bb : virtual public gr::block - { - public: - typedef boost::shared_ptr<catv_trellis_enc_bb> sptr; - - /*! - * \brief Create an ITU-T J.83B Trellis Encoder. - * - * \param constellation 64QAM or 256QAM constellation. - */ - static sptr make(catv_constellation_t constellation); - }; + static sptr make(catv_constellation_t constellation); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_CATV_TRELLIS_ENC_BB_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvb_bbheader_bb.h b/gr-dtv/include/gnuradio/dtv/dvb_bbheader_bb.h index c356210d7e..ab76b05ab2 100644 --- a/gr-dtv/include/gnuradio/dtv/dvb_bbheader_bb.h +++ b/gr-dtv/include/gnuradio/dtv/dvb_bbheader_bb.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015-2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -28,40 +28,46 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Formats MPEG-2 Transport Stream packets into FEC baseband frames + * and adds a 10-byte header. + * \ingroup dtv + * + * \details + * Input: 188-byte MPEG-2 Transport Stream packets. \n + * Output: Variable length FEC baseband frames (BBFRAME). The output frame + * length is based on the FEC rate. + */ +class DTV_API dvb_bbheader_bb : virtual public gr::block +{ +public: + typedef boost::shared_ptr<dvb_bbheader_bb> sptr; /*! - * \brief Formats MPEG-2 Transport Stream packets into FEC baseband frames - * and adds a 10-byte header. - * \ingroup dtv + * \brief Create a baseband header formatter. * - * \details - * Input: 188-byte MPEG-2 Transport Stream packets. \n - * Output: Variable length FEC baseband frames (BBFRAME). The output frame - * length is based on the FEC rate. + * \param standard DVB standard (DVB-S2 or DVB-T2). + * \param framesize FEC frame size (normal, medium or short). + * \param rate FEC code rate. + * \param rolloff DVB-S2 root-raised-cosine filter roll-off. + * \param mode DVB-T2 input processing mode. + * \param inband DVB-T2 Type B in-band signalling. + * \param fecblocks DVB-T2 number of FEC block for in-band signalling. + * \param tsrate DVB-T2 Transport Stream rate for in-band signalling. */ - class DTV_API dvb_bbheader_bb : virtual public gr::block - { - public: - typedef boost::shared_ptr<dvb_bbheader_bb> sptr; + static sptr make(dvb_standard_t standard, + dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvbs2_rolloff_factor_t rolloff, + dvbt2_inputmode_t mode, + dvbt2_inband_t inband, + int fecblocks, + int tsrate); +}; - /*! - * \brief Create a baseband header formatter. - * - * \param standard DVB standard (DVB-S2 or DVB-T2). - * \param framesize FEC frame size (normal, medium or short). - * \param rate FEC code rate. - * \param rolloff DVB-S2 root-raised-cosine filter roll-off. - * \param mode DVB-T2 input processing mode. - * \param inband DVB-T2 Type B in-band signalling. - * \param fecblocks DVB-T2 number of FEC block for in-band signalling. - * \param tsrate DVB-T2 Transport Stream rate for in-band signalling. - */ - static sptr make(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate, dvbs2_rolloff_factor_t rolloff, dvbt2_inputmode_t mode, dvbt2_inband_t inband, int fecblocks, int tsrate); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVB_BBHEADER_BB_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvb_bbscrambler_bb.h b/gr-dtv/include/gnuradio/dtv/dvb_bbscrambler_bb.h index 0acba70cd5..24cc378deb 100644 --- a/gr-dtv/include/gnuradio/dtv/dvb_bbscrambler_bb.h +++ b/gr-dtv/include/gnuradio/dtv/dvb_bbscrambler_bb.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015-2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,33 +26,33 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Scrambles FEC baseband frames with a PRBS encoder. + * \ingroup dtv + * + * \details + * Input: Variable length FEC baseband frames (BBFRAME). \n + * Output: Scrambled variable length FEC baseband frames (BBFRAME). + */ +class DTV_API dvb_bbscrambler_bb : virtual public gr::sync_block +{ +public: + typedef boost::shared_ptr<dvb_bbscrambler_bb> sptr; /*! - * \brief Scrambles FEC baseband frames with a PRBS encoder. - * \ingroup dtv + * \brief Create a baseband frame scrambler. * - * \details - * Input: Variable length FEC baseband frames (BBFRAME). \n - * Output: Scrambled variable length FEC baseband frames (BBFRAME). + * \param standard DVB standard (DVB-S2 or DVB-T2). + * \param framesize FEC frame size (normal, medium or short). + * \param rate FEC code rate. */ - class DTV_API dvb_bbscrambler_bb : virtual public gr::sync_block - { - public: - typedef boost::shared_ptr<dvb_bbscrambler_bb> sptr; - - /*! - * \brief Create a baseband frame scrambler. - * - * \param standard DVB standard (DVB-S2 or DVB-T2). - * \param framesize FEC frame size (normal, medium or short). - * \param rate FEC code rate. - */ - static sptr make(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate); - }; + static sptr + make(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVB_BBSCRAMBLER_BB_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvb_bch_bb.h b/gr-dtv/include/gnuradio/dtv/dvb_bch_bb.h index 34a8684fa4..3daafaf627 100644 --- a/gr-dtv/include/gnuradio/dtv/dvb_bch_bb.h +++ b/gr-dtv/include/gnuradio/dtv/dvb_bch_bb.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015-2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,33 +27,33 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Encodes a BCH ((Bose, Chaudhuri, Hocquenghem) FEC. + * \ingroup dtv + * + * \details + * Input: Variable length FEC baseband frames (BBFRAME). \n + * Output: Variable length FEC baseband frames with appended BCH (BCHFEC). + */ +class DTV_API dvb_bch_bb : virtual public gr::block +{ +public: + typedef boost::shared_ptr<dvb_bch_bb> sptr; /*! - * \brief Encodes a BCH ((Bose, Chaudhuri, Hocquenghem) FEC. - * \ingroup dtv + * \brief Create a baseband frame BCH encoder. * - * \details - * Input: Variable length FEC baseband frames (BBFRAME). \n - * Output: Variable length FEC baseband frames with appended BCH (BCHFEC). + * \param standard DVB standard (DVB-S2 or DVB-T2). + * \param framesize FEC frame size (normal, medium or short). + * \param rate FEC code rate. */ - class DTV_API dvb_bch_bb : virtual public gr::block - { - public: - typedef boost::shared_ptr<dvb_bch_bb> sptr; - - /*! - * \brief Create a baseband frame BCH encoder. - * - * \param standard DVB standard (DVB-S2 or DVB-T2). - * \param framesize FEC frame size (normal, medium or short). - * \param rate FEC code rate. - */ - static sptr make(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate); - }; - - } // namespace dtv + static sptr + make(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVB_BCH_BB_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvb_config.h b/gr-dtv/include/gnuradio/dtv/dvb_config.h index 68010e43b6..ddf99434c4 100644 --- a/gr-dtv/include/gnuradio/dtv/dvb_config.h +++ b/gr-dtv/include/gnuradio/dtv/dvb_config.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -22,106 +22,106 @@ #define INCLUDED_DTV_DVB_CONFIG_H namespace gr { - namespace dtv { - enum dvb_standard_t { - STANDARD_DVBS2 = 0, - STANDARD_DVBT2, - }; +namespace dtv { +enum dvb_standard_t { + STANDARD_DVBS2 = 0, + STANDARD_DVBT2, +}; - enum dvb_code_rate_t { - C1_4 = 0, - C1_3, - C2_5, - C1_2, - C3_5, - C2_3, - C3_4, - C4_5, - C5_6, - C7_8, - C8_9, - C9_10, - C13_45, - C9_20, - C90_180, - C96_180, - C11_20, - C100_180, - C104_180, - C26_45, - C18_30, - C28_45, - C23_36, - C116_180, - C20_30, - C124_180, - C25_36, - C128_180, - C13_18, - C132_180, - C22_30, - C135_180, - C140_180, - C7_9, - C154_180, - C11_45, - C4_15, - C14_45, - C7_15, - C8_15, - C32_45, - C2_9_VLSNR, - C1_5_MEDIUM, - C11_45_MEDIUM, - C1_3_MEDIUM, - C1_5_VLSNR_SF2, - C11_45_VLSNR_SF2, - C1_5_VLSNR, - C4_15_VLSNR, - C1_3_VLSNR, - C_OTHER, - }; +enum dvb_code_rate_t { + C1_4 = 0, + C1_3, + C2_5, + C1_2, + C3_5, + C2_3, + C3_4, + C4_5, + C5_6, + C7_8, + C8_9, + C9_10, + C13_45, + C9_20, + C90_180, + C96_180, + C11_20, + C100_180, + C104_180, + C26_45, + C18_30, + C28_45, + C23_36, + C116_180, + C20_30, + C124_180, + C25_36, + C128_180, + C13_18, + C132_180, + C22_30, + C135_180, + C140_180, + C7_9, + C154_180, + C11_45, + C4_15, + C14_45, + C7_15, + C8_15, + C32_45, + C2_9_VLSNR, + C1_5_MEDIUM, + C11_45_MEDIUM, + C1_3_MEDIUM, + C1_5_VLSNR_SF2, + C11_45_VLSNR_SF2, + C1_5_VLSNR, + C4_15_VLSNR, + C1_3_VLSNR, + C_OTHER, +}; - enum dvb_framesize_t { - FECFRAME_SHORT = 0, - FECFRAME_NORMAL, - FECFRAME_MEDIUM, - }; +enum dvb_framesize_t { + FECFRAME_SHORT = 0, + FECFRAME_NORMAL, + FECFRAME_MEDIUM, +}; - enum dvb_constellation_t { - MOD_QPSK = 0, - MOD_16QAM, - MOD_64QAM, - MOD_256QAM, - MOD_8PSK, - MOD_8APSK, - MOD_16APSK, - MOD_8_8APSK, - MOD_32APSK, - MOD_4_12_16APSK, - MOD_4_8_4_16APSK, - MOD_64APSK, - MOD_8_16_20_20APSK, - MOD_4_12_20_28APSK, - MOD_128APSK, - MOD_256APSK, - MOD_BPSK, - MOD_BPSK_SF2, - MOD_8VSB, - MOD_OTHER, - }; +enum dvb_constellation_t { + MOD_QPSK = 0, + MOD_16QAM, + MOD_64QAM, + MOD_256QAM, + MOD_8PSK, + MOD_8APSK, + MOD_16APSK, + MOD_8_8APSK, + MOD_32APSK, + MOD_4_12_16APSK, + MOD_4_8_4_16APSK, + MOD_64APSK, + MOD_8_16_20_20APSK, + MOD_4_12_20_28APSK, + MOD_128APSK, + MOD_256APSK, + MOD_BPSK, + MOD_BPSK_SF2, + MOD_8VSB, + MOD_OTHER, +}; - enum dvb_guardinterval_t { - GI_1_32 = 0, - GI_1_16, - GI_1_8, - GI_1_4, - GI_1_128, - GI_19_128, - GI_19_256, - }; +enum dvb_guardinterval_t { + GI_1_32 = 0, + GI_1_16, + GI_1_8, + GI_1_4, + GI_1_128, + GI_19_128, + GI_19_256, +}; - } // namespace dtv +} // namespace dtv } // namespace gr typedef gr::dtv::dvb_standard_t dvb_standard_t; @@ -131,4 +131,3 @@ typedef gr::dtv::dvb_constellation_t dvb_constellation_t; typedef gr::dtv::dvb_guardinterval_t dvb_guardinterval_t; #endif /* INCLUDED_DTV_DVB_CONFIG_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvb_ldpc_bb.h b/gr-dtv/include/gnuradio/dtv/dvb_ldpc_bb.h index 215c8deb93..702d9c2580 100644 --- a/gr-dtv/include/gnuradio/dtv/dvb_ldpc_bb.h +++ b/gr-dtv/include/gnuradio/dtv/dvb_ldpc_bb.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015-2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,33 +26,35 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Encodes a LDPC (Low-Density Parity-Check) FEC. + * \ingroup dtv + * + * Input: Variable length FEC baseband frames with appended BCH (BCHFEC). \n + * Output: Normal, medium or short FEC baseband frames with appended LPDC (LDPCFEC). + */ +class DTV_API dvb_ldpc_bb : virtual public gr::block +{ +public: + typedef boost::shared_ptr<dvb_ldpc_bb> sptr; /*! - * \brief Encodes a LDPC (Low-Density Parity-Check) FEC. - * \ingroup dtv + * \brief Create a baseband frame LDPC encoder. * - * Input: Variable length FEC baseband frames with appended BCH (BCHFEC). \n - * Output: Normal, medium or short FEC baseband frames with appended LPDC (LDPCFEC). + * \param standard DVB standard (DVB-S2 or DVB-T2). + * \param framesize FEC frame size (normal, medium or short). + * \param rate FEC code rate. + * \param constellation DVB-S2 constellation. */ - class DTV_API dvb_ldpc_bb : virtual public gr::block - { - public: - typedef boost::shared_ptr<dvb_ldpc_bb> sptr; - - /*! - * \brief Create a baseband frame LDPC encoder. - * - * \param standard DVB standard (DVB-S2 or DVB-T2). - * \param framesize FEC frame size (normal, medium or short). - * \param rate FEC code rate. - * \param constellation DVB-S2 constellation. - */ - static sptr make(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation); - }; + static sptr make(dvb_standard_t standard, + dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVB_LDPC_BB_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbs2_config.h b/gr-dtv/include/gnuradio/dtv/dvbs2_config.h index 079857a8cf..9ea6453fac 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbs2_config.h +++ b/gr-dtv/include/gnuradio/dtv/dvbs2_config.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -22,28 +22,28 @@ #define INCLUDED_DTV_DVBS2_CONFIG_H namespace gr { - namespace dtv { - enum dvbs2_rolloff_factor_t { - RO_0_35 = 0, - RO_0_25, - RO_0_20, - RO_RESERVED, - RO_0_15, - RO_0_10, - RO_0_05, - }; - - enum dvbs2_pilots_t { - PILOTS_OFF = 0, - PILOTS_ON, - }; - - enum dvbs2_interpolation_t { - INTERPOLATION_OFF = 0, - INTERPOLATION_ON, - }; - - } // namespace dtv +namespace dtv { +enum dvbs2_rolloff_factor_t { + RO_0_35 = 0, + RO_0_25, + RO_0_20, + RO_RESERVED, + RO_0_15, + RO_0_10, + RO_0_05, +}; + +enum dvbs2_pilots_t { + PILOTS_OFF = 0, + PILOTS_ON, +}; + +enum dvbs2_interpolation_t { + INTERPOLATION_OFF = 0, + INTERPOLATION_ON, +}; + +} // namespace dtv } // namespace gr typedef gr::dtv::dvbs2_rolloff_factor_t dvbs2_rolloff_factor_t; @@ -51,4 +51,3 @@ typedef gr::dtv::dvbs2_pilots_t dvbs2_pilots_t; typedef gr::dtv::dvbs2_interpolation_t dvbs2_interpolation_t; #endif /* INCLUDED_DTV_DVBS2_CONFIG_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbs2_interleaver_bb.h b/gr-dtv/include/gnuradio/dtv/dvbs2_interleaver_bb.h index 665e6c5e0a..af7731fa65 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbs2_interleaver_bb.h +++ b/gr-dtv/include/gnuradio/dtv/dvbs2_interleaver_bb.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,32 +26,33 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Bit interleaves DVB-S2 FEC baseband frames. + * \ingroup dtv + * + * Input: Normal or short FEC baseband frames with appended LPDC (LDPCFEC). \n + * Output: Bit interleaved baseband frames. + */ +class DTV_API dvbs2_interleaver_bb : virtual public gr::block +{ +public: + typedef boost::shared_ptr<dvbs2_interleaver_bb> sptr; /*! - * \brief Bit interleaves DVB-S2 FEC baseband frames. - * \ingroup dtv + * \brief Create a DVB-S2 bit interleaver. * - * Input: Normal or short FEC baseband frames with appended LPDC (LDPCFEC). \n - * Output: Bit interleaved baseband frames. + * \param framesize FEC frame size (normal or short). + * \param rate FEC code rate. + * \param constellation DVB-S2 constellation. */ - class DTV_API dvbs2_interleaver_bb : virtual public gr::block - { - public: - typedef boost::shared_ptr<dvbs2_interleaver_bb> sptr; - - /*! - * \brief Create a DVB-S2 bit interleaver. - * - * \param framesize FEC frame size (normal or short). - * \param rate FEC code rate. - * \param constellation DVB-S2 constellation. - */ - static sptr make(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation); - }; + static sptr make(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBS2_INTERLEAVER_BB_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbs2_modulator_bc.h b/gr-dtv/include/gnuradio/dtv/dvbs2_modulator_bc.h index c794fc18df..1c6f6b4e56 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbs2_modulator_bc.h +++ b/gr-dtv/include/gnuradio/dtv/dvbs2_modulator_bc.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015-2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,33 +27,35 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Modulates DVB-S2 frames. + * \ingroup dtv + * + * Input: Bit interleaved baseband frames. \n + * Output: QPSK, 8PSK, 16APSK or 32APSK modulated complex IQ values (XFECFRAME). + */ +class DTV_API dvbs2_modulator_bc : virtual public gr::block +{ +public: + typedef boost::shared_ptr<dvbs2_modulator_bc> sptr; /*! - * \brief Modulates DVB-S2 frames. - * \ingroup dtv + * \brief Create a DVB-S2 constellation modulator. * - * Input: Bit interleaved baseband frames. \n - * Output: QPSK, 8PSK, 16APSK or 32APSK modulated complex IQ values (XFECFRAME). + * \param framesize FEC frame size (normal or short). + * \param rate FEC code rate. + * \param constellation DVB-S2 constellation. + * \param interpolation 2X zero stuffing interpolation (on/off). */ - class DTV_API dvbs2_modulator_bc : virtual public gr::block - { - public: - typedef boost::shared_ptr<dvbs2_modulator_bc> sptr; - - /*! - * \brief Create a DVB-S2 constellation modulator. - * - * \param framesize FEC frame size (normal or short). - * \param rate FEC code rate. - * \param constellation DVB-S2 constellation. - * \param interpolation 2X zero stuffing interpolation (on/off). - */ - static sptr make(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation, dvbs2_interpolation_t interpolation); - }; + static sptr make(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation, + dvbs2_interpolation_t interpolation); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBS2_MODULATOR_BC_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbs2_physical_cc.h b/gr-dtv/include/gnuradio/dtv/dvbs2_physical_cc.h index 5a46d24ef9..bf872de486 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbs2_physical_cc.h +++ b/gr-dtv/include/gnuradio/dtv/dvbs2_physical_cc.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,34 +27,37 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Signals DVB-S2 physical layer frames. + * \ingroup dtv + * + * Input: QPSK, 8PSK, 16APSK or 32APSK modulated complex IQ values (XFECFRAME). \n + * Output: DVB-S2 PLFRAME. + */ +class DTV_API dvbs2_physical_cc : virtual public gr::block +{ +public: + typedef boost::shared_ptr<dvbs2_physical_cc> sptr; /*! - * \brief Signals DVB-S2 physical layer frames. - * \ingroup dtv + * \brief Create a DVB-S2 physical layer framer. * - * Input: QPSK, 8PSK, 16APSK or 32APSK modulated complex IQ values (XFECFRAME). \n - * Output: DVB-S2 PLFRAME. + * \param framesize FEC frame size (normal or short). + * \param rate FEC code rate. + * \param constellation DVB-S2 constellation. + * \param pilots pilot symbols (on/off). + * \param goldcode physical layer scrambler Gold code (0 to 262141 inclusive). */ - class DTV_API dvbs2_physical_cc : virtual public gr::block - { - public: - typedef boost::shared_ptr<dvbs2_physical_cc> sptr; - - /*! - * \brief Create a DVB-S2 physical layer framer. - * - * \param framesize FEC frame size (normal or short). - * \param rate FEC code rate. - * \param constellation DVB-S2 constellation. - * \param pilots pilot symbols (on/off). - * \param goldcode physical layer scrambler Gold code (0 to 262141 inclusive). - */ - static sptr make(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation, dvbs2_pilots_t pilots, int goldcode); - }; - - } // namespace dtv + static sptr make(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation, + dvbs2_pilots_t pilots, + int goldcode); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBS2_PHYSICAL_CC_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt2_cellinterleaver_cc.h b/gr-dtv/include/gnuradio/dtv/dvbt2_cellinterleaver_cc.h index 090180dd3e..24365fbf67 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt2_cellinterleaver_cc.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt2_cellinterleaver_cc.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,33 +26,35 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Cell and time interleaves QPSK/QAM modulated cells. + * \ingroup dtv + * + * Input: QPSK, 16QAM, 64QAM or 256QAM modulated cells. \n + * Output: Cell and time interleaved QPSK, 16QAM, 64QAM or 256QAM modulated cells. + */ +class DTV_API dvbt2_cellinterleaver_cc : virtual public gr::sync_block +{ +public: + typedef boost::shared_ptr<dvbt2_cellinterleaver_cc> sptr; /*! - * \brief Cell and time interleaves QPSK/QAM modulated cells. - * \ingroup dtv + * \brief Create a DVB-T2 cell and time interleaver. * - * Input: QPSK, 16QAM, 64QAM or 256QAM modulated cells. \n - * Output: Cell and time interleaved QPSK, 16QAM, 64QAM or 256QAM modulated cells. + * \param framesize FEC frame size (normal or short). + * \param constellation DVB-T2 constellation. + * \param fecblocks number of FEC frames in a T2 frame. + * \param tiblocks number of time interleaving blocks in a T2 frame. */ - class DTV_API dvbt2_cellinterleaver_cc : virtual public gr::sync_block - { - public: - typedef boost::shared_ptr<dvbt2_cellinterleaver_cc> sptr; - - /*! - * \brief Create a DVB-T2 cell and time interleaver. - * - * \param framesize FEC frame size (normal or short). - * \param constellation DVB-T2 constellation. - * \param fecblocks number of FEC frames in a T2 frame. - * \param tiblocks number of time interleaving blocks in a T2 frame. - */ - static sptr make(dvb_framesize_t framesize, dvb_constellation_t constellation, int fecblocks, int tiblocks); - }; + static sptr make(dvb_framesize_t framesize, + dvb_constellation_t constellation, + int fecblocks, + int tiblocks); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_CELLINTERLEAVER_CC_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt2_config.h b/gr-dtv/include/gnuradio/dtv/dvbt2_config.h index 906d953255..5db8a11a74 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt2_config.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt2_config.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -22,119 +22,119 @@ #define INCLUDED_DTV_DVBT2_CONFIG_H namespace gr { - namespace dtv { - enum dvbt2_rotation_t { - ROTATION_OFF = 0, - ROTATION_ON, - }; - - enum dvbt2_streamtype_t { - STREAMTYPE_TS = 0, - STREAMTYPE_GS, - STREAMTYPE_BOTH, - }; - - enum dvbt2_inputmode_t { - INPUTMODE_NORMAL = 0, - INPUTMODE_HIEFF, - }; - - enum dvbt2_extended_carrier_t { - CARRIERS_NORMAL = 0, - CARRIERS_EXTENDED, - }; - - enum dvbt2_preamble_t { - PREAMBLE_T2_SISO = 0, - PREAMBLE_T2_MISO, - PREAMBLE_NON_T2, - PREAMBLE_T2_LITE_SISO, - PREAMBLE_T2_LITE_MISO, - }; - - enum dvbt2_fftsize_t { - FFTSIZE_2K = 0, - FFTSIZE_8K, - FFTSIZE_4K, - FFTSIZE_1K, - FFTSIZE_16K, - FFTSIZE_32K, - FFTSIZE_8K_T2GI, - FFTSIZE_32K_T2GI, - FFTSIZE_16K_T2GI = 11, - }; - - enum dvbt2_papr_t { - PAPR_OFF = 0, - PAPR_ACE, - PAPR_TR, - PAPR_BOTH, - }; - - enum dvbt2_l1constellation_t { - L1_MOD_BPSK = 0, - L1_MOD_QPSK, - L1_MOD_16QAM, - L1_MOD_64QAM, - }; - - enum dvbt2_pilotpattern_t { - PILOT_PP1 = 0, - PILOT_PP2, - PILOT_PP3, - PILOT_PP4, - PILOT_PP5, - PILOT_PP6, - PILOT_PP7, - PILOT_PP8, - }; - - enum dvbt2_version_t { - VERSION_111 = 0, - VERSION_121, - VERSION_131, - }; - - enum dvbt2_reservedbiasbits_t { - RESERVED_OFF = 0, - RESERVED_ON, - }; - - enum dvbt2_l1scrambled_t { - L1_SCRAMBLED_OFF = 0, - L1_SCRAMBLED_ON, - }; - - enum dvbt2_misogroup_t { - MISO_TX1 = 0, - MISO_TX2, - }; - - enum dvbt2_showlevels_t { - SHOWLEVELS_OFF = 0, - SHOWLEVELS_ON, - }; - - enum dvbt2_inband_t { - INBAND_OFF = 0, - INBAND_ON, - }; - - enum dvbt2_equalization_t { - EQUALIZATION_OFF = 0, - EQUALIZATION_ON, - }; - - enum dvbt2_bandwidth_t { - BANDWIDTH_1_7_MHZ = 0, - BANDWIDTH_5_0_MHZ, - BANDWIDTH_6_0_MHZ, - BANDWIDTH_7_0_MHZ, - BANDWIDTH_8_0_MHZ, - BANDWIDTH_10_0_MHZ, - }; - - } // namespace dtv +namespace dtv { +enum dvbt2_rotation_t { + ROTATION_OFF = 0, + ROTATION_ON, +}; + +enum dvbt2_streamtype_t { + STREAMTYPE_TS = 0, + STREAMTYPE_GS, + STREAMTYPE_BOTH, +}; + +enum dvbt2_inputmode_t { + INPUTMODE_NORMAL = 0, + INPUTMODE_HIEFF, +}; + +enum dvbt2_extended_carrier_t { + CARRIERS_NORMAL = 0, + CARRIERS_EXTENDED, +}; + +enum dvbt2_preamble_t { + PREAMBLE_T2_SISO = 0, + PREAMBLE_T2_MISO, + PREAMBLE_NON_T2, + PREAMBLE_T2_LITE_SISO, + PREAMBLE_T2_LITE_MISO, +}; + +enum dvbt2_fftsize_t { + FFTSIZE_2K = 0, + FFTSIZE_8K, + FFTSIZE_4K, + FFTSIZE_1K, + FFTSIZE_16K, + FFTSIZE_32K, + FFTSIZE_8K_T2GI, + FFTSIZE_32K_T2GI, + FFTSIZE_16K_T2GI = 11, +}; + +enum dvbt2_papr_t { + PAPR_OFF = 0, + PAPR_ACE, + PAPR_TR, + PAPR_BOTH, +}; + +enum dvbt2_l1constellation_t { + L1_MOD_BPSK = 0, + L1_MOD_QPSK, + L1_MOD_16QAM, + L1_MOD_64QAM, +}; + +enum dvbt2_pilotpattern_t { + PILOT_PP1 = 0, + PILOT_PP2, + PILOT_PP3, + PILOT_PP4, + PILOT_PP5, + PILOT_PP6, + PILOT_PP7, + PILOT_PP8, +}; + +enum dvbt2_version_t { + VERSION_111 = 0, + VERSION_121, + VERSION_131, +}; + +enum dvbt2_reservedbiasbits_t { + RESERVED_OFF = 0, + RESERVED_ON, +}; + +enum dvbt2_l1scrambled_t { + L1_SCRAMBLED_OFF = 0, + L1_SCRAMBLED_ON, +}; + +enum dvbt2_misogroup_t { + MISO_TX1 = 0, + MISO_TX2, +}; + +enum dvbt2_showlevels_t { + SHOWLEVELS_OFF = 0, + SHOWLEVELS_ON, +}; + +enum dvbt2_inband_t { + INBAND_OFF = 0, + INBAND_ON, +}; + +enum dvbt2_equalization_t { + EQUALIZATION_OFF = 0, + EQUALIZATION_ON, +}; + +enum dvbt2_bandwidth_t { + BANDWIDTH_1_7_MHZ = 0, + BANDWIDTH_5_0_MHZ, + BANDWIDTH_6_0_MHZ, + BANDWIDTH_7_0_MHZ, + BANDWIDTH_8_0_MHZ, + BANDWIDTH_10_0_MHZ, +}; + +} // namespace dtv } // namespace gr typedef gr::dtv::dvbt2_rotation_t dvbt2_rotation_t; @@ -156,4 +156,3 @@ typedef gr::dtv::dvbt2_equalization_t dvbt2_equalization_t; typedef gr::dtv::dvbt2_bandwidth_t dvbt2_bandwidth_t; #endif /* INCLUDED_DTV_DVBT2_CONFIG_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt2_framemapper_cc.h b/gr-dtv/include/gnuradio/dtv/dvbt2_framemapper_cc.h index c1da566dc5..0a4827a734 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt2_framemapper_cc.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt2_framemapper_cc.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,49 +27,67 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Maps T2 frames. + * \ingroup dtv + * + * Input: Cell and time interleaved QPSK, 16QAM, 64QAM or 256QAM modulated cells. \n + * Output: T2 frame. + */ +class DTV_API dvbt2_framemapper_cc : virtual public gr::block +{ +public: + typedef boost::shared_ptr<dvbt2_framemapper_cc> sptr; /*! - * \brief Maps T2 frames. - * \ingroup dtv + * \brief Create a DVB-T2 frame mapper. * - * Input: Cell and time interleaved QPSK, 16QAM, 64QAM or 256QAM modulated cells. \n - * Output: T2 frame. + * \param framesize FEC frame size (normal or short). + * \param rate FEC code rate. + * \param constellation DVB-T2 constellation. + * \param rotation DVB-T2 constellation rotation (on or off). + * \param fecblocks number of FEC frames in a T2 frame. + * \param tiblocks number of time interleaving blocks in a T2 frame. + * \param carriermode number of carriers (normal or extended). + * \param fftsize OFDM IFFT size. + * \param guardinterval OFDM ISI guard interval. + * \param l1constellation L1 constellation. + * \param pilotpattern DVB-T2 pilot pattern (PP1 - PP8). + * \param t2frames number of T2 frames in a super-frame. + * \param numdatasyms number of OFDM symbols in a T2 frame. + * \param paprmode PAPR reduction mode. + * \param version DVB-T2 specification version. + * \param preamble P1 symbol preamble format. + * \param inputmode Baseband Header mode. + * \param reservedbiasbits set all L1 bias bits to 1 (on or off). + * \param l1scrambled scramble L1 post signalling (on or off). + * \param inband In-band type B signalling (on or off). */ - class DTV_API dvbt2_framemapper_cc : virtual public gr::block - { - public: - typedef boost::shared_ptr<dvbt2_framemapper_cc> sptr; + static sptr make(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation, + dvbt2_rotation_t rotation, + int fecblocks, + int tiblocks, + dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvb_guardinterval_t guardinterval, + dvbt2_l1constellation_t l1constellation, + dvbt2_pilotpattern_t pilotpattern, + int t2frames, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + dvbt2_preamble_t preamble, + dvbt2_inputmode_t inputmode, + dvbt2_reservedbiasbits_t reservedbiasbits, + dvbt2_l1scrambled_t l1scrambled, + dvbt2_inband_t inband); +}; - /*! - * \brief Create a DVB-T2 frame mapper. - * - * \param framesize FEC frame size (normal or short). - * \param rate FEC code rate. - * \param constellation DVB-T2 constellation. - * \param rotation DVB-T2 constellation rotation (on or off). - * \param fecblocks number of FEC frames in a T2 frame. - * \param tiblocks number of time interleaving blocks in a T2 frame. - * \param carriermode number of carriers (normal or extended). - * \param fftsize OFDM IFFT size. - * \param guardinterval OFDM ISI guard interval. - * \param l1constellation L1 constellation. - * \param pilotpattern DVB-T2 pilot pattern (PP1 - PP8). - * \param t2frames number of T2 frames in a super-frame. - * \param numdatasyms number of OFDM symbols in a T2 frame. - * \param paprmode PAPR reduction mode. - * \param version DVB-T2 specification version. - * \param preamble P1 symbol preamble format. - * \param inputmode Baseband Header mode. - * \param reservedbiasbits set all L1 bias bits to 1 (on or off). - * \param l1scrambled scramble L1 post signalling (on or off). - * \param inband In-band type B signalling (on or off). - */ - static sptr make(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation, dvbt2_rotation_t rotation, int fecblocks, int tiblocks, dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvb_guardinterval_t guardinterval, dvbt2_l1constellation_t l1constellation, dvbt2_pilotpattern_t pilotpattern, int t2frames, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, dvbt2_preamble_t preamble, dvbt2_inputmode_t inputmode, dvbt2_reservedbiasbits_t reservedbiasbits, dvbt2_l1scrambled_t l1scrambled, dvbt2_inband_t inband); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_FRAMEMAPPER_CC_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt2_freqinterleaver_cc.h b/gr-dtv/include/gnuradio/dtv/dvbt2_freqinterleaver_cc.h index 91f47e8e49..096c3ca29e 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt2_freqinterleaver_cc.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt2_freqinterleaver_cc.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,37 +27,43 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Frequency interleaves a T2 frame. + * \ingroup dtv + * + * Input: T2 frame. \n + * Output: Frequency interleaved T2 frame. + */ +class DTV_API dvbt2_freqinterleaver_cc : virtual public gr::sync_block +{ +public: + typedef boost::shared_ptr<dvbt2_freqinterleaver_cc> sptr; /*! - * \brief Frequency interleaves a T2 frame. - * \ingroup dtv + * \brief Create a DVB-T2 frequency interleaver. * - * Input: T2 frame. \n - * Output: Frequency interleaved T2 frame. + * \param carriermode number of carriers (normal or extended). + * \param fftsize OFDM IFFT size. + * \param pilotpattern DVB-T2 pilot pattern (PP1 - PP8). + * \param guardinterval OFDM ISI guard interval. + * \param numdatasyms number of OFDM symbols in a T2 frame. + * \param paprmode PAPR reduction mode. + * \param version DVB-T2 specification version. + * \param preamble P1 symbol preamble format. */ - class DTV_API dvbt2_freqinterleaver_cc : virtual public gr::sync_block - { - public: - typedef boost::shared_ptr<dvbt2_freqinterleaver_cc> sptr; + static sptr make(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + dvbt2_preamble_t preamble); +}; - /*! - * \brief Create a DVB-T2 frequency interleaver. - * - * \param carriermode number of carriers (normal or extended). - * \param fftsize OFDM IFFT size. - * \param pilotpattern DVB-T2 pilot pattern (PP1 - PP8). - * \param guardinterval OFDM ISI guard interval. - * \param numdatasyms number of OFDM symbols in a T2 frame. - * \param paprmode PAPR reduction mode. - * \param version DVB-T2 specification version. - * \param preamble P1 symbol preamble format. - */ - static sptr make(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, dvbt2_preamble_t preamble); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_FREQINTERLEAVER_CC_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt2_interleaver_bb.h b/gr-dtv/include/gnuradio/dtv/dvbt2_interleaver_bb.h index b32aabd522..78911d1c90 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt2_interleaver_bb.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt2_interleaver_bb.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,32 +26,33 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Bit interleaves DVB-T2 FEC baseband frames. + * \ingroup dtv + * + * Input: Normal or short FEC baseband frames with appended LPDC (LDPCFEC). \n + * Output: Bit interleaved (with column twist and bit to cell word de-multiplexed) cells. + */ +class DTV_API dvbt2_interleaver_bb : virtual public gr::block +{ +public: + typedef boost::shared_ptr<dvbt2_interleaver_bb> sptr; /*! - * \brief Bit interleaves DVB-T2 FEC baseband frames. - * \ingroup dtv + * \brief Create a DVB-T2 bit interleaver. * - * Input: Normal or short FEC baseband frames with appended LPDC (LDPCFEC). \n - * Output: Bit interleaved (with column twist and bit to cell word de-multiplexed) cells. + * \param framesize FEC frame size (normal or short). + * \param rate FEC code rate. + * \param constellation DVB-T2 constellation. */ - class DTV_API dvbt2_interleaver_bb : virtual public gr::block - { - public: - typedef boost::shared_ptr<dvbt2_interleaver_bb> sptr; - - /*! - * \brief Create a DVB-T2 bit interleaver. - * - * \param framesize FEC frame size (normal or short). - * \param rate FEC code rate. - * \param constellation DVB-T2 constellation. - */ - static sptr make(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation); - }; + static sptr make(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_INTERLEAVER_BB_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt2_miso_cc.h b/gr-dtv/include/gnuradio/dtv/dvbt2_miso_cc.h index 5edf077248..a84afd8ee0 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt2_miso_cc.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt2_miso_cc.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,36 +27,40 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Splits the stream for MISO (Multiple Input Single Output). + * \ingroup dtv + * + * Input: Frequency interleaved T2 frame. \n + * Output1: Frequency interleaved T2 frame (copy of input). \n + * Output2: Frequency interleaved T2 frame with modified Alamouti processing. + */ +class DTV_API dvbt2_miso_cc : virtual public gr::sync_block +{ +public: + typedef boost::shared_ptr<dvbt2_miso_cc> sptr; /*! - * \brief Splits the stream for MISO (Multiple Input Single Output). - * \ingroup dtv + * \brief Create a MISO processor. * - * Input: Frequency interleaved T2 frame. \n - * Output1: Frequency interleaved T2 frame (copy of input). \n - * Output2: Frequency interleaved T2 frame with modified Alamouti processing. + * \param carriermode number of carriers (normal or extended). + * \param fftsize OFDM IFFT size. + * \param pilotpattern DVB-T2 pilot pattern (PP1 - PP8). + * \param guardinterval OFDM ISI guard interval. + * \param numdatasyms number of OFDM symbols in a T2 frame. + * \param paprmode PAPR reduction mode. */ - class DTV_API dvbt2_miso_cc : virtual public gr::sync_block - { - public: - typedef boost::shared_ptr<dvbt2_miso_cc> sptr; + static sptr make(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode); +}; - /*! - * \brief Create a MISO processor. - * - * \param carriermode number of carriers (normal or extended). - * \param fftsize OFDM IFFT size. - * \param pilotpattern DVB-T2 pilot pattern (PP1 - PP8). - * \param guardinterval OFDM ISI guard interval. - * \param numdatasyms number of OFDM symbols in a T2 frame. - * \param paprmode PAPR reduction mode. - */ - static sptr make(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_MISO_CC_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt2_modulator_bc.h b/gr-dtv/include/gnuradio/dtv/dvbt2_modulator_bc.h index 82b36d90d1..6c04510826 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt2_modulator_bc.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt2_modulator_bc.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,32 +27,33 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Modulates DVB-T2 cells. + * \ingroup dtv + * + * Input: Bit interleaved (with column twist and bit to cell word de-multiplexing) cells. + * \n Output: QPSK, 16QAM, 64QAM or 256QAM modulated complex IQ values (cells). + */ +class DTV_API dvbt2_modulator_bc : virtual public gr::block +{ +public: + typedef boost::shared_ptr<dvbt2_modulator_bc> sptr; /*! - * \brief Modulates DVB-T2 cells. - * \ingroup dtv + * \brief Create a DVB-T2 constellation modulator. * - * Input: Bit interleaved (with column twist and bit to cell word de-multiplexing) cells. \n - * Output: QPSK, 16QAM, 64QAM or 256QAM modulated complex IQ values (cells). + * \param framesize FEC frame size (normal or short). + * \param constellation DVB-T2 constellation. + * \param rotation DVB-T2 constellation rotation (on or off). */ - class DTV_API dvbt2_modulator_bc : virtual public gr::block - { - public: - typedef boost::shared_ptr<dvbt2_modulator_bc> sptr; - - /*! - * \brief Create a DVB-T2 constellation modulator. - * - * \param framesize FEC frame size (normal or short). - * \param constellation DVB-T2 constellation. - * \param rotation DVB-T2 constellation rotation (on or off). - */ - static sptr make(dvb_framesize_t framesize, dvb_constellation_t constellation, dvbt2_rotation_t rotation); - }; + static sptr make(dvb_framesize_t framesize, + dvb_constellation_t constellation, + dvbt2_rotation_t rotation); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_MODULATOR_BC_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt2_p1insertion_cc.h b/gr-dtv/include/gnuradio/dtv/dvbt2_p1insertion_cc.h index f09e75ca40..b45c6dedf2 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt2_p1insertion_cc.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt2_p1insertion_cc.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,36 +27,41 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Inserts a P1 symbol. + * \ingroup dtv + * + * Input: OFDM T2 frame. \n + * Output: OFDM T2 frame with P1 symbol. + */ +class DTV_API dvbt2_p1insertion_cc : virtual public gr::block +{ +public: + typedef boost::shared_ptr<dvbt2_p1insertion_cc> sptr; /*! - * \brief Inserts a P1 symbol. - * \ingroup dtv + * \brief Create a P1 symbol inserter. * - * Input: OFDM T2 frame. \n - * Output: OFDM T2 frame with P1 symbol. + * \param carriermode number of carriers (normal or extended). + * \param fftsize OFDM IFFT size. + * \param guardinterval OFDM ISI guard interval. + * \param numdatasyms number of OFDM symbols in a T2 frame. + * \param preamble P1 symbol preamble format. + * \param showlevels print peak IQ levels. + * \param vclip set peak IQ level threshold. */ - class DTV_API dvbt2_p1insertion_cc : virtual public gr::block - { - public: - typedef boost::shared_ptr<dvbt2_p1insertion_cc> sptr; + static sptr make(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_preamble_t preamble, + dvbt2_showlevels_t showlevels, + float vclip); +}; - /*! - * \brief Create a P1 symbol inserter. - * - * \param carriermode number of carriers (normal or extended). - * \param fftsize OFDM IFFT size. - * \param guardinterval OFDM ISI guard interval. - * \param numdatasyms number of OFDM symbols in a T2 frame. - * \param preamble P1 symbol preamble format. - * \param showlevels print peak IQ levels. - * \param vclip set peak IQ level threshold. - */ - static sptr make(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_preamble_t preamble, dvbt2_showlevels_t showlevels, float vclip); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_P1INSERTION_CC_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt2_paprtr_cc.h b/gr-dtv/include/gnuradio/dtv/dvbt2_paprtr_cc.h index 69278c0909..be9ea4925b 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt2_paprtr_cc.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt2_paprtr_cc.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,39 +27,47 @@ #include <gnuradio/sync_block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Peak to Average Power Ratio (PAPR) reduction. + * \ingroup dtv + * + * Input: A T2 frame of OFDM symbols. \n + * Output: A T2 frame of PAPR reduced OFDM symbols. + */ +class DTV_API dvbt2_paprtr_cc : virtual public gr::sync_block +{ +public: + typedef boost::shared_ptr<dvbt2_paprtr_cc> sptr; /*! - * \brief Peak to Average Power Ratio (PAPR) reduction. - * \ingroup dtv + * \brief Create a PAPR reducer. * - * Input: A T2 frame of OFDM symbols. \n - * Output: A T2 frame of PAPR reduced OFDM symbols. + * \param carriermode number of carriers (normal or extended). + * \param fftsize OFDM IFFT size. + * \param pilotpattern DVB-T2 pilot pattern (PP1 - PP8). + * \param guardinterval OFDM ISI guard interval. + * \param numdatasyms number of OFDM symbols in a T2 frame. + * \param paprmode PAPR reduction mode. + * \param version DVB-T2 specification version. + * \param vclip PAPR clipping level. + * \param iterations PAPR algorithm number of iterations. + * \param vlength input and output vector length. */ - class DTV_API dvbt2_paprtr_cc : virtual public gr::sync_block - { - public: - typedef boost::shared_ptr<dvbt2_paprtr_cc> sptr; + static sptr make(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + float vclip, + int iterations, + unsigned int vlength); +}; - /*! - * \brief Create a PAPR reducer. - * - * \param carriermode number of carriers (normal or extended). - * \param fftsize OFDM IFFT size. - * \param pilotpattern DVB-T2 pilot pattern (PP1 - PP8). - * \param guardinterval OFDM ISI guard interval. - * \param numdatasyms number of OFDM symbols in a T2 frame. - * \param paprmode PAPR reduction mode. - * \param version DVB-T2 specification version. - * \param vclip PAPR clipping level. - * \param iterations PAPR algorithm number of iterations. - * \param vlength input and output vector length. - */ - static sptr make(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, float vclip, int iterations, unsigned int vlength); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_PAPRTR_CC_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt2_pilotgenerator_cc.h b/gr-dtv/include/gnuradio/dtv/dvbt2_pilotgenerator_cc.h index 0e7091556f..6fd40f5579 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt2_pilotgenerator_cc.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt2_pilotgenerator_cc.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,41 +27,51 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Adds pilots to T2 frames. + * \ingroup dtv + * + * Input: Frequency interleaved T2 frame. \n + * Output: T2 frame with pilots (in time domain). + */ +class DTV_API dvbt2_pilotgenerator_cc : virtual public gr::block +{ +public: + typedef boost::shared_ptr<dvbt2_pilotgenerator_cc> sptr; /*! - * \brief Adds pilots to T2 frames. - * \ingroup dtv + * \brief Create a DVB-T2 pilot generator. * - * Input: Frequency interleaved T2 frame. \n - * Output: T2 frame with pilots (in time domain). + * \param carriermode number of carriers (normal or extended). + * \param fftsize OFDM IFFT size. + * \param pilotpattern DVB-T2 pilot pattern (PP1 - PP8). + * \param guardinterval OFDM ISI guard interval. + * \param numdatasyms number of OFDM symbols in a T2 frame. + * \param paprmode PAPR reduction mode. + * \param version DVB-T2 specification version. + * \param preamble P1 symbol preamble format. + * \param misogroup MISO transmitter ID. + * \param equalization sin(x)/x DAC equalization (on or off). + * \param bandwidth sin(x)/x equalization bandwidth. + * \param vlength output vector length. */ - class DTV_API dvbt2_pilotgenerator_cc : virtual public gr::block - { - public: - typedef boost::shared_ptr<dvbt2_pilotgenerator_cc> sptr; + static sptr make(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + dvbt2_preamble_t preamble, + dvbt2_misogroup_t misogroup, + dvbt2_equalization_t equalization, + dvbt2_bandwidth_t bandwidth, + unsigned int vlength); +}; - /*! - * \brief Create a DVB-T2 pilot generator. - * - * \param carriermode number of carriers (normal or extended). - * \param fftsize OFDM IFFT size. - * \param pilotpattern DVB-T2 pilot pattern (PP1 - PP8). - * \param guardinterval OFDM ISI guard interval. - * \param numdatasyms number of OFDM symbols in a T2 frame. - * \param paprmode PAPR reduction mode. - * \param version DVB-T2 specification version. - * \param preamble P1 symbol preamble format. - * \param misogroup MISO transmitter ID. - * \param equalization sin(x)/x DAC equalization (on or off). - * \param bandwidth sin(x)/x equalization bandwidth. - * \param vlength output vector length. - */ - static sptr make(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, dvbt2_preamble_t preamble, dvbt2_misogroup_t misogroup, dvbt2_equalization_t equalization, dvbt2_bandwidth_t bandwidth, unsigned int vlength); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_PILOTGENERATOR_CC_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_bit_inner_deinterleaver.h b/gr-dtv/include/gnuradio/dtv/dvbt_bit_inner_deinterleaver.h index 1f9aab16e5..7b3a517c75 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_bit_inner_deinterleaver.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_bit_inner_deinterleaver.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,41 +27,43 @@ #include <gnuradio/dtv/dvbt_config.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Bit Inner deinterleaver. + * \ingroup dtv + * + * ETSI EN 300 744 Clause 4.3.4.1 \n + * Data Input format: \n + * 000000B0B1 - QPSK. \n + * 0000B0B1B2B3 - 16QAM. \n + * 00B0B1B2B3B4B5 - 64QAM. \n + * Data Output format: \n + * 000000X0X1 - QPSK. \n + * 0000X0X1X2X3 - 16QAM. \n + * 00X0X1X2X3X4X5 - 64QAM. \n + * bit deinterleaver block size is 126. + */ +class DTV_API dvbt_bit_inner_deinterleaver : virtual public block +{ +public: + typedef boost::shared_ptr<dvbt_bit_inner_deinterleaver> sptr; /*! - * \brief Bit Inner deinterleaver. - * \ingroup dtv + * \brief Create a Bit Inner deinterleaver * - * ETSI EN 300 744 Clause 4.3.4.1 \n - * Data Input format: \n - * 000000B0B1 - QPSK. \n - * 0000B0B1B2B3 - 16QAM. \n - * 00B0B1B2B3B4B5 - 64QAM. \n - * Data Output format: \n - * 000000X0X1 - QPSK. \n - * 0000X0X1X2X3 - 16QAM. \n - * 00X0X1X2X3X4X5 - 64QAM. \n - * bit deinterleaver block size is 126. + * \param nsize length of input stream. \n + * \param constellation constellation used. \n + * \param hierarchy hierarchy used. \n + * \param transmission transmission mode used. */ - class DTV_API dvbt_bit_inner_deinterleaver : virtual public block - { - public: - typedef boost::shared_ptr<dvbt_bit_inner_deinterleaver> sptr; + static sptr make(int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission); +}; - /*! - * \brief Create a Bit Inner deinterleaver - * - * \param nsize length of input stream. \n - * \param constellation constellation used. \n - * \param hierarchy hierarchy used. \n - * \param transmission transmission mode used. - */ - static sptr make(int nsize, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_BIT_INNER_DEINTERLEVER_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_bit_inner_interleaver.h b/gr-dtv/include/gnuradio/dtv/dvbt_bit_inner_interleaver.h index d74763e5eb..3f06a9d2a3 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_bit_inner_interleaver.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_bit_inner_interleaver.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,41 +27,43 @@ #include <gnuradio/dtv/dvbt_config.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Bit Inner interleaver. + * \ingroup dtv + * + * ETSI EN 300 744 Clause 4.3.4.1 \n + * Data Input format: \n + * 000000X0X1 - QPSK. \n + * 0000X0X1X2X3 - 16QAM. \n + * 00X0X1X2X3X4X5 - 64QAM. \n + * Data Output format: \n + * 000000B0B1 - QPSK. \n + * 0000B0B1B2B3 - 16QAM. \n + * 00B0B1B2B3B4B5 - 64QAM. \n + * bit interleaver block size is 126. + */ +class DTV_API dvbt_bit_inner_interleaver : virtual public block +{ +public: + typedef boost::shared_ptr<dvbt_bit_inner_interleaver> sptr; /*! - * \brief Bit Inner interleaver. - * \ingroup dtv + * \brief Create a Bit Inner interleaver * - * ETSI EN 300 744 Clause 4.3.4.1 \n - * Data Input format: \n - * 000000X0X1 - QPSK. \n - * 0000X0X1X2X3 - 16QAM. \n - * 00X0X1X2X3X4X5 - 64QAM. \n - * Data Output format: \n - * 000000B0B1 - QPSK. \n - * 0000B0B1B2B3 - 16QAM. \n - * 00B0B1B2B3B4B5 - 64QAM. \n - * bit interleaver block size is 126. + * \param nsize length of input stream. \n + * \param constellation constellation used. \n + * \param hierarchy hierarchy used. \n + * \param transmission transmission mode used. */ - class DTV_API dvbt_bit_inner_interleaver : virtual public block - { - public: - typedef boost::shared_ptr<dvbt_bit_inner_interleaver> sptr; + static sptr make(int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission); +}; - /*! - * \brief Create a Bit Inner interleaver - * - * \param nsize length of input stream. \n - * \param constellation constellation used. \n - * \param hierarchy hierarchy used. \n - * \param transmission transmission mode used. - */ - static sptr make(int nsize, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_BIT_INNER_INTERLEAVER_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_config.h b/gr-dtv/include/gnuradio/dtv/dvbt_config.h index c6bfa1a7e5..0e767a2b85 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_config.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_config.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -22,24 +22,23 @@ #define INCLUDED_DTV_DVBT_CONFIG_H namespace gr { - namespace dtv { - enum dvbt_hierarchy_t { - NH = 0, - ALPHA1, - ALPHA2, - ALPHA4, - }; +namespace dtv { +enum dvbt_hierarchy_t { + NH = 0, + ALPHA1, + ALPHA2, + ALPHA4, +}; - enum dvbt_transmission_mode_t { - T2k = 0, - T8k = 1, - }; +enum dvbt_transmission_mode_t { + T2k = 0, + T8k = 1, +}; - } // namespace dtv +} // namespace dtv } // namespace gr typedef gr::dtv::dvbt_hierarchy_t dvbt_hierarchy_t; typedef gr::dtv::dvbt_transmission_mode_t dvbt_transmission_mode_t; #endif /* INCLUDED_DTV_DVBT_CONFIG_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_convolutional_deinterleaver.h b/gr-dtv/include/gnuradio/dtv/dvbt_convolutional_deinterleaver.h index 1a52c41af8..15d7b7e2b2 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_convolutional_deinterleaver.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_convolutional_deinterleaver.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,34 +25,33 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Convolutional deinterleaver. + * \ingroup dtv + * + * ETSI EN 300 744 Clause 4.3.1 \n + * Forney (Ramsey type III) convolutional deinterleaver. \n + * Data input: Stream of 1 byte elements. \n + * Data output: Blocks of I bytes size. + */ +class DTV_API dvbt_convolutional_deinterleaver : virtual public block +{ +public: + typedef boost::shared_ptr<dvbt_convolutional_deinterleaver> sptr; /*! - * \brief Convolutional deinterleaver. - * \ingroup dtv + * \brief Create a DVB-T convolutional deinterleaver. * - * ETSI EN 300 744 Clause 4.3.1 \n - * Forney (Ramsey type III) convolutional deinterleaver. \n - * Data input: Stream of 1 byte elements. \n - * Data output: Blocks of I bytes size. + * \param nsize number of blocks to process. \n + * \param I size of a block. \n + * \param M depth length for each element in shift registers. */ - class DTV_API dvbt_convolutional_deinterleaver : virtual public block - { - public: - typedef boost::shared_ptr<dvbt_convolutional_deinterleaver> sptr; - - /*! - * \brief Create a DVB-T convolutional deinterleaver. - * - * \param nsize number of blocks to process. \n - * \param I size of a block. \n - * \param M depth length for each element in shift registers. - */ - static sptr make(int nsize, int I, int M); - }; + static sptr make(int nsize, int I, int M); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_CONVOLUTIONAL_DEINTERLEAVER_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_convolutional_interleaver.h b/gr-dtv/include/gnuradio/dtv/dvbt_convolutional_interleaver.h index a4c9577b54..bd343fe4d8 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_convolutional_interleaver.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_convolutional_interleaver.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,34 +25,33 @@ #include <gnuradio/sync_interpolator.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Convolutional interleaver. + * \ingroup dtv + * + * ETSI EN 300 744 Clause 4.3.1 \n + * Forney (Ramsey type III) convolutional interleaver. \n + * Input: Blocks of I bytes size. \n + * Output: Stream of 1 byte elements. + */ +class DTV_API dvbt_convolutional_interleaver : virtual public sync_interpolator +{ +public: + typedef boost::shared_ptr<dvbt_convolutional_interleaver> sptr; /*! - * \brief Convolutional interleaver. - * \ingroup dtv + * \brief Create a DVB-T convolutional interleaver. * - * ETSI EN 300 744 Clause 4.3.1 \n - * Forney (Ramsey type III) convolutional interleaver. \n - * Input: Blocks of I bytes size. \n - * Output: Stream of 1 byte elements. + * \param nsize number of blocks to process. \n + * \param I size of a block. \n + * \param M depth length for each element in shift registers. */ - class DTV_API dvbt_convolutional_interleaver : virtual public sync_interpolator - { - public: - typedef boost::shared_ptr<dvbt_convolutional_interleaver> sptr; - - /*! - * \brief Create a DVB-T convolutional interleaver. - * - * \param nsize number of blocks to process. \n - * \param I size of a block. \n - * \param M depth length for each element in shift registers. - */ - static sptr make(int nsize, int I, int M); - }; + static sptr make(int nsize, int I, int M); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_CONVOLUTIONAL_INTERLEAVER_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_demap.h b/gr-dtv/include/gnuradio/dtv/dvbt_demap.h index 1f04beea0a..e6763bee97 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_demap.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_demap.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,39 +27,42 @@ #include <gnuradio/dtv/dvbt_config.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief DVB-T demapper. + * \ingroup dtv + * + * ETSI EN 300 744 Clause 4.3.5. \n + * Data input format: \n + * complex(real(float), imag(float)). \n + * Data output format: \n + * 000000Y0Y1 - QPSK. \n + * 0000Y0Y1Y2Y3 - 16QAM. \n + * 00Y0Y1Y2Y3Y4Y5 - 64QAM. + */ +class DTV_API dvbt_demap : virtual public block +{ +public: + typedef boost::shared_ptr<dvbt_demap> sptr; /*! - * \brief DVB-T demapper. - * \ingroup dtv + * \brief Create a DVB-T demapper. * - * ETSI EN 300 744 Clause 4.3.5. \n - * Data input format: \n - * complex(real(float), imag(float)). \n - * Data output format: \n - * 000000Y0Y1 - QPSK. \n - * 0000Y0Y1Y2Y3 - 16QAM. \n - * 00Y0Y1Y2Y3Y4Y5 - 64QAM. + * \param nsize length of input stream. \n + * \param constellation constellation used. \n + * \param hierarchy hierarchy used. \n + * \param transmission transmission mode used. \n + * \param gain gain of complex input stream. */ - class DTV_API dvbt_demap : virtual public block - { - public: - typedef boost::shared_ptr<dvbt_demap> sptr; + static sptr make(int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission, + float gain); +}; - /*! - * \brief Create a DVB-T demapper. - * - * \param nsize length of input stream. \n - * \param constellation constellation used. \n - * \param hierarchy hierarchy used. \n - * \param transmission transmission mode used. \n - * \param gain gain of complex input stream. - */ - static sptr make(int nsize, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission, float gain); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_DVBT_DEMAP_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_demod_reference_signals.h b/gr-dtv/include/gnuradio/dtv/dvbt_demod_reference_signals.h index 3f28ddeec7..1ed450f0ac 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_demod_reference_signals.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_demod_reference_signals.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,47 +27,52 @@ #include <gnuradio/dtv/dvbt_config.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Reference signals demodulator. + * \ingroup dtv + * + * ETSI EN 300 744 Clause 4.5 \n + * Data input format: \n + * complex(real(float), imag(float)). \n + * Data output format: \n + * complex(real(float), imag(float)). + */ +class DTV_API dvbt_demod_reference_signals : virtual public block +{ +public: + typedef boost::shared_ptr<dvbt_demod_reference_signals> sptr; /*! - * \brief Reference signals demodulator. - * \ingroup dtv + * \brief Create Reference signals demodulator. * - * ETSI EN 300 744 Clause 4.5 \n - * Data input format: \n - * complex(real(float), imag(float)). \n - * Data output format: \n - * complex(real(float), imag(float)). + * \param itemsize size of an in/out item. \n + * \param ninput input stream length. \n + * \param noutput output stream length. \n + * \param constellation constellation used. \n + * \param hierarchy hierarchy used. \n + * \param code_rate_HP high priority stream code rate. \n + * \param code_rate_LP low priority stream code rate. \n + * \param guard_interval guard interval used. \n + * \param transmission_mode transmission mode used. \n + * \param include_cell_id include or not Cell ID. \n + * \param cell_id value of the Cell ID. */ - class DTV_API dvbt_demod_reference_signals : virtual public block - { - public: - typedef boost::shared_ptr<dvbt_demod_reference_signals> sptr; + static sptr make(int itemsize, + int ninput, + int noutput, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t code_rate_HP, + dvb_code_rate_t code_rate_LP, + dvb_guardinterval_t guard_interval, + dvbt_transmission_mode_t transmission_mode, + int include_cell_id, + int cell_id); +}; - /*! - * \brief Create Reference signals demodulator. - * - * \param itemsize size of an in/out item. \n - * \param ninput input stream length. \n - * \param noutput output stream length. \n - * \param constellation constellation used. \n - * \param hierarchy hierarchy used. \n - * \param code_rate_HP high priority stream code rate. \n - * \param code_rate_LP low priority stream code rate. \n - * \param guard_interval guard interval used. \n - * \param transmission_mode transmission mode used. \n - * \param include_cell_id include or not Cell ID. \n - * \param cell_id value of the Cell ID. - */ - static sptr make(int itemsize, int ninput, int noutput, \ - dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, \ - dvb_code_rate_t code_rate_HP, dvb_code_rate_t code_rate_LP, \ - dvb_guardinterval_t guard_interval, dvbt_transmission_mode_t transmission_mode, \ - int include_cell_id, int cell_id); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_DEMOD_REFERENCE_SIGNALS_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_energy_descramble.h b/gr-dtv/include/gnuradio/dtv/dvbt_energy_descramble.h index 6d50da1535..2f97bbbc06 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_energy_descramble.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_energy_descramble.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,34 +25,33 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Energy descramble + * \ingroup dtv + * + * ETSI EN 300 744 - Clause 4.3.1. \n + * Input - Randomized MPEG-2 transport packets. \n + * Output - MPEG-2 transport packets (including sync - 0x47). \n + * We assume the first byte is a NSYNC. \n + * First sync in a row of 8 packets is reversed - 0xB8. \n + * Block size is 188 bytes + */ +class DTV_API dvbt_energy_descramble : virtual public block +{ +public: + typedef boost::shared_ptr<dvbt_energy_descramble> sptr; /*! - * \brief Energy descramble - * \ingroup dtv + * \brief Create DVB-T Energy descramble. * - * ETSI EN 300 744 - Clause 4.3.1. \n - * Input - Randomized MPEG-2 transport packets. \n - * Output - MPEG-2 transport packets (including sync - 0x47). \n - * We assume the first byte is a NSYNC. \n - * First sync in a row of 8 packets is reversed - 0xB8. \n - * Block size is 188 bytes + * \param nblocks number of blocks. */ - class DTV_API dvbt_energy_descramble : virtual public block - { - public: - typedef boost::shared_ptr<dvbt_energy_descramble> sptr; - - /*! - * \brief Create DVB-T Energy descramble. - * - * \param nblocks number of blocks. - */ - static sptr make(int nblocks); - }; + static sptr make(int nblocks); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_ENERGY_DESCRAMBLE_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_energy_dispersal.h b/gr-dtv/include/gnuradio/dtv/dvbt_energy_dispersal.h index b5258bbe1d..051410fb79 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_energy_dispersal.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_energy_dispersal.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,34 +25,33 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Energy dispersal. + * \ingroup dtv + * + * ETSI EN 300 744 - Clause 4.3.1 \n + * Input - MPEG-2 transport packets (including sync - 0x47). \n + * Output - Randomized MPEG-2 transport packets. \n + * If first byte is not a SYNC then look for it. \n + * First sync in a row of 8 packets is reversed - 0xB8. \n + * Block size is 188 bytes. + */ +class DTV_API dvbt_energy_dispersal : virtual public gr::block +{ +public: + typedef boost::shared_ptr<dvbt_energy_dispersal> sptr; /*! - * \brief Energy dispersal. - * \ingroup dtv + * \brief Create DVB-T energy dispersal. * - * ETSI EN 300 744 - Clause 4.3.1 \n - * Input - MPEG-2 transport packets (including sync - 0x47). \n - * Output - Randomized MPEG-2 transport packets. \n - * If first byte is not a SYNC then look for it. \n - * First sync in a row of 8 packets is reversed - 0xB8. \n - * Block size is 188 bytes. + * \param nsize number of blocks. */ - class DTV_API dvbt_energy_dispersal : virtual public gr::block - { - public: - typedef boost::shared_ptr<dvbt_energy_dispersal> sptr; - - /*! - * \brief Create DVB-T energy dispersal. - * - * \param nsize number of blocks. - */ - static sptr make(int nsize); - }; + static sptr make(int nsize); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_ENERGY_DISPERSAL_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_inner_coder.h b/gr-dtv/include/gnuradio/dtv/dvbt_inner_coder.h index bd693c3fb6..6c03048542 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_inner_coder.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_inner_coder.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,43 +27,46 @@ #include <gnuradio/dtv/dvbt_config.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Inner coder with Puncturing. + * \ingroup dtv + * + * ETSI EN 300 744 Clause 4.3.3 \n + * Mother convolutional code with rate 1/2. \n + * k=1, n=2, K=6. \n + * Generator polynomial G1=171(OCT), G2=133(OCT). \n + * Punctured to obtain rates of 2/3, 3/4, 5/6, 7/8. \n + * Data Input format: Packed bytes (each bit is data). \n + * MSB - first, LSB last. \n + * Data Output format: \n + * 000000X0X1 - QPSK. \n + * 0000X0X1X2X3 - 16QAM. \n + * 00X0X1X2X3X4X5 - 64QAM. + */ +class DTV_API dvbt_inner_coder : virtual public block +{ +public: + typedef boost::shared_ptr<dvbt_inner_coder> sptr; /*! - * \brief Inner coder with Puncturing. - * \ingroup dtv + * \brief Create an Inner coder with Puncturing. * - * ETSI EN 300 744 Clause 4.3.3 \n - * Mother convolutional code with rate 1/2. \n - * k=1, n=2, K=6. \n - * Generator polynomial G1=171(OCT), G2=133(OCT). \n - * Punctured to obtain rates of 2/3, 3/4, 5/6, 7/8. \n - * Data Input format: Packed bytes (each bit is data). \n - * MSB - first, LSB last. \n - * Data Output format: \n - * 000000X0X1 - QPSK. \n - * 0000X0X1X2X3 - 16QAM. \n - * 00X0X1X2X3X4X5 - 64QAM. + * \param ninput length of input. \n + * \param noutput length of output. \n + * \param constellation type of constellation. \n + * \param hierarchy type of hierarchy used. \n + * \param coderate coderate used. */ - class DTV_API dvbt_inner_coder : virtual public block - { - public: - typedef boost::shared_ptr<dvbt_inner_coder> sptr; + static sptr make(int ninput, + int noutput, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t coderate); +}; - /*! - * \brief Create an Inner coder with Puncturing. - * - * \param ninput length of input. \n - * \param noutput length of output. \n - * \param constellation type of constellation. \n - * \param hierarchy type of hierarchy used. \n - * \param coderate coderate used. - */ - static sptr make(int ninput, int noutput, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvb_code_rate_t coderate); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_INNER_CODER_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_map.h b/gr-dtv/include/gnuradio/dtv/dvbt_map.h index 5bd8f433f9..0132517524 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_map.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_map.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,39 +27,42 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief DVB-T mapper. + * \ingroup dtv + * + * ETSI EN 300 744 Clause 4.3.5. \n + * Data input format: \n + * 000000Y0Y1 - QPSK. \n + * 0000Y0Y1Y2Y3 - 16QAM. \n + * 00Y0Y1Y2Y3Y4Y5 - 64QAM. \n + * Data output format: \n + * complex(real(float), imag(float)). + */ +class DTV_API dvbt_map : virtual public block +{ +public: + typedef boost::shared_ptr<dvbt_map> sptr; /*! - * \brief DVB-T mapper. - * \ingroup dtv + * \brief Create a DVB-T mapper. * - * ETSI EN 300 744 Clause 4.3.5. \n - * Data input format: \n - * 000000Y0Y1 - QPSK. \n - * 0000Y0Y1Y2Y3 - 16QAM. \n - * 00Y0Y1Y2Y3Y4Y5 - 64QAM. \n - * Data output format: \n - * complex(real(float), imag(float)). + * \param nsize length of input stream. \n + * \param constellation constellation used. \n + * \param hierarchy hierarchy used. \n + * \param transmission transmission mode used. \n + * \param gain gain of complex output stream. */ - class DTV_API dvbt_map : virtual public block - { - public: - typedef boost::shared_ptr<dvbt_map> sptr; + static sptr make(int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission, + float gain); +}; - /*! - * \brief Create a DVB-T mapper. - * - * \param nsize length of input stream. \n - * \param constellation constellation used. \n - * \param hierarchy hierarchy used. \n - * \param transmission transmission mode used. \n - * \param gain gain of complex output stream. - */ - static sptr make(int nsize, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission, float gain); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_MAP_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_ofdm_sym_acquisition.h b/gr-dtv/include/gnuradio/dtv/dvbt_ofdm_sym_acquisition.h index ced054dc22..55578a3297 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_ofdm_sym_acquisition.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_ofdm_sym_acquisition.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,36 +25,36 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief OFDM symbol acquisition. + * \ingroup dtv + * + * Data input format: \n + * complex(real(float), imag(float)). \n + * Data output format: \n + * complex(real(float), imag(float)). + */ +class DTV_API dvbt_ofdm_sym_acquisition : virtual public block +{ +public: + typedef boost::shared_ptr<dvbt_ofdm_sym_acquisition> sptr; /*! - * \brief OFDM symbol acquisition. - * \ingroup dtv + * \brief Create OFDM symbol acquisition. * - * Data input format: \n - * complex(real(float), imag(float)). \n - * Data output format: \n - * complex(real(float), imag(float)). + * \param blocks Always equal to 1.\n + * \param fft_length FFT size, 2048 or 8192. \n + * \param occupied_tones Active OFDM carriers, 1705 or 6817. \n + * \param cp_length Length of Cyclic Prefix (FFT size / 32, 16, 8 or 4). \n + * \param snr Initial Signal to Noise Ratio. */ - class DTV_API dvbt_ofdm_sym_acquisition : virtual public block - { - public: - typedef boost::shared_ptr<dvbt_ofdm_sym_acquisition> sptr; - - /*! - * \brief Create OFDM symbol acquisition. - * - * \param blocks Always equal to 1.\n - * \param fft_length FFT size, 2048 or 8192. \n - * \param occupied_tones Active OFDM carriers, 1705 or 6817. \n - * \param cp_length Length of Cyclic Prefix (FFT size / 32, 16, 8 or 4). \n - * \param snr Initial Signal to Noise Ratio. - */ - static sptr make(int blocks, int fft_length, int occupied_tones, int cp_length, float snr); - }; + static sptr + make(int blocks, int fft_length, int occupied_tones, int cp_length, float snr); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_OFDM_SYM_ACQUISITION_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_reed_solomon_dec.h b/gr-dtv/include/gnuradio/dtv/dvbt_reed_solomon_dec.h index 5ef8e04443..8341ec00a3 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_reed_solomon_dec.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_reed_solomon_dec.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,37 +25,36 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Reed Solomon decoder. + * \ingroup dtv + * + * ETSI EN 300 744 Clause 4.3.2 \n + * RS(N=204,K=239,T=8). + */ +class DTV_API dvbt_reed_solomon_dec : virtual public block +{ +public: + typedef boost::shared_ptr<dvbt_reed_solomon_dec> sptr; /*! - * \brief Reed Solomon decoder. - * \ingroup dtv + * \brief Create a Reed Solomon decoder. * - * ETSI EN 300 744 Clause 4.3.2 \n - * RS(N=204,K=239,T=8). + * \param p characteristic of GF(p^m). + * \param m we use GF(p^m). + * \param gfpoly Generator Polynomial. + * \param n length of codeword of RS coder. + * \param k length of information sequence of RS decoder. + * \param t number of corrected errors. + * \param s shortened length. + * \param blocks number of blocks to process at once. */ - class DTV_API dvbt_reed_solomon_dec : virtual public block - { - public: - typedef boost::shared_ptr<dvbt_reed_solomon_dec> sptr; - - /*! - * \brief Create a Reed Solomon decoder. - * - * \param p characteristic of GF(p^m). - * \param m we use GF(p^m). - * \param gfpoly Generator Polynomial. - * \param n length of codeword of RS coder. - * \param k length of information sequence of RS decoder. - * \param t number of corrected errors. - * \param s shortened length. - * \param blocks number of blocks to process at once. - */ - static sptr make(int p, int m, int gfpoly, int n, int k, int t, int s, int blocks); - }; + static sptr make(int p, int m, int gfpoly, int n, int k, int t, int s, int blocks); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_REED_SOLOMON_DEC_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_reed_solomon_enc.h b/gr-dtv/include/gnuradio/dtv/dvbt_reed_solomon_enc.h index 08c7c571fd..4bb12b1f57 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_reed_solomon_enc.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_reed_solomon_enc.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,37 +25,36 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Reed Solomon encoder + * \ingroup dtv + * + * ETSI EN 300 744 Clause 4.3.2 \n + * RS(N=204,K=239,T=8). + */ +class DTV_API dvbt_reed_solomon_enc : virtual public block +{ +public: + typedef boost::shared_ptr<dvbt_reed_solomon_enc> sptr; /*! - * \brief Reed Solomon encoder - * \ingroup dtv + * \brief Create a Reed Solomon encoder. * - * ETSI EN 300 744 Clause 4.3.2 \n - * RS(N=204,K=239,T=8). + * \param p characteristic of GF(p^m). + * \param m we use GF(p^m). + * \param gfpoly Generator Polynomial. + * \param n length of codeword of RS coder. + * \param k length of information sequence of RS encoder. + * \param t number of corrected errors. + * \param s shortened length. + * \param blocks number of blocks to process at once. */ - class DTV_API dvbt_reed_solomon_enc : virtual public block - { - public: - typedef boost::shared_ptr<dvbt_reed_solomon_enc> sptr; - - /*! - * \brief Create a Reed Solomon encoder. - * - * \param p characteristic of GF(p^m). - * \param m we use GF(p^m). - * \param gfpoly Generator Polynomial. - * \param n length of codeword of RS coder. - * \param k length of information sequence of RS encoder. - * \param t number of corrected errors. - * \param s shortened length. - * \param blocks number of blocks to process at once. - */ - static sptr make(int p, int m, int gfpoly, int n, int k, int t, int s, int blocks); - }; + static sptr make(int p, int m, int gfpoly, int n, int k, int t, int s, int blocks); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_REED_SOLOMON_ENC_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_reference_signals.h b/gr-dtv/include/gnuradio/dtv/dvbt_reference_signals.h index d41b949528..64bcd8b177 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_reference_signals.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_reference_signals.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,45 +27,52 @@ #include <gnuradio/block.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Reference signals generator. + * \ingroup dtv + * + * ETSI EN 300 744 Clause 4.5 \n + * Data input format: \n + * complex(real(float), imag(float)). \n + * Data output format: \n + * complex(real(float), imag(float)). + */ +class DTV_API dvbt_reference_signals : virtual public block +{ +public: + typedef boost::shared_ptr<dvbt_reference_signals> sptr; /*! - * \brief Reference signals generator. - * \ingroup dtv + * \brief Create Reference signals generator. * - * ETSI EN 300 744 Clause 4.5 \n - * Data input format: \n - * complex(real(float), imag(float)). \n - * Data output format: \n - * complex(real(float), imag(float)). + * \param itemsize size of an in/out item. \n + * \param ninput input stream length. \n + * \param noutput output stream length. \n + * \param constellation constellation used. \n + * \param hierarchy hierarchy used. \n + * \param code_rate_HP high priority stream code rate. \n + * \param code_rate_LP low priority stream code rate. \n + * \param guard_interval guard interval used. \n + * \param transmission_mode transmission mode used. \n + * \param include_cell_id include or not Cell ID. \n + * \param cell_id value of the Cell ID. */ - class DTV_API dvbt_reference_signals : virtual public block - { - public: - typedef boost::shared_ptr<dvbt_reference_signals> sptr; + static sptr make(int itemsize, + int ninput, + int noutput, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t code_rate_HP, + dvb_code_rate_t code_rate_LP, + dvb_guardinterval_t guard_interval, + dvbt_transmission_mode_t transmission_mode, + int include_cell_id, + int cell_id); +}; - /*! - * \brief Create Reference signals generator. - * - * \param itemsize size of an in/out item. \n - * \param ninput input stream length. \n - * \param noutput output stream length. \n - * \param constellation constellation used. \n - * \param hierarchy hierarchy used. \n - * \param code_rate_HP high priority stream code rate. \n - * \param code_rate_LP low priority stream code rate. \n - * \param guard_interval guard interval used. \n - * \param transmission_mode transmission mode used. \n - * \param include_cell_id include or not Cell ID. \n - * \param cell_id value of the Cell ID. - */ - static sptr make(int itemsize, int ninput, int noutput, dvb_constellation_t constellation, \ - dvbt_hierarchy_t hierarchy, dvb_code_rate_t code_rate_HP, dvb_code_rate_t code_rate_LP, \ - dvb_guardinterval_t guard_interval, dvbt_transmission_mode_t transmission_mode, int include_cell_id, int cell_id); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_REFERENCE_SIGNALS_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_symbol_inner_interleaver.h b/gr-dtv/include/gnuradio/dtv/dvbt_symbol_inner_interleaver.h index ae02c9192f..a2fe0f6fa3 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_symbol_inner_interleaver.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_symbol_inner_interleaver.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,41 +26,40 @@ #include <gnuradio/dtv/dvbt_config.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief Symbol interleaver. + * \ingroup dtv + * + * ETSI EN 300 744 Clause 4.3.4.2 \n + * One block is 12 groups x 126 datawords = 1512 datawords. + * + * Data Input format: \n + * 000000I0I1 - QPSK. \n + * 0000I0I1I2I3 - 16QAM. \n + * 00I0I1I2I3I4I5 - 64QAM. \n + * Data Output format: \n + * 000000Y0Y1 - QPSK. \n + * 0000Y0Y1Y2Y3 - 16QAM. \n + * 00Y0Y1Y2Y3Y4Y5 - 64QAM. + */ +class DTV_API dvbt_symbol_inner_interleaver : virtual public block +{ +public: + typedef boost::shared_ptr<dvbt_symbol_inner_interleaver> sptr; /*! - * \brief Symbol interleaver. - * \ingroup dtv - * - * ETSI EN 300 744 Clause 4.3.4.2 \n - * One block is 12 groups x 126 datawords = 1512 datawords. + * \brief Create a Symbol interleaver. * - * Data Input format: \n - * 000000I0I1 - QPSK. \n - * 0000I0I1I2I3 - 16QAM. \n - * 00I0I1I2I3I4I5 - 64QAM. \n - * Data Output format: \n - * 000000Y0Y1 - QPSK. \n - * 0000Y0Y1Y2Y3 - 16QAM. \n - * 00Y0Y1Y2Y3Y4Y5 - 64QAM. + * \param ninput length of input stream. \n + * \param transmission transmission mode used \n + * \param direction interleave or deinterleave. \n */ - class DTV_API dvbt_symbol_inner_interleaver : virtual public block - { - public: - typedef boost::shared_ptr<dvbt_symbol_inner_interleaver> sptr; + static sptr make(int ninput, dvbt_transmission_mode_t transmission, int direction); +}; - /*! - * \brief Create a Symbol interleaver. - * - * \param ninput length of input stream. \n - * \param transmission transmission mode used \n - * \param direction interleave or deinterleave. \n - */ - static sptr make(int ninput, dvbt_transmission_mode_t transmission, int direction); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_SYMBOL_INNER_INTERLEAVER_H */ - diff --git a/gr-dtv/include/gnuradio/dtv/dvbt_viterbi_decoder.h b/gr-dtv/include/gnuradio/dtv/dvbt_viterbi_decoder.h index b44ec4f44a..0a8c419a30 100644 --- a/gr-dtv/include/gnuradio/dtv/dvbt_viterbi_decoder.h +++ b/gr-dtv/include/gnuradio/dtv/dvbt_viterbi_decoder.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,43 +27,44 @@ #include <gnuradio/dtv/dvbt_config.h> namespace gr { - namespace dtv { +namespace dtv { + +/*! + * \brief DVB-T Viterbi decoder. + * \ingroup dtv + * + * ETSI EN 300 744 Clause 4.3.3 \n + * Mother convolutional code with rate 1/2. \n + * k=1, n=2, K=6. \n + * Generator polynomial G1=171(OCT), G2=133(OCT). \n + * Punctured to obtain rates of 2/3, 3/4, 5/6, 7/8. \n + * Data Input format: \n + * 000000X0X1 - QPSK. \n + * 0000X0X1X2X3 - 16QAM. \n + * 00X0X1X2X3X4X5 - 64QAM. \n + * Data Output format: Packed bytes (each bit is data). \n + * MSB - first, LSB last. + */ +class DTV_API dvbt_viterbi_decoder : virtual public block +{ +public: + typedef boost::shared_ptr<dvbt_viterbi_decoder> sptr; /*! - * \brief DVB-T Viterbi decoder. - * \ingroup dtv + * \brief Create a DVB-T Viterbi decoder. * - * ETSI EN 300 744 Clause 4.3.3 \n - * Mother convolutional code with rate 1/2. \n - * k=1, n=2, K=6. \n - * Generator polynomial G1=171(OCT), G2=133(OCT). \n - * Punctured to obtain rates of 2/3, 3/4, 5/6, 7/8. \n - * Data Input format: \n - * 000000X0X1 - QPSK. \n - * 0000X0X1X2X3 - 16QAM. \n - * 00X0X1X2X3X4X5 - 64QAM. \n - * Data Output format: Packed bytes (each bit is data). \n - * MSB - first, LSB last. + * \param constellation constellation used. \n + * \param hierarchy hierarchy used. \n + * \param coderate coderate used. \n + * \param bsize block size. */ - class DTV_API dvbt_viterbi_decoder : virtual public block - { - public: - typedef boost::shared_ptr<dvbt_viterbi_decoder> sptr; + static sptr make(dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t coderate, + int bsize); +}; - /*! - * \brief Create a DVB-T Viterbi decoder. - * - * \param constellation constellation used. \n - * \param hierarchy hierarchy used. \n - * \param coderate coderate used. \n - * \param bsize block size. - */ - static sptr make(dvb_constellation_t constellation, \ - dvbt_hierarchy_t hierarchy, dvb_code_rate_t coderate, int bsize); - }; - - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_VITERBI_DECODER_H */ - diff --git a/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.cc b/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.cc index b0aeee5df5..99e9745cd8 100644 --- a/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.cc +++ b/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.cc @@ -22,43 +22,30 @@ #include <assert.h> namespace gr { - namespace dtv { +namespace dtv { - const unsigned char atsc_basic_trellis_encoder::next_state[32] = { - 0,1,4,5, - 2,3,6,7, - 1,0,5,4, - 3,2,7,6, - 4,5,0,1, - 6,7,2,3, - 5,4,1,0, - 7,6,3,2 - }; +const unsigned char atsc_basic_trellis_encoder::next_state[32] = { + 0, 1, 4, 5, 2, 3, 6, 7, 1, 0, 5, 4, 3, 2, 7, 6, + 4, 5, 0, 1, 6, 7, 2, 3, 5, 4, 1, 0, 7, 6, 3, 2 +}; - const unsigned char atsc_basic_trellis_encoder::out_symbol[32] = { - 0,2,4,6, - 1,3,5,7, - 0,2,4,6, - 1,3,5,7, - 4,6,0,2, - 5,7,1,3, - 4,6,0,2, - 5,7,1,3 - }; +const unsigned char atsc_basic_trellis_encoder::out_symbol[32] = { + 0, 2, 4, 6, 1, 3, 5, 7, 0, 2, 4, 6, 1, 3, 5, 7, + 4, 6, 0, 2, 5, 7, 1, 3, 4, 6, 0, 2, 5, 7, 1, 3 +}; - /*! - * Encode two bit INPUT into 3 bit return value. Domain is [0,3], - * Range is [0,7]. The mapping to bipolar levels is not done. - */ +/*! + * Encode two bit INPUT into 3 bit return value. Domain is [0,3], + * Range is [0,7]. The mapping to bipolar levels is not done. + */ - int - atsc_basic_trellis_encoder::encode(unsigned int input) - { - assert (input < 4); - int index = (state << 2) + input; - state = next_state[index]; - return out_symbol[index]; - } +int atsc_basic_trellis_encoder::encode(unsigned int input) +{ + assert(input < 4); + int index = (state << 2) + input; + state = next_state[index]; + return out_symbol[index]; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.h b/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.h index 3bac601741..49b78ca99d 100644 --- a/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.h +++ b/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.h @@ -34,30 +34,30 @@ */ namespace gr { - namespace dtv { +namespace dtv { - class atsc_basic_trellis_encoder - { - private: - int state; // two bit state; +class atsc_basic_trellis_encoder +{ +private: + int state; // two bit state; - public: - atsc_basic_trellis_encoder() : state(0) {} +public: + atsc_basic_trellis_encoder() : state(0) {} - /*! - * Encode two bit INPUT into 3 bit return value. Domain is [0,3], - * Range is [0,7]. The mapping to bipolar levels is not done. - */ - int encode(unsigned int input); + /*! + * Encode two bit INPUT into 3 bit return value. Domain is [0,3], + * Range is [0,7]. The mapping to bipolar levels is not done. + */ + int encode(unsigned int input); - //! reset encoder state - void reset() {state = 0;} + //! reset encoder state + void reset() { state = 0; } - static const unsigned char next_state[32]; - static const unsigned char out_symbol[32]; - }; + static const unsigned char next_state[32]; + static const unsigned char out_symbol[32]; +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_ATSC_TRELLIS_ENCODER_H */ diff --git a/gr-dtv/lib/atsc/atsc_deinterleaver_impl.cc b/gr-dtv/lib/atsc/atsc_deinterleaver_impl.cc index 7b2001aacb..e4757e97a6 100644 --- a/gr-dtv/lib/atsc/atsc_deinterleaver_impl.cc +++ b/gr-dtv/lib/atsc/atsc_deinterleaver_impl.cc @@ -29,69 +29,67 @@ #include <gnuradio/io_signature.h> namespace gr { - namespace dtv { - - atsc_deinterleaver::sptr - atsc_deinterleaver::make() - { - return gnuradio::get_initial_sptr - (new atsc_deinterleaver_impl()); - } - - atsc_deinterleaver_impl::atsc_deinterleaver_impl() - : gr::sync_block("atsc_deinterleaver", - io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), - io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))), - alignment_fifo (156) - { - m_fifo.resize(52); - - for (int i = 0; i < 52; i++) +namespace dtv { + +atsc_deinterleaver::sptr atsc_deinterleaver::make() +{ + return gnuradio::get_initial_sptr(new atsc_deinterleaver_impl()); +} + +atsc_deinterleaver_impl::atsc_deinterleaver_impl() + : gr::sync_block("atsc_deinterleaver", + io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), + io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))), + alignment_fifo(156) +{ + m_fifo.resize(52); + + for (int i = 0; i < 52; i++) m_fifo[52 - 1 - i] = new interleaver_fifo<unsigned char>(i * 4); - sync(); - } + sync(); +} - atsc_deinterleaver_impl::~atsc_deinterleaver_impl() - { - for (int i = 0; i < 52; i++) +atsc_deinterleaver_impl::~atsc_deinterleaver_impl() +{ + for (int i = 0; i < 52; i++) delete m_fifo[i]; - } +} - void atsc_deinterleaver_impl::reset() - { - sync(); - for (int i = 0; i < 52; i++) +void atsc_deinterleaver_impl::reset() +{ + sync(); + for (int i = 0; i < 52; i++) m_fifo[i]->reset(); - } - - int - atsc_deinterleaver_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet_rs_encoded *in = (const atsc_mpeg_packet_rs_encoded *)input_items[0]; - atsc_mpeg_packet_rs_encoded *out = (atsc_mpeg_packet_rs_encoded *)output_items[0]; - - for (int i = 0; i < noutput_items; i++) { - assert (in[i].pli.regular_seg_p()); +} + +int atsc_deinterleaver_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet_rs_encoded* in = + (const atsc_mpeg_packet_rs_encoded*)input_items[0]; + atsc_mpeg_packet_rs_encoded* out = (atsc_mpeg_packet_rs_encoded*)output_items[0]; + + for (int i = 0; i < noutput_items; i++) { + assert(in[i].pli.regular_seg_p()); plinfo::sanity_check(in[i].pli); // reset commutator if required using INPUT pipeline info if (in[i].pli.first_regular_seg_p()) - sync(); + sync(); // remap OUTPUT pipeline info to reflect 52 data segment end-to-end delay - plinfo::delay (out[i].pli, in[i].pli, 52); + plinfo::delay(out[i].pli, in[i].pli, 52); // now do the actual deinterleaving for (unsigned int j = 0; j < sizeof(in[i].data); j++) { - out[i].data[j] = alignment_fifo.stuff(transform (in[i].data[j])); + out[i].data[j] = alignment_fifo.stuff(transform(in[i].data[j])); } - } - - return noutput_items; } - } /* namespace dtv */ + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_deinterleaver_impl.h b/gr-dtv/lib/atsc/atsc_deinterleaver_impl.h index 75eb7e877d..b9202e4f22 100644 --- a/gr-dtv/lib/atsc/atsc_deinterleaver_impl.h +++ b/gr-dtv/lib/atsc/atsc_deinterleaver_impl.h @@ -28,48 +28,49 @@ #include "interleaver_fifo.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_deinterleaver_impl : public atsc_deinterleaver +class atsc_deinterleaver_impl : public atsc_deinterleaver +{ +private: + //! transform a single symbol + unsigned char transform(unsigned char input) { - private: - //! transform a single symbol - unsigned char transform(unsigned char input) { unsigned char retval = m_fifo[m_commutator]->stuff(input); m_commutator++; if (m_commutator >= 52) - m_commutator = 0; + m_commutator = 0; return retval; - } + } - /*! - * Note: The use of the alignment_fifo keeps the encoder and decoder - * aligned if both are synced to a field boundary. There may be other - * ways to implement this function. This is a best guess as to how - * this should behave, as we have no test vectors for either the - * interleaver or deinterleaver. - */ - interleaver_fifo<unsigned char> alignment_fifo; + /*! + * Note: The use of the alignment_fifo keeps the encoder and decoder + * aligned if both are synced to a field boundary. There may be other + * ways to implement this function. This is a best guess as to how + * this should behave, as we have no test vectors for either the + * interleaver or deinterleaver. + */ + interleaver_fifo<unsigned char> alignment_fifo; - int m_commutator; - std::vector<interleaver_fifo<unsigned char> *> m_fifo; + int m_commutator; + std::vector<interleaver_fifo<unsigned char>*> m_fifo; - public: - atsc_deinterleaver_impl(); - ~atsc_deinterleaver_impl(); +public: + atsc_deinterleaver_impl(); + ~atsc_deinterleaver_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); - //! reset interleaver (flushes contents and resets commutator) - void reset(); + //! reset interleaver (flushes contents and resets commutator) + void reset(); - //! sync interleaver (resets commutator, but doesn't flush fifos) - void sync() { m_commutator = 0; } - }; + //! sync interleaver (resets commutator, but doesn't flush fifos) + void sync() { m_commutator = 0; } +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_DEINTERLEAVER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_depad_impl.cc b/gr-dtv/lib/atsc/atsc_depad_impl.cc index e1172e630c..fbaa3d0701 100644 --- a/gr-dtv/lib/atsc/atsc_depad_impl.cc +++ b/gr-dtv/lib/atsc/atsc_depad_impl.cc @@ -29,38 +29,35 @@ #include <gnuradio/io_signature.h> namespace gr { - namespace dtv { - - atsc_depad::sptr - atsc_depad::make() - { - return gnuradio::get_initial_sptr - (new atsc_depad_impl()); - } - - atsc_depad_impl::atsc_depad_impl() - : gr::sync_interpolator("atsc_depad", - io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), - io_signature::make(1, 1, sizeof(unsigned char)), - ATSC_MPEG_PKT_LENGTH) - { - } - - int - atsc_depad_impl::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet *in = (const atsc_mpeg_packet *)input_items[0]; - unsigned char *out = (unsigned char *)output_items[0]; - - int i; - - for (i = 0; i < noutput_items/ATSC_MPEG_PKT_LENGTH; i++) +namespace dtv { + +atsc_depad::sptr atsc_depad::make() +{ + return gnuradio::get_initial_sptr(new atsc_depad_impl()); +} + +atsc_depad_impl::atsc_depad_impl() + : gr::sync_interpolator("atsc_depad", + io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), + io_signature::make(1, 1, sizeof(unsigned char)), + ATSC_MPEG_PKT_LENGTH) +{ +} + +int atsc_depad_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet* in = (const atsc_mpeg_packet*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; + + int i; + + for (i = 0; i < noutput_items / ATSC_MPEG_PKT_LENGTH; i++) memcpy(&out[i * ATSC_MPEG_PKT_LENGTH], in[i].data, ATSC_MPEG_PKT_LENGTH); - return i * ATSC_MPEG_PKT_LENGTH; - } + return i * ATSC_MPEG_PKT_LENGTH; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_depad_impl.h b/gr-dtv/lib/atsc/atsc_depad_impl.h index d29b1cfe9e..b649f2f9d3 100644 --- a/gr-dtv/lib/atsc/atsc_depad_impl.h +++ b/gr-dtv/lib/atsc/atsc_depad_impl.h @@ -27,19 +27,19 @@ #include "atsc_types.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_depad_impl : public atsc_depad - { - public: - atsc_depad_impl(); +class atsc_depad_impl : public atsc_depad +{ +public: + atsc_depad_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_DEPAD_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_derandomizer_impl.cc b/gr-dtv/lib/atsc/atsc_derandomizer_impl.cc index 364713f7b5..31d16b3c1d 100644 --- a/gr-dtv/lib/atsc/atsc_derandomizer_impl.cc +++ b/gr-dtv/lib/atsc/atsc_derandomizer_impl.cc @@ -29,37 +29,34 @@ #include <gnuradio/io_signature.h> namespace gr { - namespace dtv { +namespace dtv { - atsc_derandomizer::sptr - atsc_derandomizer::make() - { - return gnuradio::get_initial_sptr - (new atsc_derandomizer_impl()); - } +atsc_derandomizer::sptr atsc_derandomizer::make() +{ + return gnuradio::get_initial_sptr(new atsc_derandomizer_impl()); +} - atsc_derandomizer_impl::atsc_derandomizer_impl() - : gr::sync_block("dtv_atsc_derandomizer", - io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync)), - io_signature::make(1, 1, sizeof(atsc_mpeg_packet))) - { - d_rand.reset(); - } +atsc_derandomizer_impl::atsc_derandomizer_impl() + : gr::sync_block("dtv_atsc_derandomizer", + io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync)), + io_signature::make(1, 1, sizeof(atsc_mpeg_packet))) +{ + d_rand.reset(); +} - int - atsc_derandomizer_impl::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet_no_sync *in = (const atsc_mpeg_packet_no_sync *) input_items[0]; - atsc_mpeg_packet *out = (atsc_mpeg_packet *) output_items[0]; +int atsc_derandomizer_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet_no_sync* in = (const atsc_mpeg_packet_no_sync*)input_items[0]; + atsc_mpeg_packet* out = (atsc_mpeg_packet*)output_items[0]; - for (int i = 0; i < noutput_items; i++){ + for (int i = 0; i < noutput_items; i++) { assert(in[i].pli.regular_seg_p()); if (in[i].pli.first_regular_seg_p()) - d_rand.reset(); + d_rand.reset(); d_rand.derandomize(out[i], in[i]); @@ -67,13 +64,13 @@ namespace gr { // corresponding bit in transport packet header. if (in[i].pli.transport_error_p()) - out[i].data[1] |= MPEG_TRANSPORT_ERROR_BIT; + out[i].data[1] |= MPEG_TRANSPORT_ERROR_BIT; else - out[i].data[1] &= ~MPEG_TRANSPORT_ERROR_BIT; - } - - return noutput_items; + out[i].data[1] &= ~MPEG_TRANSPORT_ERROR_BIT; } - } /* namespace dtv */ + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_derandomizer_impl.h b/gr-dtv/lib/atsc/atsc_derandomizer_impl.h index a307a51d86..f93f0895f3 100644 --- a/gr-dtv/lib/atsc/atsc_derandomizer_impl.h +++ b/gr-dtv/lib/atsc/atsc_derandomizer_impl.h @@ -27,22 +27,22 @@ #include "atsc_randomize.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_derandomizer_impl : public atsc_derandomizer - { - private: - atsc_randomize d_rand; +class atsc_derandomizer_impl : public atsc_derandomizer +{ +private: + atsc_randomize d_rand; - public: - atsc_derandomizer_impl(); +public: + atsc_derandomizer_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_DERANDOMIZER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_equalizer_impl.cc b/gr-dtv/lib/atsc/atsc_equalizer_impl.cc index 0e0b6ab88d..6dba4f180f 100644 --- a/gr-dtv/lib/atsc/atsc_equalizer_impl.cc +++ b/gr-dtv/lib/atsc/atsc_equalizer_impl.cc @@ -31,202 +31,185 @@ #include <volk/volk.h> namespace gr { - namespace dtv { +namespace dtv { - atsc_equalizer::sptr - atsc_equalizer::make() - { - return gnuradio::get_initial_sptr - (new atsc_equalizer_impl()); - } +atsc_equalizer::sptr atsc_equalizer::make() +{ + return gnuradio::get_initial_sptr(new atsc_equalizer_impl()); +} - static float - bin_map (int bit) - { - return bit ? +5 : -5; - } +static float bin_map(int bit) { return bit ? +5 : -5; } - static void - init_field_sync_common (float *p, int mask) - { - int i = 0; +static void init_field_sync_common(float* p, int mask) +{ + int i = 0; - p[i++] = bin_map (1); // data segment sync pulse - p[i++] = bin_map (0); - p[i++] = bin_map (0); - p[i++] = bin_map (1); + p[i++] = bin_map(1); // data segment sync pulse + p[i++] = bin_map(0); + p[i++] = bin_map(0); + p[i++] = bin_map(1); - for (int j = 0; j < 511; j++) // PN511 - p[i++] = bin_map (atsc_pn511[j]); + for (int j = 0; j < 511; j++) // PN511 + p[i++] = bin_map(atsc_pn511[j]); - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map (atsc_pn63[j]); + for (int j = 0; j < 63; j++) // PN63 + p[i++] = bin_map(atsc_pn63[j]); - for (int j = 0; j < 63; j++) // PN63, toggled on field 2 - p[i++] = bin_map (atsc_pn63[j] ^ mask); + for (int j = 0; j < 63; j++) // PN63, toggled on field 2 + p[i++] = bin_map(atsc_pn63[j] ^ mask); - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map (atsc_pn63[j]); - } + for (int j = 0; j < 63; j++) // PN63 + p[i++] = bin_map(atsc_pn63[j]); +} - atsc_equalizer_impl::atsc_equalizer_impl() - : gr::block("dtv_atsc_equalizer", - io_signature::make(1, 1, sizeof(atsc_soft_data_segment)), - io_signature::make(1, 1, sizeof(atsc_soft_data_segment))) - { - init_field_sync_common(training_sequence1, 0); - init_field_sync_common(training_sequence2, 1); +atsc_equalizer_impl::atsc_equalizer_impl() + : gr::block("dtv_atsc_equalizer", + io_signature::make(1, 1, sizeof(atsc_soft_data_segment)), + io_signature::make(1, 1, sizeof(atsc_soft_data_segment))) +{ + init_field_sync_common(training_sequence1, 0); + init_field_sync_common(training_sequence2, 1); - d_taps.resize(NTAPS, 0.0f); + d_taps.resize(NTAPS, 0.0f); - d_buff_not_filled = true; + d_buff_not_filled = true; - const int alignment_multiple = - volk_get_alignment() / sizeof(float); - set_alignment(std::max(1, alignment_multiple)); - } + const int alignment_multiple = volk_get_alignment() / sizeof(float); + set_alignment(std::max(1, alignment_multiple)); +} - atsc_equalizer_impl::~atsc_equalizer_impl() - { - } +atsc_equalizer_impl::~atsc_equalizer_impl() {} - std::vector<float> - atsc_equalizer_impl::taps() const - { - return d_taps; - } +std::vector<float> atsc_equalizer_impl::taps() const { return d_taps; } - std::vector<float> - atsc_equalizer_impl::data() const - { - std::vector<float> ret(&data_mem2[0], &data_mem2[ATSC_DATA_SEGMENT_LENGTH-1]); - return ret; - } +std::vector<float> atsc_equalizer_impl::data() const +{ + std::vector<float> ret(&data_mem2[0], &data_mem2[ATSC_DATA_SEGMENT_LENGTH - 1]); + return ret; +} - void - atsc_equalizer_impl::filterN(const float *input_samples, - float *output_samples, - int nsamples) - { - for (int j = 0; j < nsamples; j++) { +void atsc_equalizer_impl::filterN(const float* input_samples, + float* output_samples, + int nsamples) +{ + for (int j = 0; j < nsamples; j++) { output_samples[j] = 0; - volk_32f_x2_dot_prod_32f(&output_samples[j], - &input_samples[j], - &d_taps[0], NTAPS); - } + volk_32f_x2_dot_prod_32f( + &output_samples[j], &input_samples[j], &d_taps[0], NTAPS); } +} - void - atsc_equalizer_impl::adaptN(const float *input_samples, - const float *training_pattern, - float *output_samples, - int nsamples) - { - static const double BETA = 0.00005; // FIXME figure out what this ought to be - // FIXME add gear-shifting +void atsc_equalizer_impl::adaptN(const float* input_samples, + const float* training_pattern, + float* output_samples, + int nsamples) +{ + static const double BETA = 0.00005; // FIXME figure out what this ought to be + // FIXME add gear-shifting - for(int j = 0; j < nsamples; j++) { + for (int j = 0; j < nsamples; j++) { output_samples[j] = 0; - volk_32f_x2_dot_prod_32f(&output_samples[j], - &input_samples[j], - &d_taps[0], NTAPS); + volk_32f_x2_dot_prod_32f( + &output_samples[j], &input_samples[j], &d_taps[0], NTAPS); float e = output_samples[j] - training_pattern[j]; // update taps... float tmp_taps[NTAPS]; - volk_32f_s32f_multiply_32f(tmp_taps, &input_samples[j], BETA*e, NTAPS); + volk_32f_s32f_multiply_32f(tmp_taps, &input_samples[j], BETA * e, NTAPS); volk_32f_x2_subtract_32f(&d_taps[0], &d_taps[0], tmp_taps, NTAPS); - } } - - int - atsc_equalizer_impl::general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_soft_data_segment *in = (const atsc_soft_data_segment *) input_items[0]; - atsc_soft_data_segment *out = (atsc_soft_data_segment *) output_items[0]; - - int output_produced = 0; - int i = 0; - - if(d_buff_not_filled) { - memset(&data_mem[0], 0, - NPRETAPS*sizeof(float)); - memcpy(&data_mem[NPRETAPS], in[i].data, - ATSC_DATA_SEGMENT_LENGTH*sizeof(float)); +} + +int atsc_equalizer_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_soft_data_segment* in = (const atsc_soft_data_segment*)input_items[0]; + atsc_soft_data_segment* out = (atsc_soft_data_segment*)output_items[0]; + + int output_produced = 0; + int i = 0; + + if (d_buff_not_filled) { + memset(&data_mem[0], 0, NPRETAPS * sizeof(float)); + memcpy(&data_mem[NPRETAPS], in[i].data, ATSC_DATA_SEGMENT_LENGTH * sizeof(float)); d_flags = in[i].pli._flags; d_segno = in[i].pli._segno; d_buff_not_filled = false; i++; - } - - for (; i < noutput_items; i++) { - - memcpy(&data_mem[ATSC_DATA_SEGMENT_LENGTH + NPRETAPS], in[i].data, - (NTAPS - NPRETAPS)*sizeof(float)); - - if(d_segno == -1) { - if(d_flags & 0x0010) { - adaptN(data_mem, training_sequence2, data_mem2, KNOWN_FIELD_SYNC_LENGTH); - //filterN(&data_mem[KNOWN_FIELD_SYNC_LENGTH], data_mem2, ATSC_DATA_SEGMENT_LENGTH - KNOWN_FIELD_SYNC_LENGTH); - } - else if( !(d_flags & 0x0010) ) { - adaptN( data_mem, training_sequence1, data_mem2, KNOWN_FIELD_SYNC_LENGTH ); - //filterN(&data_mem[KNOWN_FIELD_SYNC_LENGTH], data_mem2, ATSC_DATA_SEGMENT_LENGTH - KNOWN_FIELD_SYNC_LENGTH); - } - } - else { - filterN(data_mem, data_mem2, ATSC_DATA_SEGMENT_LENGTH); - - memcpy(out[output_produced].data, data_mem2, - ATSC_DATA_SEGMENT_LENGTH*sizeof(float)); + } - out[output_produced].pli._flags = d_flags; - out[output_produced].pli._segno = d_segno; - output_produced++; + for (; i < noutput_items; i++) { + + memcpy(&data_mem[ATSC_DATA_SEGMENT_LENGTH + NPRETAPS], + in[i].data, + (NTAPS - NPRETAPS) * sizeof(float)); + + if (d_segno == -1) { + if (d_flags & 0x0010) { + adaptN(data_mem, training_sequence2, data_mem2, KNOWN_FIELD_SYNC_LENGTH); + // filterN(&data_mem[KNOWN_FIELD_SYNC_LENGTH], data_mem2, + // ATSC_DATA_SEGMENT_LENGTH - KNOWN_FIELD_SYNC_LENGTH); + } else if (!(d_flags & 0x0010)) { + adaptN(data_mem, training_sequence1, data_mem2, KNOWN_FIELD_SYNC_LENGTH); + // filterN(&data_mem[KNOWN_FIELD_SYNC_LENGTH], data_mem2, + // ATSC_DATA_SEGMENT_LENGTH - KNOWN_FIELD_SYNC_LENGTH); + } + } else { + filterN(data_mem, data_mem2, ATSC_DATA_SEGMENT_LENGTH); + + memcpy(out[output_produced].data, + data_mem2, + ATSC_DATA_SEGMENT_LENGTH * sizeof(float)); + + out[output_produced].pli._flags = d_flags; + out[output_produced].pli._segno = d_segno; + output_produced++; } - memcpy(data_mem, &data_mem[ATSC_DATA_SEGMENT_LENGTH], - NPRETAPS*sizeof(float)); - memcpy(&data_mem[NPRETAPS], in[i].data, - ATSC_DATA_SEGMENT_LENGTH*sizeof(float)); + memcpy(data_mem, &data_mem[ATSC_DATA_SEGMENT_LENGTH], NPRETAPS * sizeof(float)); + memcpy(&data_mem[NPRETAPS], in[i].data, ATSC_DATA_SEGMENT_LENGTH * sizeof(float)); d_flags = in[i].pli._flags; d_segno = in[i].pli._segno; - } - - consume_each(noutput_items); - return output_produced; } - void - atsc_equalizer_impl::setup_rpc() - { + consume_each(noutput_items); + return output_produced; +} + +void atsc_equalizer_impl::setup_rpc() +{ #ifdef GR_CTRLPORT - add_rpc_variable( - rpcbasic_sptr(new rpcbasic_register_get<atsc_equalizer, std::vector<float> >( - alias(), "taps", - &atsc_equalizer::taps, - pmt::make_f32vector(1,-10), - pmt::make_f32vector(1,10), - pmt::make_f32vector(1,0), - "", "Equalizer Taps", RPC_PRIVLVL_MIN, - DISPTIME))); - - add_rpc_variable( - rpcbasic_sptr(new rpcbasic_register_get<atsc_equalizer, std::vector<float> >( - alias(), "data", - &atsc_equalizer::data, - pmt::make_f32vector(1,-10), - pmt::make_f32vector(1,10), - pmt::make_f32vector(1,0), - "", "Post-equalizer Data", RPC_PRIVLVL_MIN, - DISPTIME))); + add_rpc_variable( + rpcbasic_sptr(new rpcbasic_register_get<atsc_equalizer, std::vector<float>>( + alias(), + "taps", + &atsc_equalizer::taps, + pmt::make_f32vector(1, -10), + pmt::make_f32vector(1, 10), + pmt::make_f32vector(1, 0), + "", + "Equalizer Taps", + RPC_PRIVLVL_MIN, + DISPTIME))); + + add_rpc_variable( + rpcbasic_sptr(new rpcbasic_register_get<atsc_equalizer, std::vector<float>>( + alias(), + "data", + &atsc_equalizer::data, + pmt::make_f32vector(1, -10), + pmt::make_f32vector(1, 10), + pmt::make_f32vector(1, 0), + "", + "Post-equalizer Data", + RPC_PRIVLVL_MIN, + DISPTIME))); #endif /* GR_CTRLPORT */ - } +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_equalizer_impl.h b/gr-dtv/lib/atsc/atsc_equalizer_impl.h index 75862f6408..86e1171a09 100644 --- a/gr-dtv/lib/atsc/atsc_equalizer_impl.h +++ b/gr-dtv/lib/atsc/atsc_equalizer_impl.h @@ -28,49 +28,51 @@ #include "atsc_syminfo_impl.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_equalizer_impl : public atsc_equalizer - { - private: - static const int NTAPS = 64; - static const int NPRETAPS = (int) (NTAPS * 0.8); // probably should be either .2 or .8 +class atsc_equalizer_impl : public atsc_equalizer +{ +private: + static const int NTAPS = 64; + static const int NPRETAPS = (int)(NTAPS * 0.8); // probably should be either .2 or .8 - // the length of the field sync pattern that we know unequivocally - static const int KNOWN_FIELD_SYNC_LENGTH = 4 + 511 + 3 * 63; + // the length of the field sync pattern that we know unequivocally + static const int KNOWN_FIELD_SYNC_LENGTH = 4 + 511 + 3 * 63; - float training_sequence1[KNOWN_FIELD_SYNC_LENGTH]; - float training_sequence2[KNOWN_FIELD_SYNC_LENGTH]; + float training_sequence1[KNOWN_FIELD_SYNC_LENGTH]; + float training_sequence2[KNOWN_FIELD_SYNC_LENGTH]; - void filterN(const float *input_samples, float *output_samples, int nsamples); - void adaptN(const float *input_samples, const float *training_pattern, - float *output_samples, int nsamples); + void filterN(const float* input_samples, float* output_samples, int nsamples); + void adaptN(const float* input_samples, + const float* training_pattern, + float* output_samples, + int nsamples); - std::vector<float> d_taps; + std::vector<float> d_taps; - float data_mem[ATSC_DATA_SEGMENT_LENGTH + NTAPS]; // Buffer for previous data packet - float data_mem2[ATSC_DATA_SEGMENT_LENGTH]; - unsigned short d_flags; - short d_segno; + float data_mem[ATSC_DATA_SEGMENT_LENGTH + NTAPS]; // Buffer for previous data packet + float data_mem2[ATSC_DATA_SEGMENT_LENGTH]; + unsigned short d_flags; + short d_segno; - int d_buff_not_filled; + int d_buff_not_filled; - public: - atsc_equalizer_impl(); - ~atsc_equalizer_impl(); +public: + atsc_equalizer_impl(); + ~atsc_equalizer_impl(); - void setup_rpc(); + void setup_rpc(); - std::vector<float> taps() const; - std::vector<float> data() const; + std::vector<float> taps() const; + std::vector<float> data() const; - virtual int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + virtual int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_EQUALIZER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_fake_single_viterbi.cc b/gr-dtv/lib/atsc/atsc_fake_single_viterbi.cc index ffe410292e..88ac0a3558 100644 --- a/gr-dtv/lib/atsc/atsc_fake_single_viterbi.cc +++ b/gr-dtv/lib/atsc/atsc_fake_single_viterbi.cc @@ -23,50 +23,39 @@ #include "atsc_fake_single_viterbi.h" namespace gr { - namespace dtv { +namespace dtv { - void - atsc_fake_single_viterbi::reset() - { - post_coder_state = 0; - } +void atsc_fake_single_viterbi::reset() { post_coder_state = 0; } - atsc_fake_single_viterbi::atsc_fake_single_viterbi() - { - reset(); - } +atsc_fake_single_viterbi::atsc_fake_single_viterbi() { reset(); } - /* - * implement simple slicer and post coder - */ - char - atsc_fake_single_viterbi::decode(float input) - { - int y2, y1; +/* + * implement simple slicer and post coder + */ +char atsc_fake_single_viterbi::decode(float input) +{ + int y2, y1; - if (input < -4){ + if (input < -4) { y2 = 0; y1 = 0; - } - else if (input < 0){ + } else if (input < 0) { y2 = 0; y1 = 1; - } - else if (input < 4){ + } else if (input < 4) { y2 = 1; y1 = 0; - } - else { + } else { y2 = 1; y1 = 1; - } + } - int x1 = y1; - int x2 = y2 ^ post_coder_state; - post_coder_state = y2; + int x1 = y1; + int x2 = y2 ^ post_coder_state; + post_coder_state = y2; - return (x2 << 1) | x1; - } + return (x2 << 1) | x1; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_fake_single_viterbi.h b/gr-dtv/lib/atsc/atsc_fake_single_viterbi.h index 9ca546a6ab..3c770d70ba 100644 --- a/gr-dtv/lib/atsc/atsc_fake_single_viterbi.h +++ b/gr-dtv/lib/atsc/atsc_fake_single_viterbi.h @@ -24,29 +24,29 @@ #define INCLUDED_ATSC_FAKE_SINGLE_VITERBI_H namespace gr { - namespace dtv { +namespace dtv { - class atsc_fake_single_viterbi - { - public: - atsc_fake_single_viterbi(); +class atsc_fake_single_viterbi +{ +public: + atsc_fake_single_viterbi(); - /*! - * \p INPUT ideally takes on the values +/- 1,3,5,7 - * return is decoded dibit in the range [0, 3] - */ - char decode (float input); + /*! + * \p INPUT ideally takes on the values +/- 1,3,5,7 + * return is decoded dibit in the range [0, 3] + */ + char decode(float input); - void reset(); + void reset(); - //! internal delay of decoder - int delay() { return 0; } + //! internal delay of decoder + int delay() { return 0; } - protected: - int post_coder_state; - }; +protected: + int post_coder_state; +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_ATSC_FAKE_SINGLE_VITERBI_H */ diff --git a/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.cc b/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.cc index ed9c44a85c..4d058718f6 100644 --- a/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.cc +++ b/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.cc @@ -27,198 +27,186 @@ #include "gnuradio/dtv/atsc_consts.h" namespace gr { - namespace dtv { - - static const int N_SAVED_SYMBOLS = 12; - - atsc_field_sync_mux::sptr - atsc_field_sync_mux::make() - { - return gnuradio::get_initial_sptr - (new atsc_field_sync_mux_impl()); - } - - atsc_field_sync_mux_impl::atsc_field_sync_mux_impl() - : gr::block("atsc_field_sync_mux", - gr::io_signature::make(1, 1, sizeof(atsc_data_segment)), - gr::io_signature::make(1, 1, sizeof(atsc_data_segment))) - { - d_already_output_field_sync = false; - for (int i = 0; i < N_SAVED_SYMBOLS; i++) { - d_saved_symbols[i] = 0; - } +namespace dtv { + +static const int N_SAVED_SYMBOLS = 12; + +atsc_field_sync_mux::sptr atsc_field_sync_mux::make() +{ + return gnuradio::get_initial_sptr(new atsc_field_sync_mux_impl()); +} + +atsc_field_sync_mux_impl::atsc_field_sync_mux_impl() + : gr::block("atsc_field_sync_mux", + gr::io_signature::make(1, 1, sizeof(atsc_data_segment)), + gr::io_signature::make(1, 1, sizeof(atsc_data_segment))) +{ + d_already_output_field_sync = false; + for (int i = 0; i < N_SAVED_SYMBOLS; i++) { + d_saved_symbols[i] = 0; } +} - atsc_field_sync_mux_impl::~atsc_field_sync_mux_impl() - { - } +atsc_field_sync_mux_impl::~atsc_field_sync_mux_impl() {} - void - atsc_field_sync_mux_impl::init_field_sync_common(unsigned char *p, int mask, - const unsigned char saved_symbols[N_SAVED_SYMBOLS]) - { - static const unsigned char bin_map[2] = {1, 6}; // map binary values to 1 of 8 levels +void atsc_field_sync_mux_impl::init_field_sync_common( + unsigned char* p, int mask, const unsigned char saved_symbols[N_SAVED_SYMBOLS]) +{ + static const unsigned char bin_map[2] = { 1, + 6 }; // map binary values to 1 of 8 levels - int i = 0; + int i = 0; - p[i++] = bin_map[1]; // data segment sync pulse - p[i++] = bin_map[0]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; + p[i++] = bin_map[1]; // data segment sync pulse + p[i++] = bin_map[0]; + p[i++] = bin_map[0]; + p[i++] = bin_map[1]; - for (int j = 0; j < 511; j++) { // PN511 + for (int j = 0; j < 511; j++) { // PN511 p[i++] = bin_map[atsc_pn511[j]]; - } + } - for (int j = 0; j < 63; j++) { // PN63 + for (int j = 0; j < 63; j++) { // PN63 p[i++] = bin_map[atsc_pn63[j]]; - } + } - for (int j = 0; j < 63; j++) { // PN63, toggled on field 2 + for (int j = 0; j < 63; j++) { // PN63, toggled on field 2 p[i++] = bin_map[atsc_pn63[j] ^ mask]; - } - - for (int j = 0; j < 63; j++) { // PN63 - p[i++] = bin_map[atsc_pn63[j]]; - } - - p[i++] = bin_map[0]; // 24 bits of 8VSB mode identifier - p[i++] = bin_map[0]; - p[i++] = bin_map[0]; - p[i++] = bin_map[0]; - - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - - p[i++] = bin_map[1]; - p[i++] = bin_map[1]; - p[i++] = bin_map[1]; - p[i++] = bin_map[1]; - - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - - for (int j = 0; j < 92; j++) { // 92 more bits - p[i++] = bin_map[atsc_pn63[j % 63]]; - } - - // now copy the last 12 symbols of the previous segment - - for (int j = 0; j < N_SAVED_SYMBOLS; j++) { - p[i++] = saved_symbols[j]; - } - - assert(i == ATSC_DATA_SEGMENT_LENGTH); } - inline void - atsc_field_sync_mux_impl::init_field_sync_1(atsc_data_segment *s, - const unsigned char saved_symbols[N_SAVED_SYMBOLS]) - { - init_field_sync_common(&s->data[0], 0, saved_symbols); + for (int j = 0; j < 63; j++) { // PN63 + p[i++] = bin_map[atsc_pn63[j]]; } - inline void - atsc_field_sync_mux_impl::init_field_sync_2(atsc_data_segment *s, - const unsigned char saved_symbols[N_SAVED_SYMBOLS]) - { - init_field_sync_common(&s->data[0], 1, saved_symbols); + p[i++] = bin_map[0]; // 24 bits of 8VSB mode identifier + p[i++] = bin_map[0]; + p[i++] = bin_map[0]; + p[i++] = bin_map[0]; + + p[i++] = bin_map[1]; + p[i++] = bin_map[0]; + p[i++] = bin_map[1]; + p[i++] = bin_map[0]; + + p[i++] = bin_map[0]; + p[i++] = bin_map[1]; + p[i++] = bin_map[0]; + p[i++] = bin_map[1]; + + p[i++] = bin_map[1]; + p[i++] = bin_map[1]; + p[i++] = bin_map[1]; + p[i++] = bin_map[1]; + + p[i++] = bin_map[0]; + p[i++] = bin_map[1]; + p[i++] = bin_map[0]; + p[i++] = bin_map[1]; + + p[i++] = bin_map[1]; + p[i++] = bin_map[0]; + p[i++] = bin_map[1]; + p[i++] = bin_map[0]; + + for (int j = 0; j < 92; j++) { // 92 more bits + p[i++] = bin_map[atsc_pn63[j % 63]]; } - void - atsc_field_sync_mux_impl::save_last_symbols(unsigned char saved_symbols[N_SAVED_SYMBOLS], - const atsc_data_segment &seg) - { - for (int i = 0; i < N_SAVED_SYMBOLS; i++) { - saved_symbols[i] = seg.data[i + ATSC_DATA_SEGMENT_LENGTH - N_SAVED_SYMBOLS]; - } - } + // now copy the last 12 symbols of the previous segment - inline bool - atsc_field_sync_mux_impl::last_regular_seg_p(const plinfo &pli) - { - return pli.regular_seg_p() && (pli.segno() == ATSC_DSEGS_PER_FIELD - 1); + for (int j = 0; j < N_SAVED_SYMBOLS; j++) { + p[i++] = saved_symbols[j]; } - void - atsc_field_sync_mux_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = noutput_items; + assert(i == ATSC_DATA_SEGMENT_LENGTH); +} + +inline void atsc_field_sync_mux_impl::init_field_sync_1( + atsc_data_segment* s, const unsigned char saved_symbols[N_SAVED_SYMBOLS]) +{ + init_field_sync_common(&s->data[0], 0, saved_symbols); +} + +inline void atsc_field_sync_mux_impl::init_field_sync_2( + atsc_data_segment* s, const unsigned char saved_symbols[N_SAVED_SYMBOLS]) +{ + init_field_sync_common(&s->data[0], 1, saved_symbols); +} + +void atsc_field_sync_mux_impl::save_last_symbols( + unsigned char saved_symbols[N_SAVED_SYMBOLS], const atsc_data_segment& seg) +{ + for (int i = 0; i < N_SAVED_SYMBOLS; i++) { + saved_symbols[i] = seg.data[i + ATSC_DATA_SEGMENT_LENGTH - N_SAVED_SYMBOLS]; } - - int - atsc_field_sync_mux_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_data_segment *in = (const atsc_data_segment *) input_items[0]; - atsc_data_segment *out = (atsc_data_segment *) output_items[0]; - int in_length = ninput_items[0]; - int index = 0; - int outdex = 0; - - for (outdex = 0; outdex < noutput_items && index < in_length; outdex++) { +} + +inline bool atsc_field_sync_mux_impl::last_regular_seg_p(const plinfo& pli) +{ + return pli.regular_seg_p() && (pli.segno() == ATSC_DSEGS_PER_FIELD - 1); +} + +void atsc_field_sync_mux_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = noutput_items; +} + +int atsc_field_sync_mux_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_data_segment* in = (const atsc_data_segment*)input_items[0]; + atsc_data_segment* out = (atsc_data_segment*)output_items[0]; + int in_length = ninput_items[0]; + int index = 0; + int outdex = 0; + + for (outdex = 0; outdex < noutput_items && index < in_length; outdex++) { assert(in[index].pli.regular_seg_p()); if (!in[index].pli.first_regular_seg_p()) { - out[outdex] = in[index]; // just copy in to out - - if (last_regular_seg_p(in[index].pli)) { - save_last_symbols(d_saved_symbols, in[index]); - } - index++; - } - else { // first_regular_seg_p - if (!d_already_output_field_sync) { - // write out field sync... - atsc_data_segment field_sync; - - field_sync.pli._flags = 0; - field_sync.pli._segno = 0; - memset(field_sync._pad_, 0, atsc_data_segment::NPAD); + out[outdex] = in[index]; // just copy in to out - if (in[index].pli.in_field1_p()) { - init_field_sync_1(&field_sync, d_saved_symbols); + if (last_regular_seg_p(in[index].pli)) { + save_last_symbols(d_saved_symbols, in[index]); } - else { - init_field_sync_2(&field_sync, d_saved_symbols); - } - - // note that index doesn't advance in this branch - out[outdex] = field_sync; - d_already_output_field_sync = true; - } - else { - // already output field sync, now output first regular segment - out[outdex] = in[index]; index++; - d_already_output_field_sync = false; - } + } else { // first_regular_seg_p + if (!d_already_output_field_sync) { + // write out field sync... + atsc_data_segment field_sync; + + field_sync.pli._flags = 0; + field_sync.pli._segno = 0; + memset(field_sync._pad_, 0, atsc_data_segment::NPAD); + + if (in[index].pli.in_field1_p()) { + init_field_sync_1(&field_sync, d_saved_symbols); + } else { + init_field_sync_2(&field_sync, d_saved_symbols); + } + + // note that index doesn't advance in this branch + out[outdex] = field_sync; + d_already_output_field_sync = true; + } else { + // already output field sync, now output first regular segment + out[outdex] = in[index]; + index++; + d_already_output_field_sync = false; + } } - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (index); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(index); - // Tell runtime system how many output items we produced. - return outdex; - } + // Tell runtime system how many output items we produced. + return outdex; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.h b/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.h index ce4ab30323..9e3083e104 100644 --- a/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.h +++ b/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.h @@ -26,34 +26,39 @@ #include "atsc_types.h" namespace gr { - namespace dtv { - - class atsc_field_sync_mux_impl : public atsc_field_sync_mux - { - private: - static const int N_SAVED_SYMBOLS = 12; - bool d_already_output_field_sync; - unsigned char d_saved_symbols[N_SAVED_SYMBOLS]; - - void init_field_sync_common(unsigned char *p, int mask, const unsigned char saved_symbols[N_SAVED_SYMBOLS]); - inline void init_field_sync_1(atsc_data_segment *s, const unsigned char saved_symbols[N_SAVED_SYMBOLS]); - inline void init_field_sync_2(atsc_data_segment *s, const unsigned char saved_symbols[N_SAVED_SYMBOLS]); - void save_last_symbols(unsigned char saved_symbols[N_SAVED_SYMBOLS], const atsc_data_segment &seg); - inline bool last_regular_seg_p(const plinfo &pli); - - public: - atsc_field_sync_mux_impl(); - ~atsc_field_sync_mux_impl(); - - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class atsc_field_sync_mux_impl : public atsc_field_sync_mux +{ +private: + static const int N_SAVED_SYMBOLS = 12; + bool d_already_output_field_sync; + unsigned char d_saved_symbols[N_SAVED_SYMBOLS]; + + void init_field_sync_common(unsigned char* p, + int mask, + const unsigned char saved_symbols[N_SAVED_SYMBOLS]); + inline void init_field_sync_1(atsc_data_segment* s, + const unsigned char saved_symbols[N_SAVED_SYMBOLS]); + inline void init_field_sync_2(atsc_data_segment* s, + const unsigned char saved_symbols[N_SAVED_SYMBOLS]); + void save_last_symbols(unsigned char saved_symbols[N_SAVED_SYMBOLS], + const atsc_data_segment& seg); + inline bool last_regular_seg_p(const plinfo& pli); + +public: + atsc_field_sync_mux_impl(); + ~atsc_field_sync_mux_impl(); + + void forecast(int noutput_items, gr_vector_int& ninput_items_required); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_FIELD_SYNC_MUX_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_fpll_impl.cc b/gr-dtv/lib/atsc/atsc_fpll_impl.cc index a552004972..8522a912ca 100644 --- a/gr-dtv/lib/atsc/atsc_fpll_impl.cc +++ b/gr-dtv/lib/atsc/atsc_fpll_impl.cc @@ -30,45 +30,40 @@ #include <gnuradio/sincos.h> namespace gr { - namespace dtv { +namespace dtv { - atsc_fpll::sptr - atsc_fpll::make(float rate) - { - return gnuradio::get_initial_sptr - (new atsc_fpll_impl(rate)); - } +atsc_fpll::sptr atsc_fpll::make(float rate) +{ + return gnuradio::get_initial_sptr(new atsc_fpll_impl(rate)); +} - atsc_fpll_impl::atsc_fpll_impl(float rate) - : sync_block("dtv_atsc_fpll", - io_signature::make(1, 1, sizeof(gr_complex)), - io_signature::make(1, 1, sizeof(float))) - { - d_afc.set_taps(1.0-exp(-1.0/rate/5e-6)); - d_nco.set_freq((-3e6 + 0.309e6)/rate*2*GR_M_PI); - d_nco.set_phase(0.0); - } +atsc_fpll_impl::atsc_fpll_impl(float rate) + : sync_block("dtv_atsc_fpll", + io_signature::make(1, 1, sizeof(gr_complex)), + io_signature::make(1, 1, sizeof(float))) +{ + d_afc.set_taps(1.0 - exp(-1.0 / rate / 5e-6)); + d_nco.set_freq((-3e6 + 0.309e6) / rate * 2 * GR_M_PI); + d_nco.set_phase(0.0); +} - atsc_fpll_impl::~atsc_fpll_impl() - { - } +atsc_fpll_impl::~atsc_fpll_impl() {} - int - atsc_fpll_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *)input_items[0]; - float *out = (float *)output_items[0]; +int atsc_fpll_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + float* out = (float*)output_items[0]; - for (int k = 0; k < noutput_items; k++) { + for (int k = 0; k < noutput_items; k++) { float a_cos, a_sin; - d_nco.step(); // increment phase - d_nco.sincos(&a_sin, &a_cos); // compute cos and sin + d_nco.step(); // increment phase + d_nco.sincos(&a_sin, &a_cos); // compute cos and sin // Mix out carrier and output I-only signal - gr_complex result = in[k]*gr_complex(a_sin, a_cos); + gr_complex result = in[k] * gr_complex(a_sin, a_cos); out[k] = result.real(); // Update phase/freq error @@ -76,20 +71,20 @@ namespace gr { float x = gr::fast_atan2f(filtered.imag(), filtered.real()); // avoid slamming filter with big transitions - static const float limit = GR_M_PI/2.0; + static const float limit = GR_M_PI / 2.0; if (x > limit) - x = limit; + x = limit; else if (x < -limit) - x = -limit; + x = -limit; static const float alpha = 0.01; - static const float beta = alpha*alpha/4.0; - d_nco.adjust_phase(alpha*x); - d_nco.adjust_freq(beta*x); - } - - return noutput_items; + static const float beta = alpha * alpha / 4.0; + d_nco.adjust_phase(alpha * x); + d_nco.adjust_freq(beta * x); } - } /* namespace dtv */ + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_fpll_impl.h b/gr-dtv/lib/atsc/atsc_fpll_impl.h index e06fc09cc5..1cc5bbd127 100644 --- a/gr-dtv/lib/atsc/atsc_fpll_impl.h +++ b/gr-dtv/lib/atsc/atsc_fpll_impl.h @@ -30,24 +30,24 @@ #include <stdio.h> namespace gr { - namespace dtv { +namespace dtv { - class atsc_fpll_impl : public atsc_fpll - { - private: - gr::nco<float,float> d_nco; - gr::filter::single_pole_iir<gr_complex,gr_complex,float> d_afc; +class atsc_fpll_impl : public atsc_fpll +{ +private: + gr::nco<float, float> d_nco; + gr::filter::single_pole_iir<gr_complex, gr_complex, float> d_afc; - public: - atsc_fpll_impl(float rate); - ~atsc_fpll_impl(); +public: + atsc_fpll_impl(float rate); + ~atsc_fpll_impl(); - virtual int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + virtual int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_FPLL_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_fs_checker_impl.cc b/gr-dtv/lib/atsc/atsc_fs_checker_impl.cc index 3a39bc794b..6297650227 100644 --- a/gr-dtv/lib/atsc/atsc_fs_checker_impl.cc +++ b/gr-dtv/lib/atsc/atsc_fs_checker_impl.cc @@ -31,98 +31,91 @@ #include "gnuradio/dtv/atsc_consts.h" #include <gnuradio/io_signature.h> -static const int PN511_ERROR_LIMIT = 20; // max number of bits wrong +static const int PN511_ERROR_LIMIT = 20; // max number of bits wrong static const int PN63_ERROR_LIMIT = 5; namespace gr { - namespace dtv { - - atsc_fs_checker::sptr - atsc_fs_checker::make() - { - return gnuradio::get_initial_sptr - (new atsc_fs_checker_impl()); - } - - atsc_fs_checker_impl::atsc_fs_checker_impl() - : gr::block("dtv_atsc_fs_checker", - io_signature::make(1, 1, sizeof(atsc_soft_data_segment)), - io_signature::make(1, 1, sizeof(atsc_soft_data_segment))) - { - reset(); - } - - void - atsc_fs_checker_impl::reset() - { - d_index = 0; - memset (d_sample_sr, 0, sizeof (d_sample_sr)); - memset (d_tag_sr, 0, sizeof (d_tag_sr)); - memset (d_bit_sr, 0, sizeof (d_bit_sr)); - d_field_num = 0; - d_segment_num = 0; - } - - atsc_fs_checker_impl::~atsc_fs_checker_impl() - { - } - - int - atsc_fs_checker_impl::general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_soft_data_segment *in = (const atsc_soft_data_segment *) input_items[0]; - atsc_soft_data_segment *out = (atsc_soft_data_segment *) output_items[0]; - - int output_produced = 0; - - for (int i = 0; i < noutput_items; i++) { +namespace dtv { + +atsc_fs_checker::sptr atsc_fs_checker::make() +{ + return gnuradio::get_initial_sptr(new atsc_fs_checker_impl()); +} + +atsc_fs_checker_impl::atsc_fs_checker_impl() + : gr::block("dtv_atsc_fs_checker", + io_signature::make(1, 1, sizeof(atsc_soft_data_segment)), + io_signature::make(1, 1, sizeof(atsc_soft_data_segment))) +{ + reset(); +} + +void atsc_fs_checker_impl::reset() +{ + d_index = 0; + memset(d_sample_sr, 0, sizeof(d_sample_sr)); + memset(d_tag_sr, 0, sizeof(d_tag_sr)); + memset(d_bit_sr, 0, sizeof(d_bit_sr)); + d_field_num = 0; + d_segment_num = 0; +} + +atsc_fs_checker_impl::~atsc_fs_checker_impl() {} + +int atsc_fs_checker_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_soft_data_segment* in = (const atsc_soft_data_segment*)input_items[0]; + atsc_soft_data_segment* out = (atsc_soft_data_segment*)output_items[0]; + + int output_produced = 0; + + for (int i = 0; i < noutput_items; i++) { // check for a hit on the PN 511 pattern int errors = 0; for (int j = 0; j < LENGTH_511 && errors < PN511_ERROR_LIMIT; j++) - errors += (in[i].data[j + OFFSET_511] >= 0) ^ atsc_pn511[j]; + errors += (in[i].data[j + OFFSET_511] >= 0) ^ atsc_pn511[j]; - //std::cout << errors << std::endl; + // std::cout << errors << std::endl; if (errors < PN511_ERROR_LIMIT) { // 511 pattern is good. - // determine if this is field 1 or field 2 - errors = 0; - for (int j = 0; j < LENGTH_2ND_63; j++) - errors += (in[i].data[j + OFFSET_2ND_63] >= 0) ^ atsc_pn63[j]; - - // we should have either field 1 (== PN63) or field 2 (== ~PN63) - if (errors <= PN63_ERROR_LIMIT) { - //std::cout << "Found FIELD_SYNC_1" << std::endl; - d_field_num = 1; // We are in field number 1 now - d_segment_num = -1; // This is the first segment - } - else if (errors >= (LENGTH_2ND_63 - PN63_ERROR_LIMIT)) { - //std::cout << "Found FIELD_SYNC_2" << std::endl; - d_field_num = 2; // We are in field number 2 now - d_segment_num = -1; // This is the first segment - } - else { - // should be extremely rare. - std::cerr << "!!! atsc_fs_checker: PN63 error count = " << errors << std::endl; - } + // determine if this is field 1 or field 2 + errors = 0; + for (int j = 0; j < LENGTH_2ND_63; j++) + errors += (in[i].data[j + OFFSET_2ND_63] >= 0) ^ atsc_pn63[j]; + + // we should have either field 1 (== PN63) or field 2 (== ~PN63) + if (errors <= PN63_ERROR_LIMIT) { + // std::cout << "Found FIELD_SYNC_1" << std::endl; + d_field_num = 1; // We are in field number 1 now + d_segment_num = -1; // This is the first segment + } else if (errors >= (LENGTH_2ND_63 - PN63_ERROR_LIMIT)) { + // std::cout << "Found FIELD_SYNC_2" << std::endl; + d_field_num = 2; // We are in field number 2 now + d_segment_num = -1; // This is the first segment + } else { + // should be extremely rare. + std::cerr << "!!! atsc_fs_checker: PN63 error count = " << errors + << std::endl; + } } - if( d_field_num == 1 || d_field_num == 2 ) { // If we have sync - // So we copy out current packet data to an output packet and fill its plinfo - for( int j = 0; j < ATSC_DATA_SEGMENT_LENGTH; j++ ) - out[output_produced].data[j] = in[i].data[j]; - out[output_produced].pli.set_regular_seg((d_field_num == 2), d_segment_num); - d_segment_num++; - output_produced++; + if (d_field_num == 1 || d_field_num == 2) { // If we have sync + // So we copy out current packet data to an output packet and fill its plinfo + for (int j = 0; j < ATSC_DATA_SEGMENT_LENGTH; j++) + out[output_produced].data[j] = in[i].data[j]; + out[output_produced].pli.set_regular_seg((d_field_num == 2), d_segment_num); + d_segment_num++; + output_produced++; } - } - - consume_each(noutput_items); - return output_produced; } - } /* namespace dtv */ + consume_each(noutput_items); + return output_produced; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_fs_checker_impl.h b/gr-dtv/lib/atsc/atsc_fs_checker_impl.h index 1210ae5830..544f6a4ba6 100644 --- a/gr-dtv/lib/atsc/atsc_fs_checker_impl.h +++ b/gr-dtv/lib/atsc/atsc_fs_checker_impl.h @@ -27,41 +27,41 @@ #include "atsc_syminfo_impl.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_fs_checker_impl : public atsc_fs_checker - { - private: - static const int SRSIZE = 1024; // must be power of two - int d_index; // points at oldest sample - float d_sample_sr[SRSIZE]; // sample shift register - atsc::syminfo d_tag_sr[SRSIZE]; // tag shift register - unsigned char d_bit_sr[SRSIZE]; // binary decision shift register - int d_field_num; - int d_segment_num; +class atsc_fs_checker_impl : public atsc_fs_checker +{ +private: + static const int SRSIZE = 1024; // must be power of two + int d_index; // points at oldest sample + float d_sample_sr[SRSIZE]; // sample shift register + atsc::syminfo d_tag_sr[SRSIZE]; // tag shift register + unsigned char d_bit_sr[SRSIZE]; // binary decision shift register + int d_field_num; + int d_segment_num; - static const int OFFSET_511 = 4; // offset to second PN 63 pattern - static const int LENGTH_511 = 511; // length of PN 63 pattern - static const int OFFSET_2ND_63 = 578; // offset to second PN 63 pattern - static const int LENGTH_2ND_63 = 63; // length of PN 63 pattern + static const int OFFSET_511 = 4; // offset to second PN 63 pattern + static const int LENGTH_511 = 511; // length of PN 63 pattern + static const int OFFSET_2ND_63 = 578; // offset to second PN 63 pattern + static const int LENGTH_2ND_63 = 63; // length of PN 63 pattern - inline static int wrap (int index){ return index & (SRSIZE - 1); } - inline static int incr (int index){ return wrap (index + 1); } - inline static int decr (int index){ return wrap (index - 1); } + inline static int wrap(int index) { return index & (SRSIZE - 1); } + inline static int incr(int index) { return wrap(index + 1); } + inline static int decr(int index) { return wrap(index - 1); } - public: - atsc_fs_checker_impl(); - ~atsc_fs_checker_impl(); +public: + atsc_fs_checker_impl(); + ~atsc_fs_checker_impl(); - void reset(); + void reset(); - virtual int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + virtual int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_FS_CHECKER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_interleaver_fifo.h b/gr-dtv/lib/atsc/atsc_interleaver_fifo.h index 0d40389c74..f9dad30029 100644 --- a/gr-dtv/lib/atsc/atsc_interleaver_fifo.h +++ b/gr-dtv/lib/atsc/atsc_interleaver_fifo.h @@ -26,61 +26,62 @@ #include <string.h> namespace gr { - namespace dtv { +namespace dtv { - template<class symbol_type> - class interleaver_fifo { - public: +template <class symbol_type> +class interleaver_fifo +{ +public: + interleaver_fifo(unsigned int size); + ~interleaver_fifo(); - interleaver_fifo(unsigned int size); - ~interleaver_fifo(); + //! reset interleaver (flushes contents and resets commutator) + void reset(); - //! reset interleaver (flushes contents and resets commutator) - void reset (); - - //! stuff a symbol into the fifo and return the oldest - symbol_type stuff(symbol_type input) { + //! stuff a symbol into the fifo and return the oldest + symbol_type stuff(symbol_type input) + { if (m_size == 0) - return input; + return input; symbol_type retval = m_fifo[m_position]; m_fifo[m_position] = input; m_position++; if (m_position >= m_size) - m_position = 0; + m_position = 0; return retval; - } + } - protected: - unsigned int m_size; - unsigned int m_position; - symbol_type *m_fifo; - }; +protected: + unsigned int m_size; + unsigned int m_position; + symbol_type* m_fifo; +}; - template<class symbol_type> - interleaver_fifo<symbol_type>::interleaver_fifo(unsigned int size) - { - m_size = size; - m_position = 0; - m_fifo = new symbol_type[size]; - memset (m_fifo, 0, m_size * sizeof(symbol_type)); - } +template <class symbol_type> +interleaver_fifo<symbol_type>::interleaver_fifo(unsigned int size) +{ + m_size = size; + m_position = 0; + m_fifo = new symbol_type[size]; + memset(m_fifo, 0, m_size * sizeof(symbol_type)); +} - template<class symbol_type> - interleaver_fifo<symbol_type>::~interleaver_fifo() - { - delete [] m_fifo; - } +template <class symbol_type> +interleaver_fifo<symbol_type>::~interleaver_fifo() +{ + delete[] m_fifo; +} - template<class symbol_type> void - interleaver_fifo<symbol_type>::reset() - { - m_position = 0; - memset (m_fifo, 0, m_size * sizeof (symbol_type)); - } +template <class symbol_type> +void interleaver_fifo<symbol_type>::reset() +{ + m_position = 0; + memset(m_fifo, 0, m_size * sizeof(symbol_type)); +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_INTERLEAVER_FIFO_H */ diff --git a/gr-dtv/lib/atsc/atsc_interleaver_impl.cc b/gr-dtv/lib/atsc/atsc_interleaver_impl.cc index cfc9e2996c..3337cfd0c7 100644 --- a/gr-dtv/lib/atsc/atsc_interleaver_impl.cc +++ b/gr-dtv/lib/atsc/atsc_interleaver_impl.cc @@ -26,84 +26,81 @@ #include "gnuradio/dtv/atsc_consts.h" namespace gr { - namespace dtv { - - atsc_interleaver::sptr - atsc_interleaver::make() - { - return gnuradio::get_initial_sptr - (new atsc_interleaver_impl()); - } - - atsc_interleaver_impl::atsc_interleaver_impl() - : gr::sync_block("atsc_interleaver", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) - { - I = 52; /* ATSC interleaver */ - J = 4; - registers = (unsigned char *) malloc(sizeof(unsigned char) * I * ((I - 1) * J)); - if (registers == NULL) { +namespace dtv { + +atsc_interleaver::sptr atsc_interleaver::make() +{ + return gnuradio::get_initial_sptr(new atsc_interleaver_impl()); +} + +atsc_interleaver_impl::atsc_interleaver_impl() + : gr::sync_block("atsc_interleaver", + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) +{ + I = 52; /* ATSC interleaver */ + J = 4; + registers = (unsigned char*)malloc(sizeof(unsigned char) * I * ((I - 1) * J)); + if (registers == NULL) { GR_LOG_FATAL(d_logger, "ATSC Interleaver, cannot allocate memory for registers."); throw std::bad_alloc(); - } + } - pointers = (int *) malloc(sizeof(int) * I); - if (pointers == NULL) { + pointers = (int*)malloc(sizeof(int) * I); + if (pointers == NULL) { free(registers); GR_LOG_FATAL(d_logger, "ATSC Interleaver, cannot allocate memory for pointers"); throw std::bad_alloc(); - } + } - memset(registers, 0, sizeof(unsigned char) * I * ((I - 1) * J)); - memset(pointers, 0, sizeof(int) * I); + memset(registers, 0, sizeof(unsigned char) * I * ((I - 1) * J)); + memset(pointers, 0, sizeof(int) * I); - commutator = 0; - } + commutator = 0; +} - atsc_interleaver_impl::~atsc_interleaver_impl() - { - free(pointers); - free(registers); - } +atsc_interleaver_impl::~atsc_interleaver_impl() +{ + free(pointers); + free(registers); +} - int - atsc_interleaver_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet_rs_encoded *in = (const atsc_mpeg_packet_rs_encoded *) input_items[0]; - atsc_mpeg_packet_rs_encoded *out = (atsc_mpeg_packet_rs_encoded *) output_items[0]; - int p, n = ATSC_MPEG_RS_ENCODED_LENGTH; +int atsc_interleaver_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet_rs_encoded* in = + (const atsc_mpeg_packet_rs_encoded*)input_items[0]; + atsc_mpeg_packet_rs_encoded* out = (atsc_mpeg_packet_rs_encoded*)output_items[0]; + int p, n = ATSC_MPEG_RS_ENCODED_LENGTH; - for (int i = 0; i < noutput_items; i++) { + for (int i = 0; i < noutput_items; i++) { assert(in[i].pli.regular_seg_p()); plinfo::sanity_check(in[i].pli); - out[i].pli = in[i].pli; // copy pipeline info - if (in[i].pli.first_regular_seg_p()) { // reset commutator if required - commutator = 0; + out[i].pli = in[i].pli; // copy pipeline info + if (in[i].pli.first_regular_seg_p()) { // reset commutator if required + commutator = 0; } for (int j = 0; j < n; j++) { - if (commutator == 0) { - out[i].data[j] = in[i].data[j]; - } - else { - p = pointers[commutator]; + if (commutator == 0) { + out[i].data[j] = in[i].data[j]; + } else { + p = pointers[commutator]; - out[i].data[j] = registers[commutator * (I - 1) * J + p]; - registers[commutator * (I - 1) * J + p] = in[i].data[j]; + out[i].data[j] = registers[commutator * (I - 1) * J + p]; + registers[commutator * (I - 1) * J + p] = in[i].data[j]; - pointers[commutator] = (p + 1) % (commutator * J); - } + pointers[commutator] = (p + 1) % (commutator * J); + } - commutator = (commutator + 1) % I; + commutator = (commutator + 1) % I; } - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ + // Tell runtime system how many output items we produced. + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_interleaver_impl.h b/gr-dtv/lib/atsc/atsc_interleaver_impl.h index ffcd02bf84..884b6a4ccc 100644 --- a/gr-dtv/lib/atsc/atsc_interleaver_impl.h +++ b/gr-dtv/lib/atsc/atsc_interleaver_impl.h @@ -25,26 +25,26 @@ #include "atsc_types.h" namespace gr { - namespace dtv { - - class atsc_interleaver_impl : public atsc_interleaver - { - private: - int I, J; - int commutator; - unsigned char *registers; - int *pointers; - - public: - atsc_interleaver_impl(); - ~atsc_interleaver_impl(); - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class atsc_interleaver_impl : public atsc_interleaver +{ +private: + int I, J; + int commutator; + unsigned char* registers; + int* pointers; + +public: + atsc_interleaver_impl(); + ~atsc_interleaver_impl(); + + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_INTERLEAVER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_pad_impl.cc b/gr-dtv/lib/atsc/atsc_pad_impl.cc index 2dee03f031..5b1a18dcb9 100644 --- a/gr-dtv/lib/atsc/atsc_pad_impl.cc +++ b/gr-dtv/lib/atsc/atsc_pad_impl.cc @@ -26,41 +26,37 @@ #include "gnuradio/dtv/atsc_consts.h" namespace gr { - namespace dtv { - - atsc_pad::sptr - atsc_pad::make() - { - return gnuradio::get_initial_sptr - (new atsc_pad_impl()); - } - - atsc_pad_impl::atsc_pad_impl() - : gr::sync_decimator("atsc_pad", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), ATSC_MPEG_PKT_LENGTH) - { - } - - atsc_pad_impl::~atsc_pad_impl() - { - } - - int - atsc_pad_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - atsc_mpeg_packet *out = (atsc_mpeg_packet *) output_items[0]; - - for (int i = 0; i < noutput_items; i++) { +namespace dtv { + +atsc_pad::sptr atsc_pad::make() +{ + return gnuradio::get_initial_sptr(new atsc_pad_impl()); +} + +atsc_pad_impl::atsc_pad_impl() + : gr::sync_decimator("atsc_pad", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), + ATSC_MPEG_PKT_LENGTH) +{ +} + +atsc_pad_impl::~atsc_pad_impl() {} + +int atsc_pad_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + atsc_mpeg_packet* out = (atsc_mpeg_packet*)output_items[0]; + + for (int i = 0; i < noutput_items; i++) { memcpy(out[i].data, &in[i * ATSC_MPEG_PKT_LENGTH], ATSC_MPEG_PKT_LENGTH); - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ + // Tell runtime system how many output items we produced. + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_pad_impl.h b/gr-dtv/lib/atsc/atsc_pad_impl.h index 292931d1f7..471bf2d8ee 100644 --- a/gr-dtv/lib/atsc/atsc_pad_impl.h +++ b/gr-dtv/lib/atsc/atsc_pad_impl.h @@ -25,20 +25,20 @@ #include "atsc_types.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_pad_impl : public atsc_pad - { - public: - atsc_pad_impl(); - ~atsc_pad_impl(); +class atsc_pad_impl : public atsc_pad +{ +public: + atsc_pad_impl(); + ~atsc_pad_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_PAD_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_pnXXX_impl.h b/gr-dtv/lib/atsc/atsc_pnXXX_impl.h index d4b86dcdbb..da07b779e5 100644 --- a/gr-dtv/lib/atsc/atsc_pnXXX_impl.h +++ b/gr-dtv/lib/atsc/atsc_pnXXX_impl.h @@ -26,34 +26,42 @@ #include <gnuradio/dtv/api.h> const unsigned char atsc_pn511[511] = { - 0,0,0,0, 0,0,0,1, 0,1,1,1, 1,1,1,1, 1,1,0,0, 1,0,1,0, 1,0,1,0, 1,1,1,0, - 0,1,1,0, 0,1,1,0, 1,0,0,0, 1,0,0,0, 1,0,0,1, 1,1,1,0, 0,0,0,1, 1,1,0,1, + 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, - 0,1,1,1, 1,1,0,1, 0,0,1,1, 0,1,0,1, 0,0,1,1, 1,0,1,1, 0,0,1,1, 1,0,1,0, - 0,1,0,0, 0,1,0,1, 1,0,0,0, 1,1,1,1, 0,0,1,0, 0,0,0,1, 0,1,0,0, 0,1,1,1, + 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, + 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, + 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, - 1,1,0,0, 1,1,1,1, 0,1,0,1, 0,0,0,1, 0,1,0,0, 1,1,0,0, 0,0,1,1, 0,0,0,1, - 0,0,0,0, 0,1,0,0, 0,0,1,1, 1,1,1,1, 0,0,0,0, 0,1,0,1, 0,1,0,0, 0,0,0,0, + 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, + 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, + 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, - 1,1,0,0, 1,1,1,1, 1,1,1,0, 1,1,1,0, 1,0,1,0, 1,0,0,1, 0,1,1,0, 0,1,1,0, - 0,0,1,1, 0,1,1,1, 0,1,1,1, 1,0,1,1, 0,1,0,0, 1,0,1,0, 0,1,0,0, 1,1,1,0, + 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, + 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, - 0,1,1,1, 0,0,0,1, 0,1,1,1, 0,1,0,0, 0,0,1,1, 0,1,0,0, 1,1,1,1, 1,0,1,1, - 0,0,0,1, 0,1,0,1, 1,0,1,1, 1,1,0,0, 1,1,0,1, 1,0,1,0, 1,1,1,0, 1,1,0,1, + 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, + 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, + 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, - 1,0,0,1, 0,1,1,0, 1,1,0,1, 1,1,0,0, 1,0,0,1, 0,0,1,0, 1,1,1,0, 0,0,1,1, - 1,0,0,1, 0,1,1,1, 1,0,1,0, 0,0,1,1, 0,1,0,1, 1,0,0,0, 0,1,0,0, 1,1,0,1, + 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, + 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, + 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, - 1,1,1,1, 0,0,0,1, 0,0,1,0, 1,0,1,1, 1,1,0,0, 0,1,1,0, 0,1,0,1, 0,0,0,0, - 1,0,0,0, 1,1,0,0, 0,0,0,1, 1,1,1,0, 1,1,1,1, 1,1,0,1, 0,1,1,0, 1,0,1,0, + 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, + 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, - 1,1,0,0, 1,0,0,1, 1,0,0,1, 0,0,0,1, 1,1,0,1, 1,1,0,0, 0,0,1,0, 1,1,0,1, - 0,0,0,0, 0,1,1,0, 1,1,0,0, 0,0,0,0, 1,0,0,1, 0,0,0,0, 0,0,0,1, 1,1,0 + 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, + 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0 }; -const unsigned char atsc_pn63[63] = { - 1,1,1,0, 0,1,0,0, 1,0,1,1, 0,1,1,1, 0,1,1,0, 0,1,1,0, 1,0,1,0, 1,1,1,1, - 1,1,0,0, 0,0,0,1, 0,0,0,0, 1,1,0,0, 0,1,0,1, 0,0,1,1, 1,1,0,1, 0,0,0 -}; +const unsigned char atsc_pn63[63] = { 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, + 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, + 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, + 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0 }; #endif /* INCLUDED_DTV_ATSC_PNXXX_H */ diff --git a/gr-dtv/lib/atsc/atsc_randomize.cc b/gr-dtv/lib/atsc/atsc_randomize.cc index 769b08587a..e598e2ecba 100644 --- a/gr-dtv/lib/atsc/atsc_randomize.cc +++ b/gr-dtv/lib/atsc/atsc_randomize.cc @@ -23,95 +23,88 @@ #include "atsc_randomize.h" namespace gr { - namespace dtv { - - unsigned char atsc_randomize::s_output_map[1 << 14]; - bool atsc_randomize::s_output_map_initialized_p = false; - - atsc_randomize::atsc_randomize () - { - d_state = PRELOAD_VALUE; - - if (!s_output_map_initialized_p) - initialize_output_map (); - } - - /*! - * \brief Generate the table used in the fast_output_map function. - * - * The table has 16K byte entries, but because of how is is used, only - * 256 entries end up being resident in the cache. This seems - * like a good use of memory. We can get away with a 16K table - * because the low two bits of the state do not affect the output - * function. By shifting right those two bits we shrink the table, - * and also get better cache line utilization. - */ - void - atsc_randomize::initialize_output_map () - { - s_output_map_initialized_p = true; - - for (int i = 0; i < (1 << 14); i++) - s_output_map[i] = slow_output_map (i << 2); - } - - - void - atsc_randomize::reset () - { - d_state = PRELOAD_VALUE; - } - - void - atsc_randomize::randomize (atsc_mpeg_packet_no_sync &out, const atsc_mpeg_packet &in) - { - assert (in.data[0] == MPEG_SYNC_BYTE); // confirm it's there, then drop - - for (int i = 0; i < ATSC_MPEG_DATA_LENGTH; i++) - out.data[i] = in.data[i + 1] ^ output_and_clk (); - } - - void - atsc_randomize::derandomize (atsc_mpeg_packet &out, const atsc_mpeg_packet_no_sync &in) - { - out.data[0] = MPEG_SYNC_BYTE; // add sync byte to beginning of packet - - for (int i = 0; i < ATSC_MPEG_DATA_LENGTH; i++) - out.data[i + 1] = in.data[i] ^ output_and_clk (); - } - - - unsigned char - atsc_randomize::slow_output_map (int st) - { - int output = 0; - - if (st & 0x8000) +namespace dtv { + +unsigned char atsc_randomize::s_output_map[1 << 14]; +bool atsc_randomize::s_output_map_initialized_p = false; + +atsc_randomize::atsc_randomize() +{ + d_state = PRELOAD_VALUE; + + if (!s_output_map_initialized_p) + initialize_output_map(); +} + +/*! + * \brief Generate the table used in the fast_output_map function. + * + * The table has 16K byte entries, but because of how is is used, only + * 256 entries end up being resident in the cache. This seems + * like a good use of memory. We can get away with a 16K table + * because the low two bits of the state do not affect the output + * function. By shifting right those two bits we shrink the table, + * and also get better cache line utilization. + */ +void atsc_randomize::initialize_output_map() +{ + s_output_map_initialized_p = true; + + for (int i = 0; i < (1 << 14); i++) + s_output_map[i] = slow_output_map(i << 2); +} + + +void atsc_randomize::reset() { d_state = PRELOAD_VALUE; } + +void atsc_randomize::randomize(atsc_mpeg_packet_no_sync& out, const atsc_mpeg_packet& in) +{ + assert(in.data[0] == MPEG_SYNC_BYTE); // confirm it's there, then drop + + for (int i = 0; i < ATSC_MPEG_DATA_LENGTH; i++) + out.data[i] = in.data[i + 1] ^ output_and_clk(); +} + +void atsc_randomize::derandomize(atsc_mpeg_packet& out, + const atsc_mpeg_packet_no_sync& in) +{ + out.data[0] = MPEG_SYNC_BYTE; // add sync byte to beginning of packet + + for (int i = 0; i < ATSC_MPEG_DATA_LENGTH; i++) + out.data[i + 1] = in.data[i] ^ output_and_clk(); +} + + +unsigned char atsc_randomize::slow_output_map(int st) +{ + int output = 0; + + if (st & 0x8000) output |= 0x01; - if (st & 0x2000) + if (st & 0x2000) output |= 0x02; - if (st & 0x1000) + if (st & 0x1000) output |= 0x04; - if (st & 0x0200) + if (st & 0x0200) output |= 0x08; - if (st & 0x0020) + if (st & 0x0020) output |= 0x10; - if (st & 0x0010) + if (st & 0x0010) output |= 0x20; - if (st & 0x0008) + if (st & 0x0008) output |= 0x40; - if (st & 0x0004) + if (st & 0x0004) output |= 0x80; - return output; - } + return output; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_randomize.h b/gr-dtv/lib/atsc/atsc_randomize.h index 0903240f48..48331cdab8 100644 --- a/gr-dtv/lib/atsc/atsc_randomize.h +++ b/gr-dtv/lib/atsc/atsc_randomize.h @@ -26,67 +26,70 @@ #include "atsc_types.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_randomize +class atsc_randomize +{ +public: + atsc_randomize(); + + /*! \brief reset randomizer LFSR + * + * must be called during the Data Segment Sync interval prior to the + * first data segment. I.e., the LFSR is reset prior to the first + * field of each VSB data frame. + */ + void reset(); + + //! randomize (whiten) mpeg packet and remove leading MPEG-2 sync byte + void randomize(atsc_mpeg_packet_no_sync& out, const atsc_mpeg_packet& in); + + //! derandomize (de-whiten) mpeg packet and add leading MPEG-2 sync byte + void derandomize(atsc_mpeg_packet& out, const atsc_mpeg_packet_no_sync& in); + + unsigned int state() const { return d_state; } + +private: + static void initialize_output_map(); + static unsigned char slow_output_map(int st); + + static unsigned char fast_output_map(int st) + { + return s_output_map[(st & 0xb23c) >> + 2]; // Magic const with 8 bits set improves cache + // utilization. The bits correspond to the taps + // used in output calculation. Others may be + // safely ignored. + } + + //! return current output value + unsigned char output() { return fast_output_map(d_state); } + + //! clock LFSR; advance to next state. + void clk() { - public: - atsc_randomize(); - - /*! \brief reset randomizer LFSR - * - * must be called during the Data Segment Sync interval prior to the - * first data segment. I.e., the LFSR is reset prior to the first - * field of each VSB data frame. - */ - void reset (); - - //! randomize (whiten) mpeg packet and remove leading MPEG-2 sync byte - void randomize (atsc_mpeg_packet_no_sync &out, const atsc_mpeg_packet &in); - - //! derandomize (de-whiten) mpeg packet and add leading MPEG-2 sync byte - void derandomize (atsc_mpeg_packet &out, const atsc_mpeg_packet_no_sync &in); - - unsigned int state() const { return d_state; } - private: - static void initialize_output_map (); - static unsigned char slow_output_map (int st); - - static unsigned char fast_output_map (int st){ - return s_output_map[(st & 0xb23c) >> 2]; // Magic const with 8 bits set improves cache - // utilization. The bits correspond to the taps - // used in output calculation. Others may be - // safely ignored. - } - - //! return current output value - unsigned char output (){ - return fast_output_map (d_state); - } - - //! clock LFSR; advance to next state. - void clk (){ if (d_state & 0x1) - d_state = ((d_state ^ MASK) >> 1) | 0x8000; + d_state = ((d_state ^ MASK) >> 1) | 0x8000; else - d_state = d_state >> 1; - } + d_state = d_state >> 1; + } - //! return current output value and advance to next state - unsigned char output_and_clk (){ - unsigned char r = output (); - clk (); + //! return current output value and advance to next state + unsigned char output_and_clk() + { + unsigned char r = output(); + clk(); return r; - } + } - unsigned int d_state; + unsigned int d_state; - static const unsigned int PRELOAD_VALUE = 0x018f; /* 0xf180 bit reversed */ - static const unsigned int MASK = 0xa638; - static unsigned char s_output_map[1 << 14]; - static bool s_output_map_initialized_p; - }; - } /* namespace dtv */ + static const unsigned int PRELOAD_VALUE = 0x018f; /* 0xf180 bit reversed */ + static const unsigned int MASK = 0xa638; + static unsigned char s_output_map[1 << 14]; + static bool s_output_map_initialized_p; +}; +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_ATSC_RANDOMIZE_H */ diff --git a/gr-dtv/lib/atsc/atsc_randomizer_impl.cc b/gr-dtv/lib/atsc/atsc_randomizer_impl.cc index f6b6a6a370..f77bb80f9d 100644 --- a/gr-dtv/lib/atsc/atsc_randomizer_impl.cc +++ b/gr-dtv/lib/atsc/atsc_randomizer_impl.cc @@ -27,44 +27,38 @@ #include "gnuradio/dtv/atsc_consts.h" namespace gr { - namespace dtv { +namespace dtv { - atsc_randomizer::sptr - atsc_randomizer::make() - { - return gnuradio::get_initial_sptr - (new atsc_randomizer_impl()); - } +atsc_randomizer::sptr atsc_randomizer::make() +{ + return gnuradio::get_initial_sptr(new atsc_randomizer_impl()); +} - atsc_randomizer_impl::atsc_randomizer_impl() - : gr::sync_block("atsc_randomizer", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync))) - { - reset(); - } +atsc_randomizer_impl::atsc_randomizer_impl() + : gr::sync_block("atsc_randomizer", + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync))) +{ + reset(); +} - atsc_randomizer_impl::~atsc_randomizer_impl() - { - } +atsc_randomizer_impl::~atsc_randomizer_impl() {} - void - atsc_randomizer_impl::reset() - { - d_rand.reset(); - d_field2 = false; - d_segno = 0; - } +void atsc_randomizer_impl::reset() +{ + d_rand.reset(); + d_field2 = false; + d_segno = 0; +} - int - atsc_randomizer_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet *in = (const atsc_mpeg_packet *) input_items[0]; - atsc_mpeg_packet_no_sync *out = (atsc_mpeg_packet_no_sync *) output_items[0]; +int atsc_randomizer_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet* in = (const atsc_mpeg_packet*)input_items[0]; + atsc_mpeg_packet_no_sync* out = (atsc_mpeg_packet_no_sync*)output_items[0]; - for (int i = 0; i < noutput_items; i++) { + for (int i = 0; i < noutput_items; i++) { // sanity check incoming data. assert((in[i].data[0] == MPEG_SYNC_BYTE)); assert((in[i].data[1] & MPEG_TRANSPORT_ERROR_BIT) == 0); @@ -78,20 +72,20 @@ namespace gr { d_segno++; if (d_segno == 312) { - d_segno = 0; - d_field2 = !d_field2; + d_segno = 0; + d_field2 = !d_field2; } if (out[i].pli.first_regular_seg_p()) { - d_rand.reset(); + d_rand.reset(); } d_rand.randomize(out[i], in[i]); - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ + // Tell runtime system how many output items we produced. + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_randomizer_impl.h b/gr-dtv/lib/atsc/atsc_randomizer_impl.h index d13b09f5e4..6c90c1a99e 100644 --- a/gr-dtv/lib/atsc/atsc_randomizer_impl.h +++ b/gr-dtv/lib/atsc/atsc_randomizer_impl.h @@ -26,27 +26,27 @@ #include "atsc_types.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_randomizer_impl : public atsc_randomizer - { - private: - atsc_randomize d_rand; - int d_segno; - bool d_field2; +class atsc_randomizer_impl : public atsc_randomizer +{ +private: + atsc_randomize d_rand; + int d_segno; + bool d_field2; - void reset(void); + void reset(void); - public: - atsc_randomizer_impl(); - ~atsc_randomizer_impl(); +public: + atsc_randomizer_impl(); + ~atsc_randomizer_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_RANDOMIZER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_rs_decoder_impl.cc b/gr-dtv/lib/atsc/atsc_rs_decoder_impl.cc index a0ca0c1c07..d7c0cc4d5b 100644 --- a/gr-dtv/lib/atsc/atsc_rs_decoder_impl.cc +++ b/gr-dtv/lib/atsc/atsc_rs_decoder_impl.cc @@ -29,153 +29,149 @@ #include <gnuradio/io_signature.h> namespace gr { - namespace dtv { - - static const int rs_init_symsize = 8; - static const int rs_init_gfpoly = 0x11d; - static const int rs_init_fcr = 0; // first consecutive root - static const int rs_init_prim = 1; // primitive is 1 (alpha) - static const int rs_init_nroots = 20; - - static const int N = (1 << rs_init_symsize) - 1; // 255 - - static const int amount_of_pad = N - ATSC_MPEG_RS_ENCODED_LENGTH; // 48 - - atsc_rs_decoder::sptr - atsc_rs_decoder::make() - { - return gnuradio::get_initial_sptr - (new atsc_rs_decoder_impl()); - } - - atsc_rs_decoder_impl::atsc_rs_decoder_impl() - : gr::sync_block("dtv_atsc_rs_decoder", - io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), - io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync))) - { - d_rs = init_rs_char(rs_init_symsize, rs_init_gfpoly, rs_init_fcr, rs_init_prim, rs_init_nroots); - assert (d_rs != 0); - d_nerrors_corrrected_count = 0; - d_bad_packet_count = 0; - d_total_packets = 0; - } - - int atsc_rs_decoder_impl::decode (atsc_mpeg_packet_no_sync &out, const atsc_mpeg_packet_rs_encoded &in) - { - unsigned char tmp[N]; - int ncorrections; - - assert((int)(amount_of_pad + sizeof(in.data)) == N); - - // add missing prefix zero padding to message - memset(tmp, 0, amount_of_pad); - memcpy(&tmp[amount_of_pad], in.data, sizeof(in.data)); - - // correct message... - ncorrections = decode_rs_char(d_rs, tmp, 0, 0); - - // copy corrected message to output, skipping prefix zero padding - memcpy (out.data, &tmp[amount_of_pad], sizeof (out.data)); - - return ncorrections; - } - - atsc_rs_decoder_impl::~atsc_rs_decoder_impl() - { - if (d_rs) - free_rs_char (d_rs); - d_rs = 0; - } - - int - atsc_rs_decoder_impl::num_errors_corrected() const - { - return d_nerrors_corrrected_count; - } - - int - atsc_rs_decoder_impl::num_bad_packets() const - { - return d_bad_packet_count; - } - - int - atsc_rs_decoder_impl::num_packets() const - { - return d_total_packets; - } - - int - atsc_rs_decoder_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet_rs_encoded *in = (const atsc_mpeg_packet_rs_encoded *)input_items[0]; - atsc_mpeg_packet_no_sync *out = (atsc_mpeg_packet_no_sync *)output_items[0]; - - for (int i = 0; i < noutput_items; i++) { +namespace dtv { + +static const int rs_init_symsize = 8; +static const int rs_init_gfpoly = 0x11d; +static const int rs_init_fcr = 0; // first consecutive root +static const int rs_init_prim = 1; // primitive is 1 (alpha) +static const int rs_init_nroots = 20; + +static const int N = (1 << rs_init_symsize) - 1; // 255 + +static const int amount_of_pad = N - ATSC_MPEG_RS_ENCODED_LENGTH; // 48 + +atsc_rs_decoder::sptr atsc_rs_decoder::make() +{ + return gnuradio::get_initial_sptr(new atsc_rs_decoder_impl()); +} + +atsc_rs_decoder_impl::atsc_rs_decoder_impl() + : gr::sync_block("dtv_atsc_rs_decoder", + io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), + io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync))) +{ + d_rs = init_rs_char( + rs_init_symsize, rs_init_gfpoly, rs_init_fcr, rs_init_prim, rs_init_nroots); + assert(d_rs != 0); + d_nerrors_corrrected_count = 0; + d_bad_packet_count = 0; + d_total_packets = 0; +} + +int atsc_rs_decoder_impl::decode(atsc_mpeg_packet_no_sync& out, + const atsc_mpeg_packet_rs_encoded& in) +{ + unsigned char tmp[N]; + int ncorrections; + + assert((int)(amount_of_pad + sizeof(in.data)) == N); + + // add missing prefix zero padding to message + memset(tmp, 0, amount_of_pad); + memcpy(&tmp[amount_of_pad], in.data, sizeof(in.data)); + + // correct message... + ncorrections = decode_rs_char(d_rs, tmp, 0, 0); + + // copy corrected message to output, skipping prefix zero padding + memcpy(out.data, &tmp[amount_of_pad], sizeof(out.data)); + + return ncorrections; +} + +atsc_rs_decoder_impl::~atsc_rs_decoder_impl() +{ + if (d_rs) + free_rs_char(d_rs); + d_rs = 0; +} + +int atsc_rs_decoder_impl::num_errors_corrected() const +{ + return d_nerrors_corrrected_count; +} + +int atsc_rs_decoder_impl::num_bad_packets() const { return d_bad_packet_count; } + +int atsc_rs_decoder_impl::num_packets() const { return d_total_packets; } + +int atsc_rs_decoder_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet_rs_encoded* in = + (const atsc_mpeg_packet_rs_encoded*)input_items[0]; + atsc_mpeg_packet_no_sync* out = (atsc_mpeg_packet_no_sync*)output_items[0]; + + for (int i = 0; i < noutput_items; i++) { assert(in[i].pli.regular_seg_p()); - out[i].pli = in[i].pli; // copy pipeline info... + out[i].pli = in[i].pli; // copy pipeline info... int nerrors_corrrected = decode(out[i], in[i]); out[i].pli.set_transport_error(nerrors_corrrected == -1); if (nerrors_corrrected == -1) { - d_bad_packet_count++; - d_nerrors_corrrected_count += 10; // lower bound estimate; most this RS can fix - } - else { - d_nerrors_corrrected_count += nerrors_corrrected; + d_bad_packet_count++; + d_nerrors_corrrected_count += + 10; // lower bound estimate; most this RS can fix + } else { + d_nerrors_corrrected_count += nerrors_corrrected; } - d_total_packets++; - #if 0 + d_total_packets++; +#if 0 if (d_total_packets > 1000) { GR_LOG_INFO(d_logger, boost::format("Error rate: %1%\tPacket error rate: %2%") \ % ((float)d_nerrors_corrrected_count/(ATSC_MPEG_DATA_LENGTH*d_total_packets)) % ((float)d_bad_packet_count/d_total_packets)); } - #endif - } - - return noutput_items; +#endif } + return noutput_items; +} + - void - atsc_rs_decoder_impl::setup_rpc() - { +void atsc_rs_decoder_impl::setup_rpc() +{ #ifdef GR_CTRLPORT - add_rpc_variable( - rpcbasic_sptr(new rpcbasic_register_get<atsc_rs_decoder, int >( - alias(), "num_errors_corrected", - &atsc_rs_decoder::num_errors_corrected, - pmt::from_long(0), - pmt::from_long(10000000), - pmt::from_long(0), - "", "Number of errors corrected", RPC_PRIVLVL_MIN, - DISPTIME))); - - add_rpc_variable( - rpcbasic_sptr(new rpcbasic_register_get<atsc_rs_decoder, int >( - alias(), "num_bad_packets", - &atsc_rs_decoder::num_bad_packets, - pmt::from_long(0), - pmt::from_long(10000000), - pmt::from_long(0), - "", "Number of bad packets", RPC_PRIVLVL_MIN, - DISPTIME))); - - add_rpc_variable( - rpcbasic_sptr(new rpcbasic_register_get<atsc_rs_decoder, int >( - alias(), "num_packets", - &atsc_rs_decoder::num_packets, - pmt::from_long(0), - pmt::from_long(10000000), - pmt::from_long(0), - "", "Number of packets", RPC_PRIVLVL_MIN, - DISPTIME))); + add_rpc_variable(rpcbasic_sptr(new rpcbasic_register_get<atsc_rs_decoder, int>( + alias(), + "num_errors_corrected", + &atsc_rs_decoder::num_errors_corrected, + pmt::from_long(0), + pmt::from_long(10000000), + pmt::from_long(0), + "", + "Number of errors corrected", + RPC_PRIVLVL_MIN, + DISPTIME))); + + add_rpc_variable(rpcbasic_sptr( + new rpcbasic_register_get<atsc_rs_decoder, int>(alias(), + "num_bad_packets", + &atsc_rs_decoder::num_bad_packets, + pmt::from_long(0), + pmt::from_long(10000000), + pmt::from_long(0), + "", + "Number of bad packets", + RPC_PRIVLVL_MIN, + DISPTIME))); + + add_rpc_variable(rpcbasic_sptr( + new rpcbasic_register_get<atsc_rs_decoder, int>(alias(), + "num_packets", + &atsc_rs_decoder::num_packets, + pmt::from_long(0), + pmt::from_long(10000000), + pmt::from_long(0), + "", + "Number of packets", + RPC_PRIVLVL_MIN, + DISPTIME))); #endif /* GR_CTRLPORT */ - } +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_rs_decoder_impl.h b/gr-dtv/lib/atsc/atsc_rs_decoder_impl.h index c657e699dc..926a9789e4 100644 --- a/gr-dtv/lib/atsc/atsc_rs_decoder_impl.h +++ b/gr-dtv/lib/atsc/atsc_rs_decoder_impl.h @@ -31,38 +31,38 @@ extern "C" { } namespace gr { - namespace dtv { +namespace dtv { - class atsc_rs_decoder_impl : public atsc_rs_decoder - { - private: - int d_nerrors_corrrected_count; - int d_bad_packet_count; - int d_total_packets; - void *d_rs; +class atsc_rs_decoder_impl : public atsc_rs_decoder +{ +private: + int d_nerrors_corrrected_count; + int d_bad_packet_count; + int d_total_packets; + void* d_rs; - public: - atsc_rs_decoder_impl(); - ~atsc_rs_decoder_impl(); +public: + atsc_rs_decoder_impl(); + ~atsc_rs_decoder_impl(); - void setup_rpc(); + void setup_rpc(); - int num_errors_corrected() const; - int num_bad_packets() const; - int num_packets() const; + int num_errors_corrected() const; + int num_bad_packets() const; + int num_packets() const; - /*! - * Decode RS encoded packet. - * \returns a count of corrected symbols, or -1 if the block was uncorrectible. - */ - int decode(atsc_mpeg_packet_no_sync &out, const atsc_mpeg_packet_rs_encoded &in); + /*! + * Decode RS encoded packet. + * \returns a count of corrected symbols, or -1 if the block was uncorrectible. + */ + int decode(atsc_mpeg_packet_no_sync& out, const atsc_mpeg_packet_rs_encoded& in); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_RS_DECODER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_rs_encoder_impl.cc b/gr-dtv/lib/atsc/atsc_rs_encoder_impl.cc index 9249301165..04a0c7c5a2 100644 --- a/gr-dtv/lib/atsc/atsc_rs_encoder_impl.cc +++ b/gr-dtv/lib/atsc/atsc_rs_encoder_impl.cc @@ -26,79 +26,77 @@ #include "atsc_rs_encoder_impl.h" namespace gr { - namespace dtv { - - static const int rs_init_symsize = 8; - static const int rs_init_gfpoly = 0x11d; - static const int rs_init_fcr = 0; // first consecutive root - static const int rs_init_prim = 1; // primitive is 1 (alpha) - static const int rs_init_nroots = 20; - - static const int N = (1 << rs_init_symsize) - 1; // 255 - static const int K = N - rs_init_nroots; // 235 - - static const int amount_of_pad = N - ATSC_MPEG_RS_ENCODED_LENGTH; // 48 - - atsc_rs_encoder::sptr - atsc_rs_encoder::make() - { - return gnuradio::get_initial_sptr - (new atsc_rs_encoder_impl()); - } - - atsc_rs_encoder_impl::atsc_rs_encoder_impl() - : gr::sync_block("atsc_rs_encoder", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) - { - d_rs = init_rs_char(rs_init_symsize, rs_init_gfpoly, rs_init_fcr, rs_init_prim, rs_init_nroots); - assert (d_rs != 0); - } - - atsc_rs_encoder_impl::~atsc_rs_encoder_impl() - { - if (d_rs) { +namespace dtv { + +static const int rs_init_symsize = 8; +static const int rs_init_gfpoly = 0x11d; +static const int rs_init_fcr = 0; // first consecutive root +static const int rs_init_prim = 1; // primitive is 1 (alpha) +static const int rs_init_nroots = 20; + +static const int N = (1 << rs_init_symsize) - 1; // 255 +static const int K = N - rs_init_nroots; // 235 + +static const int amount_of_pad = N - ATSC_MPEG_RS_ENCODED_LENGTH; // 48 + +atsc_rs_encoder::sptr atsc_rs_encoder::make() +{ + return gnuradio::get_initial_sptr(new atsc_rs_encoder_impl()); +} + +atsc_rs_encoder_impl::atsc_rs_encoder_impl() + : gr::sync_block("atsc_rs_encoder", + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync)), + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) +{ + d_rs = init_rs_char( + rs_init_symsize, rs_init_gfpoly, rs_init_fcr, rs_init_prim, rs_init_nroots); + assert(d_rs != 0); +} + +atsc_rs_encoder_impl::~atsc_rs_encoder_impl() +{ + if (d_rs) { free_rs_char(d_rs); - } - - d_rs = 0; } - void - atsc_rs_encoder_impl::encode(atsc_mpeg_packet_rs_encoded &out, const atsc_mpeg_packet_no_sync &in) - { - unsigned char tmp[K]; + d_rs = 0; +} - assert((int)(amount_of_pad + sizeof (in.data)) == K); +void atsc_rs_encoder_impl::encode(atsc_mpeg_packet_rs_encoded& out, + const atsc_mpeg_packet_no_sync& in) +{ + unsigned char tmp[K]; - // add missing prefix zero padding to message - memset(tmp, 0, amount_of_pad); - memcpy(&tmp[amount_of_pad], in.data, sizeof (in.data)); + assert((int)(amount_of_pad + sizeof(in.data)) == K); - // copy message portion to output packet - memcpy(out.data, in.data, sizeof (in.data)); + // add missing prefix zero padding to message + memset(tmp, 0, amount_of_pad); + memcpy(&tmp[amount_of_pad], in.data, sizeof(in.data)); - // now compute parity bytes and add them to tail end of output packet - encode_rs_char(d_rs, tmp, &out.data[sizeof (in.data)]); - } + // copy message portion to output packet + memcpy(out.data, in.data, sizeof(in.data)); - int - atsc_rs_encoder_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet_no_sync *in = (const atsc_mpeg_packet_no_sync *) input_items[0]; - atsc_mpeg_packet_rs_encoded *out = (atsc_mpeg_packet_rs_encoded *) output_items[0]; + // now compute parity bytes and add them to tail end of output packet + encode_rs_char(d_rs, tmp, &out.data[sizeof(in.data)]); +} - for (int i = 0; i < noutput_items; i++) { +int atsc_rs_encoder_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet_no_sync* in = (const atsc_mpeg_packet_no_sync*)input_items[0]; + atsc_mpeg_packet_rs_encoded* out = (atsc_mpeg_packet_rs_encoded*)output_items[0]; + + for (int i = 0; i < noutput_items; i++) { assert(in[i].pli.regular_seg_p()); - out[i].pli = in[i].pli; // copy pipeline info... + out[i].pli = in[i].pli; // copy pipeline info... encode(out[i], in[i]); - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ + // Tell runtime system how many output items we produced. + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_rs_encoder_impl.h b/gr-dtv/lib/atsc/atsc_rs_encoder_impl.h index 9086c8223d..a6eb3ecd73 100644 --- a/gr-dtv/lib/atsc/atsc_rs_encoder_impl.h +++ b/gr-dtv/lib/atsc/atsc_rs_encoder_impl.h @@ -24,30 +24,29 @@ #include <gnuradio/dtv/atsc_rs_encoder.h> #include "atsc_types.h" -extern "C" -{ +extern "C" { #include <gnuradio/fec/rs.h> } namespace gr { - namespace dtv { +namespace dtv { - class atsc_rs_encoder_impl : public atsc_rs_encoder - { - private: - void *d_rs; - void encode(atsc_mpeg_packet_rs_encoded &out, const atsc_mpeg_packet_no_sync &in); +class atsc_rs_encoder_impl : public atsc_rs_encoder +{ +private: + void* d_rs; + void encode(atsc_mpeg_packet_rs_encoded& out, const atsc_mpeg_packet_no_sync& in); - public: - atsc_rs_encoder_impl(); - ~atsc_rs_encoder_impl(); +public: + atsc_rs_encoder_impl(); + ~atsc_rs_encoder_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_RS_ENCODER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_single_viterbi.cc b/gr-dtv/lib/atsc/atsc_single_viterbi.cc index 5f4850d81a..d6ffeb7fef 100644 --- a/gr-dtv/lib/atsc/atsc_single_viterbi.cc +++ b/gr-dtv/lib/atsc/atsc_single_viterbi.cc @@ -24,83 +24,76 @@ #include <math.h> namespace gr { - namespace dtv { - - /* was_sent is a table of what symbol we get given what bit pair - was sent and what state we where in [state][pair] */ - const int atsc_single_viterbi::d_was_sent[4][4] = { - {0,2,4,6}, - {0,2,4,6}, - {1,3,5,7}, - {1,3,5,7}, - }; - - /* transition_table is a table of what state we were in - given current state and bit pair sent [state][pair] */ - const int atsc_single_viterbi::d_transition_table[4][4] = { - {0,2,0,2}, - {2,0,2,0}, - {1,3,1,3}, - {3,1,3,1}, - }; - - void - atsc_single_viterbi::reset() - { - for (unsigned int i = 0; i<2; i++) - for (unsigned int j = 0; j<4; j++) { - d_path_metrics[i][j] = 0; - d_traceback[i][j] = 0; +namespace dtv { + +/* was_sent is a table of what symbol we get given what bit pair + was sent and what state we where in [state][pair] */ +const int atsc_single_viterbi::d_was_sent[4][4] = { + { 0, 2, 4, 6 }, + { 0, 2, 4, 6 }, + { 1, 3, 5, 7 }, + { 1, 3, 5, 7 }, +}; + +/* transition_table is a table of what state we were in + given current state and bit pair sent [state][pair] */ +const int atsc_single_viterbi::d_transition_table[4][4] = { + { 0, 2, 0, 2 }, + { 2, 0, 2, 0 }, + { 1, 3, 1, 3 }, + { 3, 1, 3, 1 }, +}; + +void atsc_single_viterbi::reset() +{ + for (unsigned int i = 0; i < 2; i++) + for (unsigned int j = 0; j < 4; j++) { + d_path_metrics[i][j] = 0; + d_traceback[i][j] = 0; } - d_post_coder_state = 0; - d_phase = 0; - d_best_state_metric = 100000; - } + d_post_coder_state = 0; + d_phase = 0; + d_best_state_metric = 100000; +} - atsc_single_viterbi::atsc_single_viterbi() - { - reset(); - } +atsc_single_viterbi::atsc_single_viterbi() { reset(); } - float - atsc_single_viterbi::best_state_metric() const - { - return d_best_state_metric; - } +float atsc_single_viterbi::best_state_metric() const { return d_best_state_metric; } + +char atsc_single_viterbi::decode(float input) +{ + unsigned int best_state = 0; + // float best_state_metric = 100000; + d_best_state_metric = 100000; + + /* Precompute distances from input to each possible symbol */ + float distances[8] = { fabsf(input + 7), fabsf(input + 5), fabsf(input + 3), + fabsf(input + 1), fabsf(input - 1), fabsf(input - 3), + fabsf(input - 5), fabsf(input - 7) }; - char - atsc_single_viterbi::decode(float input) - { - unsigned int best_state = 0; - //float best_state_metric = 100000; - d_best_state_metric = 100000; - - /* Precompute distances from input to each possible symbol */ - float distances[8] = { fabsf( input + 7 ), fabsf( input + 5 ), - fabsf( input + 3 ), fabsf( input + 1 ), - fabsf( input - 1 ), fabsf( input - 3 ), - fabsf( input - 5 ), fabsf( input - 7 ) }; - - /* We start by iterating over all possible states */ - for (unsigned int state = 0; state < 4; state++) { + /* We start by iterating over all possible states */ + for (unsigned int state = 0; state < 4; state++) { /* Next we find the most probable path from the previous states to the state we are testing, we only need to look at the 4 paths that can be taken given the 2-bit input */ int min_metric_symb = 0; float min_metric = distances[d_was_sent[state][0]] + - d_path_metrics[d_phase][d_transition_table[state][0]]; + d_path_metrics[d_phase][d_transition_table[state][0]]; for (unsigned int symbol_sent = 1; symbol_sent < 4; symbol_sent++) - if( (distances[d_was_sent[state][symbol_sent]] + - d_path_metrics[d_phase][d_transition_table[state][symbol_sent]]) < min_metric) { - min_metric = distances[d_was_sent[state][symbol_sent]] + - d_path_metrics[d_phase][d_transition_table[state][symbol_sent]]; - min_metric_symb = symbol_sent; - } - - d_path_metrics[d_phase^1][state] = min_metric; - d_traceback[d_phase^1][state] = (((unsigned long long)min_metric_symb) << 62) | - (d_traceback[d_phase][d_transition_table[state][min_metric_symb]] >> 2); + if ((distances[d_was_sent[state][symbol_sent]] + + d_path_metrics[d_phase][d_transition_table[state][symbol_sent]]) < + min_metric) { + min_metric = + distances[d_was_sent[state][symbol_sent]] + + d_path_metrics[d_phase][d_transition_table[state][symbol_sent]]; + min_metric_symb = symbol_sent; + } + + d_path_metrics[d_phase ^ 1][state] = min_metric; + d_traceback[d_phase ^ 1][state] = + (((unsigned long long)min_metric_symb) << 62) | + (d_traceback[d_phase][d_transition_table[state][min_metric_symb]] >> 2); /* If this is the most probable state so far remember it, this only needs to be checked when we are about to output a path @@ -111,24 +104,24 @@ namespace gr { head state path will tend towards the optimal path with a probability approaching 1 in just 8 or so transitions */ - if(min_metric <= d_best_state_metric) { - d_best_state_metric = min_metric; - best_state = state; + if (min_metric <= d_best_state_metric) { + d_best_state_metric = min_metric; + best_state = state; } - } + } - if(d_best_state_metric > 10000) { - for(unsigned int state = 0; state < 4; state++) - d_path_metrics[d_phase^1][state] -= d_best_state_metric; - } - d_phase ^= 1; + if (d_best_state_metric > 10000) { + for (unsigned int state = 0; state < 4; state++) + d_path_metrics[d_phase ^ 1][state] -= d_best_state_metric; + } + d_phase ^= 1; - int y2 = (0x2 & d_traceback[d_phase][best_state]) >> 1; - int x2 = y2 ^ d_post_coder_state; - d_post_coder_state = y2; + int y2 = (0x2 & d_traceback[d_phase][best_state]) >> 1; + int x2 = y2 ^ d_post_coder_state; + d_post_coder_state = y2; - return ( x2 << 1 ) | (0x1 & d_traceback[d_phase][best_state]); - } + return (x2 << 1) | (0x1 & d_traceback[d_phase][best_state]); +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_single_viterbi.h b/gr-dtv/lib/atsc/atsc_single_viterbi.h index 9522e2eb1b..fbfd673915 100644 --- a/gr-dtv/lib/atsc/atsc_single_viterbi.h +++ b/gr-dtv/lib/atsc/atsc_single_viterbi.h @@ -24,40 +24,40 @@ #define INCLUDED_DTV_ATSC_SINGLE_VITERBI_H namespace gr { - namespace dtv { +namespace dtv { - class atsc_single_viterbi - { - public: - atsc_single_viterbi(); +class atsc_single_viterbi +{ +public: + atsc_single_viterbi(); - static const unsigned int TB_LEN = 32; + static const unsigned int TB_LEN = 32; - /*! - * \p INPUT ideally takes on the values +/- 1,3,5,7 - * return is decoded dibit in the range [0, 3] - */ - char decode(float input); + /*! + * \p INPUT ideally takes on the values +/- 1,3,5,7 + * return is decoded dibit in the range [0, 3] + */ + char decode(float input); - void reset (); + void reset(); - //! internal delay of decoder - static int delay () { return TB_LEN - 1; } + //! internal delay of decoder + static int delay() { return TB_LEN - 1; } - float best_state_metric() const; + float best_state_metric() const; - protected: - static const int d_transition_table[4][4]; - static const int d_was_sent[4][4]; +protected: + static const int d_transition_table[4][4]; + static const int d_was_sent[4][4]; - float d_path_metrics [2][4]; - unsigned long long d_traceback [2][4]; - unsigned char d_phase; - int d_post_coder_state; - float d_best_state_metric; - }; + float d_path_metrics[2][4]; + unsigned long long d_traceback[2][4]; + unsigned char d_phase; + int d_post_coder_state; + float d_best_state_metric; +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_SINGLE_VITERBI_H */ diff --git a/gr-dtv/lib/atsc/atsc_syminfo_impl.h b/gr-dtv/lib/atsc/atsc_syminfo_impl.h index 4a5008e5f8..c12f47c6b9 100644 --- a/gr-dtv/lib/atsc/atsc_syminfo_impl.h +++ b/gr-dtv/lib/atsc/atsc_syminfo_impl.h @@ -23,40 +23,39 @@ #define INCLUDED_GR_DTV_ATSC_SYMINFO_H namespace gr { - namespace dtv { - namespace atsc { - - static const unsigned int SI_SEGMENT_NUM_MASK = 0x1ff; - static const unsigned int SI_FIELD_SYNC_SEGMENT_NUM = SI_SEGMENT_NUM_MASK; // conceptually -1 - - struct syminfo { - unsigned int symbol_num : 10; // 0..831 - unsigned int segment_num : 9; // 0..311 and SI_FIELD_SYNC_SEGMENT_NUM - unsigned int field_num : 1; // 0..1 - unsigned int valid : 1; // contents are valid - }; - - - static inline bool - tag_is_start_field_sync (syminfo tag) - { - return tag.symbol_num == 0 && tag.segment_num == SI_FIELD_SYNC_SEGMENT_NUM && tag.valid; - } - - static inline bool - tag_is_start_field_sync_1 (syminfo tag) - { - return tag_is_start_field_sync (tag) && tag.field_num == 0; - } - - static inline bool - tag_is_start_field_sync_2 (syminfo tag) - { - return tag_is_start_field_sync (tag) && tag.field_num == 1; - } - - } /* namespace atsc */ - } /* namespace dtv */ +namespace dtv { +namespace atsc { + +static const unsigned int SI_SEGMENT_NUM_MASK = 0x1ff; +static const unsigned int SI_FIELD_SYNC_SEGMENT_NUM = + SI_SEGMENT_NUM_MASK; // conceptually -1 + +struct syminfo { + unsigned int symbol_num : 10; // 0..831 + unsigned int segment_num : 9; // 0..311 and SI_FIELD_SYNC_SEGMENT_NUM + unsigned int field_num : 1; // 0..1 + unsigned int valid : 1; // contents are valid +}; + + +static inline bool tag_is_start_field_sync(syminfo tag) +{ + return tag.symbol_num == 0 && tag.segment_num == SI_FIELD_SYNC_SEGMENT_NUM && + tag.valid; +} + +static inline bool tag_is_start_field_sync_1(syminfo tag) +{ + return tag_is_start_field_sync(tag) && tag.field_num == 0; +} + +static inline bool tag_is_start_field_sync_2(syminfo tag) +{ + return tag_is_start_field_sync(tag) && tag.field_num == 1; +} + +} /* namespace atsc */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_GR_DTV_ATSC_SYMINFO_H */ diff --git a/gr-dtv/lib/atsc/atsc_sync_impl.cc b/gr-dtv/lib/atsc/atsc_sync_impl.cc index 702772ed1b..2c3737564e 100644 --- a/gr-dtv/lib/atsc/atsc_sync_impl.cc +++ b/gr-dtv/lib/atsc/atsc_sync_impl.cc @@ -29,173 +29,179 @@ #include <gnuradio/io_signature.h> namespace gr { - namespace dtv { - - static const double LOOP_FILTER_TAP = 0.0005; // 0.0005 works - static const double ADJUSTMENT_GAIN = 1.0e-5 / (10 * ATSC_DATA_SEGMENT_LENGTH); - static const int SYMBOL_INDEX_OFFSET = 3; - static const int MIN_SEG_LOCK_CORRELATION_VALUE = 5; - static const signed char SSI_MIN = -16; - static const signed char SSI_MAX = 15; - - atsc_sync::sptr - atsc_sync::make(float rate) - { - return gnuradio::get_initial_sptr - (new atsc_sync_impl(rate)); - } - - atsc_sync_impl::atsc_sync_impl(float rate) - : gr::block("dtv_atsc_sync", - io_signature::make(1, 1, sizeof(float)), - io_signature::make(1, 1, sizeof(atsc_soft_data_segment))), - d_rx_clock_to_symbol_freq(rate/ATSC_SYMBOL_RATE), - d_si(0) - { - d_loop.set_taps(LOOP_FILTER_TAP); - reset(); - } - - void - atsc_sync_impl::reset() - { - d_w = d_rx_clock_to_symbol_freq; - d_mu = 0.5; - - d_timing_adjust = 0; - d_counter = 0; - d_symbol_index = 0; - d_seg_locked = false; - - d_sr = 0; - - memset(d_sample_mem, 0, ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_sample_mem)); // (float)0 = 0x00000000 - memset(d_data_mem, 0, ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_data_mem)); // (float)0 = 0x00000000 - memset(d_integrator, SSI_MIN, ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_integrator)); // signed char - } - - atsc_sync_impl::~atsc_sync_impl() - { - } - - void - atsc_sync_impl::forecast(int noutput_items, - gr_vector_int &ninput_items_required) - { - unsigned ninputs = ninput_items_required.size(); - for (unsigned i = 0; i < ninputs; i++) - ninput_items_required[i] = static_cast<int>(noutput_items * d_rx_clock_to_symbol_freq * ATSC_DATA_SEGMENT_LENGTH) + 1500 - 1; - } - - int - atsc_sync_impl::general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const float *in = (const float *) input_items[0]; - atsc_soft_data_segment *soft_data_segment_out = (atsc_soft_data_segment *) output_items[0]; - - float interp_sample; - - // amount actually consumed - d_si = 0; - - for (d_output_produced = 0; d_output_produced < noutput_items && (d_si + (int)d_interp.ntaps()) < ninput_items[0];) { - // First we interpolate a sample from input to work with - interp_sample = d_interp.interpolate(&in[d_si], d_mu); - - // Apply our timing adjustment slowly over several samples - d_mu += ADJUSTMENT_GAIN * 1e3 * d_timing_adjust; - - double s = d_mu + d_w; - double float_incr = floor(s); - d_mu = s - float_incr; - d_incr = (int)float_incr; - - assert (d_incr >= 1 && d_incr <= 3); - d_si += d_incr; - - // Remember the sample at this count position - d_sample_mem[d_counter] = interp_sample; - - // Is the sample positive or negative? - int bit = (interp_sample < 0 ? 0 : 1); - - // Put the sign bit into our shift register - d_sr = ((bit & 1) << 3) | (d_sr >> 1); - - // When +,-,-,+ (0x9, 1001) samples show up we have likely found a segment - // sync, it is more likely the segment sync will show up at about the same - // spot every ATSC_DATA_SEGMENT_LENGTH samples so we add some weight - // to this spot every pass to prevent random +,-,-,+ symbols from - // confusing our synchronizer - d_integrator[d_counter] += ((d_sr == 0x9) ? +2 : -1); - if(d_integrator[d_counter] < SSI_MIN) d_integrator[d_counter] = SSI_MIN; - if(d_integrator[d_counter] > SSI_MAX) d_integrator[d_counter] = SSI_MAX; - - d_symbol_index++; - if( d_symbol_index >= ATSC_DATA_SEGMENT_LENGTH ) +namespace dtv { + +static const double LOOP_FILTER_TAP = 0.0005; // 0.0005 works +static const double ADJUSTMENT_GAIN = 1.0e-5 / (10 * ATSC_DATA_SEGMENT_LENGTH); +static const int SYMBOL_INDEX_OFFSET = 3; +static const int MIN_SEG_LOCK_CORRELATION_VALUE = 5; +static const signed char SSI_MIN = -16; +static const signed char SSI_MAX = 15; + +atsc_sync::sptr atsc_sync::make(float rate) +{ + return gnuradio::get_initial_sptr(new atsc_sync_impl(rate)); +} + +atsc_sync_impl::atsc_sync_impl(float rate) + : gr::block("dtv_atsc_sync", + io_signature::make(1, 1, sizeof(float)), + io_signature::make(1, 1, sizeof(atsc_soft_data_segment))), + d_rx_clock_to_symbol_freq(rate / ATSC_SYMBOL_RATE), + d_si(0) +{ + d_loop.set_taps(LOOP_FILTER_TAP); + reset(); +} + +void atsc_sync_impl::reset() +{ + d_w = d_rx_clock_to_symbol_freq; + d_mu = 0.5; + + d_timing_adjust = 0; + d_counter = 0; + d_symbol_index = 0; + d_seg_locked = false; + + d_sr = 0; + + memset(d_sample_mem, + 0, + ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_sample_mem)); // (float)0 = 0x00000000 + memset(d_data_mem, + 0, + ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_data_mem)); // (float)0 = 0x00000000 + memset(d_integrator, + SSI_MIN, + ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_integrator)); // signed char +} + +atsc_sync_impl::~atsc_sync_impl() {} + +void atsc_sync_impl::forecast(int noutput_items, gr_vector_int& ninput_items_required) +{ + unsigned ninputs = ninput_items_required.size(); + for (unsigned i = 0; i < ninputs; i++) + ninput_items_required[i] = + static_cast<int>(noutput_items * d_rx_clock_to_symbol_freq * + ATSC_DATA_SEGMENT_LENGTH) + + 1500 - 1; +} + +int atsc_sync_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const float* in = (const float*)input_items[0]; + atsc_soft_data_segment* soft_data_segment_out = + (atsc_soft_data_segment*)output_items[0]; + + float interp_sample; + + // amount actually consumed + d_si = 0; + + for (d_output_produced = 0; d_output_produced < noutput_items && + (d_si + (int)d_interp.ntaps()) < ninput_items[0];) { + // First we interpolate a sample from input to work with + interp_sample = d_interp.interpolate(&in[d_si], d_mu); + + // Apply our timing adjustment slowly over several samples + d_mu += ADJUSTMENT_GAIN * 1e3 * d_timing_adjust; + + double s = d_mu + d_w; + double float_incr = floor(s); + d_mu = s - float_incr; + d_incr = (int)float_incr; + + assert(d_incr >= 1 && d_incr <= 3); + d_si += d_incr; + + // Remember the sample at this count position + d_sample_mem[d_counter] = interp_sample; + + // Is the sample positive or negative? + int bit = (interp_sample < 0 ? 0 : 1); + + // Put the sign bit into our shift register + d_sr = ((bit & 1) << 3) | (d_sr >> 1); + + // When +,-,-,+ (0x9, 1001) samples show up we have likely found a segment + // sync, it is more likely the segment sync will show up at about the same + // spot every ATSC_DATA_SEGMENT_LENGTH samples so we add some weight + // to this spot every pass to prevent random +,-,-,+ symbols from + // confusing our synchronizer + d_integrator[d_counter] += ((d_sr == 0x9) ? +2 : -1); + if (d_integrator[d_counter] < SSI_MIN) + d_integrator[d_counter] = SSI_MIN; + if (d_integrator[d_counter] > SSI_MAX) + d_integrator[d_counter] = SSI_MAX; + + d_symbol_index++; + if (d_symbol_index >= ATSC_DATA_SEGMENT_LENGTH) d_symbol_index = 0; - d_counter++; - if( d_counter >= ATSC_DATA_SEGMENT_LENGTH ) { // counter just wrapped... + d_counter++; + if (d_counter >= ATSC_DATA_SEGMENT_LENGTH) { // counter just wrapped... int best_correlation_value = d_integrator[0]; int best_correlation_index = 0; - for(int i = 1; i < ATSC_DATA_SEGMENT_LENGTH; i++) - if (d_integrator[i] > best_correlation_value) { - best_correlation_value = d_integrator[i]; - best_correlation_index = i; - } + for (int i = 1; i < ATSC_DATA_SEGMENT_LENGTH; i++) + if (d_integrator[i] > best_correlation_value) { + best_correlation_value = d_integrator[i]; + best_correlation_index = i; + } d_seg_locked = best_correlation_value >= MIN_SEG_LOCK_CORRELATION_VALUE; // the coefficients are -1,-1,+1,+1 - //d_timing_adjust = d_sample_mem[best_correlation_index - 3] + + // d_timing_adjust = d_sample_mem[best_correlation_index - 3] + // d_sample_mem[best_correlation_index - 2] - // d_sample_mem[best_correlation_index - 1] - // d_sample_mem[best_correlation_index]; - //printf( "d_timing_adjust = %f\n", d_timing_adjust ); + // printf( "d_timing_adjust = %f\n", d_timing_adjust ); int corr_count = best_correlation_index; d_timing_adjust = -d_sample_mem[corr_count--]; - if( corr_count < 0 ) corr_count = ATSC_DATA_SEGMENT_LENGTH - 1; + if (corr_count < 0) + corr_count = ATSC_DATA_SEGMENT_LENGTH - 1; d_timing_adjust -= d_sample_mem[corr_count--]; - if( corr_count < 0 ) corr_count = ATSC_DATA_SEGMENT_LENGTH - 1; + if (corr_count < 0) + corr_count = ATSC_DATA_SEGMENT_LENGTH - 1; d_timing_adjust += d_sample_mem[corr_count--]; - if( corr_count < 0 ) corr_count = ATSC_DATA_SEGMENT_LENGTH - 1; + if (corr_count < 0) + corr_count = ATSC_DATA_SEGMENT_LENGTH - 1; d_timing_adjust += d_sample_mem[corr_count--]; d_symbol_index = SYMBOL_INDEX_OFFSET - 1 - best_correlation_index; if (d_symbol_index < 0) - d_symbol_index += ATSC_DATA_SEGMENT_LENGTH; + d_symbol_index += ATSC_DATA_SEGMENT_LENGTH; d_counter = 0; - } + } - // If we are locked we can start filling and producing data packets - // Due to the way we lock the first data packet will almost always be - // half full, this is OK because the fs_checker will not let packets though - // until a non-corrupted field packet is found - if( d_seg_locked ) { + // If we are locked we can start filling and producing data packets + // Due to the way we lock the first data packet will almost always be + // half full, this is OK because the fs_checker will not let packets though + // until a non-corrupted field packet is found + if (d_seg_locked) { d_data_mem[d_symbol_index] = interp_sample; - if( d_symbol_index >= (ATSC_DATA_SEGMENT_LENGTH - 1) ) - { - for( int i = 0; i < ATSC_DATA_SEGMENT_LENGTH; i++ ) - soft_data_segment_out[d_output_produced].data[i] = d_data_mem[i]; + if (d_symbol_index >= (ATSC_DATA_SEGMENT_LENGTH - 1)) { + for (int i = 0; i < ATSC_DATA_SEGMENT_LENGTH; i++) + soft_data_segment_out[d_output_produced].data[i] = d_data_mem[i]; d_output_produced++; - } - } - } - - consume_each(d_si); - return d_output_produced; - + } + } } - } /* namespace dtv */ + consume_each(d_si); + return d_output_produced; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_sync_impl.h b/gr-dtv/lib/atsc/atsc_sync_impl.h index cf5fccd1b3..544c554fc4 100644 --- a/gr-dtv/lib/atsc/atsc_sync_impl.h +++ b/gr-dtv/lib/atsc/atsc_sync_impl.h @@ -29,47 +29,46 @@ #include <gnuradio/filter/mmse_fir_interpolator_ff.h> namespace gr { - namespace dtv { +namespace dtv { - class atsc_sync_impl : public atsc_sync - { - private: - gr::filter::single_pole_iir<float,float,float> d_loop; // ``VCO'' loop filter - gr::filter::mmse_fir_interpolator_ff d_interp; +class atsc_sync_impl : public atsc_sync +{ +private: + gr::filter::single_pole_iir<float, float, float> d_loop; // ``VCO'' loop filter + gr::filter::mmse_fir_interpolator_ff d_interp; - double d_rx_clock_to_symbol_freq; - int d_si; - double d_w; // ratio of PERIOD of Tx to Rx clocks - double d_mu; // fractional delay [0,1] - int d_incr; + double d_rx_clock_to_symbol_freq; + int d_si; + double d_w; // ratio of PERIOD of Tx to Rx clocks + double d_mu; // fractional delay [0,1] + int d_incr; - float d_sample_mem[ATSC_DATA_SEGMENT_LENGTH]; - float d_data_mem[ATSC_DATA_SEGMENT_LENGTH]; + float d_sample_mem[ATSC_DATA_SEGMENT_LENGTH]; + float d_data_mem[ATSC_DATA_SEGMENT_LENGTH]; - double d_timing_adjust; - int d_counter; // free running mod 832 counter - int d_symbol_index; - bool d_seg_locked; - unsigned char d_sr; // 4 bit shift register - signed char d_integrator[ATSC_DATA_SEGMENT_LENGTH]; - int d_output_produced; + double d_timing_adjust; + int d_counter; // free running mod 832 counter + int d_symbol_index; + bool d_seg_locked; + unsigned char d_sr; // 4 bit shift register + signed char d_integrator[ATSC_DATA_SEGMENT_LENGTH]; + int d_output_produced; - public: - atsc_sync_impl(float rate); - ~atsc_sync_impl(); +public: + atsc_sync_impl(float rate); + ~atsc_sync_impl(); - void reset(); + void reset(); - void forecast(int noutput_items, - gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - virtual int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + virtual int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_SYNC_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.cc b/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.cc index 3252f94d31..1f474b7305 100644 --- a/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.cc +++ b/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.cc @@ -27,122 +27,119 @@ #include "gnuradio/dtv/atsc_consts.h" namespace gr { - namespace dtv { +namespace dtv { - static const int DIBITS_PER_BYTE = 4; +static const int DIBITS_PER_BYTE = 4; -#define SEGOF(x) ( (x) / ((SEGMENT_SIZE + 1) * DIBITS_PER_BYTE)) +#define SEGOF(x) ((x) / ((SEGMENT_SIZE + 1) * DIBITS_PER_BYTE)) #define SYMOF(x) (((x) % ((SEGMENT_SIZE + 1) * DIBITS_PER_BYTE)) - 4) - /* How many separate Trellis encoders / Viterbi decoders run in parallel */ - static const int NCODERS = 12; +/* How many separate Trellis encoders / Viterbi decoders run in parallel */ +static const int NCODERS = 12; #define ENCODER_SEG_BUMP 4 - /* A Segment sync symbol is an 8VSB +5,-5,-5,+5 sequence that occurs at - the start of each 207-byte segment (including field sync segments). */ -#define DSEG_SYNC_SYM1 0x06 /* +5 */ -#define DSEG_SYNC_SYM2 0x01 /* -5 */ -#define DSEG_SYNC_SYM3 0x01 /* -5 */ -#define DSEG_SYNC_SYM4 0x06 /* +5 */ - - /* Shift counts to bit numbers (high order, low order); 9x entries unused */ - static const int bit1[8] = {1, 99, 3, 98, 5, 97, 7, 96}; - static const int bit2[8] = {0, 99, 2, 98, 4, 97, 6, 96}; - - atsc_trellis_encoder::sptr - atsc_trellis_encoder::make() - { - return gnuradio::get_initial_sptr - (new atsc_trellis_encoder_impl()); - } - - atsc_trellis_encoder_impl::atsc_trellis_encoder_impl() - : gr::sync_block("atsc_trellis_encoder", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), - gr::io_signature::make(1, 1, sizeof(atsc_data_segment))) - { - reset(); - debug = false; - set_output_multiple(NCODERS); - } - - atsc_trellis_encoder_impl::~atsc_trellis_encoder_impl() - { - } - - void - atsc_trellis_encoder_impl::reset() - { - for (int i = 0; i < NCODERS; i++) { +/* A Segment sync symbol is an 8VSB +5,-5,-5,+5 sequence that occurs at + the start of each 207-byte segment (including field sync segments). */ +#define DSEG_SYNC_SYM1 0x06 /* +5 */ +#define DSEG_SYNC_SYM2 0x01 /* -5 */ +#define DSEG_SYNC_SYM3 0x01 /* -5 */ +#define DSEG_SYNC_SYM4 0x06 /* +5 */ + +/* Shift counts to bit numbers (high order, low order); 9x entries unused */ +static const int bit1[8] = { 1, 99, 3, 98, 5, 97, 7, 96 }; +static const int bit2[8] = { 0, 99, 2, 98, 4, 97, 6, 96 }; + +atsc_trellis_encoder::sptr atsc_trellis_encoder::make() +{ + return gnuradio::get_initial_sptr(new atsc_trellis_encoder_impl()); +} + +atsc_trellis_encoder_impl::atsc_trellis_encoder_impl() + : gr::sync_block("atsc_trellis_encoder", + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), + gr::io_signature::make(1, 1, sizeof(atsc_data_segment))) +{ + reset(); + debug = false; + set_output_multiple(NCODERS); +} + +atsc_trellis_encoder_impl::~atsc_trellis_encoder_impl() {} + +void atsc_trellis_encoder_impl::reset() +{ + for (int i = 0; i < NCODERS; i++) { enc[i].reset(); - } } +} - void - atsc_trellis_encoder_impl::encode(atsc_data_segment out[NCODERS], - const atsc_mpeg_packet_rs_encoded in[NCODERS]) - { - unsigned char out_copy[OUTPUT_SIZE]; - unsigned char in_copy[INPUT_SIZE]; +void atsc_trellis_encoder_impl::encode(atsc_data_segment out[NCODERS], + const atsc_mpeg_packet_rs_encoded in[NCODERS]) +{ + unsigned char out_copy[OUTPUT_SIZE]; + unsigned char in_copy[INPUT_SIZE]; - assert (sizeof (in_copy) == sizeof (in[0].data) * NCODERS); - assert (sizeof (out_copy) == sizeof (out[0].data) * NCODERS); + assert(sizeof(in_copy) == sizeof(in[0].data) * NCODERS); + assert(sizeof(out_copy) == sizeof(out[0].data) * NCODERS); - // copy input into continguous temporary buffer - for (int i = 0; i < NCODERS; i++) { + // copy input into continguous temporary buffer + for (int i = 0; i < NCODERS; i++) { assert(in[i].pli.regular_seg_p()); - plinfo::sanity_check (in[i].pli); - memcpy(&in_copy[i * INPUT_SIZE / NCODERS], &in[i].data[0], ATSC_MPEG_RS_ENCODED_LENGTH * sizeof (in_copy[0])); - } + plinfo::sanity_check(in[i].pli); + memcpy(&in_copy[i * INPUT_SIZE / NCODERS], + &in[i].data[0], + ATSC_MPEG_RS_ENCODED_LENGTH * sizeof(in_copy[0])); + } - memset(out_copy, 0, sizeof (out_copy)); // FIXME, sanity check + memset(out_copy, 0, sizeof(out_copy)); // FIXME, sanity check - // do the deed... - encode_helper(out_copy, in_copy); + // do the deed... + encode_helper(out_copy, in_copy); - // copy output from contiguous temp buffer into final output - for (int i = 0; i < NCODERS; i++) { - memcpy(&out[i].data[0], &out_copy[i * OUTPUT_SIZE / NCODERS], ATSC_DATA_SEGMENT_LENGTH * sizeof (out_copy[0])); + // copy output from contiguous temp buffer into final output + for (int i = 0; i < NCODERS; i++) { + memcpy(&out[i].data[0], + &out_copy[i * OUTPUT_SIZE / NCODERS], + ATSC_DATA_SEGMENT_LENGTH * sizeof(out_copy[0])); // copy pipeline info out[i].pli = in[i].pli; plinfo::sanity_check(out[i].pli); assert(out[i].pli.regular_seg_p()); - } } +} - /* - * This code expects contiguous arrrays. Use it as is, it computes - * the correct answer. Maybe someday, when we've run out of better - * things to do, rework to avoid the copying in encode. +/* + * This code expects contiguous arrrays. Use it as is, it computes + * the correct answer. Maybe someday, when we've run out of better + * things to do, rework to avoid the copying in encode. + */ +void atsc_trellis_encoder_impl::encode_helper(unsigned char output[OUTPUT_SIZE], + const unsigned char input[INPUT_SIZE]) +{ + int i; + int encoder; + unsigned char trellis_buffer[NCODERS]; + int trellis_wherefrom[NCODERS]; + unsigned char *out, *next_out_seg; + int chunk; + int shift; + unsigned char dibit; + unsigned char symbol; + int skip_encoder_bump; + + /* FIXME, we may want special processing here for a flag + * byte to keep track of which part of the field we're in? */ - void - atsc_trellis_encoder_impl::encode_helper(unsigned char output[OUTPUT_SIZE], - const unsigned char input[INPUT_SIZE]) - { - int i; - int encoder; - unsigned char trellis_buffer[NCODERS]; - int trellis_wherefrom[NCODERS]; - unsigned char *out, *next_out_seg; - int chunk; - int shift; - unsigned char dibit; - unsigned char symbol; - int skip_encoder_bump; - - /* FIXME, we may want special processing here for a flag - * byte to keep track of which part of the field we're in? - */ - - encoder = NCODERS - ENCODER_SEG_BUMP; - skip_encoder_bump = 0; - out = output; - next_out_seg = out; - - for (chunk = 0; chunk < INPUT_SIZE; chunk += NCODERS) { + + encoder = NCODERS - ENCODER_SEG_BUMP; + skip_encoder_bump = 0; + out = output; + next_out_seg = out; + + for (chunk = 0; chunk < INPUT_SIZE; chunk += NCODERS) { /* Load a new chunk of bytes into the Trellis encoder buffers. * They get loaded in an order that depends on where we are in * the segment sync progress (sigh). @@ -151,93 +148,100 @@ namespace gr { * rather than LATER during the bitshift transition!!! */ if (out >= next_out_seg) { - encoder = (encoder + ENCODER_SEG_BUMP) % NCODERS; - skip_encoder_bump = 1; + encoder = (encoder + ENCODER_SEG_BUMP) % NCODERS; + skip_encoder_bump = 1; } for (i = 0; i < NCODERS; i++) { - /* for debug */ - trellis_wherefrom[encoder] = chunk + i; - trellis_buffer[encoder] = input [chunk + i]; - encoder++; - if (encoder >= NCODERS) { - encoder = 0; - } - } - - for (shift = 6; shift >= 0; shift -= 2) { - /* Segment boundaries happen to occur on some bitshift transitions. */ - if (out >= next_out_seg) { - /* Segment transition. Output a data segment sync symbol, - * and mess with the trellis encoder mux. - */ - *out++ = DSEG_SYNC_SYM1; - *out++ = DSEG_SYNC_SYM2; - *out++ = DSEG_SYNC_SYM3; - *out++ = DSEG_SYNC_SYM4; - if (debug) { - printf("SYNC SYNC SYNC SYNC\n"); - } - - next_out_seg = out + (SEGMENT_SIZE * DIBITS_PER_BYTE); - - if (!skip_encoder_bump) { - encoder = (encoder + ENCODER_SEG_BUMP) % NCODERS; - } - skip_encoder_bump = 0; - } - - /* Now run each of the 12 Trellis encoders to spit out 12 symbols. - * Each encoder takes input from the same byte of the chunk, but - * the outputs of the encoders come out in various orders. - * NOPE -- this is false. The encoders take input from various - * bytes of the chunk (which changes at segment sync time), AND - * they also come out in various orders. You really do have to - * keep separate track of: the input bytes, the encoders, and - * the output bytes -- because they're all moving with respect - * to each other!!! - */ - for (i = 0; i < NCODERS; i++) { - dibit = 0x03 & (trellis_buffer[encoder] >> shift); - if (debug) { - printf("Seg %ld Symb %3ld Trell %2d Byte %6d Bits %d-%d = dibit %d ", (long) SEGOF(out-output), (long) SYMOF(out-output), encoder, trellis_wherefrom[encoder], bit1[shift], bit2[shift], dibit); - } - - symbol = enc[encoder].encode(dibit); - *out++ = symbol; + /* for debug */ + trellis_wherefrom[encoder] = chunk + i; + trellis_buffer[encoder] = input[chunk + i]; encoder++; if (encoder >= NCODERS) { - encoder = 0; - } - if (debug) { - printf("sym %d\n", symbol); + encoder = 0; } + } - } /* Encoders */ - } /* Bit shifts */ - } /* Chunks */ - - /* Check up on ourselves */ - assert (0 == (INPUT_SIZE * DIBITS_PER_BYTE) % NCODERS); - assert (OUTPUT_SIZE == out - output); - assert (NCODERS - ENCODER_SEG_BUMP == encoder); - } - - int - atsc_trellis_encoder_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet_rs_encoded *in = (const atsc_mpeg_packet_rs_encoded *) input_items[0]; - atsc_data_segment *out = (atsc_data_segment *) output_items[0]; + for (shift = 6; shift >= 0; shift -= 2) { + /* Segment boundaries happen to occur on some bitshift transitions. */ + if (out >= next_out_seg) { + /* Segment transition. Output a data segment sync symbol, + * and mess with the trellis encoder mux. + */ + *out++ = DSEG_SYNC_SYM1; + *out++ = DSEG_SYNC_SYM2; + *out++ = DSEG_SYNC_SYM3; + *out++ = DSEG_SYNC_SYM4; + if (debug) { + printf("SYNC SYNC SYNC SYNC\n"); + } + + next_out_seg = out + (SEGMENT_SIZE * DIBITS_PER_BYTE); + + if (!skip_encoder_bump) { + encoder = (encoder + ENCODER_SEG_BUMP) % NCODERS; + } + skip_encoder_bump = 0; + } - for (int i = 0; i < noutput_items; i += NCODERS) { + /* Now run each of the 12 Trellis encoders to spit out 12 symbols. + * Each encoder takes input from the same byte of the chunk, but + * the outputs of the encoders come out in various orders. + * NOPE -- this is false. The encoders take input from various + * bytes of the chunk (which changes at segment sync time), AND + * they also come out in various orders. You really do have to + * keep separate track of: the input bytes, the encoders, and + * the output bytes -- because they're all moving with respect + * to each other!!! + */ + for (i = 0; i < NCODERS; i++) { + dibit = 0x03 & (trellis_buffer[encoder] >> shift); + if (debug) { + printf("Seg %ld Symb %3ld Trell %2d Byte %6d Bits %d-%d = dibit %d ", + (long)SEGOF(out - output), + (long)SYMOF(out - output), + encoder, + trellis_wherefrom[encoder], + bit1[shift], + bit2[shift], + dibit); + } + + symbol = enc[encoder].encode(dibit); + *out++ = symbol; + encoder++; + if (encoder >= NCODERS) { + encoder = 0; + } + if (debug) { + printf("sym %d\n", symbol); + } + + } /* Encoders */ + } /* Bit shifts */ + } /* Chunks */ + + /* Check up on ourselves */ + assert(0 == (INPUT_SIZE * DIBITS_PER_BYTE) % NCODERS); + assert(OUTPUT_SIZE == out - output); + assert(NCODERS - ENCODER_SEG_BUMP == encoder); +} + +int atsc_trellis_encoder_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet_rs_encoded* in = + (const atsc_mpeg_packet_rs_encoded*)input_items[0]; + atsc_data_segment* out = (atsc_data_segment*)output_items[0]; + + for (int i = 0; i < noutput_items; i += NCODERS) { encode(&out[i], &in[i]); - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ + // Tell runtime system how many output items we produced. + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.h b/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.h index 054a3aca3b..914d7b1ff3 100644 --- a/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.h +++ b/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.h @@ -26,34 +26,36 @@ #include "atsc_types.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_trellis_encoder_impl : public atsc_trellis_encoder - { - private: - bool debug; +class atsc_trellis_encoder_impl : public atsc_trellis_encoder +{ +private: + bool debug; - static const int NCODERS = 12; - static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; - static const int INPUT_SIZE = (SEGMENT_SIZE * 12); - static const int OUTPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12); + static const int NCODERS = 12; + static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; + static const int INPUT_SIZE = (SEGMENT_SIZE * 12); + static const int OUTPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12); - void reset(); - void encode(atsc_data_segment out[NCODERS], const atsc_mpeg_packet_rs_encoded in[NCODERS]); - void encode_helper(unsigned char output[OUTPUT_SIZE], const unsigned char input[INPUT_SIZE]); + void reset(); + void encode(atsc_data_segment out[NCODERS], + const atsc_mpeg_packet_rs_encoded in[NCODERS]); + void encode_helper(unsigned char output[OUTPUT_SIZE], + const unsigned char input[INPUT_SIZE]); - atsc_basic_trellis_encoder enc[NCODERS]; + atsc_basic_trellis_encoder enc[NCODERS]; - public: - atsc_trellis_encoder_impl(); - ~atsc_trellis_encoder_impl(); +public: + atsc_trellis_encoder_impl(); + ~atsc_trellis_encoder_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_TRELLIS_ENCODER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_types.h b/gr-dtv/lib/atsc/atsc_types.h index e9f82bae8c..f1202d29e6 100644 --- a/gr-dtv/lib/atsc/atsc_types.h +++ b/gr-dtv/lib/atsc/atsc_types.h @@ -28,242 +28,259 @@ #include <cassert> namespace gr { - namespace dtv { +namespace dtv { - /*! - * \brief pipeline info that flows with data - * - * Not all modules need all the info - */ - class plinfo { - public: - plinfo () : _flags (0), _segno (0) { } +/*! + * \brief pipeline info that flows with data + * + * Not all modules need all the info + */ +class plinfo +{ +public: + plinfo() : _flags(0), _segno(0) {} - // accessors + // accessors - bool field_sync1_p () const { return (_flags & fl_field_sync1) != 0; } - bool field_sync2_p () const { return (_flags & fl_field_sync2) != 0; } - bool field_sync_p () const { return field_sync1_p () || field_sync2_p (); } + bool field_sync1_p() const { return (_flags & fl_field_sync1) != 0; } + bool field_sync2_p() const { return (_flags & fl_field_sync2) != 0; } + bool field_sync_p() const { return field_sync1_p() || field_sync2_p(); } - bool regular_seg_p () const { return (_flags & fl_regular_seg) != 0; } + bool regular_seg_p() const { return (_flags & fl_regular_seg) != 0; } - bool in_field1_p () const { return (_flags & fl_field2) == 0; } - bool in_field2_p () const { return (_flags & fl_field2) != 0; } + bool in_field1_p() const { return (_flags & fl_field2) == 0; } + bool in_field2_p() const { return (_flags & fl_field2) != 0; } - bool first_regular_seg_p () const { return (_flags & fl_first_regular_seg) != 0; } + bool first_regular_seg_p() const { return (_flags & fl_first_regular_seg) != 0; } - bool transport_error_p () const { return (_flags & fl_transport_error) != 0; } + bool transport_error_p() const { return (_flags & fl_transport_error) != 0; } - unsigned int segno () const { return _segno; } - unsigned int flags () const { return _flags; } + unsigned int segno() const { return _segno; } + unsigned int flags() const { return _flags; } - // setters + // setters - void set_field_sync1 () - { + void set_field_sync1() + { _segno = 0; _flags = fl_field_sync1; - } + } - void set_field_sync2 () - { + void set_field_sync2() + { _segno = 0; _flags = fl_field_sync2 | fl_field2; - } + } - void set_regular_seg (bool field2, int segno) - { - //assert (0 <= segno && segno < ATSC_DSEGS_PER_FIELD); + void set_regular_seg(bool field2, int segno) + { + // assert (0 <= segno && segno < ATSC_DSEGS_PER_FIELD); _segno = segno; _flags = fl_regular_seg; if (segno == 0) - _flags |= fl_first_regular_seg; + _flags |= fl_first_regular_seg; if (segno >= ATSC_DSEGS_PER_FIELD) - _flags |= fl_transport_error; + _flags |= fl_transport_error; if (field2) - _flags |= fl_field2; - } + _flags |= fl_field2; + } - void set_transport_error (bool error){ + void set_transport_error(bool error) + { if (error) - _flags |= fl_transport_error; + _flags |= fl_transport_error; else - _flags &= ~fl_transport_error; - } + _flags &= ~fl_transport_error; + } - // overload equality operator - bool operator== (const plinfo &other) const { + // overload equality operator + bool operator==(const plinfo& other) const + { return (_flags == other._flags && _segno == other._segno); - } + } - bool operator!= (const plinfo &other) const { + bool operator!=(const plinfo& other) const + { return !(_flags == other._flags && _segno == other._segno); - } + } - /*! - * Set \p OUT such that it reflects a \p NSEGS_OF_DELAY - * pipeline delay from \p IN. - */ - static void delay (plinfo &out, const plinfo &in, int nsegs_of_delay) - { - assert (in.regular_seg_p ()); - assert (nsegs_of_delay >= 0); + /*! + * Set \p OUT such that it reflects a \p NSEGS_OF_DELAY + * pipeline delay from \p IN. + */ + static void delay(plinfo& out, const plinfo& in, int nsegs_of_delay) + { + assert(in.regular_seg_p()); + assert(nsegs_of_delay >= 0); - int s = in.segno (); - if (in.in_field2_p ()) - s += ATSC_DSEGS_PER_FIELD; + int s = in.segno(); + if (in.in_field2_p()) + s += ATSC_DSEGS_PER_FIELD; s -= nsegs_of_delay; if (s < 0) - s += 2 * ATSC_DSEGS_PER_FIELD; + s += 2 * ATSC_DSEGS_PER_FIELD; - //assert (0 <= s && s < 2 * ATSC_DSEGS_PER_FIELD); + // assert (0 <= s && s < 2 * ATSC_DSEGS_PER_FIELD); if (s < ATSC_DSEGS_PER_FIELD) - out.set_regular_seg (false, s); // field 1 + out.set_regular_seg(false, s); // field 1 else - out.set_regular_seg (true, s - ATSC_DSEGS_PER_FIELD); // field 2 - } - - /*! - * confirm that \p X is plausible - */ - static void sanity_check (const plinfo &in) - { - // basic sanity checks... - //assert (x.segno () >= 0); - //assert (x.segno () < (unsigned) ATSC_DSEGS_PER_FIELD); - //assert ((x.flags () & ~0x3f) == 0); - - //assert (x.regular_seg_p () ^ x.field_sync_p ()); - //assert ((x.segno () != 0) ^ x.first_regular_seg_p ()); - } - - unsigned short _flags; // bitmask - short _segno; // segment number [-1,311] -1 is the field sync segment - - protected: - // these three are mutually exclusive - // This is a regular data segment. - static const int fl_regular_seg = 0x0001; - // This is a field sync segment, for 1st half of a field. - static const int fl_field_sync1 = 0x0002; - // This is a field sync segment, for 2nd half of a field. - static const int fl_field_sync2 = 0x0004; - - // This bit is on ONLY when fl_regular_seg is set AND when this is - // the first regular data segment AFTER a field sync segment. This - // segment causes various processing modules to reset. - static const int fl_first_regular_seg = 0x0008; - - // which field are we in? - static const int fl_field2 = 0x0010; // else field 1 - - // This bit is set when Reed-Solomon decoding detects an error that it - // can't correct. Note that other error detection (e.g. Viterbi) do not - // set it, since Reed-Solomon will correct many of those. This bit is - // then copied into the final Transport Stream packet so that MPEG - // software can see that the 188-byte data segment has been corrupted. - static const int fl_transport_error = 0x0020; - }; - - - - - class atsc_mpeg_packet { - public: - static const int NPAD = 68; - unsigned char data[ATSC_MPEG_DATA_LENGTH + 1]; // first byte is sync - unsigned char _pad_[NPAD]; // pad to power of 2 (256) - - // overload equality operator - bool operator== (const atsc_mpeg_packet &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - }; - - bool operator!= (const atsc_mpeg_packet &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - }; - }; - - class atsc_mpeg_packet_no_sync { - public: - static const int NPAD = 65; - plinfo pli; - unsigned char data[ATSC_MPEG_DATA_LENGTH]; - unsigned char _pad_[NPAD]; // pad to power of 2 (256) - - // overload equality operator - bool operator== (const atsc_mpeg_packet_no_sync &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - } - - bool operator!= (const atsc_mpeg_packet_no_sync &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - } - }; - - class atsc_mpeg_packet_rs_encoded { - public: - static const int NPAD = 45; - plinfo pli; - unsigned char data[ATSC_MPEG_RS_ENCODED_LENGTH]; - unsigned char _pad_[NPAD]; // pad to power of 2 (256) - - // overload equality operator - bool operator== (const atsc_mpeg_packet_rs_encoded &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - } - - bool operator!= (const atsc_mpeg_packet_rs_encoded &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - } - }; - - - //! contains 832 3 bit symbols. The low 3 bits in the byte hold the symbol. - - class atsc_data_segment { - public: - static const int NPAD = 188; - plinfo pli; - unsigned char data[ATSC_DATA_SEGMENT_LENGTH]; - unsigned char _pad_[NPAD]; // pad to power of 2 (1024) - - // overload equality operator - bool operator== (const atsc_data_segment &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - } - - bool operator!= (const atsc_data_segment &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - } - }; + out.set_regular_seg(true, s - ATSC_DSEGS_PER_FIELD); // field 2 + } /*! - * Contains 832 bipolar floating point symbols. - * Nominal values are +/- {1, 3, 5, 7}. - * This data type represents the input to the viterbi decoder. + * confirm that \p X is plausible */ + static void sanity_check(const plinfo& in) + { + // basic sanity checks... + // assert (x.segno () >= 0); + // assert (x.segno () < (unsigned) ATSC_DSEGS_PER_FIELD); + // assert ((x.flags () & ~0x3f) == 0); + + // assert (x.regular_seg_p () ^ x.field_sync_p ()); + // assert ((x.segno () != 0) ^ x.first_regular_seg_p ()); + } + + unsigned short _flags; // bitmask + short _segno; // segment number [-1,311] -1 is the field sync segment + +protected: + // these three are mutually exclusive + // This is a regular data segment. + static const int fl_regular_seg = 0x0001; + // This is a field sync segment, for 1st half of a field. + static const int fl_field_sync1 = 0x0002; + // This is a field sync segment, for 2nd half of a field. + static const int fl_field_sync2 = 0x0004; + + // This bit is on ONLY when fl_regular_seg is set AND when this is + // the first regular data segment AFTER a field sync segment. This + // segment causes various processing modules to reset. + static const int fl_first_regular_seg = 0x0008; + + // which field are we in? + static const int fl_field2 = 0x0010; // else field 1 + + // This bit is set when Reed-Solomon decoding detects an error that it + // can't correct. Note that other error detection (e.g. Viterbi) do not + // set it, since Reed-Solomon will correct many of those. This bit is + // then copied into the final Transport Stream packet so that MPEG + // software can see that the 188-byte data segment has been corrupted. + static const int fl_transport_error = 0x0020; +}; + + +class atsc_mpeg_packet +{ +public: + static const int NPAD = 68; + unsigned char data[ATSC_MPEG_DATA_LENGTH + 1]; // first byte is sync + unsigned char _pad_[NPAD]; // pad to power of 2 (256) + + // overload equality operator + bool operator==(const atsc_mpeg_packet& other) const + { + return std::memcmp(data, other.data, sizeof(data)) == 0; + }; - class atsc_soft_data_segment { - public: - static const int NPAD = 764; - plinfo pli; - float data[ATSC_DATA_SEGMENT_LENGTH]; - unsigned char _pad_[NPAD]; // pad to power of 2 (4096) - - // overload equality operator - bool operator== (const atsc_data_segment &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - } - - bool operator!= (const atsc_data_segment &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - } + bool operator!=(const atsc_mpeg_packet& other) const + { + return !(std::memcmp(data, other.data, sizeof(data)) == 0); }; +}; + +class atsc_mpeg_packet_no_sync +{ +public: + static const int NPAD = 65; + plinfo pli; + unsigned char data[ATSC_MPEG_DATA_LENGTH]; + unsigned char _pad_[NPAD]; // pad to power of 2 (256) + + // overload equality operator + bool operator==(const atsc_mpeg_packet_no_sync& other) const + { + return std::memcmp(data, other.data, sizeof(data)) == 0; + } + + bool operator!=(const atsc_mpeg_packet_no_sync& other) const + { + return !(std::memcmp(data, other.data, sizeof(data)) == 0); + } +}; + +class atsc_mpeg_packet_rs_encoded +{ +public: + static const int NPAD = 45; + plinfo pli; + unsigned char data[ATSC_MPEG_RS_ENCODED_LENGTH]; + unsigned char _pad_[NPAD]; // pad to power of 2 (256) + + // overload equality operator + bool operator==(const atsc_mpeg_packet_rs_encoded& other) const + { + return std::memcmp(data, other.data, sizeof(data)) == 0; + } + + bool operator!=(const atsc_mpeg_packet_rs_encoded& other) const + { + return !(std::memcmp(data, other.data, sizeof(data)) == 0); + } +}; + + +//! contains 832 3 bit symbols. The low 3 bits in the byte hold the symbol. + +class atsc_data_segment +{ +public: + static const int NPAD = 188; + plinfo pli; + unsigned char data[ATSC_DATA_SEGMENT_LENGTH]; + unsigned char _pad_[NPAD]; // pad to power of 2 (1024) + + // overload equality operator + bool operator==(const atsc_data_segment& other) const + { + return std::memcmp(data, other.data, sizeof(data)) == 0; + } + + bool operator!=(const atsc_data_segment& other) const + { + return !(std::memcmp(data, other.data, sizeof(data)) == 0); + } +}; + +/*! + * Contains 832 bipolar floating point symbols. + * Nominal values are +/- {1, 3, 5, 7}. + * This data type represents the input to the viterbi decoder. + */ - } /* namespace dtv */ +class atsc_soft_data_segment +{ +public: + static const int NPAD = 764; + plinfo pli; + float data[ATSC_DATA_SEGMENT_LENGTH]; + unsigned char _pad_[NPAD]; // pad to power of 2 (4096) + + // overload equality operator + bool operator==(const atsc_data_segment& other) const + { + return std::memcmp(data, other.data, sizeof(data)) == 0; + } + + bool operator!=(const atsc_data_segment& other) const + { + return !(std::memcmp(data, other.data, sizeof(data)) == 0); + } +}; + +} /* namespace dtv */ } /* namespace gr */ #endif /* _ATSC_TYPES_H_ */ diff --git a/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.cc b/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.cc index bf1e86c9f8..a30c5663d1 100644 --- a/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.cc +++ b/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.cc @@ -30,135 +30,134 @@ #include "atsc_viterbi_mux.h" namespace gr { - namespace dtv { - - atsc_viterbi_decoder::sptr - atsc_viterbi_decoder::make() - { - return gnuradio::get_initial_sptr - (new atsc_viterbi_decoder_impl()); - } - - atsc_viterbi_decoder_impl::atsc_viterbi_decoder_impl() - : sync_block("dtv_atsc_viterbi_decoder", - io_signature::make(1, 1, sizeof(atsc_soft_data_segment)), - io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) - { - set_output_multiple(NCODERS); - - /* - * These fifo's handle the alignment problem caused by the - * inherent decoding delay of the individual viterbi decoders. - * The net result is that this entire block has a pipeline latency - * of 12 complete segments. - * - * If anybody cares, it is possible to do it with less delay, but - * this approach is at least somewhat understandable... - */ - - // the -4 is for the 4 sync symbols - int fifo_size = ATSC_DATA_SEGMENT_LENGTH - 4 - viterbi[0].delay(); - for (int i = 0; i < NCODERS; i++) +namespace dtv { + +atsc_viterbi_decoder::sptr atsc_viterbi_decoder::make() +{ + return gnuradio::get_initial_sptr(new atsc_viterbi_decoder_impl()); +} + +atsc_viterbi_decoder_impl::atsc_viterbi_decoder_impl() + : sync_block("dtv_atsc_viterbi_decoder", + io_signature::make(1, 1, sizeof(atsc_soft_data_segment)), + io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) +{ + set_output_multiple(NCODERS); + + /* + * These fifo's handle the alignment problem caused by the + * inherent decoding delay of the individual viterbi decoders. + * The net result is that this entire block has a pipeline latency + * of 12 complete segments. + * + * If anybody cares, it is possible to do it with less delay, but + * this approach is at least somewhat understandable... + */ + + // the -4 is for the 4 sync symbols + int fifo_size = ATSC_DATA_SEGMENT_LENGTH - 4 - viterbi[0].delay(); + for (int i = 0; i < NCODERS; i++) fifo[i] = new fifo_t(fifo_size); - reset(); - } + reset(); +} - atsc_viterbi_decoder_impl::~atsc_viterbi_decoder_impl() - { - for (int i = 0; i < NCODERS; i++) +atsc_viterbi_decoder_impl::~atsc_viterbi_decoder_impl() +{ + for (int i = 0; i < NCODERS; i++) delete fifo[i]; - } +} - void - atsc_viterbi_decoder_impl::reset() - { - for (int i = 0; i < NCODERS; i++) +void atsc_viterbi_decoder_impl::reset() +{ + for (int i = 0; i < NCODERS; i++) fifo[i]->reset(); - } +} - std::vector<float> - atsc_viterbi_decoder_impl::decoder_metrics() const - { - std::vector<float> metrics(NCODERS); - for (int i = 0; i < NCODERS; i++) +std::vector<float> atsc_viterbi_decoder_impl::decoder_metrics() const +{ + std::vector<float> metrics(NCODERS); + for (int i = 0; i < NCODERS; i++) metrics[i] = viterbi[i].best_state_metric(); - return metrics; - } - - int - atsc_viterbi_decoder_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_soft_data_segment *in = (const atsc_soft_data_segment *) input_items[0]; - atsc_mpeg_packet_rs_encoded *out = (atsc_mpeg_packet_rs_encoded *) output_items[0]; - - // The way the fs_checker works ensures we start getting packets - // starting with a field sync, and out input multiple is set to - // 12, so we should always get a mod 12 numbered first packet - assert(noutput_items % NCODERS == 0); - - int dbwhere; - int dbindex; - int shift; - float symbols[NCODERS][enco_which_max]; - unsigned char dibits[NCODERS][enco_which_max]; - - unsigned char out_copy[OUTPUT_SIZE]; - - for (int i = 0; i < noutput_items; i += NCODERS) { + return metrics; +} + +int atsc_viterbi_decoder_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_soft_data_segment* in = (const atsc_soft_data_segment*)input_items[0]; + atsc_mpeg_packet_rs_encoded* out = (atsc_mpeg_packet_rs_encoded*)output_items[0]; + + // The way the fs_checker works ensures we start getting packets + // starting with a field sync, and out input multiple is set to + // 12, so we should always get a mod 12 numbered first packet + assert(noutput_items % NCODERS == 0); + + int dbwhere; + int dbindex; + int shift; + float symbols[NCODERS][enco_which_max]; + unsigned char dibits[NCODERS][enco_which_max]; + + unsigned char out_copy[OUTPUT_SIZE]; + + for (int i = 0; i < noutput_items; i += NCODERS) { /* Build a continuous symbol buffer for each encoder */ for (unsigned int encoder = 0; encoder < NCODERS; encoder++) - for (unsigned int k = 0; k < enco_which_max; k++) - symbols[encoder][k] = in[i + (enco_which_syms[encoder][k]/832)].data[enco_which_syms[encoder][k] % 832]; + for (unsigned int k = 0; k < enco_which_max; k++) + symbols[encoder][k] = in[i + (enco_which_syms[encoder][k] / 832)] + .data[enco_which_syms[encoder][k] % 832]; /* Now run each of the 12 Viterbi decoders over their subset of the input symbols */ for (unsigned int encoder = 0; encoder < NCODERS; encoder++) - for (unsigned int k = 0; k < enco_which_max; k++) - dibits[encoder][k] = viterbi[encoder].decode(symbols[encoder][k]); + for (unsigned int k = 0; k < enco_which_max; k++) + dibits[encoder][k] = viterbi[encoder].decode(symbols[encoder][k]); /* Move dibits into their location in the output buffer */ for (unsigned int encoder = 0; encoder < NCODERS; encoder++) { - for (unsigned int k = 0; k < enco_which_max; k++) { - /* Store the dibit into the output data segment */ - dbwhere = enco_which_dibits[encoder][k]; - dbindex = dbwhere >> 3; - shift = dbwhere & 0x7; - out_copy[dbindex] = (out_copy[dbindex] & ~(0x03 << shift)) | (fifo[encoder]->stuff(dibits[encoder][k]) << shift); - } /* Symbols fed into one encoder */ - } /* Encoders */ + for (unsigned int k = 0; k < enco_which_max; k++) { + /* Store the dibit into the output data segment */ + dbwhere = enco_which_dibits[encoder][k]; + dbindex = dbwhere >> 3; + shift = dbwhere & 0x7; + out_copy[dbindex] = (out_copy[dbindex] & ~(0x03 << shift)) | + (fifo[encoder]->stuff(dibits[encoder][k]) << shift); + } /* Symbols fed into one encoder */ + } /* Encoders */ // copy output from contiguous temp buffer into final output for (int j = 0; j < NCODERS; j++) { - memcpy (&out[i + j].data[0], - &out_copy[j * OUTPUT_SIZE/NCODERS], - ATSC_MPEG_RS_ENCODED_LENGTH * sizeof(out_copy[0])); + memcpy(&out[i + j].data[0], + &out_copy[j * OUTPUT_SIZE / NCODERS], + ATSC_MPEG_RS_ENCODED_LENGTH * sizeof(out_copy[0])); - // adjust pipeline info to reflect 12 segment delay - plinfo::delay(out[i + j].pli, in[i + j].pli, NCODERS); + // adjust pipeline info to reflect 12 segment delay + plinfo::delay(out[i + j].pli, in[i + j].pli, NCODERS); } - } - - return noutput_items; } - void - atsc_viterbi_decoder_impl::setup_rpc() - { + return noutput_items; +} + +void atsc_viterbi_decoder_impl::setup_rpc() +{ #ifdef GR_CTRLPORT - add_rpc_variable( - rpcbasic_sptr(new rpcbasic_register_get<atsc_viterbi_decoder, std::vector<float> >( - alias(), "decoder_metrics", - &atsc_viterbi_decoder::decoder_metrics, - pmt::make_f32vector(1,0), - pmt::make_f32vector(1,100000), - pmt::make_f32vector(1,0), - "", "Viterbi decoder metrics", RPC_PRIVLVL_MIN, - DISPTIME))); + add_rpc_variable( + rpcbasic_sptr(new rpcbasic_register_get<atsc_viterbi_decoder, std::vector<float>>( + alias(), + "decoder_metrics", + &atsc_viterbi_decoder::decoder_metrics, + pmt::make_f32vector(1, 0), + pmt::make_f32vector(1, 100000), + pmt::make_f32vector(1, 0), + "", + "Viterbi decoder metrics", + RPC_PRIVLVL_MIN, + DISPTIME))); #endif /* GR_CTRLPORT */ - } +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.h b/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.h index e52aea7fa0..f5420ef259 100644 --- a/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.h +++ b/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.h @@ -28,7 +28,7 @@ #include "atsc_syminfo_impl.h" #include "atsc_interleaver_fifo.h" -#define USE_SIMPLE_SLICER 0 +#define USE_SIMPLE_SLICER 0 #define NCODERS 12 #if USE_SIMPLE_SLICER @@ -38,42 +38,42 @@ #endif namespace gr { - namespace dtv { +namespace dtv { #if USE_SIMPLE_SLICER - typedef atsc_fake_single_viterbi single_viterbi_t; +typedef atsc_fake_single_viterbi single_viterbi_t; #else - typedef atsc_single_viterbi single_viterbi_t; +typedef atsc_single_viterbi single_viterbi_t; #endif - class atsc_viterbi_decoder_impl : public atsc_viterbi_decoder - { - private: - typedef interleaver_fifo<unsigned char> fifo_t; +class atsc_viterbi_decoder_impl : public atsc_viterbi_decoder +{ +private: + typedef interleaver_fifo<unsigned char> fifo_t; - static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; // 207 - static const int OUTPUT_SIZE = (SEGMENT_SIZE * 12); - static const int INPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12); + static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; // 207 + static const int OUTPUT_SIZE = (SEGMENT_SIZE * 12); + static const int INPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12); - single_viterbi_t viterbi[NCODERS]; - fifo_t *fifo[NCODERS]; + single_viterbi_t viterbi[NCODERS]; + fifo_t* fifo[NCODERS]; - public: - atsc_viterbi_decoder_impl(); - ~atsc_viterbi_decoder_impl(); +public: + atsc_viterbi_decoder_impl(); + ~atsc_viterbi_decoder_impl(); - void setup_rpc(); + void setup_rpc(); - void reset(); + void reset(); - std::vector<float> decoder_metrics() const; + std::vector<float> decoder_metrics() const; - virtual int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + virtual int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_VITERBI_DECODER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_viterbi_gen.cc b/gr-dtv/lib/atsc/atsc_viterbi_gen.cc index bff3c47736..b19d2da018 100644 --- a/gr-dtv/lib/atsc/atsc_viterbi_gen.cc +++ b/gr-dtv/lib/atsc/atsc_viterbi_gen.cc @@ -53,20 +53,20 @@ using std::cerr; this incredible complexity buys us anything subtle and important. */ -#define SEGMENT_SIZE 207 -#define INPUT_SIZE (SEGMENT_SIZE * 12) -#define DIBITS_PER_BYTE 4 -#define EXTRAS (4 * 12) /* FIXME, sync symbols and such */ -#define SYMBOLS_OUT ((INPUT_SIZE * DIBITS_PER_BYTE) + EXTRAS) -#define SEGOF(x) ( (x) / ((SEGMENT_SIZE+1) * DIBITS_PER_BYTE)) -#define SYMOF(x) (((x) % ((SEGMENT_SIZE+1) * DIBITS_PER_BYTE))-4) -#define ENCODERS 12 -#define ENCODER_SEG_BUMP 4 +#define SEGMENT_SIZE 207 +#define INPUT_SIZE (SEGMENT_SIZE * 12) +#define DIBITS_PER_BYTE 4 +#define EXTRAS (4 * 12) /* FIXME, sync symbols and such */ +#define SYMBOLS_OUT ((INPUT_SIZE * DIBITS_PER_BYTE) + EXTRAS) +#define SEGOF(x) ((x) / ((SEGMENT_SIZE + 1) * DIBITS_PER_BYTE)) +#define SYMOF(x) (((x) % ((SEGMENT_SIZE + 1) * DIBITS_PER_BYTE)) - 4) +#define ENCODERS 12 +#define ENCODER_SEG_BUMP 4 /* Shift counts to bit numbers (high order, low order); 9x entries unused */ -static const int bit1[8] = {1, 99, 3, 98, 5, 97, 7, 96}; -static const int bit2[8] = {0, 99, 2, 98, 4, 97, 6, 96}; +static const int bit1[8] = { 1, 99, 3, 98, 5, 97, 7, 96 }; +static const int bit2[8] = { 0, 99, 2, 98, 4, 97, 6, 96 }; /* Detailed Debugging */ int debug_dec = 0; @@ -75,106 +75,109 @@ int debug_dec = 0; * Build indirect data structures to say which symbols go into which * encoder, and then where the resulting dibits from the encoders go. */ -int -build_decode_structures (char *fileout) +int build_decode_structures(char* fileout) { - int retval = 0; - int i; - int encoder; - int trellis_wheredata[ENCODERS]; - unsigned char *symp, *next_sym_seg; - unsigned char symbols[SYMBOLS_OUT]; - int chunk; - int shift; - int skip_encoder_bump; - int *enco_syms[ENCODERS]; - int *enco_dibits[ENCODERS]; - int j; - /* The data structures we'll build and then spit out... */ - int sync_symbol_indices[1000]; - int sync_symbol_indices_max; - int enco_which_syms[ENCODERS][INPUT_SIZE]; - int enco_which_dibits[ENCODERS][INPUT_SIZE]; - int enco_which_max; - #define BIT_PTR(int,shif) (((int) << 3) | ((shif) & 0x7)) - /* Running indices into them as we build 'em... */ - int *syncsyms = sync_symbol_indices; - - /* Start our running pointers at the start of our per-encoder subarrays */ - for (i = 0; i < ENCODERS; i++) { - enco_dibits[i] = enco_which_dibits[i]; - enco_syms[i] = enco_which_syms[i]; - } - - encoder = ENCODERS - ENCODER_SEG_BUMP; - skip_encoder_bump = 0; - symp = symbols; - next_sym_seg = symp; - - for (chunk = 0; - chunk < INPUT_SIZE; - chunk += ENCODERS) { - /* Associate data bytes with the Trellis encoders. - They get loaded or stored in an order that depends on where we are in the - segment sync progress (sigh). - GRR! When the chunk reload happens at the same time as the - segment boundary, we should bump the encoder NOW for the reload, - rather than LATER during the bitshift transition!!! */ - if (symp >= next_sym_seg) { - encoder = (encoder + ENCODER_SEG_BUMP) % ENCODERS; - skip_encoder_bump = 1; - } - - /* Remember where the data bytes are going to go, once we've - accumulated them from the 12 interleaved decoders */ + int retval = 0; + int i; + int encoder; + int trellis_wheredata[ENCODERS]; + unsigned char *symp, *next_sym_seg; + unsigned char symbols[SYMBOLS_OUT]; + int chunk; + int shift; + int skip_encoder_bump; + int* enco_syms[ENCODERS]; + int* enco_dibits[ENCODERS]; + int j; + /* The data structures we'll build and then spit out... */ + int sync_symbol_indices[1000]; + int sync_symbol_indices_max; + int enco_which_syms[ENCODERS][INPUT_SIZE]; + int enco_which_dibits[ENCODERS][INPUT_SIZE]; + int enco_which_max; +#define BIT_PTR(int, shif) (((int) << 3) | ((shif)&0x7)) + /* Running indices into them as we build 'em... */ + int* syncsyms = sync_symbol_indices; + + /* Start our running pointers at the start of our per-encoder subarrays */ for (i = 0; i < ENCODERS; i++) { - trellis_wheredata[encoder] = chunk+i; - encoder++; - if (encoder >= ENCODERS) encoder = 0; + enco_dibits[i] = enco_which_dibits[i]; + enco_syms[i] = enco_which_syms[i]; } - for (shift = 6; shift >= 0; shift -= 2) { - - /* Segment boundaries happen to occur on some bitshift transitions. */ - if (symp >= next_sym_seg) { - /* Segment transition. Output a data segment sync symbol, and - mess with the trellis encoder mux. */ - *syncsyms++ = symp - symbols; - symp += 4; - next_sym_seg = symp + (SEGMENT_SIZE * DIBITS_PER_BYTE); - - if (!skip_encoder_bump) - encoder = (encoder + ENCODER_SEG_BUMP) % ENCODERS; - skip_encoder_bump = 0; - } - - /* Now run each of the 12 Trellis encoders to spit out 12 symbols. - Each encoder takes input from the same byte of the chunk, but the - outputs of the encoders come out in various orders. - NOPE -- this is false. The encoders take input from various - bytes of the chunk (which changes at segment sync time), AND - they also come out in various orders. You really do have to - keep separate track of: the datasegs bytes, the encoders, and - the symbol bytes -- because they're all moving with respect to - each other!!! */ - for (i = 0; i < ENCODERS; i++) { - if (debug_dec) - printf ("Seg %ld Symb %3ld Trell %2d Byte %6d Bits %d-%d = ", - (long) SEGOF(symp-symbols), (long) SYMOF(symp-symbols), - encoder, trellis_wheredata[encoder], - bit1[shift], bit2[shift]); - - /* Decoding: Grab symbol, run through decoder, slice dibit into - buffer. */ - /* This symbol goes into this encoder next */ - *(enco_syms[encoder]++) = symp - symbols; - symp++; - /* The next output from this encoder goes into these dibits */ - *(enco_dibits[encoder]++) = BIT_PTR(trellis_wheredata[encoder], shift); - - encoder++; if (encoder >= ENCODERS) encoder = 0; - } /* Encoders */ - } /* Bit shifts */ + encoder = ENCODERS - ENCODER_SEG_BUMP; + skip_encoder_bump = 0; + symp = symbols; + next_sym_seg = symp; + + for (chunk = 0; chunk < INPUT_SIZE; chunk += ENCODERS) { + /* Associate data bytes with the Trellis encoders. + They get loaded or stored in an order that depends on where we are in the + segment sync progress (sigh). + GRR! When the chunk reload happens at the same time as the + segment boundary, we should bump the encoder NOW for the reload, + rather than LATER during the bitshift transition!!! */ + if (symp >= next_sym_seg) { + encoder = (encoder + ENCODER_SEG_BUMP) % ENCODERS; + skip_encoder_bump = 1; + } + + /* Remember where the data bytes are going to go, once we've + accumulated them from the 12 interleaved decoders */ + for (i = 0; i < ENCODERS; i++) { + trellis_wheredata[encoder] = chunk + i; + encoder++; + if (encoder >= ENCODERS) + encoder = 0; + } + + for (shift = 6; shift >= 0; shift -= 2) { + + /* Segment boundaries happen to occur on some bitshift transitions. */ + if (symp >= next_sym_seg) { + /* Segment transition. Output a data segment sync symbol, and + mess with the trellis encoder mux. */ + *syncsyms++ = symp - symbols; + symp += 4; + next_sym_seg = symp + (SEGMENT_SIZE * DIBITS_PER_BYTE); + + if (!skip_encoder_bump) + encoder = (encoder + ENCODER_SEG_BUMP) % ENCODERS; + skip_encoder_bump = 0; + } + + /* Now run each of the 12 Trellis encoders to spit out 12 symbols. + Each encoder takes input from the same byte of the chunk, but the + outputs of the encoders come out in various orders. + NOPE -- this is false. The encoders take input from various + bytes of the chunk (which changes at segment sync time), AND + they also come out in various orders. You really do have to + keep separate track of: the datasegs bytes, the encoders, and + the symbol bytes -- because they're all moving with respect to + each other!!! */ + for (i = 0; i < ENCODERS; i++) { + if (debug_dec) + printf("Seg %ld Symb %3ld Trell %2d Byte %6d Bits %d-%d = ", + (long)SEGOF(symp - symbols), + (long)SYMOF(symp - symbols), + encoder, + trellis_wheredata[encoder], + bit1[shift], + bit2[shift]); + + /* Decoding: Grab symbol, run through decoder, slice dibit into + buffer. */ + /* This symbol goes into this encoder next */ + *(enco_syms[encoder]++) = symp - symbols; + symp++; + /* The next output from this encoder goes into these dibits */ + *(enco_dibits[encoder]++) = BIT_PTR(trellis_wheredata[encoder], shift); + + encoder++; + if (encoder >= ENCODERS) + encoder = 0; + } /* Encoders */ + } /* Bit shifts */ #if 0 /* Now dump out the chunk of 12 data bytes that the twelve decoders have @@ -189,14 +192,14 @@ build_decode_structures (char *fileout) if (encoder >= ENCODERS) encoder = 0; } /* Dumping encoder bytes */ #endif - } /* Chunks */ + } /* Chunks */ - /* Now print the resulting data structures in C++ */ + /* Now print the resulting data structures in C++ */ - if (!freopen(fileout, "w", stdout)) - return 2; + if (!freopen(fileout, "w", stdout)) + return 2; - printf ("/*\n\ + printf("/*\n\ * atsc_viterbi_mux.cc\n\ *\n\ * Data structures for knowing which symbols are fed to which\n\ @@ -204,64 +207,59 @@ build_decode_structures (char *fileout) *\n\ * Generated by 'atsc_viterbi_gen.cc'.\n\ */\n\n"); - sync_symbol_indices_max = syncsyms - sync_symbol_indices; - printf ("const unsigned int sync_symbol_indices_max = %d;\n", - sync_symbol_indices_max); - printf ("const unsigned int sync_symbol_indices[%d] = {\n ", - sync_symbol_indices_max); - for (i = 0; i < sync_symbol_indices_max; i++) { - printf ("%d,%s", sync_symbol_indices[i], (7 == i%8)? "\n ": " "); - } - printf ("};\n\n"); - - enco_which_max = enco_dibits[0] - enco_which_dibits[0]; - for (i = 0; i < ENCODERS; i++) - if (enco_which_max != enco_dibits[i] - enco_which_dibits[i]) { - cerr << "Encoder " << i << " has different max_dibits " << - enco_dibits[i] - enco_which_dibits[i] << " than " << enco_which_max; - retval = 3; + sync_symbol_indices_max = syncsyms - sync_symbol_indices; + printf("const unsigned int sync_symbol_indices_max = %d;\n", sync_symbol_indices_max); + printf("const unsigned int sync_symbol_indices[%d] = {\n ", sync_symbol_indices_max); + for (i = 0; i < sync_symbol_indices_max; i++) { + printf("%d,%s", sync_symbol_indices[i], (7 == i % 8) ? "\n " : " "); } + printf("};\n\n"); + + enco_which_max = enco_dibits[0] - enco_which_dibits[0]; + for (i = 0; i < ENCODERS; i++) + if (enco_which_max != enco_dibits[i] - enco_which_dibits[i]) { + cerr << "Encoder " << i << " has different max_dibits " + << enco_dibits[i] - enco_which_dibits[i] << " than " << enco_which_max; + retval = 3; + } + + printf("const unsigned int enco_which_max = %d;\n", enco_which_max); - printf ("const unsigned int enco_which_max = %d;\n" , enco_which_max); - - printf ("const unsigned int enco_which_syms[%d][%d] = {\n", - ENCODERS, enco_which_max); - for (i = 0; i < ENCODERS; i++) { - printf (" /* %d */\n {", i); - for (j = 0; j < enco_which_max; j++) - printf ("%d,%s", enco_which_syms[i][j], (7 == j%8)? "\n ": " "); - printf ("},\n"); - } - printf ("};\n\n"); - - printf ("const unsigned int enco_which_dibits[%d][%d] = {\n", - ENCODERS, enco_which_max); - for (i = 0; i < ENCODERS; i++) { - printf (" /* %d */\n {", i); - for (j = 0; j < enco_which_max; j++) - printf ("%d,%s", enco_which_dibits[i][j], (7 == j%8)? "\n ": " "); - printf ("},\n"); - } - printf ("};\n\n"); - return retval; + printf("const unsigned int enco_which_syms[%d][%d] = {\n", ENCODERS, enco_which_max); + for (i = 0; i < ENCODERS; i++) { + printf(" /* %d */\n {", i); + for (j = 0; j < enco_which_max; j++) + printf("%d,%s", enco_which_syms[i][j], (7 == j % 8) ? "\n " : " "); + printf("},\n"); + } + printf("};\n\n"); + + printf( + "const unsigned int enco_which_dibits[%d][%d] = {\n", ENCODERS, enco_which_max); + for (i = 0; i < ENCODERS; i++) { + printf(" /* %d */\n {", i); + for (j = 0; j < enco_which_max; j++) + printf("%d,%s", enco_which_dibits[i][j], (7 == j % 8) ? "\n " : " "); + printf("},\n"); + } + printf("};\n\n"); + return retval; } -int -usage() +int usage() { - cerr << "atsc_viterbi_gen: Usage:\n"; - cerr << " ./atsc_viterbi_gen -o atsc_viterbi_mux.cc\n"; - cerr << "That's all, folks!\n"; - return 1; + cerr << "atsc_viterbi_gen: Usage:\n"; + cerr << " ./atsc_viterbi_gen -o atsc_viterbi_mux.cc\n"; + cerr << "That's all, folks!\n"; + return 1; } -int -main(int argc, char **argv) +int main(int argc, char** argv) { - if (argc != 3) return usage(); - if (argv[1][0] != '-' - || argv[1][1] != 'o' - || argv[1][2] != 0 ) return usage(); - return build_decode_structures(argv[2]); + if (argc != 3) + return usage(); + if (argv[1][0] != '-' || argv[1][1] != 'o' || argv[1][2] != 0) + return usage(); + return build_decode_structures(argv[2]); } diff --git a/gr-dtv/lib/atsc/atsc_viterbi_mux.h b/gr-dtv/lib/atsc/atsc_viterbi_mux.h index 07ec557544..2beb49e08a 100644 --- a/gr-dtv/lib/atsc/atsc_viterbi_mux.h +++ b/gr-dtv/lib/atsc/atsc_viterbi_mux.h @@ -7,2533 +7,1764 @@ const unsigned int sync_symbol_indices_max = 12; const unsigned int sync_symbol_indices[12] = { - 0, 832, 1664, 2496, 3328, 4160, 4992, 5824, - 6656, 7488, 8320, 9152, }; + 0, 832, 1664, 2496, 3328, 4160, 4992, 5824, 6656, 7488, 8320, 9152, +}; const unsigned int enco_which_max = 828; const unsigned int enco_which_syms[12][828] = { - /* 0 */ - {4, 16, 28, 40, 52, 64, 76, 88, - 100, 112, 124, 136, 148, 160, 172, 184, - 196, 208, 220, 232, 244, 256, 268, 280, - 292, 304, 316, 328, 340, 352, 364, 376, - 388, 400, 412, 424, 436, 448, 460, 472, - 484, 496, 508, 520, 532, 544, 556, 568, - 580, 592, 604, 616, 628, 640, 652, 664, - 676, 688, 700, 712, 724, 736, 748, 760, - 772, 784, 796, 808, 820, 844, 856, 868, - 880, 892, 904, 916, 928, 940, 952, 964, - 976, 988, 1000, 1012, 1024, 1036, 1048, 1060, - 1072, 1084, 1096, 1108, 1120, 1132, 1144, 1156, - 1168, 1180, 1192, 1204, 1216, 1228, 1240, 1252, - 1264, 1276, 1288, 1300, 1312, 1324, 1336, 1348, - 1360, 1372, 1384, 1396, 1408, 1420, 1432, 1444, - 1456, 1468, 1480, 1492, 1504, 1516, 1528, 1540, - 1552, 1564, 1576, 1588, 1600, 1612, 1624, 1636, - 1648, 1660, 1672, 1684, 1696, 1708, 1720, 1732, - 1744, 1756, 1768, 1780, 1792, 1804, 1816, 1828, - 1840, 1852, 1864, 1876, 1888, 1900, 1912, 1924, - 1936, 1948, 1960, 1972, 1984, 1996, 2008, 2020, - 2032, 2044, 2056, 2068, 2080, 2092, 2104, 2116, - 2128, 2140, 2152, 2164, 2176, 2188, 2200, 2212, - 2224, 2236, 2248, 2260, 2272, 2284, 2296, 2308, - 2320, 2332, 2344, 2356, 2368, 2380, 2392, 2404, - 2416, 2428, 2440, 2452, 2464, 2476, 2488, 2500, - 2512, 2524, 2536, 2548, 2560, 2572, 2584, 2596, - 2608, 2620, 2632, 2644, 2656, 2668, 2680, 2692, - 2704, 2716, 2728, 2740, 2752, 2764, 2776, 2788, - 2800, 2812, 2824, 2836, 2848, 2860, 2872, 2884, - 2896, 2908, 2920, 2932, 2944, 2956, 2968, 2980, - 2992, 3004, 3016, 3028, 3040, 3052, 3064, 3076, - 3088, 3100, 3112, 3124, 3136, 3148, 3160, 3172, - 3184, 3196, 3208, 3220, 3232, 3244, 3256, 3268, - 3280, 3292, 3304, 3316, 3340, 3352, 3364, 3376, - 3388, 3400, 3412, 3424, 3436, 3448, 3460, 3472, - 3484, 3496, 3508, 3520, 3532, 3544, 3556, 3568, - 3580, 3592, 3604, 3616, 3628, 3640, 3652, 3664, - 3676, 3688, 3700, 3712, 3724, 3736, 3748, 3760, - 3772, 3784, 3796, 3808, 3820, 3832, 3844, 3856, - 3868, 3880, 3892, 3904, 3916, 3928, 3940, 3952, - 3964, 3976, 3988, 4000, 4012, 4024, 4036, 4048, - 4060, 4072, 4084, 4096, 4108, 4120, 4132, 4144, - 4156, 4168, 4180, 4192, 4204, 4216, 4228, 4240, - 4252, 4264, 4276, 4288, 4300, 4312, 4324, 4336, - 4348, 4360, 4372, 4384, 4396, 4408, 4420, 4432, - 4444, 4456, 4468, 4480, 4492, 4504, 4516, 4528, - 4540, 4552, 4564, 4576, 4588, 4600, 4612, 4624, - 4636, 4648, 4660, 4672, 4684, 4696, 4708, 4720, - 4732, 4744, 4756, 4768, 4780, 4792, 4804, 4816, - 4828, 4840, 4852, 4864, 4876, 4888, 4900, 4912, - 4924, 4936, 4948, 4960, 4972, 4984, 4996, 5008, - 5020, 5032, 5044, 5056, 5068, 5080, 5092, 5104, - 5116, 5128, 5140, 5152, 5164, 5176, 5188, 5200, - 5212, 5224, 5236, 5248, 5260, 5272, 5284, 5296, - 5308, 5320, 5332, 5344, 5356, 5368, 5380, 5392, - 5404, 5416, 5428, 5440, 5452, 5464, 5476, 5488, - 5500, 5512, 5524, 5536, 5548, 5560, 5572, 5584, - 5596, 5608, 5620, 5632, 5644, 5656, 5668, 5680, - 5692, 5704, 5716, 5728, 5740, 5752, 5764, 5776, - 5788, 5800, 5812, 5836, 5848, 5860, 5872, 5884, - 5896, 5908, 5920, 5932, 5944, 5956, 5968, 5980, - 5992, 6004, 6016, 6028, 6040, 6052, 6064, 6076, - 6088, 6100, 6112, 6124, 6136, 6148, 6160, 6172, - 6184, 6196, 6208, 6220, 6232, 6244, 6256, 6268, - 6280, 6292, 6304, 6316, 6328, 6340, 6352, 6364, - 6376, 6388, 6400, 6412, 6424, 6436, 6448, 6460, - 6472, 6484, 6496, 6508, 6520, 6532, 6544, 6556, - 6568, 6580, 6592, 6604, 6616, 6628, 6640, 6652, - 6664, 6676, 6688, 6700, 6712, 6724, 6736, 6748, - 6760, 6772, 6784, 6796, 6808, 6820, 6832, 6844, - 6856, 6868, 6880, 6892, 6904, 6916, 6928, 6940, - 6952, 6964, 6976, 6988, 7000, 7012, 7024, 7036, - 7048, 7060, 7072, 7084, 7096, 7108, 7120, 7132, - 7144, 7156, 7168, 7180, 7192, 7204, 7216, 7228, - 7240, 7252, 7264, 7276, 7288, 7300, 7312, 7324, - 7336, 7348, 7360, 7372, 7384, 7396, 7408, 7420, - 7432, 7444, 7456, 7468, 7480, 7492, 7504, 7516, - 7528, 7540, 7552, 7564, 7576, 7588, 7600, 7612, - 7624, 7636, 7648, 7660, 7672, 7684, 7696, 7708, - 7720, 7732, 7744, 7756, 7768, 7780, 7792, 7804, - 7816, 7828, 7840, 7852, 7864, 7876, 7888, 7900, - 7912, 7924, 7936, 7948, 7960, 7972, 7984, 7996, - 8008, 8020, 8032, 8044, 8056, 8068, 8080, 8092, - 8104, 8116, 8128, 8140, 8152, 8164, 8176, 8188, - 8200, 8212, 8224, 8236, 8248, 8260, 8272, 8284, - 8296, 8308, 8332, 8344, 8356, 8368, 8380, 8392, - 8404, 8416, 8428, 8440, 8452, 8464, 8476, 8488, - 8500, 8512, 8524, 8536, 8548, 8560, 8572, 8584, - 8596, 8608, 8620, 8632, 8644, 8656, 8668, 8680, - 8692, 8704, 8716, 8728, 8740, 8752, 8764, 8776, - 8788, 8800, 8812, 8824, 8836, 8848, 8860, 8872, - 8884, 8896, 8908, 8920, 8932, 8944, 8956, 8968, - 8980, 8992, 9004, 9016, 9028, 9040, 9052, 9064, - 9076, 9088, 9100, 9112, 9124, 9136, 9148, 9160, - 9172, 9184, 9196, 9208, 9220, 9232, 9244, 9256, - 9268, 9280, 9292, 9304, 9316, 9328, 9340, 9352, - 9364, 9376, 9388, 9400, 9412, 9424, 9436, 9448, - 9460, 9472, 9484, 9496, 9508, 9520, 9532, 9544, - 9556, 9568, 9580, 9592, 9604, 9616, 9628, 9640, - 9652, 9664, 9676, 9688, 9700, 9712, 9724, 9736, - 9748, 9760, 9772, 9784, 9796, 9808, 9820, 9832, - 9844, 9856, 9868, 9880, 9892, 9904, 9916, 9928, - 9940, 9952, 9964, 9976, }, - /* 1 */ - {5, 17, 29, 41, 53, 65, 77, 89, - 101, 113, 125, 137, 149, 161, 173, 185, - 197, 209, 221, 233, 245, 257, 269, 281, - 293, 305, 317, 329, 341, 353, 365, 377, - 389, 401, 413, 425, 437, 449, 461, 473, - 485, 497, 509, 521, 533, 545, 557, 569, - 581, 593, 605, 617, 629, 641, 653, 665, - 677, 689, 701, 713, 725, 737, 749, 761, - 773, 785, 797, 809, 821, 845, 857, 869, - 881, 893, 905, 917, 929, 941, 953, 965, - 977, 989, 1001, 1013, 1025, 1037, 1049, 1061, - 1073, 1085, 1097, 1109, 1121, 1133, 1145, 1157, - 1169, 1181, 1193, 1205, 1217, 1229, 1241, 1253, - 1265, 1277, 1289, 1301, 1313, 1325, 1337, 1349, - 1361, 1373, 1385, 1397, 1409, 1421, 1433, 1445, - 1457, 1469, 1481, 1493, 1505, 1517, 1529, 1541, - 1553, 1565, 1577, 1589, 1601, 1613, 1625, 1637, - 1649, 1661, 1673, 1685, 1697, 1709, 1721, 1733, - 1745, 1757, 1769, 1781, 1793, 1805, 1817, 1829, - 1841, 1853, 1865, 1877, 1889, 1901, 1913, 1925, - 1937, 1949, 1961, 1973, 1985, 1997, 2009, 2021, - 2033, 2045, 2057, 2069, 2081, 2093, 2105, 2117, - 2129, 2141, 2153, 2165, 2177, 2189, 2201, 2213, - 2225, 2237, 2249, 2261, 2273, 2285, 2297, 2309, - 2321, 2333, 2345, 2357, 2369, 2381, 2393, 2405, - 2417, 2429, 2441, 2453, 2465, 2477, 2489, 2501, - 2513, 2525, 2537, 2549, 2561, 2573, 2585, 2597, - 2609, 2621, 2633, 2645, 2657, 2669, 2681, 2693, - 2705, 2717, 2729, 2741, 2753, 2765, 2777, 2789, - 2801, 2813, 2825, 2837, 2849, 2861, 2873, 2885, - 2897, 2909, 2921, 2933, 2945, 2957, 2969, 2981, - 2993, 3005, 3017, 3029, 3041, 3053, 3065, 3077, - 3089, 3101, 3113, 3125, 3137, 3149, 3161, 3173, - 3185, 3197, 3209, 3221, 3233, 3245, 3257, 3269, - 3281, 3293, 3305, 3317, 3341, 3353, 3365, 3377, - 3389, 3401, 3413, 3425, 3437, 3449, 3461, 3473, - 3485, 3497, 3509, 3521, 3533, 3545, 3557, 3569, - 3581, 3593, 3605, 3617, 3629, 3641, 3653, 3665, - 3677, 3689, 3701, 3713, 3725, 3737, 3749, 3761, - 3773, 3785, 3797, 3809, 3821, 3833, 3845, 3857, - 3869, 3881, 3893, 3905, 3917, 3929, 3941, 3953, - 3965, 3977, 3989, 4001, 4013, 4025, 4037, 4049, - 4061, 4073, 4085, 4097, 4109, 4121, 4133, 4145, - 4157, 4169, 4181, 4193, 4205, 4217, 4229, 4241, - 4253, 4265, 4277, 4289, 4301, 4313, 4325, 4337, - 4349, 4361, 4373, 4385, 4397, 4409, 4421, 4433, - 4445, 4457, 4469, 4481, 4493, 4505, 4517, 4529, - 4541, 4553, 4565, 4577, 4589, 4601, 4613, 4625, - 4637, 4649, 4661, 4673, 4685, 4697, 4709, 4721, - 4733, 4745, 4757, 4769, 4781, 4793, 4805, 4817, - 4829, 4841, 4853, 4865, 4877, 4889, 4901, 4913, - 4925, 4937, 4949, 4961, 4973, 4985, 4997, 5009, - 5021, 5033, 5045, 5057, 5069, 5081, 5093, 5105, - 5117, 5129, 5141, 5153, 5165, 5177, 5189, 5201, - 5213, 5225, 5237, 5249, 5261, 5273, 5285, 5297, - 5309, 5321, 5333, 5345, 5357, 5369, 5381, 5393, - 5405, 5417, 5429, 5441, 5453, 5465, 5477, 5489, - 5501, 5513, 5525, 5537, 5549, 5561, 5573, 5585, - 5597, 5609, 5621, 5633, 5645, 5657, 5669, 5681, - 5693, 5705, 5717, 5729, 5741, 5753, 5765, 5777, - 5789, 5801, 5813, 5837, 5849, 5861, 5873, 5885, - 5897, 5909, 5921, 5933, 5945, 5957, 5969, 5981, - 5993, 6005, 6017, 6029, 6041, 6053, 6065, 6077, - 6089, 6101, 6113, 6125, 6137, 6149, 6161, 6173, - 6185, 6197, 6209, 6221, 6233, 6245, 6257, 6269, - 6281, 6293, 6305, 6317, 6329, 6341, 6353, 6365, - 6377, 6389, 6401, 6413, 6425, 6437, 6449, 6461, - 6473, 6485, 6497, 6509, 6521, 6533, 6545, 6557, - 6569, 6581, 6593, 6605, 6617, 6629, 6641, 6653, - 6665, 6677, 6689, 6701, 6713, 6725, 6737, 6749, - 6761, 6773, 6785, 6797, 6809, 6821, 6833, 6845, - 6857, 6869, 6881, 6893, 6905, 6917, 6929, 6941, - 6953, 6965, 6977, 6989, 7001, 7013, 7025, 7037, - 7049, 7061, 7073, 7085, 7097, 7109, 7121, 7133, - 7145, 7157, 7169, 7181, 7193, 7205, 7217, 7229, - 7241, 7253, 7265, 7277, 7289, 7301, 7313, 7325, - 7337, 7349, 7361, 7373, 7385, 7397, 7409, 7421, - 7433, 7445, 7457, 7469, 7481, 7493, 7505, 7517, - 7529, 7541, 7553, 7565, 7577, 7589, 7601, 7613, - 7625, 7637, 7649, 7661, 7673, 7685, 7697, 7709, - 7721, 7733, 7745, 7757, 7769, 7781, 7793, 7805, - 7817, 7829, 7841, 7853, 7865, 7877, 7889, 7901, - 7913, 7925, 7937, 7949, 7961, 7973, 7985, 7997, - 8009, 8021, 8033, 8045, 8057, 8069, 8081, 8093, - 8105, 8117, 8129, 8141, 8153, 8165, 8177, 8189, - 8201, 8213, 8225, 8237, 8249, 8261, 8273, 8285, - 8297, 8309, 8333, 8345, 8357, 8369, 8381, 8393, - 8405, 8417, 8429, 8441, 8453, 8465, 8477, 8489, - 8501, 8513, 8525, 8537, 8549, 8561, 8573, 8585, - 8597, 8609, 8621, 8633, 8645, 8657, 8669, 8681, - 8693, 8705, 8717, 8729, 8741, 8753, 8765, 8777, - 8789, 8801, 8813, 8825, 8837, 8849, 8861, 8873, - 8885, 8897, 8909, 8921, 8933, 8945, 8957, 8969, - 8981, 8993, 9005, 9017, 9029, 9041, 9053, 9065, - 9077, 9089, 9101, 9113, 9125, 9137, 9149, 9161, - 9173, 9185, 9197, 9209, 9221, 9233, 9245, 9257, - 9269, 9281, 9293, 9305, 9317, 9329, 9341, 9353, - 9365, 9377, 9389, 9401, 9413, 9425, 9437, 9449, - 9461, 9473, 9485, 9497, 9509, 9521, 9533, 9545, - 9557, 9569, 9581, 9593, 9605, 9617, 9629, 9641, - 9653, 9665, 9677, 9689, 9701, 9713, 9725, 9737, - 9749, 9761, 9773, 9785, 9797, 9809, 9821, 9833, - 9845, 9857, 9869, 9881, 9893, 9905, 9917, 9929, - 9941, 9953, 9965, 9977, }, - /* 2 */ - {6, 18, 30, 42, 54, 66, 78, 90, - 102, 114, 126, 138, 150, 162, 174, 186, - 198, 210, 222, 234, 246, 258, 270, 282, - 294, 306, 318, 330, 342, 354, 366, 378, - 390, 402, 414, 426, 438, 450, 462, 474, - 486, 498, 510, 522, 534, 546, 558, 570, - 582, 594, 606, 618, 630, 642, 654, 666, - 678, 690, 702, 714, 726, 738, 750, 762, - 774, 786, 798, 810, 822, 846, 858, 870, - 882, 894, 906, 918, 930, 942, 954, 966, - 978, 990, 1002, 1014, 1026, 1038, 1050, 1062, - 1074, 1086, 1098, 1110, 1122, 1134, 1146, 1158, - 1170, 1182, 1194, 1206, 1218, 1230, 1242, 1254, - 1266, 1278, 1290, 1302, 1314, 1326, 1338, 1350, - 1362, 1374, 1386, 1398, 1410, 1422, 1434, 1446, - 1458, 1470, 1482, 1494, 1506, 1518, 1530, 1542, - 1554, 1566, 1578, 1590, 1602, 1614, 1626, 1638, - 1650, 1662, 1674, 1686, 1698, 1710, 1722, 1734, - 1746, 1758, 1770, 1782, 1794, 1806, 1818, 1830, - 1842, 1854, 1866, 1878, 1890, 1902, 1914, 1926, - 1938, 1950, 1962, 1974, 1986, 1998, 2010, 2022, - 2034, 2046, 2058, 2070, 2082, 2094, 2106, 2118, - 2130, 2142, 2154, 2166, 2178, 2190, 2202, 2214, - 2226, 2238, 2250, 2262, 2274, 2286, 2298, 2310, - 2322, 2334, 2346, 2358, 2370, 2382, 2394, 2406, - 2418, 2430, 2442, 2454, 2466, 2478, 2490, 2502, - 2514, 2526, 2538, 2550, 2562, 2574, 2586, 2598, - 2610, 2622, 2634, 2646, 2658, 2670, 2682, 2694, - 2706, 2718, 2730, 2742, 2754, 2766, 2778, 2790, - 2802, 2814, 2826, 2838, 2850, 2862, 2874, 2886, - 2898, 2910, 2922, 2934, 2946, 2958, 2970, 2982, - 2994, 3006, 3018, 3030, 3042, 3054, 3066, 3078, - 3090, 3102, 3114, 3126, 3138, 3150, 3162, 3174, - 3186, 3198, 3210, 3222, 3234, 3246, 3258, 3270, - 3282, 3294, 3306, 3318, 3342, 3354, 3366, 3378, - 3390, 3402, 3414, 3426, 3438, 3450, 3462, 3474, - 3486, 3498, 3510, 3522, 3534, 3546, 3558, 3570, - 3582, 3594, 3606, 3618, 3630, 3642, 3654, 3666, - 3678, 3690, 3702, 3714, 3726, 3738, 3750, 3762, - 3774, 3786, 3798, 3810, 3822, 3834, 3846, 3858, - 3870, 3882, 3894, 3906, 3918, 3930, 3942, 3954, - 3966, 3978, 3990, 4002, 4014, 4026, 4038, 4050, - 4062, 4074, 4086, 4098, 4110, 4122, 4134, 4146, - 4158, 4170, 4182, 4194, 4206, 4218, 4230, 4242, - 4254, 4266, 4278, 4290, 4302, 4314, 4326, 4338, - 4350, 4362, 4374, 4386, 4398, 4410, 4422, 4434, - 4446, 4458, 4470, 4482, 4494, 4506, 4518, 4530, - 4542, 4554, 4566, 4578, 4590, 4602, 4614, 4626, - 4638, 4650, 4662, 4674, 4686, 4698, 4710, 4722, - 4734, 4746, 4758, 4770, 4782, 4794, 4806, 4818, - 4830, 4842, 4854, 4866, 4878, 4890, 4902, 4914, - 4926, 4938, 4950, 4962, 4974, 4986, 4998, 5010, - 5022, 5034, 5046, 5058, 5070, 5082, 5094, 5106, - 5118, 5130, 5142, 5154, 5166, 5178, 5190, 5202, - 5214, 5226, 5238, 5250, 5262, 5274, 5286, 5298, - 5310, 5322, 5334, 5346, 5358, 5370, 5382, 5394, - 5406, 5418, 5430, 5442, 5454, 5466, 5478, 5490, - 5502, 5514, 5526, 5538, 5550, 5562, 5574, 5586, - 5598, 5610, 5622, 5634, 5646, 5658, 5670, 5682, - 5694, 5706, 5718, 5730, 5742, 5754, 5766, 5778, - 5790, 5802, 5814, 5838, 5850, 5862, 5874, 5886, - 5898, 5910, 5922, 5934, 5946, 5958, 5970, 5982, - 5994, 6006, 6018, 6030, 6042, 6054, 6066, 6078, - 6090, 6102, 6114, 6126, 6138, 6150, 6162, 6174, - 6186, 6198, 6210, 6222, 6234, 6246, 6258, 6270, - 6282, 6294, 6306, 6318, 6330, 6342, 6354, 6366, - 6378, 6390, 6402, 6414, 6426, 6438, 6450, 6462, - 6474, 6486, 6498, 6510, 6522, 6534, 6546, 6558, - 6570, 6582, 6594, 6606, 6618, 6630, 6642, 6654, - 6666, 6678, 6690, 6702, 6714, 6726, 6738, 6750, - 6762, 6774, 6786, 6798, 6810, 6822, 6834, 6846, - 6858, 6870, 6882, 6894, 6906, 6918, 6930, 6942, - 6954, 6966, 6978, 6990, 7002, 7014, 7026, 7038, - 7050, 7062, 7074, 7086, 7098, 7110, 7122, 7134, - 7146, 7158, 7170, 7182, 7194, 7206, 7218, 7230, - 7242, 7254, 7266, 7278, 7290, 7302, 7314, 7326, - 7338, 7350, 7362, 7374, 7386, 7398, 7410, 7422, - 7434, 7446, 7458, 7470, 7482, 7494, 7506, 7518, - 7530, 7542, 7554, 7566, 7578, 7590, 7602, 7614, - 7626, 7638, 7650, 7662, 7674, 7686, 7698, 7710, - 7722, 7734, 7746, 7758, 7770, 7782, 7794, 7806, - 7818, 7830, 7842, 7854, 7866, 7878, 7890, 7902, - 7914, 7926, 7938, 7950, 7962, 7974, 7986, 7998, - 8010, 8022, 8034, 8046, 8058, 8070, 8082, 8094, - 8106, 8118, 8130, 8142, 8154, 8166, 8178, 8190, - 8202, 8214, 8226, 8238, 8250, 8262, 8274, 8286, - 8298, 8310, 8334, 8346, 8358, 8370, 8382, 8394, - 8406, 8418, 8430, 8442, 8454, 8466, 8478, 8490, - 8502, 8514, 8526, 8538, 8550, 8562, 8574, 8586, - 8598, 8610, 8622, 8634, 8646, 8658, 8670, 8682, - 8694, 8706, 8718, 8730, 8742, 8754, 8766, 8778, - 8790, 8802, 8814, 8826, 8838, 8850, 8862, 8874, - 8886, 8898, 8910, 8922, 8934, 8946, 8958, 8970, - 8982, 8994, 9006, 9018, 9030, 9042, 9054, 9066, - 9078, 9090, 9102, 9114, 9126, 9138, 9150, 9162, - 9174, 9186, 9198, 9210, 9222, 9234, 9246, 9258, - 9270, 9282, 9294, 9306, 9318, 9330, 9342, 9354, - 9366, 9378, 9390, 9402, 9414, 9426, 9438, 9450, - 9462, 9474, 9486, 9498, 9510, 9522, 9534, 9546, - 9558, 9570, 9582, 9594, 9606, 9618, 9630, 9642, - 9654, 9666, 9678, 9690, 9702, 9714, 9726, 9738, - 9750, 9762, 9774, 9786, 9798, 9810, 9822, 9834, - 9846, 9858, 9870, 9882, 9894, 9906, 9918, 9930, - 9942, 9954, 9966, 9978, }, - /* 3 */ - {7, 19, 31, 43, 55, 67, 79, 91, - 103, 115, 127, 139, 151, 163, 175, 187, - 199, 211, 223, 235, 247, 259, 271, 283, - 295, 307, 319, 331, 343, 355, 367, 379, - 391, 403, 415, 427, 439, 451, 463, 475, - 487, 499, 511, 523, 535, 547, 559, 571, - 583, 595, 607, 619, 631, 643, 655, 667, - 679, 691, 703, 715, 727, 739, 751, 763, - 775, 787, 799, 811, 823, 847, 859, 871, - 883, 895, 907, 919, 931, 943, 955, 967, - 979, 991, 1003, 1015, 1027, 1039, 1051, 1063, - 1075, 1087, 1099, 1111, 1123, 1135, 1147, 1159, - 1171, 1183, 1195, 1207, 1219, 1231, 1243, 1255, - 1267, 1279, 1291, 1303, 1315, 1327, 1339, 1351, - 1363, 1375, 1387, 1399, 1411, 1423, 1435, 1447, - 1459, 1471, 1483, 1495, 1507, 1519, 1531, 1543, - 1555, 1567, 1579, 1591, 1603, 1615, 1627, 1639, - 1651, 1663, 1675, 1687, 1699, 1711, 1723, 1735, - 1747, 1759, 1771, 1783, 1795, 1807, 1819, 1831, - 1843, 1855, 1867, 1879, 1891, 1903, 1915, 1927, - 1939, 1951, 1963, 1975, 1987, 1999, 2011, 2023, - 2035, 2047, 2059, 2071, 2083, 2095, 2107, 2119, - 2131, 2143, 2155, 2167, 2179, 2191, 2203, 2215, - 2227, 2239, 2251, 2263, 2275, 2287, 2299, 2311, - 2323, 2335, 2347, 2359, 2371, 2383, 2395, 2407, - 2419, 2431, 2443, 2455, 2467, 2479, 2491, 2503, - 2515, 2527, 2539, 2551, 2563, 2575, 2587, 2599, - 2611, 2623, 2635, 2647, 2659, 2671, 2683, 2695, - 2707, 2719, 2731, 2743, 2755, 2767, 2779, 2791, - 2803, 2815, 2827, 2839, 2851, 2863, 2875, 2887, - 2899, 2911, 2923, 2935, 2947, 2959, 2971, 2983, - 2995, 3007, 3019, 3031, 3043, 3055, 3067, 3079, - 3091, 3103, 3115, 3127, 3139, 3151, 3163, 3175, - 3187, 3199, 3211, 3223, 3235, 3247, 3259, 3271, - 3283, 3295, 3307, 3319, 3343, 3355, 3367, 3379, - 3391, 3403, 3415, 3427, 3439, 3451, 3463, 3475, - 3487, 3499, 3511, 3523, 3535, 3547, 3559, 3571, - 3583, 3595, 3607, 3619, 3631, 3643, 3655, 3667, - 3679, 3691, 3703, 3715, 3727, 3739, 3751, 3763, - 3775, 3787, 3799, 3811, 3823, 3835, 3847, 3859, - 3871, 3883, 3895, 3907, 3919, 3931, 3943, 3955, - 3967, 3979, 3991, 4003, 4015, 4027, 4039, 4051, - 4063, 4075, 4087, 4099, 4111, 4123, 4135, 4147, - 4159, 4171, 4183, 4195, 4207, 4219, 4231, 4243, - 4255, 4267, 4279, 4291, 4303, 4315, 4327, 4339, - 4351, 4363, 4375, 4387, 4399, 4411, 4423, 4435, - 4447, 4459, 4471, 4483, 4495, 4507, 4519, 4531, - 4543, 4555, 4567, 4579, 4591, 4603, 4615, 4627, - 4639, 4651, 4663, 4675, 4687, 4699, 4711, 4723, - 4735, 4747, 4759, 4771, 4783, 4795, 4807, 4819, - 4831, 4843, 4855, 4867, 4879, 4891, 4903, 4915, - 4927, 4939, 4951, 4963, 4975, 4987, 4999, 5011, - 5023, 5035, 5047, 5059, 5071, 5083, 5095, 5107, - 5119, 5131, 5143, 5155, 5167, 5179, 5191, 5203, - 5215, 5227, 5239, 5251, 5263, 5275, 5287, 5299, - 5311, 5323, 5335, 5347, 5359, 5371, 5383, 5395, - 5407, 5419, 5431, 5443, 5455, 5467, 5479, 5491, - 5503, 5515, 5527, 5539, 5551, 5563, 5575, 5587, - 5599, 5611, 5623, 5635, 5647, 5659, 5671, 5683, - 5695, 5707, 5719, 5731, 5743, 5755, 5767, 5779, - 5791, 5803, 5815, 5839, 5851, 5863, 5875, 5887, - 5899, 5911, 5923, 5935, 5947, 5959, 5971, 5983, - 5995, 6007, 6019, 6031, 6043, 6055, 6067, 6079, - 6091, 6103, 6115, 6127, 6139, 6151, 6163, 6175, - 6187, 6199, 6211, 6223, 6235, 6247, 6259, 6271, - 6283, 6295, 6307, 6319, 6331, 6343, 6355, 6367, - 6379, 6391, 6403, 6415, 6427, 6439, 6451, 6463, - 6475, 6487, 6499, 6511, 6523, 6535, 6547, 6559, - 6571, 6583, 6595, 6607, 6619, 6631, 6643, 6655, - 6667, 6679, 6691, 6703, 6715, 6727, 6739, 6751, - 6763, 6775, 6787, 6799, 6811, 6823, 6835, 6847, - 6859, 6871, 6883, 6895, 6907, 6919, 6931, 6943, - 6955, 6967, 6979, 6991, 7003, 7015, 7027, 7039, - 7051, 7063, 7075, 7087, 7099, 7111, 7123, 7135, - 7147, 7159, 7171, 7183, 7195, 7207, 7219, 7231, - 7243, 7255, 7267, 7279, 7291, 7303, 7315, 7327, - 7339, 7351, 7363, 7375, 7387, 7399, 7411, 7423, - 7435, 7447, 7459, 7471, 7483, 7495, 7507, 7519, - 7531, 7543, 7555, 7567, 7579, 7591, 7603, 7615, - 7627, 7639, 7651, 7663, 7675, 7687, 7699, 7711, - 7723, 7735, 7747, 7759, 7771, 7783, 7795, 7807, - 7819, 7831, 7843, 7855, 7867, 7879, 7891, 7903, - 7915, 7927, 7939, 7951, 7963, 7975, 7987, 7999, - 8011, 8023, 8035, 8047, 8059, 8071, 8083, 8095, - 8107, 8119, 8131, 8143, 8155, 8167, 8179, 8191, - 8203, 8215, 8227, 8239, 8251, 8263, 8275, 8287, - 8299, 8311, 8335, 8347, 8359, 8371, 8383, 8395, - 8407, 8419, 8431, 8443, 8455, 8467, 8479, 8491, - 8503, 8515, 8527, 8539, 8551, 8563, 8575, 8587, - 8599, 8611, 8623, 8635, 8647, 8659, 8671, 8683, - 8695, 8707, 8719, 8731, 8743, 8755, 8767, 8779, - 8791, 8803, 8815, 8827, 8839, 8851, 8863, 8875, - 8887, 8899, 8911, 8923, 8935, 8947, 8959, 8971, - 8983, 8995, 9007, 9019, 9031, 9043, 9055, 9067, - 9079, 9091, 9103, 9115, 9127, 9139, 9151, 9163, - 9175, 9187, 9199, 9211, 9223, 9235, 9247, 9259, - 9271, 9283, 9295, 9307, 9319, 9331, 9343, 9355, - 9367, 9379, 9391, 9403, 9415, 9427, 9439, 9451, - 9463, 9475, 9487, 9499, 9511, 9523, 9535, 9547, - 9559, 9571, 9583, 9595, 9607, 9619, 9631, 9643, - 9655, 9667, 9679, 9691, 9703, 9715, 9727, 9739, - 9751, 9763, 9775, 9787, 9799, 9811, 9823, 9835, - 9847, 9859, 9871, 9883, 9895, 9907, 9919, 9931, - 9943, 9955, 9967, 9979, }, - /* 4 */ - {8, 20, 32, 44, 56, 68, 80, 92, - 104, 116, 128, 140, 152, 164, 176, 188, - 200, 212, 224, 236, 248, 260, 272, 284, - 296, 308, 320, 332, 344, 356, 368, 380, - 392, 404, 416, 428, 440, 452, 464, 476, - 488, 500, 512, 524, 536, 548, 560, 572, - 584, 596, 608, 620, 632, 644, 656, 668, - 680, 692, 704, 716, 728, 740, 752, 764, - 776, 788, 800, 812, 824, 836, 848, 860, - 872, 884, 896, 908, 920, 932, 944, 956, - 968, 980, 992, 1004, 1016, 1028, 1040, 1052, - 1064, 1076, 1088, 1100, 1112, 1124, 1136, 1148, - 1160, 1172, 1184, 1196, 1208, 1220, 1232, 1244, - 1256, 1268, 1280, 1292, 1304, 1316, 1328, 1340, - 1352, 1364, 1376, 1388, 1400, 1412, 1424, 1436, - 1448, 1460, 1472, 1484, 1496, 1508, 1520, 1532, - 1544, 1556, 1568, 1580, 1592, 1604, 1616, 1628, - 1640, 1652, 1676, 1688, 1700, 1712, 1724, 1736, - 1748, 1760, 1772, 1784, 1796, 1808, 1820, 1832, - 1844, 1856, 1868, 1880, 1892, 1904, 1916, 1928, - 1940, 1952, 1964, 1976, 1988, 2000, 2012, 2024, - 2036, 2048, 2060, 2072, 2084, 2096, 2108, 2120, - 2132, 2144, 2156, 2168, 2180, 2192, 2204, 2216, - 2228, 2240, 2252, 2264, 2276, 2288, 2300, 2312, - 2324, 2336, 2348, 2360, 2372, 2384, 2396, 2408, - 2420, 2432, 2444, 2456, 2468, 2480, 2492, 2504, - 2516, 2528, 2540, 2552, 2564, 2576, 2588, 2600, - 2612, 2624, 2636, 2648, 2660, 2672, 2684, 2696, - 2708, 2720, 2732, 2744, 2756, 2768, 2780, 2792, - 2804, 2816, 2828, 2840, 2852, 2864, 2876, 2888, - 2900, 2912, 2924, 2936, 2948, 2960, 2972, 2984, - 2996, 3008, 3020, 3032, 3044, 3056, 3068, 3080, - 3092, 3104, 3116, 3128, 3140, 3152, 3164, 3176, - 3188, 3200, 3212, 3224, 3236, 3248, 3260, 3272, - 3284, 3296, 3308, 3320, 3332, 3344, 3356, 3368, - 3380, 3392, 3404, 3416, 3428, 3440, 3452, 3464, - 3476, 3488, 3500, 3512, 3524, 3536, 3548, 3560, - 3572, 3584, 3596, 3608, 3620, 3632, 3644, 3656, - 3668, 3680, 3692, 3704, 3716, 3728, 3740, 3752, - 3764, 3776, 3788, 3800, 3812, 3824, 3836, 3848, - 3860, 3872, 3884, 3896, 3908, 3920, 3932, 3944, - 3956, 3968, 3980, 3992, 4004, 4016, 4028, 4040, - 4052, 4064, 4076, 4088, 4100, 4112, 4124, 4136, - 4148, 4172, 4184, 4196, 4208, 4220, 4232, 4244, - 4256, 4268, 4280, 4292, 4304, 4316, 4328, 4340, - 4352, 4364, 4376, 4388, 4400, 4412, 4424, 4436, - 4448, 4460, 4472, 4484, 4496, 4508, 4520, 4532, - 4544, 4556, 4568, 4580, 4592, 4604, 4616, 4628, - 4640, 4652, 4664, 4676, 4688, 4700, 4712, 4724, - 4736, 4748, 4760, 4772, 4784, 4796, 4808, 4820, - 4832, 4844, 4856, 4868, 4880, 4892, 4904, 4916, - 4928, 4940, 4952, 4964, 4976, 4988, 5000, 5012, - 5024, 5036, 5048, 5060, 5072, 5084, 5096, 5108, - 5120, 5132, 5144, 5156, 5168, 5180, 5192, 5204, - 5216, 5228, 5240, 5252, 5264, 5276, 5288, 5300, - 5312, 5324, 5336, 5348, 5360, 5372, 5384, 5396, - 5408, 5420, 5432, 5444, 5456, 5468, 5480, 5492, - 5504, 5516, 5528, 5540, 5552, 5564, 5576, 5588, - 5600, 5612, 5624, 5636, 5648, 5660, 5672, 5684, - 5696, 5708, 5720, 5732, 5744, 5756, 5768, 5780, - 5792, 5804, 5816, 5828, 5840, 5852, 5864, 5876, - 5888, 5900, 5912, 5924, 5936, 5948, 5960, 5972, - 5984, 5996, 6008, 6020, 6032, 6044, 6056, 6068, - 6080, 6092, 6104, 6116, 6128, 6140, 6152, 6164, - 6176, 6188, 6200, 6212, 6224, 6236, 6248, 6260, - 6272, 6284, 6296, 6308, 6320, 6332, 6344, 6356, - 6368, 6380, 6392, 6404, 6416, 6428, 6440, 6452, - 6464, 6476, 6488, 6500, 6512, 6524, 6536, 6548, - 6560, 6572, 6584, 6596, 6608, 6620, 6632, 6644, - 6668, 6680, 6692, 6704, 6716, 6728, 6740, 6752, - 6764, 6776, 6788, 6800, 6812, 6824, 6836, 6848, - 6860, 6872, 6884, 6896, 6908, 6920, 6932, 6944, - 6956, 6968, 6980, 6992, 7004, 7016, 7028, 7040, - 7052, 7064, 7076, 7088, 7100, 7112, 7124, 7136, - 7148, 7160, 7172, 7184, 7196, 7208, 7220, 7232, - 7244, 7256, 7268, 7280, 7292, 7304, 7316, 7328, - 7340, 7352, 7364, 7376, 7388, 7400, 7412, 7424, - 7436, 7448, 7460, 7472, 7484, 7496, 7508, 7520, - 7532, 7544, 7556, 7568, 7580, 7592, 7604, 7616, - 7628, 7640, 7652, 7664, 7676, 7688, 7700, 7712, - 7724, 7736, 7748, 7760, 7772, 7784, 7796, 7808, - 7820, 7832, 7844, 7856, 7868, 7880, 7892, 7904, - 7916, 7928, 7940, 7952, 7964, 7976, 7988, 8000, - 8012, 8024, 8036, 8048, 8060, 8072, 8084, 8096, - 8108, 8120, 8132, 8144, 8156, 8168, 8180, 8192, - 8204, 8216, 8228, 8240, 8252, 8264, 8276, 8288, - 8300, 8312, 8324, 8336, 8348, 8360, 8372, 8384, - 8396, 8408, 8420, 8432, 8444, 8456, 8468, 8480, - 8492, 8504, 8516, 8528, 8540, 8552, 8564, 8576, - 8588, 8600, 8612, 8624, 8636, 8648, 8660, 8672, - 8684, 8696, 8708, 8720, 8732, 8744, 8756, 8768, - 8780, 8792, 8804, 8816, 8828, 8840, 8852, 8864, - 8876, 8888, 8900, 8912, 8924, 8936, 8948, 8960, - 8972, 8984, 8996, 9008, 9020, 9032, 9044, 9056, - 9068, 9080, 9092, 9104, 9116, 9128, 9140, 9164, - 9176, 9188, 9200, 9212, 9224, 9236, 9248, 9260, - 9272, 9284, 9296, 9308, 9320, 9332, 9344, 9356, - 9368, 9380, 9392, 9404, 9416, 9428, 9440, 9452, - 9464, 9476, 9488, 9500, 9512, 9524, 9536, 9548, - 9560, 9572, 9584, 9596, 9608, 9620, 9632, 9644, - 9656, 9668, 9680, 9692, 9704, 9716, 9728, 9740, - 9752, 9764, 9776, 9788, 9800, 9812, 9824, 9836, - 9848, 9860, 9872, 9884, 9896, 9908, 9920, 9932, - 9944, 9956, 9968, 9980, }, - /* 5 */ - {9, 21, 33, 45, 57, 69, 81, 93, - 105, 117, 129, 141, 153, 165, 177, 189, - 201, 213, 225, 237, 249, 261, 273, 285, - 297, 309, 321, 333, 345, 357, 369, 381, - 393, 405, 417, 429, 441, 453, 465, 477, - 489, 501, 513, 525, 537, 549, 561, 573, - 585, 597, 609, 621, 633, 645, 657, 669, - 681, 693, 705, 717, 729, 741, 753, 765, - 777, 789, 801, 813, 825, 837, 849, 861, - 873, 885, 897, 909, 921, 933, 945, 957, - 969, 981, 993, 1005, 1017, 1029, 1041, 1053, - 1065, 1077, 1089, 1101, 1113, 1125, 1137, 1149, - 1161, 1173, 1185, 1197, 1209, 1221, 1233, 1245, - 1257, 1269, 1281, 1293, 1305, 1317, 1329, 1341, - 1353, 1365, 1377, 1389, 1401, 1413, 1425, 1437, - 1449, 1461, 1473, 1485, 1497, 1509, 1521, 1533, - 1545, 1557, 1569, 1581, 1593, 1605, 1617, 1629, - 1641, 1653, 1677, 1689, 1701, 1713, 1725, 1737, - 1749, 1761, 1773, 1785, 1797, 1809, 1821, 1833, - 1845, 1857, 1869, 1881, 1893, 1905, 1917, 1929, - 1941, 1953, 1965, 1977, 1989, 2001, 2013, 2025, - 2037, 2049, 2061, 2073, 2085, 2097, 2109, 2121, - 2133, 2145, 2157, 2169, 2181, 2193, 2205, 2217, - 2229, 2241, 2253, 2265, 2277, 2289, 2301, 2313, - 2325, 2337, 2349, 2361, 2373, 2385, 2397, 2409, - 2421, 2433, 2445, 2457, 2469, 2481, 2493, 2505, - 2517, 2529, 2541, 2553, 2565, 2577, 2589, 2601, - 2613, 2625, 2637, 2649, 2661, 2673, 2685, 2697, - 2709, 2721, 2733, 2745, 2757, 2769, 2781, 2793, - 2805, 2817, 2829, 2841, 2853, 2865, 2877, 2889, - 2901, 2913, 2925, 2937, 2949, 2961, 2973, 2985, - 2997, 3009, 3021, 3033, 3045, 3057, 3069, 3081, - 3093, 3105, 3117, 3129, 3141, 3153, 3165, 3177, - 3189, 3201, 3213, 3225, 3237, 3249, 3261, 3273, - 3285, 3297, 3309, 3321, 3333, 3345, 3357, 3369, - 3381, 3393, 3405, 3417, 3429, 3441, 3453, 3465, - 3477, 3489, 3501, 3513, 3525, 3537, 3549, 3561, - 3573, 3585, 3597, 3609, 3621, 3633, 3645, 3657, - 3669, 3681, 3693, 3705, 3717, 3729, 3741, 3753, - 3765, 3777, 3789, 3801, 3813, 3825, 3837, 3849, - 3861, 3873, 3885, 3897, 3909, 3921, 3933, 3945, - 3957, 3969, 3981, 3993, 4005, 4017, 4029, 4041, - 4053, 4065, 4077, 4089, 4101, 4113, 4125, 4137, - 4149, 4173, 4185, 4197, 4209, 4221, 4233, 4245, - 4257, 4269, 4281, 4293, 4305, 4317, 4329, 4341, - 4353, 4365, 4377, 4389, 4401, 4413, 4425, 4437, - 4449, 4461, 4473, 4485, 4497, 4509, 4521, 4533, - 4545, 4557, 4569, 4581, 4593, 4605, 4617, 4629, - 4641, 4653, 4665, 4677, 4689, 4701, 4713, 4725, - 4737, 4749, 4761, 4773, 4785, 4797, 4809, 4821, - 4833, 4845, 4857, 4869, 4881, 4893, 4905, 4917, - 4929, 4941, 4953, 4965, 4977, 4989, 5001, 5013, - 5025, 5037, 5049, 5061, 5073, 5085, 5097, 5109, - 5121, 5133, 5145, 5157, 5169, 5181, 5193, 5205, - 5217, 5229, 5241, 5253, 5265, 5277, 5289, 5301, - 5313, 5325, 5337, 5349, 5361, 5373, 5385, 5397, - 5409, 5421, 5433, 5445, 5457, 5469, 5481, 5493, - 5505, 5517, 5529, 5541, 5553, 5565, 5577, 5589, - 5601, 5613, 5625, 5637, 5649, 5661, 5673, 5685, - 5697, 5709, 5721, 5733, 5745, 5757, 5769, 5781, - 5793, 5805, 5817, 5829, 5841, 5853, 5865, 5877, - 5889, 5901, 5913, 5925, 5937, 5949, 5961, 5973, - 5985, 5997, 6009, 6021, 6033, 6045, 6057, 6069, - 6081, 6093, 6105, 6117, 6129, 6141, 6153, 6165, - 6177, 6189, 6201, 6213, 6225, 6237, 6249, 6261, - 6273, 6285, 6297, 6309, 6321, 6333, 6345, 6357, - 6369, 6381, 6393, 6405, 6417, 6429, 6441, 6453, - 6465, 6477, 6489, 6501, 6513, 6525, 6537, 6549, - 6561, 6573, 6585, 6597, 6609, 6621, 6633, 6645, - 6669, 6681, 6693, 6705, 6717, 6729, 6741, 6753, - 6765, 6777, 6789, 6801, 6813, 6825, 6837, 6849, - 6861, 6873, 6885, 6897, 6909, 6921, 6933, 6945, - 6957, 6969, 6981, 6993, 7005, 7017, 7029, 7041, - 7053, 7065, 7077, 7089, 7101, 7113, 7125, 7137, - 7149, 7161, 7173, 7185, 7197, 7209, 7221, 7233, - 7245, 7257, 7269, 7281, 7293, 7305, 7317, 7329, - 7341, 7353, 7365, 7377, 7389, 7401, 7413, 7425, - 7437, 7449, 7461, 7473, 7485, 7497, 7509, 7521, - 7533, 7545, 7557, 7569, 7581, 7593, 7605, 7617, - 7629, 7641, 7653, 7665, 7677, 7689, 7701, 7713, - 7725, 7737, 7749, 7761, 7773, 7785, 7797, 7809, - 7821, 7833, 7845, 7857, 7869, 7881, 7893, 7905, - 7917, 7929, 7941, 7953, 7965, 7977, 7989, 8001, - 8013, 8025, 8037, 8049, 8061, 8073, 8085, 8097, - 8109, 8121, 8133, 8145, 8157, 8169, 8181, 8193, - 8205, 8217, 8229, 8241, 8253, 8265, 8277, 8289, - 8301, 8313, 8325, 8337, 8349, 8361, 8373, 8385, - 8397, 8409, 8421, 8433, 8445, 8457, 8469, 8481, - 8493, 8505, 8517, 8529, 8541, 8553, 8565, 8577, - 8589, 8601, 8613, 8625, 8637, 8649, 8661, 8673, - 8685, 8697, 8709, 8721, 8733, 8745, 8757, 8769, - 8781, 8793, 8805, 8817, 8829, 8841, 8853, 8865, - 8877, 8889, 8901, 8913, 8925, 8937, 8949, 8961, - 8973, 8985, 8997, 9009, 9021, 9033, 9045, 9057, - 9069, 9081, 9093, 9105, 9117, 9129, 9141, 9165, - 9177, 9189, 9201, 9213, 9225, 9237, 9249, 9261, - 9273, 9285, 9297, 9309, 9321, 9333, 9345, 9357, - 9369, 9381, 9393, 9405, 9417, 9429, 9441, 9453, - 9465, 9477, 9489, 9501, 9513, 9525, 9537, 9549, - 9561, 9573, 9585, 9597, 9609, 9621, 9633, 9645, - 9657, 9669, 9681, 9693, 9705, 9717, 9729, 9741, - 9753, 9765, 9777, 9789, 9801, 9813, 9825, 9837, - 9849, 9861, 9873, 9885, 9897, 9909, 9921, 9933, - 9945, 9957, 9969, 9981, }, - /* 6 */ - {10, 22, 34, 46, 58, 70, 82, 94, - 106, 118, 130, 142, 154, 166, 178, 190, - 202, 214, 226, 238, 250, 262, 274, 286, - 298, 310, 322, 334, 346, 358, 370, 382, - 394, 406, 418, 430, 442, 454, 466, 478, - 490, 502, 514, 526, 538, 550, 562, 574, - 586, 598, 610, 622, 634, 646, 658, 670, - 682, 694, 706, 718, 730, 742, 754, 766, - 778, 790, 802, 814, 826, 838, 850, 862, - 874, 886, 898, 910, 922, 934, 946, 958, - 970, 982, 994, 1006, 1018, 1030, 1042, 1054, - 1066, 1078, 1090, 1102, 1114, 1126, 1138, 1150, - 1162, 1174, 1186, 1198, 1210, 1222, 1234, 1246, - 1258, 1270, 1282, 1294, 1306, 1318, 1330, 1342, - 1354, 1366, 1378, 1390, 1402, 1414, 1426, 1438, - 1450, 1462, 1474, 1486, 1498, 1510, 1522, 1534, - 1546, 1558, 1570, 1582, 1594, 1606, 1618, 1630, - 1642, 1654, 1678, 1690, 1702, 1714, 1726, 1738, - 1750, 1762, 1774, 1786, 1798, 1810, 1822, 1834, - 1846, 1858, 1870, 1882, 1894, 1906, 1918, 1930, - 1942, 1954, 1966, 1978, 1990, 2002, 2014, 2026, - 2038, 2050, 2062, 2074, 2086, 2098, 2110, 2122, - 2134, 2146, 2158, 2170, 2182, 2194, 2206, 2218, - 2230, 2242, 2254, 2266, 2278, 2290, 2302, 2314, - 2326, 2338, 2350, 2362, 2374, 2386, 2398, 2410, - 2422, 2434, 2446, 2458, 2470, 2482, 2494, 2506, - 2518, 2530, 2542, 2554, 2566, 2578, 2590, 2602, - 2614, 2626, 2638, 2650, 2662, 2674, 2686, 2698, - 2710, 2722, 2734, 2746, 2758, 2770, 2782, 2794, - 2806, 2818, 2830, 2842, 2854, 2866, 2878, 2890, - 2902, 2914, 2926, 2938, 2950, 2962, 2974, 2986, - 2998, 3010, 3022, 3034, 3046, 3058, 3070, 3082, - 3094, 3106, 3118, 3130, 3142, 3154, 3166, 3178, - 3190, 3202, 3214, 3226, 3238, 3250, 3262, 3274, - 3286, 3298, 3310, 3322, 3334, 3346, 3358, 3370, - 3382, 3394, 3406, 3418, 3430, 3442, 3454, 3466, - 3478, 3490, 3502, 3514, 3526, 3538, 3550, 3562, - 3574, 3586, 3598, 3610, 3622, 3634, 3646, 3658, - 3670, 3682, 3694, 3706, 3718, 3730, 3742, 3754, - 3766, 3778, 3790, 3802, 3814, 3826, 3838, 3850, - 3862, 3874, 3886, 3898, 3910, 3922, 3934, 3946, - 3958, 3970, 3982, 3994, 4006, 4018, 4030, 4042, - 4054, 4066, 4078, 4090, 4102, 4114, 4126, 4138, - 4150, 4174, 4186, 4198, 4210, 4222, 4234, 4246, - 4258, 4270, 4282, 4294, 4306, 4318, 4330, 4342, - 4354, 4366, 4378, 4390, 4402, 4414, 4426, 4438, - 4450, 4462, 4474, 4486, 4498, 4510, 4522, 4534, - 4546, 4558, 4570, 4582, 4594, 4606, 4618, 4630, - 4642, 4654, 4666, 4678, 4690, 4702, 4714, 4726, - 4738, 4750, 4762, 4774, 4786, 4798, 4810, 4822, - 4834, 4846, 4858, 4870, 4882, 4894, 4906, 4918, - 4930, 4942, 4954, 4966, 4978, 4990, 5002, 5014, - 5026, 5038, 5050, 5062, 5074, 5086, 5098, 5110, - 5122, 5134, 5146, 5158, 5170, 5182, 5194, 5206, - 5218, 5230, 5242, 5254, 5266, 5278, 5290, 5302, - 5314, 5326, 5338, 5350, 5362, 5374, 5386, 5398, - 5410, 5422, 5434, 5446, 5458, 5470, 5482, 5494, - 5506, 5518, 5530, 5542, 5554, 5566, 5578, 5590, - 5602, 5614, 5626, 5638, 5650, 5662, 5674, 5686, - 5698, 5710, 5722, 5734, 5746, 5758, 5770, 5782, - 5794, 5806, 5818, 5830, 5842, 5854, 5866, 5878, - 5890, 5902, 5914, 5926, 5938, 5950, 5962, 5974, - 5986, 5998, 6010, 6022, 6034, 6046, 6058, 6070, - 6082, 6094, 6106, 6118, 6130, 6142, 6154, 6166, - 6178, 6190, 6202, 6214, 6226, 6238, 6250, 6262, - 6274, 6286, 6298, 6310, 6322, 6334, 6346, 6358, - 6370, 6382, 6394, 6406, 6418, 6430, 6442, 6454, - 6466, 6478, 6490, 6502, 6514, 6526, 6538, 6550, - 6562, 6574, 6586, 6598, 6610, 6622, 6634, 6646, - 6670, 6682, 6694, 6706, 6718, 6730, 6742, 6754, - 6766, 6778, 6790, 6802, 6814, 6826, 6838, 6850, - 6862, 6874, 6886, 6898, 6910, 6922, 6934, 6946, - 6958, 6970, 6982, 6994, 7006, 7018, 7030, 7042, - 7054, 7066, 7078, 7090, 7102, 7114, 7126, 7138, - 7150, 7162, 7174, 7186, 7198, 7210, 7222, 7234, - 7246, 7258, 7270, 7282, 7294, 7306, 7318, 7330, - 7342, 7354, 7366, 7378, 7390, 7402, 7414, 7426, - 7438, 7450, 7462, 7474, 7486, 7498, 7510, 7522, - 7534, 7546, 7558, 7570, 7582, 7594, 7606, 7618, - 7630, 7642, 7654, 7666, 7678, 7690, 7702, 7714, - 7726, 7738, 7750, 7762, 7774, 7786, 7798, 7810, - 7822, 7834, 7846, 7858, 7870, 7882, 7894, 7906, - 7918, 7930, 7942, 7954, 7966, 7978, 7990, 8002, - 8014, 8026, 8038, 8050, 8062, 8074, 8086, 8098, - 8110, 8122, 8134, 8146, 8158, 8170, 8182, 8194, - 8206, 8218, 8230, 8242, 8254, 8266, 8278, 8290, - 8302, 8314, 8326, 8338, 8350, 8362, 8374, 8386, - 8398, 8410, 8422, 8434, 8446, 8458, 8470, 8482, - 8494, 8506, 8518, 8530, 8542, 8554, 8566, 8578, - 8590, 8602, 8614, 8626, 8638, 8650, 8662, 8674, - 8686, 8698, 8710, 8722, 8734, 8746, 8758, 8770, - 8782, 8794, 8806, 8818, 8830, 8842, 8854, 8866, - 8878, 8890, 8902, 8914, 8926, 8938, 8950, 8962, - 8974, 8986, 8998, 9010, 9022, 9034, 9046, 9058, - 9070, 9082, 9094, 9106, 9118, 9130, 9142, 9166, - 9178, 9190, 9202, 9214, 9226, 9238, 9250, 9262, - 9274, 9286, 9298, 9310, 9322, 9334, 9346, 9358, - 9370, 9382, 9394, 9406, 9418, 9430, 9442, 9454, - 9466, 9478, 9490, 9502, 9514, 9526, 9538, 9550, - 9562, 9574, 9586, 9598, 9610, 9622, 9634, 9646, - 9658, 9670, 9682, 9694, 9706, 9718, 9730, 9742, - 9754, 9766, 9778, 9790, 9802, 9814, 9826, 9838, - 9850, 9862, 9874, 9886, 9898, 9910, 9922, 9934, - 9946, 9958, 9970, 9982, }, - /* 7 */ - {11, 23, 35, 47, 59, 71, 83, 95, - 107, 119, 131, 143, 155, 167, 179, 191, - 203, 215, 227, 239, 251, 263, 275, 287, - 299, 311, 323, 335, 347, 359, 371, 383, - 395, 407, 419, 431, 443, 455, 467, 479, - 491, 503, 515, 527, 539, 551, 563, 575, - 587, 599, 611, 623, 635, 647, 659, 671, - 683, 695, 707, 719, 731, 743, 755, 767, - 779, 791, 803, 815, 827, 839, 851, 863, - 875, 887, 899, 911, 923, 935, 947, 959, - 971, 983, 995, 1007, 1019, 1031, 1043, 1055, - 1067, 1079, 1091, 1103, 1115, 1127, 1139, 1151, - 1163, 1175, 1187, 1199, 1211, 1223, 1235, 1247, - 1259, 1271, 1283, 1295, 1307, 1319, 1331, 1343, - 1355, 1367, 1379, 1391, 1403, 1415, 1427, 1439, - 1451, 1463, 1475, 1487, 1499, 1511, 1523, 1535, - 1547, 1559, 1571, 1583, 1595, 1607, 1619, 1631, - 1643, 1655, 1679, 1691, 1703, 1715, 1727, 1739, - 1751, 1763, 1775, 1787, 1799, 1811, 1823, 1835, - 1847, 1859, 1871, 1883, 1895, 1907, 1919, 1931, - 1943, 1955, 1967, 1979, 1991, 2003, 2015, 2027, - 2039, 2051, 2063, 2075, 2087, 2099, 2111, 2123, - 2135, 2147, 2159, 2171, 2183, 2195, 2207, 2219, - 2231, 2243, 2255, 2267, 2279, 2291, 2303, 2315, - 2327, 2339, 2351, 2363, 2375, 2387, 2399, 2411, - 2423, 2435, 2447, 2459, 2471, 2483, 2495, 2507, - 2519, 2531, 2543, 2555, 2567, 2579, 2591, 2603, - 2615, 2627, 2639, 2651, 2663, 2675, 2687, 2699, - 2711, 2723, 2735, 2747, 2759, 2771, 2783, 2795, - 2807, 2819, 2831, 2843, 2855, 2867, 2879, 2891, - 2903, 2915, 2927, 2939, 2951, 2963, 2975, 2987, - 2999, 3011, 3023, 3035, 3047, 3059, 3071, 3083, - 3095, 3107, 3119, 3131, 3143, 3155, 3167, 3179, - 3191, 3203, 3215, 3227, 3239, 3251, 3263, 3275, - 3287, 3299, 3311, 3323, 3335, 3347, 3359, 3371, - 3383, 3395, 3407, 3419, 3431, 3443, 3455, 3467, - 3479, 3491, 3503, 3515, 3527, 3539, 3551, 3563, - 3575, 3587, 3599, 3611, 3623, 3635, 3647, 3659, - 3671, 3683, 3695, 3707, 3719, 3731, 3743, 3755, - 3767, 3779, 3791, 3803, 3815, 3827, 3839, 3851, - 3863, 3875, 3887, 3899, 3911, 3923, 3935, 3947, - 3959, 3971, 3983, 3995, 4007, 4019, 4031, 4043, - 4055, 4067, 4079, 4091, 4103, 4115, 4127, 4139, - 4151, 4175, 4187, 4199, 4211, 4223, 4235, 4247, - 4259, 4271, 4283, 4295, 4307, 4319, 4331, 4343, - 4355, 4367, 4379, 4391, 4403, 4415, 4427, 4439, - 4451, 4463, 4475, 4487, 4499, 4511, 4523, 4535, - 4547, 4559, 4571, 4583, 4595, 4607, 4619, 4631, - 4643, 4655, 4667, 4679, 4691, 4703, 4715, 4727, - 4739, 4751, 4763, 4775, 4787, 4799, 4811, 4823, - 4835, 4847, 4859, 4871, 4883, 4895, 4907, 4919, - 4931, 4943, 4955, 4967, 4979, 4991, 5003, 5015, - 5027, 5039, 5051, 5063, 5075, 5087, 5099, 5111, - 5123, 5135, 5147, 5159, 5171, 5183, 5195, 5207, - 5219, 5231, 5243, 5255, 5267, 5279, 5291, 5303, - 5315, 5327, 5339, 5351, 5363, 5375, 5387, 5399, - 5411, 5423, 5435, 5447, 5459, 5471, 5483, 5495, - 5507, 5519, 5531, 5543, 5555, 5567, 5579, 5591, - 5603, 5615, 5627, 5639, 5651, 5663, 5675, 5687, - 5699, 5711, 5723, 5735, 5747, 5759, 5771, 5783, - 5795, 5807, 5819, 5831, 5843, 5855, 5867, 5879, - 5891, 5903, 5915, 5927, 5939, 5951, 5963, 5975, - 5987, 5999, 6011, 6023, 6035, 6047, 6059, 6071, - 6083, 6095, 6107, 6119, 6131, 6143, 6155, 6167, - 6179, 6191, 6203, 6215, 6227, 6239, 6251, 6263, - 6275, 6287, 6299, 6311, 6323, 6335, 6347, 6359, - 6371, 6383, 6395, 6407, 6419, 6431, 6443, 6455, - 6467, 6479, 6491, 6503, 6515, 6527, 6539, 6551, - 6563, 6575, 6587, 6599, 6611, 6623, 6635, 6647, - 6671, 6683, 6695, 6707, 6719, 6731, 6743, 6755, - 6767, 6779, 6791, 6803, 6815, 6827, 6839, 6851, - 6863, 6875, 6887, 6899, 6911, 6923, 6935, 6947, - 6959, 6971, 6983, 6995, 7007, 7019, 7031, 7043, - 7055, 7067, 7079, 7091, 7103, 7115, 7127, 7139, - 7151, 7163, 7175, 7187, 7199, 7211, 7223, 7235, - 7247, 7259, 7271, 7283, 7295, 7307, 7319, 7331, - 7343, 7355, 7367, 7379, 7391, 7403, 7415, 7427, - 7439, 7451, 7463, 7475, 7487, 7499, 7511, 7523, - 7535, 7547, 7559, 7571, 7583, 7595, 7607, 7619, - 7631, 7643, 7655, 7667, 7679, 7691, 7703, 7715, - 7727, 7739, 7751, 7763, 7775, 7787, 7799, 7811, - 7823, 7835, 7847, 7859, 7871, 7883, 7895, 7907, - 7919, 7931, 7943, 7955, 7967, 7979, 7991, 8003, - 8015, 8027, 8039, 8051, 8063, 8075, 8087, 8099, - 8111, 8123, 8135, 8147, 8159, 8171, 8183, 8195, - 8207, 8219, 8231, 8243, 8255, 8267, 8279, 8291, - 8303, 8315, 8327, 8339, 8351, 8363, 8375, 8387, - 8399, 8411, 8423, 8435, 8447, 8459, 8471, 8483, - 8495, 8507, 8519, 8531, 8543, 8555, 8567, 8579, - 8591, 8603, 8615, 8627, 8639, 8651, 8663, 8675, - 8687, 8699, 8711, 8723, 8735, 8747, 8759, 8771, - 8783, 8795, 8807, 8819, 8831, 8843, 8855, 8867, - 8879, 8891, 8903, 8915, 8927, 8939, 8951, 8963, - 8975, 8987, 8999, 9011, 9023, 9035, 9047, 9059, - 9071, 9083, 9095, 9107, 9119, 9131, 9143, 9167, - 9179, 9191, 9203, 9215, 9227, 9239, 9251, 9263, - 9275, 9287, 9299, 9311, 9323, 9335, 9347, 9359, - 9371, 9383, 9395, 9407, 9419, 9431, 9443, 9455, - 9467, 9479, 9491, 9503, 9515, 9527, 9539, 9551, - 9563, 9575, 9587, 9599, 9611, 9623, 9635, 9647, - 9659, 9671, 9683, 9695, 9707, 9719, 9731, 9743, - 9755, 9767, 9779, 9791, 9803, 9815, 9827, 9839, - 9851, 9863, 9875, 9887, 9899, 9911, 9923, 9935, - 9947, 9959, 9971, 9983, }, - /* 8 */ - {12, 24, 36, 48, 60, 72, 84, 96, - 108, 120, 132, 144, 156, 168, 180, 192, - 204, 216, 228, 240, 252, 264, 276, 288, - 300, 312, 324, 336, 348, 360, 372, 384, - 396, 408, 420, 432, 444, 456, 468, 480, - 492, 504, 516, 528, 540, 552, 564, 576, - 588, 600, 612, 624, 636, 648, 660, 672, - 684, 696, 708, 720, 732, 744, 756, 768, - 780, 792, 804, 816, 828, 840, 852, 864, - 876, 888, 900, 912, 924, 936, 948, 960, - 972, 984, 996, 1008, 1020, 1032, 1044, 1056, - 1068, 1080, 1092, 1104, 1116, 1128, 1140, 1152, - 1164, 1176, 1188, 1200, 1212, 1224, 1236, 1248, - 1260, 1272, 1284, 1296, 1308, 1320, 1332, 1344, - 1356, 1368, 1380, 1392, 1404, 1416, 1428, 1440, - 1452, 1464, 1476, 1488, 1500, 1512, 1524, 1536, - 1548, 1560, 1572, 1584, 1596, 1608, 1620, 1632, - 1644, 1656, 1668, 1680, 1692, 1704, 1716, 1728, - 1740, 1752, 1764, 1776, 1788, 1800, 1812, 1824, - 1836, 1848, 1860, 1872, 1884, 1896, 1908, 1920, - 1932, 1944, 1956, 1968, 1980, 1992, 2004, 2016, - 2028, 2040, 2052, 2064, 2076, 2088, 2100, 2112, - 2124, 2136, 2148, 2160, 2172, 2184, 2196, 2208, - 2220, 2232, 2244, 2256, 2268, 2280, 2292, 2304, - 2316, 2328, 2340, 2352, 2364, 2376, 2388, 2400, - 2412, 2424, 2436, 2448, 2460, 2472, 2484, 2508, - 2520, 2532, 2544, 2556, 2568, 2580, 2592, 2604, - 2616, 2628, 2640, 2652, 2664, 2676, 2688, 2700, - 2712, 2724, 2736, 2748, 2760, 2772, 2784, 2796, - 2808, 2820, 2832, 2844, 2856, 2868, 2880, 2892, - 2904, 2916, 2928, 2940, 2952, 2964, 2976, 2988, - 3000, 3012, 3024, 3036, 3048, 3060, 3072, 3084, - 3096, 3108, 3120, 3132, 3144, 3156, 3168, 3180, - 3192, 3204, 3216, 3228, 3240, 3252, 3264, 3276, - 3288, 3300, 3312, 3324, 3336, 3348, 3360, 3372, - 3384, 3396, 3408, 3420, 3432, 3444, 3456, 3468, - 3480, 3492, 3504, 3516, 3528, 3540, 3552, 3564, - 3576, 3588, 3600, 3612, 3624, 3636, 3648, 3660, - 3672, 3684, 3696, 3708, 3720, 3732, 3744, 3756, - 3768, 3780, 3792, 3804, 3816, 3828, 3840, 3852, - 3864, 3876, 3888, 3900, 3912, 3924, 3936, 3948, - 3960, 3972, 3984, 3996, 4008, 4020, 4032, 4044, - 4056, 4068, 4080, 4092, 4104, 4116, 4128, 4140, - 4152, 4164, 4176, 4188, 4200, 4212, 4224, 4236, - 4248, 4260, 4272, 4284, 4296, 4308, 4320, 4332, - 4344, 4356, 4368, 4380, 4392, 4404, 4416, 4428, - 4440, 4452, 4464, 4476, 4488, 4500, 4512, 4524, - 4536, 4548, 4560, 4572, 4584, 4596, 4608, 4620, - 4632, 4644, 4656, 4668, 4680, 4692, 4704, 4716, - 4728, 4740, 4752, 4764, 4776, 4788, 4800, 4812, - 4824, 4836, 4848, 4860, 4872, 4884, 4896, 4908, - 4920, 4932, 4944, 4956, 4968, 4980, 5004, 5016, - 5028, 5040, 5052, 5064, 5076, 5088, 5100, 5112, - 5124, 5136, 5148, 5160, 5172, 5184, 5196, 5208, - 5220, 5232, 5244, 5256, 5268, 5280, 5292, 5304, - 5316, 5328, 5340, 5352, 5364, 5376, 5388, 5400, - 5412, 5424, 5436, 5448, 5460, 5472, 5484, 5496, - 5508, 5520, 5532, 5544, 5556, 5568, 5580, 5592, - 5604, 5616, 5628, 5640, 5652, 5664, 5676, 5688, - 5700, 5712, 5724, 5736, 5748, 5760, 5772, 5784, - 5796, 5808, 5820, 5832, 5844, 5856, 5868, 5880, - 5892, 5904, 5916, 5928, 5940, 5952, 5964, 5976, - 5988, 6000, 6012, 6024, 6036, 6048, 6060, 6072, - 6084, 6096, 6108, 6120, 6132, 6144, 6156, 6168, - 6180, 6192, 6204, 6216, 6228, 6240, 6252, 6264, - 6276, 6288, 6300, 6312, 6324, 6336, 6348, 6360, - 6372, 6384, 6396, 6408, 6420, 6432, 6444, 6456, - 6468, 6480, 6492, 6504, 6516, 6528, 6540, 6552, - 6564, 6576, 6588, 6600, 6612, 6624, 6636, 6648, - 6660, 6672, 6684, 6696, 6708, 6720, 6732, 6744, - 6756, 6768, 6780, 6792, 6804, 6816, 6828, 6840, - 6852, 6864, 6876, 6888, 6900, 6912, 6924, 6936, - 6948, 6960, 6972, 6984, 6996, 7008, 7020, 7032, - 7044, 7056, 7068, 7080, 7092, 7104, 7116, 7128, - 7140, 7152, 7164, 7176, 7188, 7200, 7212, 7224, - 7236, 7248, 7260, 7272, 7284, 7296, 7308, 7320, - 7332, 7344, 7356, 7368, 7380, 7392, 7404, 7416, - 7428, 7440, 7452, 7464, 7476, 7500, 7512, 7524, - 7536, 7548, 7560, 7572, 7584, 7596, 7608, 7620, - 7632, 7644, 7656, 7668, 7680, 7692, 7704, 7716, - 7728, 7740, 7752, 7764, 7776, 7788, 7800, 7812, - 7824, 7836, 7848, 7860, 7872, 7884, 7896, 7908, - 7920, 7932, 7944, 7956, 7968, 7980, 7992, 8004, - 8016, 8028, 8040, 8052, 8064, 8076, 8088, 8100, - 8112, 8124, 8136, 8148, 8160, 8172, 8184, 8196, - 8208, 8220, 8232, 8244, 8256, 8268, 8280, 8292, - 8304, 8316, 8328, 8340, 8352, 8364, 8376, 8388, - 8400, 8412, 8424, 8436, 8448, 8460, 8472, 8484, - 8496, 8508, 8520, 8532, 8544, 8556, 8568, 8580, - 8592, 8604, 8616, 8628, 8640, 8652, 8664, 8676, - 8688, 8700, 8712, 8724, 8736, 8748, 8760, 8772, - 8784, 8796, 8808, 8820, 8832, 8844, 8856, 8868, - 8880, 8892, 8904, 8916, 8928, 8940, 8952, 8964, - 8976, 8988, 9000, 9012, 9024, 9036, 9048, 9060, - 9072, 9084, 9096, 9108, 9120, 9132, 9144, 9156, - 9168, 9180, 9192, 9204, 9216, 9228, 9240, 9252, - 9264, 9276, 9288, 9300, 9312, 9324, 9336, 9348, - 9360, 9372, 9384, 9396, 9408, 9420, 9432, 9444, - 9456, 9468, 9480, 9492, 9504, 9516, 9528, 9540, - 9552, 9564, 9576, 9588, 9600, 9612, 9624, 9636, - 9648, 9660, 9672, 9684, 9696, 9708, 9720, 9732, - 9744, 9756, 9768, 9780, 9792, 9804, 9816, 9828, - 9840, 9852, 9864, 9876, 9888, 9900, 9912, 9924, - 9936, 9948, 9960, 9972, }, - /* 9 */ - {13, 25, 37, 49, 61, 73, 85, 97, - 109, 121, 133, 145, 157, 169, 181, 193, - 205, 217, 229, 241, 253, 265, 277, 289, - 301, 313, 325, 337, 349, 361, 373, 385, - 397, 409, 421, 433, 445, 457, 469, 481, - 493, 505, 517, 529, 541, 553, 565, 577, - 589, 601, 613, 625, 637, 649, 661, 673, - 685, 697, 709, 721, 733, 745, 757, 769, - 781, 793, 805, 817, 829, 841, 853, 865, - 877, 889, 901, 913, 925, 937, 949, 961, - 973, 985, 997, 1009, 1021, 1033, 1045, 1057, - 1069, 1081, 1093, 1105, 1117, 1129, 1141, 1153, - 1165, 1177, 1189, 1201, 1213, 1225, 1237, 1249, - 1261, 1273, 1285, 1297, 1309, 1321, 1333, 1345, - 1357, 1369, 1381, 1393, 1405, 1417, 1429, 1441, - 1453, 1465, 1477, 1489, 1501, 1513, 1525, 1537, - 1549, 1561, 1573, 1585, 1597, 1609, 1621, 1633, - 1645, 1657, 1669, 1681, 1693, 1705, 1717, 1729, - 1741, 1753, 1765, 1777, 1789, 1801, 1813, 1825, - 1837, 1849, 1861, 1873, 1885, 1897, 1909, 1921, - 1933, 1945, 1957, 1969, 1981, 1993, 2005, 2017, - 2029, 2041, 2053, 2065, 2077, 2089, 2101, 2113, - 2125, 2137, 2149, 2161, 2173, 2185, 2197, 2209, - 2221, 2233, 2245, 2257, 2269, 2281, 2293, 2305, - 2317, 2329, 2341, 2353, 2365, 2377, 2389, 2401, - 2413, 2425, 2437, 2449, 2461, 2473, 2485, 2509, - 2521, 2533, 2545, 2557, 2569, 2581, 2593, 2605, - 2617, 2629, 2641, 2653, 2665, 2677, 2689, 2701, - 2713, 2725, 2737, 2749, 2761, 2773, 2785, 2797, - 2809, 2821, 2833, 2845, 2857, 2869, 2881, 2893, - 2905, 2917, 2929, 2941, 2953, 2965, 2977, 2989, - 3001, 3013, 3025, 3037, 3049, 3061, 3073, 3085, - 3097, 3109, 3121, 3133, 3145, 3157, 3169, 3181, - 3193, 3205, 3217, 3229, 3241, 3253, 3265, 3277, - 3289, 3301, 3313, 3325, 3337, 3349, 3361, 3373, - 3385, 3397, 3409, 3421, 3433, 3445, 3457, 3469, - 3481, 3493, 3505, 3517, 3529, 3541, 3553, 3565, - 3577, 3589, 3601, 3613, 3625, 3637, 3649, 3661, - 3673, 3685, 3697, 3709, 3721, 3733, 3745, 3757, - 3769, 3781, 3793, 3805, 3817, 3829, 3841, 3853, - 3865, 3877, 3889, 3901, 3913, 3925, 3937, 3949, - 3961, 3973, 3985, 3997, 4009, 4021, 4033, 4045, - 4057, 4069, 4081, 4093, 4105, 4117, 4129, 4141, - 4153, 4165, 4177, 4189, 4201, 4213, 4225, 4237, - 4249, 4261, 4273, 4285, 4297, 4309, 4321, 4333, - 4345, 4357, 4369, 4381, 4393, 4405, 4417, 4429, - 4441, 4453, 4465, 4477, 4489, 4501, 4513, 4525, - 4537, 4549, 4561, 4573, 4585, 4597, 4609, 4621, - 4633, 4645, 4657, 4669, 4681, 4693, 4705, 4717, - 4729, 4741, 4753, 4765, 4777, 4789, 4801, 4813, - 4825, 4837, 4849, 4861, 4873, 4885, 4897, 4909, - 4921, 4933, 4945, 4957, 4969, 4981, 5005, 5017, - 5029, 5041, 5053, 5065, 5077, 5089, 5101, 5113, - 5125, 5137, 5149, 5161, 5173, 5185, 5197, 5209, - 5221, 5233, 5245, 5257, 5269, 5281, 5293, 5305, - 5317, 5329, 5341, 5353, 5365, 5377, 5389, 5401, - 5413, 5425, 5437, 5449, 5461, 5473, 5485, 5497, - 5509, 5521, 5533, 5545, 5557, 5569, 5581, 5593, - 5605, 5617, 5629, 5641, 5653, 5665, 5677, 5689, - 5701, 5713, 5725, 5737, 5749, 5761, 5773, 5785, - 5797, 5809, 5821, 5833, 5845, 5857, 5869, 5881, - 5893, 5905, 5917, 5929, 5941, 5953, 5965, 5977, - 5989, 6001, 6013, 6025, 6037, 6049, 6061, 6073, - 6085, 6097, 6109, 6121, 6133, 6145, 6157, 6169, - 6181, 6193, 6205, 6217, 6229, 6241, 6253, 6265, - 6277, 6289, 6301, 6313, 6325, 6337, 6349, 6361, - 6373, 6385, 6397, 6409, 6421, 6433, 6445, 6457, - 6469, 6481, 6493, 6505, 6517, 6529, 6541, 6553, - 6565, 6577, 6589, 6601, 6613, 6625, 6637, 6649, - 6661, 6673, 6685, 6697, 6709, 6721, 6733, 6745, - 6757, 6769, 6781, 6793, 6805, 6817, 6829, 6841, - 6853, 6865, 6877, 6889, 6901, 6913, 6925, 6937, - 6949, 6961, 6973, 6985, 6997, 7009, 7021, 7033, - 7045, 7057, 7069, 7081, 7093, 7105, 7117, 7129, - 7141, 7153, 7165, 7177, 7189, 7201, 7213, 7225, - 7237, 7249, 7261, 7273, 7285, 7297, 7309, 7321, - 7333, 7345, 7357, 7369, 7381, 7393, 7405, 7417, - 7429, 7441, 7453, 7465, 7477, 7501, 7513, 7525, - 7537, 7549, 7561, 7573, 7585, 7597, 7609, 7621, - 7633, 7645, 7657, 7669, 7681, 7693, 7705, 7717, - 7729, 7741, 7753, 7765, 7777, 7789, 7801, 7813, - 7825, 7837, 7849, 7861, 7873, 7885, 7897, 7909, - 7921, 7933, 7945, 7957, 7969, 7981, 7993, 8005, - 8017, 8029, 8041, 8053, 8065, 8077, 8089, 8101, - 8113, 8125, 8137, 8149, 8161, 8173, 8185, 8197, - 8209, 8221, 8233, 8245, 8257, 8269, 8281, 8293, - 8305, 8317, 8329, 8341, 8353, 8365, 8377, 8389, - 8401, 8413, 8425, 8437, 8449, 8461, 8473, 8485, - 8497, 8509, 8521, 8533, 8545, 8557, 8569, 8581, - 8593, 8605, 8617, 8629, 8641, 8653, 8665, 8677, - 8689, 8701, 8713, 8725, 8737, 8749, 8761, 8773, - 8785, 8797, 8809, 8821, 8833, 8845, 8857, 8869, - 8881, 8893, 8905, 8917, 8929, 8941, 8953, 8965, - 8977, 8989, 9001, 9013, 9025, 9037, 9049, 9061, - 9073, 9085, 9097, 9109, 9121, 9133, 9145, 9157, - 9169, 9181, 9193, 9205, 9217, 9229, 9241, 9253, - 9265, 9277, 9289, 9301, 9313, 9325, 9337, 9349, - 9361, 9373, 9385, 9397, 9409, 9421, 9433, 9445, - 9457, 9469, 9481, 9493, 9505, 9517, 9529, 9541, - 9553, 9565, 9577, 9589, 9601, 9613, 9625, 9637, - 9649, 9661, 9673, 9685, 9697, 9709, 9721, 9733, - 9745, 9757, 9769, 9781, 9793, 9805, 9817, 9829, - 9841, 9853, 9865, 9877, 9889, 9901, 9913, 9925, - 9937, 9949, 9961, 9973, }, - /* 10 */ - {14, 26, 38, 50, 62, 74, 86, 98, - 110, 122, 134, 146, 158, 170, 182, 194, - 206, 218, 230, 242, 254, 266, 278, 290, - 302, 314, 326, 338, 350, 362, 374, 386, - 398, 410, 422, 434, 446, 458, 470, 482, - 494, 506, 518, 530, 542, 554, 566, 578, - 590, 602, 614, 626, 638, 650, 662, 674, - 686, 698, 710, 722, 734, 746, 758, 770, - 782, 794, 806, 818, 830, 842, 854, 866, - 878, 890, 902, 914, 926, 938, 950, 962, - 974, 986, 998, 1010, 1022, 1034, 1046, 1058, - 1070, 1082, 1094, 1106, 1118, 1130, 1142, 1154, - 1166, 1178, 1190, 1202, 1214, 1226, 1238, 1250, - 1262, 1274, 1286, 1298, 1310, 1322, 1334, 1346, - 1358, 1370, 1382, 1394, 1406, 1418, 1430, 1442, - 1454, 1466, 1478, 1490, 1502, 1514, 1526, 1538, - 1550, 1562, 1574, 1586, 1598, 1610, 1622, 1634, - 1646, 1658, 1670, 1682, 1694, 1706, 1718, 1730, - 1742, 1754, 1766, 1778, 1790, 1802, 1814, 1826, - 1838, 1850, 1862, 1874, 1886, 1898, 1910, 1922, - 1934, 1946, 1958, 1970, 1982, 1994, 2006, 2018, - 2030, 2042, 2054, 2066, 2078, 2090, 2102, 2114, - 2126, 2138, 2150, 2162, 2174, 2186, 2198, 2210, - 2222, 2234, 2246, 2258, 2270, 2282, 2294, 2306, - 2318, 2330, 2342, 2354, 2366, 2378, 2390, 2402, - 2414, 2426, 2438, 2450, 2462, 2474, 2486, 2510, - 2522, 2534, 2546, 2558, 2570, 2582, 2594, 2606, - 2618, 2630, 2642, 2654, 2666, 2678, 2690, 2702, - 2714, 2726, 2738, 2750, 2762, 2774, 2786, 2798, - 2810, 2822, 2834, 2846, 2858, 2870, 2882, 2894, - 2906, 2918, 2930, 2942, 2954, 2966, 2978, 2990, - 3002, 3014, 3026, 3038, 3050, 3062, 3074, 3086, - 3098, 3110, 3122, 3134, 3146, 3158, 3170, 3182, - 3194, 3206, 3218, 3230, 3242, 3254, 3266, 3278, - 3290, 3302, 3314, 3326, 3338, 3350, 3362, 3374, - 3386, 3398, 3410, 3422, 3434, 3446, 3458, 3470, - 3482, 3494, 3506, 3518, 3530, 3542, 3554, 3566, - 3578, 3590, 3602, 3614, 3626, 3638, 3650, 3662, - 3674, 3686, 3698, 3710, 3722, 3734, 3746, 3758, - 3770, 3782, 3794, 3806, 3818, 3830, 3842, 3854, - 3866, 3878, 3890, 3902, 3914, 3926, 3938, 3950, - 3962, 3974, 3986, 3998, 4010, 4022, 4034, 4046, - 4058, 4070, 4082, 4094, 4106, 4118, 4130, 4142, - 4154, 4166, 4178, 4190, 4202, 4214, 4226, 4238, - 4250, 4262, 4274, 4286, 4298, 4310, 4322, 4334, - 4346, 4358, 4370, 4382, 4394, 4406, 4418, 4430, - 4442, 4454, 4466, 4478, 4490, 4502, 4514, 4526, - 4538, 4550, 4562, 4574, 4586, 4598, 4610, 4622, - 4634, 4646, 4658, 4670, 4682, 4694, 4706, 4718, - 4730, 4742, 4754, 4766, 4778, 4790, 4802, 4814, - 4826, 4838, 4850, 4862, 4874, 4886, 4898, 4910, - 4922, 4934, 4946, 4958, 4970, 4982, 5006, 5018, - 5030, 5042, 5054, 5066, 5078, 5090, 5102, 5114, - 5126, 5138, 5150, 5162, 5174, 5186, 5198, 5210, - 5222, 5234, 5246, 5258, 5270, 5282, 5294, 5306, - 5318, 5330, 5342, 5354, 5366, 5378, 5390, 5402, - 5414, 5426, 5438, 5450, 5462, 5474, 5486, 5498, - 5510, 5522, 5534, 5546, 5558, 5570, 5582, 5594, - 5606, 5618, 5630, 5642, 5654, 5666, 5678, 5690, - 5702, 5714, 5726, 5738, 5750, 5762, 5774, 5786, - 5798, 5810, 5822, 5834, 5846, 5858, 5870, 5882, - 5894, 5906, 5918, 5930, 5942, 5954, 5966, 5978, - 5990, 6002, 6014, 6026, 6038, 6050, 6062, 6074, - 6086, 6098, 6110, 6122, 6134, 6146, 6158, 6170, - 6182, 6194, 6206, 6218, 6230, 6242, 6254, 6266, - 6278, 6290, 6302, 6314, 6326, 6338, 6350, 6362, - 6374, 6386, 6398, 6410, 6422, 6434, 6446, 6458, - 6470, 6482, 6494, 6506, 6518, 6530, 6542, 6554, - 6566, 6578, 6590, 6602, 6614, 6626, 6638, 6650, - 6662, 6674, 6686, 6698, 6710, 6722, 6734, 6746, - 6758, 6770, 6782, 6794, 6806, 6818, 6830, 6842, - 6854, 6866, 6878, 6890, 6902, 6914, 6926, 6938, - 6950, 6962, 6974, 6986, 6998, 7010, 7022, 7034, - 7046, 7058, 7070, 7082, 7094, 7106, 7118, 7130, - 7142, 7154, 7166, 7178, 7190, 7202, 7214, 7226, - 7238, 7250, 7262, 7274, 7286, 7298, 7310, 7322, - 7334, 7346, 7358, 7370, 7382, 7394, 7406, 7418, - 7430, 7442, 7454, 7466, 7478, 7502, 7514, 7526, - 7538, 7550, 7562, 7574, 7586, 7598, 7610, 7622, - 7634, 7646, 7658, 7670, 7682, 7694, 7706, 7718, - 7730, 7742, 7754, 7766, 7778, 7790, 7802, 7814, - 7826, 7838, 7850, 7862, 7874, 7886, 7898, 7910, - 7922, 7934, 7946, 7958, 7970, 7982, 7994, 8006, - 8018, 8030, 8042, 8054, 8066, 8078, 8090, 8102, - 8114, 8126, 8138, 8150, 8162, 8174, 8186, 8198, - 8210, 8222, 8234, 8246, 8258, 8270, 8282, 8294, - 8306, 8318, 8330, 8342, 8354, 8366, 8378, 8390, - 8402, 8414, 8426, 8438, 8450, 8462, 8474, 8486, - 8498, 8510, 8522, 8534, 8546, 8558, 8570, 8582, - 8594, 8606, 8618, 8630, 8642, 8654, 8666, 8678, - 8690, 8702, 8714, 8726, 8738, 8750, 8762, 8774, - 8786, 8798, 8810, 8822, 8834, 8846, 8858, 8870, - 8882, 8894, 8906, 8918, 8930, 8942, 8954, 8966, - 8978, 8990, 9002, 9014, 9026, 9038, 9050, 9062, - 9074, 9086, 9098, 9110, 9122, 9134, 9146, 9158, - 9170, 9182, 9194, 9206, 9218, 9230, 9242, 9254, - 9266, 9278, 9290, 9302, 9314, 9326, 9338, 9350, - 9362, 9374, 9386, 9398, 9410, 9422, 9434, 9446, - 9458, 9470, 9482, 9494, 9506, 9518, 9530, 9542, - 9554, 9566, 9578, 9590, 9602, 9614, 9626, 9638, - 9650, 9662, 9674, 9686, 9698, 9710, 9722, 9734, - 9746, 9758, 9770, 9782, 9794, 9806, 9818, 9830, - 9842, 9854, 9866, 9878, 9890, 9902, 9914, 9926, - 9938, 9950, 9962, 9974, }, - /* 11 */ - {15, 27, 39, 51, 63, 75, 87, 99, - 111, 123, 135, 147, 159, 171, 183, 195, - 207, 219, 231, 243, 255, 267, 279, 291, - 303, 315, 327, 339, 351, 363, 375, 387, - 399, 411, 423, 435, 447, 459, 471, 483, - 495, 507, 519, 531, 543, 555, 567, 579, - 591, 603, 615, 627, 639, 651, 663, 675, - 687, 699, 711, 723, 735, 747, 759, 771, - 783, 795, 807, 819, 831, 843, 855, 867, - 879, 891, 903, 915, 927, 939, 951, 963, - 975, 987, 999, 1011, 1023, 1035, 1047, 1059, - 1071, 1083, 1095, 1107, 1119, 1131, 1143, 1155, - 1167, 1179, 1191, 1203, 1215, 1227, 1239, 1251, - 1263, 1275, 1287, 1299, 1311, 1323, 1335, 1347, - 1359, 1371, 1383, 1395, 1407, 1419, 1431, 1443, - 1455, 1467, 1479, 1491, 1503, 1515, 1527, 1539, - 1551, 1563, 1575, 1587, 1599, 1611, 1623, 1635, - 1647, 1659, 1671, 1683, 1695, 1707, 1719, 1731, - 1743, 1755, 1767, 1779, 1791, 1803, 1815, 1827, - 1839, 1851, 1863, 1875, 1887, 1899, 1911, 1923, - 1935, 1947, 1959, 1971, 1983, 1995, 2007, 2019, - 2031, 2043, 2055, 2067, 2079, 2091, 2103, 2115, - 2127, 2139, 2151, 2163, 2175, 2187, 2199, 2211, - 2223, 2235, 2247, 2259, 2271, 2283, 2295, 2307, - 2319, 2331, 2343, 2355, 2367, 2379, 2391, 2403, - 2415, 2427, 2439, 2451, 2463, 2475, 2487, 2511, - 2523, 2535, 2547, 2559, 2571, 2583, 2595, 2607, - 2619, 2631, 2643, 2655, 2667, 2679, 2691, 2703, - 2715, 2727, 2739, 2751, 2763, 2775, 2787, 2799, - 2811, 2823, 2835, 2847, 2859, 2871, 2883, 2895, - 2907, 2919, 2931, 2943, 2955, 2967, 2979, 2991, - 3003, 3015, 3027, 3039, 3051, 3063, 3075, 3087, - 3099, 3111, 3123, 3135, 3147, 3159, 3171, 3183, - 3195, 3207, 3219, 3231, 3243, 3255, 3267, 3279, - 3291, 3303, 3315, 3327, 3339, 3351, 3363, 3375, - 3387, 3399, 3411, 3423, 3435, 3447, 3459, 3471, - 3483, 3495, 3507, 3519, 3531, 3543, 3555, 3567, - 3579, 3591, 3603, 3615, 3627, 3639, 3651, 3663, - 3675, 3687, 3699, 3711, 3723, 3735, 3747, 3759, - 3771, 3783, 3795, 3807, 3819, 3831, 3843, 3855, - 3867, 3879, 3891, 3903, 3915, 3927, 3939, 3951, - 3963, 3975, 3987, 3999, 4011, 4023, 4035, 4047, - 4059, 4071, 4083, 4095, 4107, 4119, 4131, 4143, - 4155, 4167, 4179, 4191, 4203, 4215, 4227, 4239, - 4251, 4263, 4275, 4287, 4299, 4311, 4323, 4335, - 4347, 4359, 4371, 4383, 4395, 4407, 4419, 4431, - 4443, 4455, 4467, 4479, 4491, 4503, 4515, 4527, - 4539, 4551, 4563, 4575, 4587, 4599, 4611, 4623, - 4635, 4647, 4659, 4671, 4683, 4695, 4707, 4719, - 4731, 4743, 4755, 4767, 4779, 4791, 4803, 4815, - 4827, 4839, 4851, 4863, 4875, 4887, 4899, 4911, - 4923, 4935, 4947, 4959, 4971, 4983, 5007, 5019, - 5031, 5043, 5055, 5067, 5079, 5091, 5103, 5115, - 5127, 5139, 5151, 5163, 5175, 5187, 5199, 5211, - 5223, 5235, 5247, 5259, 5271, 5283, 5295, 5307, - 5319, 5331, 5343, 5355, 5367, 5379, 5391, 5403, - 5415, 5427, 5439, 5451, 5463, 5475, 5487, 5499, - 5511, 5523, 5535, 5547, 5559, 5571, 5583, 5595, - 5607, 5619, 5631, 5643, 5655, 5667, 5679, 5691, - 5703, 5715, 5727, 5739, 5751, 5763, 5775, 5787, - 5799, 5811, 5823, 5835, 5847, 5859, 5871, 5883, - 5895, 5907, 5919, 5931, 5943, 5955, 5967, 5979, - 5991, 6003, 6015, 6027, 6039, 6051, 6063, 6075, - 6087, 6099, 6111, 6123, 6135, 6147, 6159, 6171, - 6183, 6195, 6207, 6219, 6231, 6243, 6255, 6267, - 6279, 6291, 6303, 6315, 6327, 6339, 6351, 6363, - 6375, 6387, 6399, 6411, 6423, 6435, 6447, 6459, - 6471, 6483, 6495, 6507, 6519, 6531, 6543, 6555, - 6567, 6579, 6591, 6603, 6615, 6627, 6639, 6651, - 6663, 6675, 6687, 6699, 6711, 6723, 6735, 6747, - 6759, 6771, 6783, 6795, 6807, 6819, 6831, 6843, - 6855, 6867, 6879, 6891, 6903, 6915, 6927, 6939, - 6951, 6963, 6975, 6987, 6999, 7011, 7023, 7035, - 7047, 7059, 7071, 7083, 7095, 7107, 7119, 7131, - 7143, 7155, 7167, 7179, 7191, 7203, 7215, 7227, - 7239, 7251, 7263, 7275, 7287, 7299, 7311, 7323, - 7335, 7347, 7359, 7371, 7383, 7395, 7407, 7419, - 7431, 7443, 7455, 7467, 7479, 7503, 7515, 7527, - 7539, 7551, 7563, 7575, 7587, 7599, 7611, 7623, - 7635, 7647, 7659, 7671, 7683, 7695, 7707, 7719, - 7731, 7743, 7755, 7767, 7779, 7791, 7803, 7815, - 7827, 7839, 7851, 7863, 7875, 7887, 7899, 7911, - 7923, 7935, 7947, 7959, 7971, 7983, 7995, 8007, - 8019, 8031, 8043, 8055, 8067, 8079, 8091, 8103, - 8115, 8127, 8139, 8151, 8163, 8175, 8187, 8199, - 8211, 8223, 8235, 8247, 8259, 8271, 8283, 8295, - 8307, 8319, 8331, 8343, 8355, 8367, 8379, 8391, - 8403, 8415, 8427, 8439, 8451, 8463, 8475, 8487, - 8499, 8511, 8523, 8535, 8547, 8559, 8571, 8583, - 8595, 8607, 8619, 8631, 8643, 8655, 8667, 8679, - 8691, 8703, 8715, 8727, 8739, 8751, 8763, 8775, - 8787, 8799, 8811, 8823, 8835, 8847, 8859, 8871, - 8883, 8895, 8907, 8919, 8931, 8943, 8955, 8967, - 8979, 8991, 9003, 9015, 9027, 9039, 9051, 9063, - 9075, 9087, 9099, 9111, 9123, 9135, 9147, 9159, - 9171, 9183, 9195, 9207, 9219, 9231, 9243, 9255, - 9267, 9279, 9291, 9303, 9315, 9327, 9339, 9351, - 9363, 9375, 9387, 9399, 9411, 9423, 9435, 9447, - 9459, 9471, 9483, 9495, 9507, 9519, 9531, 9543, - 9555, 9567, 9579, 9591, 9603, 9615, 9627, 9639, - 9651, 9663, 9675, 9687, 9699, 9711, 9723, 9735, - 9747, 9759, 9771, 9783, 9795, 9807, 9819, 9831, - 9843, 9855, 9867, 9879, 9891, 9903, 9915, 9927, - 9939, 9951, 9963, 9975, }, + /* 0 */ + { + 4, 16, 28, 40, 52, 64, 76, 88, 100, 112, 124, 136, 148, + 160, 172, 184, 196, 208, 220, 232, 244, 256, 268, 280, 292, 304, + 316, 328, 340, 352, 364, 376, 388, 400, 412, 424, 436, 448, 460, + 472, 484, 496, 508, 520, 532, 544, 556, 568, 580, 592, 604, 616, + 628, 640, 652, 664, 676, 688, 700, 712, 724, 736, 748, 760, 772, + 784, 796, 808, 820, 844, 856, 868, 880, 892, 904, 916, 928, 940, + 952, 964, 976, 988, 1000, 1012, 1024, 1036, 1048, 1060, 1072, 1084, 1096, + 1108, 1120, 1132, 1144, 1156, 1168, 1180, 1192, 1204, 1216, 1228, 1240, 1252, + 1264, 1276, 1288, 1300, 1312, 1324, 1336, 1348, 1360, 1372, 1384, 1396, 1408, + 1420, 1432, 1444, 1456, 1468, 1480, 1492, 1504, 1516, 1528, 1540, 1552, 1564, + 1576, 1588, 1600, 1612, 1624, 1636, 1648, 1660, 1672, 1684, 1696, 1708, 1720, + 1732, 1744, 1756, 1768, 1780, 1792, 1804, 1816, 1828, 1840, 1852, 1864, 1876, + 1888, 1900, 1912, 1924, 1936, 1948, 1960, 1972, 1984, 1996, 2008, 2020, 2032, + 2044, 2056, 2068, 2080, 2092, 2104, 2116, 2128, 2140, 2152, 2164, 2176, 2188, + 2200, 2212, 2224, 2236, 2248, 2260, 2272, 2284, 2296, 2308, 2320, 2332, 2344, + 2356, 2368, 2380, 2392, 2404, 2416, 2428, 2440, 2452, 2464, 2476, 2488, 2500, + 2512, 2524, 2536, 2548, 2560, 2572, 2584, 2596, 2608, 2620, 2632, 2644, 2656, + 2668, 2680, 2692, 2704, 2716, 2728, 2740, 2752, 2764, 2776, 2788, 2800, 2812, + 2824, 2836, 2848, 2860, 2872, 2884, 2896, 2908, 2920, 2932, 2944, 2956, 2968, + 2980, 2992, 3004, 3016, 3028, 3040, 3052, 3064, 3076, 3088, 3100, 3112, 3124, + 3136, 3148, 3160, 3172, 3184, 3196, 3208, 3220, 3232, 3244, 3256, 3268, 3280, + 3292, 3304, 3316, 3340, 3352, 3364, 3376, 3388, 3400, 3412, 3424, 3436, 3448, + 3460, 3472, 3484, 3496, 3508, 3520, 3532, 3544, 3556, 3568, 3580, 3592, 3604, + 3616, 3628, 3640, 3652, 3664, 3676, 3688, 3700, 3712, 3724, 3736, 3748, 3760, + 3772, 3784, 3796, 3808, 3820, 3832, 3844, 3856, 3868, 3880, 3892, 3904, 3916, + 3928, 3940, 3952, 3964, 3976, 3988, 4000, 4012, 4024, 4036, 4048, 4060, 4072, + 4084, 4096, 4108, 4120, 4132, 4144, 4156, 4168, 4180, 4192, 4204, 4216, 4228, + 4240, 4252, 4264, 4276, 4288, 4300, 4312, 4324, 4336, 4348, 4360, 4372, 4384, + 4396, 4408, 4420, 4432, 4444, 4456, 4468, 4480, 4492, 4504, 4516, 4528, 4540, + 4552, 4564, 4576, 4588, 4600, 4612, 4624, 4636, 4648, 4660, 4672, 4684, 4696, + 4708, 4720, 4732, 4744, 4756, 4768, 4780, 4792, 4804, 4816, 4828, 4840, 4852, + 4864, 4876, 4888, 4900, 4912, 4924, 4936, 4948, 4960, 4972, 4984, 4996, 5008, + 5020, 5032, 5044, 5056, 5068, 5080, 5092, 5104, 5116, 5128, 5140, 5152, 5164, + 5176, 5188, 5200, 5212, 5224, 5236, 5248, 5260, 5272, 5284, 5296, 5308, 5320, + 5332, 5344, 5356, 5368, 5380, 5392, 5404, 5416, 5428, 5440, 5452, 5464, 5476, + 5488, 5500, 5512, 5524, 5536, 5548, 5560, 5572, 5584, 5596, 5608, 5620, 5632, + 5644, 5656, 5668, 5680, 5692, 5704, 5716, 5728, 5740, 5752, 5764, 5776, 5788, + 5800, 5812, 5836, 5848, 5860, 5872, 5884, 5896, 5908, 5920, 5932, 5944, 5956, + 5968, 5980, 5992, 6004, 6016, 6028, 6040, 6052, 6064, 6076, 6088, 6100, 6112, + 6124, 6136, 6148, 6160, 6172, 6184, 6196, 6208, 6220, 6232, 6244, 6256, 6268, + 6280, 6292, 6304, 6316, 6328, 6340, 6352, 6364, 6376, 6388, 6400, 6412, 6424, + 6436, 6448, 6460, 6472, 6484, 6496, 6508, 6520, 6532, 6544, 6556, 6568, 6580, + 6592, 6604, 6616, 6628, 6640, 6652, 6664, 6676, 6688, 6700, 6712, 6724, 6736, + 6748, 6760, 6772, 6784, 6796, 6808, 6820, 6832, 6844, 6856, 6868, 6880, 6892, + 6904, 6916, 6928, 6940, 6952, 6964, 6976, 6988, 7000, 7012, 7024, 7036, 7048, + 7060, 7072, 7084, 7096, 7108, 7120, 7132, 7144, 7156, 7168, 7180, 7192, 7204, + 7216, 7228, 7240, 7252, 7264, 7276, 7288, 7300, 7312, 7324, 7336, 7348, 7360, + 7372, 7384, 7396, 7408, 7420, 7432, 7444, 7456, 7468, 7480, 7492, 7504, 7516, + 7528, 7540, 7552, 7564, 7576, 7588, 7600, 7612, 7624, 7636, 7648, 7660, 7672, + 7684, 7696, 7708, 7720, 7732, 7744, 7756, 7768, 7780, 7792, 7804, 7816, 7828, + 7840, 7852, 7864, 7876, 7888, 7900, 7912, 7924, 7936, 7948, 7960, 7972, 7984, + 7996, 8008, 8020, 8032, 8044, 8056, 8068, 8080, 8092, 8104, 8116, 8128, 8140, + 8152, 8164, 8176, 8188, 8200, 8212, 8224, 8236, 8248, 8260, 8272, 8284, 8296, + 8308, 8332, 8344, 8356, 8368, 8380, 8392, 8404, 8416, 8428, 8440, 8452, 8464, + 8476, 8488, 8500, 8512, 8524, 8536, 8548, 8560, 8572, 8584, 8596, 8608, 8620, + 8632, 8644, 8656, 8668, 8680, 8692, 8704, 8716, 8728, 8740, 8752, 8764, 8776, + 8788, 8800, 8812, 8824, 8836, 8848, 8860, 8872, 8884, 8896, 8908, 8920, 8932, + 8944, 8956, 8968, 8980, 8992, 9004, 9016, 9028, 9040, 9052, 9064, 9076, 9088, + 9100, 9112, 9124, 9136, 9148, 9160, 9172, 9184, 9196, 9208, 9220, 9232, 9244, + 9256, 9268, 9280, 9292, 9304, 9316, 9328, 9340, 9352, 9364, 9376, 9388, 9400, + 9412, 9424, 9436, 9448, 9460, 9472, 9484, 9496, 9508, 9520, 9532, 9544, 9556, + 9568, 9580, 9592, 9604, 9616, 9628, 9640, 9652, 9664, 9676, 9688, 9700, 9712, + 9724, 9736, 9748, 9760, 9772, 9784, 9796, 9808, 9820, 9832, 9844, 9856, 9868, + 9880, 9892, 9904, 9916, 9928, 9940, 9952, 9964, 9976, + }, + /* 1 */ + { + 5, 17, 29, 41, 53, 65, 77, 89, 101, 113, 125, 137, 149, + 161, 173, 185, 197, 209, 221, 233, 245, 257, 269, 281, 293, 305, + 317, 329, 341, 353, 365, 377, 389, 401, 413, 425, 437, 449, 461, + 473, 485, 497, 509, 521, 533, 545, 557, 569, 581, 593, 605, 617, + 629, 641, 653, 665, 677, 689, 701, 713, 725, 737, 749, 761, 773, + 785, 797, 809, 821, 845, 857, 869, 881, 893, 905, 917, 929, 941, + 953, 965, 977, 989, 1001, 1013, 1025, 1037, 1049, 1061, 1073, 1085, 1097, + 1109, 1121, 1133, 1145, 1157, 1169, 1181, 1193, 1205, 1217, 1229, 1241, 1253, + 1265, 1277, 1289, 1301, 1313, 1325, 1337, 1349, 1361, 1373, 1385, 1397, 1409, + 1421, 1433, 1445, 1457, 1469, 1481, 1493, 1505, 1517, 1529, 1541, 1553, 1565, + 1577, 1589, 1601, 1613, 1625, 1637, 1649, 1661, 1673, 1685, 1697, 1709, 1721, + 1733, 1745, 1757, 1769, 1781, 1793, 1805, 1817, 1829, 1841, 1853, 1865, 1877, + 1889, 1901, 1913, 1925, 1937, 1949, 1961, 1973, 1985, 1997, 2009, 2021, 2033, + 2045, 2057, 2069, 2081, 2093, 2105, 2117, 2129, 2141, 2153, 2165, 2177, 2189, + 2201, 2213, 2225, 2237, 2249, 2261, 2273, 2285, 2297, 2309, 2321, 2333, 2345, + 2357, 2369, 2381, 2393, 2405, 2417, 2429, 2441, 2453, 2465, 2477, 2489, 2501, + 2513, 2525, 2537, 2549, 2561, 2573, 2585, 2597, 2609, 2621, 2633, 2645, 2657, + 2669, 2681, 2693, 2705, 2717, 2729, 2741, 2753, 2765, 2777, 2789, 2801, 2813, + 2825, 2837, 2849, 2861, 2873, 2885, 2897, 2909, 2921, 2933, 2945, 2957, 2969, + 2981, 2993, 3005, 3017, 3029, 3041, 3053, 3065, 3077, 3089, 3101, 3113, 3125, + 3137, 3149, 3161, 3173, 3185, 3197, 3209, 3221, 3233, 3245, 3257, 3269, 3281, + 3293, 3305, 3317, 3341, 3353, 3365, 3377, 3389, 3401, 3413, 3425, 3437, 3449, + 3461, 3473, 3485, 3497, 3509, 3521, 3533, 3545, 3557, 3569, 3581, 3593, 3605, + 3617, 3629, 3641, 3653, 3665, 3677, 3689, 3701, 3713, 3725, 3737, 3749, 3761, + 3773, 3785, 3797, 3809, 3821, 3833, 3845, 3857, 3869, 3881, 3893, 3905, 3917, + 3929, 3941, 3953, 3965, 3977, 3989, 4001, 4013, 4025, 4037, 4049, 4061, 4073, + 4085, 4097, 4109, 4121, 4133, 4145, 4157, 4169, 4181, 4193, 4205, 4217, 4229, + 4241, 4253, 4265, 4277, 4289, 4301, 4313, 4325, 4337, 4349, 4361, 4373, 4385, + 4397, 4409, 4421, 4433, 4445, 4457, 4469, 4481, 4493, 4505, 4517, 4529, 4541, + 4553, 4565, 4577, 4589, 4601, 4613, 4625, 4637, 4649, 4661, 4673, 4685, 4697, + 4709, 4721, 4733, 4745, 4757, 4769, 4781, 4793, 4805, 4817, 4829, 4841, 4853, + 4865, 4877, 4889, 4901, 4913, 4925, 4937, 4949, 4961, 4973, 4985, 4997, 5009, + 5021, 5033, 5045, 5057, 5069, 5081, 5093, 5105, 5117, 5129, 5141, 5153, 5165, + 5177, 5189, 5201, 5213, 5225, 5237, 5249, 5261, 5273, 5285, 5297, 5309, 5321, + 5333, 5345, 5357, 5369, 5381, 5393, 5405, 5417, 5429, 5441, 5453, 5465, 5477, + 5489, 5501, 5513, 5525, 5537, 5549, 5561, 5573, 5585, 5597, 5609, 5621, 5633, + 5645, 5657, 5669, 5681, 5693, 5705, 5717, 5729, 5741, 5753, 5765, 5777, 5789, + 5801, 5813, 5837, 5849, 5861, 5873, 5885, 5897, 5909, 5921, 5933, 5945, 5957, + 5969, 5981, 5993, 6005, 6017, 6029, 6041, 6053, 6065, 6077, 6089, 6101, 6113, + 6125, 6137, 6149, 6161, 6173, 6185, 6197, 6209, 6221, 6233, 6245, 6257, 6269, + 6281, 6293, 6305, 6317, 6329, 6341, 6353, 6365, 6377, 6389, 6401, 6413, 6425, + 6437, 6449, 6461, 6473, 6485, 6497, 6509, 6521, 6533, 6545, 6557, 6569, 6581, + 6593, 6605, 6617, 6629, 6641, 6653, 6665, 6677, 6689, 6701, 6713, 6725, 6737, + 6749, 6761, 6773, 6785, 6797, 6809, 6821, 6833, 6845, 6857, 6869, 6881, 6893, + 6905, 6917, 6929, 6941, 6953, 6965, 6977, 6989, 7001, 7013, 7025, 7037, 7049, + 7061, 7073, 7085, 7097, 7109, 7121, 7133, 7145, 7157, 7169, 7181, 7193, 7205, + 7217, 7229, 7241, 7253, 7265, 7277, 7289, 7301, 7313, 7325, 7337, 7349, 7361, + 7373, 7385, 7397, 7409, 7421, 7433, 7445, 7457, 7469, 7481, 7493, 7505, 7517, + 7529, 7541, 7553, 7565, 7577, 7589, 7601, 7613, 7625, 7637, 7649, 7661, 7673, + 7685, 7697, 7709, 7721, 7733, 7745, 7757, 7769, 7781, 7793, 7805, 7817, 7829, + 7841, 7853, 7865, 7877, 7889, 7901, 7913, 7925, 7937, 7949, 7961, 7973, 7985, + 7997, 8009, 8021, 8033, 8045, 8057, 8069, 8081, 8093, 8105, 8117, 8129, 8141, + 8153, 8165, 8177, 8189, 8201, 8213, 8225, 8237, 8249, 8261, 8273, 8285, 8297, + 8309, 8333, 8345, 8357, 8369, 8381, 8393, 8405, 8417, 8429, 8441, 8453, 8465, + 8477, 8489, 8501, 8513, 8525, 8537, 8549, 8561, 8573, 8585, 8597, 8609, 8621, + 8633, 8645, 8657, 8669, 8681, 8693, 8705, 8717, 8729, 8741, 8753, 8765, 8777, + 8789, 8801, 8813, 8825, 8837, 8849, 8861, 8873, 8885, 8897, 8909, 8921, 8933, + 8945, 8957, 8969, 8981, 8993, 9005, 9017, 9029, 9041, 9053, 9065, 9077, 9089, + 9101, 9113, 9125, 9137, 9149, 9161, 9173, 9185, 9197, 9209, 9221, 9233, 9245, + 9257, 9269, 9281, 9293, 9305, 9317, 9329, 9341, 9353, 9365, 9377, 9389, 9401, + 9413, 9425, 9437, 9449, 9461, 9473, 9485, 9497, 9509, 9521, 9533, 9545, 9557, + 9569, 9581, 9593, 9605, 9617, 9629, 9641, 9653, 9665, 9677, 9689, 9701, 9713, + 9725, 9737, 9749, 9761, 9773, 9785, 9797, 9809, 9821, 9833, 9845, 9857, 9869, + 9881, 9893, 9905, 9917, 9929, 9941, 9953, 9965, 9977, + }, + /* 2 */ + { + 6, 18, 30, 42, 54, 66, 78, 90, 102, 114, 126, 138, 150, + 162, 174, 186, 198, 210, 222, 234, 246, 258, 270, 282, 294, 306, + 318, 330, 342, 354, 366, 378, 390, 402, 414, 426, 438, 450, 462, + 474, 486, 498, 510, 522, 534, 546, 558, 570, 582, 594, 606, 618, + 630, 642, 654, 666, 678, 690, 702, 714, 726, 738, 750, 762, 774, + 786, 798, 810, 822, 846, 858, 870, 882, 894, 906, 918, 930, 942, + 954, 966, 978, 990, 1002, 1014, 1026, 1038, 1050, 1062, 1074, 1086, 1098, + 1110, 1122, 1134, 1146, 1158, 1170, 1182, 1194, 1206, 1218, 1230, 1242, 1254, + 1266, 1278, 1290, 1302, 1314, 1326, 1338, 1350, 1362, 1374, 1386, 1398, 1410, + 1422, 1434, 1446, 1458, 1470, 1482, 1494, 1506, 1518, 1530, 1542, 1554, 1566, + 1578, 1590, 1602, 1614, 1626, 1638, 1650, 1662, 1674, 1686, 1698, 1710, 1722, + 1734, 1746, 1758, 1770, 1782, 1794, 1806, 1818, 1830, 1842, 1854, 1866, 1878, + 1890, 1902, 1914, 1926, 1938, 1950, 1962, 1974, 1986, 1998, 2010, 2022, 2034, + 2046, 2058, 2070, 2082, 2094, 2106, 2118, 2130, 2142, 2154, 2166, 2178, 2190, + 2202, 2214, 2226, 2238, 2250, 2262, 2274, 2286, 2298, 2310, 2322, 2334, 2346, + 2358, 2370, 2382, 2394, 2406, 2418, 2430, 2442, 2454, 2466, 2478, 2490, 2502, + 2514, 2526, 2538, 2550, 2562, 2574, 2586, 2598, 2610, 2622, 2634, 2646, 2658, + 2670, 2682, 2694, 2706, 2718, 2730, 2742, 2754, 2766, 2778, 2790, 2802, 2814, + 2826, 2838, 2850, 2862, 2874, 2886, 2898, 2910, 2922, 2934, 2946, 2958, 2970, + 2982, 2994, 3006, 3018, 3030, 3042, 3054, 3066, 3078, 3090, 3102, 3114, 3126, + 3138, 3150, 3162, 3174, 3186, 3198, 3210, 3222, 3234, 3246, 3258, 3270, 3282, + 3294, 3306, 3318, 3342, 3354, 3366, 3378, 3390, 3402, 3414, 3426, 3438, 3450, + 3462, 3474, 3486, 3498, 3510, 3522, 3534, 3546, 3558, 3570, 3582, 3594, 3606, + 3618, 3630, 3642, 3654, 3666, 3678, 3690, 3702, 3714, 3726, 3738, 3750, 3762, + 3774, 3786, 3798, 3810, 3822, 3834, 3846, 3858, 3870, 3882, 3894, 3906, 3918, + 3930, 3942, 3954, 3966, 3978, 3990, 4002, 4014, 4026, 4038, 4050, 4062, 4074, + 4086, 4098, 4110, 4122, 4134, 4146, 4158, 4170, 4182, 4194, 4206, 4218, 4230, + 4242, 4254, 4266, 4278, 4290, 4302, 4314, 4326, 4338, 4350, 4362, 4374, 4386, + 4398, 4410, 4422, 4434, 4446, 4458, 4470, 4482, 4494, 4506, 4518, 4530, 4542, + 4554, 4566, 4578, 4590, 4602, 4614, 4626, 4638, 4650, 4662, 4674, 4686, 4698, + 4710, 4722, 4734, 4746, 4758, 4770, 4782, 4794, 4806, 4818, 4830, 4842, 4854, + 4866, 4878, 4890, 4902, 4914, 4926, 4938, 4950, 4962, 4974, 4986, 4998, 5010, + 5022, 5034, 5046, 5058, 5070, 5082, 5094, 5106, 5118, 5130, 5142, 5154, 5166, + 5178, 5190, 5202, 5214, 5226, 5238, 5250, 5262, 5274, 5286, 5298, 5310, 5322, + 5334, 5346, 5358, 5370, 5382, 5394, 5406, 5418, 5430, 5442, 5454, 5466, 5478, + 5490, 5502, 5514, 5526, 5538, 5550, 5562, 5574, 5586, 5598, 5610, 5622, 5634, + 5646, 5658, 5670, 5682, 5694, 5706, 5718, 5730, 5742, 5754, 5766, 5778, 5790, + 5802, 5814, 5838, 5850, 5862, 5874, 5886, 5898, 5910, 5922, 5934, 5946, 5958, + 5970, 5982, 5994, 6006, 6018, 6030, 6042, 6054, 6066, 6078, 6090, 6102, 6114, + 6126, 6138, 6150, 6162, 6174, 6186, 6198, 6210, 6222, 6234, 6246, 6258, 6270, + 6282, 6294, 6306, 6318, 6330, 6342, 6354, 6366, 6378, 6390, 6402, 6414, 6426, + 6438, 6450, 6462, 6474, 6486, 6498, 6510, 6522, 6534, 6546, 6558, 6570, 6582, + 6594, 6606, 6618, 6630, 6642, 6654, 6666, 6678, 6690, 6702, 6714, 6726, 6738, + 6750, 6762, 6774, 6786, 6798, 6810, 6822, 6834, 6846, 6858, 6870, 6882, 6894, + 6906, 6918, 6930, 6942, 6954, 6966, 6978, 6990, 7002, 7014, 7026, 7038, 7050, + 7062, 7074, 7086, 7098, 7110, 7122, 7134, 7146, 7158, 7170, 7182, 7194, 7206, + 7218, 7230, 7242, 7254, 7266, 7278, 7290, 7302, 7314, 7326, 7338, 7350, 7362, + 7374, 7386, 7398, 7410, 7422, 7434, 7446, 7458, 7470, 7482, 7494, 7506, 7518, + 7530, 7542, 7554, 7566, 7578, 7590, 7602, 7614, 7626, 7638, 7650, 7662, 7674, + 7686, 7698, 7710, 7722, 7734, 7746, 7758, 7770, 7782, 7794, 7806, 7818, 7830, + 7842, 7854, 7866, 7878, 7890, 7902, 7914, 7926, 7938, 7950, 7962, 7974, 7986, + 7998, 8010, 8022, 8034, 8046, 8058, 8070, 8082, 8094, 8106, 8118, 8130, 8142, + 8154, 8166, 8178, 8190, 8202, 8214, 8226, 8238, 8250, 8262, 8274, 8286, 8298, + 8310, 8334, 8346, 8358, 8370, 8382, 8394, 8406, 8418, 8430, 8442, 8454, 8466, + 8478, 8490, 8502, 8514, 8526, 8538, 8550, 8562, 8574, 8586, 8598, 8610, 8622, + 8634, 8646, 8658, 8670, 8682, 8694, 8706, 8718, 8730, 8742, 8754, 8766, 8778, + 8790, 8802, 8814, 8826, 8838, 8850, 8862, 8874, 8886, 8898, 8910, 8922, 8934, + 8946, 8958, 8970, 8982, 8994, 9006, 9018, 9030, 9042, 9054, 9066, 9078, 9090, + 9102, 9114, 9126, 9138, 9150, 9162, 9174, 9186, 9198, 9210, 9222, 9234, 9246, + 9258, 9270, 9282, 9294, 9306, 9318, 9330, 9342, 9354, 9366, 9378, 9390, 9402, + 9414, 9426, 9438, 9450, 9462, 9474, 9486, 9498, 9510, 9522, 9534, 9546, 9558, + 9570, 9582, 9594, 9606, 9618, 9630, 9642, 9654, 9666, 9678, 9690, 9702, 9714, + 9726, 9738, 9750, 9762, 9774, 9786, 9798, 9810, 9822, 9834, 9846, 9858, 9870, + 9882, 9894, 9906, 9918, 9930, 9942, 9954, 9966, 9978, + }, + /* 3 */ + { + 7, 19, 31, 43, 55, 67, 79, 91, 103, 115, 127, 139, 151, + 163, 175, 187, 199, 211, 223, 235, 247, 259, 271, 283, 295, 307, + 319, 331, 343, 355, 367, 379, 391, 403, 415, 427, 439, 451, 463, + 475, 487, 499, 511, 523, 535, 547, 559, 571, 583, 595, 607, 619, + 631, 643, 655, 667, 679, 691, 703, 715, 727, 739, 751, 763, 775, + 787, 799, 811, 823, 847, 859, 871, 883, 895, 907, 919, 931, 943, + 955, 967, 979, 991, 1003, 1015, 1027, 1039, 1051, 1063, 1075, 1087, 1099, + 1111, 1123, 1135, 1147, 1159, 1171, 1183, 1195, 1207, 1219, 1231, 1243, 1255, + 1267, 1279, 1291, 1303, 1315, 1327, 1339, 1351, 1363, 1375, 1387, 1399, 1411, + 1423, 1435, 1447, 1459, 1471, 1483, 1495, 1507, 1519, 1531, 1543, 1555, 1567, + 1579, 1591, 1603, 1615, 1627, 1639, 1651, 1663, 1675, 1687, 1699, 1711, 1723, + 1735, 1747, 1759, 1771, 1783, 1795, 1807, 1819, 1831, 1843, 1855, 1867, 1879, + 1891, 1903, 1915, 1927, 1939, 1951, 1963, 1975, 1987, 1999, 2011, 2023, 2035, + 2047, 2059, 2071, 2083, 2095, 2107, 2119, 2131, 2143, 2155, 2167, 2179, 2191, + 2203, 2215, 2227, 2239, 2251, 2263, 2275, 2287, 2299, 2311, 2323, 2335, 2347, + 2359, 2371, 2383, 2395, 2407, 2419, 2431, 2443, 2455, 2467, 2479, 2491, 2503, + 2515, 2527, 2539, 2551, 2563, 2575, 2587, 2599, 2611, 2623, 2635, 2647, 2659, + 2671, 2683, 2695, 2707, 2719, 2731, 2743, 2755, 2767, 2779, 2791, 2803, 2815, + 2827, 2839, 2851, 2863, 2875, 2887, 2899, 2911, 2923, 2935, 2947, 2959, 2971, + 2983, 2995, 3007, 3019, 3031, 3043, 3055, 3067, 3079, 3091, 3103, 3115, 3127, + 3139, 3151, 3163, 3175, 3187, 3199, 3211, 3223, 3235, 3247, 3259, 3271, 3283, + 3295, 3307, 3319, 3343, 3355, 3367, 3379, 3391, 3403, 3415, 3427, 3439, 3451, + 3463, 3475, 3487, 3499, 3511, 3523, 3535, 3547, 3559, 3571, 3583, 3595, 3607, + 3619, 3631, 3643, 3655, 3667, 3679, 3691, 3703, 3715, 3727, 3739, 3751, 3763, + 3775, 3787, 3799, 3811, 3823, 3835, 3847, 3859, 3871, 3883, 3895, 3907, 3919, + 3931, 3943, 3955, 3967, 3979, 3991, 4003, 4015, 4027, 4039, 4051, 4063, 4075, + 4087, 4099, 4111, 4123, 4135, 4147, 4159, 4171, 4183, 4195, 4207, 4219, 4231, + 4243, 4255, 4267, 4279, 4291, 4303, 4315, 4327, 4339, 4351, 4363, 4375, 4387, + 4399, 4411, 4423, 4435, 4447, 4459, 4471, 4483, 4495, 4507, 4519, 4531, 4543, + 4555, 4567, 4579, 4591, 4603, 4615, 4627, 4639, 4651, 4663, 4675, 4687, 4699, + 4711, 4723, 4735, 4747, 4759, 4771, 4783, 4795, 4807, 4819, 4831, 4843, 4855, + 4867, 4879, 4891, 4903, 4915, 4927, 4939, 4951, 4963, 4975, 4987, 4999, 5011, + 5023, 5035, 5047, 5059, 5071, 5083, 5095, 5107, 5119, 5131, 5143, 5155, 5167, + 5179, 5191, 5203, 5215, 5227, 5239, 5251, 5263, 5275, 5287, 5299, 5311, 5323, + 5335, 5347, 5359, 5371, 5383, 5395, 5407, 5419, 5431, 5443, 5455, 5467, 5479, + 5491, 5503, 5515, 5527, 5539, 5551, 5563, 5575, 5587, 5599, 5611, 5623, 5635, + 5647, 5659, 5671, 5683, 5695, 5707, 5719, 5731, 5743, 5755, 5767, 5779, 5791, + 5803, 5815, 5839, 5851, 5863, 5875, 5887, 5899, 5911, 5923, 5935, 5947, 5959, + 5971, 5983, 5995, 6007, 6019, 6031, 6043, 6055, 6067, 6079, 6091, 6103, 6115, + 6127, 6139, 6151, 6163, 6175, 6187, 6199, 6211, 6223, 6235, 6247, 6259, 6271, + 6283, 6295, 6307, 6319, 6331, 6343, 6355, 6367, 6379, 6391, 6403, 6415, 6427, + 6439, 6451, 6463, 6475, 6487, 6499, 6511, 6523, 6535, 6547, 6559, 6571, 6583, + 6595, 6607, 6619, 6631, 6643, 6655, 6667, 6679, 6691, 6703, 6715, 6727, 6739, + 6751, 6763, 6775, 6787, 6799, 6811, 6823, 6835, 6847, 6859, 6871, 6883, 6895, + 6907, 6919, 6931, 6943, 6955, 6967, 6979, 6991, 7003, 7015, 7027, 7039, 7051, + 7063, 7075, 7087, 7099, 7111, 7123, 7135, 7147, 7159, 7171, 7183, 7195, 7207, + 7219, 7231, 7243, 7255, 7267, 7279, 7291, 7303, 7315, 7327, 7339, 7351, 7363, + 7375, 7387, 7399, 7411, 7423, 7435, 7447, 7459, 7471, 7483, 7495, 7507, 7519, + 7531, 7543, 7555, 7567, 7579, 7591, 7603, 7615, 7627, 7639, 7651, 7663, 7675, + 7687, 7699, 7711, 7723, 7735, 7747, 7759, 7771, 7783, 7795, 7807, 7819, 7831, + 7843, 7855, 7867, 7879, 7891, 7903, 7915, 7927, 7939, 7951, 7963, 7975, 7987, + 7999, 8011, 8023, 8035, 8047, 8059, 8071, 8083, 8095, 8107, 8119, 8131, 8143, + 8155, 8167, 8179, 8191, 8203, 8215, 8227, 8239, 8251, 8263, 8275, 8287, 8299, + 8311, 8335, 8347, 8359, 8371, 8383, 8395, 8407, 8419, 8431, 8443, 8455, 8467, + 8479, 8491, 8503, 8515, 8527, 8539, 8551, 8563, 8575, 8587, 8599, 8611, 8623, + 8635, 8647, 8659, 8671, 8683, 8695, 8707, 8719, 8731, 8743, 8755, 8767, 8779, + 8791, 8803, 8815, 8827, 8839, 8851, 8863, 8875, 8887, 8899, 8911, 8923, 8935, + 8947, 8959, 8971, 8983, 8995, 9007, 9019, 9031, 9043, 9055, 9067, 9079, 9091, + 9103, 9115, 9127, 9139, 9151, 9163, 9175, 9187, 9199, 9211, 9223, 9235, 9247, + 9259, 9271, 9283, 9295, 9307, 9319, 9331, 9343, 9355, 9367, 9379, 9391, 9403, + 9415, 9427, 9439, 9451, 9463, 9475, 9487, 9499, 9511, 9523, 9535, 9547, 9559, + 9571, 9583, 9595, 9607, 9619, 9631, 9643, 9655, 9667, 9679, 9691, 9703, 9715, + 9727, 9739, 9751, 9763, 9775, 9787, 9799, 9811, 9823, 9835, 9847, 9859, 9871, + 9883, 9895, 9907, 9919, 9931, 9943, 9955, 9967, 9979, + }, + /* 4 */ + { + 8, 20, 32, 44, 56, 68, 80, 92, 104, 116, 128, 140, 152, + 164, 176, 188, 200, 212, 224, 236, 248, 260, 272, 284, 296, 308, + 320, 332, 344, 356, 368, 380, 392, 404, 416, 428, 440, 452, 464, + 476, 488, 500, 512, 524, 536, 548, 560, 572, 584, 596, 608, 620, + 632, 644, 656, 668, 680, 692, 704, 716, 728, 740, 752, 764, 776, + 788, 800, 812, 824, 836, 848, 860, 872, 884, 896, 908, 920, 932, + 944, 956, 968, 980, 992, 1004, 1016, 1028, 1040, 1052, 1064, 1076, 1088, + 1100, 1112, 1124, 1136, 1148, 1160, 1172, 1184, 1196, 1208, 1220, 1232, 1244, + 1256, 1268, 1280, 1292, 1304, 1316, 1328, 1340, 1352, 1364, 1376, 1388, 1400, + 1412, 1424, 1436, 1448, 1460, 1472, 1484, 1496, 1508, 1520, 1532, 1544, 1556, + 1568, 1580, 1592, 1604, 1616, 1628, 1640, 1652, 1676, 1688, 1700, 1712, 1724, + 1736, 1748, 1760, 1772, 1784, 1796, 1808, 1820, 1832, 1844, 1856, 1868, 1880, + 1892, 1904, 1916, 1928, 1940, 1952, 1964, 1976, 1988, 2000, 2012, 2024, 2036, + 2048, 2060, 2072, 2084, 2096, 2108, 2120, 2132, 2144, 2156, 2168, 2180, 2192, + 2204, 2216, 2228, 2240, 2252, 2264, 2276, 2288, 2300, 2312, 2324, 2336, 2348, + 2360, 2372, 2384, 2396, 2408, 2420, 2432, 2444, 2456, 2468, 2480, 2492, 2504, + 2516, 2528, 2540, 2552, 2564, 2576, 2588, 2600, 2612, 2624, 2636, 2648, 2660, + 2672, 2684, 2696, 2708, 2720, 2732, 2744, 2756, 2768, 2780, 2792, 2804, 2816, + 2828, 2840, 2852, 2864, 2876, 2888, 2900, 2912, 2924, 2936, 2948, 2960, 2972, + 2984, 2996, 3008, 3020, 3032, 3044, 3056, 3068, 3080, 3092, 3104, 3116, 3128, + 3140, 3152, 3164, 3176, 3188, 3200, 3212, 3224, 3236, 3248, 3260, 3272, 3284, + 3296, 3308, 3320, 3332, 3344, 3356, 3368, 3380, 3392, 3404, 3416, 3428, 3440, + 3452, 3464, 3476, 3488, 3500, 3512, 3524, 3536, 3548, 3560, 3572, 3584, 3596, + 3608, 3620, 3632, 3644, 3656, 3668, 3680, 3692, 3704, 3716, 3728, 3740, 3752, + 3764, 3776, 3788, 3800, 3812, 3824, 3836, 3848, 3860, 3872, 3884, 3896, 3908, + 3920, 3932, 3944, 3956, 3968, 3980, 3992, 4004, 4016, 4028, 4040, 4052, 4064, + 4076, 4088, 4100, 4112, 4124, 4136, 4148, 4172, 4184, 4196, 4208, 4220, 4232, + 4244, 4256, 4268, 4280, 4292, 4304, 4316, 4328, 4340, 4352, 4364, 4376, 4388, + 4400, 4412, 4424, 4436, 4448, 4460, 4472, 4484, 4496, 4508, 4520, 4532, 4544, + 4556, 4568, 4580, 4592, 4604, 4616, 4628, 4640, 4652, 4664, 4676, 4688, 4700, + 4712, 4724, 4736, 4748, 4760, 4772, 4784, 4796, 4808, 4820, 4832, 4844, 4856, + 4868, 4880, 4892, 4904, 4916, 4928, 4940, 4952, 4964, 4976, 4988, 5000, 5012, + 5024, 5036, 5048, 5060, 5072, 5084, 5096, 5108, 5120, 5132, 5144, 5156, 5168, + 5180, 5192, 5204, 5216, 5228, 5240, 5252, 5264, 5276, 5288, 5300, 5312, 5324, + 5336, 5348, 5360, 5372, 5384, 5396, 5408, 5420, 5432, 5444, 5456, 5468, 5480, + 5492, 5504, 5516, 5528, 5540, 5552, 5564, 5576, 5588, 5600, 5612, 5624, 5636, + 5648, 5660, 5672, 5684, 5696, 5708, 5720, 5732, 5744, 5756, 5768, 5780, 5792, + 5804, 5816, 5828, 5840, 5852, 5864, 5876, 5888, 5900, 5912, 5924, 5936, 5948, + 5960, 5972, 5984, 5996, 6008, 6020, 6032, 6044, 6056, 6068, 6080, 6092, 6104, + 6116, 6128, 6140, 6152, 6164, 6176, 6188, 6200, 6212, 6224, 6236, 6248, 6260, + 6272, 6284, 6296, 6308, 6320, 6332, 6344, 6356, 6368, 6380, 6392, 6404, 6416, + 6428, 6440, 6452, 6464, 6476, 6488, 6500, 6512, 6524, 6536, 6548, 6560, 6572, + 6584, 6596, 6608, 6620, 6632, 6644, 6668, 6680, 6692, 6704, 6716, 6728, 6740, + 6752, 6764, 6776, 6788, 6800, 6812, 6824, 6836, 6848, 6860, 6872, 6884, 6896, + 6908, 6920, 6932, 6944, 6956, 6968, 6980, 6992, 7004, 7016, 7028, 7040, 7052, + 7064, 7076, 7088, 7100, 7112, 7124, 7136, 7148, 7160, 7172, 7184, 7196, 7208, + 7220, 7232, 7244, 7256, 7268, 7280, 7292, 7304, 7316, 7328, 7340, 7352, 7364, + 7376, 7388, 7400, 7412, 7424, 7436, 7448, 7460, 7472, 7484, 7496, 7508, 7520, + 7532, 7544, 7556, 7568, 7580, 7592, 7604, 7616, 7628, 7640, 7652, 7664, 7676, + 7688, 7700, 7712, 7724, 7736, 7748, 7760, 7772, 7784, 7796, 7808, 7820, 7832, + 7844, 7856, 7868, 7880, 7892, 7904, 7916, 7928, 7940, 7952, 7964, 7976, 7988, + 8000, 8012, 8024, 8036, 8048, 8060, 8072, 8084, 8096, 8108, 8120, 8132, 8144, + 8156, 8168, 8180, 8192, 8204, 8216, 8228, 8240, 8252, 8264, 8276, 8288, 8300, + 8312, 8324, 8336, 8348, 8360, 8372, 8384, 8396, 8408, 8420, 8432, 8444, 8456, + 8468, 8480, 8492, 8504, 8516, 8528, 8540, 8552, 8564, 8576, 8588, 8600, 8612, + 8624, 8636, 8648, 8660, 8672, 8684, 8696, 8708, 8720, 8732, 8744, 8756, 8768, + 8780, 8792, 8804, 8816, 8828, 8840, 8852, 8864, 8876, 8888, 8900, 8912, 8924, + 8936, 8948, 8960, 8972, 8984, 8996, 9008, 9020, 9032, 9044, 9056, 9068, 9080, + 9092, 9104, 9116, 9128, 9140, 9164, 9176, 9188, 9200, 9212, 9224, 9236, 9248, + 9260, 9272, 9284, 9296, 9308, 9320, 9332, 9344, 9356, 9368, 9380, 9392, 9404, + 9416, 9428, 9440, 9452, 9464, 9476, 9488, 9500, 9512, 9524, 9536, 9548, 9560, + 9572, 9584, 9596, 9608, 9620, 9632, 9644, 9656, 9668, 9680, 9692, 9704, 9716, + 9728, 9740, 9752, 9764, 9776, 9788, 9800, 9812, 9824, 9836, 9848, 9860, 9872, + 9884, 9896, 9908, 9920, 9932, 9944, 9956, 9968, 9980, + }, + /* 5 */ + { + 9, 21, 33, 45, 57, 69, 81, 93, 105, 117, 129, 141, 153, + 165, 177, 189, 201, 213, 225, 237, 249, 261, 273, 285, 297, 309, + 321, 333, 345, 357, 369, 381, 393, 405, 417, 429, 441, 453, 465, + 477, 489, 501, 513, 525, 537, 549, 561, 573, 585, 597, 609, 621, + 633, 645, 657, 669, 681, 693, 705, 717, 729, 741, 753, 765, 777, + 789, 801, 813, 825, 837, 849, 861, 873, 885, 897, 909, 921, 933, + 945, 957, 969, 981, 993, 1005, 1017, 1029, 1041, 1053, 1065, 1077, 1089, + 1101, 1113, 1125, 1137, 1149, 1161, 1173, 1185, 1197, 1209, 1221, 1233, 1245, + 1257, 1269, 1281, 1293, 1305, 1317, 1329, 1341, 1353, 1365, 1377, 1389, 1401, + 1413, 1425, 1437, 1449, 1461, 1473, 1485, 1497, 1509, 1521, 1533, 1545, 1557, + 1569, 1581, 1593, 1605, 1617, 1629, 1641, 1653, 1677, 1689, 1701, 1713, 1725, + 1737, 1749, 1761, 1773, 1785, 1797, 1809, 1821, 1833, 1845, 1857, 1869, 1881, + 1893, 1905, 1917, 1929, 1941, 1953, 1965, 1977, 1989, 2001, 2013, 2025, 2037, + 2049, 2061, 2073, 2085, 2097, 2109, 2121, 2133, 2145, 2157, 2169, 2181, 2193, + 2205, 2217, 2229, 2241, 2253, 2265, 2277, 2289, 2301, 2313, 2325, 2337, 2349, + 2361, 2373, 2385, 2397, 2409, 2421, 2433, 2445, 2457, 2469, 2481, 2493, 2505, + 2517, 2529, 2541, 2553, 2565, 2577, 2589, 2601, 2613, 2625, 2637, 2649, 2661, + 2673, 2685, 2697, 2709, 2721, 2733, 2745, 2757, 2769, 2781, 2793, 2805, 2817, + 2829, 2841, 2853, 2865, 2877, 2889, 2901, 2913, 2925, 2937, 2949, 2961, 2973, + 2985, 2997, 3009, 3021, 3033, 3045, 3057, 3069, 3081, 3093, 3105, 3117, 3129, + 3141, 3153, 3165, 3177, 3189, 3201, 3213, 3225, 3237, 3249, 3261, 3273, 3285, + 3297, 3309, 3321, 3333, 3345, 3357, 3369, 3381, 3393, 3405, 3417, 3429, 3441, + 3453, 3465, 3477, 3489, 3501, 3513, 3525, 3537, 3549, 3561, 3573, 3585, 3597, + 3609, 3621, 3633, 3645, 3657, 3669, 3681, 3693, 3705, 3717, 3729, 3741, 3753, + 3765, 3777, 3789, 3801, 3813, 3825, 3837, 3849, 3861, 3873, 3885, 3897, 3909, + 3921, 3933, 3945, 3957, 3969, 3981, 3993, 4005, 4017, 4029, 4041, 4053, 4065, + 4077, 4089, 4101, 4113, 4125, 4137, 4149, 4173, 4185, 4197, 4209, 4221, 4233, + 4245, 4257, 4269, 4281, 4293, 4305, 4317, 4329, 4341, 4353, 4365, 4377, 4389, + 4401, 4413, 4425, 4437, 4449, 4461, 4473, 4485, 4497, 4509, 4521, 4533, 4545, + 4557, 4569, 4581, 4593, 4605, 4617, 4629, 4641, 4653, 4665, 4677, 4689, 4701, + 4713, 4725, 4737, 4749, 4761, 4773, 4785, 4797, 4809, 4821, 4833, 4845, 4857, + 4869, 4881, 4893, 4905, 4917, 4929, 4941, 4953, 4965, 4977, 4989, 5001, 5013, + 5025, 5037, 5049, 5061, 5073, 5085, 5097, 5109, 5121, 5133, 5145, 5157, 5169, + 5181, 5193, 5205, 5217, 5229, 5241, 5253, 5265, 5277, 5289, 5301, 5313, 5325, + 5337, 5349, 5361, 5373, 5385, 5397, 5409, 5421, 5433, 5445, 5457, 5469, 5481, + 5493, 5505, 5517, 5529, 5541, 5553, 5565, 5577, 5589, 5601, 5613, 5625, 5637, + 5649, 5661, 5673, 5685, 5697, 5709, 5721, 5733, 5745, 5757, 5769, 5781, 5793, + 5805, 5817, 5829, 5841, 5853, 5865, 5877, 5889, 5901, 5913, 5925, 5937, 5949, + 5961, 5973, 5985, 5997, 6009, 6021, 6033, 6045, 6057, 6069, 6081, 6093, 6105, + 6117, 6129, 6141, 6153, 6165, 6177, 6189, 6201, 6213, 6225, 6237, 6249, 6261, + 6273, 6285, 6297, 6309, 6321, 6333, 6345, 6357, 6369, 6381, 6393, 6405, 6417, + 6429, 6441, 6453, 6465, 6477, 6489, 6501, 6513, 6525, 6537, 6549, 6561, 6573, + 6585, 6597, 6609, 6621, 6633, 6645, 6669, 6681, 6693, 6705, 6717, 6729, 6741, + 6753, 6765, 6777, 6789, 6801, 6813, 6825, 6837, 6849, 6861, 6873, 6885, 6897, + 6909, 6921, 6933, 6945, 6957, 6969, 6981, 6993, 7005, 7017, 7029, 7041, 7053, + 7065, 7077, 7089, 7101, 7113, 7125, 7137, 7149, 7161, 7173, 7185, 7197, 7209, + 7221, 7233, 7245, 7257, 7269, 7281, 7293, 7305, 7317, 7329, 7341, 7353, 7365, + 7377, 7389, 7401, 7413, 7425, 7437, 7449, 7461, 7473, 7485, 7497, 7509, 7521, + 7533, 7545, 7557, 7569, 7581, 7593, 7605, 7617, 7629, 7641, 7653, 7665, 7677, + 7689, 7701, 7713, 7725, 7737, 7749, 7761, 7773, 7785, 7797, 7809, 7821, 7833, + 7845, 7857, 7869, 7881, 7893, 7905, 7917, 7929, 7941, 7953, 7965, 7977, 7989, + 8001, 8013, 8025, 8037, 8049, 8061, 8073, 8085, 8097, 8109, 8121, 8133, 8145, + 8157, 8169, 8181, 8193, 8205, 8217, 8229, 8241, 8253, 8265, 8277, 8289, 8301, + 8313, 8325, 8337, 8349, 8361, 8373, 8385, 8397, 8409, 8421, 8433, 8445, 8457, + 8469, 8481, 8493, 8505, 8517, 8529, 8541, 8553, 8565, 8577, 8589, 8601, 8613, + 8625, 8637, 8649, 8661, 8673, 8685, 8697, 8709, 8721, 8733, 8745, 8757, 8769, + 8781, 8793, 8805, 8817, 8829, 8841, 8853, 8865, 8877, 8889, 8901, 8913, 8925, + 8937, 8949, 8961, 8973, 8985, 8997, 9009, 9021, 9033, 9045, 9057, 9069, 9081, + 9093, 9105, 9117, 9129, 9141, 9165, 9177, 9189, 9201, 9213, 9225, 9237, 9249, + 9261, 9273, 9285, 9297, 9309, 9321, 9333, 9345, 9357, 9369, 9381, 9393, 9405, + 9417, 9429, 9441, 9453, 9465, 9477, 9489, 9501, 9513, 9525, 9537, 9549, 9561, + 9573, 9585, 9597, 9609, 9621, 9633, 9645, 9657, 9669, 9681, 9693, 9705, 9717, + 9729, 9741, 9753, 9765, 9777, 9789, 9801, 9813, 9825, 9837, 9849, 9861, 9873, + 9885, 9897, 9909, 9921, 9933, 9945, 9957, 9969, 9981, + }, + /* 6 */ + { + 10, 22, 34, 46, 58, 70, 82, 94, 106, 118, 130, 142, 154, + 166, 178, 190, 202, 214, 226, 238, 250, 262, 274, 286, 298, 310, + 322, 334, 346, 358, 370, 382, 394, 406, 418, 430, 442, 454, 466, + 478, 490, 502, 514, 526, 538, 550, 562, 574, 586, 598, 610, 622, + 634, 646, 658, 670, 682, 694, 706, 718, 730, 742, 754, 766, 778, + 790, 802, 814, 826, 838, 850, 862, 874, 886, 898, 910, 922, 934, + 946, 958, 970, 982, 994, 1006, 1018, 1030, 1042, 1054, 1066, 1078, 1090, + 1102, 1114, 1126, 1138, 1150, 1162, 1174, 1186, 1198, 1210, 1222, 1234, 1246, + 1258, 1270, 1282, 1294, 1306, 1318, 1330, 1342, 1354, 1366, 1378, 1390, 1402, + 1414, 1426, 1438, 1450, 1462, 1474, 1486, 1498, 1510, 1522, 1534, 1546, 1558, + 1570, 1582, 1594, 1606, 1618, 1630, 1642, 1654, 1678, 1690, 1702, 1714, 1726, + 1738, 1750, 1762, 1774, 1786, 1798, 1810, 1822, 1834, 1846, 1858, 1870, 1882, + 1894, 1906, 1918, 1930, 1942, 1954, 1966, 1978, 1990, 2002, 2014, 2026, 2038, + 2050, 2062, 2074, 2086, 2098, 2110, 2122, 2134, 2146, 2158, 2170, 2182, 2194, + 2206, 2218, 2230, 2242, 2254, 2266, 2278, 2290, 2302, 2314, 2326, 2338, 2350, + 2362, 2374, 2386, 2398, 2410, 2422, 2434, 2446, 2458, 2470, 2482, 2494, 2506, + 2518, 2530, 2542, 2554, 2566, 2578, 2590, 2602, 2614, 2626, 2638, 2650, 2662, + 2674, 2686, 2698, 2710, 2722, 2734, 2746, 2758, 2770, 2782, 2794, 2806, 2818, + 2830, 2842, 2854, 2866, 2878, 2890, 2902, 2914, 2926, 2938, 2950, 2962, 2974, + 2986, 2998, 3010, 3022, 3034, 3046, 3058, 3070, 3082, 3094, 3106, 3118, 3130, + 3142, 3154, 3166, 3178, 3190, 3202, 3214, 3226, 3238, 3250, 3262, 3274, 3286, + 3298, 3310, 3322, 3334, 3346, 3358, 3370, 3382, 3394, 3406, 3418, 3430, 3442, + 3454, 3466, 3478, 3490, 3502, 3514, 3526, 3538, 3550, 3562, 3574, 3586, 3598, + 3610, 3622, 3634, 3646, 3658, 3670, 3682, 3694, 3706, 3718, 3730, 3742, 3754, + 3766, 3778, 3790, 3802, 3814, 3826, 3838, 3850, 3862, 3874, 3886, 3898, 3910, + 3922, 3934, 3946, 3958, 3970, 3982, 3994, 4006, 4018, 4030, 4042, 4054, 4066, + 4078, 4090, 4102, 4114, 4126, 4138, 4150, 4174, 4186, 4198, 4210, 4222, 4234, + 4246, 4258, 4270, 4282, 4294, 4306, 4318, 4330, 4342, 4354, 4366, 4378, 4390, + 4402, 4414, 4426, 4438, 4450, 4462, 4474, 4486, 4498, 4510, 4522, 4534, 4546, + 4558, 4570, 4582, 4594, 4606, 4618, 4630, 4642, 4654, 4666, 4678, 4690, 4702, + 4714, 4726, 4738, 4750, 4762, 4774, 4786, 4798, 4810, 4822, 4834, 4846, 4858, + 4870, 4882, 4894, 4906, 4918, 4930, 4942, 4954, 4966, 4978, 4990, 5002, 5014, + 5026, 5038, 5050, 5062, 5074, 5086, 5098, 5110, 5122, 5134, 5146, 5158, 5170, + 5182, 5194, 5206, 5218, 5230, 5242, 5254, 5266, 5278, 5290, 5302, 5314, 5326, + 5338, 5350, 5362, 5374, 5386, 5398, 5410, 5422, 5434, 5446, 5458, 5470, 5482, + 5494, 5506, 5518, 5530, 5542, 5554, 5566, 5578, 5590, 5602, 5614, 5626, 5638, + 5650, 5662, 5674, 5686, 5698, 5710, 5722, 5734, 5746, 5758, 5770, 5782, 5794, + 5806, 5818, 5830, 5842, 5854, 5866, 5878, 5890, 5902, 5914, 5926, 5938, 5950, + 5962, 5974, 5986, 5998, 6010, 6022, 6034, 6046, 6058, 6070, 6082, 6094, 6106, + 6118, 6130, 6142, 6154, 6166, 6178, 6190, 6202, 6214, 6226, 6238, 6250, 6262, + 6274, 6286, 6298, 6310, 6322, 6334, 6346, 6358, 6370, 6382, 6394, 6406, 6418, + 6430, 6442, 6454, 6466, 6478, 6490, 6502, 6514, 6526, 6538, 6550, 6562, 6574, + 6586, 6598, 6610, 6622, 6634, 6646, 6670, 6682, 6694, 6706, 6718, 6730, 6742, + 6754, 6766, 6778, 6790, 6802, 6814, 6826, 6838, 6850, 6862, 6874, 6886, 6898, + 6910, 6922, 6934, 6946, 6958, 6970, 6982, 6994, 7006, 7018, 7030, 7042, 7054, + 7066, 7078, 7090, 7102, 7114, 7126, 7138, 7150, 7162, 7174, 7186, 7198, 7210, + 7222, 7234, 7246, 7258, 7270, 7282, 7294, 7306, 7318, 7330, 7342, 7354, 7366, + 7378, 7390, 7402, 7414, 7426, 7438, 7450, 7462, 7474, 7486, 7498, 7510, 7522, + 7534, 7546, 7558, 7570, 7582, 7594, 7606, 7618, 7630, 7642, 7654, 7666, 7678, + 7690, 7702, 7714, 7726, 7738, 7750, 7762, 7774, 7786, 7798, 7810, 7822, 7834, + 7846, 7858, 7870, 7882, 7894, 7906, 7918, 7930, 7942, 7954, 7966, 7978, 7990, + 8002, 8014, 8026, 8038, 8050, 8062, 8074, 8086, 8098, 8110, 8122, 8134, 8146, + 8158, 8170, 8182, 8194, 8206, 8218, 8230, 8242, 8254, 8266, 8278, 8290, 8302, + 8314, 8326, 8338, 8350, 8362, 8374, 8386, 8398, 8410, 8422, 8434, 8446, 8458, + 8470, 8482, 8494, 8506, 8518, 8530, 8542, 8554, 8566, 8578, 8590, 8602, 8614, + 8626, 8638, 8650, 8662, 8674, 8686, 8698, 8710, 8722, 8734, 8746, 8758, 8770, + 8782, 8794, 8806, 8818, 8830, 8842, 8854, 8866, 8878, 8890, 8902, 8914, 8926, + 8938, 8950, 8962, 8974, 8986, 8998, 9010, 9022, 9034, 9046, 9058, 9070, 9082, + 9094, 9106, 9118, 9130, 9142, 9166, 9178, 9190, 9202, 9214, 9226, 9238, 9250, + 9262, 9274, 9286, 9298, 9310, 9322, 9334, 9346, 9358, 9370, 9382, 9394, 9406, + 9418, 9430, 9442, 9454, 9466, 9478, 9490, 9502, 9514, 9526, 9538, 9550, 9562, + 9574, 9586, 9598, 9610, 9622, 9634, 9646, 9658, 9670, 9682, 9694, 9706, 9718, + 9730, 9742, 9754, 9766, 9778, 9790, 9802, 9814, 9826, 9838, 9850, 9862, 9874, + 9886, 9898, 9910, 9922, 9934, 9946, 9958, 9970, 9982, + }, + /* 7 */ + { + 11, 23, 35, 47, 59, 71, 83, 95, 107, 119, 131, 143, 155, + 167, 179, 191, 203, 215, 227, 239, 251, 263, 275, 287, 299, 311, + 323, 335, 347, 359, 371, 383, 395, 407, 419, 431, 443, 455, 467, + 479, 491, 503, 515, 527, 539, 551, 563, 575, 587, 599, 611, 623, + 635, 647, 659, 671, 683, 695, 707, 719, 731, 743, 755, 767, 779, + 791, 803, 815, 827, 839, 851, 863, 875, 887, 899, 911, 923, 935, + 947, 959, 971, 983, 995, 1007, 1019, 1031, 1043, 1055, 1067, 1079, 1091, + 1103, 1115, 1127, 1139, 1151, 1163, 1175, 1187, 1199, 1211, 1223, 1235, 1247, + 1259, 1271, 1283, 1295, 1307, 1319, 1331, 1343, 1355, 1367, 1379, 1391, 1403, + 1415, 1427, 1439, 1451, 1463, 1475, 1487, 1499, 1511, 1523, 1535, 1547, 1559, + 1571, 1583, 1595, 1607, 1619, 1631, 1643, 1655, 1679, 1691, 1703, 1715, 1727, + 1739, 1751, 1763, 1775, 1787, 1799, 1811, 1823, 1835, 1847, 1859, 1871, 1883, + 1895, 1907, 1919, 1931, 1943, 1955, 1967, 1979, 1991, 2003, 2015, 2027, 2039, + 2051, 2063, 2075, 2087, 2099, 2111, 2123, 2135, 2147, 2159, 2171, 2183, 2195, + 2207, 2219, 2231, 2243, 2255, 2267, 2279, 2291, 2303, 2315, 2327, 2339, 2351, + 2363, 2375, 2387, 2399, 2411, 2423, 2435, 2447, 2459, 2471, 2483, 2495, 2507, + 2519, 2531, 2543, 2555, 2567, 2579, 2591, 2603, 2615, 2627, 2639, 2651, 2663, + 2675, 2687, 2699, 2711, 2723, 2735, 2747, 2759, 2771, 2783, 2795, 2807, 2819, + 2831, 2843, 2855, 2867, 2879, 2891, 2903, 2915, 2927, 2939, 2951, 2963, 2975, + 2987, 2999, 3011, 3023, 3035, 3047, 3059, 3071, 3083, 3095, 3107, 3119, 3131, + 3143, 3155, 3167, 3179, 3191, 3203, 3215, 3227, 3239, 3251, 3263, 3275, 3287, + 3299, 3311, 3323, 3335, 3347, 3359, 3371, 3383, 3395, 3407, 3419, 3431, 3443, + 3455, 3467, 3479, 3491, 3503, 3515, 3527, 3539, 3551, 3563, 3575, 3587, 3599, + 3611, 3623, 3635, 3647, 3659, 3671, 3683, 3695, 3707, 3719, 3731, 3743, 3755, + 3767, 3779, 3791, 3803, 3815, 3827, 3839, 3851, 3863, 3875, 3887, 3899, 3911, + 3923, 3935, 3947, 3959, 3971, 3983, 3995, 4007, 4019, 4031, 4043, 4055, 4067, + 4079, 4091, 4103, 4115, 4127, 4139, 4151, 4175, 4187, 4199, 4211, 4223, 4235, + 4247, 4259, 4271, 4283, 4295, 4307, 4319, 4331, 4343, 4355, 4367, 4379, 4391, + 4403, 4415, 4427, 4439, 4451, 4463, 4475, 4487, 4499, 4511, 4523, 4535, 4547, + 4559, 4571, 4583, 4595, 4607, 4619, 4631, 4643, 4655, 4667, 4679, 4691, 4703, + 4715, 4727, 4739, 4751, 4763, 4775, 4787, 4799, 4811, 4823, 4835, 4847, 4859, + 4871, 4883, 4895, 4907, 4919, 4931, 4943, 4955, 4967, 4979, 4991, 5003, 5015, + 5027, 5039, 5051, 5063, 5075, 5087, 5099, 5111, 5123, 5135, 5147, 5159, 5171, + 5183, 5195, 5207, 5219, 5231, 5243, 5255, 5267, 5279, 5291, 5303, 5315, 5327, + 5339, 5351, 5363, 5375, 5387, 5399, 5411, 5423, 5435, 5447, 5459, 5471, 5483, + 5495, 5507, 5519, 5531, 5543, 5555, 5567, 5579, 5591, 5603, 5615, 5627, 5639, + 5651, 5663, 5675, 5687, 5699, 5711, 5723, 5735, 5747, 5759, 5771, 5783, 5795, + 5807, 5819, 5831, 5843, 5855, 5867, 5879, 5891, 5903, 5915, 5927, 5939, 5951, + 5963, 5975, 5987, 5999, 6011, 6023, 6035, 6047, 6059, 6071, 6083, 6095, 6107, + 6119, 6131, 6143, 6155, 6167, 6179, 6191, 6203, 6215, 6227, 6239, 6251, 6263, + 6275, 6287, 6299, 6311, 6323, 6335, 6347, 6359, 6371, 6383, 6395, 6407, 6419, + 6431, 6443, 6455, 6467, 6479, 6491, 6503, 6515, 6527, 6539, 6551, 6563, 6575, + 6587, 6599, 6611, 6623, 6635, 6647, 6671, 6683, 6695, 6707, 6719, 6731, 6743, + 6755, 6767, 6779, 6791, 6803, 6815, 6827, 6839, 6851, 6863, 6875, 6887, 6899, + 6911, 6923, 6935, 6947, 6959, 6971, 6983, 6995, 7007, 7019, 7031, 7043, 7055, + 7067, 7079, 7091, 7103, 7115, 7127, 7139, 7151, 7163, 7175, 7187, 7199, 7211, + 7223, 7235, 7247, 7259, 7271, 7283, 7295, 7307, 7319, 7331, 7343, 7355, 7367, + 7379, 7391, 7403, 7415, 7427, 7439, 7451, 7463, 7475, 7487, 7499, 7511, 7523, + 7535, 7547, 7559, 7571, 7583, 7595, 7607, 7619, 7631, 7643, 7655, 7667, 7679, + 7691, 7703, 7715, 7727, 7739, 7751, 7763, 7775, 7787, 7799, 7811, 7823, 7835, + 7847, 7859, 7871, 7883, 7895, 7907, 7919, 7931, 7943, 7955, 7967, 7979, 7991, + 8003, 8015, 8027, 8039, 8051, 8063, 8075, 8087, 8099, 8111, 8123, 8135, 8147, + 8159, 8171, 8183, 8195, 8207, 8219, 8231, 8243, 8255, 8267, 8279, 8291, 8303, + 8315, 8327, 8339, 8351, 8363, 8375, 8387, 8399, 8411, 8423, 8435, 8447, 8459, + 8471, 8483, 8495, 8507, 8519, 8531, 8543, 8555, 8567, 8579, 8591, 8603, 8615, + 8627, 8639, 8651, 8663, 8675, 8687, 8699, 8711, 8723, 8735, 8747, 8759, 8771, + 8783, 8795, 8807, 8819, 8831, 8843, 8855, 8867, 8879, 8891, 8903, 8915, 8927, + 8939, 8951, 8963, 8975, 8987, 8999, 9011, 9023, 9035, 9047, 9059, 9071, 9083, + 9095, 9107, 9119, 9131, 9143, 9167, 9179, 9191, 9203, 9215, 9227, 9239, 9251, + 9263, 9275, 9287, 9299, 9311, 9323, 9335, 9347, 9359, 9371, 9383, 9395, 9407, + 9419, 9431, 9443, 9455, 9467, 9479, 9491, 9503, 9515, 9527, 9539, 9551, 9563, + 9575, 9587, 9599, 9611, 9623, 9635, 9647, 9659, 9671, 9683, 9695, 9707, 9719, + 9731, 9743, 9755, 9767, 9779, 9791, 9803, 9815, 9827, 9839, 9851, 9863, 9875, + 9887, 9899, 9911, 9923, 9935, 9947, 9959, 9971, 9983, + }, + /* 8 */ + { + 12, 24, 36, 48, 60, 72, 84, 96, 108, 120, 132, 144, 156, + 168, 180, 192, 204, 216, 228, 240, 252, 264, 276, 288, 300, 312, + 324, 336, 348, 360, 372, 384, 396, 408, 420, 432, 444, 456, 468, + 480, 492, 504, 516, 528, 540, 552, 564, 576, 588, 600, 612, 624, + 636, 648, 660, 672, 684, 696, 708, 720, 732, 744, 756, 768, 780, + 792, 804, 816, 828, 840, 852, 864, 876, 888, 900, 912, 924, 936, + 948, 960, 972, 984, 996, 1008, 1020, 1032, 1044, 1056, 1068, 1080, 1092, + 1104, 1116, 1128, 1140, 1152, 1164, 1176, 1188, 1200, 1212, 1224, 1236, 1248, + 1260, 1272, 1284, 1296, 1308, 1320, 1332, 1344, 1356, 1368, 1380, 1392, 1404, + 1416, 1428, 1440, 1452, 1464, 1476, 1488, 1500, 1512, 1524, 1536, 1548, 1560, + 1572, 1584, 1596, 1608, 1620, 1632, 1644, 1656, 1668, 1680, 1692, 1704, 1716, + 1728, 1740, 1752, 1764, 1776, 1788, 1800, 1812, 1824, 1836, 1848, 1860, 1872, + 1884, 1896, 1908, 1920, 1932, 1944, 1956, 1968, 1980, 1992, 2004, 2016, 2028, + 2040, 2052, 2064, 2076, 2088, 2100, 2112, 2124, 2136, 2148, 2160, 2172, 2184, + 2196, 2208, 2220, 2232, 2244, 2256, 2268, 2280, 2292, 2304, 2316, 2328, 2340, + 2352, 2364, 2376, 2388, 2400, 2412, 2424, 2436, 2448, 2460, 2472, 2484, 2508, + 2520, 2532, 2544, 2556, 2568, 2580, 2592, 2604, 2616, 2628, 2640, 2652, 2664, + 2676, 2688, 2700, 2712, 2724, 2736, 2748, 2760, 2772, 2784, 2796, 2808, 2820, + 2832, 2844, 2856, 2868, 2880, 2892, 2904, 2916, 2928, 2940, 2952, 2964, 2976, + 2988, 3000, 3012, 3024, 3036, 3048, 3060, 3072, 3084, 3096, 3108, 3120, 3132, + 3144, 3156, 3168, 3180, 3192, 3204, 3216, 3228, 3240, 3252, 3264, 3276, 3288, + 3300, 3312, 3324, 3336, 3348, 3360, 3372, 3384, 3396, 3408, 3420, 3432, 3444, + 3456, 3468, 3480, 3492, 3504, 3516, 3528, 3540, 3552, 3564, 3576, 3588, 3600, + 3612, 3624, 3636, 3648, 3660, 3672, 3684, 3696, 3708, 3720, 3732, 3744, 3756, + 3768, 3780, 3792, 3804, 3816, 3828, 3840, 3852, 3864, 3876, 3888, 3900, 3912, + 3924, 3936, 3948, 3960, 3972, 3984, 3996, 4008, 4020, 4032, 4044, 4056, 4068, + 4080, 4092, 4104, 4116, 4128, 4140, 4152, 4164, 4176, 4188, 4200, 4212, 4224, + 4236, 4248, 4260, 4272, 4284, 4296, 4308, 4320, 4332, 4344, 4356, 4368, 4380, + 4392, 4404, 4416, 4428, 4440, 4452, 4464, 4476, 4488, 4500, 4512, 4524, 4536, + 4548, 4560, 4572, 4584, 4596, 4608, 4620, 4632, 4644, 4656, 4668, 4680, 4692, + 4704, 4716, 4728, 4740, 4752, 4764, 4776, 4788, 4800, 4812, 4824, 4836, 4848, + 4860, 4872, 4884, 4896, 4908, 4920, 4932, 4944, 4956, 4968, 4980, 5004, 5016, + 5028, 5040, 5052, 5064, 5076, 5088, 5100, 5112, 5124, 5136, 5148, 5160, 5172, + 5184, 5196, 5208, 5220, 5232, 5244, 5256, 5268, 5280, 5292, 5304, 5316, 5328, + 5340, 5352, 5364, 5376, 5388, 5400, 5412, 5424, 5436, 5448, 5460, 5472, 5484, + 5496, 5508, 5520, 5532, 5544, 5556, 5568, 5580, 5592, 5604, 5616, 5628, 5640, + 5652, 5664, 5676, 5688, 5700, 5712, 5724, 5736, 5748, 5760, 5772, 5784, 5796, + 5808, 5820, 5832, 5844, 5856, 5868, 5880, 5892, 5904, 5916, 5928, 5940, 5952, + 5964, 5976, 5988, 6000, 6012, 6024, 6036, 6048, 6060, 6072, 6084, 6096, 6108, + 6120, 6132, 6144, 6156, 6168, 6180, 6192, 6204, 6216, 6228, 6240, 6252, 6264, + 6276, 6288, 6300, 6312, 6324, 6336, 6348, 6360, 6372, 6384, 6396, 6408, 6420, + 6432, 6444, 6456, 6468, 6480, 6492, 6504, 6516, 6528, 6540, 6552, 6564, 6576, + 6588, 6600, 6612, 6624, 6636, 6648, 6660, 6672, 6684, 6696, 6708, 6720, 6732, + 6744, 6756, 6768, 6780, 6792, 6804, 6816, 6828, 6840, 6852, 6864, 6876, 6888, + 6900, 6912, 6924, 6936, 6948, 6960, 6972, 6984, 6996, 7008, 7020, 7032, 7044, + 7056, 7068, 7080, 7092, 7104, 7116, 7128, 7140, 7152, 7164, 7176, 7188, 7200, + 7212, 7224, 7236, 7248, 7260, 7272, 7284, 7296, 7308, 7320, 7332, 7344, 7356, + 7368, 7380, 7392, 7404, 7416, 7428, 7440, 7452, 7464, 7476, 7500, 7512, 7524, + 7536, 7548, 7560, 7572, 7584, 7596, 7608, 7620, 7632, 7644, 7656, 7668, 7680, + 7692, 7704, 7716, 7728, 7740, 7752, 7764, 7776, 7788, 7800, 7812, 7824, 7836, + 7848, 7860, 7872, 7884, 7896, 7908, 7920, 7932, 7944, 7956, 7968, 7980, 7992, + 8004, 8016, 8028, 8040, 8052, 8064, 8076, 8088, 8100, 8112, 8124, 8136, 8148, + 8160, 8172, 8184, 8196, 8208, 8220, 8232, 8244, 8256, 8268, 8280, 8292, 8304, + 8316, 8328, 8340, 8352, 8364, 8376, 8388, 8400, 8412, 8424, 8436, 8448, 8460, + 8472, 8484, 8496, 8508, 8520, 8532, 8544, 8556, 8568, 8580, 8592, 8604, 8616, + 8628, 8640, 8652, 8664, 8676, 8688, 8700, 8712, 8724, 8736, 8748, 8760, 8772, + 8784, 8796, 8808, 8820, 8832, 8844, 8856, 8868, 8880, 8892, 8904, 8916, 8928, + 8940, 8952, 8964, 8976, 8988, 9000, 9012, 9024, 9036, 9048, 9060, 9072, 9084, + 9096, 9108, 9120, 9132, 9144, 9156, 9168, 9180, 9192, 9204, 9216, 9228, 9240, + 9252, 9264, 9276, 9288, 9300, 9312, 9324, 9336, 9348, 9360, 9372, 9384, 9396, + 9408, 9420, 9432, 9444, 9456, 9468, 9480, 9492, 9504, 9516, 9528, 9540, 9552, + 9564, 9576, 9588, 9600, 9612, 9624, 9636, 9648, 9660, 9672, 9684, 9696, 9708, + 9720, 9732, 9744, 9756, 9768, 9780, 9792, 9804, 9816, 9828, 9840, 9852, 9864, + 9876, 9888, 9900, 9912, 9924, 9936, 9948, 9960, 9972, + }, + /* 9 */ + { + 13, 25, 37, 49, 61, 73, 85, 97, 109, 121, 133, 145, 157, + 169, 181, 193, 205, 217, 229, 241, 253, 265, 277, 289, 301, 313, + 325, 337, 349, 361, 373, 385, 397, 409, 421, 433, 445, 457, 469, + 481, 493, 505, 517, 529, 541, 553, 565, 577, 589, 601, 613, 625, + 637, 649, 661, 673, 685, 697, 709, 721, 733, 745, 757, 769, 781, + 793, 805, 817, 829, 841, 853, 865, 877, 889, 901, 913, 925, 937, + 949, 961, 973, 985, 997, 1009, 1021, 1033, 1045, 1057, 1069, 1081, 1093, + 1105, 1117, 1129, 1141, 1153, 1165, 1177, 1189, 1201, 1213, 1225, 1237, 1249, + 1261, 1273, 1285, 1297, 1309, 1321, 1333, 1345, 1357, 1369, 1381, 1393, 1405, + 1417, 1429, 1441, 1453, 1465, 1477, 1489, 1501, 1513, 1525, 1537, 1549, 1561, + 1573, 1585, 1597, 1609, 1621, 1633, 1645, 1657, 1669, 1681, 1693, 1705, 1717, + 1729, 1741, 1753, 1765, 1777, 1789, 1801, 1813, 1825, 1837, 1849, 1861, 1873, + 1885, 1897, 1909, 1921, 1933, 1945, 1957, 1969, 1981, 1993, 2005, 2017, 2029, + 2041, 2053, 2065, 2077, 2089, 2101, 2113, 2125, 2137, 2149, 2161, 2173, 2185, + 2197, 2209, 2221, 2233, 2245, 2257, 2269, 2281, 2293, 2305, 2317, 2329, 2341, + 2353, 2365, 2377, 2389, 2401, 2413, 2425, 2437, 2449, 2461, 2473, 2485, 2509, + 2521, 2533, 2545, 2557, 2569, 2581, 2593, 2605, 2617, 2629, 2641, 2653, 2665, + 2677, 2689, 2701, 2713, 2725, 2737, 2749, 2761, 2773, 2785, 2797, 2809, 2821, + 2833, 2845, 2857, 2869, 2881, 2893, 2905, 2917, 2929, 2941, 2953, 2965, 2977, + 2989, 3001, 3013, 3025, 3037, 3049, 3061, 3073, 3085, 3097, 3109, 3121, 3133, + 3145, 3157, 3169, 3181, 3193, 3205, 3217, 3229, 3241, 3253, 3265, 3277, 3289, + 3301, 3313, 3325, 3337, 3349, 3361, 3373, 3385, 3397, 3409, 3421, 3433, 3445, + 3457, 3469, 3481, 3493, 3505, 3517, 3529, 3541, 3553, 3565, 3577, 3589, 3601, + 3613, 3625, 3637, 3649, 3661, 3673, 3685, 3697, 3709, 3721, 3733, 3745, 3757, + 3769, 3781, 3793, 3805, 3817, 3829, 3841, 3853, 3865, 3877, 3889, 3901, 3913, + 3925, 3937, 3949, 3961, 3973, 3985, 3997, 4009, 4021, 4033, 4045, 4057, 4069, + 4081, 4093, 4105, 4117, 4129, 4141, 4153, 4165, 4177, 4189, 4201, 4213, 4225, + 4237, 4249, 4261, 4273, 4285, 4297, 4309, 4321, 4333, 4345, 4357, 4369, 4381, + 4393, 4405, 4417, 4429, 4441, 4453, 4465, 4477, 4489, 4501, 4513, 4525, 4537, + 4549, 4561, 4573, 4585, 4597, 4609, 4621, 4633, 4645, 4657, 4669, 4681, 4693, + 4705, 4717, 4729, 4741, 4753, 4765, 4777, 4789, 4801, 4813, 4825, 4837, 4849, + 4861, 4873, 4885, 4897, 4909, 4921, 4933, 4945, 4957, 4969, 4981, 5005, 5017, + 5029, 5041, 5053, 5065, 5077, 5089, 5101, 5113, 5125, 5137, 5149, 5161, 5173, + 5185, 5197, 5209, 5221, 5233, 5245, 5257, 5269, 5281, 5293, 5305, 5317, 5329, + 5341, 5353, 5365, 5377, 5389, 5401, 5413, 5425, 5437, 5449, 5461, 5473, 5485, + 5497, 5509, 5521, 5533, 5545, 5557, 5569, 5581, 5593, 5605, 5617, 5629, 5641, + 5653, 5665, 5677, 5689, 5701, 5713, 5725, 5737, 5749, 5761, 5773, 5785, 5797, + 5809, 5821, 5833, 5845, 5857, 5869, 5881, 5893, 5905, 5917, 5929, 5941, 5953, + 5965, 5977, 5989, 6001, 6013, 6025, 6037, 6049, 6061, 6073, 6085, 6097, 6109, + 6121, 6133, 6145, 6157, 6169, 6181, 6193, 6205, 6217, 6229, 6241, 6253, 6265, + 6277, 6289, 6301, 6313, 6325, 6337, 6349, 6361, 6373, 6385, 6397, 6409, 6421, + 6433, 6445, 6457, 6469, 6481, 6493, 6505, 6517, 6529, 6541, 6553, 6565, 6577, + 6589, 6601, 6613, 6625, 6637, 6649, 6661, 6673, 6685, 6697, 6709, 6721, 6733, + 6745, 6757, 6769, 6781, 6793, 6805, 6817, 6829, 6841, 6853, 6865, 6877, 6889, + 6901, 6913, 6925, 6937, 6949, 6961, 6973, 6985, 6997, 7009, 7021, 7033, 7045, + 7057, 7069, 7081, 7093, 7105, 7117, 7129, 7141, 7153, 7165, 7177, 7189, 7201, + 7213, 7225, 7237, 7249, 7261, 7273, 7285, 7297, 7309, 7321, 7333, 7345, 7357, + 7369, 7381, 7393, 7405, 7417, 7429, 7441, 7453, 7465, 7477, 7501, 7513, 7525, + 7537, 7549, 7561, 7573, 7585, 7597, 7609, 7621, 7633, 7645, 7657, 7669, 7681, + 7693, 7705, 7717, 7729, 7741, 7753, 7765, 7777, 7789, 7801, 7813, 7825, 7837, + 7849, 7861, 7873, 7885, 7897, 7909, 7921, 7933, 7945, 7957, 7969, 7981, 7993, + 8005, 8017, 8029, 8041, 8053, 8065, 8077, 8089, 8101, 8113, 8125, 8137, 8149, + 8161, 8173, 8185, 8197, 8209, 8221, 8233, 8245, 8257, 8269, 8281, 8293, 8305, + 8317, 8329, 8341, 8353, 8365, 8377, 8389, 8401, 8413, 8425, 8437, 8449, 8461, + 8473, 8485, 8497, 8509, 8521, 8533, 8545, 8557, 8569, 8581, 8593, 8605, 8617, + 8629, 8641, 8653, 8665, 8677, 8689, 8701, 8713, 8725, 8737, 8749, 8761, 8773, + 8785, 8797, 8809, 8821, 8833, 8845, 8857, 8869, 8881, 8893, 8905, 8917, 8929, + 8941, 8953, 8965, 8977, 8989, 9001, 9013, 9025, 9037, 9049, 9061, 9073, 9085, + 9097, 9109, 9121, 9133, 9145, 9157, 9169, 9181, 9193, 9205, 9217, 9229, 9241, + 9253, 9265, 9277, 9289, 9301, 9313, 9325, 9337, 9349, 9361, 9373, 9385, 9397, + 9409, 9421, 9433, 9445, 9457, 9469, 9481, 9493, 9505, 9517, 9529, 9541, 9553, + 9565, 9577, 9589, 9601, 9613, 9625, 9637, 9649, 9661, 9673, 9685, 9697, 9709, + 9721, 9733, 9745, 9757, 9769, 9781, 9793, 9805, 9817, 9829, 9841, 9853, 9865, + 9877, 9889, 9901, 9913, 9925, 9937, 9949, 9961, 9973, + }, + /* 10 */ + { + 14, 26, 38, 50, 62, 74, 86, 98, 110, 122, 134, 146, 158, + 170, 182, 194, 206, 218, 230, 242, 254, 266, 278, 290, 302, 314, + 326, 338, 350, 362, 374, 386, 398, 410, 422, 434, 446, 458, 470, + 482, 494, 506, 518, 530, 542, 554, 566, 578, 590, 602, 614, 626, + 638, 650, 662, 674, 686, 698, 710, 722, 734, 746, 758, 770, 782, + 794, 806, 818, 830, 842, 854, 866, 878, 890, 902, 914, 926, 938, + 950, 962, 974, 986, 998, 1010, 1022, 1034, 1046, 1058, 1070, 1082, 1094, + 1106, 1118, 1130, 1142, 1154, 1166, 1178, 1190, 1202, 1214, 1226, 1238, 1250, + 1262, 1274, 1286, 1298, 1310, 1322, 1334, 1346, 1358, 1370, 1382, 1394, 1406, + 1418, 1430, 1442, 1454, 1466, 1478, 1490, 1502, 1514, 1526, 1538, 1550, 1562, + 1574, 1586, 1598, 1610, 1622, 1634, 1646, 1658, 1670, 1682, 1694, 1706, 1718, + 1730, 1742, 1754, 1766, 1778, 1790, 1802, 1814, 1826, 1838, 1850, 1862, 1874, + 1886, 1898, 1910, 1922, 1934, 1946, 1958, 1970, 1982, 1994, 2006, 2018, 2030, + 2042, 2054, 2066, 2078, 2090, 2102, 2114, 2126, 2138, 2150, 2162, 2174, 2186, + 2198, 2210, 2222, 2234, 2246, 2258, 2270, 2282, 2294, 2306, 2318, 2330, 2342, + 2354, 2366, 2378, 2390, 2402, 2414, 2426, 2438, 2450, 2462, 2474, 2486, 2510, + 2522, 2534, 2546, 2558, 2570, 2582, 2594, 2606, 2618, 2630, 2642, 2654, 2666, + 2678, 2690, 2702, 2714, 2726, 2738, 2750, 2762, 2774, 2786, 2798, 2810, 2822, + 2834, 2846, 2858, 2870, 2882, 2894, 2906, 2918, 2930, 2942, 2954, 2966, 2978, + 2990, 3002, 3014, 3026, 3038, 3050, 3062, 3074, 3086, 3098, 3110, 3122, 3134, + 3146, 3158, 3170, 3182, 3194, 3206, 3218, 3230, 3242, 3254, 3266, 3278, 3290, + 3302, 3314, 3326, 3338, 3350, 3362, 3374, 3386, 3398, 3410, 3422, 3434, 3446, + 3458, 3470, 3482, 3494, 3506, 3518, 3530, 3542, 3554, 3566, 3578, 3590, 3602, + 3614, 3626, 3638, 3650, 3662, 3674, 3686, 3698, 3710, 3722, 3734, 3746, 3758, + 3770, 3782, 3794, 3806, 3818, 3830, 3842, 3854, 3866, 3878, 3890, 3902, 3914, + 3926, 3938, 3950, 3962, 3974, 3986, 3998, 4010, 4022, 4034, 4046, 4058, 4070, + 4082, 4094, 4106, 4118, 4130, 4142, 4154, 4166, 4178, 4190, 4202, 4214, 4226, + 4238, 4250, 4262, 4274, 4286, 4298, 4310, 4322, 4334, 4346, 4358, 4370, 4382, + 4394, 4406, 4418, 4430, 4442, 4454, 4466, 4478, 4490, 4502, 4514, 4526, 4538, + 4550, 4562, 4574, 4586, 4598, 4610, 4622, 4634, 4646, 4658, 4670, 4682, 4694, + 4706, 4718, 4730, 4742, 4754, 4766, 4778, 4790, 4802, 4814, 4826, 4838, 4850, + 4862, 4874, 4886, 4898, 4910, 4922, 4934, 4946, 4958, 4970, 4982, 5006, 5018, + 5030, 5042, 5054, 5066, 5078, 5090, 5102, 5114, 5126, 5138, 5150, 5162, 5174, + 5186, 5198, 5210, 5222, 5234, 5246, 5258, 5270, 5282, 5294, 5306, 5318, 5330, + 5342, 5354, 5366, 5378, 5390, 5402, 5414, 5426, 5438, 5450, 5462, 5474, 5486, + 5498, 5510, 5522, 5534, 5546, 5558, 5570, 5582, 5594, 5606, 5618, 5630, 5642, + 5654, 5666, 5678, 5690, 5702, 5714, 5726, 5738, 5750, 5762, 5774, 5786, 5798, + 5810, 5822, 5834, 5846, 5858, 5870, 5882, 5894, 5906, 5918, 5930, 5942, 5954, + 5966, 5978, 5990, 6002, 6014, 6026, 6038, 6050, 6062, 6074, 6086, 6098, 6110, + 6122, 6134, 6146, 6158, 6170, 6182, 6194, 6206, 6218, 6230, 6242, 6254, 6266, + 6278, 6290, 6302, 6314, 6326, 6338, 6350, 6362, 6374, 6386, 6398, 6410, 6422, + 6434, 6446, 6458, 6470, 6482, 6494, 6506, 6518, 6530, 6542, 6554, 6566, 6578, + 6590, 6602, 6614, 6626, 6638, 6650, 6662, 6674, 6686, 6698, 6710, 6722, 6734, + 6746, 6758, 6770, 6782, 6794, 6806, 6818, 6830, 6842, 6854, 6866, 6878, 6890, + 6902, 6914, 6926, 6938, 6950, 6962, 6974, 6986, 6998, 7010, 7022, 7034, 7046, + 7058, 7070, 7082, 7094, 7106, 7118, 7130, 7142, 7154, 7166, 7178, 7190, 7202, + 7214, 7226, 7238, 7250, 7262, 7274, 7286, 7298, 7310, 7322, 7334, 7346, 7358, + 7370, 7382, 7394, 7406, 7418, 7430, 7442, 7454, 7466, 7478, 7502, 7514, 7526, + 7538, 7550, 7562, 7574, 7586, 7598, 7610, 7622, 7634, 7646, 7658, 7670, 7682, + 7694, 7706, 7718, 7730, 7742, 7754, 7766, 7778, 7790, 7802, 7814, 7826, 7838, + 7850, 7862, 7874, 7886, 7898, 7910, 7922, 7934, 7946, 7958, 7970, 7982, 7994, + 8006, 8018, 8030, 8042, 8054, 8066, 8078, 8090, 8102, 8114, 8126, 8138, 8150, + 8162, 8174, 8186, 8198, 8210, 8222, 8234, 8246, 8258, 8270, 8282, 8294, 8306, + 8318, 8330, 8342, 8354, 8366, 8378, 8390, 8402, 8414, 8426, 8438, 8450, 8462, + 8474, 8486, 8498, 8510, 8522, 8534, 8546, 8558, 8570, 8582, 8594, 8606, 8618, + 8630, 8642, 8654, 8666, 8678, 8690, 8702, 8714, 8726, 8738, 8750, 8762, 8774, + 8786, 8798, 8810, 8822, 8834, 8846, 8858, 8870, 8882, 8894, 8906, 8918, 8930, + 8942, 8954, 8966, 8978, 8990, 9002, 9014, 9026, 9038, 9050, 9062, 9074, 9086, + 9098, 9110, 9122, 9134, 9146, 9158, 9170, 9182, 9194, 9206, 9218, 9230, 9242, + 9254, 9266, 9278, 9290, 9302, 9314, 9326, 9338, 9350, 9362, 9374, 9386, 9398, + 9410, 9422, 9434, 9446, 9458, 9470, 9482, 9494, 9506, 9518, 9530, 9542, 9554, + 9566, 9578, 9590, 9602, 9614, 9626, 9638, 9650, 9662, 9674, 9686, 9698, 9710, + 9722, 9734, 9746, 9758, 9770, 9782, 9794, 9806, 9818, 9830, 9842, 9854, 9866, + 9878, 9890, 9902, 9914, 9926, 9938, 9950, 9962, 9974, + }, + /* 11 */ + { + 15, 27, 39, 51, 63, 75, 87, 99, 111, 123, 135, 147, 159, + 171, 183, 195, 207, 219, 231, 243, 255, 267, 279, 291, 303, 315, + 327, 339, 351, 363, 375, 387, 399, 411, 423, 435, 447, 459, 471, + 483, 495, 507, 519, 531, 543, 555, 567, 579, 591, 603, 615, 627, + 639, 651, 663, 675, 687, 699, 711, 723, 735, 747, 759, 771, 783, + 795, 807, 819, 831, 843, 855, 867, 879, 891, 903, 915, 927, 939, + 951, 963, 975, 987, 999, 1011, 1023, 1035, 1047, 1059, 1071, 1083, 1095, + 1107, 1119, 1131, 1143, 1155, 1167, 1179, 1191, 1203, 1215, 1227, 1239, 1251, + 1263, 1275, 1287, 1299, 1311, 1323, 1335, 1347, 1359, 1371, 1383, 1395, 1407, + 1419, 1431, 1443, 1455, 1467, 1479, 1491, 1503, 1515, 1527, 1539, 1551, 1563, + 1575, 1587, 1599, 1611, 1623, 1635, 1647, 1659, 1671, 1683, 1695, 1707, 1719, + 1731, 1743, 1755, 1767, 1779, 1791, 1803, 1815, 1827, 1839, 1851, 1863, 1875, + 1887, 1899, 1911, 1923, 1935, 1947, 1959, 1971, 1983, 1995, 2007, 2019, 2031, + 2043, 2055, 2067, 2079, 2091, 2103, 2115, 2127, 2139, 2151, 2163, 2175, 2187, + 2199, 2211, 2223, 2235, 2247, 2259, 2271, 2283, 2295, 2307, 2319, 2331, 2343, + 2355, 2367, 2379, 2391, 2403, 2415, 2427, 2439, 2451, 2463, 2475, 2487, 2511, + 2523, 2535, 2547, 2559, 2571, 2583, 2595, 2607, 2619, 2631, 2643, 2655, 2667, + 2679, 2691, 2703, 2715, 2727, 2739, 2751, 2763, 2775, 2787, 2799, 2811, 2823, + 2835, 2847, 2859, 2871, 2883, 2895, 2907, 2919, 2931, 2943, 2955, 2967, 2979, + 2991, 3003, 3015, 3027, 3039, 3051, 3063, 3075, 3087, 3099, 3111, 3123, 3135, + 3147, 3159, 3171, 3183, 3195, 3207, 3219, 3231, 3243, 3255, 3267, 3279, 3291, + 3303, 3315, 3327, 3339, 3351, 3363, 3375, 3387, 3399, 3411, 3423, 3435, 3447, + 3459, 3471, 3483, 3495, 3507, 3519, 3531, 3543, 3555, 3567, 3579, 3591, 3603, + 3615, 3627, 3639, 3651, 3663, 3675, 3687, 3699, 3711, 3723, 3735, 3747, 3759, + 3771, 3783, 3795, 3807, 3819, 3831, 3843, 3855, 3867, 3879, 3891, 3903, 3915, + 3927, 3939, 3951, 3963, 3975, 3987, 3999, 4011, 4023, 4035, 4047, 4059, 4071, + 4083, 4095, 4107, 4119, 4131, 4143, 4155, 4167, 4179, 4191, 4203, 4215, 4227, + 4239, 4251, 4263, 4275, 4287, 4299, 4311, 4323, 4335, 4347, 4359, 4371, 4383, + 4395, 4407, 4419, 4431, 4443, 4455, 4467, 4479, 4491, 4503, 4515, 4527, 4539, + 4551, 4563, 4575, 4587, 4599, 4611, 4623, 4635, 4647, 4659, 4671, 4683, 4695, + 4707, 4719, 4731, 4743, 4755, 4767, 4779, 4791, 4803, 4815, 4827, 4839, 4851, + 4863, 4875, 4887, 4899, 4911, 4923, 4935, 4947, 4959, 4971, 4983, 5007, 5019, + 5031, 5043, 5055, 5067, 5079, 5091, 5103, 5115, 5127, 5139, 5151, 5163, 5175, + 5187, 5199, 5211, 5223, 5235, 5247, 5259, 5271, 5283, 5295, 5307, 5319, 5331, + 5343, 5355, 5367, 5379, 5391, 5403, 5415, 5427, 5439, 5451, 5463, 5475, 5487, + 5499, 5511, 5523, 5535, 5547, 5559, 5571, 5583, 5595, 5607, 5619, 5631, 5643, + 5655, 5667, 5679, 5691, 5703, 5715, 5727, 5739, 5751, 5763, 5775, 5787, 5799, + 5811, 5823, 5835, 5847, 5859, 5871, 5883, 5895, 5907, 5919, 5931, 5943, 5955, + 5967, 5979, 5991, 6003, 6015, 6027, 6039, 6051, 6063, 6075, 6087, 6099, 6111, + 6123, 6135, 6147, 6159, 6171, 6183, 6195, 6207, 6219, 6231, 6243, 6255, 6267, + 6279, 6291, 6303, 6315, 6327, 6339, 6351, 6363, 6375, 6387, 6399, 6411, 6423, + 6435, 6447, 6459, 6471, 6483, 6495, 6507, 6519, 6531, 6543, 6555, 6567, 6579, + 6591, 6603, 6615, 6627, 6639, 6651, 6663, 6675, 6687, 6699, 6711, 6723, 6735, + 6747, 6759, 6771, 6783, 6795, 6807, 6819, 6831, 6843, 6855, 6867, 6879, 6891, + 6903, 6915, 6927, 6939, 6951, 6963, 6975, 6987, 6999, 7011, 7023, 7035, 7047, + 7059, 7071, 7083, 7095, 7107, 7119, 7131, 7143, 7155, 7167, 7179, 7191, 7203, + 7215, 7227, 7239, 7251, 7263, 7275, 7287, 7299, 7311, 7323, 7335, 7347, 7359, + 7371, 7383, 7395, 7407, 7419, 7431, 7443, 7455, 7467, 7479, 7503, 7515, 7527, + 7539, 7551, 7563, 7575, 7587, 7599, 7611, 7623, 7635, 7647, 7659, 7671, 7683, + 7695, 7707, 7719, 7731, 7743, 7755, 7767, 7779, 7791, 7803, 7815, 7827, 7839, + 7851, 7863, 7875, 7887, 7899, 7911, 7923, 7935, 7947, 7959, 7971, 7983, 7995, + 8007, 8019, 8031, 8043, 8055, 8067, 8079, 8091, 8103, 8115, 8127, 8139, 8151, + 8163, 8175, 8187, 8199, 8211, 8223, 8235, 8247, 8259, 8271, 8283, 8295, 8307, + 8319, 8331, 8343, 8355, 8367, 8379, 8391, 8403, 8415, 8427, 8439, 8451, 8463, + 8475, 8487, 8499, 8511, 8523, 8535, 8547, 8559, 8571, 8583, 8595, 8607, 8619, + 8631, 8643, 8655, 8667, 8679, 8691, 8703, 8715, 8727, 8739, 8751, 8763, 8775, + 8787, 8799, 8811, 8823, 8835, 8847, 8859, 8871, 8883, 8895, 8907, 8919, 8931, + 8943, 8955, 8967, 8979, 8991, 9003, 9015, 9027, 9039, 9051, 9063, 9075, 9087, + 9099, 9111, 9123, 9135, 9147, 9159, 9171, 9183, 9195, 9207, 9219, 9231, 9243, + 9255, 9267, 9279, 9291, 9303, 9315, 9327, 9339, 9351, 9363, 9375, 9387, 9399, + 9411, 9423, 9435, 9447, 9459, 9471, 9483, 9495, 9507, 9519, 9531, 9543, 9555, + 9567, 9579, 9591, 9603, 9615, 9627, 9639, 9651, 9663, 9675, 9687, 9699, 9711, + 9723, 9735, 9747, 9759, 9771, 9783, 9795, 9807, 9819, 9831, 9843, 9855, 9867, + 9879, 9891, 9903, 9915, 9927, 9939, 9951, 9963, 9975, + }, }; const unsigned int enco_which_dibits[12][828] = { - /* 0 */ - {6, 4, 2, 0, 102, 100, 98, 96, - 198, 196, 194, 192, 294, 292, 290, 288, - 390, 388, 386, 384, 486, 484, 482, 480, - 582, 580, 578, 576, 678, 676, 674, 672, - 774, 772, 770, 768, 870, 868, 866, 864, - 966, 964, 962, 960, 1062, 1060, 1058, 1056, - 1158, 1156, 1154, 1152, 1254, 1252, 1250, 1248, - 1350, 1348, 1346, 1344, 1446, 1444, 1442, 1440, - 1542, 1540, 1538, 1536, 1638, 1636, 1634, 1632, - 1798, 1796, 1794, 1792, 1894, 1892, 1890, 1888, - 1990, 1988, 1986, 1984, 2086, 2084, 2082, 2080, - 2182, 2180, 2178, 2176, 2278, 2276, 2274, 2272, - 2374, 2372, 2370, 2368, 2470, 2468, 2466, 2464, - 2566, 2564, 2562, 2560, 2662, 2660, 2658, 2656, - 2758, 2756, 2754, 2752, 2854, 2852, 2850, 2848, - 2950, 2948, 2946, 2944, 3046, 3044, 3042, 3040, - 3142, 3140, 3138, 3136, 3238, 3236, 3234, 3232, - 3334, 3332, 3330, 3328, 3398, 3396, 3394, 3392, - 3494, 3492, 3490, 3488, 3590, 3588, 3586, 3584, - 3686, 3684, 3682, 3680, 3782, 3780, 3778, 3776, - 3878, 3876, 3874, 3872, 3974, 3972, 3970, 3968, - 4070, 4068, 4066, 4064, 4166, 4164, 4162, 4160, - 4262, 4260, 4258, 4256, 4358, 4356, 4354, 4352, - 4454, 4452, 4450, 4448, 4550, 4548, 4546, 4544, - 4646, 4644, 4642, 4640, 4742, 4740, 4738, 4736, - 4838, 4836, 4834, 4832, 4934, 4932, 4930, 4928, - 4998, 4996, 4994, 4992, 5094, 5092, 5090, 5088, - 5190, 5188, 5186, 5184, 5286, 5284, 5282, 5280, - 5382, 5380, 5378, 5376, 5478, 5476, 5474, 5472, - 5574, 5572, 5570, 5568, 5670, 5668, 5666, 5664, - 5766, 5764, 5762, 5760, 5862, 5860, 5858, 5856, - 5958, 5956, 5954, 5952, 6054, 6052, 6050, 6048, - 6150, 6148, 6146, 6144, 6246, 6244, 6242, 6240, - 6342, 6340, 6338, 6336, 6438, 6436, 6434, 6432, - 6534, 6532, 6530, 6528, 6694, 6692, 6690, 6688, - 6790, 6788, 6786, 6784, 6886, 6884, 6882, 6880, - 6982, 6980, 6978, 6976, 7078, 7076, 7074, 7072, - 7174, 7172, 7170, 7168, 7270, 7268, 7266, 7264, - 7366, 7364, 7362, 7360, 7462, 7460, 7458, 7456, - 7558, 7556, 7554, 7552, 7654, 7652, 7650, 7648, - 7750, 7748, 7746, 7744, 7846, 7844, 7842, 7840, - 7942, 7940, 7938, 7936, 8038, 8036, 8034, 8032, - 8134, 8132, 8130, 8128, 8230, 8228, 8226, 8224, - 8326, 8324, 8322, 8320, 8390, 8388, 8386, 8384, - 8486, 8484, 8482, 8480, 8582, 8580, 8578, 8576, - 8678, 8676, 8674, 8672, 8774, 8772, 8770, 8768, - 8870, 8868, 8866, 8864, 8966, 8964, 8962, 8960, - 9062, 9060, 9058, 9056, 9158, 9156, 9154, 9152, - 9254, 9252, 9250, 9248, 9350, 9348, 9346, 9344, - 9446, 9444, 9442, 9440, 9542, 9540, 9538, 9536, - 9638, 9636, 9634, 9632, 9734, 9732, 9730, 9728, - 9830, 9828, 9826, 9824, 9926, 9924, 9922, 9920, - 9990, 9988, 9986, 9984, 10086, 10084, 10082, 10080, - 10182, 10180, 10178, 10176, 10278, 10276, 10274, 10272, - 10374, 10372, 10370, 10368, 10470, 10468, 10466, 10464, - 10566, 10564, 10562, 10560, 10662, 10660, 10658, 10656, - 10758, 10756, 10754, 10752, 10854, 10852, 10850, 10848, - 10950, 10948, 10946, 10944, 11046, 11044, 11042, 11040, - 11142, 11140, 11138, 11136, 11238, 11236, 11234, 11232, - 11334, 11332, 11330, 11328, 11430, 11428, 11426, 11424, - 11526, 11524, 11522, 11520, 11686, 11684, 11682, 11680, - 11782, 11780, 11778, 11776, 11878, 11876, 11874, 11872, - 11974, 11972, 11970, 11968, 12070, 12068, 12066, 12064, - 12166, 12164, 12162, 12160, 12262, 12260, 12258, 12256, - 12358, 12356, 12354, 12352, 12454, 12452, 12450, 12448, - 12550, 12548, 12546, 12544, 12646, 12644, 12642, 12640, - 12742, 12740, 12738, 12736, 12838, 12836, 12834, 12832, - 12934, 12932, 12930, 12928, 13030, 13028, 13026, 13024, - 13126, 13124, 13122, 13120, 13222, 13220, 13218, 13216, - 13286, 13284, 13282, 13280, 13382, 13380, 13378, 13376, - 13478, 13476, 13474, 13472, 13574, 13572, 13570, 13568, - 13670, 13668, 13666, 13664, 13766, 13764, 13762, 13760, - 13862, 13860, 13858, 13856, 13958, 13956, 13954, 13952, - 14054, 14052, 14050, 14048, 14150, 14148, 14146, 14144, - 14246, 14244, 14242, 14240, 14342, 14340, 14338, 14336, - 14438, 14436, 14434, 14432, 14534, 14532, 14530, 14528, - 14630, 14628, 14626, 14624, 14726, 14724, 14722, 14720, - 14822, 14820, 14818, 14816, 14918, 14916, 14914, 14912, - 14982, 14980, 14978, 14976, 15078, 15076, 15074, 15072, - 15174, 15172, 15170, 15168, 15270, 15268, 15266, 15264, - 15366, 15364, 15362, 15360, 15462, 15460, 15458, 15456, - 15558, 15556, 15554, 15552, 15654, 15652, 15650, 15648, - 15750, 15748, 15746, 15744, 15846, 15844, 15842, 15840, - 15942, 15940, 15938, 15936, 16038, 16036, 16034, 16032, - 16134, 16132, 16130, 16128, 16230, 16228, 16226, 16224, - 16326, 16324, 16322, 16320, 16422, 16420, 16418, 16416, - 16518, 16516, 16514, 16512, 16678, 16676, 16674, 16672, - 16774, 16772, 16770, 16768, 16870, 16868, 16866, 16864, - 16966, 16964, 16962, 16960, 17062, 17060, 17058, 17056, - 17158, 17156, 17154, 17152, 17254, 17252, 17250, 17248, - 17350, 17348, 17346, 17344, 17446, 17444, 17442, 17440, - 17542, 17540, 17538, 17536, 17638, 17636, 17634, 17632, - 17734, 17732, 17730, 17728, 17830, 17828, 17826, 17824, - 17926, 17924, 17922, 17920, 18022, 18020, 18018, 18016, - 18118, 18116, 18114, 18112, 18214, 18212, 18210, 18208, - 18278, 18276, 18274, 18272, 18374, 18372, 18370, 18368, - 18470, 18468, 18466, 18464, 18566, 18564, 18562, 18560, - 18662, 18660, 18658, 18656, 18758, 18756, 18754, 18752, - 18854, 18852, 18850, 18848, 18950, 18948, 18946, 18944, - 19046, 19044, 19042, 19040, 19142, 19140, 19138, 19136, - 19238, 19236, 19234, 19232, 19334, 19332, 19330, 19328, - 19430, 19428, 19426, 19424, 19526, 19524, 19522, 19520, - 19622, 19620, 19618, 19616, 19718, 19716, 19714, 19712, - 19814, 19812, 19810, 19808, }, - /* 1 */ - {14, 12, 10, 8, 110, 108, 106, 104, - 206, 204, 202, 200, 302, 300, 298, 296, - 398, 396, 394, 392, 494, 492, 490, 488, - 590, 588, 586, 584, 686, 684, 682, 680, - 782, 780, 778, 776, 878, 876, 874, 872, - 974, 972, 970, 968, 1070, 1068, 1066, 1064, - 1166, 1164, 1162, 1160, 1262, 1260, 1258, 1256, - 1358, 1356, 1354, 1352, 1454, 1452, 1450, 1448, - 1550, 1548, 1546, 1544, 1646, 1644, 1642, 1640, - 1806, 1804, 1802, 1800, 1902, 1900, 1898, 1896, - 1998, 1996, 1994, 1992, 2094, 2092, 2090, 2088, - 2190, 2188, 2186, 2184, 2286, 2284, 2282, 2280, - 2382, 2380, 2378, 2376, 2478, 2476, 2474, 2472, - 2574, 2572, 2570, 2568, 2670, 2668, 2666, 2664, - 2766, 2764, 2762, 2760, 2862, 2860, 2858, 2856, - 2958, 2956, 2954, 2952, 3054, 3052, 3050, 3048, - 3150, 3148, 3146, 3144, 3246, 3244, 3242, 3240, - 3342, 3340, 3338, 3336, 3406, 3404, 3402, 3400, - 3502, 3500, 3498, 3496, 3598, 3596, 3594, 3592, - 3694, 3692, 3690, 3688, 3790, 3788, 3786, 3784, - 3886, 3884, 3882, 3880, 3982, 3980, 3978, 3976, - 4078, 4076, 4074, 4072, 4174, 4172, 4170, 4168, - 4270, 4268, 4266, 4264, 4366, 4364, 4362, 4360, - 4462, 4460, 4458, 4456, 4558, 4556, 4554, 4552, - 4654, 4652, 4650, 4648, 4750, 4748, 4746, 4744, - 4846, 4844, 4842, 4840, 4942, 4940, 4938, 4936, - 5006, 5004, 5002, 5000, 5102, 5100, 5098, 5096, - 5198, 5196, 5194, 5192, 5294, 5292, 5290, 5288, - 5390, 5388, 5386, 5384, 5486, 5484, 5482, 5480, - 5582, 5580, 5578, 5576, 5678, 5676, 5674, 5672, - 5774, 5772, 5770, 5768, 5870, 5868, 5866, 5864, - 5966, 5964, 5962, 5960, 6062, 6060, 6058, 6056, - 6158, 6156, 6154, 6152, 6254, 6252, 6250, 6248, - 6350, 6348, 6346, 6344, 6446, 6444, 6442, 6440, - 6542, 6540, 6538, 6536, 6702, 6700, 6698, 6696, - 6798, 6796, 6794, 6792, 6894, 6892, 6890, 6888, - 6990, 6988, 6986, 6984, 7086, 7084, 7082, 7080, - 7182, 7180, 7178, 7176, 7278, 7276, 7274, 7272, - 7374, 7372, 7370, 7368, 7470, 7468, 7466, 7464, - 7566, 7564, 7562, 7560, 7662, 7660, 7658, 7656, - 7758, 7756, 7754, 7752, 7854, 7852, 7850, 7848, - 7950, 7948, 7946, 7944, 8046, 8044, 8042, 8040, - 8142, 8140, 8138, 8136, 8238, 8236, 8234, 8232, - 8334, 8332, 8330, 8328, 8398, 8396, 8394, 8392, - 8494, 8492, 8490, 8488, 8590, 8588, 8586, 8584, - 8686, 8684, 8682, 8680, 8782, 8780, 8778, 8776, - 8878, 8876, 8874, 8872, 8974, 8972, 8970, 8968, - 9070, 9068, 9066, 9064, 9166, 9164, 9162, 9160, - 9262, 9260, 9258, 9256, 9358, 9356, 9354, 9352, - 9454, 9452, 9450, 9448, 9550, 9548, 9546, 9544, - 9646, 9644, 9642, 9640, 9742, 9740, 9738, 9736, - 9838, 9836, 9834, 9832, 9934, 9932, 9930, 9928, - 9998, 9996, 9994, 9992, 10094, 10092, 10090, 10088, - 10190, 10188, 10186, 10184, 10286, 10284, 10282, 10280, - 10382, 10380, 10378, 10376, 10478, 10476, 10474, 10472, - 10574, 10572, 10570, 10568, 10670, 10668, 10666, 10664, - 10766, 10764, 10762, 10760, 10862, 10860, 10858, 10856, - 10958, 10956, 10954, 10952, 11054, 11052, 11050, 11048, - 11150, 11148, 11146, 11144, 11246, 11244, 11242, 11240, - 11342, 11340, 11338, 11336, 11438, 11436, 11434, 11432, - 11534, 11532, 11530, 11528, 11694, 11692, 11690, 11688, - 11790, 11788, 11786, 11784, 11886, 11884, 11882, 11880, - 11982, 11980, 11978, 11976, 12078, 12076, 12074, 12072, - 12174, 12172, 12170, 12168, 12270, 12268, 12266, 12264, - 12366, 12364, 12362, 12360, 12462, 12460, 12458, 12456, - 12558, 12556, 12554, 12552, 12654, 12652, 12650, 12648, - 12750, 12748, 12746, 12744, 12846, 12844, 12842, 12840, - 12942, 12940, 12938, 12936, 13038, 13036, 13034, 13032, - 13134, 13132, 13130, 13128, 13230, 13228, 13226, 13224, - 13294, 13292, 13290, 13288, 13390, 13388, 13386, 13384, - 13486, 13484, 13482, 13480, 13582, 13580, 13578, 13576, - 13678, 13676, 13674, 13672, 13774, 13772, 13770, 13768, - 13870, 13868, 13866, 13864, 13966, 13964, 13962, 13960, - 14062, 14060, 14058, 14056, 14158, 14156, 14154, 14152, - 14254, 14252, 14250, 14248, 14350, 14348, 14346, 14344, - 14446, 14444, 14442, 14440, 14542, 14540, 14538, 14536, - 14638, 14636, 14634, 14632, 14734, 14732, 14730, 14728, - 14830, 14828, 14826, 14824, 14926, 14924, 14922, 14920, - 14990, 14988, 14986, 14984, 15086, 15084, 15082, 15080, - 15182, 15180, 15178, 15176, 15278, 15276, 15274, 15272, - 15374, 15372, 15370, 15368, 15470, 15468, 15466, 15464, - 15566, 15564, 15562, 15560, 15662, 15660, 15658, 15656, - 15758, 15756, 15754, 15752, 15854, 15852, 15850, 15848, - 15950, 15948, 15946, 15944, 16046, 16044, 16042, 16040, - 16142, 16140, 16138, 16136, 16238, 16236, 16234, 16232, - 16334, 16332, 16330, 16328, 16430, 16428, 16426, 16424, - 16526, 16524, 16522, 16520, 16686, 16684, 16682, 16680, - 16782, 16780, 16778, 16776, 16878, 16876, 16874, 16872, - 16974, 16972, 16970, 16968, 17070, 17068, 17066, 17064, - 17166, 17164, 17162, 17160, 17262, 17260, 17258, 17256, - 17358, 17356, 17354, 17352, 17454, 17452, 17450, 17448, - 17550, 17548, 17546, 17544, 17646, 17644, 17642, 17640, - 17742, 17740, 17738, 17736, 17838, 17836, 17834, 17832, - 17934, 17932, 17930, 17928, 18030, 18028, 18026, 18024, - 18126, 18124, 18122, 18120, 18222, 18220, 18218, 18216, - 18286, 18284, 18282, 18280, 18382, 18380, 18378, 18376, - 18478, 18476, 18474, 18472, 18574, 18572, 18570, 18568, - 18670, 18668, 18666, 18664, 18766, 18764, 18762, 18760, - 18862, 18860, 18858, 18856, 18958, 18956, 18954, 18952, - 19054, 19052, 19050, 19048, 19150, 19148, 19146, 19144, - 19246, 19244, 19242, 19240, 19342, 19340, 19338, 19336, - 19438, 19436, 19434, 19432, 19534, 19532, 19530, 19528, - 19630, 19628, 19626, 19624, 19726, 19724, 19722, 19720, - 19822, 19820, 19818, 19816, }, - /* 2 */ - {22, 20, 18, 16, 118, 116, 114, 112, - 214, 212, 210, 208, 310, 308, 306, 304, - 406, 404, 402, 400, 502, 500, 498, 496, - 598, 596, 594, 592, 694, 692, 690, 688, - 790, 788, 786, 784, 886, 884, 882, 880, - 982, 980, 978, 976, 1078, 1076, 1074, 1072, - 1174, 1172, 1170, 1168, 1270, 1268, 1266, 1264, - 1366, 1364, 1362, 1360, 1462, 1460, 1458, 1456, - 1558, 1556, 1554, 1552, 1654, 1652, 1650, 1648, - 1814, 1812, 1810, 1808, 1910, 1908, 1906, 1904, - 2006, 2004, 2002, 2000, 2102, 2100, 2098, 2096, - 2198, 2196, 2194, 2192, 2294, 2292, 2290, 2288, - 2390, 2388, 2386, 2384, 2486, 2484, 2482, 2480, - 2582, 2580, 2578, 2576, 2678, 2676, 2674, 2672, - 2774, 2772, 2770, 2768, 2870, 2868, 2866, 2864, - 2966, 2964, 2962, 2960, 3062, 3060, 3058, 3056, - 3158, 3156, 3154, 3152, 3254, 3252, 3250, 3248, - 3350, 3348, 3346, 3344, 3414, 3412, 3410, 3408, - 3510, 3508, 3506, 3504, 3606, 3604, 3602, 3600, - 3702, 3700, 3698, 3696, 3798, 3796, 3794, 3792, - 3894, 3892, 3890, 3888, 3990, 3988, 3986, 3984, - 4086, 4084, 4082, 4080, 4182, 4180, 4178, 4176, - 4278, 4276, 4274, 4272, 4374, 4372, 4370, 4368, - 4470, 4468, 4466, 4464, 4566, 4564, 4562, 4560, - 4662, 4660, 4658, 4656, 4758, 4756, 4754, 4752, - 4854, 4852, 4850, 4848, 4950, 4948, 4946, 4944, - 5014, 5012, 5010, 5008, 5110, 5108, 5106, 5104, - 5206, 5204, 5202, 5200, 5302, 5300, 5298, 5296, - 5398, 5396, 5394, 5392, 5494, 5492, 5490, 5488, - 5590, 5588, 5586, 5584, 5686, 5684, 5682, 5680, - 5782, 5780, 5778, 5776, 5878, 5876, 5874, 5872, - 5974, 5972, 5970, 5968, 6070, 6068, 6066, 6064, - 6166, 6164, 6162, 6160, 6262, 6260, 6258, 6256, - 6358, 6356, 6354, 6352, 6454, 6452, 6450, 6448, - 6550, 6548, 6546, 6544, 6710, 6708, 6706, 6704, - 6806, 6804, 6802, 6800, 6902, 6900, 6898, 6896, - 6998, 6996, 6994, 6992, 7094, 7092, 7090, 7088, - 7190, 7188, 7186, 7184, 7286, 7284, 7282, 7280, - 7382, 7380, 7378, 7376, 7478, 7476, 7474, 7472, - 7574, 7572, 7570, 7568, 7670, 7668, 7666, 7664, - 7766, 7764, 7762, 7760, 7862, 7860, 7858, 7856, - 7958, 7956, 7954, 7952, 8054, 8052, 8050, 8048, - 8150, 8148, 8146, 8144, 8246, 8244, 8242, 8240, - 8342, 8340, 8338, 8336, 8406, 8404, 8402, 8400, - 8502, 8500, 8498, 8496, 8598, 8596, 8594, 8592, - 8694, 8692, 8690, 8688, 8790, 8788, 8786, 8784, - 8886, 8884, 8882, 8880, 8982, 8980, 8978, 8976, - 9078, 9076, 9074, 9072, 9174, 9172, 9170, 9168, - 9270, 9268, 9266, 9264, 9366, 9364, 9362, 9360, - 9462, 9460, 9458, 9456, 9558, 9556, 9554, 9552, - 9654, 9652, 9650, 9648, 9750, 9748, 9746, 9744, - 9846, 9844, 9842, 9840, 9942, 9940, 9938, 9936, - 10006, 10004, 10002, 10000, 10102, 10100, 10098, 10096, - 10198, 10196, 10194, 10192, 10294, 10292, 10290, 10288, - 10390, 10388, 10386, 10384, 10486, 10484, 10482, 10480, - 10582, 10580, 10578, 10576, 10678, 10676, 10674, 10672, - 10774, 10772, 10770, 10768, 10870, 10868, 10866, 10864, - 10966, 10964, 10962, 10960, 11062, 11060, 11058, 11056, - 11158, 11156, 11154, 11152, 11254, 11252, 11250, 11248, - 11350, 11348, 11346, 11344, 11446, 11444, 11442, 11440, - 11542, 11540, 11538, 11536, 11702, 11700, 11698, 11696, - 11798, 11796, 11794, 11792, 11894, 11892, 11890, 11888, - 11990, 11988, 11986, 11984, 12086, 12084, 12082, 12080, - 12182, 12180, 12178, 12176, 12278, 12276, 12274, 12272, - 12374, 12372, 12370, 12368, 12470, 12468, 12466, 12464, - 12566, 12564, 12562, 12560, 12662, 12660, 12658, 12656, - 12758, 12756, 12754, 12752, 12854, 12852, 12850, 12848, - 12950, 12948, 12946, 12944, 13046, 13044, 13042, 13040, - 13142, 13140, 13138, 13136, 13238, 13236, 13234, 13232, - 13302, 13300, 13298, 13296, 13398, 13396, 13394, 13392, - 13494, 13492, 13490, 13488, 13590, 13588, 13586, 13584, - 13686, 13684, 13682, 13680, 13782, 13780, 13778, 13776, - 13878, 13876, 13874, 13872, 13974, 13972, 13970, 13968, - 14070, 14068, 14066, 14064, 14166, 14164, 14162, 14160, - 14262, 14260, 14258, 14256, 14358, 14356, 14354, 14352, - 14454, 14452, 14450, 14448, 14550, 14548, 14546, 14544, - 14646, 14644, 14642, 14640, 14742, 14740, 14738, 14736, - 14838, 14836, 14834, 14832, 14934, 14932, 14930, 14928, - 14998, 14996, 14994, 14992, 15094, 15092, 15090, 15088, - 15190, 15188, 15186, 15184, 15286, 15284, 15282, 15280, - 15382, 15380, 15378, 15376, 15478, 15476, 15474, 15472, - 15574, 15572, 15570, 15568, 15670, 15668, 15666, 15664, - 15766, 15764, 15762, 15760, 15862, 15860, 15858, 15856, - 15958, 15956, 15954, 15952, 16054, 16052, 16050, 16048, - 16150, 16148, 16146, 16144, 16246, 16244, 16242, 16240, - 16342, 16340, 16338, 16336, 16438, 16436, 16434, 16432, - 16534, 16532, 16530, 16528, 16694, 16692, 16690, 16688, - 16790, 16788, 16786, 16784, 16886, 16884, 16882, 16880, - 16982, 16980, 16978, 16976, 17078, 17076, 17074, 17072, - 17174, 17172, 17170, 17168, 17270, 17268, 17266, 17264, - 17366, 17364, 17362, 17360, 17462, 17460, 17458, 17456, - 17558, 17556, 17554, 17552, 17654, 17652, 17650, 17648, - 17750, 17748, 17746, 17744, 17846, 17844, 17842, 17840, - 17942, 17940, 17938, 17936, 18038, 18036, 18034, 18032, - 18134, 18132, 18130, 18128, 18230, 18228, 18226, 18224, - 18294, 18292, 18290, 18288, 18390, 18388, 18386, 18384, - 18486, 18484, 18482, 18480, 18582, 18580, 18578, 18576, - 18678, 18676, 18674, 18672, 18774, 18772, 18770, 18768, - 18870, 18868, 18866, 18864, 18966, 18964, 18962, 18960, - 19062, 19060, 19058, 19056, 19158, 19156, 19154, 19152, - 19254, 19252, 19250, 19248, 19350, 19348, 19346, 19344, - 19446, 19444, 19442, 19440, 19542, 19540, 19538, 19536, - 19638, 19636, 19634, 19632, 19734, 19732, 19730, 19728, - 19830, 19828, 19826, 19824, }, - /* 3 */ - {30, 28, 26, 24, 126, 124, 122, 120, - 222, 220, 218, 216, 318, 316, 314, 312, - 414, 412, 410, 408, 510, 508, 506, 504, - 606, 604, 602, 600, 702, 700, 698, 696, - 798, 796, 794, 792, 894, 892, 890, 888, - 990, 988, 986, 984, 1086, 1084, 1082, 1080, - 1182, 1180, 1178, 1176, 1278, 1276, 1274, 1272, - 1374, 1372, 1370, 1368, 1470, 1468, 1466, 1464, - 1566, 1564, 1562, 1560, 1662, 1660, 1658, 1656, - 1822, 1820, 1818, 1816, 1918, 1916, 1914, 1912, - 2014, 2012, 2010, 2008, 2110, 2108, 2106, 2104, - 2206, 2204, 2202, 2200, 2302, 2300, 2298, 2296, - 2398, 2396, 2394, 2392, 2494, 2492, 2490, 2488, - 2590, 2588, 2586, 2584, 2686, 2684, 2682, 2680, - 2782, 2780, 2778, 2776, 2878, 2876, 2874, 2872, - 2974, 2972, 2970, 2968, 3070, 3068, 3066, 3064, - 3166, 3164, 3162, 3160, 3262, 3260, 3258, 3256, - 3358, 3356, 3354, 3352, 3422, 3420, 3418, 3416, - 3518, 3516, 3514, 3512, 3614, 3612, 3610, 3608, - 3710, 3708, 3706, 3704, 3806, 3804, 3802, 3800, - 3902, 3900, 3898, 3896, 3998, 3996, 3994, 3992, - 4094, 4092, 4090, 4088, 4190, 4188, 4186, 4184, - 4286, 4284, 4282, 4280, 4382, 4380, 4378, 4376, - 4478, 4476, 4474, 4472, 4574, 4572, 4570, 4568, - 4670, 4668, 4666, 4664, 4766, 4764, 4762, 4760, - 4862, 4860, 4858, 4856, 4958, 4956, 4954, 4952, - 5022, 5020, 5018, 5016, 5118, 5116, 5114, 5112, - 5214, 5212, 5210, 5208, 5310, 5308, 5306, 5304, - 5406, 5404, 5402, 5400, 5502, 5500, 5498, 5496, - 5598, 5596, 5594, 5592, 5694, 5692, 5690, 5688, - 5790, 5788, 5786, 5784, 5886, 5884, 5882, 5880, - 5982, 5980, 5978, 5976, 6078, 6076, 6074, 6072, - 6174, 6172, 6170, 6168, 6270, 6268, 6266, 6264, - 6366, 6364, 6362, 6360, 6462, 6460, 6458, 6456, - 6558, 6556, 6554, 6552, 6718, 6716, 6714, 6712, - 6814, 6812, 6810, 6808, 6910, 6908, 6906, 6904, - 7006, 7004, 7002, 7000, 7102, 7100, 7098, 7096, - 7198, 7196, 7194, 7192, 7294, 7292, 7290, 7288, - 7390, 7388, 7386, 7384, 7486, 7484, 7482, 7480, - 7582, 7580, 7578, 7576, 7678, 7676, 7674, 7672, - 7774, 7772, 7770, 7768, 7870, 7868, 7866, 7864, - 7966, 7964, 7962, 7960, 8062, 8060, 8058, 8056, - 8158, 8156, 8154, 8152, 8254, 8252, 8250, 8248, - 8350, 8348, 8346, 8344, 8414, 8412, 8410, 8408, - 8510, 8508, 8506, 8504, 8606, 8604, 8602, 8600, - 8702, 8700, 8698, 8696, 8798, 8796, 8794, 8792, - 8894, 8892, 8890, 8888, 8990, 8988, 8986, 8984, - 9086, 9084, 9082, 9080, 9182, 9180, 9178, 9176, - 9278, 9276, 9274, 9272, 9374, 9372, 9370, 9368, - 9470, 9468, 9466, 9464, 9566, 9564, 9562, 9560, - 9662, 9660, 9658, 9656, 9758, 9756, 9754, 9752, - 9854, 9852, 9850, 9848, 9950, 9948, 9946, 9944, - 10014, 10012, 10010, 10008, 10110, 10108, 10106, 10104, - 10206, 10204, 10202, 10200, 10302, 10300, 10298, 10296, - 10398, 10396, 10394, 10392, 10494, 10492, 10490, 10488, - 10590, 10588, 10586, 10584, 10686, 10684, 10682, 10680, - 10782, 10780, 10778, 10776, 10878, 10876, 10874, 10872, - 10974, 10972, 10970, 10968, 11070, 11068, 11066, 11064, - 11166, 11164, 11162, 11160, 11262, 11260, 11258, 11256, - 11358, 11356, 11354, 11352, 11454, 11452, 11450, 11448, - 11550, 11548, 11546, 11544, 11710, 11708, 11706, 11704, - 11806, 11804, 11802, 11800, 11902, 11900, 11898, 11896, - 11998, 11996, 11994, 11992, 12094, 12092, 12090, 12088, - 12190, 12188, 12186, 12184, 12286, 12284, 12282, 12280, - 12382, 12380, 12378, 12376, 12478, 12476, 12474, 12472, - 12574, 12572, 12570, 12568, 12670, 12668, 12666, 12664, - 12766, 12764, 12762, 12760, 12862, 12860, 12858, 12856, - 12958, 12956, 12954, 12952, 13054, 13052, 13050, 13048, - 13150, 13148, 13146, 13144, 13246, 13244, 13242, 13240, - 13310, 13308, 13306, 13304, 13406, 13404, 13402, 13400, - 13502, 13500, 13498, 13496, 13598, 13596, 13594, 13592, - 13694, 13692, 13690, 13688, 13790, 13788, 13786, 13784, - 13886, 13884, 13882, 13880, 13982, 13980, 13978, 13976, - 14078, 14076, 14074, 14072, 14174, 14172, 14170, 14168, - 14270, 14268, 14266, 14264, 14366, 14364, 14362, 14360, - 14462, 14460, 14458, 14456, 14558, 14556, 14554, 14552, - 14654, 14652, 14650, 14648, 14750, 14748, 14746, 14744, - 14846, 14844, 14842, 14840, 14942, 14940, 14938, 14936, - 15006, 15004, 15002, 15000, 15102, 15100, 15098, 15096, - 15198, 15196, 15194, 15192, 15294, 15292, 15290, 15288, - 15390, 15388, 15386, 15384, 15486, 15484, 15482, 15480, - 15582, 15580, 15578, 15576, 15678, 15676, 15674, 15672, - 15774, 15772, 15770, 15768, 15870, 15868, 15866, 15864, - 15966, 15964, 15962, 15960, 16062, 16060, 16058, 16056, - 16158, 16156, 16154, 16152, 16254, 16252, 16250, 16248, - 16350, 16348, 16346, 16344, 16446, 16444, 16442, 16440, - 16542, 16540, 16538, 16536, 16702, 16700, 16698, 16696, - 16798, 16796, 16794, 16792, 16894, 16892, 16890, 16888, - 16990, 16988, 16986, 16984, 17086, 17084, 17082, 17080, - 17182, 17180, 17178, 17176, 17278, 17276, 17274, 17272, - 17374, 17372, 17370, 17368, 17470, 17468, 17466, 17464, - 17566, 17564, 17562, 17560, 17662, 17660, 17658, 17656, - 17758, 17756, 17754, 17752, 17854, 17852, 17850, 17848, - 17950, 17948, 17946, 17944, 18046, 18044, 18042, 18040, - 18142, 18140, 18138, 18136, 18238, 18236, 18234, 18232, - 18302, 18300, 18298, 18296, 18398, 18396, 18394, 18392, - 18494, 18492, 18490, 18488, 18590, 18588, 18586, 18584, - 18686, 18684, 18682, 18680, 18782, 18780, 18778, 18776, - 18878, 18876, 18874, 18872, 18974, 18972, 18970, 18968, - 19070, 19068, 19066, 19064, 19166, 19164, 19162, 19160, - 19262, 19260, 19258, 19256, 19358, 19356, 19354, 19352, - 19454, 19452, 19450, 19448, 19550, 19548, 19546, 19544, - 19646, 19644, 19642, 19640, 19742, 19740, 19738, 19736, - 19838, 19836, 19834, 19832, }, - /* 4 */ - {38, 36, 34, 32, 134, 132, 130, 128, - 230, 228, 226, 224, 326, 324, 322, 320, - 422, 420, 418, 416, 518, 516, 514, 512, - 614, 612, 610, 608, 710, 708, 706, 704, - 806, 804, 802, 800, 902, 900, 898, 896, - 998, 996, 994, 992, 1094, 1092, 1090, 1088, - 1190, 1188, 1186, 1184, 1286, 1284, 1282, 1280, - 1382, 1380, 1378, 1376, 1478, 1476, 1474, 1472, - 1574, 1572, 1570, 1568, 1670, 1668, 1666, 1664, - 1734, 1732, 1730, 1728, 1830, 1828, 1826, 1824, - 1926, 1924, 1922, 1920, 2022, 2020, 2018, 2016, - 2118, 2116, 2114, 2112, 2214, 2212, 2210, 2208, - 2310, 2308, 2306, 2304, 2406, 2404, 2402, 2400, - 2502, 2500, 2498, 2496, 2598, 2596, 2594, 2592, - 2694, 2692, 2690, 2688, 2790, 2788, 2786, 2784, - 2886, 2884, 2882, 2880, 2982, 2980, 2978, 2976, - 3078, 3076, 3074, 3072, 3174, 3172, 3170, 3168, - 3270, 3268, 3266, 3264, 3430, 3428, 3426, 3424, - 3526, 3524, 3522, 3520, 3622, 3620, 3618, 3616, - 3718, 3716, 3714, 3712, 3814, 3812, 3810, 3808, - 3910, 3908, 3906, 3904, 4006, 4004, 4002, 4000, - 4102, 4100, 4098, 4096, 4198, 4196, 4194, 4192, - 4294, 4292, 4290, 4288, 4390, 4388, 4386, 4384, - 4486, 4484, 4482, 4480, 4582, 4580, 4578, 4576, - 4678, 4676, 4674, 4672, 4774, 4772, 4770, 4768, - 4870, 4868, 4866, 4864, 4966, 4964, 4962, 4960, - 5030, 5028, 5026, 5024, 5126, 5124, 5122, 5120, - 5222, 5220, 5218, 5216, 5318, 5316, 5314, 5312, - 5414, 5412, 5410, 5408, 5510, 5508, 5506, 5504, - 5606, 5604, 5602, 5600, 5702, 5700, 5698, 5696, - 5798, 5796, 5794, 5792, 5894, 5892, 5890, 5888, - 5990, 5988, 5986, 5984, 6086, 6084, 6082, 6080, - 6182, 6180, 6178, 6176, 6278, 6276, 6274, 6272, - 6374, 6372, 6370, 6368, 6470, 6468, 6466, 6464, - 6566, 6564, 6562, 6560, 6630, 6628, 6626, 6624, - 6726, 6724, 6722, 6720, 6822, 6820, 6818, 6816, - 6918, 6916, 6914, 6912, 7014, 7012, 7010, 7008, - 7110, 7108, 7106, 7104, 7206, 7204, 7202, 7200, - 7302, 7300, 7298, 7296, 7398, 7396, 7394, 7392, - 7494, 7492, 7490, 7488, 7590, 7588, 7586, 7584, - 7686, 7684, 7682, 7680, 7782, 7780, 7778, 7776, - 7878, 7876, 7874, 7872, 7974, 7972, 7970, 7968, - 8070, 8068, 8066, 8064, 8166, 8164, 8162, 8160, - 8262, 8260, 8258, 8256, 8422, 8420, 8418, 8416, - 8518, 8516, 8514, 8512, 8614, 8612, 8610, 8608, - 8710, 8708, 8706, 8704, 8806, 8804, 8802, 8800, - 8902, 8900, 8898, 8896, 8998, 8996, 8994, 8992, - 9094, 9092, 9090, 9088, 9190, 9188, 9186, 9184, - 9286, 9284, 9282, 9280, 9382, 9380, 9378, 9376, - 9478, 9476, 9474, 9472, 9574, 9572, 9570, 9568, - 9670, 9668, 9666, 9664, 9766, 9764, 9762, 9760, - 9862, 9860, 9858, 9856, 9958, 9956, 9954, 9952, - 10022, 10020, 10018, 10016, 10118, 10116, 10114, 10112, - 10214, 10212, 10210, 10208, 10310, 10308, 10306, 10304, - 10406, 10404, 10402, 10400, 10502, 10500, 10498, 10496, - 10598, 10596, 10594, 10592, 10694, 10692, 10690, 10688, - 10790, 10788, 10786, 10784, 10886, 10884, 10882, 10880, - 10982, 10980, 10978, 10976, 11078, 11076, 11074, 11072, - 11174, 11172, 11170, 11168, 11270, 11268, 11266, 11264, - 11366, 11364, 11362, 11360, 11462, 11460, 11458, 11456, - 11558, 11556, 11554, 11552, 11622, 11620, 11618, 11616, - 11718, 11716, 11714, 11712, 11814, 11812, 11810, 11808, - 11910, 11908, 11906, 11904, 12006, 12004, 12002, 12000, - 12102, 12100, 12098, 12096, 12198, 12196, 12194, 12192, - 12294, 12292, 12290, 12288, 12390, 12388, 12386, 12384, - 12486, 12484, 12482, 12480, 12582, 12580, 12578, 12576, - 12678, 12676, 12674, 12672, 12774, 12772, 12770, 12768, - 12870, 12868, 12866, 12864, 12966, 12964, 12962, 12960, - 13062, 13060, 13058, 13056, 13158, 13156, 13154, 13152, - 13318, 13316, 13314, 13312, 13414, 13412, 13410, 13408, - 13510, 13508, 13506, 13504, 13606, 13604, 13602, 13600, - 13702, 13700, 13698, 13696, 13798, 13796, 13794, 13792, - 13894, 13892, 13890, 13888, 13990, 13988, 13986, 13984, - 14086, 14084, 14082, 14080, 14182, 14180, 14178, 14176, - 14278, 14276, 14274, 14272, 14374, 14372, 14370, 14368, - 14470, 14468, 14466, 14464, 14566, 14564, 14562, 14560, - 14662, 14660, 14658, 14656, 14758, 14756, 14754, 14752, - 14854, 14852, 14850, 14848, 14950, 14948, 14946, 14944, - 15014, 15012, 15010, 15008, 15110, 15108, 15106, 15104, - 15206, 15204, 15202, 15200, 15302, 15300, 15298, 15296, - 15398, 15396, 15394, 15392, 15494, 15492, 15490, 15488, - 15590, 15588, 15586, 15584, 15686, 15684, 15682, 15680, - 15782, 15780, 15778, 15776, 15878, 15876, 15874, 15872, - 15974, 15972, 15970, 15968, 16070, 16068, 16066, 16064, - 16166, 16164, 16162, 16160, 16262, 16260, 16258, 16256, - 16358, 16356, 16354, 16352, 16454, 16452, 16450, 16448, - 16550, 16548, 16546, 16544, 16614, 16612, 16610, 16608, - 16710, 16708, 16706, 16704, 16806, 16804, 16802, 16800, - 16902, 16900, 16898, 16896, 16998, 16996, 16994, 16992, - 17094, 17092, 17090, 17088, 17190, 17188, 17186, 17184, - 17286, 17284, 17282, 17280, 17382, 17380, 17378, 17376, - 17478, 17476, 17474, 17472, 17574, 17572, 17570, 17568, - 17670, 17668, 17666, 17664, 17766, 17764, 17762, 17760, - 17862, 17860, 17858, 17856, 17958, 17956, 17954, 17952, - 18054, 18052, 18050, 18048, 18150, 18148, 18146, 18144, - 18310, 18308, 18306, 18304, 18406, 18404, 18402, 18400, - 18502, 18500, 18498, 18496, 18598, 18596, 18594, 18592, - 18694, 18692, 18690, 18688, 18790, 18788, 18786, 18784, - 18886, 18884, 18882, 18880, 18982, 18980, 18978, 18976, - 19078, 19076, 19074, 19072, 19174, 19172, 19170, 19168, - 19270, 19268, 19266, 19264, 19366, 19364, 19362, 19360, - 19462, 19460, 19458, 19456, 19558, 19556, 19554, 19552, - 19654, 19652, 19650, 19648, 19750, 19748, 19746, 19744, - 19846, 19844, 19842, 19840, }, - /* 5 */ - {46, 44, 42, 40, 142, 140, 138, 136, - 238, 236, 234, 232, 334, 332, 330, 328, - 430, 428, 426, 424, 526, 524, 522, 520, - 622, 620, 618, 616, 718, 716, 714, 712, - 814, 812, 810, 808, 910, 908, 906, 904, - 1006, 1004, 1002, 1000, 1102, 1100, 1098, 1096, - 1198, 1196, 1194, 1192, 1294, 1292, 1290, 1288, - 1390, 1388, 1386, 1384, 1486, 1484, 1482, 1480, - 1582, 1580, 1578, 1576, 1678, 1676, 1674, 1672, - 1742, 1740, 1738, 1736, 1838, 1836, 1834, 1832, - 1934, 1932, 1930, 1928, 2030, 2028, 2026, 2024, - 2126, 2124, 2122, 2120, 2222, 2220, 2218, 2216, - 2318, 2316, 2314, 2312, 2414, 2412, 2410, 2408, - 2510, 2508, 2506, 2504, 2606, 2604, 2602, 2600, - 2702, 2700, 2698, 2696, 2798, 2796, 2794, 2792, - 2894, 2892, 2890, 2888, 2990, 2988, 2986, 2984, - 3086, 3084, 3082, 3080, 3182, 3180, 3178, 3176, - 3278, 3276, 3274, 3272, 3438, 3436, 3434, 3432, - 3534, 3532, 3530, 3528, 3630, 3628, 3626, 3624, - 3726, 3724, 3722, 3720, 3822, 3820, 3818, 3816, - 3918, 3916, 3914, 3912, 4014, 4012, 4010, 4008, - 4110, 4108, 4106, 4104, 4206, 4204, 4202, 4200, - 4302, 4300, 4298, 4296, 4398, 4396, 4394, 4392, - 4494, 4492, 4490, 4488, 4590, 4588, 4586, 4584, - 4686, 4684, 4682, 4680, 4782, 4780, 4778, 4776, - 4878, 4876, 4874, 4872, 4974, 4972, 4970, 4968, - 5038, 5036, 5034, 5032, 5134, 5132, 5130, 5128, - 5230, 5228, 5226, 5224, 5326, 5324, 5322, 5320, - 5422, 5420, 5418, 5416, 5518, 5516, 5514, 5512, - 5614, 5612, 5610, 5608, 5710, 5708, 5706, 5704, - 5806, 5804, 5802, 5800, 5902, 5900, 5898, 5896, - 5998, 5996, 5994, 5992, 6094, 6092, 6090, 6088, - 6190, 6188, 6186, 6184, 6286, 6284, 6282, 6280, - 6382, 6380, 6378, 6376, 6478, 6476, 6474, 6472, - 6574, 6572, 6570, 6568, 6638, 6636, 6634, 6632, - 6734, 6732, 6730, 6728, 6830, 6828, 6826, 6824, - 6926, 6924, 6922, 6920, 7022, 7020, 7018, 7016, - 7118, 7116, 7114, 7112, 7214, 7212, 7210, 7208, - 7310, 7308, 7306, 7304, 7406, 7404, 7402, 7400, - 7502, 7500, 7498, 7496, 7598, 7596, 7594, 7592, - 7694, 7692, 7690, 7688, 7790, 7788, 7786, 7784, - 7886, 7884, 7882, 7880, 7982, 7980, 7978, 7976, - 8078, 8076, 8074, 8072, 8174, 8172, 8170, 8168, - 8270, 8268, 8266, 8264, 8430, 8428, 8426, 8424, - 8526, 8524, 8522, 8520, 8622, 8620, 8618, 8616, - 8718, 8716, 8714, 8712, 8814, 8812, 8810, 8808, - 8910, 8908, 8906, 8904, 9006, 9004, 9002, 9000, - 9102, 9100, 9098, 9096, 9198, 9196, 9194, 9192, - 9294, 9292, 9290, 9288, 9390, 9388, 9386, 9384, - 9486, 9484, 9482, 9480, 9582, 9580, 9578, 9576, - 9678, 9676, 9674, 9672, 9774, 9772, 9770, 9768, - 9870, 9868, 9866, 9864, 9966, 9964, 9962, 9960, - 10030, 10028, 10026, 10024, 10126, 10124, 10122, 10120, - 10222, 10220, 10218, 10216, 10318, 10316, 10314, 10312, - 10414, 10412, 10410, 10408, 10510, 10508, 10506, 10504, - 10606, 10604, 10602, 10600, 10702, 10700, 10698, 10696, - 10798, 10796, 10794, 10792, 10894, 10892, 10890, 10888, - 10990, 10988, 10986, 10984, 11086, 11084, 11082, 11080, - 11182, 11180, 11178, 11176, 11278, 11276, 11274, 11272, - 11374, 11372, 11370, 11368, 11470, 11468, 11466, 11464, - 11566, 11564, 11562, 11560, 11630, 11628, 11626, 11624, - 11726, 11724, 11722, 11720, 11822, 11820, 11818, 11816, - 11918, 11916, 11914, 11912, 12014, 12012, 12010, 12008, - 12110, 12108, 12106, 12104, 12206, 12204, 12202, 12200, - 12302, 12300, 12298, 12296, 12398, 12396, 12394, 12392, - 12494, 12492, 12490, 12488, 12590, 12588, 12586, 12584, - 12686, 12684, 12682, 12680, 12782, 12780, 12778, 12776, - 12878, 12876, 12874, 12872, 12974, 12972, 12970, 12968, - 13070, 13068, 13066, 13064, 13166, 13164, 13162, 13160, - 13326, 13324, 13322, 13320, 13422, 13420, 13418, 13416, - 13518, 13516, 13514, 13512, 13614, 13612, 13610, 13608, - 13710, 13708, 13706, 13704, 13806, 13804, 13802, 13800, - 13902, 13900, 13898, 13896, 13998, 13996, 13994, 13992, - 14094, 14092, 14090, 14088, 14190, 14188, 14186, 14184, - 14286, 14284, 14282, 14280, 14382, 14380, 14378, 14376, - 14478, 14476, 14474, 14472, 14574, 14572, 14570, 14568, - 14670, 14668, 14666, 14664, 14766, 14764, 14762, 14760, - 14862, 14860, 14858, 14856, 14958, 14956, 14954, 14952, - 15022, 15020, 15018, 15016, 15118, 15116, 15114, 15112, - 15214, 15212, 15210, 15208, 15310, 15308, 15306, 15304, - 15406, 15404, 15402, 15400, 15502, 15500, 15498, 15496, - 15598, 15596, 15594, 15592, 15694, 15692, 15690, 15688, - 15790, 15788, 15786, 15784, 15886, 15884, 15882, 15880, - 15982, 15980, 15978, 15976, 16078, 16076, 16074, 16072, - 16174, 16172, 16170, 16168, 16270, 16268, 16266, 16264, - 16366, 16364, 16362, 16360, 16462, 16460, 16458, 16456, - 16558, 16556, 16554, 16552, 16622, 16620, 16618, 16616, - 16718, 16716, 16714, 16712, 16814, 16812, 16810, 16808, - 16910, 16908, 16906, 16904, 17006, 17004, 17002, 17000, - 17102, 17100, 17098, 17096, 17198, 17196, 17194, 17192, - 17294, 17292, 17290, 17288, 17390, 17388, 17386, 17384, - 17486, 17484, 17482, 17480, 17582, 17580, 17578, 17576, - 17678, 17676, 17674, 17672, 17774, 17772, 17770, 17768, - 17870, 17868, 17866, 17864, 17966, 17964, 17962, 17960, - 18062, 18060, 18058, 18056, 18158, 18156, 18154, 18152, - 18318, 18316, 18314, 18312, 18414, 18412, 18410, 18408, - 18510, 18508, 18506, 18504, 18606, 18604, 18602, 18600, - 18702, 18700, 18698, 18696, 18798, 18796, 18794, 18792, - 18894, 18892, 18890, 18888, 18990, 18988, 18986, 18984, - 19086, 19084, 19082, 19080, 19182, 19180, 19178, 19176, - 19278, 19276, 19274, 19272, 19374, 19372, 19370, 19368, - 19470, 19468, 19466, 19464, 19566, 19564, 19562, 19560, - 19662, 19660, 19658, 19656, 19758, 19756, 19754, 19752, - 19854, 19852, 19850, 19848, }, - /* 6 */ - {54, 52, 50, 48, 150, 148, 146, 144, - 246, 244, 242, 240, 342, 340, 338, 336, - 438, 436, 434, 432, 534, 532, 530, 528, - 630, 628, 626, 624, 726, 724, 722, 720, - 822, 820, 818, 816, 918, 916, 914, 912, - 1014, 1012, 1010, 1008, 1110, 1108, 1106, 1104, - 1206, 1204, 1202, 1200, 1302, 1300, 1298, 1296, - 1398, 1396, 1394, 1392, 1494, 1492, 1490, 1488, - 1590, 1588, 1586, 1584, 1686, 1684, 1682, 1680, - 1750, 1748, 1746, 1744, 1846, 1844, 1842, 1840, - 1942, 1940, 1938, 1936, 2038, 2036, 2034, 2032, - 2134, 2132, 2130, 2128, 2230, 2228, 2226, 2224, - 2326, 2324, 2322, 2320, 2422, 2420, 2418, 2416, - 2518, 2516, 2514, 2512, 2614, 2612, 2610, 2608, - 2710, 2708, 2706, 2704, 2806, 2804, 2802, 2800, - 2902, 2900, 2898, 2896, 2998, 2996, 2994, 2992, - 3094, 3092, 3090, 3088, 3190, 3188, 3186, 3184, - 3286, 3284, 3282, 3280, 3446, 3444, 3442, 3440, - 3542, 3540, 3538, 3536, 3638, 3636, 3634, 3632, - 3734, 3732, 3730, 3728, 3830, 3828, 3826, 3824, - 3926, 3924, 3922, 3920, 4022, 4020, 4018, 4016, - 4118, 4116, 4114, 4112, 4214, 4212, 4210, 4208, - 4310, 4308, 4306, 4304, 4406, 4404, 4402, 4400, - 4502, 4500, 4498, 4496, 4598, 4596, 4594, 4592, - 4694, 4692, 4690, 4688, 4790, 4788, 4786, 4784, - 4886, 4884, 4882, 4880, 4982, 4980, 4978, 4976, - 5046, 5044, 5042, 5040, 5142, 5140, 5138, 5136, - 5238, 5236, 5234, 5232, 5334, 5332, 5330, 5328, - 5430, 5428, 5426, 5424, 5526, 5524, 5522, 5520, - 5622, 5620, 5618, 5616, 5718, 5716, 5714, 5712, - 5814, 5812, 5810, 5808, 5910, 5908, 5906, 5904, - 6006, 6004, 6002, 6000, 6102, 6100, 6098, 6096, - 6198, 6196, 6194, 6192, 6294, 6292, 6290, 6288, - 6390, 6388, 6386, 6384, 6486, 6484, 6482, 6480, - 6582, 6580, 6578, 6576, 6646, 6644, 6642, 6640, - 6742, 6740, 6738, 6736, 6838, 6836, 6834, 6832, - 6934, 6932, 6930, 6928, 7030, 7028, 7026, 7024, - 7126, 7124, 7122, 7120, 7222, 7220, 7218, 7216, - 7318, 7316, 7314, 7312, 7414, 7412, 7410, 7408, - 7510, 7508, 7506, 7504, 7606, 7604, 7602, 7600, - 7702, 7700, 7698, 7696, 7798, 7796, 7794, 7792, - 7894, 7892, 7890, 7888, 7990, 7988, 7986, 7984, - 8086, 8084, 8082, 8080, 8182, 8180, 8178, 8176, - 8278, 8276, 8274, 8272, 8438, 8436, 8434, 8432, - 8534, 8532, 8530, 8528, 8630, 8628, 8626, 8624, - 8726, 8724, 8722, 8720, 8822, 8820, 8818, 8816, - 8918, 8916, 8914, 8912, 9014, 9012, 9010, 9008, - 9110, 9108, 9106, 9104, 9206, 9204, 9202, 9200, - 9302, 9300, 9298, 9296, 9398, 9396, 9394, 9392, - 9494, 9492, 9490, 9488, 9590, 9588, 9586, 9584, - 9686, 9684, 9682, 9680, 9782, 9780, 9778, 9776, - 9878, 9876, 9874, 9872, 9974, 9972, 9970, 9968, - 10038, 10036, 10034, 10032, 10134, 10132, 10130, 10128, - 10230, 10228, 10226, 10224, 10326, 10324, 10322, 10320, - 10422, 10420, 10418, 10416, 10518, 10516, 10514, 10512, - 10614, 10612, 10610, 10608, 10710, 10708, 10706, 10704, - 10806, 10804, 10802, 10800, 10902, 10900, 10898, 10896, - 10998, 10996, 10994, 10992, 11094, 11092, 11090, 11088, - 11190, 11188, 11186, 11184, 11286, 11284, 11282, 11280, - 11382, 11380, 11378, 11376, 11478, 11476, 11474, 11472, - 11574, 11572, 11570, 11568, 11638, 11636, 11634, 11632, - 11734, 11732, 11730, 11728, 11830, 11828, 11826, 11824, - 11926, 11924, 11922, 11920, 12022, 12020, 12018, 12016, - 12118, 12116, 12114, 12112, 12214, 12212, 12210, 12208, - 12310, 12308, 12306, 12304, 12406, 12404, 12402, 12400, - 12502, 12500, 12498, 12496, 12598, 12596, 12594, 12592, - 12694, 12692, 12690, 12688, 12790, 12788, 12786, 12784, - 12886, 12884, 12882, 12880, 12982, 12980, 12978, 12976, - 13078, 13076, 13074, 13072, 13174, 13172, 13170, 13168, - 13334, 13332, 13330, 13328, 13430, 13428, 13426, 13424, - 13526, 13524, 13522, 13520, 13622, 13620, 13618, 13616, - 13718, 13716, 13714, 13712, 13814, 13812, 13810, 13808, - 13910, 13908, 13906, 13904, 14006, 14004, 14002, 14000, - 14102, 14100, 14098, 14096, 14198, 14196, 14194, 14192, - 14294, 14292, 14290, 14288, 14390, 14388, 14386, 14384, - 14486, 14484, 14482, 14480, 14582, 14580, 14578, 14576, - 14678, 14676, 14674, 14672, 14774, 14772, 14770, 14768, - 14870, 14868, 14866, 14864, 14966, 14964, 14962, 14960, - 15030, 15028, 15026, 15024, 15126, 15124, 15122, 15120, - 15222, 15220, 15218, 15216, 15318, 15316, 15314, 15312, - 15414, 15412, 15410, 15408, 15510, 15508, 15506, 15504, - 15606, 15604, 15602, 15600, 15702, 15700, 15698, 15696, - 15798, 15796, 15794, 15792, 15894, 15892, 15890, 15888, - 15990, 15988, 15986, 15984, 16086, 16084, 16082, 16080, - 16182, 16180, 16178, 16176, 16278, 16276, 16274, 16272, - 16374, 16372, 16370, 16368, 16470, 16468, 16466, 16464, - 16566, 16564, 16562, 16560, 16630, 16628, 16626, 16624, - 16726, 16724, 16722, 16720, 16822, 16820, 16818, 16816, - 16918, 16916, 16914, 16912, 17014, 17012, 17010, 17008, - 17110, 17108, 17106, 17104, 17206, 17204, 17202, 17200, - 17302, 17300, 17298, 17296, 17398, 17396, 17394, 17392, - 17494, 17492, 17490, 17488, 17590, 17588, 17586, 17584, - 17686, 17684, 17682, 17680, 17782, 17780, 17778, 17776, - 17878, 17876, 17874, 17872, 17974, 17972, 17970, 17968, - 18070, 18068, 18066, 18064, 18166, 18164, 18162, 18160, - 18326, 18324, 18322, 18320, 18422, 18420, 18418, 18416, - 18518, 18516, 18514, 18512, 18614, 18612, 18610, 18608, - 18710, 18708, 18706, 18704, 18806, 18804, 18802, 18800, - 18902, 18900, 18898, 18896, 18998, 18996, 18994, 18992, - 19094, 19092, 19090, 19088, 19190, 19188, 19186, 19184, - 19286, 19284, 19282, 19280, 19382, 19380, 19378, 19376, - 19478, 19476, 19474, 19472, 19574, 19572, 19570, 19568, - 19670, 19668, 19666, 19664, 19766, 19764, 19762, 19760, - 19862, 19860, 19858, 19856, }, - /* 7 */ - {62, 60, 58, 56, 158, 156, 154, 152, - 254, 252, 250, 248, 350, 348, 346, 344, - 446, 444, 442, 440, 542, 540, 538, 536, - 638, 636, 634, 632, 734, 732, 730, 728, - 830, 828, 826, 824, 926, 924, 922, 920, - 1022, 1020, 1018, 1016, 1118, 1116, 1114, 1112, - 1214, 1212, 1210, 1208, 1310, 1308, 1306, 1304, - 1406, 1404, 1402, 1400, 1502, 1500, 1498, 1496, - 1598, 1596, 1594, 1592, 1694, 1692, 1690, 1688, - 1758, 1756, 1754, 1752, 1854, 1852, 1850, 1848, - 1950, 1948, 1946, 1944, 2046, 2044, 2042, 2040, - 2142, 2140, 2138, 2136, 2238, 2236, 2234, 2232, - 2334, 2332, 2330, 2328, 2430, 2428, 2426, 2424, - 2526, 2524, 2522, 2520, 2622, 2620, 2618, 2616, - 2718, 2716, 2714, 2712, 2814, 2812, 2810, 2808, - 2910, 2908, 2906, 2904, 3006, 3004, 3002, 3000, - 3102, 3100, 3098, 3096, 3198, 3196, 3194, 3192, - 3294, 3292, 3290, 3288, 3454, 3452, 3450, 3448, - 3550, 3548, 3546, 3544, 3646, 3644, 3642, 3640, - 3742, 3740, 3738, 3736, 3838, 3836, 3834, 3832, - 3934, 3932, 3930, 3928, 4030, 4028, 4026, 4024, - 4126, 4124, 4122, 4120, 4222, 4220, 4218, 4216, - 4318, 4316, 4314, 4312, 4414, 4412, 4410, 4408, - 4510, 4508, 4506, 4504, 4606, 4604, 4602, 4600, - 4702, 4700, 4698, 4696, 4798, 4796, 4794, 4792, - 4894, 4892, 4890, 4888, 4990, 4988, 4986, 4984, - 5054, 5052, 5050, 5048, 5150, 5148, 5146, 5144, - 5246, 5244, 5242, 5240, 5342, 5340, 5338, 5336, - 5438, 5436, 5434, 5432, 5534, 5532, 5530, 5528, - 5630, 5628, 5626, 5624, 5726, 5724, 5722, 5720, - 5822, 5820, 5818, 5816, 5918, 5916, 5914, 5912, - 6014, 6012, 6010, 6008, 6110, 6108, 6106, 6104, - 6206, 6204, 6202, 6200, 6302, 6300, 6298, 6296, - 6398, 6396, 6394, 6392, 6494, 6492, 6490, 6488, - 6590, 6588, 6586, 6584, 6654, 6652, 6650, 6648, - 6750, 6748, 6746, 6744, 6846, 6844, 6842, 6840, - 6942, 6940, 6938, 6936, 7038, 7036, 7034, 7032, - 7134, 7132, 7130, 7128, 7230, 7228, 7226, 7224, - 7326, 7324, 7322, 7320, 7422, 7420, 7418, 7416, - 7518, 7516, 7514, 7512, 7614, 7612, 7610, 7608, - 7710, 7708, 7706, 7704, 7806, 7804, 7802, 7800, - 7902, 7900, 7898, 7896, 7998, 7996, 7994, 7992, - 8094, 8092, 8090, 8088, 8190, 8188, 8186, 8184, - 8286, 8284, 8282, 8280, 8446, 8444, 8442, 8440, - 8542, 8540, 8538, 8536, 8638, 8636, 8634, 8632, - 8734, 8732, 8730, 8728, 8830, 8828, 8826, 8824, - 8926, 8924, 8922, 8920, 9022, 9020, 9018, 9016, - 9118, 9116, 9114, 9112, 9214, 9212, 9210, 9208, - 9310, 9308, 9306, 9304, 9406, 9404, 9402, 9400, - 9502, 9500, 9498, 9496, 9598, 9596, 9594, 9592, - 9694, 9692, 9690, 9688, 9790, 9788, 9786, 9784, - 9886, 9884, 9882, 9880, 9982, 9980, 9978, 9976, - 10046, 10044, 10042, 10040, 10142, 10140, 10138, 10136, - 10238, 10236, 10234, 10232, 10334, 10332, 10330, 10328, - 10430, 10428, 10426, 10424, 10526, 10524, 10522, 10520, - 10622, 10620, 10618, 10616, 10718, 10716, 10714, 10712, - 10814, 10812, 10810, 10808, 10910, 10908, 10906, 10904, - 11006, 11004, 11002, 11000, 11102, 11100, 11098, 11096, - 11198, 11196, 11194, 11192, 11294, 11292, 11290, 11288, - 11390, 11388, 11386, 11384, 11486, 11484, 11482, 11480, - 11582, 11580, 11578, 11576, 11646, 11644, 11642, 11640, - 11742, 11740, 11738, 11736, 11838, 11836, 11834, 11832, - 11934, 11932, 11930, 11928, 12030, 12028, 12026, 12024, - 12126, 12124, 12122, 12120, 12222, 12220, 12218, 12216, - 12318, 12316, 12314, 12312, 12414, 12412, 12410, 12408, - 12510, 12508, 12506, 12504, 12606, 12604, 12602, 12600, - 12702, 12700, 12698, 12696, 12798, 12796, 12794, 12792, - 12894, 12892, 12890, 12888, 12990, 12988, 12986, 12984, - 13086, 13084, 13082, 13080, 13182, 13180, 13178, 13176, - 13342, 13340, 13338, 13336, 13438, 13436, 13434, 13432, - 13534, 13532, 13530, 13528, 13630, 13628, 13626, 13624, - 13726, 13724, 13722, 13720, 13822, 13820, 13818, 13816, - 13918, 13916, 13914, 13912, 14014, 14012, 14010, 14008, - 14110, 14108, 14106, 14104, 14206, 14204, 14202, 14200, - 14302, 14300, 14298, 14296, 14398, 14396, 14394, 14392, - 14494, 14492, 14490, 14488, 14590, 14588, 14586, 14584, - 14686, 14684, 14682, 14680, 14782, 14780, 14778, 14776, - 14878, 14876, 14874, 14872, 14974, 14972, 14970, 14968, - 15038, 15036, 15034, 15032, 15134, 15132, 15130, 15128, - 15230, 15228, 15226, 15224, 15326, 15324, 15322, 15320, - 15422, 15420, 15418, 15416, 15518, 15516, 15514, 15512, - 15614, 15612, 15610, 15608, 15710, 15708, 15706, 15704, - 15806, 15804, 15802, 15800, 15902, 15900, 15898, 15896, - 15998, 15996, 15994, 15992, 16094, 16092, 16090, 16088, - 16190, 16188, 16186, 16184, 16286, 16284, 16282, 16280, - 16382, 16380, 16378, 16376, 16478, 16476, 16474, 16472, - 16574, 16572, 16570, 16568, 16638, 16636, 16634, 16632, - 16734, 16732, 16730, 16728, 16830, 16828, 16826, 16824, - 16926, 16924, 16922, 16920, 17022, 17020, 17018, 17016, - 17118, 17116, 17114, 17112, 17214, 17212, 17210, 17208, - 17310, 17308, 17306, 17304, 17406, 17404, 17402, 17400, - 17502, 17500, 17498, 17496, 17598, 17596, 17594, 17592, - 17694, 17692, 17690, 17688, 17790, 17788, 17786, 17784, - 17886, 17884, 17882, 17880, 17982, 17980, 17978, 17976, - 18078, 18076, 18074, 18072, 18174, 18172, 18170, 18168, - 18334, 18332, 18330, 18328, 18430, 18428, 18426, 18424, - 18526, 18524, 18522, 18520, 18622, 18620, 18618, 18616, - 18718, 18716, 18714, 18712, 18814, 18812, 18810, 18808, - 18910, 18908, 18906, 18904, 19006, 19004, 19002, 19000, - 19102, 19100, 19098, 19096, 19198, 19196, 19194, 19192, - 19294, 19292, 19290, 19288, 19390, 19388, 19386, 19384, - 19486, 19484, 19482, 19480, 19582, 19580, 19578, 19576, - 19678, 19676, 19674, 19672, 19774, 19772, 19770, 19768, - 19870, 19868, 19866, 19864, }, - /* 8 */ - {70, 68, 66, 64, 166, 164, 162, 160, - 262, 260, 258, 256, 358, 356, 354, 352, - 454, 452, 450, 448, 550, 548, 546, 544, - 646, 644, 642, 640, 742, 740, 738, 736, - 838, 836, 834, 832, 934, 932, 930, 928, - 1030, 1028, 1026, 1024, 1126, 1124, 1122, 1120, - 1222, 1220, 1218, 1216, 1318, 1316, 1314, 1312, - 1414, 1412, 1410, 1408, 1510, 1508, 1506, 1504, - 1606, 1604, 1602, 1600, 1702, 1700, 1698, 1696, - 1766, 1764, 1762, 1760, 1862, 1860, 1858, 1856, - 1958, 1956, 1954, 1952, 2054, 2052, 2050, 2048, - 2150, 2148, 2146, 2144, 2246, 2244, 2242, 2240, - 2342, 2340, 2338, 2336, 2438, 2436, 2434, 2432, - 2534, 2532, 2530, 2528, 2630, 2628, 2626, 2624, - 2726, 2724, 2722, 2720, 2822, 2820, 2818, 2816, - 2918, 2916, 2914, 2912, 3014, 3012, 3010, 3008, - 3110, 3108, 3106, 3104, 3206, 3204, 3202, 3200, - 3302, 3300, 3298, 3296, 3366, 3364, 3362, 3360, - 3462, 3460, 3458, 3456, 3558, 3556, 3554, 3552, - 3654, 3652, 3650, 3648, 3750, 3748, 3746, 3744, - 3846, 3844, 3842, 3840, 3942, 3940, 3938, 3936, - 4038, 4036, 4034, 4032, 4134, 4132, 4130, 4128, - 4230, 4228, 4226, 4224, 4326, 4324, 4322, 4320, - 4422, 4420, 4418, 4416, 4518, 4516, 4514, 4512, - 4614, 4612, 4610, 4608, 4710, 4708, 4706, 4704, - 4806, 4804, 4802, 4800, 4902, 4900, 4898, 4896, - 5062, 5060, 5058, 5056, 5158, 5156, 5154, 5152, - 5254, 5252, 5250, 5248, 5350, 5348, 5346, 5344, - 5446, 5444, 5442, 5440, 5542, 5540, 5538, 5536, - 5638, 5636, 5634, 5632, 5734, 5732, 5730, 5728, - 5830, 5828, 5826, 5824, 5926, 5924, 5922, 5920, - 6022, 6020, 6018, 6016, 6118, 6116, 6114, 6112, - 6214, 6212, 6210, 6208, 6310, 6308, 6306, 6304, - 6406, 6404, 6402, 6400, 6502, 6500, 6498, 6496, - 6598, 6596, 6594, 6592, 6662, 6660, 6658, 6656, - 6758, 6756, 6754, 6752, 6854, 6852, 6850, 6848, - 6950, 6948, 6946, 6944, 7046, 7044, 7042, 7040, - 7142, 7140, 7138, 7136, 7238, 7236, 7234, 7232, - 7334, 7332, 7330, 7328, 7430, 7428, 7426, 7424, - 7526, 7524, 7522, 7520, 7622, 7620, 7618, 7616, - 7718, 7716, 7714, 7712, 7814, 7812, 7810, 7808, - 7910, 7908, 7906, 7904, 8006, 8004, 8002, 8000, - 8102, 8100, 8098, 8096, 8198, 8196, 8194, 8192, - 8294, 8292, 8290, 8288, 8358, 8356, 8354, 8352, - 8454, 8452, 8450, 8448, 8550, 8548, 8546, 8544, - 8646, 8644, 8642, 8640, 8742, 8740, 8738, 8736, - 8838, 8836, 8834, 8832, 8934, 8932, 8930, 8928, - 9030, 9028, 9026, 9024, 9126, 9124, 9122, 9120, - 9222, 9220, 9218, 9216, 9318, 9316, 9314, 9312, - 9414, 9412, 9410, 9408, 9510, 9508, 9506, 9504, - 9606, 9604, 9602, 9600, 9702, 9700, 9698, 9696, - 9798, 9796, 9794, 9792, 9894, 9892, 9890, 9888, - 10054, 10052, 10050, 10048, 10150, 10148, 10146, 10144, - 10246, 10244, 10242, 10240, 10342, 10340, 10338, 10336, - 10438, 10436, 10434, 10432, 10534, 10532, 10530, 10528, - 10630, 10628, 10626, 10624, 10726, 10724, 10722, 10720, - 10822, 10820, 10818, 10816, 10918, 10916, 10914, 10912, - 11014, 11012, 11010, 11008, 11110, 11108, 11106, 11104, - 11206, 11204, 11202, 11200, 11302, 11300, 11298, 11296, - 11398, 11396, 11394, 11392, 11494, 11492, 11490, 11488, - 11590, 11588, 11586, 11584, 11654, 11652, 11650, 11648, - 11750, 11748, 11746, 11744, 11846, 11844, 11842, 11840, - 11942, 11940, 11938, 11936, 12038, 12036, 12034, 12032, - 12134, 12132, 12130, 12128, 12230, 12228, 12226, 12224, - 12326, 12324, 12322, 12320, 12422, 12420, 12418, 12416, - 12518, 12516, 12514, 12512, 12614, 12612, 12610, 12608, - 12710, 12708, 12706, 12704, 12806, 12804, 12802, 12800, - 12902, 12900, 12898, 12896, 12998, 12996, 12994, 12992, - 13094, 13092, 13090, 13088, 13190, 13188, 13186, 13184, - 13254, 13252, 13250, 13248, 13350, 13348, 13346, 13344, - 13446, 13444, 13442, 13440, 13542, 13540, 13538, 13536, - 13638, 13636, 13634, 13632, 13734, 13732, 13730, 13728, - 13830, 13828, 13826, 13824, 13926, 13924, 13922, 13920, - 14022, 14020, 14018, 14016, 14118, 14116, 14114, 14112, - 14214, 14212, 14210, 14208, 14310, 14308, 14306, 14304, - 14406, 14404, 14402, 14400, 14502, 14500, 14498, 14496, - 14598, 14596, 14594, 14592, 14694, 14692, 14690, 14688, - 14790, 14788, 14786, 14784, 14886, 14884, 14882, 14880, - 15046, 15044, 15042, 15040, 15142, 15140, 15138, 15136, - 15238, 15236, 15234, 15232, 15334, 15332, 15330, 15328, - 15430, 15428, 15426, 15424, 15526, 15524, 15522, 15520, - 15622, 15620, 15618, 15616, 15718, 15716, 15714, 15712, - 15814, 15812, 15810, 15808, 15910, 15908, 15906, 15904, - 16006, 16004, 16002, 16000, 16102, 16100, 16098, 16096, - 16198, 16196, 16194, 16192, 16294, 16292, 16290, 16288, - 16390, 16388, 16386, 16384, 16486, 16484, 16482, 16480, - 16582, 16580, 16578, 16576, 16646, 16644, 16642, 16640, - 16742, 16740, 16738, 16736, 16838, 16836, 16834, 16832, - 16934, 16932, 16930, 16928, 17030, 17028, 17026, 17024, - 17126, 17124, 17122, 17120, 17222, 17220, 17218, 17216, - 17318, 17316, 17314, 17312, 17414, 17412, 17410, 17408, - 17510, 17508, 17506, 17504, 17606, 17604, 17602, 17600, - 17702, 17700, 17698, 17696, 17798, 17796, 17794, 17792, - 17894, 17892, 17890, 17888, 17990, 17988, 17986, 17984, - 18086, 18084, 18082, 18080, 18182, 18180, 18178, 18176, - 18246, 18244, 18242, 18240, 18342, 18340, 18338, 18336, - 18438, 18436, 18434, 18432, 18534, 18532, 18530, 18528, - 18630, 18628, 18626, 18624, 18726, 18724, 18722, 18720, - 18822, 18820, 18818, 18816, 18918, 18916, 18914, 18912, - 19014, 19012, 19010, 19008, 19110, 19108, 19106, 19104, - 19206, 19204, 19202, 19200, 19302, 19300, 19298, 19296, - 19398, 19396, 19394, 19392, 19494, 19492, 19490, 19488, - 19590, 19588, 19586, 19584, 19686, 19684, 19682, 19680, - 19782, 19780, 19778, 19776, }, - /* 9 */ - {78, 76, 74, 72, 174, 172, 170, 168, - 270, 268, 266, 264, 366, 364, 362, 360, - 462, 460, 458, 456, 558, 556, 554, 552, - 654, 652, 650, 648, 750, 748, 746, 744, - 846, 844, 842, 840, 942, 940, 938, 936, - 1038, 1036, 1034, 1032, 1134, 1132, 1130, 1128, - 1230, 1228, 1226, 1224, 1326, 1324, 1322, 1320, - 1422, 1420, 1418, 1416, 1518, 1516, 1514, 1512, - 1614, 1612, 1610, 1608, 1710, 1708, 1706, 1704, - 1774, 1772, 1770, 1768, 1870, 1868, 1866, 1864, - 1966, 1964, 1962, 1960, 2062, 2060, 2058, 2056, - 2158, 2156, 2154, 2152, 2254, 2252, 2250, 2248, - 2350, 2348, 2346, 2344, 2446, 2444, 2442, 2440, - 2542, 2540, 2538, 2536, 2638, 2636, 2634, 2632, - 2734, 2732, 2730, 2728, 2830, 2828, 2826, 2824, - 2926, 2924, 2922, 2920, 3022, 3020, 3018, 3016, - 3118, 3116, 3114, 3112, 3214, 3212, 3210, 3208, - 3310, 3308, 3306, 3304, 3374, 3372, 3370, 3368, - 3470, 3468, 3466, 3464, 3566, 3564, 3562, 3560, - 3662, 3660, 3658, 3656, 3758, 3756, 3754, 3752, - 3854, 3852, 3850, 3848, 3950, 3948, 3946, 3944, - 4046, 4044, 4042, 4040, 4142, 4140, 4138, 4136, - 4238, 4236, 4234, 4232, 4334, 4332, 4330, 4328, - 4430, 4428, 4426, 4424, 4526, 4524, 4522, 4520, - 4622, 4620, 4618, 4616, 4718, 4716, 4714, 4712, - 4814, 4812, 4810, 4808, 4910, 4908, 4906, 4904, - 5070, 5068, 5066, 5064, 5166, 5164, 5162, 5160, - 5262, 5260, 5258, 5256, 5358, 5356, 5354, 5352, - 5454, 5452, 5450, 5448, 5550, 5548, 5546, 5544, - 5646, 5644, 5642, 5640, 5742, 5740, 5738, 5736, - 5838, 5836, 5834, 5832, 5934, 5932, 5930, 5928, - 6030, 6028, 6026, 6024, 6126, 6124, 6122, 6120, - 6222, 6220, 6218, 6216, 6318, 6316, 6314, 6312, - 6414, 6412, 6410, 6408, 6510, 6508, 6506, 6504, - 6606, 6604, 6602, 6600, 6670, 6668, 6666, 6664, - 6766, 6764, 6762, 6760, 6862, 6860, 6858, 6856, - 6958, 6956, 6954, 6952, 7054, 7052, 7050, 7048, - 7150, 7148, 7146, 7144, 7246, 7244, 7242, 7240, - 7342, 7340, 7338, 7336, 7438, 7436, 7434, 7432, - 7534, 7532, 7530, 7528, 7630, 7628, 7626, 7624, - 7726, 7724, 7722, 7720, 7822, 7820, 7818, 7816, - 7918, 7916, 7914, 7912, 8014, 8012, 8010, 8008, - 8110, 8108, 8106, 8104, 8206, 8204, 8202, 8200, - 8302, 8300, 8298, 8296, 8366, 8364, 8362, 8360, - 8462, 8460, 8458, 8456, 8558, 8556, 8554, 8552, - 8654, 8652, 8650, 8648, 8750, 8748, 8746, 8744, - 8846, 8844, 8842, 8840, 8942, 8940, 8938, 8936, - 9038, 9036, 9034, 9032, 9134, 9132, 9130, 9128, - 9230, 9228, 9226, 9224, 9326, 9324, 9322, 9320, - 9422, 9420, 9418, 9416, 9518, 9516, 9514, 9512, - 9614, 9612, 9610, 9608, 9710, 9708, 9706, 9704, - 9806, 9804, 9802, 9800, 9902, 9900, 9898, 9896, - 10062, 10060, 10058, 10056, 10158, 10156, 10154, 10152, - 10254, 10252, 10250, 10248, 10350, 10348, 10346, 10344, - 10446, 10444, 10442, 10440, 10542, 10540, 10538, 10536, - 10638, 10636, 10634, 10632, 10734, 10732, 10730, 10728, - 10830, 10828, 10826, 10824, 10926, 10924, 10922, 10920, - 11022, 11020, 11018, 11016, 11118, 11116, 11114, 11112, - 11214, 11212, 11210, 11208, 11310, 11308, 11306, 11304, - 11406, 11404, 11402, 11400, 11502, 11500, 11498, 11496, - 11598, 11596, 11594, 11592, 11662, 11660, 11658, 11656, - 11758, 11756, 11754, 11752, 11854, 11852, 11850, 11848, - 11950, 11948, 11946, 11944, 12046, 12044, 12042, 12040, - 12142, 12140, 12138, 12136, 12238, 12236, 12234, 12232, - 12334, 12332, 12330, 12328, 12430, 12428, 12426, 12424, - 12526, 12524, 12522, 12520, 12622, 12620, 12618, 12616, - 12718, 12716, 12714, 12712, 12814, 12812, 12810, 12808, - 12910, 12908, 12906, 12904, 13006, 13004, 13002, 13000, - 13102, 13100, 13098, 13096, 13198, 13196, 13194, 13192, - 13262, 13260, 13258, 13256, 13358, 13356, 13354, 13352, - 13454, 13452, 13450, 13448, 13550, 13548, 13546, 13544, - 13646, 13644, 13642, 13640, 13742, 13740, 13738, 13736, - 13838, 13836, 13834, 13832, 13934, 13932, 13930, 13928, - 14030, 14028, 14026, 14024, 14126, 14124, 14122, 14120, - 14222, 14220, 14218, 14216, 14318, 14316, 14314, 14312, - 14414, 14412, 14410, 14408, 14510, 14508, 14506, 14504, - 14606, 14604, 14602, 14600, 14702, 14700, 14698, 14696, - 14798, 14796, 14794, 14792, 14894, 14892, 14890, 14888, - 15054, 15052, 15050, 15048, 15150, 15148, 15146, 15144, - 15246, 15244, 15242, 15240, 15342, 15340, 15338, 15336, - 15438, 15436, 15434, 15432, 15534, 15532, 15530, 15528, - 15630, 15628, 15626, 15624, 15726, 15724, 15722, 15720, - 15822, 15820, 15818, 15816, 15918, 15916, 15914, 15912, - 16014, 16012, 16010, 16008, 16110, 16108, 16106, 16104, - 16206, 16204, 16202, 16200, 16302, 16300, 16298, 16296, - 16398, 16396, 16394, 16392, 16494, 16492, 16490, 16488, - 16590, 16588, 16586, 16584, 16654, 16652, 16650, 16648, - 16750, 16748, 16746, 16744, 16846, 16844, 16842, 16840, - 16942, 16940, 16938, 16936, 17038, 17036, 17034, 17032, - 17134, 17132, 17130, 17128, 17230, 17228, 17226, 17224, - 17326, 17324, 17322, 17320, 17422, 17420, 17418, 17416, - 17518, 17516, 17514, 17512, 17614, 17612, 17610, 17608, - 17710, 17708, 17706, 17704, 17806, 17804, 17802, 17800, - 17902, 17900, 17898, 17896, 17998, 17996, 17994, 17992, - 18094, 18092, 18090, 18088, 18190, 18188, 18186, 18184, - 18254, 18252, 18250, 18248, 18350, 18348, 18346, 18344, - 18446, 18444, 18442, 18440, 18542, 18540, 18538, 18536, - 18638, 18636, 18634, 18632, 18734, 18732, 18730, 18728, - 18830, 18828, 18826, 18824, 18926, 18924, 18922, 18920, - 19022, 19020, 19018, 19016, 19118, 19116, 19114, 19112, - 19214, 19212, 19210, 19208, 19310, 19308, 19306, 19304, - 19406, 19404, 19402, 19400, 19502, 19500, 19498, 19496, - 19598, 19596, 19594, 19592, 19694, 19692, 19690, 19688, - 19790, 19788, 19786, 19784, }, - /* 10 */ - {86, 84, 82, 80, 182, 180, 178, 176, - 278, 276, 274, 272, 374, 372, 370, 368, - 470, 468, 466, 464, 566, 564, 562, 560, - 662, 660, 658, 656, 758, 756, 754, 752, - 854, 852, 850, 848, 950, 948, 946, 944, - 1046, 1044, 1042, 1040, 1142, 1140, 1138, 1136, - 1238, 1236, 1234, 1232, 1334, 1332, 1330, 1328, - 1430, 1428, 1426, 1424, 1526, 1524, 1522, 1520, - 1622, 1620, 1618, 1616, 1718, 1716, 1714, 1712, - 1782, 1780, 1778, 1776, 1878, 1876, 1874, 1872, - 1974, 1972, 1970, 1968, 2070, 2068, 2066, 2064, - 2166, 2164, 2162, 2160, 2262, 2260, 2258, 2256, - 2358, 2356, 2354, 2352, 2454, 2452, 2450, 2448, - 2550, 2548, 2546, 2544, 2646, 2644, 2642, 2640, - 2742, 2740, 2738, 2736, 2838, 2836, 2834, 2832, - 2934, 2932, 2930, 2928, 3030, 3028, 3026, 3024, - 3126, 3124, 3122, 3120, 3222, 3220, 3218, 3216, - 3318, 3316, 3314, 3312, 3382, 3380, 3378, 3376, - 3478, 3476, 3474, 3472, 3574, 3572, 3570, 3568, - 3670, 3668, 3666, 3664, 3766, 3764, 3762, 3760, - 3862, 3860, 3858, 3856, 3958, 3956, 3954, 3952, - 4054, 4052, 4050, 4048, 4150, 4148, 4146, 4144, - 4246, 4244, 4242, 4240, 4342, 4340, 4338, 4336, - 4438, 4436, 4434, 4432, 4534, 4532, 4530, 4528, - 4630, 4628, 4626, 4624, 4726, 4724, 4722, 4720, - 4822, 4820, 4818, 4816, 4918, 4916, 4914, 4912, - 5078, 5076, 5074, 5072, 5174, 5172, 5170, 5168, - 5270, 5268, 5266, 5264, 5366, 5364, 5362, 5360, - 5462, 5460, 5458, 5456, 5558, 5556, 5554, 5552, - 5654, 5652, 5650, 5648, 5750, 5748, 5746, 5744, - 5846, 5844, 5842, 5840, 5942, 5940, 5938, 5936, - 6038, 6036, 6034, 6032, 6134, 6132, 6130, 6128, - 6230, 6228, 6226, 6224, 6326, 6324, 6322, 6320, - 6422, 6420, 6418, 6416, 6518, 6516, 6514, 6512, - 6614, 6612, 6610, 6608, 6678, 6676, 6674, 6672, - 6774, 6772, 6770, 6768, 6870, 6868, 6866, 6864, - 6966, 6964, 6962, 6960, 7062, 7060, 7058, 7056, - 7158, 7156, 7154, 7152, 7254, 7252, 7250, 7248, - 7350, 7348, 7346, 7344, 7446, 7444, 7442, 7440, - 7542, 7540, 7538, 7536, 7638, 7636, 7634, 7632, - 7734, 7732, 7730, 7728, 7830, 7828, 7826, 7824, - 7926, 7924, 7922, 7920, 8022, 8020, 8018, 8016, - 8118, 8116, 8114, 8112, 8214, 8212, 8210, 8208, - 8310, 8308, 8306, 8304, 8374, 8372, 8370, 8368, - 8470, 8468, 8466, 8464, 8566, 8564, 8562, 8560, - 8662, 8660, 8658, 8656, 8758, 8756, 8754, 8752, - 8854, 8852, 8850, 8848, 8950, 8948, 8946, 8944, - 9046, 9044, 9042, 9040, 9142, 9140, 9138, 9136, - 9238, 9236, 9234, 9232, 9334, 9332, 9330, 9328, - 9430, 9428, 9426, 9424, 9526, 9524, 9522, 9520, - 9622, 9620, 9618, 9616, 9718, 9716, 9714, 9712, - 9814, 9812, 9810, 9808, 9910, 9908, 9906, 9904, - 10070, 10068, 10066, 10064, 10166, 10164, 10162, 10160, - 10262, 10260, 10258, 10256, 10358, 10356, 10354, 10352, - 10454, 10452, 10450, 10448, 10550, 10548, 10546, 10544, - 10646, 10644, 10642, 10640, 10742, 10740, 10738, 10736, - 10838, 10836, 10834, 10832, 10934, 10932, 10930, 10928, - 11030, 11028, 11026, 11024, 11126, 11124, 11122, 11120, - 11222, 11220, 11218, 11216, 11318, 11316, 11314, 11312, - 11414, 11412, 11410, 11408, 11510, 11508, 11506, 11504, - 11606, 11604, 11602, 11600, 11670, 11668, 11666, 11664, - 11766, 11764, 11762, 11760, 11862, 11860, 11858, 11856, - 11958, 11956, 11954, 11952, 12054, 12052, 12050, 12048, - 12150, 12148, 12146, 12144, 12246, 12244, 12242, 12240, - 12342, 12340, 12338, 12336, 12438, 12436, 12434, 12432, - 12534, 12532, 12530, 12528, 12630, 12628, 12626, 12624, - 12726, 12724, 12722, 12720, 12822, 12820, 12818, 12816, - 12918, 12916, 12914, 12912, 13014, 13012, 13010, 13008, - 13110, 13108, 13106, 13104, 13206, 13204, 13202, 13200, - 13270, 13268, 13266, 13264, 13366, 13364, 13362, 13360, - 13462, 13460, 13458, 13456, 13558, 13556, 13554, 13552, - 13654, 13652, 13650, 13648, 13750, 13748, 13746, 13744, - 13846, 13844, 13842, 13840, 13942, 13940, 13938, 13936, - 14038, 14036, 14034, 14032, 14134, 14132, 14130, 14128, - 14230, 14228, 14226, 14224, 14326, 14324, 14322, 14320, - 14422, 14420, 14418, 14416, 14518, 14516, 14514, 14512, - 14614, 14612, 14610, 14608, 14710, 14708, 14706, 14704, - 14806, 14804, 14802, 14800, 14902, 14900, 14898, 14896, - 15062, 15060, 15058, 15056, 15158, 15156, 15154, 15152, - 15254, 15252, 15250, 15248, 15350, 15348, 15346, 15344, - 15446, 15444, 15442, 15440, 15542, 15540, 15538, 15536, - 15638, 15636, 15634, 15632, 15734, 15732, 15730, 15728, - 15830, 15828, 15826, 15824, 15926, 15924, 15922, 15920, - 16022, 16020, 16018, 16016, 16118, 16116, 16114, 16112, - 16214, 16212, 16210, 16208, 16310, 16308, 16306, 16304, - 16406, 16404, 16402, 16400, 16502, 16500, 16498, 16496, - 16598, 16596, 16594, 16592, 16662, 16660, 16658, 16656, - 16758, 16756, 16754, 16752, 16854, 16852, 16850, 16848, - 16950, 16948, 16946, 16944, 17046, 17044, 17042, 17040, - 17142, 17140, 17138, 17136, 17238, 17236, 17234, 17232, - 17334, 17332, 17330, 17328, 17430, 17428, 17426, 17424, - 17526, 17524, 17522, 17520, 17622, 17620, 17618, 17616, - 17718, 17716, 17714, 17712, 17814, 17812, 17810, 17808, - 17910, 17908, 17906, 17904, 18006, 18004, 18002, 18000, - 18102, 18100, 18098, 18096, 18198, 18196, 18194, 18192, - 18262, 18260, 18258, 18256, 18358, 18356, 18354, 18352, - 18454, 18452, 18450, 18448, 18550, 18548, 18546, 18544, - 18646, 18644, 18642, 18640, 18742, 18740, 18738, 18736, - 18838, 18836, 18834, 18832, 18934, 18932, 18930, 18928, - 19030, 19028, 19026, 19024, 19126, 19124, 19122, 19120, - 19222, 19220, 19218, 19216, 19318, 19316, 19314, 19312, - 19414, 19412, 19410, 19408, 19510, 19508, 19506, 19504, - 19606, 19604, 19602, 19600, 19702, 19700, 19698, 19696, - 19798, 19796, 19794, 19792, }, - /* 11 */ - {94, 92, 90, 88, 190, 188, 186, 184, - 286, 284, 282, 280, 382, 380, 378, 376, - 478, 476, 474, 472, 574, 572, 570, 568, - 670, 668, 666, 664, 766, 764, 762, 760, - 862, 860, 858, 856, 958, 956, 954, 952, - 1054, 1052, 1050, 1048, 1150, 1148, 1146, 1144, - 1246, 1244, 1242, 1240, 1342, 1340, 1338, 1336, - 1438, 1436, 1434, 1432, 1534, 1532, 1530, 1528, - 1630, 1628, 1626, 1624, 1726, 1724, 1722, 1720, - 1790, 1788, 1786, 1784, 1886, 1884, 1882, 1880, - 1982, 1980, 1978, 1976, 2078, 2076, 2074, 2072, - 2174, 2172, 2170, 2168, 2270, 2268, 2266, 2264, - 2366, 2364, 2362, 2360, 2462, 2460, 2458, 2456, - 2558, 2556, 2554, 2552, 2654, 2652, 2650, 2648, - 2750, 2748, 2746, 2744, 2846, 2844, 2842, 2840, - 2942, 2940, 2938, 2936, 3038, 3036, 3034, 3032, - 3134, 3132, 3130, 3128, 3230, 3228, 3226, 3224, - 3326, 3324, 3322, 3320, 3390, 3388, 3386, 3384, - 3486, 3484, 3482, 3480, 3582, 3580, 3578, 3576, - 3678, 3676, 3674, 3672, 3774, 3772, 3770, 3768, - 3870, 3868, 3866, 3864, 3966, 3964, 3962, 3960, - 4062, 4060, 4058, 4056, 4158, 4156, 4154, 4152, - 4254, 4252, 4250, 4248, 4350, 4348, 4346, 4344, - 4446, 4444, 4442, 4440, 4542, 4540, 4538, 4536, - 4638, 4636, 4634, 4632, 4734, 4732, 4730, 4728, - 4830, 4828, 4826, 4824, 4926, 4924, 4922, 4920, - 5086, 5084, 5082, 5080, 5182, 5180, 5178, 5176, - 5278, 5276, 5274, 5272, 5374, 5372, 5370, 5368, - 5470, 5468, 5466, 5464, 5566, 5564, 5562, 5560, - 5662, 5660, 5658, 5656, 5758, 5756, 5754, 5752, - 5854, 5852, 5850, 5848, 5950, 5948, 5946, 5944, - 6046, 6044, 6042, 6040, 6142, 6140, 6138, 6136, - 6238, 6236, 6234, 6232, 6334, 6332, 6330, 6328, - 6430, 6428, 6426, 6424, 6526, 6524, 6522, 6520, - 6622, 6620, 6618, 6616, 6686, 6684, 6682, 6680, - 6782, 6780, 6778, 6776, 6878, 6876, 6874, 6872, - 6974, 6972, 6970, 6968, 7070, 7068, 7066, 7064, - 7166, 7164, 7162, 7160, 7262, 7260, 7258, 7256, - 7358, 7356, 7354, 7352, 7454, 7452, 7450, 7448, - 7550, 7548, 7546, 7544, 7646, 7644, 7642, 7640, - 7742, 7740, 7738, 7736, 7838, 7836, 7834, 7832, - 7934, 7932, 7930, 7928, 8030, 8028, 8026, 8024, - 8126, 8124, 8122, 8120, 8222, 8220, 8218, 8216, - 8318, 8316, 8314, 8312, 8382, 8380, 8378, 8376, - 8478, 8476, 8474, 8472, 8574, 8572, 8570, 8568, - 8670, 8668, 8666, 8664, 8766, 8764, 8762, 8760, - 8862, 8860, 8858, 8856, 8958, 8956, 8954, 8952, - 9054, 9052, 9050, 9048, 9150, 9148, 9146, 9144, - 9246, 9244, 9242, 9240, 9342, 9340, 9338, 9336, - 9438, 9436, 9434, 9432, 9534, 9532, 9530, 9528, - 9630, 9628, 9626, 9624, 9726, 9724, 9722, 9720, - 9822, 9820, 9818, 9816, 9918, 9916, 9914, 9912, - 10078, 10076, 10074, 10072, 10174, 10172, 10170, 10168, - 10270, 10268, 10266, 10264, 10366, 10364, 10362, 10360, - 10462, 10460, 10458, 10456, 10558, 10556, 10554, 10552, - 10654, 10652, 10650, 10648, 10750, 10748, 10746, 10744, - 10846, 10844, 10842, 10840, 10942, 10940, 10938, 10936, - 11038, 11036, 11034, 11032, 11134, 11132, 11130, 11128, - 11230, 11228, 11226, 11224, 11326, 11324, 11322, 11320, - 11422, 11420, 11418, 11416, 11518, 11516, 11514, 11512, - 11614, 11612, 11610, 11608, 11678, 11676, 11674, 11672, - 11774, 11772, 11770, 11768, 11870, 11868, 11866, 11864, - 11966, 11964, 11962, 11960, 12062, 12060, 12058, 12056, - 12158, 12156, 12154, 12152, 12254, 12252, 12250, 12248, - 12350, 12348, 12346, 12344, 12446, 12444, 12442, 12440, - 12542, 12540, 12538, 12536, 12638, 12636, 12634, 12632, - 12734, 12732, 12730, 12728, 12830, 12828, 12826, 12824, - 12926, 12924, 12922, 12920, 13022, 13020, 13018, 13016, - 13118, 13116, 13114, 13112, 13214, 13212, 13210, 13208, - 13278, 13276, 13274, 13272, 13374, 13372, 13370, 13368, - 13470, 13468, 13466, 13464, 13566, 13564, 13562, 13560, - 13662, 13660, 13658, 13656, 13758, 13756, 13754, 13752, - 13854, 13852, 13850, 13848, 13950, 13948, 13946, 13944, - 14046, 14044, 14042, 14040, 14142, 14140, 14138, 14136, - 14238, 14236, 14234, 14232, 14334, 14332, 14330, 14328, - 14430, 14428, 14426, 14424, 14526, 14524, 14522, 14520, - 14622, 14620, 14618, 14616, 14718, 14716, 14714, 14712, - 14814, 14812, 14810, 14808, 14910, 14908, 14906, 14904, - 15070, 15068, 15066, 15064, 15166, 15164, 15162, 15160, - 15262, 15260, 15258, 15256, 15358, 15356, 15354, 15352, - 15454, 15452, 15450, 15448, 15550, 15548, 15546, 15544, - 15646, 15644, 15642, 15640, 15742, 15740, 15738, 15736, - 15838, 15836, 15834, 15832, 15934, 15932, 15930, 15928, - 16030, 16028, 16026, 16024, 16126, 16124, 16122, 16120, - 16222, 16220, 16218, 16216, 16318, 16316, 16314, 16312, - 16414, 16412, 16410, 16408, 16510, 16508, 16506, 16504, - 16606, 16604, 16602, 16600, 16670, 16668, 16666, 16664, - 16766, 16764, 16762, 16760, 16862, 16860, 16858, 16856, - 16958, 16956, 16954, 16952, 17054, 17052, 17050, 17048, - 17150, 17148, 17146, 17144, 17246, 17244, 17242, 17240, - 17342, 17340, 17338, 17336, 17438, 17436, 17434, 17432, - 17534, 17532, 17530, 17528, 17630, 17628, 17626, 17624, - 17726, 17724, 17722, 17720, 17822, 17820, 17818, 17816, - 17918, 17916, 17914, 17912, 18014, 18012, 18010, 18008, - 18110, 18108, 18106, 18104, 18206, 18204, 18202, 18200, - 18270, 18268, 18266, 18264, 18366, 18364, 18362, 18360, - 18462, 18460, 18458, 18456, 18558, 18556, 18554, 18552, - 18654, 18652, 18650, 18648, 18750, 18748, 18746, 18744, - 18846, 18844, 18842, 18840, 18942, 18940, 18938, 18936, - 19038, 19036, 19034, 19032, 19134, 19132, 19130, 19128, - 19230, 19228, 19226, 19224, 19326, 19324, 19322, 19320, - 19422, 19420, 19418, 19416, 19518, 19516, 19514, 19512, - 19614, 19612, 19610, 19608, 19710, 19708, 19706, 19704, - 19806, 19804, 19802, 19800, }, + /* 0 */ + { + 6, 4, 2, 0, 102, 100, 98, 96, 198, 196, 194, + 192, 294, 292, 290, 288, 390, 388, 386, 384, 486, 484, + 482, 480, 582, 580, 578, 576, 678, 676, 674, 672, 774, + 772, 770, 768, 870, 868, 866, 864, 966, 964, 962, 960, + 1062, 1060, 1058, 1056, 1158, 1156, 1154, 1152, 1254, 1252, 1250, + 1248, 1350, 1348, 1346, 1344, 1446, 1444, 1442, 1440, 1542, 1540, + 1538, 1536, 1638, 1636, 1634, 1632, 1798, 1796, 1794, 1792, 1894, + 1892, 1890, 1888, 1990, 1988, 1986, 1984, 2086, 2084, 2082, 2080, + 2182, 2180, 2178, 2176, 2278, 2276, 2274, 2272, 2374, 2372, 2370, + 2368, 2470, 2468, 2466, 2464, 2566, 2564, 2562, 2560, 2662, 2660, + 2658, 2656, 2758, 2756, 2754, 2752, 2854, 2852, 2850, 2848, 2950, + 2948, 2946, 2944, 3046, 3044, 3042, 3040, 3142, 3140, 3138, 3136, + 3238, 3236, 3234, 3232, 3334, 3332, 3330, 3328, 3398, 3396, 3394, + 3392, 3494, 3492, 3490, 3488, 3590, 3588, 3586, 3584, 3686, 3684, + 3682, 3680, 3782, 3780, 3778, 3776, 3878, 3876, 3874, 3872, 3974, + 3972, 3970, 3968, 4070, 4068, 4066, 4064, 4166, 4164, 4162, 4160, + 4262, 4260, 4258, 4256, 4358, 4356, 4354, 4352, 4454, 4452, 4450, + 4448, 4550, 4548, 4546, 4544, 4646, 4644, 4642, 4640, 4742, 4740, + 4738, 4736, 4838, 4836, 4834, 4832, 4934, 4932, 4930, 4928, 4998, + 4996, 4994, 4992, 5094, 5092, 5090, 5088, 5190, 5188, 5186, 5184, + 5286, 5284, 5282, 5280, 5382, 5380, 5378, 5376, 5478, 5476, 5474, + 5472, 5574, 5572, 5570, 5568, 5670, 5668, 5666, 5664, 5766, 5764, + 5762, 5760, 5862, 5860, 5858, 5856, 5958, 5956, 5954, 5952, 6054, + 6052, 6050, 6048, 6150, 6148, 6146, 6144, 6246, 6244, 6242, 6240, + 6342, 6340, 6338, 6336, 6438, 6436, 6434, 6432, 6534, 6532, 6530, + 6528, 6694, 6692, 6690, 6688, 6790, 6788, 6786, 6784, 6886, 6884, + 6882, 6880, 6982, 6980, 6978, 6976, 7078, 7076, 7074, 7072, 7174, + 7172, 7170, 7168, 7270, 7268, 7266, 7264, 7366, 7364, 7362, 7360, + 7462, 7460, 7458, 7456, 7558, 7556, 7554, 7552, 7654, 7652, 7650, + 7648, 7750, 7748, 7746, 7744, 7846, 7844, 7842, 7840, 7942, 7940, + 7938, 7936, 8038, 8036, 8034, 8032, 8134, 8132, 8130, 8128, 8230, + 8228, 8226, 8224, 8326, 8324, 8322, 8320, 8390, 8388, 8386, 8384, + 8486, 8484, 8482, 8480, 8582, 8580, 8578, 8576, 8678, 8676, 8674, + 8672, 8774, 8772, 8770, 8768, 8870, 8868, 8866, 8864, 8966, 8964, + 8962, 8960, 9062, 9060, 9058, 9056, 9158, 9156, 9154, 9152, 9254, + 9252, 9250, 9248, 9350, 9348, 9346, 9344, 9446, 9444, 9442, 9440, + 9542, 9540, 9538, 9536, 9638, 9636, 9634, 9632, 9734, 9732, 9730, + 9728, 9830, 9828, 9826, 9824, 9926, 9924, 9922, 9920, 9990, 9988, + 9986, 9984, 10086, 10084, 10082, 10080, 10182, 10180, 10178, 10176, 10278, + 10276, 10274, 10272, 10374, 10372, 10370, 10368, 10470, 10468, 10466, 10464, + 10566, 10564, 10562, 10560, 10662, 10660, 10658, 10656, 10758, 10756, 10754, + 10752, 10854, 10852, 10850, 10848, 10950, 10948, 10946, 10944, 11046, 11044, + 11042, 11040, 11142, 11140, 11138, 11136, 11238, 11236, 11234, 11232, 11334, + 11332, 11330, 11328, 11430, 11428, 11426, 11424, 11526, 11524, 11522, 11520, + 11686, 11684, 11682, 11680, 11782, 11780, 11778, 11776, 11878, 11876, 11874, + 11872, 11974, 11972, 11970, 11968, 12070, 12068, 12066, 12064, 12166, 12164, + 12162, 12160, 12262, 12260, 12258, 12256, 12358, 12356, 12354, 12352, 12454, + 12452, 12450, 12448, 12550, 12548, 12546, 12544, 12646, 12644, 12642, 12640, + 12742, 12740, 12738, 12736, 12838, 12836, 12834, 12832, 12934, 12932, 12930, + 12928, 13030, 13028, 13026, 13024, 13126, 13124, 13122, 13120, 13222, 13220, + 13218, 13216, 13286, 13284, 13282, 13280, 13382, 13380, 13378, 13376, 13478, + 13476, 13474, 13472, 13574, 13572, 13570, 13568, 13670, 13668, 13666, 13664, + 13766, 13764, 13762, 13760, 13862, 13860, 13858, 13856, 13958, 13956, 13954, + 13952, 14054, 14052, 14050, 14048, 14150, 14148, 14146, 14144, 14246, 14244, + 14242, 14240, 14342, 14340, 14338, 14336, 14438, 14436, 14434, 14432, 14534, + 14532, 14530, 14528, 14630, 14628, 14626, 14624, 14726, 14724, 14722, 14720, + 14822, 14820, 14818, 14816, 14918, 14916, 14914, 14912, 14982, 14980, 14978, + 14976, 15078, 15076, 15074, 15072, 15174, 15172, 15170, 15168, 15270, 15268, + 15266, 15264, 15366, 15364, 15362, 15360, 15462, 15460, 15458, 15456, 15558, + 15556, 15554, 15552, 15654, 15652, 15650, 15648, 15750, 15748, 15746, 15744, + 15846, 15844, 15842, 15840, 15942, 15940, 15938, 15936, 16038, 16036, 16034, + 16032, 16134, 16132, 16130, 16128, 16230, 16228, 16226, 16224, 16326, 16324, + 16322, 16320, 16422, 16420, 16418, 16416, 16518, 16516, 16514, 16512, 16678, + 16676, 16674, 16672, 16774, 16772, 16770, 16768, 16870, 16868, 16866, 16864, + 16966, 16964, 16962, 16960, 17062, 17060, 17058, 17056, 17158, 17156, 17154, + 17152, 17254, 17252, 17250, 17248, 17350, 17348, 17346, 17344, 17446, 17444, + 17442, 17440, 17542, 17540, 17538, 17536, 17638, 17636, 17634, 17632, 17734, + 17732, 17730, 17728, 17830, 17828, 17826, 17824, 17926, 17924, 17922, 17920, + 18022, 18020, 18018, 18016, 18118, 18116, 18114, 18112, 18214, 18212, 18210, + 18208, 18278, 18276, 18274, 18272, 18374, 18372, 18370, 18368, 18470, 18468, + 18466, 18464, 18566, 18564, 18562, 18560, 18662, 18660, 18658, 18656, 18758, + 18756, 18754, 18752, 18854, 18852, 18850, 18848, 18950, 18948, 18946, 18944, + 19046, 19044, 19042, 19040, 19142, 19140, 19138, 19136, 19238, 19236, 19234, + 19232, 19334, 19332, 19330, 19328, 19430, 19428, 19426, 19424, 19526, 19524, + 19522, 19520, 19622, 19620, 19618, 19616, 19718, 19716, 19714, 19712, 19814, + 19812, 19810, 19808, + }, + /* 1 */ + { + 14, 12, 10, 8, 110, 108, 106, 104, 206, 204, 202, + 200, 302, 300, 298, 296, 398, 396, 394, 392, 494, 492, + 490, 488, 590, 588, 586, 584, 686, 684, 682, 680, 782, + 780, 778, 776, 878, 876, 874, 872, 974, 972, 970, 968, + 1070, 1068, 1066, 1064, 1166, 1164, 1162, 1160, 1262, 1260, 1258, + 1256, 1358, 1356, 1354, 1352, 1454, 1452, 1450, 1448, 1550, 1548, + 1546, 1544, 1646, 1644, 1642, 1640, 1806, 1804, 1802, 1800, 1902, + 1900, 1898, 1896, 1998, 1996, 1994, 1992, 2094, 2092, 2090, 2088, + 2190, 2188, 2186, 2184, 2286, 2284, 2282, 2280, 2382, 2380, 2378, + 2376, 2478, 2476, 2474, 2472, 2574, 2572, 2570, 2568, 2670, 2668, + 2666, 2664, 2766, 2764, 2762, 2760, 2862, 2860, 2858, 2856, 2958, + 2956, 2954, 2952, 3054, 3052, 3050, 3048, 3150, 3148, 3146, 3144, + 3246, 3244, 3242, 3240, 3342, 3340, 3338, 3336, 3406, 3404, 3402, + 3400, 3502, 3500, 3498, 3496, 3598, 3596, 3594, 3592, 3694, 3692, + 3690, 3688, 3790, 3788, 3786, 3784, 3886, 3884, 3882, 3880, 3982, + 3980, 3978, 3976, 4078, 4076, 4074, 4072, 4174, 4172, 4170, 4168, + 4270, 4268, 4266, 4264, 4366, 4364, 4362, 4360, 4462, 4460, 4458, + 4456, 4558, 4556, 4554, 4552, 4654, 4652, 4650, 4648, 4750, 4748, + 4746, 4744, 4846, 4844, 4842, 4840, 4942, 4940, 4938, 4936, 5006, + 5004, 5002, 5000, 5102, 5100, 5098, 5096, 5198, 5196, 5194, 5192, + 5294, 5292, 5290, 5288, 5390, 5388, 5386, 5384, 5486, 5484, 5482, + 5480, 5582, 5580, 5578, 5576, 5678, 5676, 5674, 5672, 5774, 5772, + 5770, 5768, 5870, 5868, 5866, 5864, 5966, 5964, 5962, 5960, 6062, + 6060, 6058, 6056, 6158, 6156, 6154, 6152, 6254, 6252, 6250, 6248, + 6350, 6348, 6346, 6344, 6446, 6444, 6442, 6440, 6542, 6540, 6538, + 6536, 6702, 6700, 6698, 6696, 6798, 6796, 6794, 6792, 6894, 6892, + 6890, 6888, 6990, 6988, 6986, 6984, 7086, 7084, 7082, 7080, 7182, + 7180, 7178, 7176, 7278, 7276, 7274, 7272, 7374, 7372, 7370, 7368, + 7470, 7468, 7466, 7464, 7566, 7564, 7562, 7560, 7662, 7660, 7658, + 7656, 7758, 7756, 7754, 7752, 7854, 7852, 7850, 7848, 7950, 7948, + 7946, 7944, 8046, 8044, 8042, 8040, 8142, 8140, 8138, 8136, 8238, + 8236, 8234, 8232, 8334, 8332, 8330, 8328, 8398, 8396, 8394, 8392, + 8494, 8492, 8490, 8488, 8590, 8588, 8586, 8584, 8686, 8684, 8682, + 8680, 8782, 8780, 8778, 8776, 8878, 8876, 8874, 8872, 8974, 8972, + 8970, 8968, 9070, 9068, 9066, 9064, 9166, 9164, 9162, 9160, 9262, + 9260, 9258, 9256, 9358, 9356, 9354, 9352, 9454, 9452, 9450, 9448, + 9550, 9548, 9546, 9544, 9646, 9644, 9642, 9640, 9742, 9740, 9738, + 9736, 9838, 9836, 9834, 9832, 9934, 9932, 9930, 9928, 9998, 9996, + 9994, 9992, 10094, 10092, 10090, 10088, 10190, 10188, 10186, 10184, 10286, + 10284, 10282, 10280, 10382, 10380, 10378, 10376, 10478, 10476, 10474, 10472, + 10574, 10572, 10570, 10568, 10670, 10668, 10666, 10664, 10766, 10764, 10762, + 10760, 10862, 10860, 10858, 10856, 10958, 10956, 10954, 10952, 11054, 11052, + 11050, 11048, 11150, 11148, 11146, 11144, 11246, 11244, 11242, 11240, 11342, + 11340, 11338, 11336, 11438, 11436, 11434, 11432, 11534, 11532, 11530, 11528, + 11694, 11692, 11690, 11688, 11790, 11788, 11786, 11784, 11886, 11884, 11882, + 11880, 11982, 11980, 11978, 11976, 12078, 12076, 12074, 12072, 12174, 12172, + 12170, 12168, 12270, 12268, 12266, 12264, 12366, 12364, 12362, 12360, 12462, + 12460, 12458, 12456, 12558, 12556, 12554, 12552, 12654, 12652, 12650, 12648, + 12750, 12748, 12746, 12744, 12846, 12844, 12842, 12840, 12942, 12940, 12938, + 12936, 13038, 13036, 13034, 13032, 13134, 13132, 13130, 13128, 13230, 13228, + 13226, 13224, 13294, 13292, 13290, 13288, 13390, 13388, 13386, 13384, 13486, + 13484, 13482, 13480, 13582, 13580, 13578, 13576, 13678, 13676, 13674, 13672, + 13774, 13772, 13770, 13768, 13870, 13868, 13866, 13864, 13966, 13964, 13962, + 13960, 14062, 14060, 14058, 14056, 14158, 14156, 14154, 14152, 14254, 14252, + 14250, 14248, 14350, 14348, 14346, 14344, 14446, 14444, 14442, 14440, 14542, + 14540, 14538, 14536, 14638, 14636, 14634, 14632, 14734, 14732, 14730, 14728, + 14830, 14828, 14826, 14824, 14926, 14924, 14922, 14920, 14990, 14988, 14986, + 14984, 15086, 15084, 15082, 15080, 15182, 15180, 15178, 15176, 15278, 15276, + 15274, 15272, 15374, 15372, 15370, 15368, 15470, 15468, 15466, 15464, 15566, + 15564, 15562, 15560, 15662, 15660, 15658, 15656, 15758, 15756, 15754, 15752, + 15854, 15852, 15850, 15848, 15950, 15948, 15946, 15944, 16046, 16044, 16042, + 16040, 16142, 16140, 16138, 16136, 16238, 16236, 16234, 16232, 16334, 16332, + 16330, 16328, 16430, 16428, 16426, 16424, 16526, 16524, 16522, 16520, 16686, + 16684, 16682, 16680, 16782, 16780, 16778, 16776, 16878, 16876, 16874, 16872, + 16974, 16972, 16970, 16968, 17070, 17068, 17066, 17064, 17166, 17164, 17162, + 17160, 17262, 17260, 17258, 17256, 17358, 17356, 17354, 17352, 17454, 17452, + 17450, 17448, 17550, 17548, 17546, 17544, 17646, 17644, 17642, 17640, 17742, + 17740, 17738, 17736, 17838, 17836, 17834, 17832, 17934, 17932, 17930, 17928, + 18030, 18028, 18026, 18024, 18126, 18124, 18122, 18120, 18222, 18220, 18218, + 18216, 18286, 18284, 18282, 18280, 18382, 18380, 18378, 18376, 18478, 18476, + 18474, 18472, 18574, 18572, 18570, 18568, 18670, 18668, 18666, 18664, 18766, + 18764, 18762, 18760, 18862, 18860, 18858, 18856, 18958, 18956, 18954, 18952, + 19054, 19052, 19050, 19048, 19150, 19148, 19146, 19144, 19246, 19244, 19242, + 19240, 19342, 19340, 19338, 19336, 19438, 19436, 19434, 19432, 19534, 19532, + 19530, 19528, 19630, 19628, 19626, 19624, 19726, 19724, 19722, 19720, 19822, + 19820, 19818, 19816, + }, + /* 2 */ + { + 22, 20, 18, 16, 118, 116, 114, 112, 214, 212, 210, + 208, 310, 308, 306, 304, 406, 404, 402, 400, 502, 500, + 498, 496, 598, 596, 594, 592, 694, 692, 690, 688, 790, + 788, 786, 784, 886, 884, 882, 880, 982, 980, 978, 976, + 1078, 1076, 1074, 1072, 1174, 1172, 1170, 1168, 1270, 1268, 1266, + 1264, 1366, 1364, 1362, 1360, 1462, 1460, 1458, 1456, 1558, 1556, + 1554, 1552, 1654, 1652, 1650, 1648, 1814, 1812, 1810, 1808, 1910, + 1908, 1906, 1904, 2006, 2004, 2002, 2000, 2102, 2100, 2098, 2096, + 2198, 2196, 2194, 2192, 2294, 2292, 2290, 2288, 2390, 2388, 2386, + 2384, 2486, 2484, 2482, 2480, 2582, 2580, 2578, 2576, 2678, 2676, + 2674, 2672, 2774, 2772, 2770, 2768, 2870, 2868, 2866, 2864, 2966, + 2964, 2962, 2960, 3062, 3060, 3058, 3056, 3158, 3156, 3154, 3152, + 3254, 3252, 3250, 3248, 3350, 3348, 3346, 3344, 3414, 3412, 3410, + 3408, 3510, 3508, 3506, 3504, 3606, 3604, 3602, 3600, 3702, 3700, + 3698, 3696, 3798, 3796, 3794, 3792, 3894, 3892, 3890, 3888, 3990, + 3988, 3986, 3984, 4086, 4084, 4082, 4080, 4182, 4180, 4178, 4176, + 4278, 4276, 4274, 4272, 4374, 4372, 4370, 4368, 4470, 4468, 4466, + 4464, 4566, 4564, 4562, 4560, 4662, 4660, 4658, 4656, 4758, 4756, + 4754, 4752, 4854, 4852, 4850, 4848, 4950, 4948, 4946, 4944, 5014, + 5012, 5010, 5008, 5110, 5108, 5106, 5104, 5206, 5204, 5202, 5200, + 5302, 5300, 5298, 5296, 5398, 5396, 5394, 5392, 5494, 5492, 5490, + 5488, 5590, 5588, 5586, 5584, 5686, 5684, 5682, 5680, 5782, 5780, + 5778, 5776, 5878, 5876, 5874, 5872, 5974, 5972, 5970, 5968, 6070, + 6068, 6066, 6064, 6166, 6164, 6162, 6160, 6262, 6260, 6258, 6256, + 6358, 6356, 6354, 6352, 6454, 6452, 6450, 6448, 6550, 6548, 6546, + 6544, 6710, 6708, 6706, 6704, 6806, 6804, 6802, 6800, 6902, 6900, + 6898, 6896, 6998, 6996, 6994, 6992, 7094, 7092, 7090, 7088, 7190, + 7188, 7186, 7184, 7286, 7284, 7282, 7280, 7382, 7380, 7378, 7376, + 7478, 7476, 7474, 7472, 7574, 7572, 7570, 7568, 7670, 7668, 7666, + 7664, 7766, 7764, 7762, 7760, 7862, 7860, 7858, 7856, 7958, 7956, + 7954, 7952, 8054, 8052, 8050, 8048, 8150, 8148, 8146, 8144, 8246, + 8244, 8242, 8240, 8342, 8340, 8338, 8336, 8406, 8404, 8402, 8400, + 8502, 8500, 8498, 8496, 8598, 8596, 8594, 8592, 8694, 8692, 8690, + 8688, 8790, 8788, 8786, 8784, 8886, 8884, 8882, 8880, 8982, 8980, + 8978, 8976, 9078, 9076, 9074, 9072, 9174, 9172, 9170, 9168, 9270, + 9268, 9266, 9264, 9366, 9364, 9362, 9360, 9462, 9460, 9458, 9456, + 9558, 9556, 9554, 9552, 9654, 9652, 9650, 9648, 9750, 9748, 9746, + 9744, 9846, 9844, 9842, 9840, 9942, 9940, 9938, 9936, 10006, 10004, + 10002, 10000, 10102, 10100, 10098, 10096, 10198, 10196, 10194, 10192, 10294, + 10292, 10290, 10288, 10390, 10388, 10386, 10384, 10486, 10484, 10482, 10480, + 10582, 10580, 10578, 10576, 10678, 10676, 10674, 10672, 10774, 10772, 10770, + 10768, 10870, 10868, 10866, 10864, 10966, 10964, 10962, 10960, 11062, 11060, + 11058, 11056, 11158, 11156, 11154, 11152, 11254, 11252, 11250, 11248, 11350, + 11348, 11346, 11344, 11446, 11444, 11442, 11440, 11542, 11540, 11538, 11536, + 11702, 11700, 11698, 11696, 11798, 11796, 11794, 11792, 11894, 11892, 11890, + 11888, 11990, 11988, 11986, 11984, 12086, 12084, 12082, 12080, 12182, 12180, + 12178, 12176, 12278, 12276, 12274, 12272, 12374, 12372, 12370, 12368, 12470, + 12468, 12466, 12464, 12566, 12564, 12562, 12560, 12662, 12660, 12658, 12656, + 12758, 12756, 12754, 12752, 12854, 12852, 12850, 12848, 12950, 12948, 12946, + 12944, 13046, 13044, 13042, 13040, 13142, 13140, 13138, 13136, 13238, 13236, + 13234, 13232, 13302, 13300, 13298, 13296, 13398, 13396, 13394, 13392, 13494, + 13492, 13490, 13488, 13590, 13588, 13586, 13584, 13686, 13684, 13682, 13680, + 13782, 13780, 13778, 13776, 13878, 13876, 13874, 13872, 13974, 13972, 13970, + 13968, 14070, 14068, 14066, 14064, 14166, 14164, 14162, 14160, 14262, 14260, + 14258, 14256, 14358, 14356, 14354, 14352, 14454, 14452, 14450, 14448, 14550, + 14548, 14546, 14544, 14646, 14644, 14642, 14640, 14742, 14740, 14738, 14736, + 14838, 14836, 14834, 14832, 14934, 14932, 14930, 14928, 14998, 14996, 14994, + 14992, 15094, 15092, 15090, 15088, 15190, 15188, 15186, 15184, 15286, 15284, + 15282, 15280, 15382, 15380, 15378, 15376, 15478, 15476, 15474, 15472, 15574, + 15572, 15570, 15568, 15670, 15668, 15666, 15664, 15766, 15764, 15762, 15760, + 15862, 15860, 15858, 15856, 15958, 15956, 15954, 15952, 16054, 16052, 16050, + 16048, 16150, 16148, 16146, 16144, 16246, 16244, 16242, 16240, 16342, 16340, + 16338, 16336, 16438, 16436, 16434, 16432, 16534, 16532, 16530, 16528, 16694, + 16692, 16690, 16688, 16790, 16788, 16786, 16784, 16886, 16884, 16882, 16880, + 16982, 16980, 16978, 16976, 17078, 17076, 17074, 17072, 17174, 17172, 17170, + 17168, 17270, 17268, 17266, 17264, 17366, 17364, 17362, 17360, 17462, 17460, + 17458, 17456, 17558, 17556, 17554, 17552, 17654, 17652, 17650, 17648, 17750, + 17748, 17746, 17744, 17846, 17844, 17842, 17840, 17942, 17940, 17938, 17936, + 18038, 18036, 18034, 18032, 18134, 18132, 18130, 18128, 18230, 18228, 18226, + 18224, 18294, 18292, 18290, 18288, 18390, 18388, 18386, 18384, 18486, 18484, + 18482, 18480, 18582, 18580, 18578, 18576, 18678, 18676, 18674, 18672, 18774, + 18772, 18770, 18768, 18870, 18868, 18866, 18864, 18966, 18964, 18962, 18960, + 19062, 19060, 19058, 19056, 19158, 19156, 19154, 19152, 19254, 19252, 19250, + 19248, 19350, 19348, 19346, 19344, 19446, 19444, 19442, 19440, 19542, 19540, + 19538, 19536, 19638, 19636, 19634, 19632, 19734, 19732, 19730, 19728, 19830, + 19828, 19826, 19824, + }, + /* 3 */ + { + 30, 28, 26, 24, 126, 124, 122, 120, 222, 220, 218, + 216, 318, 316, 314, 312, 414, 412, 410, 408, 510, 508, + 506, 504, 606, 604, 602, 600, 702, 700, 698, 696, 798, + 796, 794, 792, 894, 892, 890, 888, 990, 988, 986, 984, + 1086, 1084, 1082, 1080, 1182, 1180, 1178, 1176, 1278, 1276, 1274, + 1272, 1374, 1372, 1370, 1368, 1470, 1468, 1466, 1464, 1566, 1564, + 1562, 1560, 1662, 1660, 1658, 1656, 1822, 1820, 1818, 1816, 1918, + 1916, 1914, 1912, 2014, 2012, 2010, 2008, 2110, 2108, 2106, 2104, + 2206, 2204, 2202, 2200, 2302, 2300, 2298, 2296, 2398, 2396, 2394, + 2392, 2494, 2492, 2490, 2488, 2590, 2588, 2586, 2584, 2686, 2684, + 2682, 2680, 2782, 2780, 2778, 2776, 2878, 2876, 2874, 2872, 2974, + 2972, 2970, 2968, 3070, 3068, 3066, 3064, 3166, 3164, 3162, 3160, + 3262, 3260, 3258, 3256, 3358, 3356, 3354, 3352, 3422, 3420, 3418, + 3416, 3518, 3516, 3514, 3512, 3614, 3612, 3610, 3608, 3710, 3708, + 3706, 3704, 3806, 3804, 3802, 3800, 3902, 3900, 3898, 3896, 3998, + 3996, 3994, 3992, 4094, 4092, 4090, 4088, 4190, 4188, 4186, 4184, + 4286, 4284, 4282, 4280, 4382, 4380, 4378, 4376, 4478, 4476, 4474, + 4472, 4574, 4572, 4570, 4568, 4670, 4668, 4666, 4664, 4766, 4764, + 4762, 4760, 4862, 4860, 4858, 4856, 4958, 4956, 4954, 4952, 5022, + 5020, 5018, 5016, 5118, 5116, 5114, 5112, 5214, 5212, 5210, 5208, + 5310, 5308, 5306, 5304, 5406, 5404, 5402, 5400, 5502, 5500, 5498, + 5496, 5598, 5596, 5594, 5592, 5694, 5692, 5690, 5688, 5790, 5788, + 5786, 5784, 5886, 5884, 5882, 5880, 5982, 5980, 5978, 5976, 6078, + 6076, 6074, 6072, 6174, 6172, 6170, 6168, 6270, 6268, 6266, 6264, + 6366, 6364, 6362, 6360, 6462, 6460, 6458, 6456, 6558, 6556, 6554, + 6552, 6718, 6716, 6714, 6712, 6814, 6812, 6810, 6808, 6910, 6908, + 6906, 6904, 7006, 7004, 7002, 7000, 7102, 7100, 7098, 7096, 7198, + 7196, 7194, 7192, 7294, 7292, 7290, 7288, 7390, 7388, 7386, 7384, + 7486, 7484, 7482, 7480, 7582, 7580, 7578, 7576, 7678, 7676, 7674, + 7672, 7774, 7772, 7770, 7768, 7870, 7868, 7866, 7864, 7966, 7964, + 7962, 7960, 8062, 8060, 8058, 8056, 8158, 8156, 8154, 8152, 8254, + 8252, 8250, 8248, 8350, 8348, 8346, 8344, 8414, 8412, 8410, 8408, + 8510, 8508, 8506, 8504, 8606, 8604, 8602, 8600, 8702, 8700, 8698, + 8696, 8798, 8796, 8794, 8792, 8894, 8892, 8890, 8888, 8990, 8988, + 8986, 8984, 9086, 9084, 9082, 9080, 9182, 9180, 9178, 9176, 9278, + 9276, 9274, 9272, 9374, 9372, 9370, 9368, 9470, 9468, 9466, 9464, + 9566, 9564, 9562, 9560, 9662, 9660, 9658, 9656, 9758, 9756, 9754, + 9752, 9854, 9852, 9850, 9848, 9950, 9948, 9946, 9944, 10014, 10012, + 10010, 10008, 10110, 10108, 10106, 10104, 10206, 10204, 10202, 10200, 10302, + 10300, 10298, 10296, 10398, 10396, 10394, 10392, 10494, 10492, 10490, 10488, + 10590, 10588, 10586, 10584, 10686, 10684, 10682, 10680, 10782, 10780, 10778, + 10776, 10878, 10876, 10874, 10872, 10974, 10972, 10970, 10968, 11070, 11068, + 11066, 11064, 11166, 11164, 11162, 11160, 11262, 11260, 11258, 11256, 11358, + 11356, 11354, 11352, 11454, 11452, 11450, 11448, 11550, 11548, 11546, 11544, + 11710, 11708, 11706, 11704, 11806, 11804, 11802, 11800, 11902, 11900, 11898, + 11896, 11998, 11996, 11994, 11992, 12094, 12092, 12090, 12088, 12190, 12188, + 12186, 12184, 12286, 12284, 12282, 12280, 12382, 12380, 12378, 12376, 12478, + 12476, 12474, 12472, 12574, 12572, 12570, 12568, 12670, 12668, 12666, 12664, + 12766, 12764, 12762, 12760, 12862, 12860, 12858, 12856, 12958, 12956, 12954, + 12952, 13054, 13052, 13050, 13048, 13150, 13148, 13146, 13144, 13246, 13244, + 13242, 13240, 13310, 13308, 13306, 13304, 13406, 13404, 13402, 13400, 13502, + 13500, 13498, 13496, 13598, 13596, 13594, 13592, 13694, 13692, 13690, 13688, + 13790, 13788, 13786, 13784, 13886, 13884, 13882, 13880, 13982, 13980, 13978, + 13976, 14078, 14076, 14074, 14072, 14174, 14172, 14170, 14168, 14270, 14268, + 14266, 14264, 14366, 14364, 14362, 14360, 14462, 14460, 14458, 14456, 14558, + 14556, 14554, 14552, 14654, 14652, 14650, 14648, 14750, 14748, 14746, 14744, + 14846, 14844, 14842, 14840, 14942, 14940, 14938, 14936, 15006, 15004, 15002, + 15000, 15102, 15100, 15098, 15096, 15198, 15196, 15194, 15192, 15294, 15292, + 15290, 15288, 15390, 15388, 15386, 15384, 15486, 15484, 15482, 15480, 15582, + 15580, 15578, 15576, 15678, 15676, 15674, 15672, 15774, 15772, 15770, 15768, + 15870, 15868, 15866, 15864, 15966, 15964, 15962, 15960, 16062, 16060, 16058, + 16056, 16158, 16156, 16154, 16152, 16254, 16252, 16250, 16248, 16350, 16348, + 16346, 16344, 16446, 16444, 16442, 16440, 16542, 16540, 16538, 16536, 16702, + 16700, 16698, 16696, 16798, 16796, 16794, 16792, 16894, 16892, 16890, 16888, + 16990, 16988, 16986, 16984, 17086, 17084, 17082, 17080, 17182, 17180, 17178, + 17176, 17278, 17276, 17274, 17272, 17374, 17372, 17370, 17368, 17470, 17468, + 17466, 17464, 17566, 17564, 17562, 17560, 17662, 17660, 17658, 17656, 17758, + 17756, 17754, 17752, 17854, 17852, 17850, 17848, 17950, 17948, 17946, 17944, + 18046, 18044, 18042, 18040, 18142, 18140, 18138, 18136, 18238, 18236, 18234, + 18232, 18302, 18300, 18298, 18296, 18398, 18396, 18394, 18392, 18494, 18492, + 18490, 18488, 18590, 18588, 18586, 18584, 18686, 18684, 18682, 18680, 18782, + 18780, 18778, 18776, 18878, 18876, 18874, 18872, 18974, 18972, 18970, 18968, + 19070, 19068, 19066, 19064, 19166, 19164, 19162, 19160, 19262, 19260, 19258, + 19256, 19358, 19356, 19354, 19352, 19454, 19452, 19450, 19448, 19550, 19548, + 19546, 19544, 19646, 19644, 19642, 19640, 19742, 19740, 19738, 19736, 19838, + 19836, 19834, 19832, + }, + /* 4 */ + { + 38, 36, 34, 32, 134, 132, 130, 128, 230, 228, 226, + 224, 326, 324, 322, 320, 422, 420, 418, 416, 518, 516, + 514, 512, 614, 612, 610, 608, 710, 708, 706, 704, 806, + 804, 802, 800, 902, 900, 898, 896, 998, 996, 994, 992, + 1094, 1092, 1090, 1088, 1190, 1188, 1186, 1184, 1286, 1284, 1282, + 1280, 1382, 1380, 1378, 1376, 1478, 1476, 1474, 1472, 1574, 1572, + 1570, 1568, 1670, 1668, 1666, 1664, 1734, 1732, 1730, 1728, 1830, + 1828, 1826, 1824, 1926, 1924, 1922, 1920, 2022, 2020, 2018, 2016, + 2118, 2116, 2114, 2112, 2214, 2212, 2210, 2208, 2310, 2308, 2306, + 2304, 2406, 2404, 2402, 2400, 2502, 2500, 2498, 2496, 2598, 2596, + 2594, 2592, 2694, 2692, 2690, 2688, 2790, 2788, 2786, 2784, 2886, + 2884, 2882, 2880, 2982, 2980, 2978, 2976, 3078, 3076, 3074, 3072, + 3174, 3172, 3170, 3168, 3270, 3268, 3266, 3264, 3430, 3428, 3426, + 3424, 3526, 3524, 3522, 3520, 3622, 3620, 3618, 3616, 3718, 3716, + 3714, 3712, 3814, 3812, 3810, 3808, 3910, 3908, 3906, 3904, 4006, + 4004, 4002, 4000, 4102, 4100, 4098, 4096, 4198, 4196, 4194, 4192, + 4294, 4292, 4290, 4288, 4390, 4388, 4386, 4384, 4486, 4484, 4482, + 4480, 4582, 4580, 4578, 4576, 4678, 4676, 4674, 4672, 4774, 4772, + 4770, 4768, 4870, 4868, 4866, 4864, 4966, 4964, 4962, 4960, 5030, + 5028, 5026, 5024, 5126, 5124, 5122, 5120, 5222, 5220, 5218, 5216, + 5318, 5316, 5314, 5312, 5414, 5412, 5410, 5408, 5510, 5508, 5506, + 5504, 5606, 5604, 5602, 5600, 5702, 5700, 5698, 5696, 5798, 5796, + 5794, 5792, 5894, 5892, 5890, 5888, 5990, 5988, 5986, 5984, 6086, + 6084, 6082, 6080, 6182, 6180, 6178, 6176, 6278, 6276, 6274, 6272, + 6374, 6372, 6370, 6368, 6470, 6468, 6466, 6464, 6566, 6564, 6562, + 6560, 6630, 6628, 6626, 6624, 6726, 6724, 6722, 6720, 6822, 6820, + 6818, 6816, 6918, 6916, 6914, 6912, 7014, 7012, 7010, 7008, 7110, + 7108, 7106, 7104, 7206, 7204, 7202, 7200, 7302, 7300, 7298, 7296, + 7398, 7396, 7394, 7392, 7494, 7492, 7490, 7488, 7590, 7588, 7586, + 7584, 7686, 7684, 7682, 7680, 7782, 7780, 7778, 7776, 7878, 7876, + 7874, 7872, 7974, 7972, 7970, 7968, 8070, 8068, 8066, 8064, 8166, + 8164, 8162, 8160, 8262, 8260, 8258, 8256, 8422, 8420, 8418, 8416, + 8518, 8516, 8514, 8512, 8614, 8612, 8610, 8608, 8710, 8708, 8706, + 8704, 8806, 8804, 8802, 8800, 8902, 8900, 8898, 8896, 8998, 8996, + 8994, 8992, 9094, 9092, 9090, 9088, 9190, 9188, 9186, 9184, 9286, + 9284, 9282, 9280, 9382, 9380, 9378, 9376, 9478, 9476, 9474, 9472, + 9574, 9572, 9570, 9568, 9670, 9668, 9666, 9664, 9766, 9764, 9762, + 9760, 9862, 9860, 9858, 9856, 9958, 9956, 9954, 9952, 10022, 10020, + 10018, 10016, 10118, 10116, 10114, 10112, 10214, 10212, 10210, 10208, 10310, + 10308, 10306, 10304, 10406, 10404, 10402, 10400, 10502, 10500, 10498, 10496, + 10598, 10596, 10594, 10592, 10694, 10692, 10690, 10688, 10790, 10788, 10786, + 10784, 10886, 10884, 10882, 10880, 10982, 10980, 10978, 10976, 11078, 11076, + 11074, 11072, 11174, 11172, 11170, 11168, 11270, 11268, 11266, 11264, 11366, + 11364, 11362, 11360, 11462, 11460, 11458, 11456, 11558, 11556, 11554, 11552, + 11622, 11620, 11618, 11616, 11718, 11716, 11714, 11712, 11814, 11812, 11810, + 11808, 11910, 11908, 11906, 11904, 12006, 12004, 12002, 12000, 12102, 12100, + 12098, 12096, 12198, 12196, 12194, 12192, 12294, 12292, 12290, 12288, 12390, + 12388, 12386, 12384, 12486, 12484, 12482, 12480, 12582, 12580, 12578, 12576, + 12678, 12676, 12674, 12672, 12774, 12772, 12770, 12768, 12870, 12868, 12866, + 12864, 12966, 12964, 12962, 12960, 13062, 13060, 13058, 13056, 13158, 13156, + 13154, 13152, 13318, 13316, 13314, 13312, 13414, 13412, 13410, 13408, 13510, + 13508, 13506, 13504, 13606, 13604, 13602, 13600, 13702, 13700, 13698, 13696, + 13798, 13796, 13794, 13792, 13894, 13892, 13890, 13888, 13990, 13988, 13986, + 13984, 14086, 14084, 14082, 14080, 14182, 14180, 14178, 14176, 14278, 14276, + 14274, 14272, 14374, 14372, 14370, 14368, 14470, 14468, 14466, 14464, 14566, + 14564, 14562, 14560, 14662, 14660, 14658, 14656, 14758, 14756, 14754, 14752, + 14854, 14852, 14850, 14848, 14950, 14948, 14946, 14944, 15014, 15012, 15010, + 15008, 15110, 15108, 15106, 15104, 15206, 15204, 15202, 15200, 15302, 15300, + 15298, 15296, 15398, 15396, 15394, 15392, 15494, 15492, 15490, 15488, 15590, + 15588, 15586, 15584, 15686, 15684, 15682, 15680, 15782, 15780, 15778, 15776, + 15878, 15876, 15874, 15872, 15974, 15972, 15970, 15968, 16070, 16068, 16066, + 16064, 16166, 16164, 16162, 16160, 16262, 16260, 16258, 16256, 16358, 16356, + 16354, 16352, 16454, 16452, 16450, 16448, 16550, 16548, 16546, 16544, 16614, + 16612, 16610, 16608, 16710, 16708, 16706, 16704, 16806, 16804, 16802, 16800, + 16902, 16900, 16898, 16896, 16998, 16996, 16994, 16992, 17094, 17092, 17090, + 17088, 17190, 17188, 17186, 17184, 17286, 17284, 17282, 17280, 17382, 17380, + 17378, 17376, 17478, 17476, 17474, 17472, 17574, 17572, 17570, 17568, 17670, + 17668, 17666, 17664, 17766, 17764, 17762, 17760, 17862, 17860, 17858, 17856, + 17958, 17956, 17954, 17952, 18054, 18052, 18050, 18048, 18150, 18148, 18146, + 18144, 18310, 18308, 18306, 18304, 18406, 18404, 18402, 18400, 18502, 18500, + 18498, 18496, 18598, 18596, 18594, 18592, 18694, 18692, 18690, 18688, 18790, + 18788, 18786, 18784, 18886, 18884, 18882, 18880, 18982, 18980, 18978, 18976, + 19078, 19076, 19074, 19072, 19174, 19172, 19170, 19168, 19270, 19268, 19266, + 19264, 19366, 19364, 19362, 19360, 19462, 19460, 19458, 19456, 19558, 19556, + 19554, 19552, 19654, 19652, 19650, 19648, 19750, 19748, 19746, 19744, 19846, + 19844, 19842, 19840, + }, + /* 5 */ + { + 46, 44, 42, 40, 142, 140, 138, 136, 238, 236, 234, + 232, 334, 332, 330, 328, 430, 428, 426, 424, 526, 524, + 522, 520, 622, 620, 618, 616, 718, 716, 714, 712, 814, + 812, 810, 808, 910, 908, 906, 904, 1006, 1004, 1002, 1000, + 1102, 1100, 1098, 1096, 1198, 1196, 1194, 1192, 1294, 1292, 1290, + 1288, 1390, 1388, 1386, 1384, 1486, 1484, 1482, 1480, 1582, 1580, + 1578, 1576, 1678, 1676, 1674, 1672, 1742, 1740, 1738, 1736, 1838, + 1836, 1834, 1832, 1934, 1932, 1930, 1928, 2030, 2028, 2026, 2024, + 2126, 2124, 2122, 2120, 2222, 2220, 2218, 2216, 2318, 2316, 2314, + 2312, 2414, 2412, 2410, 2408, 2510, 2508, 2506, 2504, 2606, 2604, + 2602, 2600, 2702, 2700, 2698, 2696, 2798, 2796, 2794, 2792, 2894, + 2892, 2890, 2888, 2990, 2988, 2986, 2984, 3086, 3084, 3082, 3080, + 3182, 3180, 3178, 3176, 3278, 3276, 3274, 3272, 3438, 3436, 3434, + 3432, 3534, 3532, 3530, 3528, 3630, 3628, 3626, 3624, 3726, 3724, + 3722, 3720, 3822, 3820, 3818, 3816, 3918, 3916, 3914, 3912, 4014, + 4012, 4010, 4008, 4110, 4108, 4106, 4104, 4206, 4204, 4202, 4200, + 4302, 4300, 4298, 4296, 4398, 4396, 4394, 4392, 4494, 4492, 4490, + 4488, 4590, 4588, 4586, 4584, 4686, 4684, 4682, 4680, 4782, 4780, + 4778, 4776, 4878, 4876, 4874, 4872, 4974, 4972, 4970, 4968, 5038, + 5036, 5034, 5032, 5134, 5132, 5130, 5128, 5230, 5228, 5226, 5224, + 5326, 5324, 5322, 5320, 5422, 5420, 5418, 5416, 5518, 5516, 5514, + 5512, 5614, 5612, 5610, 5608, 5710, 5708, 5706, 5704, 5806, 5804, + 5802, 5800, 5902, 5900, 5898, 5896, 5998, 5996, 5994, 5992, 6094, + 6092, 6090, 6088, 6190, 6188, 6186, 6184, 6286, 6284, 6282, 6280, + 6382, 6380, 6378, 6376, 6478, 6476, 6474, 6472, 6574, 6572, 6570, + 6568, 6638, 6636, 6634, 6632, 6734, 6732, 6730, 6728, 6830, 6828, + 6826, 6824, 6926, 6924, 6922, 6920, 7022, 7020, 7018, 7016, 7118, + 7116, 7114, 7112, 7214, 7212, 7210, 7208, 7310, 7308, 7306, 7304, + 7406, 7404, 7402, 7400, 7502, 7500, 7498, 7496, 7598, 7596, 7594, + 7592, 7694, 7692, 7690, 7688, 7790, 7788, 7786, 7784, 7886, 7884, + 7882, 7880, 7982, 7980, 7978, 7976, 8078, 8076, 8074, 8072, 8174, + 8172, 8170, 8168, 8270, 8268, 8266, 8264, 8430, 8428, 8426, 8424, + 8526, 8524, 8522, 8520, 8622, 8620, 8618, 8616, 8718, 8716, 8714, + 8712, 8814, 8812, 8810, 8808, 8910, 8908, 8906, 8904, 9006, 9004, + 9002, 9000, 9102, 9100, 9098, 9096, 9198, 9196, 9194, 9192, 9294, + 9292, 9290, 9288, 9390, 9388, 9386, 9384, 9486, 9484, 9482, 9480, + 9582, 9580, 9578, 9576, 9678, 9676, 9674, 9672, 9774, 9772, 9770, + 9768, 9870, 9868, 9866, 9864, 9966, 9964, 9962, 9960, 10030, 10028, + 10026, 10024, 10126, 10124, 10122, 10120, 10222, 10220, 10218, 10216, 10318, + 10316, 10314, 10312, 10414, 10412, 10410, 10408, 10510, 10508, 10506, 10504, + 10606, 10604, 10602, 10600, 10702, 10700, 10698, 10696, 10798, 10796, 10794, + 10792, 10894, 10892, 10890, 10888, 10990, 10988, 10986, 10984, 11086, 11084, + 11082, 11080, 11182, 11180, 11178, 11176, 11278, 11276, 11274, 11272, 11374, + 11372, 11370, 11368, 11470, 11468, 11466, 11464, 11566, 11564, 11562, 11560, + 11630, 11628, 11626, 11624, 11726, 11724, 11722, 11720, 11822, 11820, 11818, + 11816, 11918, 11916, 11914, 11912, 12014, 12012, 12010, 12008, 12110, 12108, + 12106, 12104, 12206, 12204, 12202, 12200, 12302, 12300, 12298, 12296, 12398, + 12396, 12394, 12392, 12494, 12492, 12490, 12488, 12590, 12588, 12586, 12584, + 12686, 12684, 12682, 12680, 12782, 12780, 12778, 12776, 12878, 12876, 12874, + 12872, 12974, 12972, 12970, 12968, 13070, 13068, 13066, 13064, 13166, 13164, + 13162, 13160, 13326, 13324, 13322, 13320, 13422, 13420, 13418, 13416, 13518, + 13516, 13514, 13512, 13614, 13612, 13610, 13608, 13710, 13708, 13706, 13704, + 13806, 13804, 13802, 13800, 13902, 13900, 13898, 13896, 13998, 13996, 13994, + 13992, 14094, 14092, 14090, 14088, 14190, 14188, 14186, 14184, 14286, 14284, + 14282, 14280, 14382, 14380, 14378, 14376, 14478, 14476, 14474, 14472, 14574, + 14572, 14570, 14568, 14670, 14668, 14666, 14664, 14766, 14764, 14762, 14760, + 14862, 14860, 14858, 14856, 14958, 14956, 14954, 14952, 15022, 15020, 15018, + 15016, 15118, 15116, 15114, 15112, 15214, 15212, 15210, 15208, 15310, 15308, + 15306, 15304, 15406, 15404, 15402, 15400, 15502, 15500, 15498, 15496, 15598, + 15596, 15594, 15592, 15694, 15692, 15690, 15688, 15790, 15788, 15786, 15784, + 15886, 15884, 15882, 15880, 15982, 15980, 15978, 15976, 16078, 16076, 16074, + 16072, 16174, 16172, 16170, 16168, 16270, 16268, 16266, 16264, 16366, 16364, + 16362, 16360, 16462, 16460, 16458, 16456, 16558, 16556, 16554, 16552, 16622, + 16620, 16618, 16616, 16718, 16716, 16714, 16712, 16814, 16812, 16810, 16808, + 16910, 16908, 16906, 16904, 17006, 17004, 17002, 17000, 17102, 17100, 17098, + 17096, 17198, 17196, 17194, 17192, 17294, 17292, 17290, 17288, 17390, 17388, + 17386, 17384, 17486, 17484, 17482, 17480, 17582, 17580, 17578, 17576, 17678, + 17676, 17674, 17672, 17774, 17772, 17770, 17768, 17870, 17868, 17866, 17864, + 17966, 17964, 17962, 17960, 18062, 18060, 18058, 18056, 18158, 18156, 18154, + 18152, 18318, 18316, 18314, 18312, 18414, 18412, 18410, 18408, 18510, 18508, + 18506, 18504, 18606, 18604, 18602, 18600, 18702, 18700, 18698, 18696, 18798, + 18796, 18794, 18792, 18894, 18892, 18890, 18888, 18990, 18988, 18986, 18984, + 19086, 19084, 19082, 19080, 19182, 19180, 19178, 19176, 19278, 19276, 19274, + 19272, 19374, 19372, 19370, 19368, 19470, 19468, 19466, 19464, 19566, 19564, + 19562, 19560, 19662, 19660, 19658, 19656, 19758, 19756, 19754, 19752, 19854, + 19852, 19850, 19848, + }, + /* 6 */ + { + 54, 52, 50, 48, 150, 148, 146, 144, 246, 244, 242, + 240, 342, 340, 338, 336, 438, 436, 434, 432, 534, 532, + 530, 528, 630, 628, 626, 624, 726, 724, 722, 720, 822, + 820, 818, 816, 918, 916, 914, 912, 1014, 1012, 1010, 1008, + 1110, 1108, 1106, 1104, 1206, 1204, 1202, 1200, 1302, 1300, 1298, + 1296, 1398, 1396, 1394, 1392, 1494, 1492, 1490, 1488, 1590, 1588, + 1586, 1584, 1686, 1684, 1682, 1680, 1750, 1748, 1746, 1744, 1846, + 1844, 1842, 1840, 1942, 1940, 1938, 1936, 2038, 2036, 2034, 2032, + 2134, 2132, 2130, 2128, 2230, 2228, 2226, 2224, 2326, 2324, 2322, + 2320, 2422, 2420, 2418, 2416, 2518, 2516, 2514, 2512, 2614, 2612, + 2610, 2608, 2710, 2708, 2706, 2704, 2806, 2804, 2802, 2800, 2902, + 2900, 2898, 2896, 2998, 2996, 2994, 2992, 3094, 3092, 3090, 3088, + 3190, 3188, 3186, 3184, 3286, 3284, 3282, 3280, 3446, 3444, 3442, + 3440, 3542, 3540, 3538, 3536, 3638, 3636, 3634, 3632, 3734, 3732, + 3730, 3728, 3830, 3828, 3826, 3824, 3926, 3924, 3922, 3920, 4022, + 4020, 4018, 4016, 4118, 4116, 4114, 4112, 4214, 4212, 4210, 4208, + 4310, 4308, 4306, 4304, 4406, 4404, 4402, 4400, 4502, 4500, 4498, + 4496, 4598, 4596, 4594, 4592, 4694, 4692, 4690, 4688, 4790, 4788, + 4786, 4784, 4886, 4884, 4882, 4880, 4982, 4980, 4978, 4976, 5046, + 5044, 5042, 5040, 5142, 5140, 5138, 5136, 5238, 5236, 5234, 5232, + 5334, 5332, 5330, 5328, 5430, 5428, 5426, 5424, 5526, 5524, 5522, + 5520, 5622, 5620, 5618, 5616, 5718, 5716, 5714, 5712, 5814, 5812, + 5810, 5808, 5910, 5908, 5906, 5904, 6006, 6004, 6002, 6000, 6102, + 6100, 6098, 6096, 6198, 6196, 6194, 6192, 6294, 6292, 6290, 6288, + 6390, 6388, 6386, 6384, 6486, 6484, 6482, 6480, 6582, 6580, 6578, + 6576, 6646, 6644, 6642, 6640, 6742, 6740, 6738, 6736, 6838, 6836, + 6834, 6832, 6934, 6932, 6930, 6928, 7030, 7028, 7026, 7024, 7126, + 7124, 7122, 7120, 7222, 7220, 7218, 7216, 7318, 7316, 7314, 7312, + 7414, 7412, 7410, 7408, 7510, 7508, 7506, 7504, 7606, 7604, 7602, + 7600, 7702, 7700, 7698, 7696, 7798, 7796, 7794, 7792, 7894, 7892, + 7890, 7888, 7990, 7988, 7986, 7984, 8086, 8084, 8082, 8080, 8182, + 8180, 8178, 8176, 8278, 8276, 8274, 8272, 8438, 8436, 8434, 8432, + 8534, 8532, 8530, 8528, 8630, 8628, 8626, 8624, 8726, 8724, 8722, + 8720, 8822, 8820, 8818, 8816, 8918, 8916, 8914, 8912, 9014, 9012, + 9010, 9008, 9110, 9108, 9106, 9104, 9206, 9204, 9202, 9200, 9302, + 9300, 9298, 9296, 9398, 9396, 9394, 9392, 9494, 9492, 9490, 9488, + 9590, 9588, 9586, 9584, 9686, 9684, 9682, 9680, 9782, 9780, 9778, + 9776, 9878, 9876, 9874, 9872, 9974, 9972, 9970, 9968, 10038, 10036, + 10034, 10032, 10134, 10132, 10130, 10128, 10230, 10228, 10226, 10224, 10326, + 10324, 10322, 10320, 10422, 10420, 10418, 10416, 10518, 10516, 10514, 10512, + 10614, 10612, 10610, 10608, 10710, 10708, 10706, 10704, 10806, 10804, 10802, + 10800, 10902, 10900, 10898, 10896, 10998, 10996, 10994, 10992, 11094, 11092, + 11090, 11088, 11190, 11188, 11186, 11184, 11286, 11284, 11282, 11280, 11382, + 11380, 11378, 11376, 11478, 11476, 11474, 11472, 11574, 11572, 11570, 11568, + 11638, 11636, 11634, 11632, 11734, 11732, 11730, 11728, 11830, 11828, 11826, + 11824, 11926, 11924, 11922, 11920, 12022, 12020, 12018, 12016, 12118, 12116, + 12114, 12112, 12214, 12212, 12210, 12208, 12310, 12308, 12306, 12304, 12406, + 12404, 12402, 12400, 12502, 12500, 12498, 12496, 12598, 12596, 12594, 12592, + 12694, 12692, 12690, 12688, 12790, 12788, 12786, 12784, 12886, 12884, 12882, + 12880, 12982, 12980, 12978, 12976, 13078, 13076, 13074, 13072, 13174, 13172, + 13170, 13168, 13334, 13332, 13330, 13328, 13430, 13428, 13426, 13424, 13526, + 13524, 13522, 13520, 13622, 13620, 13618, 13616, 13718, 13716, 13714, 13712, + 13814, 13812, 13810, 13808, 13910, 13908, 13906, 13904, 14006, 14004, 14002, + 14000, 14102, 14100, 14098, 14096, 14198, 14196, 14194, 14192, 14294, 14292, + 14290, 14288, 14390, 14388, 14386, 14384, 14486, 14484, 14482, 14480, 14582, + 14580, 14578, 14576, 14678, 14676, 14674, 14672, 14774, 14772, 14770, 14768, + 14870, 14868, 14866, 14864, 14966, 14964, 14962, 14960, 15030, 15028, 15026, + 15024, 15126, 15124, 15122, 15120, 15222, 15220, 15218, 15216, 15318, 15316, + 15314, 15312, 15414, 15412, 15410, 15408, 15510, 15508, 15506, 15504, 15606, + 15604, 15602, 15600, 15702, 15700, 15698, 15696, 15798, 15796, 15794, 15792, + 15894, 15892, 15890, 15888, 15990, 15988, 15986, 15984, 16086, 16084, 16082, + 16080, 16182, 16180, 16178, 16176, 16278, 16276, 16274, 16272, 16374, 16372, + 16370, 16368, 16470, 16468, 16466, 16464, 16566, 16564, 16562, 16560, 16630, + 16628, 16626, 16624, 16726, 16724, 16722, 16720, 16822, 16820, 16818, 16816, + 16918, 16916, 16914, 16912, 17014, 17012, 17010, 17008, 17110, 17108, 17106, + 17104, 17206, 17204, 17202, 17200, 17302, 17300, 17298, 17296, 17398, 17396, + 17394, 17392, 17494, 17492, 17490, 17488, 17590, 17588, 17586, 17584, 17686, + 17684, 17682, 17680, 17782, 17780, 17778, 17776, 17878, 17876, 17874, 17872, + 17974, 17972, 17970, 17968, 18070, 18068, 18066, 18064, 18166, 18164, 18162, + 18160, 18326, 18324, 18322, 18320, 18422, 18420, 18418, 18416, 18518, 18516, + 18514, 18512, 18614, 18612, 18610, 18608, 18710, 18708, 18706, 18704, 18806, + 18804, 18802, 18800, 18902, 18900, 18898, 18896, 18998, 18996, 18994, 18992, + 19094, 19092, 19090, 19088, 19190, 19188, 19186, 19184, 19286, 19284, 19282, + 19280, 19382, 19380, 19378, 19376, 19478, 19476, 19474, 19472, 19574, 19572, + 19570, 19568, 19670, 19668, 19666, 19664, 19766, 19764, 19762, 19760, 19862, + 19860, 19858, 19856, + }, + /* 7 */ + { + 62, 60, 58, 56, 158, 156, 154, 152, 254, 252, 250, + 248, 350, 348, 346, 344, 446, 444, 442, 440, 542, 540, + 538, 536, 638, 636, 634, 632, 734, 732, 730, 728, 830, + 828, 826, 824, 926, 924, 922, 920, 1022, 1020, 1018, 1016, + 1118, 1116, 1114, 1112, 1214, 1212, 1210, 1208, 1310, 1308, 1306, + 1304, 1406, 1404, 1402, 1400, 1502, 1500, 1498, 1496, 1598, 1596, + 1594, 1592, 1694, 1692, 1690, 1688, 1758, 1756, 1754, 1752, 1854, + 1852, 1850, 1848, 1950, 1948, 1946, 1944, 2046, 2044, 2042, 2040, + 2142, 2140, 2138, 2136, 2238, 2236, 2234, 2232, 2334, 2332, 2330, + 2328, 2430, 2428, 2426, 2424, 2526, 2524, 2522, 2520, 2622, 2620, + 2618, 2616, 2718, 2716, 2714, 2712, 2814, 2812, 2810, 2808, 2910, + 2908, 2906, 2904, 3006, 3004, 3002, 3000, 3102, 3100, 3098, 3096, + 3198, 3196, 3194, 3192, 3294, 3292, 3290, 3288, 3454, 3452, 3450, + 3448, 3550, 3548, 3546, 3544, 3646, 3644, 3642, 3640, 3742, 3740, + 3738, 3736, 3838, 3836, 3834, 3832, 3934, 3932, 3930, 3928, 4030, + 4028, 4026, 4024, 4126, 4124, 4122, 4120, 4222, 4220, 4218, 4216, + 4318, 4316, 4314, 4312, 4414, 4412, 4410, 4408, 4510, 4508, 4506, + 4504, 4606, 4604, 4602, 4600, 4702, 4700, 4698, 4696, 4798, 4796, + 4794, 4792, 4894, 4892, 4890, 4888, 4990, 4988, 4986, 4984, 5054, + 5052, 5050, 5048, 5150, 5148, 5146, 5144, 5246, 5244, 5242, 5240, + 5342, 5340, 5338, 5336, 5438, 5436, 5434, 5432, 5534, 5532, 5530, + 5528, 5630, 5628, 5626, 5624, 5726, 5724, 5722, 5720, 5822, 5820, + 5818, 5816, 5918, 5916, 5914, 5912, 6014, 6012, 6010, 6008, 6110, + 6108, 6106, 6104, 6206, 6204, 6202, 6200, 6302, 6300, 6298, 6296, + 6398, 6396, 6394, 6392, 6494, 6492, 6490, 6488, 6590, 6588, 6586, + 6584, 6654, 6652, 6650, 6648, 6750, 6748, 6746, 6744, 6846, 6844, + 6842, 6840, 6942, 6940, 6938, 6936, 7038, 7036, 7034, 7032, 7134, + 7132, 7130, 7128, 7230, 7228, 7226, 7224, 7326, 7324, 7322, 7320, + 7422, 7420, 7418, 7416, 7518, 7516, 7514, 7512, 7614, 7612, 7610, + 7608, 7710, 7708, 7706, 7704, 7806, 7804, 7802, 7800, 7902, 7900, + 7898, 7896, 7998, 7996, 7994, 7992, 8094, 8092, 8090, 8088, 8190, + 8188, 8186, 8184, 8286, 8284, 8282, 8280, 8446, 8444, 8442, 8440, + 8542, 8540, 8538, 8536, 8638, 8636, 8634, 8632, 8734, 8732, 8730, + 8728, 8830, 8828, 8826, 8824, 8926, 8924, 8922, 8920, 9022, 9020, + 9018, 9016, 9118, 9116, 9114, 9112, 9214, 9212, 9210, 9208, 9310, + 9308, 9306, 9304, 9406, 9404, 9402, 9400, 9502, 9500, 9498, 9496, + 9598, 9596, 9594, 9592, 9694, 9692, 9690, 9688, 9790, 9788, 9786, + 9784, 9886, 9884, 9882, 9880, 9982, 9980, 9978, 9976, 10046, 10044, + 10042, 10040, 10142, 10140, 10138, 10136, 10238, 10236, 10234, 10232, 10334, + 10332, 10330, 10328, 10430, 10428, 10426, 10424, 10526, 10524, 10522, 10520, + 10622, 10620, 10618, 10616, 10718, 10716, 10714, 10712, 10814, 10812, 10810, + 10808, 10910, 10908, 10906, 10904, 11006, 11004, 11002, 11000, 11102, 11100, + 11098, 11096, 11198, 11196, 11194, 11192, 11294, 11292, 11290, 11288, 11390, + 11388, 11386, 11384, 11486, 11484, 11482, 11480, 11582, 11580, 11578, 11576, + 11646, 11644, 11642, 11640, 11742, 11740, 11738, 11736, 11838, 11836, 11834, + 11832, 11934, 11932, 11930, 11928, 12030, 12028, 12026, 12024, 12126, 12124, + 12122, 12120, 12222, 12220, 12218, 12216, 12318, 12316, 12314, 12312, 12414, + 12412, 12410, 12408, 12510, 12508, 12506, 12504, 12606, 12604, 12602, 12600, + 12702, 12700, 12698, 12696, 12798, 12796, 12794, 12792, 12894, 12892, 12890, + 12888, 12990, 12988, 12986, 12984, 13086, 13084, 13082, 13080, 13182, 13180, + 13178, 13176, 13342, 13340, 13338, 13336, 13438, 13436, 13434, 13432, 13534, + 13532, 13530, 13528, 13630, 13628, 13626, 13624, 13726, 13724, 13722, 13720, + 13822, 13820, 13818, 13816, 13918, 13916, 13914, 13912, 14014, 14012, 14010, + 14008, 14110, 14108, 14106, 14104, 14206, 14204, 14202, 14200, 14302, 14300, + 14298, 14296, 14398, 14396, 14394, 14392, 14494, 14492, 14490, 14488, 14590, + 14588, 14586, 14584, 14686, 14684, 14682, 14680, 14782, 14780, 14778, 14776, + 14878, 14876, 14874, 14872, 14974, 14972, 14970, 14968, 15038, 15036, 15034, + 15032, 15134, 15132, 15130, 15128, 15230, 15228, 15226, 15224, 15326, 15324, + 15322, 15320, 15422, 15420, 15418, 15416, 15518, 15516, 15514, 15512, 15614, + 15612, 15610, 15608, 15710, 15708, 15706, 15704, 15806, 15804, 15802, 15800, + 15902, 15900, 15898, 15896, 15998, 15996, 15994, 15992, 16094, 16092, 16090, + 16088, 16190, 16188, 16186, 16184, 16286, 16284, 16282, 16280, 16382, 16380, + 16378, 16376, 16478, 16476, 16474, 16472, 16574, 16572, 16570, 16568, 16638, + 16636, 16634, 16632, 16734, 16732, 16730, 16728, 16830, 16828, 16826, 16824, + 16926, 16924, 16922, 16920, 17022, 17020, 17018, 17016, 17118, 17116, 17114, + 17112, 17214, 17212, 17210, 17208, 17310, 17308, 17306, 17304, 17406, 17404, + 17402, 17400, 17502, 17500, 17498, 17496, 17598, 17596, 17594, 17592, 17694, + 17692, 17690, 17688, 17790, 17788, 17786, 17784, 17886, 17884, 17882, 17880, + 17982, 17980, 17978, 17976, 18078, 18076, 18074, 18072, 18174, 18172, 18170, + 18168, 18334, 18332, 18330, 18328, 18430, 18428, 18426, 18424, 18526, 18524, + 18522, 18520, 18622, 18620, 18618, 18616, 18718, 18716, 18714, 18712, 18814, + 18812, 18810, 18808, 18910, 18908, 18906, 18904, 19006, 19004, 19002, 19000, + 19102, 19100, 19098, 19096, 19198, 19196, 19194, 19192, 19294, 19292, 19290, + 19288, 19390, 19388, 19386, 19384, 19486, 19484, 19482, 19480, 19582, 19580, + 19578, 19576, 19678, 19676, 19674, 19672, 19774, 19772, 19770, 19768, 19870, + 19868, 19866, 19864, + }, + /* 8 */ + { + 70, 68, 66, 64, 166, 164, 162, 160, 262, 260, 258, + 256, 358, 356, 354, 352, 454, 452, 450, 448, 550, 548, + 546, 544, 646, 644, 642, 640, 742, 740, 738, 736, 838, + 836, 834, 832, 934, 932, 930, 928, 1030, 1028, 1026, 1024, + 1126, 1124, 1122, 1120, 1222, 1220, 1218, 1216, 1318, 1316, 1314, + 1312, 1414, 1412, 1410, 1408, 1510, 1508, 1506, 1504, 1606, 1604, + 1602, 1600, 1702, 1700, 1698, 1696, 1766, 1764, 1762, 1760, 1862, + 1860, 1858, 1856, 1958, 1956, 1954, 1952, 2054, 2052, 2050, 2048, + 2150, 2148, 2146, 2144, 2246, 2244, 2242, 2240, 2342, 2340, 2338, + 2336, 2438, 2436, 2434, 2432, 2534, 2532, 2530, 2528, 2630, 2628, + 2626, 2624, 2726, 2724, 2722, 2720, 2822, 2820, 2818, 2816, 2918, + 2916, 2914, 2912, 3014, 3012, 3010, 3008, 3110, 3108, 3106, 3104, + 3206, 3204, 3202, 3200, 3302, 3300, 3298, 3296, 3366, 3364, 3362, + 3360, 3462, 3460, 3458, 3456, 3558, 3556, 3554, 3552, 3654, 3652, + 3650, 3648, 3750, 3748, 3746, 3744, 3846, 3844, 3842, 3840, 3942, + 3940, 3938, 3936, 4038, 4036, 4034, 4032, 4134, 4132, 4130, 4128, + 4230, 4228, 4226, 4224, 4326, 4324, 4322, 4320, 4422, 4420, 4418, + 4416, 4518, 4516, 4514, 4512, 4614, 4612, 4610, 4608, 4710, 4708, + 4706, 4704, 4806, 4804, 4802, 4800, 4902, 4900, 4898, 4896, 5062, + 5060, 5058, 5056, 5158, 5156, 5154, 5152, 5254, 5252, 5250, 5248, + 5350, 5348, 5346, 5344, 5446, 5444, 5442, 5440, 5542, 5540, 5538, + 5536, 5638, 5636, 5634, 5632, 5734, 5732, 5730, 5728, 5830, 5828, + 5826, 5824, 5926, 5924, 5922, 5920, 6022, 6020, 6018, 6016, 6118, + 6116, 6114, 6112, 6214, 6212, 6210, 6208, 6310, 6308, 6306, 6304, + 6406, 6404, 6402, 6400, 6502, 6500, 6498, 6496, 6598, 6596, 6594, + 6592, 6662, 6660, 6658, 6656, 6758, 6756, 6754, 6752, 6854, 6852, + 6850, 6848, 6950, 6948, 6946, 6944, 7046, 7044, 7042, 7040, 7142, + 7140, 7138, 7136, 7238, 7236, 7234, 7232, 7334, 7332, 7330, 7328, + 7430, 7428, 7426, 7424, 7526, 7524, 7522, 7520, 7622, 7620, 7618, + 7616, 7718, 7716, 7714, 7712, 7814, 7812, 7810, 7808, 7910, 7908, + 7906, 7904, 8006, 8004, 8002, 8000, 8102, 8100, 8098, 8096, 8198, + 8196, 8194, 8192, 8294, 8292, 8290, 8288, 8358, 8356, 8354, 8352, + 8454, 8452, 8450, 8448, 8550, 8548, 8546, 8544, 8646, 8644, 8642, + 8640, 8742, 8740, 8738, 8736, 8838, 8836, 8834, 8832, 8934, 8932, + 8930, 8928, 9030, 9028, 9026, 9024, 9126, 9124, 9122, 9120, 9222, + 9220, 9218, 9216, 9318, 9316, 9314, 9312, 9414, 9412, 9410, 9408, + 9510, 9508, 9506, 9504, 9606, 9604, 9602, 9600, 9702, 9700, 9698, + 9696, 9798, 9796, 9794, 9792, 9894, 9892, 9890, 9888, 10054, 10052, + 10050, 10048, 10150, 10148, 10146, 10144, 10246, 10244, 10242, 10240, 10342, + 10340, 10338, 10336, 10438, 10436, 10434, 10432, 10534, 10532, 10530, 10528, + 10630, 10628, 10626, 10624, 10726, 10724, 10722, 10720, 10822, 10820, 10818, + 10816, 10918, 10916, 10914, 10912, 11014, 11012, 11010, 11008, 11110, 11108, + 11106, 11104, 11206, 11204, 11202, 11200, 11302, 11300, 11298, 11296, 11398, + 11396, 11394, 11392, 11494, 11492, 11490, 11488, 11590, 11588, 11586, 11584, + 11654, 11652, 11650, 11648, 11750, 11748, 11746, 11744, 11846, 11844, 11842, + 11840, 11942, 11940, 11938, 11936, 12038, 12036, 12034, 12032, 12134, 12132, + 12130, 12128, 12230, 12228, 12226, 12224, 12326, 12324, 12322, 12320, 12422, + 12420, 12418, 12416, 12518, 12516, 12514, 12512, 12614, 12612, 12610, 12608, + 12710, 12708, 12706, 12704, 12806, 12804, 12802, 12800, 12902, 12900, 12898, + 12896, 12998, 12996, 12994, 12992, 13094, 13092, 13090, 13088, 13190, 13188, + 13186, 13184, 13254, 13252, 13250, 13248, 13350, 13348, 13346, 13344, 13446, + 13444, 13442, 13440, 13542, 13540, 13538, 13536, 13638, 13636, 13634, 13632, + 13734, 13732, 13730, 13728, 13830, 13828, 13826, 13824, 13926, 13924, 13922, + 13920, 14022, 14020, 14018, 14016, 14118, 14116, 14114, 14112, 14214, 14212, + 14210, 14208, 14310, 14308, 14306, 14304, 14406, 14404, 14402, 14400, 14502, + 14500, 14498, 14496, 14598, 14596, 14594, 14592, 14694, 14692, 14690, 14688, + 14790, 14788, 14786, 14784, 14886, 14884, 14882, 14880, 15046, 15044, 15042, + 15040, 15142, 15140, 15138, 15136, 15238, 15236, 15234, 15232, 15334, 15332, + 15330, 15328, 15430, 15428, 15426, 15424, 15526, 15524, 15522, 15520, 15622, + 15620, 15618, 15616, 15718, 15716, 15714, 15712, 15814, 15812, 15810, 15808, + 15910, 15908, 15906, 15904, 16006, 16004, 16002, 16000, 16102, 16100, 16098, + 16096, 16198, 16196, 16194, 16192, 16294, 16292, 16290, 16288, 16390, 16388, + 16386, 16384, 16486, 16484, 16482, 16480, 16582, 16580, 16578, 16576, 16646, + 16644, 16642, 16640, 16742, 16740, 16738, 16736, 16838, 16836, 16834, 16832, + 16934, 16932, 16930, 16928, 17030, 17028, 17026, 17024, 17126, 17124, 17122, + 17120, 17222, 17220, 17218, 17216, 17318, 17316, 17314, 17312, 17414, 17412, + 17410, 17408, 17510, 17508, 17506, 17504, 17606, 17604, 17602, 17600, 17702, + 17700, 17698, 17696, 17798, 17796, 17794, 17792, 17894, 17892, 17890, 17888, + 17990, 17988, 17986, 17984, 18086, 18084, 18082, 18080, 18182, 18180, 18178, + 18176, 18246, 18244, 18242, 18240, 18342, 18340, 18338, 18336, 18438, 18436, + 18434, 18432, 18534, 18532, 18530, 18528, 18630, 18628, 18626, 18624, 18726, + 18724, 18722, 18720, 18822, 18820, 18818, 18816, 18918, 18916, 18914, 18912, + 19014, 19012, 19010, 19008, 19110, 19108, 19106, 19104, 19206, 19204, 19202, + 19200, 19302, 19300, 19298, 19296, 19398, 19396, 19394, 19392, 19494, 19492, + 19490, 19488, 19590, 19588, 19586, 19584, 19686, 19684, 19682, 19680, 19782, + 19780, 19778, 19776, + }, + /* 9 */ + { + 78, 76, 74, 72, 174, 172, 170, 168, 270, 268, 266, + 264, 366, 364, 362, 360, 462, 460, 458, 456, 558, 556, + 554, 552, 654, 652, 650, 648, 750, 748, 746, 744, 846, + 844, 842, 840, 942, 940, 938, 936, 1038, 1036, 1034, 1032, + 1134, 1132, 1130, 1128, 1230, 1228, 1226, 1224, 1326, 1324, 1322, + 1320, 1422, 1420, 1418, 1416, 1518, 1516, 1514, 1512, 1614, 1612, + 1610, 1608, 1710, 1708, 1706, 1704, 1774, 1772, 1770, 1768, 1870, + 1868, 1866, 1864, 1966, 1964, 1962, 1960, 2062, 2060, 2058, 2056, + 2158, 2156, 2154, 2152, 2254, 2252, 2250, 2248, 2350, 2348, 2346, + 2344, 2446, 2444, 2442, 2440, 2542, 2540, 2538, 2536, 2638, 2636, + 2634, 2632, 2734, 2732, 2730, 2728, 2830, 2828, 2826, 2824, 2926, + 2924, 2922, 2920, 3022, 3020, 3018, 3016, 3118, 3116, 3114, 3112, + 3214, 3212, 3210, 3208, 3310, 3308, 3306, 3304, 3374, 3372, 3370, + 3368, 3470, 3468, 3466, 3464, 3566, 3564, 3562, 3560, 3662, 3660, + 3658, 3656, 3758, 3756, 3754, 3752, 3854, 3852, 3850, 3848, 3950, + 3948, 3946, 3944, 4046, 4044, 4042, 4040, 4142, 4140, 4138, 4136, + 4238, 4236, 4234, 4232, 4334, 4332, 4330, 4328, 4430, 4428, 4426, + 4424, 4526, 4524, 4522, 4520, 4622, 4620, 4618, 4616, 4718, 4716, + 4714, 4712, 4814, 4812, 4810, 4808, 4910, 4908, 4906, 4904, 5070, + 5068, 5066, 5064, 5166, 5164, 5162, 5160, 5262, 5260, 5258, 5256, + 5358, 5356, 5354, 5352, 5454, 5452, 5450, 5448, 5550, 5548, 5546, + 5544, 5646, 5644, 5642, 5640, 5742, 5740, 5738, 5736, 5838, 5836, + 5834, 5832, 5934, 5932, 5930, 5928, 6030, 6028, 6026, 6024, 6126, + 6124, 6122, 6120, 6222, 6220, 6218, 6216, 6318, 6316, 6314, 6312, + 6414, 6412, 6410, 6408, 6510, 6508, 6506, 6504, 6606, 6604, 6602, + 6600, 6670, 6668, 6666, 6664, 6766, 6764, 6762, 6760, 6862, 6860, + 6858, 6856, 6958, 6956, 6954, 6952, 7054, 7052, 7050, 7048, 7150, + 7148, 7146, 7144, 7246, 7244, 7242, 7240, 7342, 7340, 7338, 7336, + 7438, 7436, 7434, 7432, 7534, 7532, 7530, 7528, 7630, 7628, 7626, + 7624, 7726, 7724, 7722, 7720, 7822, 7820, 7818, 7816, 7918, 7916, + 7914, 7912, 8014, 8012, 8010, 8008, 8110, 8108, 8106, 8104, 8206, + 8204, 8202, 8200, 8302, 8300, 8298, 8296, 8366, 8364, 8362, 8360, + 8462, 8460, 8458, 8456, 8558, 8556, 8554, 8552, 8654, 8652, 8650, + 8648, 8750, 8748, 8746, 8744, 8846, 8844, 8842, 8840, 8942, 8940, + 8938, 8936, 9038, 9036, 9034, 9032, 9134, 9132, 9130, 9128, 9230, + 9228, 9226, 9224, 9326, 9324, 9322, 9320, 9422, 9420, 9418, 9416, + 9518, 9516, 9514, 9512, 9614, 9612, 9610, 9608, 9710, 9708, 9706, + 9704, 9806, 9804, 9802, 9800, 9902, 9900, 9898, 9896, 10062, 10060, + 10058, 10056, 10158, 10156, 10154, 10152, 10254, 10252, 10250, 10248, 10350, + 10348, 10346, 10344, 10446, 10444, 10442, 10440, 10542, 10540, 10538, 10536, + 10638, 10636, 10634, 10632, 10734, 10732, 10730, 10728, 10830, 10828, 10826, + 10824, 10926, 10924, 10922, 10920, 11022, 11020, 11018, 11016, 11118, 11116, + 11114, 11112, 11214, 11212, 11210, 11208, 11310, 11308, 11306, 11304, 11406, + 11404, 11402, 11400, 11502, 11500, 11498, 11496, 11598, 11596, 11594, 11592, + 11662, 11660, 11658, 11656, 11758, 11756, 11754, 11752, 11854, 11852, 11850, + 11848, 11950, 11948, 11946, 11944, 12046, 12044, 12042, 12040, 12142, 12140, + 12138, 12136, 12238, 12236, 12234, 12232, 12334, 12332, 12330, 12328, 12430, + 12428, 12426, 12424, 12526, 12524, 12522, 12520, 12622, 12620, 12618, 12616, + 12718, 12716, 12714, 12712, 12814, 12812, 12810, 12808, 12910, 12908, 12906, + 12904, 13006, 13004, 13002, 13000, 13102, 13100, 13098, 13096, 13198, 13196, + 13194, 13192, 13262, 13260, 13258, 13256, 13358, 13356, 13354, 13352, 13454, + 13452, 13450, 13448, 13550, 13548, 13546, 13544, 13646, 13644, 13642, 13640, + 13742, 13740, 13738, 13736, 13838, 13836, 13834, 13832, 13934, 13932, 13930, + 13928, 14030, 14028, 14026, 14024, 14126, 14124, 14122, 14120, 14222, 14220, + 14218, 14216, 14318, 14316, 14314, 14312, 14414, 14412, 14410, 14408, 14510, + 14508, 14506, 14504, 14606, 14604, 14602, 14600, 14702, 14700, 14698, 14696, + 14798, 14796, 14794, 14792, 14894, 14892, 14890, 14888, 15054, 15052, 15050, + 15048, 15150, 15148, 15146, 15144, 15246, 15244, 15242, 15240, 15342, 15340, + 15338, 15336, 15438, 15436, 15434, 15432, 15534, 15532, 15530, 15528, 15630, + 15628, 15626, 15624, 15726, 15724, 15722, 15720, 15822, 15820, 15818, 15816, + 15918, 15916, 15914, 15912, 16014, 16012, 16010, 16008, 16110, 16108, 16106, + 16104, 16206, 16204, 16202, 16200, 16302, 16300, 16298, 16296, 16398, 16396, + 16394, 16392, 16494, 16492, 16490, 16488, 16590, 16588, 16586, 16584, 16654, + 16652, 16650, 16648, 16750, 16748, 16746, 16744, 16846, 16844, 16842, 16840, + 16942, 16940, 16938, 16936, 17038, 17036, 17034, 17032, 17134, 17132, 17130, + 17128, 17230, 17228, 17226, 17224, 17326, 17324, 17322, 17320, 17422, 17420, + 17418, 17416, 17518, 17516, 17514, 17512, 17614, 17612, 17610, 17608, 17710, + 17708, 17706, 17704, 17806, 17804, 17802, 17800, 17902, 17900, 17898, 17896, + 17998, 17996, 17994, 17992, 18094, 18092, 18090, 18088, 18190, 18188, 18186, + 18184, 18254, 18252, 18250, 18248, 18350, 18348, 18346, 18344, 18446, 18444, + 18442, 18440, 18542, 18540, 18538, 18536, 18638, 18636, 18634, 18632, 18734, + 18732, 18730, 18728, 18830, 18828, 18826, 18824, 18926, 18924, 18922, 18920, + 19022, 19020, 19018, 19016, 19118, 19116, 19114, 19112, 19214, 19212, 19210, + 19208, 19310, 19308, 19306, 19304, 19406, 19404, 19402, 19400, 19502, 19500, + 19498, 19496, 19598, 19596, 19594, 19592, 19694, 19692, 19690, 19688, 19790, + 19788, 19786, 19784, + }, + /* 10 */ + { + 86, 84, 82, 80, 182, 180, 178, 176, 278, 276, 274, + 272, 374, 372, 370, 368, 470, 468, 466, 464, 566, 564, + 562, 560, 662, 660, 658, 656, 758, 756, 754, 752, 854, + 852, 850, 848, 950, 948, 946, 944, 1046, 1044, 1042, 1040, + 1142, 1140, 1138, 1136, 1238, 1236, 1234, 1232, 1334, 1332, 1330, + 1328, 1430, 1428, 1426, 1424, 1526, 1524, 1522, 1520, 1622, 1620, + 1618, 1616, 1718, 1716, 1714, 1712, 1782, 1780, 1778, 1776, 1878, + 1876, 1874, 1872, 1974, 1972, 1970, 1968, 2070, 2068, 2066, 2064, + 2166, 2164, 2162, 2160, 2262, 2260, 2258, 2256, 2358, 2356, 2354, + 2352, 2454, 2452, 2450, 2448, 2550, 2548, 2546, 2544, 2646, 2644, + 2642, 2640, 2742, 2740, 2738, 2736, 2838, 2836, 2834, 2832, 2934, + 2932, 2930, 2928, 3030, 3028, 3026, 3024, 3126, 3124, 3122, 3120, + 3222, 3220, 3218, 3216, 3318, 3316, 3314, 3312, 3382, 3380, 3378, + 3376, 3478, 3476, 3474, 3472, 3574, 3572, 3570, 3568, 3670, 3668, + 3666, 3664, 3766, 3764, 3762, 3760, 3862, 3860, 3858, 3856, 3958, + 3956, 3954, 3952, 4054, 4052, 4050, 4048, 4150, 4148, 4146, 4144, + 4246, 4244, 4242, 4240, 4342, 4340, 4338, 4336, 4438, 4436, 4434, + 4432, 4534, 4532, 4530, 4528, 4630, 4628, 4626, 4624, 4726, 4724, + 4722, 4720, 4822, 4820, 4818, 4816, 4918, 4916, 4914, 4912, 5078, + 5076, 5074, 5072, 5174, 5172, 5170, 5168, 5270, 5268, 5266, 5264, + 5366, 5364, 5362, 5360, 5462, 5460, 5458, 5456, 5558, 5556, 5554, + 5552, 5654, 5652, 5650, 5648, 5750, 5748, 5746, 5744, 5846, 5844, + 5842, 5840, 5942, 5940, 5938, 5936, 6038, 6036, 6034, 6032, 6134, + 6132, 6130, 6128, 6230, 6228, 6226, 6224, 6326, 6324, 6322, 6320, + 6422, 6420, 6418, 6416, 6518, 6516, 6514, 6512, 6614, 6612, 6610, + 6608, 6678, 6676, 6674, 6672, 6774, 6772, 6770, 6768, 6870, 6868, + 6866, 6864, 6966, 6964, 6962, 6960, 7062, 7060, 7058, 7056, 7158, + 7156, 7154, 7152, 7254, 7252, 7250, 7248, 7350, 7348, 7346, 7344, + 7446, 7444, 7442, 7440, 7542, 7540, 7538, 7536, 7638, 7636, 7634, + 7632, 7734, 7732, 7730, 7728, 7830, 7828, 7826, 7824, 7926, 7924, + 7922, 7920, 8022, 8020, 8018, 8016, 8118, 8116, 8114, 8112, 8214, + 8212, 8210, 8208, 8310, 8308, 8306, 8304, 8374, 8372, 8370, 8368, + 8470, 8468, 8466, 8464, 8566, 8564, 8562, 8560, 8662, 8660, 8658, + 8656, 8758, 8756, 8754, 8752, 8854, 8852, 8850, 8848, 8950, 8948, + 8946, 8944, 9046, 9044, 9042, 9040, 9142, 9140, 9138, 9136, 9238, + 9236, 9234, 9232, 9334, 9332, 9330, 9328, 9430, 9428, 9426, 9424, + 9526, 9524, 9522, 9520, 9622, 9620, 9618, 9616, 9718, 9716, 9714, + 9712, 9814, 9812, 9810, 9808, 9910, 9908, 9906, 9904, 10070, 10068, + 10066, 10064, 10166, 10164, 10162, 10160, 10262, 10260, 10258, 10256, 10358, + 10356, 10354, 10352, 10454, 10452, 10450, 10448, 10550, 10548, 10546, 10544, + 10646, 10644, 10642, 10640, 10742, 10740, 10738, 10736, 10838, 10836, 10834, + 10832, 10934, 10932, 10930, 10928, 11030, 11028, 11026, 11024, 11126, 11124, + 11122, 11120, 11222, 11220, 11218, 11216, 11318, 11316, 11314, 11312, 11414, + 11412, 11410, 11408, 11510, 11508, 11506, 11504, 11606, 11604, 11602, 11600, + 11670, 11668, 11666, 11664, 11766, 11764, 11762, 11760, 11862, 11860, 11858, + 11856, 11958, 11956, 11954, 11952, 12054, 12052, 12050, 12048, 12150, 12148, + 12146, 12144, 12246, 12244, 12242, 12240, 12342, 12340, 12338, 12336, 12438, + 12436, 12434, 12432, 12534, 12532, 12530, 12528, 12630, 12628, 12626, 12624, + 12726, 12724, 12722, 12720, 12822, 12820, 12818, 12816, 12918, 12916, 12914, + 12912, 13014, 13012, 13010, 13008, 13110, 13108, 13106, 13104, 13206, 13204, + 13202, 13200, 13270, 13268, 13266, 13264, 13366, 13364, 13362, 13360, 13462, + 13460, 13458, 13456, 13558, 13556, 13554, 13552, 13654, 13652, 13650, 13648, + 13750, 13748, 13746, 13744, 13846, 13844, 13842, 13840, 13942, 13940, 13938, + 13936, 14038, 14036, 14034, 14032, 14134, 14132, 14130, 14128, 14230, 14228, + 14226, 14224, 14326, 14324, 14322, 14320, 14422, 14420, 14418, 14416, 14518, + 14516, 14514, 14512, 14614, 14612, 14610, 14608, 14710, 14708, 14706, 14704, + 14806, 14804, 14802, 14800, 14902, 14900, 14898, 14896, 15062, 15060, 15058, + 15056, 15158, 15156, 15154, 15152, 15254, 15252, 15250, 15248, 15350, 15348, + 15346, 15344, 15446, 15444, 15442, 15440, 15542, 15540, 15538, 15536, 15638, + 15636, 15634, 15632, 15734, 15732, 15730, 15728, 15830, 15828, 15826, 15824, + 15926, 15924, 15922, 15920, 16022, 16020, 16018, 16016, 16118, 16116, 16114, + 16112, 16214, 16212, 16210, 16208, 16310, 16308, 16306, 16304, 16406, 16404, + 16402, 16400, 16502, 16500, 16498, 16496, 16598, 16596, 16594, 16592, 16662, + 16660, 16658, 16656, 16758, 16756, 16754, 16752, 16854, 16852, 16850, 16848, + 16950, 16948, 16946, 16944, 17046, 17044, 17042, 17040, 17142, 17140, 17138, + 17136, 17238, 17236, 17234, 17232, 17334, 17332, 17330, 17328, 17430, 17428, + 17426, 17424, 17526, 17524, 17522, 17520, 17622, 17620, 17618, 17616, 17718, + 17716, 17714, 17712, 17814, 17812, 17810, 17808, 17910, 17908, 17906, 17904, + 18006, 18004, 18002, 18000, 18102, 18100, 18098, 18096, 18198, 18196, 18194, + 18192, 18262, 18260, 18258, 18256, 18358, 18356, 18354, 18352, 18454, 18452, + 18450, 18448, 18550, 18548, 18546, 18544, 18646, 18644, 18642, 18640, 18742, + 18740, 18738, 18736, 18838, 18836, 18834, 18832, 18934, 18932, 18930, 18928, + 19030, 19028, 19026, 19024, 19126, 19124, 19122, 19120, 19222, 19220, 19218, + 19216, 19318, 19316, 19314, 19312, 19414, 19412, 19410, 19408, 19510, 19508, + 19506, 19504, 19606, 19604, 19602, 19600, 19702, 19700, 19698, 19696, 19798, + 19796, 19794, 19792, + }, + /* 11 */ + { + 94, 92, 90, 88, 190, 188, 186, 184, 286, 284, 282, + 280, 382, 380, 378, 376, 478, 476, 474, 472, 574, 572, + 570, 568, 670, 668, 666, 664, 766, 764, 762, 760, 862, + 860, 858, 856, 958, 956, 954, 952, 1054, 1052, 1050, 1048, + 1150, 1148, 1146, 1144, 1246, 1244, 1242, 1240, 1342, 1340, 1338, + 1336, 1438, 1436, 1434, 1432, 1534, 1532, 1530, 1528, 1630, 1628, + 1626, 1624, 1726, 1724, 1722, 1720, 1790, 1788, 1786, 1784, 1886, + 1884, 1882, 1880, 1982, 1980, 1978, 1976, 2078, 2076, 2074, 2072, + 2174, 2172, 2170, 2168, 2270, 2268, 2266, 2264, 2366, 2364, 2362, + 2360, 2462, 2460, 2458, 2456, 2558, 2556, 2554, 2552, 2654, 2652, + 2650, 2648, 2750, 2748, 2746, 2744, 2846, 2844, 2842, 2840, 2942, + 2940, 2938, 2936, 3038, 3036, 3034, 3032, 3134, 3132, 3130, 3128, + 3230, 3228, 3226, 3224, 3326, 3324, 3322, 3320, 3390, 3388, 3386, + 3384, 3486, 3484, 3482, 3480, 3582, 3580, 3578, 3576, 3678, 3676, + 3674, 3672, 3774, 3772, 3770, 3768, 3870, 3868, 3866, 3864, 3966, + 3964, 3962, 3960, 4062, 4060, 4058, 4056, 4158, 4156, 4154, 4152, + 4254, 4252, 4250, 4248, 4350, 4348, 4346, 4344, 4446, 4444, 4442, + 4440, 4542, 4540, 4538, 4536, 4638, 4636, 4634, 4632, 4734, 4732, + 4730, 4728, 4830, 4828, 4826, 4824, 4926, 4924, 4922, 4920, 5086, + 5084, 5082, 5080, 5182, 5180, 5178, 5176, 5278, 5276, 5274, 5272, + 5374, 5372, 5370, 5368, 5470, 5468, 5466, 5464, 5566, 5564, 5562, + 5560, 5662, 5660, 5658, 5656, 5758, 5756, 5754, 5752, 5854, 5852, + 5850, 5848, 5950, 5948, 5946, 5944, 6046, 6044, 6042, 6040, 6142, + 6140, 6138, 6136, 6238, 6236, 6234, 6232, 6334, 6332, 6330, 6328, + 6430, 6428, 6426, 6424, 6526, 6524, 6522, 6520, 6622, 6620, 6618, + 6616, 6686, 6684, 6682, 6680, 6782, 6780, 6778, 6776, 6878, 6876, + 6874, 6872, 6974, 6972, 6970, 6968, 7070, 7068, 7066, 7064, 7166, + 7164, 7162, 7160, 7262, 7260, 7258, 7256, 7358, 7356, 7354, 7352, + 7454, 7452, 7450, 7448, 7550, 7548, 7546, 7544, 7646, 7644, 7642, + 7640, 7742, 7740, 7738, 7736, 7838, 7836, 7834, 7832, 7934, 7932, + 7930, 7928, 8030, 8028, 8026, 8024, 8126, 8124, 8122, 8120, 8222, + 8220, 8218, 8216, 8318, 8316, 8314, 8312, 8382, 8380, 8378, 8376, + 8478, 8476, 8474, 8472, 8574, 8572, 8570, 8568, 8670, 8668, 8666, + 8664, 8766, 8764, 8762, 8760, 8862, 8860, 8858, 8856, 8958, 8956, + 8954, 8952, 9054, 9052, 9050, 9048, 9150, 9148, 9146, 9144, 9246, + 9244, 9242, 9240, 9342, 9340, 9338, 9336, 9438, 9436, 9434, 9432, + 9534, 9532, 9530, 9528, 9630, 9628, 9626, 9624, 9726, 9724, 9722, + 9720, 9822, 9820, 9818, 9816, 9918, 9916, 9914, 9912, 10078, 10076, + 10074, 10072, 10174, 10172, 10170, 10168, 10270, 10268, 10266, 10264, 10366, + 10364, 10362, 10360, 10462, 10460, 10458, 10456, 10558, 10556, 10554, 10552, + 10654, 10652, 10650, 10648, 10750, 10748, 10746, 10744, 10846, 10844, 10842, + 10840, 10942, 10940, 10938, 10936, 11038, 11036, 11034, 11032, 11134, 11132, + 11130, 11128, 11230, 11228, 11226, 11224, 11326, 11324, 11322, 11320, 11422, + 11420, 11418, 11416, 11518, 11516, 11514, 11512, 11614, 11612, 11610, 11608, + 11678, 11676, 11674, 11672, 11774, 11772, 11770, 11768, 11870, 11868, 11866, + 11864, 11966, 11964, 11962, 11960, 12062, 12060, 12058, 12056, 12158, 12156, + 12154, 12152, 12254, 12252, 12250, 12248, 12350, 12348, 12346, 12344, 12446, + 12444, 12442, 12440, 12542, 12540, 12538, 12536, 12638, 12636, 12634, 12632, + 12734, 12732, 12730, 12728, 12830, 12828, 12826, 12824, 12926, 12924, 12922, + 12920, 13022, 13020, 13018, 13016, 13118, 13116, 13114, 13112, 13214, 13212, + 13210, 13208, 13278, 13276, 13274, 13272, 13374, 13372, 13370, 13368, 13470, + 13468, 13466, 13464, 13566, 13564, 13562, 13560, 13662, 13660, 13658, 13656, + 13758, 13756, 13754, 13752, 13854, 13852, 13850, 13848, 13950, 13948, 13946, + 13944, 14046, 14044, 14042, 14040, 14142, 14140, 14138, 14136, 14238, 14236, + 14234, 14232, 14334, 14332, 14330, 14328, 14430, 14428, 14426, 14424, 14526, + 14524, 14522, 14520, 14622, 14620, 14618, 14616, 14718, 14716, 14714, 14712, + 14814, 14812, 14810, 14808, 14910, 14908, 14906, 14904, 15070, 15068, 15066, + 15064, 15166, 15164, 15162, 15160, 15262, 15260, 15258, 15256, 15358, 15356, + 15354, 15352, 15454, 15452, 15450, 15448, 15550, 15548, 15546, 15544, 15646, + 15644, 15642, 15640, 15742, 15740, 15738, 15736, 15838, 15836, 15834, 15832, + 15934, 15932, 15930, 15928, 16030, 16028, 16026, 16024, 16126, 16124, 16122, + 16120, 16222, 16220, 16218, 16216, 16318, 16316, 16314, 16312, 16414, 16412, + 16410, 16408, 16510, 16508, 16506, 16504, 16606, 16604, 16602, 16600, 16670, + 16668, 16666, 16664, 16766, 16764, 16762, 16760, 16862, 16860, 16858, 16856, + 16958, 16956, 16954, 16952, 17054, 17052, 17050, 17048, 17150, 17148, 17146, + 17144, 17246, 17244, 17242, 17240, 17342, 17340, 17338, 17336, 17438, 17436, + 17434, 17432, 17534, 17532, 17530, 17528, 17630, 17628, 17626, 17624, 17726, + 17724, 17722, 17720, 17822, 17820, 17818, 17816, 17918, 17916, 17914, 17912, + 18014, 18012, 18010, 18008, 18110, 18108, 18106, 18104, 18206, 18204, 18202, + 18200, 18270, 18268, 18266, 18264, 18366, 18364, 18362, 18360, 18462, 18460, + 18458, 18456, 18558, 18556, 18554, 18552, 18654, 18652, 18650, 18648, 18750, + 18748, 18746, 18744, 18846, 18844, 18842, 18840, 18942, 18940, 18938, 18936, + 19038, 19036, 19034, 19032, 19134, 19132, 19130, 19128, 19230, 19228, 19226, + 19224, 19326, 19324, 19322, 19320, 19422, 19420, 19418, 19416, 19518, 19516, + 19514, 19512, 19614, 19612, 19610, 19608, 19710, 19708, 19706, 19704, 19806, + 19804, 19802, 19800, + }, }; - diff --git a/gr-dtv/lib/atsc/interleaver_fifo.h b/gr-dtv/lib/atsc/interleaver_fifo.h index bc23b2d5d0..98155b442d 100644 --- a/gr-dtv/lib/atsc/interleaver_fifo.h +++ b/gr-dtv/lib/atsc/interleaver_fifo.h @@ -29,56 +29,57 @@ * \brief template class for interleaver fifo */ -template<class symbol_type> -class interleaver_fifo { - public: - - interleaver_fifo (unsigned int size); - ~interleaver_fifo (); +template <class symbol_type> +class interleaver_fifo +{ +public: + interleaver_fifo(unsigned int size); + ~interleaver_fifo(); - //! reset interleaver (flushes contents and resets commutator) - void reset (); + //! reset interleaver (flushes contents and resets commutator) + void reset(); - //! stuff a symbol into the fifo and return the oldest - symbol_type stuff (symbol_type input){ - if (m_size == 0) - return input; + //! stuff a symbol into the fifo and return the oldest + symbol_type stuff(symbol_type input) + { + if (m_size == 0) + return input; - symbol_type retval = m_fifo[m_position]; - m_fifo[m_position] = input; - m_position++; - if (m_position >= m_size) - m_position = 0; + symbol_type retval = m_fifo[m_position]; + m_fifo[m_position] = input; + m_position++; + if (m_position >= m_size) + m_position = 0; - return retval; - } + return retval; + } protected: - unsigned int m_size; - unsigned int m_position; - symbol_type *m_fifo; + unsigned int m_size; + unsigned int m_position; + symbol_type* m_fifo; }; -template<class symbol_type> -interleaver_fifo<symbol_type>::interleaver_fifo (unsigned int size) +template <class symbol_type> +interleaver_fifo<symbol_type>::interleaver_fifo(unsigned int size) { - m_size = size; - m_position = 0; - m_fifo = new symbol_type[size]; - memset (m_fifo, 0, m_size * sizeof (symbol_type)); + m_size = size; + m_position = 0; + m_fifo = new symbol_type[size]; + memset(m_fifo, 0, m_size * sizeof(symbol_type)); } -template<class symbol_type> -interleaver_fifo<symbol_type>::~interleaver_fifo () +template <class symbol_type> +interleaver_fifo<symbol_type>::~interleaver_fifo() { - delete [] m_fifo; + delete[] m_fifo; } -template<class symbol_type> void -interleaver_fifo<symbol_type>::reset () +template <class symbol_type> +void interleaver_fifo<symbol_type>::reset() { - m_position = 0; - memset (m_fifo, 0, m_size * sizeof (symbol_type)); + m_position = 0; + memset(m_fifo, 0, m_size * sizeof(symbol_type)); } #endif /* _INTERLEAVER_FIFO_H_ */ diff --git a/gr-dtv/lib/catv/catv_frame_sync_enc_bb_impl.cc b/gr-dtv/lib/catv/catv_frame_sync_enc_bb_impl.cc index f3b16be580..7d83efc426 100644 --- a/gr-dtv/lib/catv/catv_frame_sync_enc_bb_impl.cc +++ b/gr-dtv/lib/catv/catv_frame_sync_enc_bb_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,135 +26,129 @@ #include "catv_frame_sync_enc_bb_impl.h" namespace gr { - namespace dtv { +namespace dtv { - catv_frame_sync_enc_bb::sptr - catv_frame_sync_enc_bb::make(catv_constellation_t constellation, int ctrlword) - { - return gnuradio::get_initial_sptr - (new catv_frame_sync_enc_bb_impl(constellation, ctrlword)); - } +catv_frame_sync_enc_bb::sptr +catv_frame_sync_enc_bb::make(catv_constellation_t constellation, int ctrlword) +{ + return gnuradio::get_initial_sptr( + new catv_frame_sync_enc_bb_impl(constellation, ctrlword)); +} - /* - * The private constructor - */ - catv_frame_sync_enc_bb_impl::catv_frame_sync_enc_bb_impl(catv_constellation_t constellation, int ctrlword) - : gr::block("catv_frame_sync_enc_bb", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(unsigned char))) - { - if (constellation == CATV_MOD_64QAM) { +/* + * The private constructor + */ +catv_frame_sync_enc_bb_impl::catv_frame_sync_enc_bb_impl( + catv_constellation_t constellation, int ctrlword) + : gr::block("catv_frame_sync_enc_bb", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(unsigned char))) +{ + if (constellation == CATV_MOD_64QAM) { set_output_multiple((60 * 128 * 7) + 42); - } - else { + } else { set_output_multiple((88 * 128 * 7) + 40); - } - control_word = ctrlword; - signal_constellation = constellation; } + control_word = ctrlword; + signal_constellation = constellation; +} - /* - * Our virtual destructor. - */ - catv_frame_sync_enc_bb_impl::~catv_frame_sync_enc_bb_impl() - { - } +/* + * Our virtual destructor. + */ +catv_frame_sync_enc_bb_impl::~catv_frame_sync_enc_bb_impl() {} - void - catv_frame_sync_enc_bb_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - if (signal_constellation == CATV_MOD_64QAM) { +void catv_frame_sync_enc_bb_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + if (signal_constellation == CATV_MOD_64QAM) { ninput_items_required[0] = noutput_items / ((60 * 128 * 7) + 42) * (60 * 128); - } - else { + } else { ninput_items_required[0] = noutput_items / ((88 * 128 * 7) + 40) * (88 * 128); - } } +} - int - catv_frame_sync_enc_bb_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; - int consumed = 0; - int i = 0; - unsigned char b; +int catv_frame_sync_enc_bb_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; + int consumed = 0; + int i = 0; + unsigned char b; - while (i < noutput_items) { + while (i < noutput_items) { if (signal_constellation == CATV_MOD_64QAM) { - for (int j = 0; j < 60 * 128; j++) { - b = *in++; - consumed++; + for (int j = 0; j < 60 * 128; j++) { + b = *in++; + consumed++; + for (int n = 6; n >= 0; n--) { + out[i++] = b & (1 << n) ? 1 : 0; + } + } + b = 0x75; for (int n = 6; n >= 0; n--) { - out[i++] = b & (1 << n) ? 1 : 0; + out[i++] = b & (1 << n) ? 1 : 0; } - } - b = 0x75; - for (int n = 6; n >= 0; n--) { - out[i++] = b & (1 << n) ? 1 : 0; - } - b = 0x2c; - for (int n = 6; n >= 0; n--) { - out[i++] = b & (1 << n) ? 1 : 0; - } - b = 0x0d; - for (int n = 6; n >= 0; n--) { - out[i++] = b & (1 << n) ? 1 : 0; - } - b = 0x6c; - for (int n = 6; n >= 0; n--) { - out[i++] = b & (1 << n) ? 1 : 0; - } - b = control_word << 3; - for (int n = 6; n >= 0; n--) { - out[i++] = b & (1 << n) ? 1 : 0; - } - for (int n = 6; n >= 0; n--) { - out[i++] = 0; - } - } - else { - for (int j = 0; j < 88 * 128; j++) { - b = *in++; - consumed++; + b = 0x2c; + for (int n = 6; n >= 0; n--) { + out[i++] = b & (1 << n) ? 1 : 0; + } + b = 0x0d; + for (int n = 6; n >= 0; n--) { + out[i++] = b & (1 << n) ? 1 : 0; + } + b = 0x6c; + for (int n = 6; n >= 0; n--) { + out[i++] = b & (1 << n) ? 1 : 0; + } + b = control_word << 3; for (int n = 6; n >= 0; n--) { - out[i++] = b & (1 << n) ? 1 : 0; + out[i++] = b & (1 << n) ? 1 : 0; + } + for (int n = 6; n >= 0; n--) { + out[i++] = 0; + } + } else { + for (int j = 0; j < 88 * 128; j++) { + b = *in++; + consumed++; + for (int n = 6; n >= 0; n--) { + out[i++] = b & (1 << n) ? 1 : 0; + } + } + b = 0x71; + for (int n = 7; n >= 0; n--) { + out[i++] = b & (1 << n) ? 1 : 0; + } + b = 0xe8; + for (int n = 7; n >= 0; n--) { + out[i++] = b & (1 << n) ? 1 : 0; + } + b = 0x4d; + for (int n = 7; n >= 0; n--) { + out[i++] = b & (1 << n) ? 1 : 0; + } + b = 0xd4; + for (int n = 7; n >= 0; n--) { + out[i++] = b & (1 << n) ? 1 : 0; + } + b = control_word << 4; + for (int n = 7; n >= 0; n--) { + out[i++] = b & (1 << n) ? 1 : 0; } - } - b = 0x71; - for (int n = 7; n >= 0; n--) { - out[i++] = b & (1 << n) ? 1 : 0; - } - b = 0xe8; - for (int n = 7; n >= 0; n--) { - out[i++] = b & (1 << n) ? 1 : 0; - } - b = 0x4d; - for (int n = 7; n >= 0; n--) { - out[i++] = b & (1 << n) ? 1 : 0; - } - b = 0xd4; - for (int n = 7; n >= 0; n--) { - out[i++] = b & (1 << n) ? 1 : 0; - } - b = control_word << 4; - for (int n = 7; n >= 0; n--) { - out[i++] = b & (1 << n) ? 1 : 0; - } } - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (consumed); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(consumed); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/catv/catv_frame_sync_enc_bb_impl.h b/gr-dtv/lib/catv/catv_frame_sync_enc_bb_impl.h index 38458a04cd..ae0e54a6c8 100644 --- a/gr-dtv/lib/catv/catv_frame_sync_enc_bb_impl.h +++ b/gr-dtv/lib/catv/catv_frame_sync_enc_bb_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -24,28 +24,27 @@ #include <gnuradio/dtv/catv_frame_sync_enc_bb.h> namespace gr { - namespace dtv { +namespace dtv { - class catv_frame_sync_enc_bb_impl : public catv_frame_sync_enc_bb - { - private: - int control_word; - int signal_constellation; +class catv_frame_sync_enc_bb_impl : public catv_frame_sync_enc_bb +{ +private: + int control_word; + int signal_constellation; - public: - catv_frame_sync_enc_bb_impl(catv_constellation_t constellation, int ctrlword); - ~catv_frame_sync_enc_bb_impl(); +public: + catv_frame_sync_enc_bb_impl(catv_constellation_t constellation, int ctrlword); + ~catv_frame_sync_enc_bb_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_CATV_FRAME_SYNC_ENC_BB_IMPL_H */ - diff --git a/gr-dtv/lib/catv/catv_randomizer_bb_impl.cc b/gr-dtv/lib/catv/catv_randomizer_bb_impl.cc index 833e3a0959..3d36ca1274 100644 --- a/gr-dtv/lib/catv/catv_randomizer_bb_impl.cc +++ b/gr-dtv/lib/catv/catv_randomizer_bb_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,83 +26,75 @@ #include "catv_randomizer_bb_impl.h" namespace gr { - namespace dtv { +namespace dtv { - catv_randomizer_bb::sptr - catv_randomizer_bb::make(catv_constellation_t constellation) - { - return gnuradio::get_initial_sptr - (new catv_randomizer_bb_impl(constellation)); - } +catv_randomizer_bb::sptr catv_randomizer_bb::make(catv_constellation_t constellation) +{ + return gnuradio::get_initial_sptr(new catv_randomizer_bb_impl(constellation)); +} - /* - * The private constructor - */ - catv_randomizer_bb_impl::catv_randomizer_bb_impl(catv_constellation_t constellation) - : gr::sync_block("catv_randomizer_bb", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(unsigned char))) - { - offset = 0; - if (constellation == CATV_MOD_64QAM) { +/* + * The private constructor + */ +catv_randomizer_bb_impl::catv_randomizer_bb_impl(catv_constellation_t constellation) + : gr::sync_block("catv_randomizer_bb", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(unsigned char))) +{ + offset = 0; + if (constellation == CATV_MOD_64QAM) { max_offset = 60 * 128; - } - else { + } else { max_offset = 88 * 128; - } - init_rand(); } + init_rand(); +} - /* - * Our virtual destructor. - */ - catv_randomizer_bb_impl::~catv_randomizer_bb_impl() - { - } +/* + * Our virtual destructor. + */ +catv_randomizer_bb_impl::~catv_randomizer_bb_impl() {} - void - catv_randomizer_bb_impl::init_rand() - { - unsigned char c2 = 0x7F, c1 = 0x7F, c0 = 0x7F; - unsigned char c2_new, c1_new, c0_new; - int n, i; +void catv_randomizer_bb_impl::init_rand() +{ + unsigned char c2 = 0x7F, c1 = 0x7F, c0 = 0x7F; + unsigned char c2_new, c1_new, c0_new; + int n, i; - for (n = 0; n < max_offset; n++) { + for (n = 0; n < max_offset; n++) { rseq[n] = c2; c2_new = c1; c1_new = c0 ^ c2; c0_new = c2; for (i = 0; i < 3; i++) { - c0_new <<= 1; - if (c0_new & 0x80) { - c0_new = (c0_new & 0x7F) ^ 0x09; - } + c0_new <<= 1; + if (c0_new & 0x80) { + c0_new = (c0_new & 0x7F) ^ 0x09; + } } c2 = c2_new; c1 = c1_new; c0 = c0_new; - } } +} - int - catv_randomizer_bb_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; +int catv_randomizer_bb_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; - for (int i = 0; i < noutput_items; i++) { + for (int i = 0; i < noutput_items; i++) { out[i] = in[i] ^ rseq[offset++]; if (offset == max_offset) { - offset = 0; + offset = 0; } - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ -} /* namespace gr */ + // Tell runtime system how many output items we produced. + return noutput_items; +} +} /* namespace dtv */ +} /* namespace gr */ diff --git a/gr-dtv/lib/catv/catv_randomizer_bb_impl.h b/gr-dtv/lib/catv/catv_randomizer_bb_impl.h index 06ce886d9a..5d7171c33b 100644 --- a/gr-dtv/lib/catv/catv_randomizer_bb_impl.h +++ b/gr-dtv/lib/catv/catv_randomizer_bb_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -24,26 +24,25 @@ #include <gnuradio/dtv/catv_randomizer_bb.h> namespace gr { - namespace dtv { +namespace dtv { - class catv_randomizer_bb_impl : public catv_randomizer_bb - { - private: - unsigned char rseq[88 * 128]; - int offset, max_offset; - void init_rand(); +class catv_randomizer_bb_impl : public catv_randomizer_bb +{ +private: + unsigned char rseq[88 * 128]; + int offset, max_offset; + void init_rand(); - public: - catv_randomizer_bb_impl(catv_constellation_t constellation); - ~catv_randomizer_bb_impl(); +public: + catv_randomizer_bb_impl(catv_constellation_t constellation); + ~catv_randomizer_bb_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_CATV_RANDOMIZER_BB_IMPL_H */ - diff --git a/gr-dtv/lib/catv/catv_reed_solomon_enc_bb_impl.cc b/gr-dtv/lib/catv/catv_reed_solomon_enc_bb_impl.cc index b2b529c0a5..da05f8089b 100644 --- a/gr-dtv/lib/catv/catv_reed_solomon_enc_bb_impl.cc +++ b/gr-dtv/lib/catv/catv_reed_solomon_enc_bb_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,128 +26,123 @@ #include "catv_reed_solomon_enc_bb_impl.h" namespace gr { - namespace dtv { +namespace dtv { - catv_reed_solomon_enc_bb::sptr - catv_reed_solomon_enc_bb::make() - { - return gnuradio::get_initial_sptr - (new catv_reed_solomon_enc_bb_impl()); - } - - /* - * The private constructor - */ - catv_reed_solomon_enc_bb_impl::catv_reed_solomon_enc_bb_impl() - : gr::block("catv_reed_solomon_enc_bb", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(unsigned char))) - { - set_output_multiple(128); - init_rs(); - } +catv_reed_solomon_enc_bb::sptr catv_reed_solomon_enc_bb::make() +{ + return gnuradio::get_initial_sptr(new catv_reed_solomon_enc_bb_impl()); +} - /* - * Our virtual destructor. - */ - catv_reed_solomon_enc_bb_impl::~catv_reed_solomon_enc_bb_impl() - { - } +/* + * The private constructor + */ +catv_reed_solomon_enc_bb_impl::catv_reed_solomon_enc_bb_impl() + : gr::block("catv_reed_solomon_enc_bb", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(unsigned char))) +{ + set_output_multiple(128); + init_rs(); +} + +/* + * Our virtual destructor. + */ +catv_reed_solomon_enc_bb_impl::~catv_reed_solomon_enc_bb_impl() {} - void - catv_reed_solomon_enc_bb_impl::init_rs() - { - unsigned char x; - int i, j; +void catv_reed_solomon_enc_bb_impl::init_rs() +{ + unsigned char x; + int i, j; - gf_exp[0] = 1; - gf_log[1] = 0; + gf_exp[0] = 1; + gf_log[1] = 0; - x = 1; - for (i = 1; i < 127; i++) { + x = 1; + for (i = 1; i < 127; i++) { x <<= 1; if (x & 0x80) { - x = (x & 0x7F) ^ 0x09; + x = (x & 0x7F) ^ 0x09; } gf_exp[i] = x; gf_log[x] = i; - } - for (; i < 256; i++) { + } + for (; i < 256; i++) { gf_exp[i] = gf_exp[i - 127]; - } + } - for (i = 0; i < 128; i++) { + for (i = 0; i < 128; i++) { for (j = 0; j < 128; j++) { - if ((i == 0) || (j == 0)) { - gf_mul_table[i][j] = 0; - } else { - gf_mul_table[i][j] = gf_exp[gf_log[i] + gf_log[j]]; - } + if ((i == 0) || (j == 0)) { + gf_mul_table[i][j] = 0; + } else { + gf_mul_table[i][j] = gf_exp[gf_log[i] + gf_log[j]]; + } } - } } +} - unsigned char - catv_reed_solomon_enc_bb_impl::gf_poly_eval(unsigned char *p, int len, unsigned char x) - { - unsigned char y = p[0]; - int i; +unsigned char +catv_reed_solomon_enc_bb_impl::gf_poly_eval(unsigned char* p, int len, unsigned char x) +{ + unsigned char y = p[0]; + int i; - for (i = 1; i < len; i++) { + for (i = 1; i < len; i++) { y = gf_mul_table[y][x] ^ p[i]; - } - return y; } - - void - catv_reed_solomon_enc_bb_impl::reed_solomon_enc(const unsigned char *message, unsigned char *output) - { - // Generator polynomial from p.7 of ANSI/SCTE 07 2013 - unsigned char g[] = {1, gf_exp[52], gf_exp[116], gf_exp[119], gf_exp[61], gf_exp[15]}; - int i, j; - - memcpy(output, message, 122); - memset(output + 122, 0, 6); - - for (i = 0; i < 122; i++) { + return y; +} + +void catv_reed_solomon_enc_bb_impl::reed_solomon_enc(const unsigned char* message, + unsigned char* output) +{ + // Generator polynomial from p.7 of ANSI/SCTE 07 2013 + unsigned char g[] = { + 1, gf_exp[52], gf_exp[116], gf_exp[119], gf_exp[61], gf_exp[15] + }; + int i, j; + + memcpy(output, message, 122); + memset(output + 122, 0, 6); + + for (i = 0; i < 122; i++) { for (j = 1; j < 6; j++) { - output[i + j] ^= gf_mul_table[output[i]][g[j]]; + output[i + j] ^= gf_mul_table[output[i]][g[j]]; } output[i] = message[i]; - } - - output[127] = gf_poly_eval(output, 127, gf_exp[6]); - } - - void - catv_reed_solomon_enc_bb_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = (noutput_items / 128) * 122; } - int - catv_reed_solomon_enc_bb_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; - int j = 0; - - for (int i = 0; i < noutput_items; i += 128) { + output[127] = gf_poly_eval(output, 127, gf_exp[6]); +} + +void catv_reed_solomon_enc_bb_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = (noutput_items / 128) * 122; +} + +int catv_reed_solomon_enc_bb_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; + int j = 0; + + for (int i = 0; i < noutput_items; i += 128) { reed_solomon_enc(in + j, out + i); j += 122; - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (j); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(j); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/catv/catv_reed_solomon_enc_bb_impl.h b/gr-dtv/lib/catv/catv_reed_solomon_enc_bb_impl.h index 84e4cb500e..e02593c642 100644 --- a/gr-dtv/lib/catv/catv_reed_solomon_enc_bb_impl.h +++ b/gr-dtv/lib/catv/catv_reed_solomon_enc_bb_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -24,33 +24,32 @@ #include <gnuradio/dtv/catv_reed_solomon_enc_bb.h> namespace gr { - namespace dtv { +namespace dtv { - class catv_reed_solomon_enc_bb_impl : public catv_reed_solomon_enc_bb - { - private: - unsigned char gf_mul_table[128][128]; - unsigned char gf_exp[256]; - unsigned char gf_log[128]; +class catv_reed_solomon_enc_bb_impl : public catv_reed_solomon_enc_bb +{ +private: + unsigned char gf_mul_table[128][128]; + unsigned char gf_exp[256]; + unsigned char gf_log[128]; - void init_rs(); - unsigned char gf_poly_eval(unsigned char *p, int len, unsigned char x); - void reed_solomon_enc(const unsigned char *message, unsigned char *output); + void init_rs(); + unsigned char gf_poly_eval(unsigned char* p, int len, unsigned char x); + void reed_solomon_enc(const unsigned char* message, unsigned char* output); - public: - catv_reed_solomon_enc_bb_impl(); - ~catv_reed_solomon_enc_bb_impl(); +public: + catv_reed_solomon_enc_bb_impl(); + ~catv_reed_solomon_enc_bb_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_CATV_REED_SOLOMON_ENC_BB_IMPL_H */ - diff --git a/gr-dtv/lib/catv/catv_transport_framing_enc_bb_impl.cc b/gr-dtv/lib/catv/catv_transport_framing_enc_bb_impl.cc index 4082e8265c..76ee79f2a2 100644 --- a/gr-dtv/lib/catv/catv_transport_framing_enc_bb_impl.cc +++ b/gr-dtv/lib/catv/catv_transport_framing_enc_bb_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,106 +26,100 @@ #include "catv_transport_framing_enc_bb_impl.h" namespace gr { - namespace dtv { +namespace dtv { - catv_transport_framing_enc_bb::sptr - catv_transport_framing_enc_bb::make() - { - return gnuradio::get_initial_sptr - (new catv_transport_framing_enc_bb_impl()); - } - - /* - * The private constructor - */ - catv_transport_framing_enc_bb_impl::catv_transport_framing_enc_bb_impl() - : gr::sync_block("catv_transport_framing_enc_bb", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(unsigned char))) - { - set_output_multiple(188); - } +catv_transport_framing_enc_bb::sptr catv_transport_framing_enc_bb::make() +{ + return gnuradio::get_initial_sptr(new catv_transport_framing_enc_bb_impl()); +} - /* - * Our virtual destructor. - */ - catv_transport_framing_enc_bb_impl::~catv_transport_framing_enc_bb_impl() - { - } +/* + * The private constructor + */ +catv_transport_framing_enc_bb_impl::catv_transport_framing_enc_bb_impl() + : gr::sync_block("catv_transport_framing_enc_bb", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(unsigned char))) +{ + set_output_multiple(188); +} + +/* + * Our virtual destructor. + */ +catv_transport_framing_enc_bb_impl::~catv_transport_framing_enc_bb_impl() {} - unsigned char catv_transport_framing_enc_bb_impl::compute_sum(const unsigned char *bytes) - { - unsigned char i, bit, out, out1, out2, out3; +unsigned char catv_transport_framing_enc_bb_impl::compute_sum(const unsigned char* bytes) +{ + unsigned char i, bit, out, out1, out2, out3; - unsigned char tapsG = 0xB1; // 10110001 - unsigned char tapsB = 0x45; // 1000101 + unsigned char tapsG = 0xB1; // 10110001 + unsigned char tapsB = 0x45; // 1000101 - unsigned char register1 = 0; - unsigned char register2 = 0; - unsigned char register3 = 0; + unsigned char register1 = 0; + unsigned char register2 = 0; + unsigned char register3 = 0; - unsigned char result = 0x67; + unsigned char result = 0x67; - unsigned char first7[] = {0, 0, 0, 0, 0, 0, 0, 0}; + unsigned char first7[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; - for (i = 0; i < 8; i++) { - bit = (bytes[0] >> (7-i)) & 1; + for (i = 0; i < 8; i++) { + bit = (bytes[0] >> (7 - i)) & 1; out = (register1 & 1) ^ bit; if (i < 7) { - first7[i+1] = out; + first7[i + 1] = out; } register1 >>= 1; if (out == 1) { - register1 ^= tapsG; + register1 ^= tapsG; } - } + } - for (i = 1; i < 187; i++) { + for (i = 1; i < 187; i++) { register1 = crctable[((register1) ^ BitReverseTable[bytes[i]]) & 0xff]; - } + } - for (i = 0; i < 8; i++) { + for (i = 0; i < 8; i++) { out1 = register1 & 1; register1 >>= 1; if (out1 == 1) { - register1 ^= tapsG; + register1 ^= tapsG; } out2 = (register2 & 1) ^ first7[i]; register2 >>= 1; if (first7[i] == 1) { - register2 ^= tapsB; + register2 ^= tapsB; } out3 = (register3 & 1) ^ out1 ^ out2; register3 >>= 1; if ((out1 ^ out2) == 1) { - register3 ^= tapsG; + register3 ^= tapsG; } - result ^= (out3 << (7-i)); - } - - return result; + result ^= (out3 << (7 - i)); } - int - catv_transport_framing_enc_bb_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; + return result; +} + +int catv_transport_framing_enc_bb_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; - for (int i = 0; i < noutput_items; i += 188) { + for (int i = 0; i < noutput_items; i += 188) { memcpy(out + i, in + i + 1, 187); out[i + 187] = compute_sum(in + i + 1); - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ -} /* namespace gr */ + // Tell runtime system how many output items we produced. + return noutput_items; +} +} /* namespace dtv */ +} /* namespace gr */ diff --git a/gr-dtv/lib/catv/catv_transport_framing_enc_bb_impl.h b/gr-dtv/lib/catv/catv_transport_framing_enc_bb_impl.h index fe69bc01f6..377247384f 100644 --- a/gr-dtv/lib/catv/catv_transport_framing_enc_bb_impl.h +++ b/gr-dtv/lib/catv/catv_transport_framing_enc_bb_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -24,61 +24,66 @@ #include <gnuradio/dtv/catv_transport_framing_enc_bb.h> namespace gr { - namespace dtv { - static const unsigned char crctable[] = { - 0x00,0x1b,0x36,0x2d,0x6c,0x77,0x5a,0x41,0xd8,0xc3,0xee,0xf5,0xb4,0xaf,0x82,0x99, - 0xd3,0xc8,0xe5,0xfe,0xbf,0xa4,0x89,0x92,0x0b,0x10,0x3d,0x26,0x67,0x7c,0x51,0x4a, - 0xc5,0xde,0xf3,0xe8,0xa9,0xb2,0x9f,0x84,0x1d,0x06,0x2b,0x30,0x71,0x6a,0x47,0x5c, - 0x16,0x0d,0x20,0x3b,0x7a,0x61,0x4c,0x57,0xce,0xd5,0xf8,0xe3,0xa2,0xb9,0x94,0x8f, - 0xe9,0xf2,0xdf,0xc4,0x85,0x9e,0xb3,0xa8,0x31,0x2a,0x07,0x1c,0x5d,0x46,0x6b,0x70, - 0x3a,0x21,0x0c,0x17,0x56,0x4d,0x60,0x7b,0xe2,0xf9,0xd4,0xcf,0x8e,0x95,0xb8,0xa3, - 0x2c,0x37,0x1a,0x01,0x40,0x5b,0x76,0x6d,0xf4,0xef,0xc2,0xd9,0x98,0x83,0xae,0xb5, - 0xff,0xe4,0xc9,0xd2,0x93,0x88,0xa5,0xbe,0x27,0x3c,0x11,0x0a,0x4b,0x50,0x7d,0x66, - 0xb1,0xaa,0x87,0x9c,0xdd,0xc6,0xeb,0xf0,0x69,0x72,0x5f,0x44,0x05,0x1e,0x33,0x28, - 0x62,0x79,0x54,0x4f,0x0e,0x15,0x38,0x23,0xba,0xa1,0x8c,0x97,0xd6,0xcd,0xe0,0xfb, - 0x74,0x6f,0x42,0x59,0x18,0x03,0x2e,0x35,0xac,0xb7,0x9a,0x81,0xc0,0xdb,0xf6,0xed, - 0xa7,0xbc,0x91,0x8a,0xcb,0xd0,0xfd,0xe6,0x7f,0x64,0x49,0x52,0x13,0x08,0x25,0x3e, - 0x58,0x43,0x6e,0x75,0x34,0x2f,0x02,0x19,0x80,0x9b,0xb6,0xad,0xec,0xf7,0xda,0xc1, - 0x8b,0x90,0xbd,0xa6,0xe7,0xfc,0xd1,0xca,0x53,0x48,0x65,0x7e,0x3f,0x24,0x09,0x12, - 0x9d,0x86,0xab,0xb0,0xf1,0xea,0xc7,0xdc,0x45,0x5e,0x73,0x68,0x29,0x32,0x1f,0x04, - 0x4e,0x55,0x78,0x63,0x22,0x39,0x14,0x0f,0x96,0x8d,0xa0,0xbb,0xfa,0xe1,0xcc,0xd7 - }; +namespace dtv { +static const unsigned char crctable[] = { + 0x00, 0x1b, 0x36, 0x2d, 0x6c, 0x77, 0x5a, 0x41, 0xd8, 0xc3, 0xee, 0xf5, 0xb4, 0xaf, + 0x82, 0x99, 0xd3, 0xc8, 0xe5, 0xfe, 0xbf, 0xa4, 0x89, 0x92, 0x0b, 0x10, 0x3d, 0x26, + 0x67, 0x7c, 0x51, 0x4a, 0xc5, 0xde, 0xf3, 0xe8, 0xa9, 0xb2, 0x9f, 0x84, 0x1d, 0x06, + 0x2b, 0x30, 0x71, 0x6a, 0x47, 0x5c, 0x16, 0x0d, 0x20, 0x3b, 0x7a, 0x61, 0x4c, 0x57, + 0xce, 0xd5, 0xf8, 0xe3, 0xa2, 0xb9, 0x94, 0x8f, 0xe9, 0xf2, 0xdf, 0xc4, 0x85, 0x9e, + 0xb3, 0xa8, 0x31, 0x2a, 0x07, 0x1c, 0x5d, 0x46, 0x6b, 0x70, 0x3a, 0x21, 0x0c, 0x17, + 0x56, 0x4d, 0x60, 0x7b, 0xe2, 0xf9, 0xd4, 0xcf, 0x8e, 0x95, 0xb8, 0xa3, 0x2c, 0x37, + 0x1a, 0x01, 0x40, 0x5b, 0x76, 0x6d, 0xf4, 0xef, 0xc2, 0xd9, 0x98, 0x83, 0xae, 0xb5, + 0xff, 0xe4, 0xc9, 0xd2, 0x93, 0x88, 0xa5, 0xbe, 0x27, 0x3c, 0x11, 0x0a, 0x4b, 0x50, + 0x7d, 0x66, 0xb1, 0xaa, 0x87, 0x9c, 0xdd, 0xc6, 0xeb, 0xf0, 0x69, 0x72, 0x5f, 0x44, + 0x05, 0x1e, 0x33, 0x28, 0x62, 0x79, 0x54, 0x4f, 0x0e, 0x15, 0x38, 0x23, 0xba, 0xa1, + 0x8c, 0x97, 0xd6, 0xcd, 0xe0, 0xfb, 0x74, 0x6f, 0x42, 0x59, 0x18, 0x03, 0x2e, 0x35, + 0xac, 0xb7, 0x9a, 0x81, 0xc0, 0xdb, 0xf6, 0xed, 0xa7, 0xbc, 0x91, 0x8a, 0xcb, 0xd0, + 0xfd, 0xe6, 0x7f, 0x64, 0x49, 0x52, 0x13, 0x08, 0x25, 0x3e, 0x58, 0x43, 0x6e, 0x75, + 0x34, 0x2f, 0x02, 0x19, 0x80, 0x9b, 0xb6, 0xad, 0xec, 0xf7, 0xda, 0xc1, 0x8b, 0x90, + 0xbd, 0xa6, 0xe7, 0xfc, 0xd1, 0xca, 0x53, 0x48, 0x65, 0x7e, 0x3f, 0x24, 0x09, 0x12, + 0x9d, 0x86, 0xab, 0xb0, 0xf1, 0xea, 0xc7, 0xdc, 0x45, 0x5e, 0x73, 0x68, 0x29, 0x32, + 0x1f, 0x04, 0x4e, 0x55, 0x78, 0x63, 0x22, 0x39, 0x14, 0x0f, 0x96, 0x8d, 0xa0, 0xbb, + 0xfa, 0xe1, 0xcc, 0xd7 +}; - static const unsigned char BitReverseTable[] = { - 0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0, - 0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8, - 0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4, - 0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC, - 0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2, - 0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA, - 0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6, - 0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE, - 0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1, - 0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9, - 0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5, - 0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD, - 0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3, - 0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB, - 0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7, - 0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF - }; +static const unsigned char BitReverseTable[] = { + 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, + 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, + 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, + 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, + 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, + 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, 0x0A, 0x8A, 0x4A, 0xCA, + 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, 0x06, 0x86, + 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, + 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, + 0x7E, 0xFE, 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, + 0x31, 0xB1, 0x71, 0xF1, 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, + 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, + 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, + 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, 0x03, 0x83, 0x43, 0xC3, + 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, 0x0B, 0x8B, + 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, + 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, + 0x77, 0xF7, 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, + 0x3F, 0xBF, 0x7F, 0xFF +}; - class catv_transport_framing_enc_bb_impl : public catv_transport_framing_enc_bb - { - private: - unsigned char compute_sum(const unsigned char *bytes); +class catv_transport_framing_enc_bb_impl : public catv_transport_framing_enc_bb +{ +private: + unsigned char compute_sum(const unsigned char* bytes); - public: - catv_transport_framing_enc_bb_impl(); - ~catv_transport_framing_enc_bb_impl(); +public: + catv_transport_framing_enc_bb_impl(); + ~catv_transport_framing_enc_bb_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_CATV_TRANSPORT_FRAMING_ENC_BB_IMPL_H */ - diff --git a/gr-dtv/lib/catv/catv_trellis_enc_bb_impl.cc b/gr-dtv/lib/catv/catv_trellis_enc_bb_impl.cc index 88cfd5ee5d..5c718ffb02 100644 --- a/gr-dtv/lib/catv/catv_trellis_enc_bb_impl.cc +++ b/gr-dtv/lib/catv/catv_trellis_enc_bb_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,277 +26,270 @@ #include "catv_trellis_enc_bb_impl.h" namespace gr { - namespace dtv { +namespace dtv { - catv_trellis_enc_bb::sptr - catv_trellis_enc_bb::make(catv_constellation_t constellation) - { - return gnuradio::get_initial_sptr - (new catv_trellis_enc_bb_impl(constellation)); - } +catv_trellis_enc_bb::sptr catv_trellis_enc_bb::make(catv_constellation_t constellation) +{ + return gnuradio::get_initial_sptr(new catv_trellis_enc_bb_impl(constellation)); +} - /* - * The private constructor - */ - catv_trellis_enc_bb_impl::catv_trellis_enc_bb_impl(catv_constellation_t constellation) - : gr::block("catv_trellis_enc_bb", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(unsigned char))) - { - if (constellation == CATV_MOD_64QAM) { +/* + * The private constructor + */ +catv_trellis_enc_bb_impl::catv_trellis_enc_bb_impl(catv_constellation_t constellation) + : gr::block("catv_trellis_enc_bb", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(unsigned char))) +{ + if (constellation == CATV_MOD_64QAM) { set_output_multiple(5); - } - else { + } else { set_output_multiple(5 * 6); - } + } - init_trellis(); + init_trellis(); - Xq = 0; - Yq = 0; - XYp = 0; - signal_constellation = constellation; - trellis_group = 0; - } + Xq = 0; + Yq = 0; + XYp = 0; + signal_constellation = constellation; + trellis_group = 0; +} - /* - * Our virtual destructor. - */ - catv_trellis_enc_bb_impl::~catv_trellis_enc_bb_impl() - { - } +/* + * Our virtual destructor. + */ +catv_trellis_enc_bb_impl::~catv_trellis_enc_bb_impl() {} - void - catv_trellis_enc_bb_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - if (signal_constellation == CATV_MOD_64QAM) { +void catv_trellis_enc_bb_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + if (signal_constellation == CATV_MOD_64QAM) { ninput_items_required[0] = noutput_items / 5 * 28; - } - else { + } else { ninput_items_required[0] = (noutput_items / (5 * 6)) * (38 * 6); - } } +} - void - catv_trellis_enc_bb_impl::diff_precoder(unsigned char W, unsigned char Z, unsigned char *Xp, unsigned char *Yp) - { - unsigned char common, newX, newY; +void catv_trellis_enc_bb_impl::diff_precoder(unsigned char W, + unsigned char Z, + unsigned char* Xp, + unsigned char* Yp) +{ + unsigned char common, newX, newY; - common = (Z & (*Xp ^ *Yp)); - newX = W ^ *Xp ^ common; - newY = Z ^ W ^ *Yp ^ common; + common = (Z & (*Xp ^ *Yp)); + newX = W ^ *Xp ^ common; + newY = Z ^ W ^ *Yp ^ common; - *Xp = newX; - *Yp = newY; - } + *Xp = newX; + *Yp = newY; +} - void - catv_trellis_enc_bb_impl::init_trellis() - { - unsigned char XYp, W, Z, X, Y, Xp, Yp, state, xy, Xq; - int i, n; +void catv_trellis_enc_bb_impl::init_trellis() +{ + unsigned char XYp, W, Z, X, Y, Xp, Yp, state, xy, Xq; + int i, n; - for (XYp = 0; XYp < 4; XYp++) { + for (XYp = 0; XYp < 4; XYp++) { for (W = 0; W < 16; W++) { - for (Z = 0; Z < 16; Z++) { - X = 0; - Y = 0; - Xp = (XYp & 0x02) >> 1; - Yp = (XYp & 0x01); - for (i = 0; i < 4; i++) { - diff_precoder((W >> i) & 1, (Z >> i) & 1, &Xp, &Yp); - X |= (Xp << i); - Y |= (Yp << i); + for (Z = 0; Z < 16; Z++) { + X = 0; + Y = 0; + Xp = (XYp & 0x02) >> 1; + Yp = (XYp & 0x01); + for (i = 0; i < 4; i++) { + diff_precoder((W >> i) & 1, (Z >> i) & 1, &Xp, &Yp); + X |= (Xp << i); + Y |= (Yp << i); + } + diff_precoder_table[XYp][W][Z][0] = (Xp << 1) + Yp; + diff_precoder_table[XYp][W][Z][1] = X; + diff_precoder_table[XYp][W][Z][2] = Y; } - diff_precoder_table[XYp][W][Z][0] = (Xp << 1) + Yp; - diff_precoder_table[XYp][W][Z][1] = X; - diff_precoder_table[XYp][W][Z][2] = Y; - } } - } + } - for (i = 0; i < 32; i++) { + for (i = 0; i < 32; i++) { G1table[i] = (i >> 4) ^ ((i & 0x04) >> 2) ^ (i & 1); - G2table[i] = (i >> 4) ^ ((i & 0x08) >> 3) ^ ((i & 0x04) >> 2) ^ ((i & 0x02) >> 1) ^ (i & 1); - } + G2table[i] = (i >> 4) ^ ((i & 0x08) >> 3) ^ ((i & 0x04) >> 2) ^ + ((i & 0x02) >> 1) ^ (i & 1); + } - memset(trellis_table_x, 0, 16*16*6); - memset(trellis_table_y, 0, 16*16*6); - for (state = 0; state < 16; state++) { + memset(trellis_table_x, 0, 16 * 16 * 6); + memset(trellis_table_y, 0, 16 * 16 * 6); + for (state = 0; state < 16; state++) { for (xy = 0; xy < 16; xy++) { - i = 0; - Xq = state; - for (n = 0; n < 4; n++) { - Xq = (Xq << 1) + ((xy >> n) & 1); - - if (n == 3) { - trellis_table_x[state][xy][i+1] |= G1table[Xq] << 3; - trellis_table_y[state][xy][i+1] |= G1table[Xq]; - i += 1; + i = 0; + Xq = state; + for (n = 0; n < 4; n++) { + Xq = (Xq << 1) + ((xy >> n) & 1); + + if (n == 3) { + trellis_table_x[state][xy][i + 1] |= G1table[Xq] << 3; + trellis_table_y[state][xy][i + 1] |= G1table[Xq]; + i += 1; + } + trellis_table_x[state][xy][i + 1] |= G2table[Xq] << 3; + trellis_table_y[state][xy][i + 1] |= G2table[Xq]; + i += 1; + + Xq &= 0x0F; } - trellis_table_x[state][xy][i+1] |= G2table[Xq] << 3; - trellis_table_y[state][xy][i+1] |= G2table[Xq]; - i += 1; - - Xq &= 0x0F; - } - trellis_table_x[state][xy][0] = Xq; - trellis_table_y[state][xy][0] = Xq; + trellis_table_x[state][xy][0] = Xq; + trellis_table_y[state][xy][0] = Xq; } - } } - - void - catv_trellis_enc_bb_impl::trellis_code_64qam(const unsigned char *rs, unsigned char *qs) - { - unsigned char X, Y; - int A, B, n; - - memset(qs, 0, 5); - - qs[0] |= rs[6] << 4; /* A1 */ - qs[0] |= rs[5] << 5; /* A2 */ - qs[0] |= rs[20] << 1; /* B1 */ - qs[0] |= rs[19] << 2; /* B2 */ - qs[1] |= rs[4] << 4; /* A4 */ - qs[1] |= rs[3] << 5; /* A5 */ - qs[1] |= rs[18] << 1; /* B4 */ - qs[1] |= rs[17] << 2; /* B5 */ - qs[2] |= rs[2] << 4; /* A7 */ - qs[2] |= rs[1] << 5; /* A8 */ - qs[2] |= rs[16] << 1; /* B7 */ - qs[2] |= rs[15] << 2; /* B8 */ - qs[3] |= rs[0] << 4; /* A10 */ - qs[3] |= rs[13] << 5; /* A11 */ - qs[3] |= rs[14] << 1; /* B10 */ - qs[3] |= rs[27] << 2; /* B11 */ - qs[4] |= rs[12] << 4; /* A12 */ - qs[4] |= rs[11] << 5; /* A13 */ - qs[4] |= rs[26] << 1; /* B12 */ - qs[4] |= rs[25] << 2; /* B13 */ - - A = (rs[7] << 3) | (rs[8] << 2) | (rs[9] << 1) | rs[10]; - B = (rs[21] << 3) | (rs[22] << 2) | (rs[23] << 1) | rs[24]; - X = diff_precoder_table[XYp][A][B][1]; - Y = diff_precoder_table[XYp][A][B][2]; - XYp = diff_precoder_table[XYp][A][B][0]; - - for (n = 0; n < 5; n++) { - qs[n] |= trellis_table_x[Xq][X][1+n]; - qs[n] |= trellis_table_y[Yq][Y][1+n]; - } - Xq = trellis_table_x[Xq][X][0]; - Yq = trellis_table_y[Yq][Y][0]; +} + +void catv_trellis_enc_bb_impl::trellis_code_64qam(const unsigned char* rs, + unsigned char* qs) +{ + unsigned char X, Y; + int A, B, n; + + memset(qs, 0, 5); + + qs[0] |= rs[6] << 4; /* A1 */ + qs[0] |= rs[5] << 5; /* A2 */ + qs[0] |= rs[20] << 1; /* B1 */ + qs[0] |= rs[19] << 2; /* B2 */ + qs[1] |= rs[4] << 4; /* A4 */ + qs[1] |= rs[3] << 5; /* A5 */ + qs[1] |= rs[18] << 1; /* B4 */ + qs[1] |= rs[17] << 2; /* B5 */ + qs[2] |= rs[2] << 4; /* A7 */ + qs[2] |= rs[1] << 5; /* A8 */ + qs[2] |= rs[16] << 1; /* B7 */ + qs[2] |= rs[15] << 2; /* B8 */ + qs[3] |= rs[0] << 4; /* A10 */ + qs[3] |= rs[13] << 5; /* A11 */ + qs[3] |= rs[14] << 1; /* B10 */ + qs[3] |= rs[27] << 2; /* B11 */ + qs[4] |= rs[12] << 4; /* A12 */ + qs[4] |= rs[11] << 5; /* A13 */ + qs[4] |= rs[26] << 1; /* B12 */ + qs[4] |= rs[25] << 2; /* B13 */ + + A = (rs[7] << 3) | (rs[8] << 2) | (rs[9] << 1) | rs[10]; + B = (rs[21] << 3) | (rs[22] << 2) | (rs[23] << 1) | rs[24]; + X = diff_precoder_table[XYp][A][B][1]; + Y = diff_precoder_table[XYp][A][B][2]; + XYp = diff_precoder_table[XYp][A][B][0]; + + for (n = 0; n < 5; n++) { + qs[n] |= trellis_table_x[Xq][X][1 + n]; + qs[n] |= trellis_table_y[Yq][Y][1 + n]; } + Xq = trellis_table_x[Xq][X][0]; + Yq = trellis_table_y[Yq][Y][0]; +} - void - catv_trellis_enc_bb_impl::trellis_code_256qam(const unsigned char *rs, unsigned char *qs) - { - unsigned char X, Y; - int A, B, n; +void catv_trellis_enc_bb_impl::trellis_code_256qam(const unsigned char* rs, + unsigned char* qs) +{ + unsigned char X, Y; + int A, B, n; - for (int i = 0; i < 6; i++) { + for (int i = 0; i < 6; i++) { memset(&qs[0 + (i * 5)], 0, 5); if (trellis_group == 2071) { - for (int j = 0; j < 5; j++) { - qs[j + (i * 5)] |= rs[38 + (j * 6)] << 5; - qs[j + (i * 5)] |= rs[39 + (j * 6)] << 6; - qs[j + (i * 5)] |= rs[40 + (j * 6)] << 7; - qs[j + (i * 5)] |= rs[41 + (j * 6)] << 1; - qs[j + (i * 5)] |= rs[42 + (j * 6)] << 2; - qs[j + (i * 5)] |= rs[43 + (j * 6)] << 3; - } - - A = (rs[194] << 3) | (rs[192] << 2) | (rs[190] << 1) | rs[188]; - B = (rs[195] << 3) | (rs[193] << 2) | (rs[191] << 1) | rs[189]; - } - else if (trellis_group == 2072) { - for (int j = 0; j < 5; j++) { - qs[j + (i * 5)] |= rs[68 + (j * 6)] << 5; - qs[j + (i * 5)] |= rs[69 + (j * 6)] << 6; - qs[j + (i * 5)] |= rs[70 + (j * 6)] << 7; - qs[j + (i * 5)] |= rs[71 + (j * 6)] << 1; - qs[j + (i * 5)] |= rs[72 + (j * 6)] << 2; - qs[j + (i * 5)] |= rs[73 + (j * 6)] << 3; - } - - A = (rs[202] << 3) | (rs[200] << 2) | (rs[198] << 1) | rs[196]; - B = (rs[203] << 3) | (rs[201] << 2) | (rs[199] << 1) | rs[197]; - } - else if (trellis_group == 2073) { - for (int j = 0; j < 5; j++) { - qs[j + (i * 5)] |= rs[98 + (j * 6)] << 5; - qs[j + (i * 5)] |= rs[99 + (j * 6)] << 6; - qs[j + (i * 5)] |= rs[100 + (j * 6)] << 7; - qs[j + (i * 5)] |= rs[101 + (j * 6)] << 1; - qs[j + (i * 5)] |= rs[102 + (j * 6)] << 2; - qs[j + (i * 5)] |= rs[103 + (j * 6)] << 3; - } - - A = (rs[210] << 3) | (rs[208] << 2) | (rs[206] << 1) | rs[204]; - B = (rs[211] << 3) | (rs[209] << 2) | (rs[207] << 1) | rs[205]; - } - else if (trellis_group == 2074) { - for (int j = 0; j < 5; j++) { - qs[j + (i * 5)] |= rs[128 + (j * 6)] << 5; - qs[j + (i * 5)] |= rs[129 + (j * 6)] << 6; - qs[j + (i * 5)] |= rs[130 + (j * 6)] << 7; - qs[j + (i * 5)] |= rs[131 + (j * 6)] << 1; - qs[j + (i * 5)] |= rs[132 + (j * 6)] << 2; - qs[j + (i * 5)] |= rs[133 + (j * 6)] << 3; - } - - A = (rs[218] << 3) | (rs[216] << 2) | (rs[214] << 1) | rs[212]; - B = (rs[219] << 3) | (rs[217] << 2) | (rs[215] << 1) | rs[213]; - } - else if (trellis_group == 2075) { - for (int j = 0; j < 5; j++) { - qs[j + (i * 5)] |= rs[158 + (j * 6)] << 5; - qs[j + (i * 5)] |= rs[159 + (j * 6)] << 6; - qs[j + (i * 5)] |= rs[160 + (j * 6)] << 7; - qs[j + (i * 5)] |= rs[161 + (j * 6)] << 1; - qs[j + (i * 5)] |= rs[162 + (j * 6)] << 2; - qs[j + (i * 5)] |= rs[163 + (j * 6)] << 3; - } - - A = (rs[226] << 3) | (rs[224] << 2) | (rs[222] << 1) | rs[220]; - B = (rs[227] << 3) | (rs[225] << 2) | (rs[223] << 1) | rs[221]; - } - else { - qs[0 + (i * 5)] |= rs[2 + (i * 38)] << 5; /* A1 */ - qs[0 + (i * 5)] |= rs[3 + (i * 38)] << 6; /* A2 */ - qs[0 + (i * 5)] |= rs[4 + (i * 38)] << 7; /* A3 */ - qs[0 + (i * 5)] |= rs[5 + (i * 38)] << 1; /* B1 */ - qs[0 + (i * 5)] |= rs[6 + (i * 38)] << 2; /* B2 */ - qs[0 + (i * 5)] |= rs[7 + (i * 38)] << 3; /* B3 */ - qs[1 + (i * 5)] |= rs[10 + (i * 38)] << 5; /* A5 */ - qs[1 + (i * 5)] |= rs[11 + (i * 38)] << 6; /* A6 */ - qs[1 + (i * 5)] |= rs[12 + (i * 38)] << 7; /* A7 */ - qs[1 + (i * 5)] |= rs[13 + (i * 38)] << 1; /* B5 */ - qs[1 + (i * 5)] |= rs[14 + (i * 38)] << 2; /* B6 */ - qs[1 + (i * 5)] |= rs[15 + (i * 38)] << 3; /* B7 */ - qs[2 + (i * 5)] |= rs[18 + (i * 38)] << 5; /* A9 */ - qs[2 + (i * 5)] |= rs[19 + (i * 38)] << 6; /* A10 */ - qs[2 + (i * 5)] |= rs[20 + (i * 38)] << 7; /* A11 */ - qs[2 + (i * 5)] |= rs[21 + (i * 38)] << 1; /* B9 */ - qs[2 + (i * 5)] |= rs[22 + (i * 38)] << 2; /* B10 */ - qs[2 + (i * 5)] |= rs[23 + (i * 38)] << 3; /* B11 */ - qs[3 + (i * 5)] |= rs[26 + (i * 38)] << 5; /* A13 */ - qs[3 + (i * 5)] |= rs[27 + (i * 38)] << 6; /* A14 */ - qs[3 + (i * 5)] |= rs[28 + (i * 38)] << 7; /* A15 */ - qs[3 + (i * 5)] |= rs[29 + (i * 38)] << 1; /* B13 */ - qs[3 + (i * 5)] |= rs[30 + (i * 38)] << 2; /* B14 */ - qs[3 + (i * 5)] |= rs[31 + (i * 38)] << 3; /* B15 */ - qs[4 + (i * 5)] |= rs[32 + (i * 38)] << 5; /* A16 */ - qs[4 + (i * 5)] |= rs[33 + (i * 38)] << 6; /* A17 */ - qs[4 + (i * 5)] |= rs[34 + (i * 38)] << 7; /* A18 */ - qs[4 + (i * 5)] |= rs[35 + (i * 38)] << 1; /* B16 */ - qs[4 + (i * 5)] |= rs[36 + (i * 38)] << 2; /* B17 */ - qs[4 + (i * 5)] |= rs[37 + (i * 38)] << 3; /* B18 */ - - A = (rs[24 + (i * 38)] << 3) | (rs[16 + (i * 38)] << 2) | (rs[8 + (i * 38)] << 1) | rs[0 + (i * 38)]; - B = (rs[25 + (i * 38)] << 3) | (rs[17 + (i * 38)] << 2) | (rs[9 + (i * 38)] << 1) | rs[1 + (i * 38)]; + for (int j = 0; j < 5; j++) { + qs[j + (i * 5)] |= rs[38 + (j * 6)] << 5; + qs[j + (i * 5)] |= rs[39 + (j * 6)] << 6; + qs[j + (i * 5)] |= rs[40 + (j * 6)] << 7; + qs[j + (i * 5)] |= rs[41 + (j * 6)] << 1; + qs[j + (i * 5)] |= rs[42 + (j * 6)] << 2; + qs[j + (i * 5)] |= rs[43 + (j * 6)] << 3; + } + + A = (rs[194] << 3) | (rs[192] << 2) | (rs[190] << 1) | rs[188]; + B = (rs[195] << 3) | (rs[193] << 2) | (rs[191] << 1) | rs[189]; + } else if (trellis_group == 2072) { + for (int j = 0; j < 5; j++) { + qs[j + (i * 5)] |= rs[68 + (j * 6)] << 5; + qs[j + (i * 5)] |= rs[69 + (j * 6)] << 6; + qs[j + (i * 5)] |= rs[70 + (j * 6)] << 7; + qs[j + (i * 5)] |= rs[71 + (j * 6)] << 1; + qs[j + (i * 5)] |= rs[72 + (j * 6)] << 2; + qs[j + (i * 5)] |= rs[73 + (j * 6)] << 3; + } + + A = (rs[202] << 3) | (rs[200] << 2) | (rs[198] << 1) | rs[196]; + B = (rs[203] << 3) | (rs[201] << 2) | (rs[199] << 1) | rs[197]; + } else if (trellis_group == 2073) { + for (int j = 0; j < 5; j++) { + qs[j + (i * 5)] |= rs[98 + (j * 6)] << 5; + qs[j + (i * 5)] |= rs[99 + (j * 6)] << 6; + qs[j + (i * 5)] |= rs[100 + (j * 6)] << 7; + qs[j + (i * 5)] |= rs[101 + (j * 6)] << 1; + qs[j + (i * 5)] |= rs[102 + (j * 6)] << 2; + qs[j + (i * 5)] |= rs[103 + (j * 6)] << 3; + } + + A = (rs[210] << 3) | (rs[208] << 2) | (rs[206] << 1) | rs[204]; + B = (rs[211] << 3) | (rs[209] << 2) | (rs[207] << 1) | rs[205]; + } else if (trellis_group == 2074) { + for (int j = 0; j < 5; j++) { + qs[j + (i * 5)] |= rs[128 + (j * 6)] << 5; + qs[j + (i * 5)] |= rs[129 + (j * 6)] << 6; + qs[j + (i * 5)] |= rs[130 + (j * 6)] << 7; + qs[j + (i * 5)] |= rs[131 + (j * 6)] << 1; + qs[j + (i * 5)] |= rs[132 + (j * 6)] << 2; + qs[j + (i * 5)] |= rs[133 + (j * 6)] << 3; + } + + A = (rs[218] << 3) | (rs[216] << 2) | (rs[214] << 1) | rs[212]; + B = (rs[219] << 3) | (rs[217] << 2) | (rs[215] << 1) | rs[213]; + } else if (trellis_group == 2075) { + for (int j = 0; j < 5; j++) { + qs[j + (i * 5)] |= rs[158 + (j * 6)] << 5; + qs[j + (i * 5)] |= rs[159 + (j * 6)] << 6; + qs[j + (i * 5)] |= rs[160 + (j * 6)] << 7; + qs[j + (i * 5)] |= rs[161 + (j * 6)] << 1; + qs[j + (i * 5)] |= rs[162 + (j * 6)] << 2; + qs[j + (i * 5)] |= rs[163 + (j * 6)] << 3; + } + + A = (rs[226] << 3) | (rs[224] << 2) | (rs[222] << 1) | rs[220]; + B = (rs[227] << 3) | (rs[225] << 2) | (rs[223] << 1) | rs[221]; + } else { + qs[0 + (i * 5)] |= rs[2 + (i * 38)] << 5; /* A1 */ + qs[0 + (i * 5)] |= rs[3 + (i * 38)] << 6; /* A2 */ + qs[0 + (i * 5)] |= rs[4 + (i * 38)] << 7; /* A3 */ + qs[0 + (i * 5)] |= rs[5 + (i * 38)] << 1; /* B1 */ + qs[0 + (i * 5)] |= rs[6 + (i * 38)] << 2; /* B2 */ + qs[0 + (i * 5)] |= rs[7 + (i * 38)] << 3; /* B3 */ + qs[1 + (i * 5)] |= rs[10 + (i * 38)] << 5; /* A5 */ + qs[1 + (i * 5)] |= rs[11 + (i * 38)] << 6; /* A6 */ + qs[1 + (i * 5)] |= rs[12 + (i * 38)] << 7; /* A7 */ + qs[1 + (i * 5)] |= rs[13 + (i * 38)] << 1; /* B5 */ + qs[1 + (i * 5)] |= rs[14 + (i * 38)] << 2; /* B6 */ + qs[1 + (i * 5)] |= rs[15 + (i * 38)] << 3; /* B7 */ + qs[2 + (i * 5)] |= rs[18 + (i * 38)] << 5; /* A9 */ + qs[2 + (i * 5)] |= rs[19 + (i * 38)] << 6; /* A10 */ + qs[2 + (i * 5)] |= rs[20 + (i * 38)] << 7; /* A11 */ + qs[2 + (i * 5)] |= rs[21 + (i * 38)] << 1; /* B9 */ + qs[2 + (i * 5)] |= rs[22 + (i * 38)] << 2; /* B10 */ + qs[2 + (i * 5)] |= rs[23 + (i * 38)] << 3; /* B11 */ + qs[3 + (i * 5)] |= rs[26 + (i * 38)] << 5; /* A13 */ + qs[3 + (i * 5)] |= rs[27 + (i * 38)] << 6; /* A14 */ + qs[3 + (i * 5)] |= rs[28 + (i * 38)] << 7; /* A15 */ + qs[3 + (i * 5)] |= rs[29 + (i * 38)] << 1; /* B13 */ + qs[3 + (i * 5)] |= rs[30 + (i * 38)] << 2; /* B14 */ + qs[3 + (i * 5)] |= rs[31 + (i * 38)] << 3; /* B15 */ + qs[4 + (i * 5)] |= rs[32 + (i * 38)] << 5; /* A16 */ + qs[4 + (i * 5)] |= rs[33 + (i * 38)] << 6; /* A17 */ + qs[4 + (i * 5)] |= rs[34 + (i * 38)] << 7; /* A18 */ + qs[4 + (i * 5)] |= rs[35 + (i * 38)] << 1; /* B16 */ + qs[4 + (i * 5)] |= rs[36 + (i * 38)] << 2; /* B17 */ + qs[4 + (i * 5)] |= rs[37 + (i * 38)] << 3; /* B18 */ + + A = (rs[24 + (i * 38)] << 3) | (rs[16 + (i * 38)] << 2) | + (rs[8 + (i * 38)] << 1) | rs[0 + (i * 38)]; + B = (rs[25 + (i * 38)] << 3) | (rs[17 + (i * 38)] << 2) | + (rs[9 + (i * 38)] << 1) | rs[1 + (i * 38)]; } X = diff_precoder_table[XYp][A][B][1]; @@ -304,50 +297,47 @@ namespace gr { XYp = diff_precoder_table[XYp][A][B][0]; for (n = 0; n < 5; n++) { - qs[n + (i * 5)] |= trellis_table_x[Xq][X][1+n] << 1; - qs[n + (i * 5)] |= trellis_table_y[Yq][Y][1+n]; + qs[n + (i * 5)] |= trellis_table_x[Xq][X][1 + n] << 1; + qs[n + (i * 5)] |= trellis_table_y[Yq][Y][1 + n]; } Xq = trellis_table_x[Xq][X][0]; Yq = trellis_table_y[Yq][Y][0]; trellis_group++; if (trellis_group == 2076) { - trellis_group = 0; + trellis_group = 0; } - } } +} - int - catv_trellis_enc_bb_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; +int catv_trellis_enc_bb_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; - int i = 0, j = 0; + int i = 0, j = 0; - while (i < noutput_items) { + while (i < noutput_items) { if (signal_constellation == CATV_MOD_64QAM) { - trellis_code_64qam(in + j, out + i); - i += 5; - j += 28; - } - else { - trellis_code_256qam(in + j, out + i); - i += 5 * 6; - j += 38 * 6; + trellis_code_64qam(in + j, out + i); + i += 5; + j += 28; + } else { + trellis_code_256qam(in + j, out + i); + i += 5 * 6; + j += 38 * 6; } - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (j); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(j); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/catv/catv_trellis_enc_bb_impl.h b/gr-dtv/lib/catv/catv_trellis_enc_bb_impl.h index 6a94945460..15d3b46b67 100644 --- a/gr-dtv/lib/catv/catv_trellis_enc_bb_impl.h +++ b/gr-dtv/lib/catv/catv_trellis_enc_bb_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2016,2017 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -24,40 +24,40 @@ #include <gnuradio/dtv/catv_trellis_enc_bb.h> namespace gr { - namespace dtv { - - class catv_trellis_enc_bb_impl : public catv_trellis_enc_bb - { - private: - unsigned char diff_precoder_table[4][16][16][3]; - unsigned char G1table[32]; - unsigned char G2table[32]; - unsigned char trellis_table_x[16][16][6]; - unsigned char trellis_table_y[16][16][6]; - unsigned char Xq, Yq, XYp; - int signal_constellation; - int trellis_group; - - void diff_precoder(unsigned char W, unsigned char Z, unsigned char *Xp, unsigned char *Yp); - void init_trellis(); - void trellis_code_64qam(const unsigned char *rs, unsigned char *qs); - void trellis_code_256qam(const unsigned char *rs, unsigned char *qs); - - public: - catv_trellis_enc_bb_impl(catv_constellation_t constellation); - ~catv_trellis_enc_bb_impl(); - - // Where all the action really happens - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class catv_trellis_enc_bb_impl : public catv_trellis_enc_bb +{ +private: + unsigned char diff_precoder_table[4][16][16][3]; + unsigned char G1table[32]; + unsigned char G2table[32]; + unsigned char trellis_table_x[16][16][6]; + unsigned char trellis_table_y[16][16][6]; + unsigned char Xq, Yq, XYp; + int signal_constellation; + int trellis_group; + + void + diff_precoder(unsigned char W, unsigned char Z, unsigned char* Xp, unsigned char* Yp); + void init_trellis(); + void trellis_code_64qam(const unsigned char* rs, unsigned char* qs); + void trellis_code_256qam(const unsigned char* rs, unsigned char* qs); + +public: + catv_trellis_enc_bb_impl(catv_constellation_t constellation); + ~catv_trellis_enc_bb_impl(); + + // Where all the action really happens + void forecast(int noutput_items, gr_vector_int& ninput_items_required); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_CATV_TRELLIS_ENC_BB_IMPL_H */ - diff --git a/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.cc b/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.cc index 123e7fb15e..d16c41e379 100644 --- a/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.cc +++ b/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,575 +26,564 @@ #include "dvb_bbheader_bb_impl.h" namespace gr { - namespace dtv { +namespace dtv { - dvb_bbheader_bb::sptr - dvb_bbheader_bb::make(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate, dvbs2_rolloff_factor_t rolloff, dvbt2_inputmode_t mode, dvbt2_inband_t inband, int fecblocks, int tsrate) - { - return gnuradio::get_initial_sptr - (new dvb_bbheader_bb_impl(standard, framesize, rate, rolloff, mode, inband, fecblocks, tsrate)); - } +dvb_bbheader_bb::sptr dvb_bbheader_bb::make(dvb_standard_t standard, + dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvbs2_rolloff_factor_t rolloff, + dvbt2_inputmode_t mode, + dvbt2_inband_t inband, + int fecblocks, + int tsrate) +{ + return gnuradio::get_initial_sptr(new dvb_bbheader_bb_impl( + standard, framesize, rate, rolloff, mode, inband, fecblocks, tsrate)); +} - /* - * The private constructor - */ - dvb_bbheader_bb_impl::dvb_bbheader_bb_impl(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate, dvbs2_rolloff_factor_t rolloff, dvbt2_inputmode_t mode, dvbt2_inband_t inband, int fecblocks, int tsrate) - : gr::block("dvb_bbheader_bb", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(unsigned char))) - { - count = 0; - crc = 0x0; - dvbs2x = FALSE; - alternate = TRUE; - nibble = TRUE; - frame_size = framesize; - BBHeader *f = &m_format[0].bb_header; - if (framesize == FECFRAME_NORMAL) { +/* + * The private constructor + */ +dvb_bbheader_bb_impl::dvb_bbheader_bb_impl(dvb_standard_t standard, + dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvbs2_rolloff_factor_t rolloff, + dvbt2_inputmode_t mode, + dvbt2_inband_t inband, + int fecblocks, + int tsrate) + : gr::block("dvb_bbheader_bb", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(unsigned char))) +{ + count = 0; + crc = 0x0; + dvbs2x = FALSE; + alternate = TRUE; + nibble = TRUE; + frame_size = framesize; + BBHeader* f = &m_format[0].bb_header; + if (framesize == FECFRAME_NORMAL) { switch (rate) { - case C1_4: + case C1_4: kbch = 16008; break; - case C1_3: + case C1_3: kbch = 21408; break; - case C2_5: + case C2_5: kbch = 25728; break; - case C1_2: + case C1_2: kbch = 32208; break; - case C3_5: + case C3_5: kbch = 38688; break; - case C2_3: + case C2_3: kbch = 43040; break; - case C3_4: + case C3_4: kbch = 48408; break; - case C4_5: + case C4_5: kbch = 51648; break; - case C5_6: + case C5_6: kbch = 53840; break; - case C8_9: + case C8_9: kbch = 57472; break; - case C9_10: + case C9_10: kbch = 58192; break; - case C2_9_VLSNR: + case C2_9_VLSNR: kbch = 14208; break; - case C13_45: + case C13_45: kbch = 18528; break; - case C9_20: + case C9_20: kbch = 28968; break; - case C90_180: + case C90_180: kbch = 32208; break; - case C96_180: + case C96_180: kbch = 34368; break; - case C11_20: + case C11_20: kbch = 35448; break; - case C100_180: + case C100_180: kbch = 35808; break; - case C104_180: + case C104_180: kbch = 37248; break; - case C26_45: + case C26_45: kbch = 37248; break; - case C18_30: + case C18_30: kbch = 38688; break; - case C28_45: + case C28_45: kbch = 40128; break; - case C23_36: + case C23_36: kbch = 41208; break; - case C116_180: + case C116_180: kbch = 41568; break; - case C20_30: + case C20_30: kbch = 43008; break; - case C124_180: + case C124_180: kbch = 44448; break; - case C25_36: + case C25_36: kbch = 44808; break; - case C128_180: + case C128_180: kbch = 45888; break; - case C13_18: + case C13_18: kbch = 46608; break; - case C132_180: + case C132_180: kbch = 47328; break; - case C22_30: + case C22_30: kbch = 47328; break; - case C135_180: + case C135_180: kbch = 48408; break; - case C140_180: + case C140_180: kbch = 50208; break; - case C7_9: + case C7_9: kbch = 50208; break; - case C154_180: + case C154_180: kbch = 55248; break; - default: + default: kbch = 0; break; } - } - else if (framesize == FECFRAME_SHORT) { + } else if (framesize == FECFRAME_SHORT) { switch (rate) { - case C1_4: + case C1_4: kbch = 3072; break; - case C1_3: + case C1_3: kbch = 5232; break; - case C2_5: + case C2_5: kbch = 6312; break; - case C1_2: + case C1_2: kbch = 7032; break; - case C3_5: + case C3_5: kbch = 9552; break; - case C2_3: + case C2_3: kbch = 10632; break; - case C3_4: + case C3_4: kbch = 11712; break; - case C4_5: + case C4_5: kbch = 12432; break; - case C5_6: + case C5_6: kbch = 13152; break; - case C8_9: + case C8_9: kbch = 14232; break; - case C11_45: + case C11_45: kbch = 3792; break; - case C4_15: + case C4_15: kbch = 4152; break; - case C14_45: + case C14_45: kbch = 4872; break; - case C7_15: + case C7_15: kbch = 7392; break; - case C8_15: + case C8_15: kbch = 8472; break; - case C26_45: + case C26_45: kbch = 9192; break; - case C32_45: + case C32_45: kbch = 11352; break; - case C1_5_VLSNR_SF2: + case C1_5_VLSNR_SF2: kbch = 2512; break; - case C11_45_VLSNR_SF2: + case C11_45_VLSNR_SF2: kbch = 3792; break; - case C1_5_VLSNR: + case C1_5_VLSNR: kbch = 3072; break; - case C4_15_VLSNR: + case C4_15_VLSNR: kbch = 4152; break; - case C1_3_VLSNR: + case C1_3_VLSNR: kbch = 5232; break; - default: + default: kbch = 0; break; } - } - else { + } else { switch (rate) { - case C1_5_MEDIUM: + case C1_5_MEDIUM: kbch = 5660; break; - case C11_45_MEDIUM: + case C11_45_MEDIUM: kbch = 7740; break; - case C1_3_MEDIUM: + case C1_3_MEDIUM: kbch = 10620; break; - default: + default: kbch = 0; break; } - } + } - if (standard == STANDARD_DVBS2) { + if (standard == STANDARD_DVBS2) { mode = INPUTMODE_NORMAL; inband_type_b = FALSE; - } - f->ts_gs = TS_GS_TRANSPORT; - f->sis_mis = SIS_MIS_SINGLE; - f->ccm_acm = CCM; - f->issyi = ISSYI_NOT_ACTIVE; - f->npd = NPD_NOT_ACTIVE; - if (mode == INPUTMODE_NORMAL) { - f->upl = 188 * 8; - f->dfl = kbch - 80; + } + f->ts_gs = TS_GS_TRANSPORT; + f->sis_mis = SIS_MIS_SINGLE; + f->ccm_acm = CCM; + f->issyi = ISSYI_NOT_ACTIVE; + f->npd = NPD_NOT_ACTIVE; + if (mode == INPUTMODE_NORMAL) { + f->upl = 188 * 8; + f->dfl = kbch - 80; f->sync = 0x47; - } - else { - f->upl = 0; - f->dfl = kbch - 80; + } else { + f->upl = 0; + f->dfl = kbch - 80; f->sync = 0; - } - if (standard == STANDARD_DVBS2) { + } + if (standard == STANDARD_DVBS2) { if (rolloff & 0x4) { - dvbs2x = TRUE; + dvbs2x = TRUE; } f->ro = rolloff & 0x3; - } - else { + } else { f->ro = 0; - } + } - build_crc8_table(); - input_mode = mode; - inband_type_b = inband; - fec_blocks = fecblocks; - fec_block = 0; - ts_rate = tsrate; - extra = (((kbch - 80) / 8) / 187) + 1; - if (framesize != FECFRAME_MEDIUM) { + build_crc8_table(); + input_mode = mode; + inband_type_b = inband; + fec_blocks = fecblocks; + fec_block = 0; + ts_rate = tsrate; + extra = (((kbch - 80) / 8) / 187) + 1; + if (framesize != FECFRAME_MEDIUM) { set_output_multiple(kbch); - } - else { + } else { set_output_multiple(kbch * 2); - } } +} - /* - * Our virtual destructor. - */ - dvb_bbheader_bb_impl::~dvb_bbheader_bb_impl() - { - } +/* + * Our virtual destructor. + */ +dvb_bbheader_bb_impl::~dvb_bbheader_bb_impl() {} - void - dvb_bbheader_bb_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - if (input_mode == INPUTMODE_NORMAL) { +void dvb_bbheader_bb_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + if (input_mode == INPUTMODE_NORMAL) { if (frame_size != FECFRAME_MEDIUM) { - ninput_items_required[0] = ((noutput_items - 80) / 8); + ninput_items_required[0] = ((noutput_items - 80) / 8); + } else { + ninput_items_required[0] = ((noutput_items - 160) / 8); } - else { - ninput_items_required[0] = ((noutput_items - 160) / 8); - } - } - else { + } else { ninput_items_required[0] = ((noutput_items - 80) / 8) + extra; - } } +} #define CRC_POLY 0xAB // Reversed #define CRC_POLYR 0xD5 - void - dvb_bbheader_bb_impl::build_crc8_table(void) - { - int r, crc; +void dvb_bbheader_bb_impl::build_crc8_table(void) +{ + int r, crc; - for (int i = 0; i < 256; i++) { + for (int i = 0; i < 256; i++) { r = i; crc = 0; for (int j = 7; j >= 0; j--) { - if ((r & (1 << j) ? 1 : 0) ^ ((crc & 0x80) ? 1 : 0)) { - crc = (crc << 1) ^ CRC_POLYR; - } - else { - crc <<= 1; - } + if ((r & (1 << j) ? 1 : 0) ^ ((crc & 0x80) ? 1 : 0)) { + crc = (crc << 1) ^ CRC_POLYR; + } else { + crc <<= 1; + } } crc_tab[i] = crc; - } } +} - /* - * MSB is sent first - * - * The polynomial has been reversed - */ - int - dvb_bbheader_bb_impl::add_crc8_bits(unsigned char *in, int length) - { - int crc = 0; - int b; - int i = 0; +/* + * MSB is sent first + * + * The polynomial has been reversed + */ +int dvb_bbheader_bb_impl::add_crc8_bits(unsigned char* in, int length) +{ + int crc = 0; + int b; + int i = 0; - for (int n = 0; n < length; n++) { + for (int n = 0; n < length; n++) { b = in[i++] ^ (crc & 0x01); crc >>= 1; if (b) { - crc ^= CRC_POLY; + crc ^= CRC_POLY; } - } + } - if (input_mode == INPUTMODE_HIEFF) { + if (input_mode == INPUTMODE_HIEFF) { crc ^= 0x80; - } + } - for (int n = 0; n < 8; n++) { + for (int n = 0; n < 8; n++) { in[i++] = (crc & (1 << n)) ? 1 : 0; - } - return 8;// Length of CRC } + return 8; // Length of CRC +} - void - dvb_bbheader_bb_impl::add_bbheader(unsigned char *out, int count, int padding, bool nibble) - { - int temp, m_frame_offset_bits; - unsigned char *m_frame = out; - BBHeader *h = &m_format[0].bb_header; +void dvb_bbheader_bb_impl::add_bbheader(unsigned char* out, + int count, + int padding, + bool nibble) +{ + int temp, m_frame_offset_bits; + unsigned char* m_frame = out; + BBHeader* h = &m_format[0].bb_header; - m_frame[0] = h->ts_gs >> 1; - m_frame[1] = h->ts_gs & 1; - m_frame[2] = h->sis_mis; - m_frame[3] = h->ccm_acm; - m_frame[4] = h->issyi & 1; - m_frame[5] = h->npd & 1; - if (dvbs2x == TRUE) { + m_frame[0] = h->ts_gs >> 1; + m_frame[1] = h->ts_gs & 1; + m_frame[2] = h->sis_mis; + m_frame[3] = h->ccm_acm; + m_frame[4] = h->issyi & 1; + m_frame[5] = h->npd & 1; + if (dvbs2x == TRUE) { if (alternate == TRUE) { - alternate = FALSE; - m_frame[6] = 1; - m_frame[7] = 1; + alternate = FALSE; + m_frame[6] = 1; + m_frame[7] = 1; + } else { + alternate = TRUE; + m_frame[6] = h->ro >> 1; + m_frame[7] = h->ro & 1; } - else { - alternate = TRUE; - m_frame[6] = h->ro >> 1; - m_frame[7] = h->ro & 1; - } - } - else { + } else { m_frame[6] = h->ro >> 1; m_frame[7] = h->ro & 1; - } - m_frame_offset_bits = 8; - if (h->sis_mis == SIS_MIS_MULTIPLE) { + } + m_frame_offset_bits = 8; + if (h->sis_mis == SIS_MIS_MULTIPLE) { temp = h->isi; for (int n = 7; n >= 0; n--) { - m_frame[m_frame_offset_bits++] = temp & (1 << n) ? 1 : 0; + m_frame[m_frame_offset_bits++] = temp & (1 << n) ? 1 : 0; } - } - else { + } else { for (int n = 7; n >= 0; n--) { - m_frame[m_frame_offset_bits++] = 0; + m_frame[m_frame_offset_bits++] = 0; } - } - temp = h->upl; - for (int n = 15; n >= 0; n--) { + } + temp = h->upl; + for (int n = 15; n >= 0; n--) { m_frame[m_frame_offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = h->dfl - padding; - for (int n = 15; n >= 0; n--) { + } + temp = h->dfl - padding; + for (int n = 15; n >= 0; n--) { m_frame[m_frame_offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = h->sync; - for (int n = 7; n >= 0; n--) { + } + temp = h->sync; + for (int n = 7; n >= 0; n--) { m_frame[m_frame_offset_bits++] = temp & (1 << n) ? 1 : 0; - } - // Calculate syncd, this should point to the MSB of the CRC - temp = count; - if (temp == 0) { + } + // Calculate syncd, this should point to the MSB of the CRC + temp = count; + if (temp == 0) { temp = count; - } - else { + } else { temp = (188 - count) * 8; - } - if (nibble == FALSE) { + } + if (nibble == FALSE) { temp += 4; - } - for (int n = 15; n >= 0; n--) { + } + for (int n = 15; n >= 0; n--) { m_frame[m_frame_offset_bits++] = temp & (1 << n) ? 1 : 0; - } - // Add CRC to BB header, at end - int len = BB_HEADER_LENGTH_BITS; - m_frame_offset_bits += add_crc8_bits(m_frame, len); } + // Add CRC to BB header, at end + int len = BB_HEADER_LENGTH_BITS; + m_frame_offset_bits += add_crc8_bits(m_frame, len); +} - void - dvb_bbheader_bb_impl::add_inband_type_b(unsigned char *out, int ts_rate) - { - int temp, m_frame_offset_bits; - unsigned char *m_frame = out; +void dvb_bbheader_bb_impl::add_inband_type_b(unsigned char* out, int ts_rate) +{ + int temp, m_frame_offset_bits; + unsigned char* m_frame = out; - m_frame[0] = 0; - m_frame[1] = 1; - m_frame_offset_bits = 2; - for (int n = 30; n >= 0; n--) { + m_frame[0] = 0; + m_frame[1] = 1; + m_frame_offset_bits = 2; + for (int n = 30; n >= 0; n--) { m_frame[m_frame_offset_bits++] = 0; - } - for (int n = 21; n >= 0; n--) { + } + for (int n = 21; n >= 0; n--) { m_frame[m_frame_offset_bits++] = 0; - } - for (int n = 1; n >= 0; n--) { + } + for (int n = 1; n >= 0; n--) { m_frame[m_frame_offset_bits++] = 0; - } - for (int n = 9; n >= 0; n--) { + } + for (int n = 9; n >= 0; n--) { m_frame[m_frame_offset_bits++] = 0; - } - temp = ts_rate; - for (int n = 26; n >= 0; n--) { + } + temp = ts_rate; + for (int n = 26; n >= 0; n--) { m_frame[m_frame_offset_bits++] = temp & (1 << n) ? 1 : 0; - } - for (int n = 9; n >= 0; n--) { + } + for (int n = 9; n >= 0; n--) { m_frame[m_frame_offset_bits++] = 0; - } } +} - int - dvb_bbheader_bb_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; - int consumed = 0; - int offset = 0; - int padding; - unsigned char b; +int dvb_bbheader_bb_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; + int consumed = 0; + int offset = 0; + int padding; + unsigned char b; - for (int i = 0; i < noutput_items; i += kbch) { + for (int i = 0; i < noutput_items; i += kbch) { if (frame_size != FECFRAME_MEDIUM) { - if (fec_block == 0 && inband_type_b == TRUE) { - padding = 104; - } - else { - padding = 0; - } - add_bbheader(&out[offset], count, padding, TRUE); - offset = offset + 80; + if (fec_block == 0 && inband_type_b == TRUE) { + padding = 104; + } else { + padding = 0; + } + add_bbheader(&out[offset], count, padding, TRUE); + offset = offset + 80; - if (input_mode == INPUTMODE_HIEFF) { - for (int j = 0; j < (int)((kbch - 80 - padding) / 8); j++) { - if (count == 0) { - if (*in != 0x47) { - GR_LOG_WARN(d_logger, "Transport Stream sync error!"); + if (input_mode == INPUTMODE_HIEFF) { + for (int j = 0; j < (int)((kbch - 80 - padding) / 8); j++) { + if (count == 0) { + if (*in != 0x47) { + GR_LOG_WARN(d_logger, "Transport Stream sync error!"); + } + j--; + in++; + } else { + b = *in++; + for (int n = 7; n >= 0; n--) { + out[offset++] = b & (1 << n) ? 1 : 0; + } + } + count = (count + 1) % 188; + consumed++; } - j--; - in++; - } - else { - b = *in++; - for (int n = 7; n >= 0; n--) { - out[offset++] = b & (1 << n) ? 1 : 0; + if (fec_block == 0 && inband_type_b == TRUE) { + add_inband_type_b(&out[offset], ts_rate); + offset = offset + 104; } - } - count = (count + 1) % 188; - consumed++; - } - if (fec_block == 0 && inband_type_b == TRUE) { - add_inband_type_b(&out[offset], ts_rate); - offset = offset + 104; - } - } - else { - for (int j = 0; j < (int)((kbch - 80 - padding) / 8); j++) { - if (count == 0) { - if (*in != 0x47) { - GR_LOG_WARN(d_logger, "Transport Stream sync error!"); + } else { + for (int j = 0; j < (int)((kbch - 80 - padding) / 8); j++) { + if (count == 0) { + if (*in != 0x47) { + GR_LOG_WARN(d_logger, "Transport Stream sync error!"); + } + in++; + b = crc; + crc = 0; + } else { + b = *in++; + crc = crc_tab[b ^ crc]; + } + count = (count + 1) % 188; + consumed++; + for (int n = 7; n >= 0; n--) { + out[offset++] = b & (1 << n) ? 1 : 0; + } + } + if (fec_block == 0 && inband_type_b == TRUE) { + add_inband_type_b(&out[offset], ts_rate); + offset = offset + 104; } - in++; - b = crc; - crc = 0; - } - else { - b = *in++; - crc = crc_tab[b ^ crc]; - } - count = (count + 1) % 188; - consumed++; - for (int n = 7; n >= 0; n--) { - out[offset++] = b & (1 << n) ? 1 : 0; - } } - if (fec_block == 0 && inband_type_b == TRUE) { - add_inband_type_b(&out[offset], ts_rate); - offset = offset + 104; + if (inband_type_b == TRUE) { + fec_block = (fec_block + 1) % fec_blocks; } - } - if (inband_type_b == TRUE) { - fec_block = (fec_block + 1) % fec_blocks; - } - } - else { - padding = 0; - add_bbheader(&out[offset], count, padding, nibble); - offset = offset + 80; - for (int j = 0; j < (int)((kbch - 80) / 4); j++) { - if (nibble == TRUE) { - if (count == 0) { - if (*in != 0x47) { - GR_LOG_WARN(d_logger, "Transport Stream sync error!"); + } else { + padding = 0; + add_bbheader(&out[offset], count, padding, nibble); + offset = offset + 80; + for (int j = 0; j < (int)((kbch - 80) / 4); j++) { + if (nibble == TRUE) { + if (count == 0) { + if (*in != 0x47) { + GR_LOG_WARN(d_logger, "Transport Stream sync error!"); + } + in++; + b = crc; + crc = 0; + } else { + b = *in++; + crc = crc_tab[b ^ crc]; + } + bsave = b; + count = (count + 1) % 188; + consumed++; + for (int n = 7; n >= 4; n--) { + out[offset++] = b & (1 << n) ? 1 : 0; + } + nibble = FALSE; + } else { + for (int n = 3; n >= 0; n--) { + out[offset++] = bsave & (1 << n) ? 1 : 0; + } + nibble = TRUE; } - in++; - b = crc; - crc = 0; - } - else { - b = *in++; - crc = crc_tab[b ^ crc]; - } - bsave = b; - count = (count + 1) % 188; - consumed++; - for (int n = 7; n >= 4; n--) { - out[offset++] = b & (1 << n) ? 1 : 0; - } - nibble = FALSE; - } - else { - for (int n = 3; n >= 0; n--) { - out[offset++] = bsave & (1 << n) ? 1 : 0; - } - nibble = TRUE; } - } } - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (consumed); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(consumed); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.h b/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.h index 76f3369922..fade8ff903 100644 --- a/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.h +++ b/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -24,7 +24,7 @@ #include <gnuradio/dtv/dvb_bbheader_bb.h> #include "dvb_defines.h" -typedef struct{ +typedef struct { int ts_gs; int sis_mis; int ccm_acm; @@ -36,53 +36,59 @@ typedef struct{ int dfl; int sync; int syncd; -}BBHeader; +} BBHeader; -typedef struct{ - BBHeader bb_header; -}FrameFormat; +typedef struct { + BBHeader bb_header; +} FrameFormat; namespace gr { - namespace dtv { +namespace dtv { - class dvb_bbheader_bb_impl : public dvb_bbheader_bb - { - private: - unsigned int kbch; - unsigned int count; - unsigned char crc; - unsigned int input_mode; - unsigned int extra; - unsigned int frame_size; - unsigned char bsave; - int inband_type_b; - int fec_blocks; - int fec_block; - int ts_rate; - bool dvbs2x; - bool alternate; - bool nibble; - FrameFormat m_format[1]; - unsigned char crc_tab[256]; - void add_bbheader(unsigned char *, int, int, bool); - void build_crc8_table(void); - int add_crc8_bits(unsigned char *, int); - void add_inband_type_b(unsigned char *, int); +class dvb_bbheader_bb_impl : public dvb_bbheader_bb +{ +private: + unsigned int kbch; + unsigned int count; + unsigned char crc; + unsigned int input_mode; + unsigned int extra; + unsigned int frame_size; + unsigned char bsave; + int inband_type_b; + int fec_blocks; + int fec_block; + int ts_rate; + bool dvbs2x; + bool alternate; + bool nibble; + FrameFormat m_format[1]; + unsigned char crc_tab[256]; + void add_bbheader(unsigned char*, int, int, bool); + void build_crc8_table(void); + int add_crc8_bits(unsigned char*, int); + void add_inband_type_b(unsigned char*, int); - public: - dvb_bbheader_bb_impl(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate, dvbs2_rolloff_factor_t rolloff, dvbt2_inputmode_t mode, dvbt2_inband_t inband, int fecblocks, int tsrate); - ~dvb_bbheader_bb_impl(); +public: + dvb_bbheader_bb_impl(dvb_standard_t standard, + dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvbs2_rolloff_factor_t rolloff, + dvbt2_inputmode_t mode, + dvbt2_inband_t inband, + int fecblocks, + int tsrate); + ~dvb_bbheader_bb_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVB_BBHEADER_BB_IMPL_H */ - diff --git a/gr-dtv/lib/dvb/dvb_bbscrambler_bb_impl.cc b/gr-dtv/lib/dvb/dvb_bbscrambler_bb_impl.cc index 90d5535599..4c2a9ecac9 100644 --- a/gr-dtv/lib/dvb/dvb_bbscrambler_bb_impl.cc +++ b/gr-dtv/lib/dvb/dvb_bbscrambler_bb_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016,2019 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,282 +26,277 @@ #include "dvb_bbscrambler_bb_impl.h" namespace gr { - namespace dtv { +namespace dtv { - dvb_bbscrambler_bb::sptr - dvb_bbscrambler_bb::make(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate) - { - return gnuradio::get_initial_sptr - (new dvb_bbscrambler_bb_impl(standard, framesize, rate)); - } +dvb_bbscrambler_bb::sptr dvb_bbscrambler_bb::make(dvb_standard_t standard, + dvb_framesize_t framesize, + dvb_code_rate_t rate) +{ + return gnuradio::get_initial_sptr( + new dvb_bbscrambler_bb_impl(standard, framesize, rate)); +} - /* - * The private constructor - */ - dvb_bbscrambler_bb_impl::dvb_bbscrambler_bb_impl(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate) - : gr::sync_block("dvb_bbscrambler_bb", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(unsigned char))) - { - if (framesize == FECFRAME_NORMAL) { +/* + * The private constructor + */ +dvb_bbscrambler_bb_impl::dvb_bbscrambler_bb_impl(dvb_standard_t standard, + dvb_framesize_t framesize, + dvb_code_rate_t rate) + : gr::sync_block("dvb_bbscrambler_bb", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(unsigned char))) +{ + if (framesize == FECFRAME_NORMAL) { switch (rate) { - case C1_4: + case C1_4: kbch = 16008; break; - case C1_3: + case C1_3: kbch = 21408; break; - case C2_5: + case C2_5: kbch = 25728; break; - case C1_2: + case C1_2: kbch = 32208; break; - case C3_5: + case C3_5: kbch = 38688; break; - case C2_3: + case C2_3: kbch = 43040; break; - case C3_4: + case C3_4: kbch = 48408; break; - case C4_5: + case C4_5: kbch = 51648; break; - case C5_6: + case C5_6: kbch = 53840; break; - case C8_9: + case C8_9: kbch = 57472; break; - case C9_10: + case C9_10: kbch = 58192; break; - case C2_9_VLSNR: + case C2_9_VLSNR: kbch = 14208; break; - case C13_45: + case C13_45: kbch = 18528; break; - case C9_20: + case C9_20: kbch = 28968; break; - case C90_180: + case C90_180: kbch = 32208; break; - case C96_180: + case C96_180: kbch = 34368; break; - case C11_20: + case C11_20: kbch = 35448; break; - case C100_180: + case C100_180: kbch = 35808; break; - case C104_180: + case C104_180: kbch = 37248; break; - case C26_45: + case C26_45: kbch = 37248; break; - case C18_30: + case C18_30: kbch = 38688; break; - case C28_45: + case C28_45: kbch = 40128; break; - case C23_36: + case C23_36: kbch = 41208; break; - case C116_180: + case C116_180: kbch = 41568; break; - case C20_30: + case C20_30: kbch = 43008; break; - case C124_180: + case C124_180: kbch = 44448; break; - case C25_36: + case C25_36: kbch = 44808; break; - case C128_180: + case C128_180: kbch = 45888; break; - case C13_18: + case C13_18: kbch = 46608; break; - case C132_180: + case C132_180: kbch = 47328; break; - case C22_30: + case C22_30: kbch = 47328; break; - case C135_180: + case C135_180: kbch = 48408; break; - case C140_180: + case C140_180: kbch = 50208; break; - case C7_9: + case C7_9: kbch = 50208; break; - case C154_180: + case C154_180: kbch = 55248; break; - default: + default: kbch = 0; break; } - } - else if (framesize == FECFRAME_SHORT) { + } else if (framesize == FECFRAME_SHORT) { switch (rate) { - case C1_4: + case C1_4: kbch = 3072; break; - case C1_3: + case C1_3: kbch = 5232; break; - case C2_5: + case C2_5: kbch = 6312; break; - case C1_2: + case C1_2: kbch = 7032; break; - case C3_5: + case C3_5: kbch = 9552; break; - case C2_3: + case C2_3: kbch = 10632; break; - case C3_4: + case C3_4: kbch = 11712; break; - case C4_5: + case C4_5: kbch = 12432; break; - case C5_6: + case C5_6: kbch = 13152; break; - case C8_9: + case C8_9: kbch = 14232; break; - case C11_45: + case C11_45: kbch = 3792; break; - case C4_15: + case C4_15: kbch = 4152; break; - case C14_45: + case C14_45: kbch = 4872; break; - case C7_15: + case C7_15: kbch = 7392; break; - case C8_15: + case C8_15: kbch = 8472; break; - case C26_45: + case C26_45: kbch = 9192; break; - case C32_45: + case C32_45: kbch = 11352; break; - case C1_5_VLSNR_SF2: + case C1_5_VLSNR_SF2: kbch = 2512; break; - case C11_45_VLSNR_SF2: + case C11_45_VLSNR_SF2: kbch = 3792; break; - case C1_5_VLSNR: + case C1_5_VLSNR: kbch = 3072; break; - case C4_15_VLSNR: + case C4_15_VLSNR: kbch = 4152; break; - case C1_3_VLSNR: + case C1_3_VLSNR: kbch = 5232; break; - default: + default: kbch = 0; break; } - } - else { + } else { switch (rate) { - case C1_5_MEDIUM: + case C1_5_MEDIUM: kbch = 5660; break; - case C11_45_MEDIUM: + case C11_45_MEDIUM: kbch = 7740; break; - case C1_3_MEDIUM: + case C1_3_MEDIUM: kbch = 10620; break; - default: + default: kbch = 0; break; } - } - - init_bb_randomiser(); - frame_size = framesize; - set_output_multiple(kbch); } - /* - * Our virtual destructor. - */ - dvb_bbscrambler_bb_impl::~dvb_bbscrambler_bb_impl() - { - } + init_bb_randomiser(); + frame_size = framesize; + set_output_multiple(kbch); +} - void - dvb_bbscrambler_bb_impl::init_bb_randomiser(void) - { - int sr = 0x4A80; - for (int i = 0; i < FRAME_SIZE_NORMAL; i++) { +/* + * Our virtual destructor. + */ +dvb_bbscrambler_bb_impl::~dvb_bbscrambler_bb_impl() {} + +void dvb_bbscrambler_bb_impl::init_bb_randomiser(void) +{ + int sr = 0x4A80; + for (int i = 0; i < FRAME_SIZE_NORMAL; i++) { int b = ((sr) ^ (sr >> 1)) & 1; bb_randomise[i] = b; sr >>= 1; - if(b) { - sr |= 0x4000; + if (b) { + sr |= 0x4000; } - } - bb_randomize32 = (uint32_t*)&bb_randomise[0]; - bb_randomize64 = (uint64_t*)&bb_randomise[0]; } + bb_randomize32 = (uint32_t*)&bb_randomise[0]; + bb_randomize64 = (uint64_t*)&bb_randomise[0]; +} - int - dvb_bbscrambler_bb_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const uint64_t *in = (const uint64_t *) input_items[0]; - uint64_t *out = (uint64_t *) output_items[0]; - const uint32_t *inm = (const uint32_t *) input_items[0]; - uint32_t *outm = (uint32_t *) output_items[0]; +int dvb_bbscrambler_bb_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const uint64_t* in = (const uint64_t*)input_items[0]; + uint64_t* out = (uint64_t*)output_items[0]; + const uint32_t* inm = (const uint32_t*)input_items[0]; + uint32_t* outm = (uint32_t*)output_items[0]; - if (frame_size != FECFRAME_MEDIUM) { + if (frame_size != FECFRAME_MEDIUM) { for (int i = 0; i < noutput_items; i += kbch) { - for (int j = 0; j < kbch / 8; ++j) { - *out++ = *in++ ^ bb_randomize64[j]; - } + for (int j = 0; j < kbch / 8; ++j) { + *out++ = *in++ ^ bb_randomize64[j]; + } } - } - else { + } else { for (int i = 0; i < noutput_items; i += kbch) { - for (int j = 0; j < kbch / 4; ++j) { - *outm++ = *inm++ ^ bb_randomize32[j]; - } + for (int j = 0; j < kbch / 4; ++j) { + *outm++ = *inm++ ^ bb_randomize32[j]; + } } - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ -} /* namespace gr */ + // Tell runtime system how many output items we produced. + return noutput_items; +} +} /* namespace dtv */ +} /* namespace gr */ diff --git a/gr-dtv/lib/dvb/dvb_bbscrambler_bb_impl.h b/gr-dtv/lib/dvb/dvb_bbscrambler_bb_impl.h index 547cd3544d..7483449980 100644 --- a/gr-dtv/lib/dvb/dvb_bbscrambler_bb_impl.h +++ b/gr-dtv/lib/dvb/dvb_bbscrambler_bb_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2019 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,29 +25,30 @@ #include "dvb_defines.h" namespace gr { - namespace dtv { - - class dvb_bbscrambler_bb_impl : public dvb_bbscrambler_bb - { - private: - int kbch; - int frame_size; - unsigned char bb_randomise[FRAME_SIZE_NORMAL]; - uint32_t* bb_randomize32; - uint64_t* bb_randomize64; - void init_bb_randomiser(void); - - public: - dvb_bbscrambler_bb_impl(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate); - ~dvb_bbscrambler_bb_impl(); - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class dvb_bbscrambler_bb_impl : public dvb_bbscrambler_bb +{ +private: + int kbch; + int frame_size; + unsigned char bb_randomise[FRAME_SIZE_NORMAL]; + uint32_t* bb_randomize32; + uint64_t* bb_randomize64; + void init_bb_randomiser(void); + +public: + dvb_bbscrambler_bb_impl(dvb_standard_t standard, + dvb_framesize_t framesize, + dvb_code_rate_t rate); + ~dvb_bbscrambler_bb_impl(); + + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVB_BBSCRAMBLER_BB_IMPL_H */ - diff --git a/gr-dtv/lib/dvb/dvb_bch_bb_impl.cc b/gr-dtv/lib/dvb/dvb_bch_bb_impl.cc index 48c73c3c75..9486c66e4f 100644 --- a/gr-dtv/lib/dvb/dvb_bch_bb_impl.cc +++ b/gr-dtv/lib/dvb/dvb_bch_bb_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016,2018,2019 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,514 +26,508 @@ #include "dvb_bch_bb_impl.h" namespace gr { - namespace dtv { +namespace dtv { - dvb_bch_bb::sptr - dvb_bch_bb::make(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate) - { - return gnuradio::get_initial_sptr - (new dvb_bch_bb_impl(standard, framesize, rate)); - } +dvb_bch_bb::sptr +dvb_bch_bb::make(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate) +{ + return gnuradio::get_initial_sptr(new dvb_bch_bb_impl(standard, framesize, rate)); +} - /* - * The private constructor - */ - dvb_bch_bb_impl::dvb_bch_bb_impl(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate) - : gr::block("dvb_bch_bb", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(unsigned char))) - { - if (framesize == FECFRAME_NORMAL) { +/* + * The private constructor + */ +dvb_bch_bb_impl::dvb_bch_bb_impl(dvb_standard_t standard, + dvb_framesize_t framesize, + dvb_code_rate_t rate) + : gr::block("dvb_bch_bb", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(unsigned char))) +{ + if (framesize == FECFRAME_NORMAL) { switch (rate) { - case C1_4: + case C1_4: kbch = 16008; nbch = 16200; bch_code = BCH_CODE_N12; break; - case C1_3: + case C1_3: kbch = 21408; nbch = 21600; bch_code = BCH_CODE_N12; break; - case C2_5: + case C2_5: kbch = 25728; nbch = 25920; bch_code = BCH_CODE_N12; break; - case C1_2: + case C1_2: kbch = 32208; nbch = 32400; bch_code = BCH_CODE_N12; break; - case C3_5: + case C3_5: kbch = 38688; nbch = 38880; bch_code = BCH_CODE_N12; break; - case C2_3: + case C2_3: kbch = 43040; nbch = 43200; bch_code = BCH_CODE_N10; break; - case C3_4: + case C3_4: kbch = 48408; nbch = 48600; bch_code = BCH_CODE_N12; break; - case C4_5: + case C4_5: kbch = 51648; nbch = 51840; bch_code = BCH_CODE_N12; break; - case C5_6: + case C5_6: kbch = 53840; nbch = 54000; bch_code = BCH_CODE_N10; break; - case C8_9: + case C8_9: kbch = 57472; nbch = 57600; bch_code = BCH_CODE_N8; break; - case C9_10: + case C9_10: kbch = 58192; nbch = 58320; bch_code = BCH_CODE_N8; break; - case C2_9_VLSNR: + case C2_9_VLSNR: kbch = 14208; nbch = 14400; bch_code = BCH_CODE_N12; break; - case C13_45: + case C13_45: kbch = 18528; nbch = 18720; bch_code = BCH_CODE_N12; break; - case C9_20: + case C9_20: kbch = 28968; nbch = 29160; bch_code = BCH_CODE_N12; break; - case C90_180: + case C90_180: kbch = 32208; nbch = 32400; bch_code = BCH_CODE_N12; break; - case C96_180: + case C96_180: kbch = 34368; nbch = 34560; bch_code = BCH_CODE_N12; break; - case C11_20: + case C11_20: kbch = 35448; nbch = 35640; bch_code = BCH_CODE_N12; break; - case C100_180: + case C100_180: kbch = 35808; nbch = 36000; bch_code = BCH_CODE_N12; break; - case C104_180: + case C104_180: kbch = 37248; nbch = 37440; bch_code = BCH_CODE_N12; break; - case C26_45: + case C26_45: kbch = 37248; nbch = 37440; bch_code = BCH_CODE_N12; break; - case C18_30: + case C18_30: kbch = 38688; nbch = 38880; bch_code = BCH_CODE_N12; break; - case C28_45: + case C28_45: kbch = 40128; nbch = 40320; bch_code = BCH_CODE_N12; break; - case C23_36: + case C23_36: kbch = 41208; nbch = 41400; bch_code = BCH_CODE_N12; break; - case C116_180: + case C116_180: kbch = 41568; nbch = 41760; bch_code = BCH_CODE_N12; break; - case C20_30: + case C20_30: kbch = 43008; nbch = 43200; bch_code = BCH_CODE_N12; break; - case C124_180: + case C124_180: kbch = 44448; nbch = 44640; bch_code = BCH_CODE_N12; break; - case C25_36: + case C25_36: kbch = 44808; nbch = 45000; bch_code = BCH_CODE_N12; break; - case C128_180: + case C128_180: kbch = 45888; nbch = 46080; bch_code = BCH_CODE_N12; break; - case C13_18: + case C13_18: kbch = 46608; nbch = 46800; bch_code = BCH_CODE_N12; break; - case C132_180: + case C132_180: kbch = 47328; nbch = 47520; bch_code = BCH_CODE_N12; break; - case C22_30: + case C22_30: kbch = 47328; nbch = 47520; bch_code = BCH_CODE_N12; break; - case C135_180: + case C135_180: kbch = 48408; nbch = 48600; bch_code = BCH_CODE_N12; break; - case C140_180: + case C140_180: kbch = 50208; nbch = 50400; bch_code = BCH_CODE_N12; break; - case C7_9: + case C7_9: kbch = 50208; nbch = 50400; bch_code = BCH_CODE_N12; break; - case C154_180: + case C154_180: kbch = 55248; nbch = 55440; bch_code = BCH_CODE_N12; break; - default: + default: kbch = 0; nbch = 0; bch_code = 0; break; } - } - else if (framesize == FECFRAME_SHORT) { + } else if (framesize == FECFRAME_SHORT) { switch (rate) { - case C1_4: + case C1_4: kbch = 3072; nbch = 3240; bch_code = BCH_CODE_S12; break; - case C1_3: + case C1_3: kbch = 5232; nbch = 5400; bch_code = BCH_CODE_S12; break; - case C2_5: + case C2_5: kbch = 6312; nbch = 6480; bch_code = BCH_CODE_S12; break; - case C1_2: + case C1_2: kbch = 7032; nbch = 7200; bch_code = BCH_CODE_S12; break; - case C3_5: + case C3_5: kbch = 9552; nbch = 9720; bch_code = BCH_CODE_S12; break; - case C2_3: + case C2_3: kbch = 10632; nbch = 10800; bch_code = BCH_CODE_S12; break; - case C3_4: + case C3_4: kbch = 11712; nbch = 11880; bch_code = BCH_CODE_S12; break; - case C4_5: + case C4_5: kbch = 12432; nbch = 12600; bch_code = BCH_CODE_S12; break; - case C5_6: + case C5_6: kbch = 13152; nbch = 13320; bch_code = BCH_CODE_S12; break; - case C8_9: + case C8_9: kbch = 14232; nbch = 14400; bch_code = BCH_CODE_S12; break; - case C11_45: + case C11_45: kbch = 3792; nbch = 3960; bch_code = BCH_CODE_S12; break; - case C4_15: + case C4_15: kbch = 4152; nbch = 4320; bch_code = BCH_CODE_S12; break; - case C14_45: + case C14_45: kbch = 4872; nbch = 5040; bch_code = BCH_CODE_S12; break; - case C7_15: + case C7_15: kbch = 7392; nbch = 7560; bch_code = BCH_CODE_S12; break; - case C8_15: + case C8_15: kbch = 8472; nbch = 8640; bch_code = BCH_CODE_S12; break; - case C26_45: + case C26_45: kbch = 9192; nbch = 9360; bch_code = BCH_CODE_S12; break; - case C32_45: + case C32_45: kbch = 11352; nbch = 11520; bch_code = BCH_CODE_S12; break; - case C1_5_VLSNR_SF2: + case C1_5_VLSNR_SF2: kbch = 2512; nbch = 2680; bch_code = BCH_CODE_S12; break; - case C11_45_VLSNR_SF2: + case C11_45_VLSNR_SF2: kbch = 3792; nbch = 3960; bch_code = BCH_CODE_S12; break; - case C1_5_VLSNR: + case C1_5_VLSNR: kbch = 3072; nbch = 3240; bch_code = BCH_CODE_S12; break; - case C4_15_VLSNR: + case C4_15_VLSNR: kbch = 4152; nbch = 4320; bch_code = BCH_CODE_S12; break; - case C1_3_VLSNR: + case C1_3_VLSNR: kbch = 5232; nbch = 5400; bch_code = BCH_CODE_S12; break; - default: + default: kbch = 0; nbch = 0; bch_code = 0; break; } - } - else { + } else { switch (rate) { - case C1_5_MEDIUM: + case C1_5_MEDIUM: kbch = 5660; nbch = 5840; bch_code = BCH_CODE_M12; break; - case C11_45_MEDIUM: + case C11_45_MEDIUM: kbch = 7740; nbch = 7920; bch_code = BCH_CODE_M12; break; - case C1_3_MEDIUM: + case C1_3_MEDIUM: kbch = 10620; nbch = 10800; bch_code = BCH_CODE_M12; break; - default: + default: kbch = 0; nbch = 0; bch_code = 0; break; } - } - - switch (bch_code) { - case BCH_CODE_N12: - num_parity_bits = 192; - break; - case BCH_CODE_N10: - num_parity_bits = 160; - break; - case BCH_CODE_N8: - num_parity_bits = 128; - break; - case BCH_CODE_M12: - num_parity_bits = 180; - break; - case BCH_CODE_S12: - num_parity_bits = 168; - break; - } - - bch_poly_build_tables(); - frame_size = framesize; - set_output_multiple(nbch); } - /* - * Our virtual destructor. - */ - dvb_bch_bb_impl::~dvb_bch_bb_impl() - { + switch (bch_code) { + case BCH_CODE_N12: + num_parity_bits = 192; + break; + case BCH_CODE_N10: + num_parity_bits = 160; + break; + case BCH_CODE_N8: + num_parity_bits = 128; + break; + case BCH_CODE_M12: + num_parity_bits = 180; + break; + case BCH_CODE_S12: + num_parity_bits = 168; + break; } - void - dvb_bch_bb_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = (noutput_items / nbch) * kbch; - } + bch_poly_build_tables(); + frame_size = framesize; + set_output_multiple(nbch); +} + +/* + * Our virtual destructor. + */ +dvb_bch_bb_impl::~dvb_bch_bb_impl() {} + +void dvb_bch_bb_impl::forecast(int noutput_items, gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = (noutput_items / nbch) * kbch; +} - /* - * Polynomial calculation routines - * multiply polynomials - */ - int - dvb_bch_bb_impl::poly_mult(const int *ina, int lena, const int *inb, int lenb, int *out) - { - memset(out, 0, sizeof(int) * (lena + lenb)); +/* + * Polynomial calculation routines + * multiply polynomials + */ +int dvb_bch_bb_impl::poly_mult( + const int* ina, int lena, const int* inb, int lenb, int* out) +{ + memset(out, 0, sizeof(int) * (lena + lenb)); - for (int i = 0; i < lena; i++) { + for (int i = 0; i < lena; i++) { for (int j = 0; j < lenb; j++) { - if (ina[i] * inb[j] > 0 ) { - out[i + j]++; // count number of terms for this pwr of x - } + if (ina[i] * inb[j] > 0) { + out[i + j]++; // count number of terms for this pwr of x + } } - } - int max = 0; - for (int i = 0; i < lena + lenb; i++) { - out[i] = out[i] & 1; // If even ignore the term - if(out[i]) { - max = i; + } + int max = 0; + for (int i = 0; i < lena + lenb; i++) { + out[i] = out[i] & 1; // If even ignore the term + if (out[i]) { + max = i; } - } - // return the size of array to house the result. - return max + 1; } + // return the size of array to house the result. + return max + 1; +} - //precalculate the crc from: http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html - cf. CRC-32 Lookup - void - dvb_bch_bb_impl::calculate_crc_table(void) - { - for (int divident = 0; divident < 256; divident++) { /* iterate over all possible input byte values 0 - 255 */ +// precalculate the crc from: +// http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html - cf. CRC-32 Lookup +void dvb_bch_bb_impl::calculate_crc_table(void) +{ + for (int divident = 0; divident < 256; + divident++) { /* iterate over all possible input byte values 0 - 255 */ std::bitset<MAX_BCH_PARITY_BITS> curByte(divident); curByte <<= num_parity_bits - 8; for (unsigned char bit = 0; bit < 8; bit++) { - if ((curByte[num_parity_bits - 1]) != 0) { - curByte <<= 1; - curByte ^= polynome; - } - else { - curByte <<= 1; - } + if ((curByte[num_parity_bits - 1]) != 0) { + curByte <<= 1; + curByte ^= polynome; + } else { + curByte <<= 1; + } } crc_table[divident] = curByte; - } } +} - void - dvb_bch_bb_impl::calculate_medium_crc_table(void) - { - for (int divident = 0; divident < 16; divident++) { /* iterate over all possible input byte values 0 - 15 */ +void dvb_bch_bb_impl::calculate_medium_crc_table(void) +{ + for (int divident = 0; divident < 16; + divident++) { /* iterate over all possible input byte values 0 - 15 */ std::bitset<MAX_BCH_PARITY_BITS> curByte(divident); curByte <<= num_parity_bits - 4; for (unsigned char bit = 0; bit < 4; bit++) { - if ((curByte[num_parity_bits - 1]) != 0) { - curByte <<= 1; - curByte ^= polynome; - } - else { - curByte <<= 1; - } + if ((curByte[num_parity_bits - 1]) != 0) { + curByte <<= 1; + curByte ^= polynome; + } else { + curByte <<= 1; + } } crc_medium_table[divident] = curByte; - } } - - void - dvb_bch_bb_impl::bch_poly_build_tables(void) - { - // Normal polynomials - const int polyn01[]={1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,1}; - const int polyn02[]={1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,0,1}; - const int polyn03[]={1,0,1,1,1,1,0,1,1,1,1,1,0,0,0,0,1}; - const int polyn04[]={1,0,1,0,1,0,1,0,0,1,0,1,1,0,1,0,1}; - const int polyn05[]={1,1,1,1,0,1,0,0,1,1,1,1,1,0,0,0,1}; - const int polyn06[]={1,0,1,0,1,1,0,1,1,1,1,0,1,1,1,1,1}; - const int polyn07[]={1,0,1,0,0,1,1,0,1,1,1,1,0,1,0,1,1}; - const int polyn08[]={1,1,1,0,0,1,1,0,1,1,0,0,1,1,1,0,1}; - const int polyn09[]={1,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,1}; - const int polyn10[]={1,1,1,0,0,1,0,1,1,0,1,0,1,1,1,0,1}; - const int polyn11[]={1,0,1,1,0,1,0,0,0,1,0,1,1,1,0,0,1}; - const int polyn12[]={1,1,0,0,0,1,1,1,0,1,0,1,1,0,0,0,1}; - - // Medium polynomials - const int polym01[]={1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,1}; - const int polym02[]={1,1,0,0,1,0,0,1,0,0,1,1,0,0,0,1}; - const int polym03[]={1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1}; - const int polym04[]={1,0,1,1,0,1,1,0,1,0,1,1,0,0,0,1}; - const int polym05[]={1,1,1,0,1,0,1,1,0,0,1,0,1,0,0,1}; - const int polym06[]={1,0,0,0,1,0,1,1,0,0,0,0,1,1,0,1}; - const int polym07[]={1,0,1,0,1,1,0,1,0,0,0,1,1,0,1,1}; - const int polym08[]={1,0,1,0,1,0,1,0,1,1,0,1,0,0,1,1}; - const int polym09[]={1,1,1,0,1,1,0,1,0,1,0,1,1,1,0,1}; - const int polym10[]={1,1,1,1,1,0,0,1,0,0,1,1,1,1,0,1}; - const int polym11[]={1,1,1,0,1,0,0,0,0,1,0,1,0,0,0,1}; - const int polym12[]={1,0,1,0,1,0,0,0,1,0,1,1,0,1,1,1}; - - // Short polynomials - const int polys01[]={1,1,0,1,0,1,0,0,0,0,0,0,0,0,1}; - const int polys02[]={1,0,0,0,0,0,1,0,1,0,0,1,0,0,1}; - const int polys03[]={1,1,1,0,0,0,1,0,0,1,1,0,0,0,1}; - const int polys04[]={1,0,0,0,1,0,0,1,1,0,1,0,1,0,1}; - const int polys05[]={1,0,1,0,1,0,1,0,1,1,0,1,0,1,1}; - const int polys06[]={1,0,0,1,0,0,0,1,1,1,0,0,0,1,1}; - const int polys07[]={1,0,1,0,0,1,1,1,0,0,1,1,0,1,1}; - const int polys08[]={1,0,0,0,0,1,0,0,1,1,1,1,0,0,1}; - const int polys09[]={1,1,1,1,0,0,0,0,0,1,1,0,0,0,1}; - const int polys10[]={1,0,0,1,0,0,1,0,0,1,0,1,1,0,1}; - const int polys11[]={1,0,0,0,1,0,0,0,0,0,0,1,1,0,1}; - const int polys12[]={1,1,1,1,0,1,1,1,1,0,1,0,0,1,1}; - - int len; - int polyout[2][200]; - -#define COPY_BCH_POLYNOME \ -for (unsigned int i = 0; i < num_parity_bits; i ++) {\ - polynome[i] = polyout[0][i];\ } - switch (bch_code) { - case BCH_CODE_N12: - case BCH_CODE_N10: - case BCH_CODE_N8: +void dvb_bch_bb_impl::bch_poly_build_tables(void) +{ + // Normal polynomials + const int polyn01[] = { 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; + const int polyn02[] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1 }; + const int polyn03[] = { 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1 }; + const int polyn04[] = { 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1 }; + const int polyn05[] = { 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1 }; + const int polyn06[] = { 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1 }; + const int polyn07[] = { 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1 }; + const int polyn08[] = { 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1 }; + const int polyn09[] = { 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1 }; + const int polyn10[] = { 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1 }; + const int polyn11[] = { 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1 }; + const int polyn12[] = { 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1 }; + + // Medium polynomials + const int polym01[] = { 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; + const int polym02[] = { 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1 }; + const int polym03[] = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1 }; + const int polym04[] = { 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1 }; + const int polym05[] = { 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1 }; + const int polym06[] = { 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1 }; + const int polym07[] = { 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1 }; + const int polym08[] = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1 }; + const int polym09[] = { 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1 }; + const int polym10[] = { 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1 }; + const int polym11[] = { 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1 }; + const int polym12[] = { 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1 }; + + // Short polynomials + const int polys01[] = { 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; + const int polys02[] = { 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1 }; + const int polys03[] = { 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1 }; + const int polys04[] = { 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1 }; + const int polys05[] = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1 }; + const int polys06[] = { 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1 }; + const int polys07[] = { 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1 }; + const int polys08[] = { 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1 }; + const int polys09[] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1 }; + const int polys10[] = { 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1 }; + const int polys11[] = { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1 }; + const int polys12[] = { 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1 }; + + int len; + int polyout[2][200]; + +#define COPY_BCH_POLYNOME \ + for (unsigned int i = 0; i < num_parity_bits; i++) { \ + polynome[i] = polyout[0][i]; \ + } + + switch (bch_code) { + case BCH_CODE_N12: + case BCH_CODE_N10: + case BCH_CODE_N8: - len = poly_mult(polyn01, 17, polyn02, 17, polyout[0]); + len = poly_mult(polyn01, 17, polyn02, 17, polyout[0]); len = poly_mult(polyn03, 17, polyout[0], len, polyout[1]); len = poly_mult(polyn04, 17, polyout[1], len, polyout[0]); len = poly_mult(polyn05, 17, polyout[0], len, polyout[1]); @@ -541,24 +535,24 @@ for (unsigned int i = 0; i < num_parity_bits; i ++) {\ len = poly_mult(polyn07, 17, polyout[0], len, polyout[1]); len = poly_mult(polyn08, 17, polyout[1], len, polyout[0]); if (bch_code == BCH_CODE_N8) { - COPY_BCH_POLYNOME + COPY_BCH_POLYNOME } len = poly_mult(polyn09, 17, polyout[0], len, polyout[1]); len = poly_mult(polyn10, 17, polyout[1], len, polyout[0]); if (bch_code == BCH_CODE_N10) { - COPY_BCH_POLYNOME + COPY_BCH_POLYNOME } len = poly_mult(polyn11, 17, polyout[0], len, polyout[1]); len = poly_mult(polyn12, 17, polyout[1], len, polyout[0]); if (bch_code == BCH_CODE_N12) { - COPY_BCH_POLYNOME + COPY_BCH_POLYNOME } break; - case BCH_CODE_S12: - len = poly_mult(polys01, 15, polys02, 15, polyout[0]); + case BCH_CODE_S12: + len = poly_mult(polys01, 15, polys02, 15, polyout[0]); len = poly_mult(polys03, 15, polyout[0], len, polyout[1]); len = poly_mult(polys04, 15, polyout[1], len, polyout[0]); len = poly_mult(polys05, 15, polyout[0], len, polyout[1]); @@ -573,8 +567,8 @@ for (unsigned int i = 0; i < num_parity_bits; i ++) {\ COPY_BCH_POLYNOME break; - case BCH_CODE_M12: - len = poly_mult(polym01, 16, polym02, 16, polyout[0]); + case BCH_CODE_M12: + len = poly_mult(polym01, 16, polym02, 16, polyout[0]); len = poly_mult(polym03, 16, polyout[0], len, polyout[1]); len = poly_mult(polym04, 16, polyout[1], len, polyout[0]); len = poly_mult(polym05, 16, polyout[0], len, polyout[1]); @@ -588,98 +582,102 @@ for (unsigned int i = 0; i < num_parity_bits; i ++) {\ COPY_BCH_POLYNOME break; - } - calculate_crc_table(); - calculate_medium_crc_table(); } + calculate_crc_table(); + calculate_medium_crc_table(); +} - int - dvb_bch_bb_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; - unsigned char b, temp, msb; - - // We can use a 192 bits long bitset, all higher bits not used by the bch will just be ignored - std::bitset<MAX_BCH_PARITY_BITS> parity_bits; - int consumed = 0; - - if (frame_size != FECFRAME_MEDIUM) { +int dvb_bch_bb_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; + unsigned char b, temp, msb; + + // We can use a 192 bits long bitset, all higher bits not used by the bch will just be + // ignored + std::bitset<MAX_BCH_PARITY_BITS> parity_bits; + int consumed = 0; + + if (frame_size != FECFRAME_MEDIUM) { for (int i = 0; i < noutput_items; i += nbch) { - for (int j = 0; j < (int)kbch / 8; j++) { - b = 0; - - // calculate the crc using the lookup table, cf. http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html - for (int e = 0; e < 8; e++) { - temp = *in++; - *out++ = temp; - consumed++; - - b |= temp << (7 - e); + for (int j = 0; j < (int)kbch / 8; j++) { + b = 0; + + // calculate the crc using the lookup table, cf. + // http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html + for (int e = 0; e < 8; e++) { + temp = *in++; + *out++ = temp; + consumed++; + + b |= temp << (7 - e); + } + + msb = 0; + for (int n = 1; n <= 8; n++) { + temp = parity_bits[num_parity_bits - n]; + msb |= temp << (8 - n); + } + /* XOR-in next input byte into MSB of crc and get this MSB, that's our new + * intermediate divident */ + unsigned char pos = (msb ^ b); + /* Shift out the MSB used for division per lookuptable and XOR with the + * remainder */ + parity_bits = (parity_bits << 8) ^ crc_table[pos]; } - msb = 0; - for (int n = 1; n <= 8; n++) { - temp = parity_bits[num_parity_bits - n]; - msb |= temp << (8 - n); + // Now add the parity bits to the output + for (unsigned int n = 0; n < num_parity_bits; n++) { + *out++ = (char)parity_bits[num_parity_bits - 1]; + parity_bits <<= 1; } - /* XOR-in next input byte into MSB of crc and get this MSB, that's our new intermediate divident */ - unsigned char pos = (msb ^ b); - /* Shift out the MSB used for division per lookuptable and XOR with the remainder */ - parity_bits = (parity_bits << 8) ^ crc_table[pos]; - } - - // Now add the parity bits to the output - for (unsigned int n = 0; n < num_parity_bits; n++) { - *out++ = (char) parity_bits[num_parity_bits - 1]; - parity_bits <<= 1; - } } - } - else { + } else { for (int i = 0; i < noutput_items; i += nbch) { - for (int j = 0; j < (int)kbch / 4; j++) { - b = 0; - - // calculate the crc using the lookup table, cf. http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html - for (int e = 0; e < 4; e++) { - temp = *in++; - *out++ = temp; - consumed++; - - b |= temp << (3 - e); + for (int j = 0; j < (int)kbch / 4; j++) { + b = 0; + + // calculate the crc using the lookup table, cf. + // http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html + for (int e = 0; e < 4; e++) { + temp = *in++; + *out++ = temp; + consumed++; + + b |= temp << (3 - e); + } + + msb = 0; + for (int n = 1; n <= 4; n++) { + temp = parity_bits[num_parity_bits - n]; + msb |= temp << (4 - n); + } + /* XOR-in next input byte into MSB of crc and get this MSB, that's our new + * intermediate divident */ + unsigned char pos = (msb ^ b); + /* Shift out the MSB used for division per lookuptable and XOR with the + * remainder */ + parity_bits = (parity_bits << 4) ^ crc_medium_table[pos]; } - msb = 0; - for (int n = 1; n <= 4; n++) { - temp = parity_bits[num_parity_bits - n]; - msb |= temp << (4 - n); + // Now add the parity bits to the output + for (unsigned int n = 0; n < num_parity_bits; n++) { + *out++ = (char)parity_bits[num_parity_bits - 1]; + parity_bits <<= 1; } - /* XOR-in next input byte into MSB of crc and get this MSB, that's our new intermediate divident */ - unsigned char pos = (msb ^ b); - /* Shift out the MSB used for division per lookuptable and XOR with the remainder */ - parity_bits = (parity_bits << 4) ^ crc_medium_table[pos]; - } - - // Now add the parity bits to the output - for (unsigned int n = 0; n < num_parity_bits; n++) { - *out++ = (char) parity_bits[num_parity_bits - 1]; - parity_bits <<= 1; - } } - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (consumed); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(consumed); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvb/dvb_bch_bb_impl.h b/gr-dtv/lib/dvb/dvb_bch_bb_impl.h index 1d7282c892..d6632a7406 100644 --- a/gr-dtv/lib/dvb/dvb_bch_bb_impl.h +++ b/gr-dtv/lib/dvb/dvb_bch_bb_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016,2019 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -28,40 +28,41 @@ #define MAX_BCH_PARITY_BITS 192 namespace gr { - namespace dtv { +namespace dtv { - class dvb_bch_bb_impl : public dvb_bch_bb - { - private: - unsigned int kbch; - unsigned int nbch; - unsigned int bch_code; - unsigned int frame_size; +class dvb_bch_bb_impl : public dvb_bch_bb +{ +private: + unsigned int kbch; + unsigned int nbch; + unsigned int bch_code; + unsigned int frame_size; - std::bitset<MAX_BCH_PARITY_BITS> crc_table[256]; - std::bitset<MAX_BCH_PARITY_BITS> crc_medium_table[16]; - unsigned int num_parity_bits; - std::bitset<MAX_BCH_PARITY_BITS> polynome; + std::bitset<MAX_BCH_PARITY_BITS> crc_table[256]; + std::bitset<MAX_BCH_PARITY_BITS> crc_medium_table[16]; + unsigned int num_parity_bits; + std::bitset<MAX_BCH_PARITY_BITS> polynome; - void calculate_crc_table(); - void calculate_medium_crc_table(); - int poly_mult(const int*, int, const int*, int, int*); - void bch_poly_build_tables(void); + void calculate_crc_table(); + void calculate_medium_crc_table(); + int poly_mult(const int*, int, const int*, int, int*); + void bch_poly_build_tables(void); - public: - dvb_bch_bb_impl(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate); - ~dvb_bch_bb_impl(); +public: + dvb_bch_bb_impl(dvb_standard_t standard, + dvb_framesize_t framesize, + dvb_code_rate_t rate); + ~dvb_bch_bb_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVB_BCH_BB_IMPL_H */ - diff --git a/gr-dtv/lib/dvb/dvb_defines.h b/gr-dtv/lib/dvb/dvb_defines.h index 97be4d04a3..53b1a543c7 100644 --- a/gr-dtv/lib/dvb/dvb_defines.h +++ b/gr-dtv/lib/dvb/dvb_defines.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -46,10 +46,10 @@ #define FRAME_SIZE_NORMAL 64800 #define FRAME_SIZE_MEDIUM 32400 -#define FRAME_SIZE_SHORT 16200 +#define FRAME_SIZE_SHORT 16200 // BCH Code -#define BCH_CODE_N8 0 +#define BCH_CODE_N8 0 #define BCH_CODE_N10 1 #define BCH_CODE_N12 2 #define BCH_CODE_S12 3 @@ -70,4 +70,3 @@ #define EXTRA_PILOT_SYMBOLS_SET2 ((9 * 32) + 36) #endif /* INCLUDED_DTV_DVB_DEFINES_H */ - diff --git a/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.cc b/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.cc index 31fd2daaf1..dbcb5cbfde 100644 --- a/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.cc +++ b/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016,2019 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,76 +26,81 @@ #include "dvb_ldpc_bb_impl.h" namespace gr { - namespace dtv { +namespace dtv { - dvb_ldpc_bb::sptr - dvb_ldpc_bb::make(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation) - { - return gnuradio::get_initial_sptr - (new dvb_ldpc_bb_impl(standard, framesize, rate, constellation)); - } +dvb_ldpc_bb::sptr dvb_ldpc_bb::make(dvb_standard_t standard, + dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation) +{ + return gnuradio::get_initial_sptr( + new dvb_ldpc_bb_impl(standard, framesize, rate, constellation)); +} - /* - * The private constructor - */ - dvb_ldpc_bb_impl::dvb_ldpc_bb_impl(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation) - : gr::block("dvb_ldpc_bb", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(unsigned char))), +/* + * The private constructor + */ +dvb_ldpc_bb_impl::dvb_ldpc_bb_impl(dvb_standard_t standard, + dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation) + : gr::block("dvb_ldpc_bb", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(unsigned char))), Xs(0), P(0), Xp(0) - { - frame_size_type = framesize; - if (framesize == FECFRAME_NORMAL) { +{ + frame_size_type = framesize; + if (framesize == FECFRAME_NORMAL) { frame_size = FRAME_SIZE_NORMAL; frame_size_real = FRAME_SIZE_NORMAL; switch (rate) { - case C1_4: + case C1_4: nbch = 16200; q_val = 135; break; - case C1_3: + case C1_3: nbch = 21600; q_val = 120; break; - case C2_5: + case C2_5: nbch = 25920; q_val = 108; break; - case C1_2: + case C1_2: nbch = 32400; q_val = 90; break; - case C3_5: + case C3_5: nbch = 38880; q_val = 72; break; - case C2_3: + case C2_3: nbch = 43200; q_val = 60; break; - case C3_4: + case C3_4: nbch = 48600; q_val = 45; break; - case C4_5: + case C4_5: nbch = 51840; q_val = 36; break; - case C5_6: + case C5_6: nbch = 54000; q_val = 30; break; - case C8_9: + case C8_9: nbch = 57600; q_val = 20; break; - case C9_10: + case C9_10: nbch = 58320; q_val = 18; break; - case C2_9_VLSNR: + case C2_9_VLSNR: nbch = 14400; q_val = 140; frame_size -= NORMAL_PUNCTURING; @@ -103,177 +108,176 @@ namespace gr { P = 15; Xp = NORMAL_PUNCTURING; break; - case C13_45: + case C13_45: nbch = 18720; q_val = 128; break; - case C9_20: + case C9_20: nbch = 29160; q_val = 99; break; - case C90_180: + case C90_180: nbch = 32400; q_val = 90; break; - case C96_180: + case C96_180: nbch = 34560; q_val = 84; break; - case C11_20: + case C11_20: nbch = 35640; q_val = 81; break; - case C100_180: + case C100_180: nbch = 36000; q_val = 80; break; - case C104_180: + case C104_180: nbch = 37440; q_val = 76; break; - case C26_45: + case C26_45: nbch = 37440; q_val = 76; break; - case C18_30: + case C18_30: nbch = 38880; q_val = 72; break; - case C28_45: + case C28_45: nbch = 40320; q_val = 68; break; - case C23_36: + case C23_36: nbch = 41400; q_val = 65; break; - case C116_180: + case C116_180: nbch = 41760; q_val = 64; break; - case C20_30: + case C20_30: nbch = 43200; q_val = 60; break; - case C124_180: + case C124_180: nbch = 44640; q_val = 56; break; - case C25_36: + case C25_36: nbch = 45000; q_val = 55; break; - case C128_180: + case C128_180: nbch = 46080; q_val = 52; break; - case C13_18: + case C13_18: nbch = 46800; q_val = 50; break; - case C132_180: + case C132_180: nbch = 47520; q_val = 48; break; - case C22_30: + case C22_30: nbch = 47520; q_val = 48; break; - case C135_180: + case C135_180: nbch = 48600; q_val = 45; break; - case C140_180: + case C140_180: nbch = 50400; q_val = 40; break; - case C7_9: + case C7_9: nbch = 50400; q_val = 40; break; - case C154_180: + case C154_180: nbch = 55440; q_val = 26; break; - default: + default: nbch = 0; q_val = 0; break; } - } - else if (framesize == FECFRAME_SHORT) { + } else if (framesize == FECFRAME_SHORT) { frame_size = FRAME_SIZE_SHORT; frame_size_real = FRAME_SIZE_SHORT; switch (rate) { - case C1_4: + case C1_4: nbch = 3240; q_val = 36; break; - case C1_3: + case C1_3: nbch = 5400; q_val = 30; break; - case C2_5: + case C2_5: nbch = 6480; q_val = 27; break; - case C1_2: + case C1_2: nbch = 7200; q_val = 25; break; - case C3_5: + case C3_5: nbch = 9720; q_val = 18; break; - case C2_3: + case C2_3: nbch = 10800; q_val = 15; break; - case C3_4: + case C3_4: nbch = 11880; q_val = 12; break; - case C4_5: + case C4_5: nbch = 12600; q_val = 10; break; - case C5_6: + case C5_6: nbch = 13320; q_val = 8; break; - case C8_9: + case C8_9: nbch = 14400; q_val = 5; break; - case C11_45: + case C11_45: nbch = 3960; q_val = 34; break; - case C4_15: + case C4_15: nbch = 4320; q_val = 33; break; - case C14_45: + case C14_45: nbch = 5040; q_val = 31; break; - case C7_15: + case C7_15: nbch = 7560; q_val = 24; break; - case C8_15: + case C8_15: nbch = 8640; q_val = 21; break; - case C26_45: + case C26_45: nbch = 9360; q_val = 19; break; - case C32_45: + case C32_45: nbch = 11520; q_val = 13; break; - case C1_5_VLSNR_SF2: + case C1_5_VLSNR_SF2: nbch = 2680; q_val = 135; frame_size -= SHORT_PUNCTURING_SET1; @@ -282,7 +286,7 @@ namespace gr { P = 30; Xp = 250; break; - case C11_45_VLSNR_SF2: + case C11_45_VLSNR_SF2: nbch = 3960; q_val = 34; frame_size -= SHORT_PUNCTURING_SET1; @@ -290,7 +294,7 @@ namespace gr { P = 15; Xp = SHORT_PUNCTURING_SET1; break; - case C1_5_VLSNR: + case C1_5_VLSNR: nbch = 3240; q_val = 135; frame_size -= SHORT_PUNCTURING_SET2; @@ -298,7 +302,7 @@ namespace gr { P = 10; Xp = SHORT_PUNCTURING_SET2; break; - case C4_15_VLSNR: + case C4_15_VLSNR: nbch = 4320; q_val = 33; frame_size -= SHORT_PUNCTURING_SET2; @@ -306,7 +310,7 @@ namespace gr { P = 8; Xp = SHORT_PUNCTURING_SET2; break; - case C1_3_VLSNR: + case C1_3_VLSNR: nbch = 5400; q_val = 120; frame_size -= SHORT_PUNCTURING_SET2; @@ -314,5178 +318,11337 @@ namespace gr { P = 8; Xp = SHORT_PUNCTURING_SET2; break; - default: + default: nbch = 0; q_val = 0; break; } - } - else { + } else { frame_size = FRAME_SIZE_MEDIUM - MEDIUM_PUNCTURING; frame_size_real = FRAME_SIZE_MEDIUM - MEDIUM_PUNCTURING; switch (rate) { - case C1_5_MEDIUM: + case C1_5_MEDIUM: nbch = 5840; q_val = 72; Xs = 640; P = 25; Xp = 980; break; - case C11_45_MEDIUM: + case C11_45_MEDIUM: nbch = 7920; q_val = 68; P = 15; Xp = MEDIUM_PUNCTURING; break; - case C1_3_MEDIUM: + case C1_3_MEDIUM: nbch = 10800; q_val = 60; P = 13; Xp = MEDIUM_PUNCTURING; break; - default: + default: nbch = 0; q_val = 0; break; } - } - code_rate = rate; - signal_constellation = constellation; - dvb_standard = standard; - ldpc_lookup_generate(); - if (signal_constellation == MOD_128APSK) { - frame_size += 6; - } - set_output_multiple(frame_size); } - - /* - * Our virtual destructor. - */ - dvb_ldpc_bb_impl::~dvb_ldpc_bb_impl() - { - delete[] ldpc_lut[0]; - delete[] ldpc_lut; + code_rate = rate; + signal_constellation = constellation; + dvb_standard = standard; + ldpc_lookup_generate(); + if (signal_constellation == MOD_128APSK) { + frame_size += 6; } + set_output_multiple(frame_size); +} - void - dvb_ldpc_bb_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = (noutput_items / frame_size) * nbch; - } +/* + * Our virtual destructor. + */ +dvb_ldpc_bb_impl::~dvb_ldpc_bb_impl() +{ + delete[] ldpc_lut[0]; + delete[] ldpc_lut; +} -#define LDPC_BF(TABLE_NAME, ROWS) \ -for (int row = 0; row < ROWS; row++) { /* count the entries in the table */ \ - max_lut_arraysize += TABLE_NAME[row][0]; \ -} \ -max_lut_arraysize *= 360; /* 360 bits per table entry */ \ -max_lut_arraysize /= pbits; /* spread over all parity bits */ \ -for (int i = 0; i < FRAME_SIZE_NORMAL; i++) { \ - ldpc_lut_index[i] = 1; \ -} \ -for (int row = 0; row < ROWS; row++) { \ - for (int n = 0; n < 360; n++) { \ - for (int col = 1; col <= TABLE_NAME[row][0]; col++) { \ - int current_pbit = (TABLE_NAME[row][col] + (n * q)) % pbits; \ - ldpc_lut_index[current_pbit]++; \ - if (ldpc_lut_index[current_pbit] > max_index) { \ - max_index = ldpc_lut_index[current_pbit]; \ - } \ - } \ - } \ -} \ -max_lut_arraysize += 1 + (max_index - max_lut_arraysize); /* 1 for the size at the start of the array */ \ -\ -/* Allocate a 2D Array with pbits * max_lut_arraysize - * while preserving two-subscript access - * see https://stackoverflow.com/questions/29375797/copy-2d-array-using-memcpy/29375830#29375830 - */ \ -ldpc_lut = new int*[pbits]; \ -ldpc_lut[0] = new int[pbits * max_lut_arraysize]; \ -ldpc_lut[0][0] = 1; \ -for (int i = 1; i < pbits; i++) { \ - ldpc_lut[i] = ldpc_lut[i-1] + max_lut_arraysize; \ - ldpc_lut[i][0] = 1; \ -} \ -for (int row = 0; row < ROWS; row++) { \ - for (int n = 0; n < 360; n++) { \ - for (int col = 1; col <= TABLE_NAME[row][0]; col++) { \ - int current_pbit = (TABLE_NAME[row][col] + (n * q)) % pbits; \ - ldpc_lut[current_pbit][ldpc_lut[current_pbit][0]] = im; \ - ldpc_lut[current_pbit][0]++; \ - } \ - im++; \ - } \ +void dvb_ldpc_bb_impl::forecast(int noutput_items, gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = (noutput_items / frame_size) * nbch; } - /* - * fill the lookup table, for each paritybit it contains - * {number of infobits, infobit1, infobit2, ... ] - * maximum number of infobits is calculated using the entries - * in the ldpc tables - */ - void - dvb_ldpc_bb_impl::ldpc_lookup_generate(void) - { - int im = 0; - int pbits = (frame_size_real + Xp) - nbch; //number of parity bits - int q = q_val; - int max_lut_arraysize = 0; - int max_index = 0; +#define LDPC_BF(TABLE_NAME, ROWS) \ + for (int row = 0; row < ROWS; row++) { /* count the entries in the table */ \ + max_lut_arraysize += TABLE_NAME[row][0]; \ + } \ + max_lut_arraysize *= 360; /* 360 bits per table entry */ \ + max_lut_arraysize /= pbits; /* spread over all parity bits */ \ + for (int i = 0; i < FRAME_SIZE_NORMAL; i++) { \ + ldpc_lut_index[i] = 1; \ + } \ + for (int row = 0; row < ROWS; row++) { \ + for (int n = 0; n < 360; n++) { \ + for (int col = 1; col <= TABLE_NAME[row][0]; col++) { \ + int current_pbit = (TABLE_NAME[row][col] + (n * q)) % pbits; \ + ldpc_lut_index[current_pbit]++; \ + if (ldpc_lut_index[current_pbit] > max_index) { \ + max_index = ldpc_lut_index[current_pbit]; \ + } \ + } \ + } \ + } \ + max_lut_arraysize += \ + 1 + \ + (max_index - max_lut_arraysize); /* 1 for the size at the start of the array */ \ + \ + /* Allocate a 2D Array with pbits * max_lut_arraysize \ + * while preserving two-subscript access \ + * see \ + * https://stackoverflow.com/questions/29375797/copy-2d-array-using-memcpy/29375830#29375830 \ + */ \ + ldpc_lut = new int*[pbits]; \ + ldpc_lut[0] = new int[pbits * max_lut_arraysize]; \ + ldpc_lut[0][0] = 1; \ + for (int i = 1; i < pbits; i++) { \ + ldpc_lut[i] = ldpc_lut[i - 1] + max_lut_arraysize; \ + ldpc_lut[i][0] = 1; \ + } \ + for (int row = 0; row < ROWS; row++) { \ + for (int n = 0; n < 360; n++) { \ + for (int col = 1; col <= TABLE_NAME[row][0]; col++) { \ + int current_pbit = (TABLE_NAME[row][col] + (n * q)) % pbits; \ + ldpc_lut[current_pbit][ldpc_lut[current_pbit][0]] = im; \ + ldpc_lut[current_pbit][0]++; \ + } \ + im++; \ + } \ + } + +/* + * fill the lookup table, for each paritybit it contains + * {number of infobits, infobit1, infobit2, ... ] + * maximum number of infobits is calculated using the entries + * in the ldpc tables + */ +void dvb_ldpc_bb_impl::ldpc_lookup_generate(void) +{ + int im = 0; + int pbits = (frame_size_real + Xp) - nbch; // number of parity bits + int q = q_val; + int max_lut_arraysize = 0; + int max_index = 0; - if (frame_size_type == FECFRAME_NORMAL) { + if (frame_size_type == FECFRAME_NORMAL) { if (code_rate == C1_4) { - LDPC_BF(ldpc_tab_1_4N, 45); + LDPC_BF(ldpc_tab_1_4N, 45); } if (code_rate == C1_3) { - LDPC_BF(ldpc_tab_1_3N, 60); + LDPC_BF(ldpc_tab_1_3N, 60); } if (code_rate == C2_5) { - LDPC_BF(ldpc_tab_2_5N, 72); + LDPC_BF(ldpc_tab_2_5N, 72); } if (code_rate == C1_2) { - LDPC_BF(ldpc_tab_1_2N, 90); + LDPC_BF(ldpc_tab_1_2N, 90); } if (code_rate == C3_5) { - LDPC_BF(ldpc_tab_3_5N, 108); + LDPC_BF(ldpc_tab_3_5N, 108); } if (code_rate == C2_3) { - if (dvb_standard == STANDARD_DVBT2) { - LDPC_BF(ldpc_tab_2_3N_DVBT2, 120); - } - else { - LDPC_BF(ldpc_tab_2_3N_DVBS2, 120); - } + if (dvb_standard == STANDARD_DVBT2) { + LDPC_BF(ldpc_tab_2_3N_DVBT2, 120); + } else { + LDPC_BF(ldpc_tab_2_3N_DVBS2, 120); + } } if (code_rate == C3_4) { - LDPC_BF(ldpc_tab_3_4N, 135); + LDPC_BF(ldpc_tab_3_4N, 135); } if (code_rate == C4_5) { - LDPC_BF(ldpc_tab_4_5N, 144); + LDPC_BF(ldpc_tab_4_5N, 144); } if (code_rate == C5_6) { - LDPC_BF(ldpc_tab_5_6N, 150); + LDPC_BF(ldpc_tab_5_6N, 150); } if (code_rate == C8_9) { - LDPC_BF(ldpc_tab_8_9N, 160); + LDPC_BF(ldpc_tab_8_9N, 160); } if (code_rate == C9_10) { - LDPC_BF(ldpc_tab_9_10N, 162); + LDPC_BF(ldpc_tab_9_10N, 162); } if (code_rate == C2_9_VLSNR) { - LDPC_BF(ldpc_tab_2_9N, 40); + LDPC_BF(ldpc_tab_2_9N, 40); } if (code_rate == C13_45) { - LDPC_BF(ldpc_tab_13_45N, 52); + LDPC_BF(ldpc_tab_13_45N, 52); } if (code_rate == C9_20) { - LDPC_BF(ldpc_tab_9_20N, 81); + LDPC_BF(ldpc_tab_9_20N, 81); } if (code_rate == C90_180) { - LDPC_BF(ldpc_tab_90_180N, 90); + LDPC_BF(ldpc_tab_90_180N, 90); } if (code_rate == C96_180) { - LDPC_BF(ldpc_tab_96_180N, 96); + LDPC_BF(ldpc_tab_96_180N, 96); } if (code_rate == C11_20) { - LDPC_BF(ldpc_tab_11_20N, 99); + LDPC_BF(ldpc_tab_11_20N, 99); } if (code_rate == C100_180) { - LDPC_BF(ldpc_tab_100_180N, 100); + LDPC_BF(ldpc_tab_100_180N, 100); } if (code_rate == C104_180) { - LDPC_BF(ldpc_tab_104_180N, 104); + LDPC_BF(ldpc_tab_104_180N, 104); } if (code_rate == C26_45) { - LDPC_BF(ldpc_tab_26_45N, 104); + LDPC_BF(ldpc_tab_26_45N, 104); } if (code_rate == C18_30) { - LDPC_BF(ldpc_tab_18_30N, 108); + LDPC_BF(ldpc_tab_18_30N, 108); } if (code_rate == C28_45) { - LDPC_BF(ldpc_tab_28_45N, 112); + LDPC_BF(ldpc_tab_28_45N, 112); } if (code_rate == C23_36) { - LDPC_BF(ldpc_tab_23_36N, 115); + LDPC_BF(ldpc_tab_23_36N, 115); } if (code_rate == C116_180) { - LDPC_BF(ldpc_tab_116_180N, 116); + LDPC_BF(ldpc_tab_116_180N, 116); } if (code_rate == C20_30) { - LDPC_BF(ldpc_tab_20_30N, 120); + LDPC_BF(ldpc_tab_20_30N, 120); } if (code_rate == C124_180) { - LDPC_BF(ldpc_tab_124_180N, 124); + LDPC_BF(ldpc_tab_124_180N, 124); } if (code_rate == C25_36) { - LDPC_BF(ldpc_tab_25_36N, 125); + LDPC_BF(ldpc_tab_25_36N, 125); } if (code_rate == C128_180) { - LDPC_BF(ldpc_tab_128_180N, 128); + LDPC_BF(ldpc_tab_128_180N, 128); } if (code_rate == C13_18) { - LDPC_BF(ldpc_tab_13_18N, 130); + LDPC_BF(ldpc_tab_13_18N, 130); } if (code_rate == C132_180) { - LDPC_BF(ldpc_tab_132_180N, 132); + LDPC_BF(ldpc_tab_132_180N, 132); } if (code_rate == C22_30) { - LDPC_BF(ldpc_tab_22_30N, 132); + LDPC_BF(ldpc_tab_22_30N, 132); } if (code_rate == C135_180) { - LDPC_BF(ldpc_tab_135_180N, 135); + LDPC_BF(ldpc_tab_135_180N, 135); } if (code_rate == C140_180) { - LDPC_BF(ldpc_tab_140_180N, 140); + LDPC_BF(ldpc_tab_140_180N, 140); } if (code_rate == C7_9) { - LDPC_BF(ldpc_tab_7_9N, 140); + LDPC_BF(ldpc_tab_7_9N, 140); } if (code_rate == C154_180) { - LDPC_BF(ldpc_tab_154_180N, 154); + LDPC_BF(ldpc_tab_154_180N, 154); } - } - else if (frame_size_type == FECFRAME_SHORT) { + } else if (frame_size_type == FECFRAME_SHORT) { if (code_rate == C1_4) { - LDPC_BF(ldpc_tab_1_4S, 9); + LDPC_BF(ldpc_tab_1_4S, 9); } if (code_rate == C1_3) { - LDPC_BF(ldpc_tab_1_3S, 15); + LDPC_BF(ldpc_tab_1_3S, 15); } if (code_rate == C2_5) { - LDPC_BF(ldpc_tab_2_5S, 18); + LDPC_BF(ldpc_tab_2_5S, 18); } if (code_rate == C1_2) { - LDPC_BF(ldpc_tab_1_2S, 20); + LDPC_BF(ldpc_tab_1_2S, 20); } if (code_rate == C3_5) { - if (dvb_standard == STANDARD_DVBT2) { - LDPC_BF(ldpc_tab_3_5S_DVBT2, 27); - } - else { - LDPC_BF(ldpc_tab_3_5S_DVBS2, 27); - } + if (dvb_standard == STANDARD_DVBT2) { + LDPC_BF(ldpc_tab_3_5S_DVBT2, 27); + } else { + LDPC_BF(ldpc_tab_3_5S_DVBS2, 27); + } } if (code_rate == C2_3) { - LDPC_BF(ldpc_tab_2_3S, 30); + LDPC_BF(ldpc_tab_2_3S, 30); } if (code_rate == C3_4) { - LDPC_BF(ldpc_tab_3_4S, 33); + LDPC_BF(ldpc_tab_3_4S, 33); } if (code_rate == C4_5) { - LDPC_BF(ldpc_tab_4_5S, 35); + LDPC_BF(ldpc_tab_4_5S, 35); } if (code_rate == C5_6) { - LDPC_BF(ldpc_tab_5_6S, 37); + LDPC_BF(ldpc_tab_5_6S, 37); } if (code_rate == C8_9) { - LDPC_BF(ldpc_tab_8_9S, 40); + LDPC_BF(ldpc_tab_8_9S, 40); } if (code_rate == C11_45) { - LDPC_BF(ldpc_tab_11_45S, 11); + LDPC_BF(ldpc_tab_11_45S, 11); } if (code_rate == C4_15) { - LDPC_BF(ldpc_tab_4_15S, 12); + LDPC_BF(ldpc_tab_4_15S, 12); } if (code_rate == C14_45) { - LDPC_BF(ldpc_tab_14_45S, 14); + LDPC_BF(ldpc_tab_14_45S, 14); } if (code_rate == C7_15) { - LDPC_BF(ldpc_tab_7_15S, 21); + LDPC_BF(ldpc_tab_7_15S, 21); } if (code_rate == C8_15) { - LDPC_BF(ldpc_tab_8_15S, 24); + LDPC_BF(ldpc_tab_8_15S, 24); } if (code_rate == C26_45) { - LDPC_BF(ldpc_tab_26_45S, 26); + LDPC_BF(ldpc_tab_26_45S, 26); } if (code_rate == C32_45) { - LDPC_BF(ldpc_tab_32_45S, 32); + LDPC_BF(ldpc_tab_32_45S, 32); } if (code_rate == C1_5_VLSNR_SF2) { - LDPC_BF(ldpc_tab_1_4S, 9); + LDPC_BF(ldpc_tab_1_4S, 9); } if (code_rate == C11_45_VLSNR_SF2) { - LDPC_BF(ldpc_tab_11_45S, 11); + LDPC_BF(ldpc_tab_11_45S, 11); } if (code_rate == C1_5_VLSNR) { - LDPC_BF(ldpc_tab_1_4S, 9); + LDPC_BF(ldpc_tab_1_4S, 9); } if (code_rate == C4_15_VLSNR) { - LDPC_BF(ldpc_tab_4_15S, 12); + LDPC_BF(ldpc_tab_4_15S, 12); } if (code_rate == C1_3_VLSNR) { - LDPC_BF(ldpc_tab_1_3S, 15); + LDPC_BF(ldpc_tab_1_3S, 15); } - } - else { + } else { if (code_rate == C1_5_MEDIUM) { - LDPC_BF(ldpc_tab_1_5M, 18); + LDPC_BF(ldpc_tab_1_5M, 18); } if (code_rate == C11_45_MEDIUM) { - LDPC_BF(ldpc_tab_11_45M, 22); + LDPC_BF(ldpc_tab_11_45M, 22); } if (code_rate == C1_3_MEDIUM) { - LDPC_BF(ldpc_tab_1_3M, 30); + LDPC_BF(ldpc_tab_1_3M, 30); } - } } +} - int - dvb_ldpc_bb_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; - const unsigned char *d; - unsigned char *p; - unsigned char *b = (unsigned char *) output_items[0]; - unsigned char *s; - // Calculate the number of parity bits - int plen = (frame_size_real + Xp) - nbch; - d = in; - p = &out[nbch]; - int consumed = 0; - int puncture, index; +int dvb_ldpc_bb_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; + const unsigned char* d; + unsigned char* p; + unsigned char* b = (unsigned char*)output_items[0]; + unsigned char* s; + // Calculate the number of parity bits + int plen = (frame_size_real + Xp) - nbch; + d = in; + p = &out[nbch]; + int consumed = 0; + int puncture, index; - for (int i = 0; i < noutput_items; i += frame_size) { + for (int i = 0; i < noutput_items; i += frame_size) { if (Xs != 0) { - s = &shortening_buffer[0]; - memset(s, 0, sizeof(unsigned char) * Xs); - memcpy(&s[Xs], &in[consumed], sizeof(unsigned char) * nbch); - d = s; + s = &shortening_buffer[0]; + memset(s, 0, sizeof(unsigned char) * Xs); + memcpy(&s[Xs], &in[consumed], sizeof(unsigned char) * nbch); + d = s; } if (P != 0) { - p = &puncturing_buffer[nbch]; - b = &out[i + nbch]; + p = &puncturing_buffer[nbch]; + b = &out[i + nbch]; } // First zero all the parity bits memset(p, 0, sizeof(unsigned char) * plen); // copy the information bits - memcpy(&out[i], &in[consumed], sizeof(unsigned char)*nbch); + memcpy(&out[i], &in[consumed], sizeof(unsigned char) * nbch); consumed += nbch; // now do the parity checking for (int i_p = 0; i_p < plen; i_p++) { - unsigned char pbit = 0; - for (int i_d = 1; i_d < ldpc_lut[i_p][0]; i_d++) { - pbit ^= d[ldpc_lut[i_p][i_d]]; - } - p[i_p] = pbit; + unsigned char pbit = 0; + for (int i_d = 1; i_d < ldpc_lut[i_p][0]; i_d++) { + pbit ^= d[ldpc_lut[i_p][i_d]]; + } + p[i_p] = pbit; } for (int j = 1; j < plen; j++) { - p[j] ^= p[j-1]; + p[j] ^= p[j - 1]; } if (P != 0) { - puncture = 0; - for (int j = 0; j < plen; j += P) { - p[j] = 0x55; - puncture++; - if (puncture == Xp) { - break; + puncture = 0; + for (int j = 0; j < plen; j += P) { + p[j] = 0x55; + puncture++; + if (puncture == Xp) { + break; + } } - } - index = 0; - for (int j = 0; j < plen; j++) { - if (p[j] != 0x55) { - b[index++] = p[j]; + index = 0; + for (int j = 0; j < plen; j++) { + if (p[j] != 0x55) { + b[index++] = p[j]; + } } - } - p = &out[i + nbch]; + p = &out[i + nbch]; } if (signal_constellation == MOD_128APSK) { - for (int j = 0; j < 6; j++) { - p[j + plen] = 0; - } + for (int j = 0; j < 6; j++) { + p[j + plen] = 0; + } } d += nbch; p += frame_size; - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (consumed); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(consumed); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - const int dvb_ldpc_bb_impl::ldpc_tab_1_4N[45][13]= - { - {12,23606,36098,1140,28859,18148,18510,6226,540,42014,20879,23802,47088}, - {12,16419,24928,16609,17248,7693,24997,42587,16858,34921,21042,37024,20692}, - {12,1874,40094,18704,14474,14004,11519,13106,28826,38669,22363,30255,31105}, - {12,22254,40564,22645,22532,6134,9176,39998,23892,8937,15608,16854,31009}, - {12,8037,40401,13550,19526,41902,28782,13304,32796,24679,27140,45980,10021}, - {12,40540,44498,13911,22435,32701,18405,39929,25521,12497,9851,39223,34823}, - {12,15233,45333,5041,44979,45710,42150,19416,1892,23121,15860,8832,10308}, - {12,10468,44296,3611,1480,37581,32254,13817,6883,32892,40258,46538,11940}, - {12,6705,21634,28150,43757,895,6547,20970,28914,30117,25736,41734,11392}, - {12,22002,5739,27210,27828,34192,37992,10915,6998,3824,42130,4494,35739}, - {12,8515,1191,13642,30950,25943,12673,16726,34261,31828,3340,8747,39225}, - {12,18979,17058,43130,4246,4793,44030,19454,29511,47929,15174,24333,19354}, - {12,16694,8381,29642,46516,32224,26344,9405,18292,12437,27316,35466,41992}, - {12,15642,5871,46489,26723,23396,7257,8974,3156,37420,44823,35423,13541}, - {12,42858,32008,41282,38773,26570,2702,27260,46974,1469,20887,27426,38553}, - {3,22152,24261,8297,0,0,0,0,0,0,0,0,0}, - {3,19347,9978,27802,0,0,0,0,0,0,0,0,0}, - {3,34991,6354,33561,0,0,0,0,0,0,0,0,0}, - {3,29782,30875,29523,0,0,0,0,0,0,0,0,0}, - {3,9278,48512,14349,0,0,0,0,0,0,0,0,0}, - {3,38061,4165,43878,0,0,0,0,0,0,0,0,0}, - {3,8548,33172,34410,0,0,0,0,0,0,0,0,0}, - {3,22535,28811,23950,0,0,0,0,0,0,0,0,0}, - {3,20439,4027,24186,0,0,0,0,0,0,0,0,0}, - {3,38618,8187,30947,0,0,0,0,0,0,0,0,0}, - {3,35538,43880,21459,0,0,0,0,0,0,0,0,0}, - {3,7091,45616,15063,0,0,0,0,0,0,0,0,0}, - {3,5505,9315,21908,0,0,0,0,0,0,0,0,0}, - {3,36046,32914,11836,0,0,0,0,0,0,0,0,0}, - {3,7304,39782,33721,0,0,0,0,0,0,0,0,0}, - {3,16905,29962,12980,0,0,0,0,0,0,0,0,0}, - {3,11171,23709,22460,0,0,0,0,0,0,0,0,0}, - {3,34541,9937,44500,0,0,0,0,0,0,0,0,0}, - {3,14035,47316,8815,0,0,0,0,0,0,0,0,0}, - {3,15057,45482,24461,0,0,0,0,0,0,0,0,0}, - {3,30518,36877,879,0,0,0,0,0,0,0,0,0}, - {3,7583,13364,24332,0,0,0,0,0,0,0,0,0}, - {3,448,27056,4682,0,0,0,0,0,0,0,0,0}, - {3,12083,31378,21670,0,0,0,0,0,0,0,0,0}, - {3,1159,18031,2221,0,0,0,0,0,0,0,0,0}, - {3,17028,38715,9350,0,0,0,0,0,0,0,0,0}, - {3,17343,24530,29574,0,0,0,0,0,0,0,0,0}, - {3,46128,31039,32818,0,0,0,0,0,0,0,0,0}, - {3,20373,36967,18345,0,0,0,0,0,0,0,0,0}, - {3,46685,20622,32806,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_1_4N[45][13] = { + { 12, + 23606, + 36098, + 1140, + 28859, + 18148, + 18510, + 6226, + 540, + 42014, + 20879, + 23802, + 47088 }, + { 12, + 16419, + 24928, + 16609, + 17248, + 7693, + 24997, + 42587, + 16858, + 34921, + 21042, + 37024, + 20692 }, + { 12, + 1874, + 40094, + 18704, + 14474, + 14004, + 11519, + 13106, + 28826, + 38669, + 22363, + 30255, + 31105 }, + { 12, + 22254, + 40564, + 22645, + 22532, + 6134, + 9176, + 39998, + 23892, + 8937, + 15608, + 16854, + 31009 }, + { 12, + 8037, + 40401, + 13550, + 19526, + 41902, + 28782, + 13304, + 32796, + 24679, + 27140, + 45980, + 10021 }, + { 12, + 40540, + 44498, + 13911, + 22435, + 32701, + 18405, + 39929, + 25521, + 12497, + 9851, + 39223, + 34823 }, + { 12, + 15233, + 45333, + 5041, + 44979, + 45710, + 42150, + 19416, + 1892, + 23121, + 15860, + 8832, + 10308 }, + { 12, + 10468, + 44296, + 3611, + 1480, + 37581, + 32254, + 13817, + 6883, + 32892, + 40258, + 46538, + 11940 }, + { 12, + 6705, + 21634, + 28150, + 43757, + 895, + 6547, + 20970, + 28914, + 30117, + 25736, + 41734, + 11392 }, + { 12, + 22002, + 5739, + 27210, + 27828, + 34192, + 37992, + 10915, + 6998, + 3824, + 42130, + 4494, + 35739 }, + { 12, + 8515, + 1191, + 13642, + 30950, + 25943, + 12673, + 16726, + 34261, + 31828, + 3340, + 8747, + 39225 }, + { 12, + 18979, + 17058, + 43130, + 4246, + 4793, + 44030, + 19454, + 29511, + 47929, + 15174, + 24333, + 19354 }, + { 12, + 16694, + 8381, + 29642, + 46516, + 32224, + 26344, + 9405, + 18292, + 12437, + 27316, + 35466, + 41992 }, + { 12, + 15642, + 5871, + 46489, + 26723, + 23396, + 7257, + 8974, + 3156, + 37420, + 44823, + 35423, + 13541 }, + { 12, + 42858, + 32008, + 41282, + 38773, + 26570, + 2702, + 27260, + 46974, + 1469, + 20887, + 27426, + 38553 }, + { 3, 22152, 24261, 8297, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19347, 9978, 27802, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34991, 6354, 33561, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29782, 30875, 29523, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9278, 48512, 14349, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38061, 4165, 43878, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8548, 33172, 34410, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22535, 28811, 23950, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20439, 4027, 24186, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38618, 8187, 30947, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35538, 43880, 21459, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7091, 45616, 15063, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5505, 9315, 21908, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 36046, 32914, 11836, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7304, 39782, 33721, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16905, 29962, 12980, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11171, 23709, 22460, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34541, 9937, 44500, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14035, 47316, 8815, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15057, 45482, 24461, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30518, 36877, 879, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7583, 13364, 24332, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 448, 27056, 4682, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12083, 31378, 21670, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1159, 18031, 2221, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17028, 38715, 9350, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17343, 24530, 29574, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 46128, 31039, 32818, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20373, 36967, 18345, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 46685, 20622, 32806, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_1_3N[60][13]= - { - {12,34903,20927,32093,1052,25611,16093,16454,5520,506,37399,18518,21120}, - {12,11636,14594,22158,14763,15333,6838,22222,37856,14985,31041,18704,32910}, - {12,17449,1665,35639,16624,12867,12449,10241,11650,25622,34372,19878,26894}, - {12,29235,19780,36056,20129,20029,5457,8157,35554,21237,7943,13873,14980}, - {12,9912,7143,35911,12043,17360,37253,25588,11827,29152,21936,24125,40870}, - {12,40701,36035,39556,12366,19946,29072,16365,35495,22686,11106,8756,34863}, - {12,19165,15702,13536,40238,4465,40034,40590,37540,17162,1712,20577,14138}, - {12,31338,19342,9301,39375,3211,1316,33409,28670,12282,6118,29236,35787}, - {12,11504,30506,19558,5100,24188,24738,30397,33775,9699,6215,3397,37451}, - {12,34689,23126,7571,1058,12127,27518,23064,11265,14867,30451,28289,2966}, - {12,11660,15334,16867,15160,38343,3778,4265,39139,17293,26229,42604,13486}, - {12,31497,1365,14828,7453,26350,41346,28643,23421,8354,16255,11055,24279}, - {12,15687,12467,13906,5215,41328,23755,20800,6447,7970,2803,33262,39843}, - {12,5363,22469,38091,28457,36696,34471,23619,2404,24229,41754,1297,18563}, - {12,3673,39070,14480,30279,37483,7580,29519,30519,39831,20252,18132,20010}, - {12,34386,7252,27526,12950,6875,43020,31566,39069,18985,15541,40020,16715}, - {12,1721,37332,39953,17430,32134,29162,10490,12971,28581,29331,6489,35383}, - {12,736,7022,42349,8783,6767,11871,21675,10325,11548,25978,431,24085}, - {12,1925,10602,28585,12170,15156,34404,8351,13273,20208,5800,15367,21764}, - {12,16279,37832,34792,21250,34192,7406,41488,18346,29227,26127,25493,7048}, - {3,39948,28229,24899,0,0,0,0,0,0,0,0,0}, - {3,17408,14274,38993,0,0,0,0,0,0,0,0,0}, - {3,38774,15968,28459,0,0,0,0,0,0,0,0,0}, - {3,41404,27249,27425,0,0,0,0,0,0,0,0,0}, - {3,41229,6082,43114,0,0,0,0,0,0,0,0,0}, - {3,13957,4979,40654,0,0,0,0,0,0,0,0,0}, - {3,3093,3438,34992,0,0,0,0,0,0,0,0,0}, - {3,34082,6172,28760,0,0,0,0,0,0,0,0,0}, - {3,42210,34141,41021,0,0,0,0,0,0,0,0,0}, - {3,14705,17783,10134,0,0,0,0,0,0,0,0,0}, - {3,41755,39884,22773,0,0,0,0,0,0,0,0,0}, - {3,14615,15593,1642,0,0,0,0,0,0,0,0,0}, - {3,29111,37061,39860,0,0,0,0,0,0,0,0,0}, - {3,9579,33552,633,0,0,0,0,0,0,0,0,0}, - {3,12951,21137,39608,0,0,0,0,0,0,0,0,0}, - {3,38244,27361,29417,0,0,0,0,0,0,0,0,0}, - {3,2939,10172,36479,0,0,0,0,0,0,0,0,0}, - {3,29094,5357,19224,0,0,0,0,0,0,0,0,0}, - {3,9562,24436,28637,0,0,0,0,0,0,0,0,0}, - {3,40177,2326,13504,0,0,0,0,0,0,0,0,0}, - {3,6834,21583,42516,0,0,0,0,0,0,0,0,0}, - {3,40651,42810,25709,0,0,0,0,0,0,0,0,0}, - {3,31557,32138,38142,0,0,0,0,0,0,0,0,0}, - {3,18624,41867,39296,0,0,0,0,0,0,0,0,0}, - {3,37560,14295,16245,0,0,0,0,0,0,0,0,0}, - {3,6821,21679,31570,0,0,0,0,0,0,0,0,0}, - {3,25339,25083,22081,0,0,0,0,0,0,0,0,0}, - {3,8047,697,35268,0,0,0,0,0,0,0,0,0}, - {3,9884,17073,19995,0,0,0,0,0,0,0,0,0}, - {3,26848,35245,8390,0,0,0,0,0,0,0,0,0}, - {3,18658,16134,14807,0,0,0,0,0,0,0,0,0}, - {3,12201,32944,5035,0,0,0,0,0,0,0,0,0}, - {3,25236,1216,38986,0,0,0,0,0,0,0,0,0}, - {3,42994,24782,8681,0,0,0,0,0,0,0,0,0}, - {3,28321,4932,34249,0,0,0,0,0,0,0,0,0}, - {3,4107,29382,32124,0,0,0,0,0,0,0,0,0}, - {3,22157,2624,14468,0,0,0,0,0,0,0,0,0}, - {3,38788,27081,7936,0,0,0,0,0,0,0,0,0}, - {3,4368,26148,10578,0,0,0,0,0,0,0,0,0}, - {3,25353,4122,39751,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_1_3N[60][13] = { + { 12, + 34903, + 20927, + 32093, + 1052, + 25611, + 16093, + 16454, + 5520, + 506, + 37399, + 18518, + 21120 }, + { 12, + 11636, + 14594, + 22158, + 14763, + 15333, + 6838, + 22222, + 37856, + 14985, + 31041, + 18704, + 32910 }, + { 12, + 17449, + 1665, + 35639, + 16624, + 12867, + 12449, + 10241, + 11650, + 25622, + 34372, + 19878, + 26894 }, + { 12, + 29235, + 19780, + 36056, + 20129, + 20029, + 5457, + 8157, + 35554, + 21237, + 7943, + 13873, + 14980 }, + { 12, + 9912, + 7143, + 35911, + 12043, + 17360, + 37253, + 25588, + 11827, + 29152, + 21936, + 24125, + 40870 }, + { 12, + 40701, + 36035, + 39556, + 12366, + 19946, + 29072, + 16365, + 35495, + 22686, + 11106, + 8756, + 34863 }, + { 12, + 19165, + 15702, + 13536, + 40238, + 4465, + 40034, + 40590, + 37540, + 17162, + 1712, + 20577, + 14138 }, + { 12, + 31338, + 19342, + 9301, + 39375, + 3211, + 1316, + 33409, + 28670, + 12282, + 6118, + 29236, + 35787 }, + { 12, + 11504, + 30506, + 19558, + 5100, + 24188, + 24738, + 30397, + 33775, + 9699, + 6215, + 3397, + 37451 }, + { 12, + 34689, + 23126, + 7571, + 1058, + 12127, + 27518, + 23064, + 11265, + 14867, + 30451, + 28289, + 2966 }, + { 12, + 11660, + 15334, + 16867, + 15160, + 38343, + 3778, + 4265, + 39139, + 17293, + 26229, + 42604, + 13486 }, + { 12, + 31497, + 1365, + 14828, + 7453, + 26350, + 41346, + 28643, + 23421, + 8354, + 16255, + 11055, + 24279 }, + { 12, + 15687, + 12467, + 13906, + 5215, + 41328, + 23755, + 20800, + 6447, + 7970, + 2803, + 33262, + 39843 }, + { 12, + 5363, + 22469, + 38091, + 28457, + 36696, + 34471, + 23619, + 2404, + 24229, + 41754, + 1297, + 18563 }, + { 12, + 3673, + 39070, + 14480, + 30279, + 37483, + 7580, + 29519, + 30519, + 39831, + 20252, + 18132, + 20010 }, + { 12, + 34386, + 7252, + 27526, + 12950, + 6875, + 43020, + 31566, + 39069, + 18985, + 15541, + 40020, + 16715 }, + { 12, + 1721, + 37332, + 39953, + 17430, + 32134, + 29162, + 10490, + 12971, + 28581, + 29331, + 6489, + 35383 }, + { 12, 736, 7022, 42349, 8783, 6767, 11871, 21675, 10325, 11548, 25978, 431, 24085 }, + { 12, + 1925, + 10602, + 28585, + 12170, + 15156, + 34404, + 8351, + 13273, + 20208, + 5800, + 15367, + 21764 }, + { 12, + 16279, + 37832, + 34792, + 21250, + 34192, + 7406, + 41488, + 18346, + 29227, + 26127, + 25493, + 7048 }, + { 3, 39948, 28229, 24899, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17408, 14274, 38993, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38774, 15968, 28459, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 41404, 27249, 27425, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 41229, 6082, 43114, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13957, 4979, 40654, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3093, 3438, 34992, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34082, 6172, 28760, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 42210, 34141, 41021, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14705, 17783, 10134, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 41755, 39884, 22773, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14615, 15593, 1642, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29111, 37061, 39860, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9579, 33552, 633, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12951, 21137, 39608, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38244, 27361, 29417, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2939, 10172, 36479, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29094, 5357, 19224, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9562, 24436, 28637, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 40177, 2326, 13504, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6834, 21583, 42516, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 40651, 42810, 25709, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31557, 32138, 38142, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18624, 41867, 39296, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 37560, 14295, 16245, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6821, 21679, 31570, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25339, 25083, 22081, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8047, 697, 35268, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9884, 17073, 19995, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26848, 35245, 8390, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18658, 16134, 14807, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12201, 32944, 5035, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25236, 1216, 38986, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 42994, 24782, 8681, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28321, 4932, 34249, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4107, 29382, 32124, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22157, 2624, 14468, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38788, 27081, 7936, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4368, 26148, 10578, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25353, 4122, 39751, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_2_5N[72][13]= - { - {12,31413,18834,28884,947,23050,14484,14809,4968,455,33659,16666,19008}, - {12,13172,19939,13354,13719,6132,20086,34040,13442,27958,16813,29619,16553}, - {12,1499,32075,14962,11578,11204,9217,10485,23062,30936,17892,24204,24885}, - {12,32490,18086,18007,4957,7285,32073,19038,7152,12486,13483,24808,21759}, - {12,32321,10839,15620,33521,23030,10646,26236,19744,21713,36784,8016,12869}, - {12,35597,11129,17948,26160,14729,31943,20416,10000,7882,31380,27858,33356}, - {12,14125,12131,36199,4058,35992,36594,33698,15475,1566,18498,12725,7067}, - {12,17406,8372,35437,2888,1184,30068,25802,11056,5507,26313,32205,37232}, - {12,15254,5365,17308,22519,35009,718,5240,16778,23131,24092,20587,33385}, - {12,27455,17602,4590,21767,22266,27357,30400,8732,5596,3060,33703,3596}, - {12,6882,873,10997,24738,20770,10067,13379,27409,25463,2673,6998,31378}, - {12,15181,13645,34501,3393,3840,35227,15562,23615,38342,12139,19471,15483}, - {12,13350,6707,23709,37204,25778,21082,7511,14588,10010,21854,28375,33591}, - {12,12514,4695,37190,21379,18723,5802,7182,2529,29936,35860,28338,10835}, - {12,34283,25610,33026,31017,21259,2165,21807,37578,1175,16710,21939,30841}, - {12,27292,33730,6836,26476,27539,35784,18245,16394,17939,23094,19216,17432}, - {12,11655,6183,38708,28408,35157,17089,13998,36029,15052,16617,5638,36464}, - {12,15693,28923,26245,9432,11675,25720,26405,5838,31851,26898,8090,37037}, - {12,24418,27583,7959,35562,37771,17784,11382,11156,37855,7073,21685,34515}, - {12,10977,13633,30969,7516,11943,18199,5231,13825,19589,23661,11150,35602}, - {12,19124,30774,6670,37344,16510,26317,23518,22957,6348,34069,8845,20175}, - {12,34985,14441,25668,4116,3019,21049,37308,24551,24727,20104,24850,12114}, - {12,38187,28527,13108,13985,1425,21477,30807,8613,26241,33368,35913,32477}, - {12,5903,34390,24641,26556,23007,27305,38247,2621,9122,32806,21554,18685}, - {3,17287,27292,19033,0,0,0,0,0,0,0,0,0}, - {3,25796,31795,12152,0,0,0,0,0,0,0,0,0}, - {3,12184,35088,31226,0,0,0,0,0,0,0,0,0}, - {3,38263,33386,24892,0,0,0,0,0,0,0,0,0}, - {3,23114,37995,29796,0,0,0,0,0,0,0,0,0}, - {3,34336,10551,36245,0,0,0,0,0,0,0,0,0}, - {3,35407,175,7203,0,0,0,0,0,0,0,0,0}, - {3,14654,38201,22605,0,0,0,0,0,0,0,0,0}, - {3,28404,6595,1018,0,0,0,0,0,0,0,0,0}, - {3,19932,3524,29305,0,0,0,0,0,0,0,0,0}, - {3,31749,20247,8128,0,0,0,0,0,0,0,0,0}, - {3,18026,36357,26735,0,0,0,0,0,0,0,0,0}, - {3,7543,29767,13588,0,0,0,0,0,0,0,0,0}, - {3,13333,25965,8463,0,0,0,0,0,0,0,0,0}, - {3,14504,36796,19710,0,0,0,0,0,0,0,0,0}, - {3,4528,25299,7318,0,0,0,0,0,0,0,0,0}, - {3,35091,25550,14798,0,0,0,0,0,0,0,0,0}, - {3,7824,215,1248,0,0,0,0,0,0,0,0,0}, - {3,30848,5362,17291,0,0,0,0,0,0,0,0,0}, - {3,28932,30249,27073,0,0,0,0,0,0,0,0,0}, - {3,13062,2103,16206,0,0,0,0,0,0,0,0,0}, - {3,7129,32062,19612,0,0,0,0,0,0,0,0,0}, - {3,9512,21936,38833,0,0,0,0,0,0,0,0,0}, - {3,35849,33754,23450,0,0,0,0,0,0,0,0,0}, - {3,18705,28656,18111,0,0,0,0,0,0,0,0,0}, - {3,22749,27456,32187,0,0,0,0,0,0,0,0,0}, - {3,28229,31684,30160,0,0,0,0,0,0,0,0,0}, - {3,15293,8483,28002,0,0,0,0,0,0,0,0,0}, - {3,14880,13334,12584,0,0,0,0,0,0,0,0,0}, - {3,28646,2558,19687,0,0,0,0,0,0,0,0,0}, - {3,6259,4499,26336,0,0,0,0,0,0,0,0,0}, - {3,11952,28386,8405,0,0,0,0,0,0,0,0,0}, - {3,10609,961,7582,0,0,0,0,0,0,0,0,0}, - {3,10423,13191,26818,0,0,0,0,0,0,0,0,0}, - {3,15922,36654,21450,0,0,0,0,0,0,0,0,0}, - {3,10492,1532,1205,0,0,0,0,0,0,0,0,0}, - {3,30551,36482,22153,0,0,0,0,0,0,0,0,0}, - {3,5156,11330,34243,0,0,0,0,0,0,0,0,0}, - {3,28616,35369,13322,0,0,0,0,0,0,0,0,0}, - {3,8962,1485,21186,0,0,0,0,0,0,0,0,0}, - {3,23541,17445,35561,0,0,0,0,0,0,0,0,0}, - {3,33133,11593,19895,0,0,0,0,0,0,0,0,0}, - {3,33917,7863,33651,0,0,0,0,0,0,0,0,0}, - {3,20063,28331,10702,0,0,0,0,0,0,0,0,0}, - {3,13195,21107,21859,0,0,0,0,0,0,0,0,0}, - {3,4364,31137,4804,0,0,0,0,0,0,0,0,0}, - {3,5585,2037,4830,0,0,0,0,0,0,0,0,0}, - {3,30672,16927,14800,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_2_5N[72][13] = { + { 12, 31413, 18834, 28884, 947, 23050, 14484, 14809, 4968, 455, 33659, 16666, 19008 }, + { 12, + 13172, + 19939, + 13354, + 13719, + 6132, + 20086, + 34040, + 13442, + 27958, + 16813, + 29619, + 16553 }, + { 12, + 1499, + 32075, + 14962, + 11578, + 11204, + 9217, + 10485, + 23062, + 30936, + 17892, + 24204, + 24885 }, + { 12, + 32490, + 18086, + 18007, + 4957, + 7285, + 32073, + 19038, + 7152, + 12486, + 13483, + 24808, + 21759 }, + { 12, + 32321, + 10839, + 15620, + 33521, + 23030, + 10646, + 26236, + 19744, + 21713, + 36784, + 8016, + 12869 }, + { 12, + 35597, + 11129, + 17948, + 26160, + 14729, + 31943, + 20416, + 10000, + 7882, + 31380, + 27858, + 33356 }, + { 12, + 14125, + 12131, + 36199, + 4058, + 35992, + 36594, + 33698, + 15475, + 1566, + 18498, + 12725, + 7067 }, + { 12, + 17406, + 8372, + 35437, + 2888, + 1184, + 30068, + 25802, + 11056, + 5507, + 26313, + 32205, + 37232 }, + { 12, + 15254, + 5365, + 17308, + 22519, + 35009, + 718, + 5240, + 16778, + 23131, + 24092, + 20587, + 33385 }, + { 12, 27455, 17602, 4590, 21767, 22266, 27357, 30400, 8732, 5596, 3060, 33703, 3596 }, + { 12, 6882, 873, 10997, 24738, 20770, 10067, 13379, 27409, 25463, 2673, 6998, 31378 }, + { 12, + 15181, + 13645, + 34501, + 3393, + 3840, + 35227, + 15562, + 23615, + 38342, + 12139, + 19471, + 15483 }, + { 12, + 13350, + 6707, + 23709, + 37204, + 25778, + 21082, + 7511, + 14588, + 10010, + 21854, + 28375, + 33591 }, + { 12, + 12514, + 4695, + 37190, + 21379, + 18723, + 5802, + 7182, + 2529, + 29936, + 35860, + 28338, + 10835 }, + { 12, + 34283, + 25610, + 33026, + 31017, + 21259, + 2165, + 21807, + 37578, + 1175, + 16710, + 21939, + 30841 }, + { 12, + 27292, + 33730, + 6836, + 26476, + 27539, + 35784, + 18245, + 16394, + 17939, + 23094, + 19216, + 17432 }, + { 12, + 11655, + 6183, + 38708, + 28408, + 35157, + 17089, + 13998, + 36029, + 15052, + 16617, + 5638, + 36464 }, + { 12, + 15693, + 28923, + 26245, + 9432, + 11675, + 25720, + 26405, + 5838, + 31851, + 26898, + 8090, + 37037 }, + { 12, + 24418, + 27583, + 7959, + 35562, + 37771, + 17784, + 11382, + 11156, + 37855, + 7073, + 21685, + 34515 }, + { 12, + 10977, + 13633, + 30969, + 7516, + 11943, + 18199, + 5231, + 13825, + 19589, + 23661, + 11150, + 35602 }, + { 12, + 19124, + 30774, + 6670, + 37344, + 16510, + 26317, + 23518, + 22957, + 6348, + 34069, + 8845, + 20175 }, + { 12, + 34985, + 14441, + 25668, + 4116, + 3019, + 21049, + 37308, + 24551, + 24727, + 20104, + 24850, + 12114 }, + { 12, + 38187, + 28527, + 13108, + 13985, + 1425, + 21477, + 30807, + 8613, + 26241, + 33368, + 35913, + 32477 }, + { 12, + 5903, + 34390, + 24641, + 26556, + 23007, + 27305, + 38247, + 2621, + 9122, + 32806, + 21554, + 18685 }, + { 3, 17287, 27292, 19033, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25796, 31795, 12152, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12184, 35088, 31226, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38263, 33386, 24892, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23114, 37995, 29796, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34336, 10551, 36245, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35407, 175, 7203, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14654, 38201, 22605, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28404, 6595, 1018, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19932, 3524, 29305, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31749, 20247, 8128, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18026, 36357, 26735, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7543, 29767, 13588, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13333, 25965, 8463, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14504, 36796, 19710, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4528, 25299, 7318, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35091, 25550, 14798, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7824, 215, 1248, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30848, 5362, 17291, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28932, 30249, 27073, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13062, 2103, 16206, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7129, 32062, 19612, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9512, 21936, 38833, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35849, 33754, 23450, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18705, 28656, 18111, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22749, 27456, 32187, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28229, 31684, 30160, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15293, 8483, 28002, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14880, 13334, 12584, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28646, 2558, 19687, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6259, 4499, 26336, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11952, 28386, 8405, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10609, 961, 7582, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10423, 13191, 26818, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15922, 36654, 21450, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10492, 1532, 1205, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30551, 36482, 22153, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5156, 11330, 34243, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28616, 35369, 13322, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8962, 1485, 21186, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23541, 17445, 35561, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 33133, 11593, 19895, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 33917, 7863, 33651, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20063, 28331, 10702, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13195, 21107, 21859, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4364, 31137, 4804, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5585, 2037, 4830, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30672, 16927, 14800, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_1_2N[90][9]= - { - {8,54,9318,14392,27561,26909,10219,2534,8597}, - {8,55,7263,4635,2530,28130,3033,23830,3651}, - {8,56,24731,23583,26036,17299,5750,792,9169}, - {8,57,5811,26154,18653,11551,15447,13685,16264}, - {8,58,12610,11347,28768,2792,3174,29371,12997}, - {8,59,16789,16018,21449,6165,21202,15850,3186}, - {8,60,31016,21449,17618,6213,12166,8334,18212}, - {8,61,22836,14213,11327,5896,718,11727,9308}, - {8,62,2091,24941,29966,23634,9013,15587,5444}, - {8,63,22207,3983,16904,28534,21415,27524,25912}, - {8,64,25687,4501,22193,14665,14798,16158,5491}, - {8,65,4520,17094,23397,4264,22370,16941,21526}, - {8,66,10490,6182,32370,9597,30841,25954,2762}, - {8,67,22120,22865,29870,15147,13668,14955,19235}, - {8,68,6689,18408,18346,9918,25746,5443,20645}, - {8,69,29982,12529,13858,4746,30370,10023,24828}, - {8,70,1262,28032,29888,13063,24033,21951,7863}, - {8,71,6594,29642,31451,14831,9509,9335,31552}, - {8,72,1358,6454,16633,20354,24598,624,5265}, - {8,73,19529,295,18011,3080,13364,8032,15323}, - {8,74,11981,1510,7960,21462,9129,11370,25741}, - {8,75,9276,29656,4543,30699,20646,21921,28050}, - {8,76,15975,25634,5520,31119,13715,21949,19605}, - {8,77,18688,4608,31755,30165,13103,10706,29224}, - {8,78,21514,23117,12245,26035,31656,25631,30699}, - {8,79,9674,24966,31285,29908,17042,24588,31857}, - {8,80,21856,27777,29919,27000,14897,11409,7122}, - {8,81,29773,23310,263,4877,28622,20545,22092}, - {8,82,15605,5651,21864,3967,14419,22757,15896}, - {8,83,30145,1759,10139,29223,26086,10556,5098}, - {8,84,18815,16575,2936,24457,26738,6030,505}, - {8,85,30326,22298,27562,20131,26390,6247,24791}, - {8,86,928,29246,21246,12400,15311,32309,18608}, - {8,87,20314,6025,26689,16302,2296,3244,19613}, - {8,88,6237,11943,22851,15642,23857,15112,20947}, - {8,89,26403,25168,19038,18384,8882,12719,7093}, - {3,0,14567,24965,0,0,0,0,0}, - {3,1,3908,100,0,0,0,0,0}, - {3,2,10279,240,0,0,0,0,0}, - {3,3,24102,764,0,0,0,0,0}, - {3,4,12383,4173,0,0,0,0,0}, - {3,5,13861,15918,0,0,0,0,0}, - {3,6,21327,1046,0,0,0,0,0}, - {3,7,5288,14579,0,0,0,0,0}, - {3,8,28158,8069,0,0,0,0,0}, - {3,9,16583,11098,0,0,0,0,0}, - {3,10,16681,28363,0,0,0,0,0}, - {3,11,13980,24725,0,0,0,0,0}, - {3,12,32169,17989,0,0,0,0,0}, - {3,13,10907,2767,0,0,0,0,0}, - {3,14,21557,3818,0,0,0,0,0}, - {3,15,26676,12422,0,0,0,0,0}, - {3,16,7676,8754,0,0,0,0,0}, - {3,17,14905,20232,0,0,0,0,0}, - {3,18,15719,24646,0,0,0,0,0}, - {3,19,31942,8589,0,0,0,0,0}, - {3,20,19978,27197,0,0,0,0,0}, - {3,21,27060,15071,0,0,0,0,0}, - {3,22,6071,26649,0,0,0,0,0}, - {3,23,10393,11176,0,0,0,0,0}, - {3,24,9597,13370,0,0,0,0,0}, - {3,25,7081,17677,0,0,0,0,0}, - {3,26,1433,19513,0,0,0,0,0}, - {3,27,26925,9014,0,0,0,0,0}, - {3,28,19202,8900,0,0,0,0,0}, - {3,29,18152,30647,0,0,0,0,0}, - {3,30,20803,1737,0,0,0,0,0}, - {3,31,11804,25221,0,0,0,0,0}, - {3,32,31683,17783,0,0,0,0,0}, - {3,33,29694,9345,0,0,0,0,0}, - {3,34,12280,26611,0,0,0,0,0}, - {3,35,6526,26122,0,0,0,0,0}, - {3,36,26165,11241,0,0,0,0,0}, - {3,37,7666,26962,0,0,0,0,0}, - {3,38,16290,8480,0,0,0,0,0}, - {3,39,11774,10120,0,0,0,0,0}, - {3,40,30051,30426,0,0,0,0,0}, - {3,41,1335,15424,0,0,0,0,0}, - {3,42,6865,17742,0,0,0,0,0}, - {3,43,31779,12489,0,0,0,0,0}, - {3,44,32120,21001,0,0,0,0,0}, - {3,45,14508,6996,0,0,0,0,0}, - {3,46,979,25024,0,0,0,0,0}, - {3,47,4554,21896,0,0,0,0,0}, - {3,48,7989,21777,0,0,0,0,0}, - {3,49,4972,20661,0,0,0,0,0}, - {3,50,6612,2730,0,0,0,0,0}, - {3,51,12742,4418,0,0,0,0,0}, - {3,52,29194,595,0,0,0,0,0}, - {3,53,19267,20113,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_1_2N[90][9] = { + { 8, 54, 9318, 14392, 27561, 26909, 10219, 2534, 8597 }, + { 8, 55, 7263, 4635, 2530, 28130, 3033, 23830, 3651 }, + { 8, 56, 24731, 23583, 26036, 17299, 5750, 792, 9169 }, + { 8, 57, 5811, 26154, 18653, 11551, 15447, 13685, 16264 }, + { 8, 58, 12610, 11347, 28768, 2792, 3174, 29371, 12997 }, + { 8, 59, 16789, 16018, 21449, 6165, 21202, 15850, 3186 }, + { 8, 60, 31016, 21449, 17618, 6213, 12166, 8334, 18212 }, + { 8, 61, 22836, 14213, 11327, 5896, 718, 11727, 9308 }, + { 8, 62, 2091, 24941, 29966, 23634, 9013, 15587, 5444 }, + { 8, 63, 22207, 3983, 16904, 28534, 21415, 27524, 25912 }, + { 8, 64, 25687, 4501, 22193, 14665, 14798, 16158, 5491 }, + { 8, 65, 4520, 17094, 23397, 4264, 22370, 16941, 21526 }, + { 8, 66, 10490, 6182, 32370, 9597, 30841, 25954, 2762 }, + { 8, 67, 22120, 22865, 29870, 15147, 13668, 14955, 19235 }, + { 8, 68, 6689, 18408, 18346, 9918, 25746, 5443, 20645 }, + { 8, 69, 29982, 12529, 13858, 4746, 30370, 10023, 24828 }, + { 8, 70, 1262, 28032, 29888, 13063, 24033, 21951, 7863 }, + { 8, 71, 6594, 29642, 31451, 14831, 9509, 9335, 31552 }, + { 8, 72, 1358, 6454, 16633, 20354, 24598, 624, 5265 }, + { 8, 73, 19529, 295, 18011, 3080, 13364, 8032, 15323 }, + { 8, 74, 11981, 1510, 7960, 21462, 9129, 11370, 25741 }, + { 8, 75, 9276, 29656, 4543, 30699, 20646, 21921, 28050 }, + { 8, 76, 15975, 25634, 5520, 31119, 13715, 21949, 19605 }, + { 8, 77, 18688, 4608, 31755, 30165, 13103, 10706, 29224 }, + { 8, 78, 21514, 23117, 12245, 26035, 31656, 25631, 30699 }, + { 8, 79, 9674, 24966, 31285, 29908, 17042, 24588, 31857 }, + { 8, 80, 21856, 27777, 29919, 27000, 14897, 11409, 7122 }, + { 8, 81, 29773, 23310, 263, 4877, 28622, 20545, 22092 }, + { 8, 82, 15605, 5651, 21864, 3967, 14419, 22757, 15896 }, + { 8, 83, 30145, 1759, 10139, 29223, 26086, 10556, 5098 }, + { 8, 84, 18815, 16575, 2936, 24457, 26738, 6030, 505 }, + { 8, 85, 30326, 22298, 27562, 20131, 26390, 6247, 24791 }, + { 8, 86, 928, 29246, 21246, 12400, 15311, 32309, 18608 }, + { 8, 87, 20314, 6025, 26689, 16302, 2296, 3244, 19613 }, + { 8, 88, 6237, 11943, 22851, 15642, 23857, 15112, 20947 }, + { 8, 89, 26403, 25168, 19038, 18384, 8882, 12719, 7093 }, + { 3, 0, 14567, 24965, 0, 0, 0, 0, 0 }, + { 3, 1, 3908, 100, 0, 0, 0, 0, 0 }, + { 3, 2, 10279, 240, 0, 0, 0, 0, 0 }, + { 3, 3, 24102, 764, 0, 0, 0, 0, 0 }, + { 3, 4, 12383, 4173, 0, 0, 0, 0, 0 }, + { 3, 5, 13861, 15918, 0, 0, 0, 0, 0 }, + { 3, 6, 21327, 1046, 0, 0, 0, 0, 0 }, + { 3, 7, 5288, 14579, 0, 0, 0, 0, 0 }, + { 3, 8, 28158, 8069, 0, 0, 0, 0, 0 }, + { 3, 9, 16583, 11098, 0, 0, 0, 0, 0 }, + { 3, 10, 16681, 28363, 0, 0, 0, 0, 0 }, + { 3, 11, 13980, 24725, 0, 0, 0, 0, 0 }, + { 3, 12, 32169, 17989, 0, 0, 0, 0, 0 }, + { 3, 13, 10907, 2767, 0, 0, 0, 0, 0 }, + { 3, 14, 21557, 3818, 0, 0, 0, 0, 0 }, + { 3, 15, 26676, 12422, 0, 0, 0, 0, 0 }, + { 3, 16, 7676, 8754, 0, 0, 0, 0, 0 }, + { 3, 17, 14905, 20232, 0, 0, 0, 0, 0 }, + { 3, 18, 15719, 24646, 0, 0, 0, 0, 0 }, + { 3, 19, 31942, 8589, 0, 0, 0, 0, 0 }, + { 3, 20, 19978, 27197, 0, 0, 0, 0, 0 }, + { 3, 21, 27060, 15071, 0, 0, 0, 0, 0 }, + { 3, 22, 6071, 26649, 0, 0, 0, 0, 0 }, + { 3, 23, 10393, 11176, 0, 0, 0, 0, 0 }, + { 3, 24, 9597, 13370, 0, 0, 0, 0, 0 }, + { 3, 25, 7081, 17677, 0, 0, 0, 0, 0 }, + { 3, 26, 1433, 19513, 0, 0, 0, 0, 0 }, + { 3, 27, 26925, 9014, 0, 0, 0, 0, 0 }, + { 3, 28, 19202, 8900, 0, 0, 0, 0, 0 }, + { 3, 29, 18152, 30647, 0, 0, 0, 0, 0 }, + { 3, 30, 20803, 1737, 0, 0, 0, 0, 0 }, + { 3, 31, 11804, 25221, 0, 0, 0, 0, 0 }, + { 3, 32, 31683, 17783, 0, 0, 0, 0, 0 }, + { 3, 33, 29694, 9345, 0, 0, 0, 0, 0 }, + { 3, 34, 12280, 26611, 0, 0, 0, 0, 0 }, + { 3, 35, 6526, 26122, 0, 0, 0, 0, 0 }, + { 3, 36, 26165, 11241, 0, 0, 0, 0, 0 }, + { 3, 37, 7666, 26962, 0, 0, 0, 0, 0 }, + { 3, 38, 16290, 8480, 0, 0, 0, 0, 0 }, + { 3, 39, 11774, 10120, 0, 0, 0, 0, 0 }, + { 3, 40, 30051, 30426, 0, 0, 0, 0, 0 }, + { 3, 41, 1335, 15424, 0, 0, 0, 0, 0 }, + { 3, 42, 6865, 17742, 0, 0, 0, 0, 0 }, + { 3, 43, 31779, 12489, 0, 0, 0, 0, 0 }, + { 3, 44, 32120, 21001, 0, 0, 0, 0, 0 }, + { 3, 45, 14508, 6996, 0, 0, 0, 0, 0 }, + { 3, 46, 979, 25024, 0, 0, 0, 0, 0 }, + { 3, 47, 4554, 21896, 0, 0, 0, 0, 0 }, + { 3, 48, 7989, 21777, 0, 0, 0, 0, 0 }, + { 3, 49, 4972, 20661, 0, 0, 0, 0, 0 }, + { 3, 50, 6612, 2730, 0, 0, 0, 0, 0 }, + { 3, 51, 12742, 4418, 0, 0, 0, 0, 0 }, + { 3, 52, 29194, 595, 0, 0, 0, 0, 0 }, + { 3, 53, 19267, 20113, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_3_5N[108][13]= - { - {12,22422,10282,11626,19997,11161,2922,3122,99,5625,17064,8270,179}, - {12,25087,16218,17015,828,20041,25656,4186,11629,22599,17305,22515,6463}, - {12,11049,22853,25706,14388,5500,19245,8732,2177,13555,11346,17265,3069}, - {12,16581,22225,12563,19717,23577,11555,25496,6853,25403,5218,15925,21766}, - {12,16529,14487,7643,10715,17442,11119,5679,14155,24213,21000,1116,15620}, - {12,5340,8636,16693,1434,5635,6516,9482,20189,1066,15013,25361,14243}, - {12,18506,22236,20912,8952,5421,15691,6126,21595,500,6904,13059,6802}, - {12,8433,4694,5524,14216,3685,19721,25420,9937,23813,9047,25651,16826}, - {12,21500,24814,6344,17382,7064,13929,4004,16552,12818,8720,5286,2206}, - {12,22517,2429,19065,2921,21611,1873,7507,5661,23006,23128,20543,19777}, - {12,1770,4636,20900,14931,9247,12340,11008,12966,4471,2731,16445,791}, - {12,6635,14556,18865,22421,22124,12697,9803,25485,7744,18254,11313,9004}, - {12,19982,23963,18912,7206,12500,4382,20067,6177,21007,1195,23547,24837}, - {12,756,11158,14646,20534,3647,17728,11676,11843,12937,4402,8261,22944}, - {12,9306,24009,10012,11081,3746,24325,8060,19826,842,8836,2898,5019}, - {12,7575,7455,25244,4736,14400,22981,5543,8006,24203,13053,1120,5128}, - {12,3482,9270,13059,15825,7453,23747,3656,24585,16542,17507,22462,14670}, - {12,15627,15290,4198,22748,5842,13395,23918,16985,14929,3726,25350,24157}, - {12,24896,16365,16423,13461,16615,8107,24741,3604,25904,8716,9604,20365}, - {12,3729,17245,18448,9862,20831,25326,20517,24618,13282,5099,14183,8804}, - {12,16455,17646,15376,18194,25528,1777,6066,21855,14372,12517,4488,17490}, - {12,1400,8135,23375,20879,8476,4084,12936,25536,22309,16582,6402,24360}, - {12,25119,23586,128,4761,10443,22536,8607,9752,25446,15053,1856,4040}, - {12,377,21160,13474,5451,17170,5938,10256,11972,24210,17833,22047,16108}, - {12,13075,9648,24546,13150,23867,7309,19798,2988,16858,4825,23950,15125}, - {12,20526,3553,11525,23366,2452,17626,19265,20172,18060,24593,13255,1552}, - {12,18839,21132,20119,15214,14705,7096,10174,5663,18651,19700,12524,14033}, - {12,4127,2971,17499,16287,22368,21463,7943,18880,5567,8047,23363,6797}, - {12,10651,24471,14325,4081,7258,4949,7044,1078,797,22910,20474,4318}, - {12,21374,13231,22985,5056,3821,23718,14178,9978,19030,23594,8895,25358}, - {12,6199,22056,7749,13310,3999,23697,16445,22636,5225,22437,24153,9442}, - {12,7978,12177,2893,20778,3175,8645,11863,24623,10311,25767,17057,3691}, - {12,20473,11294,9914,22815,2574,8439,3699,5431,24840,21908,16088,18244}, - {12,8208,5755,19059,8541,24924,6454,11234,10492,16406,10831,11436,9649}, - {12,16264,11275,24953,2347,12667,19190,7257,7174,24819,2938,2522,11749}, - {12,3627,5969,13862,1538,23176,6353,2855,17720,2472,7428,573,15036}, - {3,0,18539,18661,0,0,0,0,0,0,0,0,0}, - {3,1,10502,3002,0,0,0,0,0,0,0,0,0}, - {3,2,9368,10761,0,0,0,0,0,0,0,0,0}, - {3,3,12299,7828,0,0,0,0,0,0,0,0,0}, - {3,4,15048,13362,0,0,0,0,0,0,0,0,0}, - {3,5,18444,24640,0,0,0,0,0,0,0,0,0}, - {3,6,20775,19175,0,0,0,0,0,0,0,0,0}, - {3,7,18970,10971,0,0,0,0,0,0,0,0,0}, - {3,8,5329,19982,0,0,0,0,0,0,0,0,0}, - {3,9,11296,18655,0,0,0,0,0,0,0,0,0}, - {3,10,15046,20659,0,0,0,0,0,0,0,0,0}, - {3,11,7300,22140,0,0,0,0,0,0,0,0,0}, - {3,12,22029,14477,0,0,0,0,0,0,0,0,0}, - {3,13,11129,742,0,0,0,0,0,0,0,0,0}, - {3,14,13254,13813,0,0,0,0,0,0,0,0,0}, - {3,15,19234,13273,0,0,0,0,0,0,0,0,0}, - {3,16,6079,21122,0,0,0,0,0,0,0,0,0}, - {3,17,22782,5828,0,0,0,0,0,0,0,0,0}, - {3,18,19775,4247,0,0,0,0,0,0,0,0,0}, - {3,19,1660,19413,0,0,0,0,0,0,0,0,0}, - {3,20,4403,3649,0,0,0,0,0,0,0,0,0}, - {3,21,13371,25851,0,0,0,0,0,0,0,0,0}, - {3,22,22770,21784,0,0,0,0,0,0,0,0,0}, - {3,23,10757,14131,0,0,0,0,0,0,0,0,0}, - {3,24,16071,21617,0,0,0,0,0,0,0,0,0}, - {3,25,6393,3725,0,0,0,0,0,0,0,0,0}, - {3,26,597,19968,0,0,0,0,0,0,0,0,0}, - {3,27,5743,8084,0,0,0,0,0,0,0,0,0}, - {3,28,6770,9548,0,0,0,0,0,0,0,0,0}, - {3,29,4285,17542,0,0,0,0,0,0,0,0,0}, - {3,30,13568,22599,0,0,0,0,0,0,0,0,0}, - {3,31,1786,4617,0,0,0,0,0,0,0,0,0}, - {3,32,23238,11648,0,0,0,0,0,0,0,0,0}, - {3,33,19627,2030,0,0,0,0,0,0,0,0,0}, - {3,34,13601,13458,0,0,0,0,0,0,0,0,0}, - {3,35,13740,17328,0,0,0,0,0,0,0,0,0}, - {3,36,25012,13944,0,0,0,0,0,0,0,0,0}, - {3,37,22513,6687,0,0,0,0,0,0,0,0,0}, - {3,38,4934,12587,0,0,0,0,0,0,0,0,0}, - {3,39,21197,5133,0,0,0,0,0,0,0,0,0}, - {3,40,22705,6938,0,0,0,0,0,0,0,0,0}, - {3,41,7534,24633,0,0,0,0,0,0,0,0,0}, - {3,42,24400,12797,0,0,0,0,0,0,0,0,0}, - {3,43,21911,25712,0,0,0,0,0,0,0,0,0}, - {3,44,12039,1140,0,0,0,0,0,0,0,0,0}, - {3,45,24306,1021,0,0,0,0,0,0,0,0,0}, - {3,46,14012,20747,0,0,0,0,0,0,0,0,0}, - {3,47,11265,15219,0,0,0,0,0,0,0,0,0}, - {3,48,4670,15531,0,0,0,0,0,0,0,0,0}, - {3,49,9417,14359,0,0,0,0,0,0,0,0,0}, - {3,50,2415,6504,0,0,0,0,0,0,0,0,0}, - {3,51,24964,24690,0,0,0,0,0,0,0,0,0}, - {3,52,14443,8816,0,0,0,0,0,0,0,0,0}, - {3,53,6926,1291,0,0,0,0,0,0,0,0,0}, - {3,54,6209,20806,0,0,0,0,0,0,0,0,0}, - {3,55,13915,4079,0,0,0,0,0,0,0,0,0}, - {3,56,24410,13196,0,0,0,0,0,0,0,0,0}, - {3,57,13505,6117,0,0,0,0,0,0,0,0,0}, - {3,58,9869,8220,0,0,0,0,0,0,0,0,0}, - {3,59,1570,6044,0,0,0,0,0,0,0,0,0}, - {3,60,25780,17387,0,0,0,0,0,0,0,0,0}, - {3,61,20671,24913,0,0,0,0,0,0,0,0,0}, - {3,62,24558,20591,0,0,0,0,0,0,0,0,0}, - {3,63,12402,3702,0,0,0,0,0,0,0,0,0}, - {3,64,8314,1357,0,0,0,0,0,0,0,0,0}, - {3,65,20071,14616,0,0,0,0,0,0,0,0,0}, - {3,66,17014,3688,0,0,0,0,0,0,0,0,0}, - {3,67,19837,946,0,0,0,0,0,0,0,0,0}, - {3,68,15195,12136,0,0,0,0,0,0,0,0,0}, - {3,69,7758,22808,0,0,0,0,0,0,0,0,0}, - {3,70,3564,2925,0,0,0,0,0,0,0,0,0}, - {3,71,3434,7769,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_3_5N[108][13] = { + { 12, 22422, 10282, 11626, 19997, 11161, 2922, 3122, 99, 5625, 17064, 8270, 179 }, + { 12, + 25087, + 16218, + 17015, + 828, + 20041, + 25656, + 4186, + 11629, + 22599, + 17305, + 22515, + 6463 }, + { 12, + 11049, + 22853, + 25706, + 14388, + 5500, + 19245, + 8732, + 2177, + 13555, + 11346, + 17265, + 3069 }, + { 12, + 16581, + 22225, + 12563, + 19717, + 23577, + 11555, + 25496, + 6853, + 25403, + 5218, + 15925, + 21766 }, + { 12, + 16529, + 14487, + 7643, + 10715, + 17442, + 11119, + 5679, + 14155, + 24213, + 21000, + 1116, + 15620 }, + { 12, 5340, 8636, 16693, 1434, 5635, 6516, 9482, 20189, 1066, 15013, 25361, 14243 }, + { 12, 18506, 22236, 20912, 8952, 5421, 15691, 6126, 21595, 500, 6904, 13059, 6802 }, + { 12, 8433, 4694, 5524, 14216, 3685, 19721, 25420, 9937, 23813, 9047, 25651, 16826 }, + { 12, 21500, 24814, 6344, 17382, 7064, 13929, 4004, 16552, 12818, 8720, 5286, 2206 }, + { 12, 22517, 2429, 19065, 2921, 21611, 1873, 7507, 5661, 23006, 23128, 20543, 19777 }, + { 12, 1770, 4636, 20900, 14931, 9247, 12340, 11008, 12966, 4471, 2731, 16445, 791 }, + { 12, + 6635, + 14556, + 18865, + 22421, + 22124, + 12697, + 9803, + 25485, + 7744, + 18254, + 11313, + 9004 }, + { 12, + 19982, + 23963, + 18912, + 7206, + 12500, + 4382, + 20067, + 6177, + 21007, + 1195, + 23547, + 24837 }, + { 12, 756, 11158, 14646, 20534, 3647, 17728, 11676, 11843, 12937, 4402, 8261, 22944 }, + { 12, 9306, 24009, 10012, 11081, 3746, 24325, 8060, 19826, 842, 8836, 2898, 5019 }, + { 12, 7575, 7455, 25244, 4736, 14400, 22981, 5543, 8006, 24203, 13053, 1120, 5128 }, + { 12, + 3482, + 9270, + 13059, + 15825, + 7453, + 23747, + 3656, + 24585, + 16542, + 17507, + 22462, + 14670 }, + { 12, + 15627, + 15290, + 4198, + 22748, + 5842, + 13395, + 23918, + 16985, + 14929, + 3726, + 25350, + 24157 }, + { 12, + 24896, + 16365, + 16423, + 13461, + 16615, + 8107, + 24741, + 3604, + 25904, + 8716, + 9604, + 20365 }, + { 12, + 3729, + 17245, + 18448, + 9862, + 20831, + 25326, + 20517, + 24618, + 13282, + 5099, + 14183, + 8804 }, + { 12, + 16455, + 17646, + 15376, + 18194, + 25528, + 1777, + 6066, + 21855, + 14372, + 12517, + 4488, + 17490 }, + { 12, 1400, 8135, 23375, 20879, 8476, 4084, 12936, 25536, 22309, 16582, 6402, 24360 }, + { 12, 25119, 23586, 128, 4761, 10443, 22536, 8607, 9752, 25446, 15053, 1856, 4040 }, + { 12, + 377, + 21160, + 13474, + 5451, + 17170, + 5938, + 10256, + 11972, + 24210, + 17833, + 22047, + 16108 }, + { 12, + 13075, + 9648, + 24546, + 13150, + 23867, + 7309, + 19798, + 2988, + 16858, + 4825, + 23950, + 15125 }, + { 12, + 20526, + 3553, + 11525, + 23366, + 2452, + 17626, + 19265, + 20172, + 18060, + 24593, + 13255, + 1552 }, + { 12, + 18839, + 21132, + 20119, + 15214, + 14705, + 7096, + 10174, + 5663, + 18651, + 19700, + 12524, + 14033 }, + { 12, 4127, 2971, 17499, 16287, 22368, 21463, 7943, 18880, 5567, 8047, 23363, 6797 }, + { 12, 10651, 24471, 14325, 4081, 7258, 4949, 7044, 1078, 797, 22910, 20474, 4318 }, + { 12, + 21374, + 13231, + 22985, + 5056, + 3821, + 23718, + 14178, + 9978, + 19030, + 23594, + 8895, + 25358 }, + { 12, 6199, 22056, 7749, 13310, 3999, 23697, 16445, 22636, 5225, 22437, 24153, 9442 }, + { 12, 7978, 12177, 2893, 20778, 3175, 8645, 11863, 24623, 10311, 25767, 17057, 3691 }, + { 12, 20473, 11294, 9914, 22815, 2574, 8439, 3699, 5431, 24840, 21908, 16088, 18244 }, + { 12, 8208, 5755, 19059, 8541, 24924, 6454, 11234, 10492, 16406, 10831, 11436, 9649 }, + { 12, 16264, 11275, 24953, 2347, 12667, 19190, 7257, 7174, 24819, 2938, 2522, 11749 }, + { 12, 3627, 5969, 13862, 1538, 23176, 6353, 2855, 17720, 2472, 7428, 573, 15036 }, + { 3, 0, 18539, 18661, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 10502, 3002, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 9368, 10761, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 12299, 7828, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 15048, 13362, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 18444, 24640, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 20775, 19175, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 18970, 10971, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 5329, 19982, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 11296, 18655, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 15046, 20659, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 7300, 22140, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 22029, 14477, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 11129, 742, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 13254, 13813, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 19234, 13273, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 6079, 21122, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 22782, 5828, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18, 19775, 4247, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 1660, 19413, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 4403, 3649, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 13371, 25851, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 22770, 21784, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 10757, 14131, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 16071, 21617, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 6393, 3725, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 597, 19968, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 5743, 8084, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 6770, 9548, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 4285, 17542, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30, 13568, 22599, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31, 1786, 4617, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 32, 23238, 11648, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 33, 19627, 2030, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34, 13601, 13458, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35, 13740, 17328, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 36, 25012, 13944, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 37, 22513, 6687, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38, 4934, 12587, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 39, 21197, 5133, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 40, 22705, 6938, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 41, 7534, 24633, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 42, 24400, 12797, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 43, 21911, 25712, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 44, 12039, 1140, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 45, 24306, 1021, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 46, 14012, 20747, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 47, 11265, 15219, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 48, 4670, 15531, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 49, 9417, 14359, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 50, 2415, 6504, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 51, 24964, 24690, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 52, 14443, 8816, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 53, 6926, 1291, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 54, 6209, 20806, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 55, 13915, 4079, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 56, 24410, 13196, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 57, 13505, 6117, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 58, 9869, 8220, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 59, 1570, 6044, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 60, 25780, 17387, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 61, 20671, 24913, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 62, 24558, 20591, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 63, 12402, 3702, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 64, 8314, 1357, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 65, 20071, 14616, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 66, 17014, 3688, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 67, 19837, 946, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 68, 15195, 12136, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 69, 7758, 22808, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 70, 3564, 2925, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 71, 3434, 7769, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_2_3N_DVBT2[120][14]= - { - {13,317,2255,2324,2723,3538,3576,6194,6700,9101,10057,12739,17407,21039}, - {13,1958,2007,3294,4394,12762,14505,14593,14692,16522,17737,19245,21272,21379}, - {13,127,860,5001,5633,8644,9282,12690,14644,17553,19511,19681,20954,21002}, - {13,2514,2822,5781,6297,8063,9469,9551,11407,11837,12985,15710,20236,20393}, - {13,1565,3106,4659,4926,6495,6872,7343,8720,15785,16434,16727,19884,21325}, - {13,706,3220,8568,10896,12486,13663,16398,16599,19475,19781,20625,20961,21335}, - {13,4257,10449,12406,14561,16049,16522,17214,18029,18033,18802,19062,19526,20748}, - {13,412,433,558,2614,2978,4157,6584,9320,11683,11819,13024,14486,16860}, - {13,777,5906,7403,8550,8717,8770,11436,12846,13629,14755,15688,16392,16419}, - {13,4093,5045,6037,7248,8633,9771,10260,10809,11326,12072,17516,19344,19938}, - {13,2120,2648,3155,3852,6888,12258,14821,15359,16378,16437,17791,20614,21025}, - {13,1085,2434,5816,7151,8050,9422,10884,12728,15353,17733,18140,18729,20920}, - {3,856,1690,12787,0,0,0,0,0,0,0,0,0}, - {3,6532,7357,9151,0,0,0,0,0,0,0,0,0}, - {3,4210,16615,18152,0,0,0,0,0,0,0,0,0}, - {3,11494,14036,17470,0,0,0,0,0,0,0,0,0}, - {3,2474,10291,10323,0,0,0,0,0,0,0,0,0}, - {3,1778,6973,10739,0,0,0,0,0,0,0,0,0}, - {3,4347,9570,18748,0,0,0,0,0,0,0,0,0}, - {3,2189,11942,20666,0,0,0,0,0,0,0,0,0}, - {3,3868,7526,17706,0,0,0,0,0,0,0,0,0}, - {3,8780,14796,18268,0,0,0,0,0,0,0,0,0}, - {3,160,16232,17399,0,0,0,0,0,0,0,0,0}, - {3,1285,2003,18922,0,0,0,0,0,0,0,0,0}, - {3,4658,17331,20361,0,0,0,0,0,0,0,0,0}, - {3,2765,4862,5875,0,0,0,0,0,0,0,0,0}, - {3,4565,5521,8759,0,0,0,0,0,0,0,0,0}, - {3,3484,7305,15829,0,0,0,0,0,0,0,0,0}, - {3,5024,17730,17879,0,0,0,0,0,0,0,0,0}, - {3,7031,12346,15024,0,0,0,0,0,0,0,0,0}, - {3,179,6365,11352,0,0,0,0,0,0,0,0,0}, - {3,2490,3143,5098,0,0,0,0,0,0,0,0,0}, - {3,2643,3101,21259,0,0,0,0,0,0,0,0,0}, - {3,4315,4724,13130,0,0,0,0,0,0,0,0,0}, - {3,594,17365,18322,0,0,0,0,0,0,0,0,0}, - {3,5983,8597,9627,0,0,0,0,0,0,0,0,0}, - {3,10837,15102,20876,0,0,0,0,0,0,0,0,0}, - {3,10448,20418,21478,0,0,0,0,0,0,0,0,0}, - {3,3848,12029,15228,0,0,0,0,0,0,0,0,0}, - {3,708,5652,13146,0,0,0,0,0,0,0,0,0}, - {3,5998,7534,16117,0,0,0,0,0,0,0,0,0}, - {3,2098,13201,18317,0,0,0,0,0,0,0,0,0}, - {3,9186,14548,17776,0,0,0,0,0,0,0,0,0}, - {3,5246,10398,18597,0,0,0,0,0,0,0,0,0}, - {3,3083,4944,21021,0,0,0,0,0,0,0,0,0}, - {3,13726,18495,19921,0,0,0,0,0,0,0,0,0}, - {3,6736,10811,17545,0,0,0,0,0,0,0,0,0}, - {3,10084,12411,14432,0,0,0,0,0,0,0,0,0}, - {3,1064,13555,17033,0,0,0,0,0,0,0,0,0}, - {3,679,9878,13547,0,0,0,0,0,0,0,0,0}, - {3,3422,9910,20194,0,0,0,0,0,0,0,0,0}, - {3,3640,3701,10046,0,0,0,0,0,0,0,0,0}, - {3,5862,10134,11498,0,0,0,0,0,0,0,0,0}, - {3,5923,9580,15060,0,0,0,0,0,0,0,0,0}, - {3,1073,3012,16427,0,0,0,0,0,0,0,0,0}, - {3,5527,20113,20883,0,0,0,0,0,0,0,0,0}, - {3,7058,12924,15151,0,0,0,0,0,0,0,0,0}, - {3,9764,12230,17375,0,0,0,0,0,0,0,0,0}, - {3,772,7711,12723,0,0,0,0,0,0,0,0,0}, - {3,555,13816,15376,0,0,0,0,0,0,0,0,0}, - {3,10574,11268,17932,0,0,0,0,0,0,0,0,0}, - {3,15442,17266,20482,0,0,0,0,0,0,0,0,0}, - {3,390,3371,8781,0,0,0,0,0,0,0,0,0}, - {3,10512,12216,17180,0,0,0,0,0,0,0,0,0}, - {3,4309,14068,15783,0,0,0,0,0,0,0,0,0}, - {3,3971,11673,20009,0,0,0,0,0,0,0,0,0}, - {3,9259,14270,17199,0,0,0,0,0,0,0,0,0}, - {3,2947,5852,20101,0,0,0,0,0,0,0,0,0}, - {3,3965,9722,15363,0,0,0,0,0,0,0,0,0}, - {3,1429,5689,16771,0,0,0,0,0,0,0,0,0}, - {3,6101,6849,12781,0,0,0,0,0,0,0,0,0}, - {3,3676,9347,18761,0,0,0,0,0,0,0,0,0}, - {3,350,11659,18342,0,0,0,0,0,0,0,0,0}, - {3,5961,14803,16123,0,0,0,0,0,0,0,0,0}, - {3,2113,9163,13443,0,0,0,0,0,0,0,0,0}, - {3,2155,9808,12885,0,0,0,0,0,0,0,0,0}, - {3,2861,7988,11031,0,0,0,0,0,0,0,0,0}, - {3,7309,9220,20745,0,0,0,0,0,0,0,0,0}, - {3,6834,8742,11977,0,0,0,0,0,0,0,0,0}, - {3,2133,12908,14704,0,0,0,0,0,0,0,0,0}, - {3,10170,13809,18153,0,0,0,0,0,0,0,0,0}, - {3,13464,14787,14975,0,0,0,0,0,0,0,0,0}, - {3,799,1107,3789,0,0,0,0,0,0,0,0,0}, - {3,3571,8176,10165,0,0,0,0,0,0,0,0,0}, - {3,5433,13446,15481,0,0,0,0,0,0,0,0,0}, - {3,3351,6767,12840,0,0,0,0,0,0,0,0,0}, - {3,8950,8974,11650,0,0,0,0,0,0,0,0,0}, - {3,1430,4250,21332,0,0,0,0,0,0,0,0,0}, - {3,6283,10628,15050,0,0,0,0,0,0,0,0,0}, - {3,8632,14404,16916,0,0,0,0,0,0,0,0,0}, - {3,6509,10702,16278,0,0,0,0,0,0,0,0,0}, - {3,15900,16395,17995,0,0,0,0,0,0,0,0,0}, - {3,8031,18420,19733,0,0,0,0,0,0,0,0,0}, - {3,3747,4634,17087,0,0,0,0,0,0,0,0,0}, - {3,4453,6297,16262,0,0,0,0,0,0,0,0,0}, - {3,2792,3513,17031,0,0,0,0,0,0,0,0,0}, - {3,14846,20893,21563,0,0,0,0,0,0,0,0,0}, - {3,17220,20436,21337,0,0,0,0,0,0,0,0,0}, - {3,275,4107,10497,0,0,0,0,0,0,0,0,0}, - {3,3536,7520,10027,0,0,0,0,0,0,0,0,0}, - {3,14089,14943,19455,0,0,0,0,0,0,0,0,0}, - {3,1965,3931,21104,0,0,0,0,0,0,0,0,0}, - {3,2439,11565,17932,0,0,0,0,0,0,0,0,0}, - {3,154,15279,21414,0,0,0,0,0,0,0,0,0}, - {3,10017,11269,16546,0,0,0,0,0,0,0,0,0}, - {3,7169,10161,16928,0,0,0,0,0,0,0,0,0}, - {3,10284,16791,20655,0,0,0,0,0,0,0,0,0}, - {3,36,3175,8475,0,0,0,0,0,0,0,0,0}, - {3,2605,16269,19290,0,0,0,0,0,0,0,0,0}, - {3,8947,9178,15420,0,0,0,0,0,0,0,0,0}, - {3,5687,9156,12408,0,0,0,0,0,0,0,0,0}, - {3,8096,9738,14711,0,0,0,0,0,0,0,0,0}, - {3,4935,8093,19266,0,0,0,0,0,0,0,0,0}, - {3,2667,10062,15972,0,0,0,0,0,0,0,0,0}, - {3,6389,11318,14417,0,0,0,0,0,0,0,0,0}, - {3,8800,18137,18434,0,0,0,0,0,0,0,0,0}, - {3,5824,5927,15314,0,0,0,0,0,0,0,0,0}, - {3,6056,13168,15179,0,0,0,0,0,0,0,0,0}, - {3,3284,13138,18919,0,0,0,0,0,0,0,0,0}, - {3,13115,17259,17332,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_2_3N_DVBT2[120][14] = { + { 13, + 317, + 2255, + 2324, + 2723, + 3538, + 3576, + 6194, + 6700, + 9101, + 10057, + 12739, + 17407, + 21039 }, + { 13, + 1958, + 2007, + 3294, + 4394, + 12762, + 14505, + 14593, + 14692, + 16522, + 17737, + 19245, + 21272, + 21379 }, + { 13, + 127, + 860, + 5001, + 5633, + 8644, + 9282, + 12690, + 14644, + 17553, + 19511, + 19681, + 20954, + 21002 }, + { 13, + 2514, + 2822, + 5781, + 6297, + 8063, + 9469, + 9551, + 11407, + 11837, + 12985, + 15710, + 20236, + 20393 }, + { 13, + 1565, + 3106, + 4659, + 4926, + 6495, + 6872, + 7343, + 8720, + 15785, + 16434, + 16727, + 19884, + 21325 }, + { 13, + 706, + 3220, + 8568, + 10896, + 12486, + 13663, + 16398, + 16599, + 19475, + 19781, + 20625, + 20961, + 21335 }, + { 13, + 4257, + 10449, + 12406, + 14561, + 16049, + 16522, + 17214, + 18029, + 18033, + 18802, + 19062, + 19526, + 20748 }, + { 13, + 412, + 433, + 558, + 2614, + 2978, + 4157, + 6584, + 9320, + 11683, + 11819, + 13024, + 14486, + 16860 }, + { 13, + 777, + 5906, + 7403, + 8550, + 8717, + 8770, + 11436, + 12846, + 13629, + 14755, + 15688, + 16392, + 16419 }, + { 13, + 4093, + 5045, + 6037, + 7248, + 8633, + 9771, + 10260, + 10809, + 11326, + 12072, + 17516, + 19344, + 19938 }, + { 13, + 2120, + 2648, + 3155, + 3852, + 6888, + 12258, + 14821, + 15359, + 16378, + 16437, + 17791, + 20614, + 21025 }, + { 13, + 1085, + 2434, + 5816, + 7151, + 8050, + 9422, + 10884, + 12728, + 15353, + 17733, + 18140, + 18729, + 20920 }, + { 3, 856, 1690, 12787, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6532, 7357, 9151, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4210, 16615, 18152, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11494, 14036, 17470, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2474, 10291, 10323, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1778, 6973, 10739, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4347, 9570, 18748, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2189, 11942, 20666, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3868, 7526, 17706, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8780, 14796, 18268, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 160, 16232, 17399, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1285, 2003, 18922, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4658, 17331, 20361, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2765, 4862, 5875, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4565, 5521, 8759, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3484, 7305, 15829, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5024, 17730, 17879, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7031, 12346, 15024, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 179, 6365, 11352, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2490, 3143, 5098, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2643, 3101, 21259, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4315, 4724, 13130, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 594, 17365, 18322, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5983, 8597, 9627, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10837, 15102, 20876, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10448, 20418, 21478, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3848, 12029, 15228, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 708, 5652, 13146, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5998, 7534, 16117, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2098, 13201, 18317, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9186, 14548, 17776, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5246, 10398, 18597, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3083, 4944, 21021, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13726, 18495, 19921, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6736, 10811, 17545, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10084, 12411, 14432, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1064, 13555, 17033, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 679, 9878, 13547, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3422, 9910, 20194, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3640, 3701, 10046, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5862, 10134, 11498, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5923, 9580, 15060, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1073, 3012, 16427, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5527, 20113, 20883, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7058, 12924, 15151, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9764, 12230, 17375, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 772, 7711, 12723, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 555, 13816, 15376, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10574, 11268, 17932, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15442, 17266, 20482, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 390, 3371, 8781, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10512, 12216, 17180, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4309, 14068, 15783, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3971, 11673, 20009, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9259, 14270, 17199, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2947, 5852, 20101, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3965, 9722, 15363, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1429, 5689, 16771, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6101, 6849, 12781, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3676, 9347, 18761, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 350, 11659, 18342, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5961, 14803, 16123, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2113, 9163, 13443, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2155, 9808, 12885, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2861, 7988, 11031, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7309, 9220, 20745, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6834, 8742, 11977, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2133, 12908, 14704, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10170, 13809, 18153, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13464, 14787, 14975, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 799, 1107, 3789, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3571, 8176, 10165, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5433, 13446, 15481, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3351, 6767, 12840, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8950, 8974, 11650, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1430, 4250, 21332, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6283, 10628, 15050, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8632, 14404, 16916, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6509, 10702, 16278, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15900, 16395, 17995, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8031, 18420, 19733, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3747, 4634, 17087, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4453, 6297, 16262, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2792, 3513, 17031, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14846, 20893, 21563, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17220, 20436, 21337, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 275, 4107, 10497, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3536, 7520, 10027, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14089, 14943, 19455, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1965, 3931, 21104, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2439, 11565, 17932, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 154, 15279, 21414, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10017, 11269, 16546, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7169, 10161, 16928, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10284, 16791, 20655, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 36, 3175, 8475, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2605, 16269, 19290, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8947, 9178, 15420, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5687, 9156, 12408, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8096, 9738, 14711, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4935, 8093, 19266, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2667, 10062, 15972, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6389, 11318, 14417, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8800, 18137, 18434, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5824, 5927, 15314, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6056, 13168, 15179, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3284, 13138, 18919, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13115, 17259, 17332, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_2_3N_DVBS2[120][14]= - { - {13,0,10491,16043,506,12826,8065,8226,2767,240,18673,9279,10579,20928}, - {13,1,17819,8313,6433,6224,5120,5824,12812,17187,9940,13447,13825,18483}, - {13,2,17957,6024,8681,18628,12794,5915,14576,10970,12064,20437,4455,7151}, - {13,3,19777,6183,9972,14536,8182,17749,11341,5556,4379,17434,15477,18532}, - {13,4,4651,19689,1608,659,16707,14335,6143,3058,14618,17894,20684,5306}, - {13,5,9778,2552,12096,12369,15198,16890,4851,3109,1700,18725,1997,15882}, - {13,6,486,6111,13743,11537,5591,7433,15227,14145,1483,3887,17431,12430}, - {13,7,20647,14311,11734,4180,8110,5525,12141,15761,18661,18441,10569,8192}, - {13,8,3791,14759,15264,19918,10132,9062,10010,12786,10675,9682,19246,5454}, - {13,9,19525,9485,7777,19999,8378,9209,3163,20232,6690,16518,716,7353}, - {13,10,4588,6709,20202,10905,915,4317,11073,13576,16433,368,3508,21171}, - {13,11,14072,4033,19959,12608,631,19494,14160,8249,10223,21504,12395,4322}, - {3,12,13800,14161,0,0,0,0,0,0,0,0,0,0}, - {3,13,2948,9647,0,0,0,0,0,0,0,0,0,0}, - {3,14,14693,16027,0,0,0,0,0,0,0,0,0,0}, - {3,15,20506,11082,0,0,0,0,0,0,0,0,0,0}, - {3,16,1143,9020,0,0,0,0,0,0,0,0,0,0}, - {3,17,13501,4014,0,0,0,0,0,0,0,0,0,0}, - {3,18,1548,2190,0,0,0,0,0,0,0,0,0,0}, - {3,19,12216,21556,0,0,0,0,0,0,0,0,0,0}, - {3,20,2095,19897,0,0,0,0,0,0,0,0,0,0}, - {3,21,4189,7958,0,0,0,0,0,0,0,0,0,0}, - {3,22,15940,10048,0,0,0,0,0,0,0,0,0,0}, - {3,23,515,12614,0,0,0,0,0,0,0,0,0,0}, - {3,24,8501,8450,0,0,0,0,0,0,0,0,0,0}, - {3,25,17595,16784,0,0,0,0,0,0,0,0,0,0}, - {3,26,5913,8495,0,0,0,0,0,0,0,0,0,0}, - {3,27,16394,10423,0,0,0,0,0,0,0,0,0,0}, - {3,28,7409,6981,0,0,0,0,0,0,0,0,0,0}, - {3,29,6678,15939,0,0,0,0,0,0,0,0,0,0}, - {3,30,20344,12987,0,0,0,0,0,0,0,0,0,0}, - {3,31,2510,14588,0,0,0,0,0,0,0,0,0,0}, - {3,32,17918,6655,0,0,0,0,0,0,0,0,0,0}, - {3,33,6703,19451,0,0,0,0,0,0,0,0,0,0}, - {3,34,496,4217,0,0,0,0,0,0,0,0,0,0}, - {3,35,7290,5766,0,0,0,0,0,0,0,0,0,0}, - {3,36,10521,8925,0,0,0,0,0,0,0,0,0,0}, - {3,37,20379,11905,0,0,0,0,0,0,0,0,0,0}, - {3,38,4090,5838,0,0,0,0,0,0,0,0,0,0}, - {3,39,19082,17040,0,0,0,0,0,0,0,0,0,0}, - {3,40,20233,12352,0,0,0,0,0,0,0,0,0,0}, - {3,41,19365,19546,0,0,0,0,0,0,0,0,0,0}, - {3,42,6249,19030,0,0,0,0,0,0,0,0,0,0}, - {3,43,11037,19193,0,0,0,0,0,0,0,0,0,0}, - {3,44,19760,11772,0,0,0,0,0,0,0,0,0,0}, - {3,45,19644,7428,0,0,0,0,0,0,0,0,0,0}, - {3,46,16076,3521,0,0,0,0,0,0,0,0,0,0}, - {3,47,11779,21062,0,0,0,0,0,0,0,0,0,0}, - {3,48,13062,9682,0,0,0,0,0,0,0,0,0,0}, - {3,49,8934,5217,0,0,0,0,0,0,0,0,0,0}, - {3,50,11087,3319,0,0,0,0,0,0,0,0,0,0}, - {3,51,18892,4356,0,0,0,0,0,0,0,0,0,0}, - {3,52,7894,3898,0,0,0,0,0,0,0,0,0,0}, - {3,53,5963,4360,0,0,0,0,0,0,0,0,0,0}, - {3,54,7346,11726,0,0,0,0,0,0,0,0,0,0}, - {3,55,5182,5609,0,0,0,0,0,0,0,0,0,0}, - {3,56,2412,17295,0,0,0,0,0,0,0,0,0,0}, - {3,57,9845,20494,0,0,0,0,0,0,0,0,0,0}, - {3,58,6687,1864,0,0,0,0,0,0,0,0,0,0}, - {3,59,20564,5216,0,0,0,0,0,0,0,0,0,0}, - {3,0,18226,17207,0,0,0,0,0,0,0,0,0,0}, - {3,1,9380,8266,0,0,0,0,0,0,0,0,0,0}, - {3,2,7073,3065,0,0,0,0,0,0,0,0,0,0}, - {3,3,18252,13437,0,0,0,0,0,0,0,0,0,0}, - {3,4,9161,15642,0,0,0,0,0,0,0,0,0,0}, - {3,5,10714,10153,0,0,0,0,0,0,0,0,0,0}, - {3,6,11585,9078,0,0,0,0,0,0,0,0,0,0}, - {3,7,5359,9418,0,0,0,0,0,0,0,0,0,0}, - {3,8,9024,9515,0,0,0,0,0,0,0,0,0,0}, - {3,9,1206,16354,0,0,0,0,0,0,0,0,0,0}, - {3,10,14994,1102,0,0,0,0,0,0,0,0,0,0}, - {3,11,9375,20796,0,0,0,0,0,0,0,0,0,0}, - {3,12,15964,6027,0,0,0,0,0,0,0,0,0,0}, - {3,13,14789,6452,0,0,0,0,0,0,0,0,0,0}, - {3,14,8002,18591,0,0,0,0,0,0,0,0,0,0}, - {3,15,14742,14089,0,0,0,0,0,0,0,0,0,0}, - {3,16,253,3045,0,0,0,0,0,0,0,0,0,0}, - {3,17,1274,19286,0,0,0,0,0,0,0,0,0,0}, - {3,18,14777,2044,0,0,0,0,0,0,0,0,0,0}, - {3,19,13920,9900,0,0,0,0,0,0,0,0,0,0}, - {3,20,452,7374,0,0,0,0,0,0,0,0,0,0}, - {3,21,18206,9921,0,0,0,0,0,0,0,0,0,0}, - {3,22,6131,5414,0,0,0,0,0,0,0,0,0,0}, - {3,23,10077,9726,0,0,0,0,0,0,0,0,0,0}, - {3,24,12045,5479,0,0,0,0,0,0,0,0,0,0}, - {3,25,4322,7990,0,0,0,0,0,0,0,0,0,0}, - {3,26,15616,5550,0,0,0,0,0,0,0,0,0,0}, - {3,27,15561,10661,0,0,0,0,0,0,0,0,0,0}, - {3,28,20718,7387,0,0,0,0,0,0,0,0,0,0}, - {3,29,2518,18804,0,0,0,0,0,0,0,0,0,0}, - {3,30,8984,2600,0,0,0,0,0,0,0,0,0,0}, - {3,31,6516,17909,0,0,0,0,0,0,0,0,0,0}, - {3,32,11148,98,0,0,0,0,0,0,0,0,0,0}, - {3,33,20559,3704,0,0,0,0,0,0,0,0,0,0}, - {3,34,7510,1569,0,0,0,0,0,0,0,0,0,0}, - {3,35,16000,11692,0,0,0,0,0,0,0,0,0,0}, - {3,36,9147,10303,0,0,0,0,0,0,0,0,0,0}, - {3,37,16650,191,0,0,0,0,0,0,0,0,0,0}, - {3,38,15577,18685,0,0,0,0,0,0,0,0,0,0}, - {3,39,17167,20917,0,0,0,0,0,0,0,0,0,0}, - {3,40,4256,3391,0,0,0,0,0,0,0,0,0,0}, - {3,41,20092,17219,0,0,0,0,0,0,0,0,0,0}, - {3,42,9218,5056,0,0,0,0,0,0,0,0,0,0}, - {3,43,18429,8472,0,0,0,0,0,0,0,0,0,0}, - {3,44,12093,20753,0,0,0,0,0,0,0,0,0,0}, - {3,45,16345,12748,0,0,0,0,0,0,0,0,0,0}, - {3,46,16023,11095,0,0,0,0,0,0,0,0,0,0}, - {3,47,5048,17595,0,0,0,0,0,0,0,0,0,0}, - {3,48,18995,4817,0,0,0,0,0,0,0,0,0,0}, - {3,49,16483,3536,0,0,0,0,0,0,0,0,0,0}, - {3,50,1439,16148,0,0,0,0,0,0,0,0,0,0}, - {3,51,3661,3039,0,0,0,0,0,0,0,0,0,0}, - {3,52,19010,18121,0,0,0,0,0,0,0,0,0,0}, - {3,53,8968,11793,0,0,0,0,0,0,0,0,0,0}, - {3,54,13427,18003,0,0,0,0,0,0,0,0,0,0}, - {3,55,5303,3083,0,0,0,0,0,0,0,0,0,0}, - {3,56,531,16668,0,0,0,0,0,0,0,0,0,0}, - {3,57,4771,6722,0,0,0,0,0,0,0,0,0,0}, - {3,58,5695,7960,0,0,0,0,0,0,0,0,0,0}, - {3,59,3589,14630,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_2_3N_DVBS2[120][14] = { + { 13, 0, 10491, 16043, 506, 12826, 8065, 8226, 2767, 240, 18673, 9279, 10579, 20928 }, + { 13, + 1, + 17819, + 8313, + 6433, + 6224, + 5120, + 5824, + 12812, + 17187, + 9940, + 13447, + 13825, + 18483 }, + { 13, + 2, + 17957, + 6024, + 8681, + 18628, + 12794, + 5915, + 14576, + 10970, + 12064, + 20437, + 4455, + 7151 }, + { 13, + 3, + 19777, + 6183, + 9972, + 14536, + 8182, + 17749, + 11341, + 5556, + 4379, + 17434, + 15477, + 18532 }, + { 13, + 4, + 4651, + 19689, + 1608, + 659, + 16707, + 14335, + 6143, + 3058, + 14618, + 17894, + 20684, + 5306 }, + { 13, + 5, + 9778, + 2552, + 12096, + 12369, + 15198, + 16890, + 4851, + 3109, + 1700, + 18725, + 1997, + 15882 }, + { 13, + 6, + 486, + 6111, + 13743, + 11537, + 5591, + 7433, + 15227, + 14145, + 1483, + 3887, + 17431, + 12430 }, + { 13, + 7, + 20647, + 14311, + 11734, + 4180, + 8110, + 5525, + 12141, + 15761, + 18661, + 18441, + 10569, + 8192 }, + { 13, + 8, + 3791, + 14759, + 15264, + 19918, + 10132, + 9062, + 10010, + 12786, + 10675, + 9682, + 19246, + 5454 }, + { 13, 9, 19525, 9485, 7777, 19999, 8378, 9209, 3163, 20232, 6690, 16518, 716, 7353 }, + { 13, + 10, + 4588, + 6709, + 20202, + 10905, + 915, + 4317, + 11073, + 13576, + 16433, + 368, + 3508, + 21171 }, + { 13, + 11, + 14072, + 4033, + 19959, + 12608, + 631, + 19494, + 14160, + 8249, + 10223, + 21504, + 12395, + 4322 }, + { 3, 12, 13800, 14161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 2948, 9647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 14693, 16027, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 20506, 11082, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 1143, 9020, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 13501, 4014, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18, 1548, 2190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 12216, 21556, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 2095, 19897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 4189, 7958, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 15940, 10048, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 515, 12614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 8501, 8450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 17595, 16784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 5913, 8495, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 16394, 10423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 7409, 6981, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 6678, 15939, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30, 20344, 12987, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31, 2510, 14588, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 32, 17918, 6655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 33, 6703, 19451, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34, 496, 4217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35, 7290, 5766, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 36, 10521, 8925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 37, 20379, 11905, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38, 4090, 5838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 39, 19082, 17040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 40, 20233, 12352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 41, 19365, 19546, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 42, 6249, 19030, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 43, 11037, 19193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 44, 19760, 11772, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 45, 19644, 7428, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 46, 16076, 3521, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 47, 11779, 21062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 48, 13062, 9682, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 49, 8934, 5217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 50, 11087, 3319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 51, 18892, 4356, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 52, 7894, 3898, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 53, 5963, 4360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 54, 7346, 11726, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 55, 5182, 5609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 56, 2412, 17295, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 57, 9845, 20494, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 58, 6687, 1864, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 59, 20564, 5216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 18226, 17207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 9380, 8266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 7073, 3065, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 18252, 13437, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 9161, 15642, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 10714, 10153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 11585, 9078, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 5359, 9418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 9024, 9515, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 1206, 16354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 14994, 1102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 9375, 20796, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 15964, 6027, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 14789, 6452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 8002, 18591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 14742, 14089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 253, 3045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 1274, 19286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18, 14777, 2044, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 13920, 9900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 452, 7374, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 18206, 9921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 6131, 5414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 10077, 9726, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 12045, 5479, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 4322, 7990, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 15616, 5550, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 15561, 10661, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 20718, 7387, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 2518, 18804, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30, 8984, 2600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31, 6516, 17909, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 32, 11148, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 33, 20559, 3704, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34, 7510, 1569, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35, 16000, 11692, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 36, 9147, 10303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 37, 16650, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38, 15577, 18685, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 39, 17167, 20917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 40, 4256, 3391, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 41, 20092, 17219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 42, 9218, 5056, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 43, 18429, 8472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 44, 12093, 20753, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 45, 16345, 12748, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 46, 16023, 11095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 47, 5048, 17595, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 48, 18995, 4817, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 49, 16483, 3536, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 50, 1439, 16148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 51, 3661, 3039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 52, 19010, 18121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 53, 8968, 11793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 54, 13427, 18003, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 55, 5303, 3083, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 56, 531, 16668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 57, 4771, 6722, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 58, 5695, 7960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 59, 3589, 14630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_3_4N[135][13]= - { - {12,0,6385,7901,14611,13389,11200,3252,5243,2504,2722,821,7374}, - {12,1,11359,2698,357,13824,12772,7244,6752,15310,852,2001,11417}, - {12,2,7862,7977,6321,13612,12197,14449,15137,13860,1708,6399,13444}, - {12,3,1560,11804,6975,13292,3646,3812,8772,7306,5795,14327,7866}, - {12,4,7626,11407,14599,9689,1628,2113,10809,9283,1230,15241,4870}, - {12,5,1610,5699,15876,9446,12515,1400,6303,5411,14181,13925,7358}, - {12,6,4059,8836,3405,7853,7992,15336,5970,10368,10278,9675,4651}, - {12,7,4441,3963,9153,2109,12683,7459,12030,12221,629,15212,406}, - {12,8,6007,8411,5771,3497,543,14202,875,9186,6235,13908,3563}, - {12,9,3232,6625,4795,546,9781,2071,7312,3399,7250,4932,12652}, - {12,10,8820,10088,11090,7069,6585,13134,10158,7183,488,7455,9238}, - {12,11,1903,10818,119,215,7558,11046,10615,11545,14784,7961,15619}, - {12,12,3655,8736,4917,15874,5129,2134,15944,14768,7150,2692,1469}, - {12,13,8316,3820,505,8923,6757,806,7957,4216,15589,13244,2622}, - {12,14,14463,4852,15733,3041,11193,12860,13673,8152,6551,15108,8758}, - {3,15,3149,11981,0,0,0,0,0,0,0,0,0}, - {3,16,13416,6906,0,0,0,0,0,0,0,0,0}, - {3,17,13098,13352,0,0,0,0,0,0,0,0,0}, - {3,18,2009,14460,0,0,0,0,0,0,0,0,0}, - {3,19,7207,4314,0,0,0,0,0,0,0,0,0}, - {3,20,3312,3945,0,0,0,0,0,0,0,0,0}, - {3,21,4418,6248,0,0,0,0,0,0,0,0,0}, - {3,22,2669,13975,0,0,0,0,0,0,0,0,0}, - {3,23,7571,9023,0,0,0,0,0,0,0,0,0}, - {3,24,14172,2967,0,0,0,0,0,0,0,0,0}, - {3,25,7271,7138,0,0,0,0,0,0,0,0,0}, - {3,26,6135,13670,0,0,0,0,0,0,0,0,0}, - {3,27,7490,14559,0,0,0,0,0,0,0,0,0}, - {3,28,8657,2466,0,0,0,0,0,0,0,0,0}, - {3,29,8599,12834,0,0,0,0,0,0,0,0,0}, - {3,30,3470,3152,0,0,0,0,0,0,0,0,0}, - {3,31,13917,4365,0,0,0,0,0,0,0,0,0}, - {3,32,6024,13730,0,0,0,0,0,0,0,0,0}, - {3,33,10973,14182,0,0,0,0,0,0,0,0,0}, - {3,34,2464,13167,0,0,0,0,0,0,0,0,0}, - {3,35,5281,15049,0,0,0,0,0,0,0,0,0}, - {3,36,1103,1849,0,0,0,0,0,0,0,0,0}, - {3,37,2058,1069,0,0,0,0,0,0,0,0,0}, - {3,38,9654,6095,0,0,0,0,0,0,0,0,0}, - {3,39,14311,7667,0,0,0,0,0,0,0,0,0}, - {3,40,15617,8146,0,0,0,0,0,0,0,0,0}, - {3,41,4588,11218,0,0,0,0,0,0,0,0,0}, - {3,42,13660,6243,0,0,0,0,0,0,0,0,0}, - {3,43,8578,7874,0,0,0,0,0,0,0,0,0}, - {3,44,11741,2686,0,0,0,0,0,0,0,0,0}, - {3,0,1022,1264,0,0,0,0,0,0,0,0,0}, - {3,1,12604,9965,0,0,0,0,0,0,0,0,0}, - {3,2,8217,2707,0,0,0,0,0,0,0,0,0}, - {3,3,3156,11793,0,0,0,0,0,0,0,0,0}, - {3,4,354,1514,0,0,0,0,0,0,0,0,0}, - {3,5,6978,14058,0,0,0,0,0,0,0,0,0}, - {3,6,7922,16079,0,0,0,0,0,0,0,0,0}, - {3,7,15087,12138,0,0,0,0,0,0,0,0,0}, - {3,8,5053,6470,0,0,0,0,0,0,0,0,0}, - {3,9,12687,14932,0,0,0,0,0,0,0,0,0}, - {3,10,15458,1763,0,0,0,0,0,0,0,0,0}, - {3,11,8121,1721,0,0,0,0,0,0,0,0,0}, - {3,12,12431,549,0,0,0,0,0,0,0,0,0}, - {3,13,4129,7091,0,0,0,0,0,0,0,0,0}, - {3,14,1426,8415,0,0,0,0,0,0,0,0,0}, - {3,15,9783,7604,0,0,0,0,0,0,0,0,0}, - {3,16,6295,11329,0,0,0,0,0,0,0,0,0}, - {3,17,1409,12061,0,0,0,0,0,0,0,0,0}, - {3,18,8065,9087,0,0,0,0,0,0,0,0,0}, - {3,19,2918,8438,0,0,0,0,0,0,0,0,0}, - {3,20,1293,14115,0,0,0,0,0,0,0,0,0}, - {3,21,3922,13851,0,0,0,0,0,0,0,0,0}, - {3,22,3851,4000,0,0,0,0,0,0,0,0,0}, - {3,23,5865,1768,0,0,0,0,0,0,0,0,0}, - {3,24,2655,14957,0,0,0,0,0,0,0,0,0}, - {3,25,5565,6332,0,0,0,0,0,0,0,0,0}, - {3,26,4303,12631,0,0,0,0,0,0,0,0,0}, - {3,27,11653,12236,0,0,0,0,0,0,0,0,0}, - {3,28,16025,7632,0,0,0,0,0,0,0,0,0}, - {3,29,4655,14128,0,0,0,0,0,0,0,0,0}, - {3,30,9584,13123,0,0,0,0,0,0,0,0,0}, - {3,31,13987,9597,0,0,0,0,0,0,0,0,0}, - {3,32,15409,12110,0,0,0,0,0,0,0,0,0}, - {3,33,8754,15490,0,0,0,0,0,0,0,0,0}, - {3,34,7416,15325,0,0,0,0,0,0,0,0,0}, - {3,35,2909,15549,0,0,0,0,0,0,0,0,0}, - {3,36,2995,8257,0,0,0,0,0,0,0,0,0}, - {3,37,9406,4791,0,0,0,0,0,0,0,0,0}, - {3,38,11111,4854,0,0,0,0,0,0,0,0,0}, - {3,39,2812,8521,0,0,0,0,0,0,0,0,0}, - {3,40,8476,14717,0,0,0,0,0,0,0,0,0}, - {3,41,7820,15360,0,0,0,0,0,0,0,0,0}, - {3,42,1179,7939,0,0,0,0,0,0,0,0,0}, - {3,43,2357,8678,0,0,0,0,0,0,0,0,0}, - {3,44,7703,6216,0,0,0,0,0,0,0,0,0}, - {3,0,3477,7067,0,0,0,0,0,0,0,0,0}, - {3,1,3931,13845,0,0,0,0,0,0,0,0,0}, - {3,2,7675,12899,0,0,0,0,0,0,0,0,0}, - {3,3,1754,8187,0,0,0,0,0,0,0,0,0}, - {3,4,7785,1400,0,0,0,0,0,0,0,0,0}, - {3,5,9213,5891,0,0,0,0,0,0,0,0,0}, - {3,6,2494,7703,0,0,0,0,0,0,0,0,0}, - {3,7,2576,7902,0,0,0,0,0,0,0,0,0}, - {3,8,4821,15682,0,0,0,0,0,0,0,0,0}, - {3,9,10426,11935,0,0,0,0,0,0,0,0,0}, - {3,10,1810,904,0,0,0,0,0,0,0,0,0}, - {3,11,11332,9264,0,0,0,0,0,0,0,0,0}, - {3,12,11312,3570,0,0,0,0,0,0,0,0,0}, - {3,13,14916,2650,0,0,0,0,0,0,0,0,0}, - {3,14,7679,7842,0,0,0,0,0,0,0,0,0}, - {3,15,6089,13084,0,0,0,0,0,0,0,0,0}, - {3,16,3938,2751,0,0,0,0,0,0,0,0,0}, - {3,17,8509,4648,0,0,0,0,0,0,0,0,0}, - {3,18,12204,8917,0,0,0,0,0,0,0,0,0}, - {3,19,5749,12443,0,0,0,0,0,0,0,0,0}, - {3,20,12613,4431,0,0,0,0,0,0,0,0,0}, - {3,21,1344,4014,0,0,0,0,0,0,0,0,0}, - {3,22,8488,13850,0,0,0,0,0,0,0,0,0}, - {3,23,1730,14896,0,0,0,0,0,0,0,0,0}, - {3,24,14942,7126,0,0,0,0,0,0,0,0,0}, - {3,25,14983,8863,0,0,0,0,0,0,0,0,0}, - {3,26,6578,8564,0,0,0,0,0,0,0,0,0}, - {3,27,4947,396,0,0,0,0,0,0,0,0,0}, - {3,28,297,12805,0,0,0,0,0,0,0,0,0}, - {3,29,13878,6692,0,0,0,0,0,0,0,0,0}, - {3,30,11857,11186,0,0,0,0,0,0,0,0,0}, - {3,31,14395,11493,0,0,0,0,0,0,0,0,0}, - {3,32,16145,12251,0,0,0,0,0,0,0,0,0}, - {3,33,13462,7428,0,0,0,0,0,0,0,0,0}, - {3,34,14526,13119,0,0,0,0,0,0,0,0,0}, - {3,35,2535,11243,0,0,0,0,0,0,0,0,0}, - {3,36,6465,12690,0,0,0,0,0,0,0,0,0}, - {3,37,6872,9334,0,0,0,0,0,0,0,0,0}, - {3,38,15371,14023,0,0,0,0,0,0,0,0,0}, - {3,39,8101,10187,0,0,0,0,0,0,0,0,0}, - {3,40,11963,4848,0,0,0,0,0,0,0,0,0}, - {3,41,15125,6119,0,0,0,0,0,0,0,0,0}, - {3,42,8051,14465,0,0,0,0,0,0,0,0,0}, - {3,43,11139,5167,0,0,0,0,0,0,0,0,0}, - {3,44,2883,14521,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_3_4N[135][13] = { + { 12, 0, 6385, 7901, 14611, 13389, 11200, 3252, 5243, 2504, 2722, 821, 7374 }, + { 12, 1, 11359, 2698, 357, 13824, 12772, 7244, 6752, 15310, 852, 2001, 11417 }, + { 12, 2, 7862, 7977, 6321, 13612, 12197, 14449, 15137, 13860, 1708, 6399, 13444 }, + { 12, 3, 1560, 11804, 6975, 13292, 3646, 3812, 8772, 7306, 5795, 14327, 7866 }, + { 12, 4, 7626, 11407, 14599, 9689, 1628, 2113, 10809, 9283, 1230, 15241, 4870 }, + { 12, 5, 1610, 5699, 15876, 9446, 12515, 1400, 6303, 5411, 14181, 13925, 7358 }, + { 12, 6, 4059, 8836, 3405, 7853, 7992, 15336, 5970, 10368, 10278, 9675, 4651 }, + { 12, 7, 4441, 3963, 9153, 2109, 12683, 7459, 12030, 12221, 629, 15212, 406 }, + { 12, 8, 6007, 8411, 5771, 3497, 543, 14202, 875, 9186, 6235, 13908, 3563 }, + { 12, 9, 3232, 6625, 4795, 546, 9781, 2071, 7312, 3399, 7250, 4932, 12652 }, + { 12, 10, 8820, 10088, 11090, 7069, 6585, 13134, 10158, 7183, 488, 7455, 9238 }, + { 12, 11, 1903, 10818, 119, 215, 7558, 11046, 10615, 11545, 14784, 7961, 15619 }, + { 12, 12, 3655, 8736, 4917, 15874, 5129, 2134, 15944, 14768, 7150, 2692, 1469 }, + { 12, 13, 8316, 3820, 505, 8923, 6757, 806, 7957, 4216, 15589, 13244, 2622 }, + { 12, 14, 14463, 4852, 15733, 3041, 11193, 12860, 13673, 8152, 6551, 15108, 8758 }, + { 3, 15, 3149, 11981, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 13416, 6906, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 13098, 13352, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18, 2009, 14460, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 7207, 4314, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 3312, 3945, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 4418, 6248, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 2669, 13975, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 7571, 9023, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 14172, 2967, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 7271, 7138, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 6135, 13670, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 7490, 14559, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 8657, 2466, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 8599, 12834, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30, 3470, 3152, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31, 13917, 4365, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 32, 6024, 13730, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 33, 10973, 14182, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34, 2464, 13167, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35, 5281, 15049, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 36, 1103, 1849, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 37, 2058, 1069, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38, 9654, 6095, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 39, 14311, 7667, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 40, 15617, 8146, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 41, 4588, 11218, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 42, 13660, 6243, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 43, 8578, 7874, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 44, 11741, 2686, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 1022, 1264, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 12604, 9965, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 8217, 2707, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 3156, 11793, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 354, 1514, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 6978, 14058, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 7922, 16079, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 15087, 12138, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 5053, 6470, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 12687, 14932, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 15458, 1763, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 8121, 1721, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 12431, 549, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 4129, 7091, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 1426, 8415, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 9783, 7604, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 6295, 11329, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 1409, 12061, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18, 8065, 9087, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 2918, 8438, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 1293, 14115, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 3922, 13851, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 3851, 4000, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 5865, 1768, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 2655, 14957, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 5565, 6332, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 4303, 12631, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 11653, 12236, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 16025, 7632, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 4655, 14128, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30, 9584, 13123, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31, 13987, 9597, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 32, 15409, 12110, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 33, 8754, 15490, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34, 7416, 15325, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35, 2909, 15549, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 36, 2995, 8257, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 37, 9406, 4791, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38, 11111, 4854, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 39, 2812, 8521, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 40, 8476, 14717, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 41, 7820, 15360, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 42, 1179, 7939, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 43, 2357, 8678, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 44, 7703, 6216, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 3477, 7067, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 3931, 13845, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 7675, 12899, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 1754, 8187, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 7785, 1400, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 9213, 5891, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 2494, 7703, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 2576, 7902, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 4821, 15682, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 10426, 11935, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 1810, 904, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 11332, 9264, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 11312, 3570, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 14916, 2650, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 7679, 7842, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 6089, 13084, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 3938, 2751, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 8509, 4648, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18, 12204, 8917, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 5749, 12443, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 12613, 4431, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 1344, 4014, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 8488, 13850, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 1730, 14896, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 14942, 7126, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 14983, 8863, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 6578, 8564, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 4947, 396, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 297, 12805, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 13878, 6692, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30, 11857, 11186, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31, 14395, 11493, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 32, 16145, 12251, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 33, 13462, 7428, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34, 14526, 13119, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35, 2535, 11243, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 36, 6465, 12690, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 37, 6872, 9334, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38, 15371, 14023, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 39, 8101, 10187, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 40, 11963, 4848, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 41, 15125, 6119, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 42, 8051, 14465, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 43, 11139, 5167, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 44, 2883, 14521, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_4_5N[144][12]= - { - {11,0,149,11212,5575,6360,12559,8108,8505,408,10026,12828}, - {11,1,5237,490,10677,4998,3869,3734,3092,3509,7703,10305}, - {11,2,8742,5553,2820,7085,12116,10485,564,7795,2972,2157}, - {11,3,2699,4304,8350,712,2841,3250,4731,10105,517,7516}, - {11,4,12067,1351,11992,12191,11267,5161,537,6166,4246,2363}, - {11,5,6828,7107,2127,3724,5743,11040,10756,4073,1011,3422}, - {11,6,11259,1216,9526,1466,10816,940,3744,2815,11506,11573}, - {11,7,4549,11507,1118,1274,11751,5207,7854,12803,4047,6484}, - {11,8,8430,4115,9440,413,4455,2262,7915,12402,8579,7052}, - {11,9,3885,9126,5665,4505,2343,253,4707,3742,4166,1556}, - {11,10,1704,8936,6775,8639,8179,7954,8234,7850,8883,8713}, - {11,11,11716,4344,9087,11264,2274,8832,9147,11930,6054,5455}, - {11,12,7323,3970,10329,2170,8262,3854,2087,12899,9497,11700}, - {11,13,4418,1467,2490,5841,817,11453,533,11217,11962,5251}, - {11,14,1541,4525,7976,3457,9536,7725,3788,2982,6307,5997}, - {11,15,11484,2739,4023,12107,6516,551,2572,6628,8150,9852}, - {11,16,6070,1761,4627,6534,7913,3730,11866,1813,12306,8249}, - {11,17,12441,5489,8748,7837,7660,2102,11341,2936,6712,11977}, - {3,18,10155,4210,0,0,0,0,0,0,0,0}, - {3,19,1010,10483,0,0,0,0,0,0,0,0}, - {3,20,8900,10250,0,0,0,0,0,0,0,0}, - {3,21,10243,12278,0,0,0,0,0,0,0,0}, - {3,22,7070,4397,0,0,0,0,0,0,0,0}, - {3,23,12271,3887,0,0,0,0,0,0,0,0}, - {3,24,11980,6836,0,0,0,0,0,0,0,0}, - {3,25,9514,4356,0,0,0,0,0,0,0,0}, - {3,26,7137,10281,0,0,0,0,0,0,0,0}, - {3,27,11881,2526,0,0,0,0,0,0,0,0}, - {3,28,1969,11477,0,0,0,0,0,0,0,0}, - {3,29,3044,10921,0,0,0,0,0,0,0,0}, - {3,30,2236,8724,0,0,0,0,0,0,0,0}, - {3,31,9104,6340,0,0,0,0,0,0,0,0}, - {3,32,7342,8582,0,0,0,0,0,0,0,0}, - {3,33,11675,10405,0,0,0,0,0,0,0,0}, - {3,34,6467,12775,0,0,0,0,0,0,0,0}, - {3,35,3186,12198,0,0,0,0,0,0,0,0}, - {3,0,9621,11445,0,0,0,0,0,0,0,0}, - {3,1,7486,5611,0,0,0,0,0,0,0,0}, - {3,2,4319,4879,0,0,0,0,0,0,0,0}, - {3,3,2196,344,0,0,0,0,0,0,0,0}, - {3,4,7527,6650,0,0,0,0,0,0,0,0}, - {3,5,10693,2440,0,0,0,0,0,0,0,0}, - {3,6,6755,2706,0,0,0,0,0,0,0,0}, - {3,7,5144,5998,0,0,0,0,0,0,0,0}, - {3,8,11043,8033,0,0,0,0,0,0,0,0}, - {3,9,4846,4435,0,0,0,0,0,0,0,0}, - {3,10,4157,9228,0,0,0,0,0,0,0,0}, - {3,11,12270,6562,0,0,0,0,0,0,0,0}, - {3,12,11954,7592,0,0,0,0,0,0,0,0}, - {3,13,7420,2592,0,0,0,0,0,0,0,0}, - {3,14,8810,9636,0,0,0,0,0,0,0,0}, - {3,15,689,5430,0,0,0,0,0,0,0,0}, - {3,16,920,1304,0,0,0,0,0,0,0,0}, - {3,17,1253,11934,0,0,0,0,0,0,0,0}, - {3,18,9559,6016,0,0,0,0,0,0,0,0}, - {3,19,312,7589,0,0,0,0,0,0,0,0}, - {3,20,4439,4197,0,0,0,0,0,0,0,0}, - {3,21,4002,9555,0,0,0,0,0,0,0,0}, - {3,22,12232,7779,0,0,0,0,0,0,0,0}, - {3,23,1494,8782,0,0,0,0,0,0,0,0}, - {3,24,10749,3969,0,0,0,0,0,0,0,0}, - {3,25,4368,3479,0,0,0,0,0,0,0,0}, - {3,26,6316,5342,0,0,0,0,0,0,0,0}, - {3,27,2455,3493,0,0,0,0,0,0,0,0}, - {3,28,12157,7405,0,0,0,0,0,0,0,0}, - {3,29,6598,11495,0,0,0,0,0,0,0,0}, - {3,30,11805,4455,0,0,0,0,0,0,0,0}, - {3,31,9625,2090,0,0,0,0,0,0,0,0}, - {3,32,4731,2321,0,0,0,0,0,0,0,0}, - {3,33,3578,2608,0,0,0,0,0,0,0,0}, - {3,34,8504,1849,0,0,0,0,0,0,0,0}, - {3,35,4027,1151,0,0,0,0,0,0,0,0}, - {3,0,5647,4935,0,0,0,0,0,0,0,0}, - {3,1,4219,1870,0,0,0,0,0,0,0,0}, - {3,2,10968,8054,0,0,0,0,0,0,0,0}, - {3,3,6970,5447,0,0,0,0,0,0,0,0}, - {3,4,3217,5638,0,0,0,0,0,0,0,0}, - {3,5,8972,669,0,0,0,0,0,0,0,0}, - {3,6,5618,12472,0,0,0,0,0,0,0,0}, - {3,7,1457,1280,0,0,0,0,0,0,0,0}, - {3,8,8868,3883,0,0,0,0,0,0,0,0}, - {3,9,8866,1224,0,0,0,0,0,0,0,0}, - {3,10,8371,5972,0,0,0,0,0,0,0,0}, - {3,11,266,4405,0,0,0,0,0,0,0,0}, - {3,12,3706,3244,0,0,0,0,0,0,0,0}, - {3,13,6039,5844,0,0,0,0,0,0,0,0}, - {3,14,7200,3283,0,0,0,0,0,0,0,0}, - {3,15,1502,11282,0,0,0,0,0,0,0,0}, - {3,16,12318,2202,0,0,0,0,0,0,0,0}, - {3,17,4523,965,0,0,0,0,0,0,0,0}, - {3,18,9587,7011,0,0,0,0,0,0,0,0}, - {3,19,2552,2051,0,0,0,0,0,0,0,0}, - {3,20,12045,10306,0,0,0,0,0,0,0,0}, - {3,21,11070,5104,0,0,0,0,0,0,0,0}, - {3,22,6627,6906,0,0,0,0,0,0,0,0}, - {3,23,9889,2121,0,0,0,0,0,0,0,0}, - {3,24,829,9701,0,0,0,0,0,0,0,0}, - {3,25,2201,1819,0,0,0,0,0,0,0,0}, - {3,26,6689,12925,0,0,0,0,0,0,0,0}, - {3,27,2139,8757,0,0,0,0,0,0,0,0}, - {3,28,12004,5948,0,0,0,0,0,0,0,0}, - {3,29,8704,3191,0,0,0,0,0,0,0,0}, - {3,30,8171,10933,0,0,0,0,0,0,0,0}, - {3,31,6297,7116,0,0,0,0,0,0,0,0}, - {3,32,616,7146,0,0,0,0,0,0,0,0}, - {3,33,5142,9761,0,0,0,0,0,0,0,0}, - {3,34,10377,8138,0,0,0,0,0,0,0,0}, - {3,35,7616,5811,0,0,0,0,0,0,0,0}, - {3,0,7285,9863,0,0,0,0,0,0,0,0}, - {3,1,7764,10867,0,0,0,0,0,0,0,0}, - {3,2,12343,9019,0,0,0,0,0,0,0,0}, - {3,3,4414,8331,0,0,0,0,0,0,0,0}, - {3,4,3464,642,0,0,0,0,0,0,0,0}, - {3,5,6960,2039,0,0,0,0,0,0,0,0}, - {3,6,786,3021,0,0,0,0,0,0,0,0}, - {3,7,710,2086,0,0,0,0,0,0,0,0}, - {3,8,7423,5601,0,0,0,0,0,0,0,0}, - {3,9,8120,4885,0,0,0,0,0,0,0,0}, - {3,10,12385,11990,0,0,0,0,0,0,0,0}, - {3,11,9739,10034,0,0,0,0,0,0,0,0}, - {3,12,424,10162,0,0,0,0,0,0,0,0}, - {3,13,1347,7597,0,0,0,0,0,0,0,0}, - {3,14,1450,112,0,0,0,0,0,0,0,0}, - {3,15,7965,8478,0,0,0,0,0,0,0,0}, - {3,16,8945,7397,0,0,0,0,0,0,0,0}, - {3,17,6590,8316,0,0,0,0,0,0,0,0}, - {3,18,6838,9011,0,0,0,0,0,0,0,0}, - {3,19,6174,9410,0,0,0,0,0,0,0,0}, - {3,20,255,113,0,0,0,0,0,0,0,0}, - {3,21,6197,5835,0,0,0,0,0,0,0,0}, - {3,22,12902,3844,0,0,0,0,0,0,0,0}, - {3,23,4377,3505,0,0,0,0,0,0,0,0}, - {3,24,5478,8672,0,0,0,0,0,0,0,0}, - {3,25,4453,2132,0,0,0,0,0,0,0,0}, - {3,26,9724,1380,0,0,0,0,0,0,0,0}, - {3,27,12131,11526,0,0,0,0,0,0,0,0}, - {3,28,12323,9511,0,0,0,0,0,0,0,0}, - {3,29,8231,1752,0,0,0,0,0,0,0,0}, - {3,30,497,9022,0,0,0,0,0,0,0,0}, - {3,31,9288,3080,0,0,0,0,0,0,0,0}, - {3,32,2481,7515,0,0,0,0,0,0,0,0}, - {3,33,2696,268,0,0,0,0,0,0,0,0}, - {3,34,4023,12341,0,0,0,0,0,0,0,0}, - {3,35,7108,5553,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_4_5N[144][12] = { + { 11, 0, 149, 11212, 5575, 6360, 12559, 8108, 8505, 408, 10026, 12828 }, + { 11, 1, 5237, 490, 10677, 4998, 3869, 3734, 3092, 3509, 7703, 10305 }, + { 11, 2, 8742, 5553, 2820, 7085, 12116, 10485, 564, 7795, 2972, 2157 }, + { 11, 3, 2699, 4304, 8350, 712, 2841, 3250, 4731, 10105, 517, 7516 }, + { 11, 4, 12067, 1351, 11992, 12191, 11267, 5161, 537, 6166, 4246, 2363 }, + { 11, 5, 6828, 7107, 2127, 3724, 5743, 11040, 10756, 4073, 1011, 3422 }, + { 11, 6, 11259, 1216, 9526, 1466, 10816, 940, 3744, 2815, 11506, 11573 }, + { 11, 7, 4549, 11507, 1118, 1274, 11751, 5207, 7854, 12803, 4047, 6484 }, + { 11, 8, 8430, 4115, 9440, 413, 4455, 2262, 7915, 12402, 8579, 7052 }, + { 11, 9, 3885, 9126, 5665, 4505, 2343, 253, 4707, 3742, 4166, 1556 }, + { 11, 10, 1704, 8936, 6775, 8639, 8179, 7954, 8234, 7850, 8883, 8713 }, + { 11, 11, 11716, 4344, 9087, 11264, 2274, 8832, 9147, 11930, 6054, 5455 }, + { 11, 12, 7323, 3970, 10329, 2170, 8262, 3854, 2087, 12899, 9497, 11700 }, + { 11, 13, 4418, 1467, 2490, 5841, 817, 11453, 533, 11217, 11962, 5251 }, + { 11, 14, 1541, 4525, 7976, 3457, 9536, 7725, 3788, 2982, 6307, 5997 }, + { 11, 15, 11484, 2739, 4023, 12107, 6516, 551, 2572, 6628, 8150, 9852 }, + { 11, 16, 6070, 1761, 4627, 6534, 7913, 3730, 11866, 1813, 12306, 8249 }, + { 11, 17, 12441, 5489, 8748, 7837, 7660, 2102, 11341, 2936, 6712, 11977 }, + { 3, 18, 10155, 4210, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 1010, 10483, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 8900, 10250, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 10243, 12278, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 7070, 4397, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 12271, 3887, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 11980, 6836, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 9514, 4356, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 7137, 10281, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 11881, 2526, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 1969, 11477, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 3044, 10921, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30, 2236, 8724, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31, 9104, 6340, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 32, 7342, 8582, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 33, 11675, 10405, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34, 6467, 12775, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35, 3186, 12198, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 9621, 11445, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 7486, 5611, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 4319, 4879, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 2196, 344, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 7527, 6650, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 10693, 2440, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 6755, 2706, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 5144, 5998, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 11043, 8033, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 4846, 4435, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 4157, 9228, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 12270, 6562, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 11954, 7592, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 7420, 2592, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 8810, 9636, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 689, 5430, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 920, 1304, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 1253, 11934, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18, 9559, 6016, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 312, 7589, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 4439, 4197, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 4002, 9555, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 12232, 7779, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 1494, 8782, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 10749, 3969, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 4368, 3479, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 6316, 5342, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 2455, 3493, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 12157, 7405, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 6598, 11495, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30, 11805, 4455, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31, 9625, 2090, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 32, 4731, 2321, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 33, 3578, 2608, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34, 8504, 1849, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35, 4027, 1151, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 5647, 4935, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 4219, 1870, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 10968, 8054, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 6970, 5447, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 3217, 5638, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 8972, 669, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 5618, 12472, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 1457, 1280, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 8868, 3883, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 8866, 1224, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 8371, 5972, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 266, 4405, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 3706, 3244, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 6039, 5844, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 7200, 3283, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 1502, 11282, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 12318, 2202, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 4523, 965, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18, 9587, 7011, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 2552, 2051, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 12045, 10306, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 11070, 5104, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 6627, 6906, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 9889, 2121, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 829, 9701, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 2201, 1819, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 6689, 12925, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 2139, 8757, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 12004, 5948, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 8704, 3191, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30, 8171, 10933, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31, 6297, 7116, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 32, 616, 7146, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 33, 5142, 9761, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34, 10377, 8138, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35, 7616, 5811, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 7285, 9863, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 7764, 10867, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 12343, 9019, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 4414, 8331, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 3464, 642, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 6960, 2039, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 786, 3021, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 710, 2086, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 7423, 5601, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 8120, 4885, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 12385, 11990, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 9739, 10034, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 424, 10162, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 1347, 7597, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 1450, 112, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 7965, 8478, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 8945, 7397, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 6590, 8316, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18, 6838, 9011, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 6174, 9410, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 255, 113, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 6197, 5835, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 12902, 3844, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 4377, 3505, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 5478, 8672, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 4453, 2132, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 9724, 1380, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 12131, 11526, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 12323, 9511, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 8231, 1752, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30, 497, 9022, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31, 9288, 3080, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 32, 2481, 7515, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 33, 2696, 268, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34, 4023, 12341, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35, 7108, 5553, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_5_6N[150][14]= - { - {13,0,4362,416,8909,4156,3216,3112,2560,2912,6405,8593,4969,6723}, - {13,1,2479,1786,8978,3011,4339,9313,6397,2957,7288,5484,6031,10217}, - {13,2,10175,9009,9889,3091,4985,7267,4092,8874,5671,2777,2189,8716}, - {13,3,9052,4795,3924,3370,10058,1128,9996,10165,9360,4297,434,5138}, - {13,4,2379,7834,4835,2327,9843,804,329,8353,7167,3070,1528,7311}, - {13,5,3435,7871,348,3693,1876,6585,10340,7144,5870,2084,4052,2780}, - {13,6,3917,3111,3476,1304,10331,5939,5199,1611,1991,699,8316,9960}, - {13,7,6883,3237,1717,10752,7891,9764,4745,3888,10009,4176,4614,1567}, - {13,8,10587,2195,1689,2968,5420,2580,2883,6496,111,6023,1024,4449}, - {13,9,3786,8593,2074,3321,5057,1450,3840,5444,6572,3094,9892,1512}, - {13,10,8548,1848,10372,4585,7313,6536,6379,1766,9462,2456,5606,9975}, - {13,11,8204,10593,7935,3636,3882,394,5968,8561,2395,7289,9267,9978}, - {13,12,7795,74,1633,9542,6867,7352,6417,7568,10623,725,2531,9115}, - {13,13,7151,2482,4260,5003,10105,7419,9203,6691,8798,2092,8263,3755}, - {13,14,3600,570,4527,200,9718,6771,1995,8902,5446,768,1103,6520}, - {3,15,6304,7621,0,0,0,0,0,0,0,0,0,0}, - {3,16,6498,9209,0,0,0,0,0,0,0,0,0,0}, - {3,17,7293,6786,0,0,0,0,0,0,0,0,0,0}, - {3,18,5950,1708,0,0,0,0,0,0,0,0,0,0}, - {3,19,8521,1793,0,0,0,0,0,0,0,0,0,0}, - {3,20,6174,7854,0,0,0,0,0,0,0,0,0,0}, - {3,21,9773,1190,0,0,0,0,0,0,0,0,0,0}, - {3,22,9517,10268,0,0,0,0,0,0,0,0,0,0}, - {3,23,2181,9349,0,0,0,0,0,0,0,0,0,0}, - {3,24,1949,5560,0,0,0,0,0,0,0,0,0,0}, - {3,25,1556,555,0,0,0,0,0,0,0,0,0,0}, - {3,26,8600,3827,0,0,0,0,0,0,0,0,0,0}, - {3,27,5072,1057,0,0,0,0,0,0,0,0,0,0}, - {3,28,7928,3542,0,0,0,0,0,0,0,0,0,0}, - {3,29,3226,3762,0,0,0,0,0,0,0,0,0,0}, - {3,0,7045,2420,0,0,0,0,0,0,0,0,0,0}, - {3,1,9645,2641,0,0,0,0,0,0,0,0,0}, - {3,2,2774,2452,0,0,0,0,0,0,0,0,0,0}, - {3,3,5331,2031,0,0,0,0,0,0,0,0,0,0}, - {3,4,9400,7503,0,0,0,0,0,0,0,0,0,0}, - {3,5,1850,2338,0,0,0,0,0,0,0,0,0,0}, - {3,6,10456,9774,0,0,0,0,0,0,0,0,0,0}, - {3,7,1692,9276,0,0,0,0,0,0,0,0,0,0}, - {3,8,10037,4038,0,0,0,0,0,0,0,0,0,0}, - {3,9,3964,338,0,0,0,0,0,0,0,0,0,0}, - {3,10,2640,5087,0,0,0,0,0,0,0,0,0,0}, - {3,11,858,3473,0,0,0,0,0,0,0,0,0,0}, - {3,12,5582,5683,0,0,0,0,0,0,0,0,0,0}, - {3,13,9523,916,0,0,0,0,0,0,0,0,0,0}, - {3,14,4107,1559,0,0,0,0,0,0,0,0,0,0}, - {3,15,4506,3491,0,0,0,0,0,0,0,0,0,0}, - {3,16,8191,4182,0,0,0,0,0,0,0,0,0,0}, - {3,17,10192,6157,0,0,0,0,0,0,0,0,0,0}, - {3,18,5668,3305,0,0,0,0,0,0,0,0,0,0}, - {3,19,3449,1540,0,0,0,0,0,0,0,0,0,0}, - {3,20,4766,2697,0,0,0,0,0,0,0,0,0,0}, - {3,21,4069,6675,0,0,0,0,0,0,0,0,0,0}, - {3,22,1117,1016,0,0,0,0,0,0,0,0,0,0}, - {3,23,5619,3085,0,0,0,0,0,0,0,0,0,0}, - {3,24,8483,8400,0,0,0,0,0,0,0,0,0,0}, - {3,25,8255,394,0,0,0,0,0,0,0,0,0,0}, - {3,26,6338,5042,0,0,0,0,0,0,0,0,0,0}, - {3,27,6174,5119,0,0,0,0,0,0,0,0,0,0}, - {3,28,7203,1989,0,0,0,0,0,0,0,0,0,0}, - {3,29,1781,5174,0,0,0,0,0,0,0,0,0,0}, - {3,0,1464,3559,0,0,0,0,0,0,0,0,0,0}, - {3,1,3376,4214,0,0,0,0,0,0,0,0,0,0}, - {3,2,7238,67,0,0,0,0,0,0,0,0,0,0}, - {3,3,10595,8831,0,0,0,0,0,0,0,0,0,0}, - {3,4,1221,6513,0,0,0,0,0,0,0,0,0,0}, - {3,5,5300,4652,0,0,0,0,0,0,0,0,0,0}, - {3,6,1429,9749,0,0,0,0,0,0,0,0,0,0}, - {3,7,7878,5131,0,0,0,0,0,0,0,0,0,0}, - {3,8,4435,10284,0,0,0,0,0,0,0,0,0,0}, - {3,9,6331,5507,0,0,0,0,0,0,0,0,0,0}, - {3,10,6662,4941,0,0,0,0,0,0,0,0,0,0}, - {3,11,9614,10238,0,0,0,0,0,0,0,0,0,0}, - {3,12,8400,8025,0,0,0,0,0,0,0,0,0,0}, - {3,13,9156,5630,0,0,0,0,0,0,0,0,0,0}, - {3,14,7067,8878,0,0,0,0,0,0,0,0,0,0}, - {3,15,9027,3415,0,0,0,0,0,0,0,0,0,0}, - {3,16,1690,3866,0,0,0,0,0,0,0,0,0,0}, - {3,17,2854,8469,0,0,0,0,0,0,0,0,0,0}, - {3,18,6206,630,0,0,0,0,0,0,0,0,0,0}, - {3,19,363,5453,0,0,0,0,0,0,0,0,0,0}, - {3,20,4125,7008,0,0,0,0,0,0,0,0,0,0}, - {3,21,1612,6702,0,0,0,0,0,0,0,0,0,0}, - {3,22,9069,9226,0,0,0,0,0,0,0,0,0,0}, - {3,23,5767,4060,0,0,0,0,0,0,0,0,0,0}, - {3,24,3743,9237,0,0,0,0,0,0,0,0,0,0}, - {3,25,7018,5572,0,0,0,0,0,0,0,0,0,0}, - {3,26,8892,4536,0,0,0,0,0,0,0,0,0,0}, - {3,27,853,6064,0,0,0,0,0,0,0,0,0,0}, - {3,28,8069,5893,0,0,0,0,0,0,0,0,0,0}, - {3,29,2051,2885,0,0,0,0,0,0,0,0,0,0}, - {3,0,10691,3153,0,0,0,0,0,0,0,0,0,0}, - {3,1,3602,4055,0,0,0,0,0,0,0,0,0,0}, - {3,2,328,1717,0,0,0,0,0,0,0,0,0,0}, - {3,3,2219,9299,0,0,0,0,0,0,0,0,0,0}, - {3,4,1939,7898,0,0,0,0,0,0,0,0,0,0}, - {3,5,617,206,0,0,0,0,0,0,0,0,0,0}, - {3,6,8544,1374,0,0,0,0,0,0,0,0,0,0}, - {3,7,10676,3240,0,0,0,0,0,0,0,0,0,0}, - {3,8,6672,9489,0,0,0,0,0,0,0,0,0,0}, - {3,9,3170,7457,0,0,0,0,0,0,0,0,0,0}, - {3,10,7868,5731,0,0,0,0,0,0,0,0,0,0}, - {3,11,6121,10732,0,0,0,0,0,0,0,0,0,0}, - {3,12,4843,9132,0,0,0,0,0,0,0,0,0,0}, - {3,13,580,9591,0,0,0,0,0,0,0,0,0,0}, - {3,14,6267,9290,0,0,0,0,0,0,0,0,0,0}, - {3,15,3009,2268,0,0,0,0,0,0,0,0,0,0}, - {3,16,195,2419,0,0,0,0,0,0,0,0,0,0}, - {3,17,8016,1557,0,0,0,0,0,0,0,0,0,0}, - {3,18,1516,9195,0,0,0,0,0,0,0,0,0,0}, - {3,19,8062,9064,0,0,0,0,0,0,0,0,0,0}, - {3,20,2095,8968,0,0,0,0,0,0,0,0,0,0}, - {3,21,753,7326,0,0,0,0,0,0,0,0,0,0}, - {3,22,6291,3833,0,0,0,0,0,0,0,0,0,0}, - {3,23,2614,7844,0,0,0,0,0,0,0,0,0,0}, - {3,24,2303,646,0,0,0,0,0,0,0,0,0,0}, - {3,25,2075,611,0,0,0,0,0,0,0,0,0,0}, - {3,26,4687,362,0,0,0,0,0,0,0,0,0,0}, - {3,27,8684,9940,0,0,0,0,0,0,0,0,0,0}, - {3,28,4830,2065,0,0,0,0,0,0,0,0,0,0}, - {3,29,7038,1363,0,0,0,0,0,0,0,0,0,0}, - {3,0,1769,7837,0,0,0,0,0,0,0,0,0,0}, - {3,1,3801,1689,0,0,0,0,0,0,0,0,0,0}, - {3,2,10070,2359,0,0,0,0,0,0,0,0,0,0}, - {3,3,3667,9918,0,0,0,0,0,0,0,0,0,0}, - {3,4,1914,6920,0,0,0,0,0,0,0,0,0,0}, - {3,5,4244,5669,0,0,0,0,0,0,0,0,0,0}, - {3,6,10245,7821,0,0,0,0,0,0,0,0,0,0}, - {3,7,7648,3944,0,0,0,0,0,0,0,0,0,0}, - {3,8,3310,5488,0,0,0,0,0,0,0,0,0,0}, - {3,9,6346,9666,0,0,0,0,0,0,0,0,0,0}, - {3,10,7088,6122,0,0,0,0,0,0,0,0,0,0}, - {3,11,1291,7827,0,0,0,0,0,0,0,0,0,0}, - {3,12,10592,8945,0,0,0,0,0,0,0,0,0,0}, - {3,13,3609,7120,0,0,0,0,0,0,0,0,0,0}, - {3,14,9168,9112,0,0,0,0,0,0,0,0,0,0}, - {3,15,6203,8052,0,0,0,0,0,0,0,0,0,0}, - {3,16,3330,2895,0,0,0,0,0,0,0,0,0,0}, - {3,17,4264,10563,0,0,0,0,0,0,0,0,0,0}, - {3,18,10556,6496,0,0,0,0,0,0,0,0,0,0}, - {3,19,8807,7645,0,0,0,0,0,0,0,0,0,0}, - {3,20,1999,4530,0,0,0,0,0,0,0,0,0,0}, - {3,21,9202,6818,0,0,0,0,0,0,0,0,0,0}, - {3,22,3403,1734,0,0,0,0,0,0,0,0,0,0}, - {3,23,2106,9023,0,0,0,0,0,0,0,0,0,0}, - {3,24,6881,3883,0,0,0,0,0,0,0,0,0,0}, - {3,25,3895,2171,0,0,0,0,0,0,0,0,0,0}, - {3,26,4062,6424,0,0,0,0,0,0,0,0,0,0}, - {3,27,3755,9536,0,0,0,0,0,0,0,0,0,0}, - {3,28,4683,2131,0,0,0,0,0,0,0,0,0,0}, - {3,29,7347,8027,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_5_6N[150][14] = { + { 13, 0, 4362, 416, 8909, 4156, 3216, 3112, 2560, 2912, 6405, 8593, 4969, 6723 }, + { 13, 1, 2479, 1786, 8978, 3011, 4339, 9313, 6397, 2957, 7288, 5484, 6031, 10217 }, + { 13, 2, 10175, 9009, 9889, 3091, 4985, 7267, 4092, 8874, 5671, 2777, 2189, 8716 }, + { 13, 3, 9052, 4795, 3924, 3370, 10058, 1128, 9996, 10165, 9360, 4297, 434, 5138 }, + { 13, 4, 2379, 7834, 4835, 2327, 9843, 804, 329, 8353, 7167, 3070, 1528, 7311 }, + { 13, 5, 3435, 7871, 348, 3693, 1876, 6585, 10340, 7144, 5870, 2084, 4052, 2780 }, + { 13, 6, 3917, 3111, 3476, 1304, 10331, 5939, 5199, 1611, 1991, 699, 8316, 9960 }, + { 13, 7, 6883, 3237, 1717, 10752, 7891, 9764, 4745, 3888, 10009, 4176, 4614, 1567 }, + { 13, 8, 10587, 2195, 1689, 2968, 5420, 2580, 2883, 6496, 111, 6023, 1024, 4449 }, + { 13, 9, 3786, 8593, 2074, 3321, 5057, 1450, 3840, 5444, 6572, 3094, 9892, 1512 }, + { 13, 10, 8548, 1848, 10372, 4585, 7313, 6536, 6379, 1766, 9462, 2456, 5606, 9975 }, + { 13, 11, 8204, 10593, 7935, 3636, 3882, 394, 5968, 8561, 2395, 7289, 9267, 9978 }, + { 13, 12, 7795, 74, 1633, 9542, 6867, 7352, 6417, 7568, 10623, 725, 2531, 9115 }, + { 13, 13, 7151, 2482, 4260, 5003, 10105, 7419, 9203, 6691, 8798, 2092, 8263, 3755 }, + { 13, 14, 3600, 570, 4527, 200, 9718, 6771, 1995, 8902, 5446, 768, 1103, 6520 }, + { 3, 15, 6304, 7621, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 6498, 9209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 7293, 6786, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18, 5950, 1708, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 8521, 1793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 6174, 7854, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 9773, 1190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 9517, 10268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 2181, 9349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 1949, 5560, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 1556, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 8600, 3827, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 5072, 1057, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 7928, 3542, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 3226, 3762, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 7045, 2420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 9645, 2641, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 2774, 2452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 5331, 2031, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 9400, 7503, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 1850, 2338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 10456, 9774, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 1692, 9276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 10037, 4038, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 3964, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 2640, 5087, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 858, 3473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 5582, 5683, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 9523, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 4107, 1559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 4506, 3491, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 8191, 4182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 10192, 6157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18, 5668, 3305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 3449, 1540, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 4766, 2697, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 4069, 6675, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 1117, 1016, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 5619, 3085, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 8483, 8400, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 8255, 394, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 6338, 5042, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 6174, 5119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 7203, 1989, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 1781, 5174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 1464, 3559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 3376, 4214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 7238, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 10595, 8831, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 1221, 6513, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 5300, 4652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 1429, 9749, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 7878, 5131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 4435, 10284, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 6331, 5507, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 6662, 4941, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 9614, 10238, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 8400, 8025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 9156, 5630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 7067, 8878, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 9027, 3415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 1690, 3866, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 2854, 8469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18, 6206, 630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 363, 5453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 4125, 7008, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 1612, 6702, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 9069, 9226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 5767, 4060, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 3743, 9237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 7018, 5572, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 8892, 4536, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 853, 6064, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 8069, 5893, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 2051, 2885, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 10691, 3153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 3602, 4055, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 328, 1717, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 2219, 9299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 1939, 7898, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 617, 206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 8544, 1374, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 10676, 3240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 6672, 9489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 3170, 7457, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 7868, 5731, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 6121, 10732, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 4843, 9132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 580, 9591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 6267, 9290, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 3009, 2268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 195, 2419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 8016, 1557, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18, 1516, 9195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 8062, 9064, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 2095, 8968, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 753, 7326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 6291, 3833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 2614, 7844, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 2303, 646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 2075, 611, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 4687, 362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 8684, 9940, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 4830, 2065, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 7038, 1363, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 1769, 7837, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 3801, 1689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 10070, 2359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 3667, 9918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 1914, 6920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 4244, 5669, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 10245, 7821, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 7648, 3944, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 3310, 5488, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 6346, 9666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 7088, 6122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 1291, 7827, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 10592, 8945, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 3609, 7120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 9168, 9112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 6203, 8052, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 3330, 2895, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 4264, 10563, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18, 10556, 6496, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 8807, 7645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20, 1999, 4530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21, 9202, 6818, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 3403, 1734, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 2106, 9023, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 6881, 3883, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25, 3895, 2171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26, 4062, 6424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27, 3755, 9536, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28, 4683, 2131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 7347, 8027, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_8_9N[160][5]= - { - {4,0,6235,2848,3222}, - {4,1,5800,3492,5348}, - {4,2,2757,927,90}, - {4,3,6961,4516,4739}, - {4,4,1172,3237,6264}, - {4,5,1927,2425,3683}, - {4,6,3714,6309,2495}, - {4,7,3070,6342,7154}, - {4,8,2428,613,3761}, - {4,9,2906,264,5927}, - {4,10,1716,1950,4273}, - {4,11,4613,6179,3491}, - {4,12,4865,3286,6005}, - {4,13,1343,5923,3529}, - {4,14,4589,4035,2132}, - {4,15,1579,3920,6737}, - {4,16,1644,1191,5998}, - {4,17,1482,2381,4620}, - {4,18,6791,6014,6596}, - {4,19,2738,5918,3786}, - {3,0,5156,6166,0}, - {3,1,1504,4356,0}, - {3,2,130,1904,0}, - {3,3,6027,3187,0}, - {3,4,6718,759,0}, - {3,5,6240,2870,0}, - {3,6,2343,1311,0}, - {3,7,1039,5465,0}, - {3,8,6617,2513,0}, - {3,9,1588,5222,0}, - {3,10,6561,535,0}, - {3,11,4765,2054,0}, - {3,12,5966,6892,0}, - {3,13,1969,3869,0}, - {3,14,3571,2420,0}, - {3,15,4632,981,0}, - {3,16,3215,4163,0}, - {3,17,973,3117,0}, - {3,18,3802,6198,0}, - {3,19,3794,3948,0}, - {3,0,3196,6126,0}, - {3,1,573,1909,0}, - {3,2,850,4034,0}, - {3,3,5622,1601,0}, - {3,4,6005,524,0}, - {3,5,5251,5783,0}, - {3,6,172,2032,0}, - {3,7,1875,2475,0}, - {3,8,497,1291,0}, - {3,9,2566,3430,0}, - {3,10,1249,740,0}, - {3,11,2944,1948,0}, - {3,12,6528,2899,0}, - {3,13,2243,3616,0}, - {3,14,867,3733,0}, - {3,15,1374,4702,0}, - {3,16,4698,2285,0}, - {3,17,4760,3917,0}, - {3,18,1859,4058,0}, - {3,19,6141,3527,0}, - {3,0,2148,5066,0}, - {3,1,1306,145,0}, - {3,2,2319,871,0}, - {3,3,3463,1061,0}, - {3,4,5554,6647,0}, - {3,5,5837,339,0}, - {3,6,5821,4932,0}, - {3,7,6356,4756,0}, - {3,8,3930,418,0}, - {3,9,211,3094,0}, - {3,10,1007,4928,0}, - {3,11,3584,1235,0}, - {3,12,6982,2869,0}, - {3,13,1612,1013,0}, - {3,14,953,4964,0}, - {3,15,4555,4410,0}, - {3,16,4925,4842,0}, - {3,17,5778,600,0}, - {3,18,6509,2417,0}, - {3,19,1260,4903,0}, - {3,0,3369,3031,0}, - {3,1,3557,3224,0}, - {3,2,3028,583,0}, - {3,3,3258,440,0}, - {3,4,6226,6655,0}, - {3,5,4895,1094,0}, - {3,6,1481,6847,0}, - {3,7,4433,1932,0}, - {3,8,2107,1649,0}, - {3,9,2119,2065,0}, - {3,10,4003,6388,0}, - {3,11,6720,3622,0}, - {3,12,3694,4521,0}, - {3,13,1164,7050,0}, - {3,14,1965,3613,0}, - {3,15,4331,66,0}, - {3,16,2970,1796,0}, - {3,17,4652,3218,0}, - {3,18,1762,4777,0}, - {3,19,5736,1399,0}, - {3,0,970,2572,0}, - {3,1,2062,6599,0}, - {3,2,4597,4870,0}, - {3,3,1228,6913,0}, - {3,4,4159,1037,0}, - {3,5,2916,2362,0}, - {3,6,395,1226,0}, - {3,7,6911,4548,0}, - {3,8,4618,2241,0}, - {3,9,4120,4280,0}, - {3,10,5825,474,0}, - {3,11,2154,5558,0}, - {3,12,3793,5471,0}, - {3,13,5707,1595,0}, - {3,14,1403,325,0}, - {3,15,6601,5183,0}, - {3,16,6369,4569,0}, - {3,17,4846,896,0}, - {3,18,7092,6184,0}, - {3,19,6764,7127,0}, - {3,0,6358,1951,0}, - {3,1,3117,6960,0}, - {3,2,2710,7062,0}, - {3,3,1133,3604,0}, - {3,4,3694,657,0}, - {3,5,1355,110,0}, - {3,6,3329,6736,0}, - {3,7,2505,3407,0}, - {3,8,2462,4806,0}, - {3,9,4216,214,0}, - {3,10,5348,5619,0}, - {3,11,6627,6243,0}, - {3,12,2644,5073,0}, - {3,13,4212,5088,0}, - {3,14,3463,3889,0}, - {3,15,5306,478,0}, - {3,16,4320,6121,0}, - {3,17,3961,1125,0}, - {3,18,5699,1195,0}, - {3,19,6511,792,0}, - {3,0,3934,2778,0}, - {3,1,3238,6587,0}, - {3,2,1111,6596,0}, - {3,3,1457,6226,0}, - {3,4,1446,3885,0}, - {3,5,3907,4043,0}, - {3,6,6839,2873,0}, - {3,7,1733,5615,0}, - {3,8,5202,4269,0}, - {3,9,3024,4722,0}, - {3,10,5445,6372,0}, - {3,11,370,1828,0}, - {3,12,4695,1600,0}, - {3,13,680,2074,0}, - {3,14,1801,6690,0}, - {3,15,2669,1377,0}, - {3,16,2463,1681,0}, - {3,17,5972,5171,0}, - {3,18,5728,4284,0}, - {3,19,1696,1459,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_8_9N[160][5] = { + { 4, 0, 6235, 2848, 3222 }, { 4, 1, 5800, 3492, 5348 }, { 4, 2, 2757, 927, 90 }, + { 4, 3, 6961, 4516, 4739 }, { 4, 4, 1172, 3237, 6264 }, { 4, 5, 1927, 2425, 3683 }, + { 4, 6, 3714, 6309, 2495 }, { 4, 7, 3070, 6342, 7154 }, { 4, 8, 2428, 613, 3761 }, + { 4, 9, 2906, 264, 5927 }, { 4, 10, 1716, 1950, 4273 }, { 4, 11, 4613, 6179, 3491 }, + { 4, 12, 4865, 3286, 6005 }, { 4, 13, 1343, 5923, 3529 }, { 4, 14, 4589, 4035, 2132 }, + { 4, 15, 1579, 3920, 6737 }, { 4, 16, 1644, 1191, 5998 }, { 4, 17, 1482, 2381, 4620 }, + { 4, 18, 6791, 6014, 6596 }, { 4, 19, 2738, 5918, 3786 }, { 3, 0, 5156, 6166, 0 }, + { 3, 1, 1504, 4356, 0 }, { 3, 2, 130, 1904, 0 }, { 3, 3, 6027, 3187, 0 }, + { 3, 4, 6718, 759, 0 }, { 3, 5, 6240, 2870, 0 }, { 3, 6, 2343, 1311, 0 }, + { 3, 7, 1039, 5465, 0 }, { 3, 8, 6617, 2513, 0 }, { 3, 9, 1588, 5222, 0 }, + { 3, 10, 6561, 535, 0 }, { 3, 11, 4765, 2054, 0 }, { 3, 12, 5966, 6892, 0 }, + { 3, 13, 1969, 3869, 0 }, { 3, 14, 3571, 2420, 0 }, { 3, 15, 4632, 981, 0 }, + { 3, 16, 3215, 4163, 0 }, { 3, 17, 973, 3117, 0 }, { 3, 18, 3802, 6198, 0 }, + { 3, 19, 3794, 3948, 0 }, { 3, 0, 3196, 6126, 0 }, { 3, 1, 573, 1909, 0 }, + { 3, 2, 850, 4034, 0 }, { 3, 3, 5622, 1601, 0 }, { 3, 4, 6005, 524, 0 }, + { 3, 5, 5251, 5783, 0 }, { 3, 6, 172, 2032, 0 }, { 3, 7, 1875, 2475, 0 }, + { 3, 8, 497, 1291, 0 }, { 3, 9, 2566, 3430, 0 }, { 3, 10, 1249, 740, 0 }, + { 3, 11, 2944, 1948, 0 }, { 3, 12, 6528, 2899, 0 }, { 3, 13, 2243, 3616, 0 }, + { 3, 14, 867, 3733, 0 }, { 3, 15, 1374, 4702, 0 }, { 3, 16, 4698, 2285, 0 }, + { 3, 17, 4760, 3917, 0 }, { 3, 18, 1859, 4058, 0 }, { 3, 19, 6141, 3527, 0 }, + { 3, 0, 2148, 5066, 0 }, { 3, 1, 1306, 145, 0 }, { 3, 2, 2319, 871, 0 }, + { 3, 3, 3463, 1061, 0 }, { 3, 4, 5554, 6647, 0 }, { 3, 5, 5837, 339, 0 }, + { 3, 6, 5821, 4932, 0 }, { 3, 7, 6356, 4756, 0 }, { 3, 8, 3930, 418, 0 }, + { 3, 9, 211, 3094, 0 }, { 3, 10, 1007, 4928, 0 }, { 3, 11, 3584, 1235, 0 }, + { 3, 12, 6982, 2869, 0 }, { 3, 13, 1612, 1013, 0 }, { 3, 14, 953, 4964, 0 }, + { 3, 15, 4555, 4410, 0 }, { 3, 16, 4925, 4842, 0 }, { 3, 17, 5778, 600, 0 }, + { 3, 18, 6509, 2417, 0 }, { 3, 19, 1260, 4903, 0 }, { 3, 0, 3369, 3031, 0 }, + { 3, 1, 3557, 3224, 0 }, { 3, 2, 3028, 583, 0 }, { 3, 3, 3258, 440, 0 }, + { 3, 4, 6226, 6655, 0 }, { 3, 5, 4895, 1094, 0 }, { 3, 6, 1481, 6847, 0 }, + { 3, 7, 4433, 1932, 0 }, { 3, 8, 2107, 1649, 0 }, { 3, 9, 2119, 2065, 0 }, + { 3, 10, 4003, 6388, 0 }, { 3, 11, 6720, 3622, 0 }, { 3, 12, 3694, 4521, 0 }, + { 3, 13, 1164, 7050, 0 }, { 3, 14, 1965, 3613, 0 }, { 3, 15, 4331, 66, 0 }, + { 3, 16, 2970, 1796, 0 }, { 3, 17, 4652, 3218, 0 }, { 3, 18, 1762, 4777, 0 }, + { 3, 19, 5736, 1399, 0 }, { 3, 0, 970, 2572, 0 }, { 3, 1, 2062, 6599, 0 }, + { 3, 2, 4597, 4870, 0 }, { 3, 3, 1228, 6913, 0 }, { 3, 4, 4159, 1037, 0 }, + { 3, 5, 2916, 2362, 0 }, { 3, 6, 395, 1226, 0 }, { 3, 7, 6911, 4548, 0 }, + { 3, 8, 4618, 2241, 0 }, { 3, 9, 4120, 4280, 0 }, { 3, 10, 5825, 474, 0 }, + { 3, 11, 2154, 5558, 0 }, { 3, 12, 3793, 5471, 0 }, { 3, 13, 5707, 1595, 0 }, + { 3, 14, 1403, 325, 0 }, { 3, 15, 6601, 5183, 0 }, { 3, 16, 6369, 4569, 0 }, + { 3, 17, 4846, 896, 0 }, { 3, 18, 7092, 6184, 0 }, { 3, 19, 6764, 7127, 0 }, + { 3, 0, 6358, 1951, 0 }, { 3, 1, 3117, 6960, 0 }, { 3, 2, 2710, 7062, 0 }, + { 3, 3, 1133, 3604, 0 }, { 3, 4, 3694, 657, 0 }, { 3, 5, 1355, 110, 0 }, + { 3, 6, 3329, 6736, 0 }, { 3, 7, 2505, 3407, 0 }, { 3, 8, 2462, 4806, 0 }, + { 3, 9, 4216, 214, 0 }, { 3, 10, 5348, 5619, 0 }, { 3, 11, 6627, 6243, 0 }, + { 3, 12, 2644, 5073, 0 }, { 3, 13, 4212, 5088, 0 }, { 3, 14, 3463, 3889, 0 }, + { 3, 15, 5306, 478, 0 }, { 3, 16, 4320, 6121, 0 }, { 3, 17, 3961, 1125, 0 }, + { 3, 18, 5699, 1195, 0 }, { 3, 19, 6511, 792, 0 }, { 3, 0, 3934, 2778, 0 }, + { 3, 1, 3238, 6587, 0 }, { 3, 2, 1111, 6596, 0 }, { 3, 3, 1457, 6226, 0 }, + { 3, 4, 1446, 3885, 0 }, { 3, 5, 3907, 4043, 0 }, { 3, 6, 6839, 2873, 0 }, + { 3, 7, 1733, 5615, 0 }, { 3, 8, 5202, 4269, 0 }, { 3, 9, 3024, 4722, 0 }, + { 3, 10, 5445, 6372, 0 }, { 3, 11, 370, 1828, 0 }, { 3, 12, 4695, 1600, 0 }, + { 3, 13, 680, 2074, 0 }, { 3, 14, 1801, 6690, 0 }, { 3, 15, 2669, 1377, 0 }, + { 3, 16, 2463, 1681, 0 }, { 3, 17, 5972, 5171, 0 }, { 3, 18, 5728, 4284, 0 }, + { 3, 19, 1696, 1459, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_9_10N[162][5]= - { - {4,0,5611,2563,2900}, - {4,1,5220,3143,4813}, - {4,2,2481,834,81}, - {4,3,6265,4064,4265}, - {4,4,1055,2914,5638}, - {4,5,1734,2182,3315}, - {4,6,3342,5678,2246}, - {4,7,2185,552,3385}, - {4,8,2615,236,5334}, - {4,9,1546,1755,3846}, - {4,10,4154,5561,3142}, - {4,11,4382,2957,5400}, - {4,12,1209,5329,3179}, - {4,13,1421,3528,6063}, - {4,14,1480,1072,5398}, - {4,15,3843,1777,4369}, - {4,16,1334,2145,4163}, - {4,17,2368,5055,260}, - {3,0,6118,5405,0}, - {3,1,2994,4370,0}, - {3,2,3405,1669,0}, - {3,3,4640,5550,0}, - {3,4,1354,3921,0}, - {3,5,117,1713,0}, - {3,6,5425,2866,0}, - {3,7,6047,683,0}, - {3,8,5616,2582,0}, - {3,9,2108,1179,0}, - {3,10,933,4921,0}, - {3,11,5953,2261,0}, - {3,12,1430,4699,0}, - {3,13,5905,480,0}, - {3,14,4289,1846,0}, - {3,15,5374,6208,0}, - {3,16,1775,3476,0}, - {3,17,3216,2178,0}, - {3,0,4165,884,0}, - {3,1,2896,3744,0}, - {3,2,874,2801,0}, - {3,3,3423,5579,0}, - {3,4,3404,3552,0}, - {3,5,2876,5515,0}, - {3,6,516,1719,0}, - {3,7,765,3631,0}, - {3,8,5059,1441,0}, - {3,9,5629,598,0}, - {3,10,5405,473,0}, - {3,11,4724,5210,0}, - {3,12,155,1832,0}, - {3,13,1689,2229,0}, - {3,14,449,1164,0}, - {3,15,2308,3088,0}, - {3,16,1122,669,0}, - {3,17,2268,5758,0}, - {3,0,5878,2609,0}, - {3,1,782,3359,0}, - {3,2,1231,4231,0}, - {3,3,4225,2052,0}, - {3,4,4286,3517,0}, - {3,5,5531,3184,0}, - {3,6,1935,4560,0}, - {3,7,1174,131,0}, - {3,8,3115,956,0}, - {3,9,3129,1088,0}, - {3,10,5238,4440,0}, - {3,11,5722,4280,0}, - {3,12,3540,375,0}, - {3,13,191,2782,0}, - {3,14,906,4432,0}, - {3,15,3225,1111,0}, - {3,16,6296,2583,0}, - {3,17,1457,903,0}, - {3,0,855,4475,0}, - {3,1,4097,3970,0}, - {3,2,4433,4361,0}, - {3,3,5198,541,0}, - {3,4,1146,4426,0}, - {3,5,3202,2902,0}, - {3,6,2724,525,0}, - {3,7,1083,4124,0}, - {3,8,2326,6003,0}, - {3,9,5605,5990,0}, - {3,10,4376,1579,0}, - {3,11,4407,984,0}, - {3,12,1332,6163,0}, - {3,13,5359,3975,0}, - {3,14,1907,1854,0}, - {3,15,3601,5748,0}, - {3,16,6056,3266,0}, - {3,17,3322,4085,0}, - {3,0,1768,3244,0}, - {3,1,2149,144,0}, - {3,2,1589,4291,0}, - {3,3,5154,1252,0}, - {3,4,1855,5939,0}, - {3,5,4820,2706,0}, - {3,6,1475,3360,0}, - {3,7,4266,693,0}, - {3,8,4156,2018,0}, - {3,9,2103,752,0}, - {3,10,3710,3853,0}, - {3,11,5123,931,0}, - {3,12,6146,3323,0}, - {3,13,1939,5002,0}, - {3,14,5140,1437,0}, - {3,15,1263,293,0}, - {3,16,5949,4665,0}, - {3,17,4548,6380,0}, - {3,0,3171,4690,0}, - {3,1,5204,2114,0}, - {3,2,6384,5565,0}, - {3,3,5722,1757,0}, - {3,4,2805,6264,0}, - {3,5,1202,2616,0}, - {3,6,1018,3244,0}, - {3,7,4018,5289,0}, - {3,8,2257,3067,0}, - {3,9,2483,3073,0}, - {3,10,1196,5329,0}, - {3,11,649,3918,0}, - {3,12,3791,4581,0}, - {3,13,5028,3803,0}, - {3,14,3119,3506,0}, - {3,15,4779,431,0}, - {3,16,3888,5510,0}, - {3,17,4387,4084,0}, - {3,0,5836,1692,0}, - {3,1,5126,1078,0}, - {3,2,5721,6165,0}, - {3,3,3540,2499,0}, - {3,4,2225,6348,0}, - {3,5,1044,1484,0}, - {3,6,6323,4042,0}, - {3,7,1313,5603,0}, - {3,8,1303,3496,0}, - {3,9,3516,3639,0}, - {3,10,5161,2293,0}, - {3,11,4682,3845,0}, - {3,12,3045,643,0}, - {3,13,2818,2616,0}, - {3,14,3267,649,0}, - {3,15,6236,593,0}, - {3,16,646,2948,0}, - {3,17,4213,1442,0}, - {3,0,5779,1596,0}, - {3,1,2403,1237,0}, - {3,2,2217,1514,0}, - {3,3,5609,716,0}, - {3,4,5155,3858,0}, - {3,5,1517,1312,0}, - {3,6,2554,3158,0}, - {3,7,5280,2643,0}, - {3,8,4990,1353,0}, - {3,9,5648,1170,0}, - {3,10,1152,4366,0}, - {3,11,3561,5368,0}, - {3,12,3581,1411,0}, - {3,13,5647,4661,0}, - {3,14,1542,5401,0}, - {3,15,5078,2687,0}, - {3,16,316,1755,0}, - {3,17,3392,1991,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_9_10N[162][5] = { + { 4, 0, 5611, 2563, 2900 }, { 4, 1, 5220, 3143, 4813 }, { 4, 2, 2481, 834, 81 }, + { 4, 3, 6265, 4064, 4265 }, { 4, 4, 1055, 2914, 5638 }, { 4, 5, 1734, 2182, 3315 }, + { 4, 6, 3342, 5678, 2246 }, { 4, 7, 2185, 552, 3385 }, { 4, 8, 2615, 236, 5334 }, + { 4, 9, 1546, 1755, 3846 }, { 4, 10, 4154, 5561, 3142 }, { 4, 11, 4382, 2957, 5400 }, + { 4, 12, 1209, 5329, 3179 }, { 4, 13, 1421, 3528, 6063 }, { 4, 14, 1480, 1072, 5398 }, + { 4, 15, 3843, 1777, 4369 }, { 4, 16, 1334, 2145, 4163 }, { 4, 17, 2368, 5055, 260 }, + { 3, 0, 6118, 5405, 0 }, { 3, 1, 2994, 4370, 0 }, { 3, 2, 3405, 1669, 0 }, + { 3, 3, 4640, 5550, 0 }, { 3, 4, 1354, 3921, 0 }, { 3, 5, 117, 1713, 0 }, + { 3, 6, 5425, 2866, 0 }, { 3, 7, 6047, 683, 0 }, { 3, 8, 5616, 2582, 0 }, + { 3, 9, 2108, 1179, 0 }, { 3, 10, 933, 4921, 0 }, { 3, 11, 5953, 2261, 0 }, + { 3, 12, 1430, 4699, 0 }, { 3, 13, 5905, 480, 0 }, { 3, 14, 4289, 1846, 0 }, + { 3, 15, 5374, 6208, 0 }, { 3, 16, 1775, 3476, 0 }, { 3, 17, 3216, 2178, 0 }, + { 3, 0, 4165, 884, 0 }, { 3, 1, 2896, 3744, 0 }, { 3, 2, 874, 2801, 0 }, + { 3, 3, 3423, 5579, 0 }, { 3, 4, 3404, 3552, 0 }, { 3, 5, 2876, 5515, 0 }, + { 3, 6, 516, 1719, 0 }, { 3, 7, 765, 3631, 0 }, { 3, 8, 5059, 1441, 0 }, + { 3, 9, 5629, 598, 0 }, { 3, 10, 5405, 473, 0 }, { 3, 11, 4724, 5210, 0 }, + { 3, 12, 155, 1832, 0 }, { 3, 13, 1689, 2229, 0 }, { 3, 14, 449, 1164, 0 }, + { 3, 15, 2308, 3088, 0 }, { 3, 16, 1122, 669, 0 }, { 3, 17, 2268, 5758, 0 }, + { 3, 0, 5878, 2609, 0 }, { 3, 1, 782, 3359, 0 }, { 3, 2, 1231, 4231, 0 }, + { 3, 3, 4225, 2052, 0 }, { 3, 4, 4286, 3517, 0 }, { 3, 5, 5531, 3184, 0 }, + { 3, 6, 1935, 4560, 0 }, { 3, 7, 1174, 131, 0 }, { 3, 8, 3115, 956, 0 }, + { 3, 9, 3129, 1088, 0 }, { 3, 10, 5238, 4440, 0 }, { 3, 11, 5722, 4280, 0 }, + { 3, 12, 3540, 375, 0 }, { 3, 13, 191, 2782, 0 }, { 3, 14, 906, 4432, 0 }, + { 3, 15, 3225, 1111, 0 }, { 3, 16, 6296, 2583, 0 }, { 3, 17, 1457, 903, 0 }, + { 3, 0, 855, 4475, 0 }, { 3, 1, 4097, 3970, 0 }, { 3, 2, 4433, 4361, 0 }, + { 3, 3, 5198, 541, 0 }, { 3, 4, 1146, 4426, 0 }, { 3, 5, 3202, 2902, 0 }, + { 3, 6, 2724, 525, 0 }, { 3, 7, 1083, 4124, 0 }, { 3, 8, 2326, 6003, 0 }, + { 3, 9, 5605, 5990, 0 }, { 3, 10, 4376, 1579, 0 }, { 3, 11, 4407, 984, 0 }, + { 3, 12, 1332, 6163, 0 }, { 3, 13, 5359, 3975, 0 }, { 3, 14, 1907, 1854, 0 }, + { 3, 15, 3601, 5748, 0 }, { 3, 16, 6056, 3266, 0 }, { 3, 17, 3322, 4085, 0 }, + { 3, 0, 1768, 3244, 0 }, { 3, 1, 2149, 144, 0 }, { 3, 2, 1589, 4291, 0 }, + { 3, 3, 5154, 1252, 0 }, { 3, 4, 1855, 5939, 0 }, { 3, 5, 4820, 2706, 0 }, + { 3, 6, 1475, 3360, 0 }, { 3, 7, 4266, 693, 0 }, { 3, 8, 4156, 2018, 0 }, + { 3, 9, 2103, 752, 0 }, { 3, 10, 3710, 3853, 0 }, { 3, 11, 5123, 931, 0 }, + { 3, 12, 6146, 3323, 0 }, { 3, 13, 1939, 5002, 0 }, { 3, 14, 5140, 1437, 0 }, + { 3, 15, 1263, 293, 0 }, { 3, 16, 5949, 4665, 0 }, { 3, 17, 4548, 6380, 0 }, + { 3, 0, 3171, 4690, 0 }, { 3, 1, 5204, 2114, 0 }, { 3, 2, 6384, 5565, 0 }, + { 3, 3, 5722, 1757, 0 }, { 3, 4, 2805, 6264, 0 }, { 3, 5, 1202, 2616, 0 }, + { 3, 6, 1018, 3244, 0 }, { 3, 7, 4018, 5289, 0 }, { 3, 8, 2257, 3067, 0 }, + { 3, 9, 2483, 3073, 0 }, { 3, 10, 1196, 5329, 0 }, { 3, 11, 649, 3918, 0 }, + { 3, 12, 3791, 4581, 0 }, { 3, 13, 5028, 3803, 0 }, { 3, 14, 3119, 3506, 0 }, + { 3, 15, 4779, 431, 0 }, { 3, 16, 3888, 5510, 0 }, { 3, 17, 4387, 4084, 0 }, + { 3, 0, 5836, 1692, 0 }, { 3, 1, 5126, 1078, 0 }, { 3, 2, 5721, 6165, 0 }, + { 3, 3, 3540, 2499, 0 }, { 3, 4, 2225, 6348, 0 }, { 3, 5, 1044, 1484, 0 }, + { 3, 6, 6323, 4042, 0 }, { 3, 7, 1313, 5603, 0 }, { 3, 8, 1303, 3496, 0 }, + { 3, 9, 3516, 3639, 0 }, { 3, 10, 5161, 2293, 0 }, { 3, 11, 4682, 3845, 0 }, + { 3, 12, 3045, 643, 0 }, { 3, 13, 2818, 2616, 0 }, { 3, 14, 3267, 649, 0 }, + { 3, 15, 6236, 593, 0 }, { 3, 16, 646, 2948, 0 }, { 3, 17, 4213, 1442, 0 }, + { 3, 0, 5779, 1596, 0 }, { 3, 1, 2403, 1237, 0 }, { 3, 2, 2217, 1514, 0 }, + { 3, 3, 5609, 716, 0 }, { 3, 4, 5155, 3858, 0 }, { 3, 5, 1517, 1312, 0 }, + { 3, 6, 2554, 3158, 0 }, { 3, 7, 5280, 2643, 0 }, { 3, 8, 4990, 1353, 0 }, + { 3, 9, 5648, 1170, 0 }, { 3, 10, 1152, 4366, 0 }, { 3, 11, 3561, 5368, 0 }, + { 3, 12, 3581, 1411, 0 }, { 3, 13, 5647, 4661, 0 }, { 3, 14, 1542, 5401, 0 }, + { 3, 15, 5078, 2687, 0 }, { 3, 16, 316, 1755, 0 }, { 3, 17, 3392, 1991, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_2_9N[40][12]= - { - {11,5332,8018,35444,13098,9655,41945,44273,22741,9371,8727,43219}, - {11,41410,43593,14611,46707,16041,1459,29246,12748,32996,676,46909}, - {11,9340,35072,35640,17537,10512,44339,30965,25175,9918,21079,29835}, - {11,3332,12088,47966,25168,50180,42842,40914,46726,17073,41812,34356}, - {11,15159,2209,7971,22590,20020,27567,4853,10294,38839,15314,49808}, - {11,20936,14497,23365,22630,38728,28361,34659,956,8559,44957,22222}, - {11,28043,4641,25208,47039,30612,25796,14661,44139,27335,12884,6980}, - {11,32584,33453,1867,20185,36106,30357,809,28513,46045,27862,4802}, - {11,43744,13375,36066,23604,30766,6233,45051,23660,20815,19525,25207}, - {11,27522,3854,9311,21925,41107,25773,26323,24237,24344,46187,44503}, - {11,10256,20038,12177,26635,5214,14191,34404,45807,4938,4173,31344}, - {11,32043,26501,46725,4648,16718,31060,26633,19036,14222,13886,26535}, - {11,18103,8498,36814,34600,36495,36712,29833,27396,11877,42861,1834}, - {11,36592,1645,3649,30521,14674,3630,890,13307,41412,24682,9907}, - {11,4401,44543,13784,5828,32862,25179,29736,39614,5186,49749,38317}, - {11,41460,39101,50080,40137,32691,26528,35332,44067,8467,14286,10470}, - {11,12211,34019,37870,36918,36419,33153,50070,41498,47741,30538,12342}, - {11,33751,23988,33624,41882,34075,25552,3106,17611,13190,29336,312}, - {11,5667,35483,35460,16153,37267,28308,50009,46345,34204,32756,38243}, - {11,5657,24157,36834,6890,49576,46244,43875,16738,47225,2944,36882}, - {3,30341,48485,3700,0,0,0,0,0,0,0,0}, - {3,14451,20438,18875,0,0,0,0,0,0,0,0}, - {3,13634,41138,42962,0,0,0,0,0,0,0,0}, - {3,46459,13369,27974,0,0,0,0,0,0,0,0}, - {3,21493,14629,2369,0,0,0,0,0,0,0,0}, - {3,11351,40226,42457,0,0,0,0,0,0,0,0}, - {3,34749,39000,3912,0,0,0,0,0,0,0,0}, - {3,18128,46776,47055,0,0,0,0,0,0,0,0}, - {3,2221,26806,11345,0,0,0,0,0,0,0,0}, - {3,35143,630,2229,0,0,0,0,0,0,0,0}, - {3,44009,41295,34646,0,0,0,0,0,0,0,0}, - {3,32163,16657,26544,0,0,0,0,0,0,0,0}, - {3,31770,23641,43623,0,0,0,0,0,0,0,0}, - {3,45826,10902,39490,0,0,0,0,0,0,0,0}, - {3,7514,20480,28511,0,0,0,0,0,0,0,0}, - {3,11429,19834,35430,0,0,0,0,0,0,0,0}, - {3,50112,38163,5738,0,0,0,0,0,0,0,0}, - {3,16191,16862,6783,0,0,0,0,0,0,0,0}, - {3,6085,39149,34988,0,0,0,0,0,0,0,0}, - {3,41497,32023,28688,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_2_9N[40][12] = { + { 11, 5332, 8018, 35444, 13098, 9655, 41945, 44273, 22741, 9371, 8727, 43219 }, + { 11, 41410, 43593, 14611, 46707, 16041, 1459, 29246, 12748, 32996, 676, 46909 }, + { 11, 9340, 35072, 35640, 17537, 10512, 44339, 30965, 25175, 9918, 21079, 29835 }, + { 11, 3332, 12088, 47966, 25168, 50180, 42842, 40914, 46726, 17073, 41812, 34356 }, + { 11, 15159, 2209, 7971, 22590, 20020, 27567, 4853, 10294, 38839, 15314, 49808 }, + { 11, 20936, 14497, 23365, 22630, 38728, 28361, 34659, 956, 8559, 44957, 22222 }, + { 11, 28043, 4641, 25208, 47039, 30612, 25796, 14661, 44139, 27335, 12884, 6980 }, + { 11, 32584, 33453, 1867, 20185, 36106, 30357, 809, 28513, 46045, 27862, 4802 }, + { 11, 43744, 13375, 36066, 23604, 30766, 6233, 45051, 23660, 20815, 19525, 25207 }, + { 11, 27522, 3854, 9311, 21925, 41107, 25773, 26323, 24237, 24344, 46187, 44503 }, + { 11, 10256, 20038, 12177, 26635, 5214, 14191, 34404, 45807, 4938, 4173, 31344 }, + { 11, 32043, 26501, 46725, 4648, 16718, 31060, 26633, 19036, 14222, 13886, 26535 }, + { 11, 18103, 8498, 36814, 34600, 36495, 36712, 29833, 27396, 11877, 42861, 1834 }, + { 11, 36592, 1645, 3649, 30521, 14674, 3630, 890, 13307, 41412, 24682, 9907 }, + { 11, 4401, 44543, 13784, 5828, 32862, 25179, 29736, 39614, 5186, 49749, 38317 }, + { 11, 41460, 39101, 50080, 40137, 32691, 26528, 35332, 44067, 8467, 14286, 10470 }, + { 11, 12211, 34019, 37870, 36918, 36419, 33153, 50070, 41498, 47741, 30538, 12342 }, + { 11, 33751, 23988, 33624, 41882, 34075, 25552, 3106, 17611, 13190, 29336, 312 }, + { 11, 5667, 35483, 35460, 16153, 37267, 28308, 50009, 46345, 34204, 32756, 38243 }, + { 11, 5657, 24157, 36834, 6890, 49576, 46244, 43875, 16738, 47225, 2944, 36882 }, + { 3, 30341, 48485, 3700, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14451, 20438, 18875, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13634, 41138, 42962, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 46459, 13369, 27974, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21493, 14629, 2369, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11351, 40226, 42457, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34749, 39000, 3912, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18128, 46776, 47055, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2221, 26806, 11345, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35143, 630, 2229, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 44009, 41295, 34646, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 32163, 16657, 26544, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31770, 23641, 43623, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 45826, 10902, 39490, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7514, 20480, 28511, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11429, 19834, 35430, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 50112, 38163, 5738, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16191, 16862, 6783, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6085, 39149, 34988, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 41497, 32023, 28688, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_13_45N[52][13]= - { - {12,15210,4519,18217,34427,18474,16813,28246,17687,44527,31465,13004,43601}, - {12,28576,13611,24294,15041,503,11393,26290,9278,19484,20742,13226,28322}, - {12,32651,27323,22368,15522,37576,20607,20152,19741,26700,31696,21061,35991}, - {12,44168,27910,31104,34776,38835,45450,40002,31522,7807,26330,2410,44983}, - {12,15861,39215,14631,42584,26502,41864,27885,32276,29049,16878,37480,42550}, - {12,38795,13012,7912,4058,23869,3325,42889,19921,13826,40323,18162,10005}, - {12,35100,5483,7629,35166,1239,10772,5289,286,16172,41843,42612,38493}, - {12,11997,40340,19047,16236,43557,9104,24032,2915,19265,36209,6443,40947}, - {12,43527,29675,4195,31926,35392,20400,7515,45806,36068,33079,37325,6301}, - {12,4580,20492,40934,14478,8238,2425,28901,43602,7224,17640,28259,6850}, - {12,41859,14006,19132,5690,16223,11575,30562,44797,3759,9833,36529,21084}, - {12,45546,16044,26763,13559,29092,41595,5726,13733,9164,15354,20145,10655}, - {12,24076,40883,13424,30325,40589,32367,36270,9286,40151,8501,3871,22109}, - {12,26239,29805,5358,44835,11609,3899,9760,39600,43422,13295,45431,14515}, - {12,5392,37010,12386,40193,21492,45146,12376,41952,43153,45733,718,35726}, - {12,33884,38006,16927,20958,25413,44561,11245,12984,35198,30977,31916,10657}, - {12,1412,1048,14965,31879,29967,41000,32087,22,34773,768,27289,19898}, - {12,43051,6964,31807,4119,33509,15950,6304,2813,35192,38282,39710,26356}, - {12,9889,18957,6355,18770,40381,1876,38889,17958,20309,10744,1744,228}, - {12,41543,36505,32795,12454,8520,4916,22313,1363,13010,8770,17057,8694}, - {12,22987,29564,13804,3110,1382,33844,15117,42314,36045,25295,28421,22044}, - {12,15951,42952,17458,6926,21257,41243,8662,17046,15054,15302,16964,40079}, - {12,13359,45754,16715,9586,10960,25406,14675,8880,5087,12303,28993,13571}, - {12,24824,31012,4121,808,30962,28736,11013,20488,7715,7637,6217,25114}, - {3,23615,5760,5554,0,0,0,0,0,0,0,0,0}, - {3,18072,21605,39242,0,0,0,0,0,0,0,0,0}, - {3,24190,6592,12281,0,0,0,0,0,0,0,0,0}, - {3,44681,6563,7001,0,0,0,0,0,0,0,0,0}, - {3,18291,19605,33476,0,0,0,0,0,0,0,0,0}, - {3,2884,30927,18430,0,0,0,0,0,0,0,0,0}, - {3,23674,36414,30649,0,0,0,0,0,0,0,0,0}, - {3,15364,22089,19757,0,0,0,0,0,0,0,0,0}, - {3,41162,14454,17627,0,0,0,0,0,0,0,0,0}, - {3,16676,28573,22163,0,0,0,0,0,0,0,0,0}, - {3,8851,36803,27589,0,0,0,0,0,0,0,0,0}, - {3,40049,476,1413,0,0,0,0,0,0,0,0,0}, - {3,41013,34505,33296,0,0,0,0,0,0,0,0,0}, - {3,29782,38018,42124,0,0,0,0,0,0,0,0,0}, - {3,22625,7485,11772,0,0,0,0,0,0,0,0,0}, - {3,2052,37567,14082,0,0,0,0,0,0,0,0,0}, - {3,30106,43203,20858,0,0,0,0,0,0,0,0,0}, - {3,7399,3796,22396,0,0,0,0,0,0,0,0,0}, - {3,38745,792,44483,0,0,0,0,0,0,0,0,0}, - {3,28268,33355,41030,0,0,0,0,0,0,0,0,0}, - {3,30098,37269,12871,0,0,0,0,0,0,0,0,0}, - {3,35769,33119,16738,0,0,0,0,0,0,0,0,0}, - {3,3307,43434,13244,0,0,0,0,0,0,0,0,0}, - {3,17852,9133,23190,0,0,0,0,0,0,0,0,0}, - {3,35184,20115,24202,0,0,0,0,0,0,0,0,0}, - {3,14760,43026,19425,0,0,0,0,0,0,0,0,0}, - {3,26414,16821,6625,0,0,0,0,0,0,0,0,0}, - {3,30362,35769,42608,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_13_45N[52][13] = { + { 12, + 15210, + 4519, + 18217, + 34427, + 18474, + 16813, + 28246, + 17687, + 44527, + 31465, + 13004, + 43601 }, + { 12, + 28576, + 13611, + 24294, + 15041, + 503, + 11393, + 26290, + 9278, + 19484, + 20742, + 13226, + 28322 }, + { 12, + 32651, + 27323, + 22368, + 15522, + 37576, + 20607, + 20152, + 19741, + 26700, + 31696, + 21061, + 35991 }, + { 12, + 44168, + 27910, + 31104, + 34776, + 38835, + 45450, + 40002, + 31522, + 7807, + 26330, + 2410, + 44983 }, + { 12, + 15861, + 39215, + 14631, + 42584, + 26502, + 41864, + 27885, + 32276, + 29049, + 16878, + 37480, + 42550 }, + { 12, + 38795, + 13012, + 7912, + 4058, + 23869, + 3325, + 42889, + 19921, + 13826, + 40323, + 18162, + 10005 }, + { 12, 35100, 5483, 7629, 35166, 1239, 10772, 5289, 286, 16172, 41843, 42612, 38493 }, + { 12, + 11997, + 40340, + 19047, + 16236, + 43557, + 9104, + 24032, + 2915, + 19265, + 36209, + 6443, + 40947 }, + { 12, + 43527, + 29675, + 4195, + 31926, + 35392, + 20400, + 7515, + 45806, + 36068, + 33079, + 37325, + 6301 }, + { 12, 4580, 20492, 40934, 14478, 8238, 2425, 28901, 43602, 7224, 17640, 28259, 6850 }, + { 12, + 41859, + 14006, + 19132, + 5690, + 16223, + 11575, + 30562, + 44797, + 3759, + 9833, + 36529, + 21084 }, + { 12, + 45546, + 16044, + 26763, + 13559, + 29092, + 41595, + 5726, + 13733, + 9164, + 15354, + 20145, + 10655 }, + { 12, + 24076, + 40883, + 13424, + 30325, + 40589, + 32367, + 36270, + 9286, + 40151, + 8501, + 3871, + 22109 }, + { 12, + 26239, + 29805, + 5358, + 44835, + 11609, + 3899, + 9760, + 39600, + 43422, + 13295, + 45431, + 14515 }, + { 12, + 5392, + 37010, + 12386, + 40193, + 21492, + 45146, + 12376, + 41952, + 43153, + 45733, + 718, + 35726 }, + { 12, + 33884, + 38006, + 16927, + 20958, + 25413, + 44561, + 11245, + 12984, + 35198, + 30977, + 31916, + 10657 }, + { 12, 1412, 1048, 14965, 31879, 29967, 41000, 32087, 22, 34773, 768, 27289, 19898 }, + { 12, + 43051, + 6964, + 31807, + 4119, + 33509, + 15950, + 6304, + 2813, + 35192, + 38282, + 39710, + 26356 }, + { 12, 9889, 18957, 6355, 18770, 40381, 1876, 38889, 17958, 20309, 10744, 1744, 228 }, + { 12, 41543, 36505, 32795, 12454, 8520, 4916, 22313, 1363, 13010, 8770, 17057, 8694 }, + { 12, + 22987, + 29564, + 13804, + 3110, + 1382, + 33844, + 15117, + 42314, + 36045, + 25295, + 28421, + 22044 }, + { 12, + 15951, + 42952, + 17458, + 6926, + 21257, + 41243, + 8662, + 17046, + 15054, + 15302, + 16964, + 40079 }, + { 12, + 13359, + 45754, + 16715, + 9586, + 10960, + 25406, + 14675, + 8880, + 5087, + 12303, + 28993, + 13571 }, + { 12, 24824, 31012, 4121, 808, 30962, 28736, 11013, 20488, 7715, 7637, 6217, 25114 }, + { 3, 23615, 5760, 5554, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18072, 21605, 39242, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24190, 6592, 12281, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 44681, 6563, 7001, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18291, 19605, 33476, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2884, 30927, 18430, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23674, 36414, 30649, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15364, 22089, 19757, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 41162, 14454, 17627, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16676, 28573, 22163, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8851, 36803, 27589, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 40049, 476, 1413, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 41013, 34505, 33296, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29782, 38018, 42124, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22625, 7485, 11772, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2052, 37567, 14082, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30106, 43203, 20858, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7399, 3796, 22396, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38745, 792, 44483, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28268, 33355, 41030, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30098, 37269, 12871, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35769, 33119, 16738, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3307, 43434, 13244, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17852, 9133, 23190, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 35184, 20115, 24202, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14760, 43026, 19425, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26414, 16821, 6625, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30362, 35769, 42608, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_9_20N[81][13]= - { - {12,30649,35117,23181,15492,2367,31230,9368,13541,6608,23384,18300,5905}, - {12,1961,8950,20589,17688,9641,1877,4937,15293,24864,14876,6516,10165}, - {12,4229,26034,28862,8265,27847,3,22728,13946,27162,26003,17696,13261}, - {12,31719,25669,17149,17377,33106,12630,4814,16334,1480,32952,11187,3849}, - {12,30186,20938,7946,23283,11042,28080,26642,34560,11302,4991,5121,6879}, - {12,13445,22794,18048,15116,5657,9853,15581,34960,13240,11176,17937,25081}, - {12,4868,28235,30286,29706,7073,6773,10390,27002,13015,7388,14772,19581}, - {12,11765,16642,11431,19588,20154,8027,29758,5501,6398,4268,21337,21136}, - {12,2275,7899,25943,12939,14478,20369,22877,3591,12217,19130,24252,32444}, - {12,24599,21382,4689,3524,11304,20423,13677,19639,10577,28279,22330,30722}, - {12,21622,26233,3921,17722,6843,5999,8186,2355,33632,34632,30285,9616}, - {12,19909,30417,19587,27853,13896,3689,155,20457,33362,21739,22779,33862}, - {12,3713,32975,9403,2836,23109,11099,3505,14562,17309,26470,4843,12279}, - {12,24216,26340,22073,32570,12936,19797,21801,8918,7999,24408,5783,25190}, - {12,8817,29367,17017,6208,21402,2280,2110,7975,32039,34605,1235,912}, - {12,23116,33017,31405,638,4707,31760,18043,3507,11989,26632,32829,11262}, - {12,9274,2553,10697,13507,15323,27080,3752,33191,12363,24664,14068,1416}, - {12,21670,26696,18570,25197,1517,7765,32686,6572,30901,28242,17802,24056}, - {12,35388,26895,8023,31249,29290,13440,7156,17367,21472,27219,14447,9655}, - {12,11100,27918,2900,33262,15301,4664,15728,1185,24818,32995,31108,16368}, - {12,34978,31690,30464,13044,5492,10047,2768,14336,30880,32780,10993,24750}, - {12,7022,19718,26036,19145,21177,33949,17135,5193,33718,2539,13920,25537}, - {12,918,18514,14530,13699,11902,22721,8335,35346,24655,3332,14708,20822}, - {12,11191,24064,32825,12321,11771,23299,31325,25526,16785,22212,34075,9066}, - {12,31209,27819,5974,19918,26831,33338,26647,9480,28489,7827,18562,2401}, - {12,17395,23192,10277,28458,23028,18793,10463,10740,616,24647,4153,10128}, - {12,2873,22381,8132,18239,31614,4193,32313,7575,25801,27591,19872,17992}, - {4,4609,9114,14764,13516,0,0,0,0,0,0,0,0}, - {4,19192,9882,13112,16075,0,0,0,0,0,0,0,0}, - {4,12510,28902,8784,32679,0,0,0,0,0,0,0,0}, - {4,4578,34533,30609,25543,0,0,0,0,0,0,0,0}, - {4,13739,3465,5330,999,0,0,0,0,0,0,0,0}, - {4,33254,13085,5001,29061,0,0,0,0,0,0,0,0}, - {4,28369,79,17750,13399,0,0,0,0,0,0,0,0}, - {4,24851,9524,30966,10422,0,0,0,0,0,0,0,0}, - {4,18251,34810,12259,25103,0,0,0,0,0,0,0,0}, - {3,25193,16945,1059,0,0,0,0,0,0,0,0,0}, - {3,11266,13612,30508,0,0,0,0,0,0,0,0,0}, - {3,24778,25364,1322,0,0,0,0,0,0,0,0,0}, - {3,14492,11111,13693,0,0,0,0,0,0,0,0,0}, - {3,15125,8205,1749,0,0,0,0,0,0,0,0,0}, - {3,8494,9902,9395,0,0,0,0,0,0,0,0,0}, - {3,23936,3981,22799,0,0,0,0,0,0,0,0,0}, - {3,28448,28076,26544,0,0,0,0,0,0,0,0,0}, - {3,19652,13424,8915,0,0,0,0,0,0,0,0,0}, - {3,2885,11356,3241,0,0,0,0,0,0,0,0,0}, - {3,1609,10284,24350,0,0,0,0,0,0,0,0,0}, - {3,2462,19358,15717,0,0,0,0,0,0,0,0,0}, - {3,29327,15960,14743,0,0,0,0,0,0,0,0,0}, - {3,5388,32927,1288,0,0,0,0,0,0,0,0,0}, - {3,19074,6322,32214,0,0,0,0,0,0,0,0,0}, - {3,34208,30535,35462,0,0,0,0,0,0,0,0,0}, - {3,23415,20836,21819,0,0,0,0,0,0,0,0,0}, - {3,17986,12196,30030,0,0,0,0,0,0,0,0,0}, - {3,8422,2647,5710,0,0,0,0,0,0,0,0,0}, - {3,3200,23132,23337,0,0,0,0,0,0,0,0,0}, - {3,22307,29841,4813,0,0,0,0,0,0,0,0,0}, - {3,15309,26942,29970,0,0,0,0,0,0,0,0,0}, - {3,23288,7493,3005,0,0,0,0,0,0,0,0,0}, - {3,20661,34283,33192,0,0,0,0,0,0,0,0,0}, - {3,23033,9541,6424,0,0,0,0,0,0,0,0,0}, - {3,22003,24665,5534,0,0,0,0,0,0,0,0,0}, - {3,4684,1411,33340,0,0,0,0,0,0,0,0,0}, - {3,26042,6426,3808,0,0,0,0,0,0,0,0,0}, - {3,285,21942,14302,0,0,0,0,0,0,0,0,0}, - {3,16023,6825,20084,0,0,0,0,0,0,0,0,0}, - {3,34878,12295,32028,0,0,0,0,0,0,0,0,0}, - {3,2591,178,24107,0,0,0,0,0,0,0,0,0}, - {3,16379,2912,9912,0,0,0,0,0,0,0,0,0}, - {3,15375,16120,28375,0,0,0,0,0,0,0,0,0}, - {3,20170,726,11291,0,0,0,0,0,0,0,0,0}, - {3,8185,13471,8448,0,0,0,0,0,0,0,0,0}, - {3,23205,14239,17896,0,0,0,0,0,0,0,0,0}, - {3,17950,19308,1591,0,0,0,0,0,0,0,0,0}, - {3,3170,23836,18879,0,0,0,0,0,0,0,0,0}, - {3,12853,10678,18431,0,0,0,0,0,0,0,0,0}, - {3,21157,31624,3153,0,0,0,0,0,0,0,0,0}, - {3,27682,12433,3458,0,0,0,0,0,0,0,0,0}, - {3,312,4844,13138,0,0,0,0,0,0,0,0,0}, - {3,17715,35138,15456,0,0,0,0,0,0,0,0,0}, - {3,30507,33307,30783,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_9_20N[81][13] = { + { 12, + 30649, + 35117, + 23181, + 15492, + 2367, + 31230, + 9368, + 13541, + 6608, + 23384, + 18300, + 5905 }, + { 12, 1961, 8950, 20589, 17688, 9641, 1877, 4937, 15293, 24864, 14876, 6516, 10165 }, + { 12, 4229, 26034, 28862, 8265, 27847, 3, 22728, 13946, 27162, 26003, 17696, 13261 }, + { 12, + 31719, + 25669, + 17149, + 17377, + 33106, + 12630, + 4814, + 16334, + 1480, + 32952, + 11187, + 3849 }, + { 12, + 30186, + 20938, + 7946, + 23283, + 11042, + 28080, + 26642, + 34560, + 11302, + 4991, + 5121, + 6879 }, + { 12, + 13445, + 22794, + 18048, + 15116, + 5657, + 9853, + 15581, + 34960, + 13240, + 11176, + 17937, + 25081 }, + { 12, + 4868, + 28235, + 30286, + 29706, + 7073, + 6773, + 10390, + 27002, + 13015, + 7388, + 14772, + 19581 }, + { 12, + 11765, + 16642, + 11431, + 19588, + 20154, + 8027, + 29758, + 5501, + 6398, + 4268, + 21337, + 21136 }, + { 12, + 2275, + 7899, + 25943, + 12939, + 14478, + 20369, + 22877, + 3591, + 12217, + 19130, + 24252, + 32444 }, + { 12, + 24599, + 21382, + 4689, + 3524, + 11304, + 20423, + 13677, + 19639, + 10577, + 28279, + 22330, + 30722 }, + { 12, 21622, 26233, 3921, 17722, 6843, 5999, 8186, 2355, 33632, 34632, 30285, 9616 }, + { 12, + 19909, + 30417, + 19587, + 27853, + 13896, + 3689, + 155, + 20457, + 33362, + 21739, + 22779, + 33862 }, + { 12, 3713, 32975, 9403, 2836, 23109, 11099, 3505, 14562, 17309, 26470, 4843, 12279 }, + { 12, + 24216, + 26340, + 22073, + 32570, + 12936, + 19797, + 21801, + 8918, + 7999, + 24408, + 5783, + 25190 }, + { 12, 8817, 29367, 17017, 6208, 21402, 2280, 2110, 7975, 32039, 34605, 1235, 912 }, + { 12, + 23116, + 33017, + 31405, + 638, + 4707, + 31760, + 18043, + 3507, + 11989, + 26632, + 32829, + 11262 }, + { 12, + 9274, + 2553, + 10697, + 13507, + 15323, + 27080, + 3752, + 33191, + 12363, + 24664, + 14068, + 1416 }, + { 12, + 21670, + 26696, + 18570, + 25197, + 1517, + 7765, + 32686, + 6572, + 30901, + 28242, + 17802, + 24056 }, + { 12, + 35388, + 26895, + 8023, + 31249, + 29290, + 13440, + 7156, + 17367, + 21472, + 27219, + 14447, + 9655 }, + { 12, + 11100, + 27918, + 2900, + 33262, + 15301, + 4664, + 15728, + 1185, + 24818, + 32995, + 31108, + 16368 }, + { 12, + 34978, + 31690, + 30464, + 13044, + 5492, + 10047, + 2768, + 14336, + 30880, + 32780, + 10993, + 24750 }, + { 12, + 7022, + 19718, + 26036, + 19145, + 21177, + 33949, + 17135, + 5193, + 33718, + 2539, + 13920, + 25537 }, + { 12, + 918, + 18514, + 14530, + 13699, + 11902, + 22721, + 8335, + 35346, + 24655, + 3332, + 14708, + 20822 }, + { 12, + 11191, + 24064, + 32825, + 12321, + 11771, + 23299, + 31325, + 25526, + 16785, + 22212, + 34075, + 9066 }, + { 12, + 31209, + 27819, + 5974, + 19918, + 26831, + 33338, + 26647, + 9480, + 28489, + 7827, + 18562, + 2401 }, + { 12, + 17395, + 23192, + 10277, + 28458, + 23028, + 18793, + 10463, + 10740, + 616, + 24647, + 4153, + 10128 }, + { 12, + 2873, + 22381, + 8132, + 18239, + 31614, + 4193, + 32313, + 7575, + 25801, + 27591, + 19872, + 17992 }, + { 4, 4609, 9114, 14764, 13516, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 19192, 9882, 13112, 16075, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 12510, 28902, 8784, 32679, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4578, 34533, 30609, 25543, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 13739, 3465, 5330, 999, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 33254, 13085, 5001, 29061, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 28369, 79, 17750, 13399, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 24851, 9524, 30966, 10422, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 18251, 34810, 12259, 25103, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25193, 16945, 1059, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11266, 13612, 30508, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24778, 25364, 1322, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14492, 11111, 13693, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15125, 8205, 1749, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8494, 9902, 9395, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23936, 3981, 22799, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28448, 28076, 26544, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19652, 13424, 8915, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2885, 11356, 3241, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1609, 10284, 24350, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2462, 19358, 15717, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29327, 15960, 14743, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5388, 32927, 1288, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19074, 6322, 32214, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34208, 30535, 35462, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23415, 20836, 21819, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17986, 12196, 30030, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8422, 2647, 5710, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3200, 23132, 23337, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22307, 29841, 4813, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15309, 26942, 29970, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23288, 7493, 3005, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20661, 34283, 33192, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23033, 9541, 6424, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22003, 24665, 5534, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4684, 1411, 33340, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26042, 6426, 3808, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 285, 21942, 14302, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16023, 6825, 20084, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 34878, 12295, 32028, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2591, 178, 24107, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16379, 2912, 9912, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15375, 16120, 28375, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20170, 726, 11291, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8185, 13471, 8448, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23205, 14239, 17896, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17950, 19308, 1591, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3170, 23836, 18879, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12853, 10678, 18431, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21157, 31624, 3153, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27682, 12433, 3458, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 312, 4844, 13138, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17715, 35138, 15456, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30507, 33307, 30783, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_11_20N[99][14]= - { - {13,20834,22335,21330,11913,6036,15830,11069,10539,4244,15068,7113,2704,16224}, - {13,2010,5628,27960,11690,22545,24432,4986,21083,17529,4104,11941,21239,9602}, - {13,689,13248,1777,4876,2537,20869,15718,9575,18164,5294,13914,21711,23374}, - {13,9675,21239,13600,24710,10613,14804,19412,23270,26741,10503,25258,17816,25210}, - {13,12518,8680,6422,22715,25097,26959,3913,26493,7797,25977,4896,27063,20781}, - {13,21715,12850,7963,4027,4295,14931,18158,616,20570,8720,16487,19050,23925}, - {13,7939,21089,15170,24325,6651,22352,5633,27903,2685,1310,5594,9296,25670}, - {13,25121,13906,8217,25390,9112,13945,9826,10844,11418,10724,11518,9280,9576}, - {13,25979,23644,16073,27407,3476,28057,4003,2279,17490,7558,9538,22115,20439}, - {13,20708,22572,14997,15780,5159,11356,10931,8514,23275,2560,912,15935,20703}, - {13,26467,17173,21964,15469,21967,10380,16222,15106,16786,19542,28560,18387,27909}, - {13,14897,6167,24295,1266,16902,9546,11628,12048,24495,3706,22629,14165,2333}, - {13,19403,18738,28140,13141,6151,22785,9620,4290,2342,4902,15856,19033,22820}, - {13,15761,1985,9160,4435,11164,5442,23572,6951,19077,15406,16658,18324,19229}, - {13,16997,10094,19982,22821,7810,19660,1182,21968,16564,17453,10780,17034,16405}, - {13,11,28611,10411,15799,15705,2773,28601,19333,19447,16790,4618,15841,23854}, - {13,24686,4131,1013,2141,6052,11896,18719,16813,22420,23406,21052,4333,17754}, - {13,16425,17614,26883,12101,8224,13979,6869,25215,25991,28968,19337,25361,20513}, - {13,1671,14990,20692,24951,19446,7163,4959,13197,19201,3883,22532,15468,11856}, - {13,22758,23586,16985,18396,7434,11817,363,11824,285,20897,16646,16095,17011}, - {13,25144,14916,6302,20972,25439,6156,21776,19701,27803,9695,12941,23541,27425}, - {13,6979,27910,7378,8983,6280,4134,28860,8079,20892,28776,7899,23399,87}, - {13,18045,23929,25876,15560,23629,18376,4053,14655,2450,11907,19535,28543,3513}, - {13,4704,16512,16554,14062,2596,10357,17316,1011,22090,11353,20300,15300,18536}, - {13,14293,4746,28831,20028,16742,16835,28405,11245,10802,20242,17737,9590,20693}, - {13,26547,22557,22517,6285,5336,3998,2351,6628,22949,1517,4712,1770,9207}, - {13,28522,14116,5455,13105,18709,3030,4217,6306,27448,1943,23866,20212,18857}, - {3,14794,21425,15659,0,0,0,0,0,0,0,0,0,0}, - {3,4446,21140,13454,0,0,0,0,0,0,0,0,0,0}, - {3,21115,3271,1443,0,0,0,0,0,0,0,0,0,0}, - {3,2153,12424,6159,0,0,0,0,0,0,0,0,0,0}, - {3,23559,22473,26065,0,0,0,0,0,0,0,0,0,0}, - {3,15914,22980,12766,0,0,0,0,0,0,0,0,0,0}, - {3,3482,16233,5719,0,0,0,0,0,0,0,0,0,0}, - {3,27020,12322,24014,0,0,0,0,0,0,0,0,0,0}, - {3,25438,26499,26506,0,0,0,0,0,0,0,0,0,0}, - {3,21987,16027,6832,0,0,0,0,0,0,0,0,0,0}, - {3,17330,2620,20756,0,0,0,0,0,0,0,0,0,0}, - {3,15985,10471,23302,0,0,0,0,0,0,0,0,0,0}, - {3,593,6869,27185,0,0,0,0,0,0,0,0,0,0}, - {3,22961,9129,25646,0,0,0,0,0,0,0,0,0,0}, - {3,10702,12334,23959,0,0,0,0,0,0,0,0,0,0}, - {3,6375,23299,26942,0,0,0,0,0,0,0,0,0,0}, - {3,8029,4072,24051,0,0,0,0,0,0,0,0,0,0}, - {3,15147,5113,14725,0,0,0,0,0,0,0,0,0,0}, - {3,1451,27291,28731,0,0,0,0,0,0,0,0,0,0}, - {3,18808,11561,249,0,0,0,0,0,0,0,0,0,0}, - {3,28962,21405,18944,0,0,0,0,0,0,0,0,0,0}, - {3,6889,3314,23457,0,0,0,0,0,0,0,0,0,0}, - {3,27708,14530,8795,0,0,0,0,0,0,0,0,0,0}, - {3,6185,28821,6550,0,0,0,0,0,0,0,0,0,0}, - {3,2259,17627,701,0,0,0,0,0,0,0,0,0,0}, - {3,20819,18831,20140,0,0,0,0,0,0,0,0,0,0}, - {3,4991,11369,4282,0,0,0,0,0,0,0,0,0,0}, - {3,13230,3413,27092,0,0,0,0,0,0,0,0,0,0}, - {3,14556,5068,16209,0,0,0,0,0,0,0,0,0,0}, - {3,4337,24652,498,0,0,0,0,0,0,0,0,0,0}, - {3,715,28883,2285,0,0,0,0,0,0,0,0,0,0}, - {3,16524,25513,26034,0,0,0,0,0,0,0,0,0,0}, - {3,21067,15122,21667,0,0,0,0,0,0,0,0,0,0}, - {3,27982,15280,3313,0,0,0,0,0,0,0,0,0,0}, - {3,7563,22779,22453,0,0,0,0,0,0,0,0,0,0}, - {3,4744,17277,27210,0,0,0,0,0,0,0,0,0,0}, - {3,19170,10806,18815,0,0,0,0,0,0,0,0,0,0}, - {3,26424,26442,7837,0,0,0,0,0,0,0,0,0,0}, - {3,26264,28931,6020,0,0,0,0,0,0,0,0,0,0}, - {3,4645,20678,13160,0,0,0,0,0,0,0,0,0,0}, - {3,18111,28045,23883,0,0,0,0,0,0,0,0,0,0}, - {3,5128,10876,3087,0,0,0,0,0,0,0,0,0,0}, - {3,28551,26276,3541,0,0,0,0,0,0,0,0,0,0}, - {3,20152,10181,28172,0,0,0,0,0,0,0,0,0,0}, - {3,26430,14769,6809,0,0,0,0,0,0,0,0,0,0}, - {3,4956,16130,11348,0,0,0,0,0,0,0,0,0,0}, - {3,1691,10216,5743,0,0,0,0,0,0,0,0,0,0}, - {3,7848,20236,2661,0,0,0,0,0,0,0,0,0,0}, - {3,10660,8321,6155,0,0,0,0,0,0,0,0,0,0}, - {3,2757,6963,2596,0,0,0,0,0,0,0,0,0,0}, - {3,27791,6707,258,0,0,0,0,0,0,0,0,0,0}, - {3,12785,21176,15450,0,0,0,0,0,0,0,0,0,0}, - {3,7477,17274,25201,0,0,0,0,0,0,0,0,0,0}, - {3,262,18996,15836,0,0,0,0,0,0,0,0,0,0}, - {3,5287,11970,13365,0,0,0,0,0,0,0,0,0,0}, - {3,3098,17823,10786,0,0,0,0,0,0,0,0,0,0}, - {3,21831,14476,11447,0,0,0,0,0,0,0,0,0,0}, - {3,1893,3625,25404,0,0,0,0,0,0,0,0,0,0}, - {3,20880,21987,1228,0,0,0,0,0,0,0,0,0,0}, - {3,20942,15045,21358,0,0,0,0,0,0,0,0,0,0}, - {3,18237,28914,15673,0,0,0,0,0,0,0,0,0,0}, - {3,24273,284,9803,0,0,0,0,0,0,0,0,0,0}, - {3,13949,15670,16693,0,0,0,0,0,0,0,0,0,0}, - {3,15553,27782,22644,0,0,0,0,0,0,0,0,0,0}, - {3,27980,24820,27733,0,0,0,0,0,0,0,0,0,0}, - {3,7015,20974,10016,0,0,0,0,0,0,0,0,0,0}, - {3,26164,20314,25916,0,0,0,0,0,0,0,0,0,0}, - {3,11489,13663,11777,0,0,0,0,0,0,0,0,0,0}, - {3,18230,11483,5655,0,0,0,0,0,0,0,0,0,0}, - {3,1618,19977,26521,0,0,0,0,0,0,0,0,0,0}, - {3,25639,13184,28994,0,0,0,0,0,0,0,0,0,0}, - {3,3821,18349,13846,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_11_20N[99][14] = { + { 13, + 20834, + 22335, + 21330, + 11913, + 6036, + 15830, + 11069, + 10539, + 4244, + 15068, + 7113, + 2704, + 16224 }, + { 13, + 2010, + 5628, + 27960, + 11690, + 22545, + 24432, + 4986, + 21083, + 17529, + 4104, + 11941, + 21239, + 9602 }, + { 13, + 689, + 13248, + 1777, + 4876, + 2537, + 20869, + 15718, + 9575, + 18164, + 5294, + 13914, + 21711, + 23374 }, + { 13, + 9675, + 21239, + 13600, + 24710, + 10613, + 14804, + 19412, + 23270, + 26741, + 10503, + 25258, + 17816, + 25210 }, + { 13, + 12518, + 8680, + 6422, + 22715, + 25097, + 26959, + 3913, + 26493, + 7797, + 25977, + 4896, + 27063, + 20781 }, + { 13, + 21715, + 12850, + 7963, + 4027, + 4295, + 14931, + 18158, + 616, + 20570, + 8720, + 16487, + 19050, + 23925 }, + { 13, + 7939, + 21089, + 15170, + 24325, + 6651, + 22352, + 5633, + 27903, + 2685, + 1310, + 5594, + 9296, + 25670 }, + { 13, + 25121, + 13906, + 8217, + 25390, + 9112, + 13945, + 9826, + 10844, + 11418, + 10724, + 11518, + 9280, + 9576 }, + { 13, + 25979, + 23644, + 16073, + 27407, + 3476, + 28057, + 4003, + 2279, + 17490, + 7558, + 9538, + 22115, + 20439 }, + { 13, + 20708, + 22572, + 14997, + 15780, + 5159, + 11356, + 10931, + 8514, + 23275, + 2560, + 912, + 15935, + 20703 }, + { 13, + 26467, + 17173, + 21964, + 15469, + 21967, + 10380, + 16222, + 15106, + 16786, + 19542, + 28560, + 18387, + 27909 }, + { 13, + 14897, + 6167, + 24295, + 1266, + 16902, + 9546, + 11628, + 12048, + 24495, + 3706, + 22629, + 14165, + 2333 }, + { 13, + 19403, + 18738, + 28140, + 13141, + 6151, + 22785, + 9620, + 4290, + 2342, + 4902, + 15856, + 19033, + 22820 }, + { 13, + 15761, + 1985, + 9160, + 4435, + 11164, + 5442, + 23572, + 6951, + 19077, + 15406, + 16658, + 18324, + 19229 }, + { 13, + 16997, + 10094, + 19982, + 22821, + 7810, + 19660, + 1182, + 21968, + 16564, + 17453, + 10780, + 17034, + 16405 }, + { 13, + 11, + 28611, + 10411, + 15799, + 15705, + 2773, + 28601, + 19333, + 19447, + 16790, + 4618, + 15841, + 23854 }, + { 13, + 24686, + 4131, + 1013, + 2141, + 6052, + 11896, + 18719, + 16813, + 22420, + 23406, + 21052, + 4333, + 17754 }, + { 13, + 16425, + 17614, + 26883, + 12101, + 8224, + 13979, + 6869, + 25215, + 25991, + 28968, + 19337, + 25361, + 20513 }, + { 13, + 1671, + 14990, + 20692, + 24951, + 19446, + 7163, + 4959, + 13197, + 19201, + 3883, + 22532, + 15468, + 11856 }, + { 13, + 22758, + 23586, + 16985, + 18396, + 7434, + 11817, + 363, + 11824, + 285, + 20897, + 16646, + 16095, + 17011 }, + { 13, + 25144, + 14916, + 6302, + 20972, + 25439, + 6156, + 21776, + 19701, + 27803, + 9695, + 12941, + 23541, + 27425 }, + { 13, + 6979, + 27910, + 7378, + 8983, + 6280, + 4134, + 28860, + 8079, + 20892, + 28776, + 7899, + 23399, + 87 }, + { 13, + 18045, + 23929, + 25876, + 15560, + 23629, + 18376, + 4053, + 14655, + 2450, + 11907, + 19535, + 28543, + 3513 }, + { 13, + 4704, + 16512, + 16554, + 14062, + 2596, + 10357, + 17316, + 1011, + 22090, + 11353, + 20300, + 15300, + 18536 }, + { 13, + 14293, + 4746, + 28831, + 20028, + 16742, + 16835, + 28405, + 11245, + 10802, + 20242, + 17737, + 9590, + 20693 }, + { 13, + 26547, + 22557, + 22517, + 6285, + 5336, + 3998, + 2351, + 6628, + 22949, + 1517, + 4712, + 1770, + 9207 }, + { 13, + 28522, + 14116, + 5455, + 13105, + 18709, + 3030, + 4217, + 6306, + 27448, + 1943, + 23866, + 20212, + 18857 }, + { 3, 14794, 21425, 15659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4446, 21140, 13454, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21115, 3271, 1443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2153, 12424, 6159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23559, 22473, 26065, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15914, 22980, 12766, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3482, 16233, 5719, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27020, 12322, 24014, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25438, 26499, 26506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21987, 16027, 6832, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17330, 2620, 20756, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15985, 10471, 23302, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 593, 6869, 27185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22961, 9129, 25646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10702, 12334, 23959, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6375, 23299, 26942, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8029, 4072, 24051, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15147, 5113, 14725, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1451, 27291, 28731, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18808, 11561, 249, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28962, 21405, 18944, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6889, 3314, 23457, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27708, 14530, 8795, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6185, 28821, 6550, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2259, 17627, 701, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20819, 18831, 20140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4991, 11369, 4282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13230, 3413, 27092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14556, 5068, 16209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4337, 24652, 498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 715, 28883, 2285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16524, 25513, 26034, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21067, 15122, 21667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27982, 15280, 3313, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7563, 22779, 22453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4744, 17277, 27210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19170, 10806, 18815, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26424, 26442, 7837, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26264, 28931, 6020, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4645, 20678, 13160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18111, 28045, 23883, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5128, 10876, 3087, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28551, 26276, 3541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20152, 10181, 28172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26430, 14769, 6809, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4956, 16130, 11348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1691, 10216, 5743, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7848, 20236, 2661, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10660, 8321, 6155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2757, 6963, 2596, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27791, 6707, 258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12785, 21176, 15450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7477, 17274, 25201, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 262, 18996, 15836, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5287, 11970, 13365, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3098, 17823, 10786, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21831, 14476, 11447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1893, 3625, 25404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20880, 21987, 1228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20942, 15045, 21358, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18237, 28914, 15673, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24273, 284, 9803, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13949, 15670, 16693, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15553, 27782, 22644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27980, 24820, 27733, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7015, 20974, 10016, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26164, 20314, 25916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11489, 13663, 11777, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18230, 11483, 5655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1618, 19977, 26521, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25639, 13184, 28994, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3821, 18349, 13846, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_26_45N[104][14]= - { - {13,12918,15296,894,10855,350,453,11966,1667,18720,12943,24437,8135,2834}, - {13,11861,3827,15431,8827,8253,23393,15048,5554,16297,2994,6727,19453,2371}, - {13,26414,3044,20240,18313,11618,3145,10976,5786,5609,16358,2547,11557,14755}, - {13,26434,2510,26719,4420,6753,917,7821,26765,11684,9811,5420,6653,19554}, - {13,11928,20579,17439,19103,21162,11235,19172,22254,3420,10558,3646,11858,24120}, - {13,10189,8172,5004,26082,4345,5139,15135,26522,6172,17492,8462,4392,4546}, - {13,27330,21498,13424,8077,10165,9739,482,23749,1515,12788,10464,9085,20875}, - {13,12009,22276,18401,7541,5871,23053,16979,16300,13566,19424,5293,18290,23917}, - {12,9613,24175,11374,11736,17676,13126,20931,20290,20659,2000,7969,9386,0}, - {12,21507,24494,11822,21771,26776,21175,27354,15815,7598,19809,611,10144,0}, - {12,195,14244,7229,13002,14328,17987,14595,6985,7642,9434,7079,5571,0}, - {12,10013,3641,14064,11716,4620,18119,23365,26446,26273,25164,11262,26019,0}, - {12,15166,19403,5606,20138,1893,645,5414,12097,18635,21648,12255,13269,0}, - {12,1895,9969,8372,17737,21679,17061,20219,2513,27199,11242,17025,1261,0}, - {12,12845,13086,16256,15177,20822,10862,18375,6751,17532,24725,6966,18489,0}, - {12,8373,25550,20688,16686,7894,24599,21578,12516,7115,4836,23473,25162,0}, - {12,14375,9150,6606,21633,16224,23708,20350,4575,143,13356,10239,22868,0}, - {12,10760,19807,7079,16382,26236,22606,16777,24312,16941,26684,8658,19279,0}, - {12,15136,8603,332,2898,21821,23778,3232,12052,14336,7832,5600,27015,0}, - {12,14392,26564,21616,8332,21750,10379,19730,7553,27352,2718,15202,25661,0}, - {12,6891,13210,15284,21940,8742,10965,3176,25034,25137,25161,13267,7012,0}, - {12,4993,9943,13260,20980,20224,20129,2120,23111,16640,23548,21445,10794,0}, - {12,4846,2858,22663,12584,20448,4629,17825,22269,11278,26312,9463,21085,0}, - {12,24282,18233,9220,14979,24106,14507,24838,19689,17589,7926,7893,21701,0}, - {12,12253,26122,8035,20823,2584,4703,25178,5460,4190,7057,1144,8426,0}, - {12,12354,7216,19484,4110,22105,1452,11457,12539,27106,14256,14113,20701,0}, - {12,2547,26926,25933,11919,12026,24639,19741,15457,9239,26713,22838,6051,0}, - {12,8782,14714,23363,450,19972,2622,19473,24182,2391,26205,10018,9202,0}, - {12,15690,10472,20263,469,18876,23660,9005,12595,23818,26430,926,6156,0}, - {12,5440,5209,14958,9882,18843,22063,12749,18473,22546,11768,4493,12833,0}, - {12,18540,3544,9471,15893,14761,23479,22010,15491,19608,25035,9094,24836,0}, - {12,15909,16594,23538,25136,25063,24995,5354,905,18580,15476,20710,7774,0}, - {3,6088,17133,11498,0,0,0,0,0,0,0,0,0,0}, - {3,4721,17594,18267,0,0,0,0,0,0,0,0,0,0}, - {3,1645,23638,26645,0,0,0,0,0,0,0,0,0,0}, - {3,14800,17920,22016,0,0,0,0,0,0,0,0,0,0}, - {3,12927,350,19391,0,0,0,0,0,0,0,0,0,0}, - {3,19447,19886,25992,0,0,0,0,0,0,0,0,0,0}, - {3,26120,1747,11234,0,0,0,0,0,0,0,0,0,0}, - {3,1588,23170,27232,0,0,0,0,0,0,0,0,0,0}, - {3,2230,15468,18709,0,0,0,0,0,0,0,0,0,0}, - {3,17410,11055,20645,0,0,0,0,0,0,0,0,0,0}, - {3,3244,25815,14204,0,0,0,0,0,0,0,0,0,0}, - {3,2858,7980,12780,0,0,0,0,0,0,0,0,0,0}, - {3,3256,20418,24355,0,0,0,0,0,0,0,0,0,0}, - {3,24260,16245,20948,0,0,0,0,0,0,0,0,0,0}, - {3,11122,1503,15651,0,0,0,0,0,0,0,0,0,0}, - {3,19272,24054,6075,0,0,0,0,0,0,0,0,0,0}, - {3,4905,931,18884,0,0,0,0,0,0,0,0,0,0}, - {3,23633,17244,6067,0,0,0,0,0,0,0,0,0,0}, - {3,5568,26403,490,0,0,0,0,0,0,0,0,0,0}, - {3,16113,16055,10524,0,0,0,0,0,0,0,0,0,0}, - {3,23013,8138,12876,0,0,0,0,0,0,0,0,0,0}, - {3,20699,20123,15435,0,0,0,0,0,0,0,0,0,0}, - {3,27272,27296,22638,0,0,0,0,0,0,0,0,0,0}, - {3,7658,17259,20553,0,0,0,0,0,0,0,0,0,0}, - {3,14914,17891,12137,0,0,0,0,0,0,0,0,0,0}, - {3,16323,1085,18895,0,0,0,0,0,0,0,0,0,0}, - {3,21503,17141,2915,0,0,0,0,0,0,0,0,0,0}, - {3,21979,23246,1271,0,0,0,0,0,0,0,0,0,0}, - {3,14409,11303,12604,0,0,0,0,0,0,0,0,0,0}, - {3,25591,12157,14704,0,0,0,0,0,0,0,0,0,0}, - {3,18739,19265,8140,0,0,0,0,0,0,0,0,0,0}, - {3,11244,5962,6647,0,0,0,0,0,0,0,0,0,0}, - {3,3589,6029,6489,0,0,0,0,0,0,0,0,0,0}, - {3,16416,185,9426,0,0,0,0,0,0,0,0,0,0}, - {3,1267,14086,22473,0,0,0,0,0,0,0,0,0,0}, - {3,17159,22404,23608,0,0,0,0,0,0,0,0,0,0}, - {3,7230,22514,21605,0,0,0,0,0,0,0,0,0,0}, - {3,7645,1239,10717,0,0,0,0,0,0,0,0,0,0}, - {3,12028,13404,12140,0,0,0,0,0,0,0,0,0,0}, - {3,14784,15425,14895,0,0,0,0,0,0,0,0,0,0}, - {3,26165,18980,15386,0,0,0,0,0,0,0,0,0,0}, - {3,14399,7725,14908,0,0,0,0,0,0,0,0,0,0}, - {3,8463,22853,22095,0,0,0,0,0,0,0,0,0,0}, - {3,5517,1854,8283,0,0,0,0,0,0,0,0,0,0}, - {3,24381,260,12595,0,0,0,0,0,0,0,0,0,0}, - {3,839,23743,22445,0,0,0,0,0,0,0,0,0,0}, - {3,13473,8017,7716,0,0,0,0,0,0,0,0,0,0}, - {3,8697,13050,16975,0,0,0,0,0,0,0,0,0,0}, - {3,26656,16911,11972,0,0,0,0,0,0,0,0,0,0}, - {3,26173,2504,15216,0,0,0,0,0,0,0,0,0,0}, - {3,7493,6461,12840,0,0,0,0,0,0,0,0,0,0}, - {3,4464,14912,3745,0,0,0,0,0,0,0,0,0,0}, - {3,21461,9734,25841,0,0,0,0,0,0,0,0,0,0}, - {3,4659,7599,9984,0,0,0,0,0,0,0,0,0,0}, - {3,17519,7389,75,0,0,0,0,0,0,0,0,0,0}, - {3,12589,9862,8680,0,0,0,0,0,0,0,0,0,0}, - {3,23053,21981,25299,0,0,0,0,0,0,0,0,0,0}, - {3,19246,3243,15916,0,0,0,0,0,0,0,0,0,0}, - {3,21733,4467,26491,0,0,0,0,0,0,0,0,0,0}, - {3,4959,10093,20074,0,0,0,0,0,0,0,0,0,0}, - {3,9140,15000,12783,0,0,0,0,0,0,0,0,0,0}, - {3,854,10701,25850,0,0,0,0,0,0,0,0,0,0}, - {3,13624,7755,10789,0,0,0,0,0,0,0,0,0,0}, - {3,3977,15812,10783,0,0,0,0,0,0,0,0,0,0}, - {3,5830,6774,10151,0,0,0,0,0,0,0,0,0,0}, - {3,21375,25110,5830,0,0,0,0,0,0,0,0,0,0}, - {3,15985,18342,2623,0,0,0,0,0,0,0,0,0,0}, - {3,4716,27211,18500,0,0,0,0,0,0,0,0,0,0}, - {3,18370,12487,7335,0,0,0,0,0,0,0,0,0,0}, - {3,4362,21569,16881,0,0,0,0,0,0,0,0,0,0}, - {3,10421,15454,13015,0,0,0,0,0,0,0,0,0,0}, - {3,5794,1239,9934,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_26_45N[104][14] = { + { 13, + 12918, + 15296, + 894, + 10855, + 350, + 453, + 11966, + 1667, + 18720, + 12943, + 24437, + 8135, + 2834 }, + { 13, + 11861, + 3827, + 15431, + 8827, + 8253, + 23393, + 15048, + 5554, + 16297, + 2994, + 6727, + 19453, + 2371 }, + { 13, + 26414, + 3044, + 20240, + 18313, + 11618, + 3145, + 10976, + 5786, + 5609, + 16358, + 2547, + 11557, + 14755 }, + { 13, + 26434, + 2510, + 26719, + 4420, + 6753, + 917, + 7821, + 26765, + 11684, + 9811, + 5420, + 6653, + 19554 }, + { 13, + 11928, + 20579, + 17439, + 19103, + 21162, + 11235, + 19172, + 22254, + 3420, + 10558, + 3646, + 11858, + 24120 }, + { 13, + 10189, + 8172, + 5004, + 26082, + 4345, + 5139, + 15135, + 26522, + 6172, + 17492, + 8462, + 4392, + 4546 }, + { 13, + 27330, + 21498, + 13424, + 8077, + 10165, + 9739, + 482, + 23749, + 1515, + 12788, + 10464, + 9085, + 20875 }, + { 13, + 12009, + 22276, + 18401, + 7541, + 5871, + 23053, + 16979, + 16300, + 13566, + 19424, + 5293, + 18290, + 23917 }, + { 12, + 9613, + 24175, + 11374, + 11736, + 17676, + 13126, + 20931, + 20290, + 20659, + 2000, + 7969, + 9386, + 0 }, + { 12, + 21507, + 24494, + 11822, + 21771, + 26776, + 21175, + 27354, + 15815, + 7598, + 19809, + 611, + 10144, + 0 }, + { 12, 195, 14244, 7229, 13002, 14328, 17987, 14595, 6985, 7642, 9434, 7079, 5571, 0 }, + { 12, + 10013, + 3641, + 14064, + 11716, + 4620, + 18119, + 23365, + 26446, + 26273, + 25164, + 11262, + 26019, + 0 }, + { 12, + 15166, + 19403, + 5606, + 20138, + 1893, + 645, + 5414, + 12097, + 18635, + 21648, + 12255, + 13269, + 0 }, + { 12, + 1895, + 9969, + 8372, + 17737, + 21679, + 17061, + 20219, + 2513, + 27199, + 11242, + 17025, + 1261, + 0 }, + { 12, + 12845, + 13086, + 16256, + 15177, + 20822, + 10862, + 18375, + 6751, + 17532, + 24725, + 6966, + 18489, + 0 }, + { 12, + 8373, + 25550, + 20688, + 16686, + 7894, + 24599, + 21578, + 12516, + 7115, + 4836, + 23473, + 25162, + 0 }, + { 12, + 14375, + 9150, + 6606, + 21633, + 16224, + 23708, + 20350, + 4575, + 143, + 13356, + 10239, + 22868, + 0 }, + { 12, + 10760, + 19807, + 7079, + 16382, + 26236, + 22606, + 16777, + 24312, + 16941, + 26684, + 8658, + 19279, + 0 }, + { 12, + 15136, + 8603, + 332, + 2898, + 21821, + 23778, + 3232, + 12052, + 14336, + 7832, + 5600, + 27015, + 0 }, + { 12, + 14392, + 26564, + 21616, + 8332, + 21750, + 10379, + 19730, + 7553, + 27352, + 2718, + 15202, + 25661, + 0 }, + { 12, + 6891, + 13210, + 15284, + 21940, + 8742, + 10965, + 3176, + 25034, + 25137, + 25161, + 13267, + 7012, + 0 }, + { 12, + 4993, + 9943, + 13260, + 20980, + 20224, + 20129, + 2120, + 23111, + 16640, + 23548, + 21445, + 10794, + 0 }, + { 12, + 4846, + 2858, + 22663, + 12584, + 20448, + 4629, + 17825, + 22269, + 11278, + 26312, + 9463, + 21085, + 0 }, + { 12, + 24282, + 18233, + 9220, + 14979, + 24106, + 14507, + 24838, + 19689, + 17589, + 7926, + 7893, + 21701, + 0 }, + { 12, 12253, 26122, 8035, 20823, 2584, 4703, 25178, 5460, 4190, 7057, 1144, 8426, 0 }, + { 12, + 12354, + 7216, + 19484, + 4110, + 22105, + 1452, + 11457, + 12539, + 27106, + 14256, + 14113, + 20701, + 0 }, + { 12, + 2547, + 26926, + 25933, + 11919, + 12026, + 24639, + 19741, + 15457, + 9239, + 26713, + 22838, + 6051, + 0 }, + { 12, + 8782, + 14714, + 23363, + 450, + 19972, + 2622, + 19473, + 24182, + 2391, + 26205, + 10018, + 9202, + 0 }, + { 12, + 15690, + 10472, + 20263, + 469, + 18876, + 23660, + 9005, + 12595, + 23818, + 26430, + 926, + 6156, + 0 }, + { 12, + 5440, + 5209, + 14958, + 9882, + 18843, + 22063, + 12749, + 18473, + 22546, + 11768, + 4493, + 12833, + 0 }, + { 12, + 18540, + 3544, + 9471, + 15893, + 14761, + 23479, + 22010, + 15491, + 19608, + 25035, + 9094, + 24836, + 0 }, + { 12, + 15909, + 16594, + 23538, + 25136, + 25063, + 24995, + 5354, + 905, + 18580, + 15476, + 20710, + 7774, + 0 }, + { 3, 6088, 17133, 11498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4721, 17594, 18267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1645, 23638, 26645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14800, 17920, 22016, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12927, 350, 19391, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19447, 19886, 25992, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26120, 1747, 11234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1588, 23170, 27232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2230, 15468, 18709, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17410, 11055, 20645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3244, 25815, 14204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2858, 7980, 12780, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3256, 20418, 24355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24260, 16245, 20948, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11122, 1503, 15651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19272, 24054, 6075, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4905, 931, 18884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23633, 17244, 6067, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5568, 26403, 490, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16113, 16055, 10524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23013, 8138, 12876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20699, 20123, 15435, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 27272, 27296, 22638, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7658, 17259, 20553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14914, 17891, 12137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16323, 1085, 18895, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21503, 17141, 2915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21979, 23246, 1271, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14409, 11303, 12604, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25591, 12157, 14704, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18739, 19265, 8140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11244, 5962, 6647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3589, 6029, 6489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16416, 185, 9426, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1267, 14086, 22473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17159, 22404, 23608, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7230, 22514, 21605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7645, 1239, 10717, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12028, 13404, 12140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14784, 15425, 14895, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26165, 18980, 15386, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14399, 7725, 14908, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8463, 22853, 22095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5517, 1854, 8283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24381, 260, 12595, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 839, 23743, 22445, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13473, 8017, 7716, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8697, 13050, 16975, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26656, 16911, 11972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 26173, 2504, 15216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7493, 6461, 12840, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4464, 14912, 3745, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21461, 9734, 25841, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4659, 7599, 9984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17519, 7389, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12589, 9862, 8680, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23053, 21981, 25299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19246, 3243, 15916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21733, 4467, 26491, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4959, 10093, 20074, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9140, 15000, 12783, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 854, 10701, 25850, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13624, 7755, 10789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3977, 15812, 10783, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5830, 6774, 10151, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21375, 25110, 5830, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15985, 18342, 2623, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4716, 27211, 18500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18370, 12487, 7335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4362, 21569, 16881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10421, 15454, 13015, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5794, 1239, 9934, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_28_45N[112][12]= - { - {11,24402,4786,12678,6376,23965,10003,15376,15164,21366,24252,3353}, - {11,8189,3297,18493,17994,16296,11970,16168,15911,20683,11930,3119}, - {11,22463,11744,13833,8279,21652,14679,23663,4389,15110,17254,17498}, - {11,13616,426,18060,598,19615,9494,3987,8014,13361,4131,13185}, - {11,4176,17725,14717,3414,10033,17879,8079,12107,10852,1375,19459}, - {11,1450,4123,2111,17490,13209,8048,15285,4422,11667,18290,19621}, - {11,2067,15982,304,8658,19120,6746,13569,19253,2227,22778,23826}, - {11,11667,11145,20469,17485,13697,3712,4258,16831,22634,18035,7275}, - {11,23804,14496,17938,15883,14984,15944,2816,22406,22111,2319,14731}, - {11,8541,12579,22121,8602,16755,6704,23740,16151,20297,9633,1100}, - {11,19569,10549,19086,21110,11659,6901,21295,7637,11756,8293,9071}, - {11,9527,9135,7181,19534,2157,788,13347,17355,17509,711,20116}, - {11,21217,15801,12175,9604,17521,2127,21103,1346,8921,7976,3363}, - {11,11036,5152,19173,8086,3571,1955,4146,13309,15934,19132,5510}, - {11,12935,13966,15399,16179,8206,19233,16702,7127,12185,15420,1383}, - {11,6222,6384,20549,18914,23658,11189,638,9297,17741,9747,13598}, - {11,17209,11974,20776,2146,9023,3192,19646,3393,1727,15588,20185}, - {11,5008,3885,5035,15852,5189,13877,15177,3049,22164,16540,21064}, - {11,24004,10345,12255,36,24008,8764,13276,13131,2358,24010,16203}, - {11,21121,21691,8555,11918,129,8860,23600,3042,3949,19554,12319}, - {11,22514,11709,11874,11656,536,9142,3901,580,1547,10749,5529}, - {11,3324,6251,1156,112,13086,5373,5119,132,18069,10482,19519}, - {11,17279,2017,14846,21417,17154,21735,18788,11759,192,16027,6234}, - {11,20417,3788,15159,22188,21251,16633,13579,8128,1841,23554,15056}, - {7,12104,9182,6147,1553,12750,4071,6495,0,0,0,0}, - {7,4961,18460,23266,10785,10973,4405,2707,0,0,0,0}, - {7,7665,7043,1968,3589,15378,9642,21148,0,0,0,0}, - {7,13073,13298,20040,13582,17124,348,12055,0,0,0,0}, - {3,378,7476,9838,0,0,0,0,0,0,0,0}, - {3,15454,5218,14834,0,0,0,0,0,0,0,0}, - {3,17678,3445,18453,0,0,0,0,0,0,0,0}, - {3,2767,388,12638,0,0,0,0,0,0,0,0}, - {3,5688,56,6360,0,0,0,0,0,0,0,0}, - {3,20009,872,16872,0,0,0,0,0,0,0,0}, - {3,10206,5551,477,0,0,0,0,0,0,0,0}, - {3,10662,23689,19768,0,0,0,0,0,0,0,0}, - {3,8965,17535,4421,0,0,0,0,0,0,0,0}, - {3,19397,18734,5422,0,0,0,0,0,0,0,0}, - {3,10043,22104,21682,0,0,0,0,0,0,0,0}, - {3,508,1588,23853,0,0,0,0,0,0,0,0}, - {3,1092,7288,4358,0,0,0,0,0,0,0,0}, - {3,2283,22298,10504,0,0,0,0,0,0,0,0}, - {3,15022,8592,22291,0,0,0,0,0,0,0,0}, - {3,11844,17038,2983,0,0,0,0,0,0,0,0}, - {3,17404,14541,6446,0,0,0,0,0,0,0,0}, - {3,20724,7498,2993,0,0,0,0,0,0,0,0}, - {3,14715,9410,6844,0,0,0,0,0,0,0,0}, - {3,20213,14674,263,0,0,0,0,0,0,0,0}, - {3,4822,20951,635,0,0,0,0,0,0,0,0}, - {3,20651,23174,5057,0,0,0,0,0,0,0,0}, - {3,22237,9229,4859,0,0,0,0,0,0,0,0}, - {3,17280,9586,20334,0,0,0,0,0,0,0,0}, - {3,19508,8068,11375,0,0,0,0,0,0,0,0}, - {3,5776,21209,9418,0,0,0,0,0,0,0,0}, - {3,6872,6349,20397,0,0,0,0,0,0,0,0}, - {3,11165,19619,13108,0,0,0,0,0,0,0,0}, - {3,13550,10715,5122,0,0,0,0,0,0,0,0}, - {3,5655,10699,8415,0,0,0,0,0,0,0,0}, - {3,9864,4985,7986,0,0,0,0,0,0,0,0}, - {3,6436,3754,7690,0,0,0,0,0,0,0,0}, - {3,4257,17119,5328,0,0,0,0,0,0,0,0}, - {3,659,4687,6006,0,0,0,0,0,0,0,0}, - {3,527,10824,8234,0,0,0,0,0,0,0,0}, - {3,11291,1735,22513,0,0,0,0,0,0,0,0}, - {3,7254,2617,1493,0,0,0,0,0,0,0,0}, - {3,3015,7462,10953,0,0,0,0,0,0,0,0}, - {3,15705,2181,11992,0,0,0,0,0,0,0,0}, - {3,4628,19430,18223,0,0,0,0,0,0,0,0}, - {3,9426,21808,13549,0,0,0,0,0,0,0,0}, - {3,17008,3470,22568,0,0,0,0,0,0,0,0}, - {3,13643,24195,21816,0,0,0,0,0,0,0,0}, - {3,936,14226,22874,0,0,0,0,0,0,0,0}, - {3,6156,19306,18215,0,0,0,0,0,0,0,0}, - {3,23984,14714,12907,0,0,0,0,0,0,0,0}, - {3,5139,18639,15609,0,0,0,0,0,0,0,0}, - {3,11908,5446,8958,0,0,0,0,0,0,0,0}, - {3,6315,16864,15814,0,0,0,0,0,0,0,0}, - {3,10686,22570,16196,0,0,0,0,0,0,0,0}, - {3,203,4208,13716,0,0,0,0,0,0,0,0}, - {3,494,14172,11778,0,0,0,0,0,0,0,0}, - {3,15112,14244,8417,0,0,0,0,0,0,0,0}, - {3,21087,4602,15570,0,0,0,0,0,0,0,0}, - {3,19758,4401,22270,0,0,0,0,0,0,0,0}, - {3,8218,11940,5009,0,0,0,0,0,0,0,0}, - {3,23833,13785,12569,0,0,0,0,0,0,0,0}, - {3,1698,7113,18541,0,0,0,0,0,0,0,0}, - {3,18711,19991,19673,0,0,0,0,0,0,0,0}, - {3,8025,17107,14784,0,0,0,0,0,0,0,0}, - {3,5954,6817,19810,0,0,0,0,0,0,0,0}, - {3,24143,12236,18063,0,0,0,0,0,0,0,0}, - {3,23748,23956,10369,0,0,0,0,0,0,0,0}, - {3,7805,13982,13861,0,0,0,0,0,0,0,0}, - {3,5198,10889,6787,0,0,0,0,0,0,0,0}, - {3,10406,13918,3305,0,0,0,0,0,0,0,0}, - {3,12219,6523,12999,0,0,0,0,0,0,0,0}, - {3,9964,2004,17361,0,0,0,0,0,0,0,0}, - {3,23759,21507,11984,0,0,0,0,0,0,0,0}, - {3,4188,19754,13358,0,0,0,0,0,0,0,0}, - {3,8027,3662,2411,0,0,0,0,0,0,0,0}, - {3,19762,16017,9125,0,0,0,0,0,0,0,0}, - {3,2393,4619,5452,0,0,0,0,0,0,0,0}, - {3,24176,6586,10895,0,0,0,0,0,0,0,0}, - {3,15872,1795,15801,0,0,0,0,0,0,0,0}, - {3,6911,15300,14787,0,0,0,0,0,0,0,0}, - {3,2584,4905,8833,0,0,0,0,0,0,0,0}, - {3,1327,12862,9476,0,0,0,0,0,0,0,0}, - {3,16768,12633,7400,0,0,0,0,0,0,0,0}, - {3,11983,6276,18370,0,0,0,0,0,0,0,0}, - {3,12939,12793,20048,0,0,0,0,0,0,0,0}, - {3,20284,12949,21345,0,0,0,0,0,0,0,0}, - {3,19545,4503,16017,0,0,0,0,0,0,0,0}, - {3,1253,12068,18813,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_28_45N[112][12] = { + { 11, 24402, 4786, 12678, 6376, 23965, 10003, 15376, 15164, 21366, 24252, 3353 }, + { 11, 8189, 3297, 18493, 17994, 16296, 11970, 16168, 15911, 20683, 11930, 3119 }, + { 11, 22463, 11744, 13833, 8279, 21652, 14679, 23663, 4389, 15110, 17254, 17498 }, + { 11, 13616, 426, 18060, 598, 19615, 9494, 3987, 8014, 13361, 4131, 13185 }, + { 11, 4176, 17725, 14717, 3414, 10033, 17879, 8079, 12107, 10852, 1375, 19459 }, + { 11, 1450, 4123, 2111, 17490, 13209, 8048, 15285, 4422, 11667, 18290, 19621 }, + { 11, 2067, 15982, 304, 8658, 19120, 6746, 13569, 19253, 2227, 22778, 23826 }, + { 11, 11667, 11145, 20469, 17485, 13697, 3712, 4258, 16831, 22634, 18035, 7275 }, + { 11, 23804, 14496, 17938, 15883, 14984, 15944, 2816, 22406, 22111, 2319, 14731 }, + { 11, 8541, 12579, 22121, 8602, 16755, 6704, 23740, 16151, 20297, 9633, 1100 }, + { 11, 19569, 10549, 19086, 21110, 11659, 6901, 21295, 7637, 11756, 8293, 9071 }, + { 11, 9527, 9135, 7181, 19534, 2157, 788, 13347, 17355, 17509, 711, 20116 }, + { 11, 21217, 15801, 12175, 9604, 17521, 2127, 21103, 1346, 8921, 7976, 3363 }, + { 11, 11036, 5152, 19173, 8086, 3571, 1955, 4146, 13309, 15934, 19132, 5510 }, + { 11, 12935, 13966, 15399, 16179, 8206, 19233, 16702, 7127, 12185, 15420, 1383 }, + { 11, 6222, 6384, 20549, 18914, 23658, 11189, 638, 9297, 17741, 9747, 13598 }, + { 11, 17209, 11974, 20776, 2146, 9023, 3192, 19646, 3393, 1727, 15588, 20185 }, + { 11, 5008, 3885, 5035, 15852, 5189, 13877, 15177, 3049, 22164, 16540, 21064 }, + { 11, 24004, 10345, 12255, 36, 24008, 8764, 13276, 13131, 2358, 24010, 16203 }, + { 11, 21121, 21691, 8555, 11918, 129, 8860, 23600, 3042, 3949, 19554, 12319 }, + { 11, 22514, 11709, 11874, 11656, 536, 9142, 3901, 580, 1547, 10749, 5529 }, + { 11, 3324, 6251, 1156, 112, 13086, 5373, 5119, 132, 18069, 10482, 19519 }, + { 11, 17279, 2017, 14846, 21417, 17154, 21735, 18788, 11759, 192, 16027, 6234 }, + { 11, 20417, 3788, 15159, 22188, 21251, 16633, 13579, 8128, 1841, 23554, 15056 }, + { 7, 12104, 9182, 6147, 1553, 12750, 4071, 6495, 0, 0, 0, 0 }, + { 7, 4961, 18460, 23266, 10785, 10973, 4405, 2707, 0, 0, 0, 0 }, + { 7, 7665, 7043, 1968, 3589, 15378, 9642, 21148, 0, 0, 0, 0 }, + { 7, 13073, 13298, 20040, 13582, 17124, 348, 12055, 0, 0, 0, 0 }, + { 3, 378, 7476, 9838, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15454, 5218, 14834, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17678, 3445, 18453, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2767, 388, 12638, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5688, 56, 6360, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20009, 872, 16872, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10206, 5551, 477, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10662, 23689, 19768, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8965, 17535, 4421, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19397, 18734, 5422, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10043, 22104, 21682, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 508, 1588, 23853, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1092, 7288, 4358, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2283, 22298, 10504, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15022, 8592, 22291, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11844, 17038, 2983, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17404, 14541, 6446, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20724, 7498, 2993, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14715, 9410, 6844, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20213, 14674, 263, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4822, 20951, 635, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20651, 23174, 5057, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22237, 9229, 4859, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17280, 9586, 20334, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19508, 8068, 11375, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5776, 21209, 9418, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6872, 6349, 20397, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11165, 19619, 13108, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13550, 10715, 5122, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5655, 10699, 8415, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9864, 4985, 7986, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6436, 3754, 7690, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4257, 17119, 5328, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 659, 4687, 6006, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 527, 10824, 8234, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11291, 1735, 22513, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7254, 2617, 1493, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3015, 7462, 10953, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15705, 2181, 11992, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4628, 19430, 18223, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9426, 21808, 13549, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17008, 3470, 22568, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13643, 24195, 21816, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 936, 14226, 22874, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6156, 19306, 18215, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23984, 14714, 12907, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5139, 18639, 15609, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11908, 5446, 8958, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6315, 16864, 15814, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10686, 22570, 16196, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 203, 4208, 13716, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 494, 14172, 11778, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15112, 14244, 8417, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21087, 4602, 15570, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19758, 4401, 22270, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8218, 11940, 5009, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23833, 13785, 12569, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1698, 7113, 18541, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18711, 19991, 19673, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8025, 17107, 14784, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5954, 6817, 19810, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24143, 12236, 18063, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23748, 23956, 10369, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7805, 13982, 13861, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5198, 10889, 6787, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10406, 13918, 3305, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12219, 6523, 12999, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9964, 2004, 17361, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23759, 21507, 11984, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4188, 19754, 13358, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8027, 3662, 2411, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19762, 16017, 9125, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2393, 4619, 5452, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24176, 6586, 10895, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15872, 1795, 15801, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6911, 15300, 14787, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2584, 4905, 8833, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1327, 12862, 9476, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16768, 12633, 7400, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11983, 6276, 18370, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12939, 12793, 20048, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20284, 12949, 21345, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19545, 4503, 16017, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1253, 12068, 18813, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_23_36N[115][12]= - { - {11,2475,3722,16456,6081,4483,19474,20555,10558,4351,4052,20066}, - {11,1547,5612,22269,11685,23297,19891,18996,21694,7927,19412,15951}, - {11,288,15139,7767,3059,1455,12056,12721,7938,19334,3233,5711}, - {11,6664,7486,17133,2931,20176,20158,9634,20002,13129,10015,13595}, - {11,218,22642,9357,11999,22898,4446,8059,1913,22365,10039,15203}, - {11,10305,22970,7928,16564,8402,9988,7039,10195,22389,5451,8731}, - {11,19073,1005,18826,11109,13748,11891,21530,15924,21128,6841,11064}, - {11,3240,11632,18386,22456,3963,14719,4244,4599,8098,7599,12862}, - {11,5666,11543,9276,19923,19171,19591,6005,8623,22777,1255,20078}, - {11,17064,13244,323,11349,6637,8611,6695,4750,20985,18144,5584}, - {11,20309,6210,16745,10959,14284,2893,20916,10985,9664,9065,11703}, - {11,17833,21598,22375,12890,10779,11241,13115,9222,21139,1217,15337}, - {11,15514,12517,18953,11458,17296,8751,7213,12078,4994,4391,14976}, - {11,3842,21548,10955,11679,16551,8514,17999,20557,16497,12122,23056}, - {11,10551,20186,66,11038,22049,2130,1089,22093,9069,3470,8079}, - {11,19208,22044,2732,1325,22309,967,22951,1366,11745,5556,6926}, - {11,2805,18271,10046,4277,207,19518,17387,9701,8515,6813,10532}, - {11,19714,21923,13493,1768,18819,6093,14086,13695,12781,9782,445}, - {11,22160,15778,13629,10312,19769,8567,22096,15558,19730,11861,18492}, - {11,10729,16847,273,4119,4392,11480,20396,3505,7220,390,5546}, - {6,17277,8531,17390,22364,7167,2217,0,0,0,0,0}, - {6,7325,3832,19899,21104,8400,3906,0,0,0,0,0}, - {6,6218,20330,14943,14477,5614,1582,0,0,0,0,0}, - {6,21534,14286,14624,14809,6775,22838,0,0,0,0,0}, - {6,15786,6527,15848,5288,13523,9692,0,0,0,0,0}, - {3,12696,15315,602,0,0,0,0,0,0,0,0}, - {3,17081,6828,13578,0,0,0,0,0,0,0,0}, - {3,3492,6510,20337,0,0,0,0,0,0,0,0}, - {3,6113,5090,7290,0,0,0,0,0,0,0,0}, - {3,20122,15539,19267,0,0,0,0,0,0,0,0}, - {3,10412,19090,17863,0,0,0,0,0,0,0,0}, - {3,2546,2295,19448,0,0,0,0,0,0,0,0}, - {3,20296,2296,2627,0,0,0,0,0,0,0,0}, - {3,6740,14224,10460,0,0,0,0,0,0,0,0}, - {3,12878,6055,15452,0,0,0,0,0,0,0,0}, - {3,15152,15699,563,0,0,0,0,0,0,0,0}, - {3,15414,21900,19161,0,0,0,0,0,0,0,0}, - {3,11126,15975,3733,0,0,0,0,0,0,0,0}, - {3,4379,15742,6475,0,0,0,0,0,0,0,0}, - {3,17203,5870,18537,0,0,0,0,0,0,0,0}, - {3,4912,260,21115,0,0,0,0,0,0,0,0}, - {3,23164,4273,1694,0,0,0,0,0,0,0,0}, - {3,1082,5287,11152,0,0,0,0,0,0,0,0}, - {3,14537,2277,19232,0,0,0,0,0,0,0,0}, - {3,13414,15608,12926,0,0,0,0,0,0,0,0}, - {3,17043,18241,18313,0,0,0,0,0,0,0,0}, - {3,208,6118,20777,0,0,0,0,0,0,0,0}, - {3,9140,19241,22845,0,0,0,0,0,0,0,0}, - {3,18527,5035,4161,0,0,0,0,0,0,0,0}, - {3,20867,22650,5585,0,0,0,0,0,0,0,0}, - {3,7875,10358,1898,0,0,0,0,0,0,0,0}, - {3,3563,14833,21329,0,0,0,0,0,0,0,0}, - {3,14705,3359,13959,0,0,0,0,0,0,0,0}, - {3,4507,11976,20017,0,0,0,0,0,0,0,0}, - {3,22424,12925,8308,0,0,0,0,0,0,0,0}, - {3,8739,15561,8010,0,0,0,0,0,0,0,0}, - {3,6408,20723,20928,0,0,0,0,0,0,0,0}, - {3,12337,7864,15777,0,0,0,0,0,0,0,0}, - {3,12742,20430,17351,0,0,0,0,0,0,0,0}, - {3,6259,1865,9808,0,0,0,0,0,0,0,0}, - {3,8343,17441,2551,0,0,0,0,0,0,0,0}, - {3,2167,3025,23181,0,0,0,0,0,0,0,0}, - {3,22718,13243,4797,0,0,0,0,0,0,0,0}, - {3,4223,4982,4395,0,0,0,0,0,0,0,0}, - {3,1609,16748,17625,0,0,0,0,0,0,0,0}, - {3,8463,15204,19632,0,0,0,0,0,0,0,0}, - {3,6583,9112,20284,0,0,0,0,0,0,0,0}, - {3,11334,19370,4763,0,0,0,0,0,0,0,0}, - {3,746,18560,15222,0,0,0,0,0,0,0,0}, - {3,8796,12725,15176,0,0,0,0,0,0,0,0}, - {3,10245,15567,9991,0,0,0,0,0,0,0,0}, - {3,17447,18373,21523,0,0,0,0,0,0,0,0}, - {3,1473,5286,15793,0,0,0,0,0,0,0,0}, - {3,17675,21170,6699,0,0,0,0,0,0,0,0}, - {3,15515,15942,8733,0,0,0,0,0,0,0,0}, - {3,7047,11348,14584,0,0,0,0,0,0,0,0}, - {3,20435,19603,1961,0,0,0,0,0,0,0,0}, - {3,18851,7069,11402,0,0,0,0,0,0,0,0}, - {3,19180,6487,2979,0,0,0,0,0,0,0,0}, - {3,2650,13282,9040,0,0,0,0,0,0,0,0}, - {3,22613,23266,4786,0,0,0,0,0,0,0,0}, - {3,20832,3001,23129,0,0,0,0,0,0,0,0}, - {3,3850,5255,6601,0,0,0,0,0,0,0,0}, - {3,19827,15438,13956,0,0,0,0,0,0,0,0}, - {3,15798,4430,11318,0,0,0,0,0,0,0,0}, - {3,4724,8719,21209,0,0,0,0,0,0,0,0}, - {3,18127,844,21379,0,0,0,0,0,0,0,0}, - {3,7427,22987,10233,0,0,0,0,0,0,0,0}, - {3,22949,8145,21778,0,0,0,0,0,0,0,0}, - {3,7622,14471,18874,0,0,0,0,0,0,0,0}, - {3,8566,14340,3381,0,0,0,0,0,0,0,0}, - {3,3373,419,11514,0,0,0,0,0,0,0,0}, - {3,15127,917,13136,0,0,0,0,0,0,0,0}, - {3,19375,18740,4951,0,0,0,0,0,0,0,0}, - {3,960,2856,17804,0,0,0,0,0,0,0,0}, - {3,662,8107,10298,0,0,0,0,0,0,0,0}, - {3,10993,11755,19142,0,0,0,0,0,0,0,0}, - {3,11400,18818,521,0,0,0,0,0,0,0,0}, - {3,7210,18658,8285,0,0,0,0,0,0,0,0}, - {3,9496,20836,5655,0,0,0,0,0,0,0,0}, - {3,14654,13694,12705,0,0,0,0,0,0,0,0}, - {3,20381,16473,7271,0,0,0,0,0,0,0,0}, - {3,12796,3280,23370,0,0,0,0,0,0,0,0}, - {3,13893,7667,1736,0,0,0,0,0,0,0,0}, - {3,5485,18321,7789,0,0,0,0,0,0,0,0}, - {3,11242,18771,17282,0,0,0,0,0,0,0,0}, - {3,817,21060,15985,0,0,0,0,0,0,0,0}, - {3,666,20461,22464,0,0,0,0,0,0,0,0}, - {3,7696,19774,4324,0,0,0,0,0,0,0,0}, - {3,12239,14014,4759,0,0,0,0,0,0,0,0}, - {3,5011,10472,4137,0,0,0,0,0,0,0,0}, - {3,3047,2444,3818,0,0,0,0,0,0,0,0}, - {3,1594,20382,538,0,0,0,0,0,0,0,0}, - {3,7051,21874,1697,0,0,0,0,0,0,0,0}, - {3,18539,26,21487,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_23_36N[115][12] = { + { 11, 2475, 3722, 16456, 6081, 4483, 19474, 20555, 10558, 4351, 4052, 20066 }, + { 11, 1547, 5612, 22269, 11685, 23297, 19891, 18996, 21694, 7927, 19412, 15951 }, + { 11, 288, 15139, 7767, 3059, 1455, 12056, 12721, 7938, 19334, 3233, 5711 }, + { 11, 6664, 7486, 17133, 2931, 20176, 20158, 9634, 20002, 13129, 10015, 13595 }, + { 11, 218, 22642, 9357, 11999, 22898, 4446, 8059, 1913, 22365, 10039, 15203 }, + { 11, 10305, 22970, 7928, 16564, 8402, 9988, 7039, 10195, 22389, 5451, 8731 }, + { 11, 19073, 1005, 18826, 11109, 13748, 11891, 21530, 15924, 21128, 6841, 11064 }, + { 11, 3240, 11632, 18386, 22456, 3963, 14719, 4244, 4599, 8098, 7599, 12862 }, + { 11, 5666, 11543, 9276, 19923, 19171, 19591, 6005, 8623, 22777, 1255, 20078 }, + { 11, 17064, 13244, 323, 11349, 6637, 8611, 6695, 4750, 20985, 18144, 5584 }, + { 11, 20309, 6210, 16745, 10959, 14284, 2893, 20916, 10985, 9664, 9065, 11703 }, + { 11, 17833, 21598, 22375, 12890, 10779, 11241, 13115, 9222, 21139, 1217, 15337 }, + { 11, 15514, 12517, 18953, 11458, 17296, 8751, 7213, 12078, 4994, 4391, 14976 }, + { 11, 3842, 21548, 10955, 11679, 16551, 8514, 17999, 20557, 16497, 12122, 23056 }, + { 11, 10551, 20186, 66, 11038, 22049, 2130, 1089, 22093, 9069, 3470, 8079 }, + { 11, 19208, 22044, 2732, 1325, 22309, 967, 22951, 1366, 11745, 5556, 6926 }, + { 11, 2805, 18271, 10046, 4277, 207, 19518, 17387, 9701, 8515, 6813, 10532 }, + { 11, 19714, 21923, 13493, 1768, 18819, 6093, 14086, 13695, 12781, 9782, 445 }, + { 11, 22160, 15778, 13629, 10312, 19769, 8567, 22096, 15558, 19730, 11861, 18492 }, + { 11, 10729, 16847, 273, 4119, 4392, 11480, 20396, 3505, 7220, 390, 5546 }, + { 6, 17277, 8531, 17390, 22364, 7167, 2217, 0, 0, 0, 0, 0 }, + { 6, 7325, 3832, 19899, 21104, 8400, 3906, 0, 0, 0, 0, 0 }, + { 6, 6218, 20330, 14943, 14477, 5614, 1582, 0, 0, 0, 0, 0 }, + { 6, 21534, 14286, 14624, 14809, 6775, 22838, 0, 0, 0, 0, 0 }, + { 6, 15786, 6527, 15848, 5288, 13523, 9692, 0, 0, 0, 0, 0 }, + { 3, 12696, 15315, 602, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17081, 6828, 13578, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3492, 6510, 20337, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6113, 5090, 7290, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20122, 15539, 19267, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10412, 19090, 17863, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2546, 2295, 19448, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20296, 2296, 2627, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6740, 14224, 10460, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12878, 6055, 15452, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15152, 15699, 563, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15414, 21900, 19161, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11126, 15975, 3733, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4379, 15742, 6475, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17203, 5870, 18537, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4912, 260, 21115, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23164, 4273, 1694, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1082, 5287, 11152, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14537, 2277, 19232, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13414, 15608, 12926, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17043, 18241, 18313, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 208, 6118, 20777, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9140, 19241, 22845, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18527, 5035, 4161, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20867, 22650, 5585, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7875, 10358, 1898, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3563, 14833, 21329, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14705, 3359, 13959, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4507, 11976, 20017, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22424, 12925, 8308, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8739, 15561, 8010, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6408, 20723, 20928, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12337, 7864, 15777, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12742, 20430, 17351, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6259, 1865, 9808, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8343, 17441, 2551, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2167, 3025, 23181, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22718, 13243, 4797, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4223, 4982, 4395, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1609, 16748, 17625, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8463, 15204, 19632, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6583, 9112, 20284, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11334, 19370, 4763, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 746, 18560, 15222, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8796, 12725, 15176, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10245, 15567, 9991, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17447, 18373, 21523, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1473, 5286, 15793, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17675, 21170, 6699, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15515, 15942, 8733, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7047, 11348, 14584, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20435, 19603, 1961, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18851, 7069, 11402, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19180, 6487, 2979, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2650, 13282, 9040, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22613, 23266, 4786, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20832, 3001, 23129, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3850, 5255, 6601, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19827, 15438, 13956, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15798, 4430, 11318, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4724, 8719, 21209, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18127, 844, 21379, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7427, 22987, 10233, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22949, 8145, 21778, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7622, 14471, 18874, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8566, 14340, 3381, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3373, 419, 11514, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15127, 917, 13136, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19375, 18740, 4951, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 960, 2856, 17804, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 662, 8107, 10298, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10993, 11755, 19142, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11400, 18818, 521, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7210, 18658, 8285, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9496, 20836, 5655, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14654, 13694, 12705, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20381, 16473, 7271, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12796, 3280, 23370, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13893, 7667, 1736, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5485, 18321, 7789, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11242, 18771, 17282, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 817, 21060, 15985, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 666, 20461, 22464, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7696, 19774, 4324, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12239, 14014, 4759, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5011, 10472, 4137, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3047, 2444, 3818, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1594, 20382, 538, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7051, 21874, 1697, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18539, 26, 21487, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_25_36N[125][12]= - { - {11,11863,9493,4143,12695,8706,170,4967,798,9856,6015,5125}, - {11,12288,19567,18233,15430,1671,3787,10133,15709,7883,14260,17039}, - {11,2066,12269,14620,7577,11525,19519,6181,3850,8893,272,12473}, - {11,8857,12404,1136,19464,15113,12598,12147,4987,13843,12152,13241}, - {11,1354,12339,4308,23,12677,11533,3187,11609,4740,14630,19630}, - {11,14508,10946,3928,580,3526,17836,3786,15739,13991,1238,1071}, - {11,6977,13222,13811,585,8154,2579,8314,12185,15876,7738,5691}, - {11,12901,12576,11597,4893,17238,15556,8106,12472,10455,14530,17432}, - {11,8373,12875,16582,14611,14267,15093,2405,9342,18326,12125,9257}, - {11,5861,12284,2441,13280,2762,5076,17758,4359,6156,18961,13208}, - {11,4400,8474,19629,19528,14125,12780,12740,19316,491,4761,1719}, - {11,7270,6615,1175,15848,6943,18360,8905,13921,10807,19688,18757}, - {11,8312,12234,17907,17254,7699,18399,5508,12215,4818,18107,2874}, - {11,19496,13973,10432,13445,15320,13648,1501,10549,6710,8897,1998}, - {11,1575,12713,10916,5316,13713,11318,4055,5782,5828,17981,3141}, - {11,12177,10726,4244,3138,15996,6822,7495,5257,8909,6180,10680}, - {11,6650,1909,19146,1038,17229,10050,3051,9793,10839,3532,14759}, - {11,5337,8448,4939,14792,7585,17860,8612,2229,18965,1519,2031}, - {11,13845,9320,579,15441,15050,752,8303,6989,13360,12927,15255}, - {11,17286,3639,1733,16883,8457,9475,2939,3234,1993,8554,9939}, - {11,6359,15474,12100,6992,13844,16988,7481,16977,9052,9262,15270}, - {11,7181,3624,3814,16379,182,4338,17627,3315,5745,14093,15574}, - {11,10709,18662,6909,11248,5268,412,5854,16782,16059,10498,5061}, - {11,13321,617,6734,3718,15441,19241,17214,1682,18641,18646,6330}, - {11,7377,16951,14477,6507,9922,11464,2563,5702,12691,10606,17874}, - {9,7198,12571,17617,4862,18899,7100,8130,9665,10779,0,0}, - {9,6789,11459,17651,3693,13332,3854,7737,12589,15189,0,0}, - {9,16260,14569,9442,17890,18097,6845,6960,1376,8099,0,0}, - {9,12719,14986,18999,14013,3449,13618,14807,265,1508,0,0}, - {9,11231,966,15957,8315,3384,2570,5700,10911,17372,0,0}, - {3,153,8445,19598,0,0,0,0,0,0,0,0}, - {3,7841,14806,54,0,0,0,0,0,0,0,0}, - {3,2492,14099,11718,0,0,0,0,0,0,0,0}, - {3,18608,4278,333,0,0,0,0,0,0,0,0}, - {3,59,3982,16986,0,0,0,0,0,0,0,0}, - {3,3494,12496,2775,0,0,0,0,0,0,0,0}, - {3,18320,10650,16234,0,0,0,0,0,0,0,0}, - {3,9739,16537,19706,0,0,0,0,0,0,0,0}, - {3,7587,19072,18775,0,0,0,0,0,0,0,0}, - {3,14133,12042,2922,0,0,0,0,0,0,0,0}, - {3,229,17958,15889,0,0,0,0,0,0,0,0}, - {3,5130,11029,271,0,0,0,0,0,0,0,0}, - {3,5122,7021,7067,0,0,0,0,0,0,0,0}, - {3,12258,16611,9245,0,0,0,0,0,0,0,0}, - {3,15493,15347,15939,0,0,0,0,0,0,0,0}, - {3,741,12055,2822,0,0,0,0,0,0,0,0}, - {3,12804,3480,5690,0,0,0,0,0,0,0,0}, - {3,18598,19273,16354,0,0,0,0,0,0,0,0}, - {3,2569,16771,13693,0,0,0,0,0,0,0,0}, - {3,15051,853,956,0,0,0,0,0,0,0,0}, - {3,12256,2756,15137,0,0,0,0,0,0,0,0}, - {3,15685,2802,16479,0,0,0,0,0,0,0,0}, - {3,14687,12470,3583,0,0,0,0,0,0,0,0}, - {3,15473,17781,867,0,0,0,0,0,0,0,0}, - {3,4843,6765,13122,0,0,0,0,0,0,0,0}, - {3,11287,3680,19101,0,0,0,0,0,0,0,0}, - {3,4609,11385,13470,0,0,0,0,0,0,0,0}, - {3,12353,6632,206,0,0,0,0,0,0,0,0}, - {3,10984,3116,1263,0,0,0,0,0,0,0,0}, - {3,9419,14455,19438,0,0,0,0,0,0,0,0}, - {3,9528,1808,435,0,0,0,0,0,0,0,0}, - {3,2238,12870,10119,0,0,0,0,0,0,0,0}, - {3,10868,8402,11111,0,0,0,0,0,0,0,0}, - {3,11081,7197,2667,0,0,0,0,0,0,0,0}, - {3,13780,10759,19722,0,0,0,0,0,0,0,0}, - {3,3768,3052,1836,0,0,0,0,0,0,0,0}, - {3,446,1642,12388,0,0,0,0,0,0,0,0}, - {3,16876,8398,14485,0,0,0,0,0,0,0,0}, - {3,7301,14815,13811,0,0,0,0,0,0,0,0}, - {3,5678,10419,14396,0,0,0,0,0,0,0,0}, - {3,1877,14384,12817,0,0,0,0,0,0,0,0}, - {3,19028,19589,6893,0,0,0,0,0,0,0,0}, - {3,8725,6346,676,0,0,0,0,0,0,0,0}, - {3,13611,12486,2054,0,0,0,0,0,0,0,0}, - {3,11203,14908,14692,0,0,0,0,0,0,0,0}, - {3,18139,5334,1253,0,0,0,0,0,0,0,0}, - {3,16233,9749,16946,0,0,0,0,0,0,0,0}, - {3,18885,4332,16306,0,0,0,0,0,0,0,0}, - {3,3862,10395,13871,0,0,0,0,0,0,0,0}, - {3,3747,8900,3381,0,0,0,0,0,0,0,0}, - {3,13367,14132,7220,0,0,0,0,0,0,0,0}, - {3,15095,4219,15869,0,0,0,0,0,0,0,0}, - {3,13519,18079,17541,0,0,0,0,0,0,0,0}, - {3,19012,13943,19471,0,0,0,0,0,0,0,0}, - {3,2221,5710,13711,0,0,0,0,0,0,0,0}, - {3,5185,3363,10195,0,0,0,0,0,0,0,0}, - {3,9580,17331,15360,0,0,0,0,0,0,0,0}, - {3,14387,7596,9614,0,0,0,0,0,0,0,0}, - {3,17336,6371,6030,0,0,0,0,0,0,0,0}, - {3,14629,10636,10159,0,0,0,0,0,0,0,0}, - {3,2402,9170,4321,0,0,0,0,0,0,0,0}, - {3,1040,5899,153,0,0,0,0,0,0,0,0}, - {3,7710,7637,13966,0,0,0,0,0,0,0,0}, - {3,10919,8535,3791,0,0,0,0,0,0,0,0}, - {3,1968,2567,4986,0,0,0,0,0,0,0,0}, - {3,4166,8744,17691,0,0,0,0,0,0,0,0}, - {3,540,10695,10019,0,0,0,0,0,0,0,0}, - {3,17710,1188,10821,0,0,0,0,0,0,0,0}, - {3,5858,17012,17389,0,0,0,0,0,0,0,0}, - {3,3083,17587,12682,0,0,0,0,0,0,0,0}, - {3,5354,9537,6807,0,0,0,0,0,0,0,0}, - {3,4964,15942,9653,0,0,0,0,0,0,0,0}, - {3,9000,17053,13291,0,0,0,0,0,0,0,0}, - {3,11685,8503,10777,0,0,0,0,0,0,0,0}, - {3,13919,18155,9877,0,0,0,0,0,0,0,0}, - {3,1625,15314,13879,0,0,0,0,0,0,0,0}, - {3,18520,7074,17061,0,0,0,0,0,0,0,0}, - {3,3748,2752,7298,0,0,0,0,0,0,0,0}, - {3,493,19163,14139,0,0,0,0,0,0,0,0}, - {3,2260,18339,10688,0,0,0,0,0,0,0,0}, - {3,8928,17695,10276,0,0,0,0,0,0,0,0}, - {3,7640,18547,3561,0,0,0,0,0,0,0,0}, - {3,11275,5297,13167,0,0,0,0,0,0,0,0}, - {3,19691,19542,15725,0,0,0,0,0,0,0,0}, - {3,11837,7273,11297,0,0,0,0,0,0,0,0}, - {3,17873,7840,19563,0,0,0,0,0,0,0,0}, - {3,8109,3811,18417,0,0,0,0,0,0,0,0}, - {3,17759,17623,13175,0,0,0,0,0,0,0,0}, - {3,10041,4152,2249,0,0,0,0,0,0,0,0}, - {3,18452,1450,19309,0,0,0,0,0,0,0,0}, - {3,9161,11651,4614,0,0,0,0,0,0,0,0}, - {3,11547,14058,639,0,0,0,0,0,0,0,0}, - {3,9384,3272,12368,0,0,0,0,0,0,0,0}, - {3,5898,2578,14635,0,0,0,0,0,0,0,0}, - {3,15963,6733,11048,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_25_36N[125][12] = { + { 11, 11863, 9493, 4143, 12695, 8706, 170, 4967, 798, 9856, 6015, 5125 }, + { 11, 12288, 19567, 18233, 15430, 1671, 3787, 10133, 15709, 7883, 14260, 17039 }, + { 11, 2066, 12269, 14620, 7577, 11525, 19519, 6181, 3850, 8893, 272, 12473 }, + { 11, 8857, 12404, 1136, 19464, 15113, 12598, 12147, 4987, 13843, 12152, 13241 }, + { 11, 1354, 12339, 4308, 23, 12677, 11533, 3187, 11609, 4740, 14630, 19630 }, + { 11, 14508, 10946, 3928, 580, 3526, 17836, 3786, 15739, 13991, 1238, 1071 }, + { 11, 6977, 13222, 13811, 585, 8154, 2579, 8314, 12185, 15876, 7738, 5691 }, + { 11, 12901, 12576, 11597, 4893, 17238, 15556, 8106, 12472, 10455, 14530, 17432 }, + { 11, 8373, 12875, 16582, 14611, 14267, 15093, 2405, 9342, 18326, 12125, 9257 }, + { 11, 5861, 12284, 2441, 13280, 2762, 5076, 17758, 4359, 6156, 18961, 13208 }, + { 11, 4400, 8474, 19629, 19528, 14125, 12780, 12740, 19316, 491, 4761, 1719 }, + { 11, 7270, 6615, 1175, 15848, 6943, 18360, 8905, 13921, 10807, 19688, 18757 }, + { 11, 8312, 12234, 17907, 17254, 7699, 18399, 5508, 12215, 4818, 18107, 2874 }, + { 11, 19496, 13973, 10432, 13445, 15320, 13648, 1501, 10549, 6710, 8897, 1998 }, + { 11, 1575, 12713, 10916, 5316, 13713, 11318, 4055, 5782, 5828, 17981, 3141 }, + { 11, 12177, 10726, 4244, 3138, 15996, 6822, 7495, 5257, 8909, 6180, 10680 }, + { 11, 6650, 1909, 19146, 1038, 17229, 10050, 3051, 9793, 10839, 3532, 14759 }, + { 11, 5337, 8448, 4939, 14792, 7585, 17860, 8612, 2229, 18965, 1519, 2031 }, + { 11, 13845, 9320, 579, 15441, 15050, 752, 8303, 6989, 13360, 12927, 15255 }, + { 11, 17286, 3639, 1733, 16883, 8457, 9475, 2939, 3234, 1993, 8554, 9939 }, + { 11, 6359, 15474, 12100, 6992, 13844, 16988, 7481, 16977, 9052, 9262, 15270 }, + { 11, 7181, 3624, 3814, 16379, 182, 4338, 17627, 3315, 5745, 14093, 15574 }, + { 11, 10709, 18662, 6909, 11248, 5268, 412, 5854, 16782, 16059, 10498, 5061 }, + { 11, 13321, 617, 6734, 3718, 15441, 19241, 17214, 1682, 18641, 18646, 6330 }, + { 11, 7377, 16951, 14477, 6507, 9922, 11464, 2563, 5702, 12691, 10606, 17874 }, + { 9, 7198, 12571, 17617, 4862, 18899, 7100, 8130, 9665, 10779, 0, 0 }, + { 9, 6789, 11459, 17651, 3693, 13332, 3854, 7737, 12589, 15189, 0, 0 }, + { 9, 16260, 14569, 9442, 17890, 18097, 6845, 6960, 1376, 8099, 0, 0 }, + { 9, 12719, 14986, 18999, 14013, 3449, 13618, 14807, 265, 1508, 0, 0 }, + { 9, 11231, 966, 15957, 8315, 3384, 2570, 5700, 10911, 17372, 0, 0 }, + { 3, 153, 8445, 19598, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7841, 14806, 54, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2492, 14099, 11718, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18608, 4278, 333, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 59, 3982, 16986, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3494, 12496, 2775, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18320, 10650, 16234, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9739, 16537, 19706, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7587, 19072, 18775, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14133, 12042, 2922, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 229, 17958, 15889, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5130, 11029, 271, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5122, 7021, 7067, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12258, 16611, 9245, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15493, 15347, 15939, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 741, 12055, 2822, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12804, 3480, 5690, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18598, 19273, 16354, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2569, 16771, 13693, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15051, 853, 956, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12256, 2756, 15137, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15685, 2802, 16479, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14687, 12470, 3583, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15473, 17781, 867, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4843, 6765, 13122, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11287, 3680, 19101, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4609, 11385, 13470, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12353, 6632, 206, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10984, 3116, 1263, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9419, 14455, 19438, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9528, 1808, 435, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2238, 12870, 10119, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10868, 8402, 11111, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11081, 7197, 2667, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13780, 10759, 19722, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3768, 3052, 1836, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 446, 1642, 12388, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16876, 8398, 14485, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7301, 14815, 13811, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5678, 10419, 14396, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1877, 14384, 12817, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19028, 19589, 6893, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8725, 6346, 676, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13611, 12486, 2054, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11203, 14908, 14692, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18139, 5334, 1253, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16233, 9749, 16946, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18885, 4332, 16306, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3862, 10395, 13871, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3747, 8900, 3381, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13367, 14132, 7220, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15095, 4219, 15869, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13519, 18079, 17541, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19012, 13943, 19471, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2221, 5710, 13711, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5185, 3363, 10195, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9580, 17331, 15360, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14387, 7596, 9614, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17336, 6371, 6030, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14629, 10636, 10159, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2402, 9170, 4321, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1040, 5899, 153, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7710, 7637, 13966, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10919, 8535, 3791, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1968, 2567, 4986, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4166, 8744, 17691, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 540, 10695, 10019, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17710, 1188, 10821, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5858, 17012, 17389, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3083, 17587, 12682, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5354, 9537, 6807, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4964, 15942, 9653, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9000, 17053, 13291, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11685, 8503, 10777, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13919, 18155, 9877, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1625, 15314, 13879, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18520, 7074, 17061, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3748, 2752, 7298, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 493, 19163, 14139, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2260, 18339, 10688, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8928, 17695, 10276, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7640, 18547, 3561, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11275, 5297, 13167, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19691, 19542, 15725, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11837, 7273, 11297, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17873, 7840, 19563, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8109, 3811, 18417, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17759, 17623, 13175, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10041, 4152, 2249, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18452, 1450, 19309, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9161, 11651, 4614, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11547, 14058, 639, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9384, 3272, 12368, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5898, 2578, 14635, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15963, 6733, 11048, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_13_18N[130][11]= - { - {10,2510,12817,11890,13009,5343,1775,10496,13302,13348,17880}, - {10,6766,16330,2412,7944,2483,7602,12482,6942,3070,9231}, - {10,16410,1766,1240,10046,12091,14475,7003,202,7733,11237}, - {10,15562,4695,13931,17100,11102,770,3848,4216,7132,10929}, - {10,16469,17153,8177,8723,12861,15948,2251,1500,11526,8590}, - {10,14813,3505,12654,1079,11736,6290,2299,17073,6330,5997}, - {10,390,16492,13989,1320,14600,7061,6583,458,894,1596}, - {10,8625,7644,1322,16647,15763,10439,8740,5529,2969,13893}, - {10,13425,13121,5344,8739,4953,7654,17848,9334,9533,2731}, - {10,12506,10992,8762,5395,6424,11688,3193,17601,14679,8204}, - {10,5466,15487,1642,6671,13557,4074,7182,4436,12398,12973}, - {10,1958,13041,6579,15984,3762,16633,6113,11509,7227,28}, - {10,17202,4813,14024,15099,2648,4476,2260,6507,9930,9232}, - {10,14186,14510,6818,7665,12708,2645,16687,13255,8239,15884}, - {10,1751,7847,17987,11410,3345,17133,17655,5027,1261,17191}, - {10,8056,4264,13915,8217,6118,8072,6278,6835,5038,15008}, - {10,13625,2999,5336,11687,13500,5723,13903,766,6293,155}, - {10,12316,14093,7372,16846,15357,9865,17869,1429,16681,202}, - {10,15062,1123,6454,17625,3213,39,1669,1770,13636,16555}, - {10,13053,7597,11481,1336,3343,11387,5463,17830,13741,5976}, - {10,1956,13509,1664,16867,8168,13421,17078,3285,17138,1572}, - {10,16711,1499,4805,13584,14759,2844,13110,7356,5850,8330}, - {10,6521,8528,14170,6681,16992,12867,14326,15227,4082,8595}, - {10,16176,8184,8572,1923,935,8900,13020,6812,9778,3391}, - {10,3946,4711,15314,15108,15634,4144,4372,9207,10715,1291}, - {10,16601,5864,10968,4724,9235,6988,3307,6515,7004,16328}, - {10,16217,4227,9735,15857,5003,2532,4451,8574,2149,6908}, - {10,9506,8949,12035,9701,3124,14295,8567,13614,5159,16746}, - {10,2418,8669,10921,5738,147,1004,2692,9065,12877,7559}, - {10,16706,8511,10314,3118,1219,7071,12376,538,2389,3297}, - {3,12492,10589,5791,0,0,0,0,0,0,0}, - {3,13528,1653,6618,0,0,0,0,0,0,0}, - {3,10485,1307,4102,0,0,0,0,0,0,0}, - {3,347,13580,4039,0,0,0,0,0,0,0}, - {3,523,10311,10540,0,0,0,0,0,0,0}, - {3,4183,6192,17159,0,0,0,0,0,0,0}, - {3,11458,6521,9632,0,0,0,0,0,0,0}, - {3,11594,15791,10384,0,0,0,0,0,0,0}, - {3,11654,126,11715,0,0,0,0,0,0,0}, - {3,6265,34,5091,0,0,0,0,0,0,0}, - {3,7271,13900,7588,0,0,0,0,0,0,0}, - {3,3960,11297,1612,0,0,0,0,0,0,0}, - {3,9857,4695,16399,0,0,0,0,0,0,0}, - {3,6423,2197,15040,0,0,0,0,0,0,0}, - {3,4219,5979,13959,0,0,0,0,0,0,0}, - {3,2959,578,8404,0,0,0,0,0,0,0}, - {3,4585,658,6474,0,0,0,0,0,0,0}, - {3,15900,11357,5249,0,0,0,0,0,0,0}, - {3,7414,8642,1151,0,0,0,0,0,0,0}, - {3,4130,9064,14537,0,0,0,0,0,0,0}, - {3,14517,1356,3748,0,0,0,0,0,0,0}, - {3,13865,12085,17295,0,0,0,0,0,0,0}, - {3,9530,5110,1570,0,0,0,0,0,0,0}, - {3,10862,8458,15322,0,0,0,0,0,0,0}, - {3,16355,1774,5270,0,0,0,0,0,0,0}, - {3,1229,11587,1632,0,0,0,0,0,0,0}, - {3,17039,787,4703,0,0,0,0,0,0,0}, - {3,11423,15388,6136,0,0,0,0,0,0,0}, - {3,8413,9703,13946,0,0,0,0,0,0,0}, - {3,4678,4072,16702,0,0,0,0,0,0,0}, - {3,6244,4690,7164,0,0,0,0,0,0,0}, - {3,7238,14169,5398,0,0,0,0,0,0,0}, - {3,8679,122,11593,0,0,0,0,0,0,0}, - {3,10954,15802,16427,0,0,0,0,0,0,0}, - {3,9413,6717,16406,0,0,0,0,0,0,0}, - {3,1027,17863,7836,0,0,0,0,0,0,0}, - {3,655,8827,10286,0,0,0,0,0,0,0}, - {3,4124,12599,12482,0,0,0,0,0,0,0}, - {3,12955,3121,15318,0,0,0,0,0,0,0}, - {3,8343,16634,6301,0,0,0,0,0,0,0}, - {3,13568,5056,9920,0,0,0,0,0,0,0}, - {3,1948,10,17395,0,0,0,0,0,0,0}, - {3,8550,131,2151,0,0,0,0,0,0,0}, - {3,15226,15994,13093,0,0,0,0,0,0,0}, - {3,10966,15412,2781,0,0,0,0,0,0,0}, - {3,13425,15831,5346,0,0,0,0,0,0,0}, - {3,2261,1067,6346,0,0,0,0,0,0,0}, - {3,6625,1966,13533,0,0,0,0,0,0,0}, - {3,10575,4483,5761,0,0,0,0,0,0,0}, - {3,14366,2019,14426,0,0,0,0,0,0,0}, - {3,16746,1450,4830,0,0,0,0,0,0,0}, - {3,13109,7358,7942,0,0,0,0,0,0,0}, - {3,15376,7284,14035,0,0,0,0,0,0,0}, - {3,14341,12625,3306,0,0,0,0,0,0,0}, - {3,9375,7529,1537,0,0,0,0,0,0,0}, - {3,13831,13447,4549,0,0,0,0,0,0,0}, - {3,15658,15299,8238,0,0,0,0,0,0,0}, - {3,4005,13264,9766,0,0,0,0,0,0,0}, - {3,4715,6285,15383,0,0,0,0,0,0,0}, - {3,1262,12883,15434,0,0,0,0,0,0,0}, - {3,11123,14975,3434,0,0,0,0,0,0,0}, - {3,5307,1112,16967,0,0,0,0,0,0,0}, - {3,12163,12009,3681,0,0,0,0,0,0,0}, - {3,9174,13153,10344,0,0,0,0,0,0,0}, - {3,13456,13197,9562,0,0,0,0,0,0,0}, - {3,1785,7549,15347,0,0,0,0,0,0,0}, - {3,663,9748,9436,0,0,0,0,0,0,0}, - {3,4961,11903,11574,0,0,0,0,0,0,0}, - {3,16248,6238,666,0,0,0,0,0,0,0}, - {3,11426,13748,14763,0,0,0,0,0,0,0}, - {3,14431,1443,2069,0,0,0,0,0,0,0}, - {3,2376,8154,14978,0,0,0,0,0,0,0}, - {3,13140,1289,9046,0,0,0,0,0,0,0}, - {3,1159,300,3319,0,0,0,0,0,0,0}, - {3,11510,7769,15877,0,0,0,0,0,0,0}, - {3,6430,14946,6856,0,0,0,0,0,0,0}, - {3,8868,15622,12458,0,0,0,0,0,0,0}, - {3,4867,6622,6850,0,0,0,0,0,0,0}, - {3,14721,11241,12760,0,0,0,0,0,0,0}, - {3,14233,9874,17682,0,0,0,0,0,0,0}, - {3,16677,13195,15086,0,0,0,0,0,0,0}, - {3,11155,7067,14160,0,0,0,0,0,0,0}, - {3,12741,14379,8922,0,0,0,0,0,0,0}, - {3,1930,17055,11752,0,0,0,0,0,0,0}, - {3,12361,6523,9568,0,0,0,0,0,0,0}, - {3,12165,5636,16011,0,0,0,0,0,0,0}, - {3,11389,4754,9916,0,0,0,0,0,0,0}, - {3,15903,15542,8301,0,0,0,0,0,0,0}, - {3,12073,4918,9754,0,0,0,0,0,0,0}, - {3,16544,17907,14814,0,0,0,0,0,0,0}, - {3,10839,1401,5107,0,0,0,0,0,0,0}, - {3,12320,1095,8592,0,0,0,0,0,0,0}, - {3,15088,6521,12015,0,0,0,0,0,0,0}, - {3,14802,3901,8920,0,0,0,0,0,0,0}, - {3,17932,2990,1643,0,0,0,0,0,0,0}, - {3,5102,3870,2045,0,0,0,0,0,0,0}, - {3,540,2643,2287,0,0,0,0,0,0,0}, - {3,5844,2482,9471,0,0,0,0,0,0,0}, - {3,10428,637,3629,0,0,0,0,0,0,0}, - {3,8814,7277,2678,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_13_18N[130][11] = { + { 10, 2510, 12817, 11890, 13009, 5343, 1775, 10496, 13302, 13348, 17880 }, + { 10, 6766, 16330, 2412, 7944, 2483, 7602, 12482, 6942, 3070, 9231 }, + { 10, 16410, 1766, 1240, 10046, 12091, 14475, 7003, 202, 7733, 11237 }, + { 10, 15562, 4695, 13931, 17100, 11102, 770, 3848, 4216, 7132, 10929 }, + { 10, 16469, 17153, 8177, 8723, 12861, 15948, 2251, 1500, 11526, 8590 }, + { 10, 14813, 3505, 12654, 1079, 11736, 6290, 2299, 17073, 6330, 5997 }, + { 10, 390, 16492, 13989, 1320, 14600, 7061, 6583, 458, 894, 1596 }, + { 10, 8625, 7644, 1322, 16647, 15763, 10439, 8740, 5529, 2969, 13893 }, + { 10, 13425, 13121, 5344, 8739, 4953, 7654, 17848, 9334, 9533, 2731 }, + { 10, 12506, 10992, 8762, 5395, 6424, 11688, 3193, 17601, 14679, 8204 }, + { 10, 5466, 15487, 1642, 6671, 13557, 4074, 7182, 4436, 12398, 12973 }, + { 10, 1958, 13041, 6579, 15984, 3762, 16633, 6113, 11509, 7227, 28 }, + { 10, 17202, 4813, 14024, 15099, 2648, 4476, 2260, 6507, 9930, 9232 }, + { 10, 14186, 14510, 6818, 7665, 12708, 2645, 16687, 13255, 8239, 15884 }, + { 10, 1751, 7847, 17987, 11410, 3345, 17133, 17655, 5027, 1261, 17191 }, + { 10, 8056, 4264, 13915, 8217, 6118, 8072, 6278, 6835, 5038, 15008 }, + { 10, 13625, 2999, 5336, 11687, 13500, 5723, 13903, 766, 6293, 155 }, + { 10, 12316, 14093, 7372, 16846, 15357, 9865, 17869, 1429, 16681, 202 }, + { 10, 15062, 1123, 6454, 17625, 3213, 39, 1669, 1770, 13636, 16555 }, + { 10, 13053, 7597, 11481, 1336, 3343, 11387, 5463, 17830, 13741, 5976 }, + { 10, 1956, 13509, 1664, 16867, 8168, 13421, 17078, 3285, 17138, 1572 }, + { 10, 16711, 1499, 4805, 13584, 14759, 2844, 13110, 7356, 5850, 8330 }, + { 10, 6521, 8528, 14170, 6681, 16992, 12867, 14326, 15227, 4082, 8595 }, + { 10, 16176, 8184, 8572, 1923, 935, 8900, 13020, 6812, 9778, 3391 }, + { 10, 3946, 4711, 15314, 15108, 15634, 4144, 4372, 9207, 10715, 1291 }, + { 10, 16601, 5864, 10968, 4724, 9235, 6988, 3307, 6515, 7004, 16328 }, + { 10, 16217, 4227, 9735, 15857, 5003, 2532, 4451, 8574, 2149, 6908 }, + { 10, 9506, 8949, 12035, 9701, 3124, 14295, 8567, 13614, 5159, 16746 }, + { 10, 2418, 8669, 10921, 5738, 147, 1004, 2692, 9065, 12877, 7559 }, + { 10, 16706, 8511, 10314, 3118, 1219, 7071, 12376, 538, 2389, 3297 }, + { 3, 12492, 10589, 5791, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13528, 1653, 6618, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10485, 1307, 4102, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 347, 13580, 4039, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 523, 10311, 10540, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4183, 6192, 17159, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11458, 6521, 9632, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11594, 15791, 10384, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11654, 126, 11715, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6265, 34, 5091, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7271, 13900, 7588, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3960, 11297, 1612, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9857, 4695, 16399, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6423, 2197, 15040, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4219, 5979, 13959, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2959, 578, 8404, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4585, 658, 6474, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15900, 11357, 5249, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7414, 8642, 1151, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4130, 9064, 14537, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14517, 1356, 3748, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13865, 12085, 17295, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9530, 5110, 1570, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10862, 8458, 15322, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16355, 1774, 5270, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1229, 11587, 1632, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17039, 787, 4703, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11423, 15388, 6136, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8413, 9703, 13946, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4678, 4072, 16702, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6244, 4690, 7164, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7238, 14169, 5398, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8679, 122, 11593, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10954, 15802, 16427, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9413, 6717, 16406, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1027, 17863, 7836, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 655, 8827, 10286, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4124, 12599, 12482, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12955, 3121, 15318, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8343, 16634, 6301, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13568, 5056, 9920, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1948, 10, 17395, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8550, 131, 2151, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15226, 15994, 13093, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10966, 15412, 2781, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13425, 15831, 5346, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2261, 1067, 6346, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6625, 1966, 13533, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10575, 4483, 5761, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14366, 2019, 14426, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16746, 1450, 4830, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13109, 7358, 7942, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15376, 7284, 14035, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14341, 12625, 3306, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9375, 7529, 1537, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13831, 13447, 4549, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15658, 15299, 8238, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4005, 13264, 9766, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4715, 6285, 15383, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1262, 12883, 15434, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11123, 14975, 3434, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5307, 1112, 16967, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12163, 12009, 3681, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9174, 13153, 10344, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13456, 13197, 9562, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1785, 7549, 15347, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 663, 9748, 9436, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4961, 11903, 11574, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16248, 6238, 666, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11426, 13748, 14763, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14431, 1443, 2069, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2376, 8154, 14978, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13140, 1289, 9046, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1159, 300, 3319, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11510, 7769, 15877, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6430, 14946, 6856, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8868, 15622, 12458, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4867, 6622, 6850, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14721, 11241, 12760, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14233, 9874, 17682, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16677, 13195, 15086, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11155, 7067, 14160, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12741, 14379, 8922, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1930, 17055, 11752, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12361, 6523, 9568, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12165, 5636, 16011, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11389, 4754, 9916, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15903, 15542, 8301, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12073, 4918, 9754, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16544, 17907, 14814, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10839, 1401, 5107, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12320, 1095, 8592, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15088, 6521, 12015, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14802, 3901, 8920, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17932, 2990, 1643, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5102, 3870, 2045, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 540, 2643, 2287, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5844, 2482, 9471, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10428, 637, 3629, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8814, 7277, 2678, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_7_9N[140][13]= - { - {12,13057,12620,2789,3553,6763,8329,3333,7822,10490,13943,4101,2556}, - {12,658,11386,2242,7249,5935,2148,5291,11992,3222,2957,6454,3343}, - {12,93,1205,12706,11406,9017,7834,5358,13700,14295,4152,6287,4249}, - {12,6958,2768,8087,1759,11889,4474,3925,4004,14392,8923,6962,4822}, - {12,6719,5436,1905,10228,5059,4892,12448,26,12891,10607,12210,10424}, - {12,8368,10667,9045,7694,13097,3555,4831,411,8539,6527,12753,11530}, - {12,4960,6647,13969,3556,9997,7898,2134,9931,3749,4305,11242,10410}, - {12,9125,9075,9916,12370,8720,6056,8128,5425,979,3421,5660,9473}, - {12,4348,11979,5985,395,11255,13878,7797,4962,13519,13323,7596,5520}, - {12,2852,8519,3022,9432,3564,9467,8569,12235,11837,5031,4246,2}, - {12,4081,3630,1619,2525,3773,11491,14076,9834,3618,2008,4694,6948}, - {12,7684,9642,5970,1679,13207,12368,262,7401,11471,2861,5620,4754}, - {12,7474,10418,1422,10960,13852,988,13465,6415,86,2432,7595,12239}, - {12,8539,11749,8794,6350,1947,13325,13061,7385,13017,2536,13121,15}, - {12,7944,13831,5126,9938,11758,335,980,9736,12143,5753,4533,10814}, - {12,10706,12618,6949,2684,4107,14388,11372,6321,13832,9190,2838,13860}, - {12,10830,1947,13803,3257,2677,406,8400,10536,12911,3629,251,9784}, - {12,13343,13304,301,801,6456,6351,6155,6763,3812,11337,8446,9306}, - {12,524,5573,503,10544,8990,673,2309,12376,466,11441,960,1557}, - {12,4403,3564,1732,13453,12054,8941,1383,12424,4347,9830,3553,5158}, - {5,2025,4282,4983,13553,10776,0,0,0,0,0,0,0}, - {5,11833,13099,5078,4420,3527,0,0,0,0,0,0,0}, - {5,1544,7474,2780,7749,4153,0,0,0,0,0,0,0}, - {5,11189,520,8463,12230,7712,0,0,0,0,0,0,0}, - {5,10409,13367,2604,2966,9248,0,0,0,0,0,0,0}, - {5,1412,420,3507,9818,7955,0,0,0,0,0,0,0}, - {5,1122,12483,9375,10232,9456,0,0,0,0,0,0,0}, - {5,2799,7033,10404,4495,12059,0,0,0,0,0,0,0}, - {5,2569,5970,6262,2199,8045,0,0,0,0,0,0,0}, - {5,11724,511,12693,12855,9597,0,0,0,0,0,0,0}, - {5,756,12900,13391,13623,10683,0,0,0,0,0,0,0}, - {5,2095,13479,1488,9469,11142,0,0,0,0,0,0,0}, - {5,13849,1356,10776,3530,9866,0,0,0,0,0,0,0}, - {5,13449,14225,2072,12772,9461,0,0,0,0,0,0,0}, - {5,6466,6181,6502,401,7439,0,0,0,0,0,0,0}, - {5,4631,1086,3062,11789,11811,0,0,0,0,0,0,0}, - {5,6788,14007,2270,14132,2764,0,0,0,0,0,0,0}, - {5,4643,10272,11316,2608,8511,0,0,0,0,0,0,0}, - {5,5221,9028,2736,7223,1051,0,0,0,0,0,0,0}, - {5,1974,2737,6739,13904,6156,0,0,0,0,0,0,0}, - {3,5,9082,3915,0,0,0,0,0,0,0,0,0}, - {3,2400,7195,3413,0,0,0,0,0,0,0,0,0}, - {3,606,221,8171,0,0,0,0,0,0,0,0,0}, - {3,4548,1267,5310,0,0,0,0,0,0,0,0,0}, - {3,12795,2160,8305,0,0,0,0,0,0,0,0,0}, - {3,10563,3507,12190,0,0,0,0,0,0,0,0,0}, - {3,6325,2499,9717,0,0,0,0,0,0,0,0,0}, - {3,9251,6046,13308,0,0,0,0,0,0,0,0,0}, - {3,11704,10834,11241,0,0,0,0,0,0,0,0,0}, - {3,4777,3774,11533,0,0,0,0,0,0,0,0,0}, - {3,12487,10365,6852,0,0,0,0,0,0,0,0,0}, - {3,58,2650,2027,0,0,0,0,0,0,0,0,0}, - {3,7248,13704,5573,0,0,0,0,0,0,0,0,0}, - {3,12777,7834,8561,0,0,0,0,0,0,0,0,0}, - {3,7906,8121,7774,0,0,0,0,0,0,0,0,0}, - {3,554,3105,6000,0,0,0,0,0,0,0,0,0}, - {3,11198,3586,10410,0,0,0,0,0,0,0,0,0}, - {3,9002,4094,11297,0,0,0,0,0,0,0,0,0}, - {3,12058,1037,13638,0,0,0,0,0,0,0,0,0}, - {3,1258,12917,11078,0,0,0,0,0,0,0,0,0}, - {3,2430,51,10276,0,0,0,0,0,0,0,0,0}, - {3,7841,9451,10236,0,0,0,0,0,0,0,0,0}, - {3,11045,1058,10352,0,0,0,0,0,0,0,0,0}, - {3,9629,9428,86,0,0,0,0,0,0,0,0,0}, - {3,8146,1255,3802,0,0,0,0,0,0,0,0,0}, - {3,10820,6337,4199,0,0,0,0,0,0,0,0,0}, - {3,9364,7723,1139,0,0,0,0,0,0,0,0,0}, - {3,438,6445,583,0,0,0,0,0,0,0,0,0}, - {3,2683,5358,10730,0,0,0,0,0,0,0,0,0}, - {3,8471,3061,13380,0,0,0,0,0,0,0,0,0}, - {3,3005,2840,4754,0,0,0,0,0,0,0,0,0}, - {3,8210,1814,11502,0,0,0,0,0,0,0,0,0}, - {3,8667,14258,5985,0,0,0,0,0,0,0,0,0}, - {3,8407,13336,10970,0,0,0,0,0,0,0,0,0}, - {3,6363,11715,5053,0,0,0,0,0,0,0,0,0}, - {3,104,13618,13817,0,0,0,0,0,0,0,0,0}, - {3,6562,4087,294,0,0,0,0,0,0,0,0,0}, - {3,1742,10528,4626,0,0,0,0,0,0,0,0,0}, - {3,6607,2692,1587,0,0,0,0,0,0,0,0,0}, - {3,11097,8361,2788,0,0,0,0,0,0,0,0,0}, - {3,13451,3541,823,0,0,0,0,0,0,0,0,0}, - {3,4060,13604,9816,0,0,0,0,0,0,0,0,0}, - {3,157,6106,1062,0,0,0,0,0,0,0,0,0}, - {3,8853,5159,4270,0,0,0,0,0,0,0,0,0}, - {3,9352,13164,2919,0,0,0,0,0,0,0,0,0}, - {3,7526,5174,12501,0,0,0,0,0,0,0,0,0}, - {3,12634,13077,5129,0,0,0,0,0,0,0,0,0}, - {3,5750,1568,6281,0,0,0,0,0,0,0,0,0}, - {3,269,5985,10973,0,0,0,0,0,0,0,0,0}, - {3,8518,9415,1028,0,0,0,0,0,0,0,0,0}, - {3,4722,13275,634,0,0,0,0,0,0,0,0,0}, - {3,12113,7104,7436,0,0,0,0,0,0,0,0,0}, - {3,12787,1032,5936,0,0,0,0,0,0,0,0,0}, - {3,3425,11526,10797,0,0,0,0,0,0,0,0,0}, - {3,784,9208,15,0,0,0,0,0,0,0,0,0}, - {3,11223,12849,4913,0,0,0,0,0,0,0,0,0}, - {3,10635,3553,8852,0,0,0,0,0,0,0,0,0}, - {3,11749,10619,3532,0,0,0,0,0,0,0,0,0}, - {3,4080,9831,9219,0,0,0,0,0,0,0,0,0}, - {3,6560,6049,6111,0,0,0,0,0,0,0,0,0}, - {3,1304,11770,12585,0,0,0,0,0,0,0,0,0}, - {3,13209,8589,11287,0,0,0,0,0,0,0,0,0}, - {3,2887,10699,14307,0,0,0,0,0,0,0,0,0}, - {3,4752,456,4073,0,0,0,0,0,0,0,0,0}, - {3,1175,13156,4894,0,0,0,0,0,0,0,0,0}, - {3,12756,3237,6279,0,0,0,0,0,0,0,0,0}, - {3,10125,7074,2344,0,0,0,0,0,0,0,0,0}, - {3,7533,7103,5226,0,0,0,0,0,0,0,0,0}, - {3,4000,4425,12173,0,0,0,0,0,0,0,0,0}, - {3,10056,5312,1599,0,0,0,0,0,0,0,0,0}, - {3,7445,8696,12533,0,0,0,0,0,0,0,0,0}, - {3,11509,14050,2483,0,0,0,0,0,0,0,0,0}, - {3,12405,2876,5033,0,0,0,0,0,0,0,0,0}, - {3,4512,4955,5627,0,0,0,0,0,0,0,0,0}, - {3,5572,5099,10987,0,0,0,0,0,0,0,0,0}, - {3,10665,404,3082,0,0,0,0,0,0,0,0,0}, - {3,2075,1583,13454,0,0,0,0,0,0,0,0,0}, - {3,5666,7228,524,0,0,0,0,0,0,0,0,0}, - {3,13290,7634,418,0,0,0,0,0,0,0,0,0}, - {3,9006,7368,4181,0,0,0,0,0,0,0,0,0}, - {3,9447,3674,8171,0,0,0,0,0,0,0,0,0}, - {3,9355,10211,9342,0,0,0,0,0,0,0,0,0}, - {3,12572,3681,3322,0,0,0,0,0,0,0,0,0}, - {3,3295,186,7491,0,0,0,0,0,0,0,0,0}, - {3,7926,212,5241,0,0,0,0,0,0,0,0,0}, - {3,5479,1654,8097,0,0,0,0,0,0,0,0,0}, - {3,5078,423,4817,0,0,0,0,0,0,0,0,0}, - {3,1357,12780,3664,0,0,0,0,0,0,0,0,0}, - {3,11900,402,13108,0,0,0,0,0,0,0,0,0}, - {3,299,7166,12008,0,0,0,0,0,0,0,0,0}, - {3,5750,3041,5618,0,0,0,0,0,0,0,0,0}, - {3,8357,1229,8884,0,0,0,0,0,0,0,0,0}, - {3,3713,8791,13375,0,0,0,0,0,0,0,0,0}, - {3,4390,6302,568,0,0,0,0,0,0,0,0,0}, - {3,1009,4440,10003,0,0,0,0,0,0,0,0,0}, - {3,1209,11978,11711,0,0,0,0,0,0,0,0,0}, - {3,1803,9838,13537,0,0,0,0,0,0,0,0,0}, - {3,11318,9750,12421,0,0,0,0,0,0,0,0,0}, - {3,2388,3021,7880,0,0,0,0,0,0,0,0,0}, - {3,7220,1062,6871,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_7_9N[140][13] = { + { 12, 13057, 12620, 2789, 3553, 6763, 8329, 3333, 7822, 10490, 13943, 4101, 2556 }, + { 12, 658, 11386, 2242, 7249, 5935, 2148, 5291, 11992, 3222, 2957, 6454, 3343 }, + { 12, 93, 1205, 12706, 11406, 9017, 7834, 5358, 13700, 14295, 4152, 6287, 4249 }, + { 12, 6958, 2768, 8087, 1759, 11889, 4474, 3925, 4004, 14392, 8923, 6962, 4822 }, + { 12, 6719, 5436, 1905, 10228, 5059, 4892, 12448, 26, 12891, 10607, 12210, 10424 }, + { 12, 8368, 10667, 9045, 7694, 13097, 3555, 4831, 411, 8539, 6527, 12753, 11530 }, + { 12, 4960, 6647, 13969, 3556, 9997, 7898, 2134, 9931, 3749, 4305, 11242, 10410 }, + { 12, 9125, 9075, 9916, 12370, 8720, 6056, 8128, 5425, 979, 3421, 5660, 9473 }, + { 12, 4348, 11979, 5985, 395, 11255, 13878, 7797, 4962, 13519, 13323, 7596, 5520 }, + { 12, 2852, 8519, 3022, 9432, 3564, 9467, 8569, 12235, 11837, 5031, 4246, 2 }, + { 12, 4081, 3630, 1619, 2525, 3773, 11491, 14076, 9834, 3618, 2008, 4694, 6948 }, + { 12, 7684, 9642, 5970, 1679, 13207, 12368, 262, 7401, 11471, 2861, 5620, 4754 }, + { 12, 7474, 10418, 1422, 10960, 13852, 988, 13465, 6415, 86, 2432, 7595, 12239 }, + { 12, 8539, 11749, 8794, 6350, 1947, 13325, 13061, 7385, 13017, 2536, 13121, 15 }, + { 12, 7944, 13831, 5126, 9938, 11758, 335, 980, 9736, 12143, 5753, 4533, 10814 }, + { 12, 10706, 12618, 6949, 2684, 4107, 14388, 11372, 6321, 13832, 9190, 2838, 13860 }, + { 12, 10830, 1947, 13803, 3257, 2677, 406, 8400, 10536, 12911, 3629, 251, 9784 }, + { 12, 13343, 13304, 301, 801, 6456, 6351, 6155, 6763, 3812, 11337, 8446, 9306 }, + { 12, 524, 5573, 503, 10544, 8990, 673, 2309, 12376, 466, 11441, 960, 1557 }, + { 12, 4403, 3564, 1732, 13453, 12054, 8941, 1383, 12424, 4347, 9830, 3553, 5158 }, + { 5, 2025, 4282, 4983, 13553, 10776, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 11833, 13099, 5078, 4420, 3527, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 1544, 7474, 2780, 7749, 4153, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 11189, 520, 8463, 12230, 7712, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 10409, 13367, 2604, 2966, 9248, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 1412, 420, 3507, 9818, 7955, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 1122, 12483, 9375, 10232, 9456, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 2799, 7033, 10404, 4495, 12059, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 2569, 5970, 6262, 2199, 8045, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 11724, 511, 12693, 12855, 9597, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 756, 12900, 13391, 13623, 10683, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 2095, 13479, 1488, 9469, 11142, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 13849, 1356, 10776, 3530, 9866, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 13449, 14225, 2072, 12772, 9461, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 6466, 6181, 6502, 401, 7439, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 4631, 1086, 3062, 11789, 11811, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 6788, 14007, 2270, 14132, 2764, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 4643, 10272, 11316, 2608, 8511, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 5221, 9028, 2736, 7223, 1051, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 1974, 2737, 6739, 13904, 6156, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 9082, 3915, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2400, 7195, 3413, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 606, 221, 8171, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4548, 1267, 5310, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12795, 2160, 8305, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10563, 3507, 12190, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6325, 2499, 9717, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9251, 6046, 13308, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11704, 10834, 11241, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4777, 3774, 11533, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12487, 10365, 6852, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 58, 2650, 2027, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7248, 13704, 5573, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12777, 7834, 8561, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7906, 8121, 7774, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 554, 3105, 6000, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11198, 3586, 10410, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9002, 4094, 11297, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12058, 1037, 13638, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1258, 12917, 11078, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2430, 51, 10276, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7841, 9451, 10236, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11045, 1058, 10352, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9629, 9428, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8146, 1255, 3802, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10820, 6337, 4199, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9364, 7723, 1139, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 438, 6445, 583, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2683, 5358, 10730, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8471, 3061, 13380, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3005, 2840, 4754, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8210, 1814, 11502, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8667, 14258, 5985, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8407, 13336, 10970, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6363, 11715, 5053, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 104, 13618, 13817, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6562, 4087, 294, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1742, 10528, 4626, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6607, 2692, 1587, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11097, 8361, 2788, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13451, 3541, 823, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4060, 13604, 9816, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 157, 6106, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8853, 5159, 4270, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9352, 13164, 2919, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7526, 5174, 12501, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12634, 13077, 5129, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5750, 1568, 6281, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 269, 5985, 10973, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8518, 9415, 1028, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4722, 13275, 634, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12113, 7104, 7436, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12787, 1032, 5936, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3425, 11526, 10797, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 784, 9208, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11223, 12849, 4913, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10635, 3553, 8852, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11749, 10619, 3532, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4080, 9831, 9219, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6560, 6049, 6111, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1304, 11770, 12585, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13209, 8589, 11287, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2887, 10699, 14307, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4752, 456, 4073, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1175, 13156, 4894, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12756, 3237, 6279, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10125, 7074, 2344, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7533, 7103, 5226, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4000, 4425, 12173, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10056, 5312, 1599, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7445, 8696, 12533, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11509, 14050, 2483, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12405, 2876, 5033, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4512, 4955, 5627, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5572, 5099, 10987, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10665, 404, 3082, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2075, 1583, 13454, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5666, 7228, 524, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13290, 7634, 418, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9006, 7368, 4181, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9447, 3674, 8171, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9355, 10211, 9342, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12572, 3681, 3322, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3295, 186, 7491, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7926, 212, 5241, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5479, 1654, 8097, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5078, 423, 4817, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1357, 12780, 3664, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11900, 402, 13108, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 299, 7166, 12008, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5750, 3041, 5618, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8357, 1229, 8884, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3713, 8791, 13375, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4390, 6302, 568, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1009, 4440, 10003, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1209, 11978, 11711, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1803, 9838, 13537, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11318, 9750, 12421, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2388, 3021, 7880, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7220, 1062, 6871, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_90_180N[90][19]= - { - {18,708,1132,2120,3208,3879,8320,11948,14185,15214,16594,17849,19766,23814,26175,27579,28052,31512,32029}, - {18,2720,2753,3716,6133,8020,8305,9429,10337,15503,19905,20127,21963,25624,27221,27907,27945,29833,30270}, - {18,4011,7807,11547,12782,13040,14599,14836,15218,17890,18922,19668,20267,20714,22151,24373,25261,26101,27627}, - {18,136,5341,7661,12779,13392,13922,14151,15054,16544,17232,17478,19895,22814,23820,25014,26346,27575,31803}, - {18,3456,3485,5839,8312,8423,9796,10018,11520,13336,15520,19928,22019,23144,25339,27406,28729,29527,31406}, - {18,1779,3634,3930,4138,5449,5924,6776,7658,8703,11542,13133,15086,16334,21876,23860,24281,28854,29557}, - {18,697,868,1345,6257,7400,8220,9761,11501,15828,16175,16865,17251,19298,21907,24033,24175,24497,30965}, - {18,991,1845,3173,5609,11275,12666,12903,14409,15359,17537,17923,19821,20323,21561,21663,23378,25371,28487}, - {18,446,3096,3604,3688,6864,7296,8128,9957,11568,13204,14502,16280,17655,19695,25953,28006,31006,31160}, - {18,3592,5443,5450,8875,10529,10721,15241,16485,16905,17980,19685,21639,21938,25038,25322,26073,27072,32305}, - {3,2539,11274,18981,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8099,17427,18613,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7872,12547,14776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,17272,31146,31476,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12171,20651,28060,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5845,20532,24021,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2102,9627,12746,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4406,13397,16767,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7707,19199,20221,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10278,11526,13739,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8902,13337,25524,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5385,6939,15968,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1686,2985,18124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,21285,22673,25722,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4833,4895,7657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14073,19518,27540,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2832,27137,32072,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8936,19641,24786,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1696,4408,9480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3941,9228,25043,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1328,7460,25237,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11251,21361,23890,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10450,10762,26795,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1544,19244,22553,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9564,24279,27073,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12214,15608,30892,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6316,29252,30504,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3667,7784,26600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11435,20278,31840,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7211,21620,23899,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,17193,18368,23536,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3750,18865,29121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2088,7648,20893,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12231,28534,28933,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6316,14450,31885,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2672,8770,26920,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,17337,18624,26359,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3098,17939,27134,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1084,24695,31846,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5110,9148,10203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3943,19212,31745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6,6061,29453,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2271,9151,27015,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,386,2747,26182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13129,15456,30698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,126,10222,23935,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11008,17244,19711,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,17752,22103,31308,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11293,20670,23940,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11627,14829,19929,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2163,5918,23666,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,28627,28709,31369,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3161,3209,26227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1597,25322,30792,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2083,15971,16193,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4795,10875,11668,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12984,28077,28863,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1851,9750,30222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2252,8660,8984,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6764,8375,15896,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5074,16399,31725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11507,15519,30828,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3196,7975,17614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,477,11889,17748,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2420,2852,25451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {16,3683,4741,6944,8199,8808,13142,14071,15830,17216,18589,20284,21652,22542,24994,25719,26187,0,0}, - {16,1534,4620,4899,6461,6737,9082,10679,11544,16118,20173,20662,21526,22646,24778,29790,30044,0,0}, - {16,2343,2547,5620,6523,8188,9029,14162,15517,24143,25078,25163,26616,28731,30201,30889,32034,0,0}, - {16,1876,4541,5147,9087,12853,12967,13887,16009,19722,20475,21245,21908,22547,25790,27330,27640,0,0}, - {16,1706,3168,6471,7382,10195,11568,11770,17719,19484,19572,20375,20470,23332,24372,30654,31230,0,0}, - {9,996,3297,3587,4313,12243,12456,17510,20492,29071,0,0,0,0,0,0,0,0,0}, - {9,7114,7312,7937,8379,8580,11514,13657,23774,24569,0,0,0,0,0,0,0,0,0}, - {9,98,600,745,1223,4298,6362,12544,21620,28786,0,0,0,0,0,0,0,0,0}, - {9,2585,4021,10785,11294,20707,25033,25465,26990,30713,0,0,0,0,0,0,0,0,0}, - {9,1895,4346,10404,16998,17073,24131,24891,26056,26444,0,0,0,0,0,0,0,0,0}, - {6,4265,8641,8937,13462,23815,26205,0,0,0,0,0,0,0,0,0,0,0,0}, - {6,1468,2578,3070,6258,8221,10414,0,0,0,0,0,0,0,0,0,0,0,0}, - {6,5186,8832,11589,25697,29629,32022,0,0,0,0,0,0,0,0,0,0,0,0}, - {6,15971,17493,18659,19082,22089,26779,0,0,0,0,0,0,0,0,0,0,0,0}, - {6,1597,1691,10499,13815,18943,27396,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_90_180N[90][19] = { + { 18, + 708, + 1132, + 2120, + 3208, + 3879, + 8320, + 11948, + 14185, + 15214, + 16594, + 17849, + 19766, + 23814, + 26175, + 27579, + 28052, + 31512, + 32029 }, + { 18, + 2720, + 2753, + 3716, + 6133, + 8020, + 8305, + 9429, + 10337, + 15503, + 19905, + 20127, + 21963, + 25624, + 27221, + 27907, + 27945, + 29833, + 30270 }, + { 18, + 4011, + 7807, + 11547, + 12782, + 13040, + 14599, + 14836, + 15218, + 17890, + 18922, + 19668, + 20267, + 20714, + 22151, + 24373, + 25261, + 26101, + 27627 }, + { 18, + 136, + 5341, + 7661, + 12779, + 13392, + 13922, + 14151, + 15054, + 16544, + 17232, + 17478, + 19895, + 22814, + 23820, + 25014, + 26346, + 27575, + 31803 }, + { 18, + 3456, + 3485, + 5839, + 8312, + 8423, + 9796, + 10018, + 11520, + 13336, + 15520, + 19928, + 22019, + 23144, + 25339, + 27406, + 28729, + 29527, + 31406 }, + { 18, + 1779, + 3634, + 3930, + 4138, + 5449, + 5924, + 6776, + 7658, + 8703, + 11542, + 13133, + 15086, + 16334, + 21876, + 23860, + 24281, + 28854, + 29557 }, + { 18, + 697, + 868, + 1345, + 6257, + 7400, + 8220, + 9761, + 11501, + 15828, + 16175, + 16865, + 17251, + 19298, + 21907, + 24033, + 24175, + 24497, + 30965 }, + { 18, + 991, + 1845, + 3173, + 5609, + 11275, + 12666, + 12903, + 14409, + 15359, + 17537, + 17923, + 19821, + 20323, + 21561, + 21663, + 23378, + 25371, + 28487 }, + { 18, + 446, + 3096, + 3604, + 3688, + 6864, + 7296, + 8128, + 9957, + 11568, + 13204, + 14502, + 16280, + 17655, + 19695, + 25953, + 28006, + 31006, + 31160 }, + { 18, + 3592, + 5443, + 5450, + 8875, + 10529, + 10721, + 15241, + 16485, + 16905, + 17980, + 19685, + 21639, + 21938, + 25038, + 25322, + 26073, + 27072, + 32305 }, + { 3, 2539, 11274, 18981, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8099, 17427, 18613, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7872, 12547, 14776, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17272, 31146, 31476, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12171, 20651, 28060, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5845, 20532, 24021, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2102, 9627, 12746, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4406, 13397, 16767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7707, 19199, 20221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10278, 11526, 13739, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8902, 13337, 25524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5385, 6939, 15968, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1686, 2985, 18124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21285, 22673, 25722, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4833, 4895, 7657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14073, 19518, 27540, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2832, 27137, 32072, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8936, 19641, 24786, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1696, 4408, 9480, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3941, 9228, 25043, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1328, 7460, 25237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11251, 21361, 23890, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10450, 10762, 26795, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1544, 19244, 22553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9564, 24279, 27073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12214, 15608, 30892, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6316, 29252, 30504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3667, 7784, 26600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11435, 20278, 31840, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7211, 21620, 23899, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17193, 18368, 23536, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3750, 18865, 29121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2088, 7648, 20893, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12231, 28534, 28933, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6316, 14450, 31885, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2672, 8770, 26920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17337, 18624, 26359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3098, 17939, 27134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1084, 24695, 31846, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5110, 9148, 10203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3943, 19212, 31745, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 6061, 29453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2271, 9151, 27015, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 386, 2747, 26182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13129, 15456, 30698, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 126, 10222, 23935, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11008, 17244, 19711, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17752, 22103, 31308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11293, 20670, 23940, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11627, 14829, 19929, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2163, 5918, 23666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 28627, 28709, 31369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3161, 3209, 26227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1597, 25322, 30792, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2083, 15971, 16193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4795, 10875, 11668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12984, 28077, 28863, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1851, 9750, 30222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2252, 8660, 8984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6764, 8375, 15896, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5074, 16399, 31725, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11507, 15519, 30828, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3196, 7975, 17614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 477, 11889, 17748, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2420, 2852, 25451, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 16, + 3683, + 4741, + 6944, + 8199, + 8808, + 13142, + 14071, + 15830, + 17216, + 18589, + 20284, + 21652, + 22542, + 24994, + 25719, + 26187, + 0, + 0 }, + { 16, + 1534, + 4620, + 4899, + 6461, + 6737, + 9082, + 10679, + 11544, + 16118, + 20173, + 20662, + 21526, + 22646, + 24778, + 29790, + 30044, + 0, + 0 }, + { 16, + 2343, + 2547, + 5620, + 6523, + 8188, + 9029, + 14162, + 15517, + 24143, + 25078, + 25163, + 26616, + 28731, + 30201, + 30889, + 32034, + 0, + 0 }, + { 16, + 1876, + 4541, + 5147, + 9087, + 12853, + 12967, + 13887, + 16009, + 19722, + 20475, + 21245, + 21908, + 22547, + 25790, + 27330, + 27640, + 0, + 0 }, + { 16, + 1706, + 3168, + 6471, + 7382, + 10195, + 11568, + 11770, + 17719, + 19484, + 19572, + 20375, + 20470, + 23332, + 24372, + 30654, + 31230, + 0, + 0 }, + { 9, + 996, + 3297, + 3587, + 4313, + 12243, + 12456, + 17510, + 20492, + 29071, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 9, + 7114, + 7312, + 7937, + 8379, + 8580, + 11514, + 13657, + 23774, + 24569, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 9, 98, 600, 745, 1223, 4298, 6362, 12544, 21620, 28786, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 9, + 2585, + 4021, + 10785, + 11294, + 20707, + 25033, + 25465, + 26990, + 30713, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 9, + 1895, + 4346, + 10404, + 16998, + 17073, + 24131, + 24891, + 26056, + 26444, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 6, 4265, 8641, 8937, 13462, 23815, 26205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 6, 1468, 2578, 3070, 6258, 8221, 10414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 6, 5186, 8832, 11589, 25697, 29629, 32022, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 6, 15971, 17493, 18659, 19082, 22089, 26779, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 6, 1597, 1691, 10499, 13815, 18943, 27396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_96_180N[96][21]= - { - {20,551,1039,1564,1910,3126,4986,5636,5661,7079,9384,9971,10460,11259,14150,14389,14568,14681,21772,27818,28671}, - {20,384,1734,1993,3890,4594,6655,7483,8508,8573,8720,10388,15541,17306,18411,18606,19048,19273,21492,21970,29495}, - {20,1104,2877,10668,11101,12647,13994,14598,15653,17265,18435,18848,18949,19209,19312,19414,19465,24927,26613,28809,28865}, - {20,1185,6439,6519,7790,8609,8826,9934,16363,16596,18088,18757,20318,20446,21123,23938,24235,25120,25469,26036,28043}, - {20,53,3630,4384,4619,7805,8822,12208,13312,14269,16435,17925,18079,18689,19042,21541,22729,26066,27666,28759,30107}, - {20,1926,2549,9816,10544,10980,12468,13026,15658,15670,15975,17200,22364,22775,23343,24289,24956,26230,28040,28348,29718}, - {20,1243,1673,4181,6080,7829,8259,9294,10556,10905,14071,18080,18203,18537,19707,24143,24442,25877,27072,29158,29690}, - {20,1834,2523,5973,6006,8054,8843,10141,11668,12956,13202,18659,21757,24258,24675,24779,25924,26980,27008,29229,29899}, - {20,3790,5716,7345,7381,9081,9679,13629,18038,19858,21248,21348,22251,24410,26790,27643,27955,27996,28271,29638,30198}, - {20,158,545,1178,5181,8585,9927,10721,11361,11640,12552,12579,14641,14928,15609,17388,20551,24516,26834,29850,30201}, - {14,1076,3011,5636,6947,7236,7511,10629,16795,20770,22796,22853,24219,28516,29151,0,0,0,0,0,0}, - {14,678,2553,3403,6515,7079,8767,10228,10791,10832,16113,18718,21328,25762,26925,0,0,0,0,0,0}, - {14,8536,8706,9471,9854,11186,12220,13261,14034,14897,25068,26338,26427,28784,29281,0,0,0,0,0,0}, - {14,2634,3562,11652,13206,15185,17051,19666,21058,23107,23869,24590,25311,25498,28891,0,0,0,0,0,0}, - {14,2440,4164,7040,7591,9321,9796,11026,12204,13478,17852,22183,25257,28756,28813,0,0,0,0,0,0}, - {12,390,2209,3095,4554,5755,12285,12314,14372,14957,15711,22946,27713,0,0,0,0,0,0,0,0}, - {12,207,418,3856,8719,11708,15353,20717,21639,23269,26732,27613,28334,0,0,0,0,0,0,0,0}, - {12,2805,3795,7105,8130,10330,13888,15132,16415,17093,23277,25191,27630,0,0,0,0,0,0,0,0}, - {12,1381,1955,3689,6290,6342,9573,13751,14633,16298,18206,24248,24893,0,0,0,0,0,0,0,0}, - {12,5991,8976,9763,12308,12566,15265,17068,21084,22475,24371,25171,28008,0,0,0,0,0,0,0,0}, - {3,8962,17060,22260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1335,6691,14738,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4118,10315,23113,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4643,10970,28091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1195,3683,26231,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7486,17403,22471,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7328,10110,19764,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4630,13732,28298,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6139,19386,26009,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,19712,20670,27993,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9317,18037,19324,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4422,4510,10290,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1396,22324,28601,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1404,5708,22352,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14783,17214,19359,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7996,20133,20614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6219,17582,24404,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2481,20505,28124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4569,10863,28776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,941,7516,11474,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,24878,27151,28125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9053,10186,28126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1376,19327,26055,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5965,14239,16875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,17434,18098,25044,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5785,14385,22243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,15144,16981,25171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13671,25732,25961,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,95,20461,20558,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4321,19572,26175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3637,17351,18683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,18096,23926,27359,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7914,13217,23098,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9822,11342,26728,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7591,18615,28044,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,112,16897,19127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10087,18516,27292,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2762,3323,21677,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4533,20728,23071,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7164,7180,15097,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2061,6184,20598,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6310,13462,26714,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8189,9345,15315,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3319,17370,24726,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5217,9271,11984,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10245,13623,16621,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5537,22325,22692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1592,19859,25578,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7005,15625,22572,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1474,14387,28592,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,153,4254,20080,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8709,25107,25135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11663,17264,25598,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7135,17226,18698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,109,2603,26360,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,1408,9608,11927,14872,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,4187,10410,27776,30125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,1008,4409,14938,20458,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,3641,12480,20141,22605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,10453,22378,24993,30002,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,19957,24800,25196,29823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,2431,2929,5824,12333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,395,4393,15571,22019,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,15040,24712,28275,28794,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,3735,11988,13828,13949,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,4301,5829,24675,26696,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,6406,8140,9438,17274,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,4272,17638,19278,24961,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,3271,11030,11481,28624,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,3792,5394,7566,17557,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6505,11108,20811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2722,28613,28991,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11472,25911,30170,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2355,13553,25490,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3284,13373,17330,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9046,16513,22243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_96_180N[96][21] = { + { 20, 551, 1039, 1564, 1910, 3126, 4986, 5636, 5661, 7079, 9384, + 9971, 10460, 11259, 14150, 14389, 14568, 14681, 21772, 27818, 28671 }, + { 20, 384, 1734, 1993, 3890, 4594, 6655, 7483, 8508, 8573, 8720, + 10388, 15541, 17306, 18411, 18606, 19048, 19273, 21492, 21970, 29495 }, + { 20, 1104, 2877, 10668, 11101, 12647, 13994, 14598, 15653, 17265, 18435, + 18848, 18949, 19209, 19312, 19414, 19465, 24927, 26613, 28809, 28865 }, + { 20, 1185, 6439, 6519, 7790, 8609, 8826, 9934, 16363, 16596, 18088, + 18757, 20318, 20446, 21123, 23938, 24235, 25120, 25469, 26036, 28043 }, + { 20, 53, 3630, 4384, 4619, 7805, 8822, 12208, 13312, 14269, 16435, + 17925, 18079, 18689, 19042, 21541, 22729, 26066, 27666, 28759, 30107 }, + { 20, 1926, 2549, 9816, 10544, 10980, 12468, 13026, 15658, 15670, 15975, + 17200, 22364, 22775, 23343, 24289, 24956, 26230, 28040, 28348, 29718 }, + { 20, 1243, 1673, 4181, 6080, 7829, 8259, 9294, 10556, 10905, 14071, + 18080, 18203, 18537, 19707, 24143, 24442, 25877, 27072, 29158, 29690 }, + { 20, 1834, 2523, 5973, 6006, 8054, 8843, 10141, 11668, 12956, 13202, + 18659, 21757, 24258, 24675, 24779, 25924, 26980, 27008, 29229, 29899 }, + { 20, 3790, 5716, 7345, 7381, 9081, 9679, 13629, 18038, 19858, 21248, + 21348, 22251, 24410, 26790, 27643, 27955, 27996, 28271, 29638, 30198 }, + { 20, 158, 545, 1178, 5181, 8585, 9927, 10721, 11361, 11640, 12552, + 12579, 14641, 14928, 15609, 17388, 20551, 24516, 26834, 29850, 30201 }, + { 14, 1076, 3011, 5636, 6947, 7236, 7511, 10629, 16795, 20770, 22796, + 22853, 24219, 28516, 29151, 0, 0, 0, 0, 0, 0 }, + { 14, 678, 2553, 3403, 6515, 7079, 8767, 10228, 10791, 10832, 16113, + 18718, 21328, 25762, 26925, 0, 0, 0, 0, 0, 0 }, + { 14, 8536, 8706, 9471, 9854, 11186, 12220, 13261, 14034, 14897, 25068, + 26338, 26427, 28784, 29281, 0, 0, 0, 0, 0, 0 }, + { 14, 2634, 3562, 11652, 13206, 15185, 17051, 19666, 21058, 23107, 23869, + 24590, 25311, 25498, 28891, 0, 0, 0, 0, 0, 0 }, + { 14, 2440, 4164, 7040, 7591, 9321, 9796, 11026, 12204, 13478, 17852, + 22183, 25257, 28756, 28813, 0, 0, 0, 0, 0, 0 }, + { 12, 390, 2209, 3095, 4554, 5755, 12285, 12314, 14372, 14957, 15711, + 22946, 27713, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 12, 207, 418, 3856, 8719, 11708, 15353, 20717, 21639, 23269, 26732, + 27613, 28334, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 12, 2805, 3795, 7105, 8130, 10330, 13888, 15132, 16415, 17093, 23277, + 25191, 27630, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 12, 1381, 1955, 3689, 6290, 6342, 9573, 13751, 14633, 16298, 18206, + 24248, 24893, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 12, 5991, 8976, 9763, 12308, 12566, 15265, 17068, 21084, 22475, 24371, + 25171, 28008, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8962, 17060, 22260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1335, 6691, 14738, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4118, 10315, 23113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4643, 10970, 28091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1195, 3683, 26231, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7486, 17403, 22471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7328, 10110, 19764, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4630, 13732, 28298, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6139, 19386, 26009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19712, 20670, 27993, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9317, 18037, 19324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4422, 4510, 10290, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1396, 22324, 28601, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1404, 5708, 22352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14783, 17214, 19359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7996, 20133, 20614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6219, 17582, 24404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2481, 20505, 28124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4569, 10863, 28776, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 941, 7516, 11474, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24878, 27151, 28125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9053, 10186, 28126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1376, 19327, 26055, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5965, 14239, 16875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17434, 18098, 25044, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5785, 14385, 22243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15144, 16981, 25171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13671, 25732, 25961, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 95, 20461, 20558, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4321, 19572, 26175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3637, 17351, 18683, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18096, 23926, 27359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7914, 13217, 23098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9822, 11342, 26728, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7591, 18615, 28044, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 112, 16897, 19127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10087, 18516, 27292, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2762, 3323, 21677, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4533, 20728, 23071, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7164, 7180, 15097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2061, 6184, 20598, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6310, 13462, 26714, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8189, 9345, 15315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3319, 17370, 24726, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5217, 9271, 11984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10245, 13623, 16621, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5537, 22325, 22692, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1592, 19859, 25578, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7005, 15625, 22572, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1474, 14387, 28592, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 153, 4254, 20080, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8709, 25107, 25135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11663, 17264, 25598, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7135, 17226, 18698, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 109, 2603, 26360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1408, 9608, 11927, 14872, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4187, 10410, 27776, 30125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1008, 4409, 14938, 20458, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3641, 12480, 20141, 22605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 10453, 22378, 24993, 30002, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 19957, 24800, 25196, 29823, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2431, 2929, 5824, 12333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 395, 4393, 15571, 22019, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 15040, 24712, 28275, 28794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3735, 11988, 13828, 13949, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4301, 5829, 24675, 26696, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 6406, 8140, 9438, 17274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4272, 17638, 19278, 24961, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3271, 11030, 11481, 28624, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3792, 5394, 7566, 17557, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6505, 11108, 20811, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2722, 28613, 28991, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11472, 25911, 30170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2355, 13553, 25490, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3284, 13373, 17330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9046, 16513, 22243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_100_180N[100][17]= - { - {16,690,1366,2591,2859,4224,5842,7310,8181,12432,15667,15717,16935,17583,19696,20573,21269}, - {16,2488,2890,6630,6892,11563,12518,15560,16798,18355,18746,19165,19295,21567,23505,23617,23629}, - {16,321,2844,2894,3986,4538,7599,7816,9831,10247,11556,16068,17249,18194,23043,23100,25938}, - {16,2503,2827,4771,5929,6400,7437,8054,10897,11633,14404,16133,17101,24425,24973,25086,25802}, - {16,1462,2099,3910,5131,5352,8832,9495,9624,10796,12906,13903,14724,14946,17708,21034,26612}, - {16,260,523,1427,3435,4517,9494,12594,12688,12726,14163,16537,17424,18424,20321,25101,28269}, - {16,2131,2407,4820,7167,11783,15249,15982,18761,22162,24593,24971,25831,26351,27005,28348,28793}, - {16,2089,5829,6119,7505,7758,8122,9870,12107,16656,17582,19115,23738,27646,27692,27862,28356}, - {16,2714,3288,3337,5013,6210,8080,9348,12919,13458,13621,18015,21024,24044,24761,25610,26317}, - {16,1305,3402,5830,7095,8852,9580,9793,11157,12725,14355,20659,21400,22289,23823,26250,27006}, - {3,12936,15702,23593,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3616,17219,18621,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1234,12759,26749,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,396,3017,18360,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10664,21597,26165,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12986,14553,24818,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,18403,21213,28302,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6515,18331,19413,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,19649,26219,27483,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2538,15793,17528,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7871,9374,20785,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5494,8084,21558,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6691,7770,14306,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3247,7417,18827,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11615,15987,20081,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1527,15272,26042,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10540,15548,23849,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,223,2601,25888,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2395,21465,28501,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,19703,21589,27252,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12832,15726,25300,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3750,10030,16124,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,401,6474,28682,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4424,19876,25563,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,590,12853,14779,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,25185,25539,25920,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6857,23329,25764,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3467,23205,23751,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9278,24364,25033,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14956,19104,22487,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,21856,26163,27130,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2067,17357,22055,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,50,14414,19142,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,306,445,16437,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2260,13892,17608,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8893,12230,16916,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5943,8921,16380,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5079,15385,21951,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5108,6038,8513,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2126,6749,7330,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3814,11941,22949,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2301,15416,26731,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3498,14463,20417,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2062,10434,10746,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,18128,18960,23452,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13080,13129,27193,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,18818,24995,27087,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7198,11948,23135,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,17206,18524,25811,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5202,10030,10076,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8497,23410,23991,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1553,1968,13135,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4426,10786,23259,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,92,7941,23045,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6356,14028,23104,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,18319,20286,22984,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5778,25335,26191,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,662,15922,27478,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2920,9733,18974,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,15337,27509,27519,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8659,25028,27723,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14865,24564,26361,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1383,21234,21770,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10767,25752,25843,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7717,14536,24248,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {15,278,2803,2966,3547,4128,4829,4981,6699,6716,14183,14239,15939,16996,19694,20073,0}, - {15,3022,3087,10039,10174,11403,12146,13689,14934,17765,18121,18936,21818,27202,27532,28192,0}, - {15,817,3888,4102,9441,10165,10941,18131,20028,22305,23832,25225,26228,27208,27245,27390,0}, - {15,6346,7992,9053,11187,12124,16435,16850,21269,21580,22096,23700,24751,26264,27318,27576,0}, - {15,1440,3291,5755,12247,12272,15394,15659,15764,16338,17373,18840,19597,19812,22415,27062,0}, - {10,937,3118,8745,10933,12703,13906,14113,21442,21539,28140,0,0,0,0,0,0}, - {10,247,2465,2918,3189,5886,11451,16862,17458,20908,26608,0,0,0,0,0,0}, - {10,58,10104,11815,14429,16531,19797,24071,26021,28000,28489,0,0,0,0,0,0}, - {10,4367,5710,7855,14203,18071,19336,19880,20166,26774,28554,0,0,0,0,0,0}, - {10,191,1085,4068,7452,11739,15962,17501,19172,24130,28476,0,0,0,0,0,0}, - {8,4961,19716,19964,23479,24004,24340,25537,27930,0,0,0,0,0,0,0,0}, - {8,1688,2235,10464,15112,15134,25143,25910,28689,0,0,0,0,0,0,0,0}, - {8,765,11839,17427,19754,21445,22034,23493,25296,0,0,0,0,0,0,0,0}, - {8,277,7947,9952,12228,12595,16563,19758,21721,0,0,0,0,0,0,0,0}, - {8,1575,2652,5226,8159,16624,25446,26417,26722,0,0,0,0,0,0,0,0}, - {3,10571,17389,22602,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1331,7875,18475,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11738,13853,23914,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9412,11361,26507,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16877,23022,27060,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2627,16649,22369,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9446,14752,28540,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4496,7705,22247,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2439,19741,28550,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6605,12623,26774,0,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_100_180N[100][17] = { + { 16, + 690, + 1366, + 2591, + 2859, + 4224, + 5842, + 7310, + 8181, + 12432, + 15667, + 15717, + 16935, + 17583, + 19696, + 20573, + 21269 }, + { 16, + 2488, + 2890, + 6630, + 6892, + 11563, + 12518, + 15560, + 16798, + 18355, + 18746, + 19165, + 19295, + 21567, + 23505, + 23617, + 23629 }, + { 16, + 321, + 2844, + 2894, + 3986, + 4538, + 7599, + 7816, + 9831, + 10247, + 11556, + 16068, + 17249, + 18194, + 23043, + 23100, + 25938 }, + { 16, + 2503, + 2827, + 4771, + 5929, + 6400, + 7437, + 8054, + 10897, + 11633, + 14404, + 16133, + 17101, + 24425, + 24973, + 25086, + 25802 }, + { 16, + 1462, + 2099, + 3910, + 5131, + 5352, + 8832, + 9495, + 9624, + 10796, + 12906, + 13903, + 14724, + 14946, + 17708, + 21034, + 26612 }, + { 16, + 260, + 523, + 1427, + 3435, + 4517, + 9494, + 12594, + 12688, + 12726, + 14163, + 16537, + 17424, + 18424, + 20321, + 25101, + 28269 }, + { 16, + 2131, + 2407, + 4820, + 7167, + 11783, + 15249, + 15982, + 18761, + 22162, + 24593, + 24971, + 25831, + 26351, + 27005, + 28348, + 28793 }, + { 16, + 2089, + 5829, + 6119, + 7505, + 7758, + 8122, + 9870, + 12107, + 16656, + 17582, + 19115, + 23738, + 27646, + 27692, + 27862, + 28356 }, + { 16, + 2714, + 3288, + 3337, + 5013, + 6210, + 8080, + 9348, + 12919, + 13458, + 13621, + 18015, + 21024, + 24044, + 24761, + 25610, + 26317 }, + { 16, + 1305, + 3402, + 5830, + 7095, + 8852, + 9580, + 9793, + 11157, + 12725, + 14355, + 20659, + 21400, + 22289, + 23823, + 26250, + 27006 }, + { 3, 12936, 15702, 23593, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3616, 17219, 18621, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1234, 12759, 26749, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 396, 3017, 18360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10664, 21597, 26165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12986, 14553, 24818, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18403, 21213, 28302, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6515, 18331, 19413, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19649, 26219, 27483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2538, 15793, 17528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7871, 9374, 20785, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5494, 8084, 21558, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6691, 7770, 14306, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3247, 7417, 18827, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11615, 15987, 20081, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1527, 15272, 26042, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10540, 15548, 23849, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 223, 2601, 25888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2395, 21465, 28501, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19703, 21589, 27252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12832, 15726, 25300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3750, 10030, 16124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 401, 6474, 28682, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4424, 19876, 25563, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 590, 12853, 14779, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 25185, 25539, 25920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6857, 23329, 25764, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3467, 23205, 23751, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9278, 24364, 25033, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14956, 19104, 22487, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21856, 26163, 27130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2067, 17357, 22055, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 50, 14414, 19142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 306, 445, 16437, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2260, 13892, 17608, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8893, 12230, 16916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5943, 8921, 16380, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5079, 15385, 21951, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5108, 6038, 8513, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2126, 6749, 7330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3814, 11941, 22949, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2301, 15416, 26731, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3498, 14463, 20417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2062, 10434, 10746, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18128, 18960, 23452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13080, 13129, 27193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18818, 24995, 27087, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7198, 11948, 23135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17206, 18524, 25811, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5202, 10030, 10076, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8497, 23410, 23991, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1553, 1968, 13135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4426, 10786, 23259, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 92, 7941, 23045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6356, 14028, 23104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18319, 20286, 22984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5778, 25335, 26191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 662, 15922, 27478, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2920, 9733, 18974, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15337, 27509, 27519, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8659, 25028, 27723, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14865, 24564, 26361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1383, 21234, 21770, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10767, 25752, 25843, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7717, 14536, 24248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 15, + 278, + 2803, + 2966, + 3547, + 4128, + 4829, + 4981, + 6699, + 6716, + 14183, + 14239, + 15939, + 16996, + 19694, + 20073, + 0 }, + { 15, + 3022, + 3087, + 10039, + 10174, + 11403, + 12146, + 13689, + 14934, + 17765, + 18121, + 18936, + 21818, + 27202, + 27532, + 28192, + 0 }, + { 15, + 817, + 3888, + 4102, + 9441, + 10165, + 10941, + 18131, + 20028, + 22305, + 23832, + 25225, + 26228, + 27208, + 27245, + 27390, + 0 }, + { 15, + 6346, + 7992, + 9053, + 11187, + 12124, + 16435, + 16850, + 21269, + 21580, + 22096, + 23700, + 24751, + 26264, + 27318, + 27576, + 0 }, + { 15, + 1440, + 3291, + 5755, + 12247, + 12272, + 15394, + 15659, + 15764, + 16338, + 17373, + 18840, + 19597, + 19812, + 22415, + 27062, + 0 }, + { 10, + 937, + 3118, + 8745, + 10933, + 12703, + 13906, + 14113, + 21442, + 21539, + 28140, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 10, + 247, + 2465, + 2918, + 3189, + 5886, + 11451, + 16862, + 17458, + 20908, + 26608, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 10, + 58, + 10104, + 11815, + 14429, + 16531, + 19797, + 24071, + 26021, + 28000, + 28489, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 10, + 4367, + 5710, + 7855, + 14203, + 18071, + 19336, + 19880, + 20166, + 26774, + 28554, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 10, + 191, + 1085, + 4068, + 7452, + 11739, + 15962, + 17501, + 19172, + 24130, + 28476, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 8, 4961, 19716, 19964, 23479, 24004, 24340, 25537, 27930, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 8, 1688, 2235, 10464, 15112, 15134, 25143, 25910, 28689, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 8, 765, 11839, 17427, 19754, 21445, 22034, 23493, 25296, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 8, 277, 7947, 9952, 12228, 12595, 16563, 19758, 21721, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 8, 1575, 2652, 5226, 8159, 16624, 25446, 26417, 26722, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10571, 17389, 22602, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1331, 7875, 18475, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11738, 13853, 23914, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9412, 11361, 26507, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16877, 23022, 27060, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2627, 16649, 22369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9446, 14752, 28540, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4496, 7705, 22247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2439, 19741, 28550, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6605, 12623, 26774, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_104_180N[104][19]= - { - {18,2087,6318,7314,8327,9453,12989,13156,13763,13819,16963,18495,19352,20510,20651,23379,23847,23953,26469}, - {18,2680,5652,6816,7854,10673,11431,12379,14570,17081,19341,20749,21056,22990,23012,24902,25547,26718,27284}, - {18,2142,3940,4724,4791,6617,6800,9349,9380,10073,10147,11750,12900,16044,16156,17769,21600,21669,22554}, - {18,1588,3097,4277,6181,6737,8974,9793,12215,12814,17953,18270,21808,22625,24390,25429,25750,25967,26391}, - {18,561,5825,7106,7166,7475,11844,12905,13559,13978,14176,14437,16070,16587,19792,20187,23754,26070,27232}, - {18,673,1783,4046,4887,5596,8390,9229,12315,14252,14415,14529,17837,20013,20032,22201,22487,24412,25792}, - {18,1261,1910,3767,6244,7050,7367,9230,12972,13229,13472,14287,14494,16776,20523,20738,21591,23622,25206}, - {18,1618,2106,3640,6304,7984,8158,9072,9311,12618,15746,16985,18923,20959,21267,23375,24052,24260,24827}, - {18,6256,6931,7276,7356,7832,12284,12405,13083,13602,14750,19021,20026,22661,23283,24427,25301,25982,27279}, - {18,2432,3076,3399,5305,7370,8406,8826,9237,10537,15492,15606,15619,16515,17562,19550,22525,24389,25740}, - {14,157,296,422,467,7125,9849,9997,15376,15506,16119,17153,17857,18639,23136,0,0,0,0}, - {14,1275,1439,6162,8258,9031,10207,10472,16004,16641,17140,21342,22191,23200,25753,0,0,0,0}, - {14,110,1073,6460,9208,10520,15833,15951,17494,18614,19970,20537,21512,21796,22135,0,0,0,0}, - {14,3771,5399,5885,7905,8302,8614,10205,11133,11459,16044,22701,25170,26255,27086,0,0,0,0}, - {14,1597,2640,2741,3790,5107,7470,9160,12078,12350,14020,18877,19507,22658,24290,0,0,0,0}, - {14,4957,5961,6263,8201,8579,9392,10133,11712,14757,15678,15718,19528,25107,25122,0,0,0,0}, - {14,870,4508,5944,7360,11724,15003,16387,19543,19893,20189,21942,23740,25686,25849,0,0,0,0}, - {14,131,2044,6731,7619,7787,9109,9841,10006,10275,13687,16522,18212,24457,25197,0,0,0,0}, - {14,504,1863,4246,5075,5448,6296,6930,11792,13736,14588,16340,17102,17807,26621,0,0,0,0}, - {14,1137,1168,2366,3818,4311,6806,8583,10850,12198,12357,21357,23243,23568,25003,0,0,0,0}, - {3,2353,11886,22548,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1680,9112,12175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,15126,16642,27030,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5571,5719,19190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6232,13413,19728,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8197,12068,17122,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3220,3476,24534,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1630,4345,23890,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,19815,20676,24443,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12761,14080,15937,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,41,7963,23895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7658,13020,27128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1017,1447,3285,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2268,22921,26255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,261,13889,14175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13925,18777,18987,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,15136,24523,27156,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12008,18484,19299,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4304,9857,15134,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2966,9278,9737,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5469,15449,22259,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11359,14186,20635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16453,21262,23629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5613,7100,11104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3959,14714,18116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7465,13803,24660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3939,7615,9891,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12249,16491,22373,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8734,14253,25616,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5781,18719,23894,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6208,6703,14626,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1284,4730,23920,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3920,13167,13366,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3925,7147,27268,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1926,12777,21092,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,675,8186,22557,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,487,9590,12433,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7090,16031,27037,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3083,10445,22950,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,380,4663,7195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,960,12754,20597,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1790,12476,24250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11307,22121,22266,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3256,7625,12046,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11034,11800,17383,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6142,14781,19944,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2679,11106,22783,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7769,11060,15178,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7384,9851,20205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14813,19271,22600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3085,11637,19934,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6518,7995,19382,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11070,15498,26380,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,248,16291,23824,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4989,19436,26642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {7,5954,16039,16042,20349,21326,24656,25427,0,0,0,0,0,0,0,0,0,0,0}, - {7,2558,6628,9167,16825,19069,20808,22617,0,0,0,0,0,0,0,0,0,0,0}, - {7,317,13859,14069,16104,18835,20040,26633,0,0,0,0,0,0,0,0,0,0,0}, - {7,2866,4153,5875,11698,15287,19719,25808,0,0,0,0,0,0,0,0,0,0,0}, - {7,536,6955,9735,16098,20694,24675,26881,0,0,0,0,0,0,0,0,0,0,0}, - {4,25,7316,9961,21037,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,7823,19458,20404,25186,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,7142,11057,17748,24788,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,11315,12358,21583,21836,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,8995,9326,12826,25981,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,2281,10560,10674,19801,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,5001,6655,26231,26542,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,800,15131,18482,22621,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,9060,12257,24786,25188,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,3462,17201,18960,24462,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,17631,26360,26425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12774,20967,21391,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14701,20696,26807,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5931,13144,14022,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,128,16460,26300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,801,9487,25937,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6153,11296,23054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2749,14434,20049,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1732,7646,20402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3839,11031,26022,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2159,20918,21407,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,285,13785,24234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1977,3899,7972,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4120,19101,23719,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_104_180N[104][19] = { + { 18, + 2087, + 6318, + 7314, + 8327, + 9453, + 12989, + 13156, + 13763, + 13819, + 16963, + 18495, + 19352, + 20510, + 20651, + 23379, + 23847, + 23953, + 26469 }, + { 18, + 2680, + 5652, + 6816, + 7854, + 10673, + 11431, + 12379, + 14570, + 17081, + 19341, + 20749, + 21056, + 22990, + 23012, + 24902, + 25547, + 26718, + 27284 }, + { 18, + 2142, + 3940, + 4724, + 4791, + 6617, + 6800, + 9349, + 9380, + 10073, + 10147, + 11750, + 12900, + 16044, + 16156, + 17769, + 21600, + 21669, + 22554 }, + { 18, + 1588, + 3097, + 4277, + 6181, + 6737, + 8974, + 9793, + 12215, + 12814, + 17953, + 18270, + 21808, + 22625, + 24390, + 25429, + 25750, + 25967, + 26391 }, + { 18, + 561, + 5825, + 7106, + 7166, + 7475, + 11844, + 12905, + 13559, + 13978, + 14176, + 14437, + 16070, + 16587, + 19792, + 20187, + 23754, + 26070, + 27232 }, + { 18, + 673, + 1783, + 4046, + 4887, + 5596, + 8390, + 9229, + 12315, + 14252, + 14415, + 14529, + 17837, + 20013, + 20032, + 22201, + 22487, + 24412, + 25792 }, + { 18, + 1261, + 1910, + 3767, + 6244, + 7050, + 7367, + 9230, + 12972, + 13229, + 13472, + 14287, + 14494, + 16776, + 20523, + 20738, + 21591, + 23622, + 25206 }, + { 18, + 1618, + 2106, + 3640, + 6304, + 7984, + 8158, + 9072, + 9311, + 12618, + 15746, + 16985, + 18923, + 20959, + 21267, + 23375, + 24052, + 24260, + 24827 }, + { 18, + 6256, + 6931, + 7276, + 7356, + 7832, + 12284, + 12405, + 13083, + 13602, + 14750, + 19021, + 20026, + 22661, + 23283, + 24427, + 25301, + 25982, + 27279 }, + { 18, + 2432, + 3076, + 3399, + 5305, + 7370, + 8406, + 8826, + 9237, + 10537, + 15492, + 15606, + 15619, + 16515, + 17562, + 19550, + 22525, + 24389, + 25740 }, + { 14, + 157, + 296, + 422, + 467, + 7125, + 9849, + 9997, + 15376, + 15506, + 16119, + 17153, + 17857, + 18639, + 23136, + 0, + 0, + 0, + 0 }, + { 14, + 1275, + 1439, + 6162, + 8258, + 9031, + 10207, + 10472, + 16004, + 16641, + 17140, + 21342, + 22191, + 23200, + 25753, + 0, + 0, + 0, + 0 }, + { 14, + 110, + 1073, + 6460, + 9208, + 10520, + 15833, + 15951, + 17494, + 18614, + 19970, + 20537, + 21512, + 21796, + 22135, + 0, + 0, + 0, + 0 }, + { 14, + 3771, + 5399, + 5885, + 7905, + 8302, + 8614, + 10205, + 11133, + 11459, + 16044, + 22701, + 25170, + 26255, + 27086, + 0, + 0, + 0, + 0 }, + { 14, + 1597, + 2640, + 2741, + 3790, + 5107, + 7470, + 9160, + 12078, + 12350, + 14020, + 18877, + 19507, + 22658, + 24290, + 0, + 0, + 0, + 0 }, + { 14, + 4957, + 5961, + 6263, + 8201, + 8579, + 9392, + 10133, + 11712, + 14757, + 15678, + 15718, + 19528, + 25107, + 25122, + 0, + 0, + 0, + 0 }, + { 14, + 870, + 4508, + 5944, + 7360, + 11724, + 15003, + 16387, + 19543, + 19893, + 20189, + 21942, + 23740, + 25686, + 25849, + 0, + 0, + 0, + 0 }, + { 14, + 131, + 2044, + 6731, + 7619, + 7787, + 9109, + 9841, + 10006, + 10275, + 13687, + 16522, + 18212, + 24457, + 25197, + 0, + 0, + 0, + 0 }, + { 14, + 504, + 1863, + 4246, + 5075, + 5448, + 6296, + 6930, + 11792, + 13736, + 14588, + 16340, + 17102, + 17807, + 26621, + 0, + 0, + 0, + 0 }, + { 14, + 1137, + 1168, + 2366, + 3818, + 4311, + 6806, + 8583, + 10850, + 12198, + 12357, + 21357, + 23243, + 23568, + 25003, + 0, + 0, + 0, + 0 }, + { 3, 2353, 11886, 22548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1680, 9112, 12175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15126, 16642, 27030, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5571, 5719, 19190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6232, 13413, 19728, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8197, 12068, 17122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3220, 3476, 24534, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1630, 4345, 23890, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19815, 20676, 24443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12761, 14080, 15937, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 41, 7963, 23895, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7658, 13020, 27128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1017, 1447, 3285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2268, 22921, 26255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 261, 13889, 14175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13925, 18777, 18987, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15136, 24523, 27156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12008, 18484, 19299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4304, 9857, 15134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2966, 9278, 9737, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5469, 15449, 22259, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11359, 14186, 20635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16453, 21262, 23629, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5613, 7100, 11104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3959, 14714, 18116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7465, 13803, 24660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3939, 7615, 9891, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12249, 16491, 22373, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8734, 14253, 25616, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5781, 18719, 23894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6208, 6703, 14626, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1284, 4730, 23920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3920, 13167, 13366, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3925, 7147, 27268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1926, 12777, 21092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 675, 8186, 22557, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 487, 9590, 12433, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7090, 16031, 27037, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3083, 10445, 22950, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 380, 4663, 7195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 960, 12754, 20597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1790, 12476, 24250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11307, 22121, 22266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3256, 7625, 12046, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11034, 11800, 17383, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6142, 14781, 19944, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2679, 11106, 22783, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7769, 11060, 15178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7384, 9851, 20205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14813, 19271, 22600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3085, 11637, 19934, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6518, 7995, 19382, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11070, 15498, 26380, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 248, 16291, 23824, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4989, 19436, 26642, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 7, + 5954, + 16039, + 16042, + 20349, + 21326, + 24656, + 25427, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 7, 2558, 6628, 9167, 16825, 19069, 20808, 22617, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 7, 317, 13859, 14069, 16104, 18835, 20040, 26633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 7, 2866, 4153, 5875, 11698, 15287, 19719, 25808, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 7, 536, 6955, 9735, 16098, 20694, 24675, 26881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 25, 7316, 9961, 21037, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 7823, 19458, 20404, 25186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 7142, 11057, 17748, 24788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 11315, 12358, 21583, 21836, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 8995, 9326, 12826, 25981, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2281, 10560, 10674, 19801, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 5001, 6655, 26231, 26542, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 800, 15131, 18482, 22621, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 9060, 12257, 24786, 25188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3462, 17201, 18960, 24462, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17631, 26360, 26425, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12774, 20967, 21391, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14701, 20696, 26807, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5931, 13144, 14022, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 128, 16460, 26300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 801, 9487, 25937, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6153, 11296, 23054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2749, 14434, 20049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1732, 7646, 20402, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3839, 11031, 26022, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2159, 20918, 21407, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 285, 13785, 24234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1977, 3899, 7972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4120, 19101, 23719, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_116_180N[116][19]= - { - {18,3880,4377,6147,6219,7873,8180,9157,10311,10862,15393,16522,17318,17609,18398,19290,19293,20296,22244}, - {18,1056,1647,5119,5201,6991,10038,10843,11614,11901,12026,14631,16749,16772,16915,17331,19235,19877,22763}, - {18,501,2634,2812,3085,3242,4952,5087,8334,8838,8993,12601,12849,13142,13852,14416,14444,15122,20692}, - {18,343,1183,5708,6798,6951,9154,9160,9508,9884,11874,11984,13737,14933,17208,21253,21822,22723,22898}, - {18,3332,4384,5137,8527,8749,10414,10536,12759,14769,16121,19255,19326,20283,20352,20629,20827,21226,22087}, - {18,60,3866,3895,4116,5631,6985,7205,7681,10031,12825,14266,14644,16396,17010,20221,20268,21729,21752}, - {18,61,1112,1392,1826,1910,4370,5910,6660,6943,7859,9628,10213,10701,12615,14453,17123,18667,20688}, - {18,880,2397,2669,7767,9683,9705,10430,13995,15972,16217,17187,18246,18869,21077,21884,21897,21927,22475}, - {18,748,1029,1446,2912,6784,6926,7710,11674,12014,12409,12438,14411,14723,15953,16020,17496,18230,19547}, - {18,1151,2295,2975,3082,6502,8269,9130,9629,10018,10235,14871,15834,17396,17777,19138,21871,22035,22927}, - {12,650,789,4632,4777,5004,8796,13479,14917,16826,16926,19144,20754,0,0,0,0,0,0}, - {12,1693,4906,5777,5907,6472,9792,11824,16134,16406,16440,18395,22338,0,0,0,0,0,0}, - {12,5172,5920,7987,9381,10573,11382,11512,13074,15755,16591,19518,20968,0,0,0,0,0,0}, - {12,1409,2508,6542,8993,10660,13691,14724,15597,19641,20809,21160,22767,0,0,0,0,0,0}, - {12,895,1446,3298,4018,5250,6269,8897,9049,12052,15311,16199,20677,0,0,0,0,0,0}, - {10,1,774,1248,2362,7019,8430,14321,14444,19664,21475,0,0,0,0,0,0,0,0}, - {10,1714,1973,4155,7536,7975,9323,9997,10627,20959,21824,0,0,0,0,0,0,0,0}, - {10,586,1907,2153,5914,7407,8311,8900,10060,18502,18818,0,0,0,0,0,0,0,0}, - {10,805,1897,3019,7404,10055,11779,11982,15319,21802,21913,0,0,0,0,0,0,0,0}, - {10,5276,5470,8725,11080,11939,17057,17960,18930,19814,22546,0,0,0,0,0,0,0,0}, - {3,1227,10140,18999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,849,17266,18364,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4436,6167,14942,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11103,14219,19204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6738,10043,20614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1885,3173,13934,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2088,11344,20627,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2668,6722,20336,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11274,18439,21280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2223,15960,21282,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6555,7521,11051,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9037,11912,22911,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12952,19885,21298,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13696,16793,17228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1040,4501,6170,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1025,4522,21287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1213,3817,12857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1392,6601,12468,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,835,16504,19633,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,634,16014,19619,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6166,17343,21067,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6583,16107,18382,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5481,9653,18543,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14634,15406,16179,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1952,7810,16892,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2271,12635,20456,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8838,10469,20629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11400,16788,18756,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,230,11373,17104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,17204,17733,20707,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8465,13092,22087,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8684,8983,10130,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11468,13469,21366,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9342,10115,19130,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3184,9535,11802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13495,16231,19609,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8911,12617,15190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,508,8674,19422,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4059,6197,8449,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9440,11028,13468,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1779,9358,13459,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,46,7370,15160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12118,17458,21853,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,320,4449,20048,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12300,14502,21803,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9019,19417,22280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1320,6434,7916,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6850,10275,17099,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,301,5637,7309,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8443,13673,16625,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4943,15268,20252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13246,17809,18271,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3230,8329,12330,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1398,7959,18145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,274,10500,12954,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {10,1326,2057,5453,6588,11514,11920,13687,14692,17684,22043,0,0,0,0,0,0,0,0}, - {10,3921,7217,8693,10943,11769,12121,12618,19781,19932,20083,0,0,0,0,0,0,0,0}, - {10,2166,5206,5482,11453,13986,16877,18184,18822,21663,22611,0,0,0,0,0,0,0,0}, - {10,858,11727,13116,14705,15517,16109,17086,18439,19047,20321,0,0,0,0,0,0,0,0}, - {10,216,414,726,2616,6948,7028,8288,12164,21697,22606,0,0,0,0,0,0,0,0}, - {4,7441,14498,15308,17321,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,1455,6627,10112,13652,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,7448,7945,17043,21758,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,2947,7933,11624,14237,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,514,4014,20406,22226,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,4454,9815,11696,13946,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,7787,11797,13113,15796,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,2363,4379,21733,22277,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,8437,16504,16527,21350,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,8932,14444,15680,19635,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1273,11365,15443,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3533,11221,13249,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,687,1927,14403,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3914,4221,8791,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12479,15622,17384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14928,20923,22283,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7729,13750,15716,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,88,12409,19522,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6852,16166,21884,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1204,12049,16487,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11178,11226,15971,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6382,14361,16863,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10195,10247,18188,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1819,5834,8434,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,286,3333,21431,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13950,15188,17771,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10198,14887,16751,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13811,18307,18337,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1210,18076,21869,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5717,8482,11896,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6501,15625,17792,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3965,4494,20272,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1589,9900,14472,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,288,9421,12009,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2177,4626,16605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,710,4696,18127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_116_180N[116][19] = { + { 18, + 3880, + 4377, + 6147, + 6219, + 7873, + 8180, + 9157, + 10311, + 10862, + 15393, + 16522, + 17318, + 17609, + 18398, + 19290, + 19293, + 20296, + 22244 }, + { 18, + 1056, + 1647, + 5119, + 5201, + 6991, + 10038, + 10843, + 11614, + 11901, + 12026, + 14631, + 16749, + 16772, + 16915, + 17331, + 19235, + 19877, + 22763 }, + { 18, + 501, + 2634, + 2812, + 3085, + 3242, + 4952, + 5087, + 8334, + 8838, + 8993, + 12601, + 12849, + 13142, + 13852, + 14416, + 14444, + 15122, + 20692 }, + { 18, + 343, + 1183, + 5708, + 6798, + 6951, + 9154, + 9160, + 9508, + 9884, + 11874, + 11984, + 13737, + 14933, + 17208, + 21253, + 21822, + 22723, + 22898 }, + { 18, + 3332, + 4384, + 5137, + 8527, + 8749, + 10414, + 10536, + 12759, + 14769, + 16121, + 19255, + 19326, + 20283, + 20352, + 20629, + 20827, + 21226, + 22087 }, + { 18, + 60, + 3866, + 3895, + 4116, + 5631, + 6985, + 7205, + 7681, + 10031, + 12825, + 14266, + 14644, + 16396, + 17010, + 20221, + 20268, + 21729, + 21752 }, + { 18, + 61, + 1112, + 1392, + 1826, + 1910, + 4370, + 5910, + 6660, + 6943, + 7859, + 9628, + 10213, + 10701, + 12615, + 14453, + 17123, + 18667, + 20688 }, + { 18, + 880, + 2397, + 2669, + 7767, + 9683, + 9705, + 10430, + 13995, + 15972, + 16217, + 17187, + 18246, + 18869, + 21077, + 21884, + 21897, + 21927, + 22475 }, + { 18, + 748, + 1029, + 1446, + 2912, + 6784, + 6926, + 7710, + 11674, + 12014, + 12409, + 12438, + 14411, + 14723, + 15953, + 16020, + 17496, + 18230, + 19547 }, + { 18, + 1151, + 2295, + 2975, + 3082, + 6502, + 8269, + 9130, + 9629, + 10018, + 10235, + 14871, + 15834, + 17396, + 17777, + 19138, + 21871, + 22035, + 22927 }, + { 12, + 650, + 789, + 4632, + 4777, + 5004, + 8796, + 13479, + 14917, + 16826, + 16926, + 19144, + 20754, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 12, + 1693, + 4906, + 5777, + 5907, + 6472, + 9792, + 11824, + 16134, + 16406, + 16440, + 18395, + 22338, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 12, + 5172, + 5920, + 7987, + 9381, + 10573, + 11382, + 11512, + 13074, + 15755, + 16591, + 19518, + 20968, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 12, + 1409, + 2508, + 6542, + 8993, + 10660, + 13691, + 14724, + 15597, + 19641, + 20809, + 21160, + 22767, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 12, + 895, + 1446, + 3298, + 4018, + 5250, + 6269, + 8897, + 9049, + 12052, + 15311, + 16199, + 20677, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 10, + 1, + 774, + 1248, + 2362, + 7019, + 8430, + 14321, + 14444, + 19664, + 21475, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 10, + 1714, + 1973, + 4155, + 7536, + 7975, + 9323, + 9997, + 10627, + 20959, + 21824, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 10, + 586, + 1907, + 2153, + 5914, + 7407, + 8311, + 8900, + 10060, + 18502, + 18818, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 10, + 805, + 1897, + 3019, + 7404, + 10055, + 11779, + 11982, + 15319, + 21802, + 21913, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 10, + 5276, + 5470, + 8725, + 11080, + 11939, + 17057, + 17960, + 18930, + 19814, + 22546, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 3, 1227, 10140, 18999, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 849, 17266, 18364, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4436, 6167, 14942, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11103, 14219, 19204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6738, 10043, 20614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1885, 3173, 13934, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2088, 11344, 20627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2668, 6722, 20336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11274, 18439, 21280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2223, 15960, 21282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6555, 7521, 11051, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9037, 11912, 22911, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12952, 19885, 21298, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13696, 16793, 17228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1040, 4501, 6170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1025, 4522, 21287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1213, 3817, 12857, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1392, 6601, 12468, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 835, 16504, 19633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 634, 16014, 19619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6166, 17343, 21067, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6583, 16107, 18382, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5481, 9653, 18543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14634, 15406, 16179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1952, 7810, 16892, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2271, 12635, 20456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8838, 10469, 20629, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11400, 16788, 18756, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 230, 11373, 17104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17204, 17733, 20707, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8465, 13092, 22087, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8684, 8983, 10130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11468, 13469, 21366, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9342, 10115, 19130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3184, 9535, 11802, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13495, 16231, 19609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8911, 12617, 15190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 508, 8674, 19422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4059, 6197, 8449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9440, 11028, 13468, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1779, 9358, 13459, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 46, 7370, 15160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12118, 17458, 21853, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 320, 4449, 20048, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12300, 14502, 21803, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9019, 19417, 22280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1320, 6434, 7916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6850, 10275, 17099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 301, 5637, 7309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8443, 13673, 16625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4943, 15268, 20252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13246, 17809, 18271, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3230, 8329, 12330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1398, 7959, 18145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 274, 10500, 12954, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 10, + 1326, + 2057, + 5453, + 6588, + 11514, + 11920, + 13687, + 14692, + 17684, + 22043, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 10, + 3921, + 7217, + 8693, + 10943, + 11769, + 12121, + 12618, + 19781, + 19932, + 20083, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 10, + 2166, + 5206, + 5482, + 11453, + 13986, + 16877, + 18184, + 18822, + 21663, + 22611, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 10, + 858, + 11727, + 13116, + 14705, + 15517, + 16109, + 17086, + 18439, + 19047, + 20321, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 10, + 216, + 414, + 726, + 2616, + 6948, + 7028, + 8288, + 12164, + 21697, + 22606, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }, + { 4, 7441, 14498, 15308, 17321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1455, 6627, 10112, 13652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 7448, 7945, 17043, 21758, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2947, 7933, 11624, 14237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 514, 4014, 20406, 22226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4454, 9815, 11696, 13946, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 7787, 11797, 13113, 15796, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2363, 4379, 21733, 22277, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 8437, 16504, 16527, 21350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 8932, 14444, 15680, 19635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1273, 11365, 15443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3533, 11221, 13249, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 687, 1927, 14403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3914, 4221, 8791, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12479, 15622, 17384, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14928, 20923, 22283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7729, 13750, 15716, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 88, 12409, 19522, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6852, 16166, 21884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1204, 12049, 16487, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11178, 11226, 15971, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6382, 14361, 16863, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10195, 10247, 18188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1819, 5834, 8434, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 286, 3333, 21431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13950, 15188, 17771, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10198, 14887, 16751, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13811, 18307, 18337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1210, 18076, 21869, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5717, 8482, 11896, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6501, 15625, 17792, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3965, 4494, 20272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1589, 9900, 14472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 288, 9421, 12009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2177, 4626, 16605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 710, 4696, 18127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_124_180N[124][17]= - { - {16,1083,2862,3815,4075,5519,8003,9308,10029,12476,12949,13759,13918,14303,15028,19737,19953}, - {16,392,3781,6086,8378,9952,10531,11369,11954,14808,14948,16585,16682,18445,18960,19085,19423}, - {16,3023,3727,4797,5104,5342,5994,8138,9758,10146,11758,14763,15300,15640,17947,18690,18864}, - {16,854,1259,2147,3861,4258,4949,5555,5940,9454,14940,15521,16393,17029,18789,18810,19840}, - {16,4404,6608,7232,7534,7721,8079,8558,9851,11560,11968,12678,13410,15908,16918,18108,18437}, - {16,519,1591,1600,1964,7706,9481,10789,11068,13056,13373,13759,14323,14999,15505,17366,18254}, - {16,545,673,2257,4060,4289,4897,5287,7318,8511,13835,14540,14948,15475,16718,17907,18067}, - {16,1949,3426,3440,4679,5103,8692,8987,10075,10923,11162,11625,12805,13749,17487,17807,18802}, - {16,858,1969,2178,2421,2592,2764,3504,7084,9227,9349,9960,10592,18149,18974,19010,19891}, - {16,3282,5061,5908,6929,7551,7927,8116,8388,11305,11379,12527,13982,14343,15064,16259,19602}, - {3,3730,8198,8789,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1515,6545,9678,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12411,14800,17119,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1000,15382,18607,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,977,1525,5376,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4464,7676,8937,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3684,6730,9836,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10203,10305,18629,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2214,4904,10873,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,690,7077,12623,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3094,11228,16285,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2583,5278,16500,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4253,13495,14465,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3323,17768,19548,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7670,12892,18704,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,373,14868,16337,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8886,17314,17578,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10636,12385,19530,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5734,14030,18619,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3298,4905,10156,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,332,19282,19924,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,15,8741,16429,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11482,14807,15426,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6055,12144,14026,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1095,5737,10525,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,813,965,4520,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,808,8546,14057,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3195,3814,14683,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1184,17287,19477,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12411,13207,18549,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2639,12198,15656,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3527,5555,14387,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5563,10402,19122,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4538,13134,18766,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,731,3368,5865,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1253,2238,8820,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2764,11942,16705,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6375,18789,19594,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3387,11299,14192,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2486,2729,8580,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3096,5778,10416,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2513,10609,14018,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2508,10361,15415,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5368,6612,17415,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1998,5687,17627,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2711,16277,17350,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5213,5820,9217,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5744,17794,19180,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9095,15302,19441,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10031,12094,18856,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,739,6709,11785,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1496,10418,15753,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9437,11589,19552,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7484,9656,12381,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2371,7237,7794,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,748,7213,9835,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1930,6418,8683,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5482,15289,18623,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10791,15731,18781,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3622,5730,14230,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1169,9420,19665,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10170,13288,14142,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3855,7239,18843,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,816,16956,19454,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3179,5689,16584,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {13,4313,6450,8761,11594,13187,14029,14509,14944,16947,17850,18270,18390,19934,0,0,0}, - {13,1680,2214,3859,3994,4276,6984,12261,13869,14696,16303,16467,16756,19754,0,0,0}, - {13,433,1009,3169,6825,7128,7294,7327,8175,16653,16657,17314,18598,19472,0,0,0}, - {13,1473,2110,2777,5217,5902,7136,7797,8650,9116,11267,14270,15342,18291,0,0,0}, - {13,349,2892,4148,7493,10142,13920,14079,14423,15229,16255,16808,18248,18362,0,0,0}, - {13,5879,7078,7457,9493,10771,11010,12068,12994,13007,13109,17983,19531,20087,0,0,0}, - {13,483,804,993,1078,1822,4646,4658,5458,8116,8443,10056,13440,18939,0,0,0}, - {13,490,865,1309,4339,6434,8210,9248,10588,13094,16476,17620,19378,19708,0,0,0}, - {13,163,899,2396,4212,6157,9036,11116,13295,13928,15111,16312,18369,19470,0,0,0}, - {13,985,1298,3213,5145,6917,7136,7183,10870,11329,12295,13466,14989,17909,0,0,0}, - {12,89,582,812,1761,5157,6039,7843,8418,8747,11575,13169,14160,0,0,0,0}, - {12,1871,2701,3252,7399,7646,9785,11274,17041,17361,18899,19430,19691,0,0,0,0}, - {12,1328,2165,2722,4120,4132,9855,10802,14441,16771,17679,18611,18718,0,0,0,0}, - {12,1166,3128,8585,9843,10411,12365,14141,15156,16987,17484,17702,19204,0,0,0,0}, - {12,943,952,4108,4832,6706,9245,14304,16528,17055,17698,18419,19526,0,0,0,0}, - {3,1340,7429,17768,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10358,12400,16483,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1070,4760,10051,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6992,8645,9886,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,756,7962,17532,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13063,17794,18323,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,630,9881,20052,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5786,7779,15441,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5049,5860,16575,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10021,13811,20097,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2167,6374,19993,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1412,4441,11765,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14750,17242,18319,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,507,1756,18791,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2277,6901,9690,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14828,15959,16658,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4687,6452,16770,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,465,11415,13696,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13370,15379,16190,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2988,12683,16796,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6382,14227,14295,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,17221,18167,18379,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9656,9841,10968,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16917,19014,19869,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,15255,15400,17505,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6403,15345,16248,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6794,15772,18005,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3252,12230,12246,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9062,9082,10245,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,405,9373,19195,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5987,6006,6026,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2865,2887,2896,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14889,14898,14924,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7791,7800,7809,0,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_124_180N[124][17] = { + { 16, + 1083, + 2862, + 3815, + 4075, + 5519, + 8003, + 9308, + 10029, + 12476, + 12949, + 13759, + 13918, + 14303, + 15028, + 19737, + 19953 }, + { 16, + 392, + 3781, + 6086, + 8378, + 9952, + 10531, + 11369, + 11954, + 14808, + 14948, + 16585, + 16682, + 18445, + 18960, + 19085, + 19423 }, + { 16, + 3023, + 3727, + 4797, + 5104, + 5342, + 5994, + 8138, + 9758, + 10146, + 11758, + 14763, + 15300, + 15640, + 17947, + 18690, + 18864 }, + { 16, + 854, + 1259, + 2147, + 3861, + 4258, + 4949, + 5555, + 5940, + 9454, + 14940, + 15521, + 16393, + 17029, + 18789, + 18810, + 19840 }, + { 16, + 4404, + 6608, + 7232, + 7534, + 7721, + 8079, + 8558, + 9851, + 11560, + 11968, + 12678, + 13410, + 15908, + 16918, + 18108, + 18437 }, + { 16, + 519, + 1591, + 1600, + 1964, + 7706, + 9481, + 10789, + 11068, + 13056, + 13373, + 13759, + 14323, + 14999, + 15505, + 17366, + 18254 }, + { 16, + 545, + 673, + 2257, + 4060, + 4289, + 4897, + 5287, + 7318, + 8511, + 13835, + 14540, + 14948, + 15475, + 16718, + 17907, + 18067 }, + { 16, + 1949, + 3426, + 3440, + 4679, + 5103, + 8692, + 8987, + 10075, + 10923, + 11162, + 11625, + 12805, + 13749, + 17487, + 17807, + 18802 }, + { 16, + 858, + 1969, + 2178, + 2421, + 2592, + 2764, + 3504, + 7084, + 9227, + 9349, + 9960, + 10592, + 18149, + 18974, + 19010, + 19891 }, + { 16, + 3282, + 5061, + 5908, + 6929, + 7551, + 7927, + 8116, + 8388, + 11305, + 11379, + 12527, + 13982, + 14343, + 15064, + 16259, + 19602 }, + { 3, 3730, 8198, 8789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1515, 6545, 9678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12411, 14800, 17119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1000, 15382, 18607, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 977, 1525, 5376, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4464, 7676, 8937, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3684, 6730, 9836, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10203, 10305, 18629, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2214, 4904, 10873, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 690, 7077, 12623, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3094, 11228, 16285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2583, 5278, 16500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4253, 13495, 14465, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3323, 17768, 19548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7670, 12892, 18704, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 373, 14868, 16337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8886, 17314, 17578, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10636, 12385, 19530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5734, 14030, 18619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3298, 4905, 10156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 332, 19282, 19924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 8741, 16429, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11482, 14807, 15426, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6055, 12144, 14026, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1095, 5737, 10525, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 813, 965, 4520, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 808, 8546, 14057, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3195, 3814, 14683, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1184, 17287, 19477, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12411, 13207, 18549, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2639, 12198, 15656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3527, 5555, 14387, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5563, 10402, 19122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4538, 13134, 18766, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 731, 3368, 5865, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1253, 2238, 8820, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2764, 11942, 16705, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6375, 18789, 19594, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3387, 11299, 14192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2486, 2729, 8580, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3096, 5778, 10416, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2513, 10609, 14018, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2508, 10361, 15415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5368, 6612, 17415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1998, 5687, 17627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2711, 16277, 17350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5213, 5820, 9217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5744, 17794, 19180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9095, 15302, 19441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10031, 12094, 18856, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 739, 6709, 11785, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1496, 10418, 15753, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9437, 11589, 19552, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7484, 9656, 12381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2371, 7237, 7794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 748, 7213, 9835, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1930, 6418, 8683, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5482, 15289, 18623, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10791, 15731, 18781, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3622, 5730, 14230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1169, 9420, 19665, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10170, 13288, 14142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3855, 7239, 18843, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 816, 16956, 19454, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3179, 5689, 16584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 13, + 4313, + 6450, + 8761, + 11594, + 13187, + 14029, + 14509, + 14944, + 16947, + 17850, + 18270, + 18390, + 19934, + 0, + 0, + 0 }, + { 13, + 1680, + 2214, + 3859, + 3994, + 4276, + 6984, + 12261, + 13869, + 14696, + 16303, + 16467, + 16756, + 19754, + 0, + 0, + 0 }, + { 13, + 433, + 1009, + 3169, + 6825, + 7128, + 7294, + 7327, + 8175, + 16653, + 16657, + 17314, + 18598, + 19472, + 0, + 0, + 0 }, + { 13, + 1473, + 2110, + 2777, + 5217, + 5902, + 7136, + 7797, + 8650, + 9116, + 11267, + 14270, + 15342, + 18291, + 0, + 0, + 0 }, + { 13, + 349, + 2892, + 4148, + 7493, + 10142, + 13920, + 14079, + 14423, + 15229, + 16255, + 16808, + 18248, + 18362, + 0, + 0, + 0 }, + { 13, + 5879, + 7078, + 7457, + 9493, + 10771, + 11010, + 12068, + 12994, + 13007, + 13109, + 17983, + 19531, + 20087, + 0, + 0, + 0 }, + { 13, + 483, + 804, + 993, + 1078, + 1822, + 4646, + 4658, + 5458, + 8116, + 8443, + 10056, + 13440, + 18939, + 0, + 0, + 0 }, + { 13, + 490, + 865, + 1309, + 4339, + 6434, + 8210, + 9248, + 10588, + 13094, + 16476, + 17620, + 19378, + 19708, + 0, + 0, + 0 }, + { 13, + 163, + 899, + 2396, + 4212, + 6157, + 9036, + 11116, + 13295, + 13928, + 15111, + 16312, + 18369, + 19470, + 0, + 0, + 0 }, + { 13, + 985, + 1298, + 3213, + 5145, + 6917, + 7136, + 7183, + 10870, + 11329, + 12295, + 13466, + 14989, + 17909, + 0, + 0, + 0 }, + { 12, + 89, + 582, + 812, + 1761, + 5157, + 6039, + 7843, + 8418, + 8747, + 11575, + 13169, + 14160, + 0, + 0, + 0, + 0 }, + { 12, + 1871, + 2701, + 3252, + 7399, + 7646, + 9785, + 11274, + 17041, + 17361, + 18899, + 19430, + 19691, + 0, + 0, + 0, + 0 }, + { 12, + 1328, + 2165, + 2722, + 4120, + 4132, + 9855, + 10802, + 14441, + 16771, + 17679, + 18611, + 18718, + 0, + 0, + 0, + 0 }, + { 12, + 1166, + 3128, + 8585, + 9843, + 10411, + 12365, + 14141, + 15156, + 16987, + 17484, + 17702, + 19204, + 0, + 0, + 0, + 0 }, + { 12, + 943, + 952, + 4108, + 4832, + 6706, + 9245, + 14304, + 16528, + 17055, + 17698, + 18419, + 19526, + 0, + 0, + 0, + 0 }, + { 3, 1340, 7429, 17768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10358, 12400, 16483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1070, 4760, 10051, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6992, 8645, 9886, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 756, 7962, 17532, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13063, 17794, 18323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 630, 9881, 20052, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5786, 7779, 15441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5049, 5860, 16575, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10021, 13811, 20097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2167, 6374, 19993, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1412, 4441, 11765, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14750, 17242, 18319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 507, 1756, 18791, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2277, 6901, 9690, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14828, 15959, 16658, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4687, 6452, 16770, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 465, 11415, 13696, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13370, 15379, 16190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2988, 12683, 16796, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6382, 14227, 14295, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17221, 18167, 18379, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9656, 9841, 10968, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16917, 19014, 19869, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15255, 15400, 17505, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6403, 15345, 16248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6794, 15772, 18005, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3252, 12230, 12246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9062, 9082, 10245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 405, 9373, 19195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5987, 6006, 6026, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2865, 2887, 2896, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14889, 14898, 14924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7791, 7800, 7809, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_128_180N[128][16]= - { - {15,790,1010,1064,2157,2569,3499,4637,4951,6789,8177,9888,10800,13254,13829,17946}, - {15,597,693,862,900,4750,4897,5410,5441,6491,8815,11894,13411,13696,14103,18413}, - {15,903,2779,2996,6100,7489,7560,8637,8853,10078,11372,12040,15911,16944,17059,17771}, - {15,1761,2084,2099,2232,3114,3120,7062,10527,10823,11945,13918,16359,17110,17654,18370}, - {15,677,1080,2329,5100,5106,6261,6383,10953,11968,12186,13266,14451,16092,17760,17871}, - {15,1069,3672,5304,6102,6907,8087,9477,9654,11581,14650,14808,14920,15397,16179,18595}, - {15,327,1161,2624,4494,4516,5555,6928,7455,7959,8734,8933,9753,10614,16263,17689}, - {15,1922,1932,6481,7488,7722,8836,10326,10633,11184,12555,13485,14155,16373,17486,18331}, - {15,1056,1624,1991,3585,6052,7838,10123,11470,14228,15146,16166,16390,17630,17679,17774}, - {15,295,3429,3587,4597,5017,5105,5136,5827,7308,8266,9632,11612,14879,16167,18491}, - {12,1523,1615,3368,6253,8510,9070,10020,10368,10718,11882,12014,15077,0,0,0}, - {12,421,3234,4290,4808,4983,9992,12569,13331,14457,15853,15943,18318,0,0,0}, - {12,583,2081,4320,6268,6284,9084,9638,10941,13335,15062,17310,17667,0,0,0}, - {12,573,5180,5758,5813,9655,9892,10763,11209,11717,14760,14972,16395,0,0,0}, - {12,151,1917,4190,5573,5629,6725,9653,9974,10008,11971,15132,18170,0,0,0}, - {12,132,1270,3074,7215,7878,8266,11875,12274,13134,15084,17120,17556,0,0,0}, - {12,845,2417,2435,5875,7758,7807,12521,13907,16400,17778,18260,18370,0,0,0}, - {12,2848,4714,5924,6507,7595,8422,9281,13140,13276,14589,15269,15943,0,0,0}, - {12,278,931,1186,3588,4072,6943,8429,9348,9863,10056,14376,15846,0,0,0}, - {12,3480,3887,4932,5888,10246,10281,11065,11434,12290,12345,12635,13917,0,0,0}, - {3,528,14523,18426,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4127,5613,9647,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8777,15790,18168,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3491,5608,10216,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5154,8811,16363,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,437,2834,3470,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9675,12773,17150,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2456,7748,8623,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3758,14333,18097,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3969,17136,18610,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6745,13708,18656,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6152,10273,13316,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7822,14888,15541,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,15501,16598,18531,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2497,8828,15453,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3443,6899,7293,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3721,13954,15822,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,719,13335,15342,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1566,7588,8362,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8644,13389,17476,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1513,8257,15942,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2620,7224,15557,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7696,12178,17371,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5285,8439,11367,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4961,7657,17125,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11382,11542,16823,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2429,7538,10992,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,680,7651,10178,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6794,11231,18328,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1195,12837,15710,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1156,17454,18260,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6541,10062,17436,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,70,282,7519,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,608,1919,7299,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3339,11187,15788,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4771,12599,13753,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1822,4233,10561,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5233,14135,15888,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4109,14837,18717,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3011,15644,17342,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10668,11462,15065,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2486,6822,7486,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3851,6182,11215,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,595,11064,15525,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9738,10045,14128,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,929,2222,11949,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10950,12273,15503,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3672,6760,9589,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3583,5887,8907,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13351,15134,17291,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7770,9928,12542,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,268,10496,17937,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1318,2938,6971,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,428,1791,9729,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6895,8896,10420,0,0,0,0,0,0,0,0,0,0,0,0}, - {12,2946,4619,6209,7377,7931,8740,9223,12171,12985,13795,14141,16233,0,0,0}, - {12,217,958,995,3144,5905,6178,6596,10427,15013,15669,16343,18465,0,0,0}, - {12,357,2579,4550,5223,5890,7642,7900,8441,13416,17740,18131,18679,0,0,0}, - {12,894,1776,1852,3262,5830,6008,7877,9570,15838,16029,16176,16583,0,0,0}, - {12,2190,2698,3277,4748,5575,6822,8356,9692,11406,11697,12991,15275,0,0,0}, - {4,9695,12587,15112,17987,0,0,0,0,0,0,0,0,0,0,0}, - {4,5221,5710,15272,17606,0,0,0,0,0,0,0,0,0,0,0}, - {4,3068,9034,11853,17189,0,0,0,0,0,0,0,0,0,0,0}, - {4,2503,7618,9336,15768,0,0,0,0,0,0,0,0,0,0,0}, - {4,2069,2258,7450,10219,0,0,0,0,0,0,0,0,0,0,0}, - {4,778,8645,12173,12429,0,0,0,0,0,0,0,0,0,0,0}, - {4,6960,9073,12411,15065,0,0,0,0,0,0,0,0,0,0,0}, - {4,3515,5848,12776,15706,0,0,0,0,0,0,0,0,0,0,0}, - {4,4725,5967,15682,17350,0,0,0,0,0,0,0,0,0,0,0}, - {4,12416,14871,16503,18679,0,0,0,0,0,0,0,0,0,0,0}, - {3,4218,13329,17613,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,752,6184,9180,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3188,3971,11453,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2580,17414,18001,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10285,13728,15896,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,612,10652,12442,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7637,7724,15724,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1427,15130,15355,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,77,5271,8934,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3121,10373,11930,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11913,12253,15701,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6582,9841,10243,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11595,16319,16332,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6402,11107,14899,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4593,5442,9630,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1321,3877,17467,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1335,10771,12311,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,24,16695,18578,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11396,17644,18618,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7306,14777,15287,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1809,5769,10827,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,137,3555,5186,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,201,3340,10470,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8954,12160,17867,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6744,9179,14780,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3280,9637,17720,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1867,10642,14613,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4292,7451,14924,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1621,13335,16834,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8289,14826,15302,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3610,12151,12159,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3968,3976,5492,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3491,14734,17314,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3774,8427,10437,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3128,4202,15889,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3821,9781,10862,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8264,9191,12337,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1476,8123,8946,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_128_180N[128][16] = { + { 15, + 790, + 1010, + 1064, + 2157, + 2569, + 3499, + 4637, + 4951, + 6789, + 8177, + 9888, + 10800, + 13254, + 13829, + 17946 }, + { 15, + 597, + 693, + 862, + 900, + 4750, + 4897, + 5410, + 5441, + 6491, + 8815, + 11894, + 13411, + 13696, + 14103, + 18413 }, + { 15, + 903, + 2779, + 2996, + 6100, + 7489, + 7560, + 8637, + 8853, + 10078, + 11372, + 12040, + 15911, + 16944, + 17059, + 17771 }, + { 15, + 1761, + 2084, + 2099, + 2232, + 3114, + 3120, + 7062, + 10527, + 10823, + 11945, + 13918, + 16359, + 17110, + 17654, + 18370 }, + { 15, + 677, + 1080, + 2329, + 5100, + 5106, + 6261, + 6383, + 10953, + 11968, + 12186, + 13266, + 14451, + 16092, + 17760, + 17871 }, + { 15, + 1069, + 3672, + 5304, + 6102, + 6907, + 8087, + 9477, + 9654, + 11581, + 14650, + 14808, + 14920, + 15397, + 16179, + 18595 }, + { 15, + 327, + 1161, + 2624, + 4494, + 4516, + 5555, + 6928, + 7455, + 7959, + 8734, + 8933, + 9753, + 10614, + 16263, + 17689 }, + { 15, + 1922, + 1932, + 6481, + 7488, + 7722, + 8836, + 10326, + 10633, + 11184, + 12555, + 13485, + 14155, + 16373, + 17486, + 18331 }, + { 15, + 1056, + 1624, + 1991, + 3585, + 6052, + 7838, + 10123, + 11470, + 14228, + 15146, + 16166, + 16390, + 17630, + 17679, + 17774 }, + { 15, + 295, + 3429, + 3587, + 4597, + 5017, + 5105, + 5136, + 5827, + 7308, + 8266, + 9632, + 11612, + 14879, + 16167, + 18491 }, + { 12, + 1523, + 1615, + 3368, + 6253, + 8510, + 9070, + 10020, + 10368, + 10718, + 11882, + 12014, + 15077, + 0, + 0, + 0 }, + { 12, + 421, + 3234, + 4290, + 4808, + 4983, + 9992, + 12569, + 13331, + 14457, + 15853, + 15943, + 18318, + 0, + 0, + 0 }, + { 12, + 583, + 2081, + 4320, + 6268, + 6284, + 9084, + 9638, + 10941, + 13335, + 15062, + 17310, + 17667, + 0, + 0, + 0 }, + { 12, + 573, + 5180, + 5758, + 5813, + 9655, + 9892, + 10763, + 11209, + 11717, + 14760, + 14972, + 16395, + 0, + 0, + 0 }, + { 12, + 151, + 1917, + 4190, + 5573, + 5629, + 6725, + 9653, + 9974, + 10008, + 11971, + 15132, + 18170, + 0, + 0, + 0 }, + { 12, + 132, + 1270, + 3074, + 7215, + 7878, + 8266, + 11875, + 12274, + 13134, + 15084, + 17120, + 17556, + 0, + 0, + 0 }, + { 12, + 845, + 2417, + 2435, + 5875, + 7758, + 7807, + 12521, + 13907, + 16400, + 17778, + 18260, + 18370, + 0, + 0, + 0 }, + { 12, + 2848, + 4714, + 5924, + 6507, + 7595, + 8422, + 9281, + 13140, + 13276, + 14589, + 15269, + 15943, + 0, + 0, + 0 }, + { 12, + 278, + 931, + 1186, + 3588, + 4072, + 6943, + 8429, + 9348, + 9863, + 10056, + 14376, + 15846, + 0, + 0, + 0 }, + { 12, + 3480, + 3887, + 4932, + 5888, + 10246, + 10281, + 11065, + 11434, + 12290, + 12345, + 12635, + 13917, + 0, + 0, + 0 }, + { 3, 528, 14523, 18426, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4127, 5613, 9647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8777, 15790, 18168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3491, 5608, 10216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5154, 8811, 16363, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 437, 2834, 3470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9675, 12773, 17150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2456, 7748, 8623, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3758, 14333, 18097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3969, 17136, 18610, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6745, 13708, 18656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6152, 10273, 13316, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7822, 14888, 15541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15501, 16598, 18531, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2497, 8828, 15453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3443, 6899, 7293, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3721, 13954, 15822, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 719, 13335, 15342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1566, 7588, 8362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8644, 13389, 17476, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1513, 8257, 15942, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2620, 7224, 15557, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7696, 12178, 17371, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5285, 8439, 11367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4961, 7657, 17125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11382, 11542, 16823, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2429, 7538, 10992, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 680, 7651, 10178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6794, 11231, 18328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1195, 12837, 15710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1156, 17454, 18260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6541, 10062, 17436, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 70, 282, 7519, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 608, 1919, 7299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3339, 11187, 15788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4771, 12599, 13753, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1822, 4233, 10561, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5233, 14135, 15888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4109, 14837, 18717, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3011, 15644, 17342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10668, 11462, 15065, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2486, 6822, 7486, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3851, 6182, 11215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 595, 11064, 15525, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9738, 10045, 14128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 929, 2222, 11949, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10950, 12273, 15503, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3672, 6760, 9589, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3583, 5887, 8907, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13351, 15134, 17291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7770, 9928, 12542, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 268, 10496, 17937, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1318, 2938, 6971, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 428, 1791, 9729, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6895, 8896, 10420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 12, + 2946, + 4619, + 6209, + 7377, + 7931, + 8740, + 9223, + 12171, + 12985, + 13795, + 14141, + 16233, + 0, + 0, + 0 }, + { 12, + 217, + 958, + 995, + 3144, + 5905, + 6178, + 6596, + 10427, + 15013, + 15669, + 16343, + 18465, + 0, + 0, + 0 }, + { 12, + 357, + 2579, + 4550, + 5223, + 5890, + 7642, + 7900, + 8441, + 13416, + 17740, + 18131, + 18679, + 0, + 0, + 0 }, + { 12, + 894, + 1776, + 1852, + 3262, + 5830, + 6008, + 7877, + 9570, + 15838, + 16029, + 16176, + 16583, + 0, + 0, + 0 }, + { 12, + 2190, + 2698, + 3277, + 4748, + 5575, + 6822, + 8356, + 9692, + 11406, + 11697, + 12991, + 15275, + 0, + 0, + 0 }, + { 4, 9695, 12587, 15112, 17987, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 5221, 5710, 15272, 17606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3068, 9034, 11853, 17189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2503, 7618, 9336, 15768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2069, 2258, 7450, 10219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 778, 8645, 12173, 12429, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 6960, 9073, 12411, 15065, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3515, 5848, 12776, 15706, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4725, 5967, 15682, 17350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 12416, 14871, 16503, 18679, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4218, 13329, 17613, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 752, 6184, 9180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3188, 3971, 11453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2580, 17414, 18001, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10285, 13728, 15896, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 612, 10652, 12442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7637, 7724, 15724, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1427, 15130, 15355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 77, 5271, 8934, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3121, 10373, 11930, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11913, 12253, 15701, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6582, 9841, 10243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11595, 16319, 16332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6402, 11107, 14899, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4593, 5442, 9630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1321, 3877, 17467, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1335, 10771, 12311, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 16695, 18578, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11396, 17644, 18618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7306, 14777, 15287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1809, 5769, 10827, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 137, 3555, 5186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 201, 3340, 10470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8954, 12160, 17867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6744, 9179, 14780, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3280, 9637, 17720, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1867, 10642, 14613, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4292, 7451, 14924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1621, 13335, 16834, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8289, 14826, 15302, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3610, 12151, 12159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3968, 3976, 5492, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3491, 14734, 17314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3774, 8427, 10437, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3128, 4202, 15889, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3821, 9781, 10862, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8264, 9191, 12337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1476, 8123, 8946, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_132_180N[132][16]= - { - {15,214,632,923,3251,6036,6570,8258,9462,10399,11781,12778,14807,15369,16105,17153}, - {15,652,1565,3710,3720,4603,7139,7817,9076,11532,13729,14362,15379,15488,15541,15777}, - {15,98,130,520,622,1806,2474,3378,4773,6896,7533,7744,11317,11511,11574,15853}, - {15,95,1168,2985,4995,5032,5310,6932,8571,9181,9193,9896,10257,12336,12811,14754}, - {15,1178,1969,2935,3432,3628,4814,5218,5676,6214,9953,10421,11091,13574,13772,15191}, - {15,2356,7171,8062,8652,8801,9917,10037,10164,10671,10975,13460,15594,15936,16378,16711}, - {15,1401,3622,4493,5190,6908,7193,9583,10283,11832,12152,12609,13343,13427,13839,15591}, - {15,485,4930,7552,7574,7629,8514,10870,10888,11614,11774,12414,13159,15555,16874,16897}, - {15,203,711,1373,5149,7271,8191,8523,9012,9645,11391,13989,14402,15572,16490,16985}, - {15,1020,3606,4996,5016,7632,9959,11098,11792,12649,12859,13381,14579,16204,16899,17030}, - {12,3653,4711,4777,4779,5203,8250,10671,12130,12449,13340,14148,14853,0,0,0}, - {12,3209,4098,4415,4777,5358,6681,8049,9805,10139,15608,15628,16532,0,0,0}, - {12,37,279,2890,3692,5680,7136,10862,11442,13688,14572,14978,16246,0,0,0}, - {12,150,2430,2659,3909,8619,9432,12372,12720,13213,14635,15316,15727,0,0,0}, - {12,759,7725,8548,10772,10897,11392,12273,13619,14465,14488,16191,17039,0,0,0}, - {12,499,2346,4909,4998,6555,10631,12374,13539,13954,14728,14768,16213,0,0,0}, - {12,286,458,1072,1982,3593,4541,5803,7260,7681,10279,15178,15701,0,0,0}, - {12,683,850,1430,4534,4990,9870,10385,10508,12633,13516,14763,15297,0,0,0}, - {12,1304,1620,2788,4431,8333,10080,11887,11994,12430,12578,15816,16317,0,0,0}, - {12,1020,2376,3071,4752,7844,12085,12338,12790,13930,14874,16264,16947,0,0,0}, - {3,2917,14555,16711,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7491,9627,11576,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,863,2959,15686,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3115,3698,4721,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1992,6059,9232,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6038,7185,14573,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1340,3421,3694,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4609,8628,12390,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2208,8716,8858,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13808,15922,16148,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2249,11974,16896,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5853,13225,13788,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,815,4711,6530,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2209,2468,14725,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4410,5415,13854,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6355,6825,15280,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,309,9537,16469,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8068,13746,14396,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9323,10747,15016,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6903,8218,11652,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,680,3121,8534,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7311,10942,15810,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,877,965,6600,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1742,5760,12311,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3137,4854,11102,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2422,7181,7657,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11818,13570,15583,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6318,13695,13717,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3866,5279,6931,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10864,15450,15719,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4540,7389,17179,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4951,15064,16397,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7605,10323,11651,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4137,6356,7204,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5439,10310,14018,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12843,13416,14274,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2804,9644,10370,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11150,13275,14293,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5134,5240,11495,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,864,2151,13541,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,736,13561,17218,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8287,13491,16780,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5718,15660,16593,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8455,13981,15971,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9467,14810,16276,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2229,3946,8111,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7217,7241,12272,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,67,3678,5473,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6684,10779,16599,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9465,12372,16208,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6794,14248,16412,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2214,10815,11926,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3021,6374,12487,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3950,6042,9573,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7939,11686,14299,0,0,0,0,0,0,0,0,0,0,0,0}, - {12,350,3529,4079,4256,5849,7190,8860,10139,10232,10819,11381,14147,0,0,0}, - {12,317,992,2421,3962,4699,6659,7506,10225,10422,10631,12471,17133,0,0,0}, - {12,1042,1396,2353,2995,3377,5431,5872,6507,6958,8392,10521,15036,0,0,0}, - {12,2799,3188,3338,4212,5257,6667,7299,8647,9365,9822,15393,16334,0,0,0}, - {12,1095,1357,1964,2027,3439,5975,7077,10182,11538,12085,14873,15081,0,0,0}, - {4,5063,15980,16044,16895,0,0,0,0,0,0,0,0,0,0,0}, - {4,2675,3343,8369,15958,0,0,0,0,0,0,0,0,0,0,0}, - {4,186,10209,12824,14269,0,0,0,0,0,0,0,0,0,0,0}, - {4,4306,6720,10338,16589,0,0,0,0,0,0,0,0,0,0,0}, - {4,2260,7944,10926,16496,0,0,0,0,0,0,0,0,0,0,0}, - {4,821,2379,3453,11530,0,0,0,0,0,0,0,0,0,0,0}, - {4,818,3049,7651,16046,0,0,0,0,0,0,0,0,0,0,0}, - {4,2127,3717,10120,15916,0,0,0,0,0,0,0,0,0,0,0}, - {4,3267,11412,13437,15833,0,0,0,0,0,0,0,0,0,0,0}, - {4,1386,7706,15875,16377,0,0,0,0,0,0,0,0,0,0,0}, - {3,508,11392,13620,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4097,14269,15322,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9921,12311,12914,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7184,10571,15214,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3917,8952,11193,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1241,11798,14788,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10457,14430,14892,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5603,14302,16388,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,427,2770,6440,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9317,10050,14671,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3199,5089,5353,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7239,7411,13299,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,306,1674,14551,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,816,7484,12448,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,706,13444,15695,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,554,4597,9489,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2104,6359,12468,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9266,10617,11381,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3277,3793,6604,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1731,1887,9707,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,885,5432,7884,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1786,8137,13590,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5024,6886,16155,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2777,7172,8568,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3551,8533,13805,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3299,8732,15678,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,633,9789,14366,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11345,14813,16179,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1216,5414,13845,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5832,7474,10047,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1074,3156,9228,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4090,7614,10391,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2624,5520,13591,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3462,12548,12556,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2027,11569,14106,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1821,3571,8001,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3979,7285,9173,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11161,12334,16935,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2642,8811,8819,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5359,11128,13310,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,200,6362,9809,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1174,8836,13549,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_132_180N[132][16] = { + { 15, + 214, + 632, + 923, + 3251, + 6036, + 6570, + 8258, + 9462, + 10399, + 11781, + 12778, + 14807, + 15369, + 16105, + 17153 }, + { 15, + 652, + 1565, + 3710, + 3720, + 4603, + 7139, + 7817, + 9076, + 11532, + 13729, + 14362, + 15379, + 15488, + 15541, + 15777 }, + { 15, + 98, + 130, + 520, + 622, + 1806, + 2474, + 3378, + 4773, + 6896, + 7533, + 7744, + 11317, + 11511, + 11574, + 15853 }, + { 15, + 95, + 1168, + 2985, + 4995, + 5032, + 5310, + 6932, + 8571, + 9181, + 9193, + 9896, + 10257, + 12336, + 12811, + 14754 }, + { 15, + 1178, + 1969, + 2935, + 3432, + 3628, + 4814, + 5218, + 5676, + 6214, + 9953, + 10421, + 11091, + 13574, + 13772, + 15191 }, + { 15, + 2356, + 7171, + 8062, + 8652, + 8801, + 9917, + 10037, + 10164, + 10671, + 10975, + 13460, + 15594, + 15936, + 16378, + 16711 }, + { 15, + 1401, + 3622, + 4493, + 5190, + 6908, + 7193, + 9583, + 10283, + 11832, + 12152, + 12609, + 13343, + 13427, + 13839, + 15591 }, + { 15, + 485, + 4930, + 7552, + 7574, + 7629, + 8514, + 10870, + 10888, + 11614, + 11774, + 12414, + 13159, + 15555, + 16874, + 16897 }, + { 15, + 203, + 711, + 1373, + 5149, + 7271, + 8191, + 8523, + 9012, + 9645, + 11391, + 13989, + 14402, + 15572, + 16490, + 16985 }, + { 15, + 1020, + 3606, + 4996, + 5016, + 7632, + 9959, + 11098, + 11792, + 12649, + 12859, + 13381, + 14579, + 16204, + 16899, + 17030 }, + { 12, + 3653, + 4711, + 4777, + 4779, + 5203, + 8250, + 10671, + 12130, + 12449, + 13340, + 14148, + 14853, + 0, + 0, + 0 }, + { 12, + 3209, + 4098, + 4415, + 4777, + 5358, + 6681, + 8049, + 9805, + 10139, + 15608, + 15628, + 16532, + 0, + 0, + 0 }, + { 12, + 37, + 279, + 2890, + 3692, + 5680, + 7136, + 10862, + 11442, + 13688, + 14572, + 14978, + 16246, + 0, + 0, + 0 }, + { 12, + 150, + 2430, + 2659, + 3909, + 8619, + 9432, + 12372, + 12720, + 13213, + 14635, + 15316, + 15727, + 0, + 0, + 0 }, + { 12, + 759, + 7725, + 8548, + 10772, + 10897, + 11392, + 12273, + 13619, + 14465, + 14488, + 16191, + 17039, + 0, + 0, + 0 }, + { 12, + 499, + 2346, + 4909, + 4998, + 6555, + 10631, + 12374, + 13539, + 13954, + 14728, + 14768, + 16213, + 0, + 0, + 0 }, + { 12, + 286, + 458, + 1072, + 1982, + 3593, + 4541, + 5803, + 7260, + 7681, + 10279, + 15178, + 15701, + 0, + 0, + 0 }, + { 12, + 683, + 850, + 1430, + 4534, + 4990, + 9870, + 10385, + 10508, + 12633, + 13516, + 14763, + 15297, + 0, + 0, + 0 }, + { 12, + 1304, + 1620, + 2788, + 4431, + 8333, + 10080, + 11887, + 11994, + 12430, + 12578, + 15816, + 16317, + 0, + 0, + 0 }, + { 12, + 1020, + 2376, + 3071, + 4752, + 7844, + 12085, + 12338, + 12790, + 13930, + 14874, + 16264, + 16947, + 0, + 0, + 0 }, + { 3, 2917, 14555, 16711, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7491, 9627, 11576, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 863, 2959, 15686, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3115, 3698, 4721, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1992, 6059, 9232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6038, 7185, 14573, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1340, 3421, 3694, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4609, 8628, 12390, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2208, 8716, 8858, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13808, 15922, 16148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2249, 11974, 16896, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5853, 13225, 13788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 815, 4711, 6530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2209, 2468, 14725, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4410, 5415, 13854, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6355, 6825, 15280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 309, 9537, 16469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8068, 13746, 14396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9323, 10747, 15016, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6903, 8218, 11652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 680, 3121, 8534, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7311, 10942, 15810, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 877, 965, 6600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1742, 5760, 12311, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3137, 4854, 11102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2422, 7181, 7657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11818, 13570, 15583, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6318, 13695, 13717, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3866, 5279, 6931, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10864, 15450, 15719, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4540, 7389, 17179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4951, 15064, 16397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7605, 10323, 11651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4137, 6356, 7204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5439, 10310, 14018, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12843, 13416, 14274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2804, 9644, 10370, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11150, 13275, 14293, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5134, 5240, 11495, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 864, 2151, 13541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 736, 13561, 17218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8287, 13491, 16780, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5718, 15660, 16593, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8455, 13981, 15971, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9467, 14810, 16276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2229, 3946, 8111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7217, 7241, 12272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 67, 3678, 5473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6684, 10779, 16599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9465, 12372, 16208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6794, 14248, 16412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2214, 10815, 11926, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3021, 6374, 12487, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3950, 6042, 9573, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7939, 11686, 14299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 12, + 350, + 3529, + 4079, + 4256, + 5849, + 7190, + 8860, + 10139, + 10232, + 10819, + 11381, + 14147, + 0, + 0, + 0 }, + { 12, + 317, + 992, + 2421, + 3962, + 4699, + 6659, + 7506, + 10225, + 10422, + 10631, + 12471, + 17133, + 0, + 0, + 0 }, + { 12, + 1042, + 1396, + 2353, + 2995, + 3377, + 5431, + 5872, + 6507, + 6958, + 8392, + 10521, + 15036, + 0, + 0, + 0 }, + { 12, + 2799, + 3188, + 3338, + 4212, + 5257, + 6667, + 7299, + 8647, + 9365, + 9822, + 15393, + 16334, + 0, + 0, + 0 }, + { 12, + 1095, + 1357, + 1964, + 2027, + 3439, + 5975, + 7077, + 10182, + 11538, + 12085, + 14873, + 15081, + 0, + 0, + 0 }, + { 4, 5063, 15980, 16044, 16895, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2675, 3343, 8369, 15958, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 186, 10209, 12824, 14269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4306, 6720, 10338, 16589, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2260, 7944, 10926, 16496, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 821, 2379, 3453, 11530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 818, 3049, 7651, 16046, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2127, 3717, 10120, 15916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3267, 11412, 13437, 15833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1386, 7706, 15875, 16377, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 508, 11392, 13620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4097, 14269, 15322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9921, 12311, 12914, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7184, 10571, 15214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3917, 8952, 11193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1241, 11798, 14788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10457, 14430, 14892, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5603, 14302, 16388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 427, 2770, 6440, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9317, 10050, 14671, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3199, 5089, 5353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7239, 7411, 13299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 306, 1674, 14551, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 816, 7484, 12448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 706, 13444, 15695, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 554, 4597, 9489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2104, 6359, 12468, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9266, 10617, 11381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3277, 3793, 6604, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1731, 1887, 9707, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 885, 5432, 7884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1786, 8137, 13590, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5024, 6886, 16155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2777, 7172, 8568, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3551, 8533, 13805, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3299, 8732, 15678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 633, 9789, 14366, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11345, 14813, 16179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1216, 5414, 13845, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5832, 7474, 10047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1074, 3156, 9228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4090, 7614, 10391, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2624, 5520, 13591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3462, 12548, 12556, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2027, 11569, 14106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1821, 3571, 8001, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3979, 7285, 9173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11161, 12334, 16935, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2642, 8811, 8819, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5359, 11128, 13310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 200, 6362, 9809, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1174, 8836, 13549, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_135_180N[135][15]= - { - {14,15,865,1308,2887,6202,6440,7201,9014,10015,10041,11780,13602,14265,15506}, - {14,1054,1416,2903,3746,3753,7608,9121,11097,11761,12334,14304,15284,15489,15860}, - {14,388,942,2207,2627,3453,6684,7105,8633,9292,9413,11574,11789,12990,13558}, - {14,896,1802,2100,4497,6650,7324,7693,11232,11848,12625,12982,13238,13719,15260}, - {14,2165,2313,3930,5231,9263,10942,12167,12938,13529,13806,14792,15118,15304,15970}, - {14,286,951,1083,3401,5527,10235,10417,10717,12204,12522,12974,13623,13645,13721}, - {14,895,2500,3051,4393,4686,5972,7932,8025,8731,9744,10323,10619,14961,16054}, - {14,1631,2304,3149,3453,4133,4459,5442,7051,8622,10051,10791,11566,12754,14016}, - {14,2747,4371,5647,5694,5899,8378,8965,9917,10472,12163,13349,14760,15005,16196}, - {14,1119,3605,4141,4969,6694,7031,7748,8800,9268,9982,10605,11768,12185,12254}, - {11,2825,3983,3991,6410,8249,8457,8770,9183,12028,12213,12448,0,0,0}, - {11,604,1720,2373,2919,7212,7867,7967,8044,10466,13860,14417,0,0,0}, - {11,301,1594,5664,9711,9763,10804,10816,11681,11842,12204,15041,0,0,0}, - {11,47,555,1796,2032,3923,5175,5204,7322,12008,15192,15273,0,0,0}, - {11,2564,2827,4053,4355,5383,6611,7951,10231,10605,12712,15035,0,0,0}, - {11,2243,3129,5665,9703,9913,10101,10212,13549,14952,15661,15696,0,0,0}, - {11,204,775,3771,5704,7007,7095,7543,9656,12426,12882,15545,0,0,0}, - {11,4224,4480,4521,5860,5993,6200,6810,8966,13588,13658,14863,0,0,0}, - {11,528,2425,4261,6534,9097,9746,10277,11570,11722,12614,14288,0,0,0}, - {11,3612,4482,6901,8453,8546,9588,10302,11161,11365,14894,15018,0,0,0}, - {3,3742,10567,16199,0,0,0,0,0,0,0,0,0,0,0}, - {3,7133,9058,11953,0,0,0,0,0,0,0,0,0,0,0}, - {3,6322,6923,15941,0,0,0,0,0,0,0,0,0,0,0}, - {3,8088,9184,10475,0,0,0,0,0,0,0,0,0,0,0}, - {3,677,2998,15174,0,0,0,0,0,0,0,0,0,0,0}, - {3,4761,5594,9851,0,0,0,0,0,0,0,0,0,0,0}, - {3,2307,13609,15098,0,0,0,0,0,0,0,0,0,0,0}, - {3,4022,12283,12286,0,0,0,0,0,0,0,0,0,0,0}, - {3,5993,8346,11208,0,0,0,0,0,0,0,0,0,0,0}, - {3,3910,15175,15351,0,0,0,0,0,0,0,0,0,0,0}, - {3,6964,10422,13372,0,0,0,0,0,0,0,0,0,0,0}, - {3,6125,13835,14292,0,0,0,0,0,0,0,0,0,0,0}, - {3,6234,7466,8536,0,0,0,0,0,0,0,0,0,0,0}, - {3,4785,6567,8576,0,0,0,0,0,0,0,0,0,0,0}, - {3,6743,10561,14130,0,0,0,0,0,0,0,0,0,0,0}, - {3,1735,7324,11459,0,0,0,0,0,0,0,0,0,0,0}, - {3,3414,5686,12861,0,0,0,0,0,0,0,0,0,0,0}, - {3,5457,13085,14942,0,0,0,0,0,0,0,0,0,0,0}, - {3,2789,9707,10189,0,0,0,0,0,0,0,0,0,0,0}, - {3,3474,7428,8655,0,0,0,0,0,0,0,0,0,0,0}, - {3,393,4691,5694,0,0,0,0,0,0,0,0,0,0,0}, - {3,4825,8033,15186,0,0,0,0,0,0,0,0,0,0,0}, - {3,1458,4367,5864,0,0,0,0,0,0,0,0,0,0,0}, - {3,5843,11855,14660,0,0,0,0,0,0,0,0,0,0,0}, - {3,7748,8189,15486,0,0,0,0,0,0,0,0,0,0,0}, - {3,4810,13665,13848,0,0,0,0,0,0,0,0,0,0,0}, - {3,5818,6651,8375,0,0,0,0,0,0,0,0,0,0,0}, - {3,693,5872,7945,0,0,0,0,0,0,0,0,0,0,0}, - {3,172,11594,12687,0,0,0,0,0,0,0,0,0,0,0}, - {3,5430,12616,15658,0,0,0,0,0,0,0,0,0,0,0}, - {3,6934,7909,11246,0,0,0,0,0,0,0,0,0,0,0}, - {3,3637,12306,12362,0,0,0,0,0,0,0,0,0,0,0}, - {3,3471,5213,9689,0,0,0,0,0,0,0,0,0,0,0}, - {3,14049,14507,15642,0,0,0,0,0,0,0,0,0,0,0}, - {3,2668,3016,15757,0,0,0,0,0,0,0,0,0,0,0}, - {3,3740,7546,12925,0,0,0,0,0,0,0,0,0,0,0}, - {3,6446,14217,15795,0,0,0,0,0,0,0,0,0,0,0}, - {3,6834,12517,16183,0,0,0,0,0,0,0,0,0,0,0}, - {3,6930,8193,10296,0,0,0,0,0,0,0,0,0,0,0}, - {3,4279,5463,11460,0,0,0,0,0,0,0,0,0,0,0}, - {3,197,1031,3531,0,0,0,0,0,0,0,0,0,0,0}, - {3,9722,9899,11678,0,0,0,0,0,0,0,0,0,0,0}, - {3,2962,7375,15462,0,0,0,0,0,0,0,0,0,0,0}, - {3,181,2986,13487,0,0,0,0,0,0,0,0,0,0,0}, - {3,908,3631,15042,0,0,0,0,0,0,0,0,0,0,0}, - {3,3273,8070,10865,0,0,0,0,0,0,0,0,0,0,0}, - {3,4099,6682,15571,0,0,0,0,0,0,0,0,0,0,0}, - {3,2864,6393,12639,0,0,0,0,0,0,0,0,0,0,0}, - {3,6486,7891,14560,0,0,0,0,0,0,0,0,0,0,0}, - {3,10819,11213,13405,0,0,0,0,0,0,0,0,0,0,0}, - {3,71,6734,8450,0,0,0,0,0,0,0,0,0,0,0}, - {3,3467,5016,15956,0,0,0,0,0,0,0,0,0,0,0}, - {3,6267,10180,15388,0,0,0,0,0,0,0,0,0,0,0}, - {3,1625,2994,13339,0,0,0,0,0,0,0,0,0,0,0}, - {3,2517,4489,7357,0,0,0,0,0,0,0,0,0,0,0}, - {11,27,454,1440,1874,2627,6126,8518,9120,10144,13007,13892,0,0,0}, - {11,439,991,5000,5256,7215,8109,8680,10694,12078,13454,15221,0,0,0}, - {11,1162,4754,5101,5940,8304,10907,11008,11528,13514,13837,15230,0,0,0}, - {11,1230,1618,2547,2922,5619,7415,12126,12406,14378,15306,15408,0,0,0}, - {11,140,446,3378,3908,6904,7783,8587,10420,10630,12602,13597,0,0,0}, - {4,1004,3374,7234,9291,0,0,0,0,0,0,0,0,0,0}, - {4,8358,8550,8658,11681,0,0,0,0,0,0,0,0,0,0}, - {4,3669,7500,8610,10360,0,0,0,0,0,0,0,0,0,0}, - {4,4892,9971,11846,13233,0,0,0,0,0,0,0,0,0,0}, - {4,329,1735,2397,13639,0,0,0,0,0,0,0,0,0,0}, - {4,12658,12789,14985,15091,0,0,0,0,0,0,0,0,0,0}, - {4,8580,8769,9451,15185,0,0,0,0,0,0,0,0,0,0}, - {4,2383,3542,4270,8840,0,0,0,0,0,0,0,0,0,0}, - {4,1379,2256,2452,15454,0,0,0,0,0,0,0,0,0,0}, - {4,1457,6459,7332,12968,0,0,0,0,0,0,0,0,0,0}, - {3,5323,7398,14302,0,0,0,0,0,0,0,0,0,0,0}, - {3,6056,9938,10618,0,0,0,0,0,0,0,0,0,0,0}, - {3,104,6041,12225,0,0,0,0,0,0,0,0,0,0,0}, - {3,4895,14004,14522,0,0,0,0,0,0,0,0,0,0,0}, - {3,1942,6495,6826,0,0,0,0,0,0,0,0,0,0,0}, - {3,8262,15584,16179,0,0,0,0,0,0,0,0,0,0,0}, - {3,11604,12644,12874,0,0,0,0,0,0,0,0,0,0,0}, - {3,3538,9506,15206,0,0,0,0,0,0,0,0,0,0,0}, - {3,666,6038,8853,0,0,0,0,0,0,0,0,0,0,0}, - {3,5941,8753,12449,0,0,0,0,0,0,0,0,0,0,0}, - {3,6500,8604,16045,0,0,0,0,0,0,0,0,0,0,0}, - {3,7937,12018,12966,0,0,0,0,0,0,0,0,0,0,0}, - {3,8164,14164,14528,0,0,0,0,0,0,0,0,0,0,0}, - {3,867,6180,10192,0,0,0,0,0,0,0,0,0,0,0}, - {3,3403,5208,10213,0,0,0,0,0,0,0,0,0,0,0}, - {3,1752,7835,11867,0,0,0,0,0,0,0,0,0,0,0}, - {3,1576,6993,11260,0,0,0,0,0,0,0,0,0,0,0}, - {3,2245,8237,14506,0,0,0,0,0,0,0,0,0,0,0}, - {3,1284,1807,5480,0,0,0,0,0,0,0,0,0,0,0}, - {3,9778,10034,13115,0,0,0,0,0,0,0,0,0,0,0}, - {3,8398,13975,15705,0,0,0,0,0,0,0,0,0,0,0}, - {3,6906,7770,8242,0,0,0,0,0,0,0,0,0,0,0}, - {3,1896,3277,10631,0,0,0,0,0,0,0,0,0,0,0}, - {3,2168,6889,8036,0,0,0,0,0,0,0,0,0,0,0}, - {3,1616,6908,11754,0,0,0,0,0,0,0,0,0,0,0}, - {3,11353,13863,14389,0,0,0,0,0,0,0,0,0,0,0}, - {3,2514,7212,12887,0,0,0,0,0,0,0,0,0,0,0}, - {3,5661,6511,10622,0,0,0,0,0,0,0,0,0,0,0}, - {3,4690,8892,10754,0,0,0,0,0,0,0,0,0,0,0}, - {3,12200,12486,14850,0,0,0,0,0,0,0,0,0,0,0}, - {3,4663,15405,15949,0,0,0,0,0,0,0,0,0,0,0}, - {3,302,309,1904,0,0,0,0,0,0,0,0,0,0,0}, - {3,5265,7100,7105,0,0,0,0,0,0,0,0,0,0,0}, - {3,4996,7928,11084,0,0,0,0,0,0,0,0,0,0,0}, - {3,5425,10367,15826,0,0,0,0,0,0,0,0,0,0,0}, - {3,6766,8245,11914,0,0,0,0,0,0,0,0,0,0,0}, - {3,8091,13882,13887,0,0,0,0,0,0,0,0,0,0,0}, - {3,1308,1348,7944,0,0,0,0,0,0,0,0,0,0,0}, - {3,4730,10272,14249,0,0,0,0,0,0,0,0,0,0,0}, - {3,5001,5838,11633,0,0,0,0,0,0,0,0,0,0,0}, - {3,3687,4732,15948,0,0,0,0,0,0,0,0,0,0,0}, - {3,285,5437,10939,0,0,0,0,0,0,0,0,0,0,0}, - {3,7254,10928,11235,0,0,0,0,0,0,0,0,0,0,0}, - {3,2038,6236,14036,0,0,0,0,0,0,0,0,0,0,0}, - {3,9407,12341,16040,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_135_180N[135][15] = { + { 14, + 15, + 865, + 1308, + 2887, + 6202, + 6440, + 7201, + 9014, + 10015, + 10041, + 11780, + 13602, + 14265, + 15506 }, + { 14, + 1054, + 1416, + 2903, + 3746, + 3753, + 7608, + 9121, + 11097, + 11761, + 12334, + 14304, + 15284, + 15489, + 15860 }, + { 14, + 388, + 942, + 2207, + 2627, + 3453, + 6684, + 7105, + 8633, + 9292, + 9413, + 11574, + 11789, + 12990, + 13558 }, + { 14, + 896, + 1802, + 2100, + 4497, + 6650, + 7324, + 7693, + 11232, + 11848, + 12625, + 12982, + 13238, + 13719, + 15260 }, + { 14, + 2165, + 2313, + 3930, + 5231, + 9263, + 10942, + 12167, + 12938, + 13529, + 13806, + 14792, + 15118, + 15304, + 15970 }, + { 14, + 286, + 951, + 1083, + 3401, + 5527, + 10235, + 10417, + 10717, + 12204, + 12522, + 12974, + 13623, + 13645, + 13721 }, + { 14, + 895, + 2500, + 3051, + 4393, + 4686, + 5972, + 7932, + 8025, + 8731, + 9744, + 10323, + 10619, + 14961, + 16054 }, + { 14, + 1631, + 2304, + 3149, + 3453, + 4133, + 4459, + 5442, + 7051, + 8622, + 10051, + 10791, + 11566, + 12754, + 14016 }, + { 14, + 2747, + 4371, + 5647, + 5694, + 5899, + 8378, + 8965, + 9917, + 10472, + 12163, + 13349, + 14760, + 15005, + 16196 }, + { 14, + 1119, + 3605, + 4141, + 4969, + 6694, + 7031, + 7748, + 8800, + 9268, + 9982, + 10605, + 11768, + 12185, + 12254 }, + { 11, 2825, 3983, 3991, 6410, 8249, 8457, 8770, 9183, 12028, 12213, 12448, 0, 0, 0 }, + { 11, 604, 1720, 2373, 2919, 7212, 7867, 7967, 8044, 10466, 13860, 14417, 0, 0, 0 }, + { 11, + 301, + 1594, + 5664, + 9711, + 9763, + 10804, + 10816, + 11681, + 11842, + 12204, + 15041, + 0, + 0, + 0 }, + { 11, 47, 555, 1796, 2032, 3923, 5175, 5204, 7322, 12008, 15192, 15273, 0, 0, 0 }, + { 11, 2564, 2827, 4053, 4355, 5383, 6611, 7951, 10231, 10605, 12712, 15035, 0, 0, 0 }, + { 11, + 2243, + 3129, + 5665, + 9703, + 9913, + 10101, + 10212, + 13549, + 14952, + 15661, + 15696, + 0, + 0, + 0 }, + { 11, 204, 775, 3771, 5704, 7007, 7095, 7543, 9656, 12426, 12882, 15545, 0, 0, 0 }, + { 11, 4224, 4480, 4521, 5860, 5993, 6200, 6810, 8966, 13588, 13658, 14863, 0, 0, 0 }, + { 11, 528, 2425, 4261, 6534, 9097, 9746, 10277, 11570, 11722, 12614, 14288, 0, 0, 0 }, + { 11, + 3612, + 4482, + 6901, + 8453, + 8546, + 9588, + 10302, + 11161, + 11365, + 14894, + 15018, + 0, + 0, + 0 }, + { 3, 3742, 10567, 16199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7133, 9058, 11953, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6322, 6923, 15941, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8088, 9184, 10475, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 677, 2998, 15174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4761, 5594, 9851, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2307, 13609, 15098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4022, 12283, 12286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5993, 8346, 11208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3910, 15175, 15351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6964, 10422, 13372, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6125, 13835, 14292, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6234, 7466, 8536, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4785, 6567, 8576, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6743, 10561, 14130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1735, 7324, 11459, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3414, 5686, 12861, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5457, 13085, 14942, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2789, 9707, 10189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3474, 7428, 8655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 393, 4691, 5694, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4825, 8033, 15186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1458, 4367, 5864, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5843, 11855, 14660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7748, 8189, 15486, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4810, 13665, 13848, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5818, 6651, 8375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 693, 5872, 7945, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 172, 11594, 12687, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5430, 12616, 15658, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6934, 7909, 11246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3637, 12306, 12362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3471, 5213, 9689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14049, 14507, 15642, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2668, 3016, 15757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3740, 7546, 12925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6446, 14217, 15795, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6834, 12517, 16183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6930, 8193, 10296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4279, 5463, 11460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 197, 1031, 3531, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9722, 9899, 11678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2962, 7375, 15462, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 181, 2986, 13487, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 908, 3631, 15042, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3273, 8070, 10865, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4099, 6682, 15571, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2864, 6393, 12639, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6486, 7891, 14560, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10819, 11213, 13405, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 71, 6734, 8450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3467, 5016, 15956, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6267, 10180, 15388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1625, 2994, 13339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2517, 4489, 7357, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 11, 27, 454, 1440, 1874, 2627, 6126, 8518, 9120, 10144, 13007, 13892, 0, 0, 0 }, + { 11, 439, 991, 5000, 5256, 7215, 8109, 8680, 10694, 12078, 13454, 15221, 0, 0, 0 }, + { 11, + 1162, + 4754, + 5101, + 5940, + 8304, + 10907, + 11008, + 11528, + 13514, + 13837, + 15230, + 0, + 0, + 0 }, + { 11, + 1230, + 1618, + 2547, + 2922, + 5619, + 7415, + 12126, + 12406, + 14378, + 15306, + 15408, + 0, + 0, + 0 }, + { 11, 140, 446, 3378, 3908, 6904, 7783, 8587, 10420, 10630, 12602, 13597, 0, 0, 0 }, + { 4, 1004, 3374, 7234, 9291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 8358, 8550, 8658, 11681, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3669, 7500, 8610, 10360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4892, 9971, 11846, 13233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 329, 1735, 2397, 13639, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 12658, 12789, 14985, 15091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 8580, 8769, 9451, 15185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2383, 3542, 4270, 8840, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1379, 2256, 2452, 15454, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1457, 6459, 7332, 12968, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5323, 7398, 14302, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6056, 9938, 10618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 104, 6041, 12225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4895, 14004, 14522, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1942, 6495, 6826, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8262, 15584, 16179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11604, 12644, 12874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3538, 9506, 15206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 666, 6038, 8853, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5941, 8753, 12449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6500, 8604, 16045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7937, 12018, 12966, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8164, 14164, 14528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 867, 6180, 10192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3403, 5208, 10213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1752, 7835, 11867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1576, 6993, 11260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2245, 8237, 14506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1284, 1807, 5480, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9778, 10034, 13115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8398, 13975, 15705, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6906, 7770, 8242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1896, 3277, 10631, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2168, 6889, 8036, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1616, 6908, 11754, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11353, 13863, 14389, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2514, 7212, 12887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5661, 6511, 10622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4690, 8892, 10754, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12200, 12486, 14850, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4663, 15405, 15949, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 302, 309, 1904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5265, 7100, 7105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4996, 7928, 11084, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5425, 10367, 15826, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6766, 8245, 11914, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8091, 13882, 13887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1308, 1348, 7944, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4730, 10272, 14249, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5001, 5838, 11633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3687, 4732, 15948, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 285, 5437, 10939, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7254, 10928, 11235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2038, 6236, 14036, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9407, 12341, 16040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_140_180N[140][16]= - { - {15,66,862,939,3380,4920,5225,5330,6218,7204,7532,7689,9135,9363,10504,10694}, - {15,1993,2656,4602,6079,7569,7724,9038,9647,9979,11845,12641,12783,13451,13661,14166}, - {15,1360,2046,3315,3423,3974,4747,6535,6632,7261,8173,8391,9517,9928,11749,11761}, - {15,3373,3910,3965,4146,4171,6195,6384,7642,9337,9563,9716,11490,12393,13068,14016}, - {15,244,2500,3970,6097,6208,6669,7479,7667,8234,9367,10437,11623,12138,12212,12454}, - {15,665,1162,1990,2144,2356,4400,6032,9336,9988,10693,11378,12021,12582,13874,13958}, - {15,1129,1527,1725,1902,2039,2107,3241,5991,6086,7866,10793,11132,11318,13636,14100}, - {15,611,2141,2552,2602,3049,3185,5339,6495,7390,8033,9068,10844,10977,11047,13995}, - {15,2805,4137,4523,4841,7408,8551,8667,8749,8979,9232,9934,10345,10634,11646,12771}, - {15,144,1120,2295,3469,4991,5613,7186,7858,9116,9328,10850,11492,11837,12155,13103}, - {12,803,1580,1797,4719,6743,7061,7753,8376,9046,11635,11721,13350,0,0,0}, - {12,1432,3534,4822,6282,6412,7180,7619,7936,11278,12531,13074,13084,0,0,0}, - {12,2013,2575,2887,3930,4725,5498,5625,6209,6836,7268,9062,10950,0,0,0}, - {12,515,1037,2033,2624,3044,6028,7163,8729,8772,10358,10659,12466,0,0,0}, - {12,464,1685,2749,3321,3778,5322,5386,6294,7928,8871,10278,13040,0,0,0}, - {12,408,829,1672,2667,3077,3545,3703,5213,5381,7937,8474,13126,0,0,0}, - {12,1617,2490,2636,2723,5431,6975,7159,7900,10849,11572,11887,12462,0,0,0}, - {12,1402,2373,6408,6656,6704,8040,8841,9541,11818,13891,14006,14239,0,0,0}, - {12,1388,2078,2136,3514,5090,8083,8510,9200,9814,11142,11625,12980,0,0,0}, - {12,561,1659,2611,3085,3367,3804,6021,6209,6348,8282,8475,11386,0,0,0}, - {12,2457,3223,4495,4869,5314,5774,6532,6552,8987,9196,9199,11591,0,0,0}, - {12,627,1069,3015,3048,4275,4545,4617,5606,6070,8237,8659,8953,0,0,0}, - {12,1028,4096,5253,6370,8087,8382,8950,8984,9618,12843,13519,14356,0,0,0}, - {12,560,604,663,2209,2709,4421,6291,7322,10054,11747,11997,14192,0,0,0}, - {12,361,938,993,2884,3386,9431,9798,10155,11892,12184,13140,13808,0,0,0}, - {4,1045,5017,9862,13620,0,0,0,0,0,0,0,0,0,0,0}, - {4,205,3913,9136,13316,0,0,0,0,0,0,0,0,0,0,0}, - {4,2994,4307,10330,13439,0,0,0,0,0,0,0,0,0,0,0}, - {4,2437,6367,9411,10505,0,0,0,0,0,0,0,0,0,0,0}, - {4,5546,6653,7663,12391,0,0,0,0,0,0,0,0,0,0,0}, - {4,2825,3446,5803,11254,0,0,0,0,0,0,0,0,0,0,0}, - {4,1459,5988,7895,9221,0,0,0,0,0,0,0,0,0,0,0}, - {4,3968,6470,7739,12977,0,0,0,0,0,0,0,0,0,0,0}, - {4,3298,4154,12918,14282,0,0,0,0,0,0,0,0,0,0,0}, - {4,8890,9389,10144,12801,0,0,0,0,0,0,0,0,0,0,0}, - {4,2529,3668,10005,11652,0,0,0,0,0,0,0,0,0,0,0}, - {4,4558,8324,10112,12696,0,0,0,0,0,0,0,0,0,0,0}, - {4,491,6153,11815,12813,0,0,0,0,0,0,0,0,0,0,0}, - {4,1300,12716,13107,13847,0,0,0,0,0,0,0,0,0,0,0}, - {4,5542,6160,11226,12846,0,0,0,0,0,0,0,0,0,0,0}, - {3,5206,9994,11133,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7113,12088,12802,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,950,1805,8437,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4411,10474,12911,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3599,7495,8984,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4751,10097,10284,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,67,5056,11979,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10633,10770,13585,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1198,3963,9181,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,746,4895,11288,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7724,8170,9246,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6542,8235,8589,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1512,4603,11098,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7082,13053,13985,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3887,9094,10355,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3417,6588,12800,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4151,5569,8184,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5557,8162,12572,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2565,6091,6359,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2792,4430,6281,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7936,10786,11229,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,677,3184,12460,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2468,2884,11714,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,87,2318,9383,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,976,3614,10292,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,969,3180,14286,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7818,12285,13535,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3471,10797,11502,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3552,10568,12836,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1386,6971,13457,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,987,7598,9275,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5039,13533,13739,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1854,5210,11261,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10603,11753,12263,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,722,1030,12267,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,2720,5083,5350,9274,0,0,0,0,0,0,0,0,0,0,0}, - {4,3377,8717,9414,12039,0,0,0,0,0,0,0,0,0,0,0}, - {4,1355,6452,10130,13008,0,0,0,0,0,0,0,0,0,0,0}, - {4,5112,7583,9971,10955,0,0,0,0,0,0,0,0,0,0,0}, - {4,4633,8781,12791,13607,0,0,0,0,0,0,0,0,0,0,0}, - {4,1535,5803,8062,10467,0,0,0,0,0,0,0,0,0,0,0}, - {4,2326,8224,9176,12082,0,0,0,0,0,0,0,0,0,0,0}, - {4,939,8480,11823,13045,0,0,0,0,0,0,0,0,0,0,0}, - {4,380,425,4943,10388,0,0,0,0,0,0,0,0,0,0,0}, - {4,4001,4293,7887,9858,0,0,0,0,0,0,0,0,0,0,0}, - {4,3734,3746,9929,12310,0,0,0,0,0,0,0,0,0,0,0}, - {4,1592,6062,6419,10292,0,0,0,0,0,0,0,0,0,0,0}, - {4,101,2538,6316,13640,0,0,0,0,0,0,0,0,0,0,0}, - {4,3038,5921,6156,6529,0,0,0,0,0,0,0,0,0,0,0}, - {4,3820,10279,12229,12404,0,0,0,0,0,0,0,0,0,0,0}, - {3,761,3735,8874,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4985,9636,14004,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1744,2501,9257,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3223,7816,10249,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,765,2768,5363,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4911,5948,13726,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6745,9749,11658,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1373,4860,13952,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,120,407,13132,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,862,2571,3681,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3706,5914,8019,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7465,10479,12795,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,441,1017,1563,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6638,8730,10379,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3229,4169,11333,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1181,7252,11670,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1090,4576,8680,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,943,9116,11566,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3180,7882,12535,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2944,4411,12747,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3153,5618,7782,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,428,2208,10359,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,447,6906,12192,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8495,11164,12870,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,641,6397,11868,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4165,4534,11544,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4594,7957,11969,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3667,4604,7920,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2253,4617,13638,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1099,4214,6076,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,461,8085,9875,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8128,13331,13740,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8527,9749,12563,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4216,6105,12391,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6583,13362,14130,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,566,2898,4772,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4048,7696,8342,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,539,5111,9923,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,931,3789,7276,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5306,13717,13901,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1540,11240,11353,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1845,2752,6810,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8553,10094,10228,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9625,12761,13252,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4518,4526,9215,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5394,6447,10864,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7497,11962,12795,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2679,3310,3743,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2764,10853,12702,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6409,9498,10387,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_140_180N[140][16] = { + { 15, + 66, + 862, + 939, + 3380, + 4920, + 5225, + 5330, + 6218, + 7204, + 7532, + 7689, + 9135, + 9363, + 10504, + 10694 }, + { 15, + 1993, + 2656, + 4602, + 6079, + 7569, + 7724, + 9038, + 9647, + 9979, + 11845, + 12641, + 12783, + 13451, + 13661, + 14166 }, + { 15, + 1360, + 2046, + 3315, + 3423, + 3974, + 4747, + 6535, + 6632, + 7261, + 8173, + 8391, + 9517, + 9928, + 11749, + 11761 }, + { 15, + 3373, + 3910, + 3965, + 4146, + 4171, + 6195, + 6384, + 7642, + 9337, + 9563, + 9716, + 11490, + 12393, + 13068, + 14016 }, + { 15, + 244, + 2500, + 3970, + 6097, + 6208, + 6669, + 7479, + 7667, + 8234, + 9367, + 10437, + 11623, + 12138, + 12212, + 12454 }, + { 15, + 665, + 1162, + 1990, + 2144, + 2356, + 4400, + 6032, + 9336, + 9988, + 10693, + 11378, + 12021, + 12582, + 13874, + 13958 }, + { 15, + 1129, + 1527, + 1725, + 1902, + 2039, + 2107, + 3241, + 5991, + 6086, + 7866, + 10793, + 11132, + 11318, + 13636, + 14100 }, + { 15, + 611, + 2141, + 2552, + 2602, + 3049, + 3185, + 5339, + 6495, + 7390, + 8033, + 9068, + 10844, + 10977, + 11047, + 13995 }, + { 15, + 2805, + 4137, + 4523, + 4841, + 7408, + 8551, + 8667, + 8749, + 8979, + 9232, + 9934, + 10345, + 10634, + 11646, + 12771 }, + { 15, + 144, + 1120, + 2295, + 3469, + 4991, + 5613, + 7186, + 7858, + 9116, + 9328, + 10850, + 11492, + 11837, + 12155, + 13103 }, + { 12, + 803, + 1580, + 1797, + 4719, + 6743, + 7061, + 7753, + 8376, + 9046, + 11635, + 11721, + 13350, + 0, + 0, + 0 }, + { 12, + 1432, + 3534, + 4822, + 6282, + 6412, + 7180, + 7619, + 7936, + 11278, + 12531, + 13074, + 13084, + 0, + 0, + 0 }, + { 12, + 2013, + 2575, + 2887, + 3930, + 4725, + 5498, + 5625, + 6209, + 6836, + 7268, + 9062, + 10950, + 0, + 0, + 0 }, + { 12, + 515, + 1037, + 2033, + 2624, + 3044, + 6028, + 7163, + 8729, + 8772, + 10358, + 10659, + 12466, + 0, + 0, + 0 }, + { 12, + 464, + 1685, + 2749, + 3321, + 3778, + 5322, + 5386, + 6294, + 7928, + 8871, + 10278, + 13040, + 0, + 0, + 0 }, + { 12, + 408, + 829, + 1672, + 2667, + 3077, + 3545, + 3703, + 5213, + 5381, + 7937, + 8474, + 13126, + 0, + 0, + 0 }, + { 12, + 1617, + 2490, + 2636, + 2723, + 5431, + 6975, + 7159, + 7900, + 10849, + 11572, + 11887, + 12462, + 0, + 0, + 0 }, + { 12, + 1402, + 2373, + 6408, + 6656, + 6704, + 8040, + 8841, + 9541, + 11818, + 13891, + 14006, + 14239, + 0, + 0, + 0 }, + { 12, + 1388, + 2078, + 2136, + 3514, + 5090, + 8083, + 8510, + 9200, + 9814, + 11142, + 11625, + 12980, + 0, + 0, + 0 }, + { 12, + 561, + 1659, + 2611, + 3085, + 3367, + 3804, + 6021, + 6209, + 6348, + 8282, + 8475, + 11386, + 0, + 0, + 0 }, + { 12, + 2457, + 3223, + 4495, + 4869, + 5314, + 5774, + 6532, + 6552, + 8987, + 9196, + 9199, + 11591, + 0, + 0, + 0 }, + { 12, + 627, + 1069, + 3015, + 3048, + 4275, + 4545, + 4617, + 5606, + 6070, + 8237, + 8659, + 8953, + 0, + 0, + 0 }, + { 12, + 1028, + 4096, + 5253, + 6370, + 8087, + 8382, + 8950, + 8984, + 9618, + 12843, + 13519, + 14356, + 0, + 0, + 0 }, + { 12, + 560, + 604, + 663, + 2209, + 2709, + 4421, + 6291, + 7322, + 10054, + 11747, + 11997, + 14192, + 0, + 0, + 0 }, + { 12, + 361, + 938, + 993, + 2884, + 3386, + 9431, + 9798, + 10155, + 11892, + 12184, + 13140, + 13808, + 0, + 0, + 0 }, + { 4, 1045, 5017, 9862, 13620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 205, 3913, 9136, 13316, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2994, 4307, 10330, 13439, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2437, 6367, 9411, 10505, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 5546, 6653, 7663, 12391, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2825, 3446, 5803, 11254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1459, 5988, 7895, 9221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3968, 6470, 7739, 12977, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3298, 4154, 12918, 14282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 8890, 9389, 10144, 12801, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2529, 3668, 10005, 11652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4558, 8324, 10112, 12696, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 491, 6153, 11815, 12813, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1300, 12716, 13107, 13847, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 5542, 6160, 11226, 12846, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5206, 9994, 11133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7113, 12088, 12802, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 950, 1805, 8437, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4411, 10474, 12911, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3599, 7495, 8984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4751, 10097, 10284, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 67, 5056, 11979, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10633, 10770, 13585, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1198, 3963, 9181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 746, 4895, 11288, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7724, 8170, 9246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6542, 8235, 8589, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1512, 4603, 11098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7082, 13053, 13985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3887, 9094, 10355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3417, 6588, 12800, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4151, 5569, 8184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5557, 8162, 12572, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2565, 6091, 6359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2792, 4430, 6281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7936, 10786, 11229, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 677, 3184, 12460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2468, 2884, 11714, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 87, 2318, 9383, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 976, 3614, 10292, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 969, 3180, 14286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7818, 12285, 13535, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3471, 10797, 11502, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3552, 10568, 12836, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1386, 6971, 13457, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 987, 7598, 9275, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5039, 13533, 13739, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1854, 5210, 11261, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10603, 11753, 12263, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 722, 1030, 12267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2720, 5083, 5350, 9274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3377, 8717, 9414, 12039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1355, 6452, 10130, 13008, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 5112, 7583, 9971, 10955, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4633, 8781, 12791, 13607, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1535, 5803, 8062, 10467, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2326, 8224, 9176, 12082, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 939, 8480, 11823, 13045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 380, 425, 4943, 10388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4001, 4293, 7887, 9858, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3734, 3746, 9929, 12310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1592, 6062, 6419, 10292, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 101, 2538, 6316, 13640, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3038, 5921, 6156, 6529, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3820, 10279, 12229, 12404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 761, 3735, 8874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4985, 9636, 14004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1744, 2501, 9257, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3223, 7816, 10249, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 765, 2768, 5363, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4911, 5948, 13726, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6745, 9749, 11658, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1373, 4860, 13952, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 120, 407, 13132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 862, 2571, 3681, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3706, 5914, 8019, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7465, 10479, 12795, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 441, 1017, 1563, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6638, 8730, 10379, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3229, 4169, 11333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1181, 7252, 11670, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1090, 4576, 8680, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 943, 9116, 11566, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3180, 7882, 12535, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2944, 4411, 12747, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3153, 5618, 7782, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 428, 2208, 10359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 447, 6906, 12192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8495, 11164, 12870, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 641, 6397, 11868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4165, 4534, 11544, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4594, 7957, 11969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3667, 4604, 7920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2253, 4617, 13638, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1099, 4214, 6076, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 461, 8085, 9875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8128, 13331, 13740, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8527, 9749, 12563, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4216, 6105, 12391, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6583, 13362, 14130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 566, 2898, 4772, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4048, 7696, 8342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 539, 5111, 9923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 931, 3789, 7276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5306, 13717, 13901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1540, 11240, 11353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1845, 2752, 6810, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8553, 10094, 10228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9625, 12761, 13252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4518, 4526, 9215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5394, 6447, 10864, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7497, 11962, 12795, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2679, 3310, 3743, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2764, 10853, 12702, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6409, 9498, 10387, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_154_180N[154][14]= - { - {13,726,794,1587,2475,3114,3917,4471,6207,7451,8203,8218,8583,8941}, - {13,418,480,1320,1357,1481,2323,3677,5112,7038,7198,8066,9260,9282}, - {13,1506,2585,3336,4543,4828,5571,5954,6047,6081,7691,8090,8824,9153}, - {13,164,888,1867,2685,2983,4071,4848,4930,5882,7085,7861,8545,8689}, - {13,766,1004,1143,1782,1996,2506,2944,3094,4085,5728,8634,8737,8759}, - {13,199,341,2068,2100,2708,2896,4173,5846,6167,7798,9101,9159,9329}, - {13,617,752,1647,2258,2597,4708,5808,6726,7293,7800,7988,8825,9055}, - {13,315,408,620,1256,1985,2560,3226,5526,6463,6927,7223,7505,7669}, - {13,1361,1528,2397,3246,3370,4333,5167,5333,7409,8075,8197,8279,9138}, - {13,665,876,2039,2703,2864,3485,3767,4823,7275,7599,8274,8694,9334}, - {12,1160,1717,1750,2158,3040,3506,3764,3828,4261,4292,5134,6789,0}, - {12,1857,2119,2952,6145,6897,7582,7639,8032,8080,8181,8221,8454,0}, - {12,421,794,1511,2166,2489,3936,4288,5440,5901,6490,7266,8858,0}, - {12,456,2565,4071,4395,4451,4888,5338,5351,6608,7602,7835,9024,0}, - {12,617,912,3362,4085,4404,5050,5244,6043,6444,6721,7414,8353,0}, - {3,4535,7597,7853,0,0,0,0,0,0,0,0,0,0}, - {3,2632,4652,6491,0,0,0,0,0,0,0,0,0,0}, - {3,877,1378,8828,0,0,0,0,0,0,0,0,0,0}, - {3,434,3309,8607,0,0,0,0,0,0,0,0,0,0}, - {3,1075,2525,4103,0,0,0,0,0,0,0,0,0,0}, - {3,958,2220,3471,0,0,0,0,0,0,0,0,0,0}, - {3,2256,4350,7277,0,0,0,0,0,0,0,0,0,0}, - {3,1731,4306,8524,0,0,0,0,0,0,0,0,0,0}, - {3,470,6369,9026,0,0,0,0,0,0,0,0,0,0}, - {3,2605,3171,8760,0,0,0,0,0,0,0,0,0,0}, - {3,1886,4900,7558,0,0,0,0,0,0,0,0,0,0}, - {3,3825,4488,9230,0,0,0,0,0,0,0,0,0,0}, - {3,228,3806,8101,0,0,0,0,0,0,0,0,0,0}, - {3,3607,7835,8035,0,0,0,0,0,0,0,0,0,0}, - {3,5280,7413,8380,0,0,0,0,0,0,0,0,0,0}, - {3,2606,5100,5549,0,0,0,0,0,0,0,0,0,0}, - {3,2309,4329,8570,0,0,0,0,0,0,0,0,0,0}, - {3,1577,4746,7473,0,0,0,0,0,0,0,0,0,0}, - {3,2939,4664,7327,0,0,0,0,0,0,0,0,0,0}, - {3,2440,8572,8912,0,0,0,0,0,0,0,0,0,0}, - {3,4143,8221,8561,0,0,0,0,0,0,0,0,0,0}, - {3,3982,5316,7329,0,0,0,0,0,0,0,0,0,0}, - {3,387,745,5199,0,0,0,0,0,0,0,0,0,0}, - {3,2563,4077,9076,0,0,0,0,0,0,0,0,0,0}, - {3,1428,6482,9178,0,0,0,0,0,0,0,0,0,0}, - {3,4600,7640,8483,0,0,0,0,0,0,0,0,0,0}, - {3,3918,5239,5388,0,0,0,0,0,0,0,0,0,0}, - {3,2006,6768,9041,0,0,0,0,0,0,0,0,0,0}, - {3,5766,7058,7758,0,0,0,0,0,0,0,0,0,0}, - {3,2741,3382,5713,0,0,0,0,0,0,0,0,0,0}, - {3,116,1863,4193,0,0,0,0,0,0,0,0,0,0}, - {3,2339,4499,8437,0,0,0,0,0,0,0,0,0,0}, - {3,1799,5408,6711,0,0,0,0,0,0,0,0,0,0}, - {3,6937,7536,8100,0,0,0,0,0,0,0,0,0,0}, - {3,8313,8388,9277,0,0,0,0,0,0,0,0,0,0}, - {3,1743,3100,7424,0,0,0,0,0,0,0,0,0,0}, - {3,1959,2130,2230,0,0,0,0,0,0,0,0,0,0}, - {3,5007,6692,7748,0,0,0,0,0,0,0,0,0,0}, - {3,808,3333,5951,0,0,0,0,0,0,0,0,0,0}, - {3,1719,7648,8645,0,0,0,0,0,0,0,0,0,0}, - {3,102,2996,6153,0,0,0,0,0,0,0,0,0,0}, - {3,739,2765,6496,0,0,0,0,0,0,0,0,0,0}, - {3,1107,1760,7023,0,0,0,0,0,0,0,0,0,0}, - {3,1067,2666,9235,0,0,0,0,0,0,0,0,0,0}, - {3,1125,3760,8095,0,0,0,0,0,0,0,0,0,0}, - {3,2047,3143,6383,0,0,0,0,0,0,0,0,0,0}, - {3,2698,3440,5405,0,0,0,0,0,0,0,0,0,0}, - {3,1746,1854,1965,0,0,0,0,0,0,0,0,0,0}, - {3,380,3171,5816,0,0,0,0,0,0,0,0,0,0}, - {3,4155,5210,9325,0,0,0,0,0,0,0,0,0,0}, - {3,2290,2658,3766,0,0,0,0,0,0,0,0,0,0}, - {3,167,6239,6635,0,0,0,0,0,0,0,0,0,0}, - {3,1338,1541,5813,0,0,0,0,0,0,0,0,0,0}, - {3,6148,6574,7436,0,0,0,0,0,0,0,0,0,0}, - {3,3598,3777,6367,0,0,0,0,0,0,0,0,0,0}, - {3,731,4247,8887,0,0,0,0,0,0,0,0,0,0}, - {3,2152,2600,8950,0,0,0,0,0,0,0,0,0,0}, - {3,3774,4099,6605,0,0,0,0,0,0,0,0,0,0}, - {3,2819,3315,6492,0,0,0,0,0,0,0,0,0,0}, - {3,1195,3774,7126,0,0,0,0,0,0,0,0,0,0}, - {12,572,2723,3467,3509,5379,6756,6853,7335,7973,8087,8202,9000,0}, - {12,817,3136,3533,3732,5001,5148,5202,5402,6602,7236,7605,8275,0}, - {12,185,325,591,1559,1635,2826,3352,3634,3937,5814,8101,8133,0}, - {12,758,1780,1965,2932,4010,4621,7103,7249,7328,7878,8754,8805,0}, - {12,528,1433,2926,3557,3780,4650,4671,5253,5488,5517,5681,8300,0}, - {12,1172,2131,3702,4455,4504,5216,5920,6371,6660,7953,9036,9185,0}, - {12,639,1572,1714,1957,3145,5123,5330,5419,6418,7163,7237,9235,0}, - {12,166,486,708,1071,2179,3700,4756,5606,5685,6426,6467,6902,0}, - {12,462,486,735,2065,2558,3196,4006,5344,5617,7451,8141,8436,0}, - {12,435,3016,4173,4235,4415,4731,5396,7340,8002,8155,8279,9081,0}, - {5,560,2200,2649,3690,8636,0,0,0,0,0,0,0,0}, - {5,4156,5971,7133,7480,8218,0,0,0,0,0,0,0,0}, - {5,1398,2219,3796,4877,6376,0,0,0,0,0,0,0,0}, - {5,506,1284,6906,7288,9131,0,0,0,0,0,0,0,0}, - {5,643,1661,5057,8011,8241,0,0,0,0,0,0,0,0}, - {3,859,3508,5030,0,0,0,0,0,0,0,0,0,0}, - {3,575,3942,6198,0,0,0,0,0,0,0,0,0,0}, - {3,3472,5037,8710,0,0,0,0,0,0,0,0,0,0}, - {3,3850,8080,9216,0,0,0,0,0,0,0,0,0,0}, - {3,3203,8128,8836,0,0,0,0,0,0,0,0,0,0}, - {3,3059,5057,8120,0,0,0,0,0,0,0,0,0,0}, - {3,3804,6339,8539,0,0,0,0,0,0,0,0,0,0}, - {3,2355,6922,8235,0,0,0,0,0,0,0,0,0,0}, - {3,2035,2133,7090,0,0,0,0,0,0,0,0,0,0}, - {3,4787,5994,6966,0,0,0,0,0,0,0,0,0,0}, - {3,1484,4897,7766,0,0,0,0,0,0,0,0,0,0}, - {3,3977,7211,7682,0,0,0,0,0,0,0,0,0,0}, - {3,3030,4150,7823,0,0,0,0,0,0,0,0,0,0}, - {3,516,2443,7919,0,0,0,0,0,0,0,0,0,0}, - {3,5120,5715,6141,0,0,0,0,0,0,0,0,0,0}, - {3,1551,6029,7124,0,0,0,0,0,0,0,0,0,0}, - {3,1995,2156,6952,0,0,0,0,0,0,0,0,0,0}, - {3,4686,4944,8175,0,0,0,0,0,0,0,0,0,0}, - {3,2763,4667,7284,0,0,0,0,0,0,0,0,0,0}, - {3,3648,7312,7361,0,0,0,0,0,0,0,0,0,0}, - {3,333,3231,4029,0,0,0,0,0,0,0,0,0,0}, - {3,692,2273,9068,0,0,0,0,0,0,0,0,0,0}, - {3,15,3757,7203,0,0,0,0,0,0,0,0,0,0}, - {3,2870,4217,8458,0,0,0,0,0,0,0,0,0,0}, - {3,1501,2721,6548,0,0,0,0,0,0,0,0,0,0}, - {3,92,2144,6570,0,0,0,0,0,0,0,0,0,0}, - {3,1846,4578,7972,0,0,0,0,0,0,0,0,0,0}, - {3,2999,3542,4001,0,0,0,0,0,0,0,0,0,0}, - {3,1658,8479,8763,0,0,0,0,0,0,0,0,0,0}, - {3,4169,6305,7774,0,0,0,0,0,0,0,0,0,0}, - {3,2357,2475,8504,0,0,0,0,0,0,0,0,0,0}, - {3,1418,1516,3587,0,0,0,0,0,0,0,0,0,0}, - {3,2715,2754,7789,0,0,0,0,0,0,0,0,0,0}, - {3,1765,2387,8858,0,0,0,0,0,0,0,0,0,0}, - {3,5115,8712,9029,0,0,0,0,0,0,0,0,0,0}, - {3,160,2544,5818,0,0,0,0,0,0,0,0,0,0}, - {3,1600,3668,7706,0,0,0,0,0,0,0,0,0,0}, - {3,1589,3143,7396,0,0,0,0,0,0,0,0,0,0}, - {3,3310,3953,8862,0,0,0,0,0,0,0,0,0,0}, - {3,2054,3075,4821,0,0,0,0,0,0,0,0,0,0}, - {3,4061,4355,6130,0,0,0,0,0,0,0,0,0,0}, - {3,2086,2534,4831,0,0,0,0,0,0,0,0,0,0}, - {3,4229,4981,9057,0,0,0,0,0,0,0,0,0,0}, - {3,24,5398,6062,0,0,0,0,0,0,0,0,0,0}, - {3,1370,7446,8116,0,0,0,0,0,0,0,0,0,0}, - {3,409,1199,6499,0,0,0,0,0,0,0,0,0,0}, - {3,1088,1648,7267,0,0,0,0,0,0,0,0,0,0}, - {3,176,8059,9351,0,0,0,0,0,0,0,0,0,0}, - {3,558,3830,4748,0,0,0,0,0,0,0,0,0,0}, - {3,4772,8116,8277,0,0,0,0,0,0,0,0,0,0}, - {3,1253,2418,3450,0,0,0,0,0,0,0,0,0,0}, - {3,5305,5679,7537,0,0,0,0,0,0,0,0,0,0}, - {3,437,561,7932,0,0,0,0,0,0,0,0,0,0}, - {3,3058,4317,9184,0,0,0,0,0,0,0,0,0,0}, - {3,382,1516,6576,0,0,0,0,0,0,0,0,0,0}, - {3,471,6158,7469,0,0,0,0,0,0,0,0,0,0}, - {3,5,955,2716,0,0,0,0,0,0,0,0,0,0}, - {3,964,5239,8890,0,0,0,0,0,0,0,0,0,0}, - {3,727,738,4868,0,0,0,0,0,0,0,0,0,0}, - {3,7443,7560,7580,0,0,0,0,0,0,0,0,0,0}, - {3,2075,2266,8918,0,0,0,0,0,0,0,0,0,0}, - {3,4021,4267,6797,0,0,0,0,0,0,0,0,0,0}, - {3,6103,6111,8823,0,0,0,0,0,0,0,0,0,0}, - {3,6523,6531,9063,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_154_180N[154][14] = { + { 13, 726, 794, 1587, 2475, 3114, 3917, 4471, 6207, 7451, 8203, 8218, 8583, 8941 }, + { 13, 418, 480, 1320, 1357, 1481, 2323, 3677, 5112, 7038, 7198, 8066, 9260, 9282 }, + { 13, 1506, 2585, 3336, 4543, 4828, 5571, 5954, 6047, 6081, 7691, 8090, 8824, 9153 }, + { 13, 164, 888, 1867, 2685, 2983, 4071, 4848, 4930, 5882, 7085, 7861, 8545, 8689 }, + { 13, 766, 1004, 1143, 1782, 1996, 2506, 2944, 3094, 4085, 5728, 8634, 8737, 8759 }, + { 13, 199, 341, 2068, 2100, 2708, 2896, 4173, 5846, 6167, 7798, 9101, 9159, 9329 }, + { 13, 617, 752, 1647, 2258, 2597, 4708, 5808, 6726, 7293, 7800, 7988, 8825, 9055 }, + { 13, 315, 408, 620, 1256, 1985, 2560, 3226, 5526, 6463, 6927, 7223, 7505, 7669 }, + { 13, 1361, 1528, 2397, 3246, 3370, 4333, 5167, 5333, 7409, 8075, 8197, 8279, 9138 }, + { 13, 665, 876, 2039, 2703, 2864, 3485, 3767, 4823, 7275, 7599, 8274, 8694, 9334 }, + { 12, 1160, 1717, 1750, 2158, 3040, 3506, 3764, 3828, 4261, 4292, 5134, 6789, 0 }, + { 12, 1857, 2119, 2952, 6145, 6897, 7582, 7639, 8032, 8080, 8181, 8221, 8454, 0 }, + { 12, 421, 794, 1511, 2166, 2489, 3936, 4288, 5440, 5901, 6490, 7266, 8858, 0 }, + { 12, 456, 2565, 4071, 4395, 4451, 4888, 5338, 5351, 6608, 7602, 7835, 9024, 0 }, + { 12, 617, 912, 3362, 4085, 4404, 5050, 5244, 6043, 6444, 6721, 7414, 8353, 0 }, + { 3, 4535, 7597, 7853, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2632, 4652, 6491, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 877, 1378, 8828, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 434, 3309, 8607, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1075, 2525, 4103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 958, 2220, 3471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2256, 4350, 7277, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1731, 4306, 8524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 470, 6369, 9026, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2605, 3171, 8760, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1886, 4900, 7558, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3825, 4488, 9230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 228, 3806, 8101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3607, 7835, 8035, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5280, 7413, 8380, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2606, 5100, 5549, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2309, 4329, 8570, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1577, 4746, 7473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2939, 4664, 7327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2440, 8572, 8912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4143, 8221, 8561, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3982, 5316, 7329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 387, 745, 5199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2563, 4077, 9076, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1428, 6482, 9178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4600, 7640, 8483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3918, 5239, 5388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2006, 6768, 9041, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5766, 7058, 7758, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2741, 3382, 5713, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 116, 1863, 4193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2339, 4499, 8437, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1799, 5408, 6711, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6937, 7536, 8100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8313, 8388, 9277, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1743, 3100, 7424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1959, 2130, 2230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5007, 6692, 7748, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 808, 3333, 5951, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1719, 7648, 8645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 102, 2996, 6153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 739, 2765, 6496, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1107, 1760, 7023, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1067, 2666, 9235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1125, 3760, 8095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2047, 3143, 6383, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2698, 3440, 5405, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1746, 1854, 1965, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 380, 3171, 5816, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4155, 5210, 9325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2290, 2658, 3766, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 167, 6239, 6635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1338, 1541, 5813, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6148, 6574, 7436, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3598, 3777, 6367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 731, 4247, 8887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2152, 2600, 8950, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3774, 4099, 6605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2819, 3315, 6492, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1195, 3774, 7126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 12, 572, 2723, 3467, 3509, 5379, 6756, 6853, 7335, 7973, 8087, 8202, 9000, 0 }, + { 12, 817, 3136, 3533, 3732, 5001, 5148, 5202, 5402, 6602, 7236, 7605, 8275, 0 }, + { 12, 185, 325, 591, 1559, 1635, 2826, 3352, 3634, 3937, 5814, 8101, 8133, 0 }, + { 12, 758, 1780, 1965, 2932, 4010, 4621, 7103, 7249, 7328, 7878, 8754, 8805, 0 }, + { 12, 528, 1433, 2926, 3557, 3780, 4650, 4671, 5253, 5488, 5517, 5681, 8300, 0 }, + { 12, 1172, 2131, 3702, 4455, 4504, 5216, 5920, 6371, 6660, 7953, 9036, 9185, 0 }, + { 12, 639, 1572, 1714, 1957, 3145, 5123, 5330, 5419, 6418, 7163, 7237, 9235, 0 }, + { 12, 166, 486, 708, 1071, 2179, 3700, 4756, 5606, 5685, 6426, 6467, 6902, 0 }, + { 12, 462, 486, 735, 2065, 2558, 3196, 4006, 5344, 5617, 7451, 8141, 8436, 0 }, + { 12, 435, 3016, 4173, 4235, 4415, 4731, 5396, 7340, 8002, 8155, 8279, 9081, 0 }, + { 5, 560, 2200, 2649, 3690, 8636, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 4156, 5971, 7133, 7480, 8218, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 1398, 2219, 3796, 4877, 6376, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 506, 1284, 6906, 7288, 9131, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 643, 1661, 5057, 8011, 8241, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 859, 3508, 5030, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 575, 3942, 6198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3472, 5037, 8710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3850, 8080, 9216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3203, 8128, 8836, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3059, 5057, 8120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3804, 6339, 8539, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2355, 6922, 8235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2035, 2133, 7090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4787, 5994, 6966, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1484, 4897, 7766, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3977, 7211, 7682, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3030, 4150, 7823, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 516, 2443, 7919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5120, 5715, 6141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1551, 6029, 7124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1995, 2156, 6952, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4686, 4944, 8175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2763, 4667, 7284, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3648, 7312, 7361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 333, 3231, 4029, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 692, 2273, 9068, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 3757, 7203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2870, 4217, 8458, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1501, 2721, 6548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 92, 2144, 6570, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1846, 4578, 7972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2999, 3542, 4001, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1658, 8479, 8763, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4169, 6305, 7774, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2357, 2475, 8504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1418, 1516, 3587, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2715, 2754, 7789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1765, 2387, 8858, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5115, 8712, 9029, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 160, 2544, 5818, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1600, 3668, 7706, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1589, 3143, 7396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3310, 3953, 8862, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2054, 3075, 4821, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4061, 4355, 6130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2086, 2534, 4831, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4229, 4981, 9057, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 5398, 6062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1370, 7446, 8116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 409, 1199, 6499, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1088, 1648, 7267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 176, 8059, 9351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 558, 3830, 4748, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4772, 8116, 8277, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1253, 2418, 3450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5305, 5679, 7537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 437, 561, 7932, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3058, 4317, 9184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 382, 1516, 6576, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 471, 6158, 7469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 955, 2716, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 964, 5239, 8890, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 727, 738, 4868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7443, 7560, 7580, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2075, 2266, 8918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4021, 4267, 6797, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6103, 6111, 8823, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6523, 6531, 9063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_18_30N[108][20]= - { - {19,113,1557,3316,5680,6241,10407,13404,13947,14040,14353,15522,15698,16079,17363,19374,19543,20530,22833,24339}, - {19,271,1361,6236,7006,7307,7333,12768,15441,15568,17923,18341,20321,21502,22023,23938,25351,25590,25876,25910}, - {19,73,605,872,4008,6279,7653,10346,10799,12482,12935,13604,15909,16526,19782,20506,22804,23629,24859,25600}, - {19,1445,1690,4304,4851,8919,9176,9252,13783,16076,16675,17274,18806,18882,20819,21958,22451,23869,23999,24177}, - {19,1290,2337,5661,6371,8996,10102,10941,11360,12242,14918,16808,20571,23374,24046,25045,25060,25662,25783,25913}, - {19,28,42,1926,3421,3503,8558,9453,10168,15820,17473,19571,19685,22790,23336,23367,23890,24061,25657,25680}, - {19,0,1709,4041,4932,5968,7123,8430,9564,10596,11026,14761,19484,20762,20858,23803,24016,24795,25853,25863}, - {19,29,1625,6500,6609,16831,18517,18568,18738,19387,20159,20544,21603,21941,24137,24269,24416,24803,25154,25395}, - {19,55,66,871,3700,11426,13221,15001,16367,17601,18380,22796,23488,23938,25476,25635,25678,25807,25857,25872}, - {19,1,19,5958,8548,8860,11489,16845,18450,18469,19496,20190,23173,25262,25566,25668,25679,25858,25888,25915}, - {19,7520,7690,8855,9183,14654,16695,17121,17854,18083,18428,19633,20470,20736,21720,22335,23273,25083,25293,25403}, - {19,48,58,410,1299,3786,10668,18523,18963,20864,22106,22308,23033,23107,23128,23990,24286,24409,24595,25802}, - {19,12,51,3894,6539,8276,10885,11644,12777,13427,14039,15954,17078,19053,20537,22863,24521,25087,25463,25838}, - {19,3509,8748,9581,11509,15884,16230,17583,19264,20900,21001,21310,22547,22756,22959,24768,24814,25594,25626,25880}, - {19,21,29,69,1448,2386,4601,6626,6667,10242,13141,13852,14137,18640,19951,22449,23454,24431,25512,25814}, - {19,18,53,7890,9934,10063,16728,19040,19809,20825,21522,21800,23582,24556,25031,25547,25562,25733,25789,25906}, - {19,4096,4582,5766,5894,6517,10027,12182,13247,15207,17041,18958,20133,20503,22228,24332,24613,25689,25855,25883}, - {19,0,25,819,5539,7076,7536,7695,9532,13668,15051,17683,19665,20253,21996,24136,24890,25758,25784,25807}, - {19,34,40,44,4215,6076,7427,7965,8777,11017,15593,19542,22202,22973,23397,23423,24418,24873,25107,25644}, - {4,1595,6216,22850,25439,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,1562,15172,19517,22362,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,7508,12879,24324,24496,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,6298,15819,16757,18721,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,11173,15175,19966,21195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,59,13505,16941,23793,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,2267,4830,12023,20587,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,8827,9278,13072,16664,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,14419,17463,23398,25348,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,6112,16534,20423,22698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,493,8914,21103,24799,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,6896,12761,13206,25873,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,2,1380,12322,21701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,11600,21306,25753,25790,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,8421,13076,14271,15401,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,9630,14112,19017,20955,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,212,13932,21781,25824,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,5961,9110,16654,19636,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,58,5434,9936,12770,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6575,11433,19798,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2731,7338,20926,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14253,18463,25404,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,21791,24805,25869,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2,11646,15850,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6075,8586,23819,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,18435,22093,24852,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2103,2368,11704,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10925,17402,18232,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9062,25061,25674,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,18497,20853,23404,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,18606,19364,19551,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7,1022,25543,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6744,15481,25868,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9081,17305,25164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8,23701,25883,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9680,19955,22848,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,56,4564,19121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5595,15086,25892,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3174,17127,23183,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,19397,19817,20275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12561,24571,25825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7111,9889,25865,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,19104,20189,21851,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,549,9686,25548,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6586,20325,25906,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3224,20710,21637,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,641,15215,25754,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13484,23729,25818,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2043,7493,24246,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16860,25230,25768,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,22047,24200,24902,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9391,18040,19499,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7855,24336,25069,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,23834,25570,25852,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1977,8800,25756,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6671,21772,25859,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3279,6710,24444,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,24099,25117,25820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5553,12306,25915,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,48,11107,23907,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10832,11974,25773,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2223,17905,25484,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16782,17135,20446,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,475,2861,3457,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16218,22449,24362,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11716,22200,25897,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8315,15009,22633,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13,20480,25852,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12352,18658,25687,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3681,14794,23703,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,30,24531,25846,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4103,22077,24107,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,23837,25622,25812,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3627,13387,25839,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,908,5367,19388,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,0,6894,25795,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,20322,23546,25181,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8178,25260,25437,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2449,13244,22565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,31,18928,22741,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1312,5134,14838,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6085,13937,24220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,66,14633,25670,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,47,22512,25472,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8867,24704,25279,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6742,21623,22745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,147,9948,24178,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8522,24261,24307,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,19202,22406,24609,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_18_30N[108][20] = { + { 19, 113, 1557, 3316, 5680, 6241, 10407, 13404, 13947, 14040, + 14353, 15522, 15698, 16079, 17363, 19374, 19543, 20530, 22833, 24339 }, + { 19, 271, 1361, 6236, 7006, 7307, 7333, 12768, 15441, 15568, + 17923, 18341, 20321, 21502, 22023, 23938, 25351, 25590, 25876, 25910 }, + { 19, 73, 605, 872, 4008, 6279, 7653, 10346, 10799, 12482, + 12935, 13604, 15909, 16526, 19782, 20506, 22804, 23629, 24859, 25600 }, + { 19, 1445, 1690, 4304, 4851, 8919, 9176, 9252, 13783, 16076, + 16675, 17274, 18806, 18882, 20819, 21958, 22451, 23869, 23999, 24177 }, + { 19, 1290, 2337, 5661, 6371, 8996, 10102, 10941, 11360, 12242, + 14918, 16808, 20571, 23374, 24046, 25045, 25060, 25662, 25783, 25913 }, + { 19, 28, 42, 1926, 3421, 3503, 8558, 9453, 10168, 15820, + 17473, 19571, 19685, 22790, 23336, 23367, 23890, 24061, 25657, 25680 }, + { 19, 0, 1709, 4041, 4932, 5968, 7123, 8430, 9564, 10596, + 11026, 14761, 19484, 20762, 20858, 23803, 24016, 24795, 25853, 25863 }, + { 19, 29, 1625, 6500, 6609, 16831, 18517, 18568, 18738, 19387, + 20159, 20544, 21603, 21941, 24137, 24269, 24416, 24803, 25154, 25395 }, + { 19, 55, 66, 871, 3700, 11426, 13221, 15001, 16367, 17601, + 18380, 22796, 23488, 23938, 25476, 25635, 25678, 25807, 25857, 25872 }, + { 19, 1, 19, 5958, 8548, 8860, 11489, 16845, 18450, 18469, + 19496, 20190, 23173, 25262, 25566, 25668, 25679, 25858, 25888, 25915 }, + { 19, 7520, 7690, 8855, 9183, 14654, 16695, 17121, 17854, 18083, + 18428, 19633, 20470, 20736, 21720, 22335, 23273, 25083, 25293, 25403 }, + { 19, 48, 58, 410, 1299, 3786, 10668, 18523, 18963, 20864, + 22106, 22308, 23033, 23107, 23128, 23990, 24286, 24409, 24595, 25802 }, + { 19, 12, 51, 3894, 6539, 8276, 10885, 11644, 12777, 13427, + 14039, 15954, 17078, 19053, 20537, 22863, 24521, 25087, 25463, 25838 }, + { 19, 3509, 8748, 9581, 11509, 15884, 16230, 17583, 19264, 20900, + 21001, 21310, 22547, 22756, 22959, 24768, 24814, 25594, 25626, 25880 }, + { 19, 21, 29, 69, 1448, 2386, 4601, 6626, 6667, 10242, + 13141, 13852, 14137, 18640, 19951, 22449, 23454, 24431, 25512, 25814 }, + { 19, 18, 53, 7890, 9934, 10063, 16728, 19040, 19809, 20825, + 21522, 21800, 23582, 24556, 25031, 25547, 25562, 25733, 25789, 25906 }, + { 19, 4096, 4582, 5766, 5894, 6517, 10027, 12182, 13247, 15207, + 17041, 18958, 20133, 20503, 22228, 24332, 24613, 25689, 25855, 25883 }, + { 19, 0, 25, 819, 5539, 7076, 7536, 7695, 9532, 13668, + 15051, 17683, 19665, 20253, 21996, 24136, 24890, 25758, 25784, 25807 }, + { 19, 34, 40, 44, 4215, 6076, 7427, 7965, 8777, 11017, + 15593, 19542, 22202, 22973, 23397, 23423, 24418, 24873, 25107, 25644 }, + { 4, 1595, 6216, 22850, 25439, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1562, 15172, 19517, 22362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 7508, 12879, 24324, 24496, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 6298, 15819, 16757, 18721, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 11173, 15175, 19966, 21195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 59, 13505, 16941, 23793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2267, 4830, 12023, 20587, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 8827, 9278, 13072, 16664, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 14419, 17463, 23398, 25348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 6112, 16534, 20423, 22698, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 493, 8914, 21103, 24799, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 6896, 12761, 13206, 25873, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2, 1380, 12322, 21701, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 11600, 21306, 25753, 25790, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 8421, 13076, 14271, 15401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 9630, 14112, 19017, 20955, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 212, 13932, 21781, 25824, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 5961, 9110, 16654, 19636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 58, 5434, 9936, 12770, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6575, 11433, 19798, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2731, 7338, 20926, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14253, 18463, 25404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21791, 24805, 25869, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 11646, 15850, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6075, 8586, 23819, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18435, 22093, 24852, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2103, 2368, 11704, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10925, 17402, 18232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9062, 25061, 25674, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18497, 20853, 23404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18606, 19364, 19551, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 1022, 25543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6744, 15481, 25868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9081, 17305, 25164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 23701, 25883, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9680, 19955, 22848, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 56, 4564, 19121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5595, 15086, 25892, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3174, 17127, 23183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19397, 19817, 20275, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12561, 24571, 25825, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7111, 9889, 25865, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19104, 20189, 21851, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 549, 9686, 25548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6586, 20325, 25906, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3224, 20710, 21637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 641, 15215, 25754, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13484, 23729, 25818, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2043, 7493, 24246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16860, 25230, 25768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22047, 24200, 24902, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9391, 18040, 19499, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7855, 24336, 25069, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23834, 25570, 25852, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1977, 8800, 25756, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6671, 21772, 25859, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3279, 6710, 24444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24099, 25117, 25820, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5553, 12306, 25915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 48, 11107, 23907, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10832, 11974, 25773, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2223, 17905, 25484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16782, 17135, 20446, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 475, 2861, 3457, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16218, 22449, 24362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11716, 22200, 25897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8315, 15009, 22633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 20480, 25852, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12352, 18658, 25687, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3681, 14794, 23703, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30, 24531, 25846, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4103, 22077, 24107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23837, 25622, 25812, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3627, 13387, 25839, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 908, 5367, 19388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 6894, 25795, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20322, 23546, 25181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8178, 25260, 25437, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2449, 13244, 22565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31, 18928, 22741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1312, 5134, 14838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6085, 13937, 24220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 66, 14633, 25670, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 47, 22512, 25472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8867, 24704, 25279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6742, 21623, 22745, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 147, 9948, 24178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8522, 24261, 24307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19202, 22406, 24609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_20_30N[120][17]= - { - {16,692,1779,1973,2726,5151,6088,7921,9618,11804,13043,15975,16214,16889,16980,18585,18648}, - {16,13,4090,4319,5288,8102,10110,10481,10527,10953,11185,12069,13177,14217,15963,17661,20959}, - {16,2330,2516,2902,4087,6338,8015,8638,9436,10294,10843,11802,12304,12371,14095,18486,18996}, - {16,125,586,5137,5701,6432,6500,8131,8327,10488,11032,11334,11449,12504,16000,20753,21317}, - {16,30,480,2681,3635,3898,4058,12803,14734,20252,20306,20680,21329,21333,21466,21562,21568}, - {16,20,44,738,4965,5516,7659,8464,8759,12216,14630,18241,18711,19093,20217,21316,21490}, - {16,31,43,3554,5289,5667,8687,14885,16579,17883,18384,18486,19142,20785,20932,21131,21308}, - {16,7054,9276,10435,12324,12354,13849,14285,16482,19212,19217,19221,20499,20831,20925,21195,21247}, - {16,9,13,4099,10353,10747,14884,15492,17650,19291,19394,20356,20658,21068,21117,21183,21586}, - {16,28,2250,2980,8988,10282,12503,13301,18351,20546,20622,21006,21293,21344,21472,21530,21542}, - {16,17,32,2521,4374,5098,7525,13035,14437,15283,18635,19136,20240,21147,21179,21300,21349}, - {16,57,4735,5657,7649,8807,12375,16092,16178,16379,17545,19461,19489,20321,20530,21453,21457}, - {16,35,55,5333,14423,14670,15438,19468,19667,20823,21084,21241,21344,21447,21520,21554,21586}, - {16,13,20,2025,11854,12516,14938,15929,18081,19730,19929,20408,21338,21391,21425,21468,21546}, - {16,54,7451,8176,10136,15240,16442,16482,19431,19483,19762,20647,20839,20966,21512,21579,21592}, - {16,26,465,3604,4233,9831,11741,13692,18953,18974,21021,21039,21133,21282,21488,21532,21558}, - {16,1,7,16,59,6979,7675,7717,9791,12370,13050,18534,18729,19846,19864,20127,20165}, - {16,15,31,11089,12360,13640,14237,17937,18043,18410,19443,21107,21444,21449,21528,21576,21584}, - {16,32,51,9768,17848,18095,19326,19594,19618,19765,20440,20482,20582,21236,21338,21563,21587}, - {16,44,55,4864,10253,11306,12117,13076,13901,15610,17057,18205,19794,20939,21132,21267,21573}, - {16,3436,11304,15361,16511,16860,18238,18639,19341,20106,20123,20407,21200,21280,21452,21526,21569}, - {16,679,8822,11045,14403,16588,17838,19117,19453,20265,20558,21374,21396,21428,21442,21529,21590}, - {16,391,13002,13140,14314,17169,17175,17846,18122,19447,20075,20212,20436,20583,21330,21359,21403}, - {4,7601,10257,20060,21285,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,4419,9150,18097,20315,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4675,13376,21435,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,610,1238,16704,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5732,7096,21104,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5690,13531,14545,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4334,14839,17357,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8,2814,17674,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2392,8128,18369,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,502,7403,15133,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,343,13624,20673,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13188,15687,21593,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,321,16866,21347,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1242,4261,17449,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4691,8086,8691,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8500,11538,20278,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6269,12905,18192,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5984,15452,17111,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11541,18717,21534,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16,10780,16107,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12310,12959,20390,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1365,18306,19634,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6125,19132,20242,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3012,17233,21533,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5816,13021,21440,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13207,17811,18798,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2762,7586,12139,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3949,5545,13584,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11374,18279,19241,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2736,10989,21209,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4095,20677,21395,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8251,10084,20498,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7628,8875,21406,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2743,8943,9090,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1817,7788,15767,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9333,9838,21268,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6203,9480,12042,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5747,21187,21468,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2553,18281,21500,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3179,9155,15222,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12498,18109,20326,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14106,21209,21592,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7454,17484,20791,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,20804,21120,21574,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5754,18178,20935,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,30,4322,21381,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11905,20416,21397,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12452,19899,21497,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1917,6028,16868,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9891,18710,18953,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,912,21083,21446,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,370,14355,18069,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16519,19003,20902,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11163,17558,18424,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8427,14396,21405,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8885,11796,21361,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4960,15431,20653,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11944,16839,21236,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9967,14529,17208,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14144,19354,19745,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7986,12680,21396,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6097,11501,13028,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,33,13803,21038,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3177,20124,20803,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2692,6841,18655,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,971,5892,14354,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3887,19455,21271,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,17214,17315,21148,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6539,13910,21526,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3809,5153,15793,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3865,21438,21510,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7129,17787,19636,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5972,13150,14182,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7078,14906,16911,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,15705,21160,21482,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5479,13860,19763,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16817,19722,20001,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14649,16147,18886,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,15138,18578,21502,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2096,2534,17760,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11920,13460,19783,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,19876,20071,20583,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6241,14230,20775,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16138,16386,21371,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8616,15624,18453,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6013,8015,21599,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9184,10688,20792,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,18122,21141,21469,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10706,13177,20957,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,15148,15584,20959,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9114,9432,16467,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5483,14687,14705,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8325,21161,21410,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2328,17670,19834,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7015,20802,21385,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,52,5451,20379,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9689,15537,19733,0,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_20_30N[120][17] = { + { 16, + 692, + 1779, + 1973, + 2726, + 5151, + 6088, + 7921, + 9618, + 11804, + 13043, + 15975, + 16214, + 16889, + 16980, + 18585, + 18648 }, + { 16, + 13, + 4090, + 4319, + 5288, + 8102, + 10110, + 10481, + 10527, + 10953, + 11185, + 12069, + 13177, + 14217, + 15963, + 17661, + 20959 }, + { 16, + 2330, + 2516, + 2902, + 4087, + 6338, + 8015, + 8638, + 9436, + 10294, + 10843, + 11802, + 12304, + 12371, + 14095, + 18486, + 18996 }, + { 16, + 125, + 586, + 5137, + 5701, + 6432, + 6500, + 8131, + 8327, + 10488, + 11032, + 11334, + 11449, + 12504, + 16000, + 20753, + 21317 }, + { 16, + 30, + 480, + 2681, + 3635, + 3898, + 4058, + 12803, + 14734, + 20252, + 20306, + 20680, + 21329, + 21333, + 21466, + 21562, + 21568 }, + { 16, + 20, + 44, + 738, + 4965, + 5516, + 7659, + 8464, + 8759, + 12216, + 14630, + 18241, + 18711, + 19093, + 20217, + 21316, + 21490 }, + { 16, + 31, + 43, + 3554, + 5289, + 5667, + 8687, + 14885, + 16579, + 17883, + 18384, + 18486, + 19142, + 20785, + 20932, + 21131, + 21308 }, + { 16, + 7054, + 9276, + 10435, + 12324, + 12354, + 13849, + 14285, + 16482, + 19212, + 19217, + 19221, + 20499, + 20831, + 20925, + 21195, + 21247 }, + { 16, + 9, + 13, + 4099, + 10353, + 10747, + 14884, + 15492, + 17650, + 19291, + 19394, + 20356, + 20658, + 21068, + 21117, + 21183, + 21586 }, + { 16, + 28, + 2250, + 2980, + 8988, + 10282, + 12503, + 13301, + 18351, + 20546, + 20622, + 21006, + 21293, + 21344, + 21472, + 21530, + 21542 }, + { 16, + 17, + 32, + 2521, + 4374, + 5098, + 7525, + 13035, + 14437, + 15283, + 18635, + 19136, + 20240, + 21147, + 21179, + 21300, + 21349 }, + { 16, + 57, + 4735, + 5657, + 7649, + 8807, + 12375, + 16092, + 16178, + 16379, + 17545, + 19461, + 19489, + 20321, + 20530, + 21453, + 21457 }, + { 16, + 35, + 55, + 5333, + 14423, + 14670, + 15438, + 19468, + 19667, + 20823, + 21084, + 21241, + 21344, + 21447, + 21520, + 21554, + 21586 }, + { 16, + 13, + 20, + 2025, + 11854, + 12516, + 14938, + 15929, + 18081, + 19730, + 19929, + 20408, + 21338, + 21391, + 21425, + 21468, + 21546 }, + { 16, + 54, + 7451, + 8176, + 10136, + 15240, + 16442, + 16482, + 19431, + 19483, + 19762, + 20647, + 20839, + 20966, + 21512, + 21579, + 21592 }, + { 16, + 26, + 465, + 3604, + 4233, + 9831, + 11741, + 13692, + 18953, + 18974, + 21021, + 21039, + 21133, + 21282, + 21488, + 21532, + 21558 }, + { 16, + 1, + 7, + 16, + 59, + 6979, + 7675, + 7717, + 9791, + 12370, + 13050, + 18534, + 18729, + 19846, + 19864, + 20127, + 20165 }, + { 16, + 15, + 31, + 11089, + 12360, + 13640, + 14237, + 17937, + 18043, + 18410, + 19443, + 21107, + 21444, + 21449, + 21528, + 21576, + 21584 }, + { 16, + 32, + 51, + 9768, + 17848, + 18095, + 19326, + 19594, + 19618, + 19765, + 20440, + 20482, + 20582, + 21236, + 21338, + 21563, + 21587 }, + { 16, + 44, + 55, + 4864, + 10253, + 11306, + 12117, + 13076, + 13901, + 15610, + 17057, + 18205, + 19794, + 20939, + 21132, + 21267, + 21573 }, + { 16, + 3436, + 11304, + 15361, + 16511, + 16860, + 18238, + 18639, + 19341, + 20106, + 20123, + 20407, + 21200, + 21280, + 21452, + 21526, + 21569 }, + { 16, + 679, + 8822, + 11045, + 14403, + 16588, + 17838, + 19117, + 19453, + 20265, + 20558, + 21374, + 21396, + 21428, + 21442, + 21529, + 21590 }, + { 16, + 391, + 13002, + 13140, + 14314, + 17169, + 17175, + 17846, + 18122, + 19447, + 20075, + 20212, + 20436, + 20583, + 21330, + 21359, + 21403 }, + { 4, 7601, 10257, 20060, 21285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4419, 9150, 18097, 20315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4675, 13376, 21435, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 610, 1238, 16704, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5732, 7096, 21104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5690, 13531, 14545, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4334, 14839, 17357, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 2814, 17674, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2392, 8128, 18369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 502, 7403, 15133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 343, 13624, 20673, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13188, 15687, 21593, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 321, 16866, 21347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1242, 4261, 17449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4691, 8086, 8691, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8500, 11538, 20278, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6269, 12905, 18192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5984, 15452, 17111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11541, 18717, 21534, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 10780, 16107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12310, 12959, 20390, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1365, 18306, 19634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6125, 19132, 20242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3012, 17233, 21533, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5816, 13021, 21440, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13207, 17811, 18798, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2762, 7586, 12139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3949, 5545, 13584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11374, 18279, 19241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2736, 10989, 21209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4095, 20677, 21395, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8251, 10084, 20498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7628, 8875, 21406, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2743, 8943, 9090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1817, 7788, 15767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9333, 9838, 21268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6203, 9480, 12042, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5747, 21187, 21468, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2553, 18281, 21500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3179, 9155, 15222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12498, 18109, 20326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14106, 21209, 21592, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7454, 17484, 20791, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20804, 21120, 21574, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5754, 18178, 20935, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 30, 4322, 21381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11905, 20416, 21397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12452, 19899, 21497, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1917, 6028, 16868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9891, 18710, 18953, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 912, 21083, 21446, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 370, 14355, 18069, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16519, 19003, 20902, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11163, 17558, 18424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8427, 14396, 21405, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8885, 11796, 21361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4960, 15431, 20653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11944, 16839, 21236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9967, 14529, 17208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14144, 19354, 19745, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7986, 12680, 21396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6097, 11501, 13028, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 33, 13803, 21038, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3177, 20124, 20803, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2692, 6841, 18655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 971, 5892, 14354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3887, 19455, 21271, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17214, 17315, 21148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6539, 13910, 21526, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3809, 5153, 15793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3865, 21438, 21510, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7129, 17787, 19636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5972, 13150, 14182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7078, 14906, 16911, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15705, 21160, 21482, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5479, 13860, 19763, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16817, 19722, 20001, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14649, 16147, 18886, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15138, 18578, 21502, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2096, 2534, 17760, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11920, 13460, 19783, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19876, 20071, 20583, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6241, 14230, 20775, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16138, 16386, 21371, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8616, 15624, 18453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6013, 8015, 21599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9184, 10688, 20792, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18122, 21141, 21469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10706, 13177, 20957, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15148, 15584, 20959, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9114, 9432, 16467, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5483, 14687, 14705, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8325, 21161, 21410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2328, 17670, 19834, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7015, 20802, 21385, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 52, 5451, 20379, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9689, 15537, 19733, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_22_30N[132][16]= - { - {15,696,989,1238,3091,3116,3738,4269,6406,7033,8048,9157,10254,12033,16456,16912}, - {15,444,1488,6541,8626,10735,12447,13111,13706,14135,15195,15947,16453,16916,17137,17268}, - {15,401,460,992,1145,1576,1678,2238,2320,4280,6770,10027,12486,15363,16714,17157}, - {15,1161,3108,3727,4508,5092,5348,5582,7727,11793,12515,12917,13362,14247,16717,17205}, - {15,542,1190,6883,7911,8349,8835,10489,11631,14195,15009,15454,15482,16632,17040,17063}, - {15,17,487,776,880,5077,6172,9771,11446,12798,16016,16109,16171,17087,17132,17226}, - {15,1337,3275,3462,4229,9246,10180,10845,10866,12250,13633,14482,16024,16812,17186,17241}, - {15,15,980,2305,3674,5971,8224,11499,11752,11770,12897,14082,14836,15311,16391,17209}, - {15,0,3926,5869,8696,9351,9391,11371,14052,14172,14636,14974,16619,16961,17033,17237}, - {15,3033,5317,6501,8579,10698,12168,12966,14019,15392,15806,15991,16493,16690,17062,17090}, - {15,981,1205,4400,6410,11003,13319,13405,14695,15846,16297,16492,16563,16616,16862,16953}, - {15,1725,4276,8869,9588,14062,14486,15474,15548,16300,16432,17042,17050,17060,17175,17273}, - {15,1807,5921,9960,10011,14305,14490,14872,15852,16054,16061,16306,16799,16833,17136,17262}, - {15,2826,4752,6017,6540,7016,8201,14245,14419,14716,15983,16569,16652,17171,17179,17247}, - {15,1662,2516,3345,5229,8086,9686,11456,12210,14595,15808,16011,16421,16825,17112,17195}, - {15,2890,4821,5987,7226,8823,9869,12468,14694,15352,15805,16075,16462,17102,17251,17263}, - {15,3751,3890,4382,5720,10281,10411,11350,12721,13121,14127,14980,15202,15335,16735,17123}, - {15,26,30,2805,5457,6630,7188,7477,7556,11065,16608,16859,16909,16943,17030,17103}, - {15,40,4524,5043,5566,9645,10204,10282,11696,13080,14837,15607,16274,17034,17225,17266}, - {15,904,3157,6284,7151,7984,11712,12887,13767,15547,16099,16753,16829,17044,17250,17259}, - {15,7,311,4876,8334,9249,11267,14072,14559,15003,15235,15686,16331,17177,17238,17253}, - {15,4410,8066,8596,9631,10369,11249,12610,15769,16791,16960,17018,17037,17062,17165,17204}, - {15,24,8261,9691,10138,11607,12782,12786,13424,13933,15262,15795,16476,17084,17193,17220}, - {4,88,11622,14705,15890,0,0,0,0,0,0,0,0,0,0,0}, - {4,304,2026,2638,6018,0,0,0,0,0,0,0,0,0,0,0}, - {4,1163,4268,11620,17232,0,0,0,0,0,0,0,0,0,0,0}, - {4,9701,11785,14463,17260,0,0,0,0,0,0,0,0,0,0,0}, - {4,4118,10952,12224,17006,0,0,0,0,0,0,0,0,0,0,0}, - {4,3647,10823,11521,12060,0,0,0,0,0,0,0,0,0,0,0}, - {4,1717,3753,9199,11642,0,0,0,0,0,0,0,0,0,0,0}, - {3,2187,14280,17220,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14787,16903,17061,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,381,3534,4294,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3149,6947,8323,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12562,16724,16881,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7289,9997,15306,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5615,13152,17260,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5666,16926,17027,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4190,7798,16831,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4778,10629,17180,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10001,13884,15453,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6,2237,8203,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7831,15144,15160,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9186,17204,17243,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9435,17168,17237,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,42,5701,17159,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,7812,14259,15715,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,39,4513,6658,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,38,9368,11273,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1119,4785,17182,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5620,16521,16729,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16,6685,17242,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,210,3452,12383,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,466,14462,16250,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10548,12633,13962,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1452,6005,16453,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,22,4120,13684,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5195,11563,16522,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5518,16705,17201,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12233,14552,15471,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6067,13440,17248,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8660,8967,17061,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8673,12176,15051,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5959,15767,16541,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3244,12109,12414,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,31,15913,16323,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3270,15686,16653,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,24,7346,14675,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12,1531,8740,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6228,7565,16667,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16936,17122,17162,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4868,8451,13183,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3714,4451,16919,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11313,13801,17132,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,17070,17191,17242,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1911,11201,17186,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14,17190,17254,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11760,16008,16832,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14543,17033,17278,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16129,16765,17155,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6891,15561,17007,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,12741,14744,17116,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8992,16661,17277,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1861,11130,16742,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4822,13331,16192,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13281,14027,14989,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,38,14887,17141,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10698,13452,15674,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4,2539,16877,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,857,17170,17249,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11449,11906,12867,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,285,14118,16831,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,15191,17214,17242,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,39,728,16915,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2469,12969,15579,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16644,17151,17164,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2592,8280,10448,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9236,12431,17173,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9064,16892,17233,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4526,16146,17038,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,31,2116,16083,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,15837,16951,17031,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5362,8382,16618,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6137,13199,17221,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2841,15068,17068,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,24,3620,17003,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9880,15718,16764,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1784,10240,17209,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2731,10293,10846,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3121,8723,16598,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8563,15662,17088,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13,1167,14676,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,29,13850,15963,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3654,7553,8114,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,23,4362,14865,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4434,14741,16688,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8362,13901,17244,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13687,16736,17232,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,46,4229,13394,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,13169,16383,16972,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16031,16681,16952,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3384,9894,12580,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,9841,14414,16165,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5013,17099,17115,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2130,8941,17266,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,6907,15428,17241,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,16,1860,17235,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2151,16014,16643,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,14954,15958,17222,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3969,8419,15116,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,31,15593,16984,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11514,16605,17255,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_22_30N[132][16] = { + { 15, + 696, + 989, + 1238, + 3091, + 3116, + 3738, + 4269, + 6406, + 7033, + 8048, + 9157, + 10254, + 12033, + 16456, + 16912 }, + { 15, + 444, + 1488, + 6541, + 8626, + 10735, + 12447, + 13111, + 13706, + 14135, + 15195, + 15947, + 16453, + 16916, + 17137, + 17268 }, + { 15, + 401, + 460, + 992, + 1145, + 1576, + 1678, + 2238, + 2320, + 4280, + 6770, + 10027, + 12486, + 15363, + 16714, + 17157 }, + { 15, + 1161, + 3108, + 3727, + 4508, + 5092, + 5348, + 5582, + 7727, + 11793, + 12515, + 12917, + 13362, + 14247, + 16717, + 17205 }, + { 15, + 542, + 1190, + 6883, + 7911, + 8349, + 8835, + 10489, + 11631, + 14195, + 15009, + 15454, + 15482, + 16632, + 17040, + 17063 }, + { 15, + 17, + 487, + 776, + 880, + 5077, + 6172, + 9771, + 11446, + 12798, + 16016, + 16109, + 16171, + 17087, + 17132, + 17226 }, + { 15, + 1337, + 3275, + 3462, + 4229, + 9246, + 10180, + 10845, + 10866, + 12250, + 13633, + 14482, + 16024, + 16812, + 17186, + 17241 }, + { 15, + 15, + 980, + 2305, + 3674, + 5971, + 8224, + 11499, + 11752, + 11770, + 12897, + 14082, + 14836, + 15311, + 16391, + 17209 }, + { 15, + 0, + 3926, + 5869, + 8696, + 9351, + 9391, + 11371, + 14052, + 14172, + 14636, + 14974, + 16619, + 16961, + 17033, + 17237 }, + { 15, + 3033, + 5317, + 6501, + 8579, + 10698, + 12168, + 12966, + 14019, + 15392, + 15806, + 15991, + 16493, + 16690, + 17062, + 17090 }, + { 15, + 981, + 1205, + 4400, + 6410, + 11003, + 13319, + 13405, + 14695, + 15846, + 16297, + 16492, + 16563, + 16616, + 16862, + 16953 }, + { 15, + 1725, + 4276, + 8869, + 9588, + 14062, + 14486, + 15474, + 15548, + 16300, + 16432, + 17042, + 17050, + 17060, + 17175, + 17273 }, + { 15, + 1807, + 5921, + 9960, + 10011, + 14305, + 14490, + 14872, + 15852, + 16054, + 16061, + 16306, + 16799, + 16833, + 17136, + 17262 }, + { 15, + 2826, + 4752, + 6017, + 6540, + 7016, + 8201, + 14245, + 14419, + 14716, + 15983, + 16569, + 16652, + 17171, + 17179, + 17247 }, + { 15, + 1662, + 2516, + 3345, + 5229, + 8086, + 9686, + 11456, + 12210, + 14595, + 15808, + 16011, + 16421, + 16825, + 17112, + 17195 }, + { 15, + 2890, + 4821, + 5987, + 7226, + 8823, + 9869, + 12468, + 14694, + 15352, + 15805, + 16075, + 16462, + 17102, + 17251, + 17263 }, + { 15, + 3751, + 3890, + 4382, + 5720, + 10281, + 10411, + 11350, + 12721, + 13121, + 14127, + 14980, + 15202, + 15335, + 16735, + 17123 }, + { 15, + 26, + 30, + 2805, + 5457, + 6630, + 7188, + 7477, + 7556, + 11065, + 16608, + 16859, + 16909, + 16943, + 17030, + 17103 }, + { 15, + 40, + 4524, + 5043, + 5566, + 9645, + 10204, + 10282, + 11696, + 13080, + 14837, + 15607, + 16274, + 17034, + 17225, + 17266 }, + { 15, + 904, + 3157, + 6284, + 7151, + 7984, + 11712, + 12887, + 13767, + 15547, + 16099, + 16753, + 16829, + 17044, + 17250, + 17259 }, + { 15, + 7, + 311, + 4876, + 8334, + 9249, + 11267, + 14072, + 14559, + 15003, + 15235, + 15686, + 16331, + 17177, + 17238, + 17253 }, + { 15, + 4410, + 8066, + 8596, + 9631, + 10369, + 11249, + 12610, + 15769, + 16791, + 16960, + 17018, + 17037, + 17062, + 17165, + 17204 }, + { 15, + 24, + 8261, + 9691, + 10138, + 11607, + 12782, + 12786, + 13424, + 13933, + 15262, + 15795, + 16476, + 17084, + 17193, + 17220 }, + { 4, 88, 11622, 14705, 15890, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 304, 2026, 2638, 6018, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1163, 4268, 11620, 17232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 9701, 11785, 14463, 17260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4118, 10952, 12224, 17006, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3647, 10823, 11521, 12060, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1717, 3753, 9199, 11642, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2187, 14280, 17220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14787, 16903, 17061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 381, 3534, 4294, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3149, 6947, 8323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12562, 16724, 16881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7289, 9997, 15306, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5615, 13152, 17260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5666, 16926, 17027, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4190, 7798, 16831, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4778, 10629, 17180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10001, 13884, 15453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 2237, 8203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7831, 15144, 15160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9186, 17204, 17243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9435, 17168, 17237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 42, 5701, 17159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7812, 14259, 15715, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 39, 4513, 6658, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38, 9368, 11273, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1119, 4785, 17182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5620, 16521, 16729, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 6685, 17242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 210, 3452, 12383, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 466, 14462, 16250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10548, 12633, 13962, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1452, 6005, 16453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22, 4120, 13684, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5195, 11563, 16522, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5518, 16705, 17201, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12233, 14552, 15471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6067, 13440, 17248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8660, 8967, 17061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8673, 12176, 15051, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5959, 15767, 16541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3244, 12109, 12414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31, 15913, 16323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3270, 15686, 16653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 7346, 14675, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 1531, 8740, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6228, 7565, 16667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16936, 17122, 17162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4868, 8451, 13183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3714, 4451, 16919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11313, 13801, 17132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17070, 17191, 17242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1911, 11201, 17186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 17190, 17254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11760, 16008, 16832, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14543, 17033, 17278, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16129, 16765, 17155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6891, 15561, 17007, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12741, 14744, 17116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8992, 16661, 17277, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1861, 11130, 16742, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4822, 13331, 16192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13281, 14027, 14989, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 38, 14887, 17141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10698, 13452, 15674, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 2539, 16877, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 857, 17170, 17249, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11449, 11906, 12867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 285, 14118, 16831, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15191, 17214, 17242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 39, 728, 16915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2469, 12969, 15579, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16644, 17151, 17164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2592, 8280, 10448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9236, 12431, 17173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9064, 16892, 17233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4526, 16146, 17038, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31, 2116, 16083, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15837, 16951, 17031, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5362, 8382, 16618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6137, 13199, 17221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2841, 15068, 17068, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 24, 3620, 17003, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9880, 15718, 16764, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1784, 10240, 17209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2731, 10293, 10846, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3121, 8723, 16598, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8563, 15662, 17088, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 1167, 14676, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 29, 13850, 15963, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3654, 7553, 8114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 23, 4362, 14865, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4434, 14741, 16688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8362, 13901, 17244, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13687, 16736, 17232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 46, 4229, 13394, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13169, 16383, 16972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16031, 16681, 16952, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3384, 9894, 12580, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9841, 14414, 16165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5013, 17099, 17115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2130, 8941, 17266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6907, 15428, 17241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 1860, 17235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2151, 16014, 16643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14954, 15958, 17222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3969, 8419, 15116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 31, 15593, 16984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11514, 16605, 17255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_1_4S[9][13]= - { - {12,6295,9626,304,7695,4839,4936,1660,144,11203,5567,6347,12557}, - {12,10691,4988,3859,3734,3071,3494,7687,10313,5964,8069,8296,11090}, - {12,10774,3613,5208,11177,7676,3549,8746,6583,7239,12265,2674,4292}, - {12,11869,3708,5981,8718,4908,10650,6805,3334,2627,10461,9285,11120}, - {3,7844,3079,10773,0,0,0,0,0,0,0,0,0}, - {3,3385,10854,5747,0,0,0,0,0,0,0,0,0}, - {3,1360,12010,12202,0,0,0,0,0,0,0,0,0}, - {3,6189,4241,2343,0,0,0,0,0,0,0,0,0}, - {3,9840,12726,4977,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_1_4S[9][13] = { + { 12, 6295, 9626, 304, 7695, 4839, 4936, 1660, 144, 11203, 5567, 6347, 12557 }, + { 12, 10691, 4988, 3859, 3734, 3071, 3494, 7687, 10313, 5964, 8069, 8296, 11090 }, + { 12, 10774, 3613, 5208, 11177, 7676, 3549, 8746, 6583, 7239, 12265, 2674, 4292 }, + { 12, 11869, 3708, 5981, 8718, 4908, 10650, 6805, 3334, 2627, 10461, 9285, 11120 }, + { 3, 7844, 3079, 10773, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3385, 10854, 5747, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1360, 12010, 12202, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6189, 4241, 2343, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9840, 12726, 4977, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_1_3S[15][13]= - { - {12,416,8909,4156,3216,3112,2560,2912,6405,8593,4969,6723,6912}, - {12,8978,3011,4339,9312,6396,2957,7288,5485,6031,10218,2226,3575}, - {12,3383,10059,1114,10008,10147,9384,4290,434,5139,3536,1965,2291}, - {12,2797,3693,7615,7077,743,1941,8716,6215,3840,5140,4582,5420}, - {12,6110,8551,1515,7404,4879,4946,5383,1831,3441,9569,10472,4306}, - {3,1505,5682,7778,0,0,0,0,0,0,0,0,0}, - {3,7172,6830,6623,0,0,0,0,0,0,0,0,0}, - {3,7281,3941,3505,0,0,0,0,0,0,0,0,0}, - {3,10270,8669,914,0,0,0,0,0,0,0,0,0}, - {3,3622,7563,9388,0,0,0,0,0,0,0,0,0}, - {3,9930,5058,4554,0,0,0,0,0,0,0,0,0}, - {3,4844,9609,2707,0,0,0,0,0,0,0,0,0}, - {3,6883,3237,1714,0,0,0,0,0,0,0,0,0}, - {3,4768,3878,10017,0,0,0,0,0,0,0,0,0}, - {3,10127,3334,8267,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_1_3S[15][13] = { + { 12, 416, 8909, 4156, 3216, 3112, 2560, 2912, 6405, 8593, 4969, 6723, 6912 }, + { 12, 8978, 3011, 4339, 9312, 6396, 2957, 7288, 5485, 6031, 10218, 2226, 3575 }, + { 12, 3383, 10059, 1114, 10008, 10147, 9384, 4290, 434, 5139, 3536, 1965, 2291 }, + { 12, 2797, 3693, 7615, 7077, 743, 1941, 8716, 6215, 3840, 5140, 4582, 5420 }, + { 12, 6110, 8551, 1515, 7404, 4879, 4946, 5383, 1831, 3441, 9569, 10472, 4306 }, + { 3, 1505, 5682, 7778, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7172, 6830, 6623, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7281, 3941, 3505, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10270, 8669, 914, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3622, 7563, 9388, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9930, 5058, 4554, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4844, 9609, 2707, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6883, 3237, 1714, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4768, 3878, 10017, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10127, 3334, 8267, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_2_5S[18][13]= - { - {12,5650,4143,8750,583,6720,8071,635,1767,1344,6922,738,6658}, - {12,5696,1685,3207,415,7019,5023,5608,2605,857,6915,1770,8016}, - {12,3992,771,2190,7258,8970,7792,1802,1866,6137,8841,886,1931}, - {12,4108,3781,7577,6810,9322,8226,5396,5867,4428,8827,7766,2254}, - {12,4247,888,4367,8821,9660,324,5864,4774,227,7889,6405,8963}, - {12,9693,500,2520,2227,1811,9330,1928,5140,4030,4824,806,3134}, - {3,1652,8171,1435,0,0,0,0,0,0,0,0,0}, - {3,3366,6543,3745,0,0,0,0,0,0,0,0,0}, - {3,9286,8509,4645,0,0,0,0,0,0,0,0,0}, - {3,7397,5790,8972,0,0,0,0,0,0,0,0,0}, - {3,6597,4422,1799,0,0,0,0,0,0,0,0,0}, - {3,9276,4041,3847,0,0,0,0,0,0,0,0,0}, - {3,8683,7378,4946,0,0,0,0,0,0,0,0,0}, - {3,5348,1993,9186,0,0,0,0,0,0,0,0,0}, - {3,6724,9015,5646,0,0,0,0,0,0,0,0,0}, - {3,4502,4439,8474,0,0,0,0,0,0,0,0,0}, - {3,5107,7342,9442,0,0,0,0,0,0,0,0,0}, - {3,1387,8910,2660,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_2_5S[18][13] = { + { 12, 5650, 4143, 8750, 583, 6720, 8071, 635, 1767, 1344, 6922, 738, 6658 }, + { 12, 5696, 1685, 3207, 415, 7019, 5023, 5608, 2605, 857, 6915, 1770, 8016 }, + { 12, 3992, 771, 2190, 7258, 8970, 7792, 1802, 1866, 6137, 8841, 886, 1931 }, + { 12, 4108, 3781, 7577, 6810, 9322, 8226, 5396, 5867, 4428, 8827, 7766, 2254 }, + { 12, 4247, 888, 4367, 8821, 9660, 324, 5864, 4774, 227, 7889, 6405, 8963 }, + { 12, 9693, 500, 2520, 2227, 1811, 9330, 1928, 5140, 4030, 4824, 806, 3134 }, + { 3, 1652, 8171, 1435, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3366, 6543, 3745, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9286, 8509, 4645, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7397, 5790, 8972, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6597, 4422, 1799, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9276, 4041, 3847, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8683, 7378, 4946, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5348, 1993, 9186, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6724, 9015, 5646, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4502, 4439, 8474, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5107, 7342, 9442, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1387, 8910, 2660, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_1_2S[20][9]= - { - {8,20,712,2386,6354,4061,1062,5045,5158}, - {8,21,2543,5748,4822,2348,3089,6328,5876}, - {8,22,926,5701,269,3693,2438,3190,3507}, - {8,23,2802,4520,3577,5324,1091,4667,4449}, - {8,24,5140,2003,1263,4742,6497,1185,6202}, - {3,0,4046,6934,0,0,0,0,0}, - {3,1,2855,66,0,0,0,0,0}, - {3,2,6694,212,0,0,0,0,0}, - {3,3,3439,1158,0,0,0,0,0}, - {3,4,3850,4422,0,0,0,0,0}, - {3,5,5924,290,0,0,0,0,0}, - {3,6,1467,4049,0,0,0,0,0}, - {3,7,7820,2242,0,0,0,0,0}, - {3,8,4606,3080,0,0,0,0,0}, - {3,9,4633,7877,0,0,0,0,0}, - {3,10,3884,6868,0,0,0,0,0}, - {3,11,8935,4996,0,0,0,0,0}, - {3,12,3028,764,0,0,0,0,0}, - {3,13,5988,1057,0,0,0,0,0}, - {3,14,7411,3450,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_1_2S[20][9] = { + { 8, 20, 712, 2386, 6354, 4061, 1062, 5045, 5158 }, + { 8, 21, 2543, 5748, 4822, 2348, 3089, 6328, 5876 }, + { 8, 22, 926, 5701, 269, 3693, 2438, 3190, 3507 }, + { 8, 23, 2802, 4520, 3577, 5324, 1091, 4667, 4449 }, + { 8, 24, 5140, 2003, 1263, 4742, 6497, 1185, 6202 }, + { 3, 0, 4046, 6934, 0, 0, 0, 0, 0 }, + { 3, 1, 2855, 66, 0, 0, 0, 0, 0 }, + { 3, 2, 6694, 212, 0, 0, 0, 0, 0 }, + { 3, 3, 3439, 1158, 0, 0, 0, 0, 0 }, + { 3, 4, 3850, 4422, 0, 0, 0, 0, 0 }, + { 3, 5, 5924, 290, 0, 0, 0, 0, 0 }, + { 3, 6, 1467, 4049, 0, 0, 0, 0, 0 }, + { 3, 7, 7820, 2242, 0, 0, 0, 0, 0 }, + { 3, 8, 4606, 3080, 0, 0, 0, 0, 0 }, + { 3, 9, 4633, 7877, 0, 0, 0, 0, 0 }, + { 3, 10, 3884, 6868, 0, 0, 0, 0, 0 }, + { 3, 11, 8935, 4996, 0, 0, 0, 0, 0 }, + { 3, 12, 3028, 764, 0, 0, 0, 0, 0 }, + { 3, 13, 5988, 1057, 0, 0, 0, 0, 0 }, + { 3, 14, 7411, 3450, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_3_5S_DVBT2[27][13]= - { - {12,71,1478,1901,2240,2649,2725,3592,3708,3965,4080,5733,6198}, - {12,393,1384,1435,1878,2773,3182,3586,5465,6091,6110,6114,6327}, - {12,160,1149,1281,1526,1566,2129,2929,3095,3223,4250,4276,4612}, - {12,289,1446,1602,2421,3559,3796,5590,5750,5763,6168,6271,6340}, - {12,947,1227,2008,2020,2266,3365,3588,3867,4172,4250,4865,6290}, - {3,3324,3704,4447,0,0,0,0,0,0,0,0,0}, - {3,1206,2565,3089,0,0,0,0,0,0,0,0,0}, - {3,529,4027,5891,0,0,0,0,0,0,0,0,0}, - {3,141,1187,3206,0,0,0,0,0,0,0,0,0}, - {3,1990,2972,5120,0,0,0,0,0,0,0,0,0}, - {3,752,796,5976,0,0,0,0,0,0,0,0,0}, - {3,1129,2377,4030,0,0,0,0,0,0,0,0,0}, - {3,6077,6108,6231,0,0,0,0,0,0,0,0,0}, - {3,61,1053,1781,0,0,0,0,0,0,0,0,0}, - {3,2820,4109,5307,0,0,0,0,0,0,0,0,0}, - {3,2088,5834,5988,0,0,0,0,0,0,0,0,0}, - {3,3725,3945,4010,0,0,0,0,0,0,0,0,0}, - {3,1081,2780,3389,0,0,0,0,0,0,0,0,0}, - {3,659,2221,4822,0,0,0,0,0,0,0,0,0}, - {3,3033,6060,6160,0,0,0,0,0,0,0,0,0}, - {3,756,1489,2350,0,0,0,0,0,0,0,0,0}, - {3,3350,3624,5470,0,0,0,0,0,0,0,0,0}, - {3,357,1825,5242,0,0,0,0,0,0,0,0,0}, - {3,585,3372,6062,0,0,0,0,0,0,0,0,0}, - {3,561,1417,2348,0,0,0,0,0,0,0,0,0}, - {3,971,3719,5567,0,0,0,0,0,0,0,0,0}, - {3,1005,1675,2062,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_3_5S_DVBT2[27][13] = { + { 12, 71, 1478, 1901, 2240, 2649, 2725, 3592, 3708, 3965, 4080, 5733, 6198 }, + { 12, 393, 1384, 1435, 1878, 2773, 3182, 3586, 5465, 6091, 6110, 6114, 6327 }, + { 12, 160, 1149, 1281, 1526, 1566, 2129, 2929, 3095, 3223, 4250, 4276, 4612 }, + { 12, 289, 1446, 1602, 2421, 3559, 3796, 5590, 5750, 5763, 6168, 6271, 6340 }, + { 12, 947, 1227, 2008, 2020, 2266, 3365, 3588, 3867, 4172, 4250, 4865, 6290 }, + { 3, 3324, 3704, 4447, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1206, 2565, 3089, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 529, 4027, 5891, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 141, 1187, 3206, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1990, 2972, 5120, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 752, 796, 5976, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1129, 2377, 4030, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6077, 6108, 6231, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 61, 1053, 1781, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2820, 4109, 5307, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2088, 5834, 5988, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3725, 3945, 4010, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1081, 2780, 3389, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 659, 2221, 4822, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3033, 6060, 6160, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 756, 1489, 2350, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3350, 3624, 5470, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 357, 1825, 5242, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 585, 3372, 6062, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 561, 1417, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 971, 3719, 5567, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1005, 1675, 2062, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_3_5S_DVBS2[27][13]= - { - {12,2765,5713,6426,3596,1374,4811,2182,544,3394,2840,4310,771}, - {12,4951,211,2208,723,1246,2928,398,5739,265,5601,5993,2615}, - {12,210,4730,5777,3096,4282,6238,4939,1119,6463,5298,6320,4016}, - {12,4167,2063,4757,3157,5664,3956,6045,563,4284,2441,3412,6334}, - {12,4201,2428,4474,59,1721,736,2997,428,3807,1513,4732,6195}, - {12,2670,3081,5139,3736,1999,5889,4362,3806,4534,5409,6384,5809}, - {12,5516,1622,2906,3285,1257,5797,3816,817,875,2311,3543,1205}, - {12,4244,2184,5415,1705,5642,4886,2333,287,1848,1121,3595,6022}, - {12,2142,2830,4069,5654,1295,2951,3919,1356,884,1786,396,4738}, - {3,0,2161,2653,0,0,0,0,0,0,0,0,0}, - {3,1,1380,1461,0,0,0,0,0,0,0,0,0}, - {3,2,2502,3707,0,0,0,0,0,0,0,0,0}, - {3,3,3971,1057,0,0,0,0,0,0,0,0,0}, - {3,4,5985,6062,0,0,0,0,0,0,0,0,0}, - {3,5,1733,6028,0,0,0,0,0,0,0,0,0}, - {3,6,3786,1936,0,0,0,0,0,0,0,0,0}, - {3,7,4292,956,0,0,0,0,0,0,0,0,0}, - {3,8,5692,3417,0,0,0,0,0,0,0,0,0}, - {3,9,266,4878,0,0,0,0,0,0,0,0,0}, - {3,10,4913,3247,0,0,0,0,0,0,0,0,0}, - {3,11,4763,3937,0,0,0,0,0,0,0,0,0}, - {3,12,3590,2903,0,0,0,0,0,0,0,0,0}, - {3,13,2566,4215,0,0,0,0,0,0,0,0,0}, - {3,14,5208,4707,0,0,0,0,0,0,0,0,0}, - {3,15,3940,3388,0,0,0,0,0,0,0,0,0}, - {3,16,5109,4556,0,0,0,0,0,0,0,0,0}, - {3,17,4908,4177,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_3_5S_DVBS2[27][13] = { + { 12, 2765, 5713, 6426, 3596, 1374, 4811, 2182, 544, 3394, 2840, 4310, 771 }, + { 12, 4951, 211, 2208, 723, 1246, 2928, 398, 5739, 265, 5601, 5993, 2615 }, + { 12, 210, 4730, 5777, 3096, 4282, 6238, 4939, 1119, 6463, 5298, 6320, 4016 }, + { 12, 4167, 2063, 4757, 3157, 5664, 3956, 6045, 563, 4284, 2441, 3412, 6334 }, + { 12, 4201, 2428, 4474, 59, 1721, 736, 2997, 428, 3807, 1513, 4732, 6195 }, + { 12, 2670, 3081, 5139, 3736, 1999, 5889, 4362, 3806, 4534, 5409, 6384, 5809 }, + { 12, 5516, 1622, 2906, 3285, 1257, 5797, 3816, 817, 875, 2311, 3543, 1205 }, + { 12, 4244, 2184, 5415, 1705, 5642, 4886, 2333, 287, 1848, 1121, 3595, 6022 }, + { 12, 2142, 2830, 4069, 5654, 1295, 2951, 3919, 1356, 884, 1786, 396, 4738 }, + { 3, 0, 2161, 2653, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 1380, 1461, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 2502, 3707, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 3971, 1057, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 5985, 6062, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 1733, 6028, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 3786, 1936, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 4292, 956, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 5692, 3417, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 266, 4878, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 4913, 3247, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 4763, 3937, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 3590, 2903, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 2566, 4215, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 5208, 4707, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15, 3940, 3388, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16, 5109, 4556, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17, 4908, 4177, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_2_3S[30][14]= - { - {13,0,2084,1613,1548,1286,1460,3196,4297,2481,3369,3451,4620,2622}, - {13,1,122,1516,3448,2880,1407,1847,3799,3529,373,971,4358,3108}, - {13,2,259,3399,929,2650,864,3996,3833,107,5287,164,3125,2350}, - {3,3,342,3529,0,0,0,0,0,0,0,0,0,0}, - {3,4,4198,2147,0,0,0,0,0,0,0,0,0,0}, - {3,5,1880,4836,0,0,0,0,0,0,0,0,0,0}, - {3,6,3864,4910,0,0,0,0,0,0,0,0,0,0}, - {3,7,243,1542,0,0,0,0,0,0,0,0,0,0}, - {3,8,3011,1436,0,0,0,0,0,0,0,0,0,0}, - {3,9,2167,2512,0,0,0,0,0,0,0,0,0,0}, - {3,10,4606,1003,0,0,0,0,0,0,0,0,0,0}, - {3,11,2835,705,0,0,0,0,0,0,0,0,0,0}, - {3,12,3426,2365,0,0,0,0,0,0,0,0,0,0}, - {3,13,3848,2474,0,0,0,0,0,0,0,0,0,0}, - {3,14,1360,1743,0,0,0,0,0,0,0,0,0,0}, - {3,0,163,2536,0,0,0,0,0,0,0,0,0,0}, - {3,1,2583,1180,0,0,0,0,0,0,0,0,0,0}, - {3,2,1542,509,0,0,0,0,0,0,0,0,0,0}, - {3,3,4418,1005,0,0,0,0,0,0,0,0,0,0}, - {3,4,5212,5117,0,0,0,0,0,0,0,0,0,0}, - {3,5,2155,2922,0,0,0,0,0,0,0,0,0,0}, - {3,6,347,2696,0,0,0,0,0,0,0,0,0,0}, - {3,7,226,4296,0,0,0,0,0,0,0,0,0,0}, - {3,8,1560,487,0,0,0,0,0,0,0,0,0,0}, - {3,9,3926,1640,0,0,0,0,0,0,0,0,0,0}, - {3,10,149,2928,0,0,0,0,0,0,0,0,0,0}, - {3,11,2364,563,0,0,0,0,0,0,0,0,0,0}, - {3,12,635,688,0,0,0,0,0,0,0,0,0,0}, - {3,13,231,1684,0,0,0,0,0,0,0,0,0,0}, - {3,14,1129,3894,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_2_3S[30][14] = { + { 13, 0, 2084, 1613, 1548, 1286, 1460, 3196, 4297, 2481, 3369, 3451, 4620, 2622 }, + { 13, 1, 122, 1516, 3448, 2880, 1407, 1847, 3799, 3529, 373, 971, 4358, 3108 }, + { 13, 2, 259, 3399, 929, 2650, 864, 3996, 3833, 107, 5287, 164, 3125, 2350 }, + { 3, 3, 342, 3529, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 4198, 2147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 1880, 4836, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 3864, 4910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 243, 1542, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 3011, 1436, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 2167, 2512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 4606, 1003, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 2835, 705, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 3426, 2365, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 3848, 2474, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 1360, 1743, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 163, 2536, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 2583, 1180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 1542, 509, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 4418, 1005, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 5212, 5117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 2155, 2922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 347, 2696, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 226, 4296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 1560, 487, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 3926, 1640, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 149, 2928, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 2364, 563, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12, 635, 688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 13, 231, 1684, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 14, 1129, 3894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_3_4S[33][13]= - { - {12,3,3198,478,4207,1481,1009,2616,1924,3437,554,683,1801}, - {3,4,2681,2135,0,0,0,0,0,0,0,0,0}, - {3,5,3107,4027,0,0,0,0,0,0,0,0,0}, - {3,6,2637,3373,0,0,0,0,0,0,0,0,0}, - {3,7,3830,3449,0,0,0,0,0,0,0,0,0}, - {3,8,4129,2060,0,0,0,0,0,0,0,0,0}, - {3,9,4184,2742,0,0,0,0,0,0,0,0,0}, - {3,10,3946,1070,0,0,0,0,0,0,0,0,0}, - {3,11,2239,984,0,0,0,0,0,0,0,0,0}, - {3,0,1458,3031,0,0,0,0,0,0,0,0,0}, - {3,1,3003,1328,0,0,0,0,0,0,0,0,0}, - {3,2,1137,1716,0,0,0,0,0,0,0,0,0}, - {3,3,132,3725,0,0,0,0,0,0,0,0,0}, - {3,4,1817,638,0,0,0,0,0,0,0,0,0}, - {3,5,1774,3447,0,0,0,0,0,0,0,0,0}, - {3,6,3632,1257,0,0,0,0,0,0,0,0,0}, - {3,7,542,3694,0,0,0,0,0,0,0,0,0}, - {3,8,1015,1945,0,0,0,0,0,0,0,0,0}, - {3,9,1948,412,0,0,0,0,0,0,0,0,0}, - {3,10,995,2238,0,0,0,0,0,0,0,0,0}, - {3,11,4141,1907,0,0,0,0,0,0,0,0,0}, - {3,0,2480,3079,0,0,0,0,0,0,0,0,0}, - {3,1,3021,1088,0,0,0,0,0,0,0,0,0}, - {3,2,713,1379,0,0,0,0,0,0,0,0,0}, - {3,3,997,3903,0,0,0,0,0,0,0,0,0}, - {3,4,2323,3361,0,0,0,0,0,0,0,0,0}, - {3,5,1110,986,0,0,0,0,0,0,0,0,0}, - {3,6,2532,142,0,0,0,0,0,0,0,0,0}, - {3,7,1690,2405,0,0,0,0,0,0,0,0,0}, - {3,8,1298,1881,0,0,0,0,0,0,0,0,0}, - {3,9,615,174,0,0,0,0,0,0,0,0,0}, - {3,10,1648,3112,0,0,0,0,0,0,0,0,0}, - {3,11,1415,2808,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_3_4S[33][13] = { + { 12, 3, 3198, 478, 4207, 1481, 1009, 2616, 1924, 3437, 554, 683, 1801 }, + { 3, 4, 2681, 2135, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 3107, 4027, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 2637, 3373, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 3830, 3449, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 4129, 2060, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 4184, 2742, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 3946, 1070, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 2239, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 1458, 3031, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 3003, 1328, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 1137, 1716, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 132, 3725, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 1817, 638, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 1774, 3447, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 3632, 1257, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 542, 3694, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 1015, 1945, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 1948, 412, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 995, 2238, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 4141, 1907, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 2480, 3079, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 3021, 1088, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 713, 1379, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 997, 3903, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 2323, 3361, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 1110, 986, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 2532, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 1690, 2405, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8, 1298, 1881, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 615, 174, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 1648, 3112, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 1415, 2808, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_4_5S[35][4]= - { - {3,5,896,1565}, - {3,6,2493,184}, - {3,7,212,3210}, - {3,8,727,1339}, - {3,9,3428,612}, - {3,0,2663,1947}, - {3,1,230,2695}, - {3,2,2025,2794}, - {3,3,3039,283}, - {3,4,862,2889}, - {3,5,376,2110}, - {3,6,2034,2286}, - {3,7,951,2068}, - {3,8,3108,3542}, - {3,9,307,1421}, - {3,0,2272,1197}, - {3,1,1800,3280}, - {3,2,331,2308}, - {3,3,465,2552}, - {3,4,1038,2479}, - {3,5,1383,343}, - {3,6,94,236}, - {3,7,2619,121}, - {3,8,1497,2774}, - {3,9,2116,1855}, - {3,0,722,1584}, - {3,1,2767,1881}, - {3,2,2701,1610}, - {3,3,3283,1732}, - {3,4,168,1099}, - {3,5,3074,243}, - {3,6,3460,945}, - {3,7,2049,1746}, - {3,8,566,1427}, - {3,9,3545,1168} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_4_5S[35][4] = { + { 3, 5, 896, 1565 }, { 3, 6, 2493, 184 }, { 3, 7, 212, 3210 }, + { 3, 8, 727, 1339 }, { 3, 9, 3428, 612 }, { 3, 0, 2663, 1947 }, + { 3, 1, 230, 2695 }, { 3, 2, 2025, 2794 }, { 3, 3, 3039, 283 }, + { 3, 4, 862, 2889 }, { 3, 5, 376, 2110 }, { 3, 6, 2034, 2286 }, + { 3, 7, 951, 2068 }, { 3, 8, 3108, 3542 }, { 3, 9, 307, 1421 }, + { 3, 0, 2272, 1197 }, { 3, 1, 1800, 3280 }, { 3, 2, 331, 2308 }, + { 3, 3, 465, 2552 }, { 3, 4, 1038, 2479 }, { 3, 5, 1383, 343 }, + { 3, 6, 94, 236 }, { 3, 7, 2619, 121 }, { 3, 8, 1497, 2774 }, + { 3, 9, 2116, 1855 }, { 3, 0, 722, 1584 }, { 3, 1, 2767, 1881 }, + { 3, 2, 2701, 1610 }, { 3, 3, 3283, 1732 }, { 3, 4, 168, 1099 }, + { 3, 5, 3074, 243 }, { 3, 6, 3460, 945 }, { 3, 7, 2049, 1746 }, + { 3, 8, 566, 1427 }, { 3, 9, 3545, 1168 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_5_6S[37][14]= - { - {13,3,2409,499,1481,908,559,716,1270,333,2508,2264,1702,2805}, - {3,4,2447,1926,0,0,0,0,0,0,0,0,0,0}, - {3,5,414,1224,0,0,0,0,0,0,0,0,0,0}, - {3,6,2114,842,0,0,0,0,0,0,0,0,0,0}, - {3,7,212,573,0,0,0,0,0,0,0,0,0,0}, - {3,0,2383,2112,0,0,0,0,0,0,0,0,0,0}, - {3,1,2286,2348,0,0,0,0,0,0,0,0,0,0}, - {3,2,545,819,0,0,0,0,0,0,0,0,0,0}, - {3,3,1264,143,0,0,0,0,0,0,0,0,0,0}, - {3,4,1701,2258,0,0,0,0,0,0,0,0,0,0}, - {3,5,964,166,0,0,0,0,0,0,0,0,0,0}, - {3,6,114,2413,0,0,0,0,0,0,0,0,0,0}, - {3,7,2243,81,0,0,0,0,0,0,0,0,0,0}, - {3,0,1245,1581,0,0,0,0,0,0,0,0,0,0}, - {3,1,775,169,0,0,0,0,0,0,0,0,0,0}, - {3,2,1696,1104,0,0,0,0,0,0,0,0,0,0}, - {3,3,1914,2831,0,0,0,0,0,0,0,0,0,0}, - {3,4,532,1450,0,0,0,0,0,0,0,0,0,0}, - {3,5,91,974,0,0,0,0,0,0,0,0,0,0}, - {3,6,497,2228,0,0,0,0,0,0,0,0,0,0}, - {3,7,2326,1579,0,0,0,0,0,0,0,0,0,0}, - {3,0,2482,256,0,0,0,0,0,0,0,0,0,0}, - {3,1,1117,1261,0,0,0,0,0,0,0,0,0,0}, - {3,2,1257,1658,0,0,0,0,0,0,0,0,0,0}, - {3,3,1478,1225,0,0,0,0,0,0,0,0,0,0}, - {3,4,2511,980,0,0,0,0,0,0,0,0,0,0}, - {3,5,2320,2675,0,0,0,0,0,0,0,0,0,0}, - {3,6,435,1278,0,0,0,0,0,0,0,0,0,0}, - {3,7,228,503,0,0,0,0,0,0,0,0,0,0}, - {3,0,1885,2369,0,0,0,0,0,0,0,0,0,0}, - {3,1,57,483,0,0,0,0,0,0,0,0,0,0}, - {3,2,838,1050,0,0,0,0,0,0,0,0,0,0}, - {3,3,1231,1990,0,0,0,0,0,0,0,0,0,0}, - {3,4,1738,68,0,0,0,0,0,0,0,0,0,0}, - {3,5,2392,951,0,0,0,0,0,0,0,0,0,0}, - {3,6,163,645,0,0,0,0,0,0,0,0,0,0}, - {3,7,2644,1704,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_5_6S[37][14] = { + { 13, 3, 2409, 499, 1481, 908, 559, 716, 1270, 333, 2508, 2264, 1702, 2805 }, + { 3, 4, 2447, 1926, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 414, 1224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 2114, 842, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 212, 573, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 2383, 2112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 2286, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 545, 819, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 1264, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 1701, 2258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 964, 166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 114, 2413, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 2243, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 1245, 1581, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 775, 169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 1696, 1104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 1914, 2831, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 532, 1450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 91, 974, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 497, 2228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 2326, 1579, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 2482, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 1117, 1261, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 1257, 1658, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 1478, 1225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 2511, 980, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 2320, 2675, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 435, 1278, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 228, 503, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 1885, 2369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1, 57, 483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 838, 1050, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 1231, 1990, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4, 1738, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5, 2392, 951, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6, 163, 645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7, 2644, 1704, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_8_9S[40][5]= - { - {4,0,1558,712,805}, - {4,1,1450,873,1337}, - {4,2,1741,1129,1184}, - {4,3,294,806,1566}, - {4,4,482,605,923}, - {3,0,926,1578,0}, - {3,1,777,1374,0}, - {3,2,608,151,0}, - {3,3,1195,210,0}, - {3,4,1484,692,0}, - {3,0,427,488,0}, - {3,1,828,1124,0}, - {3,2,874,1366,0}, - {3,3,1500,835,0}, - {3,4,1496,502,0}, - {3,0,1006,1701,0}, - {3,1,1155,97,0}, - {3,2,657,1403,0}, - {3,3,1453,624,0}, - {3,4,429,1495,0}, - {3,0,809,385,0}, - {3,1,367,151,0}, - {3,2,1323,202,0}, - {3,3,960,318,0}, - {3,4,1451,1039,0}, - {3,0,1098,1722,0}, - {3,1,1015,1428,0}, - {3,2,1261,1564,0}, - {3,3,544,1190,0}, - {3,4,1472,1246,0}, - {3,0,508,630,0}, - {3,1,421,1704,0}, - {3,2,284,898,0}, - {3,3,392,577,0}, - {3,4,1155,556,0}, - {3,0,631,1000,0}, - {3,1,732,1368,0}, - {3,2,1328,329,0}, - {3,3,1515,506,0}, - {3,4,1104,1172,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_8_9S[40][5] = { + { 4, 0, 1558, 712, 805 }, { 4, 1, 1450, 873, 1337 }, { 4, 2, 1741, 1129, 1184 }, + { 4, 3, 294, 806, 1566 }, { 4, 4, 482, 605, 923 }, { 3, 0, 926, 1578, 0 }, + { 3, 1, 777, 1374, 0 }, { 3, 2, 608, 151, 0 }, { 3, 3, 1195, 210, 0 }, + { 3, 4, 1484, 692, 0 }, { 3, 0, 427, 488, 0 }, { 3, 1, 828, 1124, 0 }, + { 3, 2, 874, 1366, 0 }, { 3, 3, 1500, 835, 0 }, { 3, 4, 1496, 502, 0 }, + { 3, 0, 1006, 1701, 0 }, { 3, 1, 1155, 97, 0 }, { 3, 2, 657, 1403, 0 }, + { 3, 3, 1453, 624, 0 }, { 3, 4, 429, 1495, 0 }, { 3, 0, 809, 385, 0 }, + { 3, 1, 367, 151, 0 }, { 3, 2, 1323, 202, 0 }, { 3, 3, 960, 318, 0 }, + { 3, 4, 1451, 1039, 0 }, { 3, 0, 1098, 1722, 0 }, { 3, 1, 1015, 1428, 0 }, + { 3, 2, 1261, 1564, 0 }, { 3, 3, 544, 1190, 0 }, { 3, 4, 1472, 1246, 0 }, + { 3, 0, 508, 630, 0 }, { 3, 1, 421, 1704, 0 }, { 3, 2, 284, 898, 0 }, + { 3, 3, 392, 577, 0 }, { 3, 4, 1155, 556, 0 }, { 3, 0, 631, 1000, 0 }, + { 3, 1, 732, 1368, 0 }, { 3, 2, 1328, 329, 0 }, { 3, 3, 1515, 506, 0 }, + { 3, 4, 1104, 1172, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_11_45S[11][11]= - { - {10,9054,9186,12155,1000,7383,6459,2992,4723,8135,11250}, - {10,2624,9237,7139,12238,11962,4361,5292,10967,11036,8105}, - {10,2044,11996,5654,7568,7002,3549,4767,8767,2872,8345}, - {10,6966,8473,5180,8084,3359,5051,9576,5139,1893,902}, - {10,3041,3801,8252,11951,909,8535,1038,8400,3200,4585}, - {3,5291,10484,10872,0,0,0,0,0,0,0}, - {3,442,7516,3720,0,0,0,0,0,0,0}, - {3,11469,769,10998,0,0,0,0,0,0,0}, - {3,10575,1436,2935,0,0,0,0,0,0,0}, - {3,6905,8610,11285,0,0,0,0,0,0,0}, - {3,1873,5634,6383,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_11_45S[11][11] = { + { 10, 9054, 9186, 12155, 1000, 7383, 6459, 2992, 4723, 8135, 11250 }, + { 10, 2624, 9237, 7139, 12238, 11962, 4361, 5292, 10967, 11036, 8105 }, + { 10, 2044, 11996, 5654, 7568, 7002, 3549, 4767, 8767, 2872, 8345 }, + { 10, 6966, 8473, 5180, 8084, 3359, 5051, 9576, 5139, 1893, 902 }, + { 10, 3041, 3801, 8252, 11951, 909, 8535, 1038, 8400, 3200, 4585 }, + { 3, 5291, 10484, 10872, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 442, 7516, 3720, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11469, 769, 10998, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10575, 1436, 2935, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6905, 8610, 11285, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1873, 5634, 6383, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_4_15S[12][22]= - { - {21,1953,2331,2545,2623,4653,5012,5700,6458,6875,7605,7694,7881,8416,8758,9181,9555,9578,9932,10068,11479,11699}, - {21,514,784,2059,2129,2386,2454,3396,5184,6624,6825,7533,7861,9116,9473,9601,10432,11011,11159,11378,11528,11598}, - {21,483,1303,1735,2291,3302,3648,4222,4522,5511,6626,6804,7404,7752,7982,8108,8930,9151,9793,9876,10786,11879}, - {4,1956,7572,9020,9971,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,13,1578,7445,8373,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,6805,6857,8615,11179,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,7983,8022,10017,11748,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,4939,8861,10444,11661,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,2278,3733,6265,10009,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,4494,7974,10649,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,8909,11030,11696,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3131,9964,10480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_4_15S[12][22] = { + { 21, 1953, 2331, 2545, 2623, 4653, 5012, 5700, 6458, 6875, 7605, + 7694, 7881, 8416, 8758, 9181, 9555, 9578, 9932, 10068, 11479, 11699 }, + { 21, 514, 784, 2059, 2129, 2386, 2454, 3396, 5184, 6624, 6825, + 7533, 7861, 9116, 9473, 9601, 10432, 11011, 11159, 11378, 11528, 11598 }, + { 21, 483, 1303, 1735, 2291, 3302, 3648, 4222, 4522, 5511, 6626, + 6804, 7404, 7752, 7982, 8108, 8930, 9151, 9793, 9876, 10786, 11879 }, + { 4, 1956, 7572, 9020, 9971, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 13, 1578, 7445, 8373, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 6805, 6857, 8615, 11179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 7983, 8022, 10017, 11748, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4939, 8861, 10444, 11661, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2278, 3733, 6265, 10009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4494, 7974, 10649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8909, 11030, 11696, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3131, 9964, 10480, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_14_45S[14][13]= - { - {12,1606,3617,7973,6737,9495,4209,9209,4565,4250,7823,9384,400}, - {12,4105,991,923,3562,3892,10993,5640,8196,6652,4653,9116,7677}, - {12,6348,1341,5445,1494,7799,831,4952,5106,3011,9921,6537,8476}, - {12,7854,5274,8572,3741,5674,11128,4097,1398,5671,7302,8155,2641}, - {12,6548,2103,590,5749,5722,10,2682,1063,633,2949,207,6065}, - {9,2828,6366,4766,399,935,7611,84,150,3146,0,0,0}, - {3,5363,7455,7140,0,0,0,0,0,0,0,0,0}, - {3,9297,482,4848,0,0,0,0,0,0,0,0,0}, - {3,8458,1631,5344,0,0,0,0,0,0,0,0,0}, - {3,5729,6767,4836,0,0,0,0,0,0,0,0,0}, - {3,11019,4463,3882,0,0,0,0,0,0,0,0,0}, - {3,4107,9610,5454,0,0,0,0,0,0,0,0,0}, - {3,11137,4328,6307,0,0,0,0,0,0,0,0,0}, - {3,3260,7897,3809,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_14_45S[14][13] = { + { 12, 1606, 3617, 7973, 6737, 9495, 4209, 9209, 4565, 4250, 7823, 9384, 400 }, + { 12, 4105, 991, 923, 3562, 3892, 10993, 5640, 8196, 6652, 4653, 9116, 7677 }, + { 12, 6348, 1341, 5445, 1494, 7799, 831, 4952, 5106, 3011, 9921, 6537, 8476 }, + { 12, 7854, 5274, 8572, 3741, 5674, 11128, 4097, 1398, 5671, 7302, 8155, 2641 }, + { 12, 6548, 2103, 590, 5749, 5722, 10, 2682, 1063, 633, 2949, 207, 6065 }, + { 9, 2828, 6366, 4766, 399, 935, 7611, 84, 150, 3146, 0, 0, 0 }, + { 3, 5363, 7455, 7140, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9297, 482, 4848, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8458, 1631, 5344, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5729, 6767, 4836, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11019, 4463, 3882, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4107, 9610, 5454, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11137, 4328, 6307, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3260, 7897, 3809, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_7_15S[21][25]= - { - {24,3,137,314,327,983,1597,2028,3043,3217,4109,6020,6178,6535,6560,7146,7180,7408,7790,7893,8123,8313,8526,8616,8638}, - {24,356,1197,1208,1839,1903,2712,3088,3537,4091,4301,4919,5068,6025,6195,6324,6378,6686,6829,7558,7745,8042,8382,8587,8602}, - {24,18,187,1115,1417,1463,2300,2328,3502,3805,4677,4827,5551,5968,6394,6412,6753,7169,7524,7695,7976,8069,8118,8522,8582}, - {24,714,2713,2726,2964,3055,3220,3334,3459,5557,5765,5841,6290,6419,6573,6856,7786,7937,8156,8286,8327,8384,8448,8539,8559}, - {4,3452,7935,8092,8623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,56,1955,3000,8242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,1809,4094,7991,8489,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,2220,6455,7849,8548,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,1006,2576,3247,6976,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,2177,6048,7795,8295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,1413,2595,7446,8594,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,2101,3714,7541,8531,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,10,5961,7484,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3144,4636,5282,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5708,5875,8390,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3322,5223,7975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,197,4653,8283,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,598,5393,8624,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,906,7249,7542,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1223,2148,8195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,976,2001,5005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_7_15S + [21][25] = { { 24, 3, 137, 314, 327, 983, 1597, 2028, 3043, + 3217, 4109, 6020, 6178, 6535, 6560, 7146, 7180, 7408, + 7790, 7893, 8123, 8313, 8526, 8616, 8638 }, + { 24, 356, 1197, 1208, 1839, 1903, 2712, 3088, 3537, + 4091, 4301, 4919, 5068, 6025, 6195, 6324, 6378, 6686, + 6829, 7558, 7745, 8042, 8382, 8587, 8602 }, + { 24, 18, 187, 1115, 1417, 1463, 2300, 2328, 3502, + 3805, 4677, 4827, 5551, 5968, 6394, 6412, 6753, 7169, + 7524, 7695, 7976, 8069, 8118, 8522, 8582 }, + { 24, 714, 2713, 2726, 2964, 3055, 3220, 3334, 3459, + 5557, 5765, 5841, 6290, 6419, 6573, 6856, 7786, 7937, + 8156, 8286, 8327, 8384, 8448, 8539, 8559 }, + { 4, 3452, 7935, 8092, 8623, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 56, 1955, 3000, 8242, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1809, 4094, 7991, 8489, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2220, 6455, 7849, 8548, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1006, 2576, 3247, 6976, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2177, 6048, 7795, 8295, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 1413, 2595, 7446, 8594, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2101, 3714, 7541, 8531, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10, 5961, 7484, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3144, 4636, 5282, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5708, 5875, 8390, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3322, 5223, 7975, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 197, 4653, 8283, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 598, 5393, 8624, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 906, 7249, 7542, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1223, 2148, 8195, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 976, 2001, 5005, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; - const int dvb_ldpc_bb_impl::ldpc_tab_8_15S[24][22]= - { - {21,32,384,430,591,1296,1976,1999,2137,2175,3638,4214,4304,4486,4662,4999,5174,5700,6969,7115,7138,7189}, - {21,1788,1881,1910,2724,4504,4928,4973,5616,5686,5718,5846,6523,6893,6994,7074,7100,7277,7399,7476,7480,7537}, - {21,2791,2824,2927,4196,4298,4800,4948,5361,5401,5688,5818,5862,5969,6029,6244,6645,6962,7203,7302,7454,7534}, - {21,574,1461,1826,2056,2069,2387,2794,3349,3366,4951,5826,5834,5903,6640,6762,6786,6859,7043,7418,7431,7554}, - {21,14,178,675,823,890,930,1209,1311,2898,4339,4600,5203,6485,6549,6970,7208,7218,7298,7454,7457,7462}, - {4,4075,4188,7313,7553,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,5145,6018,7148,7507,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,3198,4858,6983,7033,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,3170,5126,5625,6901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {4,2839,6093,7071,7450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,11,3735,5413,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2497,5400,7238,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2067,5172,5714,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1889,7173,7329,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1795,2773,3499,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2695,2944,6735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,3221,4625,5897,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1690,6122,6816,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,5013,6839,7358,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1601,6849,7415,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2180,7389,7543,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,2121,6838,7054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,1948,3109,5046,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {3,272,1015,7464,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_8_15S[24][22] = { + { 21, 32, 384, 430, 591, 1296, 1976, 1999, 2137, 2175, 3638, + 4214, 4304, 4486, 4662, 4999, 5174, 5700, 6969, 7115, 7138, 7189 }, + { 21, 1788, 1881, 1910, 2724, 4504, 4928, 4973, 5616, 5686, 5718, + 5846, 6523, 6893, 6994, 7074, 7100, 7277, 7399, 7476, 7480, 7537 }, + { 21, 2791, 2824, 2927, 4196, 4298, 4800, 4948, 5361, 5401, 5688, + 5818, 5862, 5969, 6029, 6244, 6645, 6962, 7203, 7302, 7454, 7534 }, + { 21, 574, 1461, 1826, 2056, 2069, 2387, 2794, 3349, 3366, 4951, + 5826, 5834, 5903, 6640, 6762, 6786, 6859, 7043, 7418, 7431, 7554 }, + { 21, 14, 178, 675, 823, 890, 930, 1209, 1311, 2898, 4339, + 4600, 5203, 6485, 6549, 6970, 7208, 7218, 7298, 7454, 7457, 7462 }, + { 4, 4075, 4188, 7313, 7553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 5145, 6018, 7148, 7507, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3198, 4858, 6983, 7033, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 3170, 5126, 5625, 6901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 2839, 6093, 7071, 7450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11, 3735, 5413, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2497, 5400, 7238, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2067, 5172, 5714, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1889, 7173, 7329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1795, 2773, 3499, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2695, 2944, 6735, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3221, 4625, 5897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1690, 6122, 6816, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5013, 6839, 7358, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1601, 6849, 7415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2180, 7389, 7543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2121, 6838, 7054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1948, 3109, 5046, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 272, 1015, 7464, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_26_45S[26][14]= - { - {13,6106,5389,698,6749,6294,1653,1984,2167,6139,6095,3832,2468,6115}, - {13,4202,2362,1852,1264,3564,6345,498,6137,3908,3302,527,2767,6667}, - {12,3422,1242,1377,2238,2899,1974,1957,261,3463,4994,215,2338,0}, - {12,3016,5109,6533,2665,5300,4908,4967,5787,726,229,1970,2789,0}, - {12,6146,5765,6649,2871,884,1670,2597,5058,3659,6594,5042,304,0}, - {12,5521,2811,0,4214,2626,2211,1236,3771,852,6356,6797,3463,0}, - {12,1523,1830,3938,5593,2128,5791,3421,3680,6692,1377,3808,3475,0}, - {12,5551,6035,2247,3662,759,6783,116,6380,4586,3367,1,5003,0}, - {3,3518,6557,6510,0,0,0,0,0,0,0,0,0,0}, - {3,1830,839,4421,0,0,0,0,0,0,0,0,0,0}, - {3,5431,5959,6152,0,0,0,0,0,0,0,0,0,0}, - {3,3174,5113,4520,0,0,0,0,0,0,0,0,0,0}, - {3,5399,1303,2496,0,0,0,0,0,0,0,0,0,0}, - {3,2841,741,220,0,0,0,0,0,0,0,0,0,0}, - {3,2731,1830,4193,0,0,0,0,0,0,0,0,0,0}, - {3,1875,3935,223,0,0,0,0,0,0,0,0,0,0}, - {3,9,4720,423,0,0,0,0,0,0,0,0,0,0}, - {3,3107,2676,840,0,0,0,0,0,0,0,0,0,0}, - {3,1950,6177,6457,0,0,0,0,0,0,0,0,0,0}, - {3,4091,94,5102,0,0,0,0,0,0,0,0,0,0}, - {3,1907,6050,3455,0,0,0,0,0,0,0,0,0,0}, - {3,714,3,559,0,0,0,0,0,0,0,0,0,0}, - {3,502,4268,4164,0,0,0,0,0,0,0,0,0,0}, - {3,1019,5558,271,0,0,0,0,0,0,0,0,0,0}, - {3,6127,854,3221,0,0,0,0,0,0,0,0,0,0}, - {3,959,5337,2735,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_26_45S[26][14] = { + { 13, 6106, 5389, 698, 6749, 6294, 1653, 1984, 2167, 6139, 6095, 3832, 2468, 6115 }, + { 13, 4202, 2362, 1852, 1264, 3564, 6345, 498, 6137, 3908, 3302, 527, 2767, 6667 }, + { 12, 3422, 1242, 1377, 2238, 2899, 1974, 1957, 261, 3463, 4994, 215, 2338, 0 }, + { 12, 3016, 5109, 6533, 2665, 5300, 4908, 4967, 5787, 726, 229, 1970, 2789, 0 }, + { 12, 6146, 5765, 6649, 2871, 884, 1670, 2597, 5058, 3659, 6594, 5042, 304, 0 }, + { 12, 5521, 2811, 0, 4214, 2626, 2211, 1236, 3771, 852, 6356, 6797, 3463, 0 }, + { 12, 1523, 1830, 3938, 5593, 2128, 5791, 3421, 3680, 6692, 1377, 3808, 3475, 0 }, + { 12, 5551, 6035, 2247, 3662, 759, 6783, 116, 6380, 4586, 3367, 1, 5003, 0 }, + { 3, 3518, 6557, 6510, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1830, 839, 4421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5431, 5959, 6152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3174, 5113, 4520, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5399, 1303, 2496, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2841, 741, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2731, 1830, 4193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1875, 3935, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9, 4720, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3107, 2676, 840, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1950, 6177, 6457, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4091, 94, 5102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1907, 6050, 3455, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 714, 3, 559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 502, 4268, 4164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1019, 5558, 271, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6127, 854, 3221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 959, 5337, 2735, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_32_45S[32][13]= - { - {12,2686,655,2308,1603,336,1743,2778,1263,3555,185,4212,621}, - {12,286,2994,2599,2265,126,314,3992,4560,2845,2764,2540,1476}, - {12,2670,3599,2900,2281,3597,2768,4423,2805,836,130,1204,4162}, - {12,1884,4228,1253,2578,3053,3650,2587,4468,2784,1644,1490,4655}, - {12,4258,1699,4363,4555,3810,4046,3806,344,2459,4067,3327,3510}, - {5,1021,2741,2528,2168,2820,0,0,0,0,0,0,0}, - {3,254,1080,616,0,0,0,0,0,0,0,0,0}, - {3,1465,4192,2972,0,0,0,0,0,0,0,0,0}, - {3,2356,2976,1534,0,0,0,0,0,0,0,0,0}, - {3,4412,1937,2724,0,0,0,0,0,0,0,0,0}, - {3,1430,3024,600,0,0,0,0,0,0,0,0,0}, - {3,1952,2136,3573,0,0,0,0,0,0,0,0,0}, - {3,3009,3123,1288,0,0,0,0,0,0,0,0,0}, - {3,4553,2299,806,0,0,0,0,0,0,0,0,0}, - {3,2997,402,4330,0,0,0,0,0,0,0,0,0}, - {3,3302,4567,698,0,0,0,0,0,0,0,0,0}, - {3,2364,498,3146,0,0,0,0,0,0,0,0,0}, - {3,1809,647,992,0,0,0,0,0,0,0,0,0}, - {3,3512,32,4301,0,0,0,0,0,0,0,0,0}, - {3,1238,251,450,0,0,0,0,0,0,0,0,0}, - {3,1657,737,641,0,0,0,0,0,0,0,0,0}, - {3,560,1720,2893,0,0,0,0,0,0,0,0,0}, - {3,1689,2206,902,0,0,0,0,0,0,0,0,0}, - {3,3998,1784,2094,0,0,0,0,0,0,0,0,0}, - {3,2090,3126,1201,0,0,0,0,0,0,0,0,0}, - {3,1565,764,3473,0,0,0,0,0,0,0,0,0}, - {3,891,903,2413,0,0,0,0,0,0,0,0,0}, - {3,2286,2900,2348,0,0,0,0,0,0,0,0,0}, - {3,3026,2033,1502,0,0,0,0,0,0,0,0,0}, - {3,2404,1243,556,0,0,0,0,0,0,0,0,0}, - {3,308,2222,3825,0,0,0,0,0,0,0,0,0}, - {3,1523,3311,389,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_32_45S[32][13] = { + { 12, 2686, 655, 2308, 1603, 336, 1743, 2778, 1263, 3555, 185, 4212, 621 }, + { 12, 286, 2994, 2599, 2265, 126, 314, 3992, 4560, 2845, 2764, 2540, 1476 }, + { 12, 2670, 3599, 2900, 2281, 3597, 2768, 4423, 2805, 836, 130, 1204, 4162 }, + { 12, 1884, 4228, 1253, 2578, 3053, 3650, 2587, 4468, 2784, 1644, 1490, 4655 }, + { 12, 4258, 1699, 4363, 4555, 3810, 4046, 3806, 344, 2459, 4067, 3327, 3510 }, + { 5, 1021, 2741, 2528, 2168, 2820, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 254, 1080, 616, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1465, 4192, 2972, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2356, 2976, 1534, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4412, 1937, 2724, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1430, 3024, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1952, 2136, 3573, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3009, 3123, 1288, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4553, 2299, 806, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2997, 402, 4330, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3302, 4567, 698, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2364, 498, 3146, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1809, 647, 992, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3512, 32, 4301, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1238, 251, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1657, 737, 641, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 560, 1720, 2893, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1689, 2206, 902, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3998, 1784, 2094, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2090, 3126, 1201, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1565, 764, 3473, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 891, 903, 2413, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2286, 2900, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3026, 2033, 1502, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2404, 1243, 556, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 308, 2222, 3825, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1523, 3311, 389, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_1_5M[18][14]= - { - {13,18222,6715,4908,21568,22821,11708,4769,4495,22243,25872,9051,19072,13956}, - {13,2038,5205,21215,21009,9584,2403,23652,20866,20130,677,9509,6136,773}, - {13,19936,14590,17829,473,4432,23171,11386,17937,22084,24450,267,8822,19335}, - {13,16376,16769,5111,9794,18907,827,12385,12370,21647,10938,23619,11633,15865}, - {13,23417,7631,12243,21546,4192,22117,14757,4118,9686,17021,8531,15989,8807}, - {13,15533,16584,18529,19699,17821,4252,1254,5952,3163,20295,6944,1022,19743}, - {13,129,16579,23524,25897,14690,11222,16250,9925,4268,999,7102,24528,152}, - {13,18361,3708,3454,16604,1551,5809,20324,4775,22418,19091,19674,10975,7327}, - {13,24133,10950,22779,11388,13818,20668,7556,12333,16446,19684,12510,25118,8162}, - {3,17026,6850,1269,0,0,0,0,0,0,0,0,0,0}, - {3,21895,7137,25270,0,0,0,0,0,0,0,0,0,0}, - {3,11858,24153,13303,0,0,0,0,0,0,0,0,0,0}, - {3,7885,16438,12805,0,0,0,0,0,0,0,0,0,0}, - {3,10473,15004,8052,0,0,0,0,0,0,0,0,0,0}, - {3,2088,10379,10067,0,0,0,0,0,0,0,0,0,0}, - {3,21438,13426,10440,0,0,0,0,0,0,0,0,0,0}, - {3,17696,727,12164,0,0,0,0,0,0,0,0,0,0}, - {3,22623,8408,17849,0,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_1_5M[18][14] = { + { 13, + 18222, + 6715, + 4908, + 21568, + 22821, + 11708, + 4769, + 4495, + 22243, + 25872, + 9051, + 19072, + 13956 }, + { 13, + 2038, + 5205, + 21215, + 21009, + 9584, + 2403, + 23652, + 20866, + 20130, + 677, + 9509, + 6136, + 773 }, + { 13, + 19936, + 14590, + 17829, + 473, + 4432, + 23171, + 11386, + 17937, + 22084, + 24450, + 267, + 8822, + 19335 }, + { 13, + 16376, + 16769, + 5111, + 9794, + 18907, + 827, + 12385, + 12370, + 21647, + 10938, + 23619, + 11633, + 15865 }, + { 13, + 23417, + 7631, + 12243, + 21546, + 4192, + 22117, + 14757, + 4118, + 9686, + 17021, + 8531, + 15989, + 8807 }, + { 13, + 15533, + 16584, + 18529, + 19699, + 17821, + 4252, + 1254, + 5952, + 3163, + 20295, + 6944, + 1022, + 19743 }, + { 13, + 129, + 16579, + 23524, + 25897, + 14690, + 11222, + 16250, + 9925, + 4268, + 999, + 7102, + 24528, + 152 }, + { 13, + 18361, + 3708, + 3454, + 16604, + 1551, + 5809, + 20324, + 4775, + 22418, + 19091, + 19674, + 10975, + 7327 }, + { 13, + 24133, + 10950, + 22779, + 11388, + 13818, + 20668, + 7556, + 12333, + 16446, + 19684, + 12510, + 25118, + 8162 }, + { 3, 17026, 6850, 1269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21895, 7137, 25270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11858, 24153, 13303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7885, 16438, 12805, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10473, 15004, 8052, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2088, 10379, 10067, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 21438, 13426, 10440, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17696, 727, 12164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 22623, 8408, 17849, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_11_45M[22][11]= - { - {10,20617,6867,14845,11974,22563,190,17207,4052,7406,16007}, - {10,21448,14846,2543,23380,16633,20365,16869,13411,19853,795}, - {10,5200,2330,2775,23620,20643,10745,14742,6493,14222,20939}, - {10,9445,9523,12769,7332,21792,18717,16397,14016,9481,22162}, - {10,2922,6427,4497,4116,17658,2581,14364,3781,18851,22974}, - {10,10383,2184,1433,3889,12828,17424,17580,20936,1390,21374}, - {10,425,2063,22398,20907,9445,14790,4457,723,7048,4072}, - {10,11771,9640,23212,9613,12042,8335,21386,20129,13521,16301}, - {10,14867,12501,1086,21526,17701,17731,20907,8790,19224,5784}, - {10,7107,19690,17616,5800,9501,23320,16878,794,15931,17539}, - {3,4556,21783,1524,0,0,0,0,0,0,0}, - {3,20100,11706,23663,0,0,0,0,0,0,0}, - {3,2535,15530,6116,0,0,0,0,0,0,0}, - {3,12078,3867,2663,0,0,0,0,0,0,0}, - {3,19629,20246,7024,0,0,0,0,0,0,0}, - {3,11748,11426,19802,0,0,0,0,0,0,0}, - {3,15942,12333,5316,0,0,0,0,0,0,0}, - {3,11521,3170,17818,0,0,0,0,0,0,0}, - {3,2289,23780,16575,0,0,0,0,0,0,0}, - {3,6649,16991,13025,0,0,0,0,0,0,0}, - {3,20050,10619,10250,0,0,0,0,0,0,0}, - {3,3944,13063,5656,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_11_45M[22][11] = { + { 10, 20617, 6867, 14845, 11974, 22563, 190, 17207, 4052, 7406, 16007 }, + { 10, 21448, 14846, 2543, 23380, 16633, 20365, 16869, 13411, 19853, 795 }, + { 10, 5200, 2330, 2775, 23620, 20643, 10745, 14742, 6493, 14222, 20939 }, + { 10, 9445, 9523, 12769, 7332, 21792, 18717, 16397, 14016, 9481, 22162 }, + { 10, 2922, 6427, 4497, 4116, 17658, 2581, 14364, 3781, 18851, 22974 }, + { 10, 10383, 2184, 1433, 3889, 12828, 17424, 17580, 20936, 1390, 21374 }, + { 10, 425, 2063, 22398, 20907, 9445, 14790, 4457, 723, 7048, 4072 }, + { 10, 11771, 9640, 23212, 9613, 12042, 8335, 21386, 20129, 13521, 16301 }, + { 10, 14867, 12501, 1086, 21526, 17701, 17731, 20907, 8790, 19224, 5784 }, + { 10, 7107, 19690, 17616, 5800, 9501, 23320, 16878, 794, 15931, 17539 }, + { 3, 4556, 21783, 1524, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20100, 11706, 23663, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2535, 15530, 6116, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12078, 3867, 2663, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19629, 20246, 7024, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11748, 11426, 19802, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 15942, 12333, 5316, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11521, 3170, 17818, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2289, 23780, 16575, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6649, 16991, 13025, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 20050, 10619, 10250, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3944, 13063, 5656, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvb_ldpc_bb_impl::ldpc_tab_1_3M[30][13]= - { - {12,7416,4093,16722,1023,20586,12219,9175,16284,1554,10113,19849,17545}, - {12,13140,3257,2110,13888,3023,1537,1598,15018,18931,13905,10617,1014}, - {12,339,14366,3309,15360,18358,3196,4412,6023,7070,17380,2777,6691}, - {12,12720,17634,4141,1400,8247,18201,16077,11314,11928,3494,3155,2865}, - {12,21038,6928,3860,1943,20292,6526,12939,15182,3957,5651,356,2673}, - {12,20555,17905,5724,13932,1218,17763,5912,5164,6233,6220,1277,19209}, - {12,19190,4498,4950,6645,5482,5667,13701,16334,15231,735,8589,12344}, - {12,679,17849,17807,16033,10181,3368,5778,8275,2736,14042,17506,6005}, - {12,1576,10259,10525,3007,16522,697,7726,8641,14323,2893,8168,11070}, - {12,17270,10180,18740,847,4969,14715,19316,5530,17428,11193,9861,13562}, - {3,6156,18787,10467,0,0,0,0,0,0,0,0,0}, - {3,2422,3723,10769,0,0,0,0,0,0,0,0,0}, - {3,8015,18716,13406,0,0,0,0,0,0,0,0,0}, - {3,5969,15949,3084,0,0,0,0,0,0,0,0,0}, - {3,6855,13990,3764,0,0,0,0,0,0,0,0,0}, - {3,10351,15779,10392,0,0,0,0,0,0,0,0,0}, - {3,16078,19034,11279,0,0,0,0,0,0,0,0,0}, - {3,11747,6608,4188,0,0,0,0,0,0,0,0,0}, - {3,19699,8928,8045,0,0,0,0,0,0,0,0,0}, - {3,4598,7219,11391,0,0,0,0,0,0,0,0,0}, - {3,19766,11871,5692,0,0,0,0,0,0,0,0,0}, - {3,7487,15905,17621,0,0,0,0,0,0,0,0,0}, - {3,8554,7751,16516,0,0,0,0,0,0,0,0,0}, - {3,4981,20250,16146,0,0,0,0,0,0,0,0,0}, - {3,12524,21364,10793,0,0,0,0,0,0,0,0,0}, - {3,17083,2051,8862,0,0,0,0,0,0,0,0,0}, - {3,1315,6246,7721,0,0,0,0,0,0,0,0,0}, - {3,18043,16652,5502,0,0,0,0,0,0,0,0,0}, - {3,1432,5674,2224,0,0,0,0,0,0,0,0,0}, - {3,11257,1312,8453,0,0,0,0,0,0,0,0,0} - }; +const int dvb_ldpc_bb_impl::ldpc_tab_1_3M[30][13] = { + { 12, 7416, 4093, 16722, 1023, 20586, 12219, 9175, 16284, 1554, 10113, 19849, 17545 }, + { 12, 13140, 3257, 2110, 13888, 3023, 1537, 1598, 15018, 18931, 13905, 10617, 1014 }, + { 12, 339, 14366, 3309, 15360, 18358, 3196, 4412, 6023, 7070, 17380, 2777, 6691 }, + { 12, 12720, 17634, 4141, 1400, 8247, 18201, 16077, 11314, 11928, 3494, 3155, 2865 }, + { 12, 21038, 6928, 3860, 1943, 20292, 6526, 12939, 15182, 3957, 5651, 356, 2673 }, + { 12, 20555, 17905, 5724, 13932, 1218, 17763, 5912, 5164, 6233, 6220, 1277, 19209 }, + { 12, 19190, 4498, 4950, 6645, 5482, 5667, 13701, 16334, 15231, 735, 8589, 12344 }, + { 12, 679, 17849, 17807, 16033, 10181, 3368, 5778, 8275, 2736, 14042, 17506, 6005 }, + { 12, 1576, 10259, 10525, 3007, 16522, 697, 7726, 8641, 14323, 2893, 8168, 11070 }, + { 12, 17270, 10180, 18740, 847, 4969, 14715, 19316, 5530, 17428, 11193, 9861, 13562 }, + { 3, 6156, 18787, 10467, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2422, 3723, 10769, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8015, 18716, 13406, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 5969, 15949, 3084, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6855, 13990, 3764, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 10351, 15779, 10392, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 16078, 19034, 11279, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11747, 6608, 4188, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19699, 8928, 8045, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4598, 7219, 11391, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19766, 11871, 5692, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 7487, 15905, 17621, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 8554, 7751, 16516, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 4981, 20250, 16146, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 12524, 21364, 10793, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 17083, 2051, 8862, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1315, 6246, 7721, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 18043, 16652, 5502, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1432, 5674, 2224, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 11257, 1312, 8453, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.h b/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.h index bf2ad5c8ce..96d5104214 100644 --- a/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.h +++ b/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.h @@ -28,104 +28,107 @@ namespace gr { - namespace dtv { - - class dvb_ldpc_bb_impl : public dvb_ldpc_bb - { - private: - unsigned int frame_size; - unsigned int frame_size_real; - unsigned int frame_size_type; - unsigned int signal_constellation; - unsigned int nbch; - unsigned int code_rate; - unsigned int q_val; - unsigned int dvb_standard; - int Xs; - int P; - int Xp; - unsigned char puncturing_buffer[FRAME_SIZE_NORMAL]; - unsigned char shortening_buffer[FRAME_SIZE_NORMAL]; - int ldpc_lut_index[FRAME_SIZE_NORMAL]; - void ldpc_lookup_generate(void); - - int** ldpc_lut; - - const static int ldpc_tab_1_4N[45][13]; - const static int ldpc_tab_1_3N[60][13]; - const static int ldpc_tab_2_5N[72][13]; - const static int ldpc_tab_1_2N[90][9]; - const static int ldpc_tab_3_5N[108][13]; - const static int ldpc_tab_2_3N_DVBT2[120][14]; - const static int ldpc_tab_2_3N_DVBS2[120][14]; - const static int ldpc_tab_3_4N[135][13]; - const static int ldpc_tab_4_5N[144][12]; - const static int ldpc_tab_5_6N[150][14]; - const static int ldpc_tab_8_9N[160][5]; - const static int ldpc_tab_9_10N[162][5]; - - const static int ldpc_tab_1_4S[9][13]; - const static int ldpc_tab_1_3S[15][13]; - const static int ldpc_tab_2_5S[18][13]; - const static int ldpc_tab_1_2S[20][9]; - const static int ldpc_tab_3_5S_DVBT2[27][13]; - const static int ldpc_tab_3_5S_DVBS2[27][13]; - const static int ldpc_tab_2_3S[30][14]; - const static int ldpc_tab_3_4S[33][13]; - const static int ldpc_tab_4_5S[35][4]; - const static int ldpc_tab_5_6S[37][14]; - const static int ldpc_tab_8_9S[40][5]; - - const static int ldpc_tab_2_9N[40][12]; - const static int ldpc_tab_13_45N[52][13]; - const static int ldpc_tab_9_20N[81][13]; - const static int ldpc_tab_11_20N[99][14]; - const static int ldpc_tab_26_45N[104][14]; - const static int ldpc_tab_28_45N[112][12]; - const static int ldpc_tab_23_36N[115][12]; - const static int ldpc_tab_25_36N[125][12]; - const static int ldpc_tab_13_18N[130][11]; - const static int ldpc_tab_7_9N[140][13]; - const static int ldpc_tab_90_180N[90][19]; - const static int ldpc_tab_96_180N[96][21]; - const static int ldpc_tab_100_180N[100][17]; - const static int ldpc_tab_104_180N[104][19]; - const static int ldpc_tab_116_180N[116][19]; - const static int ldpc_tab_124_180N[124][17]; - const static int ldpc_tab_128_180N[128][16]; - const static int ldpc_tab_132_180N[132][16]; - const static int ldpc_tab_135_180N[135][15]; - const static int ldpc_tab_140_180N[140][16]; - const static int ldpc_tab_154_180N[154][14]; - const static int ldpc_tab_18_30N[108][20]; - const static int ldpc_tab_20_30N[120][17]; - const static int ldpc_tab_22_30N[132][16]; - - const static int ldpc_tab_11_45S[11][11]; - const static int ldpc_tab_4_15S[12][22]; - const static int ldpc_tab_14_45S[14][13]; - const static int ldpc_tab_7_15S[21][25]; - const static int ldpc_tab_8_15S[24][22]; - const static int ldpc_tab_26_45S[26][14]; - const static int ldpc_tab_32_45S[32][13]; - - const static int ldpc_tab_1_5M[18][14]; - const static int ldpc_tab_11_45M[22][11]; - const static int ldpc_tab_1_3M[30][13]; - - public: - dvb_ldpc_bb_impl(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation); - ~dvb_ldpc_bb_impl(); - - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class dvb_ldpc_bb_impl : public dvb_ldpc_bb +{ +private: + unsigned int frame_size; + unsigned int frame_size_real; + unsigned int frame_size_type; + unsigned int signal_constellation; + unsigned int nbch; + unsigned int code_rate; + unsigned int q_val; + unsigned int dvb_standard; + int Xs; + int P; + int Xp; + unsigned char puncturing_buffer[FRAME_SIZE_NORMAL]; + unsigned char shortening_buffer[FRAME_SIZE_NORMAL]; + int ldpc_lut_index[FRAME_SIZE_NORMAL]; + void ldpc_lookup_generate(void); + + int** ldpc_lut; + + const static int ldpc_tab_1_4N[45][13]; + const static int ldpc_tab_1_3N[60][13]; + const static int ldpc_tab_2_5N[72][13]; + const static int ldpc_tab_1_2N[90][9]; + const static int ldpc_tab_3_5N[108][13]; + const static int ldpc_tab_2_3N_DVBT2[120][14]; + const static int ldpc_tab_2_3N_DVBS2[120][14]; + const static int ldpc_tab_3_4N[135][13]; + const static int ldpc_tab_4_5N[144][12]; + const static int ldpc_tab_5_6N[150][14]; + const static int ldpc_tab_8_9N[160][5]; + const static int ldpc_tab_9_10N[162][5]; + + const static int ldpc_tab_1_4S[9][13]; + const static int ldpc_tab_1_3S[15][13]; + const static int ldpc_tab_2_5S[18][13]; + const static int ldpc_tab_1_2S[20][9]; + const static int ldpc_tab_3_5S_DVBT2[27][13]; + const static int ldpc_tab_3_5S_DVBS2[27][13]; + const static int ldpc_tab_2_3S[30][14]; + const static int ldpc_tab_3_4S[33][13]; + const static int ldpc_tab_4_5S[35][4]; + const static int ldpc_tab_5_6S[37][14]; + const static int ldpc_tab_8_9S[40][5]; + + const static int ldpc_tab_2_9N[40][12]; + const static int ldpc_tab_13_45N[52][13]; + const static int ldpc_tab_9_20N[81][13]; + const static int ldpc_tab_11_20N[99][14]; + const static int ldpc_tab_26_45N[104][14]; + const static int ldpc_tab_28_45N[112][12]; + const static int ldpc_tab_23_36N[115][12]; + const static int ldpc_tab_25_36N[125][12]; + const static int ldpc_tab_13_18N[130][11]; + const static int ldpc_tab_7_9N[140][13]; + const static int ldpc_tab_90_180N[90][19]; + const static int ldpc_tab_96_180N[96][21]; + const static int ldpc_tab_100_180N[100][17]; + const static int ldpc_tab_104_180N[104][19]; + const static int ldpc_tab_116_180N[116][19]; + const static int ldpc_tab_124_180N[124][17]; + const static int ldpc_tab_128_180N[128][16]; + const static int ldpc_tab_132_180N[132][16]; + const static int ldpc_tab_135_180N[135][15]; + const static int ldpc_tab_140_180N[140][16]; + const static int ldpc_tab_154_180N[154][14]; + const static int ldpc_tab_18_30N[108][20]; + const static int ldpc_tab_20_30N[120][17]; + const static int ldpc_tab_22_30N[132][16]; + + const static int ldpc_tab_11_45S[11][11]; + const static int ldpc_tab_4_15S[12][22]; + const static int ldpc_tab_14_45S[14][13]; + const static int ldpc_tab_7_15S[21][25]; + const static int ldpc_tab_8_15S[24][22]; + const static int ldpc_tab_26_45S[26][14]; + const static int ldpc_tab_32_45S[32][13]; + + const static int ldpc_tab_1_5M[18][14]; + const static int ldpc_tab_11_45M[22][11]; + const static int ldpc_tab_1_3M[30][13]; + +public: + dvb_ldpc_bb_impl(dvb_standard_t standard, + dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation); + ~dvb_ldpc_bb_impl(); + + void forecast(int noutput_items, gr_vector_int& ninput_items_required); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVB_LDPC_BB_IMPL_H */ diff --git a/gr-dtv/lib/dvbs2/dvbs2_interleaver_bb_impl.cc b/gr-dtv/lib/dvbs2/dvbs2_interleaver_bb_impl.cc index 35e2973647..05f9ee4a4b 100644 --- a/gr-dtv/lib/dvbs2/dvbs2_interleaver_bb_impl.cc +++ b/gr-dtv/lib/dvbs2/dvbs2_interleaver_bb_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,348 +26,348 @@ #include "dvbs2_interleaver_bb_impl.h" namespace gr { - namespace dtv { +namespace dtv { - dvbs2_interleaver_bb::sptr - dvbs2_interleaver_bb::make(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation) - { - return gnuradio::get_initial_sptr - (new dvbs2_interleaver_bb_impl(framesize, rate, constellation)); - } +dvbs2_interleaver_bb::sptr dvbs2_interleaver_bb::make(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation) +{ + return gnuradio::get_initial_sptr( + new dvbs2_interleaver_bb_impl(framesize, rate, constellation)); +} - /* - * The private constructor - */ - dvbs2_interleaver_bb_impl::dvbs2_interleaver_bb_impl(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation) - : gr::block("dvbs2_interleaver_bb", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(unsigned char))) - { - int rows; - signal_constellation = constellation; - code_rate = rate; - if (framesize == FECFRAME_NORMAL) { +/* + * The private constructor + */ +dvbs2_interleaver_bb_impl::dvbs2_interleaver_bb_impl(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation) + : gr::block("dvbs2_interleaver_bb", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(unsigned char))) +{ + int rows; + signal_constellation = constellation; + code_rate = rate; + if (framesize == FECFRAME_NORMAL) { frame_size = FRAME_SIZE_NORMAL; if (rate == C2_9_VLSNR) { - frame_size = FRAME_SIZE_NORMAL - NORMAL_PUNCTURING; + frame_size = FRAME_SIZE_NORMAL - NORMAL_PUNCTURING; } - } - else if (framesize == FECFRAME_SHORT) { + } else if (framesize == FECFRAME_SHORT) { frame_size = FRAME_SIZE_SHORT; if (rate == C1_5_VLSNR_SF2 || rate == C11_45_VLSNR_SF2) { - frame_size = FRAME_SIZE_SHORT - SHORT_PUNCTURING_SET1; + frame_size = FRAME_SIZE_SHORT - SHORT_PUNCTURING_SET1; } if (rate == C1_5_VLSNR || rate == C4_15_VLSNR || rate == C1_3_VLSNR) { - frame_size = FRAME_SIZE_SHORT - SHORT_PUNCTURING_SET2; + frame_size = FRAME_SIZE_SHORT - SHORT_PUNCTURING_SET2; } - } - else { + } else { frame_size = FRAME_SIZE_MEDIUM - MEDIUM_PUNCTURING; - } - switch (constellation) { - case MOD_BPSK: - mod = 1; - rows = frame_size / mod; - set_output_multiple(rows); - packed_items = rows; - break; - case MOD_BPSK_SF2: - mod = 1; - rows = frame_size / mod; - set_output_multiple(rows * 2); - packed_items = rows * 2; - break; - case MOD_QPSK: - mod = 2; - rows = frame_size / mod; - set_output_multiple(rows); - packed_items = rows; - break; - case MOD_8PSK: - mod = 3; - rows = frame_size / mod; - /* 210 */ - if (rate == C3_5) { + } + switch (constellation) { + case MOD_BPSK: + mod = 1; + rows = frame_size / mod; + set_output_multiple(rows); + packed_items = rows; + break; + case MOD_BPSK_SF2: + mod = 1; + rows = frame_size / mod; + set_output_multiple(rows * 2); + packed_items = rows * 2; + break; + case MOD_QPSK: + mod = 2; + rows = frame_size / mod; + set_output_multiple(rows); + packed_items = rows; + break; + case MOD_8PSK: + mod = 3; + rows = frame_size / mod; + /* 210 */ + if (rate == C3_5) { rowaddr0 = rows * 2; rowaddr1 = rows; rowaddr2 = 0; - } - /* 102 */ - else if (rate == C25_36 || rate == C13_18 || rate == C7_15 || rate == C8_15 || rate == C26_45) { + } + /* 102 */ + else if (rate == C25_36 || rate == C13_18 || rate == C7_15 || rate == C8_15 || + rate == C26_45) { rowaddr0 = rows; rowaddr1 = 0; rowaddr2 = rows * 2; - } - /* 012 */ - else { + } + /* 012 */ + else { rowaddr0 = 0; rowaddr1 = rows; rowaddr2 = rows * 2; - } - set_output_multiple(rows); - packed_items = rows; - break; - case MOD_8APSK: - mod = 3; - rows = frame_size / mod; - /* 012 */ - rowaddr0 = 0; - rowaddr1 = rows; - rowaddr2 = rows * 2; - set_output_multiple(rows); - packed_items = rows; - break; - case MOD_16APSK: - mod = 4; - rows = frame_size / mod; - if (rate == C26_45) { + } + set_output_multiple(rows); + packed_items = rows; + break; + case MOD_8APSK: + mod = 3; + rows = frame_size / mod; + /* 012 */ + rowaddr0 = 0; + rowaddr1 = rows; + rowaddr2 = rows * 2; + set_output_multiple(rows); + packed_items = rows; + break; + case MOD_16APSK: + mod = 4; + rows = frame_size / mod; + if (rate == C26_45) { /* 3201 */ if (frame_size == FRAME_SIZE_NORMAL) { - rowaddr0 = rows * 3; - rowaddr1 = rows * 2; - rowaddr2 = 0; - rowaddr3 = rows; + rowaddr0 = rows * 3; + rowaddr1 = rows * 2; + rowaddr2 = 0; + rowaddr3 = rows; } /* 2130 */ else { - rowaddr0 = rows * 2; - rowaddr1 = rows; - rowaddr2 = rows * 3; - rowaddr3 = 0; + rowaddr0 = rows * 2; + rowaddr1 = rows; + rowaddr2 = rows * 3; + rowaddr3 = 0; } - } - else if (rate == C3_5) { + } else if (rate == C3_5) { /* 3210 */ if (frame_size == FRAME_SIZE_NORMAL) { - rowaddr0 = rows * 3; - rowaddr1 = rows * 2; - rowaddr2 = rows; - rowaddr3 = 0; + rowaddr0 = rows * 3; + rowaddr1 = rows * 2; + rowaddr2 = rows; + rowaddr3 = 0; } /* 3201 */ else { - rowaddr0 = rows * 3; - rowaddr1 = rows * 2; - rowaddr2 = 0; - rowaddr3 = rows; + rowaddr0 = rows * 3; + rowaddr1 = rows * 2; + rowaddr2 = 0; + rowaddr3 = rows; } - } - /* 3012 */ - else if (rate == C28_45) { + } + /* 3012 */ + else if (rate == C28_45) { rowaddr0 = rows * 3; rowaddr1 = 0; rowaddr2 = rows; rowaddr3 = rows * 2; - } - /* 3021 */ - else if (rate == C23_36 || rate == C13_18) { + } + /* 3021 */ + else if (rate == C23_36 || rate == C13_18) { rowaddr0 = rows * 3; rowaddr1 = 0; rowaddr2 = rows * 2; rowaddr3 = rows; - } - /* 2310 */ - else if (rate == C25_36) { + } + /* 2310 */ + else if (rate == C25_36) { rowaddr0 = rows * 2; rowaddr1 = rows * 3; rowaddr2 = rows; rowaddr3 = 0; - } - /* 2103 */ - else if (rate == C7_15 || rate == C8_15) { + } + /* 2103 */ + else if (rate == C7_15 || rate == C8_15) { rowaddr0 = rows * 2; rowaddr1 = rows; rowaddr2 = 0; rowaddr3 = rows * 3; - } - /* 3210 */ - else if (rate == C140_180) { + } + /* 3210 */ + else if (rate == C140_180) { rowaddr0 = rows * 3; rowaddr1 = rows * 2; rowaddr2 = rows; rowaddr3 = 0; - } - /* 0321 */ - else if (rate == C154_180) { + } + /* 0321 */ + else if (rate == C154_180) { rowaddr0 = 0; rowaddr1 = rows * 3; rowaddr2 = rows * 2; rowaddr3 = rows; - } - /* 0123 */ - else { + } + /* 0123 */ + else { rowaddr0 = 0; rowaddr1 = rows; rowaddr2 = rows * 2; rowaddr3 = rows * 3; - } - set_output_multiple(rows); - packed_items = rows; - break; - case MOD_8_8APSK: - mod = 4; - rows = frame_size / mod; - /* 3210 */ - if (rate == C90_180) { + } + set_output_multiple(rows); + packed_items = rows; + break; + case MOD_8_8APSK: + mod = 4; + rows = frame_size / mod; + /* 3210 */ + if (rate == C90_180) { rowaddr0 = rows * 3; rowaddr1 = rows * 2; rowaddr2 = rows; rowaddr3 = 0; - } - /* 2310 */ - else if (rate == C96_180) { + } + /* 2310 */ + else if (rate == C96_180) { rowaddr0 = rows * 2; rowaddr1 = rows * 3; rowaddr2 = rows; rowaddr3 = 0; - } - /* 2301 */ - else if (rate == C100_180) { + } + /* 2301 */ + else if (rate == C100_180) { rowaddr0 = rows * 2; rowaddr1 = rows * 3; rowaddr2 = 0; rowaddr3 = rows; - } - /* 0123 */ - else { + } + /* 0123 */ + else { rowaddr0 = 0; rowaddr1 = rows; rowaddr2 = rows * 2; rowaddr3 = rows * 3; - } - set_output_multiple(rows); - packed_items = rows; - break; - case MOD_32APSK: - mod = 5; - rows = frame_size / mod; - /* 01234 */ - rowaddr0 = 0; - rowaddr1 = rows; - rowaddr2 = rows * 2; - rowaddr3 = rows * 3; - rowaddr4 = rows * 4; - set_output_multiple(rows); - packed_items = rows; - break; - case MOD_4_12_16APSK: - mod = 5; - rows = frame_size / mod; - /* 21430 */ - if (frame_size == FRAME_SIZE_NORMAL) { + } + set_output_multiple(rows); + packed_items = rows; + break; + case MOD_32APSK: + mod = 5; + rows = frame_size / mod; + /* 01234 */ + rowaddr0 = 0; + rowaddr1 = rows; + rowaddr2 = rows * 2; + rowaddr3 = rows * 3; + rowaddr4 = rows * 4; + set_output_multiple(rows); + packed_items = rows; + break; + case MOD_4_12_16APSK: + mod = 5; + rows = frame_size / mod; + /* 21430 */ + if (frame_size == FRAME_SIZE_NORMAL) { rowaddr0 = rows * 2; rowaddr1 = rows; rowaddr2 = rows * 4; rowaddr3 = rows * 3; rowaddr4 = 0; - } - else { + } else { /* 41230 */ if (rate == C2_3) { - rowaddr0 = rows * 4; - rowaddr1 = rows; - rowaddr2 = rows * 2; - rowaddr3 = rows * 3; - rowaddr4 = 0; + rowaddr0 = rows * 4; + rowaddr1 = rows; + rowaddr2 = rows * 2; + rowaddr3 = rows * 3; + rowaddr4 = 0; } /* 10423 */ else if (rate == C32_45) { - rowaddr0 = rows; - rowaddr1 = 0; - rowaddr2 = rows * 4; - rowaddr3 = rows * 2; - rowaddr4 = rows * 3; + rowaddr0 = rows; + rowaddr1 = 0; + rowaddr2 = rows * 4; + rowaddr3 = rows * 2; + rowaddr4 = rows * 3; } - } - set_output_multiple(rows); - packed_items = rows; - break; - case MOD_4_8_4_16APSK: - mod = 5; - rows = frame_size / mod; - /* 40213 */ - if (rate == C140_180) { + } + set_output_multiple(rows); + packed_items = rows; + break; + case MOD_4_8_4_16APSK: + mod = 5; + rows = frame_size / mod; + /* 40213 */ + if (rate == C140_180) { rowaddr0 = rows * 4; rowaddr1 = 0; rowaddr2 = rows * 2; rowaddr3 = rows; rowaddr4 = rows * 3; - } - /* 40312 */ - else { + } + /* 40312 */ + else { rowaddr0 = rows * 4; rowaddr1 = 0; rowaddr2 = rows * 3; rowaddr3 = rows; rowaddr4 = rows * 2; - } - set_output_multiple(rows); - packed_items = rows; - break; - case MOD_64APSK: - mod = 6; - rows = frame_size / mod; - /* 305214 */ - rowaddr0 = rows * 3; - rowaddr1 = 0; - rowaddr2 = rows * 5; - rowaddr3 = rows * 2; - rowaddr4 = rows; - rowaddr5 = rows * 4; - set_output_multiple(rows); - packed_items = rows; - break; - case MOD_8_16_20_20APSK: - mod = 6; - rows = frame_size / mod; - /* 201543 */ - if (rate == C7_9) { + } + set_output_multiple(rows); + packed_items = rows; + break; + case MOD_64APSK: + mod = 6; + rows = frame_size / mod; + /* 305214 */ + rowaddr0 = rows * 3; + rowaddr1 = 0; + rowaddr2 = rows * 5; + rowaddr3 = rows * 2; + rowaddr4 = rows; + rowaddr5 = rows * 4; + set_output_multiple(rows); + packed_items = rows; + break; + case MOD_8_16_20_20APSK: + mod = 6; + rows = frame_size / mod; + /* 201543 */ + if (rate == C7_9) { rowaddr0 = rows * 2; rowaddr1 = 0; rowaddr2 = rows; rowaddr3 = rows * 5; rowaddr4 = rows * 4; rowaddr5 = rows * 3; - } - /* 124053 */ - else if (rate == C4_5) { + } + /* 124053 */ + else if (rate == C4_5) { rowaddr0 = rows; rowaddr1 = rows * 2; rowaddr2 = rows * 4; rowaddr3 = 0; rowaddr4 = rows * 5; rowaddr5 = rows * 3; - } - /* 421053 */ - else if (rate == C5_6) { + } + /* 421053 */ + else if (rate == C5_6) { rowaddr0 = rows * 4; rowaddr1 = rows * 2; rowaddr2 = rows; rowaddr3 = 0; rowaddr4 = rows * 5; rowaddr5 = rows * 3; - } - set_output_multiple(rows); - packed_items = rows; - break; - case MOD_4_12_20_28APSK: - mod = 6; - rows = frame_size / mod; - /* 520143 */ - rowaddr0 = rows * 5; - rowaddr1 = rows * 2; - rowaddr2 = 0; - rowaddr3 = rows; - rowaddr4 = rows * 4; - rowaddr5 = rows * 3; - set_output_multiple(rows); - packed_items = rows; - break; - case MOD_128APSK: - mod = 7; - rows = (frame_size + 6) / mod; - /* 4250316 */ - if (rate == C135_180) { + } + set_output_multiple(rows); + packed_items = rows; + break; + case MOD_4_12_20_28APSK: + mod = 6; + rows = frame_size / mod; + /* 520143 */ + rowaddr0 = rows * 5; + rowaddr1 = rows * 2; + rowaddr2 = 0; + rowaddr3 = rows; + rowaddr4 = rows * 4; + rowaddr5 = rows * 3; + set_output_multiple(rows); + packed_items = rows; + break; + case MOD_128APSK: + mod = 7; + rows = (frame_size + 6) / mod; + /* 4250316 */ + if (rate == C135_180) { rowaddr0 = rows * 4; rowaddr1 = rows * 2; rowaddr2 = rows * 5; @@ -375,9 +375,9 @@ namespace gr { rowaddr4 = rows * 3; rowaddr5 = rows; rowaddr6 = rows * 6; - } - /* 4130256 */ - else if (rate == C140_180) { + } + /* 4130256 */ + else if (rate == C140_180) { rowaddr0 = rows * 4; rowaddr1 = rows; rowaddr2 = rows * 3; @@ -385,15 +385,15 @@ namespace gr { rowaddr4 = rows * 2; rowaddr5 = rows * 5; rowaddr6 = rows * 6; - } - set_output_multiple(rows + 12); - packed_items = rows + 12; - break; - case MOD_256APSK: - mod = 8; - rows = frame_size / mod; - /* 40372156 */ - if (rate == C116_180) { + } + set_output_multiple(rows + 12); + packed_items = rows + 12; + break; + case MOD_256APSK: + mod = 8; + rows = frame_size / mod; + /* 40372156 */ + if (rate == C116_180) { rowaddr0 = rows * 4; rowaddr1 = 0; rowaddr2 = rows * 3; @@ -402,9 +402,9 @@ namespace gr { rowaddr5 = rows; rowaddr6 = rows * 5; rowaddr7 = rows * 6; - } - /* 46320571 */ - else if (rate == C124_180) { + } + /* 46320571 */ + else if (rate == C124_180) { rowaddr0 = rows * 4; rowaddr1 = rows * 6; rowaddr2 = rows * 3; @@ -413,9 +413,9 @@ namespace gr { rowaddr5 = rows * 5; rowaddr6 = rows * 7; rowaddr7 = rows; - } - /* 75642301 */ - else if (rate == C128_180) { + } + /* 75642301 */ + else if (rate == C128_180) { rowaddr0 = rows * 7; rowaddr1 = rows * 5; rowaddr2 = rows * 6; @@ -424,9 +424,9 @@ namespace gr { rowaddr5 = rows * 3; rowaddr6 = 0; rowaddr7 = rows; - } - /* 50743612 */ - else if (rate == C135_180) { + } + /* 50743612 */ + else if (rate == C135_180) { rowaddr0 = rows * 5; rowaddr1 = 0; rowaddr2 = rows * 7; @@ -435,9 +435,9 @@ namespace gr { rowaddr5 = rows * 6; rowaddr6 = rows; rowaddr7 = rows * 2; - } - /* 01234567 */ - else { + } + /* 01234567 */ + else { rowaddr0 = 0; rowaddr1 = rows; rowaddr2 = rows * 2; @@ -446,96 +446,91 @@ namespace gr { rowaddr5 = rows * 5; rowaddr6 = rows * 6; rowaddr7 = rows * 7; - } - set_output_multiple(rows); - packed_items = rows; - break; - default: - mod = 2; - rows = frame_size / mod; - set_output_multiple(rows); - packed_items = rows; - break; - } + } + set_output_multiple(rows); + packed_items = rows; + break; + default: + mod = 2; + rows = frame_size / mod; + set_output_multiple(rows); + packed_items = rows; + break; } +} - /* - * Our virtual destructor. - */ - dvbs2_interleaver_bb_impl::~dvbs2_interleaver_bb_impl() - { - } +/* + * Our virtual destructor. + */ +dvbs2_interleaver_bb_impl::~dvbs2_interleaver_bb_impl() {} - void - dvbs2_interleaver_bb_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - if (signal_constellation == MOD_128APSK) { +void dvbs2_interleaver_bb_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + if (signal_constellation == MOD_128APSK) { ninput_items_required[0] = ((noutput_items / 9270) * 9258) * mod; - } - else if (signal_constellation == MOD_BPSK_SF2) { + } else if (signal_constellation == MOD_BPSK_SF2) { ninput_items_required[0] = (noutput_items * mod) / 2; - } - else { + } else { ninput_items_required[0] = noutput_items * mod; - } } +} - int - dvbs2_interleaver_bb_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; - int consumed = 0; - int produced = 0; - int rows; +int dvbs2_interleaver_bb_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; + int consumed = 0; + int produced = 0; + int rows; - switch (signal_constellation) { - case MOD_BPSK: - for (int i = 0; i < noutput_items; i += packed_items) { + switch (signal_constellation) { + case MOD_BPSK: + for (int i = 0; i < noutput_items; i += packed_items) { rows = frame_size; for (int j = 0; j < rows; j++) { - out[produced++] = in[consumed++]; + out[produced++] = in[consumed++]; } - } - break; - case MOD_BPSK_SF2: - for (int i = 0; i < noutput_items; i += packed_items) { + } + break; + case MOD_BPSK_SF2: + for (int i = 0; i < noutput_items; i += packed_items) { rows = frame_size; for (int j = 0; j < rows; j++) { - out[produced++] = in[consumed]; - out[produced++] = in[consumed++]; + out[produced++] = in[consumed]; + out[produced++] = in[consumed++]; } - } - break; - case MOD_QPSK: - for (int i = 0; i < noutput_items; i += packed_items) { + } + break; + case MOD_QPSK: + for (int i = 0; i < noutput_items; i += packed_items) { rows = frame_size / 2; for (int j = 0; j < rows; j++) { - out[produced] = in[consumed++] << 1; - out[produced++] |= in[consumed++]; + out[produced] = in[consumed++] << 1; + out[produced++] |= in[consumed++]; } - } - break; - case MOD_8PSK: - case MOD_8APSK: - for (int i = 0; i < noutput_items; i += packed_items) { + } + break; + case MOD_8PSK: + case MOD_8APSK: + for (int i = 0; i < noutput_items; i += packed_items) { rows = frame_size / 3; - const unsigned char *c1, *c2, *c3; + const unsigned char *c1, *c2, *c3; c1 = &in[consumed + rowaddr0]; c2 = &in[consumed + rowaddr1]; c3 = &in[consumed + rowaddr2]; for (int j = 0; j < rows; j++) { - out[produced++] = (c1[j]<<2) | (c2[j]<<1) | (c3[j]); - consumed += 3; + out[produced++] = (c1[j] << 2) | (c2[j] << 1) | (c3[j]); + consumed += 3; } - } - break; - case MOD_16APSK: - case MOD_8_8APSK: - for (int i = 0; i < noutput_items; i += packed_items) { + } + break; + case MOD_16APSK: + case MOD_8_8APSK: + for (int i = 0; i < noutput_items; i += packed_items) { rows = frame_size / 4; const unsigned char *c1, *c2, *c3, *c4; c1 = &in[consumed + rowaddr0]; @@ -543,15 +538,15 @@ namespace gr { c3 = &in[consumed + rowaddr2]; c4 = &in[consumed + rowaddr3]; for (int j = 0; j < rows; j++) { - out[produced++] = (c1[j]<<3) | (c2[j]<<2) | (c3[j]<<1) | (c4[j]); - consumed += 4; + out[produced++] = (c1[j] << 3) | (c2[j] << 2) | (c3[j] << 1) | (c4[j]); + consumed += 4; } - } - break; - case MOD_32APSK: - case MOD_4_12_16APSK: - case MOD_4_8_4_16APSK: - for (int i = 0; i < noutput_items; i += packed_items) { + } + break; + case MOD_32APSK: + case MOD_4_12_16APSK: + case MOD_4_8_4_16APSK: + for (int i = 0; i < noutput_items; i += packed_items) { rows = frame_size / 5; const unsigned char *c1, *c2, *c3, *c4, *c5; c1 = &in[consumed + rowaddr0]; @@ -560,15 +555,16 @@ namespace gr { c4 = &in[consumed + rowaddr3]; c5 = &in[consumed + rowaddr4]; for (int j = 0; j < rows; j++) { - out[produced++] = (c1[j]<<4) | (c2[j]<<3) | (c3[j]<<2) | (c4[j]<<1) | c5[j]; - consumed += 5; + out[produced++] = + (c1[j] << 4) | (c2[j] << 3) | (c3[j] << 2) | (c4[j] << 1) | c5[j]; + consumed += 5; } - } - break; - case MOD_64APSK: - case MOD_8_16_20_20APSK: - case MOD_4_12_20_28APSK: - for (int i = 0; i < noutput_items; i += packed_items) { + } + break; + case MOD_64APSK: + case MOD_8_16_20_20APSK: + case MOD_4_12_20_28APSK: + for (int i = 0; i < noutput_items; i += packed_items) { rows = frame_size / 6; const unsigned char *c1, *c2, *c3, *c4, *c5, *c6; c1 = &in[consumed + rowaddr0]; @@ -578,13 +574,14 @@ namespace gr { c5 = &in[consumed + rowaddr4]; c6 = &in[consumed + rowaddr5]; for (int j = 0; j < rows; j++) { - out[produced++] = (c1[j]<<5) | (c2[j]<<4) | (c3[j]<<3) | (c4[j]<<2) | (c5[j]<<1) | c6[j]; - consumed += 6; + out[produced++] = (c1[j] << 5) | (c2[j] << 4) | (c3[j] << 3) | + (c4[j] << 2) | (c5[j] << 1) | c6[j]; + consumed += 6; } - } - break; - case MOD_128APSK: - for (int i = 0; i < noutput_items; i += packed_items) { + } + break; + case MOD_128APSK: + for (int i = 0; i < noutput_items; i += packed_items) { rows = (frame_size + 6) / 7; const unsigned char *c1, *c2, *c3, *c4, *c5, *c6, *c7; c1 = &in[consumed + rowaddr0]; @@ -595,16 +592,17 @@ namespace gr { c6 = &in[consumed + rowaddr5]; c7 = &in[consumed + rowaddr6]; for (int j = 0; j < rows; j++) { - out[produced++] = (c1[j]<<6) | (c2[j]<<5) | (c3[j]<<4) | (c4[j]<<3) | (c5[j]<<2) | (c6[j]<<1) | c7[j]; - consumed += 7; + out[produced++] = (c1[j] << 6) | (c2[j] << 5) | (c3[j] << 4) | + (c4[j] << 3) | (c5[j] << 2) | (c6[j] << 1) | c7[j]; + consumed += 7; } for (int j = 0; j < 12; j++) { - out[produced++] = 0x7f; + out[produced++] = 0x7f; } - } - break; - case MOD_256APSK: - for (int i = 0; i < noutput_items; i += packed_items) { + } + break; + case MOD_256APSK: + for (int i = 0; i < noutput_items; i += packed_items) { rows = frame_size / 8; const unsigned char *c1, *c2, *c3, *c4, *c5, *c6, *c7, *c8; c1 = &in[consumed + rowaddr0]; @@ -616,30 +614,31 @@ namespace gr { c7 = &in[consumed + rowaddr6]; c8 = &in[consumed + rowaddr7]; for (int j = 0; j < rows; j++) { - out[produced++] = (c1[j]<<7) | (c2[j]<<6) | (c3[j]<<5) | (c4[j]<<4) | (c5[j]<<3) | (c6[j]<<2) | (c7[j]<<1) | c8[j]; - consumed += 8; + out[produced++] = (c1[j] << 7) | (c2[j] << 6) | (c3[j] << 5) | + (c4[j] << 4) | (c5[j] << 3) | (c6[j] << 2) | + (c7[j] << 1) | c8[j]; + consumed += 8; } - } - break; - default: - for (int i = 0; i < noutput_items; i += packed_items) { + } + break; + default: + for (int i = 0; i < noutput_items; i += packed_items) { rows = frame_size / 2; for (int j = 0; j < rows; j++) { - out[produced] = in[consumed++] << 1; - out[produced++] |= in[consumed++]; + out[produced] = in[consumed++] << 1; + out[produced++] |= in[consumed++]; } - } - break; - } + } + break; + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (consumed); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(consumed); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbs2/dvbs2_interleaver_bb_impl.h b/gr-dtv/lib/dvbs2/dvbs2_interleaver_bb_impl.h index b19800c25e..b8ecb67e57 100644 --- a/gr-dtv/lib/dvbs2/dvbs2_interleaver_bb_impl.h +++ b/gr-dtv/lib/dvbs2/dvbs2_interleaver_bb_impl.h @@ -26,38 +26,40 @@ #include <gnuradio/dtv/dvbs2_interleaver_bb.h> namespace gr { - namespace dtv { - - class dvbs2_interleaver_bb_impl : public dvbs2_interleaver_bb - { - private: - int frame_size; - int signal_constellation; - int code_rate; - int mod; - int packed_items; - int rowaddr0; - int rowaddr1; - int rowaddr2; - int rowaddr3; - int rowaddr4; - int rowaddr5; - int rowaddr6; - int rowaddr7; - - public: - dvbs2_interleaver_bb_impl(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation); - ~dvbs2_interleaver_bb_impl(); - - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class dvbs2_interleaver_bb_impl : public dvbs2_interleaver_bb +{ +private: + int frame_size; + int signal_constellation; + int code_rate; + int mod; + int packed_items; + int rowaddr0; + int rowaddr1; + int rowaddr2; + int rowaddr3; + int rowaddr4; + int rowaddr5; + int rowaddr6; + int rowaddr7; + +public: + dvbs2_interleaver_bb_impl(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation); + ~dvbs2_interleaver_bb_impl(); + + void forecast(int noutput_items, gr_vector_int& ninput_items_required); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBS2_INTERLEAVER_BB_IMPL_H */ diff --git a/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc b/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc index 71371ccc78..1ffcf0b266 100644 --- a/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc +++ b/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015-2019 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,179 +27,208 @@ #include <gnuradio/math.h> namespace gr { - namespace dtv { +namespace dtv { - dvbs2_modulator_bc::sptr - dvbs2_modulator_bc::make(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation, dvbs2_interpolation_t interpolation) - { - return gnuradio::get_initial_sptr - (new dvbs2_modulator_bc_impl(framesize, rate, constellation, interpolation)); - } +dvbs2_modulator_bc::sptr dvbs2_modulator_bc::make(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation, + dvbs2_interpolation_t interpolation) +{ + return gnuradio::get_initial_sptr( + new dvbs2_modulator_bc_impl(framesize, rate, constellation, interpolation)); +} - /* - * The private constructor - */ - dvbs2_modulator_bc_impl::dvbs2_modulator_bc_impl(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation, dvbs2_interpolation_t interpolation) - : gr::block("dvbs2_modulator_bc", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(gr_complex))) - { - double r0, r1, r2, r3, r4, r5, r6, r7, r8; - double m = 1.0; - r1 = m; - switch (constellation) { - case MOD_BPSK: - case MOD_BPSK_SF2: - m_bpsk[0][0] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); - m_bpsk[0][1] = gr_complex((r1 * cos(5.0 * GR_M_PI / 4.0)), (r1 * sin(5.0 * GR_M_PI / 4.0))); - m_bpsk[1][0] = gr_complex((r1 * cos(5.0 * GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); - m_bpsk[1][1] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(5.0 * GR_M_PI /4.0))); - break; - case MOD_QPSK: - m_qpsk[0] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); - m_qpsk[1] = gr_complex((r1 * cos(7 * GR_M_PI / 4.0)), (r1 * sin(7 * GR_M_PI / 4.0))); - m_qpsk[2] = gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); - m_qpsk[3] = gr_complex((r1 * cos(5 * GR_M_PI / 4.0)), (r1 * sin(5 * GR_M_PI / 4.0))); - break; - case MOD_8PSK: - m_8psk[0] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); - m_8psk[1] = gr_complex((r1 * cos(0.0)), (r1 * sin(0.0))); - m_8psk[2] = gr_complex((r1 * cos(4 * GR_M_PI / 4.0)), (r1 * sin(4 * GR_M_PI / 4.0))); - m_8psk[3] = gr_complex((r1 * cos(5 * GR_M_PI / 4.0)), (r1 * sin(5 * GR_M_PI / 4.0))); - m_8psk[4] = gr_complex((r1 * cos(2 * GR_M_PI / 4.0)), (r1 * sin(2 * GR_M_PI / 4.0))); - m_8psk[5] = gr_complex((r1 * cos(7 * GR_M_PI / 4.0)), (r1 * sin(7 * GR_M_PI / 4.0))); - m_8psk[6] = gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); - m_8psk[7] = gr_complex((r1 * cos(6 * GR_M_PI / 4.0)), (r1 * sin(6 * GR_M_PI / 4.0))); - break; - case MOD_8APSK: - r3 = m; - switch(rate) { - case C100_180: - r1 = r3 / 6.8; - r2 = r1 * 5.32; - break; - case C104_180: - r1 = r3 / 8.0; - r2 = r1 * 6.39; - break; - default: - r1 = 0; - r2 = 0; - break; - } - m_8psk[0] = gr_complex((r1 * cos(GR_M_PI)), (r1 * sin(GR_M_PI))); - m_8psk[1] = gr_complex((r2 * cos(GR_M_PI * 1.352)), (r2 * sin(GR_M_PI * 1.352))); - m_8psk[2] = gr_complex((r2 * cos(GR_M_PI * -1.352)), (r2 * sin(GR_M_PI * -1.352))); - m_8psk[3] = gr_complex((r3 * cos(GR_M_PI)), (r3 * sin(GR_M_PI))); - m_8psk[4] = gr_complex((r1 * cos(0.0)), (r1 * sin(0.0))); - m_8psk[5] = gr_complex((r2 * cos(GR_M_PI * -0.352)), (r2 * sin(GR_M_PI * -0.352))); - m_8psk[6] = gr_complex((r2 * cos(GR_M_PI * 0.352)), (r2 * sin(GR_M_PI * 0.352))); - m_8psk[7] = gr_complex((r3 * cos(0.0)), (r3 * sin(0.0))); - break; - case MOD_16APSK: - r2 = m; - if (framesize == FECFRAME_NORMAL) { - switch(rate) { - case C2_3: +/* + * The private constructor + */ +dvbs2_modulator_bc_impl::dvbs2_modulator_bc_impl(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation, + dvbs2_interpolation_t interpolation) + : gr::block("dvbs2_modulator_bc", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) +{ + double r0, r1, r2, r3, r4, r5, r6, r7, r8; + double m = 1.0; + r1 = m; + switch (constellation) { + case MOD_BPSK: + case MOD_BPSK_SF2: + m_bpsk[0][0] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); + m_bpsk[0][1] = + gr_complex((r1 * cos(5.0 * GR_M_PI / 4.0)), (r1 * sin(5.0 * GR_M_PI / 4.0))); + m_bpsk[1][0] = + gr_complex((r1 * cos(5.0 * GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); + m_bpsk[1][1] = + gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(5.0 * GR_M_PI / 4.0))); + break; + case MOD_QPSK: + m_qpsk[0] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); + m_qpsk[1] = + gr_complex((r1 * cos(7 * GR_M_PI / 4.0)), (r1 * sin(7 * GR_M_PI / 4.0))); + m_qpsk[2] = + gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); + m_qpsk[3] = + gr_complex((r1 * cos(5 * GR_M_PI / 4.0)), (r1 * sin(5 * GR_M_PI / 4.0))); + break; + case MOD_8PSK: + m_8psk[0] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); + m_8psk[1] = gr_complex((r1 * cos(0.0)), (r1 * sin(0.0))); + m_8psk[2] = + gr_complex((r1 * cos(4 * GR_M_PI / 4.0)), (r1 * sin(4 * GR_M_PI / 4.0))); + m_8psk[3] = + gr_complex((r1 * cos(5 * GR_M_PI / 4.0)), (r1 * sin(5 * GR_M_PI / 4.0))); + m_8psk[4] = + gr_complex((r1 * cos(2 * GR_M_PI / 4.0)), (r1 * sin(2 * GR_M_PI / 4.0))); + m_8psk[5] = + gr_complex((r1 * cos(7 * GR_M_PI / 4.0)), (r1 * sin(7 * GR_M_PI / 4.0))); + m_8psk[6] = + gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); + m_8psk[7] = + gr_complex((r1 * cos(6 * GR_M_PI / 4.0)), (r1 * sin(6 * GR_M_PI / 4.0))); + break; + case MOD_8APSK: + r3 = m; + switch (rate) { + case C100_180: + r1 = r3 / 6.8; + r2 = r1 * 5.32; + break; + case C104_180: + r1 = r3 / 8.0; + r2 = r1 * 6.39; + break; + default: + r1 = 0; + r2 = 0; + break; + } + m_8psk[0] = gr_complex((r1 * cos(GR_M_PI)), (r1 * sin(GR_M_PI))); + m_8psk[1] = gr_complex((r2 * cos(GR_M_PI * 1.352)), (r2 * sin(GR_M_PI * 1.352))); + m_8psk[2] = + gr_complex((r2 * cos(GR_M_PI * -1.352)), (r2 * sin(GR_M_PI * -1.352))); + m_8psk[3] = gr_complex((r3 * cos(GR_M_PI)), (r3 * sin(GR_M_PI))); + m_8psk[4] = gr_complex((r1 * cos(0.0)), (r1 * sin(0.0))); + m_8psk[5] = + gr_complex((r2 * cos(GR_M_PI * -0.352)), (r2 * sin(GR_M_PI * -0.352))); + m_8psk[6] = gr_complex((r2 * cos(GR_M_PI * 0.352)), (r2 * sin(GR_M_PI * 0.352))); + m_8psk[7] = gr_complex((r3 * cos(0.0)), (r3 * sin(0.0))); + break; + case MOD_16APSK: + r2 = m; + if (framesize == FECFRAME_NORMAL) { + switch (rate) { + case C2_3: r1 = r2 / 3.15; break; - case C3_4: + case C3_4: r1 = r2 / 2.85; break; - case C4_5: + case C4_5: r1 = r2 / 2.75; break; - case C5_6: + case C5_6: r1 = r2 / 2.70; break; - case C8_9: + case C8_9: r1 = r2 / 2.60; break; - case C9_10: + case C9_10: r1 = r2 / 2.57; break; - case C26_45: - case C3_5: + case C26_45: + case C3_5: r1 = r2 / 3.70; break; - case C28_45: + case C28_45: r1 = r2 / 3.50; break; - case C23_36: - case C25_36: + case C23_36: + case C25_36: r1 = r2 / 3.10; break; - case C13_18: + case C13_18: r1 = r2 / 2.85; break; - case C140_180: + case C140_180: r1 = r2 / 3.60; break; - case C154_180: + case C154_180: r1 = r2 / 3.20; break; - default: + default: r1 = 0; break; } - } - else { - switch(rate) { - case C2_3: + } else { + switch (rate) { + case C2_3: r1 = r2 / 3.15; break; - case C3_4: + case C3_4: r1 = r2 / 2.85; break; - case C4_5: + case C4_5: r1 = r2 / 2.75; break; - case C5_6: + case C5_6: r1 = r2 / 2.70; break; - case C8_9: + case C8_9: r1 = r2 / 2.60; break; - case C7_15: + case C7_15: r1 = r2 / 3.32; break; - case C8_15: + case C8_15: r1 = r2 / 3.50; break; - case C26_45: - case C3_5: + case C26_45: + case C3_5: r1 = r2 / 3.70; break; - case C32_45: + case C32_45: r1 = r2 / 2.85; break; - default: + default: r1 = 0; break; } - } - r0 = sqrt(4.0 / ((r1 * r1) + 3.0 * (r2 * r2))); - r1 *= r0; - r2 *= r0; - m_16apsk[0] = gr_complex((r2 * cos(GR_M_PI / 4.0)), (r2 * sin(GR_M_PI / 4.0))); - m_16apsk[1] = gr_complex((r2 * cos(-GR_M_PI / 4.0)), (r2 * sin(-GR_M_PI / 4.0))); - m_16apsk[2] = gr_complex((r2 * cos(3 * GR_M_PI / 4.0)), (r2 * sin(3 * GR_M_PI / 4.0))); - m_16apsk[3] = gr_complex((r2 * cos(-3 * GR_M_PI / 4.0)), (r2 * sin(-3 * GR_M_PI / 4.0))); - m_16apsk[4] = gr_complex((r2 * cos(GR_M_PI / 12.0)), (r2 * sin(GR_M_PI / 12.0))); - m_16apsk[5] = gr_complex((r2 * cos(-GR_M_PI / 12.0)), (r2 * sin(-GR_M_PI / 12.0))); - m_16apsk[6] = gr_complex((r2 * cos(11 * GR_M_PI / 12.0)), (r2 * sin(11 * GR_M_PI / 12.0))); - m_16apsk[7] = gr_complex((r2 * cos(-11 * GR_M_PI / 12.0)), (r2 * sin(-11 * GR_M_PI / 12.0))); - m_16apsk[8] = gr_complex((r2 * cos(5 * GR_M_PI / 12.0)), (r2 * sin(5 * GR_M_PI / 12.0))); - m_16apsk[9] = gr_complex((r2 * cos(-5 * GR_M_PI / 12.0)), (r2 * sin(-5 * GR_M_PI / 12.0))); - m_16apsk[10] = gr_complex((r2 * cos(7 * GR_M_PI / 12.0)), (r2 * sin(7 * GR_M_PI / 12.0))); - m_16apsk[11] = gr_complex((r2 * cos(-7 * GR_M_PI / 12.0)), (r2 * sin(-7 * GR_M_PI / 12.0))); - m_16apsk[12] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); - m_16apsk[13] = gr_complex((r1 * cos(-GR_M_PI / 4.0)), (r1 * sin(-GR_M_PI / 4.0))); - m_16apsk[14] = gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); - m_16apsk[15] = gr_complex((r1 * cos(-3 * GR_M_PI / 4.0)), (r1 * sin(-3 * GR_M_PI / 4.0))); - break; - case MOD_8_8APSK: - if (rate == C18_30) { + } + r0 = sqrt(4.0 / ((r1 * r1) + 3.0 * (r2 * r2))); + r1 *= r0; + r2 *= r0; + m_16apsk[0] = gr_complex((r2 * cos(GR_M_PI / 4.0)), (r2 * sin(GR_M_PI / 4.0))); + m_16apsk[1] = gr_complex((r2 * cos(-GR_M_PI / 4.0)), (r2 * sin(-GR_M_PI / 4.0))); + m_16apsk[2] = + gr_complex((r2 * cos(3 * GR_M_PI / 4.0)), (r2 * sin(3 * GR_M_PI / 4.0))); + m_16apsk[3] = + gr_complex((r2 * cos(-3 * GR_M_PI / 4.0)), (r2 * sin(-3 * GR_M_PI / 4.0))); + m_16apsk[4] = gr_complex((r2 * cos(GR_M_PI / 12.0)), (r2 * sin(GR_M_PI / 12.0))); + m_16apsk[5] = + gr_complex((r2 * cos(-GR_M_PI / 12.0)), (r2 * sin(-GR_M_PI / 12.0))); + m_16apsk[6] = + gr_complex((r2 * cos(11 * GR_M_PI / 12.0)), (r2 * sin(11 * GR_M_PI / 12.0))); + m_16apsk[7] = gr_complex((r2 * cos(-11 * GR_M_PI / 12.0)), + (r2 * sin(-11 * GR_M_PI / 12.0))); + m_16apsk[8] = + gr_complex((r2 * cos(5 * GR_M_PI / 12.0)), (r2 * sin(5 * GR_M_PI / 12.0))); + m_16apsk[9] = + gr_complex((r2 * cos(-5 * GR_M_PI / 12.0)), (r2 * sin(-5 * GR_M_PI / 12.0))); + m_16apsk[10] = + gr_complex((r2 * cos(7 * GR_M_PI / 12.0)), (r2 * sin(7 * GR_M_PI / 12.0))); + m_16apsk[11] = + gr_complex((r2 * cos(-7 * GR_M_PI / 12.0)), (r2 * sin(-7 * GR_M_PI / 12.0))); + m_16apsk[12] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); + m_16apsk[13] = gr_complex((r1 * cos(-GR_M_PI / 4.0)), (r1 * sin(-GR_M_PI / 4.0))); + m_16apsk[14] = + gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); + m_16apsk[15] = + gr_complex((r1 * cos(-3 * GR_M_PI / 4.0)), (r1 * sin(-3 * GR_M_PI / 4.0))); + break; + case MOD_8_8APSK: + if (rate == C18_30) { m_16apsk[0] = gr_complex(0.4718, 0.2606); m_16apsk[1] = gr_complex(0.2606, 0.4718); m_16apsk[2] = gr_complex(-0.4718, 0.2606); @@ -216,8 +245,7 @@ namespace gr { m_16apsk[13] = gr_complex(0.4984, -1.2088); m_16apsk[14] = gr_complex(-1.2088, -0.4984); m_16apsk[15] = gr_complex(-0.4984, -1.2088); - } - else if (rate == C20_30) { + } else if (rate == C20_30) { m_16apsk[0] = gr_complex(0.5061, 0.2474); m_16apsk[1] = gr_complex(0.2474, 0.5061); m_16apsk[2] = gr_complex(-0.5061, 0.2474); @@ -234,621 +262,1013 @@ namespace gr { m_16apsk[13] = gr_complex(0.4909, -1.2007); m_16apsk[14] = gr_complex(-1.2007, -0.4909); m_16apsk[15] = gr_complex(-0.4909, -1.2007); - } - else { + } else { r2 = m; - switch(rate) { - case C90_180: - case C96_180: - case C100_180: + switch (rate) { + case C90_180: + case C96_180: + case C100_180: r1 = r2 / 2.19; break; - default: + default: r1 = 0; break; } - m_16apsk[0] = gr_complex((r1 * cos(GR_M_PI / 8.0)), (r1 * sin(GR_M_PI / 8.0))); - m_16apsk[1] = gr_complex((r1 * cos(3 * GR_M_PI / 8.0)), (r1 * sin(3 * GR_M_PI / 8.0))); - m_16apsk[2] = gr_complex((r1 * cos(7 * GR_M_PI / 8.0)), (r1 * sin(7 * GR_M_PI / 8.0))); - m_16apsk[3] = gr_complex((r1 * cos(5 * GR_M_PI / 8.0)), (r1 * sin(5 * GR_M_PI / 8.0))); - m_16apsk[4] = gr_complex((r1 * cos(15 * GR_M_PI / 8.0)), (r1 * sin(15 * GR_M_PI / 8.0))); - m_16apsk[5] = gr_complex((r1 * cos(13 * GR_M_PI / 8.0)), (r1 * sin(13 * GR_M_PI / 8.0))); - m_16apsk[6] = gr_complex((r1 * cos(9 * GR_M_PI / 8.0)), (r1 * sin(9 * GR_M_PI / 8.0))); - m_16apsk[7] = gr_complex((r1 * cos(11 * GR_M_PI / 8.0)), (r1 * sin(11 * GR_M_PI / 8.0))); - m_16apsk[8] = gr_complex((r2 * cos(GR_M_PI / 8.0)), (r2 * sin(GR_M_PI / 8.0))); - m_16apsk[9] = gr_complex((r2 * cos(3 * GR_M_PI / 8.0)), (r2 * sin(3 * GR_M_PI / 8.0))); - m_16apsk[10] = gr_complex((r2 * cos(7 * GR_M_PI / 8.0)), (r2 * sin(7 * GR_M_PI / 8.0))); - m_16apsk[11] = gr_complex((r2 * cos(5 * GR_M_PI / 8.0)), (r2 * sin(5 * GR_M_PI / 8.0))); - m_16apsk[12] = gr_complex((r2 * cos(15 * GR_M_PI / 8.0)), (r2 * sin(15 * GR_M_PI / 8.0))); - m_16apsk[13] = gr_complex((r2 * cos(13 * GR_M_PI / 8.0)), (r2 * sin(13 * GR_M_PI / 8.0))); - m_16apsk[14] = gr_complex((r2 * cos(9 * GR_M_PI / 8.0)), (r2 * sin(9 * GR_M_PI / 8.0))); - m_16apsk[15] = gr_complex((r2 * cos(11 * GR_M_PI / 8.0)), (r2 * sin(11 * GR_M_PI / 8.0))); - } - break; - case MOD_32APSK: - r3 = m; - switch(rate) { - case C3_4: - r1 = r3 / 5.27; - r2 = r1 * 2.84; - break; - case C4_5: - r1 = r3 / 4.87; - r2 = r1 * 2.72; - break; - case C5_6: - r1 = r3 / 4.64; - r2 = r1 * 2.64; - break; - case C8_9: - r1 = r3 / 4.33; - r2 = r1 * 2.54; - break; - case C9_10: - r1 = r3 / 4.30; - r2 = r1 * 2.53; - break; - default: - r1 = 0; - r2 = 0; - break; - } - r0 = sqrt(8.0 / ((r1 * r1) + 3.0 * (r2 * r2) + 4.0 * (r3 * r3))); - r1 *= r0; - r2 *= r0; - r3 *= r0; - m_32apsk[0] = gr_complex((r2 * cos(GR_M_PI / 4.0)), (r2 * sin(GR_M_PI / 4.0))); - m_32apsk[1] = gr_complex((r2 * cos(5 * GR_M_PI / 12.0)), (r2 * sin(5 * GR_M_PI / 12.0))); - m_32apsk[2] = gr_complex((r2 * cos(-GR_M_PI / 4.0)), (r2 * sin(-GR_M_PI / 4.0))); - m_32apsk[3] = gr_complex((r2 * cos(-5 * GR_M_PI / 12.0)), (r2 * sin(-5 * GR_M_PI / 12.0))); - m_32apsk[4] = gr_complex((r2 * cos(3 * GR_M_PI / 4.0)), (r2 * sin(3 * GR_M_PI / 4.0))); - m_32apsk[5] = gr_complex((r2 * cos(7 * GR_M_PI / 12.0)), (r2 * sin(7 * GR_M_PI / 12.0))); - m_32apsk[6] = gr_complex((r2 * cos(-3 * GR_M_PI / 4.0)), (r2 * sin(-3 * GR_M_PI / 4.0))); - m_32apsk[7] = gr_complex((r2 * cos(-7 * GR_M_PI / 12.0)), (r2 * sin(-7 * GR_M_PI / 12.0))); - m_32apsk[8] = gr_complex((r3 * cos(GR_M_PI / 8.0)), (r3 * sin(GR_M_PI / 8.0))); - m_32apsk[9] = gr_complex((r3 * cos(3 * GR_M_PI / 8.0)), (r3 * sin(3 * GR_M_PI / 8.0))); - m_32apsk[10] = gr_complex((r3 * cos(-GR_M_PI / 4.0)), (r3 * sin(-GR_M_PI / 4.0))); - m_32apsk[11] = gr_complex((r3 * cos(-GR_M_PI / 2.0)), (r3 * sin(-GR_M_PI / 2.0))); - m_32apsk[12] = gr_complex((r3 * cos(3 * GR_M_PI / 4.0)), (r3 * sin(3 * GR_M_PI / 4.0))); - m_32apsk[13] = gr_complex((r3 * cos(GR_M_PI / 2.0)), (r3 * sin(GR_M_PI / 2.0))); - m_32apsk[14] = gr_complex((r3 * cos(-7 * GR_M_PI / 8.0)), (r3 * sin(-7 * GR_M_PI / 8.0))); - m_32apsk[15] = gr_complex((r3 * cos(-5 * GR_M_PI / 8.0)), (r3 * sin(-5 * GR_M_PI / 8.0))); - m_32apsk[16] = gr_complex((r2 * cos(GR_M_PI / 12.0)), (r2 * sin(GR_M_PI / 12.0))); - m_32apsk[17] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); - m_32apsk[18] = gr_complex((r2 * cos(-GR_M_PI / 12.0)), (r2 * sin(-GR_M_PI / 12.0))); - m_32apsk[19] = gr_complex((r1 * cos(-GR_M_PI / 4.0)), (r1 * sin(-GR_M_PI / 4.0))); - m_32apsk[20] = gr_complex((r2 * cos(11 * GR_M_PI / 12.0)), (r2 * sin(11 * GR_M_PI / 12.0))); - m_32apsk[21] = gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); - m_32apsk[22] = gr_complex((r2 * cos(-11 * GR_M_PI / 12.0)), (r2 * sin(-11 * GR_M_PI / 12.0))); - m_32apsk[23] = gr_complex((r1 * cos(-3 * GR_M_PI / 4.0)), (r1 * sin(-3 * GR_M_PI / 4.0))); - m_32apsk[24] = gr_complex((r3 * cos(0.0)), (r3 * sin(0.0))); - m_32apsk[25] = gr_complex((r3 * cos(GR_M_PI / 4.0)), (r3 * sin(GR_M_PI / 4.0))); - m_32apsk[26] = gr_complex((r3 * cos(-GR_M_PI / 8.0)), (r3 * sin(-GR_M_PI / 8.0))); - m_32apsk[27] = gr_complex((r3 * cos(-3 * GR_M_PI / 8.0)), (r3 * sin(-3 * GR_M_PI / 8.0))); - m_32apsk[28] = gr_complex((r3 * cos(7 * GR_M_PI / 8.0)), (r3 * sin(7 * GR_M_PI / 8.0))); - m_32apsk[29] = gr_complex((r3 * cos(5 * GR_M_PI / 8.0)), (r3 * sin(5 * GR_M_PI / 8.0))); - m_32apsk[30] = gr_complex((r3 * cos(GR_M_PI)), (r3 * sin(GR_M_PI))); - m_32apsk[31] = gr_complex((r3 * cos(-3 * GR_M_PI / 4.0)), (r3 * sin(-3 * GR_M_PI / 4.0))); - break; - case MOD_4_12_16APSK: - r3 = m; - if (framesize == FECFRAME_NORMAL) { - switch(rate) { - case C2_3: + m_16apsk[0] = + gr_complex((r1 * cos(GR_M_PI / 8.0)), (r1 * sin(GR_M_PI / 8.0))); + m_16apsk[1] = + gr_complex((r1 * cos(3 * GR_M_PI / 8.0)), (r1 * sin(3 * GR_M_PI / 8.0))); + m_16apsk[2] = + gr_complex((r1 * cos(7 * GR_M_PI / 8.0)), (r1 * sin(7 * GR_M_PI / 8.0))); + m_16apsk[3] = + gr_complex((r1 * cos(5 * GR_M_PI / 8.0)), (r1 * sin(5 * GR_M_PI / 8.0))); + m_16apsk[4] = gr_complex((r1 * cos(15 * GR_M_PI / 8.0)), + (r1 * sin(15 * GR_M_PI / 8.0))); + m_16apsk[5] = gr_complex((r1 * cos(13 * GR_M_PI / 8.0)), + (r1 * sin(13 * GR_M_PI / 8.0))); + m_16apsk[6] = + gr_complex((r1 * cos(9 * GR_M_PI / 8.0)), (r1 * sin(9 * GR_M_PI / 8.0))); + m_16apsk[7] = gr_complex((r1 * cos(11 * GR_M_PI / 8.0)), + (r1 * sin(11 * GR_M_PI / 8.0))); + m_16apsk[8] = + gr_complex((r2 * cos(GR_M_PI / 8.0)), (r2 * sin(GR_M_PI / 8.0))); + m_16apsk[9] = + gr_complex((r2 * cos(3 * GR_M_PI / 8.0)), (r2 * sin(3 * GR_M_PI / 8.0))); + m_16apsk[10] = + gr_complex((r2 * cos(7 * GR_M_PI / 8.0)), (r2 * sin(7 * GR_M_PI / 8.0))); + m_16apsk[11] = + gr_complex((r2 * cos(5 * GR_M_PI / 8.0)), (r2 * sin(5 * GR_M_PI / 8.0))); + m_16apsk[12] = gr_complex((r2 * cos(15 * GR_M_PI / 8.0)), + (r2 * sin(15 * GR_M_PI / 8.0))); + m_16apsk[13] = gr_complex((r2 * cos(13 * GR_M_PI / 8.0)), + (r2 * sin(13 * GR_M_PI / 8.0))); + m_16apsk[14] = + gr_complex((r2 * cos(9 * GR_M_PI / 8.0)), (r2 * sin(9 * GR_M_PI / 8.0))); + m_16apsk[15] = gr_complex((r2 * cos(11 * GR_M_PI / 8.0)), + (r2 * sin(11 * GR_M_PI / 8.0))); + } + break; + case MOD_32APSK: + r3 = m; + switch (rate) { + case C3_4: + r1 = r3 / 5.27; + r2 = r1 * 2.84; + break; + case C4_5: + r1 = r3 / 4.87; + r2 = r1 * 2.72; + break; + case C5_6: + r1 = r3 / 4.64; + r2 = r1 * 2.64; + break; + case C8_9: + r1 = r3 / 4.33; + r2 = r1 * 2.54; + break; + case C9_10: + r1 = r3 / 4.30; + r2 = r1 * 2.53; + break; + default: + r1 = 0; + r2 = 0; + break; + } + r0 = sqrt(8.0 / ((r1 * r1) + 3.0 * (r2 * r2) + 4.0 * (r3 * r3))); + r1 *= r0; + r2 *= r0; + r3 *= r0; + m_32apsk[0] = gr_complex((r2 * cos(GR_M_PI / 4.0)), (r2 * sin(GR_M_PI / 4.0))); + m_32apsk[1] = + gr_complex((r2 * cos(5 * GR_M_PI / 12.0)), (r2 * sin(5 * GR_M_PI / 12.0))); + m_32apsk[2] = gr_complex((r2 * cos(-GR_M_PI / 4.0)), (r2 * sin(-GR_M_PI / 4.0))); + m_32apsk[3] = + gr_complex((r2 * cos(-5 * GR_M_PI / 12.0)), (r2 * sin(-5 * GR_M_PI / 12.0))); + m_32apsk[4] = + gr_complex((r2 * cos(3 * GR_M_PI / 4.0)), (r2 * sin(3 * GR_M_PI / 4.0))); + m_32apsk[5] = + gr_complex((r2 * cos(7 * GR_M_PI / 12.0)), (r2 * sin(7 * GR_M_PI / 12.0))); + m_32apsk[6] = + gr_complex((r2 * cos(-3 * GR_M_PI / 4.0)), (r2 * sin(-3 * GR_M_PI / 4.0))); + m_32apsk[7] = + gr_complex((r2 * cos(-7 * GR_M_PI / 12.0)), (r2 * sin(-7 * GR_M_PI / 12.0))); + m_32apsk[8] = gr_complex((r3 * cos(GR_M_PI / 8.0)), (r3 * sin(GR_M_PI / 8.0))); + m_32apsk[9] = + gr_complex((r3 * cos(3 * GR_M_PI / 8.0)), (r3 * sin(3 * GR_M_PI / 8.0))); + m_32apsk[10] = gr_complex((r3 * cos(-GR_M_PI / 4.0)), (r3 * sin(-GR_M_PI / 4.0))); + m_32apsk[11] = gr_complex((r3 * cos(-GR_M_PI / 2.0)), (r3 * sin(-GR_M_PI / 2.0))); + m_32apsk[12] = + gr_complex((r3 * cos(3 * GR_M_PI / 4.0)), (r3 * sin(3 * GR_M_PI / 4.0))); + m_32apsk[13] = gr_complex((r3 * cos(GR_M_PI / 2.0)), (r3 * sin(GR_M_PI / 2.0))); + m_32apsk[14] = + gr_complex((r3 * cos(-7 * GR_M_PI / 8.0)), (r3 * sin(-7 * GR_M_PI / 8.0))); + m_32apsk[15] = + gr_complex((r3 * cos(-5 * GR_M_PI / 8.0)), (r3 * sin(-5 * GR_M_PI / 8.0))); + m_32apsk[16] = gr_complex((r2 * cos(GR_M_PI / 12.0)), (r2 * sin(GR_M_PI / 12.0))); + m_32apsk[17] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); + m_32apsk[18] = + gr_complex((r2 * cos(-GR_M_PI / 12.0)), (r2 * sin(-GR_M_PI / 12.0))); + m_32apsk[19] = gr_complex((r1 * cos(-GR_M_PI / 4.0)), (r1 * sin(-GR_M_PI / 4.0))); + m_32apsk[20] = + gr_complex((r2 * cos(11 * GR_M_PI / 12.0)), (r2 * sin(11 * GR_M_PI / 12.0))); + m_32apsk[21] = + gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); + m_32apsk[22] = gr_complex((r2 * cos(-11 * GR_M_PI / 12.0)), + (r2 * sin(-11 * GR_M_PI / 12.0))); + m_32apsk[23] = + gr_complex((r1 * cos(-3 * GR_M_PI / 4.0)), (r1 * sin(-3 * GR_M_PI / 4.0))); + m_32apsk[24] = gr_complex((r3 * cos(0.0)), (r3 * sin(0.0))); + m_32apsk[25] = gr_complex((r3 * cos(GR_M_PI / 4.0)), (r3 * sin(GR_M_PI / 4.0))); + m_32apsk[26] = gr_complex((r3 * cos(-GR_M_PI / 8.0)), (r3 * sin(-GR_M_PI / 8.0))); + m_32apsk[27] = + gr_complex((r3 * cos(-3 * GR_M_PI / 8.0)), (r3 * sin(-3 * GR_M_PI / 8.0))); + m_32apsk[28] = + gr_complex((r3 * cos(7 * GR_M_PI / 8.0)), (r3 * sin(7 * GR_M_PI / 8.0))); + m_32apsk[29] = + gr_complex((r3 * cos(5 * GR_M_PI / 8.0)), (r3 * sin(5 * GR_M_PI / 8.0))); + m_32apsk[30] = gr_complex((r3 * cos(GR_M_PI)), (r3 * sin(GR_M_PI))); + m_32apsk[31] = + gr_complex((r3 * cos(-3 * GR_M_PI / 4.0)), (r3 * sin(-3 * GR_M_PI / 4.0))); + break; + case MOD_4_12_16APSK: + r3 = m; + if (framesize == FECFRAME_NORMAL) { + switch (rate) { + case C2_3: r1 = r3 / 5.55; r2 = r1 * 2.85; break; - default: + default: r1 = 0; r2 = 0; break; } - } - else { - switch(rate) { - case C2_3: + } else { + switch (rate) { + case C2_3: r1 = r3 / 5.54; r2 = r1 * 2.84; break; - case C32_45: + case C32_45: r1 = r3 / 5.26; r2 = r1 * 2.84; break; - default: + default: r1 = 0; r2 = 0; break; } - } - m_32apsk[0] = gr_complex((r3 * cos(11 * GR_M_PI / 16.0)), (r3 * sin(11 * GR_M_PI / 16.0))); - m_32apsk[1] = gr_complex((r3 * cos(9 * GR_M_PI / 16.0)), (r3 * sin(9 * GR_M_PI / 16.0))); - m_32apsk[2] = gr_complex((r3 * cos(5 * GR_M_PI / 16.0)), (r3 * sin(5 * GR_M_PI / 16.0))); - m_32apsk[3] = gr_complex((r3 * cos(7 * GR_M_PI / 16.0)), (r3 * sin(7 * GR_M_PI / 16.0))); - m_32apsk[4] = gr_complex((r2 * cos(3 * GR_M_PI / 4.0)), (r2 * sin(3 * GR_M_PI / 4.0))); - m_32apsk[5] = gr_complex((r2 * cos(7 * GR_M_PI / 12.0)), (r2 * sin(7 * GR_M_PI / 12.0))); - m_32apsk[6] = gr_complex((r2 * cos(GR_M_PI / 4.0)), (r2 * sin(GR_M_PI / 4.0))); - m_32apsk[7] = gr_complex((r2 * cos(5 * GR_M_PI / 12.0)), (r2 * sin(5 * GR_M_PI / 12.0))); - m_32apsk[8] = gr_complex((r3 * cos(13 * GR_M_PI / 16.0)), (r3 * sin(13 * GR_M_PI / 16.0))); - m_32apsk[9] = gr_complex((r3 * cos(15 * GR_M_PI / 16.0)), (r3 * sin(15 * GR_M_PI / 16.0))); - m_32apsk[10] = gr_complex((r3 * cos(3 * GR_M_PI / 16.0)), (r3 * sin(3 * GR_M_PI / 16.0))); - m_32apsk[11] = gr_complex((r3 * cos(GR_M_PI / 16.0)), (r3 * sin(GR_M_PI / 16.0))); - m_32apsk[12] = gr_complex((r2 * cos(11 * GR_M_PI / 12.0)), (r2 * sin(11 * GR_M_PI / 12.0))); - m_32apsk[13] = gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); - m_32apsk[14] = gr_complex((r2 * cos(GR_M_PI / 12.0)), (r2 * sin(GR_M_PI / 12.0))); - m_32apsk[15] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); - m_32apsk[16] = gr_complex((r3 * cos(21 * GR_M_PI / 16.0)), (r3 * sin(21 * GR_M_PI / 16.0))); - m_32apsk[17] = gr_complex((r3 * cos(23 * GR_M_PI / 16.0)), (r3 * sin(23 * GR_M_PI / 16.0))); - m_32apsk[18] = gr_complex((r3 * cos(27 * GR_M_PI / 16.0)), (r3 * sin(27 * GR_M_PI / 16.0))); - m_32apsk[19] = gr_complex((r3 * cos(25 * GR_M_PI / 16.0)), (r3 * sin(25 * GR_M_PI / 16.0))); - m_32apsk[20] = gr_complex((r2 * cos(5 * GR_M_PI / 4.0)), (r2 * sin(5 * GR_M_PI / 4.0))); - m_32apsk[21] = gr_complex((r2 * cos(17 * GR_M_PI / 12.0)), (r2 * sin(17 * GR_M_PI / 12.0))); - m_32apsk[22] = gr_complex((r2 * cos(7 * GR_M_PI / 4.0)), (r2 * sin(7 * GR_M_PI / 4.0))); - m_32apsk[23] = gr_complex((r2 * cos(19 * GR_M_PI / 12.0)), (r2 * sin(19 * GR_M_PI / 12.0))); - m_32apsk[24] = gr_complex((r3 * cos(19 * GR_M_PI / 16.0)), (r3 * sin(19 * GR_M_PI / 16.0))); - m_32apsk[25] = gr_complex((r3 * cos(17 * GR_M_PI / 16.0)), (r3 * sin(17 * GR_M_PI / 16.0))); - m_32apsk[26] = gr_complex((r3 * cos(29 * GR_M_PI / 16.0)), (r3 * sin(29 * GR_M_PI / 16.0))); - m_32apsk[27] = gr_complex((r3 * cos(31 * GR_M_PI / 16.0)), (r3 * sin(31 * GR_M_PI / 16.0))); - m_32apsk[28] = gr_complex((r2 * cos(13 * GR_M_PI / 12.0)), (r2 * sin(13 * GR_M_PI / 12.0))); - m_32apsk[29] = gr_complex((r1 * cos(5 * GR_M_PI / 4.0)), (r1 * sin(5 * GR_M_PI / 4.0))); - m_32apsk[30] = gr_complex((r2 * cos(23 * GR_M_PI / 12.0)), (r2 * sin(23 * GR_M_PI / 12.0))); - m_32apsk[31] = gr_complex((r1 * cos(7 * GR_M_PI / 4.0)), (r1 * sin(7 * GR_M_PI / 4.0))); - break; - case MOD_4_8_4_16APSK: - r4 = m; - switch(rate) { - case C128_180: - r1 = r4 / 5.6; - r3 = r1 * 2.99; - r2 = r1 * 2.6; - break; - case C132_180: - r1 = r4 / 5.6; - r3 = r1 * 2.86; - r2 = r1 * 2.6; - break; - case C140_180: - r1 = r4 / 5.6; - r3 = r1 * 3.08; - r2 = r1 * 2.6; - break; - default: - r1 = 0; - r2 = 0; - r3 = 0; - break; - } - m_32apsk[0] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); - m_32apsk[1] = gr_complex((r4 * cos(7 * GR_M_PI / 16.0)), (r4 * sin(7 * GR_M_PI / 16.0))); - m_32apsk[2] = gr_complex((r1 * cos(7 * GR_M_PI / 4.0)), (r1 * sin(7 * GR_M_PI / 4.0))); - m_32apsk[3] = gr_complex((r4 * cos(25 * GR_M_PI / 16.0)), (r4 * sin(25 * GR_M_PI / 16.0))); - m_32apsk[4] = gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); - m_32apsk[5] = gr_complex((r4 * cos(9 * GR_M_PI / 16.0)), (r4 * sin(9 * GR_M_PI / 16.0))); - m_32apsk[6] = gr_complex((r1 * cos(5 * GR_M_PI / 4.0)), (r1 * sin(5 * GR_M_PI / 4.0))); - m_32apsk[7] = gr_complex((r4 * cos(23 * GR_M_PI / 16.0)), (r4 * sin(23 * GR_M_PI / 16.0))); - m_32apsk[8] = gr_complex((r2 * cos(GR_M_PI / 12.0)), (r2 * sin(GR_M_PI / 12.0))); - m_32apsk[9] = gr_complex((r4 * cos(GR_M_PI / 16.0)), (r4 * sin(GR_M_PI / 16.0))); - m_32apsk[10] = gr_complex((r2 * cos(23 * GR_M_PI / 12.0)), (r2 * sin(23 * GR_M_PI / 12.0))); - m_32apsk[11] = gr_complex((r4 * cos(31 * GR_M_PI / 16.0)), (r4 * sin(31 * GR_M_PI / 16.0))); - m_32apsk[12] = gr_complex((r2 * cos(11 * GR_M_PI / 12.0)), (r2 * sin(11 * GR_M_PI / 12.0))); - m_32apsk[13] = gr_complex((r4 * cos(15 * GR_M_PI / 16.0)), (r4 * sin(15 * GR_M_PI / 16.0))); - m_32apsk[14] = gr_complex((r2 * cos(13 * GR_M_PI / 12.0)), (r2 * sin(13 * GR_M_PI / 12.0))); - m_32apsk[15] = gr_complex((r4 * cos(17 * GR_M_PI / 16.0)), (r4 * sin(17 * GR_M_PI / 16.0))); - m_32apsk[16] = gr_complex((r2 * cos(5 * GR_M_PI / 12.0)), (r2 * sin(5 * GR_M_PI / 12.0))); - m_32apsk[17] = gr_complex((r4 * cos(5 * GR_M_PI / 16.0)), (r4 * sin(5 * GR_M_PI / 16.0))); - m_32apsk[18] = gr_complex((r2 * cos(19 * GR_M_PI / 12.0)), (r2 * sin(19 * GR_M_PI / 12.0))); - m_32apsk[19] = gr_complex((r4 * cos(27 * GR_M_PI / 16.0)), (r4 * sin(27 * GR_M_PI / 16.0))); - m_32apsk[20] = gr_complex((r2 * cos(7 * GR_M_PI / 12.0)), (r2 * sin(7 * GR_M_PI / 12.0))); - m_32apsk[21] = gr_complex((r4 * cos(11 * GR_M_PI / 16.0)), (r4 * sin(11 * GR_M_PI / 16.0))); - m_32apsk[22] = gr_complex((r2 * cos(17 * GR_M_PI / 12.0)), (r2 * sin(17 * GR_M_PI / 12.0))); - m_32apsk[23] = gr_complex((r4 * cos(21 * GR_M_PI / 16.0)), (r4 * sin(21 * GR_M_PI / 16.0))); - m_32apsk[24] = gr_complex((r3 * cos(GR_M_PI / 4.0)), (r3 * sin(GR_M_PI / 4.0))); - m_32apsk[25] = gr_complex((r4 * cos(3 * GR_M_PI / 16.0)), (r4 * sin(3 * GR_M_PI / 16.0))); - m_32apsk[26] = gr_complex((r3 * cos(7 * GR_M_PI / 4.0)), (r3 * sin(7 * GR_M_PI / 4.0))); - m_32apsk[27] = gr_complex((r4 * cos(29 * GR_M_PI / 16.0)), (r4 * sin(29 * GR_M_PI / 16.0))); - m_32apsk[28] = gr_complex((r3 * cos(3 * GR_M_PI / 4.0)), (r3 * sin(3 * GR_M_PI / 4.0))); - m_32apsk[29] = gr_complex((r4 * cos(13 * GR_M_PI / 16.0)), (r4 * sin(13 * GR_M_PI / 16.0))); - m_32apsk[30] = gr_complex((r3 * cos(5 * GR_M_PI / 4.0)), (r3 * sin(5 * GR_M_PI / 4.0))); - m_32apsk[31] = gr_complex((r4 * cos(19 * GR_M_PI / 16.0)), (r4 * sin(19 * GR_M_PI / 16.0))); - break; - case MOD_64APSK: - r4 = m; - switch(rate) { - case C128_180: - r1 = r4 / 3.95; - r3 = r1 * 2.72; - r2 = r1 * 1.88; - break; - default: - r1 = 0; - r2 = 0; - r3 = 0; - break; - } - m_64apsk[0] = gr_complex((r1 * cos(GR_M_PI / 16.0)), (r1 * sin(GR_M_PI / 16.0))); - m_64apsk[1] = gr_complex((r1 * cos(3 * GR_M_PI / 16.0)), (r1 * sin(3 * GR_M_PI / 16.0))); - m_64apsk[2] = gr_complex((r1 * cos(7 * GR_M_PI / 16.0)), (r1 * sin(7 * GR_M_PI / 16.0))); - m_64apsk[3] = gr_complex((r1 * cos(5 * GR_M_PI / 16.0)), (r1 * sin(5 * GR_M_PI / 16.0))); - m_64apsk[4] = gr_complex((r1 * cos(15 * GR_M_PI / 16.0)), (r1 * sin(15 * GR_M_PI / 16.0))); - m_64apsk[5] = gr_complex((r1 * cos(13 * GR_M_PI / 16.0)), (r1 * sin(13 * GR_M_PI / 16.0))); - m_64apsk[6] = gr_complex((r1 * cos(9 * GR_M_PI / 16.0)), (r1 * sin(9 * GR_M_PI / 16.0))); - m_64apsk[7] = gr_complex((r1 * cos(11 * GR_M_PI / 16.0)), (r1 * sin(11 * GR_M_PI / 16.0))); - m_64apsk[8] = gr_complex((r1 * cos(31 * GR_M_PI / 16.0)), (r1 * sin(31 * GR_M_PI / 16.0))); - m_64apsk[9] = gr_complex((r1 * cos(29 * GR_M_PI / 16.0)), (r1 * sin(29 * GR_M_PI / 16.0))); - m_64apsk[10] = gr_complex((r1 * cos(25 * GR_M_PI / 16.0)), (r1 * sin(25 * GR_M_PI / 16.0))); - m_64apsk[11] = gr_complex((r1 * cos(27 * GR_M_PI / 16.0)), (r1 * sin(27 * GR_M_PI / 16.0))); - m_64apsk[12] = gr_complex((r1 * cos(17 * GR_M_PI / 16.0)), (r1 * sin(17 * GR_M_PI / 16.0))); - m_64apsk[13] = gr_complex((r1 * cos(19 * GR_M_PI / 16.0)), (r1 * sin(19 * GR_M_PI / 16.0))); - m_64apsk[14] = gr_complex((r1 * cos(23 * GR_M_PI / 16.0)), (r1 * sin(23 * GR_M_PI / 16.0))); - m_64apsk[15] = gr_complex((r1 * cos(21 * GR_M_PI / 16.0)), (r1 * sin(21 * GR_M_PI / 16.0))); - m_64apsk[16] = gr_complex((r2 * cos(GR_M_PI / 16.0)), (r2 * sin(GR_M_PI / 16.0))); - m_64apsk[17] = gr_complex((r2 * cos(3 * GR_M_PI / 16.0)), (r2 * sin(3 * GR_M_PI / 16.0))); - m_64apsk[18] = gr_complex((r2 * cos(7 * GR_M_PI / 16.0)), (r2 * sin(7 * GR_M_PI / 16.0))); - m_64apsk[19] = gr_complex((r2 * cos(5 * GR_M_PI / 16.0)), (r2 * sin(5 * GR_M_PI / 16.0))); - m_64apsk[20] = gr_complex((r2 * cos(15 * GR_M_PI / 16.0)), (r2 * sin(15* GR_M_PI / 16.0))); - m_64apsk[21] = gr_complex((r2 * cos(13 * GR_M_PI / 16.0)), (r2 * sin(13 * GR_M_PI / 16.0))); - m_64apsk[22] = gr_complex((r2 * cos(9 * GR_M_PI / 16.0)), (r2 * sin(9 * GR_M_PI / 16.0))); - m_64apsk[23] = gr_complex((r2 * cos(11 * GR_M_PI / 16.0)), (r2 * sin(11 * GR_M_PI / 16.0))); - m_64apsk[24] = gr_complex((r2 * cos(31 * GR_M_PI / 16.0)), (r2 * sin(31 * GR_M_PI / 16.0))); - m_64apsk[25] = gr_complex((r2 * cos(29 * GR_M_PI / 16.0)), (r2 * sin(29 * GR_M_PI / 16.0))); - m_64apsk[26] = gr_complex((r2 * cos(25 * GR_M_PI / 16.0)), (r2 * sin(25 * GR_M_PI / 16.0))); - m_64apsk[27] = gr_complex((r2 * cos(27 * GR_M_PI / 16.0)), (r2 * sin(27 * GR_M_PI / 16.0))); - m_64apsk[28] = gr_complex((r2 * cos(17 * GR_M_PI / 16.0)), (r2 * sin(17 * GR_M_PI / 16.0))); - m_64apsk[29] = gr_complex((r2 * cos(19 * GR_M_PI / 16.0)), (r2 * sin(19 * GR_M_PI / 16.0))); - m_64apsk[30] = gr_complex((r2 * cos(23 * GR_M_PI / 16.0)), (r2 * sin(23 * GR_M_PI / 16.0))); - m_64apsk[31] = gr_complex((r2 * cos(21 * GR_M_PI / 16.0)), (r2 * sin(21 * GR_M_PI / 16.0))); - m_64apsk[32] = gr_complex((r4 * cos(GR_M_PI / 16.0)), (r4 * sin(GR_M_PI / 16.0))); - m_64apsk[33] = gr_complex((r4 * cos(3 * GR_M_PI / 16.0)), (r4 * sin(3 * GR_M_PI / 16.0))); - m_64apsk[34] = gr_complex((r4 * cos(7 * GR_M_PI / 16.0)), (r4 * sin(7 * GR_M_PI / 16.0))); - m_64apsk[35] = gr_complex((r4 * cos(5 * GR_M_PI / 16.0)), (r4 * sin(5 * GR_M_PI / 16.0))); - m_64apsk[36] = gr_complex((r4 * cos(15 * GR_M_PI / 16.0)), (r4 * sin(15 * GR_M_PI / 16.0))); - m_64apsk[37] = gr_complex((r4 * cos(13 * GR_M_PI / 16.0)), (r4 * sin(13 * GR_M_PI / 16.0))); - m_64apsk[38] = gr_complex((r4 * cos(9 * GR_M_PI / 16.0)), (r4 * sin(9 * GR_M_PI / 16.0))); - m_64apsk[39] = gr_complex((r4 * cos(11 * GR_M_PI / 16.0)), (r4 * sin(11 * GR_M_PI / 16.0))); - m_64apsk[40] = gr_complex((r4 * cos(31 * GR_M_PI / 16.0)), (r4 * sin(31 * GR_M_PI / 16.0))); - m_64apsk[41] = gr_complex((r4 * cos(29 * GR_M_PI / 16.0)), (r4 * sin(29 * GR_M_PI / 16.0))); - m_64apsk[42] = gr_complex((r4 * cos(25 * GR_M_PI / 16.0)), (r4 * sin(25 * GR_M_PI / 16.0))); - m_64apsk[43] = gr_complex((r4 * cos(27 * GR_M_PI / 16.0)), (r4 * sin(27 * GR_M_PI / 16.0))); - m_64apsk[44] = gr_complex((r4 * cos(17 * GR_M_PI / 16.0)), (r4 * sin(17 * GR_M_PI / 16.0))); - m_64apsk[45] = gr_complex((r4 * cos(19 * GR_M_PI / 16.0)), (r4 * sin(19 * GR_M_PI / 16.0))); - m_64apsk[46] = gr_complex((r4 * cos(23 * GR_M_PI / 16.0)), (r4 * sin(23 * GR_M_PI / 16.0))); - m_64apsk[47] = gr_complex((r4 * cos(21 * GR_M_PI / 16.0)), (r4 * sin(21 * GR_M_PI / 16.0))); - m_64apsk[48] = gr_complex((r3 * cos(GR_M_PI / 16.0)), (r3 * sin(GR_M_PI / 16.0))); - m_64apsk[49] = gr_complex((r3 * cos(3 * GR_M_PI / 16.0)), (r3 * sin(3 * GR_M_PI / 16.0))); - m_64apsk[50] = gr_complex((r3 * cos(7 * GR_M_PI / 16.0)), (r3 * sin(7 * GR_M_PI / 16.0))); - m_64apsk[51] = gr_complex((r3 * cos(5 * GR_M_PI / 16.0)), (r3 * sin(5 * GR_M_PI / 16.0))); - m_64apsk[52] = gr_complex((r3 * cos(15 * GR_M_PI / 16.0)), (r3 * sin(15 * GR_M_PI / 16.0))); - m_64apsk[53] = gr_complex((r3 * cos(13 * GR_M_PI / 16.0)), (r3 * sin(13 * GR_M_PI / 16.0))); - m_64apsk[54] = gr_complex((r3 * cos(9 * GR_M_PI / 16.0)), (r3 * sin(9 * GR_M_PI / 16.0))); - m_64apsk[55] = gr_complex((r3 * cos(11 * GR_M_PI / 16.0)), (r3 * sin(11 * GR_M_PI / 16.0))); - m_64apsk[56] = gr_complex((r3 * cos(31 * GR_M_PI / 16.0)), (r3 * sin(31 * GR_M_PI / 16.0))); - m_64apsk[57] = gr_complex((r3 * cos(29 * GR_M_PI / 16.0)), (r3 * sin(29 * GR_M_PI / 16.0))); - m_64apsk[58] = gr_complex((r3 * cos(25 * GR_M_PI / 16.0)), (r3 * sin(25 * GR_M_PI / 16.0))); - m_64apsk[59] = gr_complex((r3 * cos(27 * GR_M_PI / 16.0)), (r3 * sin(27 * GR_M_PI / 16.0))); - m_64apsk[60] = gr_complex((r3 * cos(17 * GR_M_PI / 16.0)), (r3 * sin(17 * GR_M_PI / 16.0))); - m_64apsk[61] = gr_complex((r3 * cos(19 * GR_M_PI / 16.0)), (r3 * sin(19 * GR_M_PI / 16.0))); - m_64apsk[62] = gr_complex((r3 * cos(23 * GR_M_PI / 16.0)), (r3 * sin(23 * GR_M_PI / 16.0))); - m_64apsk[63] = gr_complex((r3 * cos(21 * GR_M_PI / 16.0)), (r3 * sin(21 * GR_M_PI / 16.0))); - break; - case MOD_8_16_20_20APSK: - r4 = m; - switch(rate) { - case C7_9: - case C4_5: - r1 = r4 / 5.2; - r3 = r1 * 3.6; - r2 = r1 * 2.2; - break; - case C5_6: - r1 = r4 / 5.0; - r3 = r1 * 3.5; - r2 = r1 * 2.2; - break; - default: - r1 = 0; - r2 = 0; - r3 = 0; - break; - } - m_64apsk[0] = gr_complex((r2 * cos(25 * GR_M_PI / 16.0)), (r2 * sin(25 * GR_M_PI / 16.0))); - m_64apsk[1] = gr_complex((r4 * cos(7 * GR_M_PI / 4.0)), (r4 * sin(7 * GR_M_PI / 4.0))); - m_64apsk[2] = gr_complex((r2 * cos(27 * GR_M_PI / 16.0)), (r2 * sin(27 * GR_M_PI / 16.0))); - m_64apsk[3] = gr_complex((r3 * cos(7 * GR_M_PI / 4.0)), (r3 * sin(7 * GR_M_PI / 4.0))); - m_64apsk[4] = gr_complex((r4 * cos(31 * GR_M_PI / 20.0)), (r4 * sin(31 * GR_M_PI / 20.0))); - m_64apsk[5] = gr_complex((r4 * cos(33 * GR_M_PI / 20.0)), (r4 * sin(33 * GR_M_PI / 20.0))); - m_64apsk[6] = gr_complex((r3 * cos(31 * GR_M_PI / 20.0)), (r3 * sin(31 * GR_M_PI / 20.0))); - m_64apsk[7] = gr_complex((r3 * cos(33 * GR_M_PI / 20.0)), (r3 * sin(33 * GR_M_PI / 20.0))); - m_64apsk[8] = gr_complex((r2 * cos(23 * GR_M_PI / 16.0)), (r2 * sin(23 * GR_M_PI / 16.0))); - m_64apsk[9] = gr_complex((r4 * cos(5 * GR_M_PI / 4.0)), (r4 * sin(5 * GR_M_PI / 4.0))); - m_64apsk[10] = gr_complex((r2 * cos(21 * GR_M_PI / 16.0)), (r2 * sin(21 * GR_M_PI / 16.0))); - m_64apsk[11] = gr_complex((r3 * cos(5 * GR_M_PI / 4.0)), (r3 * sin(5 * GR_M_PI / 4.0))); - m_64apsk[12] = gr_complex((r4 * cos(29 * GR_M_PI / 20.0)), (r4 * sin(29 * GR_M_PI / 20.0))); - m_64apsk[13] = gr_complex((r4 * cos(27 * GR_M_PI / 20.0)), (r4 * sin(27 * GR_M_PI / 20.0))); - m_64apsk[14] = gr_complex((r3 * cos(29 * GR_M_PI / 20.0)), (r3 * sin(29 * GR_M_PI / 20.0))); - m_64apsk[15] = gr_complex((r3 * cos(27 * GR_M_PI / 20.0)), (r3 * sin(27 * GR_M_PI / 20.0))); - m_64apsk[16] = gr_complex((r1 * cos(13 * GR_M_PI / 8.0)), (r1 * sin(13 * GR_M_PI / 8.0))); - m_64apsk[17] = gr_complex((r4 * cos(37 * GR_M_PI / 20.0)), (r4 * sin(37 * GR_M_PI / 20.0))); - m_64apsk[18] = gr_complex((r2 * cos(29 * GR_M_PI / 16.0)), (r2 * sin(29 * GR_M_PI / 16.0))); - m_64apsk[19] = gr_complex((r3 * cos(37 * GR_M_PI / 20.0)), (r3 * sin(37 * GR_M_PI / 20.0))); - m_64apsk[20] = gr_complex((r1 * cos(15 * GR_M_PI / 8.0)), (r1 * sin(15 * GR_M_PI / 8.0))); - m_64apsk[21] = gr_complex((r4 * cos(39 * GR_M_PI / 20.0)), (r4 * sin(39 * GR_M_PI / 20.0))); - m_64apsk[22] = gr_complex((r2 * cos(31 * GR_M_PI / 16.0)), (r2 * sin(31 * GR_M_PI / 16.0))); - m_64apsk[23] = gr_complex((r3 * cos(39 * GR_M_PI / 20.0)), (r3 * sin(39 * GR_M_PI / 20.0))); - m_64apsk[24] = gr_complex((r1 * cos(11 * GR_M_PI / 8.0)), (r1 * sin(11 * GR_M_PI / 8.0))); - m_64apsk[25] = gr_complex((r4 * cos(23 * GR_M_PI / 20.0)), (r4 * sin(23 * GR_M_PI / 20.0))); - m_64apsk[26] = gr_complex((r2 * cos(19 * GR_M_PI / 16.0)), (r2 * sin(19 * GR_M_PI / 16.0))); - m_64apsk[27] = gr_complex((r3 * cos(23 * GR_M_PI / 20.0)), (r3 * sin(23 * GR_M_PI / 20.0))); - m_64apsk[28] = gr_complex((r1 * cos(9 * GR_M_PI / 8.0)), (r1 * sin(9 * GR_M_PI / 8.0))); - m_64apsk[29] = gr_complex((r4 * cos(21 * GR_M_PI / 20.0)), (r4 * sin(21 * GR_M_PI / 20.0))); - m_64apsk[30] = gr_complex((r2 * cos(17 * GR_M_PI / 16.0)), (r2 * sin(17 * GR_M_PI / 16.0))); - m_64apsk[31] = gr_complex((r3 * cos(21 * GR_M_PI / 20.0)), (r3 * sin(21 * GR_M_PI / 20.0))); - m_64apsk[32] = gr_complex((r2 * cos(7 * GR_M_PI / 16.0)), (r2 * sin(7 * GR_M_PI / 16.0))); - m_64apsk[33] = gr_complex((r4 * cos(GR_M_PI / 4.0)), (r4 * sin(GR_M_PI / 4.0))); - m_64apsk[34] = gr_complex((r2 * cos(5 * GR_M_PI / 16.0)), (r2 * sin(5 * GR_M_PI / 16.0))); - m_64apsk[35] = gr_complex((r3 * cos(GR_M_PI / 4.0)), (r3 * sin(GR_M_PI / 4.0))); - m_64apsk[36] = gr_complex((r4 * cos(9 * GR_M_PI / 20.0)), (r4 * sin(9 * GR_M_PI / 20.0))); - m_64apsk[37] = gr_complex((r4 * cos(7 * GR_M_PI / 20.0)), (r4 * sin(7 * GR_M_PI / 20.0))); - m_64apsk[38] = gr_complex((r3 * cos(9 * GR_M_PI / 20.0)), (r3 * sin(9 * GR_M_PI / 20.0))); - m_64apsk[39] = gr_complex((r3 * cos(7 * GR_M_PI / 20.0)), (r3 * sin(7 * GR_M_PI / 20.0))); - m_64apsk[40] = gr_complex((r2 * cos(9 * GR_M_PI / 16.0)), (r2 * sin(9 * GR_M_PI / 16.0))); - m_64apsk[41] = gr_complex((r4 * cos(3 * GR_M_PI / 4.0)), (r4 * sin(3 * GR_M_PI / 4.0))); - m_64apsk[42] = gr_complex((r2 * cos(11 * GR_M_PI / 16.0)), (r2 * sin(11 * GR_M_PI / 16.0))); - m_64apsk[43] = gr_complex((r3 * cos(3 * GR_M_PI / 4.0)), (r3 * sin(3 * GR_M_PI / 4.0))); - m_64apsk[44] = gr_complex((r4 * cos(11 * GR_M_PI / 20.0)), (r4 * sin(11 * GR_M_PI / 20.0))); - m_64apsk[45] = gr_complex((r4 * cos(13 * GR_M_PI / 20.0)), (r4 * sin(13 * GR_M_PI / 20.0))); - m_64apsk[46] = gr_complex((r3 * cos(11 * GR_M_PI / 20.0)), (r3 * sin(11 * GR_M_PI / 20.0))); - m_64apsk[47] = gr_complex((r3 * cos(13 * GR_M_PI / 20.0)), (r3 * sin(13 * GR_M_PI / 20.0))); - m_64apsk[48] = gr_complex((r1 * cos(3 * GR_M_PI / 8.0)), (r1 * sin(3 * GR_M_PI / 8.0))); - m_64apsk[49] = gr_complex((r4 * cos(3 * GR_M_PI / 20.0)), (r4 * sin(3 * GR_M_PI / 20.0))); - m_64apsk[50] = gr_complex((r2 * cos(3 * GR_M_PI / 16.0)), (r2 * sin(3 * GR_M_PI / 16.0))); - m_64apsk[51] = gr_complex((r3 * cos(3 * GR_M_PI / 20.0)), (r3 * sin(3 * GR_M_PI / 20.0))); - m_64apsk[52] = gr_complex((r1 * cos(GR_M_PI / 8.0)), (r1 * sin(GR_M_PI / 8.0))); - m_64apsk[53] = gr_complex((r4 * cos(GR_M_PI / 20.0)), (r4 * sin(GR_M_PI / 20.0))); - m_64apsk[54] = gr_complex((r2 * cos(GR_M_PI / 16.0)), (r2 * sin(GR_M_PI / 16.0))); - m_64apsk[55] = gr_complex((r3 * cos(GR_M_PI / 20.0)), (r3 * sin(GR_M_PI / 20.0))); - m_64apsk[56] = gr_complex((r1 * cos(5 * GR_M_PI / 8.0)), (r1 * sin(5 * GR_M_PI / 8.0))); - m_64apsk[57] = gr_complex((r4 * cos(17 * GR_M_PI / 20.0)), (r4 * sin(17 * GR_M_PI / 20.0))); - m_64apsk[58] = gr_complex((r2 * cos(13 * GR_M_PI / 16.0)), (r2 * sin(13 * GR_M_PI / 16.0))); - m_64apsk[59] = gr_complex((r3 * cos(17 * GR_M_PI / 20.0)), (r3 * sin(17 * GR_M_PI / 20.0))); - m_64apsk[60] = gr_complex((r1 * cos(7 * GR_M_PI / 8.0)), (r1 * sin(7 * GR_M_PI / 8.0))); - m_64apsk[61] = gr_complex((r4 * cos(19 * GR_M_PI / 20.0)), (r4 * sin(19 * GR_M_PI / 20.0))); - m_64apsk[62] = gr_complex((r2 * cos(15 * GR_M_PI / 16.0)), (r2 * sin(15 * GR_M_PI / 16.0))); - m_64apsk[63] = gr_complex((r3 * cos(19 * GR_M_PI / 20.0)), (r3 * sin(19 * GR_M_PI / 20.0))); - break; - case MOD_4_12_20_28APSK: - r4 = m; - switch(rate) { - case C132_180: - r1 = r4 / 7.0; - r3 = r1 * 4.3; - r2 = r1 * 2.4; - break; - default: - r1 = 0; - r2 = 0; - r3 = 0; - break; - } - m_64apsk[0] = gr_complex((r4 * cos(GR_M_PI / 4.0)), (r4 * sin(GR_M_PI / 4.0))); - m_64apsk[1] = gr_complex((r4 * cos(7 * GR_M_PI / 4.0)), (r4 * sin(7 * GR_M_PI / 4.0))); - m_64apsk[2] = gr_complex((r4 * cos(3 * GR_M_PI / 4.0)), (r4 * sin(3 * GR_M_PI / 4.0))); - m_64apsk[3] = gr_complex((r4 * cos(5 * GR_M_PI / 4.0)), (r4 * sin(5 * GR_M_PI / 4.0))); - m_64apsk[4] = gr_complex((r4 * cos(13 * GR_M_PI / 28.0)), (r4 * sin(13 * GR_M_PI / 28.0))); - m_64apsk[5] = gr_complex((r4 * cos(43 * GR_M_PI / 28.0)), (r4 * sin(43 * GR_M_PI / 28.0))); - m_64apsk[6] = gr_complex((r4 * cos(15 * GR_M_PI / 28.0)), (r4 * sin(15 * GR_M_PI / 28.0))); - m_64apsk[7] = gr_complex((r4 * cos(41 * GR_M_PI / 28.0)), (r4 * sin(41 * GR_M_PI / 28.0))); - m_64apsk[8] = gr_complex((r4 * cos(GR_M_PI / 28.0)), (r4 * sin(GR_M_PI / 28.0))); - m_64apsk[9] = gr_complex((r4 * cos(55 * GR_M_PI / 28.0)), (r4 * sin(55 * GR_M_PI / 28.0))); - m_64apsk[10] = gr_complex((r4 * cos(27 * GR_M_PI / 28.0)), (r4 * sin(27 * GR_M_PI / 28.0))); - m_64apsk[11] = gr_complex((r4 * cos(29 * GR_M_PI / 28.0)), (r4 * sin(29 * GR_M_PI / 28.0))); - m_64apsk[12] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); - m_64apsk[13] = gr_complex((r1 * cos(7 * GR_M_PI / 4.0)), (r1 * sin(7 * GR_M_PI / 4.0))); - m_64apsk[14] = gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); - m_64apsk[15] = gr_complex((r1 * cos(5 * GR_M_PI / 4.0)), (r1 * sin(5 * GR_M_PI / 4.0))); - m_64apsk[16] = gr_complex((r4 * cos(9 * GR_M_PI / 28.0)), (r4 * sin(9 * GR_M_PI / 28.0))); - m_64apsk[17] = gr_complex((r4 * cos(47 * GR_M_PI / 28.0)), (r4 * sin(47 * GR_M_PI / 28.0))); - m_64apsk[18] = gr_complex((r4 * cos(19 * GR_M_PI / 28.0)), (r4 * sin(19 * GR_M_PI / 28.0))); - m_64apsk[19] = gr_complex((r4 * cos(37 * GR_M_PI / 28.0)), (r4 * sin(37 * GR_M_PI / 28.0))); - m_64apsk[20] = gr_complex((r4 * cos(11 * GR_M_PI / 28.0)), (r4 * sin(11 * GR_M_PI / 28.0))); - m_64apsk[21] = gr_complex((r4 * cos(45 * GR_M_PI / 28.0)), (r4 * sin(45 * GR_M_PI / 28.0))); - m_64apsk[22] = gr_complex((r4 * cos(17 * GR_M_PI / 28.0)), (r4 * sin(17 * GR_M_PI / 28.0))); - m_64apsk[23] = gr_complex((r4 * cos(39 * GR_M_PI / 28.0)), (r4 * sin(39 * GR_M_PI / 28.0))); - m_64apsk[24] = gr_complex((r3 * cos(GR_M_PI / 20.0)), (r3 * sin(GR_M_PI / 20.0))); - m_64apsk[25] = gr_complex((r3 * cos(39 * GR_M_PI / 20.0)), (r3 * sin(39 * GR_M_PI / 20.0))); - m_64apsk[26] = gr_complex((r3 * cos(19 * GR_M_PI / 20.0)), (r3 * sin(19 * GR_M_PI / 20.0))); - m_64apsk[27] = gr_complex((r3 * cos(21 * GR_M_PI / 20.0)), (r3 * sin(21 * GR_M_PI / 20.0))); - m_64apsk[28] = gr_complex((r2 * cos(GR_M_PI / 12.0)), (r2 * sin(GR_M_PI / 12.0))); - m_64apsk[29] = gr_complex((r2 * cos(23 * GR_M_PI / 12.0)), (r2 * sin(23 * GR_M_PI / 12.0))); - m_64apsk[30] = gr_complex((r2 * cos(11 * GR_M_PI / 12.0)), (r2 * sin(11 * GR_M_PI / 12.0))); - m_64apsk[31] = gr_complex((r2 * cos(13 * GR_M_PI / 12.0)), (r2 * sin(13 * GR_M_PI / 12.0))); - m_64apsk[32] = gr_complex((r4 * cos(5 * GR_M_PI / 28.0)), (r4 * sin(5 * GR_M_PI / 28.0))); - m_64apsk[33] = gr_complex((r4 * cos(51 * GR_M_PI / 28.0)), (r4 * sin(51 * GR_M_PI / 28.0))); - m_64apsk[34] = gr_complex((r4 * cos(23 * GR_M_PI / 28.0)), (r4 * sin(23 * GR_M_PI / 28.0))); - m_64apsk[35] = gr_complex((r4 * cos(33 * GR_M_PI / 28.0)), (r4 * sin(33 * GR_M_PI / 28.0))); - m_64apsk[36] = gr_complex((r3 * cos(9 * GR_M_PI / 20.0)), (r3 * sin(9 * GR_M_PI / 20.0))); - m_64apsk[37] = gr_complex((r3 * cos(31 * GR_M_PI / 20.0)), (r3 * sin(31 * GR_M_PI / 20.0))); - m_64apsk[38] = gr_complex((r3 * cos(11 * GR_M_PI / 20.0)), (r3 * sin(11 * GR_M_PI / 20.0))); - m_64apsk[39] = gr_complex((r3 * cos(29 * GR_M_PI / 20.0)), (r3 * sin(29 * GR_M_PI / 20.0))); - m_64apsk[40] = gr_complex((r4 * cos(3 * GR_M_PI / 28.0)), (r4 * sin(3 * GR_M_PI / 28.0))); - m_64apsk[41] = gr_complex((r4 * cos(53 * GR_M_PI / 28.0)), (r4 * sin(53 * GR_M_PI / 28.0))); - m_64apsk[42] = gr_complex((r4 * cos(25 * GR_M_PI / 28.0)), (r4 * sin(25 * GR_M_PI / 28.0))); - m_64apsk[43] = gr_complex((r4 * cos(31 * GR_M_PI / 28.0)), (r4 * sin(31 * GR_M_PI / 28.0))); - m_64apsk[44] = gr_complex((r2 * cos(5 * GR_M_PI / 12.0)), (r2 * sin(5 * GR_M_PI / 12.0))); - m_64apsk[45] = gr_complex((r2 * cos(19 * GR_M_PI / 12.0)), (r2 * sin(19 * GR_M_PI / 12.0))); - m_64apsk[46] = gr_complex((r2 * cos(7 * GR_M_PI / 12.0)), (r2 * sin(7 * GR_M_PI / 12.0))); - m_64apsk[47] = gr_complex((r2 * cos(17 * GR_M_PI / 12.0)), (r2 * sin(17 * GR_M_PI / 12.0))); - m_64apsk[48] = gr_complex((r3 * cos(GR_M_PI / 4.0)), (r3 * sin(GR_M_PI / 4.0))); - m_64apsk[49] = gr_complex((r3 * cos(7 * GR_M_PI / 4.0)), (r3 * sin(7 * GR_M_PI / 4.0))); - m_64apsk[50] = gr_complex((r3 * cos(3 * GR_M_PI / 4.0)), (r3 * sin(3 * GR_M_PI / 4.0))); - m_64apsk[51] = gr_complex((r3 * cos(5 * GR_M_PI / 4.0)), (r3 * sin(5 * GR_M_PI / 4.0))); - m_64apsk[52] = gr_complex((r3 * cos(7 * GR_M_PI / 20.0)), (r3 * sin(7 * GR_M_PI / 20.0))); - m_64apsk[53] = gr_complex((r3 * cos(33 * GR_M_PI / 20.0)), (r3 * sin(33 * GR_M_PI / 20.0))); - m_64apsk[54] = gr_complex((r3 * cos(13 * GR_M_PI / 20.0)), (r3 * sin(13 * GR_M_PI / 20.0))); - m_64apsk[55] = gr_complex((r3 * cos(27 * GR_M_PI / 20.0)), (r3 * sin(27 * GR_M_PI / 20.0))); - m_64apsk[56] = gr_complex((r3 * cos(3 * GR_M_PI / 20.0)), (r3 * sin(3 * GR_M_PI / 20.0))); - m_64apsk[57] = gr_complex((r3 * cos(37 * GR_M_PI / 20.0)), (r3 * sin(37 * GR_M_PI / 20.0))); - m_64apsk[58] = gr_complex((r3 * cos(17 * GR_M_PI / 20.0)), (r3 * sin(17 * GR_M_PI / 20.0))); - m_64apsk[59] = gr_complex((r3 * cos(23 * GR_M_PI / 20.0)), (r3 * sin(23 * GR_M_PI / 20.0))); - m_64apsk[60] = gr_complex((r2 * cos(GR_M_PI / 4.0)), (r2 * sin(GR_M_PI / 4.0))); - m_64apsk[61] = gr_complex((r2 * cos(7 * GR_M_PI / 4.0)), (r2 * sin(7 * GR_M_PI / 4.0))); - m_64apsk[62] = gr_complex((r2 * cos(3 * GR_M_PI / 4.0)), (r2 * sin(3 * GR_M_PI / 4.0))); - m_64apsk[63] = gr_complex((r2 * cos(5 * GR_M_PI / 4.0)), (r2 * sin(5 * GR_M_PI / 4.0))); - break; - case MOD_128APSK: - r6 = m; - switch(rate) { - case C135_180: - r1 = r6 / 3.819; - r5 = r1 * 2.75; - r4 = r1 * 2.681; - r3 = r1 * 2.118; - r2 = r1 * 1.715; - break; - case C140_180: - r1 = r6 / 3.733; - r5 = r1 * 2.75; - r4 = r1 * 2.681; - r3 = r1 * 2.118; - r2 = r1 * 1.715; - break; - default: - r1 = 0; - r2 = 0; - r3 = 0; - r4 = 0; - r5 = 0; - break; - } - m_128apsk[0] = gr_complex((r1 * cos(83 * GR_M_PI / 1260.0)), (r1 * sin(83 * GR_M_PI / 1260.0))); - m_128apsk[1] = gr_complex((r6 * cos(11 * GR_M_PI / 105.0)), (r6 * sin(11 * GR_M_PI / 105.0))); - m_128apsk[2] = gr_complex((r6 * cos(37 * GR_M_PI / 1680.0)), (r6 * sin(37 * GR_M_PI / 1680.0))); - m_128apsk[3] = gr_complex((r6 * cos(11 * GR_M_PI / 168.0)), (r6 * sin(11 * GR_M_PI / 168.0))); - m_128apsk[4] = gr_complex((r2 * cos(121 * GR_M_PI / 2520.0)), (r2 * sin(121 * GR_M_PI / 2520.0))); - m_128apsk[5] = gr_complex((r3 * cos(23 * GR_M_PI / 280.0)), (r3 * sin(23 * GR_M_PI / 280.0))); - m_128apsk[6] = gr_complex((r5 * cos(19 * GR_M_PI / 720.0)), (r5 * sin(19 * GR_M_PI / 720.0))); - m_128apsk[7] = gr_complex((r4 * cos(61 * GR_M_PI / 720.0)), (r4 * sin(61 * GR_M_PI / 720.0))); - m_128apsk[8] = gr_complex((r1 * cos(103 * GR_M_PI / 560.0)), (r1 * sin(103 * GR_M_PI / 560.0))); - m_128apsk[9] = gr_complex((r6 * cos(61 * GR_M_PI / 420.0)), (r6 * sin(61 * GR_M_PI / 420.0))); - m_128apsk[10] = gr_complex((r6 * cos(383 * GR_M_PI / 1680.0)), (r6 * sin(383 * GR_M_PI / 1680.0))); - m_128apsk[11] = gr_complex((r6 * cos(929 * GR_M_PI / 5040.0)), (r6 * sin(929 * GR_M_PI / 5040.0))); - m_128apsk[12] = gr_complex((r2 * cos(113 * GR_M_PI / 560.0)), (r2 * sin(113 * GR_M_PI / 560.0))); - m_128apsk[13] = gr_complex((r3 * cos(169 * GR_M_PI / 1008.0)), (r3 * sin(169 * GR_M_PI / 1008.0))); - m_128apsk[14] = gr_complex((r5 * cos(563 * GR_M_PI / 2520.0)), (r5 * sin(563 * GR_M_PI / 2520.0))); - m_128apsk[15] = gr_complex((r4 * cos(139 * GR_M_PI / 840.0)), (r4 * sin(139 * GR_M_PI / 840.0))); - m_128apsk[16] = gr_complex((r1 * cos(243 * GR_M_PI / 560.0)), (r1 * sin(243 * GR_M_PI / 560.0))); - m_128apsk[17] = gr_complex((r6 * cos(1993 * GR_M_PI / 5040.0)), (r6 * sin(1993 * GR_M_PI / 5040.0))); - m_128apsk[18] = gr_complex((r6 * cos(43 * GR_M_PI / 90.0)), (r6 * sin(43 * GR_M_PI / 90.0))); - m_128apsk[19] = gr_complex((r6 * cos(73 * GR_M_PI / 168.0)), (r6 * sin(73 * GR_M_PI / 168.0))); - m_128apsk[20] = gr_complex((r2 * cos(1139 * GR_M_PI / 2520.0)), (r2 * sin(1139 * GR_M_PI / 2520.0))); - m_128apsk[21] = gr_complex((r3 * cos(117 * GR_M_PI / 280.0)), (r3 * sin(117 * GR_M_PI / 280.0))); - m_128apsk[22] = gr_complex((r5 * cos(341 * GR_M_PI / 720.0)), (r5 * sin(341 * GR_M_PI / 720.0))); - m_128apsk[23] = gr_complex((r4 * cos(349 * GR_M_PI / 840.0)), (r4 * sin(349 * GR_M_PI / 840.0))); - m_128apsk[24] = gr_complex((r1 * cos(177 * GR_M_PI / 560.0)), (r1 * sin(177 * GR_M_PI / 560.0))); - m_128apsk[25] = gr_complex((r6 * cos(1789 * GR_M_PI / 5040.0)), (r6 * sin(1789 * GR_M_PI / 5040.0))); - m_128apsk[26] = gr_complex((r6 * cos(49 * GR_M_PI / 180.0)), (r6 * sin(49 * GR_M_PI / 180.0))); - m_128apsk[27] = gr_complex((r6 * cos(53 * GR_M_PI / 168.0)), (r6 * sin(53 * GR_M_PI / 168.0))); - m_128apsk[28] = gr_complex((r2 * cos(167 * GR_M_PI / 560.0)), (r2 * sin(167 * GR_M_PI / 560.0))); - m_128apsk[29] = gr_complex((r3 * cos(239 * GR_M_PI / 720.0)), (r3 * sin(239 * GR_M_PI / 720.0))); - m_128apsk[30] = gr_complex((r5 * cos(199 * GR_M_PI / 720.0)), (r5 * sin(199 * GR_M_PI / 720.0))); - m_128apsk[31] = gr_complex((r4 * cos(281 * GR_M_PI / 840.0)), (r4 * sin(281 * GR_M_PI / 840.0))); - m_128apsk[32] = gr_complex((r1 * cos(1177 * GR_M_PI / 1260.0)), (r1 * sin(1177 * GR_M_PI / 1260.0))); - m_128apsk[33] = gr_complex((r6 * cos(94 * GR_M_PI / 105.0)), (r6 * sin(94 * GR_M_PI / 105.0))); - m_128apsk[34] = gr_complex((r6 * cos(1643 * GR_M_PI / 1680.0)), (r6 * sin(1643 * GR_M_PI / 1680.0))); - m_128apsk[35] = gr_complex((r6 * cos(157 * GR_M_PI / 168.0)), (r6 * sin(157 * GR_M_PI / 168.0))); - m_128apsk[36] = gr_complex((r2 * cos(2399 * GR_M_PI / 2520.0)), (r2 * sin(2399 * GR_M_PI / 2520.0))); - m_128apsk[37] = gr_complex((r3 * cos(257 * GR_M_PI / 280.0)), (r3 * sin(257 * GR_M_PI / 280.0))); - m_128apsk[38] = gr_complex((r5 * cos(701 * GR_M_PI / 720.0)), (r5 * sin(701 * GR_M_PI / 720.0))); - m_128apsk[39] = gr_complex((r4 * cos(659 * GR_M_PI / 720.0)), (r4 * sin(659 * GR_M_PI / 720.0))); - m_128apsk[40] = gr_complex((r1 * cos(457 * GR_M_PI / 560.0)), (r1 * sin(457 * GR_M_PI / 560.0))); - m_128apsk[41] = gr_complex((r6 * cos(359 * GR_M_PI / 420.0)), (r6 * sin(359 * GR_M_PI / 420.0))); - m_128apsk[42] = gr_complex((r6 * cos(1297 * GR_M_PI / 1680.0)), (r6 * sin(1297 * GR_M_PI / 1680.0))); - m_128apsk[43] = gr_complex((r6 * cos(4111 * GR_M_PI / 5040.0)), (r6 * sin(4111 * GR_M_PI / 5040.0))); - m_128apsk[44] = gr_complex((r2 * cos(447 * GR_M_PI / 560.0)), (r2 * sin(447 * GR_M_PI / 560.0))); - m_128apsk[45] = gr_complex((r3 * cos(839 * GR_M_PI / 1008.0)), (r3 * sin(839 * GR_M_PI / 1008.0))); - m_128apsk[46] = gr_complex((r5 * cos(1957 * GR_M_PI / 2520.0)), (r5 * sin(1957 * GR_M_PI / 2520.0))); - m_128apsk[47] = gr_complex((r4 * cos(701 * GR_M_PI / 840.0)), (r4 * sin(701 * GR_M_PI / 840.0))); - m_128apsk[48] = gr_complex((r1 * cos(317 * GR_M_PI / 560.0)), (r1 * sin(317 * GR_M_PI / 560.0))); - m_128apsk[49] = gr_complex((r6 * cos(3047 * GR_M_PI / 5040.0)), (r6 * sin(3047 * GR_M_PI / 5040.0))); - m_128apsk[50] = gr_complex((r6 * cos(47 * GR_M_PI / 90.0)), (r6 * sin(47 * GR_M_PI / 90.0))); - m_128apsk[51] = gr_complex((r6 * cos(95 * GR_M_PI / 168.0)), (r6 * sin(95 * GR_M_PI / 168.0))); - m_128apsk[52] = gr_complex((r2 * cos(1381 * GR_M_PI / 2520.0)), (r2 * sin(1381 * GR_M_PI / 2520.0))); - m_128apsk[53] = gr_complex((r3 * cos(163 * GR_M_PI / 280.0)), (r3 * sin(163 * GR_M_PI / 280.0))); - m_128apsk[54] = gr_complex((r5 * cos(379 * GR_M_PI / 720.0)), (r5 * sin(379 * GR_M_PI / 720.0))); - m_128apsk[55] = gr_complex((r4 * cos(491 * GR_M_PI / 840.0)), (r4 * sin(491 * GR_M_PI / 840.0))); - m_128apsk[56] = gr_complex((r1 * cos(383 * GR_M_PI / 560.0)), (r1 * sin(383 * GR_M_PI / 560.0))); - m_128apsk[57] = gr_complex((r6 * cos(3251 * GR_M_PI / 5040.0)), (r6 * sin(3251 * GR_M_PI / 5040.0))); - m_128apsk[58] = gr_complex((r6 * cos(131 * GR_M_PI / 180.0)), (r6 * sin(131 * GR_M_PI / 180.0))); - m_128apsk[59] = gr_complex((r6 * cos(115 * GR_M_PI / 168.0)), (r6 * sin(115 * GR_M_PI / 168.0))); - m_128apsk[60] = gr_complex((r2 * cos(393 * GR_M_PI / 560.0)), (r2 * sin(393 * GR_M_PI / 560.0))); - m_128apsk[61] = gr_complex((r3 * cos(481 * GR_M_PI / 720.0)), (r3 * sin(481 * GR_M_PI / 720.0))); - m_128apsk[62] = gr_complex((r5 * cos(521 * GR_M_PI / 720.0)), (r5 * sin(521 * GR_M_PI / 720.0))); - m_128apsk[63] = gr_complex((r4 * cos(559 * GR_M_PI / 840.0)), (r4 * sin(559 * GR_M_PI / 840.0))); - m_128apsk[64] = gr_complex((r1 * cos(2437 * GR_M_PI / 1260.0)), (r1 * sin(2437 * GR_M_PI / 1260.0))); - m_128apsk[65] = gr_complex((r6 * cos(199 * GR_M_PI / 105.0)), (r6 * sin(199 * GR_M_PI / 105.0))); - m_128apsk[66] = gr_complex((r6 * cos(3323 * GR_M_PI / 1680.0)), (r6 * sin(3323 * GR_M_PI / 1680.0))); - m_128apsk[67] = gr_complex((r6 * cos(325 * GR_M_PI / 168.0)), (r6 * sin(325 * GR_M_PI / 168.0))); - m_128apsk[68] = gr_complex((r2 * cos(4919 * GR_M_PI / 2520.0)), (r2 * sin(4919 * GR_M_PI / 2520.0))); - m_128apsk[69] = gr_complex((r3 * cos(537 * GR_M_PI / 280.0)), (r3 * sin(537 * GR_M_PI / 280.0))); - m_128apsk[70] = gr_complex((r5 * cos(1421 * GR_M_PI / 720.0)), (r5 * sin(1421 * GR_M_PI / 720.0))); - m_128apsk[71] = gr_complex((r4 * cos(1379 * GR_M_PI / 720.0)), (r4 * sin(1379 * GR_M_PI / 720.0))); - m_128apsk[72] = gr_complex((r1 * cos(1017 * GR_M_PI / 560.0)), (r1 * sin(1017 * GR_M_PI / 560.0))); - m_128apsk[73] = gr_complex((r6 * cos(779 * GR_M_PI / 420.0)), (r6 * sin(779 * GR_M_PI / 420.0))); - m_128apsk[74] = gr_complex((r6 * cos(2977 * GR_M_PI / 1680.0)), (r6 * sin(2977 * GR_M_PI / 1680.0))); - m_128apsk[75] = gr_complex((r6 * cos(9151 * GR_M_PI / 5040.0)), (r6 * sin(9151 * GR_M_PI / 5040.0))); - m_128apsk[76] = gr_complex((r2 * cos(1007 * GR_M_PI / 560.0)), (r2 * sin(1007 * GR_M_PI / 560.0))); - m_128apsk[77] = gr_complex((r3 * cos(1847 * GR_M_PI / 1008.0)), (r3 * sin(1847 * GR_M_PI / 1008.0))); - m_128apsk[78] = gr_complex((r5 * cos(4477 * GR_M_PI / 2520.0)), (r5 * sin(4477 * GR_M_PI / 2520.0))); - m_128apsk[79] = gr_complex((r4 * cos(1541 * GR_M_PI / 840.0)), (r4 * sin(1541 * GR_M_PI / 840.0))); - m_128apsk[80] = gr_complex((r1 * cos(877 * GR_M_PI / 560.0)), (r1 * sin(877 * GR_M_PI / 560.0))); - m_128apsk[81] = gr_complex((r6 * cos(8087 * GR_M_PI / 5040.0)), (r6 * sin(8087 * GR_M_PI / 5040.0))); - m_128apsk[82] = gr_complex((r6 * cos(137 * GR_M_PI / 90.0)), (r6 * sin(137 * GR_M_PI / 90.0))); - m_128apsk[83] = gr_complex((r6 * cos(263 * GR_M_PI / 168.0)), (r6 * sin(263 * GR_M_PI / 168.0))); - m_128apsk[84] = gr_complex((r2 * cos(3901 * GR_M_PI / 2520.0)), (r2 * sin(3901 * GR_M_PI / 2520.0))); - m_128apsk[85] = gr_complex((r3 * cos(443 * GR_M_PI / 280.0)), (r3 * sin(443 * GR_M_PI / 280.0))); - m_128apsk[86] = gr_complex((r5 * cos(1099 * GR_M_PI / 720.0)), (r5 * sin(1099 * GR_M_PI / 720.0))); - m_128apsk[87] = gr_complex((r4 * cos(1331 * GR_M_PI / 840.0)), (r4 * sin(1331 * GR_M_PI / 840.0))); - m_128apsk[88] = gr_complex((r1 * cos(943 * GR_M_PI / 560.0)), (r1 * sin(943 * GR_M_PI / 560.0))); - m_128apsk[89] = gr_complex((r6 * cos(8291 * GR_M_PI / 5040.0)), (r6 * sin(8291 * GR_M_PI / 5040.0))); - m_128apsk[90] = gr_complex((r6 * cos(311 * GR_M_PI / 180.0)), (r6 * sin(311 * GR_M_PI / 180.0))); - m_128apsk[91] = gr_complex((r6 * cos(283 * GR_M_PI / 168.0)), (r6 * sin(283 * GR_M_PI / 168.0))); - m_128apsk[92] = gr_complex((r2 * cos(953 * GR_M_PI / 560.0)), (r2 * sin(953 * GR_M_PI / 560.0))); - m_128apsk[93] = gr_complex((r3 * cos(1201 * GR_M_PI / 720.0)), (r3 * sin(1201 * GR_M_PI / 720.0))); - m_128apsk[94] = gr_complex((r5 * cos(1241 * GR_M_PI / 720.0)), (r5 * sin(1241 * GR_M_PI / 720.0))); - m_128apsk[95] = gr_complex((r4 * cos(1399 * GR_M_PI / 840.0)), (r4 * sin(1399 * GR_M_PI / 840.0))); - m_128apsk[96] = gr_complex((r1 * cos(1343 * GR_M_PI / 1260.0)), (r1 * sin(1343 * GR_M_PI / 1260.0))); - m_128apsk[97] = gr_complex((r6 * cos(116 * GR_M_PI / 105.0)), (r6 * sin(116 * GR_M_PI / 105.0))); - m_128apsk[98] = gr_complex((r6 * cos(1717 * GR_M_PI / 1680.0)), (r6 * sin(1717 * GR_M_PI / 1680.0))); - m_128apsk[99] = gr_complex((r6 * cos(179 * GR_M_PI / 168.0)), (r6 * sin(179 * GR_M_PI / 168.0))); - m_128apsk[100] = gr_complex((r2 * cos(2641 * GR_M_PI / 2520.0)), (r2 * sin(2641 * GR_M_PI / 2520.0))); - m_128apsk[101] = gr_complex((r3 * cos(303 * GR_M_PI / 280.0)), (r3 * sin(303 * GR_M_PI / 280.0))); - m_128apsk[102] = gr_complex((r5 * cos(739 * GR_M_PI / 720.0)), (r5 * sin(739 * GR_M_PI / 720.0))); - m_128apsk[103] = gr_complex((r4 * cos(781 * GR_M_PI / 720.0)), (r4 * sin(781 * GR_M_PI / 720.0))); - m_128apsk[104] = gr_complex((r1 * cos(663 * GR_M_PI / 560.0)), (r1 * sin(663 * GR_M_PI / 560.0))); - m_128apsk[105] = gr_complex((r6 * cos(481 * GR_M_PI / 420.0)), (r6 * sin(481 * GR_M_PI / 420.0))); - m_128apsk[106] = gr_complex((r6 * cos(2063 * GR_M_PI / 1680.0)), (r6 * sin(2063 * GR_M_PI / 1680.0))); - m_128apsk[107] = gr_complex((r6 * cos(5969 * GR_M_PI / 5040.0)), (r6 * sin(5969 * GR_M_PI / 5040.0))); - m_128apsk[108] = gr_complex((r2 * cos(673 * GR_M_PI / 560.0)), (r2 * sin(673 * GR_M_PI / 560.0))); - m_128apsk[109] = gr_complex((r3 * cos(1177 * GR_M_PI / 1008.0)), (r3 * sin(1177 * GR_M_PI / 1008.0))); - m_128apsk[110] = gr_complex((r5 * cos(3083 * GR_M_PI / 2520.0)), (r5 * sin(3083 * GR_M_PI / 2520.0))); - m_128apsk[111] = gr_complex((r4 * cos(979 * GR_M_PI / 840.0)), (r4 * sin(979 * GR_M_PI / 840.0))); - m_128apsk[112] = gr_complex((r1 * cos(803 * GR_M_PI / 560.0)), (r1 * sin(803 * GR_M_PI / 560.0))); - m_128apsk[113] = gr_complex((r6 * cos(7033 * GR_M_PI / 5040.0)), (r6 * sin(7033 * GR_M_PI / 5040.0))); - m_128apsk[114] = gr_complex((r6 * cos(133 * GR_M_PI / 90.0)), (r6 * sin(133 * GR_M_PI / 90.0))); - m_128apsk[115] = gr_complex((r6 * cos(241 * GR_M_PI / 168.0)), (r6 * sin(241 * GR_M_PI / 168.0))); - m_128apsk[116] = gr_complex((r2 * cos(3659 * GR_M_PI / 2520.0)), (r2 * sin(3659 * GR_M_PI / 2520.0))); - m_128apsk[117] = gr_complex((r3 * cos(397 * GR_M_PI / 280.0)), (r3 * sin(397 * GR_M_PI / 280.0))); - m_128apsk[118] = gr_complex((r5 * cos(1061 * GR_M_PI / 720.0)), (r5 * sin(1061 * GR_M_PI / 720.0))); - m_128apsk[119] = gr_complex((r4 * cos(1189 * GR_M_PI / 840.0)), (r4 * sin(1189 * GR_M_PI / 840.0))); - m_128apsk[120] = gr_complex((r1 * cos(737 * GR_M_PI / 560.0)), (r1 * sin(737 * GR_M_PI / 560.0))); - m_128apsk[121] = gr_complex((r6 * cos(6829 * GR_M_PI / 5040.0)), (r6 * sin(6829 * GR_M_PI / 5040.0))); - m_128apsk[122] = gr_complex((r6 * cos(229 * GR_M_PI / 180.0)), (r6 * sin(229 * GR_M_PI / 180.0))); - m_128apsk[123] = gr_complex((r6 * cos(221 * GR_M_PI / 168.0)), (r6 * sin(221 * GR_M_PI / 168.0))); - m_128apsk[124] = gr_complex((r2 * cos(727 * GR_M_PI / 560.0)), (r2 * sin(727 * GR_M_PI / 560.0))); - m_128apsk[125] = gr_complex((r3 * cos(959 * GR_M_PI / 720.0)), (r3 * sin(959 * GR_M_PI / 720.0))); - m_128apsk[126] = gr_complex((r5 * cos(919 * GR_M_PI / 720.0)), (r5 * sin(919 * GR_M_PI / 720.0))); - m_128apsk[127] = gr_complex((r4 * cos(1121 * GR_M_PI / 840.0)), (r4 * sin(1121 * GR_M_PI / 840.0))); - break; - case MOD_256APSK: - if (rate == C20_30) { + } + m_32apsk[0] = + gr_complex((r3 * cos(11 * GR_M_PI / 16.0)), (r3 * sin(11 * GR_M_PI / 16.0))); + m_32apsk[1] = + gr_complex((r3 * cos(9 * GR_M_PI / 16.0)), (r3 * sin(9 * GR_M_PI / 16.0))); + m_32apsk[2] = + gr_complex((r3 * cos(5 * GR_M_PI / 16.0)), (r3 * sin(5 * GR_M_PI / 16.0))); + m_32apsk[3] = + gr_complex((r3 * cos(7 * GR_M_PI / 16.0)), (r3 * sin(7 * GR_M_PI / 16.0))); + m_32apsk[4] = + gr_complex((r2 * cos(3 * GR_M_PI / 4.0)), (r2 * sin(3 * GR_M_PI / 4.0))); + m_32apsk[5] = + gr_complex((r2 * cos(7 * GR_M_PI / 12.0)), (r2 * sin(7 * GR_M_PI / 12.0))); + m_32apsk[6] = gr_complex((r2 * cos(GR_M_PI / 4.0)), (r2 * sin(GR_M_PI / 4.0))); + m_32apsk[7] = + gr_complex((r2 * cos(5 * GR_M_PI / 12.0)), (r2 * sin(5 * GR_M_PI / 12.0))); + m_32apsk[8] = + gr_complex((r3 * cos(13 * GR_M_PI / 16.0)), (r3 * sin(13 * GR_M_PI / 16.0))); + m_32apsk[9] = + gr_complex((r3 * cos(15 * GR_M_PI / 16.0)), (r3 * sin(15 * GR_M_PI / 16.0))); + m_32apsk[10] = + gr_complex((r3 * cos(3 * GR_M_PI / 16.0)), (r3 * sin(3 * GR_M_PI / 16.0))); + m_32apsk[11] = gr_complex((r3 * cos(GR_M_PI / 16.0)), (r3 * sin(GR_M_PI / 16.0))); + m_32apsk[12] = + gr_complex((r2 * cos(11 * GR_M_PI / 12.0)), (r2 * sin(11 * GR_M_PI / 12.0))); + m_32apsk[13] = + gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); + m_32apsk[14] = gr_complex((r2 * cos(GR_M_PI / 12.0)), (r2 * sin(GR_M_PI / 12.0))); + m_32apsk[15] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); + m_32apsk[16] = + gr_complex((r3 * cos(21 * GR_M_PI / 16.0)), (r3 * sin(21 * GR_M_PI / 16.0))); + m_32apsk[17] = + gr_complex((r3 * cos(23 * GR_M_PI / 16.0)), (r3 * sin(23 * GR_M_PI / 16.0))); + m_32apsk[18] = + gr_complex((r3 * cos(27 * GR_M_PI / 16.0)), (r3 * sin(27 * GR_M_PI / 16.0))); + m_32apsk[19] = + gr_complex((r3 * cos(25 * GR_M_PI / 16.0)), (r3 * sin(25 * GR_M_PI / 16.0))); + m_32apsk[20] = + gr_complex((r2 * cos(5 * GR_M_PI / 4.0)), (r2 * sin(5 * GR_M_PI / 4.0))); + m_32apsk[21] = + gr_complex((r2 * cos(17 * GR_M_PI / 12.0)), (r2 * sin(17 * GR_M_PI / 12.0))); + m_32apsk[22] = + gr_complex((r2 * cos(7 * GR_M_PI / 4.0)), (r2 * sin(7 * GR_M_PI / 4.0))); + m_32apsk[23] = + gr_complex((r2 * cos(19 * GR_M_PI / 12.0)), (r2 * sin(19 * GR_M_PI / 12.0))); + m_32apsk[24] = + gr_complex((r3 * cos(19 * GR_M_PI / 16.0)), (r3 * sin(19 * GR_M_PI / 16.0))); + m_32apsk[25] = + gr_complex((r3 * cos(17 * GR_M_PI / 16.0)), (r3 * sin(17 * GR_M_PI / 16.0))); + m_32apsk[26] = + gr_complex((r3 * cos(29 * GR_M_PI / 16.0)), (r3 * sin(29 * GR_M_PI / 16.0))); + m_32apsk[27] = + gr_complex((r3 * cos(31 * GR_M_PI / 16.0)), (r3 * sin(31 * GR_M_PI / 16.0))); + m_32apsk[28] = + gr_complex((r2 * cos(13 * GR_M_PI / 12.0)), (r2 * sin(13 * GR_M_PI / 12.0))); + m_32apsk[29] = + gr_complex((r1 * cos(5 * GR_M_PI / 4.0)), (r1 * sin(5 * GR_M_PI / 4.0))); + m_32apsk[30] = + gr_complex((r2 * cos(23 * GR_M_PI / 12.0)), (r2 * sin(23 * GR_M_PI / 12.0))); + m_32apsk[31] = + gr_complex((r1 * cos(7 * GR_M_PI / 4.0)), (r1 * sin(7 * GR_M_PI / 4.0))); + break; + case MOD_4_8_4_16APSK: + r4 = m; + switch (rate) { + case C128_180: + r1 = r4 / 5.6; + r3 = r1 * 2.99; + r2 = r1 * 2.6; + break; + case C132_180: + r1 = r4 / 5.6; + r3 = r1 * 2.86; + r2 = r1 * 2.6; + break; + case C140_180: + r1 = r4 / 5.6; + r3 = r1 * 3.08; + r2 = r1 * 2.6; + break; + default: + r1 = 0; + r2 = 0; + r3 = 0; + break; + } + m_32apsk[0] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); + m_32apsk[1] = + gr_complex((r4 * cos(7 * GR_M_PI / 16.0)), (r4 * sin(7 * GR_M_PI / 16.0))); + m_32apsk[2] = + gr_complex((r1 * cos(7 * GR_M_PI / 4.0)), (r1 * sin(7 * GR_M_PI / 4.0))); + m_32apsk[3] = + gr_complex((r4 * cos(25 * GR_M_PI / 16.0)), (r4 * sin(25 * GR_M_PI / 16.0))); + m_32apsk[4] = + gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); + m_32apsk[5] = + gr_complex((r4 * cos(9 * GR_M_PI / 16.0)), (r4 * sin(9 * GR_M_PI / 16.0))); + m_32apsk[6] = + gr_complex((r1 * cos(5 * GR_M_PI / 4.0)), (r1 * sin(5 * GR_M_PI / 4.0))); + m_32apsk[7] = + gr_complex((r4 * cos(23 * GR_M_PI / 16.0)), (r4 * sin(23 * GR_M_PI / 16.0))); + m_32apsk[8] = gr_complex((r2 * cos(GR_M_PI / 12.0)), (r2 * sin(GR_M_PI / 12.0))); + m_32apsk[9] = gr_complex((r4 * cos(GR_M_PI / 16.0)), (r4 * sin(GR_M_PI / 16.0))); + m_32apsk[10] = + gr_complex((r2 * cos(23 * GR_M_PI / 12.0)), (r2 * sin(23 * GR_M_PI / 12.0))); + m_32apsk[11] = + gr_complex((r4 * cos(31 * GR_M_PI / 16.0)), (r4 * sin(31 * GR_M_PI / 16.0))); + m_32apsk[12] = + gr_complex((r2 * cos(11 * GR_M_PI / 12.0)), (r2 * sin(11 * GR_M_PI / 12.0))); + m_32apsk[13] = + gr_complex((r4 * cos(15 * GR_M_PI / 16.0)), (r4 * sin(15 * GR_M_PI / 16.0))); + m_32apsk[14] = + gr_complex((r2 * cos(13 * GR_M_PI / 12.0)), (r2 * sin(13 * GR_M_PI / 12.0))); + m_32apsk[15] = + gr_complex((r4 * cos(17 * GR_M_PI / 16.0)), (r4 * sin(17 * GR_M_PI / 16.0))); + m_32apsk[16] = + gr_complex((r2 * cos(5 * GR_M_PI / 12.0)), (r2 * sin(5 * GR_M_PI / 12.0))); + m_32apsk[17] = + gr_complex((r4 * cos(5 * GR_M_PI / 16.0)), (r4 * sin(5 * GR_M_PI / 16.0))); + m_32apsk[18] = + gr_complex((r2 * cos(19 * GR_M_PI / 12.0)), (r2 * sin(19 * GR_M_PI / 12.0))); + m_32apsk[19] = + gr_complex((r4 * cos(27 * GR_M_PI / 16.0)), (r4 * sin(27 * GR_M_PI / 16.0))); + m_32apsk[20] = + gr_complex((r2 * cos(7 * GR_M_PI / 12.0)), (r2 * sin(7 * GR_M_PI / 12.0))); + m_32apsk[21] = + gr_complex((r4 * cos(11 * GR_M_PI / 16.0)), (r4 * sin(11 * GR_M_PI / 16.0))); + m_32apsk[22] = + gr_complex((r2 * cos(17 * GR_M_PI / 12.0)), (r2 * sin(17 * GR_M_PI / 12.0))); + m_32apsk[23] = + gr_complex((r4 * cos(21 * GR_M_PI / 16.0)), (r4 * sin(21 * GR_M_PI / 16.0))); + m_32apsk[24] = gr_complex((r3 * cos(GR_M_PI / 4.0)), (r3 * sin(GR_M_PI / 4.0))); + m_32apsk[25] = + gr_complex((r4 * cos(3 * GR_M_PI / 16.0)), (r4 * sin(3 * GR_M_PI / 16.0))); + m_32apsk[26] = + gr_complex((r3 * cos(7 * GR_M_PI / 4.0)), (r3 * sin(7 * GR_M_PI / 4.0))); + m_32apsk[27] = + gr_complex((r4 * cos(29 * GR_M_PI / 16.0)), (r4 * sin(29 * GR_M_PI / 16.0))); + m_32apsk[28] = + gr_complex((r3 * cos(3 * GR_M_PI / 4.0)), (r3 * sin(3 * GR_M_PI / 4.0))); + m_32apsk[29] = + gr_complex((r4 * cos(13 * GR_M_PI / 16.0)), (r4 * sin(13 * GR_M_PI / 16.0))); + m_32apsk[30] = + gr_complex((r3 * cos(5 * GR_M_PI / 4.0)), (r3 * sin(5 * GR_M_PI / 4.0))); + m_32apsk[31] = + gr_complex((r4 * cos(19 * GR_M_PI / 16.0)), (r4 * sin(19 * GR_M_PI / 16.0))); + break; + case MOD_64APSK: + r4 = m; + switch (rate) { + case C128_180: + r1 = r4 / 3.95; + r3 = r1 * 2.72; + r2 = r1 * 1.88; + break; + default: + r1 = 0; + r2 = 0; + r3 = 0; + break; + } + m_64apsk[0] = gr_complex((r1 * cos(GR_M_PI / 16.0)), (r1 * sin(GR_M_PI / 16.0))); + m_64apsk[1] = + gr_complex((r1 * cos(3 * GR_M_PI / 16.0)), (r1 * sin(3 * GR_M_PI / 16.0))); + m_64apsk[2] = + gr_complex((r1 * cos(7 * GR_M_PI / 16.0)), (r1 * sin(7 * GR_M_PI / 16.0))); + m_64apsk[3] = + gr_complex((r1 * cos(5 * GR_M_PI / 16.0)), (r1 * sin(5 * GR_M_PI / 16.0))); + m_64apsk[4] = + gr_complex((r1 * cos(15 * GR_M_PI / 16.0)), (r1 * sin(15 * GR_M_PI / 16.0))); + m_64apsk[5] = + gr_complex((r1 * cos(13 * GR_M_PI / 16.0)), (r1 * sin(13 * GR_M_PI / 16.0))); + m_64apsk[6] = + gr_complex((r1 * cos(9 * GR_M_PI / 16.0)), (r1 * sin(9 * GR_M_PI / 16.0))); + m_64apsk[7] = + gr_complex((r1 * cos(11 * GR_M_PI / 16.0)), (r1 * sin(11 * GR_M_PI / 16.0))); + m_64apsk[8] = + gr_complex((r1 * cos(31 * GR_M_PI / 16.0)), (r1 * sin(31 * GR_M_PI / 16.0))); + m_64apsk[9] = + gr_complex((r1 * cos(29 * GR_M_PI / 16.0)), (r1 * sin(29 * GR_M_PI / 16.0))); + m_64apsk[10] = + gr_complex((r1 * cos(25 * GR_M_PI / 16.0)), (r1 * sin(25 * GR_M_PI / 16.0))); + m_64apsk[11] = + gr_complex((r1 * cos(27 * GR_M_PI / 16.0)), (r1 * sin(27 * GR_M_PI / 16.0))); + m_64apsk[12] = + gr_complex((r1 * cos(17 * GR_M_PI / 16.0)), (r1 * sin(17 * GR_M_PI / 16.0))); + m_64apsk[13] = + gr_complex((r1 * cos(19 * GR_M_PI / 16.0)), (r1 * sin(19 * GR_M_PI / 16.0))); + m_64apsk[14] = + gr_complex((r1 * cos(23 * GR_M_PI / 16.0)), (r1 * sin(23 * GR_M_PI / 16.0))); + m_64apsk[15] = + gr_complex((r1 * cos(21 * GR_M_PI / 16.0)), (r1 * sin(21 * GR_M_PI / 16.0))); + m_64apsk[16] = gr_complex((r2 * cos(GR_M_PI / 16.0)), (r2 * sin(GR_M_PI / 16.0))); + m_64apsk[17] = + gr_complex((r2 * cos(3 * GR_M_PI / 16.0)), (r2 * sin(3 * GR_M_PI / 16.0))); + m_64apsk[18] = + gr_complex((r2 * cos(7 * GR_M_PI / 16.0)), (r2 * sin(7 * GR_M_PI / 16.0))); + m_64apsk[19] = + gr_complex((r2 * cos(5 * GR_M_PI / 16.0)), (r2 * sin(5 * GR_M_PI / 16.0))); + m_64apsk[20] = + gr_complex((r2 * cos(15 * GR_M_PI / 16.0)), (r2 * sin(15 * GR_M_PI / 16.0))); + m_64apsk[21] = + gr_complex((r2 * cos(13 * GR_M_PI / 16.0)), (r2 * sin(13 * GR_M_PI / 16.0))); + m_64apsk[22] = + gr_complex((r2 * cos(9 * GR_M_PI / 16.0)), (r2 * sin(9 * GR_M_PI / 16.0))); + m_64apsk[23] = + gr_complex((r2 * cos(11 * GR_M_PI / 16.0)), (r2 * sin(11 * GR_M_PI / 16.0))); + m_64apsk[24] = + gr_complex((r2 * cos(31 * GR_M_PI / 16.0)), (r2 * sin(31 * GR_M_PI / 16.0))); + m_64apsk[25] = + gr_complex((r2 * cos(29 * GR_M_PI / 16.0)), (r2 * sin(29 * GR_M_PI / 16.0))); + m_64apsk[26] = + gr_complex((r2 * cos(25 * GR_M_PI / 16.0)), (r2 * sin(25 * GR_M_PI / 16.0))); + m_64apsk[27] = + gr_complex((r2 * cos(27 * GR_M_PI / 16.0)), (r2 * sin(27 * GR_M_PI / 16.0))); + m_64apsk[28] = + gr_complex((r2 * cos(17 * GR_M_PI / 16.0)), (r2 * sin(17 * GR_M_PI / 16.0))); + m_64apsk[29] = + gr_complex((r2 * cos(19 * GR_M_PI / 16.0)), (r2 * sin(19 * GR_M_PI / 16.0))); + m_64apsk[30] = + gr_complex((r2 * cos(23 * GR_M_PI / 16.0)), (r2 * sin(23 * GR_M_PI / 16.0))); + m_64apsk[31] = + gr_complex((r2 * cos(21 * GR_M_PI / 16.0)), (r2 * sin(21 * GR_M_PI / 16.0))); + m_64apsk[32] = gr_complex((r4 * cos(GR_M_PI / 16.0)), (r4 * sin(GR_M_PI / 16.0))); + m_64apsk[33] = + gr_complex((r4 * cos(3 * GR_M_PI / 16.0)), (r4 * sin(3 * GR_M_PI / 16.0))); + m_64apsk[34] = + gr_complex((r4 * cos(7 * GR_M_PI / 16.0)), (r4 * sin(7 * GR_M_PI / 16.0))); + m_64apsk[35] = + gr_complex((r4 * cos(5 * GR_M_PI / 16.0)), (r4 * sin(5 * GR_M_PI / 16.0))); + m_64apsk[36] = + gr_complex((r4 * cos(15 * GR_M_PI / 16.0)), (r4 * sin(15 * GR_M_PI / 16.0))); + m_64apsk[37] = + gr_complex((r4 * cos(13 * GR_M_PI / 16.0)), (r4 * sin(13 * GR_M_PI / 16.0))); + m_64apsk[38] = + gr_complex((r4 * cos(9 * GR_M_PI / 16.0)), (r4 * sin(9 * GR_M_PI / 16.0))); + m_64apsk[39] = + gr_complex((r4 * cos(11 * GR_M_PI / 16.0)), (r4 * sin(11 * GR_M_PI / 16.0))); + m_64apsk[40] = + gr_complex((r4 * cos(31 * GR_M_PI / 16.0)), (r4 * sin(31 * GR_M_PI / 16.0))); + m_64apsk[41] = + gr_complex((r4 * cos(29 * GR_M_PI / 16.0)), (r4 * sin(29 * GR_M_PI / 16.0))); + m_64apsk[42] = + gr_complex((r4 * cos(25 * GR_M_PI / 16.0)), (r4 * sin(25 * GR_M_PI / 16.0))); + m_64apsk[43] = + gr_complex((r4 * cos(27 * GR_M_PI / 16.0)), (r4 * sin(27 * GR_M_PI / 16.0))); + m_64apsk[44] = + gr_complex((r4 * cos(17 * GR_M_PI / 16.0)), (r4 * sin(17 * GR_M_PI / 16.0))); + m_64apsk[45] = + gr_complex((r4 * cos(19 * GR_M_PI / 16.0)), (r4 * sin(19 * GR_M_PI / 16.0))); + m_64apsk[46] = + gr_complex((r4 * cos(23 * GR_M_PI / 16.0)), (r4 * sin(23 * GR_M_PI / 16.0))); + m_64apsk[47] = + gr_complex((r4 * cos(21 * GR_M_PI / 16.0)), (r4 * sin(21 * GR_M_PI / 16.0))); + m_64apsk[48] = gr_complex((r3 * cos(GR_M_PI / 16.0)), (r3 * sin(GR_M_PI / 16.0))); + m_64apsk[49] = + gr_complex((r3 * cos(3 * GR_M_PI / 16.0)), (r3 * sin(3 * GR_M_PI / 16.0))); + m_64apsk[50] = + gr_complex((r3 * cos(7 * GR_M_PI / 16.0)), (r3 * sin(7 * GR_M_PI / 16.0))); + m_64apsk[51] = + gr_complex((r3 * cos(5 * GR_M_PI / 16.0)), (r3 * sin(5 * GR_M_PI / 16.0))); + m_64apsk[52] = + gr_complex((r3 * cos(15 * GR_M_PI / 16.0)), (r3 * sin(15 * GR_M_PI / 16.0))); + m_64apsk[53] = + gr_complex((r3 * cos(13 * GR_M_PI / 16.0)), (r3 * sin(13 * GR_M_PI / 16.0))); + m_64apsk[54] = + gr_complex((r3 * cos(9 * GR_M_PI / 16.0)), (r3 * sin(9 * GR_M_PI / 16.0))); + m_64apsk[55] = + gr_complex((r3 * cos(11 * GR_M_PI / 16.0)), (r3 * sin(11 * GR_M_PI / 16.0))); + m_64apsk[56] = + gr_complex((r3 * cos(31 * GR_M_PI / 16.0)), (r3 * sin(31 * GR_M_PI / 16.0))); + m_64apsk[57] = + gr_complex((r3 * cos(29 * GR_M_PI / 16.0)), (r3 * sin(29 * GR_M_PI / 16.0))); + m_64apsk[58] = + gr_complex((r3 * cos(25 * GR_M_PI / 16.0)), (r3 * sin(25 * GR_M_PI / 16.0))); + m_64apsk[59] = + gr_complex((r3 * cos(27 * GR_M_PI / 16.0)), (r3 * sin(27 * GR_M_PI / 16.0))); + m_64apsk[60] = + gr_complex((r3 * cos(17 * GR_M_PI / 16.0)), (r3 * sin(17 * GR_M_PI / 16.0))); + m_64apsk[61] = + gr_complex((r3 * cos(19 * GR_M_PI / 16.0)), (r3 * sin(19 * GR_M_PI / 16.0))); + m_64apsk[62] = + gr_complex((r3 * cos(23 * GR_M_PI / 16.0)), (r3 * sin(23 * GR_M_PI / 16.0))); + m_64apsk[63] = + gr_complex((r3 * cos(21 * GR_M_PI / 16.0)), (r3 * sin(21 * GR_M_PI / 16.0))); + break; + case MOD_8_16_20_20APSK: + r4 = m; + switch (rate) { + case C7_9: + case C4_5: + r1 = r4 / 5.2; + r3 = r1 * 3.6; + r2 = r1 * 2.2; + break; + case C5_6: + r1 = r4 / 5.0; + r3 = r1 * 3.5; + r2 = r1 * 2.2; + break; + default: + r1 = 0; + r2 = 0; + r3 = 0; + break; + } + m_64apsk[0] = + gr_complex((r2 * cos(25 * GR_M_PI / 16.0)), (r2 * sin(25 * GR_M_PI / 16.0))); + m_64apsk[1] = + gr_complex((r4 * cos(7 * GR_M_PI / 4.0)), (r4 * sin(7 * GR_M_PI / 4.0))); + m_64apsk[2] = + gr_complex((r2 * cos(27 * GR_M_PI / 16.0)), (r2 * sin(27 * GR_M_PI / 16.0))); + m_64apsk[3] = + gr_complex((r3 * cos(7 * GR_M_PI / 4.0)), (r3 * sin(7 * GR_M_PI / 4.0))); + m_64apsk[4] = + gr_complex((r4 * cos(31 * GR_M_PI / 20.0)), (r4 * sin(31 * GR_M_PI / 20.0))); + m_64apsk[5] = + gr_complex((r4 * cos(33 * GR_M_PI / 20.0)), (r4 * sin(33 * GR_M_PI / 20.0))); + m_64apsk[6] = + gr_complex((r3 * cos(31 * GR_M_PI / 20.0)), (r3 * sin(31 * GR_M_PI / 20.0))); + m_64apsk[7] = + gr_complex((r3 * cos(33 * GR_M_PI / 20.0)), (r3 * sin(33 * GR_M_PI / 20.0))); + m_64apsk[8] = + gr_complex((r2 * cos(23 * GR_M_PI / 16.0)), (r2 * sin(23 * GR_M_PI / 16.0))); + m_64apsk[9] = + gr_complex((r4 * cos(5 * GR_M_PI / 4.0)), (r4 * sin(5 * GR_M_PI / 4.0))); + m_64apsk[10] = + gr_complex((r2 * cos(21 * GR_M_PI / 16.0)), (r2 * sin(21 * GR_M_PI / 16.0))); + m_64apsk[11] = + gr_complex((r3 * cos(5 * GR_M_PI / 4.0)), (r3 * sin(5 * GR_M_PI / 4.0))); + m_64apsk[12] = + gr_complex((r4 * cos(29 * GR_M_PI / 20.0)), (r4 * sin(29 * GR_M_PI / 20.0))); + m_64apsk[13] = + gr_complex((r4 * cos(27 * GR_M_PI / 20.0)), (r4 * sin(27 * GR_M_PI / 20.0))); + m_64apsk[14] = + gr_complex((r3 * cos(29 * GR_M_PI / 20.0)), (r3 * sin(29 * GR_M_PI / 20.0))); + m_64apsk[15] = + gr_complex((r3 * cos(27 * GR_M_PI / 20.0)), (r3 * sin(27 * GR_M_PI / 20.0))); + m_64apsk[16] = + gr_complex((r1 * cos(13 * GR_M_PI / 8.0)), (r1 * sin(13 * GR_M_PI / 8.0))); + m_64apsk[17] = + gr_complex((r4 * cos(37 * GR_M_PI / 20.0)), (r4 * sin(37 * GR_M_PI / 20.0))); + m_64apsk[18] = + gr_complex((r2 * cos(29 * GR_M_PI / 16.0)), (r2 * sin(29 * GR_M_PI / 16.0))); + m_64apsk[19] = + gr_complex((r3 * cos(37 * GR_M_PI / 20.0)), (r3 * sin(37 * GR_M_PI / 20.0))); + m_64apsk[20] = + gr_complex((r1 * cos(15 * GR_M_PI / 8.0)), (r1 * sin(15 * GR_M_PI / 8.0))); + m_64apsk[21] = + gr_complex((r4 * cos(39 * GR_M_PI / 20.0)), (r4 * sin(39 * GR_M_PI / 20.0))); + m_64apsk[22] = + gr_complex((r2 * cos(31 * GR_M_PI / 16.0)), (r2 * sin(31 * GR_M_PI / 16.0))); + m_64apsk[23] = + gr_complex((r3 * cos(39 * GR_M_PI / 20.0)), (r3 * sin(39 * GR_M_PI / 20.0))); + m_64apsk[24] = + gr_complex((r1 * cos(11 * GR_M_PI / 8.0)), (r1 * sin(11 * GR_M_PI / 8.0))); + m_64apsk[25] = + gr_complex((r4 * cos(23 * GR_M_PI / 20.0)), (r4 * sin(23 * GR_M_PI / 20.0))); + m_64apsk[26] = + gr_complex((r2 * cos(19 * GR_M_PI / 16.0)), (r2 * sin(19 * GR_M_PI / 16.0))); + m_64apsk[27] = + gr_complex((r3 * cos(23 * GR_M_PI / 20.0)), (r3 * sin(23 * GR_M_PI / 20.0))); + m_64apsk[28] = + gr_complex((r1 * cos(9 * GR_M_PI / 8.0)), (r1 * sin(9 * GR_M_PI / 8.0))); + m_64apsk[29] = + gr_complex((r4 * cos(21 * GR_M_PI / 20.0)), (r4 * sin(21 * GR_M_PI / 20.0))); + m_64apsk[30] = + gr_complex((r2 * cos(17 * GR_M_PI / 16.0)), (r2 * sin(17 * GR_M_PI / 16.0))); + m_64apsk[31] = + gr_complex((r3 * cos(21 * GR_M_PI / 20.0)), (r3 * sin(21 * GR_M_PI / 20.0))); + m_64apsk[32] = + gr_complex((r2 * cos(7 * GR_M_PI / 16.0)), (r2 * sin(7 * GR_M_PI / 16.0))); + m_64apsk[33] = gr_complex((r4 * cos(GR_M_PI / 4.0)), (r4 * sin(GR_M_PI / 4.0))); + m_64apsk[34] = + gr_complex((r2 * cos(5 * GR_M_PI / 16.0)), (r2 * sin(5 * GR_M_PI / 16.0))); + m_64apsk[35] = gr_complex((r3 * cos(GR_M_PI / 4.0)), (r3 * sin(GR_M_PI / 4.0))); + m_64apsk[36] = + gr_complex((r4 * cos(9 * GR_M_PI / 20.0)), (r4 * sin(9 * GR_M_PI / 20.0))); + m_64apsk[37] = + gr_complex((r4 * cos(7 * GR_M_PI / 20.0)), (r4 * sin(7 * GR_M_PI / 20.0))); + m_64apsk[38] = + gr_complex((r3 * cos(9 * GR_M_PI / 20.0)), (r3 * sin(9 * GR_M_PI / 20.0))); + m_64apsk[39] = + gr_complex((r3 * cos(7 * GR_M_PI / 20.0)), (r3 * sin(7 * GR_M_PI / 20.0))); + m_64apsk[40] = + gr_complex((r2 * cos(9 * GR_M_PI / 16.0)), (r2 * sin(9 * GR_M_PI / 16.0))); + m_64apsk[41] = + gr_complex((r4 * cos(3 * GR_M_PI / 4.0)), (r4 * sin(3 * GR_M_PI / 4.0))); + m_64apsk[42] = + gr_complex((r2 * cos(11 * GR_M_PI / 16.0)), (r2 * sin(11 * GR_M_PI / 16.0))); + m_64apsk[43] = + gr_complex((r3 * cos(3 * GR_M_PI / 4.0)), (r3 * sin(3 * GR_M_PI / 4.0))); + m_64apsk[44] = + gr_complex((r4 * cos(11 * GR_M_PI / 20.0)), (r4 * sin(11 * GR_M_PI / 20.0))); + m_64apsk[45] = + gr_complex((r4 * cos(13 * GR_M_PI / 20.0)), (r4 * sin(13 * GR_M_PI / 20.0))); + m_64apsk[46] = + gr_complex((r3 * cos(11 * GR_M_PI / 20.0)), (r3 * sin(11 * GR_M_PI / 20.0))); + m_64apsk[47] = + gr_complex((r3 * cos(13 * GR_M_PI / 20.0)), (r3 * sin(13 * GR_M_PI / 20.0))); + m_64apsk[48] = + gr_complex((r1 * cos(3 * GR_M_PI / 8.0)), (r1 * sin(3 * GR_M_PI / 8.0))); + m_64apsk[49] = + gr_complex((r4 * cos(3 * GR_M_PI / 20.0)), (r4 * sin(3 * GR_M_PI / 20.0))); + m_64apsk[50] = + gr_complex((r2 * cos(3 * GR_M_PI / 16.0)), (r2 * sin(3 * GR_M_PI / 16.0))); + m_64apsk[51] = + gr_complex((r3 * cos(3 * GR_M_PI / 20.0)), (r3 * sin(3 * GR_M_PI / 20.0))); + m_64apsk[52] = gr_complex((r1 * cos(GR_M_PI / 8.0)), (r1 * sin(GR_M_PI / 8.0))); + m_64apsk[53] = gr_complex((r4 * cos(GR_M_PI / 20.0)), (r4 * sin(GR_M_PI / 20.0))); + m_64apsk[54] = gr_complex((r2 * cos(GR_M_PI / 16.0)), (r2 * sin(GR_M_PI / 16.0))); + m_64apsk[55] = gr_complex((r3 * cos(GR_M_PI / 20.0)), (r3 * sin(GR_M_PI / 20.0))); + m_64apsk[56] = + gr_complex((r1 * cos(5 * GR_M_PI / 8.0)), (r1 * sin(5 * GR_M_PI / 8.0))); + m_64apsk[57] = + gr_complex((r4 * cos(17 * GR_M_PI / 20.0)), (r4 * sin(17 * GR_M_PI / 20.0))); + m_64apsk[58] = + gr_complex((r2 * cos(13 * GR_M_PI / 16.0)), (r2 * sin(13 * GR_M_PI / 16.0))); + m_64apsk[59] = + gr_complex((r3 * cos(17 * GR_M_PI / 20.0)), (r3 * sin(17 * GR_M_PI / 20.0))); + m_64apsk[60] = + gr_complex((r1 * cos(7 * GR_M_PI / 8.0)), (r1 * sin(7 * GR_M_PI / 8.0))); + m_64apsk[61] = + gr_complex((r4 * cos(19 * GR_M_PI / 20.0)), (r4 * sin(19 * GR_M_PI / 20.0))); + m_64apsk[62] = + gr_complex((r2 * cos(15 * GR_M_PI / 16.0)), (r2 * sin(15 * GR_M_PI / 16.0))); + m_64apsk[63] = + gr_complex((r3 * cos(19 * GR_M_PI / 20.0)), (r3 * sin(19 * GR_M_PI / 20.0))); + break; + case MOD_4_12_20_28APSK: + r4 = m; + switch (rate) { + case C132_180: + r1 = r4 / 7.0; + r3 = r1 * 4.3; + r2 = r1 * 2.4; + break; + default: + r1 = 0; + r2 = 0; + r3 = 0; + break; + } + m_64apsk[0] = gr_complex((r4 * cos(GR_M_PI / 4.0)), (r4 * sin(GR_M_PI / 4.0))); + m_64apsk[1] = + gr_complex((r4 * cos(7 * GR_M_PI / 4.0)), (r4 * sin(7 * GR_M_PI / 4.0))); + m_64apsk[2] = + gr_complex((r4 * cos(3 * GR_M_PI / 4.0)), (r4 * sin(3 * GR_M_PI / 4.0))); + m_64apsk[3] = + gr_complex((r4 * cos(5 * GR_M_PI / 4.0)), (r4 * sin(5 * GR_M_PI / 4.0))); + m_64apsk[4] = + gr_complex((r4 * cos(13 * GR_M_PI / 28.0)), (r4 * sin(13 * GR_M_PI / 28.0))); + m_64apsk[5] = + gr_complex((r4 * cos(43 * GR_M_PI / 28.0)), (r4 * sin(43 * GR_M_PI / 28.0))); + m_64apsk[6] = + gr_complex((r4 * cos(15 * GR_M_PI / 28.0)), (r4 * sin(15 * GR_M_PI / 28.0))); + m_64apsk[7] = + gr_complex((r4 * cos(41 * GR_M_PI / 28.0)), (r4 * sin(41 * GR_M_PI / 28.0))); + m_64apsk[8] = gr_complex((r4 * cos(GR_M_PI / 28.0)), (r4 * sin(GR_M_PI / 28.0))); + m_64apsk[9] = + gr_complex((r4 * cos(55 * GR_M_PI / 28.0)), (r4 * sin(55 * GR_M_PI / 28.0))); + m_64apsk[10] = + gr_complex((r4 * cos(27 * GR_M_PI / 28.0)), (r4 * sin(27 * GR_M_PI / 28.0))); + m_64apsk[11] = + gr_complex((r4 * cos(29 * GR_M_PI / 28.0)), (r4 * sin(29 * GR_M_PI / 28.0))); + m_64apsk[12] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); + m_64apsk[13] = + gr_complex((r1 * cos(7 * GR_M_PI / 4.0)), (r1 * sin(7 * GR_M_PI / 4.0))); + m_64apsk[14] = + gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); + m_64apsk[15] = + gr_complex((r1 * cos(5 * GR_M_PI / 4.0)), (r1 * sin(5 * GR_M_PI / 4.0))); + m_64apsk[16] = + gr_complex((r4 * cos(9 * GR_M_PI / 28.0)), (r4 * sin(9 * GR_M_PI / 28.0))); + m_64apsk[17] = + gr_complex((r4 * cos(47 * GR_M_PI / 28.0)), (r4 * sin(47 * GR_M_PI / 28.0))); + m_64apsk[18] = + gr_complex((r4 * cos(19 * GR_M_PI / 28.0)), (r4 * sin(19 * GR_M_PI / 28.0))); + m_64apsk[19] = + gr_complex((r4 * cos(37 * GR_M_PI / 28.0)), (r4 * sin(37 * GR_M_PI / 28.0))); + m_64apsk[20] = + gr_complex((r4 * cos(11 * GR_M_PI / 28.0)), (r4 * sin(11 * GR_M_PI / 28.0))); + m_64apsk[21] = + gr_complex((r4 * cos(45 * GR_M_PI / 28.0)), (r4 * sin(45 * GR_M_PI / 28.0))); + m_64apsk[22] = + gr_complex((r4 * cos(17 * GR_M_PI / 28.0)), (r4 * sin(17 * GR_M_PI / 28.0))); + m_64apsk[23] = + gr_complex((r4 * cos(39 * GR_M_PI / 28.0)), (r4 * sin(39 * GR_M_PI / 28.0))); + m_64apsk[24] = gr_complex((r3 * cos(GR_M_PI / 20.0)), (r3 * sin(GR_M_PI / 20.0))); + m_64apsk[25] = + gr_complex((r3 * cos(39 * GR_M_PI / 20.0)), (r3 * sin(39 * GR_M_PI / 20.0))); + m_64apsk[26] = + gr_complex((r3 * cos(19 * GR_M_PI / 20.0)), (r3 * sin(19 * GR_M_PI / 20.0))); + m_64apsk[27] = + gr_complex((r3 * cos(21 * GR_M_PI / 20.0)), (r3 * sin(21 * GR_M_PI / 20.0))); + m_64apsk[28] = gr_complex((r2 * cos(GR_M_PI / 12.0)), (r2 * sin(GR_M_PI / 12.0))); + m_64apsk[29] = + gr_complex((r2 * cos(23 * GR_M_PI / 12.0)), (r2 * sin(23 * GR_M_PI / 12.0))); + m_64apsk[30] = + gr_complex((r2 * cos(11 * GR_M_PI / 12.0)), (r2 * sin(11 * GR_M_PI / 12.0))); + m_64apsk[31] = + gr_complex((r2 * cos(13 * GR_M_PI / 12.0)), (r2 * sin(13 * GR_M_PI / 12.0))); + m_64apsk[32] = + gr_complex((r4 * cos(5 * GR_M_PI / 28.0)), (r4 * sin(5 * GR_M_PI / 28.0))); + m_64apsk[33] = + gr_complex((r4 * cos(51 * GR_M_PI / 28.0)), (r4 * sin(51 * GR_M_PI / 28.0))); + m_64apsk[34] = + gr_complex((r4 * cos(23 * GR_M_PI / 28.0)), (r4 * sin(23 * GR_M_PI / 28.0))); + m_64apsk[35] = + gr_complex((r4 * cos(33 * GR_M_PI / 28.0)), (r4 * sin(33 * GR_M_PI / 28.0))); + m_64apsk[36] = + gr_complex((r3 * cos(9 * GR_M_PI / 20.0)), (r3 * sin(9 * GR_M_PI / 20.0))); + m_64apsk[37] = + gr_complex((r3 * cos(31 * GR_M_PI / 20.0)), (r3 * sin(31 * GR_M_PI / 20.0))); + m_64apsk[38] = + gr_complex((r3 * cos(11 * GR_M_PI / 20.0)), (r3 * sin(11 * GR_M_PI / 20.0))); + m_64apsk[39] = + gr_complex((r3 * cos(29 * GR_M_PI / 20.0)), (r3 * sin(29 * GR_M_PI / 20.0))); + m_64apsk[40] = + gr_complex((r4 * cos(3 * GR_M_PI / 28.0)), (r4 * sin(3 * GR_M_PI / 28.0))); + m_64apsk[41] = + gr_complex((r4 * cos(53 * GR_M_PI / 28.0)), (r4 * sin(53 * GR_M_PI / 28.0))); + m_64apsk[42] = + gr_complex((r4 * cos(25 * GR_M_PI / 28.0)), (r4 * sin(25 * GR_M_PI / 28.0))); + m_64apsk[43] = + gr_complex((r4 * cos(31 * GR_M_PI / 28.0)), (r4 * sin(31 * GR_M_PI / 28.0))); + m_64apsk[44] = + gr_complex((r2 * cos(5 * GR_M_PI / 12.0)), (r2 * sin(5 * GR_M_PI / 12.0))); + m_64apsk[45] = + gr_complex((r2 * cos(19 * GR_M_PI / 12.0)), (r2 * sin(19 * GR_M_PI / 12.0))); + m_64apsk[46] = + gr_complex((r2 * cos(7 * GR_M_PI / 12.0)), (r2 * sin(7 * GR_M_PI / 12.0))); + m_64apsk[47] = + gr_complex((r2 * cos(17 * GR_M_PI / 12.0)), (r2 * sin(17 * GR_M_PI / 12.0))); + m_64apsk[48] = gr_complex((r3 * cos(GR_M_PI / 4.0)), (r3 * sin(GR_M_PI / 4.0))); + m_64apsk[49] = + gr_complex((r3 * cos(7 * GR_M_PI / 4.0)), (r3 * sin(7 * GR_M_PI / 4.0))); + m_64apsk[50] = + gr_complex((r3 * cos(3 * GR_M_PI / 4.0)), (r3 * sin(3 * GR_M_PI / 4.0))); + m_64apsk[51] = + gr_complex((r3 * cos(5 * GR_M_PI / 4.0)), (r3 * sin(5 * GR_M_PI / 4.0))); + m_64apsk[52] = + gr_complex((r3 * cos(7 * GR_M_PI / 20.0)), (r3 * sin(7 * GR_M_PI / 20.0))); + m_64apsk[53] = + gr_complex((r3 * cos(33 * GR_M_PI / 20.0)), (r3 * sin(33 * GR_M_PI / 20.0))); + m_64apsk[54] = + gr_complex((r3 * cos(13 * GR_M_PI / 20.0)), (r3 * sin(13 * GR_M_PI / 20.0))); + m_64apsk[55] = + gr_complex((r3 * cos(27 * GR_M_PI / 20.0)), (r3 * sin(27 * GR_M_PI / 20.0))); + m_64apsk[56] = + gr_complex((r3 * cos(3 * GR_M_PI / 20.0)), (r3 * sin(3 * GR_M_PI / 20.0))); + m_64apsk[57] = + gr_complex((r3 * cos(37 * GR_M_PI / 20.0)), (r3 * sin(37 * GR_M_PI / 20.0))); + m_64apsk[58] = + gr_complex((r3 * cos(17 * GR_M_PI / 20.0)), (r3 * sin(17 * GR_M_PI / 20.0))); + m_64apsk[59] = + gr_complex((r3 * cos(23 * GR_M_PI / 20.0)), (r3 * sin(23 * GR_M_PI / 20.0))); + m_64apsk[60] = gr_complex((r2 * cos(GR_M_PI / 4.0)), (r2 * sin(GR_M_PI / 4.0))); + m_64apsk[61] = + gr_complex((r2 * cos(7 * GR_M_PI / 4.0)), (r2 * sin(7 * GR_M_PI / 4.0))); + m_64apsk[62] = + gr_complex((r2 * cos(3 * GR_M_PI / 4.0)), (r2 * sin(3 * GR_M_PI / 4.0))); + m_64apsk[63] = + gr_complex((r2 * cos(5 * GR_M_PI / 4.0)), (r2 * sin(5 * GR_M_PI / 4.0))); + break; + case MOD_128APSK: + r6 = m; + switch (rate) { + case C135_180: + r1 = r6 / 3.819; + r5 = r1 * 2.75; + r4 = r1 * 2.681; + r3 = r1 * 2.118; + r2 = r1 * 1.715; + break; + case C140_180: + r1 = r6 / 3.733; + r5 = r1 * 2.75; + r4 = r1 * 2.681; + r3 = r1 * 2.118; + r2 = r1 * 1.715; + break; + default: + r1 = 0; + r2 = 0; + r3 = 0; + r4 = 0; + r5 = 0; + break; + } + m_128apsk[0] = gr_complex((r1 * cos(83 * GR_M_PI / 1260.0)), + (r1 * sin(83 * GR_M_PI / 1260.0))); + m_128apsk[1] = gr_complex((r6 * cos(11 * GR_M_PI / 105.0)), + (r6 * sin(11 * GR_M_PI / 105.0))); + m_128apsk[2] = gr_complex((r6 * cos(37 * GR_M_PI / 1680.0)), + (r6 * sin(37 * GR_M_PI / 1680.0))); + m_128apsk[3] = gr_complex((r6 * cos(11 * GR_M_PI / 168.0)), + (r6 * sin(11 * GR_M_PI / 168.0))); + m_128apsk[4] = gr_complex((r2 * cos(121 * GR_M_PI / 2520.0)), + (r2 * sin(121 * GR_M_PI / 2520.0))); + m_128apsk[5] = gr_complex((r3 * cos(23 * GR_M_PI / 280.0)), + (r3 * sin(23 * GR_M_PI / 280.0))); + m_128apsk[6] = gr_complex((r5 * cos(19 * GR_M_PI / 720.0)), + (r5 * sin(19 * GR_M_PI / 720.0))); + m_128apsk[7] = gr_complex((r4 * cos(61 * GR_M_PI / 720.0)), + (r4 * sin(61 * GR_M_PI / 720.0))); + m_128apsk[8] = gr_complex((r1 * cos(103 * GR_M_PI / 560.0)), + (r1 * sin(103 * GR_M_PI / 560.0))); + m_128apsk[9] = gr_complex((r6 * cos(61 * GR_M_PI / 420.0)), + (r6 * sin(61 * GR_M_PI / 420.0))); + m_128apsk[10] = gr_complex((r6 * cos(383 * GR_M_PI / 1680.0)), + (r6 * sin(383 * GR_M_PI / 1680.0))); + m_128apsk[11] = gr_complex((r6 * cos(929 * GR_M_PI / 5040.0)), + (r6 * sin(929 * GR_M_PI / 5040.0))); + m_128apsk[12] = gr_complex((r2 * cos(113 * GR_M_PI / 560.0)), + (r2 * sin(113 * GR_M_PI / 560.0))); + m_128apsk[13] = gr_complex((r3 * cos(169 * GR_M_PI / 1008.0)), + (r3 * sin(169 * GR_M_PI / 1008.0))); + m_128apsk[14] = gr_complex((r5 * cos(563 * GR_M_PI / 2520.0)), + (r5 * sin(563 * GR_M_PI / 2520.0))); + m_128apsk[15] = gr_complex((r4 * cos(139 * GR_M_PI / 840.0)), + (r4 * sin(139 * GR_M_PI / 840.0))); + m_128apsk[16] = gr_complex((r1 * cos(243 * GR_M_PI / 560.0)), + (r1 * sin(243 * GR_M_PI / 560.0))); + m_128apsk[17] = gr_complex((r6 * cos(1993 * GR_M_PI / 5040.0)), + (r6 * sin(1993 * GR_M_PI / 5040.0))); + m_128apsk[18] = + gr_complex((r6 * cos(43 * GR_M_PI / 90.0)), (r6 * sin(43 * GR_M_PI / 90.0))); + m_128apsk[19] = gr_complex((r6 * cos(73 * GR_M_PI / 168.0)), + (r6 * sin(73 * GR_M_PI / 168.0))); + m_128apsk[20] = gr_complex((r2 * cos(1139 * GR_M_PI / 2520.0)), + (r2 * sin(1139 * GR_M_PI / 2520.0))); + m_128apsk[21] = gr_complex((r3 * cos(117 * GR_M_PI / 280.0)), + (r3 * sin(117 * GR_M_PI / 280.0))); + m_128apsk[22] = gr_complex((r5 * cos(341 * GR_M_PI / 720.0)), + (r5 * sin(341 * GR_M_PI / 720.0))); + m_128apsk[23] = gr_complex((r4 * cos(349 * GR_M_PI / 840.0)), + (r4 * sin(349 * GR_M_PI / 840.0))); + m_128apsk[24] = gr_complex((r1 * cos(177 * GR_M_PI / 560.0)), + (r1 * sin(177 * GR_M_PI / 560.0))); + m_128apsk[25] = gr_complex((r6 * cos(1789 * GR_M_PI / 5040.0)), + (r6 * sin(1789 * GR_M_PI / 5040.0))); + m_128apsk[26] = gr_complex((r6 * cos(49 * GR_M_PI / 180.0)), + (r6 * sin(49 * GR_M_PI / 180.0))); + m_128apsk[27] = gr_complex((r6 * cos(53 * GR_M_PI / 168.0)), + (r6 * sin(53 * GR_M_PI / 168.0))); + m_128apsk[28] = gr_complex((r2 * cos(167 * GR_M_PI / 560.0)), + (r2 * sin(167 * GR_M_PI / 560.0))); + m_128apsk[29] = gr_complex((r3 * cos(239 * GR_M_PI / 720.0)), + (r3 * sin(239 * GR_M_PI / 720.0))); + m_128apsk[30] = gr_complex((r5 * cos(199 * GR_M_PI / 720.0)), + (r5 * sin(199 * GR_M_PI / 720.0))); + m_128apsk[31] = gr_complex((r4 * cos(281 * GR_M_PI / 840.0)), + (r4 * sin(281 * GR_M_PI / 840.0))); + m_128apsk[32] = gr_complex((r1 * cos(1177 * GR_M_PI / 1260.0)), + (r1 * sin(1177 * GR_M_PI / 1260.0))); + m_128apsk[33] = gr_complex((r6 * cos(94 * GR_M_PI / 105.0)), + (r6 * sin(94 * GR_M_PI / 105.0))); + m_128apsk[34] = gr_complex((r6 * cos(1643 * GR_M_PI / 1680.0)), + (r6 * sin(1643 * GR_M_PI / 1680.0))); + m_128apsk[35] = gr_complex((r6 * cos(157 * GR_M_PI / 168.0)), + (r6 * sin(157 * GR_M_PI / 168.0))); + m_128apsk[36] = gr_complex((r2 * cos(2399 * GR_M_PI / 2520.0)), + (r2 * sin(2399 * GR_M_PI / 2520.0))); + m_128apsk[37] = gr_complex((r3 * cos(257 * GR_M_PI / 280.0)), + (r3 * sin(257 * GR_M_PI / 280.0))); + m_128apsk[38] = gr_complex((r5 * cos(701 * GR_M_PI / 720.0)), + (r5 * sin(701 * GR_M_PI / 720.0))); + m_128apsk[39] = gr_complex((r4 * cos(659 * GR_M_PI / 720.0)), + (r4 * sin(659 * GR_M_PI / 720.0))); + m_128apsk[40] = gr_complex((r1 * cos(457 * GR_M_PI / 560.0)), + (r1 * sin(457 * GR_M_PI / 560.0))); + m_128apsk[41] = gr_complex((r6 * cos(359 * GR_M_PI / 420.0)), + (r6 * sin(359 * GR_M_PI / 420.0))); + m_128apsk[42] = gr_complex((r6 * cos(1297 * GR_M_PI / 1680.0)), + (r6 * sin(1297 * GR_M_PI / 1680.0))); + m_128apsk[43] = gr_complex((r6 * cos(4111 * GR_M_PI / 5040.0)), + (r6 * sin(4111 * GR_M_PI / 5040.0))); + m_128apsk[44] = gr_complex((r2 * cos(447 * GR_M_PI / 560.0)), + (r2 * sin(447 * GR_M_PI / 560.0))); + m_128apsk[45] = gr_complex((r3 * cos(839 * GR_M_PI / 1008.0)), + (r3 * sin(839 * GR_M_PI / 1008.0))); + m_128apsk[46] = gr_complex((r5 * cos(1957 * GR_M_PI / 2520.0)), + (r5 * sin(1957 * GR_M_PI / 2520.0))); + m_128apsk[47] = gr_complex((r4 * cos(701 * GR_M_PI / 840.0)), + (r4 * sin(701 * GR_M_PI / 840.0))); + m_128apsk[48] = gr_complex((r1 * cos(317 * GR_M_PI / 560.0)), + (r1 * sin(317 * GR_M_PI / 560.0))); + m_128apsk[49] = gr_complex((r6 * cos(3047 * GR_M_PI / 5040.0)), + (r6 * sin(3047 * GR_M_PI / 5040.0))); + m_128apsk[50] = + gr_complex((r6 * cos(47 * GR_M_PI / 90.0)), (r6 * sin(47 * GR_M_PI / 90.0))); + m_128apsk[51] = gr_complex((r6 * cos(95 * GR_M_PI / 168.0)), + (r6 * sin(95 * GR_M_PI / 168.0))); + m_128apsk[52] = gr_complex((r2 * cos(1381 * GR_M_PI / 2520.0)), + (r2 * sin(1381 * GR_M_PI / 2520.0))); + m_128apsk[53] = gr_complex((r3 * cos(163 * GR_M_PI / 280.0)), + (r3 * sin(163 * GR_M_PI / 280.0))); + m_128apsk[54] = gr_complex((r5 * cos(379 * GR_M_PI / 720.0)), + (r5 * sin(379 * GR_M_PI / 720.0))); + m_128apsk[55] = gr_complex((r4 * cos(491 * GR_M_PI / 840.0)), + (r4 * sin(491 * GR_M_PI / 840.0))); + m_128apsk[56] = gr_complex((r1 * cos(383 * GR_M_PI / 560.0)), + (r1 * sin(383 * GR_M_PI / 560.0))); + m_128apsk[57] = gr_complex((r6 * cos(3251 * GR_M_PI / 5040.0)), + (r6 * sin(3251 * GR_M_PI / 5040.0))); + m_128apsk[58] = gr_complex((r6 * cos(131 * GR_M_PI / 180.0)), + (r6 * sin(131 * GR_M_PI / 180.0))); + m_128apsk[59] = gr_complex((r6 * cos(115 * GR_M_PI / 168.0)), + (r6 * sin(115 * GR_M_PI / 168.0))); + m_128apsk[60] = gr_complex((r2 * cos(393 * GR_M_PI / 560.0)), + (r2 * sin(393 * GR_M_PI / 560.0))); + m_128apsk[61] = gr_complex((r3 * cos(481 * GR_M_PI / 720.0)), + (r3 * sin(481 * GR_M_PI / 720.0))); + m_128apsk[62] = gr_complex((r5 * cos(521 * GR_M_PI / 720.0)), + (r5 * sin(521 * GR_M_PI / 720.0))); + m_128apsk[63] = gr_complex((r4 * cos(559 * GR_M_PI / 840.0)), + (r4 * sin(559 * GR_M_PI / 840.0))); + m_128apsk[64] = gr_complex((r1 * cos(2437 * GR_M_PI / 1260.0)), + (r1 * sin(2437 * GR_M_PI / 1260.0))); + m_128apsk[65] = gr_complex((r6 * cos(199 * GR_M_PI / 105.0)), + (r6 * sin(199 * GR_M_PI / 105.0))); + m_128apsk[66] = gr_complex((r6 * cos(3323 * GR_M_PI / 1680.0)), + (r6 * sin(3323 * GR_M_PI / 1680.0))); + m_128apsk[67] = gr_complex((r6 * cos(325 * GR_M_PI / 168.0)), + (r6 * sin(325 * GR_M_PI / 168.0))); + m_128apsk[68] = gr_complex((r2 * cos(4919 * GR_M_PI / 2520.0)), + (r2 * sin(4919 * GR_M_PI / 2520.0))); + m_128apsk[69] = gr_complex((r3 * cos(537 * GR_M_PI / 280.0)), + (r3 * sin(537 * GR_M_PI / 280.0))); + m_128apsk[70] = gr_complex((r5 * cos(1421 * GR_M_PI / 720.0)), + (r5 * sin(1421 * GR_M_PI / 720.0))); + m_128apsk[71] = gr_complex((r4 * cos(1379 * GR_M_PI / 720.0)), + (r4 * sin(1379 * GR_M_PI / 720.0))); + m_128apsk[72] = gr_complex((r1 * cos(1017 * GR_M_PI / 560.0)), + (r1 * sin(1017 * GR_M_PI / 560.0))); + m_128apsk[73] = gr_complex((r6 * cos(779 * GR_M_PI / 420.0)), + (r6 * sin(779 * GR_M_PI / 420.0))); + m_128apsk[74] = gr_complex((r6 * cos(2977 * GR_M_PI / 1680.0)), + (r6 * sin(2977 * GR_M_PI / 1680.0))); + m_128apsk[75] = gr_complex((r6 * cos(9151 * GR_M_PI / 5040.0)), + (r6 * sin(9151 * GR_M_PI / 5040.0))); + m_128apsk[76] = gr_complex((r2 * cos(1007 * GR_M_PI / 560.0)), + (r2 * sin(1007 * GR_M_PI / 560.0))); + m_128apsk[77] = gr_complex((r3 * cos(1847 * GR_M_PI / 1008.0)), + (r3 * sin(1847 * GR_M_PI / 1008.0))); + m_128apsk[78] = gr_complex((r5 * cos(4477 * GR_M_PI / 2520.0)), + (r5 * sin(4477 * GR_M_PI / 2520.0))); + m_128apsk[79] = gr_complex((r4 * cos(1541 * GR_M_PI / 840.0)), + (r4 * sin(1541 * GR_M_PI / 840.0))); + m_128apsk[80] = gr_complex((r1 * cos(877 * GR_M_PI / 560.0)), + (r1 * sin(877 * GR_M_PI / 560.0))); + m_128apsk[81] = gr_complex((r6 * cos(8087 * GR_M_PI / 5040.0)), + (r6 * sin(8087 * GR_M_PI / 5040.0))); + m_128apsk[82] = gr_complex((r6 * cos(137 * GR_M_PI / 90.0)), + (r6 * sin(137 * GR_M_PI / 90.0))); + m_128apsk[83] = gr_complex((r6 * cos(263 * GR_M_PI / 168.0)), + (r6 * sin(263 * GR_M_PI / 168.0))); + m_128apsk[84] = gr_complex((r2 * cos(3901 * GR_M_PI / 2520.0)), + (r2 * sin(3901 * GR_M_PI / 2520.0))); + m_128apsk[85] = gr_complex((r3 * cos(443 * GR_M_PI / 280.0)), + (r3 * sin(443 * GR_M_PI / 280.0))); + m_128apsk[86] = gr_complex((r5 * cos(1099 * GR_M_PI / 720.0)), + (r5 * sin(1099 * GR_M_PI / 720.0))); + m_128apsk[87] = gr_complex((r4 * cos(1331 * GR_M_PI / 840.0)), + (r4 * sin(1331 * GR_M_PI / 840.0))); + m_128apsk[88] = gr_complex((r1 * cos(943 * GR_M_PI / 560.0)), + (r1 * sin(943 * GR_M_PI / 560.0))); + m_128apsk[89] = gr_complex((r6 * cos(8291 * GR_M_PI / 5040.0)), + (r6 * sin(8291 * GR_M_PI / 5040.0))); + m_128apsk[90] = gr_complex((r6 * cos(311 * GR_M_PI / 180.0)), + (r6 * sin(311 * GR_M_PI / 180.0))); + m_128apsk[91] = gr_complex((r6 * cos(283 * GR_M_PI / 168.0)), + (r6 * sin(283 * GR_M_PI / 168.0))); + m_128apsk[92] = gr_complex((r2 * cos(953 * GR_M_PI / 560.0)), + (r2 * sin(953 * GR_M_PI / 560.0))); + m_128apsk[93] = gr_complex((r3 * cos(1201 * GR_M_PI / 720.0)), + (r3 * sin(1201 * GR_M_PI / 720.0))); + m_128apsk[94] = gr_complex((r5 * cos(1241 * GR_M_PI / 720.0)), + (r5 * sin(1241 * GR_M_PI / 720.0))); + m_128apsk[95] = gr_complex((r4 * cos(1399 * GR_M_PI / 840.0)), + (r4 * sin(1399 * GR_M_PI / 840.0))); + m_128apsk[96] = gr_complex((r1 * cos(1343 * GR_M_PI / 1260.0)), + (r1 * sin(1343 * GR_M_PI / 1260.0))); + m_128apsk[97] = gr_complex((r6 * cos(116 * GR_M_PI / 105.0)), + (r6 * sin(116 * GR_M_PI / 105.0))); + m_128apsk[98] = gr_complex((r6 * cos(1717 * GR_M_PI / 1680.0)), + (r6 * sin(1717 * GR_M_PI / 1680.0))); + m_128apsk[99] = gr_complex((r6 * cos(179 * GR_M_PI / 168.0)), + (r6 * sin(179 * GR_M_PI / 168.0))); + m_128apsk[100] = gr_complex((r2 * cos(2641 * GR_M_PI / 2520.0)), + (r2 * sin(2641 * GR_M_PI / 2520.0))); + m_128apsk[101] = gr_complex((r3 * cos(303 * GR_M_PI / 280.0)), + (r3 * sin(303 * GR_M_PI / 280.0))); + m_128apsk[102] = gr_complex((r5 * cos(739 * GR_M_PI / 720.0)), + (r5 * sin(739 * GR_M_PI / 720.0))); + m_128apsk[103] = gr_complex((r4 * cos(781 * GR_M_PI / 720.0)), + (r4 * sin(781 * GR_M_PI / 720.0))); + m_128apsk[104] = gr_complex((r1 * cos(663 * GR_M_PI / 560.0)), + (r1 * sin(663 * GR_M_PI / 560.0))); + m_128apsk[105] = gr_complex((r6 * cos(481 * GR_M_PI / 420.0)), + (r6 * sin(481 * GR_M_PI / 420.0))); + m_128apsk[106] = gr_complex((r6 * cos(2063 * GR_M_PI / 1680.0)), + (r6 * sin(2063 * GR_M_PI / 1680.0))); + m_128apsk[107] = gr_complex((r6 * cos(5969 * GR_M_PI / 5040.0)), + (r6 * sin(5969 * GR_M_PI / 5040.0))); + m_128apsk[108] = gr_complex((r2 * cos(673 * GR_M_PI / 560.0)), + (r2 * sin(673 * GR_M_PI / 560.0))); + m_128apsk[109] = gr_complex((r3 * cos(1177 * GR_M_PI / 1008.0)), + (r3 * sin(1177 * GR_M_PI / 1008.0))); + m_128apsk[110] = gr_complex((r5 * cos(3083 * GR_M_PI / 2520.0)), + (r5 * sin(3083 * GR_M_PI / 2520.0))); + m_128apsk[111] = gr_complex((r4 * cos(979 * GR_M_PI / 840.0)), + (r4 * sin(979 * GR_M_PI / 840.0))); + m_128apsk[112] = gr_complex((r1 * cos(803 * GR_M_PI / 560.0)), + (r1 * sin(803 * GR_M_PI / 560.0))); + m_128apsk[113] = gr_complex((r6 * cos(7033 * GR_M_PI / 5040.0)), + (r6 * sin(7033 * GR_M_PI / 5040.0))); + m_128apsk[114] = gr_complex((r6 * cos(133 * GR_M_PI / 90.0)), + (r6 * sin(133 * GR_M_PI / 90.0))); + m_128apsk[115] = gr_complex((r6 * cos(241 * GR_M_PI / 168.0)), + (r6 * sin(241 * GR_M_PI / 168.0))); + m_128apsk[116] = gr_complex((r2 * cos(3659 * GR_M_PI / 2520.0)), + (r2 * sin(3659 * GR_M_PI / 2520.0))); + m_128apsk[117] = gr_complex((r3 * cos(397 * GR_M_PI / 280.0)), + (r3 * sin(397 * GR_M_PI / 280.0))); + m_128apsk[118] = gr_complex((r5 * cos(1061 * GR_M_PI / 720.0)), + (r5 * sin(1061 * GR_M_PI / 720.0))); + m_128apsk[119] = gr_complex((r4 * cos(1189 * GR_M_PI / 840.0)), + (r4 * sin(1189 * GR_M_PI / 840.0))); + m_128apsk[120] = gr_complex((r1 * cos(737 * GR_M_PI / 560.0)), + (r1 * sin(737 * GR_M_PI / 560.0))); + m_128apsk[121] = gr_complex((r6 * cos(6829 * GR_M_PI / 5040.0)), + (r6 * sin(6829 * GR_M_PI / 5040.0))); + m_128apsk[122] = gr_complex((r6 * cos(229 * GR_M_PI / 180.0)), + (r6 * sin(229 * GR_M_PI / 180.0))); + m_128apsk[123] = gr_complex((r6 * cos(221 * GR_M_PI / 168.0)), + (r6 * sin(221 * GR_M_PI / 168.0))); + m_128apsk[124] = gr_complex((r2 * cos(727 * GR_M_PI / 560.0)), + (r2 * sin(727 * GR_M_PI / 560.0))); + m_128apsk[125] = gr_complex((r3 * cos(959 * GR_M_PI / 720.0)), + (r3 * sin(959 * GR_M_PI / 720.0))); + m_128apsk[126] = gr_complex((r5 * cos(919 * GR_M_PI / 720.0)), + (r5 * sin(919 * GR_M_PI / 720.0))); + m_128apsk[127] = gr_complex((r4 * cos(1121 * GR_M_PI / 840.0)), + (r4 * sin(1121 * GR_M_PI / 840.0))); + break; + case MOD_256APSK: + if (rate == C20_30) { m_256apsk[0] = gr_complex(1.6350, 0.1593); m_256apsk[1] = gr_complex(1.5776, 0.4735); m_256apsk[2] = gr_complex(0.9430, 0.1100); @@ -1105,8 +1525,7 @@ namespace gr { m_256apsk[253] = gr_complex(-0.1909, -0.3627); m_256apsk[254] = gr_complex(-0.3224, -0.5236); m_256apsk[255] = gr_complex(-0.3016, -0.5347); - } - else if (rate == C22_30) { + } else if (rate == C22_30) { m_256apsk[0] = gr_complex(1.5977, 0.1526); m_256apsk[1] = gr_complex(1.3187, 0.1269); m_256apsk[2] = gr_complex(-1.5977, 0.1526); @@ -1363,12 +1782,11 @@ namespace gr { m_256apsk[253] = gr_complex(0.3110, -0.5686); m_256apsk[254] = gr_complex(-0.3893, -0.7143); m_256apsk[255] = gr_complex(-0.3110, -0.5686); - } - else { + } else { r8 = m; - switch(rate) { - case C116_180: - case C124_180: + switch (rate) { + case C116_180: + case C124_180: r1 = r8 / 6.536; r7 = r1 * 5.078; r6 = r1 * 4.235; @@ -1377,7 +1795,7 @@ namespace gr { r3 = r1 * 2.405; r2 = r1 * 1.791; break; - case C128_180: + case C128_180: r1 = r8 / 5.4; r7 = r1 * 4.6; r6 = r1 * 4.045; @@ -1386,7 +1804,7 @@ namespace gr { r3 = r1 * 2.409; r2 = r1 * 1.794; break; - case C135_180: + case C135_180: r1 = r8 / 5.2; r7 = r1 * 4.5; r6 = r1 * 4.045; @@ -1395,7 +1813,7 @@ namespace gr { r3 = r1 * 2.409; r2 = r1 * 1.794; break; - default: + default: r1 = 0; r2 = 0; r3 = 0; @@ -1405,799 +1823,1051 @@ namespace gr { r7 = 0; break; } - m_256apsk[0] = gr_complex((r1 * cos(GR_M_PI / 32.0)), (r1 * sin(GR_M_PI / 32.0))); - m_256apsk[1] = gr_complex((r1 * cos(3 * GR_M_PI / 32.0)), (r1 * sin(3 * GR_M_PI / 32.0))); - m_256apsk[2] = gr_complex((r1 * cos(7 * GR_M_PI / 32.0)), (r1 * sin(7 * GR_M_PI / 32.0))); - m_256apsk[3] = gr_complex((r1 * cos(5 * GR_M_PI / 32.0)), (r1 * sin(5 * GR_M_PI / 32.0))); - m_256apsk[4] = gr_complex((r1 * cos(15 * GR_M_PI / 32.0)), (r1 * sin(15 * GR_M_PI / 32.0))); - m_256apsk[5] = gr_complex((r1 * cos(13 * GR_M_PI / 32.0)), (r1 * sin(13 * GR_M_PI / 32.0))); - m_256apsk[6] = gr_complex((r1 * cos(9 * GR_M_PI / 32.0)), (r1 * sin(9 * GR_M_PI / 32.0))); - m_256apsk[7] = gr_complex((r1 * cos(11 * GR_M_PI / 32.0)), (r1 * sin(11 * GR_M_PI / 32.0))); - m_256apsk[8] = gr_complex((r1 * cos(31 * GR_M_PI / 32.0)), (r1 * sin(31 * GR_M_PI / 32.0))); - m_256apsk[9] = gr_complex((r1 * cos(29 * GR_M_PI / 32.0)), (r1 * sin(29 * GR_M_PI / 32.0))); - m_256apsk[10] = gr_complex((r1 * cos(25 * GR_M_PI / 32.0)), (r1 * sin(25 * GR_M_PI / 32.0))); - m_256apsk[11] = gr_complex((r1 * cos(27 * GR_M_PI / 32.0)), (r1 * sin(27 * GR_M_PI / 32.0))); - m_256apsk[12] = gr_complex((r1 * cos(17 * GR_M_PI / 32.0)), (r1 * sin(17 * GR_M_PI / 32.0))); - m_256apsk[13] = gr_complex((r1 * cos(19 * GR_M_PI / 32.0)), (r1 * sin(19 * GR_M_PI / 32.0))); - m_256apsk[14] = gr_complex((r1 * cos(23 * GR_M_PI / 32.0)), (r1 * sin(23 * GR_M_PI / 32.0))); - m_256apsk[15] = gr_complex((r1 * cos(21 * GR_M_PI / 32.0)), (r1 * sin(21 * GR_M_PI / 32.0))); - m_256apsk[16] = gr_complex((r1 * cos(-1 * GR_M_PI / 32.0)), (r1 * sin(-1 * GR_M_PI / 32.0))); - m_256apsk[17] = gr_complex((r1 * cos(-3 * GR_M_PI / 32.0)), (r1 * sin(-3 * GR_M_PI / 32.0))); - m_256apsk[18] = gr_complex((r1 * cos(-7 * GR_M_PI / 32.0)), (r1 * sin(-7 * GR_M_PI / 32.0))); - m_256apsk[19] = gr_complex((r1 * cos(-5 * GR_M_PI / 32.0)), (r1 * sin(-5 * GR_M_PI / 32.0))); - m_256apsk[20] = gr_complex((r1 * cos(-15 * GR_M_PI / 32.0)), (r1 * sin(-15 * GR_M_PI / 32.0))); - m_256apsk[21] = gr_complex((r1 * cos(-13 * GR_M_PI / 32.0)), (r1 * sin(-13 * GR_M_PI / 32.0))); - m_256apsk[22] = gr_complex((r1 * cos(-9 * GR_M_PI / 32.0)), (r1 * sin(-9 * GR_M_PI / 32.0))); - m_256apsk[23] = gr_complex((r1 * cos(-11 * GR_M_PI / 32.0)), (r1 * sin(-11 * GR_M_PI / 32.0))); - m_256apsk[24] = gr_complex((r1 * cos(33 * GR_M_PI / 32.0)), (r1 * sin(33 * GR_M_PI / 32.0))); - m_256apsk[25] = gr_complex((r1 * cos(35 * GR_M_PI / 32.0)), (r1 * sin(35 * GR_M_PI / 32.0))); - m_256apsk[26] = gr_complex((r1 * cos(39 * GR_M_PI / 32.0)), (r1 * sin(39 * GR_M_PI / 32.0))); - m_256apsk[27] = gr_complex((r1 * cos(37 * GR_M_PI / 32.0)), (r1 * sin(37 * GR_M_PI / 32.0))); - m_256apsk[28] = gr_complex((r1 * cos(47 * GR_M_PI / 32.0)), (r1 * sin(47 * GR_M_PI / 32.0))); - m_256apsk[29] = gr_complex((r1 * cos(45 * GR_M_PI / 32.0)), (r1 * sin(45 * GR_M_PI / 32.0))); - m_256apsk[30] = gr_complex((r1 * cos(41 * GR_M_PI / 32.0)), (r1 * sin(41 * GR_M_PI / 32.0))); - m_256apsk[31] = gr_complex((r1 * cos(43 * GR_M_PI / 32.0)), (r1 * sin(43 * GR_M_PI / 32.0))); - m_256apsk[32] = gr_complex((r2 * cos(GR_M_PI / 32.0)), (r2 * sin(GR_M_PI / 32.0))); - m_256apsk[33] = gr_complex((r2 * cos(3 * GR_M_PI / 32.0)), (r2 * sin(3 * GR_M_PI / 32.0))); - m_256apsk[34] = gr_complex((r2 * cos(7 * GR_M_PI / 32.0)), (r2 * sin(7 * GR_M_PI / 32.0))); - m_256apsk[35] = gr_complex((r2 * cos(5 * GR_M_PI / 32.0)), (r2 * sin(5 * GR_M_PI / 32.0))); - m_256apsk[36] = gr_complex((r2 * cos(15 * GR_M_PI / 32.0)), (r2 * sin(15 * GR_M_PI / 32.0))); - m_256apsk[37] = gr_complex((r2 * cos(13 * GR_M_PI / 32.0)), (r2 * sin(13 * GR_M_PI / 32.0))); - m_256apsk[38] = gr_complex((r2 * cos(9 * GR_M_PI / 32.0)), (r2 * sin(9 * GR_M_PI / 32.0))); - m_256apsk[39] = gr_complex((r2 * cos(11 * GR_M_PI / 32.0)), (r2 * sin(11 * GR_M_PI / 32.0))); - m_256apsk[40] = gr_complex((r2 * cos(31 * GR_M_PI / 32.0)), (r2 * sin(31 * GR_M_PI / 32.0))); - m_256apsk[41] = gr_complex((r2 * cos(29 * GR_M_PI / 32.0)), (r2 * sin(29 * GR_M_PI / 32.0))); - m_256apsk[42] = gr_complex((r2 * cos(25 * GR_M_PI / 32.0)), (r2 * sin(25 * GR_M_PI / 32.0))); - m_256apsk[43] = gr_complex((r2 * cos(27 * GR_M_PI / 32.0)), (r2 * sin(27 * GR_M_PI / 32.0))); - m_256apsk[44] = gr_complex((r2 * cos(17 * GR_M_PI / 32.0)), (r2 * sin(17 * GR_M_PI / 32.0))); - m_256apsk[45] = gr_complex((r2 * cos(19 * GR_M_PI / 32.0)), (r2 * sin(19 * GR_M_PI / 32.0))); - m_256apsk[46] = gr_complex((r2 * cos(23 * GR_M_PI / 32.0)), (r2 * sin(23 * GR_M_PI / 32.0))); - m_256apsk[47] = gr_complex((r2 * cos(21 * GR_M_PI / 32.0)), (r2 * sin(21 * GR_M_PI / 32.0))); - m_256apsk[48] = gr_complex((r2 * cos(-1 * GR_M_PI / 32.0)), (r2 * sin(-1 * GR_M_PI / 32.0))); - m_256apsk[49] = gr_complex((r2 * cos(-3 * GR_M_PI / 32.0)), (r2 * sin(-3 * GR_M_PI / 32.0))); - m_256apsk[50] = gr_complex((r2 * cos(-7 * GR_M_PI / 32.0)), (r2 * sin(-7 * GR_M_PI / 32.0))); - m_256apsk[51] = gr_complex((r2 * cos(-5 * GR_M_PI / 32.0)), (r2 * sin(-5 * GR_M_PI / 32.0))); - m_256apsk[52] = gr_complex((r2 * cos(-15 * GR_M_PI / 32.0)), (r2 * sin(-15 * GR_M_PI / 32.0))); - m_256apsk[53] = gr_complex((r2 * cos(-13 * GR_M_PI / 32.0)), (r2 * sin(-13 * GR_M_PI / 32.0))); - m_256apsk[54] = gr_complex((r2 * cos(-9 * GR_M_PI / 32.0)), (r2 * sin(-9 * GR_M_PI / 32.0))); - m_256apsk[55] = gr_complex((r2 * cos(-11 * GR_M_PI / 32.0)), (r2 * sin(-11 * GR_M_PI / 32.0))); - m_256apsk[56] = gr_complex((r2 * cos(33 * GR_M_PI / 32.0)), (r2 * sin(33 * GR_M_PI / 32.0))); - m_256apsk[57] = gr_complex((r2 * cos(35 * GR_M_PI / 32.0)), (r2 * sin(35 * GR_M_PI / 32.0))); - m_256apsk[58] = gr_complex((r2 * cos(39 * GR_M_PI / 32.0)), (r2 * sin(39 * GR_M_PI / 32.0))); - m_256apsk[59] = gr_complex((r2 * cos(37 * GR_M_PI / 32.0)), (r2 * sin(37 * GR_M_PI / 32.0))); - m_256apsk[60] = gr_complex((r2 * cos(47 * GR_M_PI / 32.0)), (r2 * sin(47 * GR_M_PI / 32.0))); - m_256apsk[61] = gr_complex((r2 * cos(45 * GR_M_PI / 32.0)), (r2 * sin(45 * GR_M_PI / 32.0))); - m_256apsk[62] = gr_complex((r2 * cos(41 * GR_M_PI / 32.0)), (r2 * sin(41 * GR_M_PI / 32.0))); - m_256apsk[63] = gr_complex((r2 * cos(43 * GR_M_PI / 32.0)), (r2 * sin(43 * GR_M_PI / 32.0))); - m_256apsk[64] = gr_complex((r4 * cos(GR_M_PI / 32.0)), (r4 * sin(GR_M_PI / 32.0))); - m_256apsk[65] = gr_complex((r4 * cos(3 * GR_M_PI / 32.0)), (r4 * sin(3 * GR_M_PI / 32.0))); - m_256apsk[66] = gr_complex((r4 * cos(7 * GR_M_PI / 32.0)), (r4 * sin(7 * GR_M_PI / 32.0))); - m_256apsk[67] = gr_complex((r4 * cos(5 * GR_M_PI / 32.0)), (r4 * sin(5 * GR_M_PI / 32.0))); - m_256apsk[68] = gr_complex((r4 * cos(15 * GR_M_PI / 32.0)), (r4 * sin(15 * GR_M_PI / 32.0))); - m_256apsk[69] = gr_complex((r4 * cos(13 * GR_M_PI / 32.0)), (r4 * sin(13 * GR_M_PI / 32.0))); - m_256apsk[70] = gr_complex((r4 * cos(9 * GR_M_PI / 32.0)), (r4 * sin(9 * GR_M_PI / 32.0))); - m_256apsk[71] = gr_complex((r4 * cos(11 * GR_M_PI / 32.0)), (r4 * sin(11 * GR_M_PI / 32.0))); - m_256apsk[72] = gr_complex((r4 * cos(31 * GR_M_PI / 32.0)), (r4 * sin(31 * GR_M_PI / 32.0))); - m_256apsk[73] = gr_complex((r4 * cos(29 * GR_M_PI / 32.0)), (r4 * sin(29 * GR_M_PI / 32.0))); - m_256apsk[74] = gr_complex((r4 * cos(25 * GR_M_PI / 32.0)), (r4 * sin(25 * GR_M_PI / 32.0))); - m_256apsk[75] = gr_complex((r4 * cos(27 * GR_M_PI / 32.0)), (r4 * sin(27 * GR_M_PI / 32.0))); - m_256apsk[76] = gr_complex((r4 * cos(17 * GR_M_PI / 32.0)), (r4 * sin(17 * GR_M_PI / 32.0))); - m_256apsk[77] = gr_complex((r4 * cos(19 * GR_M_PI / 32.0)), (r4 * sin(19 * GR_M_PI / 32.0))); - m_256apsk[78] = gr_complex((r4 * cos(23 * GR_M_PI / 32.0)), (r4 * sin(23 * GR_M_PI / 32.0))); - m_256apsk[79] = gr_complex((r4 * cos(21 * GR_M_PI / 32.0)), (r4 * sin(21 * GR_M_PI / 32.0))); - m_256apsk[80] = gr_complex((r4 * cos(-1 * GR_M_PI / 32.0)), (r4 * sin(-1 * GR_M_PI / 32.0))); - m_256apsk[81] = gr_complex((r4 * cos(-3 * GR_M_PI / 32.0)), (r4 * sin(-3 * GR_M_PI / 32.0))); - m_256apsk[82] = gr_complex((r4 * cos(-7 * GR_M_PI / 32.0)), (r4 * sin(-7 * GR_M_PI / 32.0))); - m_256apsk[83] = gr_complex((r4 * cos(-5 * GR_M_PI / 32.0)), (r4 * sin(-5 * GR_M_PI / 32.0))); - m_256apsk[84] = gr_complex((r4 * cos(-15 * GR_M_PI / 32.0)), (r4 * sin(-15 * GR_M_PI / 32.0))); - m_256apsk[85] = gr_complex((r4 * cos(-13 * GR_M_PI / 32.0)), (r4 * sin(-13 * GR_M_PI / 32.0))); - m_256apsk[86] = gr_complex((r4 * cos(-9 * GR_M_PI / 32.0)), (r4 * sin(-9 * GR_M_PI / 32.0))); - m_256apsk[87] = gr_complex((r4 * cos(-11 * GR_M_PI / 32.0)), (r4 * sin(-11 * GR_M_PI / 32.0))); - m_256apsk[88] = gr_complex((r4 * cos(33 * GR_M_PI / 32.0)), (r4 * sin(33 * GR_M_PI / 32.0))); - m_256apsk[89] = gr_complex((r4 * cos(35 * GR_M_PI / 32.0)), (r4 * sin(35 * GR_M_PI / 32.0))); - m_256apsk[90] = gr_complex((r4 * cos(39 * GR_M_PI / 32.0)), (r4 * sin(39 * GR_M_PI / 32.0))); - m_256apsk[91] = gr_complex((r4 * cos(37 * GR_M_PI / 32.0)), (r4 * sin(37 * GR_M_PI / 32.0))); - m_256apsk[92] = gr_complex((r4 * cos(47 * GR_M_PI / 32.0)), (r4 * sin(47 * GR_M_PI / 32.0))); - m_256apsk[93] = gr_complex((r4 * cos(45 * GR_M_PI / 32.0)), (r4 * sin(45 * GR_M_PI / 32.0))); - m_256apsk[94] = gr_complex((r4 * cos(41 * GR_M_PI / 32.0)), (r4 * sin(41 * GR_M_PI / 32.0))); - m_256apsk[95] = gr_complex((r4 * cos(43 * GR_M_PI / 32.0)), (r4 * sin(43 * GR_M_PI / 32.0))); - m_256apsk[96] = gr_complex((r3 * cos(GR_M_PI / 32.0)), (r3 * sin(GR_M_PI / 32.0))); - m_256apsk[97] = gr_complex((r3 * cos(3 * GR_M_PI / 32.0)), (r3 * sin(3 * GR_M_PI / 32.0))); - m_256apsk[98] = gr_complex((r3 * cos(7 * GR_M_PI / 32.0)), (r3 * sin(7 * GR_M_PI / 32.0))); - m_256apsk[99] = gr_complex((r3 * cos(5 * GR_M_PI / 32.0)), (r3 * sin(5 * GR_M_PI / 32.0))); - m_256apsk[100] = gr_complex((r3 * cos(15 * GR_M_PI / 32.0)), (r3 * sin(15 * GR_M_PI / 32.0))); - m_256apsk[101] = gr_complex((r3 * cos(13 * GR_M_PI / 32.0)), (r3 * sin(13 * GR_M_PI / 32.0))); - m_256apsk[102] = gr_complex((r3 * cos(9 * GR_M_PI / 32.0)), (r3 * sin(9 * GR_M_PI / 32.0))); - m_256apsk[103] = gr_complex((r3 * cos(11 * GR_M_PI / 32.0)), (r3 * sin(11 * GR_M_PI / 32.0))); - m_256apsk[104] = gr_complex((r3 * cos(31 * GR_M_PI / 32.0)), (r3 * sin(31 * GR_M_PI / 32.0))); - m_256apsk[105] = gr_complex((r3 * cos(29 * GR_M_PI / 32.0)), (r3 * sin(29 * GR_M_PI / 32.0))); - m_256apsk[106] = gr_complex((r3 * cos(25 * GR_M_PI / 32.0)), (r3 * sin(25 * GR_M_PI / 32.0))); - m_256apsk[107] = gr_complex((r3 * cos(27 * GR_M_PI / 32.0)), (r3 * sin(27 * GR_M_PI / 32.0))); - m_256apsk[108] = gr_complex((r3 * cos(17 * GR_M_PI / 32.0)), (r3 * sin(17 * GR_M_PI / 32.0))); - m_256apsk[109] = gr_complex((r3 * cos(19 * GR_M_PI / 32.0)), (r3 * sin(19 * GR_M_PI / 32.0))); - m_256apsk[110] = gr_complex((r3 * cos(23 * GR_M_PI / 32.0)), (r3 * sin(23 * GR_M_PI / 32.0))); - m_256apsk[111] = gr_complex((r3 * cos(21 * GR_M_PI / 32.0)), (r3 * sin(21 * GR_M_PI / 32.0))); - m_256apsk[112] = gr_complex((r3 * cos(-1 * GR_M_PI / 32.0)), (r3 * sin(-1 * GR_M_PI / 32.0))); - m_256apsk[113] = gr_complex((r3 * cos(-3 * GR_M_PI / 32.0)), (r3 * sin(-3 * GR_M_PI / 32.0))); - m_256apsk[114] = gr_complex((r3 * cos(-7 * GR_M_PI / 32.0)), (r3 * sin(-7 * GR_M_PI / 32.0))); - m_256apsk[115] = gr_complex((r3 * cos(-5 * GR_M_PI / 32.0)), (r3 * sin(-5 * GR_M_PI / 32.0))); - m_256apsk[116] = gr_complex((r3 * cos(-15 * GR_M_PI / 32.0)), (r3 * sin(-15 * GR_M_PI / 32.0))); - m_256apsk[117] = gr_complex((r3 * cos(-13 * GR_M_PI / 32.0)), (r3 * sin(-13 * GR_M_PI / 32.0))); - m_256apsk[118] = gr_complex((r3 * cos(-9 * GR_M_PI / 32.0)), (r3 * sin(-9 * GR_M_PI / 32.0))); - m_256apsk[119] = gr_complex((r3 * cos(-11 * GR_M_PI / 32.0)), (r3 * sin(-11 * GR_M_PI / 32.0))); - m_256apsk[120] = gr_complex((r3 * cos(33 * GR_M_PI / 32.0)), (r3 * sin(33 * GR_M_PI / 32.0))); - m_256apsk[121] = gr_complex((r3 * cos(35 * GR_M_PI / 32.0)), (r3 * sin(35 * GR_M_PI / 32.0))); - m_256apsk[122] = gr_complex((r3 * cos(39 * GR_M_PI / 32.0)), (r3 * sin(39 * GR_M_PI / 32.0))); - m_256apsk[123] = gr_complex((r3 * cos(37 * GR_M_PI / 32.0)), (r3 * sin(37 * GR_M_PI / 32.0))); - m_256apsk[124] = gr_complex((r3 * cos(47 * GR_M_PI / 32.0)), (r3 * sin(47 * GR_M_PI / 32.0))); - m_256apsk[125] = gr_complex((r3 * cos(45 * GR_M_PI / 32.0)), (r3 * sin(45 * GR_M_PI / 32.0))); - m_256apsk[126] = gr_complex((r3 * cos(41 * GR_M_PI / 32.0)), (r3 * sin(41 * GR_M_PI / 32.0))); - m_256apsk[127] = gr_complex((r3 * cos(43 * GR_M_PI / 32.0)), (r3 * sin(43 * GR_M_PI / 32.0))); - m_256apsk[128] = gr_complex((r8 * cos(GR_M_PI / 32.0)), (r8 * sin(GR_M_PI / 32.0))); - m_256apsk[129] = gr_complex((r8 * cos(3 * GR_M_PI / 32.0)), (r8 * sin(3 * GR_M_PI / 32.0))); - m_256apsk[130] = gr_complex((r8 * cos(7 * GR_M_PI / 32.0)), (r8 * sin(7 * GR_M_PI / 32.0))); - m_256apsk[131] = gr_complex((r8 * cos(5 * GR_M_PI / 32.0)), (r8 * sin(5 * GR_M_PI / 32.0))); - m_256apsk[132] = gr_complex((r8 * cos(15 * GR_M_PI / 32.0)), (r8 * sin(15 * GR_M_PI / 32.0))); - m_256apsk[133] = gr_complex((r8 * cos(13 * GR_M_PI / 32.0)), (r8 * sin(13 * GR_M_PI / 32.0))); - m_256apsk[134] = gr_complex((r8 * cos(9 * GR_M_PI / 32.0)), (r8 * sin(9 * GR_M_PI / 32.0))); - m_256apsk[135] = gr_complex((r8 * cos(11 * GR_M_PI / 32.0)), (r8 * sin(11 * GR_M_PI / 32.0))); - m_256apsk[136] = gr_complex((r8 * cos(31 * GR_M_PI / 32.0)), (r8 * sin(31 * GR_M_PI / 32.0))); - m_256apsk[137] = gr_complex((r8 * cos(29 * GR_M_PI / 32.0)), (r8 * sin(29 * GR_M_PI / 32.0))); - m_256apsk[138] = gr_complex((r8 * cos(25 * GR_M_PI / 32.0)), (r8 * sin(25 * GR_M_PI / 32.0))); - m_256apsk[139] = gr_complex((r8 * cos(27 * GR_M_PI / 32.0)), (r8 * sin(27 * GR_M_PI / 32.0))); - m_256apsk[140] = gr_complex((r8 * cos(17 * GR_M_PI / 32.0)), (r8 * sin(17 * GR_M_PI / 32.0))); - m_256apsk[141] = gr_complex((r8 * cos(19 * GR_M_PI / 32.0)), (r8 * sin(19 * GR_M_PI / 32.0))); - m_256apsk[142] = gr_complex((r8 * cos(23 * GR_M_PI / 32.0)), (r8 * sin(23 * GR_M_PI / 32.0))); - m_256apsk[143] = gr_complex((r8 * cos(21 * GR_M_PI / 32.0)), (r8 * sin(21 * GR_M_PI / 32.0))); - m_256apsk[144] = gr_complex((r8 * cos(-1 * GR_M_PI / 32.0)), (r8 * sin(-1 * GR_M_PI / 32.0))); - m_256apsk[145] = gr_complex((r8 * cos(-3 * GR_M_PI / 32.0)), (r8 * sin(-3 * GR_M_PI / 32.0))); - m_256apsk[146] = gr_complex((r8 * cos(-7 * GR_M_PI / 32.0)), (r8 * sin(-7 * GR_M_PI / 32.0))); - m_256apsk[147] = gr_complex((r8 * cos(-5 * GR_M_PI / 32.0)), (r8 * sin(-5 * GR_M_PI / 32.0))); - m_256apsk[148] = gr_complex((r8 * cos(-15 * GR_M_PI / 32.0)), (r8 * sin(-15 * GR_M_PI / 32.0))); - m_256apsk[149] = gr_complex((r8 * cos(-13 * GR_M_PI / 32.0)), (r8 * sin(-13 * GR_M_PI / 32.0))); - m_256apsk[150] = gr_complex((r8 * cos(-9 * GR_M_PI / 32.0)), (r8 * sin(-9 * GR_M_PI / 32.0))); - m_256apsk[151] = gr_complex((r8 * cos(-11 * GR_M_PI / 32.0)), (r8 * sin(-11 * GR_M_PI / 32.0))); - m_256apsk[152] = gr_complex((r8 * cos(33 * GR_M_PI / 32.0)), (r8 * sin(33 * GR_M_PI / 32.0))); - m_256apsk[153] = gr_complex((r8 * cos(35 * GR_M_PI / 32.0)), (r8 * sin(35 * GR_M_PI / 32.0))); - m_256apsk[154] = gr_complex((r8 * cos(39 * GR_M_PI / 32.0)), (r8 * sin(39 * GR_M_PI / 32.0))); - m_256apsk[155] = gr_complex((r8 * cos(37 * GR_M_PI / 32.0)), (r8 * sin(37 * GR_M_PI / 32.0))); - m_256apsk[156] = gr_complex((r8 * cos(47 * GR_M_PI / 32.0)), (r8 * sin(47 * GR_M_PI / 32.0))); - m_256apsk[157] = gr_complex((r8 * cos(45 * GR_M_PI / 32.0)), (r8 * sin(45 * GR_M_PI / 32.0))); - m_256apsk[158] = gr_complex((r8 * cos(41 * GR_M_PI / 32.0)), (r8 * sin(41 * GR_M_PI / 32.0))); - m_256apsk[159] = gr_complex((r8 * cos(43 * GR_M_PI / 32.0)), (r8 * sin(43 * GR_M_PI / 32.0))); - m_256apsk[160] = gr_complex((r7 * cos(GR_M_PI / 32.0)), (r7 * sin(GR_M_PI / 32.0))); - m_256apsk[161] = gr_complex((r7 * cos(3 * GR_M_PI / 32.0)), (r7 * sin(3 * GR_M_PI / 32.0))); - m_256apsk[162] = gr_complex((r7 * cos(7 * GR_M_PI / 32.0)), (r7 * sin(7 * GR_M_PI / 32.0))); - m_256apsk[163] = gr_complex((r7 * cos(5 * GR_M_PI / 32.0)), (r7 * sin(5 * GR_M_PI / 32.0))); - m_256apsk[164] = gr_complex((r7 * cos(15 * GR_M_PI / 32.0)), (r7 * sin(15 * GR_M_PI / 32.0))); - m_256apsk[165] = gr_complex((r7 * cos(13 * GR_M_PI / 32.0)), (r7 * sin(13 * GR_M_PI / 32.0))); - m_256apsk[166] = gr_complex((r7 * cos(9 * GR_M_PI / 32.0)), (r7 * sin(9 * GR_M_PI / 32.0))); - m_256apsk[167] = gr_complex((r7 * cos(11 * GR_M_PI / 32.0)), (r7 * sin(11 * GR_M_PI / 32.0))); - m_256apsk[168] = gr_complex((r7 * cos(31 * GR_M_PI / 32.0)), (r7 * sin(31 * GR_M_PI / 32.0))); - m_256apsk[169] = gr_complex((r7 * cos(29 * GR_M_PI / 32.0)), (r7 * sin(29 * GR_M_PI / 32.0))); - m_256apsk[170] = gr_complex((r7 * cos(25 * GR_M_PI / 32.0)), (r7 * sin(25 * GR_M_PI / 32.0))); - m_256apsk[171] = gr_complex((r7 * cos(27 * GR_M_PI / 32.0)), (r7 * sin(27 * GR_M_PI / 32.0))); - m_256apsk[172] = gr_complex((r7 * cos(17 * GR_M_PI / 32.0)), (r7 * sin(17 * GR_M_PI / 32.0))); - m_256apsk[173] = gr_complex((r7 * cos(19 * GR_M_PI / 32.0)), (r7 * sin(19 * GR_M_PI / 32.0))); - m_256apsk[174] = gr_complex((r7 * cos(23 * GR_M_PI / 32.0)), (r7 * sin(23 * GR_M_PI / 32.0))); - m_256apsk[175] = gr_complex((r7 * cos(21 * GR_M_PI / 32.0)), (r7 * sin(21 * GR_M_PI / 32.0))); - m_256apsk[176] = gr_complex((r7 * cos(-1 * GR_M_PI / 32.0)), (r7 * sin(-1 * GR_M_PI / 32.0))); - m_256apsk[177] = gr_complex((r7 * cos(-3 * GR_M_PI / 32.0)), (r7 * sin(-3 * GR_M_PI / 32.0))); - m_256apsk[178] = gr_complex((r7 * cos(-7 * GR_M_PI / 32.0)), (r7 * sin(-7 * GR_M_PI / 32.0))); - m_256apsk[179] = gr_complex((r7 * cos(-5 * GR_M_PI / 32.0)), (r7 * sin(-5 * GR_M_PI / 32.0))); - m_256apsk[180] = gr_complex((r7 * cos(-15 * GR_M_PI / 32.0)), (r7 * sin(-15 * GR_M_PI / 32.0))); - m_256apsk[181] = gr_complex((r7 * cos(-13 * GR_M_PI / 32.0)), (r7 * sin(-13 * GR_M_PI / 32.0))); - m_256apsk[182] = gr_complex((r7 * cos(-9 * GR_M_PI / 32.0)), (r7 * sin(-9 * GR_M_PI / 32.0))); - m_256apsk[183] = gr_complex((r7 * cos(-11 * GR_M_PI / 32.0)), (r7 * sin(-11 * GR_M_PI / 32.0))); - m_256apsk[184] = gr_complex((r7 * cos(33 * GR_M_PI / 32.0)), (r7 * sin(33 * GR_M_PI / 32.0))); - m_256apsk[185] = gr_complex((r7 * cos(35 * GR_M_PI / 32.0)), (r7 * sin(35 * GR_M_PI / 32.0))); - m_256apsk[186] = gr_complex((r7 * cos(39 * GR_M_PI / 32.0)), (r7 * sin(39 * GR_M_PI / 32.0))); - m_256apsk[187] = gr_complex((r7 * cos(37 * GR_M_PI / 32.0)), (r7 * sin(37 * GR_M_PI / 32.0))); - m_256apsk[188] = gr_complex((r7 * cos(47 * GR_M_PI / 32.0)), (r7 * sin(47 * GR_M_PI / 32.0))); - m_256apsk[189] = gr_complex((r7 * cos(45 * GR_M_PI / 32.0)), (r7 * sin(45 * GR_M_PI / 32.0))); - m_256apsk[190] = gr_complex((r7 * cos(41 * GR_M_PI / 32.0)), (r7 * sin(41 * GR_M_PI / 32.0))); - m_256apsk[191] = gr_complex((r7 * cos(43 * GR_M_PI / 32.0)), (r7 * sin(43 * GR_M_PI / 32.0))); - m_256apsk[192] = gr_complex((r5 * cos(GR_M_PI / 32.0)), (r5 * sin(GR_M_PI / 32.0))); - m_256apsk[193] = gr_complex((r5 * cos(3 * GR_M_PI / 32.0)), (r5 * sin(3 * GR_M_PI / 32.0))); - m_256apsk[194] = gr_complex((r5 * cos(7 * GR_M_PI / 32.0)), (r5 * sin(7 * GR_M_PI / 32.0))); - m_256apsk[195] = gr_complex((r5 * cos(5 * GR_M_PI / 32.0)), (r5 * sin(5 * GR_M_PI / 32.0))); - m_256apsk[196] = gr_complex((r5 * cos(15 * GR_M_PI / 32.0)), (r5 * sin(15 * GR_M_PI / 32.0))); - m_256apsk[197] = gr_complex((r5 * cos(13 * GR_M_PI / 32.0)), (r5 * sin(13 * GR_M_PI / 32.0))); - m_256apsk[198] = gr_complex((r5 * cos(9 * GR_M_PI / 32.0)), (r5 * sin(9 * GR_M_PI / 32.0))); - m_256apsk[199] = gr_complex((r5 * cos(11 * GR_M_PI / 32.0)), (r5 * sin(11 * GR_M_PI / 32.0))); - m_256apsk[200] = gr_complex((r5 * cos(31 * GR_M_PI / 32.0)), (r5 * sin(31 * GR_M_PI / 32.0))); - m_256apsk[201] = gr_complex((r5 * cos(29 * GR_M_PI / 32.0)), (r5 * sin(29 * GR_M_PI / 32.0))); - m_256apsk[202] = gr_complex((r5 * cos(25 * GR_M_PI / 32.0)), (r5 * sin(25 * GR_M_PI / 32.0))); - m_256apsk[203] = gr_complex((r5 * cos(27 * GR_M_PI / 32.0)), (r5 * sin(27 * GR_M_PI / 32.0))); - m_256apsk[204] = gr_complex((r5 * cos(17 * GR_M_PI / 32.0)), (r5 * sin(17 * GR_M_PI / 32.0))); - m_256apsk[205] = gr_complex((r5 * cos(19 * GR_M_PI / 32.0)), (r5 * sin(19 * GR_M_PI / 32.0))); - m_256apsk[206] = gr_complex((r5 * cos(23 * GR_M_PI / 32.0)), (r5 * sin(23 * GR_M_PI / 32.0))); - m_256apsk[207] = gr_complex((r5 * cos(21 * GR_M_PI / 32.0)), (r5 * sin(21 * GR_M_PI / 32.0))); - m_256apsk[208] = gr_complex((r5 * cos(-1 * GR_M_PI / 32.0)), (r5 * sin(-1 * GR_M_PI / 32.0))); - m_256apsk[209] = gr_complex((r5 * cos(-3 * GR_M_PI / 32.0)), (r5 * sin(-3 * GR_M_PI / 32.0))); - m_256apsk[210] = gr_complex((r5 * cos(-7 * GR_M_PI / 32.0)), (r5 * sin(-7 * GR_M_PI / 32.0))); - m_256apsk[211] = gr_complex((r5 * cos(-5 * GR_M_PI / 32.0)), (r5 * sin(-5 * GR_M_PI / 32.0))); - m_256apsk[212] = gr_complex((r5 * cos(-15 * GR_M_PI / 32.0)), (r5 * sin(-15 * GR_M_PI / 32.0))); - m_256apsk[213] = gr_complex((r5 * cos(-13 * GR_M_PI / 32.0)), (r5 * sin(-13 * GR_M_PI / 32.0))); - m_256apsk[214] = gr_complex((r5 * cos(-9 * GR_M_PI / 32.0)), (r5 * sin(-9 * GR_M_PI / 32.0))); - m_256apsk[215] = gr_complex((r5 * cos(-11 * GR_M_PI / 32.0)), (r5 * sin(-11 * GR_M_PI / 32.0))); - m_256apsk[216] = gr_complex((r5 * cos(33 * GR_M_PI / 32.0)), (r5 * sin(33 * GR_M_PI / 32.0))); - m_256apsk[217] = gr_complex((r5 * cos(35 * GR_M_PI / 32.0)), (r5 * sin(35 * GR_M_PI / 32.0))); - m_256apsk[218] = gr_complex((r5 * cos(39 * GR_M_PI / 32.0)), (r5 * sin(39 * GR_M_PI / 32.0))); - m_256apsk[219] = gr_complex((r5 * cos(37 * GR_M_PI / 32.0)), (r5 * sin(37 * GR_M_PI / 32.0))); - m_256apsk[220] = gr_complex((r5 * cos(47 * GR_M_PI / 32.0)), (r5 * sin(47 * GR_M_PI / 32.0))); - m_256apsk[221] = gr_complex((r5 * cos(45 * GR_M_PI / 32.0)), (r5 * sin(45 * GR_M_PI / 32.0))); - m_256apsk[222] = gr_complex((r5 * cos(41 * GR_M_PI / 32.0)), (r5 * sin(41 * GR_M_PI / 32.0))); - m_256apsk[223] = gr_complex((r5 * cos(43 * GR_M_PI / 32.0)), (r5 * sin(43 * GR_M_PI / 32.0))); - m_256apsk[224] = gr_complex((r6 * cos(GR_M_PI / 32.0)), (r6 * sin(GR_M_PI / 32.0))); - m_256apsk[225] = gr_complex((r6 * cos(3 * GR_M_PI / 32.0)), (r6 * sin(3 * GR_M_PI / 32.0))); - m_256apsk[226] = gr_complex((r6 * cos(7 * GR_M_PI / 32.0)), (r6 * sin(7 * GR_M_PI / 32.0))); - m_256apsk[227] = gr_complex((r6 * cos(5 * GR_M_PI / 32.0)), (r6 * sin(5 * GR_M_PI / 32.0))); - m_256apsk[228] = gr_complex((r6 * cos(15 * GR_M_PI / 32.0)), (r6 * sin(15 * GR_M_PI / 32.0))); - m_256apsk[229] = gr_complex((r6 * cos(13 * GR_M_PI / 32.0)), (r6 * sin(13 * GR_M_PI / 32.0))); - m_256apsk[230] = gr_complex((r6 * cos(9 * GR_M_PI / 32.0)), (r6 * sin(9 * GR_M_PI / 32.0))); - m_256apsk[231] = gr_complex((r6 * cos(11 * GR_M_PI / 32.0)), (r6 * sin(11 * GR_M_PI / 32.0))); - m_256apsk[232] = gr_complex((r6 * cos(31 * GR_M_PI / 32.0)), (r6 * sin(31 * GR_M_PI / 32.0))); - m_256apsk[233] = gr_complex((r6 * cos(29 * GR_M_PI / 32.0)), (r6 * sin(29 * GR_M_PI / 32.0))); - m_256apsk[234] = gr_complex((r6 * cos(25 * GR_M_PI / 32.0)), (r6 * sin(25 * GR_M_PI / 32.0))); - m_256apsk[235] = gr_complex((r6 * cos(27 * GR_M_PI / 32.0)), (r6 * sin(27 * GR_M_PI / 32.0))); - m_256apsk[236] = gr_complex((r6 * cos(17 * GR_M_PI / 32.0)), (r6 * sin(17 * GR_M_PI / 32.0))); - m_256apsk[237] = gr_complex((r6 * cos(19 * GR_M_PI / 32.0)), (r6 * sin(19 * GR_M_PI / 32.0))); - m_256apsk[238] = gr_complex((r6 * cos(23 * GR_M_PI / 32.0)), (r6 * sin(23 * GR_M_PI / 32.0))); - m_256apsk[239] = gr_complex((r6 * cos(21 * GR_M_PI / 32.0)), (r6 * sin(21 * GR_M_PI / 32.0))); - m_256apsk[240] = gr_complex((r6 * cos(-1 * GR_M_PI / 32.0)), (r6 * sin(-1 * GR_M_PI / 32.0))); - m_256apsk[241] = gr_complex((r6 * cos(-3 * GR_M_PI / 32.0)), (r6 * sin(-3 * GR_M_PI / 32.0))); - m_256apsk[242] = gr_complex((r6 * cos(-7 * GR_M_PI / 32.0)), (r6 * sin(-7 * GR_M_PI / 32.0))); - m_256apsk[243] = gr_complex((r6 * cos(-5 * GR_M_PI / 32.0)), (r6 * sin(-5 * GR_M_PI / 32.0))); - m_256apsk[244] = gr_complex((r6 * cos(-15 * GR_M_PI / 32.0)), (r6 * sin(-15 * GR_M_PI / 32.0))); - m_256apsk[245] = gr_complex((r6 * cos(-13 * GR_M_PI / 32.0)), (r6 * sin(-13 * GR_M_PI / 32.0))); - m_256apsk[246] = gr_complex((r6 * cos(-9 * GR_M_PI / 32.0)), (r6 * sin(-9 * GR_M_PI / 32.0))); - m_256apsk[247] = gr_complex((r6 * cos(-11 * GR_M_PI / 32.0)), (r6 * sin(-11 * GR_M_PI / 32.0))); - m_256apsk[248] = gr_complex((r6 * cos(33 * GR_M_PI / 32.0)), (r6 * sin(33 * GR_M_PI / 32.0))); - m_256apsk[249] = gr_complex((r6 * cos(35 * GR_M_PI / 32.0)), (r6 * sin(35 * GR_M_PI / 32.0))); - m_256apsk[250] = gr_complex((r6 * cos(39 * GR_M_PI / 32.0)), (r6 * sin(39 * GR_M_PI / 32.0))); - m_256apsk[251] = gr_complex((r6 * cos(37 * GR_M_PI / 32.0)), (r6 * sin(37 * GR_M_PI / 32.0))); - m_256apsk[252] = gr_complex((r6 * cos(47 * GR_M_PI / 32.0)), (r6 * sin(47 * GR_M_PI / 32.0))); - m_256apsk[253] = gr_complex((r6 * cos(45 * GR_M_PI / 32.0)), (r6 * sin(45 * GR_M_PI / 32.0))); - m_256apsk[254] = gr_complex((r6 * cos(41 * GR_M_PI / 32.0)), (r6 * sin(41 * GR_M_PI / 32.0))); - m_256apsk[255] = gr_complex((r6 * cos(43 * GR_M_PI / 32.0)), (r6 * sin(43 * GR_M_PI / 32.0))); - } - break; - case MOD_64QAM: - m_64apsk[0] = gr_complex( 1.0, 1.0); - m_64apsk[1] = gr_complex( 1.0, -1.0); - m_64apsk[2] = gr_complex( 1.0, -3.0); - m_64apsk[3] = gr_complex( -3.0, -1.0); - m_64apsk[4] = gr_complex( -3.0, 1.0); - m_64apsk[5] = gr_complex( 1.0, 3.0); - m_64apsk[6] = gr_complex( -3.0, -3.0); - m_64apsk[7] = gr_complex( -3.0, 3.0); - m_64apsk[8] = gr_complex( -1.0, 1.0); - m_64apsk[9] = gr_complex( -1.0, -1.0); - m_64apsk[10] = gr_complex( 3.0, 1.0); - m_64apsk[11] = gr_complex(-1.0, 3.0); - m_64apsk[12] = gr_complex(-1.0, -3.0); - m_64apsk[13] = gr_complex( 3.0, -1.0); - m_64apsk[14] = gr_complex( 3.0, -3.0); - m_64apsk[15] = gr_complex( 3.0, 3.0); - m_64apsk[16] = gr_complex( 5.0, 1.0); - m_64apsk[17] = gr_complex( 1.0, -5.0); - m_64apsk[18] = gr_complex( 1.0, -7.0); - m_64apsk[19] = gr_complex(-7.0, -1.0); - m_64apsk[20] = gr_complex(-3.0, 5.0); - m_64apsk[21] = gr_complex( 5.0, 3.0); - m_64apsk[22] = gr_complex(-7.0, -3.0); - m_64apsk[23] = gr_complex(-3.0, 7.0); - m_64apsk[24] = gr_complex(-1.0, 5.0); - m_64apsk[25] = gr_complex(-5.0, -1.0); - m_64apsk[26] = gr_complex( 7.0, 1.0); - m_64apsk[27] = gr_complex(-1.0, 7.0); - m_64apsk[28] = gr_complex(-5.0, -3.0); - m_64apsk[29] = gr_complex( 3.0, -5.0); - m_64apsk[30] = gr_complex( 3.0, -7.0); - m_64apsk[31] = gr_complex( 7.0, 3.0); - m_64apsk[32] = gr_complex( 1.0, 5.0); - m_64apsk[33] = gr_complex( 5.0, -1.0); - m_64apsk[34] = gr_complex( 5.0, -3.0); - m_64apsk[35] = gr_complex(-3.0, -5.0); - m_64apsk[36] = gr_complex(-7.0, 1.0); - m_64apsk[37] = gr_complex( 1.0, 7.0); - m_64apsk[38] = gr_complex(-3.0, -7.0); - m_64apsk[39] = gr_complex(-7.0, 3.0); - m_64apsk[40] = gr_complex(-5.0, 1.0); - m_64apsk[41] = gr_complex(-1.0, -5.0); - m_64apsk[42] = gr_complex( 3.0, 5.0); - m_64apsk[43] = gr_complex(-5.0, 3.0); - m_64apsk[44] = gr_complex(-1.0, -7.0); - m_64apsk[45] = gr_complex( 7.0, -1.0); - m_64apsk[46] = gr_complex( 7.0, -3.0); - m_64apsk[47] = gr_complex( 3.0, 7.0); - m_64apsk[48] = gr_complex( 5.0, 5.0); - m_64apsk[49] = gr_complex( 5.0, -5.0); - m_64apsk[50] = gr_complex( 5.0, -7.0); - m_64apsk[51] = gr_complex(-7.0, -5.0); - m_64apsk[52] = gr_complex(-7.0, 5.0); - m_64apsk[53] = gr_complex( 5.0, 7.0); - m_64apsk[54] = gr_complex(-7.0, -7.0); - m_64apsk[55] = gr_complex(-7.0, 7.0); - m_64apsk[56] = gr_complex(-5.0, 5.0); - m_64apsk[57] = gr_complex(-5.0, -5.0); - m_64apsk[58] = gr_complex( 7.0, 5.0); - m_64apsk[59] = gr_complex(-5.0, 7.0); - m_64apsk[60] = gr_complex(-5.0, -7.0); - m_64apsk[61] = gr_complex( 7.0, -5.0); - m_64apsk[62] = gr_complex( 7.0, -7.0); - m_64apsk[63] = gr_complex( 7.0, 7.0); - break; - case MOD_256QAM: - m_256apsk[0] = gr_complex( 1.0, 1.0); - m_256apsk[1] = gr_complex( 1.0, -1.0); - m_256apsk[2] = gr_complex( -3.0, 1.0); - m_256apsk[3] = gr_complex( 1.0, 3.0); - m_256apsk[4] = gr_complex( 1.0, 5.0); - m_256apsk[5] = gr_complex( 5.0, -1.0); - m_256apsk[6] = gr_complex( -7.0, 1.0); - m_256apsk[7] = gr_complex( 1.0, 7.0); - m_256apsk[8] = gr_complex( 1.0, 9.0); - m_256apsk[9] = gr_complex( 9.0, -1.0); - m_256apsk[10] = gr_complex( -11.0, 1.0); - m_256apsk[11] = gr_complex( 1.0, 11.0); - m_256apsk[12] = gr_complex( 1.0, 13.0); - m_256apsk[13] = gr_complex( 13.0, -1.0); - m_256apsk[14] = gr_complex( -15.0, 1.0); - m_256apsk[15] = gr_complex( 1.0, 15.0); - m_256apsk[16] = gr_complex( -1.0, 1.0); - m_256apsk[17] = gr_complex( -1.0, -1.0); - m_256apsk[18] = gr_complex( -1.0, -3.0); - m_256apsk[19] = gr_complex( 3.0, -1.0); - m_256apsk[20] = gr_complex( -5.0, 1.0); - m_256apsk[21] = gr_complex( -1.0, -5.0); - m_256apsk[22] = gr_complex( -1.0, -7.0); - m_256apsk[23] = gr_complex( 7.0, -1.0); - m_256apsk[24] = gr_complex( -9.0, 1.0); - m_256apsk[25] = gr_complex( -1.0, -9.0); - m_256apsk[26] = gr_complex( -1.0, -11.0); - m_256apsk[27] = gr_complex( 11.0, -1.0); - m_256apsk[28] = gr_complex( -13.0, 1.0); - m_256apsk[29] = gr_complex( -1.0, -13.0); - m_256apsk[30] = gr_complex( -1.0, -15.0); - m_256apsk[31] = gr_complex( 15.0, -1.0); - m_256apsk[32] = gr_complex( 1.0, -3.0); - m_256apsk[33] = gr_complex( -3.0, -1.0); - m_256apsk[34] = gr_complex( -3.0, -3.0); - m_256apsk[35] = gr_complex( -3.0, 3.0); - m_256apsk[36] = gr_complex( 5.0, -3.0); - m_256apsk[37] = gr_complex( -3.0, -5.0); - m_256apsk[38] = gr_complex( -3.0, -7.0); - m_256apsk[39] = gr_complex( -7.0, 3.0); - m_256apsk[40] = gr_complex( 9.0, -3.0); - m_256apsk[41] = gr_complex( -3.0, -9.0); - m_256apsk[42] = gr_complex( -3.0, -11.0); - m_256apsk[43] = gr_complex( -11.0, 3.0); - m_256apsk[44] = gr_complex( 13.0, -3.0); - m_256apsk[45] = gr_complex( -3.0, -13.0); - m_256apsk[46] = gr_complex( -3.0, -15.0); - m_256apsk[47] = gr_complex( -15.0, 3.0); - m_256apsk[48] = gr_complex( 3.0, 1.0); - m_256apsk[49] = gr_complex( -1.0, 3.0); - m_256apsk[50] = gr_complex( 3.0, -3.0); - m_256apsk[51] = gr_complex( 3.0, 3.0); - m_256apsk[52] = gr_complex( 3.0, 5.0); - m_256apsk[53] = gr_complex( -5.0, 3.0); - m_256apsk[54] = gr_complex( 7.0, -3.0); - m_256apsk[55] = gr_complex( 3.0, 7.0); - m_256apsk[56] = gr_complex( 3.0, 9.0); - m_256apsk[57] = gr_complex( -9.0, 3.0); - m_256apsk[58] = gr_complex( 11.0, -3.0); - m_256apsk[59] = gr_complex( 3.0, 11.0); - m_256apsk[60] = gr_complex( 3.0, 13.0); - m_256apsk[61] = gr_complex( -13.0, 3.0); - m_256apsk[62] = gr_complex( 15.0, -3.0); - m_256apsk[63] = gr_complex( 3.0, 15.0); - m_256apsk[64] = gr_complex( 5.0, 1.0); - m_256apsk[65] = gr_complex( 1.0, -5.0); - m_256apsk[66] = gr_complex( -3.0, 5.0); - m_256apsk[67] = gr_complex( 5.0, 3.0); - m_256apsk[68] = gr_complex( 5.0, 5.0); - m_256apsk[69] = gr_complex( 5.0, -5.0); - m_256apsk[70] = gr_complex( -7.0, 5.0); - m_256apsk[71] = gr_complex( 5.0, 7.0); - m_256apsk[72] = gr_complex( 5.0, 9.0); - m_256apsk[73] = gr_complex( 9.0, -5.0); - m_256apsk[74] = gr_complex( -11.0, 5.0); - m_256apsk[75] = gr_complex( 5.0, 11.0); - m_256apsk[76] = gr_complex( 5.0, 13.0); - m_256apsk[77] = gr_complex( 13.0, -5.0); - m_256apsk[78] = gr_complex( -15.0, 5.0); - m_256apsk[79] = gr_complex( 5.0, 15.0); - m_256apsk[80] = gr_complex( -1.0, 5.0); - m_256apsk[81] = gr_complex( -5.0, -1.0); - m_256apsk[82] = gr_complex( -5.0, -3.0); - m_256apsk[83] = gr_complex( 3.0, -5.0); - m_256apsk[84] = gr_complex( -5.0, 5.0); - m_256apsk[85] = gr_complex( -5.0, -5.0); - m_256apsk[86] = gr_complex( -5.0, -7.0); - m_256apsk[87] = gr_complex( 7.0, -5.0); - m_256apsk[88] = gr_complex( -9.0, 5.0); - m_256apsk[89] = gr_complex( -5.0, -9.0); - m_256apsk[90] = gr_complex( -5.0, -11.0); - m_256apsk[91] = gr_complex( 11.0, -5.0); - m_256apsk[92] = gr_complex( -13.0, 5.0); - m_256apsk[93] = gr_complex( -5.0, -13.0); - m_256apsk[94] = gr_complex( -5.0, -15.0); - m_256apsk[95] = gr_complex( 15.0, -5.0); - m_256apsk[96] = gr_complex( 1.0, -7.0); - m_256apsk[97] = gr_complex( -7.0, -1.0); - m_256apsk[98] = gr_complex( -7.0, -3.0); - m_256apsk[99] = gr_complex( -3.0, 7.0); - m_256apsk[100] = gr_complex( 5.0, -7.0); - m_256apsk[101] = gr_complex( -7.0, -5.0); - m_256apsk[102] = gr_complex( -7.0, -7.0); - m_256apsk[103] = gr_complex( -7.0, 7.0); - m_256apsk[104] = gr_complex( 9.0, -7.0); - m_256apsk[105] = gr_complex( -7.0, -9.0); - m_256apsk[106] = gr_complex( -7.0, -11.0); - m_256apsk[107] = gr_complex(-11.0, 7.0); - m_256apsk[108] = gr_complex( 13.0, -7.0); - m_256apsk[109] = gr_complex( -7.0, -13.0); - m_256apsk[110] = gr_complex( -7.0, -15.0); - m_256apsk[111] = gr_complex(-15.0, 7.0); - m_256apsk[112] = gr_complex( 7.0, 1.0); - m_256apsk[113] = gr_complex( -1.0, 7.0); - m_256apsk[114] = gr_complex( 3.0, -7.0); - m_256apsk[115] = gr_complex( 7.0, 3.0); - m_256apsk[116] = gr_complex( 7.0, 5.0); - m_256apsk[117] = gr_complex( -5.0, 7.0); - m_256apsk[118] = gr_complex( 7.0, -7.0); - m_256apsk[119] = gr_complex( 7.0, 7.0); - m_256apsk[120] = gr_complex( 7.0, 9.0); - m_256apsk[121] = gr_complex( -9.0, 7.0); - m_256apsk[122] = gr_complex( 11.0, -7.0); - m_256apsk[123] = gr_complex( 7.0, 11.0); - m_256apsk[124] = gr_complex( 7.0, 13.0); - m_256apsk[125] = gr_complex(-13.0, 7.0); - m_256apsk[126] = gr_complex( 15.0, -7.0); - m_256apsk[127] = gr_complex( 7.0, 15.0); - m_256apsk[128] = gr_complex( 9.0, 1.0); - m_256apsk[129] = gr_complex( 1.0, -9.0); - m_256apsk[130] = gr_complex( -3.0, 9.0); - m_256apsk[131] = gr_complex( 9.0, 3.0); - m_256apsk[132] = gr_complex( 9.0, 5.0); - m_256apsk[133] = gr_complex( 5.0, -9.0); - m_256apsk[134] = gr_complex( -7.0, 9.0); - m_256apsk[135] = gr_complex( 9.0, 7.0); - m_256apsk[136] = gr_complex( 9.0, 9.0); - m_256apsk[137] = gr_complex( 9.0, -9.0); - m_256apsk[138] = gr_complex(-11.0, 9.0); - m_256apsk[139] = gr_complex( 9.0, 11.0); - m_256apsk[140] = gr_complex( 9.0, 13.0); - m_256apsk[141] = gr_complex( 13.0, -9.0); - m_256apsk[142] = gr_complex(-15.0, 9.0); - m_256apsk[143] = gr_complex( 9.0, 15.0); - m_256apsk[144] = gr_complex( -1.0, 9.0); - m_256apsk[145] = gr_complex( -9.0, -1.0); - m_256apsk[146] = gr_complex( -9.0, -3.0); - m_256apsk[147] = gr_complex( 3.0, -9.0); - m_256apsk[148] = gr_complex( -5.0, 9.0); - m_256apsk[149] = gr_complex( -9.0, -5.0); - m_256apsk[150] = gr_complex( -9.0, -7.0); - m_256apsk[151] = gr_complex( 7.0, -9.0); - m_256apsk[152] = gr_complex( -9.0, 9.0); - m_256apsk[153] = gr_complex( -9.0, -9.0); - m_256apsk[154] = gr_complex( -9.0, -11.0); - m_256apsk[155] = gr_complex( 11.0, -9.0); - m_256apsk[156] = gr_complex(-13.0, 9.0); - m_256apsk[157] = gr_complex( -9.0, -13.0); - m_256apsk[158] = gr_complex( -9.0, -15.0); - m_256apsk[159] = gr_complex( 15.0, -9.0); - m_256apsk[160] = gr_complex( 1.0, -11.0); - m_256apsk[161] = gr_complex(-11.0, -1.0); - m_256apsk[162] = gr_complex(-11.0, -3.0); - m_256apsk[163] = gr_complex( -3.0, 11.0); - m_256apsk[164] = gr_complex( 5.0, -11.0); - m_256apsk[165] = gr_complex(-11.0, -5.0); - m_256apsk[166] = gr_complex(-11.0, -7.0); - m_256apsk[167] = gr_complex( -7.0, 11.0); - m_256apsk[168] = gr_complex( 9.0, -11.0); - m_256apsk[169] = gr_complex(-11.0, -9.0); - m_256apsk[170] = gr_complex(-11.0, -11.0); - m_256apsk[171] = gr_complex(-11.0, 11.0); - m_256apsk[172] = gr_complex( 13.0, -11.0); - m_256apsk[173] = gr_complex(-11.0, -13.0); - m_256apsk[174] = gr_complex(-11.0, -15.0); - m_256apsk[175] = gr_complex(-15.0, 11.0); - m_256apsk[176] = gr_complex( 11.0, 1.0); - m_256apsk[177] = gr_complex( -1.0, 11.0); - m_256apsk[178] = gr_complex( 3.0, -11.0); - m_256apsk[179] = gr_complex( 11.0, 3.0); - m_256apsk[180] = gr_complex( 11.0, 5.0); - m_256apsk[181] = gr_complex( -5.0, 11.0); - m_256apsk[182] = gr_complex( 7.0, -11.0); - m_256apsk[183] = gr_complex( 11.0, 7.0); - m_256apsk[184] = gr_complex( 11.0, 9.0); - m_256apsk[185] = gr_complex( -9.0, 11.0); - m_256apsk[186] = gr_complex( 11.0, -11.0); - m_256apsk[187] = gr_complex( 11.0, 11.0); - m_256apsk[188] = gr_complex( 11.0, 13.0); - m_256apsk[189] = gr_complex(-13.0, 11.0); - m_256apsk[190] = gr_complex( 15.0, -11.0); - m_256apsk[191] = gr_complex( 11.0, 15.0); - m_256apsk[192] = gr_complex( 13.0, 1.0); - m_256apsk[193] = gr_complex( 1.0, -13.0); - m_256apsk[194] = gr_complex( -3.0, 13.0); - m_256apsk[195] = gr_complex( 13.0, 3.0); - m_256apsk[196] = gr_complex( 13.0, 5.0); - m_256apsk[197] = gr_complex( 5.0, -13.0); - m_256apsk[198] = gr_complex( -7.0, 13.0); - m_256apsk[199] = gr_complex( 13.0, 7.0); - m_256apsk[200] = gr_complex( 13.0, 9.0); - m_256apsk[201] = gr_complex( 9.0, -13.0); - m_256apsk[202] = gr_complex(-11.0, 13.0); - m_256apsk[203] = gr_complex( 13.0, 11.0); - m_256apsk[204] = gr_complex( 13.0, 13.0); - m_256apsk[205] = gr_complex( 13.0, -13.0); - m_256apsk[206] = gr_complex(-15.0, 13.0); - m_256apsk[207] = gr_complex( 13.0, 15.0); - m_256apsk[208] = gr_complex( -1.0, 13.0); - m_256apsk[209] = gr_complex(-13.0, -1.0); - m_256apsk[210] = gr_complex(-13.0, -3.0); - m_256apsk[211] = gr_complex( 3.0, -13.0); - m_256apsk[212] = gr_complex( -5.0, 13.0); - m_256apsk[213] = gr_complex(-13.0, -5.0); - m_256apsk[214] = gr_complex(-13.0, -7.0); - m_256apsk[215] = gr_complex( 7.0, -13.0); - m_256apsk[216] = gr_complex( -9.0, 13.0); - m_256apsk[217] = gr_complex(-13.0, -9.0); - m_256apsk[218] = gr_complex(-13.0, -11.0); - m_256apsk[219] = gr_complex( 11.0, -13.0); - m_256apsk[220] = gr_complex(-13.0, 13.0); - m_256apsk[221] = gr_complex(-13.0, -13.0); - m_256apsk[222] = gr_complex(-13.0, -15.0); - m_256apsk[223] = gr_complex( 15.0, -13.0); - m_256apsk[224] = gr_complex( 1.0, -15.0); - m_256apsk[225] = gr_complex(-15.0, -1.0); - m_256apsk[226] = gr_complex(-15.0, -3.0); - m_256apsk[227] = gr_complex( -3.0, 15.0); - m_256apsk[228] = gr_complex( 5.0, -15.0); - m_256apsk[229] = gr_complex(-15.0, -5.0); - m_256apsk[230] = gr_complex(-15.0, -7.0); - m_256apsk[231] = gr_complex( -7.0, 15.0); - m_256apsk[232] = gr_complex( 9.0, -15.0); - m_256apsk[233] = gr_complex(-15.0, -9.0); - m_256apsk[234] = gr_complex(-15.0, -11.0); - m_256apsk[235] = gr_complex(-11.0, 15.0); - m_256apsk[236] = gr_complex( 13.0, -15.0); - m_256apsk[237] = gr_complex(-15.0, -13.0); - m_256apsk[238] = gr_complex(-15.0, -15.0); - m_256apsk[239] = gr_complex(-15.0, 15.0); - m_256apsk[240] = gr_complex( 15.0, 1.0); - m_256apsk[241] = gr_complex( -1.0, 15.0); - m_256apsk[242] = gr_complex( 3.0, -15.0); - m_256apsk[243] = gr_complex( 15.0, 3.0); - m_256apsk[244] = gr_complex( 15.0, 5.0); - m_256apsk[245] = gr_complex( -5.0, 15.0); - m_256apsk[246] = gr_complex( 7.0, -15.0); - m_256apsk[247] = gr_complex( 15.0, 7.0); - m_256apsk[248] = gr_complex( 15.0, 9.0); - m_256apsk[249] = gr_complex( -9.0, 15.0); - m_256apsk[250] = gr_complex( 11.0, -15.0); - m_256apsk[251] = gr_complex( 15.0, 11.0); - m_256apsk[252] = gr_complex( 15.0, 13.0); - m_256apsk[253] = gr_complex(-13.0, 15.0); - m_256apsk[254] = gr_complex( 15.0, -15.0); - m_256apsk[255] = gr_complex( 15.0, 15.0); - break; - case MOD_8VSB: - m_8psk[0] = gr_complex(-7.0 + 1.25, 0.0); - m_8psk[1] = gr_complex(-5.0 + 1.25, 0.0); - m_8psk[2] = gr_complex(-3.0 + 1.25, 0.0); - m_8psk[3] = gr_complex(-1.0 + 1.25, 0.0); - m_8psk[4] = gr_complex( 1.0 + 1.25, 0.0); - m_8psk[5] = gr_complex( 3.0 + 1.25, 0.0); - m_8psk[6] = gr_complex( 5.0 + 1.25, 0.0); - m_8psk[7] = gr_complex( 7.0 + 1.25, 0.0); - break; - default: - m_qpsk[0] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); - m_qpsk[1] = gr_complex((r1 * cos(7 * GR_M_PI / 4.0)), (r1 * sin(7 * GR_M_PI / 4.0))); - m_qpsk[2] = gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); - m_qpsk[3] = gr_complex((r1 * cos(5 * GR_M_PI / 4.0)), (r1 * sin(5 * GR_M_PI / 4.0))); - break; - } - signal_constellation = constellation; - signal_interpolation = interpolation; - set_output_multiple(2); + m_256apsk[0] = + gr_complex((r1 * cos(GR_M_PI / 32.0)), (r1 * sin(GR_M_PI / 32.0))); + m_256apsk[1] = gr_complex((r1 * cos(3 * GR_M_PI / 32.0)), + (r1 * sin(3 * GR_M_PI / 32.0))); + m_256apsk[2] = gr_complex((r1 * cos(7 * GR_M_PI / 32.0)), + (r1 * sin(7 * GR_M_PI / 32.0))); + m_256apsk[3] = gr_complex((r1 * cos(5 * GR_M_PI / 32.0)), + (r1 * sin(5 * GR_M_PI / 32.0))); + m_256apsk[4] = gr_complex((r1 * cos(15 * GR_M_PI / 32.0)), + (r1 * sin(15 * GR_M_PI / 32.0))); + m_256apsk[5] = gr_complex((r1 * cos(13 * GR_M_PI / 32.0)), + (r1 * sin(13 * GR_M_PI / 32.0))); + m_256apsk[6] = gr_complex((r1 * cos(9 * GR_M_PI / 32.0)), + (r1 * sin(9 * GR_M_PI / 32.0))); + m_256apsk[7] = gr_complex((r1 * cos(11 * GR_M_PI / 32.0)), + (r1 * sin(11 * GR_M_PI / 32.0))); + m_256apsk[8] = gr_complex((r1 * cos(31 * GR_M_PI / 32.0)), + (r1 * sin(31 * GR_M_PI / 32.0))); + m_256apsk[9] = gr_complex((r1 * cos(29 * GR_M_PI / 32.0)), + (r1 * sin(29 * GR_M_PI / 32.0))); + m_256apsk[10] = gr_complex((r1 * cos(25 * GR_M_PI / 32.0)), + (r1 * sin(25 * GR_M_PI / 32.0))); + m_256apsk[11] = gr_complex((r1 * cos(27 * GR_M_PI / 32.0)), + (r1 * sin(27 * GR_M_PI / 32.0))); + m_256apsk[12] = gr_complex((r1 * cos(17 * GR_M_PI / 32.0)), + (r1 * sin(17 * GR_M_PI / 32.0))); + m_256apsk[13] = gr_complex((r1 * cos(19 * GR_M_PI / 32.0)), + (r1 * sin(19 * GR_M_PI / 32.0))); + m_256apsk[14] = gr_complex((r1 * cos(23 * GR_M_PI / 32.0)), + (r1 * sin(23 * GR_M_PI / 32.0))); + m_256apsk[15] = gr_complex((r1 * cos(21 * GR_M_PI / 32.0)), + (r1 * sin(21 * GR_M_PI / 32.0))); + m_256apsk[16] = gr_complex((r1 * cos(-1 * GR_M_PI / 32.0)), + (r1 * sin(-1 * GR_M_PI / 32.0))); + m_256apsk[17] = gr_complex((r1 * cos(-3 * GR_M_PI / 32.0)), + (r1 * sin(-3 * GR_M_PI / 32.0))); + m_256apsk[18] = gr_complex((r1 * cos(-7 * GR_M_PI / 32.0)), + (r1 * sin(-7 * GR_M_PI / 32.0))); + m_256apsk[19] = gr_complex((r1 * cos(-5 * GR_M_PI / 32.0)), + (r1 * sin(-5 * GR_M_PI / 32.0))); + m_256apsk[20] = gr_complex((r1 * cos(-15 * GR_M_PI / 32.0)), + (r1 * sin(-15 * GR_M_PI / 32.0))); + m_256apsk[21] = gr_complex((r1 * cos(-13 * GR_M_PI / 32.0)), + (r1 * sin(-13 * GR_M_PI / 32.0))); + m_256apsk[22] = gr_complex((r1 * cos(-9 * GR_M_PI / 32.0)), + (r1 * sin(-9 * GR_M_PI / 32.0))); + m_256apsk[23] = gr_complex((r1 * cos(-11 * GR_M_PI / 32.0)), + (r1 * sin(-11 * GR_M_PI / 32.0))); + m_256apsk[24] = gr_complex((r1 * cos(33 * GR_M_PI / 32.0)), + (r1 * sin(33 * GR_M_PI / 32.0))); + m_256apsk[25] = gr_complex((r1 * cos(35 * GR_M_PI / 32.0)), + (r1 * sin(35 * GR_M_PI / 32.0))); + m_256apsk[26] = gr_complex((r1 * cos(39 * GR_M_PI / 32.0)), + (r1 * sin(39 * GR_M_PI / 32.0))); + m_256apsk[27] = gr_complex((r1 * cos(37 * GR_M_PI / 32.0)), + (r1 * sin(37 * GR_M_PI / 32.0))); + m_256apsk[28] = gr_complex((r1 * cos(47 * GR_M_PI / 32.0)), + (r1 * sin(47 * GR_M_PI / 32.0))); + m_256apsk[29] = gr_complex((r1 * cos(45 * GR_M_PI / 32.0)), + (r1 * sin(45 * GR_M_PI / 32.0))); + m_256apsk[30] = gr_complex((r1 * cos(41 * GR_M_PI / 32.0)), + (r1 * sin(41 * GR_M_PI / 32.0))); + m_256apsk[31] = gr_complex((r1 * cos(43 * GR_M_PI / 32.0)), + (r1 * sin(43 * GR_M_PI / 32.0))); + m_256apsk[32] = + gr_complex((r2 * cos(GR_M_PI / 32.0)), (r2 * sin(GR_M_PI / 32.0))); + m_256apsk[33] = gr_complex((r2 * cos(3 * GR_M_PI / 32.0)), + (r2 * sin(3 * GR_M_PI / 32.0))); + m_256apsk[34] = gr_complex((r2 * cos(7 * GR_M_PI / 32.0)), + (r2 * sin(7 * GR_M_PI / 32.0))); + m_256apsk[35] = gr_complex((r2 * cos(5 * GR_M_PI / 32.0)), + (r2 * sin(5 * GR_M_PI / 32.0))); + m_256apsk[36] = gr_complex((r2 * cos(15 * GR_M_PI / 32.0)), + (r2 * sin(15 * GR_M_PI / 32.0))); + m_256apsk[37] = gr_complex((r2 * cos(13 * GR_M_PI / 32.0)), + (r2 * sin(13 * GR_M_PI / 32.0))); + m_256apsk[38] = gr_complex((r2 * cos(9 * GR_M_PI / 32.0)), + (r2 * sin(9 * GR_M_PI / 32.0))); + m_256apsk[39] = gr_complex((r2 * cos(11 * GR_M_PI / 32.0)), + (r2 * sin(11 * GR_M_PI / 32.0))); + m_256apsk[40] = gr_complex((r2 * cos(31 * GR_M_PI / 32.0)), + (r2 * sin(31 * GR_M_PI / 32.0))); + m_256apsk[41] = gr_complex((r2 * cos(29 * GR_M_PI / 32.0)), + (r2 * sin(29 * GR_M_PI / 32.0))); + m_256apsk[42] = gr_complex((r2 * cos(25 * GR_M_PI / 32.0)), + (r2 * sin(25 * GR_M_PI / 32.0))); + m_256apsk[43] = gr_complex((r2 * cos(27 * GR_M_PI / 32.0)), + (r2 * sin(27 * GR_M_PI / 32.0))); + m_256apsk[44] = gr_complex((r2 * cos(17 * GR_M_PI / 32.0)), + (r2 * sin(17 * GR_M_PI / 32.0))); + m_256apsk[45] = gr_complex((r2 * cos(19 * GR_M_PI / 32.0)), + (r2 * sin(19 * GR_M_PI / 32.0))); + m_256apsk[46] = gr_complex((r2 * cos(23 * GR_M_PI / 32.0)), + (r2 * sin(23 * GR_M_PI / 32.0))); + m_256apsk[47] = gr_complex((r2 * cos(21 * GR_M_PI / 32.0)), + (r2 * sin(21 * GR_M_PI / 32.0))); + m_256apsk[48] = gr_complex((r2 * cos(-1 * GR_M_PI / 32.0)), + (r2 * sin(-1 * GR_M_PI / 32.0))); + m_256apsk[49] = gr_complex((r2 * cos(-3 * GR_M_PI / 32.0)), + (r2 * sin(-3 * GR_M_PI / 32.0))); + m_256apsk[50] = gr_complex((r2 * cos(-7 * GR_M_PI / 32.0)), + (r2 * sin(-7 * GR_M_PI / 32.0))); + m_256apsk[51] = gr_complex((r2 * cos(-5 * GR_M_PI / 32.0)), + (r2 * sin(-5 * GR_M_PI / 32.0))); + m_256apsk[52] = gr_complex((r2 * cos(-15 * GR_M_PI / 32.0)), + (r2 * sin(-15 * GR_M_PI / 32.0))); + m_256apsk[53] = gr_complex((r2 * cos(-13 * GR_M_PI / 32.0)), + (r2 * sin(-13 * GR_M_PI / 32.0))); + m_256apsk[54] = gr_complex((r2 * cos(-9 * GR_M_PI / 32.0)), + (r2 * sin(-9 * GR_M_PI / 32.0))); + m_256apsk[55] = gr_complex((r2 * cos(-11 * GR_M_PI / 32.0)), + (r2 * sin(-11 * GR_M_PI / 32.0))); + m_256apsk[56] = gr_complex((r2 * cos(33 * GR_M_PI / 32.0)), + (r2 * sin(33 * GR_M_PI / 32.0))); + m_256apsk[57] = gr_complex((r2 * cos(35 * GR_M_PI / 32.0)), + (r2 * sin(35 * GR_M_PI / 32.0))); + m_256apsk[58] = gr_complex((r2 * cos(39 * GR_M_PI / 32.0)), + (r2 * sin(39 * GR_M_PI / 32.0))); + m_256apsk[59] = gr_complex((r2 * cos(37 * GR_M_PI / 32.0)), + (r2 * sin(37 * GR_M_PI / 32.0))); + m_256apsk[60] = gr_complex((r2 * cos(47 * GR_M_PI / 32.0)), + (r2 * sin(47 * GR_M_PI / 32.0))); + m_256apsk[61] = gr_complex((r2 * cos(45 * GR_M_PI / 32.0)), + (r2 * sin(45 * GR_M_PI / 32.0))); + m_256apsk[62] = gr_complex((r2 * cos(41 * GR_M_PI / 32.0)), + (r2 * sin(41 * GR_M_PI / 32.0))); + m_256apsk[63] = gr_complex((r2 * cos(43 * GR_M_PI / 32.0)), + (r2 * sin(43 * GR_M_PI / 32.0))); + m_256apsk[64] = + gr_complex((r4 * cos(GR_M_PI / 32.0)), (r4 * sin(GR_M_PI / 32.0))); + m_256apsk[65] = gr_complex((r4 * cos(3 * GR_M_PI / 32.0)), + (r4 * sin(3 * GR_M_PI / 32.0))); + m_256apsk[66] = gr_complex((r4 * cos(7 * GR_M_PI / 32.0)), + (r4 * sin(7 * GR_M_PI / 32.0))); + m_256apsk[67] = gr_complex((r4 * cos(5 * GR_M_PI / 32.0)), + (r4 * sin(5 * GR_M_PI / 32.0))); + m_256apsk[68] = gr_complex((r4 * cos(15 * GR_M_PI / 32.0)), + (r4 * sin(15 * GR_M_PI / 32.0))); + m_256apsk[69] = gr_complex((r4 * cos(13 * GR_M_PI / 32.0)), + (r4 * sin(13 * GR_M_PI / 32.0))); + m_256apsk[70] = gr_complex((r4 * cos(9 * GR_M_PI / 32.0)), + (r4 * sin(9 * GR_M_PI / 32.0))); + m_256apsk[71] = gr_complex((r4 * cos(11 * GR_M_PI / 32.0)), + (r4 * sin(11 * GR_M_PI / 32.0))); + m_256apsk[72] = gr_complex((r4 * cos(31 * GR_M_PI / 32.0)), + (r4 * sin(31 * GR_M_PI / 32.0))); + m_256apsk[73] = gr_complex((r4 * cos(29 * GR_M_PI / 32.0)), + (r4 * sin(29 * GR_M_PI / 32.0))); + m_256apsk[74] = gr_complex((r4 * cos(25 * GR_M_PI / 32.0)), + (r4 * sin(25 * GR_M_PI / 32.0))); + m_256apsk[75] = gr_complex((r4 * cos(27 * GR_M_PI / 32.0)), + (r4 * sin(27 * GR_M_PI / 32.0))); + m_256apsk[76] = gr_complex((r4 * cos(17 * GR_M_PI / 32.0)), + (r4 * sin(17 * GR_M_PI / 32.0))); + m_256apsk[77] = gr_complex((r4 * cos(19 * GR_M_PI / 32.0)), + (r4 * sin(19 * GR_M_PI / 32.0))); + m_256apsk[78] = gr_complex((r4 * cos(23 * GR_M_PI / 32.0)), + (r4 * sin(23 * GR_M_PI / 32.0))); + m_256apsk[79] = gr_complex((r4 * cos(21 * GR_M_PI / 32.0)), + (r4 * sin(21 * GR_M_PI / 32.0))); + m_256apsk[80] = gr_complex((r4 * cos(-1 * GR_M_PI / 32.0)), + (r4 * sin(-1 * GR_M_PI / 32.0))); + m_256apsk[81] = gr_complex((r4 * cos(-3 * GR_M_PI / 32.0)), + (r4 * sin(-3 * GR_M_PI / 32.0))); + m_256apsk[82] = gr_complex((r4 * cos(-7 * GR_M_PI / 32.0)), + (r4 * sin(-7 * GR_M_PI / 32.0))); + m_256apsk[83] = gr_complex((r4 * cos(-5 * GR_M_PI / 32.0)), + (r4 * sin(-5 * GR_M_PI / 32.0))); + m_256apsk[84] = gr_complex((r4 * cos(-15 * GR_M_PI / 32.0)), + (r4 * sin(-15 * GR_M_PI / 32.0))); + m_256apsk[85] = gr_complex((r4 * cos(-13 * GR_M_PI / 32.0)), + (r4 * sin(-13 * GR_M_PI / 32.0))); + m_256apsk[86] = gr_complex((r4 * cos(-9 * GR_M_PI / 32.0)), + (r4 * sin(-9 * GR_M_PI / 32.0))); + m_256apsk[87] = gr_complex((r4 * cos(-11 * GR_M_PI / 32.0)), + (r4 * sin(-11 * GR_M_PI / 32.0))); + m_256apsk[88] = gr_complex((r4 * cos(33 * GR_M_PI / 32.0)), + (r4 * sin(33 * GR_M_PI / 32.0))); + m_256apsk[89] = gr_complex((r4 * cos(35 * GR_M_PI / 32.0)), + (r4 * sin(35 * GR_M_PI / 32.0))); + m_256apsk[90] = gr_complex((r4 * cos(39 * GR_M_PI / 32.0)), + (r4 * sin(39 * GR_M_PI / 32.0))); + m_256apsk[91] = gr_complex((r4 * cos(37 * GR_M_PI / 32.0)), + (r4 * sin(37 * GR_M_PI / 32.0))); + m_256apsk[92] = gr_complex((r4 * cos(47 * GR_M_PI / 32.0)), + (r4 * sin(47 * GR_M_PI / 32.0))); + m_256apsk[93] = gr_complex((r4 * cos(45 * GR_M_PI / 32.0)), + (r4 * sin(45 * GR_M_PI / 32.0))); + m_256apsk[94] = gr_complex((r4 * cos(41 * GR_M_PI / 32.0)), + (r4 * sin(41 * GR_M_PI / 32.0))); + m_256apsk[95] = gr_complex((r4 * cos(43 * GR_M_PI / 32.0)), + (r4 * sin(43 * GR_M_PI / 32.0))); + m_256apsk[96] = + gr_complex((r3 * cos(GR_M_PI / 32.0)), (r3 * sin(GR_M_PI / 32.0))); + m_256apsk[97] = gr_complex((r3 * cos(3 * GR_M_PI / 32.0)), + (r3 * sin(3 * GR_M_PI / 32.0))); + m_256apsk[98] = gr_complex((r3 * cos(7 * GR_M_PI / 32.0)), + (r3 * sin(7 * GR_M_PI / 32.0))); + m_256apsk[99] = gr_complex((r3 * cos(5 * GR_M_PI / 32.0)), + (r3 * sin(5 * GR_M_PI / 32.0))); + m_256apsk[100] = gr_complex((r3 * cos(15 * GR_M_PI / 32.0)), + (r3 * sin(15 * GR_M_PI / 32.0))); + m_256apsk[101] = gr_complex((r3 * cos(13 * GR_M_PI / 32.0)), + (r3 * sin(13 * GR_M_PI / 32.0))); + m_256apsk[102] = gr_complex((r3 * cos(9 * GR_M_PI / 32.0)), + (r3 * sin(9 * GR_M_PI / 32.0))); + m_256apsk[103] = gr_complex((r3 * cos(11 * GR_M_PI / 32.0)), + (r3 * sin(11 * GR_M_PI / 32.0))); + m_256apsk[104] = gr_complex((r3 * cos(31 * GR_M_PI / 32.0)), + (r3 * sin(31 * GR_M_PI / 32.0))); + m_256apsk[105] = gr_complex((r3 * cos(29 * GR_M_PI / 32.0)), + (r3 * sin(29 * GR_M_PI / 32.0))); + m_256apsk[106] = gr_complex((r3 * cos(25 * GR_M_PI / 32.0)), + (r3 * sin(25 * GR_M_PI / 32.0))); + m_256apsk[107] = gr_complex((r3 * cos(27 * GR_M_PI / 32.0)), + (r3 * sin(27 * GR_M_PI / 32.0))); + m_256apsk[108] = gr_complex((r3 * cos(17 * GR_M_PI / 32.0)), + (r3 * sin(17 * GR_M_PI / 32.0))); + m_256apsk[109] = gr_complex((r3 * cos(19 * GR_M_PI / 32.0)), + (r3 * sin(19 * GR_M_PI / 32.0))); + m_256apsk[110] = gr_complex((r3 * cos(23 * GR_M_PI / 32.0)), + (r3 * sin(23 * GR_M_PI / 32.0))); + m_256apsk[111] = gr_complex((r3 * cos(21 * GR_M_PI / 32.0)), + (r3 * sin(21 * GR_M_PI / 32.0))); + m_256apsk[112] = gr_complex((r3 * cos(-1 * GR_M_PI / 32.0)), + (r3 * sin(-1 * GR_M_PI / 32.0))); + m_256apsk[113] = gr_complex((r3 * cos(-3 * GR_M_PI / 32.0)), + (r3 * sin(-3 * GR_M_PI / 32.0))); + m_256apsk[114] = gr_complex((r3 * cos(-7 * GR_M_PI / 32.0)), + (r3 * sin(-7 * GR_M_PI / 32.0))); + m_256apsk[115] = gr_complex((r3 * cos(-5 * GR_M_PI / 32.0)), + (r3 * sin(-5 * GR_M_PI / 32.0))); + m_256apsk[116] = gr_complex((r3 * cos(-15 * GR_M_PI / 32.0)), + (r3 * sin(-15 * GR_M_PI / 32.0))); + m_256apsk[117] = gr_complex((r3 * cos(-13 * GR_M_PI / 32.0)), + (r3 * sin(-13 * GR_M_PI / 32.0))); + m_256apsk[118] = gr_complex((r3 * cos(-9 * GR_M_PI / 32.0)), + (r3 * sin(-9 * GR_M_PI / 32.0))); + m_256apsk[119] = gr_complex((r3 * cos(-11 * GR_M_PI / 32.0)), + (r3 * sin(-11 * GR_M_PI / 32.0))); + m_256apsk[120] = gr_complex((r3 * cos(33 * GR_M_PI / 32.0)), + (r3 * sin(33 * GR_M_PI / 32.0))); + m_256apsk[121] = gr_complex((r3 * cos(35 * GR_M_PI / 32.0)), + (r3 * sin(35 * GR_M_PI / 32.0))); + m_256apsk[122] = gr_complex((r3 * cos(39 * GR_M_PI / 32.0)), + (r3 * sin(39 * GR_M_PI / 32.0))); + m_256apsk[123] = gr_complex((r3 * cos(37 * GR_M_PI / 32.0)), + (r3 * sin(37 * GR_M_PI / 32.0))); + m_256apsk[124] = gr_complex((r3 * cos(47 * GR_M_PI / 32.0)), + (r3 * sin(47 * GR_M_PI / 32.0))); + m_256apsk[125] = gr_complex((r3 * cos(45 * GR_M_PI / 32.0)), + (r3 * sin(45 * GR_M_PI / 32.0))); + m_256apsk[126] = gr_complex((r3 * cos(41 * GR_M_PI / 32.0)), + (r3 * sin(41 * GR_M_PI / 32.0))); + m_256apsk[127] = gr_complex((r3 * cos(43 * GR_M_PI / 32.0)), + (r3 * sin(43 * GR_M_PI / 32.0))); + m_256apsk[128] = + gr_complex((r8 * cos(GR_M_PI / 32.0)), (r8 * sin(GR_M_PI / 32.0))); + m_256apsk[129] = gr_complex((r8 * cos(3 * GR_M_PI / 32.0)), + (r8 * sin(3 * GR_M_PI / 32.0))); + m_256apsk[130] = gr_complex((r8 * cos(7 * GR_M_PI / 32.0)), + (r8 * sin(7 * GR_M_PI / 32.0))); + m_256apsk[131] = gr_complex((r8 * cos(5 * GR_M_PI / 32.0)), + (r8 * sin(5 * GR_M_PI / 32.0))); + m_256apsk[132] = gr_complex((r8 * cos(15 * GR_M_PI / 32.0)), + (r8 * sin(15 * GR_M_PI / 32.0))); + m_256apsk[133] = gr_complex((r8 * cos(13 * GR_M_PI / 32.0)), + (r8 * sin(13 * GR_M_PI / 32.0))); + m_256apsk[134] = gr_complex((r8 * cos(9 * GR_M_PI / 32.0)), + (r8 * sin(9 * GR_M_PI / 32.0))); + m_256apsk[135] = gr_complex((r8 * cos(11 * GR_M_PI / 32.0)), + (r8 * sin(11 * GR_M_PI / 32.0))); + m_256apsk[136] = gr_complex((r8 * cos(31 * GR_M_PI / 32.0)), + (r8 * sin(31 * GR_M_PI / 32.0))); + m_256apsk[137] = gr_complex((r8 * cos(29 * GR_M_PI / 32.0)), + (r8 * sin(29 * GR_M_PI / 32.0))); + m_256apsk[138] = gr_complex((r8 * cos(25 * GR_M_PI / 32.0)), + (r8 * sin(25 * GR_M_PI / 32.0))); + m_256apsk[139] = gr_complex((r8 * cos(27 * GR_M_PI / 32.0)), + (r8 * sin(27 * GR_M_PI / 32.0))); + m_256apsk[140] = gr_complex((r8 * cos(17 * GR_M_PI / 32.0)), + (r8 * sin(17 * GR_M_PI / 32.0))); + m_256apsk[141] = gr_complex((r8 * cos(19 * GR_M_PI / 32.0)), + (r8 * sin(19 * GR_M_PI / 32.0))); + m_256apsk[142] = gr_complex((r8 * cos(23 * GR_M_PI / 32.0)), + (r8 * sin(23 * GR_M_PI / 32.0))); + m_256apsk[143] = gr_complex((r8 * cos(21 * GR_M_PI / 32.0)), + (r8 * sin(21 * GR_M_PI / 32.0))); + m_256apsk[144] = gr_complex((r8 * cos(-1 * GR_M_PI / 32.0)), + (r8 * sin(-1 * GR_M_PI / 32.0))); + m_256apsk[145] = gr_complex((r8 * cos(-3 * GR_M_PI / 32.0)), + (r8 * sin(-3 * GR_M_PI / 32.0))); + m_256apsk[146] = gr_complex((r8 * cos(-7 * GR_M_PI / 32.0)), + (r8 * sin(-7 * GR_M_PI / 32.0))); + m_256apsk[147] = gr_complex((r8 * cos(-5 * GR_M_PI / 32.0)), + (r8 * sin(-5 * GR_M_PI / 32.0))); + m_256apsk[148] = gr_complex((r8 * cos(-15 * GR_M_PI / 32.0)), + (r8 * sin(-15 * GR_M_PI / 32.0))); + m_256apsk[149] = gr_complex((r8 * cos(-13 * GR_M_PI / 32.0)), + (r8 * sin(-13 * GR_M_PI / 32.0))); + m_256apsk[150] = gr_complex((r8 * cos(-9 * GR_M_PI / 32.0)), + (r8 * sin(-9 * GR_M_PI / 32.0))); + m_256apsk[151] = gr_complex((r8 * cos(-11 * GR_M_PI / 32.0)), + (r8 * sin(-11 * GR_M_PI / 32.0))); + m_256apsk[152] = gr_complex((r8 * cos(33 * GR_M_PI / 32.0)), + (r8 * sin(33 * GR_M_PI / 32.0))); + m_256apsk[153] = gr_complex((r8 * cos(35 * GR_M_PI / 32.0)), + (r8 * sin(35 * GR_M_PI / 32.0))); + m_256apsk[154] = gr_complex((r8 * cos(39 * GR_M_PI / 32.0)), + (r8 * sin(39 * GR_M_PI / 32.0))); + m_256apsk[155] = gr_complex((r8 * cos(37 * GR_M_PI / 32.0)), + (r8 * sin(37 * GR_M_PI / 32.0))); + m_256apsk[156] = gr_complex((r8 * cos(47 * GR_M_PI / 32.0)), + (r8 * sin(47 * GR_M_PI / 32.0))); + m_256apsk[157] = gr_complex((r8 * cos(45 * GR_M_PI / 32.0)), + (r8 * sin(45 * GR_M_PI / 32.0))); + m_256apsk[158] = gr_complex((r8 * cos(41 * GR_M_PI / 32.0)), + (r8 * sin(41 * GR_M_PI / 32.0))); + m_256apsk[159] = gr_complex((r8 * cos(43 * GR_M_PI / 32.0)), + (r8 * sin(43 * GR_M_PI / 32.0))); + m_256apsk[160] = + gr_complex((r7 * cos(GR_M_PI / 32.0)), (r7 * sin(GR_M_PI / 32.0))); + m_256apsk[161] = gr_complex((r7 * cos(3 * GR_M_PI / 32.0)), + (r7 * sin(3 * GR_M_PI / 32.0))); + m_256apsk[162] = gr_complex((r7 * cos(7 * GR_M_PI / 32.0)), + (r7 * sin(7 * GR_M_PI / 32.0))); + m_256apsk[163] = gr_complex((r7 * cos(5 * GR_M_PI / 32.0)), + (r7 * sin(5 * GR_M_PI / 32.0))); + m_256apsk[164] = gr_complex((r7 * cos(15 * GR_M_PI / 32.0)), + (r7 * sin(15 * GR_M_PI / 32.0))); + m_256apsk[165] = gr_complex((r7 * cos(13 * GR_M_PI / 32.0)), + (r7 * sin(13 * GR_M_PI / 32.0))); + m_256apsk[166] = gr_complex((r7 * cos(9 * GR_M_PI / 32.0)), + (r7 * sin(9 * GR_M_PI / 32.0))); + m_256apsk[167] = gr_complex((r7 * cos(11 * GR_M_PI / 32.0)), + (r7 * sin(11 * GR_M_PI / 32.0))); + m_256apsk[168] = gr_complex((r7 * cos(31 * GR_M_PI / 32.0)), + (r7 * sin(31 * GR_M_PI / 32.0))); + m_256apsk[169] = gr_complex((r7 * cos(29 * GR_M_PI / 32.0)), + (r7 * sin(29 * GR_M_PI / 32.0))); + m_256apsk[170] = gr_complex((r7 * cos(25 * GR_M_PI / 32.0)), + (r7 * sin(25 * GR_M_PI / 32.0))); + m_256apsk[171] = gr_complex((r7 * cos(27 * GR_M_PI / 32.0)), + (r7 * sin(27 * GR_M_PI / 32.0))); + m_256apsk[172] = gr_complex((r7 * cos(17 * GR_M_PI / 32.0)), + (r7 * sin(17 * GR_M_PI / 32.0))); + m_256apsk[173] = gr_complex((r7 * cos(19 * GR_M_PI / 32.0)), + (r7 * sin(19 * GR_M_PI / 32.0))); + m_256apsk[174] = gr_complex((r7 * cos(23 * GR_M_PI / 32.0)), + (r7 * sin(23 * GR_M_PI / 32.0))); + m_256apsk[175] = gr_complex((r7 * cos(21 * GR_M_PI / 32.0)), + (r7 * sin(21 * GR_M_PI / 32.0))); + m_256apsk[176] = gr_complex((r7 * cos(-1 * GR_M_PI / 32.0)), + (r7 * sin(-1 * GR_M_PI / 32.0))); + m_256apsk[177] = gr_complex((r7 * cos(-3 * GR_M_PI / 32.0)), + (r7 * sin(-3 * GR_M_PI / 32.0))); + m_256apsk[178] = gr_complex((r7 * cos(-7 * GR_M_PI / 32.0)), + (r7 * sin(-7 * GR_M_PI / 32.0))); + m_256apsk[179] = gr_complex((r7 * cos(-5 * GR_M_PI / 32.0)), + (r7 * sin(-5 * GR_M_PI / 32.0))); + m_256apsk[180] = gr_complex((r7 * cos(-15 * GR_M_PI / 32.0)), + (r7 * sin(-15 * GR_M_PI / 32.0))); + m_256apsk[181] = gr_complex((r7 * cos(-13 * GR_M_PI / 32.0)), + (r7 * sin(-13 * GR_M_PI / 32.0))); + m_256apsk[182] = gr_complex((r7 * cos(-9 * GR_M_PI / 32.0)), + (r7 * sin(-9 * GR_M_PI / 32.0))); + m_256apsk[183] = gr_complex((r7 * cos(-11 * GR_M_PI / 32.0)), + (r7 * sin(-11 * GR_M_PI / 32.0))); + m_256apsk[184] = gr_complex((r7 * cos(33 * GR_M_PI / 32.0)), + (r7 * sin(33 * GR_M_PI / 32.0))); + m_256apsk[185] = gr_complex((r7 * cos(35 * GR_M_PI / 32.0)), + (r7 * sin(35 * GR_M_PI / 32.0))); + m_256apsk[186] = gr_complex((r7 * cos(39 * GR_M_PI / 32.0)), + (r7 * sin(39 * GR_M_PI / 32.0))); + m_256apsk[187] = gr_complex((r7 * cos(37 * GR_M_PI / 32.0)), + (r7 * sin(37 * GR_M_PI / 32.0))); + m_256apsk[188] = gr_complex((r7 * cos(47 * GR_M_PI / 32.0)), + (r7 * sin(47 * GR_M_PI / 32.0))); + m_256apsk[189] = gr_complex((r7 * cos(45 * GR_M_PI / 32.0)), + (r7 * sin(45 * GR_M_PI / 32.0))); + m_256apsk[190] = gr_complex((r7 * cos(41 * GR_M_PI / 32.0)), + (r7 * sin(41 * GR_M_PI / 32.0))); + m_256apsk[191] = gr_complex((r7 * cos(43 * GR_M_PI / 32.0)), + (r7 * sin(43 * GR_M_PI / 32.0))); + m_256apsk[192] = + gr_complex((r5 * cos(GR_M_PI / 32.0)), (r5 * sin(GR_M_PI / 32.0))); + m_256apsk[193] = gr_complex((r5 * cos(3 * GR_M_PI / 32.0)), + (r5 * sin(3 * GR_M_PI / 32.0))); + m_256apsk[194] = gr_complex((r5 * cos(7 * GR_M_PI / 32.0)), + (r5 * sin(7 * GR_M_PI / 32.0))); + m_256apsk[195] = gr_complex((r5 * cos(5 * GR_M_PI / 32.0)), + (r5 * sin(5 * GR_M_PI / 32.0))); + m_256apsk[196] = gr_complex((r5 * cos(15 * GR_M_PI / 32.0)), + (r5 * sin(15 * GR_M_PI / 32.0))); + m_256apsk[197] = gr_complex((r5 * cos(13 * GR_M_PI / 32.0)), + (r5 * sin(13 * GR_M_PI / 32.0))); + m_256apsk[198] = gr_complex((r5 * cos(9 * GR_M_PI / 32.0)), + (r5 * sin(9 * GR_M_PI / 32.0))); + m_256apsk[199] = gr_complex((r5 * cos(11 * GR_M_PI / 32.0)), + (r5 * sin(11 * GR_M_PI / 32.0))); + m_256apsk[200] = gr_complex((r5 * cos(31 * GR_M_PI / 32.0)), + (r5 * sin(31 * GR_M_PI / 32.0))); + m_256apsk[201] = gr_complex((r5 * cos(29 * GR_M_PI / 32.0)), + (r5 * sin(29 * GR_M_PI / 32.0))); + m_256apsk[202] = gr_complex((r5 * cos(25 * GR_M_PI / 32.0)), + (r5 * sin(25 * GR_M_PI / 32.0))); + m_256apsk[203] = gr_complex((r5 * cos(27 * GR_M_PI / 32.0)), + (r5 * sin(27 * GR_M_PI / 32.0))); + m_256apsk[204] = gr_complex((r5 * cos(17 * GR_M_PI / 32.0)), + (r5 * sin(17 * GR_M_PI / 32.0))); + m_256apsk[205] = gr_complex((r5 * cos(19 * GR_M_PI / 32.0)), + (r5 * sin(19 * GR_M_PI / 32.0))); + m_256apsk[206] = gr_complex((r5 * cos(23 * GR_M_PI / 32.0)), + (r5 * sin(23 * GR_M_PI / 32.0))); + m_256apsk[207] = gr_complex((r5 * cos(21 * GR_M_PI / 32.0)), + (r5 * sin(21 * GR_M_PI / 32.0))); + m_256apsk[208] = gr_complex((r5 * cos(-1 * GR_M_PI / 32.0)), + (r5 * sin(-1 * GR_M_PI / 32.0))); + m_256apsk[209] = gr_complex((r5 * cos(-3 * GR_M_PI / 32.0)), + (r5 * sin(-3 * GR_M_PI / 32.0))); + m_256apsk[210] = gr_complex((r5 * cos(-7 * GR_M_PI / 32.0)), + (r5 * sin(-7 * GR_M_PI / 32.0))); + m_256apsk[211] = gr_complex((r5 * cos(-5 * GR_M_PI / 32.0)), + (r5 * sin(-5 * GR_M_PI / 32.0))); + m_256apsk[212] = gr_complex((r5 * cos(-15 * GR_M_PI / 32.0)), + (r5 * sin(-15 * GR_M_PI / 32.0))); + m_256apsk[213] = gr_complex((r5 * cos(-13 * GR_M_PI / 32.0)), + (r5 * sin(-13 * GR_M_PI / 32.0))); + m_256apsk[214] = gr_complex((r5 * cos(-9 * GR_M_PI / 32.0)), + (r5 * sin(-9 * GR_M_PI / 32.0))); + m_256apsk[215] = gr_complex((r5 * cos(-11 * GR_M_PI / 32.0)), + (r5 * sin(-11 * GR_M_PI / 32.0))); + m_256apsk[216] = gr_complex((r5 * cos(33 * GR_M_PI / 32.0)), + (r5 * sin(33 * GR_M_PI / 32.0))); + m_256apsk[217] = gr_complex((r5 * cos(35 * GR_M_PI / 32.0)), + (r5 * sin(35 * GR_M_PI / 32.0))); + m_256apsk[218] = gr_complex((r5 * cos(39 * GR_M_PI / 32.0)), + (r5 * sin(39 * GR_M_PI / 32.0))); + m_256apsk[219] = gr_complex((r5 * cos(37 * GR_M_PI / 32.0)), + (r5 * sin(37 * GR_M_PI / 32.0))); + m_256apsk[220] = gr_complex((r5 * cos(47 * GR_M_PI / 32.0)), + (r5 * sin(47 * GR_M_PI / 32.0))); + m_256apsk[221] = gr_complex((r5 * cos(45 * GR_M_PI / 32.0)), + (r5 * sin(45 * GR_M_PI / 32.0))); + m_256apsk[222] = gr_complex((r5 * cos(41 * GR_M_PI / 32.0)), + (r5 * sin(41 * GR_M_PI / 32.0))); + m_256apsk[223] = gr_complex((r5 * cos(43 * GR_M_PI / 32.0)), + (r5 * sin(43 * GR_M_PI / 32.0))); + m_256apsk[224] = + gr_complex((r6 * cos(GR_M_PI / 32.0)), (r6 * sin(GR_M_PI / 32.0))); + m_256apsk[225] = gr_complex((r6 * cos(3 * GR_M_PI / 32.0)), + (r6 * sin(3 * GR_M_PI / 32.0))); + m_256apsk[226] = gr_complex((r6 * cos(7 * GR_M_PI / 32.0)), + (r6 * sin(7 * GR_M_PI / 32.0))); + m_256apsk[227] = gr_complex((r6 * cos(5 * GR_M_PI / 32.0)), + (r6 * sin(5 * GR_M_PI / 32.0))); + m_256apsk[228] = gr_complex((r6 * cos(15 * GR_M_PI / 32.0)), + (r6 * sin(15 * GR_M_PI / 32.0))); + m_256apsk[229] = gr_complex((r6 * cos(13 * GR_M_PI / 32.0)), + (r6 * sin(13 * GR_M_PI / 32.0))); + m_256apsk[230] = gr_complex((r6 * cos(9 * GR_M_PI / 32.0)), + (r6 * sin(9 * GR_M_PI / 32.0))); + m_256apsk[231] = gr_complex((r6 * cos(11 * GR_M_PI / 32.0)), + (r6 * sin(11 * GR_M_PI / 32.0))); + m_256apsk[232] = gr_complex((r6 * cos(31 * GR_M_PI / 32.0)), + (r6 * sin(31 * GR_M_PI / 32.0))); + m_256apsk[233] = gr_complex((r6 * cos(29 * GR_M_PI / 32.0)), + (r6 * sin(29 * GR_M_PI / 32.0))); + m_256apsk[234] = gr_complex((r6 * cos(25 * GR_M_PI / 32.0)), + (r6 * sin(25 * GR_M_PI / 32.0))); + m_256apsk[235] = gr_complex((r6 * cos(27 * GR_M_PI / 32.0)), + (r6 * sin(27 * GR_M_PI / 32.0))); + m_256apsk[236] = gr_complex((r6 * cos(17 * GR_M_PI / 32.0)), + (r6 * sin(17 * GR_M_PI / 32.0))); + m_256apsk[237] = gr_complex((r6 * cos(19 * GR_M_PI / 32.0)), + (r6 * sin(19 * GR_M_PI / 32.0))); + m_256apsk[238] = gr_complex((r6 * cos(23 * GR_M_PI / 32.0)), + (r6 * sin(23 * GR_M_PI / 32.0))); + m_256apsk[239] = gr_complex((r6 * cos(21 * GR_M_PI / 32.0)), + (r6 * sin(21 * GR_M_PI / 32.0))); + m_256apsk[240] = gr_complex((r6 * cos(-1 * GR_M_PI / 32.0)), + (r6 * sin(-1 * GR_M_PI / 32.0))); + m_256apsk[241] = gr_complex((r6 * cos(-3 * GR_M_PI / 32.0)), + (r6 * sin(-3 * GR_M_PI / 32.0))); + m_256apsk[242] = gr_complex((r6 * cos(-7 * GR_M_PI / 32.0)), + (r6 * sin(-7 * GR_M_PI / 32.0))); + m_256apsk[243] = gr_complex((r6 * cos(-5 * GR_M_PI / 32.0)), + (r6 * sin(-5 * GR_M_PI / 32.0))); + m_256apsk[244] = gr_complex((r6 * cos(-15 * GR_M_PI / 32.0)), + (r6 * sin(-15 * GR_M_PI / 32.0))); + m_256apsk[245] = gr_complex((r6 * cos(-13 * GR_M_PI / 32.0)), + (r6 * sin(-13 * GR_M_PI / 32.0))); + m_256apsk[246] = gr_complex((r6 * cos(-9 * GR_M_PI / 32.0)), + (r6 * sin(-9 * GR_M_PI / 32.0))); + m_256apsk[247] = gr_complex((r6 * cos(-11 * GR_M_PI / 32.0)), + (r6 * sin(-11 * GR_M_PI / 32.0))); + m_256apsk[248] = gr_complex((r6 * cos(33 * GR_M_PI / 32.0)), + (r6 * sin(33 * GR_M_PI / 32.0))); + m_256apsk[249] = gr_complex((r6 * cos(35 * GR_M_PI / 32.0)), + (r6 * sin(35 * GR_M_PI / 32.0))); + m_256apsk[250] = gr_complex((r6 * cos(39 * GR_M_PI / 32.0)), + (r6 * sin(39 * GR_M_PI / 32.0))); + m_256apsk[251] = gr_complex((r6 * cos(37 * GR_M_PI / 32.0)), + (r6 * sin(37 * GR_M_PI / 32.0))); + m_256apsk[252] = gr_complex((r6 * cos(47 * GR_M_PI / 32.0)), + (r6 * sin(47 * GR_M_PI / 32.0))); + m_256apsk[253] = gr_complex((r6 * cos(45 * GR_M_PI / 32.0)), + (r6 * sin(45 * GR_M_PI / 32.0))); + m_256apsk[254] = gr_complex((r6 * cos(41 * GR_M_PI / 32.0)), + (r6 * sin(41 * GR_M_PI / 32.0))); + m_256apsk[255] = gr_complex((r6 * cos(43 * GR_M_PI / 32.0)), + (r6 * sin(43 * GR_M_PI / 32.0))); + } + break; + case MOD_64QAM: + m_64apsk[0] = gr_complex(1.0, 1.0); + m_64apsk[1] = gr_complex(1.0, -1.0); + m_64apsk[2] = gr_complex(1.0, -3.0); + m_64apsk[3] = gr_complex(-3.0, -1.0); + m_64apsk[4] = gr_complex(-3.0, 1.0); + m_64apsk[5] = gr_complex(1.0, 3.0); + m_64apsk[6] = gr_complex(-3.0, -3.0); + m_64apsk[7] = gr_complex(-3.0, 3.0); + m_64apsk[8] = gr_complex(-1.0, 1.0); + m_64apsk[9] = gr_complex(-1.0, -1.0); + m_64apsk[10] = gr_complex(3.0, 1.0); + m_64apsk[11] = gr_complex(-1.0, 3.0); + m_64apsk[12] = gr_complex(-1.0, -3.0); + m_64apsk[13] = gr_complex(3.0, -1.0); + m_64apsk[14] = gr_complex(3.0, -3.0); + m_64apsk[15] = gr_complex(3.0, 3.0); + m_64apsk[16] = gr_complex(5.0, 1.0); + m_64apsk[17] = gr_complex(1.0, -5.0); + m_64apsk[18] = gr_complex(1.0, -7.0); + m_64apsk[19] = gr_complex(-7.0, -1.0); + m_64apsk[20] = gr_complex(-3.0, 5.0); + m_64apsk[21] = gr_complex(5.0, 3.0); + m_64apsk[22] = gr_complex(-7.0, -3.0); + m_64apsk[23] = gr_complex(-3.0, 7.0); + m_64apsk[24] = gr_complex(-1.0, 5.0); + m_64apsk[25] = gr_complex(-5.0, -1.0); + m_64apsk[26] = gr_complex(7.0, 1.0); + m_64apsk[27] = gr_complex(-1.0, 7.0); + m_64apsk[28] = gr_complex(-5.0, -3.0); + m_64apsk[29] = gr_complex(3.0, -5.0); + m_64apsk[30] = gr_complex(3.0, -7.0); + m_64apsk[31] = gr_complex(7.0, 3.0); + m_64apsk[32] = gr_complex(1.0, 5.0); + m_64apsk[33] = gr_complex(5.0, -1.0); + m_64apsk[34] = gr_complex(5.0, -3.0); + m_64apsk[35] = gr_complex(-3.0, -5.0); + m_64apsk[36] = gr_complex(-7.0, 1.0); + m_64apsk[37] = gr_complex(1.0, 7.0); + m_64apsk[38] = gr_complex(-3.0, -7.0); + m_64apsk[39] = gr_complex(-7.0, 3.0); + m_64apsk[40] = gr_complex(-5.0, 1.0); + m_64apsk[41] = gr_complex(-1.0, -5.0); + m_64apsk[42] = gr_complex(3.0, 5.0); + m_64apsk[43] = gr_complex(-5.0, 3.0); + m_64apsk[44] = gr_complex(-1.0, -7.0); + m_64apsk[45] = gr_complex(7.0, -1.0); + m_64apsk[46] = gr_complex(7.0, -3.0); + m_64apsk[47] = gr_complex(3.0, 7.0); + m_64apsk[48] = gr_complex(5.0, 5.0); + m_64apsk[49] = gr_complex(5.0, -5.0); + m_64apsk[50] = gr_complex(5.0, -7.0); + m_64apsk[51] = gr_complex(-7.0, -5.0); + m_64apsk[52] = gr_complex(-7.0, 5.0); + m_64apsk[53] = gr_complex(5.0, 7.0); + m_64apsk[54] = gr_complex(-7.0, -7.0); + m_64apsk[55] = gr_complex(-7.0, 7.0); + m_64apsk[56] = gr_complex(-5.0, 5.0); + m_64apsk[57] = gr_complex(-5.0, -5.0); + m_64apsk[58] = gr_complex(7.0, 5.0); + m_64apsk[59] = gr_complex(-5.0, 7.0); + m_64apsk[60] = gr_complex(-5.0, -7.0); + m_64apsk[61] = gr_complex(7.0, -5.0); + m_64apsk[62] = gr_complex(7.0, -7.0); + m_64apsk[63] = gr_complex(7.0, 7.0); + break; + case MOD_256QAM: + m_256apsk[0] = gr_complex(1.0, 1.0); + m_256apsk[1] = gr_complex(1.0, -1.0); + m_256apsk[2] = gr_complex(-3.0, 1.0); + m_256apsk[3] = gr_complex(1.0, 3.0); + m_256apsk[4] = gr_complex(1.0, 5.0); + m_256apsk[5] = gr_complex(5.0, -1.0); + m_256apsk[6] = gr_complex(-7.0, 1.0); + m_256apsk[7] = gr_complex(1.0, 7.0); + m_256apsk[8] = gr_complex(1.0, 9.0); + m_256apsk[9] = gr_complex(9.0, -1.0); + m_256apsk[10] = gr_complex(-11.0, 1.0); + m_256apsk[11] = gr_complex(1.0, 11.0); + m_256apsk[12] = gr_complex(1.0, 13.0); + m_256apsk[13] = gr_complex(13.0, -1.0); + m_256apsk[14] = gr_complex(-15.0, 1.0); + m_256apsk[15] = gr_complex(1.0, 15.0); + m_256apsk[16] = gr_complex(-1.0, 1.0); + m_256apsk[17] = gr_complex(-1.0, -1.0); + m_256apsk[18] = gr_complex(-1.0, -3.0); + m_256apsk[19] = gr_complex(3.0, -1.0); + m_256apsk[20] = gr_complex(-5.0, 1.0); + m_256apsk[21] = gr_complex(-1.0, -5.0); + m_256apsk[22] = gr_complex(-1.0, -7.0); + m_256apsk[23] = gr_complex(7.0, -1.0); + m_256apsk[24] = gr_complex(-9.0, 1.0); + m_256apsk[25] = gr_complex(-1.0, -9.0); + m_256apsk[26] = gr_complex(-1.0, -11.0); + m_256apsk[27] = gr_complex(11.0, -1.0); + m_256apsk[28] = gr_complex(-13.0, 1.0); + m_256apsk[29] = gr_complex(-1.0, -13.0); + m_256apsk[30] = gr_complex(-1.0, -15.0); + m_256apsk[31] = gr_complex(15.0, -1.0); + m_256apsk[32] = gr_complex(1.0, -3.0); + m_256apsk[33] = gr_complex(-3.0, -1.0); + m_256apsk[34] = gr_complex(-3.0, -3.0); + m_256apsk[35] = gr_complex(-3.0, 3.0); + m_256apsk[36] = gr_complex(5.0, -3.0); + m_256apsk[37] = gr_complex(-3.0, -5.0); + m_256apsk[38] = gr_complex(-3.0, -7.0); + m_256apsk[39] = gr_complex(-7.0, 3.0); + m_256apsk[40] = gr_complex(9.0, -3.0); + m_256apsk[41] = gr_complex(-3.0, -9.0); + m_256apsk[42] = gr_complex(-3.0, -11.0); + m_256apsk[43] = gr_complex(-11.0, 3.0); + m_256apsk[44] = gr_complex(13.0, -3.0); + m_256apsk[45] = gr_complex(-3.0, -13.0); + m_256apsk[46] = gr_complex(-3.0, -15.0); + m_256apsk[47] = gr_complex(-15.0, 3.0); + m_256apsk[48] = gr_complex(3.0, 1.0); + m_256apsk[49] = gr_complex(-1.0, 3.0); + m_256apsk[50] = gr_complex(3.0, -3.0); + m_256apsk[51] = gr_complex(3.0, 3.0); + m_256apsk[52] = gr_complex(3.0, 5.0); + m_256apsk[53] = gr_complex(-5.0, 3.0); + m_256apsk[54] = gr_complex(7.0, -3.0); + m_256apsk[55] = gr_complex(3.0, 7.0); + m_256apsk[56] = gr_complex(3.0, 9.0); + m_256apsk[57] = gr_complex(-9.0, 3.0); + m_256apsk[58] = gr_complex(11.0, -3.0); + m_256apsk[59] = gr_complex(3.0, 11.0); + m_256apsk[60] = gr_complex(3.0, 13.0); + m_256apsk[61] = gr_complex(-13.0, 3.0); + m_256apsk[62] = gr_complex(15.0, -3.0); + m_256apsk[63] = gr_complex(3.0, 15.0); + m_256apsk[64] = gr_complex(5.0, 1.0); + m_256apsk[65] = gr_complex(1.0, -5.0); + m_256apsk[66] = gr_complex(-3.0, 5.0); + m_256apsk[67] = gr_complex(5.0, 3.0); + m_256apsk[68] = gr_complex(5.0, 5.0); + m_256apsk[69] = gr_complex(5.0, -5.0); + m_256apsk[70] = gr_complex(-7.0, 5.0); + m_256apsk[71] = gr_complex(5.0, 7.0); + m_256apsk[72] = gr_complex(5.0, 9.0); + m_256apsk[73] = gr_complex(9.0, -5.0); + m_256apsk[74] = gr_complex(-11.0, 5.0); + m_256apsk[75] = gr_complex(5.0, 11.0); + m_256apsk[76] = gr_complex(5.0, 13.0); + m_256apsk[77] = gr_complex(13.0, -5.0); + m_256apsk[78] = gr_complex(-15.0, 5.0); + m_256apsk[79] = gr_complex(5.0, 15.0); + m_256apsk[80] = gr_complex(-1.0, 5.0); + m_256apsk[81] = gr_complex(-5.0, -1.0); + m_256apsk[82] = gr_complex(-5.0, -3.0); + m_256apsk[83] = gr_complex(3.0, -5.0); + m_256apsk[84] = gr_complex(-5.0, 5.0); + m_256apsk[85] = gr_complex(-5.0, -5.0); + m_256apsk[86] = gr_complex(-5.0, -7.0); + m_256apsk[87] = gr_complex(7.0, -5.0); + m_256apsk[88] = gr_complex(-9.0, 5.0); + m_256apsk[89] = gr_complex(-5.0, -9.0); + m_256apsk[90] = gr_complex(-5.0, -11.0); + m_256apsk[91] = gr_complex(11.0, -5.0); + m_256apsk[92] = gr_complex(-13.0, 5.0); + m_256apsk[93] = gr_complex(-5.0, -13.0); + m_256apsk[94] = gr_complex(-5.0, -15.0); + m_256apsk[95] = gr_complex(15.0, -5.0); + m_256apsk[96] = gr_complex(1.0, -7.0); + m_256apsk[97] = gr_complex(-7.0, -1.0); + m_256apsk[98] = gr_complex(-7.0, -3.0); + m_256apsk[99] = gr_complex(-3.0, 7.0); + m_256apsk[100] = gr_complex(5.0, -7.0); + m_256apsk[101] = gr_complex(-7.0, -5.0); + m_256apsk[102] = gr_complex(-7.0, -7.0); + m_256apsk[103] = gr_complex(-7.0, 7.0); + m_256apsk[104] = gr_complex(9.0, -7.0); + m_256apsk[105] = gr_complex(-7.0, -9.0); + m_256apsk[106] = gr_complex(-7.0, -11.0); + m_256apsk[107] = gr_complex(-11.0, 7.0); + m_256apsk[108] = gr_complex(13.0, -7.0); + m_256apsk[109] = gr_complex(-7.0, -13.0); + m_256apsk[110] = gr_complex(-7.0, -15.0); + m_256apsk[111] = gr_complex(-15.0, 7.0); + m_256apsk[112] = gr_complex(7.0, 1.0); + m_256apsk[113] = gr_complex(-1.0, 7.0); + m_256apsk[114] = gr_complex(3.0, -7.0); + m_256apsk[115] = gr_complex(7.0, 3.0); + m_256apsk[116] = gr_complex(7.0, 5.0); + m_256apsk[117] = gr_complex(-5.0, 7.0); + m_256apsk[118] = gr_complex(7.0, -7.0); + m_256apsk[119] = gr_complex(7.0, 7.0); + m_256apsk[120] = gr_complex(7.0, 9.0); + m_256apsk[121] = gr_complex(-9.0, 7.0); + m_256apsk[122] = gr_complex(11.0, -7.0); + m_256apsk[123] = gr_complex(7.0, 11.0); + m_256apsk[124] = gr_complex(7.0, 13.0); + m_256apsk[125] = gr_complex(-13.0, 7.0); + m_256apsk[126] = gr_complex(15.0, -7.0); + m_256apsk[127] = gr_complex(7.0, 15.0); + m_256apsk[128] = gr_complex(9.0, 1.0); + m_256apsk[129] = gr_complex(1.0, -9.0); + m_256apsk[130] = gr_complex(-3.0, 9.0); + m_256apsk[131] = gr_complex(9.0, 3.0); + m_256apsk[132] = gr_complex(9.0, 5.0); + m_256apsk[133] = gr_complex(5.0, -9.0); + m_256apsk[134] = gr_complex(-7.0, 9.0); + m_256apsk[135] = gr_complex(9.0, 7.0); + m_256apsk[136] = gr_complex(9.0, 9.0); + m_256apsk[137] = gr_complex(9.0, -9.0); + m_256apsk[138] = gr_complex(-11.0, 9.0); + m_256apsk[139] = gr_complex(9.0, 11.0); + m_256apsk[140] = gr_complex(9.0, 13.0); + m_256apsk[141] = gr_complex(13.0, -9.0); + m_256apsk[142] = gr_complex(-15.0, 9.0); + m_256apsk[143] = gr_complex(9.0, 15.0); + m_256apsk[144] = gr_complex(-1.0, 9.0); + m_256apsk[145] = gr_complex(-9.0, -1.0); + m_256apsk[146] = gr_complex(-9.0, -3.0); + m_256apsk[147] = gr_complex(3.0, -9.0); + m_256apsk[148] = gr_complex(-5.0, 9.0); + m_256apsk[149] = gr_complex(-9.0, -5.0); + m_256apsk[150] = gr_complex(-9.0, -7.0); + m_256apsk[151] = gr_complex(7.0, -9.0); + m_256apsk[152] = gr_complex(-9.0, 9.0); + m_256apsk[153] = gr_complex(-9.0, -9.0); + m_256apsk[154] = gr_complex(-9.0, -11.0); + m_256apsk[155] = gr_complex(11.0, -9.0); + m_256apsk[156] = gr_complex(-13.0, 9.0); + m_256apsk[157] = gr_complex(-9.0, -13.0); + m_256apsk[158] = gr_complex(-9.0, -15.0); + m_256apsk[159] = gr_complex(15.0, -9.0); + m_256apsk[160] = gr_complex(1.0, -11.0); + m_256apsk[161] = gr_complex(-11.0, -1.0); + m_256apsk[162] = gr_complex(-11.0, -3.0); + m_256apsk[163] = gr_complex(-3.0, 11.0); + m_256apsk[164] = gr_complex(5.0, -11.0); + m_256apsk[165] = gr_complex(-11.0, -5.0); + m_256apsk[166] = gr_complex(-11.0, -7.0); + m_256apsk[167] = gr_complex(-7.0, 11.0); + m_256apsk[168] = gr_complex(9.0, -11.0); + m_256apsk[169] = gr_complex(-11.0, -9.0); + m_256apsk[170] = gr_complex(-11.0, -11.0); + m_256apsk[171] = gr_complex(-11.0, 11.0); + m_256apsk[172] = gr_complex(13.0, -11.0); + m_256apsk[173] = gr_complex(-11.0, -13.0); + m_256apsk[174] = gr_complex(-11.0, -15.0); + m_256apsk[175] = gr_complex(-15.0, 11.0); + m_256apsk[176] = gr_complex(11.0, 1.0); + m_256apsk[177] = gr_complex(-1.0, 11.0); + m_256apsk[178] = gr_complex(3.0, -11.0); + m_256apsk[179] = gr_complex(11.0, 3.0); + m_256apsk[180] = gr_complex(11.0, 5.0); + m_256apsk[181] = gr_complex(-5.0, 11.0); + m_256apsk[182] = gr_complex(7.0, -11.0); + m_256apsk[183] = gr_complex(11.0, 7.0); + m_256apsk[184] = gr_complex(11.0, 9.0); + m_256apsk[185] = gr_complex(-9.0, 11.0); + m_256apsk[186] = gr_complex(11.0, -11.0); + m_256apsk[187] = gr_complex(11.0, 11.0); + m_256apsk[188] = gr_complex(11.0, 13.0); + m_256apsk[189] = gr_complex(-13.0, 11.0); + m_256apsk[190] = gr_complex(15.0, -11.0); + m_256apsk[191] = gr_complex(11.0, 15.0); + m_256apsk[192] = gr_complex(13.0, 1.0); + m_256apsk[193] = gr_complex(1.0, -13.0); + m_256apsk[194] = gr_complex(-3.0, 13.0); + m_256apsk[195] = gr_complex(13.0, 3.0); + m_256apsk[196] = gr_complex(13.0, 5.0); + m_256apsk[197] = gr_complex(5.0, -13.0); + m_256apsk[198] = gr_complex(-7.0, 13.0); + m_256apsk[199] = gr_complex(13.0, 7.0); + m_256apsk[200] = gr_complex(13.0, 9.0); + m_256apsk[201] = gr_complex(9.0, -13.0); + m_256apsk[202] = gr_complex(-11.0, 13.0); + m_256apsk[203] = gr_complex(13.0, 11.0); + m_256apsk[204] = gr_complex(13.0, 13.0); + m_256apsk[205] = gr_complex(13.0, -13.0); + m_256apsk[206] = gr_complex(-15.0, 13.0); + m_256apsk[207] = gr_complex(13.0, 15.0); + m_256apsk[208] = gr_complex(-1.0, 13.0); + m_256apsk[209] = gr_complex(-13.0, -1.0); + m_256apsk[210] = gr_complex(-13.0, -3.0); + m_256apsk[211] = gr_complex(3.0, -13.0); + m_256apsk[212] = gr_complex(-5.0, 13.0); + m_256apsk[213] = gr_complex(-13.0, -5.0); + m_256apsk[214] = gr_complex(-13.0, -7.0); + m_256apsk[215] = gr_complex(7.0, -13.0); + m_256apsk[216] = gr_complex(-9.0, 13.0); + m_256apsk[217] = gr_complex(-13.0, -9.0); + m_256apsk[218] = gr_complex(-13.0, -11.0); + m_256apsk[219] = gr_complex(11.0, -13.0); + m_256apsk[220] = gr_complex(-13.0, 13.0); + m_256apsk[221] = gr_complex(-13.0, -13.0); + m_256apsk[222] = gr_complex(-13.0, -15.0); + m_256apsk[223] = gr_complex(15.0, -13.0); + m_256apsk[224] = gr_complex(1.0, -15.0); + m_256apsk[225] = gr_complex(-15.0, -1.0); + m_256apsk[226] = gr_complex(-15.0, -3.0); + m_256apsk[227] = gr_complex(-3.0, 15.0); + m_256apsk[228] = gr_complex(5.0, -15.0); + m_256apsk[229] = gr_complex(-15.0, -5.0); + m_256apsk[230] = gr_complex(-15.0, -7.0); + m_256apsk[231] = gr_complex(-7.0, 15.0); + m_256apsk[232] = gr_complex(9.0, -15.0); + m_256apsk[233] = gr_complex(-15.0, -9.0); + m_256apsk[234] = gr_complex(-15.0, -11.0); + m_256apsk[235] = gr_complex(-11.0, 15.0); + m_256apsk[236] = gr_complex(13.0, -15.0); + m_256apsk[237] = gr_complex(-15.0, -13.0); + m_256apsk[238] = gr_complex(-15.0, -15.0); + m_256apsk[239] = gr_complex(-15.0, 15.0); + m_256apsk[240] = gr_complex(15.0, 1.0); + m_256apsk[241] = gr_complex(-1.0, 15.0); + m_256apsk[242] = gr_complex(3.0, -15.0); + m_256apsk[243] = gr_complex(15.0, 3.0); + m_256apsk[244] = gr_complex(15.0, 5.0); + m_256apsk[245] = gr_complex(-5.0, 15.0); + m_256apsk[246] = gr_complex(7.0, -15.0); + m_256apsk[247] = gr_complex(15.0, 7.0); + m_256apsk[248] = gr_complex(15.0, 9.0); + m_256apsk[249] = gr_complex(-9.0, 15.0); + m_256apsk[250] = gr_complex(11.0, -15.0); + m_256apsk[251] = gr_complex(15.0, 11.0); + m_256apsk[252] = gr_complex(15.0, 13.0); + m_256apsk[253] = gr_complex(-13.0, 15.0); + m_256apsk[254] = gr_complex(15.0, -15.0); + m_256apsk[255] = gr_complex(15.0, 15.0); + break; + case MOD_8VSB: + m_8psk[0] = gr_complex(-7.0 + 1.25, 0.0); + m_8psk[1] = gr_complex(-5.0 + 1.25, 0.0); + m_8psk[2] = gr_complex(-3.0 + 1.25, 0.0); + m_8psk[3] = gr_complex(-1.0 + 1.25, 0.0); + m_8psk[4] = gr_complex(1.0 + 1.25, 0.0); + m_8psk[5] = gr_complex(3.0 + 1.25, 0.0); + m_8psk[6] = gr_complex(5.0 + 1.25, 0.0); + m_8psk[7] = gr_complex(7.0 + 1.25, 0.0); + break; + default: + m_qpsk[0] = gr_complex((r1 * cos(GR_M_PI / 4.0)), (r1 * sin(GR_M_PI / 4.0))); + m_qpsk[1] = + gr_complex((r1 * cos(7 * GR_M_PI / 4.0)), (r1 * sin(7 * GR_M_PI / 4.0))); + m_qpsk[2] = + gr_complex((r1 * cos(3 * GR_M_PI / 4.0)), (r1 * sin(3 * GR_M_PI / 4.0))); + m_qpsk[3] = + gr_complex((r1 * cos(5 * GR_M_PI / 4.0)), (r1 * sin(5 * GR_M_PI / 4.0))); + break; } + signal_constellation = constellation; + signal_interpolation = interpolation; + set_output_multiple(2); +} - /* - * Our virtual destructor. - */ - dvbs2_modulator_bc_impl::~dvbs2_modulator_bc_impl() - { - } +/* + * Our virtual destructor. + */ +dvbs2_modulator_bc_impl::~dvbs2_modulator_bc_impl() {} - void - dvbs2_modulator_bc_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - if (signal_interpolation == INTERPOLATION_OFF) { +void dvbs2_modulator_bc_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + if (signal_interpolation == INTERPOLATION_OFF) { ninput_items_required[0] = noutput_items; - } - else { + } else { ninput_items_required[0] = noutput_items / 2; - } } +} - int - dvbs2_modulator_bc_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - int index; - gr_complex zero; +int dvbs2_modulator_bc_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + gr_complex* out = (gr_complex*)output_items[0]; + int index; + gr_complex zero; - zero = gr_complex(0.0, 0.0); + zero = gr_complex(0.0, 0.0); - if (signal_interpolation == INTERPOLATION_OFF) { + if (signal_interpolation == INTERPOLATION_OFF) { switch (signal_constellation) { - case MOD_BPSK: - case MOD_BPSK_SF2: + case MOD_BPSK: + case MOD_BPSK_SF2: for (int i = 0; i < noutput_items; i++) { - index = *in++; - *out++ = m_bpsk[i & 1][index & 0x1]; + index = *in++; + *out++ = m_bpsk[i & 1][index & 0x1]; } break; - case MOD_QPSK: + case MOD_QPSK: for (int i = 0; i < noutput_items; i++) { - index = *in++; - *out++ = m_qpsk[index & 0x3]; + index = *in++; + *out++ = m_qpsk[index & 0x3]; } break; - case MOD_8PSK: - case MOD_8VSB: - case MOD_8APSK: + case MOD_8PSK: + case MOD_8VSB: + case MOD_8APSK: for (int i = 0; i < noutput_items; i++) { - index = *in++; - *out++ = m_8psk[index & 0x7]; + index = *in++; + *out++ = m_8psk[index & 0x7]; } break; - case MOD_16APSK: - case MOD_8_8APSK: + case MOD_16APSK: + case MOD_8_8APSK: for (int i = 0; i < noutput_items; i++) { - index = *in++; - *out++ = m_16apsk[index & 0xf]; + index = *in++; + *out++ = m_16apsk[index & 0xf]; } break; - case MOD_32APSK: - case MOD_4_12_16APSK: - case MOD_4_8_4_16APSK: + case MOD_32APSK: + case MOD_4_12_16APSK: + case MOD_4_8_4_16APSK: for (int i = 0; i < noutput_items; i++) { - index = *in++; - *out++ = m_32apsk[index & 0x1f]; + index = *in++; + *out++ = m_32apsk[index & 0x1f]; } break; - case MOD_64APSK: - case MOD_64QAM: - case MOD_8_16_20_20APSK: - case MOD_4_12_20_28APSK: + case MOD_64APSK: + case MOD_64QAM: + case MOD_8_16_20_20APSK: + case MOD_4_12_20_28APSK: for (int i = 0; i < noutput_items; i++) { - index = *in++; - *out++ = m_64apsk[index & 0x3f]; + index = *in++; + *out++ = m_64apsk[index & 0x3f]; } break; - case MOD_128APSK: + case MOD_128APSK: for (int i = 0; i < noutput_items; i++) { - index = *in++; - *out++ = m_128apsk[index & 0x7f]; + index = *in++; + *out++ = m_128apsk[index & 0x7f]; } break; - case MOD_256APSK: - case MOD_256QAM: + case MOD_256APSK: + case MOD_256QAM: for (int i = 0; i < noutput_items; i++) { - index = *in++; - *out++ = m_256apsk[index & 0xff]; + index = *in++; + *out++ = m_256apsk[index & 0xff]; } break; - default: + default: for (int i = 0; i < noutput_items; i++) { - index = *in++; - *out++ = m_qpsk[index & 0x3]; + index = *in++; + *out++ = m_qpsk[index & 0x3]; } break; } - } - else { + } else { switch (signal_constellation) { - case MOD_BPSK: - case MOD_BPSK_SF2: + case MOD_BPSK: + case MOD_BPSK_SF2: for (int i = 0; i < noutput_items; i++) { - index = *in++; - *out++ = m_bpsk[i & 1][index & 0x1]; - *out++ = zero; + index = *in++; + *out++ = m_bpsk[i & 1][index & 0x1]; + *out++ = zero; } break; - case MOD_QPSK: + case MOD_QPSK: for (int i = 0; i < noutput_items / 2; i++) { - index = *in++; - *out++ = m_qpsk[index & 0x3]; - *out++ = zero; + index = *in++; + *out++ = m_qpsk[index & 0x3]; + *out++ = zero; } break; - case MOD_8PSK: - case MOD_8APSK: + case MOD_8PSK: + case MOD_8APSK: for (int i = 0; i < noutput_items / 2; i++) { - index = *in++; - *out++ = m_8psk[index & 0x7]; - *out++ = zero; + index = *in++; + *out++ = m_8psk[index & 0x7]; + *out++ = zero; } break; - case MOD_16APSK: - case MOD_8_8APSK: + case MOD_16APSK: + case MOD_8_8APSK: for (int i = 0; i < noutput_items / 2; i++) { - index = *in++; - *out++ = m_16apsk[index & 0xf]; - *out++ = zero; + index = *in++; + *out++ = m_16apsk[index & 0xf]; + *out++ = zero; } break; - case MOD_32APSK: - case MOD_4_12_16APSK: - case MOD_4_8_4_16APSK: + case MOD_32APSK: + case MOD_4_12_16APSK: + case MOD_4_8_4_16APSK: for (int i = 0; i < noutput_items / 2; i++) { - index = *in++; - *out++ = m_32apsk[index & 0x1f]; - *out++ = zero; + index = *in++; + *out++ = m_32apsk[index & 0x1f]; + *out++ = zero; } break; - case MOD_64APSK: - case MOD_64QAM: - case MOD_8_16_20_20APSK: - case MOD_4_12_20_28APSK: + case MOD_64APSK: + case MOD_64QAM: + case MOD_8_16_20_20APSK: + case MOD_4_12_20_28APSK: for (int i = 0; i < noutput_items / 2; i++) { - index = *in++; - *out++ = m_64apsk[index & 0x3f]; - *out++ = zero; + index = *in++; + *out++ = m_64apsk[index & 0x3f]; + *out++ = zero; } break; - case MOD_128APSK: + case MOD_128APSK: for (int i = 0; i < noutput_items / 2; i++) { - index = *in++; - *out++ = m_128apsk[index & 0x7f]; - *out++ = zero; + index = *in++; + *out++ = m_128apsk[index & 0x7f]; + *out++ = zero; } break; - case MOD_256APSK: - case MOD_256QAM: + case MOD_256APSK: + case MOD_256QAM: for (int i = 0; i < noutput_items / 2; i++) { - index = *in++; - *out++ = m_256apsk[index & 0xff]; - *out++ = zero; + index = *in++; + *out++ = m_256apsk[index & 0xff]; + *out++ = zero; } break; - default: + default: for (int i = 0; i < noutput_items / 2; i++) { - index = *in++; - *out++ = m_qpsk[index & 0x3]; - *out++ = zero; + index = *in++; + *out++ = m_qpsk[index & 0x3]; + *out++ = zero; } break; } - } - - // Tell runtime system how many input items we consumed on - // each input stream. - if (signal_interpolation == INTERPOLATION_OFF) { - consume_each (noutput_items); - } - else { - consume_each (noutput_items / 2); - } + } - // Tell runtime system how many output items we produced. - return noutput_items; + // Tell runtime system how many input items we consumed on + // each input stream. + if (signal_interpolation == INTERPOLATION_OFF) { + consume_each(noutput_items); + } else { + consume_each(noutput_items / 2); } - } /* namespace dtv */ -} /* namespace gr */ + // Tell runtime system how many output items we produced. + return noutput_items; +} +} /* namespace dtv */ +} /* namespace gr */ diff --git a/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.h b/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.h index d606d535c0..ba503a2ea9 100644 --- a/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.h +++ b/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.h @@ -26,35 +26,38 @@ #include <gnuradio/dtv/dvbs2_modulator_bc.h> namespace gr { - namespace dtv { - - class dvbs2_modulator_bc_impl : public dvbs2_modulator_bc - { - private: - int signal_constellation; - int signal_interpolation; - gr_complex m_bpsk[2][2]; - gr_complex m_qpsk[4]; - gr_complex m_8psk[8]; - gr_complex m_16apsk[16]; - gr_complex m_32apsk[32]; - gr_complex m_64apsk[64]; - gr_complex m_128apsk[128]; - gr_complex m_256apsk[256]; - - public: - dvbs2_modulator_bc_impl(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation, dvbs2_interpolation_t interpolation); - ~dvbs2_modulator_bc_impl(); - - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class dvbs2_modulator_bc_impl : public dvbs2_modulator_bc +{ +private: + int signal_constellation; + int signal_interpolation; + gr_complex m_bpsk[2][2]; + gr_complex m_qpsk[4]; + gr_complex m_8psk[8]; + gr_complex m_16apsk[16]; + gr_complex m_32apsk[32]; + gr_complex m_64apsk[64]; + gr_complex m_128apsk[128]; + gr_complex m_256apsk[256]; + +public: + dvbs2_modulator_bc_impl(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation, + dvbs2_interpolation_t interpolation); + ~dvbs2_modulator_bc_impl(); + + void forecast(int noutput_items, gr_vector_int& ninput_items_required); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DVBS2_MODULATOR_BC_IMPL_H */ diff --git a/gr-dtv/lib/dvbs2/dvbs2_physical_cc_impl.cc b/gr-dtv/lib/dvbs2/dvbs2_physical_cc_impl.cc index b441cdc10d..53720e43f8 100644 --- a/gr-dtv/lib/dvbs2/dvbs2_physical_cc_impl.cc +++ b/gr-dtv/lib/dvbs2/dvbs2_physical_cc_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016,2018 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,759 +27,765 @@ #include <gnuradio/math.h> namespace gr { - namespace dtv { - - dvbs2_physical_cc::sptr - dvbs2_physical_cc::make(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation, dvbs2_pilots_t pilots, int goldcode) - { - return gnuradio::get_initial_sptr - (new dvbs2_physical_cc_impl(framesize, rate, constellation, pilots, goldcode)); - } - - /* - * The private constructor - */ - dvbs2_physical_cc_impl::dvbs2_physical_cc_impl(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation, dvbs2_pilots_t pilots, int goldcode) - : gr::block("dvbs2_physical_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex))) - { - int type, modcod; - double r0 = 1.0; - - signal_constellation = constellation; - modcod = 0; - if (framesize == FECFRAME_NORMAL) { +namespace dtv { + +dvbs2_physical_cc::sptr dvbs2_physical_cc::make(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation, + dvbs2_pilots_t pilots, + int goldcode) +{ + return gnuradio::get_initial_sptr( + new dvbs2_physical_cc_impl(framesize, rate, constellation, pilots, goldcode)); +} + +/* + * The private constructor + */ +dvbs2_physical_cc_impl::dvbs2_physical_cc_impl(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation, + dvbs2_pilots_t pilots, + int goldcode) + : gr::block("dvbs2_physical_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) +{ + int type, modcod; + double r0 = 1.0; + + signal_constellation = constellation; + modcod = 0; + if (framesize == FECFRAME_NORMAL) { frame_size = FRAME_SIZE_NORMAL; type = 0; if (rate == C2_9_VLSNR) { - frame_size = (FRAME_SIZE_NORMAL - NORMAL_PUNCTURING) + (EXTRA_PILOT_SYMBOLS_SET1 * 2); - pilots = PILOTS_ON; /* force pilots on for VL-SNR */ + frame_size = + (FRAME_SIZE_NORMAL - NORMAL_PUNCTURING) + (EXTRA_PILOT_SYMBOLS_SET1 * 2); + pilots = PILOTS_ON; /* force pilots on for VL-SNR */ } - } + } - else if (framesize == FECFRAME_SHORT) { + else if (framesize == FECFRAME_SHORT) { frame_size = FRAME_SIZE_SHORT; type = 2; if (rate == C1_5_VLSNR_SF2 || rate == C11_45_VLSNR_SF2) { - frame_size = ((FRAME_SIZE_SHORT - SHORT_PUNCTURING_SET1) * 2) + EXTRA_PILOT_SYMBOLS_SET1; - pilots = PILOTS_ON; /* force pilots on for VL-SNR */ + frame_size = ((FRAME_SIZE_SHORT - SHORT_PUNCTURING_SET1) * 2) + + EXTRA_PILOT_SYMBOLS_SET1; + pilots = PILOTS_ON; /* force pilots on for VL-SNR */ } if (rate == C1_5_VLSNR || rate == C4_15_VLSNR || rate == C1_3_VLSNR) { - frame_size = (FRAME_SIZE_SHORT - SHORT_PUNCTURING_SET2) + EXTRA_PILOT_SYMBOLS_SET2; - pilots = PILOTS_ON; /* force pilots on for VL-SNR */ + frame_size = + (FRAME_SIZE_SHORT - SHORT_PUNCTURING_SET2) + EXTRA_PILOT_SYMBOLS_SET2; + pilots = PILOTS_ON; /* force pilots on for VL-SNR */ } - } - else { + } else { frame_size = FRAME_SIZE_MEDIUM - MEDIUM_PUNCTURING + EXTRA_PILOT_SYMBOLS_SET1; type = 0; - pilots = PILOTS_ON; /* force pilots on for VL-SNR */ - } + pilots = PILOTS_ON; /* force pilots on for VL-SNR */ + } - pilot_mode = pilots; - if (pilot_mode) { + pilot_mode = pilots; + if (pilot_mode) { type |= 1; - } - if (goldcode < 0 || goldcode > 262141) { + } + if (goldcode < 0 || goldcode > 262141) { GR_LOG_WARN(d_logger, "Gold Code must be between 0 and 262141 inclusive."); GR_LOG_WARN(d_logger, "Gold Code set to 0."); goldcode = 0; - } - gold_code = goldcode; + } + gold_code = goldcode; + + vlsnr_set = VLSNR_OFF; + switch (rate) { + case C2_9_VLSNR: + vlsnr_header = 0; + vlsnr_set = VLSNR_SET1; + break; + case C1_5_MEDIUM: + vlsnr_header = 1; + vlsnr_set = VLSNR_SET1; + break; + case C11_45_MEDIUM: + vlsnr_header = 2; + vlsnr_set = VLSNR_SET1; + break; + case C1_3_MEDIUM: + vlsnr_header = 3; + vlsnr_set = VLSNR_SET1; + break; + case C1_5_VLSNR_SF2: + vlsnr_header = 4; + vlsnr_set = VLSNR_SET1; + break; + case C11_45_VLSNR_SF2: + vlsnr_header = 5; + vlsnr_set = VLSNR_SET1; + break; + case C1_5_VLSNR: + vlsnr_header = 9; + vlsnr_set = VLSNR_SET2; + break; + case C4_15_VLSNR: + vlsnr_header = 10; + vlsnr_set = VLSNR_SET2; + break; + case C1_3_VLSNR: + vlsnr_header = 11; + vlsnr_set = VLSNR_SET2; + break; + default: + vlsnr_header = 12; + break; + } - vlsnr_set = VLSNR_OFF; - switch (rate) { - case C2_9_VLSNR: - vlsnr_header = 0; - vlsnr_set = VLSNR_SET1; - break; - case C1_5_MEDIUM: - vlsnr_header = 1; - vlsnr_set = VLSNR_SET1; - break; - case C11_45_MEDIUM: - vlsnr_header = 2; - vlsnr_set = VLSNR_SET1; - break; - case C1_3_MEDIUM: - vlsnr_header = 3; - vlsnr_set = VLSNR_SET1; - break; - case C1_5_VLSNR_SF2: - vlsnr_header = 4; - vlsnr_set = VLSNR_SET1; - break; - case C11_45_VLSNR_SF2: - vlsnr_header = 5; - vlsnr_set = VLSNR_SET1; - break; - case C1_5_VLSNR: - vlsnr_header = 9; - vlsnr_set = VLSNR_SET2; - break; - case C4_15_VLSNR: - vlsnr_header = 10; - vlsnr_set = VLSNR_SET2; - break; - case C1_3_VLSNR: - vlsnr_header = 11; - vlsnr_set = VLSNR_SET2; - break; - default: - vlsnr_header = 12; - break; - } - - m_bpsk[0][0] = gr_complex((r0 * cos(GR_M_PI / 4.0)), (r0 * sin(GR_M_PI / 4.0))); - m_bpsk[0][1] = gr_complex((r0 * cos(5.0 * GR_M_PI / 4.0)), (r0 * sin(5.0 * GR_M_PI / 4.0))); - m_bpsk[1][0] = gr_complex((r0 * cos(5.0 * GR_M_PI / 4.0)), (r0 * sin(GR_M_PI / 4.0))); - m_bpsk[1][1] = gr_complex((r0 * cos(GR_M_PI / 4.0)), (r0 * sin(5.0 * GR_M_PI /4.0))); - m_bpsk[2][0] = gr_complex((r0 * cos(5.0 * GR_M_PI / 4.0)), (r0 * sin(GR_M_PI / 4.0))); - m_bpsk[2][1] = gr_complex((r0 * cos(GR_M_PI / 4.0)), (r0 * sin(5.0 * GR_M_PI /4.0))); - m_bpsk[3][0] = gr_complex((r0 * cos(5.0 * GR_M_PI / 4.0)), (r0 * sin(5.0 * GR_M_PI / 4.0))); - m_bpsk[3][1] = gr_complex((r0 * cos(GR_M_PI / 4.0)), (r0 * sin(GR_M_PI / 4.0))); - - m_zero = gr_complex(0.0, 0.0); - - // Mode and code rate - if (constellation == MOD_BPSK) { + m_bpsk[0][0] = gr_complex((r0 * cos(GR_M_PI / 4.0)), (r0 * sin(GR_M_PI / 4.0))); + m_bpsk[0][1] = + gr_complex((r0 * cos(5.0 * GR_M_PI / 4.0)), (r0 * sin(5.0 * GR_M_PI / 4.0))); + m_bpsk[1][0] = gr_complex((r0 * cos(5.0 * GR_M_PI / 4.0)), (r0 * sin(GR_M_PI / 4.0))); + m_bpsk[1][1] = gr_complex((r0 * cos(GR_M_PI / 4.0)), (r0 * sin(5.0 * GR_M_PI / 4.0))); + m_bpsk[2][0] = gr_complex((r0 * cos(5.0 * GR_M_PI / 4.0)), (r0 * sin(GR_M_PI / 4.0))); + m_bpsk[2][1] = gr_complex((r0 * cos(GR_M_PI / 4.0)), (r0 * sin(5.0 * GR_M_PI / 4.0))); + m_bpsk[3][0] = + gr_complex((r0 * cos(5.0 * GR_M_PI / 4.0)), (r0 * sin(5.0 * GR_M_PI / 4.0))); + m_bpsk[3][1] = gr_complex((r0 * cos(GR_M_PI / 4.0)), (r0 * sin(GR_M_PI / 4.0))); + + m_zero = gr_complex(0.0, 0.0); + + // Mode and code rate + if (constellation == MOD_BPSK) { slots = (frame_size / 1) / 90; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C1_5_MEDIUM: - case C11_45_MEDIUM: - case C1_3_MEDIUM: + case C1_5_MEDIUM: + case C11_45_MEDIUM: + case C1_3_MEDIUM: modcod = 128; break; - case C1_5_VLSNR: - case C4_15_VLSNR: - case C1_3_VLSNR: + case C1_5_VLSNR: + case C4_15_VLSNR: + case C1_3_VLSNR: modcod = 130; break; - default: + default: modcod = 0; break; } - } + } - if (constellation == MOD_BPSK_SF2) { + if (constellation == MOD_BPSK_SF2) { slots = (frame_size / 1) / 90; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C1_5_VLSNR_SF2: - case C11_45_VLSNR_SF2: + case C1_5_VLSNR_SF2: + case C11_45_VLSNR_SF2: modcod = 128; break; - default: + default: modcod = 0; break; } - } + } - if (constellation == MOD_QPSK) { + if (constellation == MOD_QPSK) { slots = (frame_size / 2) / 90; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C2_9_VLSNR: + case C2_9_VLSNR: modcod = 128; break; - case C1_4: + case C1_4: modcod = 1; break; - case C1_3: + case C1_3: modcod = 2; break; - case C2_5: + case C2_5: modcod = 3; break; - case C1_2: + case C1_2: modcod = 4; break; - case C3_5: + case C3_5: modcod = 5; break; - case C2_3: + case C2_3: modcod = 6; break; - case C3_4: + case C3_4: modcod = 7; break; - case C4_5: + case C4_5: modcod = 8; break; - case C5_6: + case C5_6: modcod = 9; break; - case C8_9: + case C8_9: modcod = 10; break; - case C9_10: + case C9_10: modcod = 11; break; - case C13_45: + case C13_45: modcod = 132; break; - case C9_20: + case C9_20: modcod = 134; break; - case C11_20: + case C11_20: modcod = 136; break; - case C11_45: + case C11_45: modcod = 216; break; - case C4_15: + case C4_15: modcod = 218; break; - case C14_45: + case C14_45: modcod = 220; break; - case C7_15: + case C7_15: modcod = 222; break; - case C8_15: + case C8_15: modcod = 224; break; - case C32_45: + case C32_45: modcod = 226; break; - default: + default: modcod = 0; break; } - } + } - if (constellation == MOD_8PSK) { + if (constellation == MOD_8PSK) { slots = (frame_size / 3) / 90; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C3_5: + case C3_5: modcod = 12; break; - case C2_3: + case C2_3: modcod = 13; break; - case C3_4: + case C3_4: modcod = 14; break; - case C5_6: + case C5_6: modcod = 15; break; - case C8_9: + case C8_9: modcod = 16; break; - case C9_10: + case C9_10: modcod = 17; break; - case C23_36: + case C23_36: modcod = 142; break; - case C25_36: + case C25_36: modcod = 144; break; - case C13_18: + case C13_18: modcod = 146; break; - case C7_15: + case C7_15: modcod = 228; break; - case C8_15: + case C8_15: modcod = 230; break; - case C26_45: + case C26_45: modcod = 232; break; - case C32_45: + case C32_45: modcod = 234; break; - default: + default: modcod = 0; break; } - } + } - if (constellation == MOD_8APSK) { + if (constellation == MOD_8APSK) { slots = (frame_size / 3) / 90; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C100_180: + case C100_180: modcod = 138; break; - case C104_180: + case C104_180: modcod = 140; break; - default: + default: modcod = 0; break; } - } + } - if (constellation == MOD_16APSK) { + if (constellation == MOD_16APSK) { slots = (frame_size / 4) / 90; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C2_3: + case C2_3: modcod = 18; break; - case C3_4: + case C3_4: modcod = 19; break; - case C4_5: + case C4_5: modcod = 20; break; - case C5_6: + case C5_6: modcod = 21; break; - case C8_9: + case C8_9: modcod = 22; break; - case C9_10: + case C9_10: modcod = 23; break; - case C26_45: + case C26_45: if (frame_size == FRAME_SIZE_NORMAL) { - modcod = 154; - } - else { - modcod = 240; + modcod = 154; + } else { + modcod = 240; } break; - case C3_5: + case C3_5: if (frame_size == FRAME_SIZE_NORMAL) { - modcod = 156; - } - else { - modcod = 242; + modcod = 156; + } else { + modcod = 242; } break; - case C28_45: + case C28_45: modcod = 160; break; - case C23_36: + case C23_36: modcod = 162; break; - case C25_36: + case C25_36: modcod = 166; break; - case C13_18: + case C13_18: modcod = 168; break; - case C140_180: + case C140_180: modcod = 170; break; - case C154_180: + case C154_180: modcod = 172; break; - case C7_15: + case C7_15: modcod = 236; break; - case C8_15: + case C8_15: modcod = 238; break; - case C32_45: + case C32_45: modcod = 244; break; - default: + default: modcod = 0; break; } - } + } - if (constellation == MOD_8_8APSK) - { + if (constellation == MOD_8_8APSK) { slots = (frame_size / 4) / 90; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C90_180: + case C90_180: modcod = 148; break; - case C96_180: + case C96_180: modcod = 150; break; - case C100_180: + case C100_180: modcod = 152; break; - case C18_30: + case C18_30: modcod = 158; break; - case C20_30: + case C20_30: modcod = 164; break; - default: + default: modcod = 0; break; } - } + } - if (constellation == MOD_32APSK) { + if (constellation == MOD_32APSK) { slots = (frame_size / 5) / 90; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C3_4: + case C3_4: modcod = 24; break; - case C4_5: + case C4_5: modcod = 25; break; - case C5_6: + case C5_6: modcod = 26; break; - case C8_9: + case C8_9: modcod = 27; break; - case C9_10: + case C9_10: modcod = 28; break; - default: + default: modcod = 0; break; } - } + } - if (constellation == MOD_4_12_16APSK) { + if (constellation == MOD_4_12_16APSK) { slots = (frame_size / 5) / 90; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C2_3: + case C2_3: if (frame_size == FRAME_SIZE_NORMAL) { - modcod = 174; - } - else { - modcod = 246; + modcod = 174; + } else { + modcod = 246; } break; - case C32_45: + case C32_45: modcod = 248; break; - default: + default: modcod = 0; break; } - } + } - if (constellation == MOD_4_8_4_16APSK) { + if (constellation == MOD_4_8_4_16APSK) { slots = (frame_size / 5) / 90; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C128_180: + case C128_180: modcod = 178; break; - case C132_180: + case C132_180: modcod = 180; break; - case C140_180: + case C140_180: modcod = 182; break; - default: + default: modcod = 0; break; } - } + } - if (constellation == MOD_64APSK) { + if (constellation == MOD_64APSK) { slots = (frame_size / 6) / 90; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C128_180: + case C128_180: modcod = 184; break; - default: + default: modcod = 0; break; } - } + } - if (constellation == MOD_8_16_20_20APSK) { + if (constellation == MOD_8_16_20_20APSK) { slots = (frame_size / 6) / 90; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C7_9: + case C7_9: modcod = 190; break; - case C4_5: + case C4_5: modcod = 194; break; - case C5_6: + case C5_6: modcod = 198; break; - default: + default: modcod = 0; break; } - } + } - if (constellation == MOD_4_12_20_28APSK) { + if (constellation == MOD_4_12_20_28APSK) { slots = (frame_size / 6) / 90; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C132_180: + case C132_180: modcod = 186; break; - default: + default: modcod = 0; break; } - } + } - if (constellation == MOD_128APSK) { + if (constellation == MOD_128APSK) { slots = 103; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C135_180: + case C135_180: modcod = 200; break; - case C140_180: + case C140_180: modcod = 202; break; - default: + default: modcod = 0; break; } - } + } - if (constellation == MOD_256APSK) { + if (constellation == MOD_256APSK) { slots = (frame_size / 8) / 90; pilot_symbols = (slots / 16) * 36; if (!(slots % 16)) { - pilot_symbols -= 36; + pilot_symbols -= 36; } switch (rate) { - case C116_180: + case C116_180: modcod = 204; break; - case C20_30: + case C20_30: modcod = 206; break; - case C124_180: + case C124_180: modcod = 208; break; - case C128_180: + case C128_180: modcod = 210; break; - case C22_30: + case C22_30: modcod = 212; break; - case C135_180: + case C135_180: modcod = 214; break; - default: + default: modcod = 0; break; } - } + } - // Now create the PL header. - // Add the sync sequence SOF - for (int i = 0; i < 26; i++) { + // Now create the PL header. + // Add the sync sequence SOF + for (int i = 0; i < 26; i++) { b[i] = ph_sync_seq[i]; - } - // Add the mode and code - pl_header_encode(modcod, type, &b[26]); + } + // Add the mode and code + pl_header_encode(modcod, type, &b[26]); - // BPSK modulate and create the header - for (int i = 0; i < 26; i++) { + // BPSK modulate and create the header + for (int i = 0; i < 26; i++) { m_pl[i] = m_bpsk[i & 1][b[i]]; - } - if (modcod & 0x80) { + } + if (modcod & 0x80) { for (int i = 26; i < 90; i++) { - m_pl[i] = m_bpsk[(i & 1) + 2][b[i]]; + m_pl[i] = m_bpsk[(i & 1) + 2][b[i]]; } - } - else { + } else { for (int i = 26; i < 90; i++) { - m_pl[i] = m_bpsk[i & 1][b[i]]; + m_pl[i] = m_bpsk[i & 1][b[i]]; } - } + } - // Create the VL-SNR header. - // Add leading zeroes - for (int i = 0; i < 2; i++) { + // Create the VL-SNR header. + // Add leading zeroes + for (int i = 0; i < 2; i++) { b[i] = 0; - } - for (int i = 2; i < 898; i++) { + } + for (int i = 2; i < 898; i++) { b[i] = ph_vlsnr_seq[vlsnr_header][i - 2]; - } - // Add trailing zeroes - for (int i = 898; i < VLSNR_HEADER_LENGTH; i++) { + } + // Add trailing zeroes + for (int i = 898; i < VLSNR_HEADER_LENGTH; i++) { b[i] = 0; - } - // BPSK modulate and create the VL-SNR header - for (int i = 0; i < VLSNR_HEADER_LENGTH; i++) { + } + // BPSK modulate and create the VL-SNR header + for (int i = 0; i < VLSNR_HEADER_LENGTH; i++) { m_vlsnr_header[i] = m_bpsk[i & 1][b[i]]; - } + } - build_symbol_scrambler_table(); - if (!pilot_mode) { + build_symbol_scrambler_table(); + if (!pilot_mode) { pilot_symbols = 0; - } - if (vlsnr_set == VLSNR_OFF) { - set_output_multiple((((slots * 90) + 90) + pilot_symbols) * 2); - } - else { - set_output_multiple((((slots * 90) + 90) + (pilot_symbols + 36) + VLSNR_HEADER_LENGTH) * 2); - } } - - /* - * Our virtual destructor. - */ - dvbs2_physical_cc_impl::~dvbs2_physical_cc_impl() - { + if (vlsnr_set == VLSNR_OFF) { + set_output_multiple((((slots * 90) + 90) + pilot_symbols) * 2); + } else { + set_output_multiple( + (((slots * 90) + 90) + (pilot_symbols + 36) + VLSNR_HEADER_LENGTH) * 2); } +} - void - dvbs2_physical_cc_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - if (vlsnr_set == VLSNR_OFF) { - ninput_items_required[0] = (noutput_items / ((((slots * 90) + 90) + pilot_symbols) * 2)) * (slots * 90); - } - else if (vlsnr_set == VLSNR_SET1) { - ninput_items_required[0] = (noutput_items / ((((slots * 90) + 90) + (pilot_symbols + 36) + VLSNR_HEADER_LENGTH) * 2)) * ((slots * 90) - EXTRA_PILOT_SYMBOLS_SET1); - } - else { - ninput_items_required[0] = (noutput_items / ((((slots * 90) + 90) + (pilot_symbols + 36) + VLSNR_HEADER_LENGTH) * 2)) * ((slots * 90) - EXTRA_PILOT_SYMBOLS_SET2); - } +/* + * Our virtual destructor. + */ +dvbs2_physical_cc_impl::~dvbs2_physical_cc_impl() {} + +void dvbs2_physical_cc_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + if (vlsnr_set == VLSNR_OFF) { + ninput_items_required[0] = + (noutput_items / ((((slots * 90) + 90) + pilot_symbols) * 2)) * (slots * 90); + } else if (vlsnr_set == VLSNR_SET1) { + ninput_items_required[0] = + (noutput_items / + ((((slots * 90) + 90) + (pilot_symbols + 36) + VLSNR_HEADER_LENGTH) * 2)) * + ((slots * 90) - EXTRA_PILOT_SYMBOLS_SET1); + } else { + ninput_items_required[0] = + (noutput_items / + ((((slots * 90) + 90) + (pilot_symbols + 36) + VLSNR_HEADER_LENGTH) * 2)) * + ((slots * 90) - EXTRA_PILOT_SYMBOLS_SET2); } +} - void - dvbs2_physical_cc_impl::b_64_8_code(unsigned char in, int *out) - { - unsigned long temp, bit; +void dvbs2_physical_cc_impl::b_64_8_code(unsigned char in, int* out) +{ + unsigned long temp, bit; - temp = 0; + temp = 0; - if (in & 0x80) { + if (in & 0x80) { temp ^= g[0]; - } - if (in & 0x40) { + } + if (in & 0x40) { temp ^= g[1]; - } - if (in & 0x20) { + } + if (in & 0x20) { temp ^= g[2]; - } - if (in & 0x10) { + } + if (in & 0x10) { temp ^= g[3]; - } - if (in & 0x08) { + } + if (in & 0x08) { temp ^= g[4]; - } - if (in & 0x04) { + } + if (in & 0x04) { temp ^= g[5]; - } - if (in & 0x02) { + } + if (in & 0x02) { temp ^= g[6]; - } + } - bit = 0x80000000; - for (int m = 0; m < 32; m++) { + bit = 0x80000000; + for (int m = 0; m < 32; m++) { out[(m * 2)] = (temp & bit) ? 1 : 0; out[(m * 2) + 1] = out[m * 2] ^ (in & 0x01); bit >>= 1; - } - // Randomise it - for (int m = 0; m < 64; m++) { + } + // Randomise it + for (int m = 0; m < 64; m++) { out[m] = out[m] ^ ph_scram_tab[m]; - } } +} - void - dvbs2_physical_cc_impl::pl_header_encode(unsigned char modcod, unsigned char type, int *out) - { - unsigned char code; +void dvbs2_physical_cc_impl::pl_header_encode(unsigned char modcod, + unsigned char type, + int* out) +{ + unsigned char code; - if (modcod & 0x80) { + if (modcod & 0x80) { code = modcod | (type & 0x1); - } - else { + } else { code = (modcod << 2) | type; - } - // Add the modcod and type information and scramble it - b_64_8_code (code, out); } - - int - dvbs2_physical_cc_impl::parity_chk(long a, long b) - { - int c = 0; - a = a & b; - for (int i = 0; i < 18; i++) { - if(a & (1L << i)) { - c++; + // Add the modcod and type information and scramble it + b_64_8_code(code, out); +} + +int dvbs2_physical_cc_impl::parity_chk(long a, long b) +{ + int c = 0; + a = a & b; + for (int i = 0; i < 18; i++) { + if (a & (1L << i)) { + c++; } - } - return c & 1; } + return c & 1; +} - void - dvbs2_physical_cc_impl::build_symbol_scrambler_table(void) - { - long x, y; - int xa, xb, xc, ya, yb, yc; - int rn, zna, znb; +void dvbs2_physical_cc_impl::build_symbol_scrambler_table(void) +{ + long x, y; + int xa, xb, xc, ya, yb, yc; + int rn, zna, znb; - // Initialisation - x = 0x00001; - y = 0x3FFFF; + // Initialisation + x = 0x00001; + y = 0x3FFFF; - for (int n = 0; n < gold_code; n++) { + for (int n = 0; n < gold_code; n++) { xb = parity_chk(x, 0x0081); x >>= 1; if (xb) { - x |= 0x20000; + x |= 0x20000; } - } + } - for (int i = 0; i < FRAME_SIZE_NORMAL; i++) { + for (int i = 0; i < FRAME_SIZE_NORMAL; i++) { xa = parity_chk(x, 0x8050); xb = parity_chk(x, 0x0081); xc = x & 1; x >>= 1; if (xb) { - x |= 0x20000; + x |= 0x20000; } ya = parity_chk(y, 0x04A1); @@ -788,746 +794,1026 @@ namespace gr { y >>= 1; if (ya) { - y |= 0x20000; + y |= 0x20000; } zna = xc ^ yc; znb = xa ^ yb; rn = (znb << 1) + zna; m_cscram[i] = rn; - } } - - int - dvbs2_physical_cc_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - int consumed = 0; - int produced = 0; - int slot_count, n; - int group, symbols; - gr_complex tempin, tempout; - - if (vlsnr_set == VLSNR_OFF) { - for (int i = 0; i < noutput_items / 2; i += (((slots * 90) + 90) + pilot_symbols)) { - n = 0; - slot_count = 0; - for (int plh = 0; plh < 90; plh++) { - out[produced++] = m_pl[plh]; - out[produced++] = m_zero; - } - for (int j = 0; j < slots; j++) { - for (int k = 0; k < 90; k++) { - tempin = in[consumed++]; - switch (m_cscram[n++]) { - case 0: - tempout = tempin; - break; - case 1: - tempout = gr_complex(-tempin.imag(), tempin.real()); - break; - case 2: - tempout = -tempin; - break; - case 3: - tempout = gr_complex( tempin.imag(), -tempin.real()); - break; - } - out[produced++] = tempout; - out[produced++] = m_zero; +} + +int dvbs2_physical_cc_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + gr_complex* out = (gr_complex*)output_items[0]; + int consumed = 0; + int produced = 0; + int slot_count, n; + int group, symbols; + gr_complex tempin, tempout; + + if (vlsnr_set == VLSNR_OFF) { + for (int i = 0; i < noutput_items / 2; + i += (((slots * 90) + 90) + pilot_symbols)) { + n = 0; + slot_count = 0; + for (int plh = 0; plh < 90; plh++) { + out[produced++] = m_pl[plh]; + out[produced++] = m_zero; } - slot_count = (slot_count + 1) % 16; - if ((slot_count == 0) && (j < slots - 1)) { - if (pilot_mode) { - // Add pilots if needed - for (int p = 0; p < 36; p++) { - tempin = m_bpsk[0][0]; - switch (m_cscram[n++]) { - case 0: - tempout = tempin; - break; - case 1: - tempout = gr_complex(-tempin.imag(), tempin.real()); - break; - case 2: - tempout = -tempin; - break; - case 3: - tempout = gr_complex( tempin.imag(), -tempin.real()); - break; - } - out[produced++] = tempout; - out[produced++] = m_zero; - } - } - } - } - } - } - else if (vlsnr_set == VLSNR_SET1) { - for (int i = 0; i < noutput_items / 2; i += (((slots * 90) + 90) + pilot_symbols + VLSNR_HEADER_LENGTH + 36)) { - n = 0; - slot_count = 10; - group = 0; - symbols = 0; - for (int plh = 0; plh < 90; plh++) { - out[produced++] = m_pl[plh]; - out[produced++] = m_zero; - } - for (int vlh = 0; vlh < VLSNR_HEADER_LENGTH; vlh++) { - out[produced++] = m_vlsnr_header[vlh]; - out[produced++] = m_zero; - } - for (int j = 0; j < slots; j++) { - for (int k = 0; k < 90; k++) { - tempin = in[consumed++]; - if (signal_constellation == MOD_QPSK) { - switch (m_cscram[n++]) { - case 0: - tempout = tempin; - break; - case 1: - tempout = gr_complex(-tempin.imag(), tempin.real()); - break; - case 2: - tempout = -tempin; - break; - case 3: - tempout = gr_complex( tempin.imag(), -tempin.real()); - break; - } - } - else { - switch (m_cscram[n++]) { - case 0: - tempout = tempin; - break; - case 1: - tempout = -tempin; - break; - case 2: - tempout = tempin; - break; - case 3: - tempout = -tempin; - break; - } - } - out[produced++] = tempout; - out[produced++] = m_zero; - symbols++; - if (group <= 18 && symbols == 703) { - for (int p = 0; p < 34; p++) { - tempin = m_bpsk[0][0]; - switch (m_cscram[n++]) { - case 0: - tempout = tempin; - break; - case 1: - tempout = gr_complex(-tempin.imag(), tempin.real()); - break; - case 2: - tempout = -tempin; - break; - case 3: - tempout = gr_complex( tempin.imag(), -tempin.real()); - break; - } - out[produced++] = tempout; - out[produced++] = m_zero; - } - for (int x = (k + 1 + 34) - 90; x < 90; x++) { - tempin = in[consumed++]; - if (signal_constellation == MOD_QPSK) { + for (int j = 0; j < slots; j++) { + for (int k = 0; k < 90; k++) { + tempin = in[consumed++]; switch (m_cscram[n++]) { - case 0: + case 0: tempout = tempin; break; - case 1: - tempout = gr_complex(-tempin.imag(), tempin.real()); + case 1: + tempout = gr_complex(-tempin.imag(), tempin.real()); break; - case 2: + case 2: tempout = -tempin; break; - case 3: - tempout = gr_complex( tempin.imag(), -tempin.real()); + case 3: + tempout = gr_complex(tempin.imag(), -tempin.real()); break; } - } - else { - switch (m_cscram[n++]) { - case 0: - tempout = tempin; - break; - case 1: - tempout = -tempin; - break; - case 2: - tempout = tempin; + out[produced++] = tempout; + out[produced++] = m_zero; + } + slot_count = (slot_count + 1) % 16; + if ((slot_count == 0) && (j < slots - 1)) { + if (pilot_mode) { + // Add pilots if needed + for (int p = 0; p < 36; p++) { + tempin = m_bpsk[0][0]; + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = gr_complex(-tempin.imag(), tempin.real()); + break; + case 2: + tempout = -tempin; + break; + case 3: + tempout = gr_complex(tempin.imag(), -tempin.real()); + break; + } + out[produced++] = tempout; + out[produced++] = m_zero; + } + } + } + } + } + } else if (vlsnr_set == VLSNR_SET1) { + for (int i = 0; i < noutput_items / 2; + i += (((slots * 90) + 90) + pilot_symbols + VLSNR_HEADER_LENGTH + 36)) { + n = 0; + slot_count = 10; + group = 0; + symbols = 0; + for (int plh = 0; plh < 90; plh++) { + out[produced++] = m_pl[plh]; + out[produced++] = m_zero; + } + for (int vlh = 0; vlh < VLSNR_HEADER_LENGTH; vlh++) { + out[produced++] = m_vlsnr_header[vlh]; + out[produced++] = m_zero; + } + for (int j = 0; j < slots; j++) { + for (int k = 0; k < 90; k++) { + tempin = in[consumed++]; + if (signal_constellation == MOD_QPSK) { + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = gr_complex(-tempin.imag(), tempin.real()); + break; + case 2: + tempout = -tempin; + break; + case 3: + tempout = gr_complex(tempin.imag(), -tempin.real()); + break; + } + } else { + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = -tempin; + break; + case 2: + tempout = tempin; + break; + case 3: + tempout = -tempin; + break; + } + } + out[produced++] = tempout; + out[produced++] = m_zero; + symbols++; + if (group <= 18 && symbols == 703) { + for (int p = 0; p < 34; p++) { + tempin = m_bpsk[0][0]; + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = gr_complex(-tempin.imag(), tempin.real()); + break; + case 2: + tempout = -tempin; + break; + case 3: + tempout = gr_complex(tempin.imag(), -tempin.real()); + break; + } + out[produced++] = tempout; + out[produced++] = m_zero; + } + for (int x = (k + 1 + 34) - 90; x < 90; x++) { + tempin = in[consumed++]; + if (signal_constellation == MOD_QPSK) { + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = gr_complex(-tempin.imag(), tempin.real()); + break; + case 2: + tempout = -tempin; + break; + case 3: + tempout = gr_complex(tempin.imag(), -tempin.real()); + break; + } + } else { + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = -tempin; + break; + case 2: + tempout = tempin; + break; + case 3: + tempout = -tempin; + break; + } + } + out[produced++] = tempout; + out[produced++] = m_zero; + symbols++; + } + slot_count = (slot_count + 1) % 16; + j++; break; - case 3: - tempout = -tempin; + } else if ((group > 18 && group <= 21) && symbols == 702) { + for (int p = 0; p < 36; p++) { + tempin = m_bpsk[0][0]; + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = gr_complex(-tempin.imag(), tempin.real()); + break; + case 2: + tempout = -tempin; + break; + case 3: + tempout = gr_complex(tempin.imag(), -tempin.real()); + break; + } + out[produced++] = tempout; + out[produced++] = m_zero; + } + for (int x = (k + 1 + 36) - 90; x < 90; x++) { + tempin = in[consumed++]; + if (signal_constellation == MOD_QPSK) { + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = gr_complex(-tempin.imag(), tempin.real()); + break; + case 2: + tempout = -tempin; + break; + case 3: + tempout = gr_complex(tempin.imag(), -tempin.real()); + break; + } + } else { + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = -tempin; + break; + case 2: + tempout = tempin; + break; + case 3: + tempout = -tempin; + break; + } + } + out[produced++] = tempout; + out[produced++] = m_zero; + symbols++; + } + slot_count = (slot_count + 1) % 16; + j++; break; } - } - out[produced++] = tempout; - out[produced++] = m_zero; - symbols++; } slot_count = (slot_count + 1) % 16; - j++; - break; - } - else if ((group > 18 && group <= 21) && symbols == 702) { - for (int p = 0; p < 36; p++) { - tempin = m_bpsk[0][0]; - switch (m_cscram[n++]) { - case 0: - tempout = tempin; - break; - case 1: - tempout = gr_complex(-tempin.imag(), tempin.real()); - break; - case 2: - tempout = -tempin; - break; - case 3: - tempout = gr_complex( tempin.imag(), -tempin.real()); - break; - } - out[produced++] = tempout; - out[produced++] = m_zero; + if ((slot_count == 0) && (j < slots - 1)) { + if (pilot_mode) { + // Add pilots if needed + group++; + symbols = 0; + for (int p = 0; p < 36; p++) { + tempin = m_bpsk[0][0]; + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = gr_complex(-tempin.imag(), tempin.real()); + break; + case 2: + tempout = -tempin; + break; + case 3: + tempout = gr_complex(tempin.imag(), -tempin.real()); + break; + } + out[produced++] = tempout; + out[produced++] = m_zero; + } + } } - for (int x = (k + 1 + 36) - 90; x < 90; x++) { - tempin = in[consumed++]; - if (signal_constellation == MOD_QPSK) { + } + } + } else { /* VL-SNR set 2 */ + for (int i = 0; i < noutput_items / 2; + i += (((slots * 90) + 90) + pilot_symbols + VLSNR_HEADER_LENGTH + 36)) { + n = 0; + slot_count = 10; + group = 0; + symbols = 0; + for (int plh = 0; plh < 90; plh++) { + out[produced++] = m_pl[plh]; + out[produced++] = m_zero; + } + for (int vlh = 0; vlh < VLSNR_HEADER_LENGTH; vlh++) { + out[produced++] = m_vlsnr_header[vlh]; + out[produced++] = m_zero; + } + for (int j = 0; j < slots; j++) { + for (int k = 0; k < 90; k++) { + tempin = in[consumed++]; switch (m_cscram[n++]) { - case 0: + case 0: tempout = tempin; break; - case 1: - tempout = gr_complex(-tempin.imag(), tempin.real()); - break; - case 2: + case 1: tempout = -tempin; break; - case 3: - tempout = gr_complex( tempin.imag(), -tempin.real()); - break; - } - } - else { - switch (m_cscram[n++]) { - case 0: + case 2: tempout = tempin; break; - case 1: + case 3: tempout = -tempin; break; - case 2: - tempout = tempin; + } + out[produced++] = tempout; + out[produced++] = m_zero; + symbols++; + if (group <= 9 && symbols == 704) { + for (int p = 0; p < 32; p++) { + tempin = m_bpsk[0][0]; + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = gr_complex(-tempin.imag(), tempin.real()); + break; + case 2: + tempout = -tempin; + break; + case 3: + tempout = gr_complex(tempin.imag(), -tempin.real()); + break; + } + out[produced++] = tempout; + out[produced++] = m_zero; + } + for (int x = (k + 1 + 32) - 90; x < 90; x++) { + tempin = in[consumed++]; + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = -tempin; + break; + case 2: + tempout = tempin; + break; + case 3: + tempout = -tempin; + break; + } + out[produced++] = tempout; + out[produced++] = m_zero; + symbols++; + } + slot_count = (slot_count + 1) % 16; + j++; break; - case 3: - tempout = -tempin; + } else if ((group == 10) && symbols == 702) { + for (int p = 0; p < 36; p++) { + tempin = m_bpsk[0][0]; + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = gr_complex(-tempin.imag(), tempin.real()); + break; + case 2: + tempout = -tempin; + break; + case 3: + tempout = gr_complex(tempin.imag(), -tempin.real()); + break; + } + out[produced++] = tempout; + out[produced++] = m_zero; + } + for (int x = (k + 1 + 36) - 90; x < 90; x++) { + tempin = in[consumed++]; + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = -tempin; + break; + case 2: + tempout = tempin; + break; + case 3: + tempout = -tempin; + break; + } + out[produced++] = tempout; + out[produced++] = m_zero; + symbols++; + } + slot_count = (slot_count + 1) % 16; + j++; break; } - } - out[produced++] = tempout; - out[produced++] = m_zero; - symbols++; } slot_count = (slot_count + 1) % 16; - j++; - break; - } - } - slot_count = (slot_count + 1) % 16; - if ((slot_count == 0) && (j < slots - 1)) { - if (pilot_mode) { - // Add pilots if needed - group++; - symbols = 0; - for (int p = 0; p < 36; p++) { - tempin = m_bpsk[0][0]; - switch (m_cscram[n++]) { - case 0: - tempout = tempin; - break; - case 1: - tempout = gr_complex(-tempin.imag(), tempin.real()); - break; - case 2: - tempout = -tempin; - break; - case 3: - tempout = gr_complex( tempin.imag(), -tempin.real()); - break; - } - out[produced++] = tempout; - out[produced++] = m_zero; - } - } - } - } - } - } - else { /* VL-SNR set 2 */ - for (int i = 0; i < noutput_items / 2; i += (((slots * 90) + 90) + pilot_symbols + VLSNR_HEADER_LENGTH + 36)) { - n = 0; - slot_count = 10; - group = 0; - symbols = 0; - for (int plh = 0; plh < 90; plh++) { - out[produced++] = m_pl[plh]; - out[produced++] = m_zero; - } - for (int vlh = 0; vlh < VLSNR_HEADER_LENGTH; vlh++) { - out[produced++] = m_vlsnr_header[vlh]; - out[produced++] = m_zero; - } - for (int j = 0; j < slots; j++) { - for (int k = 0; k < 90; k++) { - tempin = in[consumed++]; - switch (m_cscram[n++]) { - case 0: - tempout = tempin; - break; - case 1: - tempout = -tempin; - break; - case 2: - tempout = tempin; - break; - case 3: - tempout = -tempin; - break; - } - out[produced++] = tempout; - out[produced++] = m_zero; - symbols++; - if (group <= 9 && symbols == 704) { - for (int p = 0; p < 32; p++) { - tempin = m_bpsk[0][0]; - switch (m_cscram[n++]) { - case 0: - tempout = tempin; - break; - case 1: - tempout = gr_complex(-tempin.imag(), tempin.real()); - break; - case 2: - tempout = -tempin; - break; - case 3: - tempout = gr_complex( tempin.imag(), -tempin.real()); - break; - } - out[produced++] = tempout; - out[produced++] = m_zero; - } - for (int x = (k + 1 + 32) - 90; x < 90; x++) { - tempin = in[consumed++]; - switch (m_cscram[n++]) { - case 0: - tempout = tempin; - break; - case 1: - tempout = -tempin; - break; - case 2: - tempout = tempin; - break; - case 3: - tempout = -tempin; - break; - } - out[produced++] = tempout; - out[produced++] = m_zero; - symbols++; - } - slot_count = (slot_count + 1) % 16; - j++; - break; - } - else if ((group == 10) && symbols == 702) { - for (int p = 0; p < 36; p++) { - tempin = m_bpsk[0][0]; - switch (m_cscram[n++]) { - case 0: - tempout = tempin; - break; - case 1: - tempout = gr_complex(-tempin.imag(), tempin.real()); - break; - case 2: - tempout = -tempin; - break; - case 3: - tempout = gr_complex( tempin.imag(), -tempin.real()); - break; - } - out[produced++] = tempout; - out[produced++] = m_zero; - } - for (int x = (k + 1 + 36) - 90; x < 90; x++) { - tempin = in[consumed++]; - switch (m_cscram[n++]) { - case 0: - tempout = tempin; - break; - case 1: - tempout = -tempin; - break; - case 2: - tempout = tempin; - break; - case 3: - tempout = -tempin; - break; - } - out[produced++] = tempout; - out[produced++] = m_zero; - symbols++; - } - slot_count = (slot_count + 1) % 16; - j++; - break; - } - } - slot_count = (slot_count + 1) % 16; - if ((slot_count == 0) && (j < slots - 1)) { - if (pilot_mode) { - // Add pilots if needed - group++; - symbols = 0; - for (int p = 0; p < 36; p++) { - tempin = m_bpsk[0][0]; - switch (m_cscram[n++]) { - case 0: - tempout = tempin; - break; - case 1: - tempout = gr_complex(-tempin.imag(), tempin.real()); - break; - case 2: - tempout = -tempin; - break; - case 3: - tempout = gr_complex( tempin.imag(), -tempin.real()); - break; - } - out[produced++] = tempout; - out[produced++] = m_zero; + if ((slot_count == 0) && (j < slots - 1)) { + if (pilot_mode) { + // Add pilots if needed + group++; + symbols = 0; + for (int p = 0; p < 36; p++) { + tempin = m_bpsk[0][0]; + switch (m_cscram[n++]) { + case 0: + tempout = tempin; + break; + case 1: + tempout = gr_complex(-tempin.imag(), tempin.real()); + break; + case 2: + tempout = -tempin; + break; + case 3: + tempout = gr_complex(tempin.imag(), -tempin.real()); + break; + } + out[produced++] = tempout; + out[produced++] = m_zero; + } + } } - } } - } } - } - - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (consumed); - - // Tell runtime system how many output items we produced. - return noutput_items; } - const unsigned long dvbs2_physical_cc_impl::g[7] = - { - 0x90AC2DDD, 0x55555555, 0x33333333, 0x0F0F0F0F, 0x00FF00FF, 0x0000FFFF, 0xFFFFFFFF - }; - - const int dvbs2_physical_cc_impl::ph_scram_tab[64] = - { - 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, - 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0 + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(consumed); + + // Tell runtime system how many output items we produced. + return noutput_items; +} + +const unsigned long dvbs2_physical_cc_impl::g[7] = { 0x90AC2DDD, 0x55555555, 0x33333333, + 0x0F0F0F0F, 0x00FF00FF, 0x0000FFFF, + 0xFFFFFFFF }; + +const int dvbs2_physical_cc_impl::ph_scram_tab[64] = { + 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, + 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0 +}; + +const int dvbs2_physical_cc_impl::ph_sync_seq[26] = { 0, 1, 1, 0, 0, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 0, 0, 1, 0 }; + +const int + dvbs2_physical_cc_impl::ph_vlsnr_seq[16][896] = { + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, + 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, + 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, + 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, + 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, + 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, + 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, + 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, + 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, + 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, + 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 1 }, + + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, + 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, + 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, + 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, + 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, + 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, + 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, + 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, + 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, + 1, 1, 1, 1, 0 }, + + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, + 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, + 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, + 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, + 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, + 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, + 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, + 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, + 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, + 1, 1, 1, 1, 0 }, + + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, + 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, + 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, + 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, + 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, + 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, + 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 1 }, + + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, + 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, + 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, + 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, + 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, + 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, + 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, + 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, + 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, + 1, 1, 1, 1, 0 }, + + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, + 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, + 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, + 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, + 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, + 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, + 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, + 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, + 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, + 1, 1, 1, 1, 0 }, + + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, + 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, + 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, + 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, + 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, + 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, + 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, + 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, + 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, + 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 1 }, + + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, + 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, + 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, + 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, + 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, + 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, + 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, + 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, + 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, + 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, + 1, 1, 1, 1, 0 }, + + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, + 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, + 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, + 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, + 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, + 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, + 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, + 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 1 }, + + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, + 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, + 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, + 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, + 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, + 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, + 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, + 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, + 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, + 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, + 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, + 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 1 }, + + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, + 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, + 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, + 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, + 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, + 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, + 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 1 }, + + { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, + 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, + 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, + 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, + 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, + 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, + 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, + 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, + 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, + 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 1 }, + + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, + 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, + 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, + 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, + 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, + 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, + 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, + 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 1 }, + + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, + 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, + 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, + 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, + 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, + 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, + 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, + 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, + 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, + 1, 1, 1, 1, 0 }, + + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, + 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, + 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, + 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, + 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, + 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, + 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, + 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, + 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, + 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, + 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, + 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, + 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, + 1, 1, 1, 1, 0 }, + + { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, + 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, + 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, + 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, + 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, + 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, + 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, + 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, + 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, + 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, + 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 1 } }; - const int dvbs2_physical_cc_impl::ph_sync_seq[26] = - { - 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0 - }; - - const int dvbs2_physical_cc_impl::ph_vlsnr_seq[16][896] = - { - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 1,0,0,1,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,0,0,1,0,1,1,1,1,0, - 1,1,1,1,0,1,1,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,0,1,1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,1,0,0,0,1,0,1,1,1,0,0,1,1,0,1,1,1, - 1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,1,0,0,1,1,0,1,1,1,1,1,0,0,1,1,0,0,1,0,1,1,1,1,0,1,0, - 0,1,1,1,1,0,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,0,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,0,0,1,0,0,1,1,1,1,0,1,0,1,0, - 0,1,0,1,1,1,1,0,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,0,0,0,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,1,0,1,0,1,0,1,0,0,0,1,1,0,1,0, - 0,0,1,0,0,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,0,1,0,0,1,1,0,0,1,0,1,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,0,1,0,0,0,0, - 0,0,1,1,0,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,0,1,0,1,1,1,1,1,1,0,0,1,1,1,1,0,1,0,1,1,1,1,1,0,1, - 1,0,1,0,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,1,1,1,0,1,0,0,1,1,1,0,1,0,1,0,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,1,1, - 0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1, - 0,1,1,1,0,0,1,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,0,0,1,1,0,0,0,1,1,1, - 0,0,1,1,1,0,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1, - 0,1,0,1,1,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0, - 1,1,1,0,1,0,0,1,1,0,1,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,1,1,0,0,1,1,1,1,1,0,0,1,1,1,0,1,1,0,1,0,0,1,1,1, - 0,0,1,1,1,1,1,1,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1, - 0,0,1,0,0,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1}, - - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 0,1,1,0,0,1,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,0,1,1,1,1,1,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,1,1,0,1,0,0,0,0,1, - 1,1,1,1,0,1,1,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,0,1,1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,1,0,0,0,1,0,1,1,1,0,0,1,1,0,1,1,1, - 0,1,1,1,1,0,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,1,0,0,1,0,1,1,0,0,1,0,0,0,0,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1, - 0,1,1,1,1,0,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,0,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,0,0,1,0,0,1,1,1,1,0,1,0,1,0, - 1,0,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,0,0,1,0,1,1,1,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,1,1,0,0,1,0,1, - 0,0,1,0,0,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,0,1,0,0,1,1,0,0,1,0,1,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,0,1,0,0,0,0, - 1,1,0,0,1,0,1,1,1,1,0,1,0,1,0,0,1,1,1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,1,0, - 1,0,1,0,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,1,1,1,0,1,0,0,1,1,1,0,1,0,1,0,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,1,1, - 1,1,1,0,1,1,1,1,1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,1,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0, - 0,1,1,1,0,0,1,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,0,0,1,1,0,0,0,1,1,1, - 1,1,0,0,0,1,0,0,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,1,0,1,1,0,1,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,1,0, - 0,1,0,1,1,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0, - 0,0,0,1,0,1,1,0,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,0,1,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,0,0,1,0,1,1,0,0,0, - 0,0,1,1,1,1,1,1,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1, - 1,1,0,1,1,1,0,0,0,0,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,0,1,1,0,1,0,0,0,1,0,0,1,0,1,0,1,1,1,1,1,0}, - - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 1,0,0,1,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,0,0,1,0,1,1,1,1,0, - 0,0,0,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,1,0,0,0, - 0,1,1,1,1,0,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,1,0,0,1,0,1,1,0,0,1,0,0,0,0,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1, - 0,1,1,1,1,0,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,0,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,0,0,1,0,0,1,1,1,1,0,1,0,1,0, - 0,1,0,1,1,1,1,0,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,0,0,0,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,1,0,1,0,1,0,1,0,0,0,1,1,0,1,0, - 1,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,0,0,1,1,1,1,0,1,1,0,0,1,1,0,1,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,1,0,1,1,1,1, - 1,1,0,0,1,0,1,1,1,1,0,1,0,1,0,0,1,1,1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,1,0, - 1,0,1,0,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,1,1,1,0,1,0,0,1,1,1,0,1,0,1,0,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,1,1, - 0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1, - 1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,0,0,1,1,1,1,1,0,1,1,0,1,1,1,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,1,1,0,0,1,1,1,0,0,0, - 1,1,0,0,0,1,0,0,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,1,0,1,1,0,1,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,1,0, - 0,1,0,1,1,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0, - 1,1,1,0,1,0,0,1,1,0,1,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,1,1,0,0,1,1,1,1,1,0,0,1,1,1,0,1,1,0,1,0,0,1,1,1, - 1,1,0,0,0,0,0,0,1,0,1,1,0,1,1,1,1,1,0,0,1,0,1,0,0,1,0,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0, - 1,1,0,1,1,1,0,0,0,0,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,0,1,1,0,1,0,0,0,1,0,0,1,0,1,0,1,1,1,1,1,0}, - - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 0,1,1,0,0,1,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,0,1,1,1,1,1,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,1,1,0,1,0,0,0,0,1, - 0,0,0,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,1,0,0,0, - 1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,1,0,0,1,1,0,1,1,1,1,1,0,0,1,1,0,0,1,0,1,1,1,1,0,1,0, - 0,1,1,1,1,0,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,0,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,0,0,1,0,0,1,1,1,1,0,1,0,1,0, - 1,0,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,0,0,1,0,1,1,1,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,1,1,0,0,1,0,1, - 1,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,0,0,1,1,1,1,0,1,1,0,0,1,1,0,1,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,1,0,1,1,1,1, - 0,0,1,1,0,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,0,1,0,1,1,1,1,1,1,0,0,1,1,1,1,0,1,0,1,1,1,1,1,0,1, - 1,0,1,0,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,1,1,1,0,1,0,0,1,1,1,0,1,0,1,0,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,1,1, - 1,1,1,0,1,1,1,1,1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,1,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0, - 1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,0,0,1,1,1,1,1,0,1,1,0,1,1,1,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,1,1,0,0,1,1,1,0,0,0, - 0,0,1,1,1,0,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1, - 0,1,0,1,1,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0, - 0,0,0,1,0,1,1,0,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,0,1,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,0,0,1,0,1,1,0,0,0, - 1,1,0,0,0,0,0,0,1,0,1,1,0,1,1,1,1,1,0,0,1,0,1,0,0,1,0,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0, - 0,0,1,0,0,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1}, - - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 1,0,0,1,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,0,0,1,0,1,1,1,1,0, - 1,1,1,1,0,1,1,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,0,1,1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,1,0,0,0,1,0,1,1,1,0,0,1,1,0,1,1,1, - 1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,1,0,0,1,1,0,1,1,1,1,1,0,0,1,1,0,0,1,0,1,1,1,1,0,1,0, - 1,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,1, - 1,0,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,0,0,1,0,1,1,1,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,1,1,0,0,1,0,1, - 1,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,0,0,1,1,1,1,0,1,1,0,0,1,1,0,1,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,1,0,1,1,1,1, - 1,1,0,0,1,0,1,1,1,1,0,1,0,1,0,0,1,1,1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,1,0, - 1,0,1,0,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,1,1,1,0,1,0,0,1,1,1,0,1,0,1,0,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,1,1, - 0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1, - 0,1,1,1,0,0,1,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,0,0,1,1,0,0,0,1,1,1, - 0,0,1,1,1,0,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1, - 1,0,1,0,0,1,1,0,1,1,1,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,1,1,1,0,1,1,0,0,1,1,1,1,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1, - 0,0,0,1,0,1,1,0,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,0,1,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,0,0,1,0,1,1,0,0,0, - 1,1,0,0,0,0,0,0,1,0,1,1,0,1,1,1,1,1,0,0,1,0,1,0,0,1,0,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0, - 1,1,0,1,1,1,0,0,0,0,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,0,1,1,0,1,0,0,0,1,0,0,1,0,1,0,1,1,1,1,1,0}, - - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 0,1,1,0,0,1,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,0,1,1,1,1,1,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,1,1,0,1,0,0,0,0,1, - 0,0,0,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,1,0,0,0, - 1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,1,0,0,1,1,0,1,1,1,1,1,0,0,1,1,0,0,1,0,1,1,1,1,0,1,0, - 1,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,1, - 0,1,0,1,1,1,1,0,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,0,0,0,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,1,0,1,0,1,0,1,0,0,0,1,1,0,1,0, - 0,0,1,0,0,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,0,1,0,0,1,1,0,0,1,0,1,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,0,1,0,0,0,0, - 1,1,0,0,1,0,1,1,1,1,0,1,0,1,0,0,1,1,1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,1,0, - 1,0,1,0,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,1,1,1,0,1,0,0,1,1,1,0,1,0,1,0,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,1,1, - 1,1,1,0,1,1,1,1,1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,1,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0, - 1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,0,0,1,1,1,1,1,0,1,1,0,1,1,1,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,1,1,0,0,1,1,1,0,0,0, - 0,0,1,1,1,0,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1, - 1,0,1,0,0,1,1,0,1,1,1,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,1,1,1,0,1,1,0,0,1,1,1,1,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1, - 1,1,1,0,1,0,0,1,1,0,1,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,1,1,0,0,1,1,1,1,1,0,0,1,1,1,0,1,1,0,1,0,0,1,1,1, - 0,0,1,1,1,1,1,1,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1, - 1,1,0,1,1,1,0,0,0,0,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,0,1,1,0,1,0,0,0,1,0,0,1,0,1,0,1,1,1,1,1,0}, - - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 1,0,0,1,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,0,0,1,0,1,1,1,1,0, - 0,0,0,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,1,0,0,0, - 0,1,1,1,1,0,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,1,0,0,1,0,1,1,0,0,1,0,0,0,0,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1, - 0,1,1,1,1,0,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,0,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,0,0,1,0,0,1,1,1,1,0,1,0,1,0, - 0,1,0,1,1,1,1,0,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,0,0,0,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,1,0,1,0,1,0,1,0,0,0,1,1,0,1,0, - 1,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,0,0,1,1,1,1,0,1,1,0,0,1,1,0,1,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,1,0,1,1,1,1, - 1,1,0,0,1,0,1,1,1,1,0,1,0,1,0,0,1,1,1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,1,0, - 0,1,0,1,0,0,1,0,0,0,1,0,1,1,1,1,1,1,0,0,1,0,0,1,0,0,0,1,0,1,1,0,0,0,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,1,0,1,0,0,0,0, - 1,1,1,0,1,1,1,1,1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,1,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0, - 0,1,1,1,0,0,1,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,0,0,1,1,0,0,0,1,1,1, - 0,0,1,1,1,0,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1, - 1,0,1,0,0,1,1,0,1,1,1,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,1,1,1,0,1,1,0,0,1,1,1,1,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1, - 0,0,0,1,0,1,1,0,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,0,1,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,0,0,1,0,1,1,0,0,0, - 0,0,1,1,1,1,1,1,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1, - 0,0,1,0,0,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1}, - - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 0,1,1,0,0,1,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,0,1,1,1,1,1,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,1,1,0,1,0,0,0,0,1, - 0,0,0,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,1,0,0,0, - 1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,1,0,0,1,1,0,1,1,1,1,1,0,0,1,1,0,0,1,0,1,1,1,1,0,1,0, - 0,1,1,1,1,0,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,0,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,0,0,1,0,0,1,1,1,1,0,1,0,1,0, - 1,0,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,0,0,1,0,1,1,1,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,1,1,0,0,1,0,1, - 1,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,0,0,1,1,1,1,0,1,1,0,0,1,1,0,1,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,1,0,1,1,1,1, - 0,0,1,1,0,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,0,1,0,1,1,1,1,1,1,0,0,1,1,1,1,0,1,0,1,1,1,1,1,0,1, - 0,1,0,1,0,0,1,0,0,0,1,0,1,1,1,1,1,1,0,0,1,0,0,1,0,0,0,1,0,1,1,0,0,0,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,1,0,1,0,0,0,0, - 0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1, - 0,1,1,1,0,0,1,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,0,0,1,1,0,0,0,1,1,1, - 1,1,0,0,0,1,0,0,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,1,0,1,1,0,1,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,1,0, - 1,0,1,0,0,1,1,0,1,1,1,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,1,1,1,0,1,1,0,0,1,1,1,1,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1, - 1,1,1,0,1,0,0,1,1,0,1,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,1,1,0,0,1,1,1,1,1,0,0,1,1,1,0,1,1,0,1,0,0,1,1,1, - 0,0,1,1,1,1,1,1,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1, - 1,1,0,1,1,1,0,0,0,0,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,0,1,1,0,1,0,0,0,1,0,0,1,0,1,0,1,1,1,1,1,0}, - - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 1,0,0,1,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,0,0,1,0,1,1,1,1,0, - 1,1,1,1,0,1,1,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,0,1,1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,1,0,0,0,1,0,1,1,1,0,0,1,1,0,1,1,1, - 1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,1,0,0,1,1,0,1,1,1,1,1,0,0,1,1,0,0,1,0,1,1,1,1,0,1,0, - 1,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,1, - 1,0,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,0,0,1,0,1,1,1,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,1,1,0,0,1,0,1, - 1,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,0,0,1,1,1,1,0,1,1,0,0,1,1,0,1,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,1,0,1,1,1,1, - 1,1,0,0,1,0,1,1,1,1,0,1,0,1,0,0,1,1,1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,1,0, - 0,1,0,1,0,0,1,0,0,0,1,0,1,1,1,1,1,1,0,0,1,0,0,1,0,0,0,1,0,1,1,0,0,0,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,1,0,1,0,0,0,0, - 1,1,1,0,1,1,1,1,1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,1,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0, - 1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,0,0,1,1,1,1,1,0,1,1,0,1,1,1,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,1,1,0,0,1,1,1,0,0,0, - 1,1,0,0,0,1,0,0,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,1,0,1,1,0,1,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,1,0, - 0,1,0,1,1,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0, - 1,1,1,0,1,0,0,1,1,0,1,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,1,1,0,0,1,1,1,1,1,0,0,1,1,1,0,1,1,0,1,0,0,1,1,1, - 0,0,1,1,1,1,1,1,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1, - 0,0,1,0,0,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1}, - - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 1,0,0,1,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,0,0,1,0,1,1,1,1,0, - 0,0,0,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,1,0,0,0, - 0,1,1,1,1,0,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,1,0,0,1,0,1,1,0,0,1,0,0,0,0,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1, - 1,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,1, - 1,0,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,0,0,1,0,1,1,1,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,1,1,0,0,1,0,1, - 0,0,1,0,0,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,0,1,0,0,1,1,0,0,1,0,1,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,0,1,0,0,0,0, - 0,0,1,1,0,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,0,1,0,1,1,1,1,1,1,0,0,1,1,1,1,0,1,0,1,1,1,1,1,0,1, - 1,0,1,0,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,1,1,1,0,1,0,0,1,1,1,0,1,0,1,0,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,1,1, - 0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1, - 1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,0,0,1,1,1,1,1,0,1,1,0,1,1,1,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,1,1,0,0,1,1,1,0,0,0, - 1,1,0,0,0,1,0,0,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,1,0,1,1,0,1,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,1,0, - 1,0,1,0,0,1,1,0,1,1,1,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,1,1,1,0,1,1,0,0,1,1,1,1,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1, - 0,0,0,1,0,1,1,0,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,0,1,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,0,0,1,0,1,1,0,0,0, - 0,0,1,1,1,1,1,1,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1, - 0,0,1,0,0,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1}, - - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 0,1,1,0,0,1,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,0,1,1,1,1,1,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,1,1,0,1,0,0,0,0,1, - 0,0,0,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,1,0,0,0, - 1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,1,0,0,1,1,0,1,1,1,1,1,0,0,1,1,0,0,1,0,1,1,1,1,0,1,0, - 0,1,1,1,1,0,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,0,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,0,0,1,0,0,1,1,1,1,0,1,0,1,0, - 1,0,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,0,0,1,0,1,1,1,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,1,1,0,0,1,0,1, - 1,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,0,0,1,1,1,1,0,1,1,0,0,1,1,0,1,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,1,0,1,1,1,1, - 0,0,1,1,0,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,0,1,0,1,1,1,1,1,1,0,0,1,1,1,1,0,1,0,1,1,1,1,1,0,1, - 1,0,1,0,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,1,1,1,0,1,0,0,1,1,1,0,1,0,1,0,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,1,1, - 1,1,1,0,1,1,1,1,1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,1,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0, - 1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,0,0,1,1,1,1,1,0,1,1,0,1,1,1,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,1,1,0,0,1,1,1,0,0,0, - 0,0,1,1,1,0,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1, - 0,1,0,1,1,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0, - 0,0,0,1,0,1,1,0,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,0,1,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,0,0,1,0,1,1,0,0,0, - 1,1,0,0,0,0,0,0,1,0,1,1,0,1,1,1,1,1,0,0,1,0,1,0,0,1,0,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0, - 0,0,1,0,0,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1}, - - {0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,1,1,0,1,1, - 0,1,1,0,0,1,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,0,1,1,1,1,1,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,1,1,0,1,0,0,0,0,1, - 0,0,0,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,1,0,0,0, - 0,1,1,1,1,0,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,1,0,0,1,0,1,1,0,0,1,0,0,0,0,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1, - 1,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,1, - 1,0,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,0,0,1,0,1,1,1,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,1,1,0,0,1,0,1, - 1,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,0,0,1,1,1,1,0,1,1,0,0,1,1,0,1,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,1,0,1,1,1,1, - 1,1,0,0,1,0,1,1,1,1,0,1,0,1,0,0,1,1,1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,1,0, - 1,0,1,0,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,1,1,1,0,1,0,0,1,1,1,0,1,0,1,0,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,1,1, - 0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1, - 0,1,1,1,0,0,1,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,0,0,1,1,0,0,0,1,1,1, - 0,0,1,1,1,0,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1, - 0,1,0,1,1,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0, - 1,1,1,0,1,0,0,1,1,0,1,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,1,1,0,0,1,1,1,1,1,0,0,1,1,1,0,1,1,0,1,0,0,1,1,1, - 0,0,1,1,1,1,1,1,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1, - 0,0,1,0,0,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1}, - - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 0,1,1,0,0,1,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,0,1,1,1,1,1,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,1,1,0,1,0,0,0,0,1, - 1,1,1,1,0,1,1,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,0,1,1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,1,0,0,0,1,0,1,1,1,0,0,1,1,0,1,1,1, - 0,1,1,1,1,0,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,1,0,0,1,0,1,1,0,0,1,0,0,0,0,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1, - 0,1,1,1,1,0,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,0,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,0,0,1,0,0,1,1,1,1,0,1,0,1,0, - 1,0,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,0,0,1,0,1,1,1,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,1,1,0,0,1,0,1, - 0,0,1,0,0,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,0,1,0,0,1,1,0,0,1,0,1,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,0,1,0,0,0,0, - 1,1,0,0,1,0,1,1,1,1,0,1,0,1,0,0,1,1,1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,1,0, - 0,1,0,1,0,0,1,0,0,0,1,0,1,1,1,1,1,1,0,0,1,0,0,1,0,0,0,1,0,1,1,0,0,0,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,1,0,1,0,0,0,0, - 0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1, - 1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,0,0,1,1,1,1,1,0,1,1,0,1,1,1,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,1,1,0,0,1,1,1,0,0,0, - 0,0,1,1,1,0,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1, - 1,0,1,0,0,1,1,0,1,1,1,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,1,1,1,0,1,1,0,0,1,1,1,1,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1, - 1,1,1,0,1,0,0,1,1,0,1,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,1,1,0,0,1,1,1,1,1,0,0,1,1,1,0,1,1,0,1,0,0,1,1,1, - 1,1,0,0,0,0,0,0,1,0,1,1,0,1,1,1,1,1,0,0,1,0,1,0,0,1,0,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0, - 0,0,1,0,0,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1}, - - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 0,1,1,0,0,1,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,0,1,1,1,1,1,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,1,1,0,1,0,0,0,0,1, - 1,1,1,1,0,1,1,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,0,1,1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,1,0,0,0,1,0,1,1,1,0,0,1,1,0,1,1,1, - 0,1,1,1,1,0,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,1,0,0,1,0,1,1,0,0,1,0,0,0,0,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1, - 1,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,1, - 0,1,0,1,1,1,1,0,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,0,0,0,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,1,0,1,0,1,0,1,0,0,0,1,1,0,1,0, - 1,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,0,0,1,1,1,1,0,1,1,0,0,1,1,0,1,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,1,0,1,1,1,1, - 0,0,1,1,0,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,0,1,0,1,1,1,1,1,1,0,0,1,1,1,1,0,1,0,1,1,1,1,1,0,1, - 0,1,0,1,0,0,1,0,0,0,1,0,1,1,1,1,1,1,0,0,1,0,0,1,0,0,0,1,0,1,1,0,0,0,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,1,0,1,0,0,0,0, - 0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1, - 1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,0,0,1,1,1,1,1,0,1,1,0,1,1,1,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,1,1,0,0,1,1,1,0,0,0, - 0,0,1,1,1,0,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1, - 0,1,0,1,1,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0, - 0,0,0,1,0,1,1,0,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,0,1,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,0,0,1,0,1,1,0,0,0, - 0,0,1,1,1,1,1,1,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1, - 1,1,0,1,1,1,0,0,0,0,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,0,1,1,0,1,0,0,0,1,0,0,1,0,1,0,1,1,1,1,1,0}, - - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 1,0,0,1,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,0,0,1,0,1,1,1,1,0, - 0,0,0,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,1,0,0,0, - 0,1,1,1,1,0,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,1,0,1,0,1,0,0,1,0,1,1,0,0,1,0,0,0,0,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1, - 1,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,1, - 1,0,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,0,0,1,0,1,1,1,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,1,1,0,0,1,0,1, - 0,0,1,0,0,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,0,1,0,0,1,1,0,0,1,0,1,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,0,1,0,0,0,0, - 0,0,1,1,0,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,0,1,0,1,1,1,1,1,1,0,0,1,1,1,1,0,1,0,1,1,1,1,1,0,1, - 0,1,0,1,0,0,1,0,0,0,1,0,1,1,1,1,1,1,0,0,1,0,0,1,0,0,0,1,0,1,1,0,0,0,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,1,0,1,0,0,0,0, - 1,1,1,0,1,1,1,1,1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,1,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0, - 0,1,1,1,0,0,1,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,0,0,1,1,0,0,0,1,1,1, - 0,0,1,1,1,0,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,0,1,1,1,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1, - 0,1,0,1,1,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0, - 1,1,1,0,1,0,0,1,1,0,1,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,1,1,0,0,1,1,1,1,1,0,0,1,1,1,0,1,1,0,1,0,0,1,1,1, - 1,1,0,0,0,0,0,0,1,0,1,1,0,1,1,1,1,1,0,0,1,0,1,0,0,1,0,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0, - 1,1,0,1,1,1,0,0,0,0,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,0,1,1,0,1,0,0,0,1,0,0,1,0,1,0,1,1,1,1,1,0}, - - {1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0, - 0,1,1,0,0,1,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,0,1,1,1,1,1,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,1,1,0,1,0,0,0,0,1, - 0,0,0,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,1,0,0,0, - 1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,1,0,0,1,1,0,1,1,1,1,1,0,0,1,1,0,0,1,0,1,1,1,1,0,1,0, - 1,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,1, - 0,1,0,1,1,1,1,0,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,0,0,0,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,1,0,1,0,1,0,1,0,0,0,1,1,0,1,0, - 0,0,1,0,0,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,0,1,0,0,1,1,0,0,1,0,1,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,0,1,0,0,0,0, - 1,1,0,0,1,0,1,1,1,1,0,1,0,1,0,0,1,1,1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,1,0, - 0,1,0,1,0,0,1,0,0,0,1,0,1,1,1,1,1,1,0,0,1,0,0,1,0,0,0,1,0,1,1,0,0,0,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,1,0,1,0,0,0,0, - 0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1, - 0,1,1,1,0,0,1,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,0,0,1,1,0,0,0,1,1,1, - 1,1,0,0,0,1,0,0,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,1,0,1,1,0,1,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,1,0, - 0,1,0,1,1,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0, - 0,0,0,1,0,1,1,0,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,0,1,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,0,0,1,0,1,1,0,0,0, - 1,1,0,0,0,0,0,0,1,0,1,1,0,1,1,1,1,1,0,0,1,0,1,0,0,1,0,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0, - 0,0,1,0,0,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1} - }; - - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbs2/dvbs2_physical_cc_impl.h b/gr-dtv/lib/dvbs2/dvbs2_physical_cc_impl.h index 845c5687d7..05010c6e02 100644 --- a/gr-dtv/lib/dvbs2/dvbs2_physical_cc_impl.h +++ b/gr-dtv/lib/dvbs2/dvbs2_physical_cc_impl.h @@ -28,48 +28,52 @@ #define VLSNR_HEADER_LENGTH 900 namespace gr { - namespace dtv { +namespace dtv { - class dvbs2_physical_cc_impl : public dvbs2_physical_cc - { - private: - int frame_size; - int signal_constellation; - int slots; - int pilot_mode; - int pilot_symbols; - int gold_code; - int vlsnr_header; - int vlsnr_set; - int b[VLSNR_HEADER_LENGTH]; - gr_complex m_bpsk[4][2]; - gr_complex m_pl[90]; - gr_complex m_vlsnr_header[VLSNR_HEADER_LENGTH]; - gr_complex m_zero; - int m_cscram[FRAME_SIZE_NORMAL]; - void b_64_8_code(unsigned char, int *); - void pl_header_encode(unsigned char, unsigned char, int *); - int parity_chk(long, long); - void build_symbol_scrambler_table(void); +class dvbs2_physical_cc_impl : public dvbs2_physical_cc +{ +private: + int frame_size; + int signal_constellation; + int slots; + int pilot_mode; + int pilot_symbols; + int gold_code; + int vlsnr_header; + int vlsnr_set; + int b[VLSNR_HEADER_LENGTH]; + gr_complex m_bpsk[4][2]; + gr_complex m_pl[90]; + gr_complex m_vlsnr_header[VLSNR_HEADER_LENGTH]; + gr_complex m_zero; + int m_cscram[FRAME_SIZE_NORMAL]; + void b_64_8_code(unsigned char, int*); + void pl_header_encode(unsigned char, unsigned char, int*); + int parity_chk(long, long); + void build_symbol_scrambler_table(void); - const static unsigned long g[7]; - const static int ph_scram_tab[64]; - const static int ph_sync_seq[26]; - const static int ph_vlsnr_seq[16][VLSNR_HEADER_LENGTH - 4]; + const static unsigned long g[7]; + const static int ph_scram_tab[64]; + const static int ph_sync_seq[26]; + const static int ph_vlsnr_seq[16][VLSNR_HEADER_LENGTH - 4]; - public: - dvbs2_physical_cc_impl(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation, dvbs2_pilots_t pilots, int goldcode); - ~dvbs2_physical_cc_impl(); +public: + dvbs2_physical_cc_impl(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation, + dvbs2_pilots_t pilots, + int goldcode); + ~dvbs2_physical_cc_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBS2_PHYSICAL_CC_IMPL_H */ diff --git a/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc b/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc index 4c67f62a60..b5687bd934 100644 --- a/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -29,264 +29,212 @@ #define INTERLEAVER_BLOCK_SIZE 126 namespace gr { - namespace dtv { - - const int dvbt_bit_inner_deinterleaver_impl::d_bsize = INTERLEAVER_BLOCK_SIZE; - - dvbt_bit_inner_deinterleaver::sptr - dvbt_bit_inner_deinterleaver::make(int nsize, \ - dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission) - { - return gnuradio::get_initial_sptr - (new dvbt_bit_inner_deinterleaver_impl(nsize, constellation, hierarchy, transmission)); - } - - /* - * The private constructor - */ - dvbt_bit_inner_deinterleaver_impl::dvbt_bit_inner_deinterleaver_impl(int nsize, dvb_constellation_t constellation, \ - dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission) - : block("dvbt_bit_inner_deinterleaver", - io_signature::make(1, 1, sizeof (unsigned char) * nsize), - io_signature::make(1, 2, sizeof (unsigned char) * nsize)), - config(constellation, hierarchy, gr::dtv::C1_2, gr::dtv::C1_2, gr::dtv::GI_1_32, transmission), +namespace dtv { + +const int dvbt_bit_inner_deinterleaver_impl::d_bsize = INTERLEAVER_BLOCK_SIZE; + +dvbt_bit_inner_deinterleaver::sptr +dvbt_bit_inner_deinterleaver::make(int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission) +{ + return gnuradio::get_initial_sptr(new dvbt_bit_inner_deinterleaver_impl( + nsize, constellation, hierarchy, transmission)); +} + +/* + * The private constructor + */ +dvbt_bit_inner_deinterleaver_impl::dvbt_bit_inner_deinterleaver_impl( + int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission) + : block("dvbt_bit_inner_deinterleaver", + io_signature::make(1, 1, sizeof(unsigned char) * nsize), + io_signature::make(1, 2, sizeof(unsigned char) * nsize)), + config(constellation, + hierarchy, + gr::dtv::C1_2, + gr::dtv::C1_2, + gr::dtv::GI_1_32, + transmission), d_nsize(nsize), d_hierarchy(hierarchy) - { - d_v = config.d_m; - d_hierarchy = config.d_hierarchy; - - d_perm = (unsigned char *)new (std::nothrow) unsigned char[d_v * d_bsize]; - if (d_perm == NULL) { - GR_LOG_FATAL(d_logger, "Bit Inner Deinterleaver, cannot allocate memory for d_perm."); +{ + d_v = config.d_m; + d_hierarchy = config.d_hierarchy; + + d_perm = (unsigned char*)new (std::nothrow) unsigned char[d_v * d_bsize]; + if (d_perm == NULL) { + GR_LOG_FATAL(d_logger, + "Bit Inner Deinterleaver, cannot allocate memory for d_perm."); throw std::bad_alloc(); - } + } - //Init permutation table (used for b[e][do]) - for (int i = 0; i < d_bsize * d_v; i++) { + // Init permutation table (used for b[e][do]) + for (int i = 0; i < d_bsize * d_v; i++) { if (d_hierarchy == NH) { - d_perm[i] = ((i % d_v) / (d_v / 2)) + 2 * (i % (d_v / 2)); - } - else { - d_perm[i] = (i % (d_v - 2)) / ((d_v - 2) / 2) + 2 * (i % ((d_v - 2) / 2)) + 2; + d_perm[i] = ((i % d_v) / (d_v / 2)) + 2 * (i % (d_v / 2)); + } else { + d_perm[i] = (i % (d_v - 2)) / ((d_v - 2) / 2) + 2 * (i % ((d_v - 2) / 2)) + 2; } - } - - if (d_nsize % d_bsize) { - GR_LOG_ERROR(d_logger, boost::format("Input size must be multiple of block size: nsize: %1% bsize: %2%") \ - % d_nsize % d_bsize); - } } - /* - * Our virtual destructor. - */ - dvbt_bit_inner_deinterleaver_impl::~dvbt_bit_inner_deinterleaver_impl() - { - delete [] d_perm; + if (d_nsize % d_bsize) { + GR_LOG_ERROR( + d_logger, + boost::format( + "Input size must be multiple of block size: nsize: %1% bsize: %2%") % + d_nsize % d_bsize); } +} - void - dvbt_bit_inner_deinterleaver_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = noutput_items; - } - - int - dvbt_bit_inner_deinterleaver_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *outh = (unsigned char *) output_items[0]; - unsigned char *outl = (unsigned char *) output_items[1]; - - int bmax = noutput_items * d_nsize / d_bsize; - - // First index of d_b is Bit interleaver number - // Second index of d_b is the position inside Bit interleaver - unsigned char d_b[MAX_MODULATION_ORDER][INTERLEAVER_BLOCK_SIZE]; - - for (int bcount = 0; bcount < bmax; bcount++) { +/* + * Our virtual destructor. + */ +dvbt_bit_inner_deinterleaver_impl::~dvbt_bit_inner_deinterleaver_impl() +{ + delete[] d_perm; +} + +void dvbt_bit_inner_deinterleaver_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = noutput_items; +} + +int dvbt_bit_inner_deinterleaver_impl::general_work( + int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* outh = (unsigned char*)output_items[0]; + unsigned char* outl = (unsigned char*)output_items[1]; + + int bmax = noutput_items * d_nsize / d_bsize; + + // First index of d_b is Bit interleaver number + // Second index of d_b is the position inside Bit interleaver + unsigned char d_b[MAX_MODULATION_ORDER][INTERLEAVER_BLOCK_SIZE]; + + for (int bcount = 0; bcount < bmax; bcount++) { for (int w = 0; w < d_bsize; w++) { - int c = in[(bcount * d_bsize) + w]; + int c = in[(bcount * d_bsize) + w]; - for (int e = 0; e < d_v; e++) { - d_b[e][d_lookup_H[w][e]] = (c >> (d_v - e - 1)) & 1; - } + for (int e = 0; e < d_v; e++) { + d_b[e][d_lookup_H[w][e]] = (c >> (d_v - e - 1)) & 1; + } } for (int i = 0; i < d_bsize; i++) { - if (d_hierarchy == NH) { - // Create output from demultiplexer - int c = 0; + if (d_hierarchy == NH) { + // Create output from demultiplexer + int c = 0; - for (int k = 0; k < d_v; k++) { - c = (c << 1) | d_b[d_perm[(d_v * i) + k]][i]; - } + for (int k = 0; k < d_v; k++) { + c = (c << 1) | d_b[d_perm[(d_v * i) + k]][i]; + } - outh[(bcount * d_bsize) + i] = c; - } - else { - int c = 0; + outh[(bcount * d_bsize) + i] = c; + } else { + int c = 0; - // High priority output - first 2 streams - for (int k = 0; k < 2; k++) { - c = (c << 1) | d_b[(d_v * i + k) % 2][(d_v * i + k) / 2]; - } + // High priority output - first 2 streams + for (int k = 0; k < 2; k++) { + c = (c << 1) | d_b[(d_v * i + k) % 2][(d_v * i + k) / 2]; + } - outh[(bcount * d_bsize) + i] = c; + outh[(bcount * d_bsize) + i] = c; - c = 0; - // Low priority output - (v - 2) streams - for (int k = 2; k < (d_v - 2); k++) { - c = (c << 1) | d_b[d_perm[d_v * i + k]][(d_v * i + k) / (d_v - 2)]; - } + c = 0; + // Low priority output - (v - 2) streams + for (int k = 2; k < (d_v - 2); k++) { + c = (c << 1) | d_b[d_perm[d_v * i + k]][(d_v * i + k) / (d_v - 2)]; + } - outl[(bcount * d_bsize) + i] = c; - } + outl[(bcount * d_bsize) + i] = c; + } } - } - - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (noutput_items); - - // Tell runtime system how many output items we produced. - return noutput_items; } - const int dvbt_bit_inner_deinterleaver_impl::d_lookup_H[INTERLEAVER_BLOCK_SIZE][MAX_MODULATION_ORDER] = - { - {0, 63, 105, 42, 21, 84}, - {1, 64, 106, 43, 22, 85}, - {2, 65, 107, 44, 23, 86}, - {3, 66, 108, 45, 24, 87}, - {4, 67, 109, 46, 25, 88}, - {5, 68, 110, 47, 26, 89}, - {6, 69, 111, 48, 27, 90}, - {7, 70, 112, 49, 28, 91}, - {8, 71, 113, 50, 29, 92}, - {9, 72, 114, 51, 30, 93}, - {10, 73, 115, 52, 31, 94}, - {11, 74, 116, 53, 32, 95}, - {12, 75, 117, 54, 33, 96}, - {13, 76, 118, 55, 34, 97}, - {14, 77, 119, 56, 35, 98}, - {15, 78, 120, 57, 36, 99}, - {16, 79, 121, 58, 37, 100}, - {17, 80, 122, 59, 38, 101}, - {18, 81, 123, 60, 39, 102}, - {19, 82, 124, 61, 40, 103}, - {20, 83, 125, 62, 41, 104}, - {21, 84, 0, 63, 42, 105}, - {22, 85, 1, 64, 43, 106}, - {23, 86, 2, 65, 44, 107}, - {24, 87, 3, 66, 45, 108}, - {25, 88, 4, 67, 46, 109}, - {26, 89, 5, 68, 47, 110}, - {27, 90, 6, 69, 48, 111}, - {28, 91, 7, 70, 49, 112}, - {29, 92, 8, 71, 50, 113}, - {30, 93, 9, 72, 51, 114}, - {31, 94, 10, 73, 52, 115}, - {32, 95, 11, 74, 53, 116}, - {33, 96, 12, 75, 54, 117}, - {34, 97, 13, 76, 55, 118}, - {35, 98, 14, 77, 56, 119}, - {36, 99, 15, 78, 57, 120}, - {37, 100, 16, 79, 58, 121}, - {38, 101, 17, 80, 59, 122}, - {39, 102, 18, 81, 60, 123}, - {40, 103, 19, 82, 61, 124}, - {41, 104, 20, 83, 62, 125}, - {42, 105, 21, 84, 63, 0}, - {43, 106, 22, 85, 64, 1}, - {44, 107, 23, 86, 65, 2}, - {45, 108, 24, 87, 66, 3}, - {46, 109, 25, 88, 67, 4}, - {47, 110, 26, 89, 68, 5}, - {48, 111, 27, 90, 69, 6}, - {49, 112, 28, 91, 70, 7}, - {50, 113, 29, 92, 71, 8}, - {51, 114, 30, 93, 72, 9}, - {52, 115, 31, 94, 73, 10}, - {53, 116, 32, 95, 74, 11}, - {54, 117, 33, 96, 75, 12}, - {55, 118, 34, 97, 76, 13}, - {56, 119, 35, 98, 77, 14}, - {57, 120, 36, 99, 78, 15}, - {58, 121, 37, 100, 79, 16}, - {59, 122, 38, 101, 80, 17}, - {60, 123, 39, 102, 81, 18}, - {61, 124, 40, 103, 82, 19}, - {62, 125, 41, 104, 83, 20}, - {63, 0, 42, 105, 84, 21}, - {64, 1, 43, 106, 85, 22}, - {65, 2, 44, 107, 86, 23}, - {66, 3, 45, 108, 87, 24}, - {67, 4, 46, 109, 88, 25}, - {68, 5, 47, 110, 89, 26}, - {69, 6, 48, 111, 90, 27}, - {70, 7, 49, 112, 91, 28}, - {71, 8, 50, 113, 92, 29}, - {72, 9, 51, 114, 93, 30}, - {73, 10, 52, 115, 94, 31}, - {74, 11, 53, 116, 95, 32}, - {75, 12, 54, 117, 96, 33}, - {76, 13, 55, 118, 97, 34}, - {77, 14, 56, 119, 98, 35}, - {78, 15, 57, 120, 99, 36}, - {79, 16, 58, 121, 100, 37}, - {80, 17, 59, 122, 101, 38}, - {81, 18, 60, 123, 102, 39}, - {82, 19, 61, 124, 103, 40}, - {83, 20, 62, 125, 104, 41}, - {84, 21, 63, 0, 105, 42}, - {85, 22, 64, 1, 106, 43}, - {86, 23, 65, 2, 107, 44}, - {87, 24, 66, 3, 108, 45}, - {88, 25, 67, 4, 109, 46}, - {89, 26, 68, 5, 110, 47}, - {90, 27, 69, 6, 111, 48}, - {91, 28, 70, 7, 112, 49}, - {92, 29, 71, 8, 113, 50}, - {93, 30, 72, 9, 114, 51}, - {94, 31, 73, 10, 115, 52}, - {95, 32, 74, 11, 116, 53}, - {96, 33, 75, 12, 117, 54}, - {97, 34, 76, 13, 118, 55}, - {98, 35, 77, 14, 119, 56}, - {99, 36, 78, 15, 120, 57}, - {100, 37, 79, 16, 121, 58}, - {101, 38, 80, 17, 122, 59}, - {102, 39, 81, 18, 123, 60}, - {103, 40, 82, 19, 124, 61}, - {104, 41, 83, 20, 125, 62}, - {105, 42, 84, 21, 0, 63}, - {106, 43, 85, 22, 1, 64}, - {107, 44, 86, 23, 2, 65}, - {108, 45, 87, 24, 3, 66}, - {109, 46, 88, 25, 4, 67}, - {110, 47, 89, 26, 5, 68}, - {111, 48, 90, 27, 6, 69}, - {112, 49, 91, 28, 7, 70}, - {113, 50, 92, 29, 8, 71}, - {114, 51, 93, 30, 9, 72}, - {115, 52, 94, 31, 10, 73}, - {116, 53, 95, 32, 11, 74}, - {117, 54, 96, 33, 12, 75}, - {118, 55, 97, 34, 13, 76}, - {119, 56, 98, 35, 14, 77}, - {120, 57, 99, 36, 15, 78}, - {121, 58, 100, 37, 16, 79}, - {122, 59, 101, 38, 17, 80}, - {123, 60, 102, 39, 18, 81}, - {124, 61, 103, 40, 19, 82}, - {125, 62, 104, 41, 20, 83} + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(noutput_items); + + // Tell runtime system how many output items we produced. + return noutput_items; +} + +const int dvbt_bit_inner_deinterleaver_impl::d_lookup_H + [INTERLEAVER_BLOCK_SIZE][MAX_MODULATION_ORDER] = { + { 0, 63, 105, 42, 21, 84 }, { 1, 64, 106, 43, 22, 85 }, + { 2, 65, 107, 44, 23, 86 }, { 3, 66, 108, 45, 24, 87 }, + { 4, 67, 109, 46, 25, 88 }, { 5, 68, 110, 47, 26, 89 }, + { 6, 69, 111, 48, 27, 90 }, { 7, 70, 112, 49, 28, 91 }, + { 8, 71, 113, 50, 29, 92 }, { 9, 72, 114, 51, 30, 93 }, + { 10, 73, 115, 52, 31, 94 }, { 11, 74, 116, 53, 32, 95 }, + { 12, 75, 117, 54, 33, 96 }, { 13, 76, 118, 55, 34, 97 }, + { 14, 77, 119, 56, 35, 98 }, { 15, 78, 120, 57, 36, 99 }, + { 16, 79, 121, 58, 37, 100 }, { 17, 80, 122, 59, 38, 101 }, + { 18, 81, 123, 60, 39, 102 }, { 19, 82, 124, 61, 40, 103 }, + { 20, 83, 125, 62, 41, 104 }, { 21, 84, 0, 63, 42, 105 }, + { 22, 85, 1, 64, 43, 106 }, { 23, 86, 2, 65, 44, 107 }, + { 24, 87, 3, 66, 45, 108 }, { 25, 88, 4, 67, 46, 109 }, + { 26, 89, 5, 68, 47, 110 }, { 27, 90, 6, 69, 48, 111 }, + { 28, 91, 7, 70, 49, 112 }, { 29, 92, 8, 71, 50, 113 }, + { 30, 93, 9, 72, 51, 114 }, { 31, 94, 10, 73, 52, 115 }, + { 32, 95, 11, 74, 53, 116 }, { 33, 96, 12, 75, 54, 117 }, + { 34, 97, 13, 76, 55, 118 }, { 35, 98, 14, 77, 56, 119 }, + { 36, 99, 15, 78, 57, 120 }, { 37, 100, 16, 79, 58, 121 }, + { 38, 101, 17, 80, 59, 122 }, { 39, 102, 18, 81, 60, 123 }, + { 40, 103, 19, 82, 61, 124 }, { 41, 104, 20, 83, 62, 125 }, + { 42, 105, 21, 84, 63, 0 }, { 43, 106, 22, 85, 64, 1 }, + { 44, 107, 23, 86, 65, 2 }, { 45, 108, 24, 87, 66, 3 }, + { 46, 109, 25, 88, 67, 4 }, { 47, 110, 26, 89, 68, 5 }, + { 48, 111, 27, 90, 69, 6 }, { 49, 112, 28, 91, 70, 7 }, + { 50, 113, 29, 92, 71, 8 }, { 51, 114, 30, 93, 72, 9 }, + { 52, 115, 31, 94, 73, 10 }, { 53, 116, 32, 95, 74, 11 }, + { 54, 117, 33, 96, 75, 12 }, { 55, 118, 34, 97, 76, 13 }, + { 56, 119, 35, 98, 77, 14 }, { 57, 120, 36, 99, 78, 15 }, + { 58, 121, 37, 100, 79, 16 }, { 59, 122, 38, 101, 80, 17 }, + { 60, 123, 39, 102, 81, 18 }, { 61, 124, 40, 103, 82, 19 }, + { 62, 125, 41, 104, 83, 20 }, { 63, 0, 42, 105, 84, 21 }, + { 64, 1, 43, 106, 85, 22 }, { 65, 2, 44, 107, 86, 23 }, + { 66, 3, 45, 108, 87, 24 }, { 67, 4, 46, 109, 88, 25 }, + { 68, 5, 47, 110, 89, 26 }, { 69, 6, 48, 111, 90, 27 }, + { 70, 7, 49, 112, 91, 28 }, { 71, 8, 50, 113, 92, 29 }, + { 72, 9, 51, 114, 93, 30 }, { 73, 10, 52, 115, 94, 31 }, + { 74, 11, 53, 116, 95, 32 }, { 75, 12, 54, 117, 96, 33 }, + { 76, 13, 55, 118, 97, 34 }, { 77, 14, 56, 119, 98, 35 }, + { 78, 15, 57, 120, 99, 36 }, { 79, 16, 58, 121, 100, 37 }, + { 80, 17, 59, 122, 101, 38 }, { 81, 18, 60, 123, 102, 39 }, + { 82, 19, 61, 124, 103, 40 }, { 83, 20, 62, 125, 104, 41 }, + { 84, 21, 63, 0, 105, 42 }, { 85, 22, 64, 1, 106, 43 }, + { 86, 23, 65, 2, 107, 44 }, { 87, 24, 66, 3, 108, 45 }, + { 88, 25, 67, 4, 109, 46 }, { 89, 26, 68, 5, 110, 47 }, + { 90, 27, 69, 6, 111, 48 }, { 91, 28, 70, 7, 112, 49 }, + { 92, 29, 71, 8, 113, 50 }, { 93, 30, 72, 9, 114, 51 }, + { 94, 31, 73, 10, 115, 52 }, { 95, 32, 74, 11, 116, 53 }, + { 96, 33, 75, 12, 117, 54 }, { 97, 34, 76, 13, 118, 55 }, + { 98, 35, 77, 14, 119, 56 }, { 99, 36, 78, 15, 120, 57 }, + { 100, 37, 79, 16, 121, 58 }, { 101, 38, 80, 17, 122, 59 }, + { 102, 39, 81, 18, 123, 60 }, { 103, 40, 82, 19, 124, 61 }, + { 104, 41, 83, 20, 125, 62 }, { 105, 42, 84, 21, 0, 63 }, + { 106, 43, 85, 22, 1, 64 }, { 107, 44, 86, 23, 2, 65 }, + { 108, 45, 87, 24, 3, 66 }, { 109, 46, 88, 25, 4, 67 }, + { 110, 47, 89, 26, 5, 68 }, { 111, 48, 90, 27, 6, 69 }, + { 112, 49, 91, 28, 7, 70 }, { 113, 50, 92, 29, 8, 71 }, + { 114, 51, 93, 30, 9, 72 }, { 115, 52, 94, 31, 10, 73 }, + { 116, 53, 95, 32, 11, 74 }, { 117, 54, 96, 33, 12, 75 }, + { 118, 55, 97, 34, 13, 76 }, { 119, 56, 98, 35, 14, 77 }, + { 120, 57, 99, 36, 15, 78 }, { 121, 58, 100, 37, 16, 79 }, + { 122, 59, 101, 38, 17, 80 }, { 123, 60, 102, 39, 18, 81 }, + { 124, 61, 103, 40, 19, 82 }, { 125, 62, 104, 41, 20, 83 } }; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.h b/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.h index 9d33f6124b..6dbf255202 100644 --- a/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,40 +25,42 @@ #include "dvbt_configure.h" namespace gr { - namespace dtv { +namespace dtv { - class dvbt_bit_inner_deinterleaver_impl : public dvbt_bit_inner_deinterleaver - { - private: - const dvbt_configure config; +class dvbt_bit_inner_deinterleaver_impl : public dvbt_bit_inner_deinterleaver +{ +private: + const dvbt_configure config; - static const int d_lookup_H[126][6]; + static const int d_lookup_H[126][6]; - int d_nsize; - dvbt_hierarchy_t d_hierarchy; + int d_nsize; + dvbt_hierarchy_t d_hierarchy; - // constellation - int d_v; - // Bit interleaver block size - static const int d_bsize; + // constellation + int d_v; + // Bit interleaver block size + static const int d_bsize; - // Table to keep interleaved indices - unsigned char * d_perm; + // Table to keep interleaved indices + unsigned char* d_perm; - public: - dvbt_bit_inner_deinterleaver_impl(int nsize, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission); - ~dvbt_bit_inner_deinterleaver_impl(); +public: + dvbt_bit_inner_deinterleaver_impl(int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission); + ~dvbt_bit_inner_deinterleaver_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_BIT_INNER_DEINTERLEVER_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc b/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc index 07ba588f3e..c82af1356c 100644 --- a/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -29,266 +29,211 @@ #define INTERLEAVER_BLOCK_SIZE 126 namespace gr { - namespace dtv { +namespace dtv { - const int dvbt_bit_inner_interleaver_impl::d_bsize = INTERLEAVER_BLOCK_SIZE; +const int dvbt_bit_inner_interleaver_impl::d_bsize = INTERLEAVER_BLOCK_SIZE; - dvbt_bit_inner_interleaver::sptr - dvbt_bit_inner_interleaver::make(int nsize, \ - dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission) - { - return gnuradio::get_initial_sptr - (new dvbt_bit_inner_interleaver_impl(nsize, constellation, hierarchy, transmission)); - } +dvbt_bit_inner_interleaver::sptr +dvbt_bit_inner_interleaver::make(int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission) +{ + return gnuradio::get_initial_sptr(new dvbt_bit_inner_interleaver_impl( + nsize, constellation, hierarchy, transmission)); +} - /* - * The private constructor - */ - dvbt_bit_inner_interleaver_impl::dvbt_bit_inner_interleaver_impl(int nsize, dvb_constellation_t constellation, \ - dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission) - : block("dvbt_bit_inner_interleaver", - io_signature::make(1, 2, sizeof(unsigned char) * nsize), - io_signature::make(1, 1, sizeof (unsigned char) * nsize)), - config(constellation, hierarchy, gr::dtv::C1_2, gr::dtv::C1_2, gr::dtv::GI_1_32, transmission), +/* + * The private constructor + */ +dvbt_bit_inner_interleaver_impl::dvbt_bit_inner_interleaver_impl( + int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission) + : block("dvbt_bit_inner_interleaver", + io_signature::make(1, 2, sizeof(unsigned char) * nsize), + io_signature::make(1, 1, sizeof(unsigned char) * nsize)), + config(constellation, + hierarchy, + gr::dtv::C1_2, + gr::dtv::C1_2, + gr::dtv::GI_1_32, + transmission), d_nsize(nsize), d_hierarchy(hierarchy) - { - d_v = config.d_m; - d_hierarchy = config.d_hierarchy; - - d_perm = (unsigned char *)new (std::nothrow) unsigned char[d_v * d_bsize]; - if (d_perm == NULL) { - GR_LOG_FATAL(d_logger, "Bit Inner Interleaver, cannot allocate memory for d_perm."); +{ + d_v = config.d_m; + d_hierarchy = config.d_hierarchy; + + d_perm = (unsigned char*)new (std::nothrow) unsigned char[d_v * d_bsize]; + if (d_perm == NULL) { + GR_LOG_FATAL(d_logger, + "Bit Inner Interleaver, cannot allocate memory for d_perm."); throw std::bad_alloc(); - } + } - //Init permutation table (used for b[e][do]) - for (int i = 0; i < d_bsize * d_v; i++) { + // Init permutation table (used for b[e][do]) + for (int i = 0; i < d_bsize * d_v; i++) { if (d_hierarchy == NH) { - d_perm[i] = ((i % d_v) / (d_v / 2)) + 2 * (i % (d_v / 2)); - } - else { - d_perm[i] = (i % (d_v - 2)) / ((d_v - 2) / 2) + 2 * (i % ((d_v - 2) / 2)) + 2; + d_perm[i] = ((i % d_v) / (d_v / 2)) + 2 * (i % (d_v / 2)); + } else { + d_perm[i] = (i % (d_v - 2)) / ((d_v - 2) / 2) + 2 * (i % ((d_v - 2) / 2)) + 2; } - } - - if (d_nsize % d_bsize) { - GR_LOG_ERROR(d_logger, boost::format("Input size must be multiple of block size: nsize: %1% bsize: %2%") \ - % d_nsize % d_bsize); - } } - /* - * Our virtual destructor. - */ - dvbt_bit_inner_interleaver_impl::~dvbt_bit_inner_interleaver_impl() - { - delete [] d_perm; + if (d_nsize % d_bsize) { + GR_LOG_ERROR( + d_logger, + boost::format( + "Input size must be multiple of block size: nsize: %1% bsize: %2%") % + d_nsize % d_bsize); } +} + +/* + * Our virtual destructor. + */ +dvbt_bit_inner_interleaver_impl::~dvbt_bit_inner_interleaver_impl() { delete[] d_perm; } - void - dvbt_bit_inner_interleaver_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - unsigned ninputs = ninput_items_required.size(); - for (unsigned i = 0; i < ninputs; i++) +void dvbt_bit_inner_interleaver_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + unsigned ninputs = ninput_items_required.size(); + for (unsigned i = 0; i < ninputs; i++) ninput_items_required[i] = noutput_items; - } +} - int - dvbt_bit_inner_interleaver_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *inh = (const unsigned char *) input_items[0]; - const unsigned char *inl = (const unsigned char *) input_items[1]; - unsigned char *out = (unsigned char *) output_items[0]; +int dvbt_bit_inner_interleaver_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* inh = (const unsigned char*)input_items[0]; + const unsigned char* inl = (const unsigned char*)input_items[1]; + unsigned char* out = (unsigned char*)output_items[0]; - int bmax = noutput_items * d_nsize / d_bsize; + int bmax = noutput_items * d_nsize / d_bsize; - // First index of d_b is Bit interleaver number - // Second index of d_b is the position inside the Bit interleaver - unsigned char d_b[MAX_MODULATION_ORDER][INTERLEAVER_BLOCK_SIZE]; + // First index of d_b is Bit interleaver number + // Second index of d_b is the position inside the Bit interleaver + unsigned char d_b[MAX_MODULATION_ORDER][INTERLEAVER_BLOCK_SIZE]; - for (int bcount = 0; bcount < bmax; bcount++) { + for (int bcount = 0; bcount < bmax; bcount++) { for (int i = 0; i < d_bsize; i++) { - if (d_hierarchy == NH) { - int c = inh[bcount * d_bsize + i]; - - // Create the demultiplexer - for (int k = 0; k < d_v; k++) { - d_b[d_perm[(d_v * i) + k]][i] = (c >> (d_v - k - 1)) & 1; - } - } - else { - int ch = inh[(bcount * d_bsize) + i]; - int cl = inl[(bcount * d_bsize) + i]; - - // High priority input - first 2 streams - for (int k = 0; k < 2; k++) { - d_b[(d_v * i + k) % 2][(d_v * i + k) / 2] = (ch >> (1 - k)) & 1; - } - - // Low priority input - (v - 2) streams - for (int k = 2; k < (d_v - 2); k++) { - d_b[d_perm[d_v * i + k]][(d_v * i + k) / (d_v - 2)] = (cl >> (d_v - k - 1)) & 1; + if (d_hierarchy == NH) { + int c = inh[bcount * d_bsize + i]; + + // Create the demultiplexer + for (int k = 0; k < d_v; k++) { + d_b[d_perm[(d_v * i) + k]][i] = (c >> (d_v - k - 1)) & 1; + } + } else { + int ch = inh[(bcount * d_bsize) + i]; + int cl = inl[(bcount * d_bsize) + i]; + + // High priority input - first 2 streams + for (int k = 0; k < 2; k++) { + d_b[(d_v * i + k) % 2][(d_v * i + k) / 2] = (ch >> (1 - k)) & 1; + } + + // Low priority input - (v - 2) streams + for (int k = 2; k < (d_v - 2); k++) { + d_b[d_perm[d_v * i + k]][(d_v * i + k) / (d_v - 2)] = + (cl >> (d_v - k - 1)) & 1; + } } - } } // Take one bit from each interleaver // and format the output for (int w = 0; w < d_bsize; w++) { - int val = 0; + int val = 0; - for (int e = 0; e < d_v; e++) { - val = (val << 1) | d_b[e][d_lookup_H[w][e]]; - } + for (int e = 0; e < d_v; e++) { + val = (val << 1) | d_b[e][d_lookup_H[w][e]]; + } - out[(bcount * d_bsize) + w] = val; + out[(bcount * d_bsize) + w] = val; } - } - - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (noutput_items); - - // Tell runtime system how many output items we produced. - return noutput_items; } - const int dvbt_bit_inner_interleaver_impl::d_lookup_H[INTERLEAVER_BLOCK_SIZE][MAX_MODULATION_ORDER] = - { - {0, 63, 105, 42, 21, 84}, - {1, 64, 106, 43, 22, 85}, - {2, 65, 107, 44, 23, 86}, - {3, 66, 108, 45, 24, 87}, - {4, 67, 109, 46, 25, 88}, - {5, 68, 110, 47, 26, 89}, - {6, 69, 111, 48, 27, 90}, - {7, 70, 112, 49, 28, 91}, - {8, 71, 113, 50, 29, 92}, - {9, 72, 114, 51, 30, 93}, - {10, 73, 115, 52, 31, 94}, - {11, 74, 116, 53, 32, 95}, - {12, 75, 117, 54, 33, 96}, - {13, 76, 118, 55, 34, 97}, - {14, 77, 119, 56, 35, 98}, - {15, 78, 120, 57, 36, 99}, - {16, 79, 121, 58, 37, 100}, - {17, 80, 122, 59, 38, 101}, - {18, 81, 123, 60, 39, 102}, - {19, 82, 124, 61, 40, 103}, - {20, 83, 125, 62, 41, 104}, - {21, 84, 0, 63, 42, 105}, - {22, 85, 1, 64, 43, 106}, - {23, 86, 2, 65, 44, 107}, - {24, 87, 3, 66, 45, 108}, - {25, 88, 4, 67, 46, 109}, - {26, 89, 5, 68, 47, 110}, - {27, 90, 6, 69, 48, 111}, - {28, 91, 7, 70, 49, 112}, - {29, 92, 8, 71, 50, 113}, - {30, 93, 9, 72, 51, 114}, - {31, 94, 10, 73, 52, 115}, - {32, 95, 11, 74, 53, 116}, - {33, 96, 12, 75, 54, 117}, - {34, 97, 13, 76, 55, 118}, - {35, 98, 14, 77, 56, 119}, - {36, 99, 15, 78, 57, 120}, - {37, 100, 16, 79, 58, 121}, - {38, 101, 17, 80, 59, 122}, - {39, 102, 18, 81, 60, 123}, - {40, 103, 19, 82, 61, 124}, - {41, 104, 20, 83, 62, 125}, - {42, 105, 21, 84, 63, 0}, - {43, 106, 22, 85, 64, 1}, - {44, 107, 23, 86, 65, 2}, - {45, 108, 24, 87, 66, 3}, - {46, 109, 25, 88, 67, 4}, - {47, 110, 26, 89, 68, 5}, - {48, 111, 27, 90, 69, 6}, - {49, 112, 28, 91, 70, 7}, - {50, 113, 29, 92, 71, 8}, - {51, 114, 30, 93, 72, 9}, - {52, 115, 31, 94, 73, 10}, - {53, 116, 32, 95, 74, 11}, - {54, 117, 33, 96, 75, 12}, - {55, 118, 34, 97, 76, 13}, - {56, 119, 35, 98, 77, 14}, - {57, 120, 36, 99, 78, 15}, - {58, 121, 37, 100, 79, 16}, - {59, 122, 38, 101, 80, 17}, - {60, 123, 39, 102, 81, 18}, - {61, 124, 40, 103, 82, 19}, - {62, 125, 41, 104, 83, 20}, - {63, 0, 42, 105, 84, 21}, - {64, 1, 43, 106, 85, 22}, - {65, 2, 44, 107, 86, 23}, - {66, 3, 45, 108, 87, 24}, - {67, 4, 46, 109, 88, 25}, - {68, 5, 47, 110, 89, 26}, - {69, 6, 48, 111, 90, 27}, - {70, 7, 49, 112, 91, 28}, - {71, 8, 50, 113, 92, 29}, - {72, 9, 51, 114, 93, 30}, - {73, 10, 52, 115, 94, 31}, - {74, 11, 53, 116, 95, 32}, - {75, 12, 54, 117, 96, 33}, - {76, 13, 55, 118, 97, 34}, - {77, 14, 56, 119, 98, 35}, - {78, 15, 57, 120, 99, 36}, - {79, 16, 58, 121, 100, 37}, - {80, 17, 59, 122, 101, 38}, - {81, 18, 60, 123, 102, 39}, - {82, 19, 61, 124, 103, 40}, - {83, 20, 62, 125, 104, 41}, - {84, 21, 63, 0, 105, 42}, - {85, 22, 64, 1, 106, 43}, - {86, 23, 65, 2, 107, 44}, - {87, 24, 66, 3, 108, 45}, - {88, 25, 67, 4, 109, 46}, - {89, 26, 68, 5, 110, 47}, - {90, 27, 69, 6, 111, 48}, - {91, 28, 70, 7, 112, 49}, - {92, 29, 71, 8, 113, 50}, - {93, 30, 72, 9, 114, 51}, - {94, 31, 73, 10, 115, 52}, - {95, 32, 74, 11, 116, 53}, - {96, 33, 75, 12, 117, 54}, - {97, 34, 76, 13, 118, 55}, - {98, 35, 77, 14, 119, 56}, - {99, 36, 78, 15, 120, 57}, - {100, 37, 79, 16, 121, 58}, - {101, 38, 80, 17, 122, 59}, - {102, 39, 81, 18, 123, 60}, - {103, 40, 82, 19, 124, 61}, - {104, 41, 83, 20, 125, 62}, - {105, 42, 84, 21, 0, 63}, - {106, 43, 85, 22, 1, 64}, - {107, 44, 86, 23, 2, 65}, - {108, 45, 87, 24, 3, 66}, - {109, 46, 88, 25, 4, 67}, - {110, 47, 89, 26, 5, 68}, - {111, 48, 90, 27, 6, 69}, - {112, 49, 91, 28, 7, 70}, - {113, 50, 92, 29, 8, 71}, - {114, 51, 93, 30, 9, 72}, - {115, 52, 94, 31, 10, 73}, - {116, 53, 95, 32, 11, 74}, - {117, 54, 96, 33, 12, 75}, - {118, 55, 97, 34, 13, 76}, - {119, 56, 98, 35, 14, 77}, - {120, 57, 99, 36, 15, 78}, - {121, 58, 100, 37, 16, 79}, - {122, 59, 101, 38, 17, 80}, - {123, 60, 102, 39, 18, 81}, - {124, 61, 103, 40, 19, 82}, - {125, 62, 104, 41, 20, 83} + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(noutput_items); + + // Tell runtime system how many output items we produced. + return noutput_items; +} + +const int dvbt_bit_inner_interleaver_impl::d_lookup_H + [INTERLEAVER_BLOCK_SIZE][MAX_MODULATION_ORDER] = { + { 0, 63, 105, 42, 21, 84 }, { 1, 64, 106, 43, 22, 85 }, + { 2, 65, 107, 44, 23, 86 }, { 3, 66, 108, 45, 24, 87 }, + { 4, 67, 109, 46, 25, 88 }, { 5, 68, 110, 47, 26, 89 }, + { 6, 69, 111, 48, 27, 90 }, { 7, 70, 112, 49, 28, 91 }, + { 8, 71, 113, 50, 29, 92 }, { 9, 72, 114, 51, 30, 93 }, + { 10, 73, 115, 52, 31, 94 }, { 11, 74, 116, 53, 32, 95 }, + { 12, 75, 117, 54, 33, 96 }, { 13, 76, 118, 55, 34, 97 }, + { 14, 77, 119, 56, 35, 98 }, { 15, 78, 120, 57, 36, 99 }, + { 16, 79, 121, 58, 37, 100 }, { 17, 80, 122, 59, 38, 101 }, + { 18, 81, 123, 60, 39, 102 }, { 19, 82, 124, 61, 40, 103 }, + { 20, 83, 125, 62, 41, 104 }, { 21, 84, 0, 63, 42, 105 }, + { 22, 85, 1, 64, 43, 106 }, { 23, 86, 2, 65, 44, 107 }, + { 24, 87, 3, 66, 45, 108 }, { 25, 88, 4, 67, 46, 109 }, + { 26, 89, 5, 68, 47, 110 }, { 27, 90, 6, 69, 48, 111 }, + { 28, 91, 7, 70, 49, 112 }, { 29, 92, 8, 71, 50, 113 }, + { 30, 93, 9, 72, 51, 114 }, { 31, 94, 10, 73, 52, 115 }, + { 32, 95, 11, 74, 53, 116 }, { 33, 96, 12, 75, 54, 117 }, + { 34, 97, 13, 76, 55, 118 }, { 35, 98, 14, 77, 56, 119 }, + { 36, 99, 15, 78, 57, 120 }, { 37, 100, 16, 79, 58, 121 }, + { 38, 101, 17, 80, 59, 122 }, { 39, 102, 18, 81, 60, 123 }, + { 40, 103, 19, 82, 61, 124 }, { 41, 104, 20, 83, 62, 125 }, + { 42, 105, 21, 84, 63, 0 }, { 43, 106, 22, 85, 64, 1 }, + { 44, 107, 23, 86, 65, 2 }, { 45, 108, 24, 87, 66, 3 }, + { 46, 109, 25, 88, 67, 4 }, { 47, 110, 26, 89, 68, 5 }, + { 48, 111, 27, 90, 69, 6 }, { 49, 112, 28, 91, 70, 7 }, + { 50, 113, 29, 92, 71, 8 }, { 51, 114, 30, 93, 72, 9 }, + { 52, 115, 31, 94, 73, 10 }, { 53, 116, 32, 95, 74, 11 }, + { 54, 117, 33, 96, 75, 12 }, { 55, 118, 34, 97, 76, 13 }, + { 56, 119, 35, 98, 77, 14 }, { 57, 120, 36, 99, 78, 15 }, + { 58, 121, 37, 100, 79, 16 }, { 59, 122, 38, 101, 80, 17 }, + { 60, 123, 39, 102, 81, 18 }, { 61, 124, 40, 103, 82, 19 }, + { 62, 125, 41, 104, 83, 20 }, { 63, 0, 42, 105, 84, 21 }, + { 64, 1, 43, 106, 85, 22 }, { 65, 2, 44, 107, 86, 23 }, + { 66, 3, 45, 108, 87, 24 }, { 67, 4, 46, 109, 88, 25 }, + { 68, 5, 47, 110, 89, 26 }, { 69, 6, 48, 111, 90, 27 }, + { 70, 7, 49, 112, 91, 28 }, { 71, 8, 50, 113, 92, 29 }, + { 72, 9, 51, 114, 93, 30 }, { 73, 10, 52, 115, 94, 31 }, + { 74, 11, 53, 116, 95, 32 }, { 75, 12, 54, 117, 96, 33 }, + { 76, 13, 55, 118, 97, 34 }, { 77, 14, 56, 119, 98, 35 }, + { 78, 15, 57, 120, 99, 36 }, { 79, 16, 58, 121, 100, 37 }, + { 80, 17, 59, 122, 101, 38 }, { 81, 18, 60, 123, 102, 39 }, + { 82, 19, 61, 124, 103, 40 }, { 83, 20, 62, 125, 104, 41 }, + { 84, 21, 63, 0, 105, 42 }, { 85, 22, 64, 1, 106, 43 }, + { 86, 23, 65, 2, 107, 44 }, { 87, 24, 66, 3, 108, 45 }, + { 88, 25, 67, 4, 109, 46 }, { 89, 26, 68, 5, 110, 47 }, + { 90, 27, 69, 6, 111, 48 }, { 91, 28, 70, 7, 112, 49 }, + { 92, 29, 71, 8, 113, 50 }, { 93, 30, 72, 9, 114, 51 }, + { 94, 31, 73, 10, 115, 52 }, { 95, 32, 74, 11, 116, 53 }, + { 96, 33, 75, 12, 117, 54 }, { 97, 34, 76, 13, 118, 55 }, + { 98, 35, 77, 14, 119, 56 }, { 99, 36, 78, 15, 120, 57 }, + { 100, 37, 79, 16, 121, 58 }, { 101, 38, 80, 17, 122, 59 }, + { 102, 39, 81, 18, 123, 60 }, { 103, 40, 82, 19, 124, 61 }, + { 104, 41, 83, 20, 125, 62 }, { 105, 42, 84, 21, 0, 63 }, + { 106, 43, 85, 22, 1, 64 }, { 107, 44, 86, 23, 2, 65 }, + { 108, 45, 87, 24, 3, 66 }, { 109, 46, 88, 25, 4, 67 }, + { 110, 47, 89, 26, 5, 68 }, { 111, 48, 90, 27, 6, 69 }, + { 112, 49, 91, 28, 7, 70 }, { 113, 50, 92, 29, 8, 71 }, + { 114, 51, 93, 30, 9, 72 }, { 115, 52, 94, 31, 10, 73 }, + { 116, 53, 95, 32, 11, 74 }, { 117, 54, 96, 33, 12, 75 }, + { 118, 55, 97, 34, 13, 76 }, { 119, 56, 98, 35, 14, 77 }, + { 120, 57, 99, 36, 15, 78 }, { 121, 58, 100, 37, 16, 79 }, + { 122, 59, 101, 38, 17, 80 }, { 123, 60, 102, 39, 18, 81 }, + { 124, 61, 103, 40, 19, 82 }, { 125, 62, 104, 41, 20, 83 } }; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.h b/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.h index 5fc5e109f8..b6d6d4203b 100644 --- a/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,40 +25,42 @@ #include "dvbt_configure.h" namespace gr { - namespace dtv { +namespace dtv { - class dvbt_bit_inner_interleaver_impl : public dvbt_bit_inner_interleaver - { - private: - const dvbt_configure config; +class dvbt_bit_inner_interleaver_impl : public dvbt_bit_inner_interleaver +{ +private: + const dvbt_configure config; - static const int d_lookup_H[126][6]; + static const int d_lookup_H[126][6]; - int d_nsize; - dvbt_hierarchy_t d_hierarchy; + int d_nsize; + dvbt_hierarchy_t d_hierarchy; - // constellation - int d_v; - // Bit interleaver block size - static const int d_bsize; + // constellation + int d_v; + // Bit interleaver block size + static const int d_bsize; - // Table to keep interleaved indices - unsigned char * d_perm; + // Table to keep interleaved indices + unsigned char* d_perm; - public: - dvbt_bit_inner_interleaver_impl(int nsize, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission); - ~dvbt_bit_inner_interleaver_impl(); +public: + dvbt_bit_inner_interleaver_impl(int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission); + ~dvbt_bit_inner_interleaver_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_BIT_INNER_INTERLEAVER_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_configure.cc b/gr-dtv/lib/dvbt/dvbt_configure.cc index 33f5cc838b..7f47961267 100644 --- a/gr-dtv/lib/dvbt/dvbt_configure.cc +++ b/gr-dtv/lib/dvbt/dvbt_configure.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,250 +27,247 @@ #include <iostream> namespace gr { - namespace dtv { +namespace dtv { - void - dvbt_configure::set_frame_number(int fn) - { - d_frame_index = fn; - } - int - dvbt_configure::get_frame_mumber() - { - return (d_frame_index); - } - void - dvbt_configure::set_constellation(dvb_constellation_t constellation) - { - d_constellation = constellation; - } - dvb_constellation_t - dvbt_configure::get_constellation() - { - return (d_constellation); - } - void - dvbt_configure::set_hierarchical(dvbt_hierarchy_t hierarchy) - { - d_hierarchy = hierarchy; - } - dvbt_hierarchy_t - dvbt_configure::get_hierarchical() - { - return d_hierarchy; - } - void - dvbt_configure::set_code_rate_HP(dvb_code_rate_t code_rate) - { - d_code_rate_HP = code_rate; - } - void - dvbt_configure::set_code_rate_LP(dvb_code_rate_t code_rate) - { - d_code_rate_LP = code_rate; - } - dvb_code_rate_t - dvbt_configure::get_code_rate_HP() - { - return d_code_rate_HP; - } - dvb_code_rate_t - dvbt_configure::get_code_rate_LP() - { - return d_code_rate_LP; - } - void - dvbt_configure::set_transmission_mode(dvbt_transmission_mode_t transmission_mode) - { - d_transmission_mode = transmission_mode; - } - dvbt_transmission_mode_t - dvbt_configure::get_transmission_mode() - { - return d_transmission_mode; - } +void dvbt_configure::set_frame_number(int fn) { d_frame_index = fn; } +int dvbt_configure::get_frame_mumber() { return (d_frame_index); } +void dvbt_configure::set_constellation(dvb_constellation_t constellation) +{ + d_constellation = constellation; +} +dvb_constellation_t dvbt_configure::get_constellation() { return (d_constellation); } +void dvbt_configure::set_hierarchical(dvbt_hierarchy_t hierarchy) +{ + d_hierarchy = hierarchy; +} +dvbt_hierarchy_t dvbt_configure::get_hierarchical() { return d_hierarchy; } +void dvbt_configure::set_code_rate_HP(dvb_code_rate_t code_rate) +{ + d_code_rate_HP = code_rate; +} +void dvbt_configure::set_code_rate_LP(dvb_code_rate_t code_rate) +{ + d_code_rate_LP = code_rate; +} +dvb_code_rate_t dvbt_configure::get_code_rate_HP() { return d_code_rate_HP; } +dvb_code_rate_t dvbt_configure::get_code_rate_LP() { return d_code_rate_LP; } +void dvbt_configure::set_transmission_mode(dvbt_transmission_mode_t transmission_mode) +{ + d_transmission_mode = transmission_mode; +} +dvbt_transmission_mode_t dvbt_configure::get_transmission_mode() +{ + return d_transmission_mode; +} - dvbt_configure::dvbt_configure(dvb_constellation_t constellation, \ - dvbt_hierarchy_t hierarchy, dvb_code_rate_t code_rate_HP, \ - dvb_code_rate_t code_rate_LP, dvb_guardinterval_t guard_interval, \ - dvbt_transmission_mode_t transmission_mode, int include_cell_id, int cell_id) : - d_constellation(constellation), d_hierarchy(hierarchy), d_code_rate_HP(code_rate_HP), - d_code_rate_LP(code_rate_LP), d_guard_interval(guard_interval), d_transmission_mode(transmission_mode), - d_include_cell_id(include_cell_id), d_cell_id(cell_id) - { - d_symbols_per_frame = 68; - d_frames_per_superframe = 4; - d_symbol_index = 0; - d_frame_index = 0; - d_superframe_index = 0; +dvbt_configure::dvbt_configure(dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t code_rate_HP, + dvb_code_rate_t code_rate_LP, + dvb_guardinterval_t guard_interval, + dvbt_transmission_mode_t transmission_mode, + int include_cell_id, + int cell_id) + : d_constellation(constellation), + d_hierarchy(hierarchy), + d_code_rate_HP(code_rate_HP), + d_code_rate_LP(code_rate_LP), + d_guard_interval(guard_interval), + d_transmission_mode(transmission_mode), + d_include_cell_id(include_cell_id), + d_cell_id(cell_id) +{ + d_symbols_per_frame = 68; + d_frames_per_superframe = 4; + d_symbol_index = 0; + d_frame_index = 0; + d_superframe_index = 0; - switch (d_transmission_mode) { - case T2k: - d_Kmin = 0; d_Kmax = 1704; - d_fft_length = 2048; - d_payload_length = 1512; - break; - case T8k: - d_Kmin = 0; d_Kmax = 6816; - d_fft_length = 8192; - d_payload_length = 6048; - break; - default: - d_Kmin = 0; d_Kmax = 1704; - d_fft_length = 2048; - d_payload_length = 1512; - break; - } - d_zeros_on_left = int(ceil((d_fft_length - (d_Kmax - d_Kmin + 1)) / 2.0)); - d_zeros_on_right = d_fft_length - d_zeros_on_left - (d_Kmax - d_Kmin + 1); + switch (d_transmission_mode) { + case T2k: + d_Kmin = 0; + d_Kmax = 1704; + d_fft_length = 2048; + d_payload_length = 1512; + break; + case T8k: + d_Kmin = 0; + d_Kmax = 6816; + d_fft_length = 8192; + d_payload_length = 6048; + break; + default: + d_Kmin = 0; + d_Kmax = 1704; + d_fft_length = 2048; + d_payload_length = 1512; + break; + } + d_zeros_on_left = int(ceil((d_fft_length - (d_Kmax - d_Kmin + 1)) / 2.0)); + d_zeros_on_right = d_fft_length - d_zeros_on_left - (d_Kmax - d_Kmin + 1); - switch (d_constellation) { - case MOD_QPSK: - d_constellation_size = 4; - d_step = 2; - d_m = 2; - break; - case MOD_16QAM: - d_constellation_size = 16; - d_step = 2; - d_m = 4; - break; - case MOD_64QAM: - d_constellation_size = 64; - d_step = 2; - d_m = 6; - break; - default: - d_constellation_size = 16; - d_step = 2; - d_m = 4; - break; - } + switch (d_constellation) { + case MOD_QPSK: + d_constellation_size = 4; + d_step = 2; + d_m = 2; + break; + case MOD_16QAM: + d_constellation_size = 16; + d_step = 2; + d_m = 4; + break; + case MOD_64QAM: + d_constellation_size = 64; + d_step = 2; + d_m = 6; + break; + default: + d_constellation_size = 16; + d_step = 2; + d_m = 4; + break; + } - switch (d_code_rate_HP) { - case C1_2: - d_cr_k = 1; d_cr_n = 2; d_cr_p = 1; - break; - case C2_3: - d_cr_k = 2; d_cr_n = 3; d_cr_p = 2; - break; - case C3_4: - d_cr_k = 3; d_cr_n = 4; d_cr_p = 3; - break; - case C5_6: - d_cr_k = 5; d_cr_n = 6; d_cr_p = 5; - break; - case C7_8: - d_cr_k = 7; d_cr_n = 8; d_cr_p = 7; - break; - default: - d_cr_k = 1; d_cr_n = 2; d_cr_p = 1; - break; - } + switch (d_code_rate_HP) { + case C1_2: + d_cr_k = 1; + d_cr_n = 2; + d_cr_p = 1; + break; + case C2_3: + d_cr_k = 2; + d_cr_n = 3; + d_cr_p = 2; + break; + case C3_4: + d_cr_k = 3; + d_cr_n = 4; + d_cr_p = 3; + break; + case C5_6: + d_cr_k = 5; + d_cr_n = 6; + d_cr_p = 5; + break; + case C7_8: + d_cr_k = 7; + d_cr_n = 8; + d_cr_p = 7; + break; + default: + d_cr_k = 1; + d_cr_n = 2; + d_cr_p = 1; + break; + } - switch (d_code_rate_LP) { - case C1_2: - d_cr_k = 1; d_cr_n = 2; - break; - case C2_3: - d_cr_k = 2; d_cr_n = 3; - break; - case C3_4: - d_cr_k = 3; d_cr_n = 4; - break; - case C5_6: - d_cr_k = 5; d_cr_n = 6; - break; - case C7_8: - d_cr_k = 7; d_cr_n = 8; - break; - default: - d_cr_k = 1; d_cr_n = 2; - break; - } + switch (d_code_rate_LP) { + case C1_2: + d_cr_k = 1; + d_cr_n = 2; + break; + case C2_3: + d_cr_k = 2; + d_cr_n = 3; + break; + case C3_4: + d_cr_k = 3; + d_cr_n = 4; + break; + case C5_6: + d_cr_k = 5; + d_cr_n = 6; + break; + case C7_8: + d_cr_k = 7; + d_cr_n = 8; + break; + default: + d_cr_k = 1; + d_cr_n = 2; + break; + } - switch (guard_interval) { - case GI_1_32: - d_cp_length = d_fft_length / 32; - break; - case GI_1_16: - d_cp_length = d_fft_length / 16; - break; - case GI_1_8: - d_cp_length = d_fft_length / 8; - break; - case GI_1_4: - d_cp_length = d_fft_length / 4; - break; - default: - d_cp_length = d_fft_length / 32; - break; - } + switch (guard_interval) { + case GI_1_32: + d_cp_length = d_fft_length / 32; + break; + case GI_1_16: + d_cp_length = d_fft_length / 16; + break; + case GI_1_8: + d_cp_length = d_fft_length / 8; + break; + case GI_1_4: + d_cp_length = d_fft_length / 4; + break; + default: + d_cp_length = d_fft_length / 32; + break; + } - switch (d_hierarchy) { - case NH: - d_alpha = 1; - break; - case ALPHA1: - d_alpha = 1; - break; - case ALPHA2: - d_alpha = 2; - break; - case ALPHA4: - d_alpha = 4; - break; - default: - d_alpha = 1; - break; - } + switch (d_hierarchy) { + case NH: + d_alpha = 1; + break; + case ALPHA1: + d_alpha = 1; + break; + case ALPHA2: + d_alpha = 2; + break; + case ALPHA4: + d_alpha = 4; + break; + default: + d_alpha = 1; + break; + } - // ETSI EN 400 744 Clause 4.4 - // Normalization factor - switch (d_m) { - case 2: - d_norm = 1.0 / sqrt(2); - break; - case 4: - if (d_alpha == 1) { + // ETSI EN 400 744 Clause 4.4 + // Normalization factor + switch (d_m) { + case 2: + d_norm = 1.0 / sqrt(2); + break; + case 4: + if (d_alpha == 1) { d_norm = 1.0 / sqrt(10); - } - if (d_alpha == 2) { + } + if (d_alpha == 2) { d_norm = 1.0 / sqrt(20); - } - if (d_alpha == 4) { + } + if (d_alpha == 4) { d_norm = 1.0 / sqrt(52); - } - break; - case 6: - if (d_alpha == 1) { + } + break; + case 6: + if (d_alpha == 1) { d_norm = 1.0 / sqrt(42); - } - if (d_alpha == 2) { + } + if (d_alpha == 2) { d_norm = 1.0 / sqrt(60); - } - if (d_alpha == 4) { + } + if (d_alpha == 4) { d_norm = 1.0 / sqrt(108); - } - break; - default: - if (d_alpha == 1) { + } + break; + default: + if (d_alpha == 1) { d_norm = 1.0 / sqrt(10); - } - if (d_alpha == 2) { + } + if (d_alpha == 2) { d_norm = 1.0 / sqrt(20); - } - if (d_alpha == 4) { + } + if (d_alpha == 4) { d_norm = 1.0 / sqrt(52); - } - break; - } + } + break; } +} - dvbt_configure::~dvbt_configure() - { - } +dvbt_configure::~dvbt_configure() {} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt/dvbt_configure.h b/gr-dtv/lib/dvbt/dvbt_configure.h index 5e87410c90..672da63dcf 100644 --- a/gr-dtv/lib/dvbt/dvbt_configure.h +++ b/gr-dtv/lib/dvbt/dvbt_configure.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,79 +25,82 @@ #include <gnuradio/dtv/dvbt_config.h> namespace gr { - namespace dtv { - - class dvbt_configure - { - public: - int d_symbols_per_frame; - int d_frames_per_superframe; - - int d_symbol_index; - int d_frame_index; - int d_superframe_index; - - //Constelaltion parameters - dvb_constellation_t d_constellation; - int d_constellation_size; - int d_step; - int d_m; - float d_norm; - - //Hierarchy information - dvbt_hierarchy_t d_hierarchy; - int d_alpha; - - //Inner Coding parameters - dvb_code_rate_t d_code_rate_HP; - dvb_code_rate_t d_code_rate_LP; - - // Guard interval length - dvb_guardinterval_t d_guard_interval; - - //Transmission type parameters - dvbt_transmission_mode_t d_transmission_mode; - - //Include cell id + cell id parameters - int d_include_cell_id; - int d_cell_id; - - // Puncturer parameters - int d_cr_k; - int d_cr_n; - int d_cr_p; - - //Other DVB-T parameters - int d_Kmin; - int d_Kmax; - int d_fft_length; - int d_payload_length; - int d_zeros_on_left; - int d_zeros_on_right; - int d_cp_length; - - void set_frame_number(int fn); - int get_frame_mumber(); - void set_constellation(dvb_constellation_t constellation); - dvb_constellation_t get_constellation(); - void set_hierarchical(dvbt_hierarchy_t hierarchy); - dvbt_hierarchy_t get_hierarchical(); - void set_code_rate_HP(dvb_code_rate_t coderate); - dvb_code_rate_t get_code_rate_HP(); - void set_code_rate_LP(dvb_code_rate_t coderate); - dvb_code_rate_t get_code_rate_LP(); - void set_transmission_mode(dvbt_transmission_mode_t transmission_mode); - dvbt_transmission_mode_t get_transmission_mode(); - - dvbt_configure(dvb_constellation_t constellation = gr::dtv::MOD_16QAM, \ - dvbt_hierarchy_t hierarchy = gr::dtv::NH, dvb_code_rate_t code_rate_HP = gr::dtv::C1_2, \ - dvb_code_rate_t code_rate_LP = gr::dtv::C1_2, dvb_guardinterval_t guard_interval = gr::dtv::GI_1_32, \ - dvbt_transmission_mode_t transmission_mode = gr::dtv::T2k, int include_cell_id = 0, int cell_id = 0); - ~dvbt_configure(); - }; - - } // namespace dtv +namespace dtv { + +class dvbt_configure +{ +public: + int d_symbols_per_frame; + int d_frames_per_superframe; + + int d_symbol_index; + int d_frame_index; + int d_superframe_index; + + // Constelaltion parameters + dvb_constellation_t d_constellation; + int d_constellation_size; + int d_step; + int d_m; + float d_norm; + + // Hierarchy information + dvbt_hierarchy_t d_hierarchy; + int d_alpha; + + // Inner Coding parameters + dvb_code_rate_t d_code_rate_HP; + dvb_code_rate_t d_code_rate_LP; + + // Guard interval length + dvb_guardinterval_t d_guard_interval; + + // Transmission type parameters + dvbt_transmission_mode_t d_transmission_mode; + + // Include cell id + cell id parameters + int d_include_cell_id; + int d_cell_id; + + // Puncturer parameters + int d_cr_k; + int d_cr_n; + int d_cr_p; + + // Other DVB-T parameters + int d_Kmin; + int d_Kmax; + int d_fft_length; + int d_payload_length; + int d_zeros_on_left; + int d_zeros_on_right; + int d_cp_length; + + void set_frame_number(int fn); + int get_frame_mumber(); + void set_constellation(dvb_constellation_t constellation); + dvb_constellation_t get_constellation(); + void set_hierarchical(dvbt_hierarchy_t hierarchy); + dvbt_hierarchy_t get_hierarchical(); + void set_code_rate_HP(dvb_code_rate_t coderate); + dvb_code_rate_t get_code_rate_HP(); + void set_code_rate_LP(dvb_code_rate_t coderate); + dvb_code_rate_t get_code_rate_LP(); + void set_transmission_mode(dvbt_transmission_mode_t transmission_mode); + dvbt_transmission_mode_t get_transmission_mode(); + + dvbt_configure(dvb_constellation_t constellation = gr::dtv::MOD_16QAM, + dvbt_hierarchy_t hierarchy = gr::dtv::NH, + dvb_code_rate_t code_rate_HP = gr::dtv::C1_2, + dvb_code_rate_t code_rate_LP = gr::dtv::C1_2, + dvb_guardinterval_t guard_interval = gr::dtv::GI_1_32, + dvbt_transmission_mode_t transmission_mode = gr::dtv::T2k, + int include_cell_id = 0, + int cell_id = 0); + ~dvbt_configure(); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_CONFIGURE_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_convolutional_deinterleaver_impl.cc b/gr-dtv/lib/dvbt/dvbt_convolutional_deinterleaver_impl.cc index c04b433f7f..0c22744de3 100644 --- a/gr-dtv/lib/dvbt/dvbt_convolutional_deinterleaver_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_convolutional_deinterleaver_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,112 +26,119 @@ #include "dvbt_convolutional_deinterleaver_impl.h" namespace gr { - namespace dtv { +namespace dtv { - const int dvbt_convolutional_deinterleaver_impl::d_SYNC = 0x47; - const int dvbt_convolutional_deinterleaver_impl::d_NSYNC = 0xB8; - const int dvbt_convolutional_deinterleaver_impl::d_MUX_PKT = 8; +const int dvbt_convolutional_deinterleaver_impl::d_SYNC = 0x47; +const int dvbt_convolutional_deinterleaver_impl::d_NSYNC = 0xB8; +const int dvbt_convolutional_deinterleaver_impl::d_MUX_PKT = 8; - dvbt_convolutional_deinterleaver::sptr - dvbt_convolutional_deinterleaver::make(int nsize, int I, int M) - { - return gnuradio::get_initial_sptr - (new dvbt_convolutional_deinterleaver_impl(nsize, I, M)); - } +dvbt_convolutional_deinterleaver::sptr +dvbt_convolutional_deinterleaver::make(int nsize, int I, int M) +{ + return gnuradio::get_initial_sptr( + new dvbt_convolutional_deinterleaver_impl(nsize, I, M)); +} - /* - * The private constructor - */ - dvbt_convolutional_deinterleaver_impl::dvbt_convolutional_deinterleaver_impl(int blocks, int I, int M) - : block("dvbt_convolutional_deinterleaver", - io_signature::make(1, 1, sizeof (unsigned char)), - io_signature::make(1, 1, sizeof (unsigned char) * I * blocks)), - d_blocks(blocks), d_I(I), d_M(M) - { - set_relative_rate(1, (uint64_t)(d_I * d_blocks)); - set_output_multiple(2); - //The positions are shift registers (FIFOs) - //of length i*M - for (int i = (d_I - 1); i >= 0; i--) { +/* + * The private constructor + */ +dvbt_convolutional_deinterleaver_impl::dvbt_convolutional_deinterleaver_impl(int blocks, + int I, + int M) + : block("dvbt_convolutional_deinterleaver", + io_signature::make(1, 1, sizeof(unsigned char)), + io_signature::make(1, 1, sizeof(unsigned char) * I * blocks)), + d_blocks(blocks), + d_I(I), + d_M(M) +{ + set_relative_rate(1, (uint64_t)(d_I * d_blocks)); + set_output_multiple(2); + // The positions are shift registers (FIFOs) + // of length i*M + for (int i = (d_I - 1); i >= 0; i--) { d_shift.push_back(new std::deque<unsigned char>(d_M * i, 0)); - } - - // There are 8 mux packets - assert(d_blocks / d_M == d_MUX_PKT); } - /* - * Our virtual destructor. - */ - dvbt_convolutional_deinterleaver_impl::~dvbt_convolutional_deinterleaver_impl() - { - for (unsigned int i = 0; i < d_shift.size(); i++) { + // There are 8 mux packets + assert(d_blocks / d_M == d_MUX_PKT); +} + +/* + * Our virtual destructor. + */ +dvbt_convolutional_deinterleaver_impl::~dvbt_convolutional_deinterleaver_impl() +{ + for (unsigned int i = 0; i < d_shift.size(); i++) { delete d_shift.back(); d_shift.pop_back(); - } } +} - void - dvbt_convolutional_deinterleaver_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - int ninputs = ninput_items_required.size (); +void dvbt_convolutional_deinterleaver_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + int ninputs = ninput_items_required.size(); - for (int i = 0; i < ninputs; i++) { + for (int i = 0; i < ninputs; i++) { ninput_items_required[i] = noutput_items * d_I * d_blocks; - } } +} - int - dvbt_convolutional_deinterleaver_impl::general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; +int dvbt_convolutional_deinterleaver_impl::general_work( + int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; - int to_out = noutput_items; + int to_out = noutput_items; - /* - * Look for a tag that signals superframe_start and consume all input items - * that are in input buffer so far. - * This will actually reset the convolutional deinterleaver - */ - std::vector<tag_t> tags; - const uint64_t nread = this->nitems_read(0); //number of items read on port 0 - this->get_tags_in_range(tags, 0, nread, nread + (noutput_items * d_I * d_blocks), pmt::string_to_symbol("superframe_start")); - - if (tags.size()) { + /* + * Look for a tag that signals superframe_start and consume all input items + * that are in input buffer so far. + * This will actually reset the convolutional deinterleaver + */ + std::vector<tag_t> tags; + const uint64_t nread = this->nitems_read(0); // number of items read on port 0 + this->get_tags_in_range(tags, + 0, + nread, + nread + (noutput_items * d_I * d_blocks), + pmt::string_to_symbol("superframe_start")); + + if (tags.size()) { if (tags[0].offset - nread) { - consume_each(tags[0].offset - nread); - return (0); + consume_each(tags[0].offset - nread); + return (0); } - } + } - /* - * At this moment the first item in input buffer should be NSYNC or SYNC - */ + /* + * At this moment the first item in input buffer should be NSYNC or SYNC + */ - for (int count = 0, i = 0; i < to_out; i++) { + for (int count = 0, i = 0; i < to_out; i++) { for (int mux_pkt = 0; mux_pkt < d_MUX_PKT; mux_pkt++) { - // This is actually the deinterleaver - for (int k = 0; k < (d_M * d_I); k++) { - d_shift[k % d_I]->push_back(in[count]); - out[count++] = d_shift[k % d_I]->front(); - d_shift[k % d_I]->pop_front(); - } + // This is actually the deinterleaver + for (int k = 0; k < (d_M * d_I); k++) { + d_shift[k % d_I]->push_back(in[count]); + out[count++] = d_shift[k % d_I]->front(); + d_shift[k % d_I]->pop_front(); + } } - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each(d_I * d_blocks * to_out); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(d_I * d_blocks * to_out); - // Tell runtime system how many output items we produced. - return (to_out); - } + // Tell runtime system how many output items we produced. + return (to_out); +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt/dvbt_convolutional_deinterleaver_impl.h b/gr-dtv/lib/dvbt/dvbt_convolutional_deinterleaver_impl.h index 7b3fafecad..e4a37d8a79 100644 --- a/gr-dtv/lib/dvbt/dvbt_convolutional_deinterleaver_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_convolutional_deinterleaver_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -24,34 +24,33 @@ #include <gnuradio/dtv/dvbt_convolutional_deinterleaver.h> namespace gr { - namespace dtv { +namespace dtv { - class dvbt_convolutional_deinterleaver_impl : public dvbt_convolutional_deinterleaver - { - private: - static const int d_SYNC; - static const int d_NSYNC; - static const int d_MUX_PKT; +class dvbt_convolutional_deinterleaver_impl : public dvbt_convolutional_deinterleaver +{ +private: + static const int d_SYNC; + static const int d_NSYNC; + static const int d_MUX_PKT; - int d_blocks; - int d_I; - int d_M; - std::vector< std::deque<unsigned char> * > d_shift; + int d_blocks; + int d_I; + int d_M; + std::vector<std::deque<unsigned char>*> d_shift; - public: - dvbt_convolutional_deinterleaver_impl(int nsize, int I, int M); - ~dvbt_convolutional_deinterleaver_impl(); +public: + dvbt_convolutional_deinterleaver_impl(int nsize, int I, int M); + ~dvbt_convolutional_deinterleaver_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_CONVOLUTIONAL_DEINTERLEAVER_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_convolutional_interleaver_impl.cc b/gr-dtv/lib/dvbt/dvbt_convolutional_interleaver_impl.cc index ee440bc789..69127cb271 100644 --- a/gr-dtv/lib/dvbt/dvbt_convolutional_interleaver_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_convolutional_interleaver_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,63 +27,65 @@ #include <deque> namespace gr { - namespace dtv { +namespace dtv { - dvbt_convolutional_interleaver::sptr - dvbt_convolutional_interleaver::make(int nsize, int I, int M) - { - return gnuradio::get_initial_sptr - (new dvbt_convolutional_interleaver_impl(nsize, I, M)); - } +dvbt_convolutional_interleaver::sptr +dvbt_convolutional_interleaver::make(int nsize, int I, int M) +{ + return gnuradio::get_initial_sptr( + new dvbt_convolutional_interleaver_impl(nsize, I, M)); +} - /* - * The private constructor - */ - dvbt_convolutional_interleaver_impl::dvbt_convolutional_interleaver_impl(int blocks, int I, int M) - : sync_interpolator("dvbt_convolutional_interleaver", - io_signature::make(1, 1, sizeof (unsigned char) * I * blocks), - io_signature::make(1, 1, sizeof (unsigned char)), I * blocks), - d_I(I), d_M(M) - { - //Positions are shift registers (FIFOs) - //of length i*M - for (int i = 0; i < d_I; i++) { +/* + * The private constructor + */ +dvbt_convolutional_interleaver_impl::dvbt_convolutional_interleaver_impl(int blocks, + int I, + int M) + : sync_interpolator("dvbt_convolutional_interleaver", + io_signature::make(1, 1, sizeof(unsigned char) * I * blocks), + io_signature::make(1, 1, sizeof(unsigned char)), + I * blocks), + d_I(I), + d_M(M) +{ + // Positions are shift registers (FIFOs) + // of length i*M + for (int i = 0; i < d_I; i++) { d_shift.push_back(new std::deque<unsigned char>(d_M * i, 0)); - } } +} - /* - * Our virtual destructor. - */ - dvbt_convolutional_interleaver_impl::~dvbt_convolutional_interleaver_impl() - { - for (unsigned int i = 0; i < d_shift.size(); i++) { +/* + * Our virtual destructor. + */ +dvbt_convolutional_interleaver_impl::~dvbt_convolutional_interleaver_impl() +{ + for (unsigned int i = 0; i < d_shift.size(); i++) { delete d_shift.back(); d_shift.pop_back(); - } } +} - int - dvbt_convolutional_interleaver_impl::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; +int dvbt_convolutional_interleaver_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; - for (int i = 0; i < (noutput_items / d_I); i++) { - //Process one block of I symbols + for (int i = 0; i < (noutput_items / d_I); i++) { + // Process one block of I symbols for (unsigned int j = 0; j < d_shift.size(); j++) { - d_shift[j]->push_front(in[(d_I * i) + j]); - out[(d_I * i) + j] = d_shift[j]->back(); - d_shift[j]->pop_back(); + d_shift[j]->push_front(in[(d_I * i) + j]); + out[(d_I * i) + j] = d_shift[j]->back(); + d_shift[j]->pop_back(); } - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ -} /* namespace gr */ + // Tell runtime system how many output items we produced. + return noutput_items; +} +} /* namespace dtv */ +} /* namespace gr */ diff --git a/gr-dtv/lib/dvbt/dvbt_convolutional_interleaver_impl.h b/gr-dtv/lib/dvbt/dvbt_convolutional_interleaver_impl.h index 391e0ef77c..f5094bc321 100644 --- a/gr-dtv/lib/dvbt/dvbt_convolutional_interleaver_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_convolutional_interleaver_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,26 +26,25 @@ #include <deque> namespace gr { - namespace dtv { +namespace dtv { - class dvbt_convolutional_interleaver_impl : public dvbt_convolutional_interleaver - { - private: - int d_I; - int d_M; - std::vector< std::deque<unsigned char> * > d_shift; +class dvbt_convolutional_interleaver_impl : public dvbt_convolutional_interleaver +{ +private: + int d_I; + int d_M; + std::vector<std::deque<unsigned char>*> d_shift; - public: - dvbt_convolutional_interleaver_impl(int nsize, int I, int M); - ~dvbt_convolutional_interleaver_impl(); +public: + dvbt_convolutional_interleaver_impl(int nsize, int I, int M); + ~dvbt_convolutional_interleaver_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_CONVOLUTIONAL_INTERLEAVER_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_demap_impl.cc b/gr-dtv/lib/dvbt/dvbt_demap_impl.cc index 65d659226c..77e6aa08ca 100644 --- a/gr-dtv/lib/dvbt/dvbt_demap_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_demap_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,77 +27,90 @@ #include <volk/volk.h> namespace gr { - namespace dtv { - - dvbt_demap::sptr - dvbt_demap::make(int nsize, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, \ - dvbt_transmission_mode_t transmission, float gain) - { - return gnuradio::get_initial_sptr - (new dvbt_demap_impl(nsize, constellation, hierarchy, transmission, gain)); - } - - /* - * The private constructor - */ - dvbt_demap_impl::dvbt_demap_impl(int nsize, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, \ - dvbt_transmission_mode_t transmission, float gain) - : block("dvbt_demap", - io_signature::make(1, 1, sizeof (gr_complex) * nsize), - io_signature::make(1, 1, sizeof (unsigned char) * nsize)), - config(constellation, hierarchy, gr::dtv::C1_2, gr::dtv::C1_2, gr::dtv::GI_1_32, transmission), +namespace dtv { + +dvbt_demap::sptr dvbt_demap::make(int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission, + float gain) +{ + return gnuradio::get_initial_sptr( + new dvbt_demap_impl(nsize, constellation, hierarchy, transmission, gain)); +} + +/* + * The private constructor + */ +dvbt_demap_impl::dvbt_demap_impl(int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission, + float gain) + : block("dvbt_demap", + io_signature::make(1, 1, sizeof(gr_complex) * nsize), + io_signature::make(1, 1, sizeof(unsigned char) * nsize)), + config(constellation, + hierarchy, + gr::dtv::C1_2, + gr::dtv::C1_2, + gr::dtv::GI_1_32, + transmission), d_nsize(nsize), d_constellation_size(0), d_step(0), d_alpha(0), d_gain(0.0) - { - //Get parameters from config object - d_constellation_size = config.d_constellation_size; - d_transmission_mode = config.d_transmission_mode; - d_step = config.d_step; - d_alpha = config.d_alpha; - d_gain = gain * config.d_norm; - - d_constellation_points = (gr_complex*) volk_malloc(sizeof(gr_complex) * d_constellation_size, volk_get_alignment()); - if (d_constellation_points == NULL) { - GR_LOG_FATAL(d_logger, "DVB-T Demap, cannot allocate memory for d_constellation_points."); +{ + // Get parameters from config object + d_constellation_size = config.d_constellation_size; + d_transmission_mode = config.d_transmission_mode; + d_step = config.d_step; + d_alpha = config.d_alpha; + d_gain = gain * config.d_norm; + + d_constellation_points = (gr_complex*)volk_malloc( + sizeof(gr_complex) * d_constellation_size, volk_get_alignment()); + if (d_constellation_points == NULL) { + GR_LOG_FATAL(d_logger, + "DVB-T Demap, cannot allocate memory for d_constellation_points."); throw std::bad_alloc(); - } + } - d_sq_dist = (float*) volk_malloc(sizeof(float) * d_constellation_size, volk_get_alignment()); - if (d_sq_dist == NULL) { + d_sq_dist = + (float*)volk_malloc(sizeof(float) * d_constellation_size, volk_get_alignment()); + if (d_sq_dist == NULL) { GR_LOG_FATAL(d_logger, "DVB-T Demap, cannot allocate memory for d_sq_dist."); volk_free(d_constellation_points); throw std::bad_alloc(); - } - - make_constellation_points(d_constellation_size, d_step, d_alpha); } - /* - * Our virtual destructor. - */ - dvbt_demap_impl::~dvbt_demap_impl() - { - volk_free(d_sq_dist); - volk_free(d_constellation_points); - } + make_constellation_points(d_constellation_size, d_step, d_alpha); +} + +/* + * Our virtual destructor. + */ +dvbt_demap_impl::~dvbt_demap_impl() +{ + volk_free(d_sq_dist); + volk_free(d_constellation_points); +} - void - dvbt_demap_impl::make_constellation_points(int size, int step, int alpha) - { - // The symmetry of the constellation is used to calculate - // 16QAM from QPSK and 64QAM from 16QAM +void dvbt_demap_impl::make_constellation_points(int size, int step, int alpha) +{ + // The symmetry of the constellation is used to calculate + // 16QAM from QPSK and 64QAM from 16QAM - int bits_per_axis = log2(size) / 2; - int steps_per_axis = sqrt(size) / 2 - 1; + int bits_per_axis = log2(size) / 2; + int steps_per_axis = sqrt(size) / 2 - 1; - for (int i = 0; i < size; i++) { + for (int i = 0; i < size; i++) { // This is the quadrant made of the first two bits starting from MSB int q = i >> (2 * (bits_per_axis - 1)) & 3; // Sign for correct calculation of I and Q in each quadrant - int sign0 = (q >> 1) ? -1 : 1; int sign1 = (q & 1) ? -1 : 1; + int sign0 = (q >> 1) ? -1 : 1; + int sign1 = (q & 1) ? -1 : 1; int x = (i >> (bits_per_axis - 1)) & ((1 << (bits_per_axis - 1)) - 1); int y = i & ((1 << (bits_per_axis - 1)) - 1); @@ -112,11 +125,12 @@ namespace gr { // but the bits on each axis are not taken in consecutive order // So we need to convert from b0b2b4b1b3b5->b0b1b2b3b4b5(64QAM) - x = 0; y = 0; + x = 0; + y = 0; for (int j = 0; j < (bits_per_axis - 1); j++) { - x += ((val >> (1 + 2 * j)) & 1) << j; - y += ((val >> (2 * j)) & 1) << j; + x += ((val >> (1 + 2 * j)) & 1) << j; + y += ((val >> (2 * j)) & 1) << j; } val = (q << 2 * (bits_per_axis - 1)) + (x << (bits_per_axis - 1)) + y; @@ -124,61 +138,54 @@ namespace gr { // Keep corresponding symbol bits->complex symbol in one vector // Normalize the signal using gain d_constellation_points[val] = d_gain * gr_complex(sign0 * xval, sign1 * yval); - } } +} - int - dvbt_demap_impl::find_constellation_value(gr_complex val) - { - float min_dist = std::norm(val - d_constellation_points[0]); - int min_index = 0; +int dvbt_demap_impl::find_constellation_value(gr_complex val) +{ + float min_dist = std::norm(val - d_constellation_points[0]); + int min_index = 0; - volk_32fc_x2_square_dist_32f(&d_sq_dist[0], &val, &d_constellation_points[0], d_constellation_size); + volk_32fc_x2_square_dist_32f( + &d_sq_dist[0], &val, &d_constellation_points[0], d_constellation_size); - for (int i = 0; i < d_constellation_size; i++) { + for (int i = 0; i < d_constellation_size; i++) { if (d_sq_dist[i] < min_dist) { - min_dist = d_sq_dist[i]; - min_index = i; + min_dist = d_sq_dist[i]; + min_index = i; } - } - - //return d_constellation_bits[min_index]; - return min_index; } - int - dvbt_demap_impl::bin_to_gray(int val) - { - return (val >> 1) ^ val; - } + // return d_constellation_bits[min_index]; + return min_index; +} - void - dvbt_demap_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = noutput_items; - } +int dvbt_demap_impl::bin_to_gray(int val) { return (val >> 1) ^ val; } + +void dvbt_demap_impl::forecast(int noutput_items, gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = noutput_items; +} - int - dvbt_demap_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; +int dvbt_demap_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; - // TODO - use DFE (Decision Feedback Equalizer) + // TODO - use DFE (Decision Feedback Equalizer) - for (int i = 0; i < (noutput_items * d_nsize); i++) { + for (int i = 0; i < (noutput_items * d_nsize); i++) { out[i] = find_constellation_value(in[i]); - } + } - consume_each (noutput_items); + consume_each(noutput_items); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt/dvbt_demap_impl.h b/gr-dtv/lib/dvbt/dvbt_demap_impl.h index 020578b1b5..ec65eb7fc1 100644 --- a/gr-dtv/lib/dvbt/dvbt_demap_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_demap_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,47 +25,50 @@ #include "dvbt_configure.h" namespace gr { - namespace dtv { +namespace dtv { - class dvbt_demap_impl : public dvbt_demap - { - private: - const dvbt_configure config; +class dvbt_demap_impl : public dvbt_demap +{ +private: + const dvbt_configure config; - int d_nsize; + int d_nsize; - //Constellation size - unsigned char d_constellation_size; - //Transmission mode - dvbt_transmission_mode_t d_transmission_mode; - //Step on each axis of the constellation - unsigned char d_step; - //Keep Alpha internally - unsigned char d_alpha; - //Gain for the complex values - float d_gain; + // Constellation size + unsigned char d_constellation_size; + // Transmission mode + dvbt_transmission_mode_t d_transmission_mode; + // Step on each axis of the constellation + unsigned char d_step; + // Keep Alpha internally + unsigned char d_alpha; + // Gain for the complex values + float d_gain; - gr_complex * d_constellation_points; - float * d_sq_dist; + gr_complex* d_constellation_points; + float* d_sq_dist; - void make_constellation_points(int size, int step, int alpha); - int find_constellation_value(gr_complex val); - int bin_to_gray(int val); + void make_constellation_points(int size, int step, int alpha); + int find_constellation_value(gr_complex val); + int bin_to_gray(int val); - public: - dvbt_demap_impl(int nsize, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission, float gain); - ~dvbt_demap_impl(); +public: + dvbt_demap_impl(int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission, + float gain); + ~dvbt_demap_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_DVBT_DEMAP_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_demod_reference_signals_impl.cc b/gr-dtv/lib/dvbt/dvbt_demod_reference_signals_impl.cc index 71a50ad2a4..54acac43be 100644 --- a/gr-dtv/lib/dvbt/dvbt_demod_reference_signals_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_demod_reference_signals_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,128 +26,153 @@ #include "dvbt_demod_reference_signals_impl.h" namespace gr { - namespace dtv { - - dvbt_demod_reference_signals::sptr - dvbt_demod_reference_signals::make(int itemsize, int ninput, int noutput, \ - dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, \ - dvb_code_rate_t code_rate_HP, dvb_code_rate_t code_rate_LP, \ - dvb_guardinterval_t guard_interval, dvbt_transmission_mode_t transmission_mode, \ - int include_cell_id, int cell_id) - { - return gnuradio::get_initial_sptr - (new dvbt_demod_reference_signals_impl(itemsize, ninput, \ - noutput, constellation, hierarchy, code_rate_HP, code_rate_LP, \ - guard_interval, transmission_mode, include_cell_id, cell_id)); - } - - /* - * The private constructor - */ - dvbt_demod_reference_signals_impl::dvbt_demod_reference_signals_impl(int itemsize, int ninput, int noutput, \ - dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvb_code_rate_t code_rate_HP,\ - dvb_code_rate_t code_rate_LP, dvb_guardinterval_t guard_interval,\ - dvbt_transmission_mode_t transmission_mode, int include_cell_id, int cell_id) - : block("dvbt_demod_reference_signals", - io_signature::make(1, 1, itemsize * ninput), - io_signature::make(1, 1, itemsize * noutput)), - config(constellation, hierarchy, code_rate_HP, code_rate_LP, \ - guard_interval, transmission_mode, include_cell_id, cell_id), - d_pg(config), - d_init(0), - d_fi_start(0) - { - d_ninput = ninput; - d_noutput = noutput; - - // TODO - investigate why this is happening - if ((config.d_constellation == MOD_64QAM) && (config.d_transmission_mode == T8k)) +namespace dtv { + +dvbt_demod_reference_signals::sptr +dvbt_demod_reference_signals::make(int itemsize, + int ninput, + int noutput, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t code_rate_HP, + dvb_code_rate_t code_rate_LP, + dvb_guardinterval_t guard_interval, + dvbt_transmission_mode_t transmission_mode, + int include_cell_id, + int cell_id) +{ + return gnuradio::get_initial_sptr( + new dvbt_demod_reference_signals_impl(itemsize, + ninput, + noutput, + constellation, + hierarchy, + code_rate_HP, + code_rate_LP, + guard_interval, + transmission_mode, + include_cell_id, + cell_id)); +} + +/* + * The private constructor + */ +dvbt_demod_reference_signals_impl::dvbt_demod_reference_signals_impl( + int itemsize, + int ninput, + int noutput, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t code_rate_HP, + dvb_code_rate_t code_rate_LP, + dvb_guardinterval_t guard_interval, + dvbt_transmission_mode_t transmission_mode, + int include_cell_id, + int cell_id) + : block("dvbt_demod_reference_signals", + io_signature::make(1, 1, itemsize * ninput), + io_signature::make(1, 1, itemsize * noutput)), + config(constellation, + hierarchy, + code_rate_HP, + code_rate_LP, + guard_interval, + transmission_mode, + include_cell_id, + cell_id), + d_pg(config), + d_init(0), + d_fi_start(0) +{ + d_ninput = ninput; + d_noutput = noutput; + + // TODO - investigate why this is happening + if ((config.d_constellation == MOD_64QAM) && (config.d_transmission_mode == T8k)) d_fi_start = 2; - else + else d_fi_start = 3; +} + +/* + * Our virtual destructor. + */ +dvbt_demod_reference_signals_impl::~dvbt_demod_reference_signals_impl() {} + +void dvbt_demod_reference_signals_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + int ninputs = ninput_items_required.size(); + + for (int i = 0; i < ninputs; i++) + ninput_items_required[i] = 2 * noutput_items; +} + +int dvbt_demod_reference_signals_impl::is_sync_start(int nitems) +{ + std::vector<tag_t> tags; + const uint64_t nread = this->nitems_read(0); // number of items read on port 0 + this->get_tags_in_range( + tags, 0, nread, nread + nitems, pmt::string_to_symbol("sync_start")); + + return tags.size() ? 1 : 0; +} + +int dvbt_demod_reference_signals_impl::general_work( + int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + gr_complex* out = (gr_complex*)output_items[0]; + + int symbol_index = 0; + int frame_index = 0; + int to_out = 0; + + for (int i = 0; i < noutput_items; i++) { + to_out += d_pg.parse_input( + &in[i * d_ninput], &out[i * d_noutput], &symbol_index, &frame_index); } /* - * Our virtual destructor. + * Wait for a sync_start tag from upstream that signals when to start. + * Always consume until to a superframe start. */ - dvbt_demod_reference_signals_impl::~dvbt_demod_reference_signals_impl() - { - } - - void - dvbt_demod_reference_signals_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - int ninputs = ninput_items_required.size(); - - for (int i = 0; i < ninputs; i++) - ninput_items_required[i] = 2 * noutput_items; - } - - int - dvbt_demod_reference_signals_impl::is_sync_start(int nitems) - { - std::vector<tag_t> tags; - const uint64_t nread = this->nitems_read(0); //number of items read on port 0 - this->get_tags_in_range(tags, 0, nread, nread + nitems, pmt::string_to_symbol("sync_start")); - - return tags.size() ? 1 : 0; - } - - int - dvbt_demod_reference_signals_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - - int symbol_index = 0; - int frame_index = 0; - int to_out = 0; - - for (int i = 0; i < noutput_items; i++) { - to_out += d_pg.parse_input(&in[i * d_ninput], &out[i * d_noutput], &symbol_index, &frame_index); - } - - /* - * Wait for a sync_start tag from upstream that signals when to start. - * Always consume until to a superframe start. - */ - if (is_sync_start(noutput_items)) { + if (is_sync_start(noutput_items)) { d_init = 0; - } + } - if (d_init == 0) { + if (d_init == 0) { // This is super-frame start if (((symbol_index % 68) == 0) && ((frame_index % 4) == d_fi_start)) { - d_init = 1; - - const uint64_t offset = this->nitems_written(0); - pmt::pmt_t key = pmt::string_to_symbol("superframe_start"); - pmt::pmt_t value = pmt::from_long(0xaa); - this->add_item_tag(0, offset, key, value); - } - else { - consume_each(1); - return (0); + d_init = 1; + + const uint64_t offset = this->nitems_written(0); + pmt::pmt_t key = pmt::string_to_symbol("superframe_start"); + pmt::pmt_t value = pmt::from_long(0xaa); + this->add_item_tag(0, offset, key, value); + } else { + consume_each(1); + return (0); } - } + } - // Send a tag for each OFDM symbol informing about - // symbol index. - const uint64_t offset = this->nitems_written(0); - pmt::pmt_t key = pmt::string_to_symbol("symbol_index"); - pmt::pmt_t value = pmt::from_long(symbol_index); - this->add_item_tag(0, offset, key, value); + // Send a tag for each OFDM symbol informing about + // symbol index. + const uint64_t offset = this->nitems_written(0); + pmt::pmt_t key = pmt::string_to_symbol("symbol_index"); + pmt::pmt_t value = pmt::from_long(symbol_index); + this->add_item_tag(0, offset, key, value); - // Consume from input stream - consume_each (noutput_items); + // Consume from input stream + consume_each(noutput_items); - // Tell runtime system how many output items we produced. - return to_out; - } + // Tell runtime system how many output items we produced. + return to_out; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt/dvbt_demod_reference_signals_impl.h b/gr-dtv/lib/dvbt/dvbt_demod_reference_signals_impl.h index 1c7f5fde30..e80d87fa21 100644 --- a/gr-dtv/lib/dvbt/dvbt_demod_reference_signals_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_demod_reference_signals_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,44 +25,50 @@ #include "dvbt_reference_signals_impl.h" namespace gr { - namespace dtv { +namespace dtv { - class dvbt_demod_reference_signals_impl : public dvbt_demod_reference_signals - { - // configuration object for this class - const dvbt_configure config; +class dvbt_demod_reference_signals_impl : public dvbt_demod_reference_signals +{ + // configuration object for this class + const dvbt_configure config; - private: - // Pilot Generator object - dvbt_pilot_gen d_pg; +private: + // Pilot Generator object + dvbt_pilot_gen d_pg; - //In and Out data length - int d_ninput; - int d_noutput; + // In and Out data length + int d_ninput; + int d_noutput; - int d_init; - int d_fi_start; + int d_init; + int d_fi_start; - int is_sync_start(int nitems); + int is_sync_start(int nitems); - public: - dvbt_demod_reference_signals_impl(int itemsize, int ninput, int noutput, \ - dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, \ - dvb_code_rate_t code_rate_HP, dvb_code_rate_t code_rate_LP, \ - dvb_guardinterval_t guard_interval, \ - dvbt_transmission_mode_t transmission_mode = gr::dtv::T2k, int include_cell_id = 0, int cell_id = 0); - ~dvbt_demod_reference_signals_impl(); +public: + dvbt_demod_reference_signals_impl( + int itemsize, + int ninput, + int noutput, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t code_rate_HP, + dvb_code_rate_t code_rate_LP, + dvb_guardinterval_t guard_interval, + dvbt_transmission_mode_t transmission_mode = gr::dtv::T2k, + int include_cell_id = 0, + int cell_id = 0); + ~dvbt_demod_reference_signals_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_DEMOD_REFERENCE_SIGNALS_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_energy_descramble_impl.cc b/gr-dtv/lib/dvbt/dvbt_energy_descramble_impl.cc index 1cb020eb0d..42d0b952bd 100644 --- a/gr-dtv/lib/dvbt/dvbt_energy_descramble_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_energy_descramble_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,131 +26,121 @@ #include "dvbt_energy_descramble_impl.h" namespace gr { - namespace dtv { - - const int dvbt_energy_descramble_impl::d_nblocks = 8; - const int dvbt_energy_descramble_impl::d_bsize = 188; - const int dvbt_energy_descramble_impl::d_SYNC = 0x47; - const int dvbt_energy_descramble_impl::d_NSYNC = 0xB8; - const int dvbt_energy_descramble_impl::d_MUX_PKT = 8; - - void - dvbt_energy_descramble_impl::init_prbs() - { - d_reg = 0xa9; - } +namespace dtv { + +const int dvbt_energy_descramble_impl::d_nblocks = 8; +const int dvbt_energy_descramble_impl::d_bsize = 188; +const int dvbt_energy_descramble_impl::d_SYNC = 0x47; +const int dvbt_energy_descramble_impl::d_NSYNC = 0xB8; +const int dvbt_energy_descramble_impl::d_MUX_PKT = 8; + +void dvbt_energy_descramble_impl::init_prbs() { d_reg = 0xa9; } - int - dvbt_energy_descramble_impl::clock_prbs(int clocks) - { - int res = 0; - int feedback = 0; +int dvbt_energy_descramble_impl::clock_prbs(int clocks) +{ + int res = 0; + int feedback = 0; - for(int i = 0; i < clocks; i++) { + for (int i = 0; i < clocks; i++) { feedback = ((d_reg >> (14 - 1)) ^ (d_reg >> (15 - 1))) & 0x1; d_reg = ((d_reg << 1) | feedback) & 0x7fff; res = (res << 1) | feedback; - } - - return res; } - dvbt_energy_descramble::sptr - dvbt_energy_descramble::make(int nblocks) - { - return gnuradio::get_initial_sptr - (new dvbt_energy_descramble_impl(nblocks)); - } + return res; +} - /* - * The private constructor - */ - dvbt_energy_descramble_impl::dvbt_energy_descramble_impl(int nblocks) - : block("dvbt_energy_descramble", - io_signature::make(1, 1, sizeof (unsigned char) * d_nblocks * d_bsize), - io_signature::make(1, 1, sizeof (unsigned char))), - d_reg(0xa9), d_index(0), d_search(0) - { - set_relative_rate((uint64_t) (d_nblocks * d_bsize), 1); - - // Set output multiple of (2 search + 1 data = 3) at least (4 for now) - set_output_multiple(4 * d_nblocks * d_bsize); - - // Search interval for NSYNC is 2 * 8 * MUX size - d_search = 2 * (d_nblocks * d_bsize); +dvbt_energy_descramble::sptr dvbt_energy_descramble::make(int nblocks) +{ + return gnuradio::get_initial_sptr(new dvbt_energy_descramble_impl(nblocks)); +} + +/* + * The private constructor + */ +dvbt_energy_descramble_impl::dvbt_energy_descramble_impl(int nblocks) + : block("dvbt_energy_descramble", + io_signature::make(1, 1, sizeof(unsigned char) * d_nblocks * d_bsize), + io_signature::make(1, 1, sizeof(unsigned char))), + d_reg(0xa9), + d_index(0), + d_search(0) +{ + set_relative_rate((uint64_t)(d_nblocks * d_bsize), 1); + + // Set output multiple of (2 search + 1 data = 3) at least (4 for now) + set_output_multiple(4 * d_nblocks * d_bsize); + + // Search interval for NSYNC is 2 * 8 * MUX size + d_search = 2 * (d_nblocks * d_bsize); +} + +/* + * Our virtual destructor. + */ +dvbt_energy_descramble_impl::~dvbt_energy_descramble_impl() {} + +void dvbt_energy_descramble_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = 4 * (noutput_items / (d_nblocks * d_bsize)); +} + +int dvbt_energy_descramble_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; + + int to_consume, to_out; + + // Search for a NSYNC + while ((in[d_index] != d_NSYNC) && (d_index < d_search)) { + d_index += d_bsize; } /* - * Our virtual destructor. + * If we did not find a NSYNC then just consume + * and return 0. */ - dvbt_energy_descramble_impl::~dvbt_energy_descramble_impl() - { - } - - void - dvbt_energy_descramble_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = 4 * (noutput_items / (d_nblocks * d_bsize)); - } - - int - dvbt_energy_descramble_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; - - int to_consume, to_out; - - // Search for a NSYNC - while ((in[d_index] != d_NSYNC) && (d_index < d_search)) { - d_index += d_bsize; - } - - /* - * If we did not find a NSYNC then just consume - * and return 0. - */ - if (d_index >= d_search) { + if (d_index >= d_search) { d_index = 0; to_consume = 2; to_out = 0; - } - else { + } else { // We found a NSYNC, descramble the data to_consume = (noutput_items / (d_nblocks * d_bsize)) - 2; to_out = noutput_items - 2 * (d_nblocks * d_bsize); for (int count = 0, i = 0; i < to_consume; i++) { - init_prbs(); + init_prbs(); - for (int mux_pkt = 0; mux_pkt < d_MUX_PKT; mux_pkt++) { - out[count++] = d_SYNC; - // PRBS clocking starts right after NSYNC + for (int mux_pkt = 0; mux_pkt < d_MUX_PKT; mux_pkt++) { + out[count++] = d_SYNC; + // PRBS clocking starts right after NSYNC - for (int k = 1; k < d_bsize; k++) { - out[count] = in[d_index + count] ^ clock_prbs(d_nblocks); - count++; - } + for (int k = 1; k < d_bsize; k++) { + out[count] = in[d_index + count] ^ clock_prbs(d_nblocks); + count++; + } - // For subsequent blocks PRBS is clocked also on SYNC - // but its output is not used - clock_prbs(d_nblocks); - } + // For subsequent blocks PRBS is clocked also on SYNC + // but its output is not used + clock_prbs(d_nblocks); + } } - } + } - // Tell runtime how many input items we consumed - consume_each(to_consume); + // Tell runtime how many input items we consumed + consume_each(to_consume); - // Tell runtime system how many output items we produced. - return (to_out); - } + // Tell runtime system how many output items we produced. + return (to_out); +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt/dvbt_energy_descramble_impl.h b/gr-dtv/lib/dvbt/dvbt_energy_descramble_impl.h index 8681732016..979fbe265a 100644 --- a/gr-dtv/lib/dvbt/dvbt_energy_descramble_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_energy_descramble_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -24,42 +24,41 @@ #include <gnuradio/dtv/dvbt_energy_descramble.h> namespace gr { - namespace dtv { +namespace dtv { - class dvbt_energy_descramble_impl : public dvbt_energy_descramble - { - private: - static const int d_nblocks; - static const int d_bsize; - static const int d_SYNC; - static const int d_NSYNC; - static const int d_MUX_PKT; +class dvbt_energy_descramble_impl : public dvbt_energy_descramble +{ +private: + static const int d_nblocks; + static const int d_bsize; + static const int d_SYNC; + static const int d_NSYNC; + static const int d_MUX_PKT; - // Register for PRBS - int d_reg; + // Register for PRBS + int d_reg; - // Index - int d_index; - // Search interval - int d_search; + // Index + int d_index; + // Search interval + int d_search; - void init_prbs(); - int clock_prbs(int clocks); + void init_prbs(); + int clock_prbs(int clocks); - public: - dvbt_energy_descramble_impl(int nblocks); - ~dvbt_energy_descramble_impl(); +public: + dvbt_energy_descramble_impl(int nblocks); + ~dvbt_energy_descramble_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_ENERGY_DESCRAMBLE_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_energy_dispersal_impl.cc b/gr-dtv/lib/dvbt/dvbt_energy_dispersal_impl.cc index d70ddf1f03..3cebb46078 100644 --- a/gr-dtv/lib/dvbt/dvbt_energy_dispersal_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_energy_dispersal_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,125 +26,113 @@ #include "dvbt_energy_dispersal_impl.h" namespace gr { - namespace dtv { +namespace dtv { - const int dvbt_energy_dispersal_impl::d_npacks = 8; - const int dvbt_energy_dispersal_impl::d_psize = 188; - const int dvbt_energy_dispersal_impl::d_SYNC = 0x47; - const int dvbt_energy_dispersal_impl::d_NSYNC = 0xB8; +const int dvbt_energy_dispersal_impl::d_npacks = 8; +const int dvbt_energy_dispersal_impl::d_psize = 188; +const int dvbt_energy_dispersal_impl::d_SYNC = 0x47; +const int dvbt_energy_dispersal_impl::d_NSYNC = 0xB8; - void - dvbt_energy_dispersal_impl::init_prbs() - { - d_reg = 0xa9; - } +void dvbt_energy_dispersal_impl::init_prbs() { d_reg = 0xa9; } - int - dvbt_energy_dispersal_impl::clock_prbs(int clocks) - { - int res = 0; - int feedback = 0; +int dvbt_energy_dispersal_impl::clock_prbs(int clocks) +{ + int res = 0; + int feedback = 0; - for (int i = 0; i < clocks; i++) { + for (int i = 0; i < clocks; i++) { feedback = ((d_reg >> (14 - 1)) ^ (d_reg >> (15 - 1))) & 0x1; d_reg = ((d_reg << 1) | feedback) & 0x7fff; res = (res << 1) | feedback; - } - return res; } + return res; +} - dvbt_energy_dispersal::sptr - dvbt_energy_dispersal::make(int nblocks) - { - return gnuradio::get_initial_sptr - (new dvbt_energy_dispersal_impl(nblocks)); - } +dvbt_energy_dispersal::sptr dvbt_energy_dispersal::make(int nblocks) +{ + return gnuradio::get_initial_sptr(new dvbt_energy_dispersal_impl(nblocks)); +} - /* - * The private constructor - */ - dvbt_energy_dispersal_impl::dvbt_energy_dispersal_impl(int nblocks) - : gr::block("dvbt_energy_dispersal", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(unsigned char) * nblocks * d_npacks * d_psize)), +/* + * The private constructor + */ +dvbt_energy_dispersal_impl::dvbt_energy_dispersal_impl(int nblocks) + : gr::block("dvbt_energy_dispersal", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make( + 1, 1, sizeof(unsigned char) * nblocks * d_npacks * d_psize)), d_nblocks(nblocks), d_reg(0xa9) - { - set_relative_rate(1, (uint64_t) (d_nblocks * d_npacks * d_psize)); - } +{ + set_relative_rate(1, (uint64_t)(d_nblocks * d_npacks * d_psize)); +} - /* - * Our virtual destructor. - */ - dvbt_energy_dispersal_impl::~dvbt_energy_dispersal_impl() - { - } - - void - dvbt_energy_dispersal_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - // Add one block size for SYNC search - ninput_items_required[0] = d_npacks * (d_psize + 1) * d_nblocks * noutput_items; - } - - int - dvbt_energy_dispersal_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; - - int index = 0; - int count = 0; - int ret = 0; - int is_sync = 0; - - // Search for SYNC byte - while (is_sync == 0 && index < d_psize) { +/* + * Our virtual destructor. + */ +dvbt_energy_dispersal_impl::~dvbt_energy_dispersal_impl() {} + +void dvbt_energy_dispersal_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + // Add one block size for SYNC search + ninput_items_required[0] = d_npacks * (d_psize + 1) * d_nblocks * noutput_items; +} + +int dvbt_energy_dispersal_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; + + int index = 0; + int count = 0; + int ret = 0; + int is_sync = 0; + + // Search for SYNC byte + while (is_sync == 0 && index < d_psize) { if (in[index] == d_SYNC) { - is_sync = 1; + is_sync = 1; + } else { + index++; } - else { - index++; - } - } + } - // If we found a SYNC byte - if (is_sync) { + // If we found a SYNC byte + if (is_sync) { for (int i = 0; i < (d_nblocks * noutput_items); i++) { - init_prbs(); + init_prbs(); - int sync = d_NSYNC; + int sync = d_NSYNC; - for (int j = 0; j < d_npacks; j++) { - if (in[index + count] != d_SYNC) { - GR_LOG_WARN(d_logger, "Malformed MPEG-TS!"); - } + for (int j = 0; j < d_npacks; j++) { + if (in[index + count] != d_SYNC) { + GR_LOG_WARN(d_logger, "Malformed MPEG-TS!"); + } - out[count++] = sync; + out[count++] = sync; - for (int k = 1; k < d_psize; k++) { - out[count] = in[index + count] ^ clock_prbs(d_npacks); - count++; - } + for (int k = 1; k < d_psize; k++) { + out[count] = in[index + count] ^ clock_prbs(d_npacks); + count++; + } - sync = d_SYNC; - clock_prbs(d_npacks); - } + sync = d_SYNC; + clock_prbs(d_npacks); + } } consume_each(index + d_npacks * d_psize * d_nblocks * noutput_items); ret = noutput_items; - } - else { + } else { consume_each(index); ret = 0; - } - - // Tell runtime system how many output items we produced. - return ret; } - } /* namespace dtv */ -} /* namespace gr */ + // Tell runtime system how many output items we produced. + return ret; +} +} /* namespace dtv */ +} /* namespace gr */ diff --git a/gr-dtv/lib/dvbt/dvbt_energy_dispersal_impl.h b/gr-dtv/lib/dvbt/dvbt_energy_dispersal_impl.h index e1cfe4e925..b40f00e556 100644 --- a/gr-dtv/lib/dvbt/dvbt_energy_dispersal_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_energy_dispersal_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -24,42 +24,41 @@ #include <gnuradio/dtv/dvbt_energy_dispersal.h> namespace gr { - namespace dtv { +namespace dtv { - class dvbt_energy_dispersal_impl : public dvbt_energy_dispersal - { - private: - // Packet size - static const int d_psize; - // Number of packets after which PRBS is reset - static const int d_npacks; - // Number of blocks - int d_nblocks; - // SYNC value - static const int d_SYNC; - // Negative SYNC value - static const int d_NSYNC; +class dvbt_energy_dispersal_impl : public dvbt_energy_dispersal +{ +private: + // Packet size + static const int d_psize; + // Number of packets after which PRBS is reset + static const int d_npacks; + // Number of blocks + int d_nblocks; + // SYNC value + static const int d_SYNC; + // Negative SYNC value + static const int d_NSYNC; - // Register for PRBS - int d_reg; + // Register for PRBS + int d_reg; - void init_prbs(); - int clock_prbs(int clocks); + void init_prbs(); + int clock_prbs(int clocks); - public: - dvbt_energy_dispersal_impl(int nsize); - ~dvbt_energy_dispersal_impl(); +public: + dvbt_energy_dispersal_impl(int nsize); + ~dvbt_energy_dispersal_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_ENERGY_DISPERSAL_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_inner_coder_impl.cc b/gr-dtv/lib/dvbt/dvbt_inner_coder_impl.cc index 19eec4e350..1b2129b1f2 100644 --- a/gr-dtv/lib/dvbt/dvbt_inner_coder_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_inner_coder_impl.cc @@ -1,22 +1,22 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016,2019 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. - */ + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -27,239 +27,247 @@ #include <assert.h> namespace gr { - namespace dtv { - - inline void - dvbt_inner_coder_impl::generate_codeword(unsigned char in, int &x, int &y) - { - //insert input bit - d_reg |= ((in & 0x1) << 7); - - d_reg = d_reg >> 1; - - x = d_lookup_171[d_reg]; - y = d_lookup_133[d_reg]; - } - - //TODO - do this based on puncturing matrix - /* - * Input e.g rate 2/3: - * 000000x0x1 - * Output e.g. rate 2/3 - * 00000c0c1c2 - */ - - inline void - dvbt_inner_coder_impl::generate_punctured_code(dvb_code_rate_t coderate, unsigned char * in, unsigned char * out) - { - int x, y; - - switch(coderate) { - //X1Y1 - case C1_2: - generate_codeword(in[0], x, y); - out[0] = x; out[1] = y; - break; - //X1Y1Y2 - case C2_3: - generate_codeword(in[0], x, y); - out[0] = x; out[1] = y; - generate_codeword(in[1], x, y); - out[2] = y; - break; - //X1Y1Y2X3 - case C3_4: - generate_codeword(in[0], x, y); - out[0] = x; out[1] = y; - generate_codeword(in[1], x, y); - out[2] = y; - generate_codeword(in[2], x, y); - out[3] = x; - break; - //X1Y1Y2X3Y4X5 - case C5_6: - generate_codeword(in[0], x, y); - out[0] = x; out[1] = y; - generate_codeword(in[1], x, y); - out[2] = y; - generate_codeword(in[2], x, y); - out[3] = x; - generate_codeword(in[3], x, y); - out[4] = y; - generate_codeword(in[4], x, y); - out[5] = x; - break; - //X1Y1Y2X3Y4X5Y6X7 - case C7_8: - generate_codeword(in[0], x, y); - out[0] = x; out[1] = y; - generate_codeword(in[1], x, y); - out[2] = y; - generate_codeword(in[2], x, y); - out[3] = y; - generate_codeword(in[3], x, y); - out[4] = y; - generate_codeword(in[4], x, y); - out[5] = x; - generate_codeword(in[5], x, y); - out[6] = y; - generate_codeword(in[6], x, y); - out[7] = x; - break; - default: - generate_codeword(in[0], x, y); - out[0] = x; out[1] = y; - break; - } +namespace dtv { + +inline void dvbt_inner_coder_impl::generate_codeword(unsigned char in, int& x, int& y) +{ + // insert input bit + d_reg |= ((in & 0x1) << 7); + + d_reg = d_reg >> 1; + + x = d_lookup_171[d_reg]; + y = d_lookup_133[d_reg]; +} + +// TODO - do this based on puncturing matrix +/* + * Input e.g rate 2/3: + * 000000x0x1 + * Output e.g. rate 2/3 + * 00000c0c1c2 + */ + +inline void dvbt_inner_coder_impl::generate_punctured_code(dvb_code_rate_t coderate, + unsigned char* in, + unsigned char* out) +{ + int x, y; + + switch (coderate) { + // X1Y1 + case C1_2: + generate_codeword(in[0], x, y); + out[0] = x; + out[1] = y; + break; + // X1Y1Y2 + case C2_3: + generate_codeword(in[0], x, y); + out[0] = x; + out[1] = y; + generate_codeword(in[1], x, y); + out[2] = y; + break; + // X1Y1Y2X3 + case C3_4: + generate_codeword(in[0], x, y); + out[0] = x; + out[1] = y; + generate_codeword(in[1], x, y); + out[2] = y; + generate_codeword(in[2], x, y); + out[3] = x; + break; + // X1Y1Y2X3Y4X5 + case C5_6: + generate_codeword(in[0], x, y); + out[0] = x; + out[1] = y; + generate_codeword(in[1], x, y); + out[2] = y; + generate_codeword(in[2], x, y); + out[3] = x; + generate_codeword(in[3], x, y); + out[4] = y; + generate_codeword(in[4], x, y); + out[5] = x; + break; + // X1Y1Y2X3Y4X5Y6X7 + case C7_8: + generate_codeword(in[0], x, y); + out[0] = x; + out[1] = y; + generate_codeword(in[1], x, y); + out[2] = y; + generate_codeword(in[2], x, y); + out[3] = y; + generate_codeword(in[3], x, y); + out[4] = y; + generate_codeword(in[4], x, y); + out[5] = x; + generate_codeword(in[5], x, y); + out[6] = y; + generate_codeword(in[6], x, y); + out[7] = x; + break; + default: + generate_codeword(in[0], x, y); + out[0] = x; + out[1] = y; + break; } - - dvbt_inner_coder::sptr - dvbt_inner_coder::make(int ninput, int noutput, dvb_constellation_t constellation, \ - dvbt_hierarchy_t hierarchy, dvb_code_rate_t coderate) - { - return gnuradio::get_initial_sptr - (new dvbt_inner_coder_impl(ninput, noutput, constellation, hierarchy, coderate)); - } - - /* - * The private constructor - */ - dvbt_inner_coder_impl::dvbt_inner_coder_impl(int ninput, int noutput, dvb_constellation_t constellation, \ - dvbt_hierarchy_t hierarchy, dvb_code_rate_t coderate) - : block("dvbt_inner_coder", - io_signature::make(1, 1, sizeof (unsigned char)), - io_signature::make(1, 1, sizeof (unsigned char) * noutput)), +} + +dvbt_inner_coder::sptr dvbt_inner_coder::make(int ninput, + int noutput, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t coderate) +{ + return gnuradio::get_initial_sptr( + new dvbt_inner_coder_impl(ninput, noutput, constellation, hierarchy, coderate)); +} + +/* + * The private constructor + */ +dvbt_inner_coder_impl::dvbt_inner_coder_impl(int ninput, + int noutput, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t coderate) + : block("dvbt_inner_coder", + io_signature::make(1, 1, sizeof(unsigned char)), + io_signature::make(1, 1, sizeof(unsigned char) * noutput)), config(constellation, hierarchy, coderate, coderate), - d_ninput(ninput), d_noutput(noutput), + d_ninput(ninput), + d_noutput(noutput), d_reg(0) - { - //Determine k - input of encoder - d_k = config.d_cr_k; - //Determine n - output of encoder - d_n = config.d_cr_n; - //Determine m - constellation symbol size - d_m = config.d_m; - - // In order to accommodate all constalations (m=2,4,6) - // and rates (1/2, 2/3, 3/4, 5/6, 7/8) - // We need the following things to happen: - // - output item size multiple of 1512bytes - // - noutput_items multiple of 4 - // - in block size 4*(k*m/8) - // - out block size 4*n - // - // Rate calculation follows: - // We process km input bits(km/8 Bytes) - // We output nm bits - // We output one byte for a symbol of m bits - // The out/in rate in bytes is: 8n/km (Bytes) - - assert(d_noutput % 1512 == 0); - - // Set output items multiple of 4 - set_output_multiple(4); - - // calculate in and out block sizes - d_in_bs = (d_k * d_m) / 2; - d_out_bs = 4 * d_n; - - // allocate bit buffers - d_in_buff = new (std::nothrow) unsigned char[8 * d_in_bs]; - if (d_in_buff == NULL) { +{ + // Determine k - input of encoder + d_k = config.d_cr_k; + // Determine n - output of encoder + d_n = config.d_cr_n; + // Determine m - constellation symbol size + d_m = config.d_m; + + // In order to accommodate all constalations (m=2,4,6) + // and rates (1/2, 2/3, 3/4, 5/6, 7/8) + // We need the following things to happen: + // - output item size multiple of 1512bytes + // - noutput_items multiple of 4 + // - in block size 4*(k*m/8) + // - out block size 4*n + // + // Rate calculation follows: + // We process km input bits(km/8 Bytes) + // We output nm bits + // We output one byte for a symbol of m bits + // The out/in rate in bytes is: 8n/km (Bytes) + + assert(d_noutput % 1512 == 0); + + // Set output items multiple of 4 + set_output_multiple(4); + + // calculate in and out block sizes + d_in_bs = (d_k * d_m) / 2; + d_out_bs = 4 * d_n; + + // allocate bit buffers + d_in_buff = new (std::nothrow) unsigned char[8 * d_in_bs]; + if (d_in_buff == NULL) { GR_LOG_FATAL(d_logger, "Inner Coder, cannot allocate memory for d_in_buff."); throw std::bad_alloc(); - } + } - d_out_buff = new (std::nothrow) unsigned char[8 * d_in_bs * d_n / d_k]; - if (d_out_buff == NULL) { + d_out_buff = new (std::nothrow) unsigned char[8 * d_in_bs * d_n / d_k]; + if (d_out_buff == NULL) { GR_LOG_FATAL(d_logger, "Inner Coder, cannot allocate memory for d_out_buff."); - delete [] d_in_buff; + delete[] d_in_buff; throw std::bad_alloc(); - } } - - /* - * Our virtual destructor. - */ - dvbt_inner_coder_impl::~dvbt_inner_coder_impl() - { - delete [] d_out_buff; - delete [] d_in_buff; - } - - void - dvbt_inner_coder_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - int input_required = noutput_items * d_noutput * d_k * d_m / (d_ninput * 8 * d_n); - - unsigned ninputs = ninput_items_required.size(); - for (unsigned int i = 0; i < ninputs; i++) { +} + +/* + * Our virtual destructor. + */ +dvbt_inner_coder_impl::~dvbt_inner_coder_impl() +{ + delete[] d_out_buff; + delete[] d_in_buff; +} + +void dvbt_inner_coder_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + int input_required = noutput_items * d_noutput * d_k * d_m / (d_ninput * 8 * d_n); + + unsigned ninputs = ninput_items_required.size(); + for (unsigned int i = 0; i < ninputs; i++) { ninput_items_required[i] = input_required; - } } +} - int - dvbt_inner_coder_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; +int dvbt_inner_coder_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; - for (int k = 0; k < (noutput_items * d_noutput / d_out_bs); k++) { + for (int k = 0; k < (noutput_items * d_noutput / d_out_bs); k++) { // Unpack input to bits for (int i = 0; i < d_in_bs; i++) { - for (int j = 0; j < 8; j++) { - d_in_buff[8*i + j] = (in[k*d_in_bs + i] >> (7 - j)) & 1; - } + for (int j = 0; j < 8; j++) { + d_in_buff[8 * i + j] = (in[k * d_in_bs + i] >> (7 - j)) & 1; + } } // Encode the data - for (int in_bit = 0, out_bit = 0; in_bit < (8 * d_in_bs); in_bit += d_k, out_bit += d_n) { - generate_punctured_code(config.d_code_rate_HP, &d_in_buff[in_bit], &d_out_buff[out_bit]); + for (int in_bit = 0, out_bit = 0; in_bit < (8 * d_in_bs); + in_bit += d_k, out_bit += d_n) { + generate_punctured_code( + config.d_code_rate_HP, &d_in_buff[in_bit], &d_out_buff[out_bit]); } // Pack d_m bit in one output byte for (int i = 0; i < d_out_bs; i++) { - unsigned char c = 0; + unsigned char c = 0; - for (int j = 0; j < d_m; j++) { - c |= d_out_buff[d_m*i + j] << (d_m - 1 - j); - } + for (int j = 0; j < d_m; j++) { + c |= d_out_buff[d_m * i + j] << (d_m - 1 - j); + } - out[k*d_out_bs + i] = c; + out[k * d_out_bs + i] = c; } - } - - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each(noutput_items * d_noutput * d_k * d_m / (d_ninput * 8 * d_n)); - - // Tell runtime system how many output items we produced. - return noutput_items; } - const int dvbt_inner_coder_impl::d_lookup_171[128] = - {0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, - 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, - 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1}; - - const int dvbt_inner_coder_impl::d_lookup_133[128] = - {0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, - 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, - 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, - 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, - 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1}; - - } /* namespace dtv */ + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(noutput_items * d_noutput * d_k * d_m / (d_ninput * 8 * d_n)); + + // Tell runtime system how many output items we produced. + return noutput_items; +} + +const int dvbt_inner_coder_impl::d_lookup_171[128] = { + 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, + 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1 +}; + +const int dvbt_inner_coder_impl::d_lookup_133[128] = { + 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, + 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, + 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1 +}; + +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt/dvbt_inner_coder_impl.h b/gr-dtv/lib/dvbt/dvbt_inner_coder_impl.h index 7c31c1897d..7da206d3bc 100644 --- a/gr-dtv/lib/dvbt/dvbt_inner_coder_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_inner_coder_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,53 +25,58 @@ #include "dvbt_configure.h" namespace gr { - namespace dtv { - - class dvbt_inner_coder_impl : public dvbt_inner_coder - { - private: - const dvbt_configure config; - - static const int d_lookup_171[128]; - static const int d_lookup_133[128]; - - int d_ninput; - int d_noutput; - - int d_reg; - - // Code rate k/n - int d_k; - int d_n; - // Constellation with m - int d_m; - - // input block size in bytes - int d_in_bs; - // bit input buffer - unsigned char * d_in_buff; - - // output block size in bytes - int d_out_bs; - // bit output buffer - unsigned char * d_out_buff; - - inline void generate_codeword(unsigned char in, int &x, int &y); - inline void generate_punctured_code(dvb_code_rate_t coderate, unsigned char * in, unsigned char * out); - - public: - dvbt_inner_coder_impl(int ninput, int noutput, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvb_code_rate_t coderate); - ~dvbt_inner_coder_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class dvbt_inner_coder_impl : public dvbt_inner_coder +{ +private: + const dvbt_configure config; + + static const int d_lookup_171[128]; + static const int d_lookup_133[128]; + + int d_ninput; + int d_noutput; + + int d_reg; + + // Code rate k/n + int d_k; + int d_n; + // Constellation with m + int d_m; + + // input block size in bytes + int d_in_bs; + // bit input buffer + unsigned char* d_in_buff; + + // output block size in bytes + int d_out_bs; + // bit output buffer + unsigned char* d_out_buff; + + inline void generate_codeword(unsigned char in, int& x, int& y); + inline void generate_punctured_code(dvb_code_rate_t coderate, + unsigned char* in, + unsigned char* out); + +public: + dvbt_inner_coder_impl(int ninput, + int noutput, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t coderate); + ~dvbt_inner_coder_impl(); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_INNER_CODER_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_map_impl.cc b/gr-dtv/lib/dvbt/dvbt_map_impl.cc index b2c21da525..2a8ee5af31 100644 --- a/gr-dtv/lib/dvbt/dvbt_map_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_map_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -28,73 +28,79 @@ #include <math.h> namespace gr { - namespace dtv { - - dvbt_map::sptr - dvbt_map::make(int nsize, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission, float gain) - { - return gnuradio::get_initial_sptr - (new dvbt_map_impl(nsize, constellation, hierarchy, transmission, gain)); - } - - /* - * The private constructor - */ - dvbt_map_impl::dvbt_map_impl(int nsize, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission, float gain) - : block("dvbt_map", - io_signature::make(1, 1, sizeof (unsigned char) * nsize), - io_signature::make(1, 1, sizeof (gr_complex) * nsize)), - config(constellation, hierarchy, gr::dtv::C1_2, gr::dtv::C1_2, gr::dtv::GI_1_32, transmission), +namespace dtv { + +dvbt_map::sptr dvbt_map::make(int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission, + float gain) +{ + return gnuradio::get_initial_sptr( + new dvbt_map_impl(nsize, constellation, hierarchy, transmission, gain)); +} + +/* + * The private constructor + */ +dvbt_map_impl::dvbt_map_impl(int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission, + float gain) + : block("dvbt_map", + io_signature::make(1, 1, sizeof(unsigned char) * nsize), + io_signature::make(1, 1, sizeof(gr_complex) * nsize)), + config(constellation, + hierarchy, + gr::dtv::C1_2, + gr::dtv::C1_2, + gr::dtv::GI_1_32, + transmission), d_nsize(nsize), d_constellation_size(0), d_step(0), d_alpha(0), d_gain(0.0) - { - //Get parameters from config object - d_constellation_size = config.d_constellation_size; - d_transmission_mode = config.d_transmission_mode; - d_step = config.d_step; - d_alpha = config.d_alpha; - d_gain = gain * config.d_norm; - - d_constellation_points = new (std::nothrow) gr_complex[d_constellation_size]; - if (d_constellation_points == NULL) { - GR_LOG_FATAL(d_logger, "DVB-T Map, cannot allocate memory for d_constellation_points."); +{ + // Get parameters from config object + d_constellation_size = config.d_constellation_size; + d_transmission_mode = config.d_transmission_mode; + d_step = config.d_step; + d_alpha = config.d_alpha; + d_gain = gain * config.d_norm; + + d_constellation_points = new (std::nothrow) gr_complex[d_constellation_size]; + if (d_constellation_points == NULL) { + GR_LOG_FATAL(d_logger, + "DVB-T Map, cannot allocate memory for d_constellation_points."); throw std::bad_alloc(); - } - - make_constellation_points(d_constellation_size, d_step, d_alpha); } - /* - * Our virtual destructor. - */ - dvbt_map_impl::~dvbt_map_impl() - { - delete [] d_constellation_points; - } + make_constellation_points(d_constellation_size, d_step, d_alpha); +} - unsigned int - dvbt_map_impl::bin_to_gray(unsigned int val) - { - return (val >> 1) ^ val; - } +/* + * Our virtual destructor. + */ +dvbt_map_impl::~dvbt_map_impl() { delete[] d_constellation_points; } + +unsigned int dvbt_map_impl::bin_to_gray(unsigned int val) { return (val >> 1) ^ val; } - void - dvbt_map_impl::make_constellation_points(int size, int step, int alpha) - { - // The symmetry of the constellation is used to calculate - // 16-QAM from QPSK and 64-QAM form 16-QAM +void dvbt_map_impl::make_constellation_points(int size, int step, int alpha) +{ + // The symmetry of the constellation is used to calculate + // 16-QAM from QPSK and 64-QAM form 16-QAM - int bits_per_axis = log2(size) / 2; - int steps_per_axis = sqrt(size) / 2 - 1; + int bits_per_axis = log2(size) / 2; + int steps_per_axis = sqrt(size) / 2 - 1; - for (int i = 0; i < size; i++) { + for (int i = 0; i < size; i++) { // This is the quadrant made of the first two bits starting from MSB int q = i >> (2 * (bits_per_axis - 1)) & 3; // Sign for correctly calculate I and Q in each quadrant - int sign0 = (q >> 1) ? -1 : 1; int sign1 = (q & 1) ? -1 : 1; + int sign0 = (q >> 1) ? -1 : 1; + int sign1 = (q & 1) ? -1 : 1; int x = (i >> (bits_per_axis - 1)) & ((1 << (bits_per_axis - 1)) - 1); int y = i & ((1 << (bits_per_axis - 1)) - 1); @@ -109,11 +115,12 @@ namespace gr { // but the bits on each axis are not taken in consecutive order // So we need to convert from b0b2b4b1b3b5->b0b1b2b3b4b5(QAM64) - x = 0; y = 0; + x = 0; + y = 0; for (int j = 0; j < (bits_per_axis - 1); j++) { - x += ((val >> (1 + 2 * j)) & 1) << j; - y += ((val >> (2 * j)) & 1) << j; + x += ((val >> (1 + 2 * j)) & 1) << j; + y += ((val >> (2 * j)) & 1) << j; } val = (q << 2 * (bits_per_axis - 1)) + (x << (bits_per_axis - 1)) + y; @@ -121,42 +128,38 @@ namespace gr { // Keep corresponding symbol bits->complex symbol in one vector // Normalize the signal using gain d_constellation_points[val] = d_gain * gr_complex(sign0 * xval, sign1 * yval); - } } - - gr_complex - dvbt_map_impl::find_constellation_point(int val) - { - return d_constellation_points[val]; - } - - void - dvbt_map_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = noutput_items; - } - - int - dvbt_map_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - - for (int i = 0; i < (noutput_items * d_nsize); i++) { +} + +gr_complex dvbt_map_impl::find_constellation_point(int val) +{ + return d_constellation_points[val]; +} + +void dvbt_map_impl::forecast(int noutput_items, gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = noutput_items; +} + +int dvbt_map_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + gr_complex* out = (gr_complex*)output_items[0]; + + for (int i = 0; i < (noutput_items * d_nsize); i++) { out[i] = find_constellation_point(in[i]); - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (noutput_items); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(noutput_items); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt/dvbt_map_impl.h b/gr-dtv/lib/dvbt/dvbt_map_impl.h index 045a8e0e6d..7974dec626 100644 --- a/gr-dtv/lib/dvbt/dvbt_map_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_map_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,48 +25,51 @@ #include "dvbt_configure.h" namespace gr { - namespace dtv { +namespace dtv { - class dvbt_map_impl : public dvbt_map - { - private: - const dvbt_configure config; +class dvbt_map_impl : public dvbt_map +{ +private: + const dvbt_configure config; - int d_nsize; + int d_nsize; - //Constellation size - unsigned char d_constellation_size; - // Keeps transmission mode - dvbt_transmission_mode_t d_transmission_mode; - //Step on each axis of the constellation - unsigned char d_step; - //Keep Alpha internally - unsigned char d_alpha; - //Gain for the complex values - float d_gain; + // Constellation size + unsigned char d_constellation_size; + // Keeps transmission mode + dvbt_transmission_mode_t d_transmission_mode; + // Step on each axis of the constellation + unsigned char d_step; + // Keep Alpha internally + unsigned char d_alpha; + // Gain for the complex values + float d_gain; - gr_complex * d_constellation_points; + gr_complex* d_constellation_points; - void make_constellation_points(int size, int step, int alpha); - gr_complex find_constellation_point(int val); + void make_constellation_points(int size, int step, int alpha); + gr_complex find_constellation_point(int val); - //Return gray representation from natural binary - unsigned int bin_to_gray(unsigned int val); + // Return gray representation from natural binary + unsigned int bin_to_gray(unsigned int val); - public: - dvbt_map_impl(int nsize, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission, float gain); - ~dvbt_map_impl(); +public: + dvbt_map_impl(int nsize, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvbt_transmission_mode_t transmission, + float gain); + ~dvbt_map_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_MAP_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc b/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc index 3914722e4e..fc2d7de33b 100644 --- a/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc @@ -31,97 +31,102 @@ #include <limits> namespace gr { - namespace dtv { - - int - dvbt_ofdm_sym_acquisition_impl::peak_detect_init(float threshold_factor_rise, float alpha) - { - d_avg_alpha = alpha; - d_threshold_factor_rise = threshold_factor_rise; - d_avg_max = std::numeric_limits<float>::min(); - d_avg_min = std::numeric_limits<float>::max(); - - return (0); - } - - int - dvbt_ofdm_sym_acquisition_impl::peak_detect_process(const float * datain, const int datain_length, int * peak_pos, int * peak_max) - { - uint16_t peak_index = 0; - int peak_pos_length = 0; - - volk_32f_index_max_16u(&peak_index, &datain[0], datain_length); - - peak_pos_length = 1; - if (datain_length >= d_fft_length) { +namespace dtv { + +int dvbt_ofdm_sym_acquisition_impl::peak_detect_init(float threshold_factor_rise, + float alpha) +{ + d_avg_alpha = alpha; + d_threshold_factor_rise = threshold_factor_rise; + d_avg_max = std::numeric_limits<float>::min(); + d_avg_min = std::numeric_limits<float>::max(); + + return (0); +} + +int dvbt_ofdm_sym_acquisition_impl::peak_detect_process(const float* datain, + const int datain_length, + int* peak_pos, + int* peak_max) +{ + uint16_t peak_index = 0; + int peak_pos_length = 0; + + volk_32f_index_max_16u(&peak_index, &datain[0], datain_length); + + peak_pos_length = 1; + if (datain_length >= d_fft_length) { float min = datain[(peak_index + d_fft_length / 2) % d_fft_length]; if (d_avg_min == std::numeric_limits<float>::max()) { - d_avg_min = min; - } - else { - d_avg_min = d_avg_alpha * min + (1 - d_avg_alpha) * d_avg_min; + d_avg_min = min; + } else { + d_avg_min = d_avg_alpha * min + (1 - d_avg_alpha) * d_avg_min; } - } + } - if (d_avg_max == std::numeric_limits<float>::min()) { - // Initialize d_avg_max with the first value. + if (d_avg_max == std::numeric_limits<float>::min()) { + // Initialize d_avg_max with the first value. d_avg_max = datain[peak_index]; - } - else if (datain[peak_index] > d_avg_max - d_threshold_factor_rise * (d_avg_max-d_avg_min)) { + } else if (datain[peak_index] > + d_avg_max - d_threshold_factor_rise * (d_avg_max - d_avg_min)) { d_avg_max = d_avg_alpha * datain[peak_index] + (1 - d_avg_alpha) * d_avg_max; - } - else { - peak_pos_length = 0; - } - - // We now check whether the peak is in the border of the search interval. This would mean that - // the search interval is not correct, and it should be re-set. This happens for instance when the - // hardware dropped some samples. - // Our definition of "border of the search interval" depends if the search interval is "big" or not. - if (datain_length < d_fft_length) { + } else { + peak_pos_length = 0; + } + + // We now check whether the peak is in the border of the search interval. This would + // mean that the search interval is not correct, and it should be re-set. This happens + // for instance when the hardware dropped some samples. Our definition of "border of + // the search interval" depends if the search interval is "big" or not. + if (datain_length < d_fft_length) { if ((peak_index == 0) || (peak_index == (unsigned int)datain_length - 1)) { - peak_pos_length = 0; + peak_pos_length = 0; } - } - else { + } else { if ((peak_index < 5) || (peak_index > (unsigned int)datain_length - 5)) { - peak_pos_length = 0; + peak_pos_length = 0; } - } - - peak_pos[0] = peak_index; - *peak_max = 0; - return (peak_pos_length); } - int - dvbt_ofdm_sym_acquisition_impl::ml_sync(const gr_complex * in, int lookup_start, int lookup_stop, int * cp_pos, gr_complex * derot, int * to_consume, int * to_out) - { - assert(lookup_start >= lookup_stop); - assert(lookup_stop >= (d_cp_length + d_fft_length - 1)); - - int low, size; - - // Array to store peak positions - __GR_VLA(int, peak_pos, d_fft_length); - __GR_VLA(float, d_phi, d_fft_length); - - // Calculate norm - low = lookup_stop - (d_cp_length + d_fft_length - 1); - size = lookup_start - (lookup_stop - (d_cp_length + d_fft_length - 1)) + 1; - - volk_32fc_magnitude_squared_32f(&d_norm[low], &in[low], size); - - // Calculate gamma on each point - // TODO check these boundaries!!!!!!! - low = lookup_stop - (d_cp_length - 1); - size = lookup_start - low + 1; - - volk_32fc_x2_multiply_conjugate_32fc(&d_corr[low - d_fft_length], &in[low], &in[low - d_fft_length], size); - - // Calculate time delay and frequency correction - // This looks like spaghetti code but it is fast - for (int i = lookup_start - 1; i >= lookup_stop; i--) { + peak_pos[0] = peak_index; + *peak_max = 0; + return (peak_pos_length); +} + +int dvbt_ofdm_sym_acquisition_impl::ml_sync(const gr_complex* in, + int lookup_start, + int lookup_stop, + int* cp_pos, + gr_complex* derot, + int* to_consume, + int* to_out) +{ + assert(lookup_start >= lookup_stop); + assert(lookup_stop >= (d_cp_length + d_fft_length - 1)); + + int low, size; + + // Array to store peak positions + __GR_VLA(int, peak_pos, d_fft_length); + __GR_VLA(float, d_phi, d_fft_length); + + // Calculate norm + low = lookup_stop - (d_cp_length + d_fft_length - 1); + size = lookup_start - (lookup_stop - (d_cp_length + d_fft_length - 1)) + 1; + + volk_32fc_magnitude_squared_32f(&d_norm[low], &in[low], size); + + // Calculate gamma on each point + // TODO check these boundaries!!!!!!! + low = lookup_stop - (d_cp_length - 1); + size = lookup_start - low + 1; + + volk_32fc_x2_multiply_conjugate_32fc( + &d_corr[low - d_fft_length], &in[low], &in[low - d_fft_length], size); + + // Calculate time delay and frequency correction + // This looks like spaghetti code but it is fast + for (int i = lookup_start - 1; i >= lookup_stop; i--) { int k = i - lookup_stop; d_phi[k] = 0.0; @@ -129,30 +134,31 @@ namespace gr { // Moving sum for calculating gamma and phi for (int j = 0; j < d_cp_length; j++) { - // Calculate gamma and store it - d_gamma[k] += d_corr[i - j - d_fft_length]; - // Calculate phi and store it - d_phi[k] += d_norm[i - j] + d_norm[i - j - d_fft_length]; + // Calculate gamma and store it + d_gamma[k] += d_corr[i - j - d_fft_length]; + // Calculate phi and store it + d_phi[k] += d_norm[i - j] + d_norm[i - j - d_fft_length]; } - } + } - // Init lambda with gamma - low = 0; - size = lookup_start - lookup_stop; + // Init lambda with gamma + low = 0; + size = lookup_start - lookup_stop; - volk_32fc_magnitude_32f(&d_lambda[low], &d_gamma[low], size); + volk_32fc_magnitude_32f(&d_lambda[low], &d_gamma[low], size); - // Calculate lambda - low = 0; - size = lookup_start - lookup_stop; + // Calculate lambda + low = 0; + size = lookup_start - lookup_stop; - volk_32f_s32f_multiply_32f(&d_phi[low], &d_phi[low], d_rho / 2.0, size); - volk_32f_x2_subtract_32f(&d_lambda[low], &d_lambda[low], &d_phi[low], size); + volk_32f_s32f_multiply_32f(&d_phi[low], &d_phi[low], d_rho / 2.0, size); + volk_32f_x2_subtract_32f(&d_lambda[low], &d_lambda[low], &d_phi[low], size); - int peak_length, peak, peak_max; - // Find peaks of lambda - // We have found an end of symbol at peak_pos[0] + CP + FFT - if ((peak_length = peak_detect_process(&d_lambda[0], (lookup_start - lookup_stop), &peak_pos[0], &peak_max))) { + int peak_length, peak, peak_max; + // Find peaks of lambda + // We have found an end of symbol at peak_pos[0] + CP + FFT + if ((peak_length = peak_detect_process( + &d_lambda[0], (lookup_start - lookup_stop), &peak_pos[0], &peak_max))) { peak = peak_pos[peak_max] + lookup_stop; *cp_pos = peak; @@ -163,21 +169,21 @@ namespace gr { // Store phases for derotating the signal // We always process CP len + FFT len for (int i = 0; i < (d_cp_length + d_fft_length); i++) { - if (i == d_nextpos) { - d_phaseinc = d_nextphaseinc; - } + if (i == d_nextpos) { + d_phaseinc = d_nextphaseinc; + } - // We are interested only in fft_length - d_phase += d_phaseinc; + // We are interested only in fft_length + d_phase += d_phaseinc; - while (d_phase > (float)GR_M_PI) { - d_phase -= (float)(2.0 * GR_M_PI); - } - while (d_phase < (float)(-GR_M_PI)) { - d_phase += (float)(2.0 * GR_M_PI); - } + while (d_phase > (float)GR_M_PI) { + d_phase -= (float)(2.0 * GR_M_PI); + } + while (d_phase < (float)(-GR_M_PI)) { + d_phase += (float)(2.0 * GR_M_PI); + } - derot[i] = gr_expj(d_phase); + derot[i] = gr_expj(d_phase); } d_nextphaseinc = sensitivity * peak_epsilon; @@ -185,188 +191,220 @@ namespace gr { *to_consume = d_cp_length + d_fft_length; *to_out = 1; - } - else { + } else { for (int i = 0; i < (d_cp_length + d_fft_length); i++) { - d_phase += d_phaseinc; - - while (d_phase > (float)GR_M_PI) { - d_phase -= (float)(2.0 * GR_M_PI); - } - while (d_phase < (float)(-GR_M_PI)) { - d_phase += (float)(2.0 * GR_M_PI); - } + d_phase += d_phaseinc; + + while (d_phase > (float)GR_M_PI) { + d_phase -= (float)(2.0 * GR_M_PI); + } + while (d_phase < (float)(-GR_M_PI)) { + d_phase += (float)(2.0 * GR_M_PI); + } } // We consume only fft_length *to_consume = d_cp_length + d_fft_length; *to_out = 0; - } - - return (peak_length); - } - - void - dvbt_ofdm_sym_acquisition_impl::send_sync_start() - { - const uint64_t offset = this->nitems_written(0); - pmt::pmt_t key = pmt::string_to_symbol("sync_start"); - pmt::pmt_t value = pmt::from_long(1); - this->add_item_tag(0, offset, key, value); } - // Derotates the signal - void dvbt_ofdm_sym_acquisition_impl::derotate(const gr_complex * in, gr_complex * out) - { - volk_32fc_x2_multiply_32fc(&out[0], &d_derot[0], &in[0], d_fft_length); - } + return (peak_length); +} + +void dvbt_ofdm_sym_acquisition_impl::send_sync_start() +{ + const uint64_t offset = this->nitems_written(0); + pmt::pmt_t key = pmt::string_to_symbol("sync_start"); + pmt::pmt_t value = pmt::from_long(1); + this->add_item_tag(0, offset, key, value); +} + +// Derotates the signal +void dvbt_ofdm_sym_acquisition_impl::derotate(const gr_complex* in, gr_complex* out) +{ + volk_32fc_x2_multiply_32fc(&out[0], &d_derot[0], &in[0], d_fft_length); +} + +dvbt_ofdm_sym_acquisition::sptr dvbt_ofdm_sym_acquisition::make( + int blocks, int fft_length, int occupied_tones, int cp_length, float snr) +{ + return gnuradio::get_initial_sptr(new dvbt_ofdm_sym_acquisition_impl( + blocks, fft_length, occupied_tones, cp_length, snr)); +} - dvbt_ofdm_sym_acquisition::sptr - dvbt_ofdm_sym_acquisition::make(int blocks, int fft_length, int occupied_tones, int cp_length, float snr) - { - return gnuradio::get_initial_sptr - (new dvbt_ofdm_sym_acquisition_impl(blocks, fft_length, occupied_tones, cp_length, snr)); - } - - /* - * The private constructor - */ - dvbt_ofdm_sym_acquisition_impl::dvbt_ofdm_sym_acquisition_impl(int blocks, int fft_length, int occupied_tones, int cp_length, float snr) - : block("dvbt_ofdm_sym_acquisition", - io_signature::make(1, 1, sizeof (gr_complex) * blocks), - io_signature::make(1, 1, sizeof (gr_complex) * blocks * fft_length)), - d_fft_length(fft_length), d_cp_length(cp_length), d_snr(snr), \ - d_phase(0.0), d_phaseinc(0.0), d_cp_found(0), d_nextphaseinc(0), d_nextpos(0), \ - d_initial_acquisition(0), d_cp_start(0), \ - d_to_consume(0), d_to_out(0), d_consumed(0), d_out(0) - { - set_relative_rate(1, (uint64_t) (d_cp_length + d_fft_length)); - - d_snr = pow(10, d_snr / 10.0); - d_rho = d_snr / (d_snr + 1.0); - - d_gamma = (gr_complex*) volk_malloc(sizeof(gr_complex) * d_fft_length, volk_get_alignment()); - if (d_gamma == NULL) { - GR_LOG_FATAL(d_logger, "OFDM Symbol Acquisition, cannot allocate memory for d_gamma."); +/* + * The private constructor + */ +dvbt_ofdm_sym_acquisition_impl::dvbt_ofdm_sym_acquisition_impl( + int blocks, int fft_length, int occupied_tones, int cp_length, float snr) + : block("dvbt_ofdm_sym_acquisition", + io_signature::make(1, 1, sizeof(gr_complex) * blocks), + io_signature::make(1, 1, sizeof(gr_complex) * blocks * fft_length)), + d_fft_length(fft_length), + d_cp_length(cp_length), + d_snr(snr), + d_phase(0.0), + d_phaseinc(0.0), + d_cp_found(0), + d_nextphaseinc(0), + d_nextpos(0), + d_initial_acquisition(0), + d_cp_start(0), + d_to_consume(0), + d_to_out(0), + d_consumed(0), + d_out(0) +{ + set_relative_rate(1, (uint64_t)(d_cp_length + d_fft_length)); + + d_snr = pow(10, d_snr / 10.0); + d_rho = d_snr / (d_snr + 1.0); + + d_gamma = + (gr_complex*)volk_malloc(sizeof(gr_complex) * d_fft_length, volk_get_alignment()); + if (d_gamma == NULL) { + GR_LOG_FATAL(d_logger, + "OFDM Symbol Acquisition, cannot allocate memory for d_gamma."); throw std::bad_alloc(); - } + } - d_lambda = (float*) volk_malloc(sizeof(float) * d_fft_length, volk_get_alignment()); - if (d_lambda == NULL) { - GR_LOG_FATAL(d_logger, "OFDM Symbol Acquisition, cannot allocate memory for d_lambda."); + d_lambda = (float*)volk_malloc(sizeof(float) * d_fft_length, volk_get_alignment()); + if (d_lambda == NULL) { + GR_LOG_FATAL(d_logger, + "OFDM Symbol Acquisition, cannot allocate memory for d_lambda."); volk_free(d_gamma); throw std::bad_alloc(); - } + } - d_derot = (gr_complex*) volk_malloc(sizeof(gr_complex) * (d_fft_length + d_cp_length), volk_get_alignment()); - if (d_derot == NULL) { - GR_LOG_FATAL(d_logger, "OFDM Symbol Acquisition, cannot allocate memory for d_derot."); + d_derot = (gr_complex*)volk_malloc(sizeof(gr_complex) * (d_fft_length + d_cp_length), + volk_get_alignment()); + if (d_derot == NULL) { + GR_LOG_FATAL(d_logger, + "OFDM Symbol Acquisition, cannot allocate memory for d_derot."); volk_free(d_lambda); volk_free(d_gamma); throw std::bad_alloc(); - } + } - d_conj = (gr_complex*) volk_malloc(sizeof(gr_complex) * (2 * d_fft_length + d_cp_length), volk_get_alignment()); - if (d_conj == NULL) { - GR_LOG_FATAL(d_logger, "OFDM Symbol Acquisition, cannot allocate memory for d_conj."); + d_conj = (gr_complex*)volk_malloc( + sizeof(gr_complex) * (2 * d_fft_length + d_cp_length), volk_get_alignment()); + if (d_conj == NULL) { + GR_LOG_FATAL(d_logger, + "OFDM Symbol Acquisition, cannot allocate memory for d_conj."); volk_free(d_derot); volk_free(d_lambda); volk_free(d_gamma); throw std::bad_alloc(); - } + } - d_norm = (float*) volk_malloc(sizeof(float) * (2 * d_fft_length + d_cp_length), volk_get_alignment()); - if (d_norm == NULL) { - GR_LOG_FATAL(d_logger, "OFDM Symbol Acquisition, cannot allocate memory for d_norm."); + d_norm = (float*)volk_malloc(sizeof(float) * (2 * d_fft_length + d_cp_length), + volk_get_alignment()); + if (d_norm == NULL) { + GR_LOG_FATAL(d_logger, + "OFDM Symbol Acquisition, cannot allocate memory for d_norm."); volk_free(d_conj); volk_free(d_derot); volk_free(d_lambda); volk_free(d_gamma); throw std::bad_alloc(); - } + } - d_corr = (gr_complex*) volk_malloc(sizeof(gr_complex) * (2 * d_fft_length + d_cp_length), volk_get_alignment()); - if (d_corr == NULL) { - GR_LOG_FATAL(d_logger, "OFDM Symbol Acquisition, cannot allocate memory for d_corr."); + d_corr = (gr_complex*)volk_malloc( + sizeof(gr_complex) * (2 * d_fft_length + d_cp_length), volk_get_alignment()); + if (d_corr == NULL) { + GR_LOG_FATAL(d_logger, + "OFDM Symbol Acquisition, cannot allocate memory for d_corr."); volk_free(d_norm); volk_free(d_conj); volk_free(d_derot); volk_free(d_lambda); volk_free(d_gamma); throw std::bad_alloc(); - } - - peak_detect_init(0.3, 0.9); - } - - /* - * Our virtual destructor. - */ - dvbt_ofdm_sym_acquisition_impl::~dvbt_ofdm_sym_acquisition_impl() - { - volk_free(d_corr); - volk_free(d_norm); - volk_free(d_conj); - volk_free(d_derot); - volk_free(d_lambda); - volk_free(d_gamma); } - void - dvbt_ofdm_sym_acquisition_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - int ninputs = ninput_items_required.size(); + peak_detect_init(0.3, 0.9); +} - // make sure we receive at least (symbol_length + fft_length) - for (int i = 0; i < ninputs; i++) { +/* + * Our virtual destructor. + */ +dvbt_ofdm_sym_acquisition_impl::~dvbt_ofdm_sym_acquisition_impl() +{ + volk_free(d_corr); + volk_free(d_norm); + volk_free(d_conj); + volk_free(d_derot); + volk_free(d_lambda); + volk_free(d_gamma); +} + +void dvbt_ofdm_sym_acquisition_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + int ninputs = ninput_items_required.size(); + + // make sure we receive at least (symbol_length + fft_length) + for (int i = 0; i < ninputs; i++) { ninput_items_required[i] = (d_cp_length + d_fft_length) * (noutput_items + 1); - } } +} + +/* + * ML Estimation of Time and Frequency Offset in OFDM systems + * Jan-Jaap van de Beek + */ - /* - * ML Estimation of Time and Frequency Offset in OFDM systems - * Jan-Jaap van de Beek - */ - - int - dvbt_ofdm_sym_acquisition_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - int low; - - d_consumed = 0; - d_out = 0; - - for (int i = 0; i < noutput_items; i++) { - // This is initial acquisition of symbol start - // TODO - make a FSM - if (!d_initial_acquisition) { - d_initial_acquisition = ml_sync(&in[d_consumed], 2 * d_fft_length + d_cp_length - 1, d_fft_length + d_cp_length - 1, \ - &d_cp_start, &d_derot[0], &d_to_consume, &d_to_out); +int dvbt_ofdm_sym_acquisition_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + gr_complex* out = (gr_complex*)output_items[0]; + int low; + + d_consumed = 0; + d_out = 0; + + for (int i = 0; i < noutput_items; i++) { + // This is initial acquisition of symbol start + // TODO - make a FSM + if (!d_initial_acquisition) { + d_initial_acquisition = ml_sync(&in[d_consumed], + 2 * d_fft_length + d_cp_length - 1, + d_fft_length + d_cp_length - 1, + &d_cp_start, + &d_derot[0], + &d_to_consume, + &d_to_out); d_cp_found = d_initial_acquisition; - } - else { + } else { // If we are here it means that in the previous iteration we found the CP. We - // now thus only search near it. - d_cp_found = ml_sync(&in[d_consumed], d_cp_start + 8, std::max(d_cp_start - 8, d_cp_length+d_fft_length - 1), \ - &d_cp_start, &d_derot[0], &d_to_consume, &d_to_out); + // now thus only search near it. + d_cp_found = ml_sync(&in[d_consumed], + d_cp_start + 8, + std::max(d_cp_start - 8, d_cp_length + d_fft_length - 1), + &d_cp_start, + &d_derot[0], + &d_to_consume, + &d_to_out); if (!d_cp_found) { - // We may have not found the CP because the smaller search range was too small (rare, but possible). - // We re-try with the whole search range. - d_cp_found = ml_sync(&in[d_consumed], 2 * d_fft_length + d_cp_length - 1, d_fft_length + d_cp_length - 1, \ - &d_cp_start, &d_derot[0], &d_to_consume, &d_to_out ); + // We may have not found the CP because the smaller search range was too + // small (rare, but possible). We re-try with the whole search range. + d_cp_found = ml_sync(&in[d_consumed], + 2 * d_fft_length + d_cp_length - 1, + d_fft_length + d_cp_length - 1, + &d_cp_start, + &d_derot[0], + &d_to_consume, + &d_to_out); } - } + } - if (d_cp_found) { + if (d_cp_found) { low = d_consumed + d_cp_start - d_fft_length + 1; derotate(&in[low], &out[i * d_fft_length]); - } - else { + } else { // Send sync_start downstream send_sync_start(); d_initial_acquisition = 0; @@ -379,18 +417,17 @@ namespace gr { // Tell runtime system how many output items we produced. return (d_out); - } - d_consumed += d_to_consume; - d_out += d_to_out; } + d_consumed += d_to_consume; + d_out += d_to_out; + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each(d_to_consume); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(d_to_consume); - // Tell runtime system how many output items we produced. - return (d_to_out); - } - } /* namespace dtv */ + // Tell runtime system how many output items we produced. + return (d_to_out); +} +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.h b/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.h index e4fe1dc50a..c7b2fd41f0 100644 --- a/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.h @@ -24,67 +24,76 @@ #include <gnuradio/dtv/dvbt_ofdm_sym_acquisition.h> namespace gr { - namespace dtv { - - class dvbt_ofdm_sym_acquisition_impl : public dvbt_ofdm_sym_acquisition - { - private: - int d_fft_length; - int d_cp_length; - float d_snr; - float d_rho; - - gr_complex * d_conj; - float * d_norm; - gr_complex * d_corr; - gr_complex * d_gamma; - float * d_lambda; - - // For peak detector - float d_threshold_factor_rise; - float d_avg_alpha; - float d_avg_min; - float d_avg_max; - float d_phase; - double d_phaseinc; - int d_cp_found; - double d_nextphaseinc; - int d_nextpos; - - int d_initial_acquisition; - - int d_cp_start; - - gr_complex * d_derot; - int d_to_consume; - int d_to_out; - int d_consumed; - int d_out; - - int ml_sync(const gr_complex * in, int lookup_start, int lookup_stop, int * cp_pos, gr_complex * derot, int * to_consume, int * to_out); - - int peak_detect_init(float threshold_factor_rise, float alpha); - - int peak_detect_process(const float * datain, const int datain_length, int * peak_pos, int * peak_max); - - void send_sync_start(); - - void derotate(const gr_complex * in, gr_complex *out); - - public: - dvbt_ofdm_sym_acquisition_impl(int blocks, int fft_length, int occupied_tones, int cp_length, float snr); - ~dvbt_ofdm_sym_acquisition_impl(); - - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class dvbt_ofdm_sym_acquisition_impl : public dvbt_ofdm_sym_acquisition +{ +private: + int d_fft_length; + int d_cp_length; + float d_snr; + float d_rho; + + gr_complex* d_conj; + float* d_norm; + gr_complex* d_corr; + gr_complex* d_gamma; + float* d_lambda; + + // For peak detector + float d_threshold_factor_rise; + float d_avg_alpha; + float d_avg_min; + float d_avg_max; + float d_phase; + double d_phaseinc; + int d_cp_found; + double d_nextphaseinc; + int d_nextpos; + + int d_initial_acquisition; + + int d_cp_start; + + gr_complex* d_derot; + int d_to_consume; + int d_to_out; + int d_consumed; + int d_out; + + int ml_sync(const gr_complex* in, + int lookup_start, + int lookup_stop, + int* cp_pos, + gr_complex* derot, + int* to_consume, + int* to_out); + + int peak_detect_init(float threshold_factor_rise, float alpha); + + int peak_detect_process(const float* datain, + const int datain_length, + int* peak_pos, + int* peak_max); + + void send_sync_start(); + + void derotate(const gr_complex* in, gr_complex* out); + +public: + dvbt_ofdm_sym_acquisition_impl( + int blocks, int fft_length, int occupied_tones, int cp_length, float snr); + ~dvbt_ofdm_sym_acquisition_impl(); + + void forecast(int noutput_items, gr_vector_int& ninput_items_required); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_OFDM_SYM_ACQUISITION_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_reed_solomon_dec_impl.cc b/gr-dtv/lib/dvbt/dvbt_reed_solomon_dec_impl.cc index fd6fedcf8d..f6d59ba2c1 100644 --- a/gr-dtv/lib/dvbt/dvbt_reed_solomon_dec_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_reed_solomon_dec_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,107 +26,105 @@ #include "dvbt_reed_solomon_dec_impl.h" namespace gr { - namespace dtv { - - static const int rs_init_symsize = 8; - static const int rs_init_fcr = 0; // first consecutive root - static const int rs_init_prim = 1; // primitive is 1 (alpha) - static const int N = (1 << rs_init_symsize) - 1; // 255 - - dvbt_reed_solomon_dec::sptr - dvbt_reed_solomon_dec::make(int p, int m, int gfpoly, int n, int k, int t, int s, int blocks) - { - return gnuradio::get_initial_sptr - (new dvbt_reed_solomon_dec_impl(p, m, gfpoly, n, k, t, s, blocks)); - } - - /* - * The private constructor - */ - dvbt_reed_solomon_dec_impl::dvbt_reed_solomon_dec_impl(int p, int m, int gfpoly, int n, int k, int t, int s, int blocks) - : block("dvbt_reed_solomon_dec", - io_signature::make(1, 1, sizeof(unsigned char) * blocks * (n - s)), - io_signature::make(1, 1, sizeof(unsigned char) * blocks * (k - s))), - d_n(n), d_k(k), d_s(s), d_blocks(blocks) - { - d_rs = init_rs_char(rs_init_symsize, gfpoly, rs_init_fcr, rs_init_prim, (n - k)); - if (d_rs == NULL) { +namespace dtv { + +static const int rs_init_symsize = 8; +static const int rs_init_fcr = 0; // first consecutive root +static const int rs_init_prim = 1; // primitive is 1 (alpha) +static const int N = (1 << rs_init_symsize) - 1; // 255 + +dvbt_reed_solomon_dec::sptr dvbt_reed_solomon_dec::make( + int p, int m, int gfpoly, int n, int k, int t, int s, int blocks) +{ + return gnuradio::get_initial_sptr( + new dvbt_reed_solomon_dec_impl(p, m, gfpoly, n, k, t, s, blocks)); +} + +/* + * The private constructor + */ +dvbt_reed_solomon_dec_impl::dvbt_reed_solomon_dec_impl( + int p, int m, int gfpoly, int n, int k, int t, int s, int blocks) + : block("dvbt_reed_solomon_dec", + io_signature::make(1, 1, sizeof(unsigned char) * blocks * (n - s)), + io_signature::make(1, 1, sizeof(unsigned char) * blocks * (k - s))), + d_n(n), + d_k(k), + d_s(s), + d_blocks(blocks) +{ + d_rs = init_rs_char(rs_init_symsize, gfpoly, rs_init_fcr, rs_init_prim, (n - k)); + if (d_rs == NULL) { GR_LOG_FATAL(d_logger, "Reed-Solomon Decoder, cannot allocate memory for d_rs."); throw std::bad_alloc(); - } - d_nerrors_corrected_count = 0; - d_bad_packet_count = 0; - d_total_packets = 0; - } - - /* - * Our virtual destructor. - */ - dvbt_reed_solomon_dec_impl::~dvbt_reed_solomon_dec_impl() - { - free_rs_char(d_rs); - } - - void - dvbt_reed_solomon_dec_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = noutput_items; - } - - int - dvbt_reed_solomon_dec_impl::decode (unsigned char &out, const unsigned char &in) - { - unsigned char tmp[N]; - int ncorrections; - - // add missing prefix zero padding to message - memset(tmp, 0, d_s); - memcpy(&tmp[d_s], &in, (d_n - d_s)); - - // correct message... - ncorrections = decode_rs_char(d_rs, tmp, 0, 0); - - // copy corrected message to output, skipping prefix zero padding - memcpy (&out, &tmp[d_s], (d_k - d_s)); - - return ncorrections; } + d_nerrors_corrected_count = 0; + d_bad_packet_count = 0; + d_total_packets = 0; +} - int - dvbt_reed_solomon_dec_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; - int j = 0; - int k = 0; - - for (int i = 0; i < (d_blocks * noutput_items); i++) { +/* + * Our virtual destructor. + */ +dvbt_reed_solomon_dec_impl::~dvbt_reed_solomon_dec_impl() { free_rs_char(d_rs); } + +void dvbt_reed_solomon_dec_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = noutput_items; +} + +int dvbt_reed_solomon_dec_impl::decode(unsigned char& out, const unsigned char& in) +{ + unsigned char tmp[N]; + int ncorrections; + + // add missing prefix zero padding to message + memset(tmp, 0, d_s); + memcpy(&tmp[d_s], &in, (d_n - d_s)); + + // correct message... + ncorrections = decode_rs_char(d_rs, tmp, 0, 0); + + // copy corrected message to output, skipping prefix zero padding + memcpy(&out, &tmp[d_s], (d_k - d_s)); + + return ncorrections; +} + +int dvbt_reed_solomon_dec_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; + int j = 0; + int k = 0; + + for (int i = 0; i < (d_blocks * noutput_items); i++) { int nerrors_corrected = decode(out[k], in[j]); if (nerrors_corrected == -1) { - d_bad_packet_count++; - d_nerrors_corrected_count += ((d_n - d_s) - (d_k - d_s)) / 2; // lower bound estimate; most this RS can fix - } - else { - d_nerrors_corrected_count += nerrors_corrected; + d_bad_packet_count++; + d_nerrors_corrected_count += ((d_n - d_s) - (d_k - d_s)) / + 2; // lower bound estimate; most this RS can fix + } else { + d_nerrors_corrected_count += nerrors_corrected; } - d_total_packets++; + d_total_packets++; j += (d_n - d_s); k += (d_k - d_s); - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (noutput_items); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(noutput_items); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt/dvbt_reed_solomon_dec_impl.h b/gr-dtv/lib/dvbt/dvbt_reed_solomon_dec_impl.h index 39a45c4521..a2f4193690 100644 --- a/gr-dtv/lib/dvbt/dvbt_reed_solomon_dec_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_reed_solomon_dec_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -28,37 +28,37 @@ extern "C" { } namespace gr { - namespace dtv { +namespace dtv { - class dvbt_reed_solomon_dec_impl : public dvbt_reed_solomon_dec - { - private: - int d_n; - int d_k; - int d_s; - int d_blocks; +class dvbt_reed_solomon_dec_impl : public dvbt_reed_solomon_dec +{ +private: + int d_n; + int d_k; + int d_s; + int d_blocks; - int d_nerrors_corrected_count; - int d_bad_packet_count; - int d_total_packets; + int d_nerrors_corrected_count; + int d_bad_packet_count; + int d_total_packets; - void *d_rs; /* Reed-Solomon characteristics structure */ - int decode(unsigned char &out, const unsigned char &in); + void* d_rs; /* Reed-Solomon characteristics structure */ + int decode(unsigned char& out, const unsigned char& in); - public: - dvbt_reed_solomon_dec_impl(int p, int m, int gfpoly, int n, int k, int t, int s, int blocks); - ~dvbt_reed_solomon_dec_impl(); +public: + dvbt_reed_solomon_dec_impl( + int p, int m, int gfpoly, int n, int k, int t, int s, int blocks); + ~dvbt_reed_solomon_dec_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_REED_SOLOMON_DEC_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_reed_solomon_enc_impl.cc b/gr-dtv/lib/dvbt/dvbt_reed_solomon_enc_impl.cc index 9092321462..8bf8794ec3 100644 --- a/gr-dtv/lib/dvbt/dvbt_reed_solomon_enc_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_reed_solomon_enc_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,96 +26,99 @@ #include "dvbt_reed_solomon_enc_impl.h" namespace gr { - namespace dtv { +namespace dtv { - static const int rs_init_symsize = 8; - static const int rs_init_fcr = 0; // first consecutive root - static const int rs_init_prim = 1; // primitive is 1 (alpha) +static const int rs_init_symsize = 8; +static const int rs_init_fcr = 0; // first consecutive root +static const int rs_init_prim = 1; // primitive is 1 (alpha) - dvbt_reed_solomon_enc::sptr - dvbt_reed_solomon_enc::make(int p, int m, int gfpoly, int n, int k, int t, int s, int blocks) - { - return gnuradio::get_initial_sptr - (new dvbt_reed_solomon_enc_impl(p, m, gfpoly, n, k, t, s, blocks)); - } +dvbt_reed_solomon_enc::sptr dvbt_reed_solomon_enc::make( + int p, int m, int gfpoly, int n, int k, int t, int s, int blocks) +{ + return gnuradio::get_initial_sptr( + new dvbt_reed_solomon_enc_impl(p, m, gfpoly, n, k, t, s, blocks)); +} - /* - * The private constructor - */ - dvbt_reed_solomon_enc_impl::dvbt_reed_solomon_enc_impl(int p, int m, int gfpoly, int n, int k, int t, int s, int blocks) - : block("dvbt_reed_solomon", - io_signature::make(1, 1, sizeof(unsigned char) * blocks * (k - s)), - io_signature::make(1, 1, sizeof(unsigned char) * blocks * (n - s))), - d_n(n), d_k(k), d_s(s), d_blocks(blocks) - { - d_rs = init_rs_char(rs_init_symsize, gfpoly, rs_init_fcr, rs_init_prim, (n - k)); - if (d_rs == NULL) { +/* + * The private constructor + */ +dvbt_reed_solomon_enc_impl::dvbt_reed_solomon_enc_impl( + int p, int m, int gfpoly, int n, int k, int t, int s, int blocks) + : block("dvbt_reed_solomon", + io_signature::make(1, 1, sizeof(unsigned char) * blocks * (k - s)), + io_signature::make(1, 1, sizeof(unsigned char) * blocks * (n - s))), + d_n(n), + d_k(k), + d_s(s), + d_blocks(blocks) +{ + d_rs = init_rs_char(rs_init_symsize, gfpoly, rs_init_fcr, rs_init_prim, (n - k)); + if (d_rs == NULL) { GR_LOG_FATAL(d_logger, "Reed-Solomon Encoder, cannot allocate memory for d_rs."); throw std::bad_alloc(); - } - // The full input frame size (d_k) (no need to add in d_s, as the block input is the pre-shortedned K) - d_data = (unsigned char *) malloc(sizeof(unsigned char) * (d_k)); - if (d_data == NULL) { - GR_LOG_FATAL(d_logger, "Reed-Solomon Encoder, cannot allocate memory for d_data."); + } + // The full input frame size (d_k) (no need to add in d_s, as the block input is the + // pre-shortedned K) + d_data = (unsigned char*)malloc(sizeof(unsigned char) * (d_k)); + if (d_data == NULL) { + GR_LOG_FATAL(d_logger, + "Reed-Solomon Encoder, cannot allocate memory for d_data."); free_rs_char(d_rs); throw std::bad_alloc(); - } - } - - /* - * Our virtual destructor. - */ - dvbt_reed_solomon_enc_impl::~dvbt_reed_solomon_enc_impl() - { - free(d_data); - free_rs_char(d_rs); - } - - void - dvbt_reed_solomon_enc_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = noutput_items; } +} - void - dvbt_reed_solomon_enc_impl::encode(const unsigned char *in, unsigned char *out) - { - // Shortened Reed-Solomon: prepend zero bytes to message (discarded after encoding) - std::memset(d_data, 0, d_s); - // This is the number of data bytes we need from the input stream. - int shortened_k = d_k-d_s; - std::memcpy(&d_data[d_s], in, shortened_k); - - // Copy input message to output then append Reed-Solomon bits - std::memcpy(out, in, shortened_k); - encode_rs_char(d_rs, d_data, &out[shortened_k]); - } - - int - dvbt_reed_solomon_enc_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; - int j = 0; - int k = 0; - - for (int i = 0; i < noutput_items * d_blocks; i++) { +/* + * Our virtual destructor. + */ +dvbt_reed_solomon_enc_impl::~dvbt_reed_solomon_enc_impl() +{ + free(d_data); + free_rs_char(d_rs); +} + +void dvbt_reed_solomon_enc_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = noutput_items; +} + +void dvbt_reed_solomon_enc_impl::encode(const unsigned char* in, unsigned char* out) +{ + // Shortened Reed-Solomon: prepend zero bytes to message (discarded after encoding) + std::memset(d_data, 0, d_s); + // This is the number of data bytes we need from the input stream. + int shortened_k = d_k - d_s; + std::memcpy(&d_data[d_s], in, shortened_k); + + // Copy input message to output then append Reed-Solomon bits + std::memcpy(out, in, shortened_k); + encode_rs_char(d_rs, d_data, &out[shortened_k]); +} + +int dvbt_reed_solomon_enc_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; + int j = 0; + int k = 0; + + for (int i = 0; i < noutput_items * d_blocks; i++) { encode(in + j, out + k); j += (d_k - d_s); k += (d_n - d_s); - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (noutput_items); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(noutput_items); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt/dvbt_reed_solomon_enc_impl.h b/gr-dtv/lib/dvbt/dvbt_reed_solomon_enc_impl.h index 47dea875f4..26411c3f7e 100644 --- a/gr-dtv/lib/dvbt/dvbt_reed_solomon_enc_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_reed_solomon_enc_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -28,35 +28,35 @@ extern "C" { } namespace gr { - namespace dtv { +namespace dtv { - class dvbt_reed_solomon_enc_impl : public dvbt_reed_solomon_enc - { - private: - int d_n; - int d_k; - int d_s; - int d_blocks; +class dvbt_reed_solomon_enc_impl : public dvbt_reed_solomon_enc +{ +private: + int d_n; + int d_k; + int d_s; + int d_blocks; - unsigned char *d_data; + unsigned char* d_data; - void *d_rs; /* Reed-Solomon characteristics structure */ - void encode(const unsigned char *in, unsigned char *out); + void* d_rs; /* Reed-Solomon characteristics structure */ + void encode(const unsigned char* in, unsigned char* out); - public: - dvbt_reed_solomon_enc_impl(int p, int m, int gfpoly, int n, int k, int t, int s, int blocks); - ~dvbt_reed_solomon_enc_impl(); +public: + dvbt_reed_solomon_enc_impl( + int p, int m, int gfpoly, int n, int k, int t, int s, int blocks); + ~dvbt_reed_solomon_enc_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_REED_SOLOMON_ENC_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc b/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc index bdf1574104..9b4e92b309 100644 --- a/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016,2018,2019 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -30,573 +30,537 @@ #include <algorithm> namespace gr { - namespace dtv { - - //Number of symbols in a frame - const int dvbt_pilot_gen::d_symbols_per_frame = SYMBOLS_PER_FRAME; - //Number of frames in a superframe - const int dvbt_pilot_gen::d_frames_per_superframe = FRAMES_PER_SUPERFRAME; - - // 2k mode - // Scattered pilots # of carriers - const int dvbt_pilot_gen::d_spilot_carriers_size_2k = SCATTERED_PILOT_SIZE_2k; - // Continual pilots # of carriers and positions - const int dvbt_pilot_gen::d_cpilot_carriers_size_2k = CONTINUAL_PILOT_SIZE_2k; - const int dvbt_pilot_gen::d_cpilot_carriers_2k[dvbt_pilot_gen::d_cpilot_carriers_size_2k] = { - 0, 48, 54, 87, 141, 156, 192, \ - 201, 255, 279, 282, 333, 432, 450, \ - 483, 525, 531, 618, 636, 714, 759, \ - 765, 780, 804, 873, 888, 918, 939, \ - 942, 969, 984, 1050, 1101, 1107, 1110, \ - 1137, 1140, 1146, 1206, 1269, 1323, 1377, \ - 1491, 1683, 1704 +namespace dtv { + +// Number of symbols in a frame +const int dvbt_pilot_gen::d_symbols_per_frame = SYMBOLS_PER_FRAME; +// Number of frames in a superframe +const int dvbt_pilot_gen::d_frames_per_superframe = FRAMES_PER_SUPERFRAME; + +// 2k mode +// Scattered pilots # of carriers +const int dvbt_pilot_gen::d_spilot_carriers_size_2k = SCATTERED_PILOT_SIZE_2k; +// Continual pilots # of carriers and positions +const int dvbt_pilot_gen::d_cpilot_carriers_size_2k = CONTINUAL_PILOT_SIZE_2k; +const int + dvbt_pilot_gen::d_cpilot_carriers_2k[dvbt_pilot_gen::d_cpilot_carriers_size_2k] = { + 0, 48, 54, 87, 141, 156, 192, 201, 255, 279, 282, 333, + 432, 450, 483, 525, 531, 618, 636, 714, 759, 765, 780, 804, + 873, 888, 918, 939, 942, 969, 984, 1050, 1101, 1107, 1110, 1137, + 1140, 1146, 1206, 1269, 1323, 1377, 1491, 1683, 1704 }; - // TPS pilots # of carriers and positions - const int dvbt_pilot_gen::d_tps_carriers_size_2k = TPS_PILOT_SIZE_2k; - const int dvbt_pilot_gen::d_tps_carriers_2k[dvbt_pilot_gen::d_tps_carriers_size_2k] = { - 34, 50, 209, 346, 413, \ - 569, 595, 688, 790, 901, \ - 1073, 1219, 1262, 1286, 1469, \ - 1594, 1687 +// TPS pilots # of carriers and positions +const int dvbt_pilot_gen::d_tps_carriers_size_2k = TPS_PILOT_SIZE_2k; +const int dvbt_pilot_gen::d_tps_carriers_2k[dvbt_pilot_gen::d_tps_carriers_size_2k] = { + 34, 50, 209, 346, 413, 569, 595, 688, 790, + 901, 1073, 1219, 1262, 1286, 1469, 1594, 1687 +}; + +// 8k mode +// Scattered pilots # of carriers +const int dvbt_pilot_gen::d_spilot_carriers_size_8k = SCATTERED_PILOT_SIZE_8k; +// Continual pilots # of carriers and positions +const int dvbt_pilot_gen::d_cpilot_carriers_size_8k = CONTINUAL_PILOT_SIZE_8k; +const int + dvbt_pilot_gen::d_cpilot_carriers_8k[dvbt_pilot_gen::d_cpilot_carriers_size_8k] = { + 0, 48, 54, 87, 141, 156, 192, 201, 255, 279, 282, 333, 432, + 450, 483, 525, 531, 618, 636, 714, 759, 765, 780, 804, 873, 888, + 918, 939, 942, 969, 984, 1050, 1101, 1107, 1110, 1137, 1140, 1146, 1206, + 1269, 1323, 1377, 1491, 1683, 1704, 1752, 1758, 1791, 1845, 1860, 1896, 1905, + 1959, 1983, 1986, 2037, 2136, 2154, 2187, 2229, 2235, 2322, 2340, 2418, 2463, + 2469, 2484, 2508, 2577, 2592, 2622, 2643, 2646, 2673, 2688, 2754, 2805, 2811, + 2814, 2841, 2844, 2850, 2910, 2973, 3027, 3081, 3195, 3387, 3408, 3456, 3462, + 3495, 3549, 3564, 3600, 3609, 3663, 3687, 3690, 3741, 3840, 3858, 3891, 3933, + 3939, 4026, 4044, 4122, 4167, 4173, 4188, 4212, 4281, 4296, 4326, 4347, 4350, + 4377, 4392, 4458, 4509, 4515, 4518, 4545, 4548, 4554, 4614, 4677, 4731, 4785, + 4899, 5091, 5112, 5160, 5166, 5199, 5253, 5268, 5304, 5313, 5367, 5391, 5394, + 5445, 5544, 5562, 5595, 5637, 5643, 5730, 5748, 5826, 5871, 5877, 5892, 5916, + 5985, 6000, 6030, 6051, 6054, 6081, 6096, 6162, 6213, 6219, 6222, 6249, 6252, + 6258, 6318, 6381, 6435, 6489, 6603, 6795, 6816 }; - - // 8k mode - // Scattered pilots # of carriers - const int dvbt_pilot_gen::d_spilot_carriers_size_8k = SCATTERED_PILOT_SIZE_8k; - // Continual pilots # of carriers and positions - const int dvbt_pilot_gen::d_cpilot_carriers_size_8k = CONTINUAL_PILOT_SIZE_8k; - const int dvbt_pilot_gen::d_cpilot_carriers_8k[dvbt_pilot_gen::d_cpilot_carriers_size_8k] = { - 0, 48, 54, 87, 141, 156, 192, - 201, 255, 279, 282, 333, 432, 450, - 483, 525, 531, 618, 636, 714, 759, - 765, 780, 804, 873, 888, 918, 939, - 942, 969, 984, 1050, 1101, 1107, 1110, - 1137, 1140, 1146, 1206, 1269, 1323, 1377, - 1491, 1683, 1704, 1752, 1758, 1791, 1845, - 1860, 1896, 1905, 1959, 1983, 1986, 2037, - 2136, 2154, 2187, 2229, 2235, 2322, 2340, - 2418, 2463, 2469, 2484, 2508, 2577, 2592, - 2622, 2643, 2646, 2673, 2688, 2754, 2805, - 2811, 2814, 2841, 2844, 2850, 2910, 2973, - 3027, 3081, 3195, 3387, 3408, 3456, 3462, - 3495, 3549, 3564, 3600, 3609, 3663, 3687, - 3690, 3741, 3840, 3858, 3891, 3933, 3939, - 4026, 4044, 4122, 4167, 4173, 4188, 4212, - 4281, 4296, 4326, 4347, 4350, 4377, 4392, - 4458, 4509, 4515, 4518, 4545, 4548, 4554, - 4614, 4677, 4731, 4785, 4899, 5091, 5112, - 5160, 5166, 5199, 5253, 5268, 5304, 5313, - 5367, 5391, 5394, 5445, 5544, 5562, 5595, - 5637, 5643, 5730, 5748, 5826, 5871, 5877, - 5892, 5916, 5985, 6000, 6030, 6051, 6054, - 6081, 6096, 6162, 6213, 6219, 6222, 6249, - 6252, 6258, 6318, 6381, 6435, 6489, 6603, - 6795, 6816 - }; - // TPS pilots # of carriers and positions - const int dvbt_pilot_gen::d_tps_carriers_size_8k = TPS_PILOT_SIZE_8k; - const int dvbt_pilot_gen::d_tps_carriers_8k[dvbt_pilot_gen::d_tps_carriers_size_8k] = { - 34, 50, 209, 346, 413, 569, 595, 688, \ - 790, 901, 1073, 1219, 1262, 1286, 1469, 1594, \ - 1687, 1738, 1754, 1913, 2050, 2117, 2273, 2299, \ - 2392, 2494, 2605, 2777, 2923, 2966, 2990, 3173, \ - 3298, 3391, 3442, 3458, 3617, 3754, 3821, 3977, \ - 4003, 4096, 4198, 4309, 4481, 4627, 4670, 4694, \ - 4877, 5002, 5095, 5146, 5162, 5321, 5458, 5525, \ - 5681, 5707, 5800, 5902, 6013, 6185, 6331, 6374, \ - 6398, 6581, 6706, 6799 - }; - - // TPS sync sequence for odd and even frames - const int dvbt_pilot_gen::d_tps_sync_size = 16; // TODO - const int dvbt_pilot_gen::d_tps_sync_even[d_tps_sync_size] = { - 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0 - }; - const int dvbt_pilot_gen::d_tps_sync_odd[d_tps_sync_size] = { - 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1 - }; - - /* - * Constructor of class - */ - dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure &c) : config(c), - d_spilot_index(0), - d_cpilot_index(0), - d_tpilot_index(0), - d_symbol_index(0), - d_symbol_index_known(0), - d_frame_index(0), - d_superframe_index(0), - d_freq_offset_max(8), - d_trigger_index(0), - d_payload_index(0), - d_chanestim_index(0), - d_prev_mod_symbol_index(0), - d_mod_symbol_index(0) - { - //Determine parameters from config file - d_Kmin = config.d_Kmin; - d_Kmax = config.d_Kmax; - d_fft_length = config.d_fft_length; - d_payload_length = config.d_payload_length; - d_zeros_on_left = config.d_zeros_on_left; - d_zeros_on_right = config.d_zeros_on_right; - d_cp_length = config.d_cp_length; - - //Set-up pilot data depending on transmission mode - if (config.d_transmission_mode == T2k) { +// TPS pilots # of carriers and positions +const int dvbt_pilot_gen::d_tps_carriers_size_8k = TPS_PILOT_SIZE_8k; +const int dvbt_pilot_gen::d_tps_carriers_8k[dvbt_pilot_gen::d_tps_carriers_size_8k] = { + 34, 50, 209, 346, 413, 569, 595, 688, 790, 901, 1073, 1219, 1262, 1286, + 1469, 1594, 1687, 1738, 1754, 1913, 2050, 2117, 2273, 2299, 2392, 2494, 2605, 2777, + 2923, 2966, 2990, 3173, 3298, 3391, 3442, 3458, 3617, 3754, 3821, 3977, 4003, 4096, + 4198, 4309, 4481, 4627, 4670, 4694, 4877, 5002, 5095, 5146, 5162, 5321, 5458, 5525, + 5681, 5707, 5800, 5902, 6013, 6185, 6331, 6374, 6398, 6581, 6706, 6799 +}; + +// TPS sync sequence for odd and even frames +const int dvbt_pilot_gen::d_tps_sync_size = 16; // TODO +const int dvbt_pilot_gen::d_tps_sync_even[d_tps_sync_size] = { 0, 0, 1, 1, 0, 1, 0, 1, + 1, 1, 1, 0, 1, 1, 1, 0 }; +const int dvbt_pilot_gen::d_tps_sync_odd[d_tps_sync_size] = { 1, 1, 0, 0, 1, 0, 1, 0, + 0, 0, 0, 1, 0, 0, 0, 1 }; + +/* + * Constructor of class + */ +dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure& c) + : config(c), + d_spilot_index(0), + d_cpilot_index(0), + d_tpilot_index(0), + d_symbol_index(0), + d_symbol_index_known(0), + d_frame_index(0), + d_superframe_index(0), + d_freq_offset_max(8), + d_trigger_index(0), + d_payload_index(0), + d_chanestim_index(0), + d_prev_mod_symbol_index(0), + d_mod_symbol_index(0) +{ + // Determine parameters from config file + d_Kmin = config.d_Kmin; + d_Kmax = config.d_Kmax; + d_fft_length = config.d_fft_length; + d_payload_length = config.d_payload_length; + d_zeros_on_left = config.d_zeros_on_left; + d_zeros_on_right = config.d_zeros_on_right; + d_cp_length = config.d_cp_length; + + // Set-up pilot data depending on transmission mode + if (config.d_transmission_mode == T2k) { d_spilot_carriers_size = d_spilot_carriers_size_2k; d_cpilot_carriers_size = d_cpilot_carriers_size_2k; d_cpilot_carriers = d_cpilot_carriers_2k; d_tps_carriers_size = d_tps_carriers_size_2k; d_tps_carriers = d_tps_carriers_2k; - } - else if (config.d_transmission_mode == T8k) { + } else if (config.d_transmission_mode == T8k) { d_spilot_carriers_size = d_spilot_carriers_size_8k; d_cpilot_carriers_size = d_cpilot_carriers_size_8k; d_cpilot_carriers = d_cpilot_carriers_8k; d_tps_carriers_size = d_tps_carriers_size_8k; d_tps_carriers = d_tps_carriers_8k; - } - else { + } else { d_spilot_carriers_size = d_spilot_carriers_size_2k; d_cpilot_carriers_size = d_cpilot_carriers_size_2k; d_cpilot_carriers = d_cpilot_carriers_2k; d_tps_carriers_size = d_tps_carriers_size_2k; d_tps_carriers = d_tps_carriers_2k; - } + } - d_freq_offset = 0; - d_carrier_freq_correction = 0.0; - d_sampling_freq_correction = 0.0; + d_freq_offset = 0; + d_carrier_freq_correction = 0.0; + d_sampling_freq_correction = 0.0; - //allocate PRBS buffer - d_wk = new char[d_Kmax - d_Kmin + 1]; - if (d_wk == NULL) { + // allocate PRBS buffer + d_wk = new char[d_Kmax - d_Kmin + 1]; + if (d_wk == NULL) { std::cerr << "Reference Signals, cannot allocate memory for d_wk." << std::endl; throw std::bad_alloc(); - } - // Generate wk sequence - generate_prbs(); - - // allocate buffer for scattered pilots - d_spilot_carriers_val = new (std::nothrow) gr_complex[d_Kmax - d_Kmin + 1]; - if (d_spilot_carriers_val == NULL) { - std::cerr << "Reference Signals, cannot allocate memory for d_spilot_carriers_val." << std::endl; - delete [] d_wk; + } + // Generate wk sequence + generate_prbs(); + + // allocate buffer for scattered pilots + d_spilot_carriers_val = new (std::nothrow) gr_complex[d_Kmax - d_Kmin + 1]; + if (d_spilot_carriers_val == NULL) { + std::cerr + << "Reference Signals, cannot allocate memory for d_spilot_carriers_val." + << std::endl; + delete[] d_wk; throw std::bad_alloc(); - } - - // allocate buffer for channel gains (for each useful carrier) - d_channel_gain = new (std::nothrow) gr_complex[d_Kmax - d_Kmin + 1]; - if (d_channel_gain == NULL) { - std::cerr << "Reference Signals, cannot allocate memory for d_channel_gain." << std::endl; - delete [] d_spilot_carriers_val; - delete [] d_wk; + } + + // allocate buffer for channel gains (for each useful carrier) + d_channel_gain = new (std::nothrow) gr_complex[d_Kmax - d_Kmin + 1]; + if (d_channel_gain == NULL) { + std::cerr << "Reference Signals, cannot allocate memory for d_channel_gain." + << std::endl; + delete[] d_spilot_carriers_val; + delete[] d_wk; throw std::bad_alloc(); - } - - // Allocate buffer for continual pilots phase diffs - d_known_phase_diff = new (std::nothrow) float[d_cpilot_carriers_size - 1]; - if (d_known_phase_diff == NULL) { - std::cerr << "Reference Signals, cannot allocate memory for d_known_phase_diff." << std::endl; - delete [] d_channel_gain; - delete [] d_spilot_carriers_val; - delete [] d_wk; + } + + // Allocate buffer for continual pilots phase diffs + d_known_phase_diff = new (std::nothrow) float[d_cpilot_carriers_size - 1]; + if (d_known_phase_diff == NULL) { + std::cerr << "Reference Signals, cannot allocate memory for d_known_phase_diff." + << std::endl; + delete[] d_channel_gain; + delete[] d_spilot_carriers_val; + delete[] d_wk; throw std::bad_alloc(); - } - - // Obtain phase diff for all continual pilots - for (int i = 0; i < (d_cpilot_carriers_size - 1); i++) { - d_known_phase_diff[i] = \ - norm(get_cpilot_value(d_cpilot_carriers[i + 1]) - get_cpilot_value(d_cpilot_carriers[i])); - } - - d_cpilot_phase_diff = new (std::nothrow) float[d_cpilot_carriers_size - 1]; - if (d_cpilot_phase_diff == NULL) { - std::cerr << "Reference Signals, cannot allocate memory for d_cpilot_phase_diff." << std::endl; - delete [] d_known_phase_diff; - delete [] d_channel_gain; - delete [] d_spilot_carriers_val; - delete [] d_wk; + } + + // Obtain phase diff for all continual pilots + for (int i = 0; i < (d_cpilot_carriers_size - 1); i++) { + d_known_phase_diff[i] = norm(get_cpilot_value(d_cpilot_carriers[i + 1]) - + get_cpilot_value(d_cpilot_carriers[i])); + } + + d_cpilot_phase_diff = new (std::nothrow) float[d_cpilot_carriers_size - 1]; + if (d_cpilot_phase_diff == NULL) { + std::cerr << "Reference Signals, cannot allocate memory for d_cpilot_phase_diff." + << std::endl; + delete[] d_known_phase_diff; + delete[] d_channel_gain; + delete[] d_spilot_carriers_val; + delete[] d_wk; throw std::bad_alloc(); - } - - // Allocate buffer for derotated input symbol - d_derot_in = new (std::nothrow) gr_complex[d_fft_length]; - if (d_derot_in == NULL) { - std::cerr << "Reference Signals, cannot allocate memory for d_derot_in." << std::endl; - delete [] d_cpilot_phase_diff; - delete [] d_known_phase_diff; - delete [] d_channel_gain; - delete [] d_spilot_carriers_val; - delete [] d_wk; + } + + // Allocate buffer for derotated input symbol + d_derot_in = new (std::nothrow) gr_complex[d_fft_length]; + if (d_derot_in == NULL) { + std::cerr << "Reference Signals, cannot allocate memory for d_derot_in." + << std::endl; + delete[] d_cpilot_phase_diff; + delete[] d_known_phase_diff; + delete[] d_channel_gain; + delete[] d_spilot_carriers_val; + delete[] d_wk; throw std::bad_alloc(); - } - - // allocate buffer for first tps symbol constellation - d_tps_carriers_val = new (std::nothrow) gr_complex[d_tps_carriers_size]; - if (d_tps_carriers_val == NULL) { - std::cerr << "Reference Signals, cannot allocate memory for d_tps_carriers_val." << std::endl; - delete [] d_derot_in; - delete [] d_cpilot_phase_diff; - delete [] d_known_phase_diff; - delete [] d_channel_gain; - delete [] d_spilot_carriers_val; - delete [] d_wk; + } + + // allocate buffer for first tps symbol constellation + d_tps_carriers_val = new (std::nothrow) gr_complex[d_tps_carriers_size]; + if (d_tps_carriers_val == NULL) { + std::cerr << "Reference Signals, cannot allocate memory for d_tps_carriers_val." + << std::endl; + delete[] d_derot_in; + delete[] d_cpilot_phase_diff; + delete[] d_known_phase_diff; + delete[] d_channel_gain; + delete[] d_spilot_carriers_val; + delete[] d_wk; throw std::bad_alloc(); - } - - // allocate tps data buffer - d_tps_data = new (std::nothrow) unsigned char[d_symbols_per_frame]; - if (d_tps_data == NULL) { - std::cerr << "Reference Signals, cannot allocate memory for d_tps_data." << std::endl; - delete [] d_tps_carriers_val; - delete [] d_derot_in; - delete [] d_cpilot_phase_diff; - delete [] d_known_phase_diff; - delete [] d_channel_gain; - delete [] d_spilot_carriers_val; - delete [] d_wk; + } + + // allocate tps data buffer + d_tps_data = new (std::nothrow) unsigned char[d_symbols_per_frame]; + if (d_tps_data == NULL) { + std::cerr << "Reference Signals, cannot allocate memory for d_tps_data." + << std::endl; + delete[] d_tps_carriers_val; + delete[] d_derot_in; + delete[] d_cpilot_phase_diff; + delete[] d_known_phase_diff; + delete[] d_channel_gain; + delete[] d_spilot_carriers_val; + delete[] d_wk; throw std::bad_alloc(); - } - - d_prev_tps_symbol = new (std::nothrow) gr_complex[d_tps_carriers_size]; - if (d_prev_tps_symbol == NULL) { - std::cerr << "Reference Signals, cannot allocate memory for d_prev_tps_symbol." << std::endl; - delete [] d_tps_data; - delete [] d_tps_carriers_val; - delete [] d_derot_in; - delete [] d_cpilot_phase_diff; - delete [] d_known_phase_diff; - delete [] d_channel_gain; - delete [] d_spilot_carriers_val; - delete [] d_wk; + } + + d_prev_tps_symbol = new (std::nothrow) gr_complex[d_tps_carriers_size]; + if (d_prev_tps_symbol == NULL) { + std::cerr << "Reference Signals, cannot allocate memory for d_prev_tps_symbol." + << std::endl; + delete[] d_tps_data; + delete[] d_tps_carriers_val; + delete[] d_derot_in; + delete[] d_cpilot_phase_diff; + delete[] d_known_phase_diff; + delete[] d_channel_gain; + delete[] d_spilot_carriers_val; + delete[] d_wk; throw std::bad_alloc(); - } - std::fill_n(d_prev_tps_symbol, d_tps_carriers_size, 0); - - d_tps_symbol = new (std::nothrow) gr_complex[d_tps_carriers_size]; - if (d_tps_symbol == NULL) { - std::cerr << "Reference Signals, cannot allocate memory for d_tps_symbol." << std::endl; - delete [] d_prev_tps_symbol; - delete [] d_tps_data; - delete [] d_tps_carriers_val; - delete [] d_derot_in; - delete [] d_cpilot_phase_diff; - delete [] d_known_phase_diff; - delete [] d_channel_gain; - delete [] d_spilot_carriers_val; - delete [] d_wk; + } + std::fill_n(d_prev_tps_symbol, d_tps_carriers_size, 0); + + d_tps_symbol = new (std::nothrow) gr_complex[d_tps_carriers_size]; + if (d_tps_symbol == NULL) { + std::cerr << "Reference Signals, cannot allocate memory for d_tps_symbol." + << std::endl; + delete[] d_prev_tps_symbol; + delete[] d_tps_data; + delete[] d_tps_carriers_val; + delete[] d_derot_in; + delete[] d_cpilot_phase_diff; + delete[] d_known_phase_diff; + delete[] d_channel_gain; + delete[] d_spilot_carriers_val; + delete[] d_wk; throw std::bad_alloc(); - } - std::fill_n(d_tps_symbol, d_tps_carriers_size, 0); + } + std::fill_n(d_tps_symbol, d_tps_carriers_size, 0); - // Init receive TPS data vector - for (int i = 0; i < d_symbols_per_frame; i++) { + // Init receive TPS data vector + for (int i = 0; i < d_symbols_per_frame; i++) { d_rcv_tps_data.push_back(0); - } + } - // Init TPS sync sequence - for (int i = 0; i < d_tps_sync_size; i++) { + // Init TPS sync sequence + for (int i = 0; i < d_tps_sync_size; i++) { d_tps_sync_evenv.push_back(d_tps_sync_even[i]); d_tps_sync_oddv.push_back(d_tps_sync_odd[i]); - } - - // Allocate buffer for channel estimation carriers - d_chanestim_carriers = new (std::nothrow) int[d_Kmax - d_Kmin + 1]; - if (d_chanestim_carriers == NULL) { - std::cerr << "Reference Signals, cannot allocate memory for d_chanestim_carriers." << std::endl; - delete [] d_tps_symbol; - delete [] d_prev_tps_symbol; - delete [] d_tps_data; - delete [] d_tps_carriers_val; - delete [] d_derot_in; - delete [] d_cpilot_phase_diff; - delete [] d_known_phase_diff; - delete [] d_channel_gain; - delete [] d_spilot_carriers_val; - delete [] d_wk; - throw std::bad_alloc(); - } - - // Allocate buffer for payload carriers - d_payload_carriers = new (std::nothrow) int[d_Kmax - d_Kmin + 1]; - if (d_payload_carriers == NULL) { - std::cerr << "Reference Signals, cannot allocate memory for d_payload_carriers." << std::endl; - delete [] d_chanestim_carriers; - delete [] d_tps_symbol; - delete [] d_prev_tps_symbol; - delete [] d_tps_data; - delete [] d_tps_carriers_val; - delete [] d_derot_in; - delete [] d_cpilot_phase_diff; - delete [] d_known_phase_diff; - delete [] d_channel_gain; - delete [] d_spilot_carriers_val; - delete [] d_wk; - throw std::bad_alloc(); - } + } - // Reset the pilot generator - reset_pilot_generator(); - // Format TPS data with current values - format_tps_data(); + // Allocate buffer for channel estimation carriers + d_chanestim_carriers = new (std::nothrow) int[d_Kmax - d_Kmin + 1]; + if (d_chanestim_carriers == NULL) { + std::cerr << "Reference Signals, cannot allocate memory for d_chanestim_carriers." + << std::endl; + delete[] d_tps_symbol; + delete[] d_prev_tps_symbol; + delete[] d_tps_data; + delete[] d_tps_carriers_val; + delete[] d_derot_in; + delete[] d_cpilot_phase_diff; + delete[] d_known_phase_diff; + delete[] d_channel_gain; + delete[] d_spilot_carriers_val; + delete[] d_wk; + throw std::bad_alloc(); } - /* - * Destructor of class - */ - dvbt_pilot_gen::~dvbt_pilot_gen() - { - delete [] d_payload_carriers; - delete [] d_chanestim_carriers; - delete [] d_tps_symbol; - delete [] d_prev_tps_symbol; - delete [] d_tps_data; - delete [] d_tps_carriers_val; - delete [] d_derot_in; - delete [] d_cpilot_phase_diff; - delete [] d_known_phase_diff; - delete [] d_channel_gain; - delete [] d_spilot_carriers_val; - delete [] d_wk; + // Allocate buffer for payload carriers + d_payload_carriers = new (std::nothrow) int[d_Kmax - d_Kmin + 1]; + if (d_payload_carriers == NULL) { + std::cerr << "Reference Signals, cannot allocate memory for d_payload_carriers." + << std::endl; + delete[] d_chanestim_carriers; + delete[] d_tps_symbol; + delete[] d_prev_tps_symbol; + delete[] d_tps_data; + delete[] d_tps_carriers_val; + delete[] d_derot_in; + delete[] d_cpilot_phase_diff; + delete[] d_known_phase_diff; + delete[] d_channel_gain; + delete[] d_spilot_carriers_val; + delete[] d_wk; + throw std::bad_alloc(); } - /* - * Generate PRBS sequence - * X^11 + X^2 + 1 - * en 300 744 - section 4.5.2 - */ - void - dvbt_pilot_gen::generate_prbs() - { - // init PRBS register with 1s - unsigned int reg_prbs = (1 << 11) - 1; - - for (int k = 0; k < (d_Kmax - d_Kmin + 1); k++) { + // Reset the pilot generator + reset_pilot_generator(); + // Format TPS data with current values + format_tps_data(); +} + +/* + * Destructor of class + */ +dvbt_pilot_gen::~dvbt_pilot_gen() +{ + delete[] d_payload_carriers; + delete[] d_chanestim_carriers; + delete[] d_tps_symbol; + delete[] d_prev_tps_symbol; + delete[] d_tps_data; + delete[] d_tps_carriers_val; + delete[] d_derot_in; + delete[] d_cpilot_phase_diff; + delete[] d_known_phase_diff; + delete[] d_channel_gain; + delete[] d_spilot_carriers_val; + delete[] d_wk; +} + +/* + * Generate PRBS sequence + * X^11 + X^2 + 1 + * en 300 744 - section 4.5.2 + */ +void dvbt_pilot_gen::generate_prbs() +{ + // init PRBS register with 1s + unsigned int reg_prbs = (1 << 11) - 1; + + for (int k = 0; k < (d_Kmax - d_Kmin + 1); k++) { d_wk[k] = (char)(reg_prbs & 0x01); int new_bit = ((reg_prbs >> 2) ^ (reg_prbs >> 0)) & 0x01; reg_prbs = (reg_prbs >> 1) | (new_bit << 10); - } } +} - /* - * Generate shortened BCH(67, 53) codes from TPS data - * Extend the code with 60 bits and use BCH(127, 113) - */ - void - dvbt_pilot_gen::generate_bch_code() - { - //TODO - //DO other way: if (feedback == 1) reg = reg ^ polymomial - //else nothing - - //(n, k) = (127, 113) = (60+67, 60+53) - unsigned int reg_bch = 0; - unsigned char data_in[113]; - - //fill in 60 zeros - memset(&data_in[0], 0, 60); - //fill in TPS data - start bit not included - memcpy(&data_in[60], &d_tps_data[1], 53); - - //X^14+X^9+X^8+X^6+X^5+X^4+X^2+X+1 - for (int i = 0; i < 113; i++) { +/* + * Generate shortened BCH(67, 53) codes from TPS data + * Extend the code with 60 bits and use BCH(127, 113) + */ +void dvbt_pilot_gen::generate_bch_code() +{ + // TODO + // DO other way: if (feedback == 1) reg = reg ^ polymomial + // else nothing + + //(n, k) = (127, 113) = (60+67, 60+53) + unsigned int reg_bch = 0; + unsigned char data_in[113]; + + // fill in 60 zeros + memset(&data_in[0], 0, 60); + // fill in TPS data - start bit not included + memcpy(&data_in[60], &d_tps_data[1], 53); + + // X^14+X^9+X^8+X^6+X^5+X^4+X^2+X+1 + for (int i = 0; i < 113; i++) { int feedback = 0x1 & (data_in[i] ^ reg_bch); - reg_bch = reg_bch >> 1; + reg_bch = reg_bch >> 1; reg_bch |= feedback << 13; - reg_bch = reg_bch \ - ^ (feedback << 12) ^ (feedback << 11) \ - ^ (feedback << 9) ^ (feedback << 8) \ - ^ (feedback << 7) ^ (feedback << 5) \ - ^ (feedback << 4); - } - - for (int i = 0; i < 14; i++) { + reg_bch = reg_bch ^ (feedback << 12) ^ (feedback << 11) ^ (feedback << 9) ^ + (feedback << 8) ^ (feedback << 7) ^ (feedback << 5) ^ (feedback << 4); + } + + for (int i = 0; i < 14; i++) { d_tps_data[i + 54] = 0x1 & (reg_bch >> i); - } } +} - int - dvbt_pilot_gen::verify_bch_code(std::deque<char> data) - { - int ret = 0; +int dvbt_pilot_gen::verify_bch_code(std::deque<char> data) +{ + int ret = 0; - //TODO - //DO other way: if (feedback == 1) reg = reg ^ polymomial - //else nothing + // TODO + // DO other way: if (feedback == 1) reg = reg ^ polymomial + // else nothing - //(n, k) = (127, 113) = (60+67, 60+53) - unsigned int reg_bch = 0; - unsigned char data_in[113]; + //(n, k) = (127, 113) = (60+67, 60+53) + unsigned int reg_bch = 0; + unsigned char data_in[113]; - //fill in 60 zeros - memset(&data_in[0], 0, 60); - //fill in TPS data - start bit not included - //memcpy(&data_in[60], &data[1], 53); - for (int i = 0; i < 53; i++) { + // fill in 60 zeros + memset(&data_in[0], 0, 60); + // fill in TPS data - start bit not included + // memcpy(&data_in[60], &data[1], 53); + for (int i = 0; i < 53; i++) { data_in[60 + i] = data[1 + i]; - } + } - //X^14+X^9+X^8+X^6+X^5+X^4+X^2+X+1 - for (int i = 0; i < 113; i++) { + // X^14+X^9+X^8+X^6+X^5+X^4+X^2+X+1 + for (int i = 0; i < 113; i++) { int feedback = 0x1 & (data_in[i] ^ reg_bch); - reg_bch = reg_bch >> 1; + reg_bch = reg_bch >> 1; reg_bch |= feedback << 13; - reg_bch = reg_bch \ - ^ (feedback << 12) ^ (feedback << 11) \ - ^ (feedback << 9) ^ (feedback << 8) \ - ^ (feedback << 7) ^ (feedback << 5) \ - ^ (feedback << 4); - } - - for (int i = 0; i < 14; i++) { - if ((unsigned int)data[i + 54] != (0x1 & (reg_bch >> i))) { - ret = -1; - break; - } - } - - return ret; - } - - void - dvbt_pilot_gen::set_symbol_index(int sindex) - { - d_symbol_index = sindex; - } - - int - dvbt_pilot_gen::get_symbol_index() - { - return d_symbol_index; + reg_bch = reg_bch ^ (feedback << 12) ^ (feedback << 11) ^ (feedback << 9) ^ + (feedback << 8) ^ (feedback << 7) ^ (feedback << 5) ^ (feedback << 4); } - void - dvbt_pilot_gen::set_tps_data() - { + for (int i = 0; i < 14; i++) { + if ((unsigned int)data[i + 54] != (0x1 & (reg_bch >> i))) { + ret = -1; + break; + } } - void - dvbt_pilot_gen::get_tps_data() - { - } + return ret; +} - /* - * Reset pilot generator - */ - void - dvbt_pilot_gen::reset_pilot_generator() - { - d_spilot_index = 0; d_cpilot_index = 0; d_tpilot_index = 0; - d_payload_index = 0; d_chanestim_index = 0; - d_symbol_index = 0; d_frame_index = 0; d_superframe_index = 0; - d_symbol_index_known = 0; - d_equalizer_ready = 0; - } +void dvbt_pilot_gen::set_symbol_index(int sindex) { d_symbol_index = sindex; } - /* - * Init scattered pilot generator - */ - int - dvbt_pilot_gen::get_current_spilot(int sindex) const - { - //TODO - can be optimized for same symbol_index - return (d_Kmin + 3 * (sindex % 4) + 12 * d_spilot_index); - } +int dvbt_pilot_gen::get_symbol_index() { return d_symbol_index; } - gr_complex - dvbt_pilot_gen::get_spilot_value(int spilot) - { - // TODO - can be calculated at the beginning - return gr_complex(4 * 2 * (0.5 - d_wk[spilot]) / 3, 0); - } - - void - dvbt_pilot_gen::set_spilot_value(int spilot, gr_complex val) - { - d_spilot_carriers_val[spilot] = val; - } +void dvbt_pilot_gen::set_tps_data() {} - void - dvbt_pilot_gen::set_channel_gain(int spilot, gr_complex val) - { - // Gain gval=rxval/txval - d_channel_gain[spilot] = gr_complex((4 * 2 * (0.5 - d_wk[spilot]) / 3), 0) / val; - } - void - dvbt_pilot_gen::advance_spilot(int sindex) - { - //TODO - do in a simpler way? - int size = d_spilot_carriers_size; +void dvbt_pilot_gen::get_tps_data() {} - if (sindex == 0) { +/* + * Reset pilot generator + */ +void dvbt_pilot_gen::reset_pilot_generator() +{ + d_spilot_index = 0; + d_cpilot_index = 0; + d_tpilot_index = 0; + d_payload_index = 0; + d_chanestim_index = 0; + d_symbol_index = 0; + d_frame_index = 0; + d_superframe_index = 0; + d_symbol_index_known = 0; + d_equalizer_ready = 0; +} + +/* + * Init scattered pilot generator + */ +int dvbt_pilot_gen::get_current_spilot(int sindex) const +{ + // TODO - can be optimized for same symbol_index + return (d_Kmin + 3 * (sindex % 4) + 12 * d_spilot_index); +} + +gr_complex dvbt_pilot_gen::get_spilot_value(int spilot) +{ + // TODO - can be calculated at the beginning + return gr_complex(4 * 2 * (0.5 - d_wk[spilot]) / 3, 0); +} + +void dvbt_pilot_gen::set_spilot_value(int spilot, gr_complex val) +{ + d_spilot_carriers_val[spilot] = val; +} + +void dvbt_pilot_gen::set_channel_gain(int spilot, gr_complex val) +{ + // Gain gval=rxval/txval + d_channel_gain[spilot] = gr_complex((4 * 2 * (0.5 - d_wk[spilot]) / 3), 0) / val; +} +void dvbt_pilot_gen::advance_spilot(int sindex) +{ + // TODO - do in a simpler way? + int size = d_spilot_carriers_size; + + if (sindex == 0) { size = d_spilot_carriers_size + 1; - } - - // TODO - fix this - what value should we use? - ++d_spilot_index; - d_spilot_index = d_spilot_index % size; } - int - dvbt_pilot_gen::get_first_spilot() - { - d_spilot_index = 0; + // TODO - fix this - what value should we use? + ++d_spilot_index; + d_spilot_index = d_spilot_index % size; +} - return (d_Kmin + 3 * (d_symbol_index % 4)); - } +int dvbt_pilot_gen::get_first_spilot() +{ + d_spilot_index = 0; - int - dvbt_pilot_gen::get_last_spilot() const - { - int size = d_spilot_carriers_size - 1; + return (d_Kmin + 3 * (d_symbol_index % 4)); +} - if (d_symbol_index == 0) { - size = d_spilot_carriers_size; - } +int dvbt_pilot_gen::get_last_spilot() const +{ + int size = d_spilot_carriers_size - 1; - return (d_Kmin + 3 * (d_symbol_index % 4) + 12 * size); + if (d_symbol_index == 0) { + size = d_spilot_carriers_size; } - int - dvbt_pilot_gen::get_next_spilot() - { - int pilot = (d_Kmin + 3 * (d_symbol_index % 4) + 12 * (++d_spilot_index)); + return (d_Kmin + 3 * (d_symbol_index % 4) + 12 * size); +} - if (pilot > d_Kmax) { - pilot = d_Kmax; - } +int dvbt_pilot_gen::get_next_spilot() +{ + int pilot = (d_Kmin + 3 * (d_symbol_index % 4) + 12 * (++d_spilot_index)); - return pilot; + if (pilot > d_Kmax) { + pilot = d_Kmax; } - int - dvbt_pilot_gen::process_spilot_data(const gr_complex * in) - { - // This is channel estimator - // Interpolate the gain between carriers to obtain - // gain for non pilot carriers - we use linear interpolation - - /*************************************************************/ - // Find out the OFDM symbol index (value 0 to 3) sent - // in current block by correlating scattered symbols with - // current block - result is (symbol index % 4) - /*************************************************************/ - float max = 0; float sum = 0; - - for (int scount = 0; scount < 4; scount++) { - d_spilot_index = 0; d_cpilot_index = 0; + return pilot; +} + +int dvbt_pilot_gen::process_spilot_data(const gr_complex* in) +{ + // This is channel estimator + // Interpolate the gain between carriers to obtain + // gain for non pilot carriers - we use linear interpolation + + /*************************************************************/ + // Find out the OFDM symbol index (value 0 to 3) sent + // in current block by correlating scattered symbols with + // current block - result is (symbol index % 4) + /*************************************************************/ + float max = 0; + float sum = 0; + + for (int scount = 0; scount < 4; scount++) { + d_spilot_index = 0; + d_cpilot_index = 0; d_chanestim_index = 0; for (int k = 0; k < (d_Kmax - d_Kmin + 1); k++) { - // Keep data for channel estimation - if (k == get_current_spilot(scount)) { - set_chanestim_carrier(k); - advance_spilot(scount); - advance_chanestim(); - } + // Keep data for channel estimation + if (k == get_current_spilot(scount)) { + set_chanestim_carrier(k); + advance_spilot(scount); + advance_chanestim(); + } } gr_complex c = gr_complex(0.0, 0.0); @@ -604,44 +568,46 @@ namespace gr { // This should be of range 0 to d_chanestim_index bit for now we use just a // small number of spilots to obtain the symbol index for (int j = 0; j < 10; j++) { - c += get_spilot_value(d_chanestim_carriers[j]) * conj(in[d_zeros_on_left + d_chanestim_carriers[j]]); + c += get_spilot_value(d_chanestim_carriers[j]) * + conj(in[d_zeros_on_left + d_chanestim_carriers[j]]); } sum = norm(c); if (sum > max) { - max = sum; - d_mod_symbol_index = scount; + max = sum; + d_mod_symbol_index = scount; } - } + } - /*************************************************************/ - // Keep data for channel estimator - // This method interpolates scattered measurements across one OFDM symbol - // It does not use measurements from the previous OFDM symbols (does not use history) - // as it may have encountered a phase change for the current phase only - /*************************************************************/ + /*************************************************************/ + // Keep data for channel estimator + // This method interpolates scattered measurements across one OFDM symbol + // It does not use measurements from the previous OFDM symbols (does not use history) + // as it may have encountered a phase change for the current phase only + /*************************************************************/ - d_spilot_index = 0; d_cpilot_index = 0; - d_chanestim_index = 0; + d_spilot_index = 0; + d_cpilot_index = 0; + d_chanestim_index = 0; - for (int k = 0; k < (d_Kmax - d_Kmin + 1); k++) { + for (int k = 0; k < (d_Kmax - d_Kmin + 1); k++) { // Keep data for channel estimation if (k == get_current_spilot(d_mod_symbol_index)) { - set_chanestim_carrier(k); - advance_spilot(d_mod_symbol_index); - advance_chanestim(); + set_chanestim_carrier(k); + advance_spilot(d_mod_symbol_index); + advance_chanestim(); } // Keep data for channel estimation if (k == get_current_cpilot()) { - set_chanestim_carrier(k); - advance_cpilot(); - advance_chanestim(); + set_chanestim_carrier(k); + advance_cpilot(); + advance_chanestim(); } - } + } - // We use both scattered pilots and continual pilots - for (int i = 0, startk = d_chanestim_carriers[0]; i < d_chanestim_index; i++) { + // We use both scattered pilots and continual pilots + for (int i = 0, startk = d_chanestim_carriers[0]; i < d_chanestim_index; i++) { // Get a carrier from the list of carriers // used for channel estimation int k = d_chanestim_carriers[i]; @@ -649,642 +615,646 @@ namespace gr { set_channel_gain(k, in[k + d_zeros_on_left]); // Calculate tg(alpha) due to linear interpolation - gr_complex tg_alpha = (d_channel_gain[k] - d_channel_gain[startk]) / gr_complex(11.0, 0.0); + gr_complex tg_alpha = + (d_channel_gain[k] - d_channel_gain[startk]) / gr_complex(11.0, 0.0); // Calculate interpolation for all intermediate values for (int j = 1; j < (k - startk); j++) { - gr_complex current = d_channel_gain[startk] + tg_alpha * gr_complex(j, 0.0); - d_channel_gain[startk + j] = current; + gr_complex current = d_channel_gain[startk] + tg_alpha * gr_complex(j, 0.0); + d_channel_gain[startk + j] = current; } startk = k; - } - - // Signal that equalizer is ready - d_equalizer_ready = 1; - - int diff_sindex = (d_mod_symbol_index - d_prev_mod_symbol_index + 4) % 4; - - d_prev_mod_symbol_index = d_mod_symbol_index; - - return diff_sindex; } - /* - * Init continual pilot generator - */ - int - dvbt_pilot_gen::get_current_cpilot() const - { - return d_cpilot_carriers[d_cpilot_index]; - } - - gr_complex - dvbt_pilot_gen::get_cpilot_value(int cpilot) - { - //TODO - can be calculated at the beginning - return gr_complex((float)(4 * 2 * (0.5 - d_wk[cpilot])) / 3, 0); - } + // Signal that equalizer is ready + d_equalizer_ready = 1; - void - dvbt_pilot_gen::advance_cpilot() - { - ++d_cpilot_index; - d_cpilot_index = d_cpilot_index % d_cpilot_carriers_size; - } + int diff_sindex = (d_mod_symbol_index - d_prev_mod_symbol_index + 4) % 4; - void - dvbt_pilot_gen::process_cpilot_data(const gr_complex * in) - { - // Look for maximum correlation for cpilots - // in order to obtain post FFT integer frequency correction + d_prev_mod_symbol_index = d_mod_symbol_index; - float max = 0; float sum = 0; - int start = 0; - float phase; + return diff_sindex; +} - for (int i = d_zeros_on_left - d_freq_offset_max; i < d_zeros_on_left + d_freq_offset_max; i++) { +/* + * Init continual pilot generator + */ +int dvbt_pilot_gen::get_current_cpilot() const +{ + return d_cpilot_carriers[d_cpilot_index]; +} + +gr_complex dvbt_pilot_gen::get_cpilot_value(int cpilot) +{ + // TODO - can be calculated at the beginning + return gr_complex((float)(4 * 2 * (0.5 - d_wk[cpilot])) / 3, 0); +} + +void dvbt_pilot_gen::advance_cpilot() +{ + ++d_cpilot_index; + d_cpilot_index = d_cpilot_index % d_cpilot_carriers_size; +} + +void dvbt_pilot_gen::process_cpilot_data(const gr_complex* in) +{ + // Look for maximum correlation for cpilots + // in order to obtain post FFT integer frequency correction + + float max = 0; + float sum = 0; + int start = 0; + float phase; + + for (int i = d_zeros_on_left - d_freq_offset_max; + i < d_zeros_on_left + d_freq_offset_max; + i++) { sum = 0; for (int j = 0; j < (d_cpilot_carriers_size - 1); j++) { - phase = norm(in[i + d_cpilot_carriers[j + 1]] - in[i + d_cpilot_carriers[j]]); - sum += d_known_phase_diff[j] * phase; + phase = norm(in[i + d_cpilot_carriers[j + 1]] - in[i + d_cpilot_carriers[j]]); + sum += d_known_phase_diff[j] * phase; } if (sum > max) { - max = sum; - start = i; + max = sum; + start = i; } - } - - d_freq_offset = start - d_zeros_on_left; } - void - dvbt_pilot_gen::compute_oneshot_csft(const gr_complex * in) - { - gr_complex left_corr_sum = 0.0; gr_complex right_corr_sum = 0.0; - int half_size = (d_cpilot_carriers_size - 1) / 2; + d_freq_offset = start - d_zeros_on_left; +} - // TODO init this in constructor - float carrier_coeff = 1.0 / (2 * GR_M_PI * (1 + float (d_cp_length) / float (d_fft_length)) * 2); - float sampling_coeff = 1.0 / (2 * GR_M_PI * ((1 + float (d_cp_length) / float (d_fft_length)) * ((float)d_cpilot_carriers_size / 2.0))); +void dvbt_pilot_gen::compute_oneshot_csft(const gr_complex* in) +{ + gr_complex left_corr_sum = 0.0; + gr_complex right_corr_sum = 0.0; + int half_size = (d_cpilot_carriers_size - 1) / 2; - float left_angle, right_angle; + // TODO init this in constructor + float carrier_coeff = + 1.0 / (2 * GR_M_PI * (1 + float(d_cp_length) / float(d_fft_length)) * 2); + float sampling_coeff = 1.0 / (2 * GR_M_PI * + ((1 + float(d_cp_length) / float(d_fft_length)) * + ((float)d_cpilot_carriers_size / 2.0))); - // Compute cpilots correlation between previous symbol and current symbol - // in both halves of the cpilots. The cpilots are distributed evenly - // on left and right sides of the center frequency. + float left_angle, right_angle; - for (int j = 0; j < half_size; j++) { - left_corr_sum += in[d_freq_offset + d_zeros_on_left + d_cpilot_carriers[j]] * \ - std::conj(in[d_freq_offset + d_fft_length + d_zeros_on_left + d_cpilot_carriers[j]]); - } + // Compute cpilots correlation between previous symbol and current symbol + // in both halves of the cpilots. The cpilots are distributed evenly + // on left and right sides of the center frequency. - for (int j = half_size + 1; j < d_cpilot_carriers_size; j++) { - right_corr_sum += in[d_freq_offset + d_zeros_on_left + d_cpilot_carriers[j]] * \ - std::conj(in[d_freq_offset + d_fft_length + d_zeros_on_left + d_cpilot_carriers[j]]); - } - - left_angle = std::arg(left_corr_sum); - right_angle = std::arg(right_corr_sum); + for (int j = 0; j < half_size; j++) { + left_corr_sum += in[d_freq_offset + d_zeros_on_left + d_cpilot_carriers[j]] * + std::conj(in[d_freq_offset + d_fft_length + d_zeros_on_left + + d_cpilot_carriers[j]]); + } - d_carrier_freq_correction = (right_angle + left_angle) * carrier_coeff; - d_sampling_freq_correction = (right_angle - left_angle) * sampling_coeff; + for (int j = half_size + 1; j < d_cpilot_carriers_size; j++) { + right_corr_sum += in[d_freq_offset + d_zeros_on_left + d_cpilot_carriers[j]] * + std::conj(in[d_freq_offset + d_fft_length + d_zeros_on_left + + d_cpilot_carriers[j]]); } - gr_complex * - dvbt_pilot_gen::frequency_correction(const gr_complex * in, gr_complex * out) - { - // TODO - use PI control loop to calculate tracking corrections - int symbol_count = 1; + left_angle = std::arg(left_corr_sum); + right_angle = std::arg(right_corr_sum); - for (int k = 0; k < d_fft_length; k++) { + d_carrier_freq_correction = (right_angle + left_angle) * carrier_coeff; + d_sampling_freq_correction = (right_angle - left_angle) * sampling_coeff; +} + +gr_complex* dvbt_pilot_gen::frequency_correction(const gr_complex* in, gr_complex* out) +{ + // TODO - use PI control loop to calculate tracking corrections + int symbol_count = 1; + + for (int k = 0; k < d_fft_length; k++) { // TODO - for 2k mode the continuous pilots are not split evenly // between left/right center frequency. Probably the scattered // pilots needs to be added. float correction = (float)d_freq_offset + d_carrier_freq_correction; - gr_complex c = gr_expj(-2 * GR_M_PI * correction * \ - (d_fft_length + d_cp_length) / d_fft_length * symbol_count); + gr_complex c = gr_expj(-2 * GR_M_PI * correction * (d_fft_length + d_cp_length) / + d_fft_length * symbol_count); // TODO - vectorize this operation out[k] = c * in[k + d_freq_offset]; - } - - return (out); } - /* - * Init tps sequence, return values for first position - * If first symbol then init tps DBPSK data - */ - int - dvbt_pilot_gen::get_current_tpilot() const - { - return d_tps_carriers[d_tpilot_index]; - } + return (out); +} - gr_complex - dvbt_pilot_gen::get_tpilot_value(int tpilot) - { - //TODO - it can be calculated at the beginnning - if (d_symbol_index == 0) { +/* + * Init tps sequence, return values for first position + * If first symbol then init tps DBPSK data + */ +int dvbt_pilot_gen::get_current_tpilot() const { return d_tps_carriers[d_tpilot_index]; } + +gr_complex dvbt_pilot_gen::get_tpilot_value(int tpilot) +{ + // TODO - it can be calculated at the beginnning + if (d_symbol_index == 0) { d_tps_carriers_val[d_tpilot_index] = gr_complex(2 * (0.5 - d_wk[tpilot]), 0); - } - else { + } else { if (d_tps_data[d_symbol_index] == 1) { - d_tps_carriers_val[d_tpilot_index] = gr_complex(-d_tps_carriers_val[d_tpilot_index].real(), 0); + d_tps_carriers_val[d_tpilot_index] = + gr_complex(-d_tps_carriers_val[d_tpilot_index].real(), 0); } - } - - return d_tps_carriers_val[d_tpilot_index]; } - void - dvbt_pilot_gen::advance_tpilot() - { - ++d_tpilot_index; - d_tpilot_index = d_tpilot_index % d_tps_carriers_size; - } + return d_tps_carriers_val[d_tpilot_index]; +} + +void dvbt_pilot_gen::advance_tpilot() +{ + ++d_tpilot_index; + d_tpilot_index = d_tpilot_index % d_tps_carriers_size; +} - /* - * Set a number of bits to a specified value - */ - void - dvbt_pilot_gen::set_tps_bits(int start, int stop, unsigned int data) - { - for (int i = start; i >= stop; i--) { +/* + * Set a number of bits to a specified value + */ +void dvbt_pilot_gen::set_tps_bits(int start, int stop, unsigned int data) +{ + for (int i = start; i >= stop; i--) { d_tps_data[i] = data & 0x1; data = data >> 1; - } } - - /* - * Clause 4.6 - * Format data that will be sent with TPS signals - * en 300 744 - section 4.6.2 - * s0 Initialization - * s1-s16 Synchronization word - * s17-s22 Length Indicator - * s23-s24 Frame Number - * S25-s26 Constellation - * s27, s28, s29 Hierarchy information - * s30, s31, s32 Code rate, HP stream - * s33, s34, s35 Code rate, LP stream - * s36, s37 Guard interval - * s38, s39 Transmission mode - * s40, s47 Cell identifier - * s48-s53 All set to "0" - * s54-s67 Error protection (BCH code) - */ - void - dvbt_pilot_gen::format_tps_data() - { - //Clause 4.6.3 - set_tps_bits(0, 0, d_wk[0]); - //Clause 4.6.2.2 - if (d_frame_index % 2) { +} + +/* + * Clause 4.6 + * Format data that will be sent with TPS signals + * en 300 744 - section 4.6.2 + * s0 Initialization + * s1-s16 Synchronization word + * s17-s22 Length Indicator + * s23-s24 Frame Number + * S25-s26 Constellation + * s27, s28, s29 Hierarchy information + * s30, s31, s32 Code rate, HP stream + * s33, s34, s35 Code rate, LP stream + * s36, s37 Guard interval + * s38, s39 Transmission mode + * s40, s47 Cell identifier + * s48-s53 All set to "0" + * s54-s67 Error protection (BCH code) + */ +void dvbt_pilot_gen::format_tps_data() +{ + // Clause 4.6.3 + set_tps_bits(0, 0, d_wk[0]); + // Clause 4.6.2.2 + if (d_frame_index % 2) { set_tps_bits(16, 1, 0xca11); - } - else { + } else { set_tps_bits(16, 1, 0x35ee); - } - //Clause 4.6.2.3 - if (config.d_include_cell_id) { + } + // Clause 4.6.2.3 + if (config.d_include_cell_id) { set_tps_bits(22, 17, 0x1f); - } - else { + } else { set_tps_bits(22, 17, 0x17); - } - //Clause 4.6.2.4 - set_tps_bits(24, 23, d_frame_index); - //Clause 4.6.2.5 - set_tps_bits(26, 25, config.d_constellation); - //Clause 4.6.2.6 - set_tps_bits(29, 27, config.d_hierarchy); - //Clause 4.6.2.7 - switch (config.d_code_rate_HP) { - case C1_2: - set_tps_bits(32, 30, 0); - break; - case C2_3: - set_tps_bits(32, 30, 1); - break; - case C3_4: - set_tps_bits(32, 30, 2); - break; - case C5_6: - set_tps_bits(32, 30, 3); - break; - case C7_8: - set_tps_bits(32, 30, 4); - break; - default: - set_tps_bits(32, 30, 0); - break; - } - switch (config.d_code_rate_LP) { - case C1_2: - set_tps_bits(35, 33, 0); - break; - case C2_3: - set_tps_bits(35, 33, 1); - break; - case C3_4: - set_tps_bits(35, 33, 2); - break; - case C5_6: - set_tps_bits(35, 33, 3); - break; - case C7_8: - set_tps_bits(35, 33, 4); - break; - default: - set_tps_bits(35, 33, 0); - break; - } - //Clause 4.6.2.8 - set_tps_bits(37, 36, config.d_guard_interval); - //Clause 4.6.2.9 - set_tps_bits(39, 38, config.d_transmission_mode); - //Clause 4.6.2.10 - if (d_frame_index % 2) { + } + // Clause 4.6.2.4 + set_tps_bits(24, 23, d_frame_index); + // Clause 4.6.2.5 + set_tps_bits(26, 25, config.d_constellation); + // Clause 4.6.2.6 + set_tps_bits(29, 27, config.d_hierarchy); + // Clause 4.6.2.7 + switch (config.d_code_rate_HP) { + case C1_2: + set_tps_bits(32, 30, 0); + break; + case C2_3: + set_tps_bits(32, 30, 1); + break; + case C3_4: + set_tps_bits(32, 30, 2); + break; + case C5_6: + set_tps_bits(32, 30, 3); + break; + case C7_8: + set_tps_bits(32, 30, 4); + break; + default: + set_tps_bits(32, 30, 0); + break; + } + switch (config.d_code_rate_LP) { + case C1_2: + set_tps_bits(35, 33, 0); + break; + case C2_3: + set_tps_bits(35, 33, 1); + break; + case C3_4: + set_tps_bits(35, 33, 2); + break; + case C5_6: + set_tps_bits(35, 33, 3); + break; + case C7_8: + set_tps_bits(35, 33, 4); + break; + default: + set_tps_bits(35, 33, 0); + break; + } + // Clause 4.6.2.8 + set_tps_bits(37, 36, config.d_guard_interval); + // Clause 4.6.2.9 + set_tps_bits(39, 38, config.d_transmission_mode); + // Clause 4.6.2.10 + if (d_frame_index % 2) { set_tps_bits(47, 40, config.d_cell_id & 0xff); - } - else { + } else { set_tps_bits(47, 40, (config.d_cell_id >> 8) & 0xff); - } - //These bits are set to zero - set_tps_bits(53, 48, 0); - //Clause 4.6.2.11 - generate_bch_code(); } - - int - dvbt_pilot_gen::process_tps_data(const gr_complex * in, const int diff_symbol_index) - { - int end_frame = 0; - - // Look for TPS data only - demodulate DBPSK - // Calculate phase difference between previous symbol - // and current one to determine the current bit. - // Use majority voting for decision - int tps_majority_zero = 0; - - for (int k = 0; k < d_tps_carriers_size; k++) { + // These bits are set to zero + set_tps_bits(53, 48, 0); + // Clause 4.6.2.11 + generate_bch_code(); +} + +int dvbt_pilot_gen::process_tps_data(const gr_complex* in, const int diff_symbol_index) +{ + int end_frame = 0; + + // Look for TPS data only - demodulate DBPSK + // Calculate phase difference between previous symbol + // and current one to determine the current bit. + // Use majority voting for decision + int tps_majority_zero = 0; + + for (int k = 0; k < d_tps_carriers_size; k++) { // Use equalizer to correct data and frequency correction - gr_complex val = in[d_zeros_on_left + d_tps_carriers[k]] * d_channel_gain[d_tps_carriers[k]]; + gr_complex val = + in[d_zeros_on_left + d_tps_carriers[k]] * d_channel_gain[d_tps_carriers[k]]; if (!d_symbol_index_known || (d_symbol_index != 0)) { - gr_complex phdiff = val * conj(d_prev_tps_symbol[k]); - - if (phdiff.real() >= 0.0) { - tps_majority_zero++; - } - else { - tps_majority_zero--; - } + gr_complex phdiff = val * conj(d_prev_tps_symbol[k]); + + if (phdiff.real() >= 0.0) { + tps_majority_zero++; + } else { + tps_majority_zero--; + } } d_prev_tps_symbol[k] = val; - } + } - // Insert obtained TPS bit into FIFO - // Insert the same bit into FIFO in the case - // diff_symbol_index is more than one. This will happen - // in the case of losing 1 to 3 symbols. - // This could be corrected by BCH decoder afterwards. + // Insert obtained TPS bit into FIFO + // Insert the same bit into FIFO in the case + // diff_symbol_index is more than one. This will happen + // in the case of losing 1 to 3 symbols. + // This could be corrected by BCH decoder afterwards. - for (int i = 0; i < diff_symbol_index; i++) { + for (int i = 0; i < diff_symbol_index; i++) { // Take out the front entry first d_rcv_tps_data.pop_front(); // Add data at tail if (!d_symbol_index_known || (d_symbol_index != 0)) { - if (tps_majority_zero >= 0) { + if (tps_majority_zero >= 0) { + d_rcv_tps_data.push_back(0); + } else { + d_rcv_tps_data.push_back(1); + } + } else { d_rcv_tps_data.push_back(0); - } - else { - d_rcv_tps_data.push_back(1); - } - } - else { - d_rcv_tps_data.push_back(0); } - } + } - // Match synchronization signatures - if (std::equal(d_rcv_tps_data.begin() + 1, d_rcv_tps_data.begin() + d_tps_sync_evenv.size(), d_tps_sync_evenv.begin())) { + // Match synchronization signatures + if (std::equal(d_rcv_tps_data.begin() + 1, + d_rcv_tps_data.begin() + d_tps_sync_evenv.size(), + d_tps_sync_evenv.begin())) { // Verify parity for TPS data if (!verify_bch_code(d_rcv_tps_data)) { - d_frame_index = (d_rcv_tps_data[23] << 1) | (d_rcv_tps_data[24]); + d_frame_index = (d_rcv_tps_data[23] << 1) | (d_rcv_tps_data[24]); - d_symbol_index_known = 1; - end_frame = 1; - } - else { - d_symbol_index_known = 0; - end_frame = 0; + d_symbol_index_known = 1; + end_frame = 1; + } else { + d_symbol_index_known = 0; + end_frame = 0; } // Clear up FIFO for (int i = 0; i < d_symbols_per_frame; i++) { - d_rcv_tps_data[i] = 0; + d_rcv_tps_data[i] = 0; } - } - else if (std::equal(d_rcv_tps_data.begin() + 1, d_rcv_tps_data.begin() + d_tps_sync_oddv.size(), d_tps_sync_oddv.begin())) { + } else if (std::equal(d_rcv_tps_data.begin() + 1, + d_rcv_tps_data.begin() + d_tps_sync_oddv.size(), + d_tps_sync_oddv.begin())) { // Verify parity for TPS data if (!verify_bch_code(d_rcv_tps_data)) { - d_frame_index = (d_rcv_tps_data[23] << 1) | (d_rcv_tps_data[24]); + d_frame_index = (d_rcv_tps_data[23] << 1) | (d_rcv_tps_data[24]); - d_symbol_index_known = 1; - end_frame = 1; - } - else { - d_symbol_index_known = 0; - end_frame = 0; + d_symbol_index_known = 1; + end_frame = 1; + } else { + d_symbol_index_known = 0; + end_frame = 0; } // Clear up FIFO for (int i = 0; i < d_symbols_per_frame; i++) { - d_rcv_tps_data[i] = 0; + d_rcv_tps_data[i] = 0; } - } - - return end_frame; } - void - dvbt_pilot_gen::set_chanestim_carrier(int k) - { - d_chanestim_carriers[d_chanestim_index] = k; - } + return end_frame; +} - void - dvbt_pilot_gen::advance_chanestim() - { - d_chanestim_index++; - } +void dvbt_pilot_gen::set_chanestim_carrier(int k) +{ + d_chanestim_carriers[d_chanestim_index] = k; +} - int - dvbt_pilot_gen::get_current_payload() - { - return d_payload_carriers[d_payload_index]; - } +void dvbt_pilot_gen::advance_chanestim() { d_chanestim_index++; } - void - dvbt_pilot_gen::set_payload_carrier(int k) - { - d_payload_carriers[d_payload_index] = k; - } +int dvbt_pilot_gen::get_current_payload() { return d_payload_carriers[d_payload_index]; } - void - dvbt_pilot_gen::advance_payload() - { - d_payload_index++; - } +void dvbt_pilot_gen::set_payload_carrier(int k) +{ + d_payload_carriers[d_payload_index] = k; +} - void - dvbt_pilot_gen::process_payload_data(const gr_complex *in, gr_complex *out) - { - //reset indexes - d_spilot_index = 0; d_cpilot_index = 0; d_tpilot_index = 0; - d_payload_index = 0;d_chanestim_index = 0; - int is_payload = 1; +void dvbt_pilot_gen::advance_payload() { d_payload_index++; } - //process one block - one symbol - for (int k = 0; k < (d_Kmax - d_Kmin + 1); k++) { +void dvbt_pilot_gen::process_payload_data(const gr_complex* in, gr_complex* out) +{ + // reset indexes + d_spilot_index = 0; + d_cpilot_index = 0; + d_tpilot_index = 0; + d_payload_index = 0; + d_chanestim_index = 0; + int is_payload = 1; + + // process one block - one symbol + for (int k = 0; k < (d_Kmax - d_Kmin + 1); k++) { is_payload = 1; // Keep data for channel estimation // This depends on the symbol index if (k == get_current_spilot(d_mod_symbol_index)) { - advance_spilot(d_mod_symbol_index); - is_payload = 0; + advance_spilot(d_mod_symbol_index); + is_payload = 0; } // Keep data for frequency correction // and channel estimation if (k == get_current_cpilot()) { - advance_cpilot(); - is_payload = 0; + advance_cpilot(); + is_payload = 0; } if (k == get_current_tpilot()) { - advance_tpilot(); - is_payload = 0; + advance_tpilot(); + is_payload = 0; } // Keep payload carrier number // This depends on the symbol index if (is_payload) { - set_payload_carrier(k); - advance_payload(); + set_payload_carrier(k); + advance_payload(); } - } + } - if (d_equalizer_ready) { + if (d_equalizer_ready) { // Equalize payload data according to channel estimator for (int i = 0; i < d_payload_index; i++) { - out[i] = in[d_zeros_on_left + d_payload_carriers[i]] * d_channel_gain[d_payload_carriers[i]]; + out[i] = in[d_zeros_on_left + d_payload_carriers[i]] * + d_channel_gain[d_payload_carriers[i]]; } - } - else { + } else { // If equ not ready, return 0 for (int i = 0; i < d_payload_length; i++) { - out[0] = gr_complex(0.0, 0.0); + out[0] = gr_complex(0.0, 0.0); } - } } +} - void - dvbt_pilot_gen::update_output(const gr_complex *in, gr_complex *out) - { - int is_payload = 1; - int payload_count = 0; +void dvbt_pilot_gen::update_output(const gr_complex* in, gr_complex* out) +{ + int is_payload = 1; + int payload_count = 0; - //move to the next symbol - //re-genereate TPS data - format_tps_data(); + // move to the next symbol + // re-genereate TPS data + format_tps_data(); - //reset indexes - payload_count = 0; - d_spilot_index = 0; d_cpilot_index = 0; d_tpilot_index = 0; + // reset indexes + payload_count = 0; + d_spilot_index = 0; + d_cpilot_index = 0; + d_tpilot_index = 0; - for (int i = 0; i < d_zeros_on_left; i++) { + for (int i = 0; i < d_zeros_on_left; i++) { out[i] = gr_complex(0.0, 0.0); - } + } - //process one block - one symbol - for (int k = d_Kmin; k < (d_Kmax - d_Kmin + 1); k++) { - is_payload = 1; - if (k == get_current_spilot(d_symbol_index)) { + // process one block - one symbol + for (int k = d_Kmin; k < (d_Kmax - d_Kmin + 1); k++) { + is_payload = 1; + if (k == get_current_spilot(d_symbol_index)) { out[d_zeros_on_left + k] = get_spilot_value(k); advance_spilot(d_symbol_index); is_payload = 0; - } + } - if (k == get_current_cpilot()) { + if (k == get_current_cpilot()) { out[d_zeros_on_left + k] = get_cpilot_value(k); advance_cpilot(); is_payload = 0; - } + } - if (k == get_current_tpilot()) { + if (k == get_current_tpilot()) { out[d_zeros_on_left + k] = get_tpilot_value(k); advance_tpilot(); is_payload = 0; - } + } - if (is_payload == 1) { + if (is_payload == 1) { out[d_zeros_on_left + k] = in[payload_count++]; - } - } + } + } - // update indexes - if (++d_symbol_index == d_symbols_per_frame) { + // update indexes + if (++d_symbol_index == d_symbols_per_frame) { d_symbol_index = 0; if (++d_frame_index == d_frames_per_superframe) { - d_frame_index = 0; - d_superframe_index++; + d_frame_index = 0; + d_superframe_index++; } - } + } - for (int i = (d_fft_length - d_zeros_on_right); i < d_fft_length; i++) { + for (int i = (d_fft_length - d_zeros_on_right); i < d_fft_length; i++) { out[i] = gr_complex(0.0, 0.0); - } } - - int - dvbt_pilot_gen::parse_input(const gr_complex *in, gr_complex *out, int * symbol_index, int * frame_index) - { - d_trigger_index++; - - // Obtain frequency correction based on cpilots. - // Obtain channel estimation based on both - // cpilots and spilots. - // We use spilot correlation for finding the symbol index modulo 4 - // The diff between previous sym index and current index is used - // to advance the symbol index inside a frame (0 to 67) - // Then based on the TPS data we find out the start of a frame - - // Process cpilot data - // This is post FFT integer frequency offset estimation - // This is called before all other processing - process_cpilot_data(in); - - // Compute one shot Post-FFT Carrier and Sampling Frequency Tracking - // Obtain fractional Carrer and Sampling frequency corrections - // Before this moment it is assumed to have corrected this: - // - symbol timing (pre-FFT) - // - symbol frequency correction (pre-FFT) - // - integer frequency correction (post-FFT) - // TODO - call this just in the acquisition mode - compute_oneshot_csft(in); - - // Gather all corrections and obtain a corrected OFDM symbol: - // - input symbol shift (post-FFT) - // - integer frequency correction (post-FFT) - // - fractional frequency (carrier and sampling) corrections (post-FFT) - // TODO - use PI to update the corrections - frequency_correction(in, d_derot_in); - - // Process spilot data - // This is channel estimation function - int diff_symbol_index = process_spilot_data(d_derot_in); - - // Correct symbol index so that all subsequent processing - // use correct symbol index - d_symbol_index = (d_symbol_index + diff_symbol_index) % d_symbols_per_frame; - - // Symbol index is used in other modules too - *symbol_index = d_symbol_index; - // Frame index is used in other modules too - *frame_index = d_frame_index; - - // Process TPS data - // If a frame is recognized then signal end of frame - int frame_end = process_tps_data(d_derot_in, diff_symbol_index); - - // We are just at the end of a frame - if (frame_end) { +} + +int dvbt_pilot_gen::parse_input(const gr_complex* in, + gr_complex* out, + int* symbol_index, + int* frame_index) +{ + d_trigger_index++; + + // Obtain frequency correction based on cpilots. + // Obtain channel estimation based on both + // cpilots and spilots. + // We use spilot correlation for finding the symbol index modulo 4 + // The diff between previous sym index and current index is used + // to advance the symbol index inside a frame (0 to 67) + // Then based on the TPS data we find out the start of a frame + + // Process cpilot data + // This is post FFT integer frequency offset estimation + // This is called before all other processing + process_cpilot_data(in); + + // Compute one shot Post-FFT Carrier and Sampling Frequency Tracking + // Obtain fractional Carrer and Sampling frequency corrections + // Before this moment it is assumed to have corrected this: + // - symbol timing (pre-FFT) + // - symbol frequency correction (pre-FFT) + // - integer frequency correction (post-FFT) + // TODO - call this just in the acquisition mode + compute_oneshot_csft(in); + + // Gather all corrections and obtain a corrected OFDM symbol: + // - input symbol shift (post-FFT) + // - integer frequency correction (post-FFT) + // - fractional frequency (carrier and sampling) corrections (post-FFT) + // TODO - use PI to update the corrections + frequency_correction(in, d_derot_in); + + // Process spilot data + // This is channel estimation function + int diff_symbol_index = process_spilot_data(d_derot_in); + + // Correct symbol index so that all subsequent processing + // use correct symbol index + d_symbol_index = (d_symbol_index + diff_symbol_index) % d_symbols_per_frame; + + // Symbol index is used in other modules too + *symbol_index = d_symbol_index; + // Frame index is used in other modules too + *frame_index = d_frame_index; + + // Process TPS data + // If a frame is recognized then signal end of frame + int frame_end = process_tps_data(d_derot_in, diff_symbol_index); + + // We are just at the end of a frame + if (frame_end) { d_symbol_index = d_symbols_per_frame - 1; - } - - // Process payload data with correct symbol index - process_payload_data(d_derot_in, out); - - // noutput_items should be 1 in this case - return 1; - } - - dvbt_reference_signals::sptr - dvbt_reference_signals::make(int itemsize, int ninput, int noutput, \ - dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, \ - dvb_code_rate_t code_rate_HP, dvb_code_rate_t code_rate_LP, \ - dvb_guardinterval_t guard_interval, dvbt_transmission_mode_t transmission_mode, \ - int include_cell_id, int cell_id) - { - return gnuradio::get_initial_sptr - (new dvbt_reference_signals_impl(itemsize, ninput, \ - noutput, constellation, hierarchy, code_rate_HP, code_rate_LP, \ - guard_interval, transmission_mode, include_cell_id, cell_id)); - } - - /* - * The private constructor - */ - dvbt_reference_signals_impl::dvbt_reference_signals_impl(int itemsize, int ninput, int noutput, \ - dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvb_code_rate_t code_rate_HP,\ - dvb_code_rate_t code_rate_LP, dvb_guardinterval_t guard_interval,\ - dvbt_transmission_mode_t transmission_mode, int include_cell_id, int cell_id) - : block("dvbt_reference_signals", - io_signature::make(1, 1, itemsize * ninput), - io_signature::make(1, 1, itemsize * noutput)), - config(constellation, hierarchy, code_rate_HP, code_rate_LP, \ - guard_interval, transmission_mode, include_cell_id, cell_id), - d_pg(config) - { - d_ninput = ninput; - d_noutput = noutput; - } - - /* - * Our virtual destructor. - */ - dvbt_reference_signals_impl::~dvbt_reference_signals_impl() - { } - void - dvbt_reference_signals_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = noutput_items; - } - - int - dvbt_reference_signals_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - - for (int i = 0; i < noutput_items; i++) { + // Process payload data with correct symbol index + process_payload_data(d_derot_in, out); + + // noutput_items should be 1 in this case + return 1; +} + +dvbt_reference_signals::sptr +dvbt_reference_signals::make(int itemsize, + int ninput, + int noutput, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t code_rate_HP, + dvb_code_rate_t code_rate_LP, + dvb_guardinterval_t guard_interval, + dvbt_transmission_mode_t transmission_mode, + int include_cell_id, + int cell_id) +{ + return gnuradio::get_initial_sptr(new dvbt_reference_signals_impl(itemsize, + ninput, + noutput, + constellation, + hierarchy, + code_rate_HP, + code_rate_LP, + guard_interval, + transmission_mode, + include_cell_id, + cell_id)); +} + +/* + * The private constructor + */ +dvbt_reference_signals_impl::dvbt_reference_signals_impl( + int itemsize, + int ninput, + int noutput, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t code_rate_HP, + dvb_code_rate_t code_rate_LP, + dvb_guardinterval_t guard_interval, + dvbt_transmission_mode_t transmission_mode, + int include_cell_id, + int cell_id) + : block("dvbt_reference_signals", + io_signature::make(1, 1, itemsize * ninput), + io_signature::make(1, 1, itemsize * noutput)), + config(constellation, + hierarchy, + code_rate_HP, + code_rate_LP, + guard_interval, + transmission_mode, + include_cell_id, + cell_id), + d_pg(config) +{ + d_ninput = ninput; + d_noutput = noutput; +} + +/* + * Our virtual destructor. + */ +dvbt_reference_signals_impl::~dvbt_reference_signals_impl() {} + +void dvbt_reference_signals_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = noutput_items; +} + +int dvbt_reference_signals_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + gr_complex* out = (gr_complex*)output_items[0]; + + for (int i = 0; i < noutput_items; i++) { d_pg.update_output(&in[i * d_ninput], &out[i * d_noutput]); - } - - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (noutput_items); - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ -} /* namespace gr */ + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(noutput_items); + // Tell runtime system how many output items we produced. + return noutput_items; +} +} /* namespace dtv */ +} /* namespace gr */ diff --git a/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.h b/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.h index 06a74f936c..0ab7193a26 100644 --- a/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,233 +26,242 @@ #include <vector> #include <deque> - // This should eventually go into a const file - const int SYMBOLS_PER_FRAME = 68; - const int FRAMES_PER_SUPERFRAME = 4; +// This should eventually go into a const file +const int SYMBOLS_PER_FRAME = 68; +const int FRAMES_PER_SUPERFRAME = 4; - const int SCATTERED_PILOT_SIZE_2k = 142; - const int CONTINUAL_PILOT_SIZE_2k = 45; - const int TPS_PILOT_SIZE_2k = 17; +const int SCATTERED_PILOT_SIZE_2k = 142; +const int CONTINUAL_PILOT_SIZE_2k = 45; +const int TPS_PILOT_SIZE_2k = 17; - const int SCATTERED_PILOT_SIZE_8k = 568; - const int CONTINUAL_PILOT_SIZE_8k = 177; - const int TPS_PILOT_SIZE_8k = 68; +const int SCATTERED_PILOT_SIZE_8k = 568; +const int CONTINUAL_PILOT_SIZE_8k = 177; +const int TPS_PILOT_SIZE_8k = 68; namespace gr { - namespace dtv { - - class dvbt_pilot_gen { - private: - // this should be first in order to be initialized first - const dvbt_configure &config; - - int d_Kmin; - int d_Kmax; - int d_fft_length; - int d_payload_length; - int d_zeros_on_left; - int d_zeros_on_right; - int d_cp_length; - - static const int d_symbols_per_frame; - static const int d_frames_per_superframe; - - // 2k mode - // scattered pilot carriers info - static const int d_spilot_carriers_size_2k; - - // continual pilot carriers info - static const int d_cpilot_carriers_size_2k; - static const int d_cpilot_carriers_2k[]; - - // TPS carriers info - static const int d_tps_carriers_size_2k; - static const int d_tps_carriers_2k[]; - - //8k mode - // scattered pilot carriers info - static const int d_spilot_carriers_size_8k; - - // continual pilot carriers info - static const int d_cpilot_carriers_size_8k; - static const int d_cpilot_carriers_8k[]; - - // TPS carriers info - static const int d_tps_carriers_size_8k; - static const int d_tps_carriers_8k[]; - - // TPS sync data - static const int d_tps_sync_size; - static const int d_tps_sync_even[]; - static const int d_tps_sync_odd[]; - - // Variables to keep data for 2k, 8k, 4k - int d_spilot_carriers_size; - gr_complex * d_spilot_carriers_val; - gr_complex * d_channel_gain; - - int d_cpilot_carriers_size; - const int * d_cpilot_carriers; - float * d_known_phase_diff; - float * d_cpilot_phase_diff; - int d_freq_offset; - float d_carrier_freq_correction; - float d_sampling_freq_correction; - - // Variable to keep corrected OFDM symbol - gr_complex * d_derot_in; - - int d_tps_carriers_size; - const int * d_tps_carriers; - gr_complex * d_tps_carriers_val; - - // Keeps TPS data - unsigned char * d_tps_data; - // Keep TPS carriers values from previous symbol - gr_complex * d_prev_tps_symbol; - // Keep TPS carriers values from current symbol - gr_complex * d_tps_symbol; - // Keeps the rcv TPS data, is a FIFO - std::deque<char> d_rcv_tps_data; - // Keeps the TPS sync sequence - std::deque<char> d_tps_sync_evenv; - std::deque<char> d_tps_sync_oddv; - - // Keeps channel estimation carriers - // we use both continual and scattered carriers - int * d_chanestim_carriers; - - // Keeps paload carriers - int * d_payload_carriers; - - // Indexes for all carriers - int d_spilot_index; - int d_cpilot_index; - int d_tpilot_index; - int d_symbol_index; - int d_symbol_index_known; - int d_frame_index; - int d_superframe_index; - int d_freq_offset_max; - int d_trigger_index; - int d_payload_index; - int d_chanestim_index; - int d_prev_mod_symbol_index; - int d_mod_symbol_index; - int d_equalizer_ready; - - // PRPS generator data buffer - char * d_wk; - // Generate PRBS - void generate_prbs(); - - // TPS private methods - void set_tps_bits(int start, int stop, unsigned int data); - - void set_symbol_index(int index); - int get_symbol_index(); - void set_tps_data(); - void get_tps_data(); - - void reset_pilot_generator(); - - // Scattered pilot generator methods - int get_current_spilot(int spilot) const; - gr_complex get_spilot_value(int spilot); - void set_spilot_value(int spilot, gr_complex val); - void advance_spilot(int sindex); - // Methods used to quick iterate through all spilots - int get_first_spilot(); - int get_last_spilot() const; - int get_next_spilot(); - // Scattered pilot data processing method - int process_spilot_data(const gr_complex * in); - - // Channel estimation methods - void set_channel_gain(int spilot, gr_complex val); - - // Continual pilot generator methods - int get_current_cpilot() const; - gr_complex get_cpilot_value(int cpilot); - void advance_cpilot(); - // Continual pilot data processing methods - void process_cpilot_data(const gr_complex * in); - void compute_oneshot_csft(const gr_complex * in); - gr_complex * frequency_correction(const gr_complex * in, gr_complex * out); - - // TPS generator methods - int get_current_tpilot() const; - gr_complex get_tpilot_value(int tpilot); - void advance_tpilot(); - // TPS data - void format_tps_data(); - // Encode TPS data - void generate_bch_code(); - // Verify parity on TPS data - int verify_bch_code(std::deque<char> data); - // TPS data processing methods - int process_tps_data(const gr_complex * in, const int diff_symbo_index); - - // Channel estimation methods - void set_chanestim_carrier(int k); - - // Payload data processing methods - int get_current_payload(); - void advance_chanestim(); - void set_payload_carrier(int k); - void advance_payload(); - void process_payload_data(const gr_complex *in, gr_complex *out); - - public: - dvbt_pilot_gen(const dvbt_configure &config); - ~dvbt_pilot_gen(); - - /*! - * ETSI EN 300 744 Clause 4.5. \n - * Update a set of carriers with the pilot signals. \n - */ - void update_output(const gr_complex *in, gr_complex *out); - - /*! - * TODO - * ETSI EN 300 744 Clause 4.5. \n - * Extract data from a set of carriers using pilot signals. \n - * This is doing frequency correcton, equalization. \n - */ - int parse_input(const gr_complex *in, gr_complex *out, int * symbol_index, int * frame_index); - }; - - class dvbt_reference_signals_impl : public dvbt_reference_signals - { - // configuration object for this class - const dvbt_configure config; - - private: - // Pilot Generator object - dvbt_pilot_gen d_pg; - - //In and Out data length - int d_ninput; - int d_noutput; - - public: - dvbt_reference_signals_impl(int itemsize, int ninput, int noutput, \ - dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, \ - dvb_code_rate_t code_rate_HP, dvb_code_rate_t code_rate_LP, \ - dvb_guardinterval_t guard_interval, \ - dvbt_transmission_mode_t transmission_mode = gr::dtv::T2k, int include_cell_id = 0, int cell_id = 0); - ~dvbt_reference_signals_impl(); - - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class dvbt_pilot_gen +{ +private: + // this should be first in order to be initialized first + const dvbt_configure& config; + + int d_Kmin; + int d_Kmax; + int d_fft_length; + int d_payload_length; + int d_zeros_on_left; + int d_zeros_on_right; + int d_cp_length; + + static const int d_symbols_per_frame; + static const int d_frames_per_superframe; + + // 2k mode + // scattered pilot carriers info + static const int d_spilot_carriers_size_2k; + + // continual pilot carriers info + static const int d_cpilot_carriers_size_2k; + static const int d_cpilot_carriers_2k[]; + + // TPS carriers info + static const int d_tps_carriers_size_2k; + static const int d_tps_carriers_2k[]; + + // 8k mode + // scattered pilot carriers info + static const int d_spilot_carriers_size_8k; + + // continual pilot carriers info + static const int d_cpilot_carriers_size_8k; + static const int d_cpilot_carriers_8k[]; + + // TPS carriers info + static const int d_tps_carriers_size_8k; + static const int d_tps_carriers_8k[]; + + // TPS sync data + static const int d_tps_sync_size; + static const int d_tps_sync_even[]; + static const int d_tps_sync_odd[]; + + // Variables to keep data for 2k, 8k, 4k + int d_spilot_carriers_size; + gr_complex* d_spilot_carriers_val; + gr_complex* d_channel_gain; + + int d_cpilot_carriers_size; + const int* d_cpilot_carriers; + float* d_known_phase_diff; + float* d_cpilot_phase_diff; + int d_freq_offset; + float d_carrier_freq_correction; + float d_sampling_freq_correction; + + // Variable to keep corrected OFDM symbol + gr_complex* d_derot_in; + + int d_tps_carriers_size; + const int* d_tps_carriers; + gr_complex* d_tps_carriers_val; + + // Keeps TPS data + unsigned char* d_tps_data; + // Keep TPS carriers values from previous symbol + gr_complex* d_prev_tps_symbol; + // Keep TPS carriers values from current symbol + gr_complex* d_tps_symbol; + // Keeps the rcv TPS data, is a FIFO + std::deque<char> d_rcv_tps_data; + // Keeps the TPS sync sequence + std::deque<char> d_tps_sync_evenv; + std::deque<char> d_tps_sync_oddv; + + // Keeps channel estimation carriers + // we use both continual and scattered carriers + int* d_chanestim_carriers; + + // Keeps paload carriers + int* d_payload_carriers; + + // Indexes for all carriers + int d_spilot_index; + int d_cpilot_index; + int d_tpilot_index; + int d_symbol_index; + int d_symbol_index_known; + int d_frame_index; + int d_superframe_index; + int d_freq_offset_max; + int d_trigger_index; + int d_payload_index; + int d_chanestim_index; + int d_prev_mod_symbol_index; + int d_mod_symbol_index; + int d_equalizer_ready; + + // PRPS generator data buffer + char* d_wk; + // Generate PRBS + void generate_prbs(); + + // TPS private methods + void set_tps_bits(int start, int stop, unsigned int data); + + void set_symbol_index(int index); + int get_symbol_index(); + void set_tps_data(); + void get_tps_data(); + + void reset_pilot_generator(); + + // Scattered pilot generator methods + int get_current_spilot(int spilot) const; + gr_complex get_spilot_value(int spilot); + void set_spilot_value(int spilot, gr_complex val); + void advance_spilot(int sindex); + // Methods used to quick iterate through all spilots + int get_first_spilot(); + int get_last_spilot() const; + int get_next_spilot(); + // Scattered pilot data processing method + int process_spilot_data(const gr_complex* in); + + // Channel estimation methods + void set_channel_gain(int spilot, gr_complex val); + + // Continual pilot generator methods + int get_current_cpilot() const; + gr_complex get_cpilot_value(int cpilot); + void advance_cpilot(); + // Continual pilot data processing methods + void process_cpilot_data(const gr_complex* in); + void compute_oneshot_csft(const gr_complex* in); + gr_complex* frequency_correction(const gr_complex* in, gr_complex* out); + + // TPS generator methods + int get_current_tpilot() const; + gr_complex get_tpilot_value(int tpilot); + void advance_tpilot(); + // TPS data + void format_tps_data(); + // Encode TPS data + void generate_bch_code(); + // Verify parity on TPS data + int verify_bch_code(std::deque<char> data); + // TPS data processing methods + int process_tps_data(const gr_complex* in, const int diff_symbo_index); + + // Channel estimation methods + void set_chanestim_carrier(int k); + + // Payload data processing methods + int get_current_payload(); + void advance_chanestim(); + void set_payload_carrier(int k); + void advance_payload(); + void process_payload_data(const gr_complex* in, gr_complex* out); + +public: + dvbt_pilot_gen(const dvbt_configure& config); + ~dvbt_pilot_gen(); + + /*! + * ETSI EN 300 744 Clause 4.5. \n + * Update a set of carriers with the pilot signals. \n + */ + void update_output(const gr_complex* in, gr_complex* out); + + /*! + * TODO + * ETSI EN 300 744 Clause 4.5. \n + * Extract data from a set of carriers using pilot signals. \n + * This is doing frequency correcton, equalization. \n + */ + int parse_input(const gr_complex* in, + gr_complex* out, + int* symbol_index, + int* frame_index); +}; + +class dvbt_reference_signals_impl : public dvbt_reference_signals +{ + // configuration object for this class + const dvbt_configure config; + +private: + // Pilot Generator object + dvbt_pilot_gen d_pg; + + // In and Out data length + int d_ninput; + int d_noutput; + +public: + dvbt_reference_signals_impl(int itemsize, + int ninput, + int noutput, + dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t code_rate_HP, + dvb_code_rate_t code_rate_LP, + dvb_guardinterval_t guard_interval, + dvbt_transmission_mode_t transmission_mode = gr::dtv::T2k, + int include_cell_id = 0, + int cell_id = 0); + ~dvbt_reference_signals_impl(); + + void forecast(int noutput_items, gr_vector_int& ninput_items_required); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_REFERENCE_SIGNALS_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_symbol_inner_interleaver_impl.cc b/gr-dtv/lib/dvbt/dvbt_symbol_inner_interleaver_impl.cc index 1edd15a109..99d8d634f2 100644 --- a/gr-dtv/lib/dvbt/dvbt_symbol_inner_interleaver_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_symbol_inner_interleaver_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,196 +26,192 @@ #include "dvbt_symbol_inner_interleaver_impl.h" namespace gr { - namespace dtv { +namespace dtv { - const char dvbt_symbol_inner_interleaver_impl::d_bit_perm_2k[] = {4, 3, 9, 6, 2, 8, 1, 5, 7, 0}; - const char dvbt_symbol_inner_interleaver_impl::d_bit_perm_8k[] = {7, 1, 4, 2, 9, 6, 8, 10, 0, 3, 11, 5}; +const char dvbt_symbol_inner_interleaver_impl::d_bit_perm_2k[] = { 4, 3, 9, 6, 2, + 8, 1, 5, 7, 0 }; +const char dvbt_symbol_inner_interleaver_impl::d_bit_perm_8k[] = { 7, 1, 4, 2, 9, 6, + 8, 10, 0, 3, 11, 5 }; - void - dvbt_symbol_inner_interleaver_impl::generate_H() - { - const int Mmax = d_fft_length; - const int Nmax = d_payload_length; - const int Nr = int(ceil(log2(d_fft_length))); - int q = 0; +void dvbt_symbol_inner_interleaver_impl::generate_H() +{ + const int Mmax = d_fft_length; + const int Nmax = d_payload_length; + const int Nr = int(ceil(log2(d_fft_length))); + int q = 0; - for (int i = 0; i < Mmax; i++) { + for (int i = 0; i < Mmax; i++) { d_h[q] = ((i % 2) << (Nr - 1)) + calculate_R(i); if (d_h[q] < Nmax) { - q++; + q++; } - } } +} - int - dvbt_symbol_inner_interleaver_impl::H(int q) - { - return d_h[q]; - } +int dvbt_symbol_inner_interleaver_impl::H(int q) { return d_h[q]; } - int - dvbt_symbol_inner_interleaver_impl::calculate_R(int i) - { - const int Nr = int(ceil(log2(d_fft_length))); - int reg = 0; +int dvbt_symbol_inner_interleaver_impl::calculate_R(int i) +{ + const int Nr = int(ceil(log2(d_fft_length))); + int reg = 0; - if (i == 0) { + if (i == 0) { reg = 0; - } - else if (i == 1) { + } else if (i == 1) { reg = 0; - } - else { + } else { reg = 1; for (int k = 3; k <= i; k++) { - char new_bit = 0; - - if (d_transmission_mode == T2k) { - new_bit = (reg ^ (reg >> 3)) & 1; - } - else if (d_transmission_mode == T8k) { - new_bit = (reg ^ (reg >> 1) ^ (reg >> 4) ^ (reg >> 6)) & 1; - } - else { - new_bit = (reg ^ (reg >> 3)) & 1; - } - - int mask = (1 << Nr) - 1; - reg = ((reg >> 1) | (new_bit << (Nr - 2))) & mask; + char new_bit = 0; + + if (d_transmission_mode == T2k) { + new_bit = (reg ^ (reg >> 3)) & 1; + } else if (d_transmission_mode == T8k) { + new_bit = (reg ^ (reg >> 1) ^ (reg >> 4) ^ (reg >> 6)) & 1; + } else { + new_bit = (reg ^ (reg >> 3)) & 1; + } + + int mask = (1 << Nr) - 1; + reg = ((reg >> 1) | (new_bit << (Nr - 2))) & mask; } - } + } - int newreg = 0; + int newreg = 0; - for (int k = 0; k < (Nr - 1); k++) { + for (int k = 0; k < (Nr - 1); k++) { char bit = (reg >> k) & 1; newreg = newreg | (bit << d_bit_perm[k]); - } - - return newreg; } - dvbt_symbol_inner_interleaver::sptr - dvbt_symbol_inner_interleaver::make(int nsize, dvbt_transmission_mode_t transmission, int direction) - { - return gnuradio::get_initial_sptr - (new dvbt_symbol_inner_interleaver_impl(nsize, transmission, direction)); - } + return newreg; +} - /* - * The private constructor - */ - dvbt_symbol_inner_interleaver_impl::dvbt_symbol_inner_interleaver_impl(int nsize, dvbt_transmission_mode_t transmission, int direction) - : block("dvbt_symbol_inner_interleaver", - io_signature::make(1, 1, sizeof(unsigned char) * nsize), - io_signature::make(1, 1, sizeof(unsigned char) * nsize)), - config(gr::dtv::MOD_16QAM, gr::dtv::NH, gr::dtv::C1_2, gr::dtv::C1_2, gr::dtv::GI_1_32, transmission), - d_nsize(nsize), d_direction(direction), - d_fft_length(0), d_payload_length(0), +dvbt_symbol_inner_interleaver::sptr dvbt_symbol_inner_interleaver::make( + int nsize, dvbt_transmission_mode_t transmission, int direction) +{ + return gnuradio::get_initial_sptr( + new dvbt_symbol_inner_interleaver_impl(nsize, transmission, direction)); +} + +/* + * The private constructor + */ +dvbt_symbol_inner_interleaver_impl::dvbt_symbol_inner_interleaver_impl( + int nsize, dvbt_transmission_mode_t transmission, int direction) + : block("dvbt_symbol_inner_interleaver", + io_signature::make(1, 1, sizeof(unsigned char) * nsize), + io_signature::make(1, 1, sizeof(unsigned char) * nsize)), + config(gr::dtv::MOD_16QAM, + gr::dtv::NH, + gr::dtv::C1_2, + gr::dtv::C1_2, + gr::dtv::GI_1_32, + transmission), + d_nsize(nsize), + d_direction(direction), + d_fft_length(0), + d_payload_length(0), d_symbol_index(0) - { - d_symbols_per_frame = config.d_symbols_per_frame; - d_transmission_mode = config.d_transmission_mode; - d_fft_length = config.d_fft_length; - d_payload_length = config.d_payload_length; - d_direction = direction; - - // Verify if transmission mode matches with size of block - assert(d_payload_length == d_nsize); - - // Allocate memory for h vector - d_h = new (std::nothrow) int[d_fft_length]; - if (d_h == NULL) { - GR_LOG_FATAL(d_logger, "Symbol Inner Interleaver, cannot allocate memory for d_h."); +{ + d_symbols_per_frame = config.d_symbols_per_frame; + d_transmission_mode = config.d_transmission_mode; + d_fft_length = config.d_fft_length; + d_payload_length = config.d_payload_length; + d_direction = direction; + + // Verify if transmission mode matches with size of block + assert(d_payload_length == d_nsize); + + // Allocate memory for h vector + d_h = new (std::nothrow) int[d_fft_length]; + if (d_h == NULL) { + GR_LOG_FATAL(d_logger, + "Symbol Inner Interleaver, cannot allocate memory for d_h."); throw std::bad_alloc(); - } + } - // Setup bit permutation vectors - if (d_transmission_mode == T2k) { + // Setup bit permutation vectors + if (d_transmission_mode == T2k) { d_bit_perm = d_bit_perm_2k; - } - else if (d_transmission_mode == T8k) { + } else if (d_transmission_mode == T8k) { d_bit_perm = d_bit_perm_8k; - } - else { + } else { d_bit_perm = d_bit_perm_2k; - } - - // Generate the h function - generate_H(); - } - - /* - * Our virtual destructor. - */ - dvbt_symbol_inner_interleaver_impl::~dvbt_symbol_inner_interleaver_impl() - { - delete [] d_h; } - void - dvbt_symbol_inner_interleaver_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = noutput_items; - } - - int - dvbt_symbol_inner_interleaver_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; - - // Demod reference signals sends a tag per OFDM frame - // containing the symbol index. - std::vector<tag_t> tags; - const uint64_t nread = this->nitems_read(0); //number of items read on port 0 + // Generate the h function + generate_H(); +} - // Read all tags on the input buffer - this->get_tags_in_range(tags, 0, nread, nread + noutput_items, pmt::string_to_symbol("symbol_index")); - - for (int k = 0; k < noutput_items; k++) { +/* + * Our virtual destructor. + */ +dvbt_symbol_inner_interleaver_impl::~dvbt_symbol_inner_interleaver_impl() +{ + delete[] d_h; +} + +void dvbt_symbol_inner_interleaver_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = noutput_items; +} + +int dvbt_symbol_inner_interleaver_impl::general_work( + int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; + + // Demod reference signals sends a tag per OFDM frame + // containing the symbol index. + std::vector<tag_t> tags; + const uint64_t nread = this->nitems_read(0); // number of items read on port 0 + + // Read all tags on the input buffer + this->get_tags_in_range( + tags, 0, nread, nread + noutput_items, pmt::string_to_symbol("symbol_index")); + + for (int k = 0; k < noutput_items; k++) { int blocks = k * d_nsize; if (d_direction) { - // Interleave - for (int q = 0; q < d_nsize; q++) { - if (d_symbol_index % 2) { - out[blocks + q] = in[blocks + H(q)]; - } - else { - out[blocks + H(q)] = in[blocks + q]; + // Interleave + for (int q = 0; q < d_nsize; q++) { + if (d_symbol_index % 2) { + out[blocks + q] = in[blocks + H(q)]; + } else { + out[blocks + H(q)] = in[blocks + q]; + } } - } - ++d_symbol_index; - d_symbol_index = d_symbol_index % d_symbols_per_frame; - } - else { - // Deinterleave - d_symbol_index = pmt::to_long(tags[k].value); - - for (int q = 0; q < d_nsize; q++) { - if (d_symbol_index % 2) { - out[blocks + H(q)] = in[blocks + q]; - } - else { - out[blocks + q] = in[blocks + H(q)]; + ++d_symbol_index; + d_symbol_index = d_symbol_index % d_symbols_per_frame; + } else { + // Deinterleave + d_symbol_index = pmt::to_long(tags[k].value); + + for (int q = 0; q < d_nsize; q++) { + if (d_symbol_index % 2) { + out[blocks + H(q)] = in[blocks + q]; + } else { + out[blocks + q] = in[blocks + H(q)]; + } } - } } - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (noutput_items); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(noutput_items); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt/dvbt_symbol_inner_interleaver_impl.h b/gr-dtv/lib/dvbt/dvbt_symbol_inner_interleaver_impl.h index 6a7265d7e1..8ccc68167b 100644 --- a/gr-dtv/lib/dvbt/dvbt_symbol_inner_interleaver_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_symbol_inner_interleaver_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -25,46 +25,47 @@ #include "dvbt_configure.h" namespace gr { - namespace dtv { +namespace dtv { - class dvbt_symbol_inner_interleaver_impl : public dvbt_symbol_inner_interleaver - { - private: - const dvbt_configure config; +class dvbt_symbol_inner_interleaver_impl : public dvbt_symbol_inner_interleaver +{ +private: + const dvbt_configure config; - int d_symbols_per_frame; - dvbt_transmission_mode_t d_transmission_mode; - int d_nsize; - int d_direction; - int d_fft_length; - int d_payload_length; + int d_symbols_per_frame; + dvbt_transmission_mode_t d_transmission_mode; + int d_nsize; + int d_direction; + int d_fft_length; + int d_payload_length; - int * d_h; - const char * d_bit_perm; - static const char d_bit_perm_2k[]; - static const char d_bit_perm_8k[]; + int* d_h; + const char* d_bit_perm; + static const char d_bit_perm_2k[]; + static const char d_bit_perm_8k[]; - //Keeps the symbol index - unsigned int d_symbol_index; + // Keeps the symbol index + unsigned int d_symbol_index; - void generate_H(); - int H(int q); - int calculate_R(int i); + void generate_H(); + int H(int q); + int calculate_R(int i); - public: - dvbt_symbol_inner_interleaver_impl(int nsize, dvbt_transmission_mode_t transmission, int direction); - ~dvbt_symbol_inner_interleaver_impl(); +public: + dvbt_symbol_inner_interleaver_impl(int nsize, + dvbt_transmission_mode_t transmission, + int direction); + ~dvbt_symbol_inner_interleaver_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_SYMBOL_INNER_INTERLEAVER_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.cc b/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.cc index 97b014f9ae..e2acf1180e 100644 --- a/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,625 +26,610 @@ #include "dvbt_viterbi_decoder_impl.h" namespace gr { - namespace dtv { - - const unsigned char dvbt_viterbi_decoder_impl::d_puncture_1_2[2] = {1, 1}; - const unsigned char dvbt_viterbi_decoder_impl::d_puncture_2_3[4] = {1, 1, 0, 1}; - const unsigned char dvbt_viterbi_decoder_impl::d_puncture_3_4[6] = {1, 1, 0, 1, 1, 0}; - const unsigned char dvbt_viterbi_decoder_impl::d_puncture_5_6[10] = {1, 1, 0, 1, 1, 0, 0, 1, 1, 0}; - const unsigned char dvbt_viterbi_decoder_impl::d_puncture_7_8[14] = {1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0}; - /* 8-bit parity lookup table, generated by partab.c */ - const unsigned char dvbt_viterbi_decoder_impl::d_Partab[] = { - 0, 1, 1, 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, 0, 1, - 0, 1, 1, 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, 0, 1, - 0, 1, 1, 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, 0, 1, - 0, 1, 1, 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, 0, 1, - 0, 1, 1, 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, 0, 1, - 0, 1, 1, 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, 1, 1, 0, - }; +namespace dtv { + +const unsigned char dvbt_viterbi_decoder_impl::d_puncture_1_2[2] = { 1, 1 }; +const unsigned char dvbt_viterbi_decoder_impl::d_puncture_2_3[4] = { 1, 1, 0, 1 }; +const unsigned char dvbt_viterbi_decoder_impl::d_puncture_3_4[6] = { 1, 1, 0, 1, 1, 0 }; +const unsigned char dvbt_viterbi_decoder_impl::d_puncture_5_6[10] = { 1, 1, 0, 1, 1, + 0, 0, 1, 1, 0 }; +const unsigned char dvbt_viterbi_decoder_impl::d_puncture_7_8[14] = { + 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0 +}; +/* 8-bit parity lookup table, generated by partab.c */ +const unsigned char dvbt_viterbi_decoder_impl::d_Partab[] = { + 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, + 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, + 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, + 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, + 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, + 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, + 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, + 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, +}; #ifdef DTV_SSE2 - __GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_metric0[4]; - __GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_metric1[4]; - __GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_path0[4]; - __GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_path1[4]; +__GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_metric0[4]; +__GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_metric1[4]; +__GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_path0[4]; +__GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_path1[4]; #else - __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_metric0_generic[64]; - __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_metric1_generic[64]; - __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_path0_generic[64]; - __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_path1_generic[64]; +__GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_metric0_generic[64]; +__GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_metric1_generic[64]; +__GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_path0_generic[64]; +__GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_path1_generic[64]; #endif #ifdef DTV_SSE2 - __GR_ATTR_ALIGNED(16) branchtab27 dvbt_viterbi_decoder_impl::Branchtab27_sse2[2]; +__GR_ATTR_ALIGNED(16) branchtab27 dvbt_viterbi_decoder_impl::Branchtab27_sse2[2]; #else - __GR_ATTR_ALIGNED(16) branchtab27 dvbt_viterbi_decoder_impl::Branchtab27_generic[2]; +__GR_ATTR_ALIGNED(16) branchtab27 dvbt_viterbi_decoder_impl::Branchtab27_generic[2]; #endif - __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::mmresult[64]; - __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::ppresult[TRACEBACK_MAX][64]; +__GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::mmresult[64]; +__GR_ATTR_ALIGNED(16) +unsigned char dvbt_viterbi_decoder_impl::ppresult[TRACEBACK_MAX][64]; #ifdef DTV_SSE2 - void - dvbt_viterbi_decoder_impl::dvbt_viterbi_chunks_init_sse2(__m128i *mm0, __m128i *pp0) - { +void dvbt_viterbi_decoder_impl::dvbt_viterbi_chunks_init_sse2(__m128i* mm0, __m128i* pp0) +{ #else - void - dvbt_viterbi_decoder_impl::dvbt_viterbi_chunks_init_generic(unsigned char *mm0, unsigned char *pp0) - { +void dvbt_viterbi_decoder_impl::dvbt_viterbi_chunks_init_generic(unsigned char* mm0, + unsigned char* pp0) +{ #endif - // Initialize starting metrics to prefer 0 state - int i, j; + // Initialize starting metrics to prefer 0 state + int i, j; #ifdef DTV_SSE2 - for (i = 0; i < 4; i++) { + for (i = 0; i < 4; i++) { mm0[i] = _mm_setzero_si128(); pp0[i] = _mm_setzero_si128(); - } + } - int polys[2] = { POLYA, POLYB }; - for (i = 0; i < 32; i++) { - Branchtab27_sse2[0].c[i] = (polys[0] < 0) ^ d_Partab[(2*i) & abs(polys[0])] ? 1 : 0; - Branchtab27_sse2[1].c[i] = (polys[1] < 0) ^ d_Partab[(2*i) & abs(polys[1])] ? 1 : 0; - } + int polys[2] = { POLYA, POLYB }; + for (i = 0; i < 32; i++) { + Branchtab27_sse2[0].c[i] = + (polys[0] < 0) ^ d_Partab[(2 * i) & abs(polys[0])] ? 1 : 0; + Branchtab27_sse2[1].c[i] = + (polys[1] < 0) ^ d_Partab[(2 * i) & abs(polys[1])] ? 1 : 0; + } #else - for (i = 0; i < 64; i++) { + for (i = 0; i < 64; i++) { mm0[i] = 0; pp0[i] = 0; - } + } - int polys[2] = { POLYA, POLYB }; - for (i = 0; i < 32; i++) { - Branchtab27_generic[0].c[i] = (polys[0] < 0) ^ d_Partab[(2*i) & abs(polys[0])] ? 1 : 0; - Branchtab27_generic[1].c[i] = (polys[1] < 0) ^ d_Partab[(2*i) & abs(polys[1])] ? 1 : 0; - } + int polys[2] = { POLYA, POLYB }; + for (i = 0; i < 32; i++) { + Branchtab27_generic[0].c[i] = + (polys[0] < 0) ^ d_Partab[(2 * i) & abs(polys[0])] ? 1 : 0; + Branchtab27_generic[1].c[i] = + (polys[1] < 0) ^ d_Partab[(2 * i) & abs(polys[1])] ? 1 : 0; + } #endif - for (i = 0; i < 64; i++) { + for (i = 0; i < 64; i++) { mmresult[i] = 0; for (j = 0; j < TRACEBACK_MAX; j++) { - ppresult[j][i] = 0; + ppresult[j][i] = 0; } - } } +} #ifdef DTV_SSE2 - void - dvbt_viterbi_decoder_impl::dvbt_viterbi_butterfly2_sse2(unsigned char *symbols, __m128i *mm0, __m128i *mm1, __m128i *pp0, __m128i *pp1) - { - int i; +void dvbt_viterbi_decoder_impl::dvbt_viterbi_butterfly2_sse2( + unsigned char* symbols, __m128i* mm0, __m128i* mm1, __m128i* pp0, __m128i* pp1) +{ + int i; - __m128i *metric0, *metric1; - __m128i *path0, *path1; + __m128i *metric0, *metric1; + __m128i *path0, *path1; - metric0 = mm0; - path0 = pp0; - metric1 = mm1; - path1 = pp1; + metric0 = mm0; + path0 = pp0; + metric1 = mm1; + path1 = pp1; - // Operate on 4 symbols (2 bits) at a time + // Operate on 4 symbols (2 bits) at a time - __m128i m0, m1, m2, m3, decision0, decision1, survivor0, survivor1; - __m128i metsv, metsvm; - __m128i shift0, shift1; - __m128i tmp0, tmp1; - __m128i sym0v, sym1v; + __m128i m0, m1, m2, m3, decision0, decision1, survivor0, survivor1; + __m128i metsv, metsvm; + __m128i shift0, shift1; + __m128i tmp0, tmp1; + __m128i sym0v, sym1v; - sym0v = _mm_set1_epi8(symbols[0]); - sym1v = _mm_set1_epi8(symbols[1]); + sym0v = _mm_set1_epi8(symbols[0]); + sym1v = _mm_set1_epi8(symbols[1]); - for (i = 0; i < 2; i++) { + for (i = 0; i < 2; i++) { if (symbols[0] == 2) { - metsvm = _mm_xor_si128(Branchtab27_sse2[1].v[i],sym1v); - metsv = _mm_sub_epi8(_mm_set1_epi8(1),metsvm); - } - else if (symbols[1] == 2) { - metsvm = _mm_xor_si128(Branchtab27_sse2[0].v[i],sym0v); - metsv = _mm_sub_epi8(_mm_set1_epi8(1),metsvm); - } - else { - metsvm = _mm_add_epi8(_mm_xor_si128(Branchtab27_sse2[0].v[i],sym0v),_mm_xor_si128(Branchtab27_sse2[1].v[i],sym1v)); - metsv = _mm_sub_epi8(_mm_set1_epi8(2),metsvm); + metsvm = _mm_xor_si128(Branchtab27_sse2[1].v[i], sym1v); + metsv = _mm_sub_epi8(_mm_set1_epi8(1), metsvm); + } else if (symbols[1] == 2) { + metsvm = _mm_xor_si128(Branchtab27_sse2[0].v[i], sym0v); + metsv = _mm_sub_epi8(_mm_set1_epi8(1), metsvm); + } else { + metsvm = _mm_add_epi8(_mm_xor_si128(Branchtab27_sse2[0].v[i], sym0v), + _mm_xor_si128(Branchtab27_sse2[1].v[i], sym1v)); + metsv = _mm_sub_epi8(_mm_set1_epi8(2), metsvm); } m0 = _mm_add_epi8(metric0[i], metsv); - m1 = _mm_add_epi8(metric0[i+2], metsvm); + m1 = _mm_add_epi8(metric0[i + 2], metsvm); m2 = _mm_add_epi8(metric0[i], metsvm); - m3 = _mm_add_epi8(metric0[i+2], metsv); + m3 = _mm_add_epi8(metric0[i + 2], metsv); - decision0 = _mm_cmpgt_epi8(_mm_sub_epi8(m0,m1),_mm_setzero_si128()); - decision1 = _mm_cmpgt_epi8(_mm_sub_epi8(m2,m3),_mm_setzero_si128()); - survivor0 = _mm_or_si128(_mm_and_si128(decision0,m0),_mm_andnot_si128(decision0,m1)); - survivor1 = _mm_or_si128(_mm_and_si128(decision1,m2),_mm_andnot_si128(decision1,m3)); + decision0 = _mm_cmpgt_epi8(_mm_sub_epi8(m0, m1), _mm_setzero_si128()); + decision1 = _mm_cmpgt_epi8(_mm_sub_epi8(m2, m3), _mm_setzero_si128()); + survivor0 = + _mm_or_si128(_mm_and_si128(decision0, m0), _mm_andnot_si128(decision0, m1)); + survivor1 = + _mm_or_si128(_mm_and_si128(decision1, m2), _mm_andnot_si128(decision1, m3)); shift0 = _mm_slli_epi16(path0[i], 1); - shift1 = _mm_slli_epi16(path0[2+i], 1); + shift1 = _mm_slli_epi16(path0[2 + i], 1); shift1 = _mm_add_epi8(shift1, _mm_set1_epi8(1)); - metric1[2*i] = _mm_unpacklo_epi8(survivor0,survivor1); - tmp0 = _mm_or_si128(_mm_and_si128(decision0,shift0),_mm_andnot_si128(decision0,shift1)); + metric1[2 * i] = _mm_unpacklo_epi8(survivor0, survivor1); + tmp0 = _mm_or_si128(_mm_and_si128(decision0, shift0), + _mm_andnot_si128(decision0, shift1)); - metric1[2*i+1] = _mm_unpackhi_epi8(survivor0,survivor1); - tmp1 = _mm_or_si128(_mm_and_si128(decision1,shift0),_mm_andnot_si128(decision1,shift1)); + metric1[2 * i + 1] = _mm_unpackhi_epi8(survivor0, survivor1); + tmp1 = _mm_or_si128(_mm_and_si128(decision1, shift0), + _mm_andnot_si128(decision1, shift1)); - path1[2*i] = _mm_unpacklo_epi8(tmp0, tmp1); - path1[2*i+1] = _mm_unpackhi_epi8(tmp0, tmp1); - } + path1[2 * i] = _mm_unpacklo_epi8(tmp0, tmp1); + path1[2 * i + 1] = _mm_unpackhi_epi8(tmp0, tmp1); + } - metric0 = mm1; - path0 = pp1; - metric1 = mm0; - path1 = pp0; + metric0 = mm1; + path0 = pp1; + metric1 = mm0; + path1 = pp0; - sym0v = _mm_set1_epi8(symbols[2]); - sym1v = _mm_set1_epi8(symbols[3]); + sym0v = _mm_set1_epi8(symbols[2]); + sym1v = _mm_set1_epi8(symbols[3]); - for (i = 0; i < 2; i++) { + for (i = 0; i < 2; i++) { if (symbols[2] == 2) { - metsvm = _mm_xor_si128(Branchtab27_sse2[1].v[i],sym1v); - metsv = _mm_sub_epi8(_mm_set1_epi8(1),metsvm); - } - else if (symbols[3] == 2) { - metsvm = _mm_xor_si128(Branchtab27_sse2[0].v[i],sym0v); - metsv = _mm_sub_epi8(_mm_set1_epi8(1),metsvm); - } - else { - metsvm = _mm_add_epi8(_mm_xor_si128(Branchtab27_sse2[0].v[i],sym0v),_mm_xor_si128(Branchtab27_sse2[1].v[i],sym1v)); - metsv = _mm_sub_epi8(_mm_set1_epi8(2),metsvm); + metsvm = _mm_xor_si128(Branchtab27_sse2[1].v[i], sym1v); + metsv = _mm_sub_epi8(_mm_set1_epi8(1), metsvm); + } else if (symbols[3] == 2) { + metsvm = _mm_xor_si128(Branchtab27_sse2[0].v[i], sym0v); + metsv = _mm_sub_epi8(_mm_set1_epi8(1), metsvm); + } else { + metsvm = _mm_add_epi8(_mm_xor_si128(Branchtab27_sse2[0].v[i], sym0v), + _mm_xor_si128(Branchtab27_sse2[1].v[i], sym1v)); + metsv = _mm_sub_epi8(_mm_set1_epi8(2), metsvm); } m0 = _mm_add_epi8(metric0[i], metsv); - m1 = _mm_add_epi8(metric0[i+2], metsvm); + m1 = _mm_add_epi8(metric0[i + 2], metsvm); m2 = _mm_add_epi8(metric0[i], metsvm); - m3 = _mm_add_epi8(metric0[i+2], metsv); + m3 = _mm_add_epi8(metric0[i + 2], metsv); - decision0 = _mm_cmpgt_epi8(_mm_sub_epi8(m0,m1),_mm_setzero_si128()); - decision1 = _mm_cmpgt_epi8(_mm_sub_epi8(m2,m3),_mm_setzero_si128()); - survivor0 = _mm_or_si128(_mm_and_si128(decision0,m0),_mm_andnot_si128(decision0,m1)); - survivor1 = _mm_or_si128(_mm_and_si128(decision1,m2),_mm_andnot_si128(decision1,m3)); + decision0 = _mm_cmpgt_epi8(_mm_sub_epi8(m0, m1), _mm_setzero_si128()); + decision1 = _mm_cmpgt_epi8(_mm_sub_epi8(m2, m3), _mm_setzero_si128()); + survivor0 = + _mm_or_si128(_mm_and_si128(decision0, m0), _mm_andnot_si128(decision0, m1)); + survivor1 = + _mm_or_si128(_mm_and_si128(decision1, m2), _mm_andnot_si128(decision1, m3)); shift0 = _mm_slli_epi16(path0[i], 1); - shift1 = _mm_slli_epi16(path0[2+i], 1); + shift1 = _mm_slli_epi16(path0[2 + i], 1); shift1 = _mm_add_epi8(shift1, _mm_set1_epi8(1)); - metric1[2*i] = _mm_unpacklo_epi8(survivor0,survivor1); - tmp0 = _mm_or_si128(_mm_and_si128(decision0,shift0),_mm_andnot_si128(decision0,shift1)); + metric1[2 * i] = _mm_unpacklo_epi8(survivor0, survivor1); + tmp0 = _mm_or_si128(_mm_and_si128(decision0, shift0), + _mm_andnot_si128(decision0, shift1)); - metric1[2*i+1] = _mm_unpackhi_epi8(survivor0,survivor1); - tmp1 = _mm_or_si128(_mm_and_si128(decision1,shift0),_mm_andnot_si128(decision1,shift1)); + metric1[2 * i + 1] = _mm_unpackhi_epi8(survivor0, survivor1); + tmp1 = _mm_or_si128(_mm_and_si128(decision1, shift0), + _mm_andnot_si128(decision1, shift1)); - path1[2*i] = _mm_unpacklo_epi8(tmp0, tmp1); - path1[2*i+1] = _mm_unpackhi_epi8(tmp0, tmp1); - } + path1[2 * i] = _mm_unpacklo_epi8(tmp0, tmp1); + path1[2 * i + 1] = _mm_unpackhi_epi8(tmp0, tmp1); } +} #else - void - dvbt_viterbi_decoder_impl::dvbt_viterbi_butterfly2_generic(unsigned char *symbols, unsigned char *mm0, unsigned char *mm1, unsigned char *pp0, unsigned char *pp1) - { - int i, j, k; - - unsigned char *metric0, *metric1; - unsigned char *path0, *path1; - - metric0 = mm0; - path0 = pp0; - metric1 = mm1; - path1 = pp1; - - // Operate on 4 symbols (2 bits) at a time - - unsigned char m0[16], m1[16], m2[16], m3[16], decision0[16], decision1[16], survivor0[16], survivor1[16]; - unsigned char metsv[16], metsvm[16]; - unsigned char shift0[16], shift1[16]; - unsigned char tmp0[16], tmp1[16]; - unsigned char sym0v[16], sym1v[16]; - unsigned short simd_epi16; - - for (j = 0; j < 16; j++) { +void dvbt_viterbi_decoder_impl::dvbt_viterbi_butterfly2_generic(unsigned char* symbols, + unsigned char* mm0, + unsigned char* mm1, + unsigned char* pp0, + unsigned char* pp1) +{ + int i, j, k; + + unsigned char *metric0, *metric1; + unsigned char *path0, *path1; + + metric0 = mm0; + path0 = pp0; + metric1 = mm1; + path1 = pp1; + + // Operate on 4 symbols (2 bits) at a time + + unsigned char m0[16], m1[16], m2[16], m3[16], decision0[16], decision1[16], + survivor0[16], survivor1[16]; + unsigned char metsv[16], metsvm[16]; + unsigned char shift0[16], shift1[16]; + unsigned char tmp0[16], tmp1[16]; + unsigned char sym0v[16], sym1v[16]; + unsigned short simd_epi16; + + for (j = 0; j < 16; j++) { sym0v[j] = symbols[0]; sym1v[j] = symbols[1]; - } + } - for (i = 0; i < 2; i++) { + for (i = 0; i < 2; i++) { if (symbols[0] == 2) { - for (j = 0; j < 16; j++) { - metsvm[j] = Branchtab27_generic[1].c[(i*16) + j] ^ sym1v[j]; - metsv[j] = 1 - metsvm[j]; - } - } - else if (symbols[1] == 2) { - for (j = 0; j < 16; j++) { - metsvm[j] = Branchtab27_generic[0].c[(i*16) + j] ^ sym0v[j]; - metsv[j] = 1 - metsvm[j]; - } - } - else { - for (j = 0; j < 16; j++) { - metsvm[j] = (Branchtab27_generic[0].c[(i*16) + j] ^ sym0v[j]) + (Branchtab27_generic[1].c[(i*16) + j] ^ sym1v[j]); - metsv[j] = 2 - metsvm[j]; - } + for (j = 0; j < 16; j++) { + metsvm[j] = Branchtab27_generic[1].c[(i * 16) + j] ^ sym1v[j]; + metsv[j] = 1 - metsvm[j]; + } + } else if (symbols[1] == 2) { + for (j = 0; j < 16; j++) { + metsvm[j] = Branchtab27_generic[0].c[(i * 16) + j] ^ sym0v[j]; + metsv[j] = 1 - metsvm[j]; + } + } else { + for (j = 0; j < 16; j++) { + metsvm[j] = (Branchtab27_generic[0].c[(i * 16) + j] ^ sym0v[j]) + + (Branchtab27_generic[1].c[(i * 16) + j] ^ sym1v[j]); + metsv[j] = 2 - metsvm[j]; + } } for (j = 0; j < 16; j++) { - m0[j] = metric0[(i*16) + j] + metsv[j]; - m1[j] = metric0[((i+2)*16) + j] + metsvm[j]; - m2[j] = metric0[(i*16) + j] + metsvm[j]; - m3[j] = metric0[((i+2)*16) + j] + metsv[j]; + m0[j] = metric0[(i * 16) + j] + metsv[j]; + m1[j] = metric0[((i + 2) * 16) + j] + metsvm[j]; + m2[j] = metric0[(i * 16) + j] + metsvm[j]; + m3[j] = metric0[((i + 2) * 16) + j] + metsv[j]; } for (j = 0; j < 16; j++) { - decision0[j] = ((m0[j] - m1[j]) > 0) ? 0xff : 0x0; - decision1[j] = ((m2[j] - m3[j]) > 0) ? 0xff : 0x0; - survivor0[j] = (decision0[j] & m0[j]) | ((~decision0[j]) & m1[j]); - survivor1[j] = (decision1[j] & m2[j]) | ((~decision1[j]) & m3[j]); + decision0[j] = ((m0[j] - m1[j]) > 0) ? 0xff : 0x0; + decision1[j] = ((m2[j] - m3[j]) > 0) ? 0xff : 0x0; + survivor0[j] = (decision0[j] & m0[j]) | ((~decision0[j]) & m1[j]); + survivor1[j] = (decision1[j] & m2[j]) | ((~decision1[j]) & m3[j]); } for (j = 0; j < 16; j += 2) { - simd_epi16 = path0[(i*16) + j]; - simd_epi16 |= path0[(i*16) + (j+1)] << 8; - simd_epi16 <<= 1; - shift0[j] = simd_epi16; - shift0[j+1] = simd_epi16 >> 8; - - simd_epi16 = path0[((i+2)*16) + j]; - simd_epi16 |= path0[((i+2)*16) + (j+1)] << 8; - simd_epi16 <<= 1; - shift1[j] = simd_epi16; - shift1[j+1] = simd_epi16 >> 8; + simd_epi16 = path0[(i * 16) + j]; + simd_epi16 |= path0[(i * 16) + (j + 1)] << 8; + simd_epi16 <<= 1; + shift0[j] = simd_epi16; + shift0[j + 1] = simd_epi16 >> 8; + + simd_epi16 = path0[((i + 2) * 16) + j]; + simd_epi16 |= path0[((i + 2) * 16) + (j + 1)] << 8; + simd_epi16 <<= 1; + shift1[j] = simd_epi16; + shift1[j + 1] = simd_epi16 >> 8; } for (j = 0; j < 16; j++) { - shift1[j] = shift1[j] + 1; + shift1[j] = shift1[j] + 1; } for (j = 0, k = 0; j < 16; j += 2, k++) { - metric1[(2*i*16) + j] = survivor0[k]; - metric1[(2*i*16) + (j+1)] = survivor1[k]; + metric1[(2 * i * 16) + j] = survivor0[k]; + metric1[(2 * i * 16) + (j + 1)] = survivor1[k]; } for (j = 0; j < 16; j++) { - tmp0[j] = (decision0[j] & shift0[j]) | ((~decision0[j]) & shift1[j]); + tmp0[j] = (decision0[j] & shift0[j]) | ((~decision0[j]) & shift1[j]); } for (j = 0, k = 8; j < 16; j += 2, k++) { - metric1[((2*i+1)*16) + j] = survivor0[k]; - metric1[((2*i+1)*16) + (j+1)] = survivor1[k]; + metric1[((2 * i + 1) * 16) + j] = survivor0[k]; + metric1[((2 * i + 1) * 16) + (j + 1)] = survivor1[k]; } for (j = 0; j < 16; j++) { - tmp1[j] = (decision1[j] & shift0[j]) | ((~decision1[j]) & shift1[j]); + tmp1[j] = (decision1[j] & shift0[j]) | ((~decision1[j]) & shift1[j]); } for (j = 0, k = 0; j < 16; j += 2, k++) { - path1[(2*i*16) + j] = tmp0[k]; - path1[(2*i*16) + (j+1)] = tmp1[k]; + path1[(2 * i * 16) + j] = tmp0[k]; + path1[(2 * i * 16) + (j + 1)] = tmp1[k]; } for (j = 0, k = 8; j < 16; j += 2, k++) { - path1[((2*i+1)*16) + j] = tmp0[k]; - path1[((2*i+1)*16) + (j+1)] = tmp1[k]; + path1[((2 * i + 1) * 16) + j] = tmp0[k]; + path1[((2 * i + 1) * 16) + (j + 1)] = tmp1[k]; } - } + } - metric0 = mm1; - path0 = pp1; - metric1 = mm0; - path1 = pp0; + metric0 = mm1; + path0 = pp1; + metric1 = mm0; + path1 = pp0; - for (j = 0; j < 16; j++) { + for (j = 0; j < 16; j++) { sym0v[j] = symbols[2]; sym1v[j] = symbols[3]; - } + } - for (i = 0; i < 2; i++) { + for (i = 0; i < 2; i++) { if (symbols[2] == 2) { - for (j = 0; j < 16; j++) { - metsvm[j] = Branchtab27_generic[1].c[(i*16) + j] ^ sym1v[j]; - metsv[j] = 1 - metsvm[j]; - } - } - else if (symbols[3] == 2) { - for (j = 0; j < 16; j++) { - metsvm[j] = Branchtab27_generic[0].c[(i*16) + j] ^ sym0v[j]; - metsv[j] = 1 - metsvm[j]; - } - } - else { - for (j = 0; j < 16; j++) { - metsvm[j] = (Branchtab27_generic[0].c[(i*16) + j] ^ sym0v[j]) + (Branchtab27_generic[1].c[(i*16) + j] ^ sym1v[j]); - metsv[j] = 2 - metsvm[j]; - } + for (j = 0; j < 16; j++) { + metsvm[j] = Branchtab27_generic[1].c[(i * 16) + j] ^ sym1v[j]; + metsv[j] = 1 - metsvm[j]; + } + } else if (symbols[3] == 2) { + for (j = 0; j < 16; j++) { + metsvm[j] = Branchtab27_generic[0].c[(i * 16) + j] ^ sym0v[j]; + metsv[j] = 1 - metsvm[j]; + } + } else { + for (j = 0; j < 16; j++) { + metsvm[j] = (Branchtab27_generic[0].c[(i * 16) + j] ^ sym0v[j]) + + (Branchtab27_generic[1].c[(i * 16) + j] ^ sym1v[j]); + metsv[j] = 2 - metsvm[j]; + } } for (j = 0; j < 16; j++) { - m0[j] = metric0[(i*16) + j] + metsv[j]; - m1[j] = metric0[((i+2)*16) + j] + metsvm[j]; - m2[j] = metric0[(i*16) + j] + metsvm[j]; - m3[j] = metric0[((i+2)*16) + j] + metsv[j]; + m0[j] = metric0[(i * 16) + j] + metsv[j]; + m1[j] = metric0[((i + 2) * 16) + j] + metsvm[j]; + m2[j] = metric0[(i * 16) + j] + metsvm[j]; + m3[j] = metric0[((i + 2) * 16) + j] + metsv[j]; } for (j = 0; j < 16; j++) { - decision0[j] = ((m0[j] - m1[j]) > 0) ? 0xff : 0x0; - decision1[j] = ((m2[j] - m3[j]) > 0) ? 0xff : 0x0; - survivor0[j] = (decision0[j] & m0[j]) | ((~decision0[j]) & m1[j]); - survivor1[j] = (decision1[j] & m2[j]) | ((~decision1[j]) & m3[j]); + decision0[j] = ((m0[j] - m1[j]) > 0) ? 0xff : 0x0; + decision1[j] = ((m2[j] - m3[j]) > 0) ? 0xff : 0x0; + survivor0[j] = (decision0[j] & m0[j]) | ((~decision0[j]) & m1[j]); + survivor1[j] = (decision1[j] & m2[j]) | ((~decision1[j]) & m3[j]); } for (j = 0; j < 16; j += 2) { - simd_epi16 = path0[(i*16) + j]; - simd_epi16 |= path0[(i*16) + (j+1)] << 8; - simd_epi16 <<= 1; - shift0[j] = simd_epi16; - shift0[j+1] = simd_epi16 >> 8; - - simd_epi16 = path0[((i+2)*16) + j]; - simd_epi16 |= path0[((i+2)*16) + (j+1)] << 8; - simd_epi16 <<= 1; - shift1[j] = simd_epi16; - shift1[j+1] = simd_epi16 >> 8; + simd_epi16 = path0[(i * 16) + j]; + simd_epi16 |= path0[(i * 16) + (j + 1)] << 8; + simd_epi16 <<= 1; + shift0[j] = simd_epi16; + shift0[j + 1] = simd_epi16 >> 8; + + simd_epi16 = path0[((i + 2) * 16) + j]; + simd_epi16 |= path0[((i + 2) * 16) + (j + 1)] << 8; + simd_epi16 <<= 1; + shift1[j] = simd_epi16; + shift1[j + 1] = simd_epi16 >> 8; } for (j = 0; j < 16; j++) { - shift1[j] = shift1[j] + 1; + shift1[j] = shift1[j] + 1; } for (j = 0, k = 0; j < 16; j += 2, k++) { - metric1[(2*i*16) + j] = survivor0[k]; - metric1[(2*i*16) + (j+1)] = survivor1[k]; + metric1[(2 * i * 16) + j] = survivor0[k]; + metric1[(2 * i * 16) + (j + 1)] = survivor1[k]; } for (j = 0; j < 16; j++) { - tmp0[j] = (decision0[j] & shift0[j]) | ((~decision0[j]) & shift1[j]); + tmp0[j] = (decision0[j] & shift0[j]) | ((~decision0[j]) & shift1[j]); } for (j = 0, k = 8; j < 16; j += 2, k++) { - metric1[((2*i+1)*16) + j] = survivor0[k]; - metric1[((2*i+1)*16) + (j+1)] = survivor1[k]; + metric1[((2 * i + 1) * 16) + j] = survivor0[k]; + metric1[((2 * i + 1) * 16) + (j + 1)] = survivor1[k]; } for (j = 0; j < 16; j++) { - tmp1[j] = (decision1[j] & shift0[j]) | ((~decision1[j]) & shift1[j]); + tmp1[j] = (decision1[j] & shift0[j]) | ((~decision1[j]) & shift1[j]); } for (j = 0, k = 0; j < 16; j += 2, k++) { - path1[(2*i*16) + j] = tmp0[k]; - path1[(2*i*16) + (j+1)] = tmp1[k]; + path1[(2 * i * 16) + j] = tmp0[k]; + path1[(2 * i * 16) + (j + 1)] = tmp1[k]; } for (j = 0, k = 8; j < 16; j += 2, k++) { - path1[((2*i+1)*16) + j] = tmp0[k]; - path1[((2*i+1)*16) + (j+1)] = tmp1[k]; + path1[((2 * i + 1) * 16) + j] = tmp0[k]; + path1[((2 * i + 1) * 16) + (j + 1)] = tmp1[k]; } - } } +} #endif #ifdef DTV_SSE2 - unsigned char - dvbt_viterbi_decoder_impl::dvbt_viterbi_get_output_sse2(__m128i *mm0, __m128i *pp0, int ntraceback, unsigned char *outbuf) - { +unsigned char dvbt_viterbi_decoder_impl::dvbt_viterbi_get_output_sse2( + __m128i* mm0, __m128i* pp0, int ntraceback, unsigned char* outbuf) +{ #else - unsigned char - dvbt_viterbi_decoder_impl::dvbt_viterbi_get_output_generic(unsigned char *mm0, unsigned char *pp0, int ntraceback, unsigned char *outbuf) - { +unsigned char dvbt_viterbi_decoder_impl::dvbt_viterbi_get_output_generic( + unsigned char* mm0, unsigned char* pp0, int ntraceback, unsigned char* outbuf) +{ #endif - // Find current best path - int i; - int bestmetric, minmetric; - int beststate = 0; - int pos = 0; + // Find current best path + int i; + int bestmetric, minmetric; + int beststate = 0; + int pos = 0; #ifndef DTV_SSE2 - int j; + int j; #endif - // Implement a circular buffer with the last ntraceback paths - store_pos = (store_pos + 1) % ntraceback; + // Implement a circular buffer with the last ntraceback paths + store_pos = (store_pos + 1) % ntraceback; #ifdef DTV_SSE2 - // TODO - find another way to extract the value - for (i = 0; i < 4; i++) { - _mm_store_si128((__m128i *) &mmresult[i*16], mm0[i]); - _mm_store_si128((__m128i *) &ppresult[store_pos][i*16], pp0[i]); - } + // TODO - find another way to extract the value + for (i = 0; i < 4; i++) { + _mm_store_si128((__m128i*)&mmresult[i * 16], mm0[i]); + _mm_store_si128((__m128i*)&ppresult[store_pos][i * 16], pp0[i]); + } #else - for (i = 0; i < 4; i++) { + for (i = 0; i < 4; i++) { for (j = 0; j < 16; j++) { - mmresult[(i*16) + j] = mm0[(i*16) + j]; - ppresult[store_pos][(i*16) + j] = pp0[(i*16) + j]; + mmresult[(i * 16) + j] = mm0[(i * 16) + j]; + ppresult[store_pos][(i * 16) + j] = pp0[(i * 16) + j]; } - } + } #endif - // Find out the best final state - bestmetric = mmresult[beststate]; - minmetric = mmresult[beststate]; + // Find out the best final state + bestmetric = mmresult[beststate]; + minmetric = mmresult[beststate]; - for (i = 1; i < 64; i++) { + for (i = 1; i < 64; i++) { if (mmresult[i] > bestmetric) { - bestmetric = mmresult[i]; - beststate = i; + bestmetric = mmresult[i]; + beststate = i; } if (mmresult[i] < minmetric) { - minmetric = mmresult[i]; + minmetric = mmresult[i]; } - } + } - // Trace back - for (i = 0, pos = store_pos; i < (ntraceback - 1); i++) { + // Trace back + for (i = 0, pos = store_pos; i < (ntraceback - 1); i++) { // Obtain the state from the output bits // by clocking in the output bits in reverse order. // The state has only 6 bits beststate = ppresult[pos][beststate] >> 2; pos = (pos - 1 + ntraceback) % ntraceback; - } + } - // Store output byte - *outbuf = ppresult[pos][beststate]; + // Store output byte + *outbuf = ppresult[pos][beststate]; #ifdef DTV_SSE2 - // Zero out the path variable - // and prevent metric overflow - for (i = 0; i < 4; i++) { + // Zero out the path variable + // and prevent metric overflow + for (i = 0; i < 4; i++) { pp0[i] = _mm_setzero_si128(); mm0[i] = _mm_sub_epi8(mm0[i], _mm_set1_epi8(minmetric)); - } + } #else - for (i = 0; i < 4; i++) { + for (i = 0; i < 4; i++) { for (j = 0; j < 16; j++) { - pp0[(i*16) + j] = 0; - mm0[(i*16) + j] = mm0[(i*16) + j] - minmetric; + pp0[(i * 16) + j] = 0; + mm0[(i * 16) + j] = mm0[(i * 16) + j] - minmetric; } - } + } #endif - return bestmetric; - } + return bestmetric; +} - dvbt_viterbi_decoder::sptr - dvbt_viterbi_decoder::make(dvb_constellation_t constellation, \ - dvbt_hierarchy_t hierarchy, dvb_code_rate_t coderate, int bsize) - { - return gnuradio::get_initial_sptr - (new dvbt_viterbi_decoder_impl(constellation, hierarchy, coderate, bsize)); - } +dvbt_viterbi_decoder::sptr dvbt_viterbi_decoder::make(dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t coderate, + int bsize) +{ + return gnuradio::get_initial_sptr( + new dvbt_viterbi_decoder_impl(constellation, hierarchy, coderate, bsize)); +} - /* - * The private constructor - */ - dvbt_viterbi_decoder_impl::dvbt_viterbi_decoder_impl(dvb_constellation_t constellation, \ - dvbt_hierarchy_t hierarchy, dvb_code_rate_t coderate, int bsize) - : block("dvbt_viterbi_decoder", - io_signature::make(1, 1, sizeof (unsigned char)), - io_signature::make(1, 1, sizeof (unsigned char))), +/* + * The private constructor + */ +dvbt_viterbi_decoder_impl::dvbt_viterbi_decoder_impl(dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t coderate, + int bsize) + : block("dvbt_viterbi_decoder", + io_signature::make(1, 1, sizeof(unsigned char)), + io_signature::make(1, 1, sizeof(unsigned char))), config(constellation, hierarchy, coderate, coderate), d_bsize(bsize), d_init(0), store_pos(0) - { - //Determine k - input of encoder - d_k = config.d_cr_k; - //Determine n - output of encoder - d_n = config.d_cr_n; - //Determine m - constellation symbol size - d_m = config.d_m; - // Determine puncturing vector and traceback - if (config.d_code_rate_HP == C1_2) { +{ + // Determine k - input of encoder + d_k = config.d_cr_k; + // Determine n - output of encoder + d_n = config.d_cr_n; + // Determine m - constellation symbol size + d_m = config.d_m; + // Determine puncturing vector and traceback + if (config.d_code_rate_HP == C1_2) { d_puncture = d_puncture_1_2; d_ntraceback = 5; - } - else if (config.d_code_rate_HP == C2_3) { + } else if (config.d_code_rate_HP == C2_3) { d_puncture = d_puncture_2_3; d_ntraceback = 9; - } - else if (config.d_code_rate_HP == C3_4) { + } else if (config.d_code_rate_HP == C3_4) { d_puncture = d_puncture_3_4; d_ntraceback = 10; - } - else if (config.d_code_rate_HP == C5_6) { + } else if (config.d_code_rate_HP == C5_6) { d_puncture = d_puncture_5_6; d_ntraceback = 15; - } - else if (config.d_code_rate_HP == C7_8) { + } else if (config.d_code_rate_HP == C7_8) { d_puncture = d_puncture_7_8; d_ntraceback = 24; - } - else { + } else { d_puncture = d_puncture_1_2; d_ntraceback = 5; - } - - /* - * We input n bytes, each carrying m bits => nm bits - * The result after decoding is km bits, therefore km/8 bytes. - * - * out/in rate is therefore km/8n in bytes - */ - - assert ((d_bsize * d_n) % d_m == 0); - set_output_multiple (d_bsize * d_k / 8); - - /* - * Calculate process variables: - * Number of symbols (d_m bits) in all blocks - * It is also the number of input bytes since - * one byte always contains just one symbol. - */ - d_nsymbols = d_bsize * d_n / d_m; - // Number of bits after depuncturing a block (before decoding) - d_nbits = 2 * d_k * d_bsize; - // Number of output bytes after decoding - d_nout = d_nbits / 2 / 8; - - // Allocate the buffer for the bits - d_inbits = new (std::nothrow) unsigned char [d_nbits]; - if (d_inbits == NULL) { + } + + /* + * We input n bytes, each carrying m bits => nm bits + * The result after decoding is km bits, therefore km/8 bytes. + * + * out/in rate is therefore km/8n in bytes + */ + + assert((d_bsize * d_n) % d_m == 0); + set_output_multiple(d_bsize * d_k / 8); + + /* + * Calculate process variables: + * Number of symbols (d_m bits) in all blocks + * It is also the number of input bytes since + * one byte always contains just one symbol. + */ + d_nsymbols = d_bsize * d_n / d_m; + // Number of bits after depuncturing a block (before decoding) + d_nbits = 2 * d_k * d_bsize; + // Number of output bytes after decoding + d_nout = d_nbits / 2 / 8; + + // Allocate the buffer for the bits + d_inbits = new (std::nothrow) unsigned char[d_nbits]; + if (d_inbits == NULL) { GR_LOG_FATAL(d_logger, "Viterbi Decoder, cannot allocate memory for d_inbits."); throw std::bad_alloc(); - } + } - mettab[0][0] = 1; - mettab[0][1] = 0; - mettab[1][0] = 0; - mettab[1][1] = 1; + mettab[0][0] = 1; + mettab[0][1] = 0; + mettab[1][0] = 0; + mettab[1][1] = 1; #ifdef DTV_SSE2 - dvbt_viterbi_chunks_init_sse2(d_metric0, d_path0); + dvbt_viterbi_chunks_init_sse2(d_metric0, d_path0); #else - dvbt_viterbi_chunks_init_generic(d_metric0_generic, d_path0_generic); + dvbt_viterbi_chunks_init_generic(d_metric0_generic, d_path0_generic); #endif +} - } - - /* - * Our virtual destructor. - */ - dvbt_viterbi_decoder_impl::~dvbt_viterbi_decoder_impl() - { - delete [] d_inbits; - } +/* + * Our virtual destructor. + */ +dvbt_viterbi_decoder_impl::~dvbt_viterbi_decoder_impl() { delete[] d_inbits; } - void - dvbt_viterbi_decoder_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - int input_required = noutput_items * 8 * d_n / (d_k * d_m); +void dvbt_viterbi_decoder_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + int input_required = noutput_items * 8 * d_n / (d_k * d_m); - unsigned ninputs = ninput_items_required.size(); - for (unsigned int i = 0; i < ninputs; i++) { + unsigned ninputs = ninput_items_required.size(); + for (unsigned int i = 0; i < ninputs; i++) { ninput_items_required[i] = input_required; - } } +} - int - dvbt_viterbi_decoder_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - int nstreams = input_items.size(); - int nblocks = 8 * noutput_items / (d_bsize * d_k); - int out_count = 0; +int dvbt_viterbi_decoder_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + int nstreams = input_items.size(); + int nblocks = 8 * noutput_items / (d_bsize * d_k); + int out_count = 0; - for (int m = 0; m < nstreams; m++) { - const unsigned char *in = (const unsigned char *) input_items[m]; - unsigned char *out = (unsigned char *) output_items[m]; + for (int m = 0; m < nstreams; m++) { + const unsigned char* in = (const unsigned char*)input_items[m]; + unsigned char* out = (unsigned char*)output_items[m]; /* * Look for a tag that signals superframe_start and consume all input items @@ -652,89 +637,102 @@ namespace gr { * This will actually reset the viterbi decoder. */ std::vector<tag_t> tags; - const uint64_t nread = this->nitems_read(0); //number of items read on port 0 - this->get_tags_in_range(tags, 0, nread, nread + (nblocks * d_nsymbols), pmt::string_to_symbol("superframe_start")); + const uint64_t nread = this->nitems_read(0); // number of items read on port 0 + this->get_tags_in_range(tags, + 0, + nread, + nread + (nblocks * d_nsymbols), + pmt::string_to_symbol("superframe_start")); if (tags.size()) { - d_init = 0; + d_init = 0; #ifdef DTV_SSE2 - dvbt_viterbi_chunks_init_sse2(d_metric0, d_path0); + dvbt_viterbi_chunks_init_sse2(d_metric0, d_path0); #else - dvbt_viterbi_chunks_init_generic(d_metric0_generic, d_path0_generic); + dvbt_viterbi_chunks_init_generic(d_metric0_generic, d_path0_generic); #endif - if (tags[0].offset - nread) { - consume_each(tags[0].offset - nread); - return (0); - } + if (tags[0].offset - nread) { + consume_each(tags[0].offset - nread); + return (0); + } } // This is actually the Viterbi decoder for (int n = 0; n < nblocks; n++) { - /* - * Depuncture and unpack a block. - * We receive the symbol (d_m bits/byte) in one byte (e.g. for QAM16 00001111). - * Create a buffer of bytes containing just one bit/byte. - * Also depuncture according to the puncture vector. - * TODO - reduce the number of branches while depuncturing. - */ - for (int count = 0, i = 0; i < d_nsymbols; i++) { - for (int j = (d_m - 1); j >= 0; j--) { - // Depuncture - while (d_puncture[count % (2 * d_k)] == 0) { - d_inbits[count++] = 2; - } - - // Insert received bits - d_inbits[count++] = (in[(n * d_nsymbols) + i] >> j) & 1; - - // Depuncture - while (d_puncture[count % (2 * d_k)] == 0) { - d_inbits[count++] = 2; - } + /* + * Depuncture and unpack a block. + * We receive the symbol (d_m bits/byte) in one byte (e.g. for QAM16 + * 00001111). Create a buffer of bytes containing just one bit/byte. Also + * depuncture according to the puncture vector. + * TODO - reduce the number of branches while depuncturing. + */ + for (int count = 0, i = 0; i < d_nsymbols; i++) { + for (int j = (d_m - 1); j >= 0; j--) { + // Depuncture + while (d_puncture[count % (2 * d_k)] == 0) { + d_inbits[count++] = 2; + } + + // Insert received bits + d_inbits[count++] = (in[(n * d_nsymbols) + i] >> j) & 1; + + // Depuncture + while (d_puncture[count % (2 * d_k)] == 0) { + d_inbits[count++] = 2; + } + } } - } - /* - * Decode a block. - */ - for (int in_count = 0; in_count < d_nbits; in_count++) { - if ((in_count % 4) == 0) { // 0 or 3 + /* + * Decode a block. + */ + for (int in_count = 0; in_count < d_nbits; in_count++) { + if ((in_count % 4) == 0) { // 0 or 3 #ifdef DTV_SSE2 - dvbt_viterbi_butterfly2_sse2(&d_inbits[in_count & 0xfffffffc], d_metric0, d_metric1, d_path0, d_path1); + dvbt_viterbi_butterfly2_sse2(&d_inbits[in_count & 0xfffffffc], + d_metric0, + d_metric1, + d_path0, + d_path1); #else - dvbt_viterbi_butterfly2_generic(&d_inbits[in_count & 0xfffffffc], d_metric0_generic, d_metric1_generic, d_path0_generic, d_path1_generic); + dvbt_viterbi_butterfly2_generic(&d_inbits[in_count & 0xfffffffc], + d_metric0_generic, + d_metric1_generic, + d_path0_generic, + d_path1_generic); #endif - if ((in_count > 0) && (in_count % 16) == 8) { // 8 or 11 - unsigned char c; + if ((in_count > 0) && (in_count % 16) == 8) { // 8 or 11 + unsigned char c; #ifdef DTV_SSE2 - dvbt_viterbi_get_output_sse2(d_metric0, d_path0, d_ntraceback, &c); + dvbt_viterbi_get_output_sse2( + d_metric0, d_path0, d_ntraceback, &c); #else - dvbt_viterbi_get_output_generic(d_metric0_generic, d_path0_generic, d_ntraceback, &c); + dvbt_viterbi_get_output_generic( + d_metric0_generic, d_path0_generic, d_ntraceback, &c); #endif - if (d_init == 0) { - if (out_count >= d_ntraceback) { - out[out_count - d_ntraceback] = c; - } + if (d_init == 0) { + if (out_count >= d_ntraceback) { + out[out_count - d_ntraceback] = c; + } + } else { + out[out_count] = c; + } + out_count++; + } } - else { - out[out_count] = c; - } - out_count++; - } } - } } - } + } - int to_out = noutput_items; + int to_out = noutput_items; - if (d_init == 0) { + if (d_init == 0) { /* * Send superframe_start to signal this situation * downstream @@ -747,16 +745,15 @@ namespace gr { // Take in consideration the traceback length to_out = to_out - d_ntraceback; d_init = 1; - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (nblocks * d_nsymbols); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(nblocks * d_nsymbols); - // Tell runtime system how many output items we produced. - return (to_out); - } + // Tell runtime system how many output items we produced. + return (to_out); +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.h b/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.h index 22b040cd3f..607e5bda8f 100644 --- a/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.h @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -40,112 +40,124 @@ #ifdef DTV_SSE2 union branchtab27 { - unsigned char c[32]; - __m128i v[2]; + unsigned char c[32]; + __m128i v[2]; }; #else struct branchtab27 { - unsigned char c[32]; + unsigned char c[32]; }; #endif namespace gr { - namespace dtv { +namespace dtv { - class dvbt_viterbi_decoder_impl : public dvbt_viterbi_decoder - { - private: - dvbt_configure config; +class dvbt_viterbi_decoder_impl : public dvbt_viterbi_decoder +{ +private: + dvbt_configure config; - // Puncturing vectors - static const unsigned char d_puncture_1_2[]; - static const unsigned char d_puncture_2_3[]; - static const unsigned char d_puncture_3_4[]; - static const unsigned char d_puncture_5_6[]; - static const unsigned char d_puncture_7_8[]; - static const unsigned char d_Partab[]; + // Puncturing vectors + static const unsigned char d_puncture_1_2[]; + static const unsigned char d_puncture_2_3[]; + static const unsigned char d_puncture_3_4[]; + static const unsigned char d_puncture_5_6[]; + static const unsigned char d_puncture_7_8[]; + static const unsigned char d_Partab[]; #ifdef DTV_SSE2 - static __m128i d_metric0[4]; - static __m128i d_metric1[4]; - static __m128i d_path0[4]; - static __m128i d_path1[4]; + static __m128i d_metric0[4]; + static __m128i d_metric1[4]; + static __m128i d_path0[4]; + static __m128i d_path1[4]; #else - static unsigned char d_metric0_generic[64]; - static unsigned char d_metric1_generic[64]; - static unsigned char d_path0_generic[64]; - static unsigned char d_path1_generic[64]; + static unsigned char d_metric0_generic[64]; + static unsigned char d_metric1_generic[64]; + static unsigned char d_path0_generic[64]; + static unsigned char d_path1_generic[64]; #endif #ifdef DTV_SSE2 - static branchtab27 Branchtab27_sse2[2]; + static branchtab27 Branchtab27_sse2[2]; #else - static branchtab27 Branchtab27_generic[2]; + static branchtab27 Branchtab27_generic[2]; #endif - // Metrics for each state - static unsigned char mmresult[64]; - // Paths for each state - static unsigned char ppresult[TRACEBACK_MAX][64]; + // Metrics for each state + static unsigned char mmresult[64]; + // Paths for each state + static unsigned char ppresult[TRACEBACK_MAX][64]; - // Current puncturing vector - const unsigned char * d_puncture; + // Current puncturing vector + const unsigned char* d_puncture; - // Code rate k/n - int d_k; - int d_n; - // Constellation with m - int d_m; + // Code rate k/n + int d_k; + int d_n; + // Constellation with m + int d_m; - // Block size - int d_bsize; - // Symbols to consume on decoding from one block - int d_nsymbols; - // Number of bits after depuncturing a block - int d_nbits; - // Number of full packed out bytes - int d_nout; + // Block size + int d_bsize; + // Symbols to consume on decoding from one block + int d_nsymbols; + // Number of bits after depuncturing a block + int d_nbits; + // Number of full packed out bytes + int d_nout; - // Traceback (in bytes) - int d_ntraceback; + // Traceback (in bytes) + int d_ntraceback; - // Viterbi tables - int mettab[2][256]; + // Viterbi tables + int mettab[2][256]; - // Buffer to keep the input bits - unsigned char * d_inbits; + // Buffer to keep the input bits + unsigned char* d_inbits; - // This is used to get rid of traceback on the first frame - int d_init; + // This is used to get rid of traceback on the first frame + int d_init; - // Position in circular buffer where the current decoded byte is stored - int store_pos; + // Position in circular buffer where the current decoded byte is stored + int store_pos; #ifdef DTV_SSE2 - void dvbt_viterbi_chunks_init_sse2(__m128i *mm0, __m128i *pp0); - void dvbt_viterbi_butterfly2_sse2(unsigned char *symbols, __m128i m0[], __m128i m1[], __m128i p0[], __m128i p1[]); - unsigned char dvbt_viterbi_get_output_sse2(__m128i *mm0, __m128i *pp0, int ntraceback, unsigned char *outbuf); + void dvbt_viterbi_chunks_init_sse2(__m128i* mm0, __m128i* pp0); + void dvbt_viterbi_butterfly2_sse2( + unsigned char* symbols, __m128i m0[], __m128i m1[], __m128i p0[], __m128i p1[]); + unsigned char dvbt_viterbi_get_output_sse2(__m128i* mm0, + __m128i* pp0, + int ntraceback, + unsigned char* outbuf); #else - void dvbt_viterbi_chunks_init_generic(unsigned char *mm0, unsigned char *pp0); - void dvbt_viterbi_butterfly2_generic(unsigned char *symbols, unsigned char m0[], unsigned char m1[], unsigned char p0[], unsigned char p1[]); - unsigned char dvbt_viterbi_get_output_generic(unsigned char *mm0, unsigned char *pp0, int ntraceback, unsigned char *outbuf); + void dvbt_viterbi_chunks_init_generic(unsigned char* mm0, unsigned char* pp0); + void dvbt_viterbi_butterfly2_generic(unsigned char* symbols, + unsigned char m0[], + unsigned char m1[], + unsigned char p0[], + unsigned char p1[]); + unsigned char dvbt_viterbi_get_output_generic(unsigned char* mm0, + unsigned char* pp0, + int ntraceback, + unsigned char* outbuf); #endif - public: - dvbt_viterbi_decoder_impl(dvb_constellation_t constellation, \ - dvbt_hierarchy_t hierarchy, dvb_code_rate_t coderate, int bsize); - ~dvbt_viterbi_decoder_impl(); +public: + dvbt_viterbi_decoder_impl(dvb_constellation_t constellation, + dvbt_hierarchy_t hierarchy, + dvb_code_rate_t coderate, + int bsize); + ~dvbt_viterbi_decoder_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_VITERBI_DECODER_IMPL_H */ - diff --git a/gr-dtv/lib/dvbt2/dvbt2_cellinterleaver_cc_impl.cc b/gr-dtv/lib/dvbt2/dvbt2_cellinterleaver_cc_impl.cc index ad401feed3..1e04e6c078 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_cellinterleaver_cc_impl.cc +++ b/gr-dtv/lib/dvbt2/dvbt2_cellinterleaver_cc_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,34 +26,41 @@ #include "dvbt2_cellinterleaver_cc_impl.h" namespace gr { - namespace dtv { +namespace dtv { - dvbt2_cellinterleaver_cc::sptr - dvbt2_cellinterleaver_cc::make(dvb_framesize_t framesize, dvb_constellation_t constellation, int fecblocks, int tiblocks) - { - return gnuradio::get_initial_sptr - (new dvbt2_cellinterleaver_cc_impl(framesize, constellation, fecblocks, tiblocks)); - } +dvbt2_cellinterleaver_cc::sptr +dvbt2_cellinterleaver_cc::make(dvb_framesize_t framesize, + dvb_constellation_t constellation, + int fecblocks, + int tiblocks) +{ + return gnuradio::get_initial_sptr( + new dvbt2_cellinterleaver_cc_impl(framesize, constellation, fecblocks, tiblocks)); +} - /* - * The private constructor - */ - dvbt2_cellinterleaver_cc_impl::dvbt2_cellinterleaver_cc_impl(dvb_framesize_t framesize, dvb_constellation_t constellation, int fecblocks, int tiblocks) - : gr::sync_block("dvbt2_cellinterleaver_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex))) - { - int max_states, xor_size, pn_mask, result, q = 0; - int lfsr = 0; - int logic11[2] = {0, 3}; - int logic12[2] = {0, 2}; - int logic13[4] = {0, 1, 4, 6}; - int logic14[6] = {0, 1, 4, 5, 9, 11}; - int logic15[4] = {0, 1, 2, 12}; - int *logic; - if (framesize == FECFRAME_NORMAL) { +/* + * The private constructor + */ +dvbt2_cellinterleaver_cc_impl::dvbt2_cellinterleaver_cc_impl( + dvb_framesize_t framesize, + dvb_constellation_t constellation, + int fecblocks, + int tiblocks) + : gr::sync_block("dvbt2_cellinterleaver_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) +{ + int max_states, xor_size, pn_mask, result, q = 0; + int lfsr = 0; + int logic11[2] = { 0, 3 }; + int logic12[2] = { 0, 2 }; + int logic13[4] = { 0, 1, 4, 6 }; + int logic14[6] = { 0, 1, 4, 5, 9, 11 }; + int logic15[4] = { 0, 1, 2, 12 }; + int* logic; + if (framesize == FECFRAME_NORMAL) { switch (constellation) { - case MOD_QPSK: + case MOD_QPSK: cell_size = 32400; pn_degree = 15; pn_mask = 0x3fff; @@ -61,7 +68,7 @@ namespace gr { logic = &logic15[0]; xor_size = 4; break; - case MOD_16QAM: + case MOD_16QAM: cell_size = 16200; pn_degree = 14; pn_mask = 0x1fff; @@ -69,7 +76,7 @@ namespace gr { logic = &logic14[0]; xor_size = 6; break; - case MOD_64QAM: + case MOD_64QAM: cell_size = 10800; pn_degree = 14; pn_mask = 0x1fff; @@ -77,7 +84,7 @@ namespace gr { logic = &logic14[0]; xor_size = 6; break; - case MOD_256QAM: + case MOD_256QAM: cell_size = 8100; pn_degree = 13; pn_mask = 0xfff; @@ -85,7 +92,7 @@ namespace gr { logic = &logic13[0]; xor_size = 4; break; - default: + default: cell_size = 32400; pn_degree = 15; pn_mask = 0x3fff; @@ -94,10 +101,9 @@ namespace gr { xor_size = 4; break; } - } - else { + } else { switch (constellation) { - case MOD_QPSK: + case MOD_QPSK: cell_size = 8100; pn_degree = 13; pn_mask = 0xfff; @@ -105,7 +111,7 @@ namespace gr { logic = &logic13[0]; xor_size = 4; break; - case MOD_16QAM: + case MOD_16QAM: cell_size = 4050; pn_degree = 12; pn_mask = 0x7ff; @@ -113,7 +119,7 @@ namespace gr { logic = &logic12[0]; xor_size = 2; break; - case MOD_64QAM: + case MOD_64QAM: cell_size = 2700; pn_degree = 12; pn_mask = 0x7ff; @@ -121,7 +127,7 @@ namespace gr { logic = &logic12[0]; xor_size = 2; break; - case MOD_256QAM: + case MOD_256QAM: cell_size = 2025; pn_degree = 11; pn_mask = 0x3ff; @@ -129,7 +135,7 @@ namespace gr { logic = &logic11[0]; xor_size = 2; break; - default: + default: cell_size = 8100; pn_degree = 13; pn_mask = 0xfff; @@ -138,139 +144,134 @@ namespace gr { xor_size = 4; break; } - } - for (int i = 0; i < max_states; i++) { + } + for (int i = 0; i < max_states; i++) { if (i == 0 || i == 1) { - lfsr = 0; - } - else if (i == 2) { - lfsr = 1; - } - else { - result = 0; - for (int k = 0; k < xor_size; k++) { - result ^= (lfsr >> logic[k]) & 1; - } - lfsr &= pn_mask; - lfsr >>= 1; - lfsr |= result << (pn_degree - 2); + lfsr = 0; + } else if (i == 2) { + lfsr = 1; + } else { + result = 0; + for (int k = 0; k < xor_size; k++) { + result ^= (lfsr >> logic[k]) & 1; + } + lfsr &= pn_mask; + lfsr >>= 1; + lfsr |= result << (pn_degree - 2); } lfsr |= (i % 2) << (pn_degree - 1); if (lfsr < cell_size) { - permutations[q++] = lfsr; + permutations[q++] = lfsr; } - } - if (tiblocks == 0) { + } + if (tiblocks == 0) { FECBlocksPerSmallTIBlock = 1; FECBlocksPerBigTIBlock = 1; numBigTIBlocks = 0; numSmallTIBlocks = fecblocks; - } - else { + } else { FECBlocksPerSmallTIBlock = floor(((float)fecblocks) / ((float)tiblocks)); FECBlocksPerBigTIBlock = ceil(((float)fecblocks) / ((float)tiblocks)); numBigTIBlocks = fecblocks % tiblocks; numSmallTIBlocks = tiblocks - numBigTIBlocks; - } - time_interleave = (gr_complex *) malloc(sizeof(gr_complex) * cell_size * fecblocks); - if (time_interleave == NULL) { - GR_LOG_FATAL(d_logger, "Cell/Time Interleaver, cannot allocate memory for time_interleave."); + } + time_interleave = (gr_complex*)malloc(sizeof(gr_complex) * cell_size * fecblocks); + if (time_interleave == NULL) { + GR_LOG_FATAL( + d_logger, + "Cell/Time Interleaver, cannot allocate memory for time_interleave."); throw std::bad_alloc(); - } - cols = (gr_complex **) malloc(sizeof(gr_complex *) * FECBlocksPerBigTIBlock * 5); - if (cols == NULL) { + } + cols = (gr_complex**)malloc(sizeof(gr_complex*) * FECBlocksPerBigTIBlock * 5); + if (cols == NULL) { free(time_interleave); GR_LOG_FATAL(d_logger, "Cell/Time Interleaver, cannot allocate memory for cols."); throw std::bad_alloc(); - } - ti_blocks = tiblocks; - fec_blocks = fecblocks; - set_output_multiple(cell_size * fecblocks); - interleaved_items = cell_size * fecblocks; } + ti_blocks = tiblocks; + fec_blocks = fecblocks; + set_output_multiple(cell_size * fecblocks); + interleaved_items = cell_size * fecblocks; +} - /* - * Our virtual destructor. - */ - dvbt2_cellinterleaver_cc_impl::~dvbt2_cellinterleaver_cc_impl() - { - free(cols); - free(time_interleave); - } +/* + * Our virtual destructor. + */ +dvbt2_cellinterleaver_cc_impl::~dvbt2_cellinterleaver_cc_impl() +{ + free(cols); + free(time_interleave); +} - int - dvbt2_cellinterleaver_cc_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - int FECBlocksPerTIBlock, n, shift, temp, index, rows, numCols, ti_index; +int dvbt2_cellinterleaver_cc_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + gr_complex* out = (gr_complex*)output_items[0]; + int FECBlocksPerTIBlock, n, shift, temp, index, rows, numCols, ti_index; - for (int i = 0; i < noutput_items; i += interleaved_items) { + for (int i = 0; i < noutput_items; i += interleaved_items) { index = 0; for (int s = 0; s < numSmallTIBlocks + numBigTIBlocks; s++) { - n = 0; - if (s < numSmallTIBlocks) { - FECBlocksPerTIBlock = FECBlocksPerSmallTIBlock; - } - else { - FECBlocksPerTIBlock = FECBlocksPerBigTIBlock; - } - for (int r = 0; r < FECBlocksPerTIBlock; r++) { - shift = cell_size; - while (shift >= cell_size) { - temp = n; - shift = 0; - for (int p = 0; p < pn_degree; p++) { - shift |= temp & 1; - shift <<= 1; - temp >>= 1; - } - n++; + n = 0; + if (s < numSmallTIBlocks) { + FECBlocksPerTIBlock = FECBlocksPerSmallTIBlock; + } else { + FECBlocksPerTIBlock = FECBlocksPerBigTIBlock; } - for (int w = 0; w < cell_size; w++) { - time_interleave[((permutations[w] + shift) % cell_size) + index] = *in++; + for (int r = 0; r < FECBlocksPerTIBlock; r++) { + shift = cell_size; + while (shift >= cell_size) { + temp = n; + shift = 0; + for (int p = 0; p < pn_degree; p++) { + shift |= temp & 1; + shift <<= 1; + temp >>= 1; + } + n++; + } + for (int w = 0; w < cell_size; w++) { + time_interleave[((permutations[w] + shift) % cell_size) + index] = + *in++; + } + index += cell_size; } - index += cell_size; - } } if (ti_blocks != 0) { - ti_index = 0; - for (int s = 0; s < numSmallTIBlocks + numBigTIBlocks; s++) { - if (s < numSmallTIBlocks) { - FECBlocksPerTIBlock = FECBlocksPerSmallTIBlock; - } - else { - FECBlocksPerTIBlock = FECBlocksPerBigTIBlock; - } - numCols = 5 * FECBlocksPerTIBlock; - rows = cell_size / 5; - for (int j = 0; j < numCols; j++) { - cols[j] = &time_interleave[(rows * j) + ti_index]; + ti_index = 0; + for (int s = 0; s < numSmallTIBlocks + numBigTIBlocks; s++) { + if (s < numSmallTIBlocks) { + FECBlocksPerTIBlock = FECBlocksPerSmallTIBlock; + } else { + FECBlocksPerTIBlock = FECBlocksPerBigTIBlock; + } + numCols = 5 * FECBlocksPerTIBlock; + rows = cell_size / 5; + for (int j = 0; j < numCols; j++) { + cols[j] = &time_interleave[(rows * j) + ti_index]; + } + index = 0; + for (int k = 0; k < rows; k++) { + for (int w = 0; w < numCols; w++) { + *out++ = *(cols[w] + index); + } + index++; + } + ti_index += rows * numCols; } + } else { index = 0; - for (int k = 0; k < rows; k++) { - for (int w = 0; w < numCols; w++) { - *out++ = *(cols[w] + index); - } - index++; + for (int w = 0; w < fec_blocks * cell_size; w++) { + *out++ = time_interleave[index++]; } - ti_index += rows * numCols; - } } - else { - index = 0; - for (int w = 0; w < fec_blocks * cell_size; w++) { - *out++ = time_interleave[index++]; - } - } - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ -} /* namespace gr */ + // Tell runtime system how many output items we produced. + return noutput_items; +} +} /* namespace dtv */ +} /* namespace gr */ diff --git a/gr-dtv/lib/dvbt2/dvbt2_cellinterleaver_cc_impl.h b/gr-dtv/lib/dvbt2/dvbt2_cellinterleaver_cc_impl.h index 233c805096..cce442a527 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_cellinterleaver_cc_impl.h +++ b/gr-dtv/lib/dvbt2/dvbt2_cellinterleaver_cc_impl.h @@ -26,34 +26,37 @@ #include <gnuradio/dtv/dvbt2_cellinterleaver_cc.h> namespace gr { - namespace dtv { - - class dvbt2_cellinterleaver_cc_impl : public dvbt2_cellinterleaver_cc - { - private: - int cell_size; - int pn_degree; - int ti_blocks; - int fec_blocks; - int permutations[32768]; - int FECBlocksPerSmallTIBlock; - int FECBlocksPerBigTIBlock; - int numBigTIBlocks; - int numSmallTIBlocks; - int interleaved_items; - gr_complex *time_interleave; - gr_complex **cols; - - public: - dvbt2_cellinterleaver_cc_impl(dvb_framesize_t framesize, dvb_constellation_t constellation, int fecblocks, int tiblocks); - ~dvbt2_cellinterleaver_cc_impl(); - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class dvbt2_cellinterleaver_cc_impl : public dvbt2_cellinterleaver_cc +{ +private: + int cell_size; + int pn_degree; + int ti_blocks; + int fec_blocks; + int permutations[32768]; + int FECBlocksPerSmallTIBlock; + int FECBlocksPerBigTIBlock; + int numBigTIBlocks; + int numSmallTIBlocks; + int interleaved_items; + gr_complex* time_interleave; + gr_complex** cols; + +public: + dvbt2_cellinterleaver_cc_impl(dvb_framesize_t framesize, + dvb_constellation_t constellation, + int fecblocks, + int tiblocks); + ~dvbt2_cellinterleaver_cc_impl(); + + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_CELLINTERLEAVER_CC_IMPL_H */ diff --git a/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.cc b/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.cc index 2ddf0dd647..a567ec7929 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.cc +++ b/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015-2017,2019 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,1793 +27,1821 @@ #include <algorithm> namespace gr { - namespace dtv { +namespace dtv { - dvbt2_framemapper_cc::sptr - dvbt2_framemapper_cc::make(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation, dvbt2_rotation_t rotation, int fecblocks, int tiblocks, dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvb_guardinterval_t guardinterval, dvbt2_l1constellation_t l1constellation, dvbt2_pilotpattern_t pilotpattern, int t2frames, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, dvbt2_preamble_t preamble, dvbt2_inputmode_t inputmode, dvbt2_reservedbiasbits_t reservedbiasbits, dvbt2_l1scrambled_t l1scrambled, dvbt2_inband_t inband) - { - return gnuradio::get_initial_sptr - (new dvbt2_framemapper_cc_impl(framesize, rate, constellation, rotation, fecblocks, tiblocks, carriermode, fftsize, guardinterval, l1constellation, pilotpattern, t2frames, numdatasyms, paprmode, version, preamble, inputmode, reservedbiasbits, l1scrambled, inband)); - } +dvbt2_framemapper_cc::sptr +dvbt2_framemapper_cc::make(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation, + dvbt2_rotation_t rotation, + int fecblocks, + int tiblocks, + dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvb_guardinterval_t guardinterval, + dvbt2_l1constellation_t l1constellation, + dvbt2_pilotpattern_t pilotpattern, + int t2frames, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + dvbt2_preamble_t preamble, + dvbt2_inputmode_t inputmode, + dvbt2_reservedbiasbits_t reservedbiasbits, + dvbt2_l1scrambled_t l1scrambled, + dvbt2_inband_t inband) +{ + return gnuradio::get_initial_sptr(new dvbt2_framemapper_cc_impl(framesize, + rate, + constellation, + rotation, + fecblocks, + tiblocks, + carriermode, + fftsize, + guardinterval, + l1constellation, + pilotpattern, + t2frames, + numdatasyms, + paprmode, + version, + preamble, + inputmode, + reservedbiasbits, + l1scrambled, + inband)); +} - /* - * The private constructor - */ - dvbt2_framemapper_cc_impl::dvbt2_framemapper_cc_impl(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation, dvbt2_rotation_t rotation, int fecblocks, int tiblocks, dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvb_guardinterval_t guardinterval, dvbt2_l1constellation_t l1constellation, dvbt2_pilotpattern_t pilotpattern, int t2frames, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, dvbt2_preamble_t preamble, dvbt2_inputmode_t inputmode, dvbt2_reservedbiasbits_t reservedbiasbits, dvbt2_l1scrambled_t l1scrambled, dvbt2_inband_t inband) - : gr::block("dvbt2_framemapper_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex))) - { - L1Pre *l1preinit = &L1_Signalling[0].l1pre_data; - L1Post *l1postinit = &L1_Signalling[0].l1post_data; - double normalization; - double m_16qam_lookup[4] = {3.0, 1.0, -3.0, -1.0}; - double m_64qam_lookup[8] = {7.0, 5.0, 1.0, 3.0, -7.0, -5.0, -1.0, -3.0}; - int real_index, imag_index; - int N_punc_temp, N_post_temp; - if (framesize == FECFRAME_NORMAL) { +/* + * The private constructor + */ +dvbt2_framemapper_cc_impl::dvbt2_framemapper_cc_impl( + dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation, + dvbt2_rotation_t rotation, + int fecblocks, + int tiblocks, + dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvb_guardinterval_t guardinterval, + dvbt2_l1constellation_t l1constellation, + dvbt2_pilotpattern_t pilotpattern, + int t2frames, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + dvbt2_preamble_t preamble, + dvbt2_inputmode_t inputmode, + dvbt2_reservedbiasbits_t reservedbiasbits, + dvbt2_l1scrambled_t l1scrambled, + dvbt2_inband_t inband) + : gr::block("dvbt2_framemapper_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) +{ + L1Pre* l1preinit = &L1_Signalling[0].l1pre_data; + L1Post* l1postinit = &L1_Signalling[0].l1post_data; + double normalization; + double m_16qam_lookup[4] = { 3.0, 1.0, -3.0, -1.0 }; + double m_64qam_lookup[8] = { 7.0, 5.0, 1.0, 3.0, -7.0, -5.0, -1.0, -3.0 }; + int real_index, imag_index; + int N_punc_temp, N_post_temp; + if (framesize == FECFRAME_NORMAL) { switch (constellation) { - case MOD_QPSK: + case MOD_QPSK: cell_size = 32400; break; - case MOD_16QAM: + case MOD_16QAM: cell_size = 16200; break; - case MOD_64QAM: + case MOD_64QAM: cell_size = 10800; break; - case MOD_256QAM: + case MOD_256QAM: cell_size = 8100; break; - default: + default: cell_size = 0; break; } - } - else { + } else { switch (constellation) { - case MOD_QPSK: + case MOD_QPSK: cell_size = 8100; break; - case MOD_16QAM: + case MOD_16QAM: cell_size = 4050; break; - case MOD_64QAM: + case MOD_64QAM: cell_size = 2700; break; - case MOD_256QAM: + case MOD_256QAM: cell_size = 2025; break; - default: + default: cell_size = 0; break; } - } - l1preinit->type = STREAMTYPE_TS; - l1preinit->bwt_ext = carriermode; - fft_size = fftsize; - l1preinit->s1 = preamble; - l1preinit->s2 = fft_size & 0x7; - l1preinit->l1_repetition_flag = FALSE; - l1preinit->guard_interval = guardinterval; - l1preinit->papr = paprmode; - l1preinit->l1_mod = l1constellation; - l1preinit->l1_cod = 0; - l1preinit->l1_fec_type = 0; - l1preinit->l1_post_info_size = KSIG_POST - 32; - l1preinit->pilot_pattern = pilotpattern; - l1preinit->tx_id_availability = 0; - l1preinit->cell_id = 0; - l1preinit->network_id = 0x3085; - l1preinit->t2_system_id = 0x8001; - l1preinit->num_t2_frames = t2frames; - l1preinit->num_data_symbols = numdatasyms; - l1preinit->regen_flag = FALSE; - l1preinit->l1_post_extension = FALSE; - l1preinit->num_rf = 1; - l1preinit->current_rf_index = 0; - l1preinit->t2_version = version; - if (version == VERSION_131) { + } + l1preinit->type = STREAMTYPE_TS; + l1preinit->bwt_ext = carriermode; + fft_size = fftsize; + l1preinit->s1 = preamble; + l1preinit->s2 = fft_size & 0x7; + l1preinit->l1_repetition_flag = FALSE; + l1preinit->guard_interval = guardinterval; + l1preinit->papr = paprmode; + l1preinit->l1_mod = l1constellation; + l1preinit->l1_cod = 0; + l1preinit->l1_fec_type = 0; + l1preinit->l1_post_info_size = KSIG_POST - 32; + l1preinit->pilot_pattern = pilotpattern; + l1preinit->tx_id_availability = 0; + l1preinit->cell_id = 0; + l1preinit->network_id = 0x3085; + l1preinit->t2_system_id = 0x8001; + l1preinit->num_t2_frames = t2frames; + l1preinit->num_data_symbols = numdatasyms; + l1preinit->regen_flag = FALSE; + l1preinit->l1_post_extension = FALSE; + l1preinit->num_rf = 1; + l1preinit->current_rf_index = 0; + l1preinit->t2_version = version; + if (version == VERSION_131) { l1preinit->l1_post_scrambled = l1scrambled; - } - else { + } else { l1preinit->l1_post_scrambled = FALSE; - } - l1preinit->t2_base_lite = FALSE; - if (reservedbiasbits == RESERVED_ON && version == VERSION_131) { + } + l1preinit->t2_base_lite = FALSE; + if (reservedbiasbits == RESERVED_ON && version == VERSION_131) { l1preinit->reserved = 0xf; - } - else { + } else { l1preinit->reserved = 0x0; - } + } - l1postinit->sub_slices_per_frame = 1; - l1postinit->num_plp = 1; - l1postinit->num_aux = 0; - l1postinit->aux_config_rfu = 0; - l1postinit->rf_idx = 0; - l1postinit->frequency = 729833333; - l1postinit->plp_id = 0; - l1postinit->plp_type = 1; - l1postinit->plp_payload_type = 3; - l1postinit->ff_flag = 0; - l1postinit->first_rf_idx = 0; - l1postinit->first_frame_idx = 0; - l1postinit->plp_group_id = 1; - switch (rate) { - case C1_3: - l1postinit->plp_cod = 6; - break; - case C2_5: - l1postinit->plp_cod = 7; - break; - case C1_2: - l1postinit->plp_cod = 0; - break; - case C3_5: - l1postinit->plp_cod = 1; - break; - case C2_3: - l1postinit->plp_cod = 2; - break; - case C3_4: - l1postinit->plp_cod = 3; - break; - case C4_5: - l1postinit->plp_cod = 4; - break; - case C5_6: - l1postinit->plp_cod = 5; - break; - default: - l1postinit->plp_cod = 0; - break; - } - l1postinit->plp_mod = constellation; - l1postinit->plp_rotation = rotation; - l1postinit->plp_fec_type = framesize; - l1postinit->plp_num_blocks_max = fecblocks; - l1postinit->frame_interval = 1; - l1postinit->time_il_length = tiblocks; - l1postinit->time_il_type = 0; - l1postinit->in_band_a_flag = 0; - if (inband == INBAND_ON && version == VERSION_131) { + l1postinit->sub_slices_per_frame = 1; + l1postinit->num_plp = 1; + l1postinit->num_aux = 0; + l1postinit->aux_config_rfu = 0; + l1postinit->rf_idx = 0; + l1postinit->frequency = 729833333; + l1postinit->plp_id = 0; + l1postinit->plp_type = 1; + l1postinit->plp_payload_type = 3; + l1postinit->ff_flag = 0; + l1postinit->first_rf_idx = 0; + l1postinit->first_frame_idx = 0; + l1postinit->plp_group_id = 1; + switch (rate) { + case C1_3: + l1postinit->plp_cod = 6; + break; + case C2_5: + l1postinit->plp_cod = 7; + break; + case C1_2: + l1postinit->plp_cod = 0; + break; + case C3_5: + l1postinit->plp_cod = 1; + break; + case C2_3: + l1postinit->plp_cod = 2; + break; + case C3_4: + l1postinit->plp_cod = 3; + break; + case C4_5: + l1postinit->plp_cod = 4; + break; + case C5_6: + l1postinit->plp_cod = 5; + break; + default: + l1postinit->plp_cod = 0; + break; + } + l1postinit->plp_mod = constellation; + l1postinit->plp_rotation = rotation; + l1postinit->plp_fec_type = framesize; + l1postinit->plp_num_blocks_max = fecblocks; + l1postinit->frame_interval = 1; + l1postinit->time_il_length = tiblocks; + l1postinit->time_il_type = 0; + l1postinit->in_band_a_flag = 0; + if (inband == INBAND_ON && version == VERSION_131) { l1postinit->in_band_b_flag = 1; - } - else { + } else { l1postinit->in_band_b_flag = 0; - } - if (reservedbiasbits == RESERVED_ON && version == VERSION_131) { + } + if (reservedbiasbits == RESERVED_ON && version == VERSION_131) { l1postinit->reserved_1 = 0x7ff; - } - else { + } else { l1postinit->reserved_1 = 0x0; - } - if (version == VERSION_111) { + } + if (version == VERSION_111) { l1postinit->plp_mode = 0; - } - else { + } else { l1postinit->plp_mode = inputmode + 1; - } - l1postinit->static_flag = 0; - l1postinit->static_padding_flag = 0; - l1postinit->fef_length_msb = 0; - if (reservedbiasbits == RESERVED_ON && version == VERSION_131) { + } + l1postinit->static_flag = 0; + l1postinit->static_padding_flag = 0; + l1postinit->fef_length_msb = 0; + if (reservedbiasbits == RESERVED_ON && version == VERSION_131) { l1postinit->reserved_2 = 0x3fffffff; - } - else { + } else { l1postinit->reserved_2 = 0; - } - l1postinit->frame_idx = 0; - l1postinit->sub_slice_interval = 0; - l1postinit->type_2_start = 0; - l1postinit->l1_change_counter = 0; - l1postinit->start_rf_idx = 0; - if (reservedbiasbits == RESERVED_ON && version == VERSION_131) { + } + l1postinit->frame_idx = 0; + l1postinit->sub_slice_interval = 0; + l1postinit->type_2_start = 0; + l1postinit->l1_change_counter = 0; + l1postinit->start_rf_idx = 0; + if (reservedbiasbits == RESERVED_ON && version == VERSION_131) { l1postinit->reserved_3 = 0xff; - } - else { + } else { l1postinit->reserved_3 = 0; - } - l1postinit->plp_id = 0; - l1postinit->plp_start = 0; - l1postinit->plp_num_blocks = fecblocks; - if (reservedbiasbits == RESERVED_ON && version == VERSION_131) { + } + l1postinit->plp_id = 0; + l1postinit->plp_start = 0; + l1postinit->plp_num_blocks = fecblocks; + if (reservedbiasbits == RESERVED_ON && version == VERSION_131) { l1postinit->reserved_4 = 0xff; l1postinit->reserved_5 = 0xff; - } - else { + } else { l1postinit->reserved_4 = 0; l1postinit->reserved_5 = 0; - } + } - bch_poly_build_tables(); - l1pre_ldpc_lookup_generate(); - m_bpsk[0] = gr_complex( 1.0, 0.0); - m_bpsk[1] = gr_complex( -1.0, 0.0); - unmodulated = gr_complex( 0.0, 0.0); + bch_poly_build_tables(); + l1pre_ldpc_lookup_generate(); + m_bpsk[0] = gr_complex(1.0, 0.0); + m_bpsk[1] = gr_complex(-1.0, 0.0); + unmodulated = gr_complex(0.0, 0.0); - l1post_ldpc_lookup_generate(); - switch (l1constellation) { - case L1_MOD_BPSK: - eta_mod = 1; - break; - case L1_MOD_QPSK: - normalization = sqrt(2); - m_qpsk[0] = gr_complex( 1.0 / normalization, 1.0 / normalization); - m_qpsk[1] = gr_complex( 1.0 / normalization, -1.0 / normalization); - m_qpsk[2] = gr_complex(-1.0 / normalization, 1.0 / normalization); - m_qpsk[3] = gr_complex(-1.0 / normalization, -1.0 / normalization); - eta_mod = 2; - break; - case L1_MOD_16QAM: - normalization = sqrt(10); - for (int i = 0; i < 16; i++) { + l1post_ldpc_lookup_generate(); + switch (l1constellation) { + case L1_MOD_BPSK: + eta_mod = 1; + break; + case L1_MOD_QPSK: + normalization = sqrt(2); + m_qpsk[0] = gr_complex(1.0 / normalization, 1.0 / normalization); + m_qpsk[1] = gr_complex(1.0 / normalization, -1.0 / normalization); + m_qpsk[2] = gr_complex(-1.0 / normalization, 1.0 / normalization); + m_qpsk[3] = gr_complex(-1.0 / normalization, -1.0 / normalization); + eta_mod = 2; + break; + case L1_MOD_16QAM: + normalization = sqrt(10); + for (int i = 0; i < 16; i++) { real_index = ((i & 0x8) >> 2) | ((i & 0x2) >> 1); imag_index = ((i & 0x4) >> 1) | ((i & 0x1) >> 0); - m_16qam[i] = gr_complex(m_16qam_lookup[real_index] / normalization, m_16qam_lookup[imag_index] / normalization); - } - eta_mod = 4; - break; - case L1_MOD_64QAM: - normalization = sqrt(42); - for (int i = 0; i < 64; i++) { + m_16qam[i] = gr_complex(m_16qam_lookup[real_index] / normalization, + m_16qam_lookup[imag_index] / normalization); + } + eta_mod = 4; + break; + case L1_MOD_64QAM: + normalization = sqrt(42); + for (int i = 0; i < 64; i++) { real_index = ((i & 0x20) >> 3) | ((i & 0x8) >> 2) | ((i & 0x2) >> 1); imag_index = ((i & 0x10) >> 2) | ((i & 0x4) >> 1) | ((i & 0x1) >> 0); - m_64qam[i] = gr_complex(m_64qam_lookup[real_index] / normalization, m_64qam_lookup[imag_index] / normalization); - } - eta_mod = 6; - break; - } - N_P2 = 1; - C_P2 = 0; - N_FC = 0; - C_FC = 0; - C_DATA = 0; - if ((preamble == PREAMBLE_T2_SISO) || (preamble == PREAMBLE_T2_LITE_SISO)) { + m_64qam[i] = gr_complex(m_64qam_lookup[real_index] / normalization, + m_64qam_lookup[imag_index] / normalization); + } + eta_mod = 6; + break; + } + N_P2 = 1; + C_P2 = 0; + N_FC = 0; + C_FC = 0; + C_DATA = 0; + if ((preamble == PREAMBLE_T2_SISO) || (preamble == PREAMBLE_T2_LITE_SISO)) { switch (fft_size) { - case FFTSIZE_1K: + case FFTSIZE_1K: N_P2 = 16; C_P2 = 558; break; - case FFTSIZE_2K: + case FFTSIZE_2K: N_P2 = 8; C_P2 = 1118; break; - case FFTSIZE_4K: + case FFTSIZE_4K: N_P2 = 4; C_P2 = 2236; break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: N_P2 = 2; C_P2 = 4472; break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: N_P2 = 1; C_P2 = 8944; break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: N_P2 = 1; C_P2 = 22432; break; } - } - else { + } else { switch (fft_size) { - case FFTSIZE_1K: + case FFTSIZE_1K: N_P2 = 16; C_P2 = 546; break; - case FFTSIZE_2K: + case FFTSIZE_2K: N_P2 = 8; C_P2 = 1098; break; - case FFTSIZE_4K: + case FFTSIZE_4K: N_P2 = 4; C_P2 = 2198; break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: N_P2 = 2; C_P2 = 4398; break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: N_P2 = 1; C_P2 = 8814; break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: N_P2 = 1; C_P2 = 17612; break; } - } - switch (fft_size) { - case FFTSIZE_1K: - switch (pilotpattern) { - case PILOT_PP1: - C_DATA = 764; - N_FC = 568; - C_FC = 402; - break; - case PILOT_PP2: - C_DATA = 768; - N_FC = 710; - C_FC = 654; - break; - case PILOT_PP3: - C_DATA = 798; - N_FC = 710; - C_FC = 490; - break; - case PILOT_PP4: - C_DATA = 804; - N_FC = 780; - C_FC = 707; - break; - case PILOT_PP5: - C_DATA = 818; - N_FC = 780; - C_FC = 544; - break; - case PILOT_PP6: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP7: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP8: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + switch (fft_size) { + case FFTSIZE_1K: + switch (pilotpattern) { + case PILOT_PP1: + C_DATA = 764; + N_FC = 568; + C_FC = 402; + break; + case PILOT_PP2: + C_DATA = 768; + N_FC = 710; + C_FC = 654; + break; + case PILOT_PP3: + C_DATA = 798; + N_FC = 710; + C_FC = 490; + break; + case PILOT_PP4: + C_DATA = 804; + N_FC = 780; + C_FC = 707; + break; + case PILOT_PP5: + C_DATA = 818; + N_FC = 780; + C_FC = 544; + break; + case PILOT_PP6: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP7: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP8: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 10; + C_DATA -= 10; } if (N_FC != 0) { - N_FC -= 10; + N_FC -= 10; } if (C_FC != 0) { - C_FC -= 10; + C_FC -= 10; } - } - break; - case FFTSIZE_2K: - switch (pilotpattern) { - case PILOT_PP1: - C_DATA = 1522; - N_FC = 1136; - C_FC = 804; - break; - case PILOT_PP2: - C_DATA = 1532; - N_FC = 1420; - C_FC = 1309; - break; - case PILOT_PP3: - C_DATA = 1596; - N_FC = 1420; - C_FC = 980; - break; - case PILOT_PP4: - C_DATA = 1602; - N_FC = 1562; - C_FC = 1415; - break; - case PILOT_PP5: - C_DATA = 1632; - N_FC = 1562; - C_FC = 1088; - break; - case PILOT_PP6: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP7: - C_DATA = 1646; - N_FC = 1632; - C_FC = 1396; - break; - case PILOT_PP8: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + break; + case FFTSIZE_2K: + switch (pilotpattern) { + case PILOT_PP1: + C_DATA = 1522; + N_FC = 1136; + C_FC = 804; + break; + case PILOT_PP2: + C_DATA = 1532; + N_FC = 1420; + C_FC = 1309; + break; + case PILOT_PP3: + C_DATA = 1596; + N_FC = 1420; + C_FC = 980; + break; + case PILOT_PP4: + C_DATA = 1602; + N_FC = 1562; + C_FC = 1415; + break; + case PILOT_PP5: + C_DATA = 1632; + N_FC = 1562; + C_FC = 1088; + break; + case PILOT_PP6: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP7: + C_DATA = 1646; + N_FC = 1632; + C_FC = 1396; + break; + case PILOT_PP8: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 18; + C_DATA -= 18; } if (N_FC != 0) { - N_FC -= 18; + N_FC -= 18; } if (C_FC != 0) { - C_FC -= 18; + C_FC -= 18; } - } - break; - case FFTSIZE_4K: - switch (pilotpattern) { - case PILOT_PP1: - C_DATA = 3084; - N_FC = 2272; - C_FC = 1609; - break; - case PILOT_PP2: - C_DATA = 3092; - N_FC = 2840; - C_FC = 2619; - break; - case PILOT_PP3: - C_DATA = 3228; - N_FC = 2840; - C_FC = 1961; - break; - case PILOT_PP4: - C_DATA = 3234; - N_FC = 3124; - C_FC = 2831; - break; - case PILOT_PP5: - C_DATA = 3298; - N_FC = 3124; - C_FC = 2177; - break; - case PILOT_PP6: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP7: - C_DATA = 3328; - N_FC = 3266; - C_FC = 2792; - break; - case PILOT_PP8: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + break; + case FFTSIZE_4K: + switch (pilotpattern) { + case PILOT_PP1: + C_DATA = 3084; + N_FC = 2272; + C_FC = 1609; + break; + case PILOT_PP2: + C_DATA = 3092; + N_FC = 2840; + C_FC = 2619; + break; + case PILOT_PP3: + C_DATA = 3228; + N_FC = 2840; + C_FC = 1961; + break; + case PILOT_PP4: + C_DATA = 3234; + N_FC = 3124; + C_FC = 2831; + break; + case PILOT_PP5: + C_DATA = 3298; + N_FC = 3124; + C_FC = 2177; + break; + case PILOT_PP6: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP7: + C_DATA = 3328; + N_FC = 3266; + C_FC = 2792; + break; + case PILOT_PP8: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 36; + C_DATA -= 36; } if (N_FC != 0) { - N_FC -= 36; + N_FC -= 36; } if (C_FC != 0) { - C_FC -= 36; + C_FC -= 36; } - } - break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 6208; N_FC = 4544; C_FC = 3218; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 6214; N_FC = 5680; C_FC = 5238; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 6494; N_FC = 5680; C_FC = 3922; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 6498; N_FC = 6248; C_FC = 5662; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 6634; N_FC = 6248; C_FC = 4354; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 6698; N_FC = 6532; C_FC = 5585; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 6698; N_FC = 0; C_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 6296; N_FC = 4608; C_FC = 3264; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 6298; N_FC = 5760; C_FC = 5312; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 6584; N_FC = 5760; C_FC = 3978; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 6588; N_FC = 6336; C_FC = 5742; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 6728; N_FC = 6336; C_FC = 4416; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 6788; N_FC = 6624; C_FC = 5664; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 6788; N_FC = 0; C_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 72; + C_DATA -= 72; } if (N_FC != 0) { - N_FC -= 72; + N_FC -= 72; } if (C_FC != 0) { - C_FC -= 72; + C_FC -= 72; } - } - break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 12418; N_FC = 9088; C_FC = 6437; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 12436; N_FC = 11360; C_FC = 10476; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 12988; N_FC = 11360; C_FC = 7845; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 13002; N_FC = 12496; C_FC = 11324; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 13272; N_FC = 12496; C_FC = 8709; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 13288; N_FC = 13064; C_FC = 11801; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 13416; N_FC = 13064; C_FC = 11170; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 13406; N_FC = 0; C_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 12678; N_FC = 9280; C_FC = 6573; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 12698; N_FC = 11600; C_FC = 10697; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 13262; N_FC = 11600; C_FC = 8011; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 13276; N_FC = 12760; C_FC = 11563; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 13552; N_FC = 12760; C_FC = 8893; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 13568; N_FC = 13340; C_FC = 12051; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 13698; N_FC = 13340; C_FC = 11406; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 13688; N_FC = 0; C_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 144; + C_DATA -= 144; } if (N_FC != 0) { - N_FC -= 144; + N_FC -= 144; } if (C_FC != 0) { - C_FC -= 144; + C_FC -= 144; } - } - break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 24886; N_FC = 22720; C_FC = 20952; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 26022; N_FC = 24992; C_FC = 22649; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 26592; N_FC = 26128; C_FC = 23603; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 26836; N_FC = 0; C_FC = 0; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 26812; N_FC = 0; C_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 25412; N_FC = 23200; C_FC = 21395; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 26572; N_FC = 25520; C_FC = 23127; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 27152; N_FC = 26680; C_FC = 24102; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 27404; N_FC = 0; C_FC = 0; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 27376; N_FC = 0; C_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 288; + C_DATA -= 288; } if (N_FC != 0) { - N_FC -= 288; + N_FC -= 288; } if (C_FC != 0) { - C_FC -= 288; + C_FC -= 288; } - } - break; - } - if ((preamble == PREAMBLE_T2_SISO) || (preamble == PREAMBLE_T2_LITE_SISO)) { + } + break; + } + if ((preamble == PREAMBLE_T2_SISO) || (preamble == PREAMBLE_T2_LITE_SISO)) { if (guardinterval == GI_1_128 && pilotpattern == PILOT_PP7) { - N_FC = 0; - C_FC = 0; + N_FC = 0; + C_FC = 0; } if (guardinterval == GI_1_32 && pilotpattern == PILOT_PP4) { - N_FC = 0; - C_FC = 0; + N_FC = 0; + C_FC = 0; } if (guardinterval == GI_1_16 && pilotpattern == PILOT_PP2) { - N_FC = 0; - C_FC = 0; + N_FC = 0; + C_FC = 0; } if (guardinterval == GI_19_256 && pilotpattern == PILOT_PP2) { - N_FC = 0; - C_FC = 0; + N_FC = 0; + C_FC = 0; } - } - N_punc_temp = (6 * (KBCH_1_2 - KSIG_POST)) / 5; - N_post_temp = KSIG_POST + NBCH_PARITY + 9000 - N_punc_temp; - if (N_P2 == 1) { + } + N_punc_temp = (6 * (KBCH_1_2 - KSIG_POST)) / 5; + N_post_temp = KSIG_POST + NBCH_PARITY + 9000 - N_punc_temp; + if (N_P2 == 1) { N_post = ceil((float)N_post_temp / (2 * (float)eta_mod)) * 2 * eta_mod; - } - else { - N_post = ceil((float)N_post_temp / ((float)eta_mod * (float)N_P2)) * eta_mod * N_P2; - } - N_punc = N_punc_temp - (N_post - N_post_temp); - l1preinit->l1_post_size = N_post / eta_mod; - add_l1pre(&l1pre_cache[0]); - l1_constellation = l1constellation; - t2_frames = t2frames; - t2_frame_num = 0; - if (version == VERSION_131) { + } else { + N_post = + ceil((float)N_post_temp / ((float)eta_mod * (float)N_P2)) * eta_mod * N_P2; + } + N_punc = N_punc_temp - (N_post - N_post_temp); + l1preinit->l1_post_size = N_post / eta_mod; + add_l1pre(&l1pre_cache[0]); + l1_constellation = l1constellation; + t2_frames = t2frames; + t2_frame_num = 0; + if (version == VERSION_131) { l1_scrambled = l1scrambled; - } - else { + } else { l1_scrambled = FALSE; - } - stream_items = cell_size * fecblocks; - if (N_FC == 0) { + } + stream_items = cell_size * fecblocks; + if (N_FC == 0) { set_output_multiple((N_P2 * C_P2) + (numdatasyms * C_DATA)); mapped_items = (N_P2 * C_P2) + (numdatasyms * C_DATA); if (mapped_items < (stream_items + 1840 + (N_post / eta_mod) + (N_FC - C_FC))) { - GR_LOG_WARN(d_logger, "Frame Mapper, too many FEC blocks in T2 frame."); - mapped_items = stream_items + 1840 + (N_post / eta_mod) + (N_FC - C_FC); /* avoid segfault */ + GR_LOG_WARN(d_logger, "Frame Mapper, too many FEC blocks in T2 frame."); + mapped_items = stream_items + 1840 + (N_post / eta_mod) + + (N_FC - C_FC); /* avoid segfault */ } - zigzag_interleave = (gr_complex *) malloc(sizeof(gr_complex) * mapped_items); + zigzag_interleave = (gr_complex*)malloc(sizeof(gr_complex) * mapped_items); if (zigzag_interleave == NULL) { - GR_LOG_FATAL(d_logger, "Frame Mapper, cannot allocate memory for zigzag_interleave."); - throw std::bad_alloc(); + GR_LOG_FATAL(d_logger, + "Frame Mapper, cannot allocate memory for zigzag_interleave."); + throw std::bad_alloc(); } - } - else { + } else { set_output_multiple((N_P2 * C_P2) + ((numdatasyms - 1) * C_DATA) + N_FC); mapped_items = (N_P2 * C_P2) + ((numdatasyms - 1) * C_DATA) + N_FC; if (mapped_items < (stream_items + 1840 + (N_post / eta_mod) + (N_FC - C_FC))) { - GR_LOG_WARN(d_logger, "Frame Mapper, too many FEC blocks in T2 frame."); - mapped_items = stream_items + 1840 + (N_post / eta_mod) + (N_FC - C_FC); /* avoid segfault */ + GR_LOG_WARN(d_logger, "Frame Mapper, too many FEC blocks in T2 frame."); + mapped_items = stream_items + 1840 + (N_post / eta_mod) + + (N_FC - C_FC); /* avoid segfault */ } - zigzag_interleave = (gr_complex *) malloc(sizeof(gr_complex) * mapped_items); + zigzag_interleave = (gr_complex*)malloc(sizeof(gr_complex) * mapped_items); if (zigzag_interleave == NULL) { - GR_LOG_FATAL(d_logger, "Frame Mapper, cannot allocate memory for zigzag_interleave."); - throw std::bad_alloc(); + GR_LOG_FATAL(d_logger, + "Frame Mapper, cannot allocate memory for zigzag_interleave."); + throw std::bad_alloc(); } - } - dummy_randomize = (gr_complex *) malloc(sizeof(gr_complex) * mapped_items - stream_items - 1840 - (N_post / eta_mod) - (N_FC - C_FC)); - if (dummy_randomize == NULL) { + } + dummy_randomize = + (gr_complex*)malloc(sizeof(gr_complex) * mapped_items - stream_items - 1840 - + (N_post / eta_mod) - (N_FC - C_FC)); + if (dummy_randomize == NULL) { free(zigzag_interleave); - GR_LOG_FATAL(d_logger, "Frame Mapper, cannot allocate memory for dummy_randomize."); + GR_LOG_FATAL(d_logger, + "Frame Mapper, cannot allocate memory for dummy_randomize."); throw std::bad_alloc(); - } - init_dummy_randomizer(); - init_l1_randomizer(); } + init_dummy_randomizer(); + init_l1_randomizer(); +} - /* - * Our virtual destructor. - */ - dvbt2_framemapper_cc_impl::~dvbt2_framemapper_cc_impl() - { - free(dummy_randomize); - free(zigzag_interleave); - } +/* + * Our virtual destructor. + */ +dvbt2_framemapper_cc_impl::~dvbt2_framemapper_cc_impl() +{ + free(dummy_randomize); + free(zigzag_interleave); +} - void - dvbt2_framemapper_cc_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = stream_items * (noutput_items / mapped_items); - } +void dvbt2_framemapper_cc_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = stream_items * (noutput_items / mapped_items); +} #define CRC_POLY 0x04C11DB7 - int - dvbt2_framemapper_cc_impl::add_crc32_bits(unsigned char *in, int length) - { - int crc = 0xffffffff; - int b; - int i = 0; +int dvbt2_framemapper_cc_impl::add_crc32_bits(unsigned char* in, int length) +{ + int crc = 0xffffffff; + int b; + int i = 0; - for (int n = 0; n < length; n++) { + for (int n = 0; n < length; n++) { b = in[i++] ^ ((crc >> 31) & 0x01); crc <<= 1; if (b) { - crc ^= CRC_POLY; + crc ^= CRC_POLY; } - } + } - for (int n = 31; n >= 0; n--) { + for (int n = 31; n >= 0; n--) { in[i++] = (crc & (1 << n)) ? 1 : 0; - } - return 32; } + return 32; +} - int - dvbt2_framemapper_cc_impl::poly_mult(const int *ina, int lena, const int *inb, int lenb, int *out) - { - memset(out, 0, sizeof(int) * (lena + lenb)); +int dvbt2_framemapper_cc_impl::poly_mult( + const int* ina, int lena, const int* inb, int lenb, int* out) +{ + memset(out, 0, sizeof(int) * (lena + lenb)); - for (int i = 0; i < lena; i++) { + for (int i = 0; i < lena; i++) { for (int j = 0; j < lenb; j++) { - if (ina[i] * inb[j] > 0) { - out[i + j]++; // count number of terms for this pwr of x - } + if (ina[i] * inb[j] > 0) { + out[i + j]++; // count number of terms for this pwr of x + } } - } - int max = 0; - for (int i = 0; i < lena + lenb; i++) { - out[i] = out[i] & 1; // If even ignore the term - if(out[i]) max = i; - } - // return the size of array to house the result. - return max + 1; } + int max = 0; + for (int i = 0; i < lena + lenb; i++) { + out[i] = out[i] & 1; // If even ignore the term + if (out[i]) + max = i; + } + // return the size of array to house the result. + return max + 1; +} - void - dvbt2_framemapper_cc_impl::poly_pack(const int *pin, unsigned int* pout, int len) - { - int lw = len / 32; - int ptr = 0; - unsigned int temp; - if (len % 32) { +void dvbt2_framemapper_cc_impl::poly_pack(const int* pin, unsigned int* pout, int len) +{ + int lw = len / 32; + int ptr = 0; + unsigned int temp; + if (len % 32) { lw++; - } + } - for (int i = 0; i < lw; i++) { + for (int i = 0; i < lw; i++) { temp = 0x80000000; pout[i] = 0; for (int j = 0; j < 32; j++) { - if (pin[ptr++]) { - pout[i] |= temp; - } - temp >>= 1; + if (pin[ptr++]) { + pout[i] |= temp; + } + temp >>= 1; } - } } +} - void - dvbt2_framemapper_cc_impl::bch_poly_build_tables(void) - { - // Short polynomials - const int polys01[]={1,1,0,1,0,1,0,0,0,0,0,0,0,0,1}; - const int polys02[]={1,0,0,0,0,0,1,0,1,0,0,1,0,0,1}; - const int polys03[]={1,1,1,0,0,0,1,0,0,1,1,0,0,0,1}; - const int polys04[]={1,0,0,0,1,0,0,1,1,0,1,0,1,0,1}; - const int polys05[]={1,0,1,0,1,0,1,0,1,1,0,1,0,1,1}; - const int polys06[]={1,0,0,1,0,0,0,1,1,1,0,0,0,1,1}; - const int polys07[]={1,0,1,0,0,1,1,1,0,0,1,1,0,1,1}; - const int polys08[]={1,0,0,0,0,1,0,0,1,1,1,1,0,0,1}; - const int polys09[]={1,1,1,1,0,0,0,0,0,1,1,0,0,0,1}; - const int polys10[]={1,0,0,1,0,0,1,0,0,1,0,1,1,0,1}; - const int polys11[]={1,0,0,0,1,0,0,0,0,0,0,1,1,0,1}; - const int polys12[]={1,1,1,1,0,1,1,1,1,0,1,0,0,1,1}; +void dvbt2_framemapper_cc_impl::bch_poly_build_tables(void) +{ + // Short polynomials + const int polys01[] = { 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; + const int polys02[] = { 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1 }; + const int polys03[] = { 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1 }; + const int polys04[] = { 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1 }; + const int polys05[] = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1 }; + const int polys06[] = { 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1 }; + const int polys07[] = { 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1 }; + const int polys08[] = { 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1 }; + const int polys09[] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1 }; + const int polys10[] = { 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1 }; + const int polys11[] = { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1 }; + const int polys12[] = { 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1 }; - int len; - int polyout[2][200]; + int len; + int polyout[2][200]; - len = poly_mult(polys01, 15, polys02, 15, polyout[0]); - len = poly_mult(polys03, 15, polyout[0], len, polyout[1]); - len = poly_mult(polys04, 15, polyout[1], len, polyout[0]); - len = poly_mult(polys05, 15, polyout[0], len, polyout[1]); - len = poly_mult(polys06, 15, polyout[1], len, polyout[0]); - len = poly_mult(polys07, 15, polyout[0], len, polyout[1]); - len = poly_mult(polys08, 15, polyout[1], len, polyout[0]); - len = poly_mult(polys09, 15, polyout[0], len, polyout[1]); - len = poly_mult(polys10, 15, polyout[1], len, polyout[0]); - len = poly_mult(polys11, 15, polyout[0], len, polyout[1]); - len = poly_mult(polys12, 15, polyout[1], len, polyout[0]); - poly_pack(polyout[0], m_poly_s_12, 168); - } + len = poly_mult(polys01, 15, polys02, 15, polyout[0]); + len = poly_mult(polys03, 15, polyout[0], len, polyout[1]); + len = poly_mult(polys04, 15, polyout[1], len, polyout[0]); + len = poly_mult(polys05, 15, polyout[0], len, polyout[1]); + len = poly_mult(polys06, 15, polyout[1], len, polyout[0]); + len = poly_mult(polys07, 15, polyout[0], len, polyout[1]); + len = poly_mult(polys08, 15, polyout[1], len, polyout[0]); + len = poly_mult(polys09, 15, polyout[0], len, polyout[1]); + len = poly_mult(polys10, 15, polyout[1], len, polyout[0]); + len = poly_mult(polys11, 15, polyout[0], len, polyout[1]); + len = poly_mult(polys12, 15, polyout[1], len, polyout[0]); + poly_pack(polyout[0], m_poly_s_12, 168); +} - inline void - dvbt2_framemapper_cc_impl::reg_6_shift(unsigned int *sr) - { - sr[5] = (sr[5] >> 1) | (sr[4] << 31); - sr[4] = (sr[4] >> 1) | (sr[3] << 31); - sr[3] = (sr[3] >> 1) | (sr[2] << 31); - sr[2] = (sr[2] >> 1) | (sr[1] << 31); - sr[1] = (sr[1] >> 1) | (sr[0] << 31); - sr[0] = (sr[0] >> 1); - } +inline void dvbt2_framemapper_cc_impl::reg_6_shift(unsigned int* sr) +{ + sr[5] = (sr[5] >> 1) | (sr[4] << 31); + sr[4] = (sr[4] >> 1) | (sr[3] << 31); + sr[3] = (sr[3] >> 1) | (sr[2] << 31); + sr[2] = (sr[2] >> 1) | (sr[1] << 31); + sr[1] = (sr[1] >> 1) | (sr[0] << 31); + sr[0] = (sr[0] >> 1); +} - void - dvbt2_framemapper_cc_impl::l1pre_ldpc_lookup_generate(void) - { - int im; - int index; - int pbits; - int q; - index = 0; - im = 0; +void dvbt2_framemapper_cc_impl::l1pre_ldpc_lookup_generate(void) +{ + int im; + int index; + int pbits; + int q; + index = 0; + im = 0; - pbits = FRAME_SIZE_SHORT - NBCH_1_4; //number of parity bits - q = 36; + pbits = FRAME_SIZE_SHORT - NBCH_1_4; // number of parity bits + q = 36; - for (int row = 0; row < 9; row++) { - for(int n = 0; n < 360; n++) { - for (int col = 1; col <= ldpc_tab_1_4S[row][0]; col++) { - l1pre_ldpc_encode.p[index] = (ldpc_tab_1_4S[row][col] + (n * q)) % pbits; - l1pre_ldpc_encode.d[index] = im; - index++; - } - im++; + for (int row = 0; row < 9; row++) { + for (int n = 0; n < 360; n++) { + for (int col = 1; col <= ldpc_tab_1_4S[row][0]; col++) { + l1pre_ldpc_encode.p[index] = (ldpc_tab_1_4S[row][col] + (n * q)) % pbits; + l1pre_ldpc_encode.d[index] = im; + index++; + } + im++; } - } - l1pre_ldpc_encode.table_length = index; } + l1pre_ldpc_encode.table_length = index; +} - void - dvbt2_framemapper_cc_impl::l1post_ldpc_lookup_generate(void) - { - int im; - int index; - int pbits; - int q; - index = 0; - im = 0; +void dvbt2_framemapper_cc_impl::l1post_ldpc_lookup_generate(void) +{ + int im; + int index; + int pbits; + int q; + index = 0; + im = 0; - pbits = FRAME_SIZE_SHORT - NBCH_1_2; //number of parity bits - q = 25; + pbits = FRAME_SIZE_SHORT - NBCH_1_2; // number of parity bits + q = 25; - for (int row = 0; row < 20; row++) { - for(int n = 0; n < 360; n++) { - for (int col = 1; col <= ldpc_tab_1_2S[row][0]; col++) { - l1post_ldpc_encode.p[index] = (ldpc_tab_1_2S[row][col] + (n * q)) % pbits; - l1post_ldpc_encode.d[index] = im; - index++; - } - im++; + for (int row = 0; row < 20; row++) { + for (int n = 0; n < 360; n++) { + for (int col = 1; col <= ldpc_tab_1_2S[row][0]; col++) { + l1post_ldpc_encode.p[index] = (ldpc_tab_1_2S[row][col] + (n * q)) % pbits; + l1post_ldpc_encode.d[index] = im; + index++; + } + im++; } - } - l1post_ldpc_encode.table_length = index; } + l1post_ldpc_encode.table_length = index; +} - void - dvbt2_framemapper_cc_impl::add_l1pre(gr_complex *out) - { - int temp, offset_bits = 0; - unsigned char b, value; - unsigned int shift[6]; - int plen = FRAME_SIZE_SHORT - NBCH_1_4; - const unsigned char *d; - unsigned char *p; - unsigned char *l1pre = l1_temp; - L1Pre *l1preinit = &L1_Signalling[0].l1pre_data; - int g, o, index; +void dvbt2_framemapper_cc_impl::add_l1pre(gr_complex* out) +{ + int temp, offset_bits = 0; + unsigned char b, value; + unsigned int shift[6]; + int plen = FRAME_SIZE_SHORT - NBCH_1_4; + const unsigned char* d; + unsigned char* p; + unsigned char* l1pre = l1_temp; + L1Pre* l1preinit = &L1_Signalling[0].l1pre_data; + int g, o, index; - temp = l1preinit->type; - for (int n = 7; n >= 0; n--) { + temp = l1preinit->type; + for (int n = 7; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - l1pre[offset_bits++] = l1preinit->bwt_ext; - temp = l1preinit->s1; - for (int n = 2; n >= 0; n--) { + } + l1pre[offset_bits++] = l1preinit->bwt_ext; + temp = l1preinit->s1; + for (int n = 2; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->s2; - for (int n = 2; n >= 0; n--) { + } + temp = l1preinit->s2; + for (int n = 2; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - l1pre[offset_bits++] = 0; - l1pre[offset_bits++] = l1preinit->l1_repetition_flag; - temp = l1preinit->guard_interval; - for (int n = 2; n >= 0; n--) { + } + l1pre[offset_bits++] = 0; + l1pre[offset_bits++] = l1preinit->l1_repetition_flag; + temp = l1preinit->guard_interval; + for (int n = 2; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->papr; - for (int n = 3; n >= 0; n--) { + } + temp = l1preinit->papr; + for (int n = 3; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->l1_mod; - for (int n = 3; n >= 0; n--) { + } + temp = l1preinit->l1_mod; + for (int n = 3; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->l1_cod; - for (int n = 1; n >= 0; n--) { + } + temp = l1preinit->l1_cod; + for (int n = 1; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->l1_fec_type; - for (int n = 1; n >= 0; n--) { + } + temp = l1preinit->l1_fec_type; + for (int n = 1; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->l1_post_size; - for (int n = 17; n >= 0; n--) { + } + temp = l1preinit->l1_post_size; + for (int n = 17; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->l1_post_info_size; - for (int n = 17; n >= 0; n--) { + } + temp = l1preinit->l1_post_info_size; + for (int n = 17; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->pilot_pattern; - for (int n = 3; n >= 0; n--) { + } + temp = l1preinit->pilot_pattern; + for (int n = 3; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->tx_id_availability; - for (int n = 7; n >= 0; n--) { + } + temp = l1preinit->tx_id_availability; + for (int n = 7; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->cell_id; - for (int n = 15; n >= 0; n--) { + } + temp = l1preinit->cell_id; + for (int n = 15; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->network_id; - for (int n = 15; n >= 0; n--) { + } + temp = l1preinit->network_id; + for (int n = 15; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->t2_system_id; - for (int n = 15; n >= 0; n--) { + } + temp = l1preinit->t2_system_id; + for (int n = 15; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->num_t2_frames; - for (int n = 7; n >= 0; n--) { + } + temp = l1preinit->num_t2_frames; + for (int n = 7; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->num_data_symbols; - for (int n = 11; n >= 0; n--) { + } + temp = l1preinit->num_data_symbols; + for (int n = 11; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->regen_flag; - for (int n = 2; n >= 0; n--) { + } + temp = l1preinit->regen_flag; + for (int n = 2; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - l1pre[offset_bits++] = l1preinit->l1_post_extension; - temp = l1preinit->num_rf; - for (int n = 2; n >= 0; n--) { + } + l1pre[offset_bits++] = l1preinit->l1_post_extension; + temp = l1preinit->num_rf; + for (int n = 2; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->current_rf_index; - for (int n = 2; n >= 0; n--) { + } + temp = l1preinit->current_rf_index; + for (int n = 2; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1preinit->t2_version; - for (int n = 3; n >= 0; n--) { + } + temp = l1preinit->t2_version; + for (int n = 3; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - l1pre[offset_bits++] = l1preinit->l1_post_scrambled; - l1pre[offset_bits++] = l1preinit->t2_base_lite; - temp = l1preinit->reserved; - for (int n = 3; n >= 0; n--) { + } + l1pre[offset_bits++] = l1preinit->l1_post_scrambled; + l1pre[offset_bits++] = l1preinit->t2_base_lite; + temp = l1preinit->reserved; + for (int n = 3; n >= 0; n--) { l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - offset_bits += add_crc32_bits(l1pre, offset_bits); - /* Padding */ - for (int n = KBCH_1_4 - offset_bits - 1; n >= 0; n--) { + } + offset_bits += add_crc32_bits(l1pre, offset_bits); + /* Padding */ + for (int n = KBCH_1_4 - offset_bits - 1; n >= 0; n--) { l1pre[offset_bits++] = 0; - } - /* BCH */ - offset_bits = 0; - memset(shift, 0, sizeof(unsigned int) * 6); - for (int j = 0; j < KBCH_1_4; j++) { + } + /* BCH */ + offset_bits = 0; + memset(shift, 0, sizeof(unsigned int) * 6); + for (int j = 0; j < KBCH_1_4; j++) { value = l1pre[offset_bits++]; b = (value ^ ((shift[5] & 0x01000000) ? 1 : 0)); reg_6_shift(shift); if (b) { - shift[0] ^= m_poly_s_12[0]; - shift[1] ^= m_poly_s_12[1]; - shift[2] ^= m_poly_s_12[2]; - shift[3] ^= m_poly_s_12[3]; - shift[4] ^= m_poly_s_12[4]; - shift[5] ^= m_poly_s_12[5]; + shift[0] ^= m_poly_s_12[0]; + shift[1] ^= m_poly_s_12[1]; + shift[2] ^= m_poly_s_12[2]; + shift[3] ^= m_poly_s_12[3]; + shift[4] ^= m_poly_s_12[4]; + shift[5] ^= m_poly_s_12[5]; } - } - for (int n = 0; n < NBCH_PARITY; n++) { + } + for (int n = 0; n < NBCH_PARITY; n++) { l1pre[offset_bits++] = (shift[5] & 0x01000000) ? 1 : 0; reg_6_shift(shift); - } - /* LDPC */ - d = l1_temp; - p = &l1_temp[NBCH_1_4]; - memset(p, 0, sizeof(unsigned char)*plen); - for(int j = 0; j < l1pre_ldpc_encode.table_length; j++) { + } + /* LDPC */ + d = l1_temp; + p = &l1_temp[NBCH_1_4]; + memset(p, 0, sizeof(unsigned char) * plen); + for (int j = 0; j < l1pre_ldpc_encode.table_length; j++) { p[l1pre_ldpc_encode.p[j]] ^= d[l1pre_ldpc_encode.d[j]]; - } - for(int j = 1; j < plen; j++) { - p[j] ^= p[j-1]; - } - /* Puncturing */ - for (int c = 0; c < 31; c++) { + } + for (int j = 1; j < plen; j++) { + p[j] ^= p[j - 1]; + } + /* Puncturing */ + for (int c = 0; c < 31; c++) { g = pre_puncture[c]; for (int c2 = 0; c2 < 360; c2++) { - o = (c2 * 36) + g + NBCH_1_4; - l1_temp[o] = 0x55; + o = (c2 * 36) + g + NBCH_1_4; + l1_temp[o] = 0x55; } - } - g = pre_puncture[31]; - for (int c2 = 0; c2 < 328; c2++) { + } + g = pre_puncture[31]; + for (int c2 = 0; c2 < 328; c2++) { o = (c2 * 36) + g + NBCH_1_4; l1_temp[o] = 0x55; - } - /* remove padding and punctured bits, BPSK modulate */ - index = 0; - for (int w = 0; w < KSIG_PRE; w++) { + } + /* remove padding and punctured bits, BPSK modulate */ + index = 0; + for (int w = 0; w < KSIG_PRE; w++) { out[index++] = m_bpsk[l1_temp[w]]; - } - for (int w = 0; w < NBCH_PARITY; w++) { + } + for (int w = 0; w < NBCH_PARITY; w++) { out[index++] = m_bpsk[l1_temp[w + KBCH_1_4]]; - } - for (int w = 0; w < FRAME_SIZE_SHORT - NBCH_1_4; w++) { + } + for (int w = 0; w < FRAME_SIZE_SHORT - NBCH_1_4; w++) { if (l1_temp[w + NBCH_1_4] != 0x55) { - out[index++] = m_bpsk[l1_temp[w + NBCH_1_4]]; + out[index++] = m_bpsk[l1_temp[w + NBCH_1_4]]; } - } } +} - void - dvbt2_framemapper_cc_impl::add_l1post(gr_complex *out, int t2_frame_num) - { - int temp, offset_bits = 0; - unsigned char b, value; - unsigned int shift[6]; - int plen = FRAME_SIZE_SHORT - NBCH_1_2; - const unsigned char *d; - unsigned char *p; - unsigned char *l1post = l1_interleave; - L1Post *l1postinit = &L1_Signalling[0].l1post_data; - int m, g, o, last, index; - const int *post_padding; - const int *post_puncture; - int rows, numCols, mod, offset, pack, produced; - unsigned char *cols[12]; +void dvbt2_framemapper_cc_impl::add_l1post(gr_complex* out, int t2_frame_num) +{ + int temp, offset_bits = 0; + unsigned char b, value; + unsigned int shift[6]; + int plen = FRAME_SIZE_SHORT - NBCH_1_2; + const unsigned char* d; + unsigned char* p; + unsigned char* l1post = l1_interleave; + L1Post* l1postinit = &L1_Signalling[0].l1post_data; + int m, g, o, last, index; + const int* post_padding; + const int* post_puncture; + int rows, numCols, mod, offset, pack, produced; + unsigned char* cols[12]; - temp = l1postinit->sub_slices_per_frame; - for (int n = 14; n >= 0; n--) { + temp = l1postinit->sub_slices_per_frame; + for (int n = 14; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->num_plp; - for (int n = 7; n >= 0; n--) { + } + temp = l1postinit->num_plp; + for (int n = 7; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->num_aux; - for (int n = 3; n >= 0; n--) { + } + temp = l1postinit->num_aux; + for (int n = 3; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->aux_config_rfu; - for (int n = 7; n >= 0; n--) { + } + temp = l1postinit->aux_config_rfu; + for (int n = 7; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->rf_idx; - for (int n = 2; n >= 0; n--) { + } + temp = l1postinit->rf_idx; + for (int n = 2; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->frequency; - for (int n = 31; n >= 0; n--) { + } + temp = l1postinit->frequency; + for (int n = 31; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->plp_id; - for (int n = 7; n >= 0; n--) { + } + temp = l1postinit->plp_id; + for (int n = 7; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->plp_type; - for (int n = 2; n >= 0; n--) { + } + temp = l1postinit->plp_type; + for (int n = 2; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->plp_payload_type; - for (int n = 4; n >= 0; n--) { + } + temp = l1postinit->plp_payload_type; + for (int n = 4; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - l1post[offset_bits++] = l1postinit->ff_flag; - temp = l1postinit->first_rf_idx; - for (int n = 2; n >= 0; n--) { + } + l1post[offset_bits++] = l1postinit->ff_flag; + temp = l1postinit->first_rf_idx; + for (int n = 2; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->first_frame_idx; - for (int n = 7; n >= 0; n--) { + } + temp = l1postinit->first_frame_idx; + for (int n = 7; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->plp_group_id; - for (int n = 7; n >= 0; n--) { + } + temp = l1postinit->plp_group_id; + for (int n = 7; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->plp_cod; - for (int n = 2; n >= 0; n--) { + } + temp = l1postinit->plp_cod; + for (int n = 2; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->plp_mod; - for (int n = 2; n >= 0; n--) { + } + temp = l1postinit->plp_mod; + for (int n = 2; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - l1post[offset_bits++] = l1postinit->plp_rotation; - temp = l1postinit->plp_fec_type; - for (int n = 1; n >= 0; n--) { + } + l1post[offset_bits++] = l1postinit->plp_rotation; + temp = l1postinit->plp_fec_type; + for (int n = 1; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->plp_num_blocks_max; - for (int n = 9; n >= 0; n--) { + } + temp = l1postinit->plp_num_blocks_max; + for (int n = 9; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->frame_interval; - for (int n = 7; n >= 0; n--) { + } + temp = l1postinit->frame_interval; + for (int n = 7; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->time_il_length; - for (int n = 7; n >= 0; n--) { + } + temp = l1postinit->time_il_length; + for (int n = 7; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - l1post[offset_bits++] = l1postinit->time_il_type; - l1post[offset_bits++] = l1postinit->in_band_a_flag; - l1post[offset_bits++] = l1postinit->in_band_b_flag; - temp = l1postinit->reserved_1; - for (int n = 10; n >= 0; n--) { + } + l1post[offset_bits++] = l1postinit->time_il_type; + l1post[offset_bits++] = l1postinit->in_band_a_flag; + l1post[offset_bits++] = l1postinit->in_band_b_flag; + temp = l1postinit->reserved_1; + for (int n = 10; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->plp_mode; - for (int n = 1; n >= 0; n--) { + } + temp = l1postinit->plp_mode; + for (int n = 1; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - l1post[offset_bits++] = l1postinit->static_flag; - l1post[offset_bits++] = l1postinit->static_padding_flag; - temp = l1postinit->fef_length_msb; - for (int n = 1; n >= 0; n--) { + } + l1post[offset_bits++] = l1postinit->static_flag; + l1post[offset_bits++] = l1postinit->static_padding_flag; + temp = l1postinit->fef_length_msb; + for (int n = 1; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->reserved_2; - for (int n = 29; n >= 0; n--) { + } + temp = l1postinit->reserved_2; + for (int n = 29; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = t2_frame_num; - for (int n = 7; n >= 0; n--) { + } + temp = t2_frame_num; + for (int n = 7; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->sub_slice_interval; - for (int n = 21; n >= 0; n--) { + } + temp = l1postinit->sub_slice_interval; + for (int n = 21; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->type_2_start; - for (int n = 21; n >= 0; n--) { + } + temp = l1postinit->type_2_start; + for (int n = 21; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->l1_change_counter; - for (int n = 7; n >= 0; n--) { + } + temp = l1postinit->l1_change_counter; + for (int n = 7; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->start_rf_idx; - for (int n = 2; n >= 0; n--) { + } + temp = l1postinit->start_rf_idx; + for (int n = 2; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->reserved_3; - for (int n = 7; n >= 0; n--) { + } + temp = l1postinit->reserved_3; + for (int n = 7; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->plp_id_dynamic; - for (int n = 7; n >= 0; n--) { + } + temp = l1postinit->plp_id_dynamic; + for (int n = 7; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->plp_start; - for (int n = 21; n >= 0; n--) { + } + temp = l1postinit->plp_start; + for (int n = 21; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->plp_num_blocks; - for (int n = 9; n >= 0; n--) { + } + temp = l1postinit->plp_num_blocks; + for (int n = 9; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->reserved_4; - for (int n = 7; n >= 0; n--) { + } + temp = l1postinit->reserved_4; + for (int n = 7; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - temp = l1postinit->reserved_5; - for (int n = 7; n >= 0; n--) { + } + temp = l1postinit->reserved_5; + for (int n = 7; n >= 0; n--) { l1post[offset_bits++] = temp & (1 << n) ? 1 : 0; - } - offset_bits += add_crc32_bits(l1post, offset_bits); - if (l1_scrambled == TRUE) { + } + offset_bits += add_crc32_bits(l1post, offset_bits); + if (l1_scrambled == TRUE) { for (int n = 0; n < offset_bits; n++) { - l1post[n] = l1post[n] ^ l1_randomize[n]; + l1post[n] = l1post[n] ^ l1_randomize[n]; } - } - /* Padding */ - switch (l1_constellation) { - case L1_MOD_BPSK: - post_padding = post_padding_bqpsk; - break; - case L1_MOD_QPSK: - post_padding = post_padding_bqpsk; - break; - case L1_MOD_16QAM: - post_padding = post_padding_16qam; - break; - case L1_MOD_64QAM: - post_padding = post_padding_64qam; - break; - default: - post_padding = post_padding_bqpsk; - break; - } - memset(l1_map, 0, KBCH_1_2); - if (offset_bits <= 360) { + } + /* Padding */ + switch (l1_constellation) { + case L1_MOD_BPSK: + post_padding = post_padding_bqpsk; + break; + case L1_MOD_QPSK: + post_padding = post_padding_bqpsk; + break; + case L1_MOD_16QAM: + post_padding = post_padding_16qam; + break; + case L1_MOD_64QAM: + post_padding = post_padding_64qam; + break; + default: + post_padding = post_padding_bqpsk; + break; + } + memset(l1_map, 0, KBCH_1_2); + if (offset_bits <= 360) { m = 20 - 1; last = 360 - offset_bits; - } - else { + } else { m = (KBCH_1_2 - offset_bits) / 360; last = KBCH_1_2 - offset_bits - (360 * m); - } - for (int n = 0; n < m; n++) { + } + for (int n = 0; n < m; n++) { index = post_padding[n] * 360; if (post_padding[n] == 19) { - for (int w = 0; w < 192; w++) { - l1_map[index++] = 0x7; - } - } - else { - for (int w = 0; w < 360; w++) { - l1_map[index++] = 0x7; - } + for (int w = 0; w < 192; w++) { + l1_map[index++] = 0x7; + } + } else { + for (int w = 0; w < 360; w++) { + l1_map[index++] = 0x7; + } } - } - if (post_padding[m] == 19) { + } + if (post_padding[m] == 19) { index = (post_padding[m] * 360) + 192 - last; - } - else { + } else { index = (post_padding[m] * 360) + 360 - last; - } - for (int w = 0; w < last; w++) { + } + for (int w = 0; w < last; w++) { l1_map[index++] = 0x7; - } - index = 0; - l1post = l1_temp; - for (int n = 0; n < KBCH_1_2; n++) { + } + index = 0; + l1post = l1_temp; + for (int n = 0; n < KBCH_1_2; n++) { if (l1_map[n] != 0x7) { - l1post[n] = l1_interleave[index++]; - } - else { - l1post[n] = 0; + l1post[n] = l1_interleave[index++]; + } else { + l1post[n] = 0; } - } - /* BCH */ - offset_bits = 0; - memset(shift, 0, sizeof(unsigned int) * 6); - for (int j = 0; j < KBCH_1_2; j++) { + } + /* BCH */ + offset_bits = 0; + memset(shift, 0, sizeof(unsigned int) * 6); + for (int j = 0; j < KBCH_1_2; j++) { value = l1post[offset_bits++]; b = (value ^ ((shift[5] & 0x01000000) ? 1 : 0)); reg_6_shift(shift); if (b) { - shift[0] ^= m_poly_s_12[0]; - shift[1] ^= m_poly_s_12[1]; - shift[2] ^= m_poly_s_12[2]; - shift[3] ^= m_poly_s_12[3]; - shift[4] ^= m_poly_s_12[4]; - shift[5] ^= m_poly_s_12[5]; + shift[0] ^= m_poly_s_12[0]; + shift[1] ^= m_poly_s_12[1]; + shift[2] ^= m_poly_s_12[2]; + shift[3] ^= m_poly_s_12[3]; + shift[4] ^= m_poly_s_12[4]; + shift[5] ^= m_poly_s_12[5]; } - } - for (int n = 0; n < NBCH_PARITY; n++) { + } + for (int n = 0; n < NBCH_PARITY; n++) { l1post[offset_bits++] = (shift[5] & 0x01000000) ? 1 : 0; reg_6_shift(shift); - } - /* LDPC */ - d = l1_temp; - p = &l1_temp[NBCH_1_2]; - memset(p, 0, sizeof(unsigned char)*plen); - for(int j = 0; j < l1post_ldpc_encode.table_length; j++) { + } + /* LDPC */ + d = l1_temp; + p = &l1_temp[NBCH_1_2]; + memset(p, 0, sizeof(unsigned char) * plen); + for (int j = 0; j < l1post_ldpc_encode.table_length; j++) { p[l1post_ldpc_encode.p[j]] ^= d[l1post_ldpc_encode.d[j]]; - } - for(int j = 1; j < plen; j++) { - p[j] ^= p[j-1]; - } - /* Puncturing */ - switch (l1_constellation) { - case L1_MOD_BPSK: - post_puncture = post_puncture_bqpsk; - break; - case L1_MOD_QPSK: - post_puncture = post_puncture_bqpsk; - break; - case L1_MOD_16QAM: - post_puncture = post_puncture_16qam; - break; - case L1_MOD_64QAM: - post_puncture = post_puncture_64qam; - break; - default: - post_puncture = post_puncture_bqpsk; - break; - } - for (int c = 0; c < (N_punc / 360); c++) { + } + for (int j = 1; j < plen; j++) { + p[j] ^= p[j - 1]; + } + /* Puncturing */ + switch (l1_constellation) { + case L1_MOD_BPSK: + post_puncture = post_puncture_bqpsk; + break; + case L1_MOD_QPSK: + post_puncture = post_puncture_bqpsk; + break; + case L1_MOD_16QAM: + post_puncture = post_puncture_16qam; + break; + case L1_MOD_64QAM: + post_puncture = post_puncture_64qam; + break; + default: + post_puncture = post_puncture_bqpsk; + break; + } + for (int c = 0; c < (N_punc / 360); c++) { g = post_puncture[c]; for (int c2 = 0; c2 < 360; c2++) { - o = (c2 * 25) + g + NBCH_1_2; - l1_temp[o] = 0x55; + o = (c2 * 25) + g + NBCH_1_2; + l1_temp[o] = 0x55; } - } - g = post_puncture[(N_punc / 360)]; - for (int c2 = 0; c2 < (N_punc - ((N_punc / 360) * 360)); c2++) { + } + g = post_puncture[(N_punc / 360)]; + for (int c2 = 0; c2 < (N_punc - ((N_punc / 360) * 360)); c2++) { o = (c2 * 25) + g + NBCH_1_2; l1_temp[o] = 0x55; - } - /* remove padding and punctured bits */ - index = 0; - for (int w = 0; w < KBCH_1_2; w++) { + } + /* remove padding and punctured bits */ + index = 0; + for (int w = 0; w < KBCH_1_2; w++) { if (l1_map[w] != 0x7) { - l1_interleave[index++] = l1_temp[w]; + l1_interleave[index++] = l1_temp[w]; } - } - for (int w = 0; w < NBCH_PARITY; w++) { + } + for (int w = 0; w < NBCH_PARITY; w++) { l1_interleave[index++] = l1_temp[w + KBCH_1_2]; - } - for (int w = 0; w < FRAME_SIZE_SHORT - NBCH_1_2; w++) { + } + for (int w = 0; w < FRAME_SIZE_SHORT - NBCH_1_2; w++) { if (l1_temp[w + NBCH_1_2] != 0x55) { - l1_interleave[index++] = l1_temp[w + NBCH_1_2]; + l1_interleave[index++] = l1_temp[w + NBCH_1_2]; } - } - /* Bit interleave for 16QAM and 64QAM */ - if (l1_constellation == L1_MOD_16QAM || l1_constellation == L1_MOD_64QAM) { + } + /* Bit interleave for 16QAM and 64QAM */ + if (l1_constellation == L1_MOD_16QAM || l1_constellation == L1_MOD_64QAM) { if (l1_constellation == L1_MOD_16QAM) { - numCols = 8; - rows = N_post / 8; - } - else { - numCols = 12; - rows = N_post / 12; + numCols = 8; + rows = N_post / 8; + } else { + numCols = 12; + rows = N_post / 12; } for (int j = 0; j < numCols; j++) { - cols[j] = &l1_interleave[rows * j]; + cols[j] = &l1_interleave[rows * j]; } index = 0; for (int k = 0; k < rows; k++) { - for (int w = 0; w < numCols; w++) { - *l1post++ = *(cols[w] + index); - } - index++; + for (int w = 0; w < numCols; w++) { + *l1post++ = *(cols[w] + index); + } + index++; } - } - switch (l1_constellation) { - case L1_MOD_BPSK: - index = 0; - produced = 0; - for (int d = 0; d < N_post; d++) { + } + switch (l1_constellation) { + case L1_MOD_BPSK: + index = 0; + produced = 0; + for (int d = 0; d < N_post; d++) { out[produced++] = m_bpsk[l1_interleave[index++]]; - } - break; - case L1_MOD_QPSK: - mod = 2; - index = 0; - produced = 0; - for (int d = 0; d < N_post / mod; d++) { + } + break; + case L1_MOD_QPSK: + mod = 2; + index = 0; + produced = 0; + for (int d = 0; d < N_post / mod; d++) { pack = 0; for (int e = 0; e < mod; e++) { - pack |= l1_interleave[index++]; - pack <<= 1; + pack |= l1_interleave[index++]; + pack <<= 1; } pack >>= 1; out[produced++] = m_qpsk[pack]; - } - break; - case L1_MOD_16QAM: - mod = 4; - index = 0; - produced = 0; - for (int d = 0; d < N_post / (mod * 2); d++) { + } + break; + case L1_MOD_16QAM: + mod = 4; + index = 0; + produced = 0; + for (int d = 0; d < N_post / (mod * 2); d++) { pack = 0; for (int e = 0; e < (mod * 2); e++) { - offset = mux16[e]; - pack |= l1_temp[index + offset]; - pack <<= 1; + offset = mux16[e]; + pack |= l1_temp[index + offset]; + pack <<= 1; } pack >>= 1; out[produced++] = m_16qam[pack >> 4]; out[produced++] = m_16qam[pack & 0xf]; index += (mod * 2); - } - break; - case L1_MOD_64QAM: - mod = 6; - index = 0; - produced = 0; - for (int d = 0; d < N_post / (mod * 2); d++) { + } + break; + case L1_MOD_64QAM: + mod = 6; + index = 0; + produced = 0; + for (int d = 0; d < N_post / (mod * 2); d++) { pack = 0; for (int e = 0; e < (mod * 2); e++) { - offset = mux64[e]; - pack |= l1_temp[index + offset]; - pack <<= 1; + offset = mux64[e]; + pack |= l1_temp[index + offset]; + pack <<= 1; } pack >>= 1; out[produced++] = m_64qam[pack >> 6]; out[produced++] = m_64qam[pack & 0x3f]; index += (mod * 2); - } - break; - } + } + break; } +} - void - dvbt2_framemapper_cc_impl::init_dummy_randomizer(void) - { - int sr = 0x4A80; - int num = mapped_items - stream_items - 1840 - (N_post / eta_mod) - (N_FC - C_FC); - std::fill_n(&dummy_randomize[0], num, 0); - for (int i = 0; i < num; i++) { +void dvbt2_framemapper_cc_impl::init_dummy_randomizer(void) +{ + int sr = 0x4A80; + int num = mapped_items - stream_items - 1840 - (N_post / eta_mod) - (N_FC - C_FC); + std::fill_n(&dummy_randomize[0], num, 0); + for (int i = 0; i < num; i++) { int b = ((sr) ^ (sr >> 1)) & 1; dummy_randomize[i] = (b ? -1.0 : 1.0); sr >>= 1; - if(b) { - sr |= 0x4000; + if (b) { + sr |= 0x4000; } - } } +} - void - dvbt2_framemapper_cc_impl::init_l1_randomizer(void) - { - int sr = 0x4A80; - for (int i = 0; i < KBCH_1_2; i++) { +void dvbt2_framemapper_cc_impl::init_l1_randomizer(void) +{ + int sr = 0x4A80; + for (int i = 0; i < KBCH_1_2; i++) { int b = ((sr) ^ (sr >> 1)) & 1; l1_randomize[i] = b; sr >>= 1; - if(b) { - sr |= 0x4000; + if (b) { + sr |= 0x4000; } - } } +} - int - dvbt2_framemapper_cc_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - int index = 0; - int read, save, count = 0; - gr_complex *interleave = zigzag_interleave; +int dvbt2_framemapper_cc_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + gr_complex* out = (gr_complex*)output_items[0]; + int index = 0; + int read, save, count = 0; + gr_complex* interleave = zigzag_interleave; - for (int i = 0; i < noutput_items; i += mapped_items) { + for (int i = 0; i < noutput_items; i += mapped_items) { if (N_P2 == 1) { - for (int j = 0; j < 1840; j++) { - *out++ = l1pre_cache[index++]; - } - add_l1post(out, t2_frame_num); - t2_frame_num = (t2_frame_num + 1) % t2_frames; - out += N_post / eta_mod; - for (int j = 0; j < stream_items; j++) { - *out++ = *in++; - } - index = 0; - for (int j = 0; j < mapped_items - stream_items - 1840 - (N_post / eta_mod) - (N_FC - C_FC); j++) { - *out++ = dummy_randomize[index++]; - } - for (int j = 0; j < N_FC - C_FC; j++) { - *out++ = unmodulated; - } - } - else { - for (int j = 0; j < 1840; j++) { - *interleave++ = l1pre_cache[index++]; - } - add_l1post(interleave, t2_frame_num); - t2_frame_num = (t2_frame_num + 1) % t2_frames; - interleave += N_post / eta_mod; - for (int j = 0; j < stream_items; j++) { - *interleave++ = *in++; - } - index = 0; - for (int j = 0; j < mapped_items - stream_items - 1840 - (N_post / eta_mod) - (N_FC - C_FC); j++) { - *interleave++ = dummy_randomize[index++]; - } - for (int j = 0; j < N_FC - C_FC; j++) { - *interleave++ = unmodulated; - } - interleave = zigzag_interleave; - read = 0; - index = 0; - for (int n = 0; n < N_P2; n++) { - save = read; - for (int j = 0; j < 1840 / N_P2; j++) { - out[index++] = interleave[read]; - count++; - read += N_P2; + for (int j = 0; j < 1840; j++) { + *out++ = l1pre_cache[index++]; + } + add_l1post(out, t2_frame_num); + t2_frame_num = (t2_frame_num + 1) % t2_frames; + out += N_post / eta_mod; + for (int j = 0; j < stream_items; j++) { + *out++ = *in++; + } + index = 0; + for (int j = 0; j < mapped_items - stream_items - 1840 - (N_post / eta_mod) - + (N_FC - C_FC); + j++) { + *out++ = dummy_randomize[index++]; + } + for (int j = 0; j < N_FC - C_FC; j++) { + *out++ = unmodulated; + } + } else { + for (int j = 0; j < 1840; j++) { + *interleave++ = l1pre_cache[index++]; } - read = save + 1; - index += C_P2 - (1840 / N_P2); - } - read = 1840; - index = 1840 / N_P2; - for (int n = 0; n < N_P2; n++) { - save = read; - for (int j = 0; j < (N_post / eta_mod) / N_P2; j++) { - out[index++] = interleave[read]; - count++; - read += N_P2; + add_l1post(interleave, t2_frame_num); + t2_frame_num = (t2_frame_num + 1) % t2_frames; + interleave += N_post / eta_mod; + for (int j = 0; j < stream_items; j++) { + *interleave++ = *in++; } - read = save + 1; - index += C_P2 - ((N_post / eta_mod) / N_P2); - } - read = 1840 + (N_post / eta_mod); - index = (1840 / N_P2) + ((N_post / eta_mod) / N_P2); - for (int n = 0; n < N_P2; n++) { - for (int j = 0; j < C_P2 - (1840 / N_P2) - ((N_post / eta_mod) / N_P2); j++) { - out[index++] = interleave[read++]; - count++; + index = 0; + for (int j = 0; j < mapped_items - stream_items - 1840 - (N_post / eta_mod) - + (N_FC - C_FC); + j++) { + *interleave++ = dummy_randomize[index++]; } - index += C_P2 - (C_P2 - (1840 / N_P2) - ((N_post / eta_mod) / N_P2)); - } - index -= C_P2 - (C_P2 - (1840 / N_P2) - ((N_post / eta_mod) / N_P2)); - for (int j = 0; j < mapped_items - count; j++) { - out[index++] = interleave[read++]; - } - out += mapped_items; + for (int j = 0; j < N_FC - C_FC; j++) { + *interleave++ = unmodulated; + } + interleave = zigzag_interleave; + read = 0; + index = 0; + for (int n = 0; n < N_P2; n++) { + save = read; + for (int j = 0; j < 1840 / N_P2; j++) { + out[index++] = interleave[read]; + count++; + read += N_P2; + } + read = save + 1; + index += C_P2 - (1840 / N_P2); + } + read = 1840; + index = 1840 / N_P2; + for (int n = 0; n < N_P2; n++) { + save = read; + for (int j = 0; j < (N_post / eta_mod) / N_P2; j++) { + out[index++] = interleave[read]; + count++; + read += N_P2; + } + read = save + 1; + index += C_P2 - ((N_post / eta_mod) / N_P2); + } + read = 1840 + (N_post / eta_mod); + index = (1840 / N_P2) + ((N_post / eta_mod) / N_P2); + for (int n = 0; n < N_P2; n++) { + for (int j = 0; j < C_P2 - (1840 / N_P2) - ((N_post / eta_mod) / N_P2); + j++) { + out[index++] = interleave[read++]; + count++; + } + index += C_P2 - (C_P2 - (1840 / N_P2) - ((N_post / eta_mod) / N_P2)); + } + index -= C_P2 - (C_P2 - (1840 / N_P2) - ((N_post / eta_mod) / N_P2)); + for (int j = 0; j < mapped_items - count; j++) { + out[index++] = interleave[read++]; + } + out += mapped_items; } - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (stream_items); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(stream_items); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - const int dvbt2_framemapper_cc_impl::ldpc_tab_1_4S[9][13]= - { - {12,6295,9626,304,7695,4839,4936,1660,144,11203,5567,6347,12557}, - {12,10691,4988,3859,3734,3071,3494,7687,10313,5964,8069,8296,11090}, - {12,10774,3613,5208,11177,7676,3549,8746,6583,7239,12265,2674,4292}, - {12,11869,3708,5981,8718,4908,10650,6805,3334,2627,10461,9285,11120}, - {3,7844,3079,10773,0,0,0,0,0,0,0,0,0}, - {3,3385,10854,5747,0,0,0,0,0,0,0,0,0}, - {3,1360,12010,12202,0,0,0,0,0,0,0,0,0}, - {3,6189,4241,2343,0,0,0,0,0,0,0,0,0}, - {3,9840,12726,4977,0,0,0,0,0,0,0,0,0} - }; +const int dvbt2_framemapper_cc_impl::ldpc_tab_1_4S[9][13] = { + { 12, 6295, 9626, 304, 7695, 4839, 4936, 1660, 144, 11203, 5567, 6347, 12557 }, + { 12, 10691, 4988, 3859, 3734, 3071, 3494, 7687, 10313, 5964, 8069, 8296, 11090 }, + { 12, 10774, 3613, 5208, 11177, 7676, 3549, 8746, 6583, 7239, 12265, 2674, 4292 }, + { 12, 11869, 3708, 5981, 8718, 4908, 10650, 6805, 3334, 2627, 10461, 9285, 11120 }, + { 3, 7844, 3079, 10773, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3385, 10854, 5747, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 1360, 12010, 12202, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 6189, 4241, 2343, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 9840, 12726, 4977, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; - const int dvbt2_framemapper_cc_impl::ldpc_tab_1_2S[20][9]= - { - {8,20,712,2386,6354,4061,1062,5045,5158}, - {8,21,2543,5748,4822,2348,3089,6328,5876}, - {8,22,926,5701,269,3693,2438,3190,3507}, - {8,23,2802,4520,3577,5324,1091,4667,4449}, - {8,24,5140,2003,1263,4742,6497,1185,6202}, - {3,0,4046,6934,0,0,0,0,0}, - {3,1,2855,66,0,0,0,0,0}, - {3,2,6694,212,0,0,0,0,0}, - {3,3,3439,1158,0,0,0,0,0}, - {3,4,3850,4422,0,0,0,0,0}, - {3,5,5924,290,0,0,0,0,0}, - {3,6,1467,4049,0,0,0,0,0}, - {3,7,7820,2242,0,0,0,0,0}, - {3,8,4606,3080,0,0,0,0,0}, - {3,9,4633,7877,0,0,0,0,0}, - {3,10,3884,6868,0,0,0,0,0}, - {3,11,8935,4996,0,0,0,0,0}, - {3,12,3028,764,0,0,0,0,0}, - {3,13,5988,1057,0,0,0,0,0}, - {3,14,7411,3450,0,0,0,0,0} - }; +const int dvbt2_framemapper_cc_impl::ldpc_tab_1_2S[20][9] = { + { 8, 20, 712, 2386, 6354, 4061, 1062, 5045, 5158 }, + { 8, 21, 2543, 5748, 4822, 2348, 3089, 6328, 5876 }, + { 8, 22, 926, 5701, 269, 3693, 2438, 3190, 3507 }, + { 8, 23, 2802, 4520, 3577, 5324, 1091, 4667, 4449 }, + { 8, 24, 5140, 2003, 1263, 4742, 6497, 1185, 6202 }, + { 3, 0, 4046, 6934, 0, 0, 0, 0, 0 }, + { 3, 1, 2855, 66, 0, 0, 0, 0, 0 }, + { 3, 2, 6694, 212, 0, 0, 0, 0, 0 }, + { 3, 3, 3439, 1158, 0, 0, 0, 0, 0 }, + { 3, 4, 3850, 4422, 0, 0, 0, 0, 0 }, + { 3, 5, 5924, 290, 0, 0, 0, 0, 0 }, + { 3, 6, 1467, 4049, 0, 0, 0, 0, 0 }, + { 3, 7, 7820, 2242, 0, 0, 0, 0, 0 }, + { 3, 8, 4606, 3080, 0, 0, 0, 0, 0 }, + { 3, 9, 4633, 7877, 0, 0, 0, 0, 0 }, + { 3, 10, 3884, 6868, 0, 0, 0, 0, 0 }, + { 3, 11, 8935, 4996, 0, 0, 0, 0, 0 }, + { 3, 12, 3028, 764, 0, 0, 0, 0, 0 }, + { 3, 13, 5988, 1057, 0, 0, 0, 0, 0 }, + { 3, 14, 7411, 3450, 0, 0, 0, 0, 0 } +}; - const int dvbt2_framemapper_cc_impl::pre_puncture[36] = - { - 27, 13, 29, 32, 5, 0, 11, 21, 33, 20, 25, 28, 18, 35, 8, 3, 9, 31, 22, 24, 7, 14, 17, 4, 2, 26, 16, 34, 19, 10, 12, 23, 1, 6, 30, 15 - }; +const int dvbt2_framemapper_cc_impl::pre_puncture[36] = { + 27, 13, 29, 32, 5, 0, 11, 21, 33, 20, 25, 28, 18, 35, 8, 3, 9, 31, + 22, 24, 7, 14, 17, 4, 2, 26, 16, 34, 19, 10, 12, 23, 1, 6, 30, 15 +}; - const int dvbt2_framemapper_cc_impl::post_padding_bqpsk[20] = - { - 18, 17, 16, 15, 14, 13, 12, 11, 4, 10, 9, 8, 3, 2, 7, 6, 5, 1, 19, 0 - }; +const int dvbt2_framemapper_cc_impl::post_padding_bqpsk[20] = { + 18, 17, 16, 15, 14, 13, 12, 11, 4, 10, 9, 8, 3, 2, 7, 6, 5, 1, 19, 0 +}; - const int dvbt2_framemapper_cc_impl::post_padding_16qam[20] = - { - 18, 17, 16, 15, 14, 13, 12, 11, 4, 10, 9, 8, 7, 3, 2, 1, 6, 5, 19, 0 - }; +const int dvbt2_framemapper_cc_impl::post_padding_16qam[20] = { + 18, 17, 16, 15, 14, 13, 12, 11, 4, 10, 9, 8, 7, 3, 2, 1, 6, 5, 19, 0 +}; - const int dvbt2_framemapper_cc_impl::post_padding_64qam[20] = - { - 18, 17, 16, 4, 15, 14, 13, 12, 3, 11, 10, 9, 2, 8, 7, 1, 6, 5, 19, 0 - }; +const int dvbt2_framemapper_cc_impl::post_padding_64qam[20] = { + 18, 17, 16, 4, 15, 14, 13, 12, 3, 11, 10, 9, 2, 8, 7, 1, 6, 5, 19, 0 +}; - const int dvbt2_framemapper_cc_impl::post_puncture_bqpsk[25] = - { - 6, 4, 18, 9, 13, 8, 15, 20, 5, 17, 2, 24, 10, 22, 12, 3, 16, 23, 1, 14, 0, 21, 19, 7, 11 - }; +const int dvbt2_framemapper_cc_impl::post_puncture_bqpsk[25] = { + 6, 4, 18, 9, 13, 8, 15, 20, 5, 17, 2, 24, 10, + 22, 12, 3, 16, 23, 1, 14, 0, 21, 19, 7, 11 +}; - const int dvbt2_framemapper_cc_impl::post_puncture_16qam[25] = - { - 6, 4, 13, 9, 18, 8, 15, 20, 5, 17, 2, 22, 24, 7, 12, 1, 16, 23, 14, 0, 21, 10, 19, 11, 3 - }; +const int dvbt2_framemapper_cc_impl::post_puncture_16qam[25] = { + 6, 4, 13, 9, 18, 8, 15, 20, 5, 17, 2, 22, 24, + 7, 12, 1, 16, 23, 14, 0, 21, 10, 19, 11, 3 +}; - const int dvbt2_framemapper_cc_impl::post_puncture_64qam[25] = - { - 6, 15, 13, 10, 3, 17, 21, 8, 5, 19, 2, 23, 16, 24, 7, 18, 1, 12, 20, 0, 4, 14, 9, 11, 22 - }; +const int dvbt2_framemapper_cc_impl::post_puncture_64qam[25] = { + 6, 15, 13, 10, 3, 17, 21, 8, 5, 19, 2, 23, 16, + 24, 7, 18, 1, 12, 20, 0, 4, 14, 9, 11, 22 +}; - const int dvbt2_framemapper_cc_impl::mux16[8] = - { - 7, 1, 3, 5, 2, 4, 6, 0 - }; +const int dvbt2_framemapper_cc_impl::mux16[8] = { 7, 1, 3, 5, 2, 4, 6, 0 }; - const int dvbt2_framemapper_cc_impl::mux64[12] = - { - 11, 8, 5, 2, 10, 7, 4, 1, 9, 6, 3, 0 - }; +const int dvbt2_framemapper_cc_impl::mux64[12] = { 11, 8, 5, 2, 10, 7, 4, 1, 9, 6, 3, 0 }; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.h b/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.h index 06998ebe73..dee5feb8c3 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.h +++ b/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.h @@ -34,7 +34,7 @@ #define KSIG_POST 350 #define NBCH_PARITY 168 -typedef struct{ +typedef struct { int type; int bwt_ext; int s1; @@ -63,9 +63,9 @@ typedef struct{ int t2_base_lite; int reserved; int crc_32; -}L1Pre; +} L1Pre; -typedef struct{ +typedef struct { int sub_slices_per_frame; int num_plp; int num_aux; @@ -106,103 +106,122 @@ typedef struct{ int plp_num_blocks; int reserved_4; int reserved_5; -}L1Post; +} L1Post; -typedef struct{ - L1Pre l1pre_data; - L1Post l1post_data; -}L1Signalling; +typedef struct { + L1Pre l1pre_data; + L1Post l1post_data; +} L1Signalling; -typedef struct{ +typedef struct { int table_length; int d[LDPC_ENCODE_TABLE_LENGTH]; int p[LDPC_ENCODE_TABLE_LENGTH]; -}l1pre_ldpc_encode_table; +} l1pre_ldpc_encode_table; -typedef struct{ +typedef struct { int table_length; int d[LDPC_ENCODE_TABLE_LENGTH]; int p[LDPC_ENCODE_TABLE_LENGTH]; -}l1post_ldpc_encode_table; +} l1post_ldpc_encode_table; namespace gr { - namespace dtv { - - class dvbt2_framemapper_cc_impl : public dvbt2_framemapper_cc - { - private: - int cell_size; - int stream_items; - int mapped_items; - int l1_constellation; - int fft_size; - int eta_mod; - int t2_frames; - int t2_frame_num; - int l1_scrambled; - int N_P2; - int C_P2; - int N_FC; - int C_FC; - int C_DATA; - int N_post; - int N_punc; - L1Signalling L1_Signalling[1]; - void add_l1pre(gr_complex *); - void add_l1post(gr_complex *, int); - int add_crc32_bits(unsigned char *, int); - unsigned int m_poly_s_12[6]; - int poly_mult(const int*, int, const int*, int, int*); - void poly_pack(const int*, unsigned int*, int); - void poly_reverse(int*, int*, int); - inline void reg_6_shift(unsigned int*); - void bch_poly_build_tables(void); - void l1pre_ldpc_lookup_generate(void); - void l1post_ldpc_lookup_generate(void); - void init_dummy_randomizer(void); - void init_l1_randomizer(void); - l1pre_ldpc_encode_table l1pre_ldpc_encode; - l1post_ldpc_encode_table l1post_ldpc_encode; - unsigned char l1_temp[FRAME_SIZE_SHORT]; - unsigned char l1_interleave[FRAME_SIZE_SHORT]; - unsigned char l1_map[KBCH_1_2]; - unsigned char l1_randomize[KBCH_1_2]; - gr_complex *zigzag_interleave; - gr_complex *dummy_randomize; - gr_complex l1pre_cache[1840]; - gr_complex unmodulated; - gr_complex m_bpsk[2]; - gr_complex m_qpsk[4]; - gr_complex m_16qam[16]; - gr_complex m_64qam[64]; - - const static int ldpc_tab_1_4S[9][13]; - const static int ldpc_tab_1_2S[20][9]; - - const static int pre_puncture[36]; - const static int post_padding_bqpsk[20]; - const static int post_padding_16qam[20]; - const static int post_padding_64qam[20]; - const static int post_puncture_bqpsk[25]; - const static int post_puncture_16qam[25]; - const static int post_puncture_64qam[25]; - - const static int mux16[8]; - const static int mux64[12]; - - public: - dvbt2_framemapper_cc_impl(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation, dvbt2_rotation_t rotation, int fecblocks, int tiblocks, dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvb_guardinterval_t guardinterval, dvbt2_l1constellation_t l1constellation, dvbt2_pilotpattern_t pilotpattern, int t2frames, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, dvbt2_preamble_t preamble, dvbt2_inputmode_t inputmode, dvbt2_reservedbiasbits_t reservedbiasbits, dvbt2_l1scrambled_t l1scrambled, dvbt2_inband_t inband); - ~dvbt2_framemapper_cc_impl(); - - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class dvbt2_framemapper_cc_impl : public dvbt2_framemapper_cc +{ +private: + int cell_size; + int stream_items; + int mapped_items; + int l1_constellation; + int fft_size; + int eta_mod; + int t2_frames; + int t2_frame_num; + int l1_scrambled; + int N_P2; + int C_P2; + int N_FC; + int C_FC; + int C_DATA; + int N_post; + int N_punc; + L1Signalling L1_Signalling[1]; + void add_l1pre(gr_complex*); + void add_l1post(gr_complex*, int); + int add_crc32_bits(unsigned char*, int); + unsigned int m_poly_s_12[6]; + int poly_mult(const int*, int, const int*, int, int*); + void poly_pack(const int*, unsigned int*, int); + void poly_reverse(int*, int*, int); + inline void reg_6_shift(unsigned int*); + void bch_poly_build_tables(void); + void l1pre_ldpc_lookup_generate(void); + void l1post_ldpc_lookup_generate(void); + void init_dummy_randomizer(void); + void init_l1_randomizer(void); + l1pre_ldpc_encode_table l1pre_ldpc_encode; + l1post_ldpc_encode_table l1post_ldpc_encode; + unsigned char l1_temp[FRAME_SIZE_SHORT]; + unsigned char l1_interleave[FRAME_SIZE_SHORT]; + unsigned char l1_map[KBCH_1_2]; + unsigned char l1_randomize[KBCH_1_2]; + gr_complex* zigzag_interleave; + gr_complex* dummy_randomize; + gr_complex l1pre_cache[1840]; + gr_complex unmodulated; + gr_complex m_bpsk[2]; + gr_complex m_qpsk[4]; + gr_complex m_16qam[16]; + gr_complex m_64qam[64]; + + const static int ldpc_tab_1_4S[9][13]; + const static int ldpc_tab_1_2S[20][9]; + + const static int pre_puncture[36]; + const static int post_padding_bqpsk[20]; + const static int post_padding_16qam[20]; + const static int post_padding_64qam[20]; + const static int post_puncture_bqpsk[25]; + const static int post_puncture_16qam[25]; + const static int post_puncture_64qam[25]; + + const static int mux16[8]; + const static int mux64[12]; + +public: + dvbt2_framemapper_cc_impl(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation, + dvbt2_rotation_t rotation, + int fecblocks, + int tiblocks, + dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvb_guardinterval_t guardinterval, + dvbt2_l1constellation_t l1constellation, + dvbt2_pilotpattern_t pilotpattern, + int t2frames, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + dvbt2_preamble_t preamble, + dvbt2_inputmode_t inputmode, + dvbt2_reservedbiasbits_t reservedbiasbits, + dvbt2_l1scrambled_t l1scrambled, + dvbt2_inband_t inband); + ~dvbt2_framemapper_cc_impl(); + + void forecast(int noutput_items, gr_vector_int& ninput_items_required); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_FRAMEMAPPER_CC_IMPL_H */ diff --git a/gr-dtv/lib/dvbt2/dvbt2_freqinterleaver_cc_impl.cc b/gr-dtv/lib/dvbt2/dvbt2_freqinterleaver_cc_impl.cc index bda49e9540..aee8793720 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_freqinterleaver_cc_impl.cc +++ b/gr-dtv/lib/dvbt2/dvbt2_freqinterleaver_cc_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,853 +26,837 @@ #include "dvbt2_freqinterleaver_cc_impl.h" namespace gr { - namespace dtv { +namespace dtv { - dvbt2_freqinterleaver_cc::sptr - dvbt2_freqinterleaver_cc::make(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, dvbt2_preamble_t preamble) - { - return gnuradio::get_initial_sptr - (new dvbt2_freqinterleaver_cc_impl(carriermode, fftsize, pilotpattern, guardinterval, numdatasyms, paprmode, version, preamble)); - } +dvbt2_freqinterleaver_cc::sptr +dvbt2_freqinterleaver_cc::make(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + dvbt2_preamble_t preamble) +{ + return gnuradio::get_initial_sptr(new dvbt2_freqinterleaver_cc_impl(carriermode, + fftsize, + pilotpattern, + guardinterval, + numdatasyms, + paprmode, + version, + preamble)); +} - /* - * The private constructor - */ - dvbt2_freqinterleaver_cc_impl::dvbt2_freqinterleaver_cc_impl(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, dvbt2_preamble_t preamble) - : gr::sync_block("dvbt2_freqinterleaver_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex))) - { - int max_states, xor_size, pn_mask, result; - int q_even = 0; - int q_odd = 0; - int q_evenP2 = 0; - int q_oddP2 = 0; - int q_evenFC = 0; - int q_oddFC = 0; - int lfsr = 0; - int logic1k[2] = {0, 4}; - int logic2k[2] = {0, 3}; - int logic4k[2] = {0, 2}; - int logic8k[4] = {0, 1, 4, 6}; - int logic16k[6] = {0, 1, 4, 5, 9, 11}; - int logic32k[4] = {0, 1, 2, 12}; - int *logic; - const int *bitpermeven, *bitpermodd; - int pn_degree, even, odd; - if ((preamble == PREAMBLE_T2_SISO) || (preamble == PREAMBLE_T2_LITE_SISO)) { +/* + * The private constructor + */ +dvbt2_freqinterleaver_cc_impl::dvbt2_freqinterleaver_cc_impl( + dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + dvbt2_preamble_t preamble) + : gr::sync_block("dvbt2_freqinterleaver_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) +{ + int max_states, xor_size, pn_mask, result; + int q_even = 0; + int q_odd = 0; + int q_evenP2 = 0; + int q_oddP2 = 0; + int q_evenFC = 0; + int q_oddFC = 0; + int lfsr = 0; + int logic1k[2] = { 0, 4 }; + int logic2k[2] = { 0, 3 }; + int logic4k[2] = { 0, 2 }; + int logic8k[4] = { 0, 1, 4, 6 }; + int logic16k[6] = { 0, 1, 4, 5, 9, 11 }; + int logic32k[4] = { 0, 1, 2, 12 }; + int* logic; + const int *bitpermeven, *bitpermodd; + int pn_degree, even, odd; + if ((preamble == PREAMBLE_T2_SISO) || (preamble == PREAMBLE_T2_LITE_SISO)) { switch (fftsize) { - case FFTSIZE_1K: + case FFTSIZE_1K: N_P2 = 16; C_P2 = 558; break; - case FFTSIZE_2K: + case FFTSIZE_2K: N_P2 = 8; C_P2 = 1118; break; - case FFTSIZE_4K: + case FFTSIZE_4K: N_P2 = 4; C_P2 = 2236; break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: N_P2 = 2; C_P2 = 4472; break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: N_P2 = 1; C_P2 = 8944; break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: N_P2 = 1; C_P2 = 22432; break; } - } - else { + } else { switch (fftsize) { - case FFTSIZE_1K: + case FFTSIZE_1K: N_P2 = 16; C_P2 = 546; break; - case FFTSIZE_2K: + case FFTSIZE_2K: N_P2 = 8; C_P2 = 1098; break; - case FFTSIZE_4K: + case FFTSIZE_4K: N_P2 = 4; C_P2 = 2198; break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: N_P2 = 2; C_P2 = 4398; break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: N_P2 = 1; C_P2 = 8814; break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: N_P2 = 1; C_P2 = 17612; break; } - } - switch (fftsize) { - case FFTSIZE_1K: - pn_degree = 9; - pn_mask = 0x1ff; - max_states = 1024; - logic = &logic1k[0]; - xor_size = 2; - bitpermeven = &bitperm1keven[0]; - bitpermodd = &bitperm1kodd[0]; - break; - case FFTSIZE_2K: - pn_degree = 10; - pn_mask = 0x3ff; - max_states = 2048; - logic = &logic2k[0]; - xor_size = 2; - bitpermeven = &bitperm2keven[0]; - bitpermodd = &bitperm2kodd[0]; - break; - case FFTSIZE_4K: - pn_degree = 11; - pn_mask = 0x7ff; - max_states = 4096; - logic = &logic4k[0]; - xor_size = 2; - bitpermeven = &bitperm4keven[0]; - bitpermodd = &bitperm4kodd[0]; - break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: - pn_degree = 12; - pn_mask = 0xfff; - max_states = 8192; - logic = &logic8k[0]; - xor_size = 4; - bitpermeven = &bitperm8keven[0]; - bitpermodd = &bitperm8kodd[0]; - break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: - pn_degree = 13; - pn_mask = 0x1fff; - max_states = 16384; - logic = &logic16k[0]; - xor_size = 6; - bitpermeven = &bitperm16keven[0]; - bitpermodd = &bitperm16kodd[0]; - break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: - pn_degree = 14; - pn_mask = 0x3fff; - max_states = 32768; - logic = &logic32k[0]; - xor_size = 4; - bitpermeven = &bitperm32k[0]; - bitpermodd = &bitperm32k[0]; - break; - default: - pn_degree = 0; - pn_mask = 0; - max_states = 0; - logic = &logic1k[0]; - xor_size = 0; - bitpermeven = &bitperm1keven[0]; - bitpermodd = &bitperm1kodd[0]; - break; - } - switch (fftsize) { - case FFTSIZE_1K: - switch (pilotpattern) { - case PILOT_PP1: - C_DATA = 764; - N_FC = 568; - C_FC = 402; - break; - case PILOT_PP2: - C_DATA = 768; - N_FC = 710; - C_FC = 654; - break; - case PILOT_PP3: - C_DATA = 798; - N_FC = 710; - C_FC = 490; - break; - case PILOT_PP4: - C_DATA = 804; - N_FC = 780; - C_FC = 707; - break; - case PILOT_PP5: - C_DATA = 818; - N_FC = 780; - C_FC = 544; - break; - case PILOT_PP6: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP7: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP8: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + switch (fftsize) { + case FFTSIZE_1K: + pn_degree = 9; + pn_mask = 0x1ff; + max_states = 1024; + logic = &logic1k[0]; + xor_size = 2; + bitpermeven = &bitperm1keven[0]; + bitpermodd = &bitperm1kodd[0]; + break; + case FFTSIZE_2K: + pn_degree = 10; + pn_mask = 0x3ff; + max_states = 2048; + logic = &logic2k[0]; + xor_size = 2; + bitpermeven = &bitperm2keven[0]; + bitpermodd = &bitperm2kodd[0]; + break; + case FFTSIZE_4K: + pn_degree = 11; + pn_mask = 0x7ff; + max_states = 4096; + logic = &logic4k[0]; + xor_size = 2; + bitpermeven = &bitperm4keven[0]; + bitpermodd = &bitperm4kodd[0]; + break; + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: + pn_degree = 12; + pn_mask = 0xfff; + max_states = 8192; + logic = &logic8k[0]; + xor_size = 4; + bitpermeven = &bitperm8keven[0]; + bitpermodd = &bitperm8kodd[0]; + break; + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: + pn_degree = 13; + pn_mask = 0x1fff; + max_states = 16384; + logic = &logic16k[0]; + xor_size = 6; + bitpermeven = &bitperm16keven[0]; + bitpermodd = &bitperm16kodd[0]; + break; + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: + pn_degree = 14; + pn_mask = 0x3fff; + max_states = 32768; + logic = &logic32k[0]; + xor_size = 4; + bitpermeven = &bitperm32k[0]; + bitpermodd = &bitperm32k[0]; + break; + default: + pn_degree = 0; + pn_mask = 0; + max_states = 0; + logic = &logic1k[0]; + xor_size = 0; + bitpermeven = &bitperm1keven[0]; + bitpermodd = &bitperm1kodd[0]; + break; + } + switch (fftsize) { + case FFTSIZE_1K: + switch (pilotpattern) { + case PILOT_PP1: + C_DATA = 764; + N_FC = 568; + C_FC = 402; + break; + case PILOT_PP2: + C_DATA = 768; + N_FC = 710; + C_FC = 654; + break; + case PILOT_PP3: + C_DATA = 798; + N_FC = 710; + C_FC = 490; + break; + case PILOT_PP4: + C_DATA = 804; + N_FC = 780; + C_FC = 707; + break; + case PILOT_PP5: + C_DATA = 818; + N_FC = 780; + C_FC = 544; + break; + case PILOT_PP6: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP7: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP8: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 10; + C_DATA -= 10; } if (N_FC != 0) { - N_FC -= 10; + N_FC -= 10; } if (C_FC != 0) { - C_FC -= 10; + C_FC -= 10; } - } - break; - case FFTSIZE_2K: - switch (pilotpattern) { - case PILOT_PP1: - C_DATA = 1522; - N_FC = 1136; - C_FC = 804; - break; - case PILOT_PP2: - C_DATA = 1532; - N_FC = 1420; - C_FC = 1309; - break; - case PILOT_PP3: - C_DATA = 1596; - N_FC = 1420; - C_FC = 980; - break; - case PILOT_PP4: - C_DATA = 1602; - N_FC = 1562; - C_FC = 1415; - break; - case PILOT_PP5: - C_DATA = 1632; - N_FC = 1562; - C_FC = 1088; - break; - case PILOT_PP6: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP7: - C_DATA = 1646; - N_FC = 1632; - C_FC = 1396; - break; - case PILOT_PP8: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + break; + case FFTSIZE_2K: + switch (pilotpattern) { + case PILOT_PP1: + C_DATA = 1522; + N_FC = 1136; + C_FC = 804; + break; + case PILOT_PP2: + C_DATA = 1532; + N_FC = 1420; + C_FC = 1309; + break; + case PILOT_PP3: + C_DATA = 1596; + N_FC = 1420; + C_FC = 980; + break; + case PILOT_PP4: + C_DATA = 1602; + N_FC = 1562; + C_FC = 1415; + break; + case PILOT_PP5: + C_DATA = 1632; + N_FC = 1562; + C_FC = 1088; + break; + case PILOT_PP6: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP7: + C_DATA = 1646; + N_FC = 1632; + C_FC = 1396; + break; + case PILOT_PP8: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 18; + C_DATA -= 18; } if (N_FC != 0) { - N_FC -= 18; + N_FC -= 18; } if (C_FC != 0) { - C_FC -= 18; + C_FC -= 18; } - } - break; - case FFTSIZE_4K: - switch (pilotpattern) { - case PILOT_PP1: - C_DATA = 3084; - N_FC = 2272; - C_FC = 1609; - break; - case PILOT_PP2: - C_DATA = 3092; - N_FC = 2840; - C_FC = 2619; - break; - case PILOT_PP3: - C_DATA = 3228; - N_FC = 2840; - C_FC = 1961; - break; - case PILOT_PP4: - C_DATA = 3234; - N_FC = 3124; - C_FC = 2831; - break; - case PILOT_PP5: - C_DATA = 3298; - N_FC = 3124; - C_FC = 2177; - break; - case PILOT_PP6: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP7: - C_DATA = 3328; - N_FC = 3266; - C_FC = 2792; - break; - case PILOT_PP8: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + break; + case FFTSIZE_4K: + switch (pilotpattern) { + case PILOT_PP1: + C_DATA = 3084; + N_FC = 2272; + C_FC = 1609; + break; + case PILOT_PP2: + C_DATA = 3092; + N_FC = 2840; + C_FC = 2619; + break; + case PILOT_PP3: + C_DATA = 3228; + N_FC = 2840; + C_FC = 1961; + break; + case PILOT_PP4: + C_DATA = 3234; + N_FC = 3124; + C_FC = 2831; + break; + case PILOT_PP5: + C_DATA = 3298; + N_FC = 3124; + C_FC = 2177; + break; + case PILOT_PP6: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP7: + C_DATA = 3328; + N_FC = 3266; + C_FC = 2792; + break; + case PILOT_PP8: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 36; + C_DATA -= 36; } if (N_FC != 0) { - N_FC -= 36; + N_FC -= 36; } if (C_FC != 0) { - C_FC -= 36; + C_FC -= 36; } - } - break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 6208; N_FC = 4544; C_FC = 3218; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 6214; N_FC = 5680; C_FC = 5238; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 6494; N_FC = 5680; C_FC = 3922; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 6498; N_FC = 6248; C_FC = 5662; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 6634; N_FC = 6248; C_FC = 4354; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 6698; N_FC = 6532; C_FC = 5585; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 6698; N_FC = 0; C_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 6296; N_FC = 4608; C_FC = 3264; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 6298; N_FC = 5760; C_FC = 5312; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 6584; N_FC = 5760; C_FC = 3978; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 6588; N_FC = 6336; C_FC = 5742; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 6728; N_FC = 6336; C_FC = 4416; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 6788; N_FC = 6624; C_FC = 5664; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 6788; N_FC = 0; C_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 72; + C_DATA -= 72; } if (N_FC != 0) { - N_FC -= 72; + N_FC -= 72; } if (C_FC != 0) { - C_FC -= 72; + C_FC -= 72; } - } - break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 12418; N_FC = 9088; C_FC = 6437; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 12436; N_FC = 11360; C_FC = 10476; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 12988; N_FC = 11360; C_FC = 7845; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 13002; N_FC = 12496; C_FC = 11324; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 13272; N_FC = 12496; C_FC = 8709; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 13288; N_FC = 13064; C_FC = 11801; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 13416; N_FC = 13064; C_FC = 11170; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 13406; N_FC = 0; C_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 12678; N_FC = 9280; C_FC = 6573; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 12698; N_FC = 11600; C_FC = 10697; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 13262; N_FC = 11600; C_FC = 8011; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 13276; N_FC = 12760; C_FC = 11563; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 13552; N_FC = 12760; C_FC = 8893; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 13568; N_FC = 13340; C_FC = 12051; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 13698; N_FC = 13340; C_FC = 11406; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 13688; N_FC = 0; C_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 144; + C_DATA -= 144; } if (N_FC != 0) { - N_FC -= 144; + N_FC -= 144; } if (C_FC != 0) { - C_FC -= 144; + C_FC -= 144; } - } - break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 24886; N_FC = 22720; C_FC = 20952; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 26022; N_FC = 24992; C_FC = 22649; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 26592; N_FC = 26128; C_FC = 23603; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 26836; N_FC = 0; C_FC = 0; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 26812; N_FC = 0; C_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 25412; N_FC = 23200; C_FC = 21395; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 26572; N_FC = 25520; C_FC = 23127; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 27152; N_FC = 26680; C_FC = 24102; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 27404; N_FC = 0; C_FC = 0; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 27376; N_FC = 0; C_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 288; + C_DATA -= 288; } if (N_FC != 0) { - N_FC -= 288; + N_FC -= 288; } if (C_FC != 0) { - C_FC -= 288; + C_FC -= 288; } - } - break; - } - if ((preamble == PREAMBLE_T2_SISO) || (preamble == PREAMBLE_T2_LITE_SISO)) { + } + break; + } + if ((preamble == PREAMBLE_T2_SISO) || (preamble == PREAMBLE_T2_LITE_SISO)) { if (guardinterval == GI_1_128 && pilotpattern == PILOT_PP7) { - N_FC = 0; - C_FC = 0; + N_FC = 0; + C_FC = 0; } if (guardinterval == GI_1_32 && pilotpattern == PILOT_PP4) { - N_FC = 0; - C_FC = 0; + N_FC = 0; + C_FC = 0; } if (guardinterval == GI_1_16 && pilotpattern == PILOT_PP2) { - N_FC = 0; - C_FC = 0; + N_FC = 0; + C_FC = 0; } if (guardinterval == GI_19_256 && pilotpattern == PILOT_PP2) { - N_FC = 0; - C_FC = 0; + N_FC = 0; + C_FC = 0; } - } - for (int i = 0; i < max_states; i++) { + } + for (int i = 0; i < max_states; i++) { if (i == 0 || i == 1) { - lfsr = 0; - } - else if (i == 2) { - lfsr = 1; - } - else { - result = 0; - for (int k = 0; k < xor_size; k++) { - result ^= (lfsr >> logic[k]) & 1; - } - lfsr &= pn_mask; - lfsr >>= 1; - lfsr |= result << (pn_degree - 1); + lfsr = 0; + } else if (i == 2) { + lfsr = 1; + } else { + result = 0; + for (int k = 0; k < xor_size; k++) { + result ^= (lfsr >> logic[k]) & 1; + } + lfsr &= pn_mask; + lfsr >>= 1; + lfsr |= result << (pn_degree - 1); } even = 0; odd = 0; for (int n = 0; n < pn_degree; n++) { - even |= ((lfsr >> n) & 0x1) << bitpermeven[n]; + even |= ((lfsr >> n) & 0x1) << bitpermeven[n]; } for (int n = 0; n < pn_degree; n++) { - odd |= ((lfsr >> n) & 0x1) << bitpermodd[n]; + odd |= ((lfsr >> n) & 0x1) << bitpermodd[n]; } even = even + ((i % 2) * (max_states / 2)); odd = odd + ((i % 2) * (max_states / 2)); if (even < C_DATA) { - Heven[q_even++] = even; + Heven[q_even++] = even; } if (odd < C_DATA) { - Hodd[q_odd++] = odd; + Hodd[q_odd++] = odd; } if (even < C_P2) { - HevenP2[q_evenP2++] = even; + HevenP2[q_evenP2++] = even; } if (odd < C_P2) { - HoddP2[q_oddP2++] = odd; + HoddP2[q_oddP2++] = odd; } if (even < N_FC) { - HevenFC[q_evenFC++] = even; + HevenFC[q_evenFC++] = even; } if (odd < N_FC) { - HoddFC[q_oddFC++] = odd; + HoddFC[q_oddFC++] = odd; } - } - if (fftsize == FFTSIZE_32K || fftsize == FFTSIZE_32K_T2GI) { + } + if (fftsize == FFTSIZE_32K || fftsize == FFTSIZE_32K_T2GI) { for (int j = 0; j < q_odd; j++) { - int a; - a = Hodd[j]; - Heven[a] = j; + int a; + a = Hodd[j]; + Heven[a] = j; } for (int j = 0; j < q_oddP2; j++) { - int a; - a = HoddP2[j]; - HevenP2[a] = j; + int a; + a = HoddP2[j]; + HevenP2[a] = j; } for (int j = 0; j < q_oddFC; j++) { - int a; - a = HoddFC[j]; - HevenFC[a] = j; + int a; + a = HoddFC[j]; + HevenFC[a] = j; } - } - if (N_FC == 0) { + } + if (N_FC == 0) { set_output_multiple((N_P2 * C_P2) + (numdatasyms * C_DATA)); interleaved_items = (N_P2 * C_P2) + (numdatasyms * C_DATA); num_data_symbols = numdatasyms; - } - else { + } else { set_output_multiple((N_P2 * C_P2) + ((numdatasyms - 1) * C_DATA) + N_FC); interleaved_items = (N_P2 * C_P2) + ((numdatasyms - 1) * C_DATA) + N_FC; num_data_symbols = numdatasyms - 1; - } } +} - /* - * Our virtual destructor. - */ - dvbt2_freqinterleaver_cc_impl::~dvbt2_freqinterleaver_cc_impl() - { - } +/* + * Our virtual destructor. + */ +dvbt2_freqinterleaver_cc_impl::~dvbt2_freqinterleaver_cc_impl() {} - int - dvbt2_freqinterleaver_cc_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - int symbol = 0; - int *H; +int dvbt2_freqinterleaver_cc_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + gr_complex* out = (gr_complex*)output_items[0]; + int symbol = 0; + int* H; - for (int i = 0; i < noutput_items; i += interleaved_items) { + for (int i = 0; i < noutput_items; i += interleaved_items) { for (int j = 0; j < N_P2; j++) { - if ((symbol % 2) == 0) { - H = HevenP2; - } - else { - H = HoddP2; - } - for (int j = 0; j < C_P2; j++) { - *out++ = in[H[j]]; - } - symbol++; - in += C_P2; + if ((symbol % 2) == 0) { + H = HevenP2; + } else { + H = HoddP2; + } + for (int j = 0; j < C_P2; j++) { + *out++ = in[H[j]]; + } + symbol++; + in += C_P2; } for (int j = 0; j < num_data_symbols; j++) { - if ((symbol % 2) == 0) { - H = Heven; - } - else { - H = Hodd; - } - for (int j = 0; j < C_DATA; j++) { - *out++ = in[H[j]]; - } - symbol++; - in += C_DATA; + if ((symbol % 2) == 0) { + H = Heven; + } else { + H = Hodd; + } + for (int j = 0; j < C_DATA; j++) { + *out++ = in[H[j]]; + } + symbol++; + in += C_DATA; } if (N_FC != 0) { - if ((symbol % 2) == 0) { - H = HevenFC; - } - else { - H = HoddFC; - } - for (int j = 0; j < N_FC; j++) { - *out++ = in[H[j]]; - } - symbol++; - in += N_FC; - } - } - - // Tell runtime system how many output items we produced. - return noutput_items; + if ((symbol % 2) == 0) { + H = HevenFC; + } else { + H = HoddFC; + } + for (int j = 0; j < N_FC; j++) { + *out++ = in[H[j]]; + } + symbol++; + in += N_FC; + } } - const int dvbt2_freqinterleaver_cc_impl::bitperm1keven[9] = - { - 8, 7, 6, 5, 0, 1, 2, 3, 4 - }; + // Tell runtime system how many output items we produced. + return noutput_items; +} - const int dvbt2_freqinterleaver_cc_impl::bitperm1kodd[9] = - { - 6, 8, 7, 4, 1, 0, 5, 2, 3 - }; +const int dvbt2_freqinterleaver_cc_impl::bitperm1keven[9] = { 8, 7, 6, 5, 0, 1, 2, 3, 4 }; - const int dvbt2_freqinterleaver_cc_impl::bitperm2keven[10] = - { - 4, 3, 9, 6, 2, 8, 1, 5, 7, 0 - }; +const int dvbt2_freqinterleaver_cc_impl::bitperm1kodd[9] = { 6, 8, 7, 4, 1, 0, 5, 2, 3 }; - const int dvbt2_freqinterleaver_cc_impl::bitperm2kodd[10] = - { - 6, 9, 4, 8, 5, 1, 0, 7, 2, 3 - }; +const int dvbt2_freqinterleaver_cc_impl::bitperm2keven[10] = { 4, 3, 9, 6, 2, + 8, 1, 5, 7, 0 }; - const int dvbt2_freqinterleaver_cc_impl::bitperm4keven[11] = - { - 6, 3, 0, 9, 4, 2, 1, 8, 5, 10, 7 - }; +const int dvbt2_freqinterleaver_cc_impl::bitperm2kodd[10] = { + 6, 9, 4, 8, 5, 1, 0, 7, 2, 3 +}; - const int dvbt2_freqinterleaver_cc_impl::bitperm4kodd[11] = - { - 5, 9, 1, 4, 3, 0, 8, 10, 7, 2, 6 - }; +const int dvbt2_freqinterleaver_cc_impl::bitperm4keven[11] = { 6, 3, 0, 9, 4, 2, + 1, 8, 5, 10, 7 }; - const int dvbt2_freqinterleaver_cc_impl::bitperm8keven[12] = - { - 7, 1, 4, 2, 9, 6, 8, 10, 0, 3, 11, 5 - }; +const int dvbt2_freqinterleaver_cc_impl::bitperm4kodd[11] = { 5, 9, 1, 4, 3, 0, + 8, 10, 7, 2, 6 }; - const int dvbt2_freqinterleaver_cc_impl::bitperm8kodd[12] = - { - 11, 4, 9, 3, 1, 2, 5, 0, 6, 7, 10, 8 - }; +const int dvbt2_freqinterleaver_cc_impl::bitperm8keven[12] = { 7, 1, 4, 2, 9, 6, + 8, 10, 0, 3, 11, 5 }; - const int dvbt2_freqinterleaver_cc_impl::bitperm16keven[13] = - { - 9, 7, 6, 10, 12, 5, 1, 11, 0, 2, 3, 4, 8 - }; +const int dvbt2_freqinterleaver_cc_impl::bitperm8kodd[12] = { 11, 4, 9, 3, 1, 2, + 5, 0, 6, 7, 10, 8 }; - const int dvbt2_freqinterleaver_cc_impl::bitperm16kodd[13] = - { - 6, 8, 10, 12, 2, 0, 4, 1, 11, 3, 5, 9, 7 - }; +const int dvbt2_freqinterleaver_cc_impl::bitperm16keven[13] = { 9, 7, 6, 10, 12, 5, 1, + 11, 0, 2, 3, 4, 8 }; - const int dvbt2_freqinterleaver_cc_impl::bitperm32k[14] = - { - 7, 13, 3, 4, 9, 2, 12, 11, 1, 8, 10, 0, 5, 6 - }; +const int dvbt2_freqinterleaver_cc_impl::bitperm16kodd[13] = { 6, 8, 10, 12, 2, 0, 4, + 1, 11, 3, 5, 9, 7 }; - } /* namespace dtv */ -} /* namespace gr */ +const int dvbt2_freqinterleaver_cc_impl::bitperm32k[14] = { 7, 13, 3, 4, 9, 2, 12, + 11, 1, 8, 10, 0, 5, 6 }; +} /* namespace dtv */ +} /* namespace gr */ diff --git a/gr-dtv/lib/dvbt2/dvbt2_freqinterleaver_cc_impl.h b/gr-dtv/lib/dvbt2/dvbt2_freqinterleaver_cc_impl.h index 7e4fd08314..77585300a4 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_freqinterleaver_cc_impl.h +++ b/gr-dtv/lib/dvbt2/dvbt2_freqinterleaver_cc_impl.h @@ -26,47 +26,54 @@ #include <gnuradio/dtv/dvbt2_freqinterleaver_cc.h> namespace gr { - namespace dtv { +namespace dtv { - class dvbt2_freqinterleaver_cc_impl : public dvbt2_freqinterleaver_cc - { - private: - int interleaved_items; - int num_data_symbols; - int Heven[32768]; - int Hodd[32768]; - int HevenP2[32768]; - int HoddP2[32768]; - int HevenFC[32768]; - int HoddFC[32768]; - int N_P2; - int C_P2; - int N_FC; - int C_FC; - int C_DATA; +class dvbt2_freqinterleaver_cc_impl : public dvbt2_freqinterleaver_cc +{ +private: + int interleaved_items; + int num_data_symbols; + int Heven[32768]; + int Hodd[32768]; + int HevenP2[32768]; + int HoddP2[32768]; + int HevenFC[32768]; + int HoddFC[32768]; + int N_P2; + int C_P2; + int N_FC; + int C_FC; + int C_DATA; - const static int bitperm1keven[9]; - const static int bitperm1kodd[9]; - const static int bitperm2keven[10]; - const static int bitperm2kodd[10]; - const static int bitperm4keven[11]; - const static int bitperm4kodd[11]; - const static int bitperm8keven[12]; - const static int bitperm8kodd[12]; - const static int bitperm16keven[13]; - const static int bitperm16kodd[13]; - const static int bitperm32k[14]; + const static int bitperm1keven[9]; + const static int bitperm1kodd[9]; + const static int bitperm2keven[10]; + const static int bitperm2kodd[10]; + const static int bitperm4keven[11]; + const static int bitperm4kodd[11]; + const static int bitperm8keven[12]; + const static int bitperm8kodd[12]; + const static int bitperm16keven[13]; + const static int bitperm16kodd[13]; + const static int bitperm32k[14]; - public: - dvbt2_freqinterleaver_cc_impl(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, dvbt2_preamble_t preamble); - ~dvbt2_freqinterleaver_cc_impl(); +public: + dvbt2_freqinterleaver_cc_impl(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + dvbt2_preamble_t preamble); + ~dvbt2_freqinterleaver_cc_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_FREQINTERLEAVER_CC_IMPL_H */ diff --git a/gr-dtv/lib/dvbt2/dvbt2_interleaver_bb_impl.cc b/gr-dtv/lib/dvbt2/dvbt2_interleaver_bb_impl.cc index 6dc49bff7a..74f49d30ae 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_interleaver_bb_impl.cc +++ b/gr-dtv/lib/dvbt2/dvbt2_interleaver_bb_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016,2018,2019 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,204 +26,203 @@ #include "dvbt2_interleaver_bb_impl.h" namespace gr { - namespace dtv { - - dvbt2_interleaver_bb::sptr - dvbt2_interleaver_bb::make(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation) - { - return gnuradio::get_initial_sptr - (new dvbt2_interleaver_bb_impl(framesize, rate, constellation)); - } - - /* - * The private constructor - */ - dvbt2_interleaver_bb_impl::dvbt2_interleaver_bb_impl(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation) - : gr::block("dvbt2_interleaver_bb", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(unsigned char))) - { - signal_constellation = constellation; - code_rate = rate; - if (framesize == FECFRAME_NORMAL) { +namespace dtv { + +dvbt2_interleaver_bb::sptr dvbt2_interleaver_bb::make(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation) +{ + return gnuradio::get_initial_sptr( + new dvbt2_interleaver_bb_impl(framesize, rate, constellation)); +} + +/* + * The private constructor + */ +dvbt2_interleaver_bb_impl::dvbt2_interleaver_bb_impl(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation) + : gr::block("dvbt2_interleaver_bb", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(unsigned char))) +{ + signal_constellation = constellation; + code_rate = rate; + if (framesize == FECFRAME_NORMAL) { frame_size = FRAME_SIZE_NORMAL; switch (rate) { - case C1_2: + case C1_2: nbch = 32400; q_val = 90; break; - case C3_5: + case C3_5: nbch = 38880; q_val = 72; break; - case C2_3: + case C2_3: nbch = 43200; q_val = 60; break; - case C3_4: + case C3_4: nbch = 48600; q_val = 45; break; - case C4_5: + case C4_5: nbch = 51840; q_val = 36; break; - case C5_6: + case C5_6: nbch = 54000; q_val = 30; break; - default: + default: nbch = 0; q_val = 0; break; } - } - else { + } else { frame_size = FRAME_SIZE_SHORT; switch (rate) { - case C1_3: + case C1_3: nbch = 5400; q_val = 30; break; - case C2_5: + case C2_5: nbch = 6480; q_val = 27; break; - case C1_2: + case C1_2: nbch = 7200; q_val = 25; break; - case C3_5: + case C3_5: nbch = 9720; q_val = 18; break; - case C2_3: + case C2_3: nbch = 10800; q_val = 15; break; - case C3_4: + case C3_4: nbch = 11880; q_val = 12; break; - case C4_5: + case C4_5: nbch = 12600; q_val = 10; break; - case C5_6: + case C5_6: nbch = 13320; q_val = 8; break; - default: + default: nbch = 0; q_val = 0; break; } - } - switch (constellation) { - case MOD_QPSK: - mod = 2; - set_output_multiple(frame_size / mod); - packed_items = frame_size / mod; - break; - case MOD_16QAM: - mod = 4; - set_output_multiple(frame_size / mod); - packed_items = frame_size / mod; - break; - case MOD_64QAM: - mod = 6; - set_output_multiple(frame_size / mod); - packed_items = frame_size / mod; - break; - case MOD_256QAM: - mod = 8; - set_output_multiple(frame_size / mod); - packed_items = frame_size / mod; - break; - default: - mod = 1; - set_output_multiple(frame_size / mod); - packed_items = frame_size / mod; - break; - } - generate_lookup(); } + switch (constellation) { + case MOD_QPSK: + mod = 2; + set_output_multiple(frame_size / mod); + packed_items = frame_size / mod; + break; + case MOD_16QAM: + mod = 4; + set_output_multiple(frame_size / mod); + packed_items = frame_size / mod; + break; + case MOD_64QAM: + mod = 6; + set_output_multiple(frame_size / mod); + packed_items = frame_size / mod; + break; + case MOD_256QAM: + mod = 8; + set_output_multiple(frame_size / mod); + packed_items = frame_size / mod; + break; + default: + mod = 1; + set_output_multiple(frame_size / mod); + packed_items = frame_size / mod; + break; + } + generate_lookup(); +} - inline void - dvbt2_interleaver_bb_impl::interleave_parity_bits(int *tempu, const int *&in) - { - for (int k = 0; k < nbch; k++) { +inline void dvbt2_interleaver_bb_impl::interleave_parity_bits(int* tempu, const int*& in) +{ + for (int k = 0; k < nbch; k++) { tempu[k] = *in++; - } - for (int t = 0; t < q_val; t++) { + } + for (int t = 0; t < q_val; t++) { for (int s = 0; s < 360; s++) { - tempu[nbch + (360 * t) + s] = in[(q_val * s) + t]; + tempu[nbch + (360 * t) + s] = in[(q_val * s) + t]; } - } - in = in + (q_val * 360); } - - inline void - dvbt2_interleaver_bb_impl::twist_interleave_columns(int* tempv, int* tempu, int rows, int mod, const int *twist) - { - int index = 0, offset; - for (int col = 0; col < mod; col++) { + in = in + (q_val * 360); +} + +inline void dvbt2_interleaver_bb_impl::twist_interleave_columns( + int* tempv, int* tempu, int rows, int mod, const int* twist) +{ + int index = 0, offset; + for (int col = 0; col < mod; col++) { offset = twist[col]; for (int row = 0; row < rows; row++) { - tempv[offset + (rows * col)] = tempu[index++]; - offset++; - if (offset == rows) { - offset = 0; - } + tempv[offset + (rows * col)] = tempu[index++]; + offset++; + if (offset == rows) { + offset = 0; + } } - } } +} - void - dvbt2_interleaver_bb_impl::generate_lookup() - { - int rows, index = 0; - int *tempv; - int *tempu; - const int *twist; - const int *c1, *c2, *c3, *c4, *c5, *c6, *c7, *c8; - const int *c9, *c10, *c11, *c12, *c13, *c14, *c15, *c16; +void dvbt2_interleaver_bb_impl::generate_lookup() +{ + int rows, index = 0; + int* tempv; + int* tempu; + const int* twist; + const int *c1, *c2, *c3, *c4, *c5, *c6, *c7, *c8; + const int *c9, *c10, *c11, *c12, *c13, *c14, *c15, *c16; - tempv = new int[FRAME_SIZE_NORMAL]; - tempu = new int[FRAME_SIZE_NORMAL]; + tempv = new int[FRAME_SIZE_NORMAL]; + tempu = new int[FRAME_SIZE_NORMAL]; - for(int i = 0; i < FRAME_SIZE_NORMAL; i++) { + for (int i = 0; i < FRAME_SIZE_NORMAL; i++) { lookup_table[i] = i; - } + } - const int *in = &lookup_table[0]; + const int* in = &lookup_table[0]; - switch (signal_constellation) { - //ignore QPSK, not worth it, as there is no column interleaving - case MOD_16QAM: - rows = frame_size / (mod * 2); + switch (signal_constellation) { + // ignore QPSK, not worth it, as there is no column interleaving + case MOD_16QAM: + rows = frame_size / (mod * 2); - if (frame_size == FRAME_SIZE_NORMAL) { + if (frame_size == FRAME_SIZE_NORMAL) { twist = &twist16n[0]; - } - else { + } else { twist = &twist16s[0]; - } + } - interleave_parity_bits(tempu, in); + interleave_parity_bits(tempu, in); - c1 = &tempv[0]; - c2 = &tempv[rows]; - c3 = &tempv[rows * 2]; - c4 = &tempv[rows * 3]; - c5 = &tempv[rows * 4]; - c6 = &tempv[rows * 5]; - c7 = &tempv[rows * 6]; - c8 = &tempv[rows * 7]; + c1 = &tempv[0]; + c2 = &tempv[rows]; + c3 = &tempv[rows * 2]; + c4 = &tempv[rows * 3]; + c5 = &tempv[rows * 4]; + c6 = &tempv[rows * 5]; + c7 = &tempv[rows * 6]; + c8 = &tempv[rows * 7]; - twist_interleave_columns(tempv, tempu, rows, mod * 2, twist); + twist_interleave_columns(tempv, tempu, rows, mod * 2, twist); - for (int j = 0; j < rows; j++) { + for (int j = 0; j < rows; j++) { tempu[index++] = c1[j]; tempu[index++] = c2[j]; tempu[index++] = c3[j]; @@ -232,37 +231,36 @@ namespace gr { tempu[index++] = c6[j]; tempu[index++] = c7[j]; tempu[index++] = c8[j]; - } - break; + } + break; - case MOD_64QAM: - rows = frame_size / (mod * 2); + case MOD_64QAM: + rows = frame_size / (mod * 2); - if (frame_size == FRAME_SIZE_NORMAL) { + if (frame_size == FRAME_SIZE_NORMAL) { twist = twist64n; - } - else { + } else { twist = twist64s; - } - - interleave_parity_bits(tempu, in); - - c1 = &tempv[0]; - c2 = &tempv[rows]; - c3 = &tempv[rows * 2]; - c4 = &tempv[rows * 3]; - c5 = &tempv[rows * 4]; - c6 = &tempv[rows * 5]; - c7 = &tempv[rows * 6]; - c8 = &tempv[rows * 7]; - c9 = &tempv[rows * 8]; - c10 = &tempv[rows * 9]; - c11 = &tempv[rows * 10]; - c12 = &tempv[rows * 11]; - - twist_interleave_columns(tempv, tempu, rows, mod * 2, twist); - - for (int j = 0; j < rows; j++) { + } + + interleave_parity_bits(tempu, in); + + c1 = &tempv[0]; + c2 = &tempv[rows]; + c3 = &tempv[rows * 2]; + c4 = &tempv[rows * 3]; + c5 = &tempv[rows * 4]; + c6 = &tempv[rows * 5]; + c7 = &tempv[rows * 6]; + c8 = &tempv[rows * 7]; + c9 = &tempv[rows * 8]; + c10 = &tempv[rows * 9]; + c11 = &tempv[rows * 10]; + c12 = &tempv[rows * 11]; + + twist_interleave_columns(tempv, tempu, rows, mod * 2, twist); + + for (int j = 0; j < rows; j++) { tempu[index++] = c1[j]; tempu[index++] = c2[j]; tempu[index++] = c3[j]; @@ -275,11 +273,11 @@ namespace gr { tempu[index++] = c10[j]; tempu[index++] = c11[j]; tempu[index++] = c12[j]; - } - break; + } + break; - case MOD_256QAM: - if (frame_size == FRAME_SIZE_NORMAL) { + case MOD_256QAM: + if (frame_size == FRAME_SIZE_NORMAL) { rows = frame_size / (mod * 2); interleave_parity_bits(tempu, in); @@ -304,25 +302,24 @@ namespace gr { twist_interleave_columns(tempv, tempu, rows, mod * 2, twist256n); for (int j = 0; j < rows; j++) { - tempu[index++] = c1[j]; - tempu[index++] = c2[j]; - tempu[index++] = c3[j]; - tempu[index++] = c4[j]; - tempu[index++] = c5[j]; - tempu[index++] = c6[j]; - tempu[index++] = c7[j]; - tempu[index++] = c8[j]; - tempu[index++] = c9[j]; - tempu[index++] = c10[j]; - tempu[index++] = c11[j]; - tempu[index++] = c12[j]; - tempu[index++] = c13[j]; - tempu[index++] = c14[j]; - tempu[index++] = c15[j]; - tempu[index++] = c16[j]; + tempu[index++] = c1[j]; + tempu[index++] = c2[j]; + tempu[index++] = c3[j]; + tempu[index++] = c4[j]; + tempu[index++] = c5[j]; + tempu[index++] = c6[j]; + tempu[index++] = c7[j]; + tempu[index++] = c8[j]; + tempu[index++] = c9[j]; + tempu[index++] = c10[j]; + tempu[index++] = c11[j]; + tempu[index++] = c12[j]; + tempu[index++] = c13[j]; + tempu[index++] = c14[j]; + tempu[index++] = c15[j]; + tempu[index++] = c16[j]; } - } - else { //frame_size == FRAME_SIZE_SHORT + } else { // frame_size == FRAME_SIZE_SHORT rows = frame_size / mod; interleave_parity_bits(tempu, in); @@ -339,302 +336,241 @@ namespace gr { twist_interleave_columns(tempv, tempu, rows, mod, twist256s); for (int j = 0; j < rows; j++) { - tempu[index++] = c1[j]; - tempu[index++] = c2[j]; - tempu[index++] = c3[j]; - tempu[index++] = c4[j]; - tempu[index++] = c5[j]; - tempu[index++] = c6[j]; - tempu[index++] = c7[j]; - tempu[index++] = c8[j]; + tempu[index++] = c1[j]; + tempu[index++] = c2[j]; + tempu[index++] = c3[j]; + tempu[index++] = c4[j]; + tempu[index++] = c5[j]; + tempu[index++] = c6[j]; + tempu[index++] = c7[j]; + tempu[index++] = c8[j]; } - } - } - - //tempu now has the input indices interleaved correctly, so save it - memcpy(lookup_table, tempu, frame_size * sizeof(int)); - - delete[] tempu; - delete[] tempv; + } } - /* - * Our virtual destructor. - */ - dvbt2_interleaver_bb_impl::~dvbt2_interleaver_bb_impl() - { - } + // tempu now has the input indices interleaved correctly, so save it + memcpy(lookup_table, tempu, frame_size * sizeof(int)); - void - dvbt2_interleaver_bb_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = noutput_items * mod; - } + delete[] tempu; + delete[] tempv; +} - int - dvbt2_interleaver_bb_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; - int consumed = 0; - int produced = 0; - int rows, offset, index; - unsigned int pack; - const int *mux; - - switch (signal_constellation) { - case MOD_QPSK: - for (int i = 0; i < noutput_items; i += packed_items) { +/* + * Our virtual destructor. + */ +dvbt2_interleaver_bb_impl::~dvbt2_interleaver_bb_impl() {} + +void dvbt2_interleaver_bb_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = noutput_items * mod; +} + +int dvbt2_interleaver_bb_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; + int consumed = 0; + int produced = 0; + int rows, offset, index; + unsigned int pack; + const int* mux; + + switch (signal_constellation) { + case MOD_QPSK: + for (int i = 0; i < noutput_items; i += packed_items) { rows = frame_size / 2; if (code_rate == C1_3 || code_rate == C2_5) { - for (int k = 0; k < nbch; k++) { - tempu[k] = *in++; - } - for (int t = 0; t < q_val; t++) { - for (int s = 0; s < 360; s++) { - tempu[nbch + (360 * t) + s] = in[(q_val * s) + t]; + for (int k = 0; k < nbch; k++) { + tempu[k] = *in++; + } + for (int t = 0; t < q_val; t++) { + for (int s = 0; s < 360; s++) { + tempu[nbch + (360 * t) + s] = in[(q_val * s) + t]; + } + } + in = in + (q_val * 360); + index = 0; + for (int j = 0; j < rows; j++) { + out[produced] = tempu[index++] << 1; + out[produced++] |= tempu[index++]; + consumed += 2; + } + } else { + for (int j = 0; j < rows; j++) { + out[produced] = in[consumed++] << 1; + out[produced++] |= in[consumed++]; } - } - in = in + (q_val * 360); - index = 0; - for (int j = 0; j < rows; j++) { - out[produced] = tempu[index++] << 1; - out[produced++] |= tempu[index++]; - consumed += 2; - } - } - else { - for (int j = 0; j < rows; j++) { - out[produced] = in[consumed++] << 1; - out[produced++] |= in[consumed++]; - } } - } - break; + } + break; - case MOD_16QAM: - if (code_rate == C3_5 && frame_size == FRAME_SIZE_NORMAL) { + case MOD_16QAM: + if (code_rate == C3_5 && frame_size == FRAME_SIZE_NORMAL) { mux = &mux16_35[0]; - } - else if (code_rate == C1_3 && frame_size == FRAME_SIZE_SHORT) { + } else if (code_rate == C1_3 && frame_size == FRAME_SIZE_SHORT) { mux = &mux16_13[0]; - } - else if (code_rate == C2_5 && frame_size == FRAME_SIZE_SHORT) { + } else if (code_rate == C2_5 && frame_size == FRAME_SIZE_SHORT) { mux = &mux16_25[0]; - } - else { + } else { mux = &mux16[0]; - } - for (int i = 0; i < noutput_items; i += packed_items) { + } + for (int i = 0; i < noutput_items; i += packed_items) { index = 0; for (int d = 0; d < frame_size / (mod * 2); d++) { - pack = 0; - for (int e = 0; e < (mod * 2); e++) { - offset = mux[e]; - pack |= in[lookup_table[index++]] << (((mod * 2) - 1) - offset); - } - out[produced++] = pack >> 4; - out[produced++] = pack & 0xf; + pack = 0; + for (int e = 0; e < (mod * 2); e++) { + offset = mux[e]; + pack |= in[lookup_table[index++]] << (((mod * 2) - 1) - offset); + } + out[produced++] = pack >> 4; + out[produced++] = pack & 0xf; } consumed += frame_size; in += frame_size; - } - break; + } + break; - case MOD_64QAM: - if (code_rate == C3_5 && frame_size == FRAME_SIZE_NORMAL) { + case MOD_64QAM: + if (code_rate == C3_5 && frame_size == FRAME_SIZE_NORMAL) { mux = &mux64_35[0]; - } - else if (code_rate == C1_3 && frame_size == FRAME_SIZE_SHORT) { + } else if (code_rate == C1_3 && frame_size == FRAME_SIZE_SHORT) { mux = &mux64_13[0]; - } - else if (code_rate == C2_5 && frame_size == FRAME_SIZE_SHORT) { + } else if (code_rate == C2_5 && frame_size == FRAME_SIZE_SHORT) { mux = &mux64_25[0]; - } - else { + } else { mux = &mux64[0]; - } - for (int i = 0; i < noutput_items; i += packed_items) { + } + for (int i = 0; i < noutput_items; i += packed_items) { index = 0; for (int d = 0; d < frame_size / (mod * 2); d++) { - pack = 0; - for (int e = 0; e < (mod * 2); e++) { - offset = mux[e]; - pack |= in[lookup_table[index++]] << (((mod * 2) - 1) - offset); - } - out[produced++] = pack >> 6; - out[produced++] = pack & 0x3f; + pack = 0; + for (int e = 0; e < (mod * 2); e++) { + offset = mux[e]; + pack |= in[lookup_table[index++]] << (((mod * 2) - 1) - offset); + } + out[produced++] = pack >> 6; + out[produced++] = pack & 0x3f; } consumed += frame_size; in += frame_size; - } - break; + } + break; - case MOD_256QAM: - if (frame_size == FRAME_SIZE_NORMAL) { + case MOD_256QAM: + if (frame_size == FRAME_SIZE_NORMAL) { if (code_rate == C3_5) { - mux = &mux256_35[0]; - } - else if (code_rate == C2_3) { - mux = &mux256_23[0]; - } - else { - mux = &mux256[0]; + mux = &mux256_35[0]; + } else if (code_rate == C2_3) { + mux = &mux256_23[0]; + } else { + mux = &mux256[0]; } for (int i = 0; i < noutput_items; i += packed_items) { - index = 0; - for (int d = 0; d < frame_size / (mod * 2); d++) { - pack = 0; - for (int e = 0; e < (mod * 2); e++) { - offset = mux[e]; - pack |= in[lookup_table[index++]] << (((mod * 2) - 1) - offset); + index = 0; + for (int d = 0; d < frame_size / (mod * 2); d++) { + pack = 0; + for (int e = 0; e < (mod * 2); e++) { + offset = mux[e]; + pack |= in[lookup_table[index++]] << (((mod * 2) - 1) - offset); + } + out[produced++] = pack >> 8; + out[produced++] = pack & 0xff; } - out[produced++] = pack >> 8; - out[produced++] = pack & 0xff; - } - consumed += frame_size; - in += frame_size; + consumed += frame_size; + in += frame_size; } - } + } - else { //frame_size = FRAME_SIZE_SHORT + else { // frame_size = FRAME_SIZE_SHORT if (code_rate == C1_3) { - mux = &mux256s_13[0]; - } - else if (code_rate == C2_5) { - mux = &mux256s_25[0]; - } - else { - mux = &mux256s[0]; + mux = &mux256s_13[0]; + } else if (code_rate == C2_5) { + mux = &mux256s_25[0]; + } else { + mux = &mux256s[0]; } for (int i = 0; i < noutput_items; i += packed_items) { - index = 0; - for (int d = 0; d < frame_size / mod; d++) { - pack = 0; - for (int e = 0; e < mod; e++) { - offset = mux[e]; - pack |= in[lookup_table[index++]] << ((mod - 1) - offset); + index = 0; + for (int d = 0; d < frame_size / mod; d++) { + pack = 0; + for (int e = 0; e < mod; e++) { + offset = mux[e]; + pack |= in[lookup_table[index++]] << ((mod - 1) - offset); + } + out[produced++] = pack & 0xff; } - out[produced++] = pack & 0xff; - } - consumed += frame_size; - in += frame_size; + consumed += frame_size; + in += frame_size; } - } - break; - } + } + break; + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (consumed); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(consumed); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - const int dvbt2_interleaver_bb_impl::twist16n[8] = - { - 0, 0, 2, 4, 4, 5, 7, 7 - }; - - const int dvbt2_interleaver_bb_impl::twist64n[12] = - { - 0, 0, 2, 2, 3, 4, 4, 5, 5, 7, 8, 9 - }; - - const int dvbt2_interleaver_bb_impl::twist256n[16] = - { - 0, 2, 2, 2, 2, 3, 7, 15, 16, 20, 22, 22, 27, 27, 28, 32 - }; - - const int dvbt2_interleaver_bb_impl::twist16s[8] = - { - 0, 0, 0, 1, 7, 20, 20, 21 - }; - - const int dvbt2_interleaver_bb_impl::twist64s[12] = - { - 0, 0, 0, 2, 2, 2, 3, 3, 3, 6, 7, 7 - }; - - const int dvbt2_interleaver_bb_impl::twist256s[8] = - { - 0, 0, 0, 1, 7, 20, 20, 21 - }; - - const int dvbt2_interleaver_bb_impl::mux16[8] = - { - 7, 1, 4, 2, 5, 3, 6, 0 - }; - - const int dvbt2_interleaver_bb_impl::mux64[12] = - { - 11, 7, 3, 10, 6, 2, 9, 5, 1, 8, 4, 0 - }; - - const int dvbt2_interleaver_bb_impl::mux256[16] = - { - 15, 1, 13, 3, 8, 11, 9, 5, 10, 6, 4, 7, 12, 2, 14, 0 - }; - - const int dvbt2_interleaver_bb_impl::mux16_35[8] = - { - 0, 5, 1, 2, 4, 7, 3, 6 - }; - - const int dvbt2_interleaver_bb_impl::mux16_13[8] = - { - 6, 0, 3, 4, 5, 2, 1, 7 - }; - - const int dvbt2_interleaver_bb_impl::mux16_25[8] = - { - 7, 5, 4, 0, 3, 1, 2, 6 - }; - - const int dvbt2_interleaver_bb_impl::mux64_35[12] = - { - 2, 7, 6, 9, 0, 3, 1, 8, 4, 11, 5, 10 - }; - - const int dvbt2_interleaver_bb_impl::mux64_13[12] = - { - 4, 2, 0, 5, 6, 1, 3, 7, 8, 9, 10, 11 - }; - - const int dvbt2_interleaver_bb_impl::mux64_25[12] = - { - 4, 0, 1, 6, 2, 3, 5, 8, 7, 10, 9, 11 - }; - - const int dvbt2_interleaver_bb_impl::mux256_35[16] = - { - 2, 11, 3, 4, 0, 9, 1, 8, 10, 13, 7, 14, 6, 15, 5, 12 - }; - - const int dvbt2_interleaver_bb_impl::mux256_23[16] = - { - 7, 2, 9, 0, 4, 6, 13, 3, 14, 10, 15, 5, 8, 12, 11, 1 - }; - - const int dvbt2_interleaver_bb_impl::mux256s[8] = - { - 7, 3, 1, 5, 2, 6, 4, 0 - }; - - const int dvbt2_interleaver_bb_impl::mux256s_13[8] = - { - 4, 0, 1, 2, 5, 3, 6, 7 - }; - - const int dvbt2_interleaver_bb_impl::mux256s_25[8] = - { - 4, 0, 5, 1, 2, 3, 6, 7 - }; - - } /* namespace dtv */ -} /* namespace gr */ +const int dvbt2_interleaver_bb_impl::twist16n[8] = { 0, 0, 2, 4, 4, 5, 7, 7 }; + +const int dvbt2_interleaver_bb_impl::twist64n[12] = { + 0, 0, 2, 2, 3, 4, 4, 5, 5, 7, 8, 9 +}; + +const int dvbt2_interleaver_bb_impl::twist256n[16] = { 0, 2, 2, 2, 2, 3, 7, 15, + 16, 20, 22, 22, 27, 27, 28, 32 }; +const int dvbt2_interleaver_bb_impl::twist16s[8] = { 0, 0, 0, 1, 7, 20, 20, 21 }; + +const int dvbt2_interleaver_bb_impl::twist64s[12] = { + 0, 0, 0, 2, 2, 2, 3, 3, 3, 6, 7, 7 +}; + +const int dvbt2_interleaver_bb_impl::twist256s[8] = { 0, 0, 0, 1, 7, 20, 20, 21 }; + +const int dvbt2_interleaver_bb_impl::mux16[8] = { 7, 1, 4, 2, 5, 3, 6, 0 }; + +const int dvbt2_interleaver_bb_impl::mux64[12] = { 11, 7, 3, 10, 6, 2, 9, 5, 1, 8, 4, 0 }; + +const int dvbt2_interleaver_bb_impl::mux256[16] = { 15, 1, 13, 3, 8, 11, 9, 5, + 10, 6, 4, 7, 12, 2, 14, 0 }; + +const int dvbt2_interleaver_bb_impl::mux16_35[8] = { 0, 5, 1, 2, 4, 7, 3, 6 }; + +const int dvbt2_interleaver_bb_impl::mux16_13[8] = { 6, 0, 3, 4, 5, 2, 1, 7 }; + +const int dvbt2_interleaver_bb_impl::mux16_25[8] = { 7, 5, 4, 0, 3, 1, 2, 6 }; + +const int dvbt2_interleaver_bb_impl::mux64_35[12] = { + 2, 7, 6, 9, 0, 3, 1, 8, 4, 11, 5, 10 +}; + +const int dvbt2_interleaver_bb_impl::mux64_13[12] = { + 4, 2, 0, 5, 6, 1, 3, 7, 8, 9, 10, 11 +}; + +const int dvbt2_interleaver_bb_impl::mux64_25[12] = { + 4, 0, 1, 6, 2, 3, 5, 8, 7, 10, 9, 11 +}; + +const int dvbt2_interleaver_bb_impl::mux256_35[16] = { 2, 11, 3, 4, 0, 9, 1, 8, + 10, 13, 7, 14, 6, 15, 5, 12 }; + +const int dvbt2_interleaver_bb_impl::mux256_23[16] = { 7, 2, 9, 0, 4, 6, 13, 3, + 14, 10, 15, 5, 8, 12, 11, 1 }; + +const int dvbt2_interleaver_bb_impl::mux256s[8] = { 7, 3, 1, 5, 2, 6, 4, 0 }; + +const int dvbt2_interleaver_bb_impl::mux256s_13[8] = { 4, 0, 1, 2, 5, 3, 6, 7 }; + +const int dvbt2_interleaver_bb_impl::mux256s_25[8] = { 4, 0, 5, 1, 2, 3, 6, 7 }; + +} /* namespace dtv */ +} /* namespace gr */ diff --git a/gr-dtv/lib/dvbt2/dvbt2_interleaver_bb_impl.h b/gr-dtv/lib/dvbt2/dvbt2_interleaver_bb_impl.h index 59a89d9618..836a547bd6 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_interleaver_bb_impl.h +++ b/gr-dtv/lib/dvbt2/dvbt2_interleaver_bb_impl.h @@ -1,7 +1,7 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2018,2019 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) @@ -26,63 +26,66 @@ #include <gnuradio/dtv/dvbt2_interleaver_bb.h> namespace gr { - namespace dtv { - - class dvbt2_interleaver_bb_impl : public dvbt2_interleaver_bb - { - private: - int frame_size; - int signal_constellation; - int code_rate; - int nbch; - int q_val; - int mod; - int packed_items; - unsigned char tempu[FRAME_SIZE_NORMAL]; - int lookup_table[FRAME_SIZE_NORMAL]; - - void generate_lookup(); - inline void interleave_parity_bits(int *tempu, const int *&in); - inline void twist_interleave_columns(int* tempv, int* tempu, int rows, int mod, const int *twist); - - const static int twist16n[8]; - const static int twist64n[12]; - const static int twist256n[16]; - - const static int twist16s[8]; - const static int twist64s[12]; - const static int twist256s[8]; - - const static int mux16[8]; - const static int mux64[12]; - const static int mux256[16]; - - const static int mux16_35[8]; - const static int mux16_13[8]; - const static int mux16_25[8]; - const static int mux64_35[12]; - const static int mux64_13[12]; - const static int mux64_25[12]; - const static int mux256_35[16]; - const static int mux256_23[16]; - - const static int mux256s[8]; - const static int mux256s_13[8]; - const static int mux256s_25[8]; - - public: - dvbt2_interleaver_bb_impl(dvb_framesize_t framesize, dvb_code_rate_t rate, dvb_constellation_t constellation); - ~dvbt2_interleaver_bb_impl(); - - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class dvbt2_interleaver_bb_impl : public dvbt2_interleaver_bb +{ +private: + int frame_size; + int signal_constellation; + int code_rate; + int nbch; + int q_val; + int mod; + int packed_items; + unsigned char tempu[FRAME_SIZE_NORMAL]; + int lookup_table[FRAME_SIZE_NORMAL]; + + void generate_lookup(); + inline void interleave_parity_bits(int* tempu, const int*& in); + inline void + twist_interleave_columns(int* tempv, int* tempu, int rows, int mod, const int* twist); + + const static int twist16n[8]; + const static int twist64n[12]; + const static int twist256n[16]; + + const static int twist16s[8]; + const static int twist64s[12]; + const static int twist256s[8]; + + const static int mux16[8]; + const static int mux64[12]; + const static int mux256[16]; + + const static int mux16_35[8]; + const static int mux16_13[8]; + const static int mux16_25[8]; + const static int mux64_35[12]; + const static int mux64_13[12]; + const static int mux64_25[12]; + const static int mux256_35[16]; + const static int mux256_23[16]; + + const static int mux256s[8]; + const static int mux256s_13[8]; + const static int mux256s_25[8]; + +public: + dvbt2_interleaver_bb_impl(dvb_framesize_t framesize, + dvb_code_rate_t rate, + dvb_constellation_t constellation); + ~dvbt2_interleaver_bb_impl(); + + void forecast(int noutput_items, gr_vector_int& ninput_items_required); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_INTERLEAVER_BB_IMPL_H */ diff --git a/gr-dtv/lib/dvbt2/dvbt2_miso_cc_impl.cc b/gr-dtv/lib/dvbt2/dvbt2_miso_cc_impl.cc index a3d2684650..626fba2815 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_miso_cc_impl.cc +++ b/gr-dtv/lib/dvbt2/dvbt2_miso_cc_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -26,567 +26,568 @@ #include "dvbt2_miso_cc_impl.h" namespace gr { - namespace dtv { +namespace dtv { - dvbt2_miso_cc::sptr - dvbt2_miso_cc::make(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode) - { - return gnuradio::get_initial_sptr - (new dvbt2_miso_cc_impl(carriermode, fftsize, pilotpattern, guardinterval, numdatasyms, paprmode)); - } +dvbt2_miso_cc::sptr dvbt2_miso_cc::make(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode) +{ + return gnuradio::get_initial_sptr(new dvbt2_miso_cc_impl( + carriermode, fftsize, pilotpattern, guardinterval, numdatasyms, paprmode)); +} - /* - * The private constructor - */ - dvbt2_miso_cc_impl::dvbt2_miso_cc_impl(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode) - : gr::sync_block("dvbt2_miso_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(2, 2, sizeof(gr_complex))) - { - switch (fftsize) { - case FFTSIZE_1K: - N_P2 = 16; - C_P2 = 546; - break; - case FFTSIZE_2K: - N_P2 = 8; - C_P2 = 1098; - break; - case FFTSIZE_4K: - N_P2 = 4; - C_P2 = 2198; - break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: - N_P2 = 2; - C_P2 = 4398; - break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: - N_P2 = 1; - C_P2 = 8814; - break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: - N_P2 = 1; - C_P2 = 17612; - break; - } - switch (fftsize) { - case FFTSIZE_1K: - switch (pilotpattern) { - case PILOT_PP1: - C_DATA = 764; - N_FC = 568; - C_FC = 402; - break; - case PILOT_PP2: - C_DATA = 768; - N_FC = 710; - C_FC = 654; - break; - case PILOT_PP3: - C_DATA = 798; - N_FC = 710; - C_FC = 490; - break; - case PILOT_PP4: - C_DATA = 804; - N_FC = 780; - C_FC = 707; - break; - case PILOT_PP5: - C_DATA = 818; - N_FC = 780; - C_FC = 544; - break; - case PILOT_PP6: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP7: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP8: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { +/* + * The private constructor + */ +dvbt2_miso_cc_impl::dvbt2_miso_cc_impl(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode) + : gr::sync_block("dvbt2_miso_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(2, 2, sizeof(gr_complex))) +{ + switch (fftsize) { + case FFTSIZE_1K: + N_P2 = 16; + C_P2 = 546; + break; + case FFTSIZE_2K: + N_P2 = 8; + C_P2 = 1098; + break; + case FFTSIZE_4K: + N_P2 = 4; + C_P2 = 2198; + break; + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: + N_P2 = 2; + C_P2 = 4398; + break; + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: + N_P2 = 1; + C_P2 = 8814; + break; + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: + N_P2 = 1; + C_P2 = 17612; + break; + } + switch (fftsize) { + case FFTSIZE_1K: + switch (pilotpattern) { + case PILOT_PP1: + C_DATA = 764; + N_FC = 568; + C_FC = 402; + break; + case PILOT_PP2: + C_DATA = 768; + N_FC = 710; + C_FC = 654; + break; + case PILOT_PP3: + C_DATA = 798; + N_FC = 710; + C_FC = 490; + break; + case PILOT_PP4: + C_DATA = 804; + N_FC = 780; + C_FC = 707; + break; + case PILOT_PP5: + C_DATA = 818; + N_FC = 780; + C_FC = 544; + break; + case PILOT_PP6: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP7: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP8: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 10; + C_DATA -= 10; } if (N_FC != 0) { - N_FC -= 10; + N_FC -= 10; } if (C_FC != 0) { - C_FC -= 10; + C_FC -= 10; } - } - break; - case FFTSIZE_2K: - switch (pilotpattern) { - case PILOT_PP1: - C_DATA = 1522; - N_FC = 1136; - C_FC = 804; - break; - case PILOT_PP2: - C_DATA = 1532; - N_FC = 1420; - C_FC = 1309; - break; - case PILOT_PP3: - C_DATA = 1596; - N_FC = 1420; - C_FC = 980; - break; - case PILOT_PP4: - C_DATA = 1602; - N_FC = 1562; - C_FC = 1415; - break; - case PILOT_PP5: - C_DATA = 1632; - N_FC = 1562; - C_FC = 1088; - break; - case PILOT_PP6: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP7: - C_DATA = 1646; - N_FC = 1632; - C_FC = 1396; - break; - case PILOT_PP8: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + break; + case FFTSIZE_2K: + switch (pilotpattern) { + case PILOT_PP1: + C_DATA = 1522; + N_FC = 1136; + C_FC = 804; + break; + case PILOT_PP2: + C_DATA = 1532; + N_FC = 1420; + C_FC = 1309; + break; + case PILOT_PP3: + C_DATA = 1596; + N_FC = 1420; + C_FC = 980; + break; + case PILOT_PP4: + C_DATA = 1602; + N_FC = 1562; + C_FC = 1415; + break; + case PILOT_PP5: + C_DATA = 1632; + N_FC = 1562; + C_FC = 1088; + break; + case PILOT_PP6: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP7: + C_DATA = 1646; + N_FC = 1632; + C_FC = 1396; + break; + case PILOT_PP8: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 18; + C_DATA -= 18; } if (N_FC != 0) { - N_FC -= 18; + N_FC -= 18; } if (C_FC != 0) { - C_FC -= 18; + C_FC -= 18; } - } - break; - case FFTSIZE_4K: - switch (pilotpattern) { - case PILOT_PP1: - C_DATA = 3084; - N_FC = 2272; - C_FC = 1609; - break; - case PILOT_PP2: - C_DATA = 3092; - N_FC = 2840; - C_FC = 2619; - break; - case PILOT_PP3: - C_DATA = 3228; - N_FC = 2840; - C_FC = 1961; - break; - case PILOT_PP4: - C_DATA = 3234; - N_FC = 3124; - C_FC = 2831; - break; - case PILOT_PP5: - C_DATA = 3298; - N_FC = 3124; - C_FC = 2177; - break; - case PILOT_PP6: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP7: - C_DATA = 3328; - N_FC = 3266; - C_FC = 2792; - break; - case PILOT_PP8: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + break; + case FFTSIZE_4K: + switch (pilotpattern) { + case PILOT_PP1: + C_DATA = 3084; + N_FC = 2272; + C_FC = 1609; + break; + case PILOT_PP2: + C_DATA = 3092; + N_FC = 2840; + C_FC = 2619; + break; + case PILOT_PP3: + C_DATA = 3228; + N_FC = 2840; + C_FC = 1961; + break; + case PILOT_PP4: + C_DATA = 3234; + N_FC = 3124; + C_FC = 2831; + break; + case PILOT_PP5: + C_DATA = 3298; + N_FC = 3124; + C_FC = 2177; + break; + case PILOT_PP6: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP7: + C_DATA = 3328; + N_FC = 3266; + C_FC = 2792; + break; + case PILOT_PP8: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 36; + C_DATA -= 36; } if (N_FC != 0) { - N_FC -= 36; + N_FC -= 36; } if (C_FC != 0) { - C_FC -= 36; + C_FC -= 36; } - } - break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 6208; N_FC = 4544; C_FC = 3218; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 6214; N_FC = 5680; C_FC = 5238; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 6494; N_FC = 5680; C_FC = 3922; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 6498; N_FC = 6248; C_FC = 5662; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 6634; N_FC = 6248; C_FC = 4354; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 6698; N_FC = 6532; C_FC = 5585; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 6698; N_FC = 0; C_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 6296; N_FC = 4608; C_FC = 3264; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 6298; N_FC = 5760; C_FC = 5312; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 6584; N_FC = 5760; C_FC = 3978; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 6588; N_FC = 6336; C_FC = 5742; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 6728; N_FC = 6336; C_FC = 4416; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 6788; N_FC = 6624; C_FC = 5664; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 6788; N_FC = 0; C_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 72; + C_DATA -= 72; } if (N_FC != 0) { - N_FC -= 72; + N_FC -= 72; } if (C_FC != 0) { - C_FC -= 72; + C_FC -= 72; } - } - break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 12418; N_FC = 9088; C_FC = 6437; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 12436; N_FC = 11360; C_FC = 10476; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 12988; N_FC = 11360; C_FC = 7845; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 13002; N_FC = 12496; C_FC = 11324; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 13272; N_FC = 12496; C_FC = 8709; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 13288; N_FC = 13064; C_FC = 11801; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 13416; N_FC = 13064; C_FC = 11170; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 13406; N_FC = 0; C_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 12678; N_FC = 9280; C_FC = 6573; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 12698; N_FC = 11600; C_FC = 10697; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 13262; N_FC = 11600; C_FC = 8011; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 13276; N_FC = 12760; C_FC = 11563; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 13552; N_FC = 12760; C_FC = 8893; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 13568; N_FC = 13340; C_FC = 12051; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 13698; N_FC = 13340; C_FC = 11406; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 13688; N_FC = 0; C_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 144; + C_DATA -= 144; } if (N_FC != 0) { - N_FC -= 144; + N_FC -= 144; } if (C_FC != 0) { - C_FC -= 144; + C_FC -= 144; } - } - break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 24886; N_FC = 22720; C_FC = 20952; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 26022; N_FC = 24992; C_FC = 22649; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 26592; N_FC = 26128; C_FC = 23603; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 26836; N_FC = 0; C_FC = 0; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 26812; N_FC = 0; C_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 25412; N_FC = 23200; C_FC = 21395; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 26572; N_FC = 25520; C_FC = 23127; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 27152; N_FC = 26680; C_FC = 24102; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 27404; N_FC = 0; C_FC = 0; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 27376; N_FC = 0; C_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 288; + C_DATA -= 288; } if (N_FC != 0) { - N_FC -= 288; + N_FC -= 288; } if (C_FC != 0) { - C_FC -= 288; + C_FC -= 288; } - } - break; - } - if (N_FC == 0) { + } + break; + } + if (N_FC == 0) { set_output_multiple((N_P2 * C_P2) + (numdatasyms * C_DATA)); miso_items = (N_P2 * C_P2) + (numdatasyms * C_DATA); - } - else { + } else { set_output_multiple((N_P2 * C_P2) + ((numdatasyms - 1) * C_DATA) + N_FC); miso_items = (N_P2 * C_P2) + ((numdatasyms - 1) * C_DATA) + N_FC; - } } +} - /* - * Our virtual destructor. - */ - dvbt2_miso_cc_impl::~dvbt2_miso_cc_impl() - { - } +/* + * Our virtual destructor. + */ +dvbt2_miso_cc_impl::~dvbt2_miso_cc_impl() {} - int - dvbt2_miso_cc_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out1 = (gr_complex *) output_items[0]; - gr_complex *out2 = (gr_complex *) output_items[1]; - gr_complex temp1, temp2; +int dvbt2_miso_cc_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + gr_complex* out1 = (gr_complex*)output_items[0]; + gr_complex* out2 = (gr_complex*)output_items[1]; + gr_complex temp1, temp2; - for (int i = 0; i < noutput_items; i += miso_items) { + for (int i = 0; i < noutput_items; i += miso_items) { memcpy(out1, in, sizeof(gr_complex) * miso_items); out1 += miso_items; for (int j = 0; j < miso_items; j += 2) { - temp1 = std::conj(*in++); - temp2 = std::conj(*in++); - *out2++ = -temp2; - *out2++ = temp1; + temp1 = std::conj(*in++); + temp2 = std::conj(*in++); + *out2++ = -temp2; + *out2++ = temp1; } - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ -} /* namespace gr */ + // Tell runtime system how many output items we produced. + return noutput_items; +} +} /* namespace dtv */ +} /* namespace gr */ diff --git a/gr-dtv/lib/dvbt2/dvbt2_miso_cc_impl.h b/gr-dtv/lib/dvbt2/dvbt2_miso_cc_impl.h index 2d14808107..ade2c92c10 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_miso_cc_impl.h +++ b/gr-dtv/lib/dvbt2/dvbt2_miso_cc_impl.h @@ -26,28 +26,33 @@ #include <gnuradio/dtv/dvbt2_miso_cc.h> namespace gr { - namespace dtv { - - class dvbt2_miso_cc_impl : public dvbt2_miso_cc - { - private: - int miso_items; - int N_P2; - int C_P2; - int N_FC; - int C_FC; - int C_DATA; - - public: - dvbt2_miso_cc_impl(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode); - ~dvbt2_miso_cc_impl(); - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class dvbt2_miso_cc_impl : public dvbt2_miso_cc +{ +private: + int miso_items; + int N_P2; + int C_P2; + int N_FC; + int C_FC; + int C_DATA; + +public: + dvbt2_miso_cc_impl(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode); + ~dvbt2_miso_cc_impl(); + + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_MISO_CC_IMPL_H */ diff --git a/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.cc b/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.cc index 7435c4ad36..ad6f6e9b58 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.cc +++ b/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2017,2018 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -27,264 +27,264 @@ #include <gnuradio/math.h> namespace gr { - namespace dtv { +namespace dtv { - dvbt2_modulator_bc::sptr - dvbt2_modulator_bc::make(dvb_framesize_t framesize, dvb_constellation_t constellation, dvbt2_rotation_t rotation) - { - return gnuradio::get_initial_sptr - (new dvbt2_modulator_bc_impl(framesize, constellation, rotation)); - } +dvbt2_modulator_bc::sptr dvbt2_modulator_bc::make(dvb_framesize_t framesize, + dvb_constellation_t constellation, + dvbt2_rotation_t rotation) +{ + return gnuradio::get_initial_sptr( + new dvbt2_modulator_bc_impl(framesize, constellation, rotation)); +} - /* - * The private constructor - */ - dvbt2_modulator_bc_impl::dvbt2_modulator_bc_impl(dvb_framesize_t framesize, dvb_constellation_t constellation, dvbt2_rotation_t rotation) - : gr::block("dvbt2_modulator_bc", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(gr_complex))) - { - double normalization; - double rotation_angle; - double m_16qam_lookup[4] = {3.0, 1.0, -3.0, -1.0}; - double m_64qam_lookup[8] = {7.0, 5.0, 1.0, 3.0, -7.0, -5.0, -1.0, -3.0}; - double m_256qam_lookup[16] = {15.0, 13.0, 9.0, 11.0, 1.0, 3.0, 7.0, 5.0, -15.0, -13.0, -9.0, -11.0, -1.0, -3.0, -7.0, -5.0}; - int real_index, imag_index; - gr_complex temp; - cyclic_delay = FALSE; - if (framesize == FECFRAME_NORMAL) { +/* + * The private constructor + */ +dvbt2_modulator_bc_impl::dvbt2_modulator_bc_impl(dvb_framesize_t framesize, + dvb_constellation_t constellation, + dvbt2_rotation_t rotation) + : gr::block("dvbt2_modulator_bc", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) +{ + double normalization; + double rotation_angle; + double m_16qam_lookup[4] = { 3.0, 1.0, -3.0, -1.0 }; + double m_64qam_lookup[8] = { 7.0, 5.0, 1.0, 3.0, -7.0, -5.0, -1.0, -3.0 }; + double m_256qam_lookup[16] = { 15.0, 13.0, 9.0, 11.0, 1.0, 3.0, 7.0, 5.0, + -15.0, -13.0, -9.0, -11.0, -1.0, -3.0, -7.0, -5.0 }; + int real_index, imag_index; + gr_complex temp; + cyclic_delay = FALSE; + if (framesize == FECFRAME_NORMAL) { switch (constellation) { - case MOD_QPSK: + case MOD_QPSK: cell_size = 32400; break; - case MOD_16QAM: + case MOD_16QAM: cell_size = 16200; break; - case MOD_64QAM: + case MOD_64QAM: cell_size = 10800; break; - case MOD_256QAM: + case MOD_256QAM: cell_size = 8100; break; - default: + default: cell_size = 0; break; } - } - else { + } else { switch (constellation) { - case MOD_QPSK: + case MOD_QPSK: cell_size = 8100; break; - case MOD_16QAM: + case MOD_16QAM: cell_size = 4050; break; - case MOD_64QAM: + case MOD_64QAM: cell_size = 2700; break; - case MOD_256QAM: + case MOD_256QAM: cell_size = 2025; break; - default: + default: cell_size = 0; break; } - } - switch (constellation) { - case MOD_QPSK: - normalization = std::sqrt(2.0); - m_qpsk[0] = gr_complex( 1.0 / normalization, 1.0 / normalization); - m_qpsk[1] = gr_complex( 1.0 / normalization, -1.0 / normalization); - m_qpsk[2] = gr_complex(-1.0 / normalization, 1.0 / normalization); - m_qpsk[3] = gr_complex(-1.0 / normalization, -1.0 / normalization); - if (rotation == ROTATION_ON) { + } + switch (constellation) { + case MOD_QPSK: + normalization = std::sqrt(2.0); + m_qpsk[0] = gr_complex(1.0 / normalization, 1.0 / normalization); + m_qpsk[1] = gr_complex(1.0 / normalization, -1.0 / normalization); + m_qpsk[2] = gr_complex(-1.0 / normalization, 1.0 / normalization); + m_qpsk[3] = gr_complex(-1.0 / normalization, -1.0 / normalization); + if (rotation == ROTATION_ON) { cyclic_delay = TRUE; rotation_angle = (2.0 * GR_M_PI * 29.0) / 360.0; temp = std::exp(gr_complexd(0.0, rotation_angle)); for (int i = 0; i < 4; i++) { - m_qpsk[i] *= temp; + m_qpsk[i] *= temp; } - } - break; - case MOD_16QAM: - normalization = std::sqrt(10.0); - for (int i = 0; i < 16; i++) { + } + break; + case MOD_16QAM: + normalization = std::sqrt(10.0); + for (int i = 0; i < 16; i++) { real_index = ((i & 0x8) >> 2) | ((i & 0x2) >> 1); imag_index = ((i & 0x4) >> 1) | ((i & 0x1) >> 0); - m_16qam[i] = gr_complex(m_16qam_lookup[real_index] / normalization, m_16qam_lookup[imag_index] / normalization); - } - if (rotation == ROTATION_ON) { + m_16qam[i] = gr_complex(m_16qam_lookup[real_index] / normalization, + m_16qam_lookup[imag_index] / normalization); + } + if (rotation == ROTATION_ON) { cyclic_delay = TRUE; rotation_angle = (2.0 * GR_M_PI * 16.8) / 360.0; temp = std::exp(gr_complexd(0.0, rotation_angle)); for (int i = 0; i < 16; i++) { - m_16qam[i] *= temp; + m_16qam[i] *= temp; } - } - break; - case MOD_64QAM: - normalization = std::sqrt(42.0); - for (int i = 0; i < 64; i++) { + } + break; + case MOD_64QAM: + normalization = std::sqrt(42.0); + for (int i = 0; i < 64; i++) { real_index = ((i & 0x20) >> 3) | ((i & 0x8) >> 2) | ((i & 0x2) >> 1); imag_index = ((i & 0x10) >> 2) | ((i & 0x4) >> 1) | ((i & 0x1) >> 0); - m_64qam[i] = gr_complex(m_64qam_lookup[real_index] / normalization, m_64qam_lookup[imag_index] / normalization); - } - if (rotation == ROTATION_ON) { + m_64qam[i] = gr_complex(m_64qam_lookup[real_index] / normalization, + m_64qam_lookup[imag_index] / normalization); + } + if (rotation == ROTATION_ON) { cyclic_delay = TRUE; rotation_angle = (2.0 * GR_M_PI * 8.6) / 360.0; temp = std::exp(gr_complexd(0.0, rotation_angle)); for (int i = 0; i < 64; i++) { - m_64qam[i] *= temp; + m_64qam[i] *= temp; } - } - break; - case MOD_256QAM: - normalization = std::sqrt(170.0); - for (int i = 0; i < 256; i++) { - real_index = ((i & 0x80) >> 4) | ((i & 0x20) >> 3) | ((i & 0x8) >> 2) | ((i & 0x2) >> 1); - imag_index = ((i & 0x40) >> 3) | ((i & 0x10) >> 2) | ((i & 0x4) >> 1) | ((i & 0x1) >> 0); - m_256qam[i] = gr_complex(m_256qam_lookup[real_index] / normalization, m_256qam_lookup[imag_index] / normalization); - } - if (rotation == ROTATION_ON) { + } + break; + case MOD_256QAM: + normalization = std::sqrt(170.0); + for (int i = 0; i < 256; i++) { + real_index = ((i & 0x80) >> 4) | ((i & 0x20) >> 3) | ((i & 0x8) >> 2) | + ((i & 0x2) >> 1); + imag_index = ((i & 0x40) >> 3) | ((i & 0x10) >> 2) | ((i & 0x4) >> 1) | + ((i & 0x1) >> 0); + m_256qam[i] = gr_complex(m_256qam_lookup[real_index] / normalization, + m_256qam_lookup[imag_index] / normalization); + } + if (rotation == ROTATION_ON) { cyclic_delay = TRUE; rotation_angle = (2.0 * GR_M_PI * 3.576334375) / 360.0; temp = std::exp(gr_complexd(0.0, rotation_angle)); for (int i = 0; i < 256; i++) { - m_256qam[i] *= temp; + m_256qam[i] *= temp; } - } - break; - default: - normalization = std::sqrt(2.0); - m_qpsk[0] = gr_complex( 1.0 / normalization, 1.0 / normalization); - m_qpsk[1] = gr_complex( 1.0 / normalization, -1.0 / normalization); - m_qpsk[2] = gr_complex(-1.0 / normalization, 1.0 / normalization); - m_qpsk[3] = gr_complex(-1.0 / normalization, -1.0 / normalization); - if (rotation == ROTATION_ON) { + } + break; + default: + normalization = std::sqrt(2.0); + m_qpsk[0] = gr_complex(1.0 / normalization, 1.0 / normalization); + m_qpsk[1] = gr_complex(1.0 / normalization, -1.0 / normalization); + m_qpsk[2] = gr_complex(-1.0 / normalization, 1.0 / normalization); + m_qpsk[3] = gr_complex(-1.0 / normalization, -1.0 / normalization); + if (rotation == ROTATION_ON) { cyclic_delay = TRUE; rotation_angle = (2.0 * GR_M_PI * 29.0) / 360.0; temp = std::exp(gr_complexd(0.0, rotation_angle)); for (int i = 0; i < 4; i++) { - m_qpsk[i] *= temp; + m_qpsk[i] *= temp; } - } - break; - } - signal_constellation = constellation; - set_output_multiple(cell_size); + } + break; } + signal_constellation = constellation; + set_output_multiple(cell_size); +} - /* - * Our virtual destructor. - */ - dvbt2_modulator_bc_impl::~dvbt2_modulator_bc_impl() - { - } +/* + * Our virtual destructor. + */ +dvbt2_modulator_bc_impl::~dvbt2_modulator_bc_impl() {} - void - dvbt2_modulator_bc_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = noutput_items; - } +void dvbt2_modulator_bc_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = noutput_items; +} - int - dvbt2_modulator_bc_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - const unsigned char *in_delay; - int index, index_delay; +int dvbt2_modulator_bc_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + gr_complex* out = (gr_complex*)output_items[0]; + const unsigned char* in_delay; + int index, index_delay; - switch (signal_constellation) { - case MOD_QPSK: - for (int i = 0; i < noutput_items; i += cell_size) { + switch (signal_constellation) { + case MOD_QPSK: + for (int i = 0; i < noutput_items; i += cell_size) { if (cyclic_delay == FALSE) { - for (int j = 0; j < cell_size; j++) { - index = *in++; - *out++ = m_qpsk[index & 0x3]; - } - } - else { - in_delay = in; - for (int j = 0; j < cell_size; j++) { - index = *in++; - index_delay = in_delay[(j + cell_size - 1) % cell_size]; - *out++ = gr_complex(m_qpsk[index & 0x3].real(), - m_qpsk[index_delay & 0x3].imag()); - } + for (int j = 0; j < cell_size; j++) { + index = *in++; + *out++ = m_qpsk[index & 0x3]; + } + } else { + in_delay = in; + for (int j = 0; j < cell_size; j++) { + index = *in++; + index_delay = in_delay[(j + cell_size - 1) % cell_size]; + *out++ = gr_complex(m_qpsk[index & 0x3].real(), + m_qpsk[index_delay & 0x3].imag()); + } } - } - break; - case MOD_16QAM: - for (int i = 0; i < noutput_items; i += cell_size) { + } + break; + case MOD_16QAM: + for (int i = 0; i < noutput_items; i += cell_size) { if (cyclic_delay == FALSE) { - for (int j = 0; j < cell_size; j++) { - index = *in++; - *out++ = m_16qam[index & 0xf]; - } + for (int j = 0; j < cell_size; j++) { + index = *in++; + *out++ = m_16qam[index & 0xf]; + } + } else { + in_delay = in; + for (int j = 0; j < cell_size; j++) { + index = *in++; + index_delay = in_delay[(j + cell_size - 1) % cell_size]; + *out++ = gr_complex(m_16qam[index & 0xf].real(), + m_16qam[index_delay & 0xf].imag()); + } } - else { - in_delay = in; - for (int j = 0; j < cell_size; j++) { - index = *in++; - index_delay = in_delay[(j + cell_size - 1) % cell_size]; - *out++ = gr_complex(m_16qam[index & 0xf].real(), - m_16qam[index_delay & 0xf].imag()); - } - } - } - break; - case MOD_64QAM: - for (int i = 0; i < noutput_items; i += cell_size) { + } + break; + case MOD_64QAM: + for (int i = 0; i < noutput_items; i += cell_size) { if (cyclic_delay == FALSE) { - for (int j = 0; j < cell_size; j++) { - index = *in++; - *out++ = m_64qam[index & 0x3f]; - } + for (int j = 0; j < cell_size; j++) { + index = *in++; + *out++ = m_64qam[index & 0x3f]; + } + } else { + in_delay = in; + for (int j = 0; j < cell_size; j++) { + index = *in++; + index_delay = in_delay[(j + cell_size - 1) % cell_size]; + *out++ = gr_complex(m_64qam[index & 0x3f].real(), + m_64qam[index_delay & 0x3f].imag()); + } } - else { - in_delay = in; - for (int j = 0; j < cell_size; j++) { - index = *in++; - index_delay = in_delay[(j + cell_size - 1) % cell_size]; - *out++ = gr_complex(m_64qam[index & 0x3f].real(), - m_64qam[index_delay & 0x3f].imag()); - } - } - } - break; - case MOD_256QAM: - for (int i = 0; i < noutput_items; i += cell_size) { + } + break; + case MOD_256QAM: + for (int i = 0; i < noutput_items; i += cell_size) { if (cyclic_delay == FALSE) { - for (int j = 0; j < cell_size; j++) { - index = *in++; - *out++ = m_256qam[index & 0xff]; - } + for (int j = 0; j < cell_size; j++) { + index = *in++; + *out++ = m_256qam[index & 0xff]; + } + } else { + in_delay = in; + for (int j = 0; j < cell_size; j++) { + index = *in++; + index_delay = in_delay[(j + cell_size - 1) % cell_size]; + *out++ = gr_complex(m_256qam[index & 0xff].real(), + m_256qam[index_delay & 0xff].imag()); + } } - else { - in_delay = in; - for (int j = 0; j < cell_size; j++) { - index = *in++; - index_delay = in_delay[(j + cell_size - 1) % cell_size]; - *out++ = gr_complex(m_256qam[index & 0xff].real(), - m_256qam[index_delay & 0xff].imag()); - } - } - } - break; - } + } + break; + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (noutput_items); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(noutput_items); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.h b/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.h index 3853075e5b..b07c6330a6 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.h +++ b/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.h @@ -26,32 +26,34 @@ #include <gnuradio/dtv/dvbt2_modulator_bc.h> namespace gr { - namespace dtv { - - class dvbt2_modulator_bc_impl : public dvbt2_modulator_bc - { - private: - int signal_constellation; - int cyclic_delay; - int cell_size; - gr_complex m_qpsk[4]; - gr_complex m_16qam[16]; - gr_complex m_64qam[64]; - gr_complex m_256qam[256]; - - public: - dvbt2_modulator_bc_impl(dvb_framesize_t framesize, dvb_constellation_t constellation, dvbt2_rotation_t rotation); - ~dvbt2_modulator_bc_impl(); - - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class dvbt2_modulator_bc_impl : public dvbt2_modulator_bc +{ +private: + int signal_constellation; + int cyclic_delay; + int cell_size; + gr_complex m_qpsk[4]; + gr_complex m_16qam[16]; + gr_complex m_64qam[64]; + gr_complex m_256qam[256]; + +public: + dvbt2_modulator_bc_impl(dvb_framesize_t framesize, + dvb_constellation_t constellation, + dvbt2_rotation_t rotation); + ~dvbt2_modulator_bc_impl(); + + void forecast(int noutput_items, gr_vector_int& ninput_items_required); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_MODULATOR_BC_IMPL_H */ diff --git a/gr-dtv/lib/dvbt2/dvbt2_p1insertion_cc_impl.cc b/gr-dtv/lib/dvbt2/dvbt2_p1insertion_cc_impl.cc index 5c4e68c4a3..9fda59a468 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_p1insertion_cc_impl.cc +++ b/gr-dtv/lib/dvbt2/dvbt2_p1insertion_cc_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2019 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -28,331 +28,357 @@ #include <algorithm> namespace gr { - namespace dtv { +namespace dtv { - dvbt2_p1insertion_cc::sptr - dvbt2_p1insertion_cc::make(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_preamble_t preamble, dvbt2_showlevels_t showlevels, float vclip) - { - return gnuradio::get_initial_sptr - (new dvbt2_p1insertion_cc_impl(carriermode, fftsize, guardinterval, numdatasyms, preamble, showlevels, vclip)); - } +dvbt2_p1insertion_cc::sptr +dvbt2_p1insertion_cc::make(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_preamble_t preamble, + dvbt2_showlevels_t showlevels, + float vclip) +{ + return gnuradio::get_initial_sptr(new dvbt2_p1insertion_cc_impl( + carriermode, fftsize, guardinterval, numdatasyms, preamble, showlevels, vclip)); +} - /* - * The private constructor - */ - dvbt2_p1insertion_cc_impl::dvbt2_p1insertion_cc_impl(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_preamble_t preamble, dvbt2_showlevels_t showlevels, float vclip) - : gr::block("dvbt2_p1insertion_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex))) - { - int s1, s2, index = 0; - const gr_complex *in = (const gr_complex *) p1_freq; - gr_complex *out = (gr_complex *) p1_time; - s1 = preamble; - switch (fftsize) { - case FFTSIZE_1K: - fft_size = 1024; - N_P2 = 16; - break; - case FFTSIZE_2K: - fft_size = 2048; - N_P2 = 8; - break; - case FFTSIZE_4K: - fft_size = 4096; - N_P2 = 4; - break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: - fft_size = 8192; - N_P2 = 2; - break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: - fft_size = 16384; - N_P2 = 1; - break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: - fft_size = 32768; - N_P2 = 1; - break; - } - switch (guardinterval) { - case GI_1_32: - guard_interval = fft_size / 32; - break; - case GI_1_16: - guard_interval = fft_size / 16; - break; - case GI_1_8: - guard_interval = fft_size / 8; - break; - case GI_1_4: - guard_interval = fft_size / 4; - break; - case GI_1_128: - guard_interval = fft_size / 128; - break; - case GI_19_128: - guard_interval = (fft_size * 19) / 128; - break; - case GI_19_256: - guard_interval = (fft_size * 19) / 256; - break; - } - init_p1_randomizer(); - s2 = (fftsize & 0x7) << 1; - for (int i = 0; i < 8; i++) { +/* + * The private constructor + */ +dvbt2_p1insertion_cc_impl::dvbt2_p1insertion_cc_impl(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_preamble_t preamble, + dvbt2_showlevels_t showlevels, + float vclip) + : gr::block("dvbt2_p1insertion_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) +{ + int s1, s2, index = 0; + const gr_complex* in = (const gr_complex*)p1_freq; + gr_complex* out = (gr_complex*)p1_time; + s1 = preamble; + switch (fftsize) { + case FFTSIZE_1K: + fft_size = 1024; + N_P2 = 16; + break; + case FFTSIZE_2K: + fft_size = 2048; + N_P2 = 8; + break; + case FFTSIZE_4K: + fft_size = 4096; + N_P2 = 4; + break; + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: + fft_size = 8192; + N_P2 = 2; + break; + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: + fft_size = 16384; + N_P2 = 1; + break; + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: + fft_size = 32768; + N_P2 = 1; + break; + } + switch (guardinterval) { + case GI_1_32: + guard_interval = fft_size / 32; + break; + case GI_1_16: + guard_interval = fft_size / 16; + break; + case GI_1_8: + guard_interval = fft_size / 8; + break; + case GI_1_4: + guard_interval = fft_size / 4; + break; + case GI_1_128: + guard_interval = fft_size / 128; + break; + case GI_19_128: + guard_interval = (fft_size * 19) / 128; + break; + case GI_19_256: + guard_interval = (fft_size * 19) / 256; + break; + } + init_p1_randomizer(); + s2 = (fftsize & 0x7) << 1; + for (int i = 0; i < 8; i++) { for (int j = 7; j >= 0; j--) { - modulation_sequence[index++] = (s1_modulation_patterns[s1][i] >> j) & 0x1; + modulation_sequence[index++] = (s1_modulation_patterns[s1][i] >> j) & 0x1; } - } - for (int i = 0; i < 32; i++) { + } + for (int i = 0; i < 32; i++) { for (int j = 7; j >= 0; j--) { - modulation_sequence[index++] = (s2_modulation_patterns[s2][i] >> j) & 0x1; + modulation_sequence[index++] = (s2_modulation_patterns[s2][i] >> j) & 0x1; } - } - for (int i = 0; i < 8; i++) { + } + for (int i = 0; i < 8; i++) { for (int j = 7; j >= 0; j--) { - modulation_sequence[index++] = (s1_modulation_patterns[s1][i] >> j) & 0x1; + modulation_sequence[index++] = (s1_modulation_patterns[s1][i] >> j) & 0x1; } - } - dbpsk_modulation_sequence[0] = 1; - for (int i = 1; i < 385; i++) { + } + dbpsk_modulation_sequence[0] = 1; + for (int i = 1; i < 385; i++) { dbpsk_modulation_sequence[i] = 0; - } - for (int i = 1; i < 385; i++) { + } + for (int i = 1; i < 385; i++) { if (modulation_sequence[i - 1] == 1) { - dbpsk_modulation_sequence[i] = -dbpsk_modulation_sequence[i - 1]; - } - else { - dbpsk_modulation_sequence[i] = dbpsk_modulation_sequence[i - 1]; + dbpsk_modulation_sequence[i] = -dbpsk_modulation_sequence[i - 1]; + } else { + dbpsk_modulation_sequence[i] = dbpsk_modulation_sequence[i - 1]; } - } - for (int i = 0; i < 384; i++) { + } + for (int i = 0; i < 384; i++) { dbpsk_modulation_sequence[i] = dbpsk_modulation_sequence[i + 1] * p1_randomize[i]; - } - std::fill_n(&p1_freq[0], 1024, 0); - for (int i = 0; i < 384; i++) { + } + std::fill_n(&p1_freq[0], 1024, 0); + for (int i = 0; i < 384; i++) { p1_freq[p1_active_carriers[i] + 86] = float(dbpsk_modulation_sequence[i]); - } - p1_fft_size = 1024; - p1_fft = new fft::fft_complex(p1_fft_size, false, 1); - gr_complex *dst = p1_fft->get_inbuf(); - memcpy(&dst[p1_fft_size / 2], &in[0], sizeof(gr_complex) * p1_fft_size / 2); - memcpy(&dst[0], &in[p1_fft_size / 2], sizeof(gr_complex) * p1_fft_size / 2); - p1_fft->execute(); - memcpy(out, p1_fft->get_outbuf(), sizeof(gr_complex) * p1_fft_size); - for (int i = 0; i < 1024; i++) { + } + p1_fft_size = 1024; + p1_fft = new fft::fft_complex(p1_fft_size, false, 1); + gr_complex* dst = p1_fft->get_inbuf(); + memcpy(&dst[p1_fft_size / 2], &in[0], sizeof(gr_complex) * p1_fft_size / 2); + memcpy(&dst[0], &in[p1_fft_size / 2], sizeof(gr_complex) * p1_fft_size / 2); + p1_fft->execute(); + memcpy(out, p1_fft->get_outbuf(), sizeof(gr_complex) * p1_fft_size); + for (int i = 0; i < 1024; i++) { p1_time[i] /= std::sqrt(384.0); - } - for (int i = 0; i < 1023; i++) { + } + for (int i = 0; i < 1023; i++) { p1_freqshft[i + 1] = p1_freq[i]; - } - p1_freqshft[0] = p1_freq[1023]; - in = (const gr_complex *) p1_freqshft; - out = (gr_complex *) p1_timeshft; - dst = p1_fft->get_inbuf(); - memcpy(&dst[p1_fft_size / 2], &in[0], sizeof(gr_complex) * p1_fft_size / 2); - memcpy(&dst[0], &in[p1_fft_size / 2], sizeof(gr_complex) * p1_fft_size / 2); - p1_fft->execute(); - memcpy(out, p1_fft->get_outbuf(), sizeof(gr_complex) * p1_fft_size); - for (int i = 0; i < 1024; i++) { + } + p1_freqshft[0] = p1_freq[1023]; + in = (const gr_complex*)p1_freqshft; + out = (gr_complex*)p1_timeshft; + dst = p1_fft->get_inbuf(); + memcpy(&dst[p1_fft_size / 2], &in[0], sizeof(gr_complex) * p1_fft_size / 2); + memcpy(&dst[0], &in[p1_fft_size / 2], sizeof(gr_complex) * p1_fft_size / 2); + p1_fft->execute(); + memcpy(out, p1_fft->get_outbuf(), sizeof(gr_complex) * p1_fft_size); + for (int i = 0; i < 1024; i++) { p1_timeshft[i] /= std::sqrt(384.0); - } - frame_items = ((numdatasyms + N_P2) * fft_size) + ((numdatasyms + N_P2) * guard_interval); - insertion_items = frame_items + 2048; - set_output_multiple(frame_items + 2048); - show_levels = showlevels; - real_positive = 0.0; - real_negative = 0.0; - imag_positive = 0.0; - imag_negative = 0.0; - real_positive_threshold = vclip; - real_negative_threshold = -vclip; - imag_positive_threshold = vclip; - imag_negative_threshold = -vclip; - real_positive_threshold_count = 0; - real_negative_threshold_count = 0; - imag_positive_threshold_count = 0; - imag_negative_threshold_count = 0; } + frame_items = + ((numdatasyms + N_P2) * fft_size) + ((numdatasyms + N_P2) * guard_interval); + insertion_items = frame_items + 2048; + set_output_multiple(frame_items + 2048); + show_levels = showlevels; + real_positive = 0.0; + real_negative = 0.0; + imag_positive = 0.0; + imag_negative = 0.0; + real_positive_threshold = vclip; + real_negative_threshold = -vclip; + imag_positive_threshold = vclip; + imag_negative_threshold = -vclip; + real_positive_threshold_count = 0; + real_negative_threshold_count = 0; + imag_positive_threshold_count = 0; + imag_negative_threshold_count = 0; +} - void - dvbt2_p1insertion_cc_impl::init_p1_randomizer(void) - { - int sr = 0x4e46; - for (int i = 0; i < 384; i++) { +void dvbt2_p1insertion_cc_impl::init_p1_randomizer(void) +{ + int sr = 0x4e46; + for (int i = 0; i < 384; i++) { int b = ((sr) ^ (sr >> 1)) & 1; if (b == 0) { - p1_randomize[i] = 1; - } - else { - p1_randomize[i] = -1; + p1_randomize[i] = 1; + } else { + p1_randomize[i] = -1; } sr >>= 1; - if(b) sr |= 0x4000; - } + if (b) + sr |= 0x4000; } +} - /* - * Our virtual destructor. - */ - dvbt2_p1insertion_cc_impl::~dvbt2_p1insertion_cc_impl() - { - delete p1_fft; - } +/* + * Our virtual destructor. + */ +dvbt2_p1insertion_cc_impl::~dvbt2_p1insertion_cc_impl() { delete p1_fft; } - void - dvbt2_p1insertion_cc_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = frame_items * (noutput_items / insertion_items); - } +void dvbt2_p1insertion_cc_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = frame_items * (noutput_items / insertion_items); +} - int - dvbt2_p1insertion_cc_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - gr_complex *level; +int dvbt2_p1insertion_cc_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + gr_complex* out = (gr_complex*)output_items[0]; + gr_complex* level; - for (int i = 0; i < noutput_items; i += insertion_items) { + for (int i = 0; i < noutput_items; i += insertion_items) { level = out; for (int j = 0; j < 542; j++) { - *out++ = p1_timeshft[j]; + *out++ = p1_timeshft[j]; } for (int j = 0; j < 1024; j++) { - *out++ = p1_time[j]; + *out++ = p1_time[j]; } for (int j = 542; j < 1024; j++) { - *out++ = p1_timeshft[j]; + *out++ = p1_timeshft[j]; } memcpy(out, in, sizeof(gr_complex) * frame_items); if (show_levels == TRUE) { - for (int j = 0; j < frame_items + 2048; j++) { - if (level[j].real() > real_positive) { - real_positive = level[j].real(); - } - if (level[j].real() < real_negative) { - real_negative = level[j].real(); - } - if (level[j].imag() > imag_positive) { - imag_positive = level[j].imag(); - } - if (level[j].imag() < imag_negative) { - imag_negative = level[j].imag(); + for (int j = 0; j < frame_items + 2048; j++) { + if (level[j].real() > real_positive) { + real_positive = level[j].real(); + } + if (level[j].real() < real_negative) { + real_negative = level[j].real(); + } + if (level[j].imag() > imag_positive) { + imag_positive = level[j].imag(); + } + if (level[j].imag() < imag_negative) { + imag_negative = level[j].imag(); + } + if (level[j].real() > real_positive_threshold) { + real_positive_threshold_count++; + } + if (level[j].real() < real_negative_threshold) { + real_negative_threshold_count++; + } + if (level[j].imag() > imag_positive_threshold) { + imag_positive_threshold_count++; + } + if (level[j].imag() < imag_negative_threshold) { + imag_negative_threshold_count++; + } } - if (level[j].real() > real_positive_threshold) { - real_positive_threshold_count++; - } - if (level[j].real() < real_negative_threshold) { - real_negative_threshold_count++; - } - if (level[j].imag() > imag_positive_threshold) { - imag_positive_threshold_count++; - } - if (level[j].imag() < imag_negative_threshold) { - imag_negative_threshold_count++; - } - } - printf("peak real = %+e, %+e, %d, %d\n", real_positive, real_negative, real_positive_threshold_count, real_negative_threshold_count); - printf("peak imag = %+e, %+e, %d, %d\n", imag_positive, imag_negative, imag_positive_threshold_count, imag_negative_threshold_count); + printf("peak real = %+e, %+e, %d, %d\n", + real_positive, + real_negative, + real_positive_threshold_count, + real_negative_threshold_count); + printf("peak imag = %+e, %+e, %d, %d\n", + imag_positive, + imag_negative, + imag_positive_threshold_count, + imag_negative_threshold_count); } out += frame_items; in += frame_items; - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (frame_items); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(frame_items); - // Tell runtime system how many output items we produced. - return noutput_items; - } + // Tell runtime system how many output items we produced. + return noutput_items; +} - const int dvbt2_p1insertion_cc_impl::p1_active_carriers[384] = - { - 44, 45, 47, 51, 54, 59, 62, 64, 65, 66, 70, 75, 78, 80, 81, 82, 84, 85, 87, 88, 89, 90, - 94, 96, 97, 98, 102, 107, 110, 112, 113, 114, 116, 117, 119, 120, 121, 122, 124, - 125, 127, 131, 132, 133, 135, 136, 137, 138, 142, 144, 145, 146, 148, 149, 151, - 152, 153, 154, 158, 160, 161, 162, 166, 171, +const int dvbt2_p1insertion_cc_impl::p1_active_carriers[384] = { + 44, 45, 47, 51, 54, 59, 62, 64, 65, 66, 70, 75, 78, 80, 81, 82, + 84, 85, 87, 88, 89, 90, 94, 96, 97, 98, 102, 107, 110, 112, 113, 114, + 116, 117, 119, 120, 121, 122, 124, 125, 127, 131, 132, 133, 135, 136, 137, 138, + 142, 144, 145, 146, 148, 149, 151, 152, 153, 154, 158, 160, 161, 162, 166, 171, - 172, 173, 175, 179, 182, 187, 190, 192, 193, 194, 198, 203, 206, 208, 209, 210, - 212, 213, 215, 216, 217, 218, 222, 224, 225, 226, 230, 235, 238, 240, 241, 242, - 244, 245, 247, 248, 249, 250, 252, 253, 255, 259, 260, 261, 263, 264, 265, 266, - 270, 272, 273, 274, 276, 277, 279, 280, 281, 282, 286, 288, 289, 290, 294, 299, - 300, 301, 303, 307, 310, 315, 318, 320, 321, 322, 326, 331, 334, 336, 337, 338, - 340, 341, 343, 344, 345, 346, 350, 352, 353, 354, 358, 363, 364, 365, 367, 371, - 374, 379, 382, 384, 385, 386, 390, 395, 396, 397, 399, 403, 406, 411, 412, 413, - 415, 419, 420, 421, 423, 424, 425, 426, 428, 429, 431, 435, 438, 443, 446, 448, - 449, 450, 454, 459, 462, 464, 465, 466, 468, 469, 471, 472, 473, 474, 478, 480, - 481, 482, 486, 491, 494, 496, 497, 498, 500, 501, 503, 504, 505, 506, 508, 509, - 511, 515, 516, 517, 519, 520, 521, 522, 526, 528, 529, 530, 532, 533, 535, 536, - 537, 538, 542, 544, 545, 546, 550, 555, 558, 560, 561, 562, 564, 565, 567, 568, - 569, 570, 572, 573, 575, 579, 580, 581, 583, 584, 585, 586, 588, 589, 591, 595, - 598, 603, 604, 605, 607, 611, 612, 613, 615, 616, 617, 618, 622, 624, 625, 626, - 628, 629, 631, 632, 633, 634, 636, 637, 639, 643, 644, 645, 647, 648, 649, 650, - 654, 656, 657, 658, 660, 661, 663, 664, 665, 666, 670, 672, 673, 674, 678, 683, + 172, 173, 175, 179, 182, 187, 190, 192, 193, 194, 198, 203, 206, 208, 209, 210, + 212, 213, 215, 216, 217, 218, 222, 224, 225, 226, 230, 235, 238, 240, 241, 242, + 244, 245, 247, 248, 249, 250, 252, 253, 255, 259, 260, 261, 263, 264, 265, 266, + 270, 272, 273, 274, 276, 277, 279, 280, 281, 282, 286, 288, 289, 290, 294, 299, + 300, 301, 303, 307, 310, 315, 318, 320, 321, 322, 326, 331, 334, 336, 337, 338, + 340, 341, 343, 344, 345, 346, 350, 352, 353, 354, 358, 363, 364, 365, 367, 371, + 374, 379, 382, 384, 385, 386, 390, 395, 396, 397, 399, 403, 406, 411, 412, 413, + 415, 419, 420, 421, 423, 424, 425, 426, 428, 429, 431, 435, 438, 443, 446, 448, + 449, 450, 454, 459, 462, 464, 465, 466, 468, 469, 471, 472, 473, 474, 478, 480, + 481, 482, 486, 491, 494, 496, 497, 498, 500, 501, 503, 504, 505, 506, 508, 509, + 511, 515, 516, 517, 519, 520, 521, 522, 526, 528, 529, 530, 532, 533, 535, 536, + 537, 538, 542, 544, 545, 546, 550, 555, 558, 560, 561, 562, 564, 565, 567, 568, + 569, 570, 572, 573, 575, 579, 580, 581, 583, 584, 585, 586, 588, 589, 591, 595, + 598, 603, 604, 605, 607, 611, 612, 613, 615, 616, 617, 618, 622, 624, 625, 626, + 628, 629, 631, 632, 633, 634, 636, 637, 639, 643, 644, 645, 647, 648, 649, 650, + 654, 656, 657, 658, 660, 661, 663, 664, 665, 666, 670, 672, 673, 674, 678, 683, - 684, 689, 692, 696, 698, 699, 701, 702, 703, 704, 706, 707, 708, - 712, 714, 715, 717, 718, 719, 720, 722, 723, 725, 726, 727, 729, - 733, 734, 735, 736, 738, 739, 740, 744, 746, 747, 748, 753, 756, - 760, 762, 763, 765, 766, 767, 768, 770, 771, 772, 776, 778, 779, - 780, 785, 788, 792, 794, 795, 796, 801, 805, 806, 807, 809 - }; + 684, 689, 692, 696, 698, 699, 701, 702, 703, 704, 706, 707, 708, 712, 714, 715, + 717, 718, 719, 720, 722, 723, 725, 726, 727, 729, 733, 734, 735, 736, 738, 739, + 740, 744, 746, 747, 748, 753, 756, 760, 762, 763, 765, 766, 767, 768, 770, 771, + 772, 776, 778, 779, 780, 785, 788, 792, 794, 795, 796, 801, 805, 806, 807, 809 +}; - const unsigned char dvbt2_p1insertion_cc_impl::s1_modulation_patterns[8][8] = - { - {0x12, 0x47, 0x21, 0x74, 0x1D, 0x48, 0x2E, 0x7B}, - {0x47, 0x12, 0x74, 0x21, 0x48, 0x1D, 0x7B, 0x2E}, - {0x21, 0x74, 0x12, 0x47, 0x2E, 0x7B, 0x1D, 0x48}, - {0x74, 0x21, 0x47, 0x12, 0x7B, 0x2E, 0x48, 0x1D}, - {0x1D, 0x48, 0x2E, 0x7B, 0x12, 0x47, 0x21, 0x74}, - {0x48, 0x1D, 0x7B, 0x2E, 0x47, 0x12, 0x74, 0x21}, - {0x2E, 0x7B, 0x1D, 0x48, 0x21, 0x74, 0x12, 0x47}, - {0x7B, 0x2E, 0x48, 0x1D, 0x74, 0x21, 0x47, 0x12} - }; +const unsigned char dvbt2_p1insertion_cc_impl::s1_modulation_patterns[8][8] = { + { 0x12, 0x47, 0x21, 0x74, 0x1D, 0x48, 0x2E, 0x7B }, + { 0x47, 0x12, 0x74, 0x21, 0x48, 0x1D, 0x7B, 0x2E }, + { 0x21, 0x74, 0x12, 0x47, 0x2E, 0x7B, 0x1D, 0x48 }, + { 0x74, 0x21, 0x47, 0x12, 0x7B, 0x2E, 0x48, 0x1D }, + { 0x1D, 0x48, 0x2E, 0x7B, 0x12, 0x47, 0x21, 0x74 }, + { 0x48, 0x1D, 0x7B, 0x2E, 0x47, 0x12, 0x74, 0x21 }, + { 0x2E, 0x7B, 0x1D, 0x48, 0x21, 0x74, 0x12, 0x47 }, + { 0x7B, 0x2E, 0x48, 0x1D, 0x74, 0x21, 0x47, 0x12 } +}; - const unsigned char dvbt2_p1insertion_cc_impl::s2_modulation_patterns[16][32] = - { - {0x12, 0x1D, 0x47, 0x48, 0x21, 0x2E, 0x74, 0x7B, 0x1D, 0x12, 0x48, 0x47, 0x2E, 0x21, 0x7B, 0x74, - 0x12, 0xE2, 0x47, 0xB7, 0x21, 0xD1, 0x74, 0x84, 0x1D, 0xED, 0x48, 0xB8, 0x2E, 0xDE, 0x7B, 0x8B}, - {0x47, 0x48, 0x12, 0x1D, 0x74, 0x7B, 0x21, 0x2E, 0x48, 0x47, 0x1D, 0x12, 0x7B, 0x74, 0x2E, 0x21, - 0x47, 0xB7, 0x12, 0xE2, 0x74, 0x84, 0x21, 0xD1, 0x48, 0xB8, 0x1D, 0xED, 0x7B, 0x8B, 0x2E, 0xDE}, - {0x21, 0x2E, 0x74, 0x7B, 0x12, 0x1D, 0x47, 0x48, 0x2E, 0x21, 0x7B, 0x74, 0x1D, 0x12, 0x48, 0x47, - 0x21, 0xD1, 0x74, 0x84, 0x12, 0xE2, 0x47, 0xB7, 0x2E, 0xDE, 0x7B, 0x8B, 0x1D, 0xED, 0x48, 0xB8}, - {0x74, 0x7B, 0x21, 0x2E, 0x47, 0x48, 0x12, 0x1D, 0x7B, 0x74, 0x2E, 0x21, 0x48, 0x47, 0x1D, 0x12, - 0x74, 0x84, 0x21, 0xD1, 0x47, 0xB7, 0x12, 0xE2, 0x7B, 0x8B, 0x2E, 0xDE, 0x48, 0xB8, 0x1D, 0xED}, - {0x1D, 0x12, 0x48, 0x47, 0x2E, 0x21, 0x7B, 0x74, 0x12, 0x1D, 0x47, 0x48, 0x21, 0x2E, 0x74, 0x7B, - 0x1D, 0xED, 0x48, 0xB8, 0x2E, 0xDE, 0x7B, 0x8B, 0x12, 0xE2, 0x47, 0xB7, 0x21, 0xD1, 0x74, 0x84}, - {0x48, 0x47, 0x1D, 0x12, 0x7B, 0x74, 0x2E, 0x21, 0x47, 0x48, 0x12, 0x1D, 0x74, 0x7B, 0x21, 0x2E, - 0x48, 0xB8, 0x1D, 0xED, 0x7B, 0x8B, 0x2E, 0xDE, 0x47, 0xB7, 0x12, 0xE2, 0x74, 0x84, 0x21, 0xD1}, - {0x2E, 0x21, 0x7B, 0x74, 0x1D, 0x12, 0x48, 0x47, 0x21, 0x2E, 0x74, 0x7B, 0x12, 0x1D, 0x47, 0x48, - 0x2E, 0xDE, 0x7B, 0x8B, 0x1D, 0xED, 0x48, 0xB8, 0x21, 0xD1, 0x74, 0x84, 0x12, 0xE2, 0x47, 0xB7}, - {0x7B, 0x74, 0x2E, 0x21, 0x48, 0x47, 0x1D, 0x12, 0x74, 0x7B, 0x21, 0x2E, 0x47, 0x48, 0x12, 0x1D, - 0x7B, 0x8B, 0x2E, 0xDE, 0x48, 0xB8, 0x1D, 0xED, 0x74, 0x84, 0x21, 0xD1, 0x47, 0xB7, 0x12, 0xE2}, - {0x12, 0xE2, 0x47, 0xB7, 0x21, 0xD1, 0x74, 0x84, 0x1D, 0xED, 0x48, 0xB8, 0x2E, 0xDE, 0x7B, 0x8B, - 0x12, 0x1D, 0x47, 0x48, 0x21, 0x2E, 0x74, 0x7B, 0x1D, 0x12, 0x48, 0x47, 0x2E, 0x21, 0x7B, 0x74}, - {0x47, 0xB7, 0x12, 0xE2, 0x74, 0x84, 0x21, 0xD1, 0x48, 0xB8, 0x1D, 0xED, 0x7B, 0x8B, 0x2E, 0xDE, - 0x47, 0x48, 0x12, 0x1D, 0x74, 0x7B, 0x21, 0x2E, 0x48, 0x47, 0x1D, 0x12, 0x7B, 0x74, 0x2E, 0x21}, - {0x21, 0xD1, 0x74, 0x84, 0x12, 0xE2, 0x47, 0xB7, 0x2E, 0xDE, 0x7B, 0x8B, 0x1D, 0xED, 0x48, 0xB8, - 0x21, 0x2E, 0x74, 0x7B, 0x12, 0x1D, 0x47, 0x48, 0x2E, 0x21, 0x7B, 0x74, 0x1D, 0x12, 0x48, 0x47}, - {0x74, 0x84, 0x21, 0xD1, 0x47, 0xB7, 0x12, 0xE2, 0x7B, 0x8B, 0x2E, 0xDE, 0x48, 0xB8, 0x1D, 0xED, - 0x74, 0x7B, 0x21, 0x2E, 0x47, 0x48, 0x12, 0x1D, 0x7B, 0x74, 0x2E, 0x21, 0x48, 0x47, 0x1D, 0x12}, - {0x1D, 0xED, 0x48, 0xB8, 0x2E, 0xDE, 0x7B, 0x8B, 0x12, 0xE2, 0x47, 0xB7, 0x21, 0xD1, 0x74, 0x84, - 0x1D, 0x12, 0x48, 0x47, 0x2E, 0x21, 0x7B, 0x74, 0x12, 0x1D, 0x47, 0x48, 0x21, 0x2E, 0x74, 0x7B}, - {0x48, 0xB8, 0x1D, 0xED, 0x7B, 0x8B, 0x2E, 0xDE, 0x47, 0xB7, 0x12, 0xE2, 0x74, 0x84, 0x21, 0xD1, - 0x48, 0x47, 0x1D, 0x12, 0x7B, 0x74, 0x2E, 0x21, 0x47, 0x48, 0x12, 0x1D, 0x74, 0x7B, 0x21, 0x2E}, - {0x2E, 0xDE, 0x7B, 0x8B, 0x1D, 0xED, 0x48, 0xB8, 0x21, 0xD1, 0x74, 0x84, 0x12, 0xE2, 0x47, 0xB7, - 0x2E, 0x21, 0x7B, 0x74, 0x1D, 0x12, 0x48, 0x47, 0x21, 0x2E, 0x74, 0x7B, 0x12, 0x1D, 0x47, 0x48}, - {0x7B, 0x8B, 0x2E, 0xDE, 0x48, 0xB8, 0x1D, 0xED, 0x74, 0x84, 0x21, 0xD1, 0x47, 0xB7, 0x12, 0xE2, - 0x7B, 0x74, 0x2E, 0x21, 0x48, 0x47, 0x1D, 0x12, 0x74, 0x7B, 0x21, 0x2E, 0x47, 0x48, 0x12, 0x1D} - }; +const unsigned char dvbt2_p1insertion_cc_impl::s2_modulation_patterns[16][32] = { + { 0x12, 0x1D, 0x47, 0x48, 0x21, 0x2E, 0x74, 0x7B, 0x1D, 0x12, 0x48, + 0x47, 0x2E, 0x21, 0x7B, 0x74, 0x12, 0xE2, 0x47, 0xB7, 0x21, 0xD1, + 0x74, 0x84, 0x1D, 0xED, 0x48, 0xB8, 0x2E, 0xDE, 0x7B, 0x8B }, + { 0x47, 0x48, 0x12, 0x1D, 0x74, 0x7B, 0x21, 0x2E, 0x48, 0x47, 0x1D, + 0x12, 0x7B, 0x74, 0x2E, 0x21, 0x47, 0xB7, 0x12, 0xE2, 0x74, 0x84, + 0x21, 0xD1, 0x48, 0xB8, 0x1D, 0xED, 0x7B, 0x8B, 0x2E, 0xDE }, + { 0x21, 0x2E, 0x74, 0x7B, 0x12, 0x1D, 0x47, 0x48, 0x2E, 0x21, 0x7B, + 0x74, 0x1D, 0x12, 0x48, 0x47, 0x21, 0xD1, 0x74, 0x84, 0x12, 0xE2, + 0x47, 0xB7, 0x2E, 0xDE, 0x7B, 0x8B, 0x1D, 0xED, 0x48, 0xB8 }, + { 0x74, 0x7B, 0x21, 0x2E, 0x47, 0x48, 0x12, 0x1D, 0x7B, 0x74, 0x2E, + 0x21, 0x48, 0x47, 0x1D, 0x12, 0x74, 0x84, 0x21, 0xD1, 0x47, 0xB7, + 0x12, 0xE2, 0x7B, 0x8B, 0x2E, 0xDE, 0x48, 0xB8, 0x1D, 0xED }, + { 0x1D, 0x12, 0x48, 0x47, 0x2E, 0x21, 0x7B, 0x74, 0x12, 0x1D, 0x47, + 0x48, 0x21, 0x2E, 0x74, 0x7B, 0x1D, 0xED, 0x48, 0xB8, 0x2E, 0xDE, + 0x7B, 0x8B, 0x12, 0xE2, 0x47, 0xB7, 0x21, 0xD1, 0x74, 0x84 }, + { 0x48, 0x47, 0x1D, 0x12, 0x7B, 0x74, 0x2E, 0x21, 0x47, 0x48, 0x12, + 0x1D, 0x74, 0x7B, 0x21, 0x2E, 0x48, 0xB8, 0x1D, 0xED, 0x7B, 0x8B, + 0x2E, 0xDE, 0x47, 0xB7, 0x12, 0xE2, 0x74, 0x84, 0x21, 0xD1 }, + { 0x2E, 0x21, 0x7B, 0x74, 0x1D, 0x12, 0x48, 0x47, 0x21, 0x2E, 0x74, + 0x7B, 0x12, 0x1D, 0x47, 0x48, 0x2E, 0xDE, 0x7B, 0x8B, 0x1D, 0xED, + 0x48, 0xB8, 0x21, 0xD1, 0x74, 0x84, 0x12, 0xE2, 0x47, 0xB7 }, + { 0x7B, 0x74, 0x2E, 0x21, 0x48, 0x47, 0x1D, 0x12, 0x74, 0x7B, 0x21, + 0x2E, 0x47, 0x48, 0x12, 0x1D, 0x7B, 0x8B, 0x2E, 0xDE, 0x48, 0xB8, + 0x1D, 0xED, 0x74, 0x84, 0x21, 0xD1, 0x47, 0xB7, 0x12, 0xE2 }, + { 0x12, 0xE2, 0x47, 0xB7, 0x21, 0xD1, 0x74, 0x84, 0x1D, 0xED, 0x48, + 0xB8, 0x2E, 0xDE, 0x7B, 0x8B, 0x12, 0x1D, 0x47, 0x48, 0x21, 0x2E, + 0x74, 0x7B, 0x1D, 0x12, 0x48, 0x47, 0x2E, 0x21, 0x7B, 0x74 }, + { 0x47, 0xB7, 0x12, 0xE2, 0x74, 0x84, 0x21, 0xD1, 0x48, 0xB8, 0x1D, + 0xED, 0x7B, 0x8B, 0x2E, 0xDE, 0x47, 0x48, 0x12, 0x1D, 0x74, 0x7B, + 0x21, 0x2E, 0x48, 0x47, 0x1D, 0x12, 0x7B, 0x74, 0x2E, 0x21 }, + { 0x21, 0xD1, 0x74, 0x84, 0x12, 0xE2, 0x47, 0xB7, 0x2E, 0xDE, 0x7B, + 0x8B, 0x1D, 0xED, 0x48, 0xB8, 0x21, 0x2E, 0x74, 0x7B, 0x12, 0x1D, + 0x47, 0x48, 0x2E, 0x21, 0x7B, 0x74, 0x1D, 0x12, 0x48, 0x47 }, + { 0x74, 0x84, 0x21, 0xD1, 0x47, 0xB7, 0x12, 0xE2, 0x7B, 0x8B, 0x2E, + 0xDE, 0x48, 0xB8, 0x1D, 0xED, 0x74, 0x7B, 0x21, 0x2E, 0x47, 0x48, + 0x12, 0x1D, 0x7B, 0x74, 0x2E, 0x21, 0x48, 0x47, 0x1D, 0x12 }, + { 0x1D, 0xED, 0x48, 0xB8, 0x2E, 0xDE, 0x7B, 0x8B, 0x12, 0xE2, 0x47, + 0xB7, 0x21, 0xD1, 0x74, 0x84, 0x1D, 0x12, 0x48, 0x47, 0x2E, 0x21, + 0x7B, 0x74, 0x12, 0x1D, 0x47, 0x48, 0x21, 0x2E, 0x74, 0x7B }, + { 0x48, 0xB8, 0x1D, 0xED, 0x7B, 0x8B, 0x2E, 0xDE, 0x47, 0xB7, 0x12, + 0xE2, 0x74, 0x84, 0x21, 0xD1, 0x48, 0x47, 0x1D, 0x12, 0x7B, 0x74, + 0x2E, 0x21, 0x47, 0x48, 0x12, 0x1D, 0x74, 0x7B, 0x21, 0x2E }, + { 0x2E, 0xDE, 0x7B, 0x8B, 0x1D, 0xED, 0x48, 0xB8, 0x21, 0xD1, 0x74, + 0x84, 0x12, 0xE2, 0x47, 0xB7, 0x2E, 0x21, 0x7B, 0x74, 0x1D, 0x12, + 0x48, 0x47, 0x21, 0x2E, 0x74, 0x7B, 0x12, 0x1D, 0x47, 0x48 }, + { 0x7B, 0x8B, 0x2E, 0xDE, 0x48, 0xB8, 0x1D, 0xED, 0x74, 0x84, 0x21, + 0xD1, 0x47, 0xB7, 0x12, 0xE2, 0x7B, 0x74, 0x2E, 0x21, 0x48, 0x47, + 0x1D, 0x12, 0x74, 0x7B, 0x21, 0x2E, 0x47, 0x48, 0x12, 0x1D } +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ - diff --git a/gr-dtv/lib/dvbt2/dvbt2_p1insertion_cc_impl.h b/gr-dtv/lib/dvbt2/dvbt2_p1insertion_cc_impl.h index 7d83b4c4a1..fb6c8de565 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_p1insertion_cc_impl.h +++ b/gr-dtv/lib/dvbt2/dvbt2_p1insertion_cc_impl.h @@ -27,59 +27,65 @@ #include <gnuradio/fft/fft.h> namespace gr { - namespace dtv { +namespace dtv { - class dvbt2_p1insertion_cc_impl : public dvbt2_p1insertion_cc - { - private: - int fft_size; - int guard_interval; - int frame_items; - int insertion_items; - int N_P2; - int p1_randomize[384]; - int modulation_sequence[384]; - int dbpsk_modulation_sequence[385]; - gr_complex p1_freq[1024]; - gr_complex p1_freqshft[1024]; - gr_complex p1_time[1024]; - gr_complex p1_timeshft[1024]; - void init_p1_randomizer(void); +class dvbt2_p1insertion_cc_impl : public dvbt2_p1insertion_cc +{ +private: + int fft_size; + int guard_interval; + int frame_items; + int insertion_items; + int N_P2; + int p1_randomize[384]; + int modulation_sequence[384]; + int dbpsk_modulation_sequence[385]; + gr_complex p1_freq[1024]; + gr_complex p1_freqshft[1024]; + gr_complex p1_time[1024]; + gr_complex p1_timeshft[1024]; + void init_p1_randomizer(void); - int show_levels; - float real_positive; - float real_negative; - float imag_positive; - float imag_negative; - float real_positive_threshold; - float real_negative_threshold; - float imag_positive_threshold; - float imag_negative_threshold; - int real_positive_threshold_count; - int real_negative_threshold_count; - int imag_positive_threshold_count; - int imag_negative_threshold_count; + int show_levels; + float real_positive; + float real_negative; + float imag_positive; + float imag_negative; + float real_positive_threshold; + float real_negative_threshold; + float imag_positive_threshold; + float imag_negative_threshold; + int real_positive_threshold_count; + int real_negative_threshold_count; + int imag_positive_threshold_count; + int imag_negative_threshold_count; - fft::fft_complex *p1_fft; - int p1_fft_size; + fft::fft_complex* p1_fft; + int p1_fft_size; - const static int p1_active_carriers[384]; - const static unsigned char s1_modulation_patterns[8][8]; - const static unsigned char s2_modulation_patterns[16][32]; + const static int p1_active_carriers[384]; + const static unsigned char s1_modulation_patterns[8][8]; + const static unsigned char s2_modulation_patterns[16][32]; - public: - dvbt2_p1insertion_cc_impl(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_preamble_t preamble, dvbt2_showlevels_t showlevels, float vclip); - ~dvbt2_p1insertion_cc_impl(); +public: + dvbt2_p1insertion_cc_impl(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_preamble_t preamble, + dvbt2_showlevels_t showlevels, + float vclip); + ~dvbt2_p1insertion_cc_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_P1INSERTION_CC_IMPL_H */ diff --git a/gr-dtv/lib/dvbt2/dvbt2_paprtr_cc_impl.cc b/gr-dtv/lib/dvbt2/dvbt2_paprtr_cc_impl.cc index 8d2e20775d..740b0a0b43 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_paprtr_cc_impl.cc +++ b/gr-dtv/lib/dvbt2/dvbt2_paprtr_cc_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015-2019 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -33,543 +33,570 @@ #define EARLY_EXIT namespace gr { - namespace dtv { +namespace dtv { - dvbt2_paprtr_cc::sptr - dvbt2_paprtr_cc::make(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, float vclip, int iterations, unsigned int vlength) - { - return gnuradio::get_initial_sptr - (new dvbt2_paprtr_cc_impl(carriermode, fftsize, pilotpattern, guardinterval, numdatasyms, paprmode, version, vclip, iterations, vlength)); - } +dvbt2_paprtr_cc::sptr dvbt2_paprtr_cc::make(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + float vclip, + int iterations, + unsigned int vlength) +{ + return gnuradio::get_initial_sptr(new dvbt2_paprtr_cc_impl(carriermode, + fftsize, + pilotpattern, + guardinterval, + numdatasyms, + paprmode, + version, + vclip, + iterations, + vlength)); +} - /* - * The private constructor - */ - dvbt2_paprtr_cc_impl::dvbt2_paprtr_cc_impl(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, float vclip, int iterations, unsigned int vlength) - : gr::sync_block("dvbt2_paprtr_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex) * vlength), - gr::io_signature::make(1, 1, sizeof(gr_complex) * vlength)) - { - switch (fftsize) { - case FFTSIZE_1K: - N_P2 = 16; - C_PS = 853; - K_EXT = 0; - break; - case FFTSIZE_2K: - N_P2 = 8; - C_PS = 1705; - K_EXT = 0; - break; - case FFTSIZE_4K: - N_P2 = 4; - C_PS = 3409; - K_EXT = 0; - break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: - N_P2 = 2; - if (carriermode == CARRIERS_NORMAL) { +/* + * The private constructor + */ +dvbt2_paprtr_cc_impl::dvbt2_paprtr_cc_impl(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + float vclip, + int iterations, + unsigned int vlength) + : gr::sync_block("dvbt2_paprtr_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex) * vlength), + gr::io_signature::make(1, 1, sizeof(gr_complex) * vlength)) +{ + switch (fftsize) { + case FFTSIZE_1K: + N_P2 = 16; + C_PS = 853; + K_EXT = 0; + break; + case FFTSIZE_2K: + N_P2 = 8; + C_PS = 1705; + K_EXT = 0; + break; + case FFTSIZE_4K: + N_P2 = 4; + C_PS = 3409; + K_EXT = 0; + break; + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: + N_P2 = 2; + if (carriermode == CARRIERS_NORMAL) { C_PS = 6817; K_EXT = 0; - } - else { + } else { C_PS = 6913; K_EXT = 48; - } - break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: - N_P2 = 1; - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: + N_P2 = 1; + if (carriermode == CARRIERS_NORMAL) { C_PS = 13633; K_EXT = 0; - } - else { + } else { C_PS = 13921; K_EXT = 144; - } - break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: - N_P2 = 1; - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: + N_P2 = 1; + if (carriermode == CARRIERS_NORMAL) { C_PS = 27265; K_EXT = 0; - } - else { + } else { C_PS = 27841; K_EXT = 288; - } - break; - } - switch (fftsize) { - case FFTSIZE_1K: - switch (pilotpattern) { - case PILOT_PP1: - N_FC = 568; - break; - case PILOT_PP2: - N_FC = 710; - break; - case PILOT_PP3: - N_FC = 710; - break; - case PILOT_PP4: - N_FC = 780; - break; - case PILOT_PP5: - N_FC = 780; - break; - case PILOT_PP6: - N_FC = 0; - break; - case PILOT_PP7: - N_FC = 0; - break; - case PILOT_PP8: - N_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + break; + } + switch (fftsize) { + case FFTSIZE_1K: + switch (pilotpattern) { + case PILOT_PP1: + N_FC = 568; + break; + case PILOT_PP2: + N_FC = 710; + break; + case PILOT_PP3: + N_FC = 710; + break; + case PILOT_PP4: + N_FC = 780; + break; + case PILOT_PP5: + N_FC = 780; + break; + case PILOT_PP6: + N_FC = 0; + break; + case PILOT_PP7: + N_FC = 0; + break; + case PILOT_PP8: + N_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (N_FC != 0) { - N_FC -= 10; + N_FC -= 10; } - } - break; - case FFTSIZE_2K: - switch (pilotpattern) { - case PILOT_PP1: - N_FC = 1136; - break; - case PILOT_PP2: - N_FC = 1420; - break; - case PILOT_PP3: - N_FC = 1420; - break; - case PILOT_PP4: - N_FC = 1562; - break; - case PILOT_PP5: - N_FC = 1562; - break; - case PILOT_PP6: - N_FC = 0; - break; - case PILOT_PP7: - N_FC = 1632; - break; - case PILOT_PP8: - N_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + break; + case FFTSIZE_2K: + switch (pilotpattern) { + case PILOT_PP1: + N_FC = 1136; + break; + case PILOT_PP2: + N_FC = 1420; + break; + case PILOT_PP3: + N_FC = 1420; + break; + case PILOT_PP4: + N_FC = 1562; + break; + case PILOT_PP5: + N_FC = 1562; + break; + case PILOT_PP6: + N_FC = 0; + break; + case PILOT_PP7: + N_FC = 1632; + break; + case PILOT_PP8: + N_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (N_FC != 0) { - N_FC -= 18; + N_FC -= 18; } - } - break; - case FFTSIZE_4K: - switch (pilotpattern) { - case PILOT_PP1: - N_FC = 2272; - break; - case PILOT_PP2: - N_FC = 2840; - break; - case PILOT_PP3: - N_FC = 2840; - break; - case PILOT_PP4: - N_FC = 3124; - break; - case PILOT_PP5: - N_FC = 3124; - break; - case PILOT_PP6: - N_FC = 0; - break; - case PILOT_PP7: - N_FC = 3266; - break; - case PILOT_PP8: - N_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + break; + case FFTSIZE_4K: + switch (pilotpattern) { + case PILOT_PP1: + N_FC = 2272; + break; + case PILOT_PP2: + N_FC = 2840; + break; + case PILOT_PP3: + N_FC = 2840; + break; + case PILOT_PP4: + N_FC = 3124; + break; + case PILOT_PP5: + N_FC = 3124; + break; + case PILOT_PP6: + N_FC = 0; + break; + case PILOT_PP7: + N_FC = 3266; + break; + case PILOT_PP8: + N_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (N_FC != 0) { - N_FC -= 36; + N_FC -= 36; } - } - break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: N_FC = 4544; break; - case PILOT_PP2: + case PILOT_PP2: N_FC = 5680; break; - case PILOT_PP3: + case PILOT_PP3: N_FC = 5680; break; - case PILOT_PP4: + case PILOT_PP4: N_FC = 6248; break; - case PILOT_PP5: + case PILOT_PP5: N_FC = 6248; break; - case PILOT_PP6: + case PILOT_PP6: N_FC = 0; break; - case PILOT_PP7: + case PILOT_PP7: N_FC = 6532; break; - case PILOT_PP8: + case PILOT_PP8: N_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: N_FC = 4608; break; - case PILOT_PP2: + case PILOT_PP2: N_FC = 5760; break; - case PILOT_PP3: + case PILOT_PP3: N_FC = 5760; break; - case PILOT_PP4: + case PILOT_PP4: N_FC = 6336; break; - case PILOT_PP5: + case PILOT_PP5: N_FC = 6336; break; - case PILOT_PP6: + case PILOT_PP6: N_FC = 0; break; - case PILOT_PP7: + case PILOT_PP7: N_FC = 6624; break; - case PILOT_PP8: + case PILOT_PP8: N_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (N_FC != 0) { - N_FC -= 72; + N_FC -= 72; } - } - break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: N_FC = 9088; break; - case PILOT_PP2: + case PILOT_PP2: N_FC = 11360; break; - case PILOT_PP3: + case PILOT_PP3: N_FC = 11360; break; - case PILOT_PP4: + case PILOT_PP4: N_FC = 12496; break; - case PILOT_PP5: + case PILOT_PP5: N_FC = 12496; break; - case PILOT_PP6: + case PILOT_PP6: N_FC = 13064; break; - case PILOT_PP7: + case PILOT_PP7: N_FC = 13064; break; - case PILOT_PP8: + case PILOT_PP8: N_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: N_FC = 9280; break; - case PILOT_PP2: + case PILOT_PP2: N_FC = 11600; break; - case PILOT_PP3: + case PILOT_PP3: N_FC = 11600; break; - case PILOT_PP4: + case PILOT_PP4: N_FC = 12760; break; - case PILOT_PP5: + case PILOT_PP5: N_FC = 12760; break; - case PILOT_PP6: + case PILOT_PP6: N_FC = 13340; break; - case PILOT_PP7: + case PILOT_PP7: N_FC = 13340; break; - case PILOT_PP8: + case PILOT_PP8: N_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (N_FC != 0) { - N_FC -= 144; + N_FC -= 144; } - } - break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: N_FC = 0; break; - case PILOT_PP2: + case PILOT_PP2: N_FC = 22720; break; - case PILOT_PP3: + case PILOT_PP3: N_FC = 0; break; - case PILOT_PP4: + case PILOT_PP4: N_FC = 24992; break; - case PILOT_PP5: + case PILOT_PP5: N_FC = 0; break; - case PILOT_PP6: + case PILOT_PP6: N_FC = 26128; break; - case PILOT_PP7: + case PILOT_PP7: N_FC = 0; break; - case PILOT_PP8: + case PILOT_PP8: N_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: N_FC = 0; break; - case PILOT_PP2: + case PILOT_PP2: N_FC = 23200; break; - case PILOT_PP3: + case PILOT_PP3: N_FC = 0; break; - case PILOT_PP4: + case PILOT_PP4: N_FC = 25520; break; - case PILOT_PP5: + case PILOT_PP5: N_FC = 0; break; - case PILOT_PP6: + case PILOT_PP6: N_FC = 26680; break; - case PILOT_PP7: + case PILOT_PP7: N_FC = 0; break; - case PILOT_PP8: + case PILOT_PP8: N_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (N_FC != 0) { - N_FC -= 288; + N_FC -= 288; } - } - break; - } - if (guardinterval == GI_1_128 && pilotpattern == PILOT_PP7) { + } + break; + } + if (guardinterval == GI_1_128 && pilotpattern == PILOT_PP7) { N_FC = 0; - } - if (guardinterval == GI_1_32 && pilotpattern == PILOT_PP4) { + } + if (guardinterval == GI_1_32 && pilotpattern == PILOT_PP4) { N_FC = 0; - } - if (guardinterval == GI_1_16 && pilotpattern == PILOT_PP2) { + } + if (guardinterval == GI_1_16 && pilotpattern == PILOT_PP2) { N_FC = 0; - } - if (guardinterval == GI_19_256 && pilotpattern == PILOT_PP2) { + } + if (guardinterval == GI_19_256 && pilotpattern == PILOT_PP2) { N_FC = 0; - } - for (int i = 0; i < C_PS; i++) { + } + for (int i = 0; i < C_PS; i++) { p2_carrier_map[i] = DATA_CARRIER; fc_carrier_map[i] = DATA_CARRIER; - } - switch (fftsize) { - case FFTSIZE_1K: - for (int i = 0; i < 10; i++) { + } + switch (fftsize) { + case FFTSIZE_1K: + for (int i = 0; i < 10; i++) { p2_carrier_map[p2_papr_map_1k[i]] = P2PAPR_CARRIER; fc_carrier_map[p2_papr_map_1k[i]] = TRPAPR_CARRIER; - } - N_TR = 10; - p2_papr_map = p2_papr_map_1k; - tr_papr_map = tr_papr_map_1k; - break; - case FFTSIZE_2K: - for (int i = 0; i < 18; i++) { + } + N_TR = 10; + p2_papr_map = p2_papr_map_1k; + tr_papr_map = tr_papr_map_1k; + break; + case FFTSIZE_2K: + for (int i = 0; i < 18; i++) { p2_carrier_map[p2_papr_map_2k[i]] = P2PAPR_CARRIER; fc_carrier_map[p2_papr_map_2k[i]] = TRPAPR_CARRIER; - } - N_TR = 18; - p2_papr_map = p2_papr_map_2k; - tr_papr_map = tr_papr_map_2k; - break; - case FFTSIZE_4K: - for (int i = 0; i < 36; i++) { + } + N_TR = 18; + p2_papr_map = p2_papr_map_2k; + tr_papr_map = tr_papr_map_2k; + break; + case FFTSIZE_4K: + for (int i = 0; i < 36; i++) { p2_carrier_map[p2_papr_map_4k[i]] = P2PAPR_CARRIER; fc_carrier_map[p2_papr_map_4k[i]] = TRPAPR_CARRIER; - } - N_TR = 36; - p2_papr_map = p2_papr_map_4k; - tr_papr_map = tr_papr_map_4k; - break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: - for (int i = 0; i < 72; i++) { + } + N_TR = 36; + p2_papr_map = p2_papr_map_4k; + tr_papr_map = tr_papr_map_4k; + break; + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: + for (int i = 0; i < 72; i++) { p2_carrier_map[p2_papr_map_8k[i] + K_EXT] = P2PAPR_CARRIER; fc_carrier_map[p2_papr_map_8k[i] + K_EXT] = TRPAPR_CARRIER; - } - N_TR = 72; - p2_papr_map = p2_papr_map_8k; - tr_papr_map = tr_papr_map_8k; - break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: - for (int i = 0; i < 144; i++) { + } + N_TR = 72; + p2_papr_map = p2_papr_map_8k; + tr_papr_map = tr_papr_map_8k; + break; + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: + for (int i = 0; i < 144; i++) { p2_carrier_map[p2_papr_map_16k[i] + K_EXT] = P2PAPR_CARRIER; fc_carrier_map[p2_papr_map_16k[i] + K_EXT] = TRPAPR_CARRIER; - } - N_TR = 144; - p2_papr_map = p2_papr_map_16k; - tr_papr_map = tr_papr_map_16k; - break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: - for (int i = 0; i < 288; i++) { + } + N_TR = 144; + p2_papr_map = p2_papr_map_16k; + tr_papr_map = tr_papr_map_16k; + break; + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: + for (int i = 0; i < 288; i++) { p2_carrier_map[p2_papr_map_32k[i] + K_EXT] = P2PAPR_CARRIER; fc_carrier_map[p2_papr_map_32k[i] + K_EXT] = TRPAPR_CARRIER; - } - N_TR = 288; - p2_papr_map = p2_papr_map_32k; - tr_papr_map = tr_papr_map_32k; - break; - } - switch (pilotpattern) { - case PILOT_PP1: - dx = 3; - dy = 4; - break; - case PILOT_PP2: - dx = 6; - dy = 2; - break; - case PILOT_PP3: - dx = 6; - dy = 4; - break; - case PILOT_PP4: - dx = 12; - dy = 2; - break; - case PILOT_PP5: - dx = 12; - dy = 4; - break; - case PILOT_PP6: - dx = 24; - dy = 2; - break; - case PILOT_PP7: - dx = 24; - dy = 4; - break; - case PILOT_PP8: - dx = 6; - dy = 16; - break; - } - shift = 0; - papr_map = p2_papr_map; - fft_size = fftsize; - pilot_pattern = pilotpattern; - carrier_mode = carriermode; - papr_mode = paprmode; - version_num = version; - if (version == VERSION_131 && papr_mode == PAPR_OFF) { + } + N_TR = 288; + p2_papr_map = p2_papr_map_32k; + tr_papr_map = tr_papr_map_32k; + break; + } + switch (pilotpattern) { + case PILOT_PP1: + dx = 3; + dy = 4; + break; + case PILOT_PP2: + dx = 6; + dy = 2; + break; + case PILOT_PP3: + dx = 6; + dy = 4; + break; + case PILOT_PP4: + dx = 12; + dy = 2; + break; + case PILOT_PP5: + dx = 12; + dy = 4; + break; + case PILOT_PP6: + dx = 24; + dy = 2; + break; + case PILOT_PP7: + dx = 24; + dy = 4; + break; + case PILOT_PP8: + dx = 6; + dy = 16; + break; + } + shift = 0; + papr_map = p2_papr_map; + fft_size = fftsize; + pilot_pattern = pilotpattern; + carrier_mode = carriermode; + papr_mode = paprmode; + version_num = version; + if (version == VERSION_131 && papr_mode == PAPR_OFF) { v_clip = 3.0; num_iterations = 1; - } - else { + } else { v_clip = vclip; num_iterations = iterations; - } - left_nulls = ((vlength - C_PS) / 2) + 1; - right_nulls = (vlength - C_PS) / 2; - papr_fft_size = vlength; - papr_fft = new (std::nothrow) fft::fft_complex(papr_fft_size, false, 1); - if (papr_fft == NULL) { - GR_LOG_FATAL(d_logger, "Tone Reservation PAPR, cannot allocate memory for papr_fft."); + } + left_nulls = ((vlength - C_PS) / 2) + 1; + right_nulls = (vlength - C_PS) / 2; + papr_fft_size = vlength; + papr_fft = new (std::nothrow) fft::fft_complex(papr_fft_size, false, 1); + if (papr_fft == NULL) { + GR_LOG_FATAL(d_logger, + "Tone Reservation PAPR, cannot allocate memory for papr_fft."); throw std::bad_alloc(); - } - ones_freq = (gr_complex*) volk_malloc(sizeof(gr_complex) * papr_fft_size, volk_get_alignment()); - if (ones_freq == NULL) { - GR_LOG_FATAL(d_logger, "Tone Reservation PAPR, cannot allocate memory for ones_freq."); + } + ones_freq = (gr_complex*)volk_malloc(sizeof(gr_complex) * papr_fft_size, + volk_get_alignment()); + if (ones_freq == NULL) { + GR_LOG_FATAL(d_logger, + "Tone Reservation PAPR, cannot allocate memory for ones_freq."); delete papr_fft; throw std::bad_alloc(); - } - ones_time = (gr_complex*) volk_malloc(sizeof(gr_complex) * papr_fft_size, volk_get_alignment()); - if (ones_time == NULL) { - GR_LOG_FATAL(d_logger, "Tone Reservation PAPR, cannot allocate memory for ones_time."); + } + ones_time = (gr_complex*)volk_malloc(sizeof(gr_complex) * papr_fft_size, + volk_get_alignment()); + if (ones_time == NULL) { + GR_LOG_FATAL(d_logger, + "Tone Reservation PAPR, cannot allocate memory for ones_time."); volk_free(ones_freq); delete papr_fft; throw std::bad_alloc(); - } - c = (gr_complex*) volk_malloc(sizeof(gr_complex) * papr_fft_size, volk_get_alignment()); - if (c == NULL) { + } + c = (gr_complex*)volk_malloc(sizeof(gr_complex) * papr_fft_size, + volk_get_alignment()); + if (c == NULL) { GR_LOG_FATAL(d_logger, "Tone Reservation PAPR, cannot allocate memory for c."); volk_free(ones_time); volk_free(ones_freq); delete papr_fft; throw std::bad_alloc(); - } - ctemp = (gr_complex*) volk_malloc(sizeof(gr_complex) * papr_fft_size, volk_get_alignment()); - if (ctemp == NULL) { - GR_LOG_FATAL(d_logger, "Tone Reservation PAPR, cannot allocate memory for ctemp."); + } + ctemp = (gr_complex*)volk_malloc(sizeof(gr_complex) * papr_fft_size, + volk_get_alignment()); + if (ctemp == NULL) { + GR_LOG_FATAL(d_logger, + "Tone Reservation PAPR, cannot allocate memory for ctemp."); volk_free(c); volk_free(ones_time); volk_free(ones_freq); delete papr_fft; throw std::bad_alloc(); - } - magnitude = (float*) volk_malloc(sizeof(float) * papr_fft_size, volk_get_alignment()); - if (magnitude == NULL) { - GR_LOG_FATAL(d_logger, "Tone Reservation PAPR, cannot allocate memory for magnitude."); + } + magnitude = (float*)volk_malloc(sizeof(float) * papr_fft_size, volk_get_alignment()); + if (magnitude == NULL) { + GR_LOG_FATAL(d_logger, + "Tone Reservation PAPR, cannot allocate memory for magnitude."); volk_free(ctemp); volk_free(c); volk_free(ones_time); volk_free(ones_freq); delete papr_fft; throw std::bad_alloc(); - } - r = (gr_complex*) volk_malloc(sizeof(gr_complex) * N_TR, volk_get_alignment()); - if (r == NULL) { + } + r = (gr_complex*)volk_malloc(sizeof(gr_complex) * N_TR, volk_get_alignment()); + if (r == NULL) { GR_LOG_FATAL(d_logger, "Tone Reservation PAPR, cannot allocate memory for r."); volk_free(magnitude); volk_free(ctemp); @@ -578,9 +605,9 @@ namespace gr { volk_free(ones_freq); delete papr_fft; throw std::bad_alloc(); - } - rNew = (gr_complex*) volk_malloc(sizeof(gr_complex) * N_TR, volk_get_alignment()); - if (rNew == NULL) { + } + rNew = (gr_complex*)volk_malloc(sizeof(gr_complex) * N_TR, volk_get_alignment()); + if (rNew == NULL) { GR_LOG_FATAL(d_logger, "Tone Reservation PAPR, cannot allocate memory for rNew."); volk_free(r); volk_free(magnitude); @@ -590,9 +617,9 @@ namespace gr { volk_free(ones_freq); delete papr_fft; throw std::bad_alloc(); - } - v = (gr_complex*) volk_malloc(sizeof(gr_complex) * N_TR, volk_get_alignment()); - if (v == NULL) { + } + v = (gr_complex*)volk_malloc(sizeof(gr_complex) * N_TR, volk_get_alignment()); + if (v == NULL) { GR_LOG_FATAL(d_logger, "Tone Reservation PAPR, cannot allocate memory for v."); volk_free(rNew); volk_free(r); @@ -603,382 +630,379 @@ namespace gr { volk_free(ones_freq); delete papr_fft; throw std::bad_alloc(); - } - num_symbols = numdatasyms + N_P2; - set_output_multiple(num_symbols); } + num_symbols = numdatasyms + N_P2; + set_output_multiple(num_symbols); +} - /* - * Our virtual destructor. - */ - dvbt2_paprtr_cc_impl::~dvbt2_paprtr_cc_impl() - { - volk_free(v); - volk_free(rNew); - volk_free(r); - volk_free(magnitude); - volk_free(ctemp); - volk_free(c); - volk_free(ones_time); - volk_free(ones_freq); - delete papr_fft; - } +/* + * Our virtual destructor. + */ +dvbt2_paprtr_cc_impl::~dvbt2_paprtr_cc_impl() +{ + volk_free(v); + volk_free(rNew); + volk_free(r); + volk_free(magnitude); + volk_free(ctemp); + volk_free(c); + volk_free(ones_time); + volk_free(ones_freq); + delete papr_fft; +} - void - dvbt2_paprtr_cc_impl::init_pilots(int symbol) - { - for (int i = 0; i < C_PS; i++) { +void dvbt2_paprtr_cc_impl::init_pilots(int symbol) +{ + for (int i = 0; i < C_PS; i++) { data_carrier_map[i] = DATA_CARRIER; - } - if (carrier_mode == CARRIERS_NORMAL) { + } + if (carrier_mode == CARRIERS_NORMAL) { shift = dx * (symbol % dy); - } - else { + } else { shift = dx * ((symbol + (K_EXT / dx)) % dy); - } - switch (fft_size) { - case FFTSIZE_1K: - for (int i = 0; i < 10; i++) { + } + switch (fft_size) { + case FFTSIZE_1K: + for (int i = 0; i < 10; i++) { data_carrier_map[tr_papr_map_1k[i] + shift] = TRPAPR_CARRIER; - } - break; - case FFTSIZE_2K: - for (int i = 0; i < 18; i++) { + } + break; + case FFTSIZE_2K: + for (int i = 0; i < 18; i++) { data_carrier_map[tr_papr_map_2k[i] + shift] = TRPAPR_CARRIER; - } - break; - case FFTSIZE_4K: - for (int i = 0; i < 36; i++) { + } + break; + case FFTSIZE_4K: + for (int i = 0; i < 36; i++) { data_carrier_map[tr_papr_map_4k[i] + shift] = TRPAPR_CARRIER; - } - break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: - for (int i = 0; i < 72; i++) { + } + break; + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: + for (int i = 0; i < 72; i++) { data_carrier_map[tr_papr_map_8k[i] + shift] = TRPAPR_CARRIER; - } - break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: - for (int i = 0; i < 144; i++) { + } + break; + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: + for (int i = 0; i < 144; i++) { data_carrier_map[tr_papr_map_16k[i] + shift] = TRPAPR_CARRIER; - } - break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: - for (int i = 0; i < 288; i++) { + } + break; + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: + for (int i = 0; i < 288; i++) { data_carrier_map[tr_papr_map_32k[i] + shift] = TRPAPR_CARRIER; - } - break; - } + } + break; } +} - int - dvbt2_paprtr_cc_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - const gr_complex one (1.0, 0.0); - const gr_complex zero (0.0, 0.0); - const float normalization = 1.0 / N_TR; - const int L_FC = (N_FC != 0); - const int center = (C_PS - 1) / 2; - const float aMax = 5.0 * N_TR * std::sqrt(10.0 / (27.0 * C_PS)); - gr_complex *dst; - int m = 0, index, valid; - float y, a, alpha; - gr_complex u, result; - double vtemp; +int dvbt2_paprtr_cc_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + gr_complex* out = (gr_complex*)output_items[0]; + const gr_complex one(1.0, 0.0); + const gr_complex zero(0.0, 0.0); + const float normalization = 1.0 / N_TR; + const int L_FC = (N_FC != 0); + const int center = (C_PS - 1) / 2; + const float aMax = 5.0 * N_TR * std::sqrt(10.0 / (27.0 * C_PS)); + gr_complex* dst; + int m = 0, index, valid; + float y, a, alpha; + gr_complex u, result; + double vtemp; - for (int i = 0; i < noutput_items; i += num_symbols) { - if (papr_mode == PAPR_TR || papr_mode == PAPR_BOTH || (version_num == VERSION_131 && papr_mode == PAPR_OFF)) { - for (int j = 0; j < num_symbols; j++) { - init_pilots(j); - valid = FALSE; - if (j < N_P2) { - index = 0; - std::fill_n(&ones_freq[index], left_nulls, 0); - index = left_nulls; - for (int n = 0; n < C_PS; n++) { - if (p2_carrier_map[n] == P2PAPR_CARRIER) { - ones_freq[index++] = one; - } - else { - ones_freq[index++] = zero; - } - } - std::fill_n(&ones_freq[index], right_nulls, 0); - papr_map = p2_papr_map; - valid = TRUE; - } - else if (j == (num_symbols - L_FC) && (papr_mode == PAPR_TR || papr_mode == PAPR_BOTH)) { - index = 0; - std::fill_n(&ones_freq[index], left_nulls, 0); - index = left_nulls; - for (int n = 0; n < C_PS; n++) { - if (fc_carrier_map[n] == TRPAPR_CARRIER) { - ones_freq[index++] = one; - } - else { - ones_freq[index++] = zero; - } - } - std::fill_n(&ones_freq[index], right_nulls, 0); - papr_map = p2_papr_map; - valid = TRUE; - } - else if (papr_mode == PAPR_TR || papr_mode == PAPR_BOTH) { - index = 0; - std::fill_n(&ones_freq[index], left_nulls, 0); - index = left_nulls; - for (int n = 0; n < C_PS; n++) { - if (data_carrier_map[n] == TRPAPR_CARRIER) { - ones_freq[index++] = one; - } - else { - ones_freq[index++] = zero; - } - } - std::fill_n(&ones_freq[index], right_nulls, 0); - papr_map = tr_papr_map; - valid = TRUE; - } - if (valid == TRUE) { - dst = papr_fft->get_inbuf(); - memcpy(&dst[papr_fft_size / 2], &ones_freq[0], sizeof(gr_complex) * papr_fft_size / 2); - memcpy(&dst[0], &ones_freq[papr_fft_size / 2], sizeof(gr_complex) * papr_fft_size / 2); - papr_fft->execute(); - memcpy(ones_time, papr_fft->get_outbuf(), sizeof(gr_complex) * papr_fft_size); - volk_32fc_s32fc_multiply_32fc(ones_time, ones_time, normalization, papr_fft_size); - std::fill_n(&r[0], N_TR, 0); - std::fill_n(&c[0], papr_fft_size, 0); - for (int k = 1; k <= num_iterations; k++) { - y = 0.0; - volk_32f_x2_add_32f((float*)ctemp, (float*)in, (float*)c, papr_fft_size * 2); - volk_32fc_magnitude_32f(magnitude, ctemp, papr_fft_size); - for (int n = 0; n < papr_fft_size; n++) { - if (magnitude[n] > y) { - y = magnitude[n]; - m = n; - } + for (int i = 0; i < noutput_items; i += num_symbols) { + if (papr_mode == PAPR_TR || papr_mode == PAPR_BOTH || + (version_num == VERSION_131 && papr_mode == PAPR_OFF)) { + for (int j = 0; j < num_symbols; j++) { + init_pilots(j); + valid = FALSE; + if (j < N_P2) { + index = 0; + std::fill_n(&ones_freq[index], left_nulls, 0); + index = left_nulls; + for (int n = 0; n < C_PS; n++) { + if (p2_carrier_map[n] == P2PAPR_CARRIER) { + ones_freq[index++] = one; + } else { + ones_freq[index++] = zero; + } + } + std::fill_n(&ones_freq[index], right_nulls, 0); + papr_map = p2_papr_map; + valid = TRUE; + } else if (j == (num_symbols - L_FC) && + (papr_mode == PAPR_TR || papr_mode == PAPR_BOTH)) { + index = 0; + std::fill_n(&ones_freq[index], left_nulls, 0); + index = left_nulls; + for (int n = 0; n < C_PS; n++) { + if (fc_carrier_map[n] == TRPAPR_CARRIER) { + ones_freq[index++] = one; + } else { + ones_freq[index++] = zero; + } + } + std::fill_n(&ones_freq[index], right_nulls, 0); + papr_map = p2_papr_map; + valid = TRUE; + } else if (papr_mode == PAPR_TR || papr_mode == PAPR_BOTH) { + index = 0; + std::fill_n(&ones_freq[index], left_nulls, 0); + index = left_nulls; + for (int n = 0; n < C_PS; n++) { + if (data_carrier_map[n] == TRPAPR_CARRIER) { + ones_freq[index++] = one; + } else { + ones_freq[index++] = zero; + } + } + std::fill_n(&ones_freq[index], right_nulls, 0); + papr_map = tr_papr_map; + valid = TRUE; } + if (valid == TRUE) { + dst = papr_fft->get_inbuf(); + memcpy(&dst[papr_fft_size / 2], + &ones_freq[0], + sizeof(gr_complex) * papr_fft_size / 2); + memcpy(&dst[0], + &ones_freq[papr_fft_size / 2], + sizeof(gr_complex) * papr_fft_size / 2); + papr_fft->execute(); + memcpy(ones_time, + papr_fft->get_outbuf(), + sizeof(gr_complex) * papr_fft_size); + volk_32fc_s32fc_multiply_32fc( + ones_time, ones_time, normalization, papr_fft_size); + std::fill_n(&r[0], N_TR, 0); + std::fill_n(&c[0], papr_fft_size, 0); + for (int k = 1; k <= num_iterations; k++) { + y = 0.0; + volk_32f_x2_add_32f( + (float*)ctemp, (float*)in, (float*)c, papr_fft_size * 2); + volk_32fc_magnitude_32f(magnitude, ctemp, papr_fft_size); + for (int n = 0; n < papr_fft_size; n++) { + if (magnitude[n] > y) { + y = magnitude[n]; + m = n; + } + } #ifdef EARLY_EXIT - if (y < v_clip + 0.01) { - break; - } + if (y < v_clip + 0.01) { + break; + } #else - if (y < v_clip) { - break; - } + if (y < v_clip) { + break; + } #endif - u = (in[m] + c[m]) / y; - alpha = y - v_clip; - for (int n = 0; n < N_TR; n++) { - vtemp = (-2.0 * GR_M_PI * m * ((papr_map[n] + shift) - center)) / papr_fft_size; - ctemp[n] = std::exp(gr_complexd(0.0, vtemp)); - } - volk_32fc_s32fc_multiply_32fc(v, ctemp, u, N_TR); - volk_32f_s32f_multiply_32f((float*)rNew, (float*)v, alpha, N_TR * 2); - volk_32f_x2_subtract_32f((float*)rNew, (float*)r, (float*)rNew, N_TR * 2); - volk_32fc_x2_multiply_conjugate_32fc(ctemp, r, v, N_TR); - for (int n = 0; n < N_TR; n++) { - alphaLimit[n] = std::sqrt((aMax * aMax) - (ctemp[n].imag() * ctemp[n].imag())) + ctemp[n].real(); - } - index = 0; - volk_32fc_magnitude_32f(magnitude, rNew, N_TR); - for (int n = 0; n < N_TR; n++) { - if (magnitude[n] > aMax) { - alphaLimitMax[index++] = alphaLimit[n]; - } - } - if (index != 0) { - a = 1.0e+30; - for (int n = 0; n < index; n++) { - if (alphaLimitMax[n] < a) { - a = alphaLimitMax[n]; + u = (in[m] + c[m]) / y; + alpha = y - v_clip; + for (int n = 0; n < N_TR; n++) { + vtemp = + (-2.0 * GR_M_PI * m * ((papr_map[n] + shift) - center)) / + papr_fft_size; + ctemp[n] = std::exp(gr_complexd(0.0, vtemp)); + } + volk_32fc_s32fc_multiply_32fc(v, ctemp, u, N_TR); + volk_32f_s32f_multiply_32f( + (float*)rNew, (float*)v, alpha, N_TR * 2); + volk_32f_x2_subtract_32f( + (float*)rNew, (float*)r, (float*)rNew, N_TR * 2); + volk_32fc_x2_multiply_conjugate_32fc(ctemp, r, v, N_TR); + for (int n = 0; n < N_TR; n++) { + alphaLimit[n] = std::sqrt((aMax * aMax) - (ctemp[n].imag() * + ctemp[n].imag())) + + ctemp[n].real(); + } + index = 0; + volk_32fc_magnitude_32f(magnitude, rNew, N_TR); + for (int n = 0; n < N_TR; n++) { + if (magnitude[n] > aMax) { + alphaLimitMax[index++] = alphaLimit[n]; + } + } + if (index != 0) { + a = 1.0e+30; + for (int n = 0; n < index; n++) { + if (alphaLimitMax[n] < a) { + a = alphaLimitMax[n]; + } + } + alpha = a; + volk_32f_s32f_multiply_32f( + (float*)rNew, (float*)v, alpha, N_TR * 2); + volk_32f_x2_subtract_32f( + (float*)rNew, (float*)r, (float*)rNew, N_TR * 2); + } + for (int n = 0; n < papr_fft_size; n++) { + ones_freq[(n + m) % papr_fft_size] = ones_time[n]; + } + result = u * alpha; + volk_32fc_s32fc_multiply_32fc( + ctemp, ones_freq, result, papr_fft_size); + volk_32f_x2_subtract_32f( + (float*)c, (float*)c, (float*)ctemp, papr_fft_size * 2); + memcpy(r, rNew, sizeof(gr_complex) * N_TR); } - } - alpha = a; - volk_32f_s32f_multiply_32f((float*)rNew, (float*)v, alpha, N_TR * 2); - volk_32f_x2_subtract_32f((float*)rNew, (float*)r, (float*)rNew, N_TR * 2); + volk_32f_x2_add_32f( + (float*)out, (float*)in, (float*)c, papr_fft_size * 2); + in = in + papr_fft_size; + out = out + papr_fft_size; + } else { + memcpy(out, in, sizeof(gr_complex) * papr_fft_size); + in = in + papr_fft_size; + out = out + papr_fft_size; } - for (int n = 0; n < papr_fft_size; n++) { - ones_freq[(n + m) % papr_fft_size] = ones_time[n]; - } - result = u * alpha; - volk_32fc_s32fc_multiply_32fc(ctemp, ones_freq, result, papr_fft_size); - volk_32f_x2_subtract_32f((float*)c, (float*)c, (float*)ctemp, papr_fft_size * 2); - memcpy(r, rNew, sizeof(gr_complex) * N_TR); - } - volk_32f_x2_add_32f((float*)out, (float*)in, (float*)c, papr_fft_size * 2); - in = in + papr_fft_size; - out = out + papr_fft_size; } - else { - memcpy(out, in, sizeof(gr_complex) * papr_fft_size); - in = in + papr_fft_size; - out = out + papr_fft_size; + } else { + for (int j = 0; j < num_symbols; j++) { + memcpy(out, in, sizeof(gr_complex) * papr_fft_size); + in = in + papr_fft_size; + out = out + papr_fft_size; } - } - } - else { - for (int j = 0; j < num_symbols; j++) { - memcpy(out, in, sizeof(gr_complex) * papr_fft_size); - in = in + papr_fft_size; - out = out + papr_fft_size; - } } - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - const int dvbt2_paprtr_cc_impl::p2_papr_map_1k[10] = - { - 116, 130, 134, 157, 182, 256, 346, 478, 479, 532 - }; + // Tell runtime system how many output items we produced. + return noutput_items; +} - const int dvbt2_paprtr_cc_impl::p2_papr_map_2k[18] = - { - 113, 124, 262, 467, 479, 727, 803, 862, 910, 946, - 980, 1201, 1322, 1342, 1396, 1397, 1562, 1565 - }; +const int dvbt2_paprtr_cc_impl::p2_papr_map_1k[10] = { 116, 130, 134, 157, 182, + 256, 346, 478, 479, 532 }; - const int dvbt2_paprtr_cc_impl::p2_papr_map_4k[36] = - { - 104, 116, 119, 163, 170, 173, 664, 886, 1064, 1151, 1196, 1264, 1531, - 1736, 1951, 1960, 2069, 2098, 2311, 2366, 2473, 2552, 2584, 2585, 2645, - 2774, 2846, 2882, 3004, 3034, 3107, 3127, 3148, 3191, 3283, 3289 - }; +const int dvbt2_paprtr_cc_impl::p2_papr_map_2k[18] = { + 113, 124, 262, 467, 479, 727, 803, 862, 910, + 946, 980, 1201, 1322, 1342, 1396, 1397, 1562, 1565 +}; - const int dvbt2_paprtr_cc_impl::p2_papr_map_8k[72] = - { - 106, 109, 110, 112, 115, 118, 133, 142, 163, 184, 206, 247, 445, 461, - 503, 565, 602, 656, 766, 800, 922, 1094, 1108, 1199, 1258, 1726, 1793, - 1939, 2128, 2714, 3185, 3365, 3541, 3655, 3770, 3863, 4066, 4190, 4282, - 4565, 4628, 4727, 4882, 4885, 5143, 5192, 5210, 5257, 5261, 5459, 5651, - 5809, 5830, 5986, 6020, 6076, 6253, 6269, 6410, 6436, 6467, 6475, 6509, - 6556, 6611, 6674, 6685, 6689, 6691, 6695, 6698, 6701 - }; +const int dvbt2_paprtr_cc_impl::p2_papr_map_4k[36] = { + 104, 116, 119, 163, 170, 173, 664, 886, 1064, 1151, 1196, 1264, + 1531, 1736, 1951, 1960, 2069, 2098, 2311, 2366, 2473, 2552, 2584, 2585, + 2645, 2774, 2846, 2882, 3004, 3034, 3107, 3127, 3148, 3191, 3283, 3289 +}; - const int dvbt2_paprtr_cc_impl::p2_papr_map_16k[144] = - { - 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119, 121, 122, 125, 128, - 131, 134, 137, 140, 143, 161, 223, 230, 398, 482, 497, 733, 809, 850, 922, - 962, 1196, 1256, 1262, 1559, 1691, 1801, 1819, 1937, 2005, 2095, 2308, 2383, - 2408, 2425, 2428, 2479, 2579, 2893, 2902, 3086, 3554, 4085, 4127, 4139, 4151, - 4163, 4373, 4400, 4576, 4609, 4952, 4961, 5444, 5756, 5800, 6094, 6208, 6658, - 6673, 6799, 7208, 7682, 8101, 8135, 8230, 8692, 8788, 8933, 9323, 9449, 9478, - 9868, 10192, 10261, 10430, 10630, 10685, 10828, 10915, 10930, 10942, 11053, - 11185, 11324, 11369, 11468, 11507, 11542, 11561, 11794, 11912, 11974, 11978, - 12085, 12179, 12193, 12269, 12311, 12758, 12767, 12866, 12938, 12962, 12971, - 13099, 13102, 13105, 13120, 13150, 13280, 13282, 13309, 13312, 13321, 13381, - 13402, 13448, 13456, 13462, 13463, 13466, 13478, 13492, 13495, 13498, 13501, - 13502, 13504, 13507, 13510, 13513, 13514, 13516 - }; +const int dvbt2_paprtr_cc_impl::p2_papr_map_8k[72] = { + 106, 109, 110, 112, 115, 118, 133, 142, 163, 184, 206, 247, + 445, 461, 503, 565, 602, 656, 766, 800, 922, 1094, 1108, 1199, + 1258, 1726, 1793, 1939, 2128, 2714, 3185, 3365, 3541, 3655, 3770, 3863, + 4066, 4190, 4282, 4565, 4628, 4727, 4882, 4885, 5143, 5192, 5210, 5257, + 5261, 5459, 5651, 5809, 5830, 5986, 6020, 6076, 6253, 6269, 6410, 6436, + 6467, 6475, 6509, 6556, 6611, 6674, 6685, 6689, 6691, 6695, 6698, 6701 +}; - const int dvbt2_paprtr_cc_impl::p2_papr_map_32k[288] = - { - 104, 106, 107, 109, 110, 112, 113, 115, 118, 121, 124, 127, 130, 133, 136, - 139, 142, 145, 148, 151, 154, 157, 160, 163, 166, 169, 172, 175, 178, 181, - 184, 187, 190, 193, 196, 199, 202, 205, 208, 211, 404, 452, 455, 467, 509, - 539, 568, 650, 749, 1001, 1087, 1286, 1637, 1823, 1835, 1841, 1889, 1898, - 1901, 2111, 2225, 2252, 2279, 2309, 2315, 2428, 2452, 2497, 2519, 3109, 3154, - 3160, 3170, 3193, 3214, 3298, 3331, 3346, 3388, 3397, 3404, 3416, 3466, 3491, - 3500, 3572, 4181, 4411, 4594, 4970, 5042, 5069, 5081, 5086, 5095, 5104, 5320, - 5465, 5491, 6193, 6541, 6778, 6853, 6928, 6934, 7030, 7198, 7351, 7712, 7826, - 7922, 8194, 8347, 8350, 8435, 8518, 8671, 8861, 8887, 9199, 9980, 10031, 10240, - 10519, 10537, 10573, 10589, 11078, 11278, 11324, 11489, 11642, 12034, 12107, 12184, - 12295, 12635, 12643, 12941, 12995, 13001, 13133, 13172, 13246, 13514, 13522, 13939, - 14362, 14720, 14926, 15338, 15524, 15565, 15662, 15775, 16358, 16613, 16688, 16760, - 17003, 17267, 17596, 17705, 18157, 18272, 18715, 18994, 19249, 19348, 20221, 20855, - 21400, 21412, 21418, 21430, 21478, 21559, 21983, 21986, 22331, 22367, 22370, 22402, - 22447, 22535, 22567, 22571, 22660, 22780, 22802, 22844, 22888, 22907, 23021, 23057, - 23086, 23213, 23240, 23263, 23333, 23369, 23453, 23594, 24143, 24176, 24319, 24325, - 24565, 24587, 24641, 24965, 25067, 25094, 25142, 25331, 25379, 25465, 25553, 25589, - 25594, 25655, 25664, 25807, 25823, 25873, 25925, 25948, 26002, 26008, 26102, 26138, - 26141, 26377, 26468, 26498, 26510, 26512, 26578, 26579, 26588, 26594, 26597, 26608, - 26627, 26642, 26767, 26776, 26800, 26876, 26882, 26900, 26917, 26927, 26951, 26957, - 26960, 26974, 26986, 27010, 27013, 27038, 27044, 27053, 27059, 27061, 27074, 27076, - 27083, 27086, 27092, 27094, 27098, 27103, 27110, 27115, 27118, 27119, 27125, 27128, - 27130, 27133, 27134, 27140, 27143, 27145, 27146, 27148, 27149 - }; +const int dvbt2_paprtr_cc_impl::p2_papr_map_16k[144] = { + 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119, 121, + 122, 125, 128, 131, 134, 137, 140, 143, 161, 223, 230, 398, + 482, 497, 733, 809, 850, 922, 962, 1196, 1256, 1262, 1559, 1691, + 1801, 1819, 1937, 2005, 2095, 2308, 2383, 2408, 2425, 2428, 2479, 2579, + 2893, 2902, 3086, 3554, 4085, 4127, 4139, 4151, 4163, 4373, 4400, 4576, + 4609, 4952, 4961, 5444, 5756, 5800, 6094, 6208, 6658, 6673, 6799, 7208, + 7682, 8101, 8135, 8230, 8692, 8788, 8933, 9323, 9449, 9478, 9868, 10192, + 10261, 10430, 10630, 10685, 10828, 10915, 10930, 10942, 11053, 11185, 11324, 11369, + 11468, 11507, 11542, 11561, 11794, 11912, 11974, 11978, 12085, 12179, 12193, 12269, + 12311, 12758, 12767, 12866, 12938, 12962, 12971, 13099, 13102, 13105, 13120, 13150, + 13280, 13282, 13309, 13312, 13321, 13381, 13402, 13448, 13456, 13462, 13463, 13466, + 13478, 13492, 13495, 13498, 13501, 13502, 13504, 13507, 13510, 13513, 13514, 13516 +}; - const int dvbt2_paprtr_cc_impl::tr_papr_map_1k[10] = - { - 109, 117, 122, 129, 139, 321, 350, 403, 459, 465 - }; +const int dvbt2_paprtr_cc_impl::p2_papr_map_32k[288] = { + 104, 106, 107, 109, 110, 112, 113, 115, 118, 121, 124, 127, + 130, 133, 136, 139, 142, 145, 148, 151, 154, 157, 160, 163, + 166, 169, 172, 175, 178, 181, 184, 187, 190, 193, 196, 199, + 202, 205, 208, 211, 404, 452, 455, 467, 509, 539, 568, 650, + 749, 1001, 1087, 1286, 1637, 1823, 1835, 1841, 1889, 1898, 1901, 2111, + 2225, 2252, 2279, 2309, 2315, 2428, 2452, 2497, 2519, 3109, 3154, 3160, + 3170, 3193, 3214, 3298, 3331, 3346, 3388, 3397, 3404, 3416, 3466, 3491, + 3500, 3572, 4181, 4411, 4594, 4970, 5042, 5069, 5081, 5086, 5095, 5104, + 5320, 5465, 5491, 6193, 6541, 6778, 6853, 6928, 6934, 7030, 7198, 7351, + 7712, 7826, 7922, 8194, 8347, 8350, 8435, 8518, 8671, 8861, 8887, 9199, + 9980, 10031, 10240, 10519, 10537, 10573, 10589, 11078, 11278, 11324, 11489, 11642, + 12034, 12107, 12184, 12295, 12635, 12643, 12941, 12995, 13001, 13133, 13172, 13246, + 13514, 13522, 13939, 14362, 14720, 14926, 15338, 15524, 15565, 15662, 15775, 16358, + 16613, 16688, 16760, 17003, 17267, 17596, 17705, 18157, 18272, 18715, 18994, 19249, + 19348, 20221, 20855, 21400, 21412, 21418, 21430, 21478, 21559, 21983, 21986, 22331, + 22367, 22370, 22402, 22447, 22535, 22567, 22571, 22660, 22780, 22802, 22844, 22888, + 22907, 23021, 23057, 23086, 23213, 23240, 23263, 23333, 23369, 23453, 23594, 24143, + 24176, 24319, 24325, 24565, 24587, 24641, 24965, 25067, 25094, 25142, 25331, 25379, + 25465, 25553, 25589, 25594, 25655, 25664, 25807, 25823, 25873, 25925, 25948, 26002, + 26008, 26102, 26138, 26141, 26377, 26468, 26498, 26510, 26512, 26578, 26579, 26588, + 26594, 26597, 26608, 26627, 26642, 26767, 26776, 26800, 26876, 26882, 26900, 26917, + 26927, 26951, 26957, 26960, 26974, 26986, 27010, 27013, 27038, 27044, 27053, 27059, + 27061, 27074, 27076, 27083, 27086, 27092, 27094, 27098, 27103, 27110, 27115, 27118, + 27119, 27125, 27128, 27130, 27133, 27134, 27140, 27143, 27145, 27146, 27148, 27149 +}; - const int dvbt2_paprtr_cc_impl::tr_papr_map_2k[18] = - { - 250, 404, 638, 677, 700, 712, 755, 952, 1125, 1145, - 1190, 1276, 1325, 1335, 1406, 1431, 1472, 1481 - }; +const int dvbt2_paprtr_cc_impl::tr_papr_map_1k[10] = { 109, 117, 122, 129, 139, + 321, 350, 403, 459, 465 }; - const int dvbt2_paprtr_cc_impl::tr_papr_map_4k[36] = - { - 170, 219, 405, 501, 597, 654, 661, 745, 995, 1025, 1319, 1361, 1394, - 1623, 1658, 1913, 1961, 1971, 2106, 2117, 2222, 2228, 2246, 2254, 2361, - 2468, 2469, 2482, 2637, 2679, 2708, 2825, 2915, 2996, 3033, 3119 - }; +const int dvbt2_paprtr_cc_impl::tr_papr_map_2k[18] = { + 250, 404, 638, 677, 700, 712, 755, 952, 1125, + 1145, 1190, 1276, 1325, 1335, 1406, 1431, 1472, 1481 +}; - const int dvbt2_paprtr_cc_impl::tr_papr_map_8k[72] = - { - 111, 115, 123, 215, 229, 392, 613, 658, 831, 842, 997, 1503, 1626, 1916, - 1924, 1961, 2233, 2246, 2302, 2331, 2778, 2822, 2913, 2927, 2963, 2994, - 3087, 3162, 3226, 3270, 3503, 3585, 3711, 3738, 3874, 3902, 4013, 4017, - 4186, 4253, 4292, 4339, 4412, 4453, 4669, 4910, 5015, 5030, 5061, 5170, - 5263, 5313, 5360, 5384, 5394, 5493, 5550, 5847, 5901, 5999, 6020, 6165, - 6174, 6227, 6245, 6314, 6316, 6327, 6503, 6507, 6545, 6565 - }; +const int dvbt2_paprtr_cc_impl::tr_papr_map_4k[36] = { + 170, 219, 405, 501, 597, 654, 661, 745, 995, 1025, 1319, 1361, + 1394, 1623, 1658, 1913, 1961, 1971, 2106, 2117, 2222, 2228, 2246, 2254, + 2361, 2468, 2469, 2482, 2637, 2679, 2708, 2825, 2915, 2996, 3033, 3119 +}; - const int dvbt2_paprtr_cc_impl::tr_papr_map_16k[144] = - { - 109, 122, 139, 171, 213, 214, 251, 585, 763, 1012, 1021, 1077, 1148, 1472, - 1792, 1883, 1889, 1895, 1900, 2013, 2311, 2582, 2860, 2980, 3011, 3099, 3143, - 3171, 3197, 3243, 3257, 3270, 3315, 3436, 3470, 3582, 3681, 3712, 3767, 3802, - 3979, 4045, 4112, 4197, 4409, 4462, 4756, 5003, 5007, 5036, 5246, 5483, 5535, - 5584, 5787, 5789, 6047, 6349, 6392, 6498, 6526, 6542, 6591, 6680, 6688, 6785, - 6860, 7134, 7286, 7387, 7415, 7417, 7505, 7526, 7541, 7551, 7556, 7747, 7814, - 7861, 7880, 8045, 8179, 8374, 8451, 8514, 8684, 8698, 8804, 8924, 9027, 9113, - 9211, 9330, 9479, 9482, 9487, 9619, 9829, 10326, 10394, 10407, 10450, 10528, - 10671, 10746, 10774, 10799, 10801, 10912, 11113, 11128, 11205, 11379, 11459, - 11468, 11658, 11776, 11791, 11953, 11959, 12021, 12028, 12135, 12233, 12407, - 12441, 12448, 12470, 12501, 12548, 12642, 12679, 12770, 12788, 12899, 12923, - 12939, 13050, 13103, 13147, 13256, 13339, 13409 - }; +const int dvbt2_paprtr_cc_impl::tr_papr_map_8k[72] = { + 111, 115, 123, 215, 229, 392, 613, 658, 831, 842, 997, 1503, + 1626, 1916, 1924, 1961, 2233, 2246, 2302, 2331, 2778, 2822, 2913, 2927, + 2963, 2994, 3087, 3162, 3226, 3270, 3503, 3585, 3711, 3738, 3874, 3902, + 4013, 4017, 4186, 4253, 4292, 4339, 4412, 4453, 4669, 4910, 5015, 5030, + 5061, 5170, 5263, 5313, 5360, 5384, 5394, 5493, 5550, 5847, 5901, 5999, + 6020, 6165, 6174, 6227, 6245, 6314, 6316, 6327, 6503, 6507, 6545, 6565 +}; - const int dvbt2_paprtr_cc_impl::tr_papr_map_32k[288] = - { - 164, 320, 350, 521, 527, 578, 590, 619, 635, 651, 662, 664, 676, 691, 723, - 940, 1280, 1326, 1509, 1520, 1638, 1682, 1805, 1833, 1861, 1891, 1900, 1902, - 1949, 1967, 1978, 1998, 2006, 2087, 2134, 2165, 2212, 2427, 2475, 2555, 2874, - 3067, 3091, 3101, 3146, 3188, 3322, 3353, 3383, 3503, 3523, 3654, 3856, 4150, - 4158, 4159, 4174, 4206, 4318, 4417, 4629, 4631, 4875, 5104, 5106, 5111, 5131, - 5145, 5146, 5177, 5181, 5246, 5269, 5458, 5474, 5500, 5509, 5579, 5810, 5823, - 6058, 6066, 6098, 6411, 6741, 6775, 6932, 7103, 7258, 7303, 7413, 7586, 7591, - 7634, 7636, 7655, 7671, 7675, 7756, 7760, 7826, 7931, 7937, 7951, 8017, 8061, - 8071, 8117, 8317, 8321, 8353, 8806, 9010, 9237, 9427, 9453, 9469, 9525, 9558, - 9574, 9584, 9820, 9973, 10011, 10043, 10064, 10066, 10081, 10136, 10193, 10249, - 10511, 10537, 11083, 11350, 11369, 11428, 11622, 11720, 11924, 11974, 11979, 12944, - 12945, 13009, 13070, 13110, 13257, 13364, 13370, 13449, 13503, 13514, 13520, 13583, - 13593, 13708, 13925, 14192, 14228, 14235, 14279, 14284, 14370, 14393, 14407, 14422, - 14471, 14494, 14536, 14617, 14829, 14915, 15094, 15138, 15155, 15170, 15260, 15283, - 15435, 15594, 15634, 15810, 16178, 16192, 16196, 16297, 16366, 16498, 16501, 16861, - 16966, 17039, 17057, 17240, 17523, 17767, 18094, 18130, 18218, 18344, 18374, 18657, - 18679, 18746, 18772, 18779, 18786, 18874, 18884, 18955, 19143, 19497, 19534, 19679, - 19729, 19738, 19751, 19910, 19913, 20144, 20188, 20194, 20359, 20490, 20500, 20555, - 20594, 20633, 20656, 21099, 21115, 21597, 22139, 22208, 22244, 22530, 22547, 22562, - 22567, 22696, 22757, 22798, 22854, 22877, 23068, 23102, 23141, 23154, 23170, 23202, - 23368, 23864, 24057, 24215, 24219, 24257, 24271, 24325, 24447, 25137, 25590, 25702, - 25706, 25744, 25763, 25811, 25842, 25853, 25954, 26079, 26158, 26285, 26346, 26488, - 26598, 26812, 26845, 26852, 26869, 26898, 26909, 26927, 26931, 26946, 26975, 26991, - 27039 - }; +const int dvbt2_paprtr_cc_impl::tr_papr_map_16k[144] = { + 109, 122, 139, 171, 213, 214, 251, 585, 763, 1012, 1021, 1077, + 1148, 1472, 1792, 1883, 1889, 1895, 1900, 2013, 2311, 2582, 2860, 2980, + 3011, 3099, 3143, 3171, 3197, 3243, 3257, 3270, 3315, 3436, 3470, 3582, + 3681, 3712, 3767, 3802, 3979, 4045, 4112, 4197, 4409, 4462, 4756, 5003, + 5007, 5036, 5246, 5483, 5535, 5584, 5787, 5789, 6047, 6349, 6392, 6498, + 6526, 6542, 6591, 6680, 6688, 6785, 6860, 7134, 7286, 7387, 7415, 7417, + 7505, 7526, 7541, 7551, 7556, 7747, 7814, 7861, 7880, 8045, 8179, 8374, + 8451, 8514, 8684, 8698, 8804, 8924, 9027, 9113, 9211, 9330, 9479, 9482, + 9487, 9619, 9829, 10326, 10394, 10407, 10450, 10528, 10671, 10746, 10774, 10799, + 10801, 10912, 11113, 11128, 11205, 11379, 11459, 11468, 11658, 11776, 11791, 11953, + 11959, 12021, 12028, 12135, 12233, 12407, 12441, 12448, 12470, 12501, 12548, 12642, + 12679, 12770, 12788, 12899, 12923, 12939, 13050, 13103, 13147, 13256, 13339, 13409 +}; - } /* namespace dtv */ -} /* namespace gr */ +const int dvbt2_paprtr_cc_impl::tr_papr_map_32k[288] = { + 164, 320, 350, 521, 527, 578, 590, 619, 635, 651, 662, 664, + 676, 691, 723, 940, 1280, 1326, 1509, 1520, 1638, 1682, 1805, 1833, + 1861, 1891, 1900, 1902, 1949, 1967, 1978, 1998, 2006, 2087, 2134, 2165, + 2212, 2427, 2475, 2555, 2874, 3067, 3091, 3101, 3146, 3188, 3322, 3353, + 3383, 3503, 3523, 3654, 3856, 4150, 4158, 4159, 4174, 4206, 4318, 4417, + 4629, 4631, 4875, 5104, 5106, 5111, 5131, 5145, 5146, 5177, 5181, 5246, + 5269, 5458, 5474, 5500, 5509, 5579, 5810, 5823, 6058, 6066, 6098, 6411, + 6741, 6775, 6932, 7103, 7258, 7303, 7413, 7586, 7591, 7634, 7636, 7655, + 7671, 7675, 7756, 7760, 7826, 7931, 7937, 7951, 8017, 8061, 8071, 8117, + 8317, 8321, 8353, 8806, 9010, 9237, 9427, 9453, 9469, 9525, 9558, 9574, + 9584, 9820, 9973, 10011, 10043, 10064, 10066, 10081, 10136, 10193, 10249, 10511, + 10537, 11083, 11350, 11369, 11428, 11622, 11720, 11924, 11974, 11979, 12944, 12945, + 13009, 13070, 13110, 13257, 13364, 13370, 13449, 13503, 13514, 13520, 13583, 13593, + 13708, 13925, 14192, 14228, 14235, 14279, 14284, 14370, 14393, 14407, 14422, 14471, + 14494, 14536, 14617, 14829, 14915, 15094, 15138, 15155, 15170, 15260, 15283, 15435, + 15594, 15634, 15810, 16178, 16192, 16196, 16297, 16366, 16498, 16501, 16861, 16966, + 17039, 17057, 17240, 17523, 17767, 18094, 18130, 18218, 18344, 18374, 18657, 18679, + 18746, 18772, 18779, 18786, 18874, 18884, 18955, 19143, 19497, 19534, 19679, 19729, + 19738, 19751, 19910, 19913, 20144, 20188, 20194, 20359, 20490, 20500, 20555, 20594, + 20633, 20656, 21099, 21115, 21597, 22139, 22208, 22244, 22530, 22547, 22562, 22567, + 22696, 22757, 22798, 22854, 22877, 23068, 23102, 23141, 23154, 23170, 23202, 23368, + 23864, 24057, 24215, 24219, 24257, 24271, 24325, 24447, 25137, 25590, 25702, 25706, + 25744, 25763, 25811, 25842, 25853, 25954, 26079, 26158, 26285, 26346, 26488, 26598, + 26812, 26845, 26852, 26869, 26898, 26909, 26927, 26931, 26946, 26975, 26991, 27039 +}; +} /* namespace dtv */ +} /* namespace gr */ diff --git a/gr-dtv/lib/dvbt2/dvbt2_paprtr_cc_impl.h b/gr-dtv/lib/dvbt2/dvbt2_paprtr_cc_impl.h index 886afd2e38..da5fdfc86a 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_paprtr_cc_impl.h +++ b/gr-dtv/lib/dvbt2/dvbt2_paprtr_cc_impl.h @@ -31,82 +31,91 @@ #define MAX_PAPRTONES 288 enum dvbt2_carrier_type_t { - DATA_CARRIER = 1, - P2PILOT_CARRIER, - P2PAPR_CARRIER, - TRPAPR_CARRIER, - SCATTERED_CARRIER, - CONTINUAL_CARRIER + DATA_CARRIER = 1, + P2PILOT_CARRIER, + P2PAPR_CARRIER, + TRPAPR_CARRIER, + SCATTERED_CARRIER, + CONTINUAL_CARRIER }; namespace gr { - namespace dtv { +namespace dtv { - class dvbt2_paprtr_cc_impl : public dvbt2_paprtr_cc - { - private: - int num_symbols; - int fft_size; - int left_nulls; - int right_nulls; - int pilot_pattern; - int carrier_mode; - int papr_mode; - int version_num; - double v_clip; - int num_iterations; - const int *papr_map; - const int *p2_papr_map; - const int *tr_papr_map; - int p2_carrier_map[MAX_CARRIERS]; - int data_carrier_map[MAX_CARRIERS]; - int fc_carrier_map[MAX_CARRIERS]; - gr_complex *ones_freq; - gr_complex *ones_time; - gr_complex *c; - gr_complex *ctemp; - float *magnitude; - gr_complex *r; - gr_complex *rNew; - gr_complex *v; - float alphaLimit[MAX_PAPRTONES]; - float alphaLimitMax[MAX_PAPRTONES]; - int N_P2; - int N_FC; - int K_EXT; - int C_PS; - int N_TR; - int dx; - int dy; - int shift; - void init_pilots(int); +class dvbt2_paprtr_cc_impl : public dvbt2_paprtr_cc +{ +private: + int num_symbols; + int fft_size; + int left_nulls; + int right_nulls; + int pilot_pattern; + int carrier_mode; + int papr_mode; + int version_num; + double v_clip; + int num_iterations; + const int* papr_map; + const int* p2_papr_map; + const int* tr_papr_map; + int p2_carrier_map[MAX_CARRIERS]; + int data_carrier_map[MAX_CARRIERS]; + int fc_carrier_map[MAX_CARRIERS]; + gr_complex* ones_freq; + gr_complex* ones_time; + gr_complex* c; + gr_complex* ctemp; + float* magnitude; + gr_complex* r; + gr_complex* rNew; + gr_complex* v; + float alphaLimit[MAX_PAPRTONES]; + float alphaLimitMax[MAX_PAPRTONES]; + int N_P2; + int N_FC; + int K_EXT; + int C_PS; + int N_TR; + int dx; + int dy; + int shift; + void init_pilots(int); - fft::fft_complex *papr_fft; - int papr_fft_size; + fft::fft_complex* papr_fft; + int papr_fft_size; - const static int p2_papr_map_1k[10]; - const static int p2_papr_map_2k[18]; - const static int p2_papr_map_4k[36]; - const static int p2_papr_map_8k[72]; - const static int p2_papr_map_16k[144]; - const static int p2_papr_map_32k[288]; - const static int tr_papr_map_1k[10]; - const static int tr_papr_map_2k[18]; - const static int tr_papr_map_4k[36]; - const static int tr_papr_map_8k[72]; - const static int tr_papr_map_16k[144]; - const static int tr_papr_map_32k[288]; + const static int p2_papr_map_1k[10]; + const static int p2_papr_map_2k[18]; + const static int p2_papr_map_4k[36]; + const static int p2_papr_map_8k[72]; + const static int p2_papr_map_16k[144]; + const static int p2_papr_map_32k[288]; + const static int tr_papr_map_1k[10]; + const static int tr_papr_map_2k[18]; + const static int tr_papr_map_4k[36]; + const static int tr_papr_map_8k[72]; + const static int tr_papr_map_16k[144]; + const static int tr_papr_map_32k[288]; - public: - dvbt2_paprtr_cc_impl(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, float vclip, int iterations, unsigned int vlength); - ~dvbt2_paprtr_cc_impl(); +public: + dvbt2_paprtr_cc_impl(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + float vclip, + int iterations, + unsigned int vlength); + ~dvbt2_paprtr_cc_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_PAPRTR_CC_IMPL_H */ diff --git a/gr-dtv/lib/dvbt2/dvbt2_pilotgenerator_cc_impl.cc b/gr-dtv/lib/dvbt2/dvbt2_pilotgenerator_cc_impl.cc index d653eae1dc..b7bf097f17 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_pilotgenerator_cc_impl.cc +++ b/gr-dtv/lib/dvbt2/dvbt2_pilotgenerator_cc_impl.cc @@ -1,17 +1,17 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015,2016,2018 Free Software Foundation, Inc. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -28,3294 +28,3110 @@ #include <volk/volk.h> namespace gr { - namespace dtv { - - dvbt2_pilotgenerator_cc::sptr - dvbt2_pilotgenerator_cc::make(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, dvbt2_preamble_t preamble, dvbt2_misogroup_t misogroup, dvbt2_equalization_t equalization, dvbt2_bandwidth_t bandwidth, unsigned int vlength) - { - return gnuradio::get_initial_sptr - (new dvbt2_pilotgenerator_cc_impl(carriermode, fftsize, pilotpattern, guardinterval, numdatasyms, paprmode, version, preamble, misogroup, equalization, bandwidth, vlength)); - } - - /* - * The private constructor - */ - dvbt2_pilotgenerator_cc_impl::dvbt2_pilotgenerator_cc_impl(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, dvbt2_preamble_t preamble, dvbt2_misogroup_t misogroup, dvbt2_equalization_t equalization, dvbt2_bandwidth_t bandwidth, unsigned int vlength) - : gr::block("dvbt2_pilotgenerator_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex) * vlength)) - { - int step, ki; - double x, sinc, sincrms = 0.0; - double fs, fstep, f = 0.0; - miso_group = misogroup; - if ((preamble == PREAMBLE_T2_SISO) || (preamble == PREAMBLE_T2_LITE_SISO)) { +namespace dtv { + +dvbt2_pilotgenerator_cc::sptr +dvbt2_pilotgenerator_cc::make(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + dvbt2_preamble_t preamble, + dvbt2_misogroup_t misogroup, + dvbt2_equalization_t equalization, + dvbt2_bandwidth_t bandwidth, + unsigned int vlength) +{ + return gnuradio::get_initial_sptr(new dvbt2_pilotgenerator_cc_impl(carriermode, + fftsize, + pilotpattern, + guardinterval, + numdatasyms, + paprmode, + version, + preamble, + misogroup, + equalization, + bandwidth, + vlength)); +} + +/* + * The private constructor + */ +dvbt2_pilotgenerator_cc_impl::dvbt2_pilotgenerator_cc_impl( + dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + dvbt2_preamble_t preamble, + dvbt2_misogroup_t misogroup, + dvbt2_equalization_t equalization, + dvbt2_bandwidth_t bandwidth, + unsigned int vlength) + : gr::block("dvbt2_pilotgenerator_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex) * vlength)) +{ + int step, ki; + double x, sinc, sincrms = 0.0; + double fs, fstep, f = 0.0; + miso_group = misogroup; + if ((preamble == PREAMBLE_T2_SISO) || (preamble == PREAMBLE_T2_LITE_SISO)) { miso = FALSE; switch (fftsize) { - case FFTSIZE_1K: + case FFTSIZE_1K: N_P2 = 16; C_P2 = 558; break; - case FFTSIZE_2K: + case FFTSIZE_2K: N_P2 = 8; C_P2 = 1118; break; - case FFTSIZE_4K: + case FFTSIZE_4K: N_P2 = 4; C_P2 = 2236; break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: N_P2 = 2; C_P2 = 4472; break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: N_P2 = 1; C_P2 = 8944; break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: N_P2 = 1; C_P2 = 22432; break; } - } - else { + } else { miso = TRUE; switch (fftsize) { - case FFTSIZE_1K: + case FFTSIZE_1K: N_P2 = 16; C_P2 = 546; break; - case FFTSIZE_2K: + case FFTSIZE_2K: N_P2 = 8; C_P2 = 1098; break; - case FFTSIZE_4K: + case FFTSIZE_4K: N_P2 = 4; C_P2 = 2198; break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: N_P2 = 2; C_P2 = 4398; break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: N_P2 = 1; C_P2 = 8814; break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: N_P2 = 1; C_P2 = 17612; break; } - } - switch (fftsize) { - case FFTSIZE_1K: - C_PS = 853; - K_EXT = 0; - K_OFFSET = 0; - break; - case FFTSIZE_2K: - C_PS = 1705; - K_EXT = 0; - K_OFFSET = 0; - break; - case FFTSIZE_4K: - C_PS = 3409; - K_EXT = 0; - K_OFFSET = 0; - break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + switch (fftsize) { + case FFTSIZE_1K: + C_PS = 853; + K_EXT = 0; + K_OFFSET = 0; + break; + case FFTSIZE_2K: + C_PS = 1705; + K_EXT = 0; + K_OFFSET = 0; + break; + case FFTSIZE_4K: + C_PS = 3409; + K_EXT = 0; + K_OFFSET = 0; + break; + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: + if (carriermode == CARRIERS_NORMAL) { C_PS = 6817; K_EXT = 0; K_OFFSET = 48; - } - else { + } else { C_PS = 6913; K_EXT = 48; K_OFFSET = 0; - } - break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: + if (carriermode == CARRIERS_NORMAL) { C_PS = 13633; K_EXT = 0; K_OFFSET = 144; - } - else { + } else { C_PS = 13921; K_EXT = 144; K_OFFSET = 0; - } - break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: + if (carriermode == CARRIERS_NORMAL) { C_PS = 27265; K_EXT = 0; K_OFFSET = 288; - } - else { + } else { C_PS = 27841; K_EXT = 288; K_OFFSET = 0; - } - break; - } - switch (fftsize) { - case FFTSIZE_1K: - switch (pilotpattern) { - case PILOT_PP1: - C_DATA = 764; - N_FC = 568; - C_FC = 402; - break; - case PILOT_PP2: - C_DATA = 768; - N_FC = 710; - C_FC = 654; - break; - case PILOT_PP3: - C_DATA = 798; - N_FC = 710; - C_FC = 490; - break; - case PILOT_PP4: - C_DATA = 804; - N_FC = 780; - C_FC = 707; - break; - case PILOT_PP5: - C_DATA = 818; - N_FC = 780; - C_FC = 544; - break; - case PILOT_PP6: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP7: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP8: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + break; + } + switch (fftsize) { + case FFTSIZE_1K: + switch (pilotpattern) { + case PILOT_PP1: + C_DATA = 764; + N_FC = 568; + C_FC = 402; + break; + case PILOT_PP2: + C_DATA = 768; + N_FC = 710; + C_FC = 654; + break; + case PILOT_PP3: + C_DATA = 798; + N_FC = 710; + C_FC = 490; + break; + case PILOT_PP4: + C_DATA = 804; + N_FC = 780; + C_FC = 707; + break; + case PILOT_PP5: + C_DATA = 818; + N_FC = 780; + C_FC = 544; + break; + case PILOT_PP6: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP7: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP8: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 10; + C_DATA -= 10; } if (N_FC != 0) { - N_FC -= 10; + N_FC -= 10; } if (C_FC != 0) { - C_FC -= 10; + C_FC -= 10; } - } - break; - case FFTSIZE_2K: - switch (pilotpattern) { - case PILOT_PP1: - C_DATA = 1522; - N_FC = 1136; - C_FC = 804; - break; - case PILOT_PP2: - C_DATA = 1532; - N_FC = 1420; - C_FC = 1309; - break; - case PILOT_PP3: - C_DATA = 1596; - N_FC = 1420; - C_FC = 980; - break; - case PILOT_PP4: - C_DATA = 1602; - N_FC = 1562; - C_FC = 1415; - break; - case PILOT_PP5: - C_DATA = 1632; - N_FC = 1562; - C_FC = 1088; - break; - case PILOT_PP6: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP7: - C_DATA = 1646; - N_FC = 1632; - C_FC = 1396; - break; - case PILOT_PP8: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + break; + case FFTSIZE_2K: + switch (pilotpattern) { + case PILOT_PP1: + C_DATA = 1522; + N_FC = 1136; + C_FC = 804; + break; + case PILOT_PP2: + C_DATA = 1532; + N_FC = 1420; + C_FC = 1309; + break; + case PILOT_PP3: + C_DATA = 1596; + N_FC = 1420; + C_FC = 980; + break; + case PILOT_PP4: + C_DATA = 1602; + N_FC = 1562; + C_FC = 1415; + break; + case PILOT_PP5: + C_DATA = 1632; + N_FC = 1562; + C_FC = 1088; + break; + case PILOT_PP6: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP7: + C_DATA = 1646; + N_FC = 1632; + C_FC = 1396; + break; + case PILOT_PP8: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 18; + C_DATA -= 18; } if (N_FC != 0) { - N_FC -= 18; + N_FC -= 18; } if (C_FC != 0) { - C_FC -= 18; + C_FC -= 18; } - } - break; - case FFTSIZE_4K: - switch (pilotpattern) { - case PILOT_PP1: - C_DATA = 3084; - N_FC = 2272; - C_FC = 1609; - break; - case PILOT_PP2: - C_DATA = 3092; - N_FC = 2840; - C_FC = 2619; - break; - case PILOT_PP3: - C_DATA = 3228; - N_FC = 2840; - C_FC = 1961; - break; - case PILOT_PP4: - C_DATA = 3234; - N_FC = 3124; - C_FC = 2831; - break; - case PILOT_PP5: - C_DATA = 3298; - N_FC = 3124; - C_FC = 2177; - break; - case PILOT_PP6: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - case PILOT_PP7: - C_DATA = 3328; - N_FC = 3266; - C_FC = 2792; - break; - case PILOT_PP8: - C_DATA = 0; - N_FC = 0; - C_FC = 0; - break; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + break; + case FFTSIZE_4K: + switch (pilotpattern) { + case PILOT_PP1: + C_DATA = 3084; + N_FC = 2272; + C_FC = 1609; + break; + case PILOT_PP2: + C_DATA = 3092; + N_FC = 2840; + C_FC = 2619; + break; + case PILOT_PP3: + C_DATA = 3228; + N_FC = 2840; + C_FC = 1961; + break; + case PILOT_PP4: + C_DATA = 3234; + N_FC = 3124; + C_FC = 2831; + break; + case PILOT_PP5: + C_DATA = 3298; + N_FC = 3124; + C_FC = 2177; + break; + case PILOT_PP6: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + case PILOT_PP7: + C_DATA = 3328; + N_FC = 3266; + C_FC = 2792; + break; + case PILOT_PP8: + C_DATA = 0; + N_FC = 0; + C_FC = 0; + break; + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 36; + C_DATA -= 36; } if (N_FC != 0) { - N_FC -= 36; + N_FC -= 36; } if (C_FC != 0) { - C_FC -= 36; + C_FC -= 36; } - } - break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 6208; N_FC = 4544; C_FC = 3218; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 6214; N_FC = 5680; C_FC = 5238; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 6494; N_FC = 5680; C_FC = 3922; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 6498; N_FC = 6248; C_FC = 5662; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 6634; N_FC = 6248; C_FC = 4354; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 6698; N_FC = 6532; C_FC = 5585; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 6698; N_FC = 0; C_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 6296; N_FC = 4608; C_FC = 3264; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 6298; N_FC = 5760; C_FC = 5312; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 6584; N_FC = 5760; C_FC = 3978; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 6588; N_FC = 6336; C_FC = 5742; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 6728; N_FC = 6336; C_FC = 4416; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 6788; N_FC = 6624; C_FC = 5664; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 6788; N_FC = 0; C_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 72; + C_DATA -= 72; } if (N_FC != 0) { - N_FC -= 72; + N_FC -= 72; } if (C_FC != 0) { - C_FC -= 72; + C_FC -= 72; } - } - break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 12418; N_FC = 9088; C_FC = 6437; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 12436; N_FC = 11360; C_FC = 10476; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 12988; N_FC = 11360; C_FC = 7845; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 13002; N_FC = 12496; C_FC = 11324; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 13272; N_FC = 12496; C_FC = 8709; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 13288; N_FC = 13064; C_FC = 11801; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 13416; N_FC = 13064; C_FC = 11170; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 13406; N_FC = 0; C_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 12678; N_FC = 9280; C_FC = 6573; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 12698; N_FC = 11600; C_FC = 10697; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 13262; N_FC = 11600; C_FC = 8011; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 13276; N_FC = 12760; C_FC = 11563; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 13552; N_FC = 12760; C_FC = 8893; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 13568; N_FC = 13340; C_FC = 12051; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 13698; N_FC = 13340; C_FC = 11406; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 13688; N_FC = 0; C_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 144; + C_DATA -= 144; } if (N_FC != 0) { - N_FC -= 144; + N_FC -= 144; } if (C_FC != 0) { - C_FC -= 144; + C_FC -= 144; } - } - break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: - if (carriermode == CARRIERS_NORMAL) { + } + break; + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: + if (carriermode == CARRIERS_NORMAL) { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 24886; N_FC = 22720; C_FC = 20952; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 26022; N_FC = 24992; C_FC = 22649; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 26592; N_FC = 26128; C_FC = 23603; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 26836; N_FC = 0; C_FC = 0; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 26812; N_FC = 0; C_FC = 0; break; } - } - else { + } else { switch (pilotpattern) { - case PILOT_PP1: + case PILOT_PP1: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP2: + case PILOT_PP2: C_DATA = 25412; N_FC = 23200; C_FC = 21395; break; - case PILOT_PP3: + case PILOT_PP3: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP4: + case PILOT_PP4: C_DATA = 26572; N_FC = 25520; C_FC = 23127; break; - case PILOT_PP5: + case PILOT_PP5: C_DATA = 0; N_FC = 0; C_FC = 0; break; - case PILOT_PP6: + case PILOT_PP6: C_DATA = 27152; N_FC = 26680; C_FC = 24102; break; - case PILOT_PP7: + case PILOT_PP7: C_DATA = 27404; N_FC = 0; C_FC = 0; break; - case PILOT_PP8: + case PILOT_PP8: C_DATA = 27376; N_FC = 0; C_FC = 0; break; } - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { if (C_DATA != 0) { - C_DATA -= 288; + C_DATA -= 288; } if (N_FC != 0) { - N_FC -= 288; + N_FC -= 288; } if (C_FC != 0) { - C_FC -= 288; + C_FC -= 288; } - } - break; - } - if (miso == FALSE) { + } + break; + } + if (miso == FALSE) { if (guardinterval == GI_1_128 && pilotpattern == PILOT_PP7) { - N_FC = 0; - C_FC = 0; + N_FC = 0; + C_FC = 0; } if (guardinterval == GI_1_32 && pilotpattern == PILOT_PP4) { - N_FC = 0; - C_FC = 0; + N_FC = 0; + C_FC = 0; } if (guardinterval == GI_1_16 && pilotpattern == PILOT_PP2) { - N_FC = 0; - C_FC = 0; + N_FC = 0; + C_FC = 0; } if (guardinterval == GI_19_256 && pilotpattern == PILOT_PP2) { - N_FC = 0; - C_FC = 0; + N_FC = 0; + C_FC = 0; } - } - init_prbs(); - for (int i = 0; i < C_PS; i++) { + } + init_prbs(); + for (int i = 0; i < C_PS; i++) { p2_carrier_map[i] = DATA_CARRIER; - } - if ((fftsize == FFTSIZE_32K || fftsize == FFTSIZE_32K_T2GI) && (miso == FALSE)) { + } + if ((fftsize == FFTSIZE_32K || fftsize == FFTSIZE_32K_T2GI) && (miso == FALSE)) { step = 6; - } - else { + } else { step = 3; - } - for (int i = 0; i < C_PS; i += step) { + } + for (int i = 0; i < C_PS; i += step) { if (miso == TRUE && miso_group == MISO_TX2) { - if (((i / 3) % 2) && (i % 3 == 0)) { - p2_carrier_map[i] = P2PILOT_CARRIER_INVERTED; - } - else { + if (((i / 3) % 2) && (i % 3 == 0)) { + p2_carrier_map[i] = P2PILOT_CARRIER_INVERTED; + } else { + p2_carrier_map[i] = P2PILOT_CARRIER; + } + } else { p2_carrier_map[i] = P2PILOT_CARRIER; - } } - else { - p2_carrier_map[i] = P2PILOT_CARRIER; - } - } - if (carriermode == CARRIERS_EXTENDED) { + } + if (carriermode == CARRIERS_EXTENDED) { for (int i = 0; i < K_EXT; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((i / 3) % 2) && (i % 3 == 0)) { - p2_carrier_map[i] = P2PILOT_CARRIER_INVERTED; + if (miso == TRUE && miso_group == MISO_TX2) { + if (((i / 3) % 2) && (i % 3 == 0)) { + p2_carrier_map[i] = P2PILOT_CARRIER_INVERTED; + } else { + p2_carrier_map[i] = P2PILOT_CARRIER; + } + if ((((i + (C_PS - K_EXT)) / 3) % 2) && ((i + (C_PS - K_EXT)) % 3 == 0)) { + p2_carrier_map[i + (C_PS - K_EXT)] = P2PILOT_CARRIER_INVERTED; + } else { + p2_carrier_map[i + (C_PS - K_EXT)] = P2PILOT_CARRIER; + } + } else { + p2_carrier_map[i] = P2PILOT_CARRIER; + p2_carrier_map[i + (C_PS - K_EXT)] = P2PILOT_CARRIER; } - else { - p2_carrier_map[i] = P2PILOT_CARRIER; - } - if ((((i + (C_PS - K_EXT)) / 3) % 2) && ((i + (C_PS - K_EXT)) % 3 == 0)) { - p2_carrier_map[i + (C_PS - K_EXT)] = P2PILOT_CARRIER_INVERTED; - } - else { - p2_carrier_map[i + (C_PS - K_EXT)] = P2PILOT_CARRIER; - } - } - else { - p2_carrier_map[i] = P2PILOT_CARRIER; - p2_carrier_map[i + (C_PS - K_EXT)] = P2PILOT_CARRIER; - } } - } - if (miso == TRUE) { + } + if (miso == TRUE) { p2_carrier_map[K_EXT + 1] = P2PILOT_CARRIER; p2_carrier_map[K_EXT + 2] = P2PILOT_CARRIER; p2_carrier_map[C_PS - K_EXT - 2] = P2PILOT_CARRIER; p2_carrier_map[C_PS - K_EXT - 3] = P2PILOT_CARRIER; - } - switch (fftsize) { - case FFTSIZE_1K: - for (int i = 0; i < 10; i++) { + } + switch (fftsize) { + case FFTSIZE_1K: + for (int i = 0; i < 10; i++) { p2_carrier_map[p2_papr_map_1k[i]] = P2PAPR_CARRIER; - } - if (miso == TRUE) { + } + if (miso == TRUE) { for (int i = 0; i < 10; i++) { - ki = p2_papr_map_1k[i] + K_EXT; - if (i < 9) { - if (((ki % 3) == 1) && ((ki + 1) != (p2_papr_map_1k[i + 1] + K_EXT))) { - p2_carrier_map[ki + 1] = P2PILOT_CARRIER; - } - } - else { - if ((ki % 3) == 1) { - p2_carrier_map[ki + 1] = P2PILOT_CARRIER; - } - } - if (i > 0) { - if (((ki % 3) == 2) && ((ki - 1) != (p2_papr_map_1k[i - 1] + K_EXT))) { - p2_carrier_map[ki - 1] = P2PILOT_CARRIER; - } - } - else { - if ((ki % 3) == 2) { - p2_carrier_map[ki - 1] = P2PILOT_CARRIER; - } - } + ki = p2_papr_map_1k[i] + K_EXT; + if (i < 9) { + if (((ki % 3) == 1) && + ((ki + 1) != (p2_papr_map_1k[i + 1] + K_EXT))) { + p2_carrier_map[ki + 1] = P2PILOT_CARRIER; + } + } else { + if ((ki % 3) == 1) { + p2_carrier_map[ki + 1] = P2PILOT_CARRIER; + } + } + if (i > 0) { + if (((ki % 3) == 2) && + ((ki - 1) != (p2_papr_map_1k[i - 1] + K_EXT))) { + p2_carrier_map[ki - 1] = P2PILOT_CARRIER; + } + } else { + if ((ki % 3) == 2) { + p2_carrier_map[ki - 1] = P2PILOT_CARRIER; + } + } } - } - cp_bpsk[0] = gr_complex(4.0 / 3.0, 0.0); - cp_bpsk[1] = gr_complex(-4.0 / 3.0, 0.0); - cp_bpsk_inverted[0] = gr_complex(-4.0 / 3.0, 0.0); - cp_bpsk_inverted[1] = gr_complex(4.0 / 3.0, 0.0); - break; - case FFTSIZE_2K: - for (int i = 0; i < 18; i++) { + } + cp_bpsk[0] = gr_complex(4.0 / 3.0, 0.0); + cp_bpsk[1] = gr_complex(-4.0 / 3.0, 0.0); + cp_bpsk_inverted[0] = gr_complex(-4.0 / 3.0, 0.0); + cp_bpsk_inverted[1] = gr_complex(4.0 / 3.0, 0.0); + break; + case FFTSIZE_2K: + for (int i = 0; i < 18; i++) { p2_carrier_map[p2_papr_map_2k[i]] = P2PAPR_CARRIER; - } - if (miso == TRUE) { + } + if (miso == TRUE) { for (int i = 0; i < 18; i++) { - ki = p2_papr_map_2k[i] + K_EXT; - if (i < 17) { - if (((ki % 3) == 1) && ((ki + 1) != (p2_papr_map_2k[i + 1] + K_EXT))) { - p2_carrier_map[ki + 1] = P2PILOT_CARRIER; - } - } - else { - if ((ki % 3) == 1) { - p2_carrier_map[ki + 1] = P2PILOT_CARRIER; - } - } - if (i > 0) { - if (((ki % 3) == 2) && ((ki - 1) != (p2_papr_map_2k[i - 1] + K_EXT))) { - p2_carrier_map[ki - 1] = P2PILOT_CARRIER; - } - } - else { - if ((ki % 3) == 2) { - p2_carrier_map[ki - 1] = P2PILOT_CARRIER; - } - } + ki = p2_papr_map_2k[i] + K_EXT; + if (i < 17) { + if (((ki % 3) == 1) && + ((ki + 1) != (p2_papr_map_2k[i + 1] + K_EXT))) { + p2_carrier_map[ki + 1] = P2PILOT_CARRIER; + } + } else { + if ((ki % 3) == 1) { + p2_carrier_map[ki + 1] = P2PILOT_CARRIER; + } + } + if (i > 0) { + if (((ki % 3) == 2) && + ((ki - 1) != (p2_papr_map_2k[i - 1] + K_EXT))) { + p2_carrier_map[ki - 1] = P2PILOT_CARRIER; + } + } else { + if ((ki % 3) == 2) { + p2_carrier_map[ki - 1] = P2PILOT_CARRIER; + } + } } - } - cp_bpsk[0] = gr_complex(4.0 / 3.0, 0.0); - cp_bpsk[1] = gr_complex(-4.0 / 3.0, 0.0); - cp_bpsk_inverted[0] = gr_complex(-4.0 / 3.0, 0.0); - cp_bpsk_inverted[1] = gr_complex(4.0 / 3.0, 0.0); - break; - case FFTSIZE_4K: - for (int i = 0; i < 36; i++) { + } + cp_bpsk[0] = gr_complex(4.0 / 3.0, 0.0); + cp_bpsk[1] = gr_complex(-4.0 / 3.0, 0.0); + cp_bpsk_inverted[0] = gr_complex(-4.0 / 3.0, 0.0); + cp_bpsk_inverted[1] = gr_complex(4.0 / 3.0, 0.0); + break; + case FFTSIZE_4K: + for (int i = 0; i < 36; i++) { p2_carrier_map[p2_papr_map_4k[i]] = P2PAPR_CARRIER; - } - if (miso == TRUE) { + } + if (miso == TRUE) { for (int i = 0; i < 36; i++) { - ki = p2_papr_map_4k[i] + K_EXT; - if (i < 35) { - if (((ki % 3) == 1) && ((ki + 1) != (p2_papr_map_4k[i + 1] + K_EXT))) { - p2_carrier_map[ki + 1] = P2PILOT_CARRIER; - } - } - else { - if ((ki % 3) == 1) { - p2_carrier_map[ki + 1] = P2PILOT_CARRIER; - } - } - if (i > 0) { - if (((ki % 3) == 2) && ((ki - 1) != (p2_papr_map_4k[i - 1] + K_EXT))) { - p2_carrier_map[ki - 1] = P2PILOT_CARRIER; - } - } - else { - if ((ki % 3) == 2) { - p2_carrier_map[ki - 1] = P2PILOT_CARRIER; - } - } + ki = p2_papr_map_4k[i] + K_EXT; + if (i < 35) { + if (((ki % 3) == 1) && + ((ki + 1) != (p2_papr_map_4k[i + 1] + K_EXT))) { + p2_carrier_map[ki + 1] = P2PILOT_CARRIER; + } + } else { + if ((ki % 3) == 1) { + p2_carrier_map[ki + 1] = P2PILOT_CARRIER; + } + } + if (i > 0) { + if (((ki % 3) == 2) && + ((ki - 1) != (p2_papr_map_4k[i - 1] + K_EXT))) { + p2_carrier_map[ki - 1] = P2PILOT_CARRIER; + } + } else { + if ((ki % 3) == 2) { + p2_carrier_map[ki - 1] = P2PILOT_CARRIER; + } + } } - } - cp_bpsk[0] = gr_complex((4.0 * std::sqrt(2.0)) / 3.0, 0.0); - cp_bpsk[1] = gr_complex(-(4.0 * std::sqrt(2.0)) / 3.0, 0.0); - cp_bpsk_inverted[0] = gr_complex(-(4.0 * std::sqrt(2.0)) / 3.0, 0.0); - cp_bpsk_inverted[1] = gr_complex((4.0 * std::sqrt(2.0)) / 3.0, 0.0); - break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: - for (int i = 0; i < 72; i++) { + } + cp_bpsk[0] = gr_complex((4.0 * std::sqrt(2.0)) / 3.0, 0.0); + cp_bpsk[1] = gr_complex(-(4.0 * std::sqrt(2.0)) / 3.0, 0.0); + cp_bpsk_inverted[0] = gr_complex(-(4.0 * std::sqrt(2.0)) / 3.0, 0.0); + cp_bpsk_inverted[1] = gr_complex((4.0 * std::sqrt(2.0)) / 3.0, 0.0); + break; + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: + for (int i = 0; i < 72; i++) { p2_carrier_map[p2_papr_map_8k[i] + K_EXT] = P2PAPR_CARRIER; - } - if (miso == TRUE) { + } + if (miso == TRUE) { for (int i = 0; i < 72; i++) { - ki = p2_papr_map_8k[i] + K_EXT; - if (i < 71) { - if (((ki % 3) == 1) && ((ki + 1) != (p2_papr_map_8k[i + 1] + K_EXT))) { - p2_carrier_map[ki + 1] = P2PILOT_CARRIER; - } - } - else { - if ((ki % 3) == 1) { - p2_carrier_map[ki + 1] = P2PILOT_CARRIER; - } - } - if (i > 0) { - if (((ki % 3) == 2) && ((ki - 1) != (p2_papr_map_8k[i - 1] + K_EXT))) { - p2_carrier_map[ki - 1] = P2PILOT_CARRIER; - } - } - else { - if ((ki % 3) == 2) { - p2_carrier_map[ki - 1] = P2PILOT_CARRIER; - } - } + ki = p2_papr_map_8k[i] + K_EXT; + if (i < 71) { + if (((ki % 3) == 1) && + ((ki + 1) != (p2_papr_map_8k[i + 1] + K_EXT))) { + p2_carrier_map[ki + 1] = P2PILOT_CARRIER; + } + } else { + if ((ki % 3) == 1) { + p2_carrier_map[ki + 1] = P2PILOT_CARRIER; + } + } + if (i > 0) { + if (((ki % 3) == 2) && + ((ki - 1) != (p2_papr_map_8k[i - 1] + K_EXT))) { + p2_carrier_map[ki - 1] = P2PILOT_CARRIER; + } + } else { + if ((ki % 3) == 2) { + p2_carrier_map[ki - 1] = P2PILOT_CARRIER; + } + } } - } - cp_bpsk[0] = gr_complex(8.0 / 3.0, 0.0); - cp_bpsk[1] = gr_complex(-8.0 / 3.0, 0.0); - cp_bpsk_inverted[0] = gr_complex(-8.0 / 3.0, 0.0); - cp_bpsk_inverted[1] = gr_complex(8.0 / 3.0, 0.0); - break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: - for (int i = 0; i < 144; i++) { + } + cp_bpsk[0] = gr_complex(8.0 / 3.0, 0.0); + cp_bpsk[1] = gr_complex(-8.0 / 3.0, 0.0); + cp_bpsk_inverted[0] = gr_complex(-8.0 / 3.0, 0.0); + cp_bpsk_inverted[1] = gr_complex(8.0 / 3.0, 0.0); + break; + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: + for (int i = 0; i < 144; i++) { p2_carrier_map[p2_papr_map_16k[i] + K_EXT] = P2PAPR_CARRIER; - } - if (miso == TRUE) { + } + if (miso == TRUE) { for (int i = 0; i < 144; i++) { - ki = p2_papr_map_16k[i] + K_EXT; - if (i < 143) { - if (((ki % 3) == 1) && ((ki + 1) != (p2_papr_map_16k[i + 1] + K_EXT))) { - p2_carrier_map[ki + 1] = P2PILOT_CARRIER; - } - } - else { - if ((ki % 3) == 1) { - p2_carrier_map[ki + 1] = P2PILOT_CARRIER; - } - } - if (i > 0) { - if (((ki % 3) == 2) && ((ki - 1) != (p2_papr_map_16k[i - 1] + K_EXT))) { - p2_carrier_map[ki - 1] = P2PILOT_CARRIER; - } - } - else { - if ((ki % 3) == 2) { - p2_carrier_map[ki - 1] = P2PILOT_CARRIER; - } - } + ki = p2_papr_map_16k[i] + K_EXT; + if (i < 143) { + if (((ki % 3) == 1) && + ((ki + 1) != (p2_papr_map_16k[i + 1] + K_EXT))) { + p2_carrier_map[ki + 1] = P2PILOT_CARRIER; + } + } else { + if ((ki % 3) == 1) { + p2_carrier_map[ki + 1] = P2PILOT_CARRIER; + } + } + if (i > 0) { + if (((ki % 3) == 2) && + ((ki - 1) != (p2_papr_map_16k[i - 1] + K_EXT))) { + p2_carrier_map[ki - 1] = P2PILOT_CARRIER; + } + } else { + if ((ki % 3) == 2) { + p2_carrier_map[ki - 1] = P2PILOT_CARRIER; + } + } } - } - cp_bpsk[0] = gr_complex(8.0 / 3.0, 0.0); - cp_bpsk[1] = gr_complex(-8.0 / 3.0, 0.0); - cp_bpsk_inverted[0] = gr_complex(-8.0 / 3.0, 0.0); - cp_bpsk_inverted[1] = gr_complex(8.0 / 3.0, 0.0); - break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: - for (int i = 0; i < 288; i++) { + } + cp_bpsk[0] = gr_complex(8.0 / 3.0, 0.0); + cp_bpsk[1] = gr_complex(-8.0 / 3.0, 0.0); + cp_bpsk_inverted[0] = gr_complex(-8.0 / 3.0, 0.0); + cp_bpsk_inverted[1] = gr_complex(8.0 / 3.0, 0.0); + break; + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: + for (int i = 0; i < 288; i++) { p2_carrier_map[p2_papr_map_32k[i] + K_EXT] = P2PAPR_CARRIER; - } - if (miso == TRUE) { + } + if (miso == TRUE) { for (int i = 0; i < 288; i++) { - ki = p2_papr_map_32k[i] + K_EXT; - if (i < 287) { - if (((ki % 3) == 1) && ((ki + 1) != (p2_papr_map_32k[i + 1] + K_EXT))) { - p2_carrier_map[ki + 1] = P2PILOT_CARRIER; - } - } - else { - if ((ki % 3) == 1) { - p2_carrier_map[ki + 1] = P2PILOT_CARRIER; - } - } - if (i > 0) { - if (((ki % 3) == 2) && ((ki - 1) != (p2_papr_map_32k[i - 1] + K_EXT))) { - p2_carrier_map[ki - 1] = P2PILOT_CARRIER; - } - } - else { - if ((ki % 3) == 2) { - p2_carrier_map[ki - 1] = P2PILOT_CARRIER; - } - } + ki = p2_papr_map_32k[i] + K_EXT; + if (i < 287) { + if (((ki % 3) == 1) && + ((ki + 1) != (p2_papr_map_32k[i + 1] + K_EXT))) { + p2_carrier_map[ki + 1] = P2PILOT_CARRIER; + } + } else { + if ((ki % 3) == 1) { + p2_carrier_map[ki + 1] = P2PILOT_CARRIER; + } + } + if (i > 0) { + if (((ki % 3) == 2) && + ((ki - 1) != (p2_papr_map_32k[i - 1] + K_EXT))) { + p2_carrier_map[ki - 1] = P2PILOT_CARRIER; + } + } else { + if ((ki % 3) == 2) { + p2_carrier_map[ki - 1] = P2PILOT_CARRIER; + } + } } - } - cp_bpsk[0] = gr_complex(8.0 / 3.0, 0.0); - cp_bpsk[1] = gr_complex(-8.0 / 3.0, 0.0); - cp_bpsk_inverted[0] = gr_complex(-8.0 / 3.0, 0.0); - cp_bpsk_inverted[1] = gr_complex(8.0 / 3.0, 0.0); - break; - } - switch (pilotpattern) { - case PILOT_PP1: - sp_bpsk[0] = gr_complex(4.0 / 3.0, 0.0); - sp_bpsk[1] = gr_complex(-4.0 / 3.0, 0.0); - sp_bpsk_inverted[0] = gr_complex(-4.0 / 3.0, 0.0); - sp_bpsk_inverted[1] = gr_complex(4.0 / 3.0, 0.0); - dx = 3; - dy = 4; - break; - case PILOT_PP2: - sp_bpsk[0] = gr_complex(4.0 / 3.0, 0.0); - sp_bpsk[1] = gr_complex(-4.0 / 3.0, 0.0); - sp_bpsk_inverted[0] = gr_complex(-4.0 / 3.0, 0.0); - sp_bpsk_inverted[1] = gr_complex(4.0 / 3.0, 0.0); - dx = 6; - dy = 2; - break; - case PILOT_PP3: - sp_bpsk[0] = gr_complex(7.0 / 4.0, 0.0); - sp_bpsk[1] = gr_complex(-7.0 / 4.0, 0.0); - sp_bpsk_inverted[0] = gr_complex(-7.0 / 4.0, 0.0); - sp_bpsk_inverted[1] = gr_complex(7.0 / 4.0, 0.0); - dx = 6; - dy = 4; - break; - case PILOT_PP4: - sp_bpsk[0] = gr_complex(7.0 / 4.0, 0.0); - sp_bpsk[1] = gr_complex(-7.0 / 4.0, 0.0); - sp_bpsk_inverted[0] = gr_complex(-7.0 / 4.0, 0.0); - sp_bpsk_inverted[1] = gr_complex(7.0 / 4.0, 0.0); - dx = 12; - dy = 2; - break; - case PILOT_PP5: - sp_bpsk[0] = gr_complex(7.0 / 3.0, 0.0); - sp_bpsk[1] = gr_complex(-7.0 / 3.0, 0.0); - sp_bpsk_inverted[0] = gr_complex(-7.0 / 3.0, 0.0); - sp_bpsk_inverted[1] = gr_complex(7.0 / 3.0, 0.0); - dx = 12; - dy = 4; - break; - case PILOT_PP6: - sp_bpsk[0] = gr_complex(7.0 / 3.0, 0.0); - sp_bpsk[1] = gr_complex(-7.0 / 3.0, 0.0); - sp_bpsk_inverted[0] = gr_complex(-7.0 / 3.0, 0.0); - sp_bpsk_inverted[1] = gr_complex(7.0 / 3.0, 0.0); - dx = 24; - dy = 2; - break; - case PILOT_PP7: - sp_bpsk[0] = gr_complex(7.0 / 3.0, 0.0); - sp_bpsk[1] = gr_complex(-7.0 / 3.0, 0.0); - sp_bpsk_inverted[0] = gr_complex(-7.0 / 3.0, 0.0); - sp_bpsk_inverted[1] = gr_complex(7.0 / 3.0, 0.0); - dx = 24; - dy = 4; - break; - case PILOT_PP8: - sp_bpsk[0] = gr_complex(7.0 / 3.0, 0.0); - sp_bpsk[1] = gr_complex(-7.0 / 3.0, 0.0); - sp_bpsk_inverted[0] = gr_complex(-7.0 / 3.0, 0.0); - sp_bpsk_inverted[1] = gr_complex(7.0 / 3.0, 0.0); - dx = 6; - dy = 16; - break; - } - for (int i = 0; i < C_PS; i++) { + } + cp_bpsk[0] = gr_complex(8.0 / 3.0, 0.0); + cp_bpsk[1] = gr_complex(-8.0 / 3.0, 0.0); + cp_bpsk_inverted[0] = gr_complex(-8.0 / 3.0, 0.0); + cp_bpsk_inverted[1] = gr_complex(8.0 / 3.0, 0.0); + break; + } + switch (pilotpattern) { + case PILOT_PP1: + sp_bpsk[0] = gr_complex(4.0 / 3.0, 0.0); + sp_bpsk[1] = gr_complex(-4.0 / 3.0, 0.0); + sp_bpsk_inverted[0] = gr_complex(-4.0 / 3.0, 0.0); + sp_bpsk_inverted[1] = gr_complex(4.0 / 3.0, 0.0); + dx = 3; + dy = 4; + break; + case PILOT_PP2: + sp_bpsk[0] = gr_complex(4.0 / 3.0, 0.0); + sp_bpsk[1] = gr_complex(-4.0 / 3.0, 0.0); + sp_bpsk_inverted[0] = gr_complex(-4.0 / 3.0, 0.0); + sp_bpsk_inverted[1] = gr_complex(4.0 / 3.0, 0.0); + dx = 6; + dy = 2; + break; + case PILOT_PP3: + sp_bpsk[0] = gr_complex(7.0 / 4.0, 0.0); + sp_bpsk[1] = gr_complex(-7.0 / 4.0, 0.0); + sp_bpsk_inverted[0] = gr_complex(-7.0 / 4.0, 0.0); + sp_bpsk_inverted[1] = gr_complex(7.0 / 4.0, 0.0); + dx = 6; + dy = 4; + break; + case PILOT_PP4: + sp_bpsk[0] = gr_complex(7.0 / 4.0, 0.0); + sp_bpsk[1] = gr_complex(-7.0 / 4.0, 0.0); + sp_bpsk_inverted[0] = gr_complex(-7.0 / 4.0, 0.0); + sp_bpsk_inverted[1] = gr_complex(7.0 / 4.0, 0.0); + dx = 12; + dy = 2; + break; + case PILOT_PP5: + sp_bpsk[0] = gr_complex(7.0 / 3.0, 0.0); + sp_bpsk[1] = gr_complex(-7.0 / 3.0, 0.0); + sp_bpsk_inverted[0] = gr_complex(-7.0 / 3.0, 0.0); + sp_bpsk_inverted[1] = gr_complex(7.0 / 3.0, 0.0); + dx = 12; + dy = 4; + break; + case PILOT_PP6: + sp_bpsk[0] = gr_complex(7.0 / 3.0, 0.0); + sp_bpsk[1] = gr_complex(-7.0 / 3.0, 0.0); + sp_bpsk_inverted[0] = gr_complex(-7.0 / 3.0, 0.0); + sp_bpsk_inverted[1] = gr_complex(7.0 / 3.0, 0.0); + dx = 24; + dy = 2; + break; + case PILOT_PP7: + sp_bpsk[0] = gr_complex(7.0 / 3.0, 0.0); + sp_bpsk[1] = gr_complex(-7.0 / 3.0, 0.0); + sp_bpsk_inverted[0] = gr_complex(-7.0 / 3.0, 0.0); + sp_bpsk_inverted[1] = gr_complex(7.0 / 3.0, 0.0); + dx = 24; + dy = 4; + break; + case PILOT_PP8: + sp_bpsk[0] = gr_complex(7.0 / 3.0, 0.0); + sp_bpsk[1] = gr_complex(-7.0 / 3.0, 0.0); + sp_bpsk_inverted[0] = gr_complex(-7.0 / 3.0, 0.0); + sp_bpsk_inverted[1] = gr_complex(7.0 / 3.0, 0.0); + dx = 6; + dy = 16; + break; + } + for (int i = 0; i < C_PS; i++) { fc_carrier_map[i] = DATA_CARRIER; - } - for (int i = 0; i < C_PS; i++) { + } + for (int i = 0; i < C_PS; i++) { if (i % dx == 0) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((i / dx) % 2) { - fc_carrier_map[i] = SCATTERED_CARRIER_INVERTED; - } - else { - fc_carrier_map[i] = SCATTERED_CARRIER; + if (miso == TRUE && miso_group == MISO_TX2) { + if ((i / dx) % 2) { + fc_carrier_map[i] = SCATTERED_CARRIER_INVERTED; + } else { + fc_carrier_map[i] = SCATTERED_CARRIER; + } + } else { + fc_carrier_map[i] = SCATTERED_CARRIER; } - } - else { - fc_carrier_map[i] = SCATTERED_CARRIER; - } } - } - if (fftsize == FFTSIZE_1K && pilotpattern == PILOT_PP4) { + } + if (fftsize == FFTSIZE_1K && pilotpattern == PILOT_PP4) { fc_carrier_map[C_PS - 2] = SCATTERED_CARRIER; - } - else if (fftsize == FFTSIZE_1K && pilotpattern == PILOT_PP5) { + } else if (fftsize == FFTSIZE_1K && pilotpattern == PILOT_PP5) { fc_carrier_map[C_PS - 2] = SCATTERED_CARRIER; - } - else if (fftsize == FFTSIZE_2K && pilotpattern == PILOT_PP7) { + } else if (fftsize == FFTSIZE_2K && pilotpattern == PILOT_PP7) { fc_carrier_map[C_PS - 2] = SCATTERED_CARRIER; - } - if (miso == TRUE && miso_group == MISO_TX2) { + } + if (miso == TRUE && miso_group == MISO_TX2) { if ((numdatasyms + N_P2 - 1) % 2) { - fc_carrier_map[0] = SCATTERED_CARRIER_INVERTED; - fc_carrier_map[C_PS - 1] = SCATTERED_CARRIER_INVERTED; - } - else { - fc_carrier_map[0] = SCATTERED_CARRIER; - fc_carrier_map[C_PS - 1] = SCATTERED_CARRIER; + fc_carrier_map[0] = SCATTERED_CARRIER_INVERTED; + fc_carrier_map[C_PS - 1] = SCATTERED_CARRIER_INVERTED; + } else { + fc_carrier_map[0] = SCATTERED_CARRIER; + fc_carrier_map[C_PS - 1] = SCATTERED_CARRIER; } - } - else { + } else { fc_carrier_map[0] = SCATTERED_CARRIER; fc_carrier_map[C_PS - 1] = SCATTERED_CARRIER; - } - if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { + } + if (paprmode == PAPR_TR || paprmode == PAPR_BOTH) { switch (fftsize) { - case FFTSIZE_1K: + case FFTSIZE_1K: for (int i = 0; i < 10; i++) { - fc_carrier_map[p2_papr_map_1k[i]] = TRPAPR_CARRIER; + fc_carrier_map[p2_papr_map_1k[i]] = TRPAPR_CARRIER; } break; - case FFTSIZE_2K: + case FFTSIZE_2K: for (int i = 0; i < 18; i++) { - fc_carrier_map[p2_papr_map_2k[i]] = TRPAPR_CARRIER; + fc_carrier_map[p2_papr_map_2k[i]] = TRPAPR_CARRIER; } break; - case FFTSIZE_4K: + case FFTSIZE_4K: for (int i = 0; i < 36; i++) { - fc_carrier_map[p2_papr_map_4k[i]] = TRPAPR_CARRIER; + fc_carrier_map[p2_papr_map_4k[i]] = TRPAPR_CARRIER; } break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: for (int i = 0; i < 72; i++) { - fc_carrier_map[p2_papr_map_8k[i] + K_EXT] = TRPAPR_CARRIER; + fc_carrier_map[p2_papr_map_8k[i] + K_EXT] = TRPAPR_CARRIER; } break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: for (int i = 0; i < 144; i++) { - fc_carrier_map[p2_papr_map_16k[i] + K_EXT] = TRPAPR_CARRIER; + fc_carrier_map[p2_papr_map_16k[i] + K_EXT] = TRPAPR_CARRIER; } break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: for (int i = 0; i < 288; i++) { - fc_carrier_map[p2_papr_map_32k[i] + K_EXT] = TRPAPR_CARRIER; + fc_carrier_map[p2_papr_map_32k[i] + K_EXT] = TRPAPR_CARRIER; } break; } - } - if (N_FC == 0) { + } + if (N_FC == 0) { active_items = (N_P2 * C_P2) + (numdatasyms * C_DATA); - } - else { + } else { active_items = (N_P2 * C_P2) + ((numdatasyms - 1) * C_DATA) + N_FC; - } - fft_size = fftsize; - pilot_pattern = pilotpattern; - carrier_mode = carriermode; - papr_mode = paprmode; - left_nulls = ((vlength - C_PS) / 2) + 1; - right_nulls = (vlength - C_PS) / 2; - if ((fftsize == FFTSIZE_32K || fftsize == FFTSIZE_32K_T2GI) && (miso == FALSE)) { + } + fft_size = fftsize; + pilot_pattern = pilotpattern; + carrier_mode = carriermode; + papr_mode = paprmode; + left_nulls = ((vlength - C_PS) / 2) + 1; + right_nulls = (vlength - C_PS) / 2; + if ((fftsize == FFTSIZE_32K || fftsize == FFTSIZE_32K_T2GI) && (miso == FALSE)) { p2_bpsk[0] = gr_complex(std::sqrt(37.0) / 5.0, 0.0); p2_bpsk[1] = gr_complex(-(std::sqrt(37.0) / 5.0), 0.0); p2_bpsk_inverted[0] = gr_complex(-(std::sqrt(37.0) / 5.0), 0.0); p2_bpsk_inverted[1] = gr_complex(std::sqrt(37.0) / 5.0, 0.0); - } - else { + } else { p2_bpsk[0] = gr_complex(std::sqrt(31.0) / 5.0, 0.0); p2_bpsk[1] = gr_complex(-(std::sqrt(31.0) / 5.0), 0.0); p2_bpsk_inverted[0] = gr_complex(-(std::sqrt(31.0) / 5.0), 0.0); p2_bpsk_inverted[1] = gr_complex(std::sqrt(31.0) / 5.0, 0.0); - } - normalization = 5.0 / std::sqrt(27.0 * C_PS); - switch (bandwidth) { - case BANDWIDTH_1_7_MHZ: - fs = 131.0 * 1000000.0 / 71.0; - break; - case BANDWIDTH_5_0_MHZ: - fs = 5.0 * 8000000.0 / 7.0; - break; - case BANDWIDTH_6_0_MHZ: - fs = 6.0 * 8000000.0 / 7.0; - break; - case BANDWIDTH_7_0_MHZ: - fs = 7.0 * 8000000.0 / 7.0; - break; - case BANDWIDTH_8_0_MHZ: - fs = 8.0 * 8000000.0 / 7.0; - break; - case BANDWIDTH_10_0_MHZ: - fs = 10.0 * 8000000.0 / 7.0; - break; - default: - fs = 1.0; - break; - } - fstep = fs / vlength; - for (unsigned int i = 0; i < vlength / 2; i++) { + } + normalization = 5.0 / std::sqrt(27.0 * C_PS); + switch (bandwidth) { + case BANDWIDTH_1_7_MHZ: + fs = 131.0 * 1000000.0 / 71.0; + break; + case BANDWIDTH_5_0_MHZ: + fs = 5.0 * 8000000.0 / 7.0; + break; + case BANDWIDTH_6_0_MHZ: + fs = 6.0 * 8000000.0 / 7.0; + break; + case BANDWIDTH_7_0_MHZ: + fs = 7.0 * 8000000.0 / 7.0; + break; + case BANDWIDTH_8_0_MHZ: + fs = 8.0 * 8000000.0 / 7.0; + break; + case BANDWIDTH_10_0_MHZ: + fs = 10.0 * 8000000.0 / 7.0; + break; + default: + fs = 1.0; + break; + } + fstep = fs / vlength; + for (unsigned int i = 0; i < vlength / 2; i++) { x = GR_M_PI * f / fs; if (i == 0) { - sinc = 1.0; - } - else { - sinc = sin(x) / x; + sinc = 1.0; + } else { + sinc = sin(x) / x; } sincrms += sinc * sinc; inverse_sinc[i + (vlength / 2)] = gr_complex(1.0 / sinc, 0.0); inverse_sinc[(vlength / 2) - i - 1] = gr_complex(1.0 / sinc, 0.0); f = f + fstep; - } - sincrms = std::sqrt(sincrms / (vlength / 2)); - for (unsigned int i = 0; i < vlength; i++) { + } + sincrms = std::sqrt(sincrms / (vlength / 2)); + for (unsigned int i = 0; i < vlength; i++) { inverse_sinc[i] *= sincrms; - } - equalization_enable = equalization; - ofdm_fft_size = vlength; - ofdm_fft = new (std::nothrow) fft::fft_complex(ofdm_fft_size, false, 1); - if (ofdm_fft == NULL) { - GR_LOG_FATAL(d_logger, "Pilot Generator and IFFT, cannot allocate memory for ofdm_fft."); + } + equalization_enable = equalization; + ofdm_fft_size = vlength; + ofdm_fft = new (std::nothrow) fft::fft_complex(ofdm_fft_size, false, 1); + if (ofdm_fft == NULL) { + GR_LOG_FATAL(d_logger, + "Pilot Generator and IFFT, cannot allocate memory for ofdm_fft."); throw std::bad_alloc(); - } + } - num_symbols = numdatasyms + N_P2; - data_carrier_map.resize(num_symbols); - for (std::vector< std::vector<int> >::size_type i = 0; i != data_carrier_map.size(); i++){ + num_symbols = numdatasyms + N_P2; + data_carrier_map.resize(num_symbols); + for (std::vector<std::vector<int>>::size_type i = 0; i != data_carrier_map.size(); + i++) { data_carrier_map[i].resize(MAX_CARRIERS); - } - init_pilots(); - - set_output_multiple(num_symbols); } + init_pilots(); - /* - * Our virtual destructor. - */ - dvbt2_pilotgenerator_cc_impl::~dvbt2_pilotgenerator_cc_impl() - { - delete ofdm_fft; - } + set_output_multiple(num_symbols); +} - void - dvbt2_pilotgenerator_cc_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = active_items * (noutput_items / num_symbols); - } +/* + * Our virtual destructor. + */ +dvbt2_pilotgenerator_cc_impl::~dvbt2_pilotgenerator_cc_impl() { delete ofdm_fft; } + +void dvbt2_pilotgenerator_cc_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = active_items * (noutput_items / num_symbols); +} - void - dvbt2_pilotgenerator_cc_impl::init_prbs(void) - { - int sr = 0x7ff; - int j = 0; +void dvbt2_pilotgenerator_cc_impl::init_prbs(void) +{ + int sr = 0x7ff; + int j = 0; - for (int i = 0; i < MAX_CARRIERS; i++) { + for (int i = 0; i < MAX_CARRIERS; i++) { int b = ((sr) ^ (sr >> 2)) & 1; prbs[i] = sr & 1; sr >>= 1; - if(b) { - sr |= 0x400; + if (b) { + sr |= 0x400; } - } + } - for (int i = 0; i < (CHIPS / 8); i++) { + for (int i = 0; i < (CHIPS / 8); i++) { for (int k = 7; k >= 0; k--) { - pn_sequence[j] = (pn_sequence_table[i] >> k) & 0x1; - j = j + 1; + pn_sequence[j] = (pn_sequence_table[i] >> k) & 0x1; + j = j + 1; } - } } - - void - dvbt2_pilotgenerator_cc_impl::init_pilots() - { - for (int symbol = 0; symbol < num_symbols; ++symbol){ - int remainder, shift; - std::vector<int> &data_carrier_map = this->data_carrier_map[symbol]; - for (int i = 0; i < C_PS; i++) { - data_carrier_map[i] = DATA_CARRIER; - } - switch (fft_size) { +} + +void dvbt2_pilotgenerator_cc_impl::init_pilots() +{ + for (int symbol = 0; symbol < num_symbols; ++symbol) { + int remainder, shift; + std::vector<int>& data_carrier_map = this->data_carrier_map[symbol]; + for (int i = 0; i < C_PS; i++) { + data_carrier_map[i] = DATA_CARRIER; + } + switch (fft_size) { case FFTSIZE_1K: - switch (pilot_pattern) { + switch (pilot_pattern) { case PILOT_PP1: - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp1_cp1[i] % 1632) / dx)) % 2 && (((pp1_cp1[i] % 1632) % dx) == 0)) { - data_carrier_map[pp1_cp1[i] % 1632] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp1_cp1[i] % 1632] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp1_cp1[i] % 1632] = CONTINUAL_CARRIER; - } - } - break; + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp1_cp1[i] % 1632) / dx)) % 2 && + (((pp1_cp1[i] % 1632) % dx) == 0)) { + data_carrier_map[pp1_cp1[i] % 1632] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp1_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp1_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + } + break; case PILOT_PP2: - for (int i = 0; i < 20; i++) { - data_carrier_map[pp2_cp1[i] % 1632] = CONTINUAL_CARRIER; - } - break; + for (int i = 0; i < 20; i++) { + data_carrier_map[pp2_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + break; case PILOT_PP3: - for (int i = 0; i < 22; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp3_cp1[i] % 1632) / dx)) % 2 && (((pp3_cp1[i] % 1632) % dx) == 0)) { - data_carrier_map[pp3_cp1[i] % 1632] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp3_cp1[i] % 1632] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp3_cp1[i] % 1632] = CONTINUAL_CARRIER; - } - } - break; + for (int i = 0; i < 22; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp3_cp1[i] % 1632) / dx)) % 2 && + (((pp3_cp1[i] % 1632) % dx) == 0)) { + data_carrier_map[pp3_cp1[i] % 1632] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + } + break; case PILOT_PP4: - for (int i = 0; i < 20; i++) { - data_carrier_map[pp4_cp1[i] % 1632] = CONTINUAL_CARRIER; - } - break; + for (int i = 0; i < 20; i++) { + data_carrier_map[pp4_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + break; case PILOT_PP5: - for (int i = 0; i < 19; i++) { - data_carrier_map[pp5_cp1[i] % 1632] = CONTINUAL_CARRIER; - } - break; + for (int i = 0; i < 19; i++) { + data_carrier_map[pp5_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + break; case PILOT_PP6: - break; + break; case PILOT_PP7: - for (int i = 0; i < 15; i++) { - data_carrier_map[pp7_cp1[i] % 1632] = CONTINUAL_CARRIER; - } - break; + for (int i = 0; i < 15; i++) { + data_carrier_map[pp7_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + break; case PILOT_PP8: - break; - } - break; + break; + } + break; case FFTSIZE_2K: - switch (pilot_pattern) { + switch (pilot_pattern) { case PILOT_PP1: - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp1_cp1[i] % 1632) / dx)) % 2 && (((pp1_cp1[i] % 1632) % dx) == 0)) { - data_carrier_map[pp1_cp1[i] % 1632] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp1_cp1[i] % 1632] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp1_cp1[i] % 1632] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 25; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp1_cp2[i] % 1632) / dx)) % 2 && (((pp1_cp2[i] % 1632) % dx) == 0)) { - data_carrier_map[pp1_cp2[i] % 1632] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp1_cp2[i] % 1632] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp1_cp2[i] % 1632] = CONTINUAL_CARRIER; - } - } - break; + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp1_cp1[i] % 1632) / dx)) % 2 && + (((pp1_cp1[i] % 1632) % dx) == 0)) { + data_carrier_map[pp1_cp1[i] % 1632] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp1_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp1_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 25; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp1_cp2[i] % 1632) / dx)) % 2 && + (((pp1_cp2[i] % 1632) % dx) == 0)) { + data_carrier_map[pp1_cp2[i] % 1632] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp1_cp2[i] % 1632] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp1_cp2[i] % 1632] = CONTINUAL_CARRIER; + } + } + break; case PILOT_PP2: - for (int i = 0; i < 20; i++) { - data_carrier_map[pp2_cp1[i] % 1632] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 22; i++) { - data_carrier_map[pp2_cp2[i] % 1632] = CONTINUAL_CARRIER; - } - break; + for (int i = 0; i < 20; i++) { + data_carrier_map[pp2_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 22; i++) { + data_carrier_map[pp2_cp2[i] % 1632] = CONTINUAL_CARRIER; + } + break; case PILOT_PP3: - for (int i = 0; i < 22; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp3_cp1[i] % 1632) / dx)) % 2 && (((pp3_cp1[i] % 1632) % dx) == 0)) { - data_carrier_map[pp3_cp1[i] % 1632] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp3_cp1[i] % 1632] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp3_cp1[i] % 1632] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp3_cp2[i] % 1632) / dx)) % 2 && (((pp3_cp2[i] % 1632) % dx) == 0)) { - data_carrier_map[pp3_cp2[i] % 1632] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp3_cp2[i] % 1632] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp3_cp2[i] % 1632] = CONTINUAL_CARRIER; - } - } - break; + for (int i = 0; i < 22; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp3_cp1[i] % 1632) / dx)) % 2 && + (((pp3_cp1[i] % 1632) % dx) == 0)) { + data_carrier_map[pp3_cp1[i] % 1632] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp3_cp2[i] % 1632) / dx)) % 2 && + (((pp3_cp2[i] % 1632) % dx) == 0)) { + data_carrier_map[pp3_cp2[i] % 1632] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_cp2[i] % 1632] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_cp2[i] % 1632] = CONTINUAL_CARRIER; + } + } + break; case PILOT_PP4: - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp4_cp1[i] % 1632) / dx)) % 2 && (((pp4_cp1[i] % 1632) % dx) == 0)) { - data_carrier_map[pp4_cp1[i] % 1632] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp1[i] % 1632] = CONTINUAL_CARRIER; - } + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp4_cp1[i] % 1632) / dx)) % 2 && + (((pp4_cp1[i] % 1632) % dx) == 0)) { + data_carrier_map[pp4_cp1[i] % 1632] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp1[i] % 1632] = CONTINUAL_CARRIER; + } } - else { - data_carrier_map[pp4_cp1[i] % 1632] = CONTINUAL_CARRIER; + for (int i = 0; i < 23; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp4_cp2[i] % 1632) / dx)) % 2 && + (((pp4_cp2[i] % 1632) % dx) == 0)) { + data_carrier_map[pp4_cp2[i] % 1632] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp2[i] % 1632] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp2[i] % 1632] = CONTINUAL_CARRIER; + } } - } - for (int i = 0; i < 23; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp4_cp2[i] % 1632) / dx)) % 2 && (((pp4_cp2[i] % 1632) % dx) == 0)) { - data_carrier_map[pp4_cp2[i] % 1632] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp2[i] % 1632] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp2[i] % 1632] = CONTINUAL_CARRIER; - } - } - break; + break; case PILOT_PP5: - for (int i = 0; i < 19; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp5_cp1[i] % 1632) / dx)) % 2 && (((pp5_cp1[i] % 1632) % dx) == 0)) { - data_carrier_map[pp5_cp1[i] % 1632] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp5_cp1[i] % 1632] = CONTINUAL_CARRIER; - } + for (int i = 0; i < 19; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp5_cp1[i] % 1632) / dx)) % 2 && + (((pp5_cp1[i] % 1632) % dx) == 0)) { + data_carrier_map[pp5_cp1[i] % 1632] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_cp1[i] % 1632] = CONTINUAL_CARRIER; + } } - else { - data_carrier_map[pp5_cp1[i] % 1632] = CONTINUAL_CARRIER; + for (int i = 0; i < 23; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp5_cp2[i] % 1632) / dx)) % 2 && + (((pp5_cp2[i] % 1632) % dx) == 0)) { + data_carrier_map[pp5_cp2[i] % 1632] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_cp2[i] % 1632] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_cp2[i] % 1632] = CONTINUAL_CARRIER; + } } - } - for (int i = 0; i < 23; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp5_cp2[i] % 1632) / dx)) % 2 && (((pp5_cp2[i] % 1632) % dx) == 0)) { - data_carrier_map[pp5_cp2[i] % 1632] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp5_cp2[i] % 1632] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp5_cp2[i] % 1632] = CONTINUAL_CARRIER; - } - } - break; + break; case PILOT_PP6: - break; + break; case PILOT_PP7: - for (int i = 0; i < 15; i++) { - data_carrier_map[pp7_cp1[i] % 1632] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 30; i++) { - data_carrier_map[pp7_cp2[i] % 1632] = CONTINUAL_CARRIER; - } - break; + for (int i = 0; i < 15; i++) { + data_carrier_map[pp7_cp1[i] % 1632] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 30; i++) { + data_carrier_map[pp7_cp2[i] % 1632] = CONTINUAL_CARRIER; + } + break; case PILOT_PP8: - break; - } - break; + break; + } + break; case FFTSIZE_4K: - switch (pilot_pattern) { + switch (pilot_pattern) { case PILOT_PP1: - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp1_cp1[i] % 3264) / dx)) % 2 && (((pp1_cp1[i] % 3264) % dx) == 0)) { - data_carrier_map[pp1_cp1[i] % 3264] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp1_cp1[i] % 3264] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp1_cp1[i] % 3264] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 25; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp1_cp2[i] % 3264) / dx)) % 2 && (((pp1_cp2[i] % 3264) % dx) == 0)) { - data_carrier_map[pp1_cp2[i] % 3264] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp1_cp2[i] % 3264] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp1_cp2[i] % 3264] = CONTINUAL_CARRIER; - } - } - break; + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp1_cp1[i] % 3264) / dx)) % 2 && + (((pp1_cp1[i] % 3264) % dx) == 0)) { + data_carrier_map[pp1_cp1[i] % 3264] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp1_cp1[i] % 3264] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp1_cp1[i] % 3264] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 25; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp1_cp2[i] % 3264) / dx)) % 2 && + (((pp1_cp2[i] % 3264) % dx) == 0)) { + data_carrier_map[pp1_cp2[i] % 3264] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp1_cp2[i] % 3264] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp1_cp2[i] % 3264] = CONTINUAL_CARRIER; + } + } + break; case PILOT_PP2: - for (int i = 0; i < 20; i++) { - data_carrier_map[pp2_cp1[i] % 3264] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 22; i++) { - data_carrier_map[pp2_cp2[i] % 3264] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 2; i++) { - data_carrier_map[pp2_cp3[i] % 3264] = CONTINUAL_CARRIER; - } - break; + for (int i = 0; i < 20; i++) { + data_carrier_map[pp2_cp1[i] % 3264] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 22; i++) { + data_carrier_map[pp2_cp2[i] % 3264] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 2; i++) { + data_carrier_map[pp2_cp3[i] % 3264] = CONTINUAL_CARRIER; + } + break; case PILOT_PP3: - for (int i = 0; i < 22; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp3_cp1[i] % 3264) / dx)) % 2 && (((pp3_cp1[i] % 3264) % dx) == 0)) { - data_carrier_map[pp3_cp1[i] % 3264] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp3_cp1[i] % 3264] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp3_cp1[i] % 3264] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp3_cp2[i] % 3264) / dx)) % 2 && (((pp3_cp2[i] % 3264) % dx) == 0)) { - data_carrier_map[pp3_cp2[i] % 3264] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp3_cp2[i] % 3264] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp3_cp2[i] % 3264] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 1; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp3_cp3[i] % 3264) / dx)) % 2 && (((pp3_cp3[i] % 3264) % dx) == 0)) { - data_carrier_map[pp3_cp3[i] % 3264] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp3_cp3[i] % 3264] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp3_cp3[i] % 3264] = CONTINUAL_CARRIER; - } - } - break; + for (int i = 0; i < 22; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp3_cp1[i] % 3264) / dx)) % 2 && + (((pp3_cp1[i] % 3264) % dx) == 0)) { + data_carrier_map[pp3_cp1[i] % 3264] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_cp1[i] % 3264] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_cp1[i] % 3264] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp3_cp2[i] % 3264) / dx)) % 2 && + (((pp3_cp2[i] % 3264) % dx) == 0)) { + data_carrier_map[pp3_cp2[i] % 3264] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_cp2[i] % 3264] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_cp2[i] % 3264] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 1; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp3_cp3[i] % 3264) / dx)) % 2 && + (((pp3_cp3[i] % 3264) % dx) == 0)) { + data_carrier_map[pp3_cp3[i] % 3264] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_cp3[i] % 3264] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_cp3[i] % 3264] = CONTINUAL_CARRIER; + } + } + break; case PILOT_PP4: - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp4_cp1[i] % 3264) / dx)) % 2 && (((pp4_cp1[i] % 3264) % dx) == 0)) { - data_carrier_map[pp4_cp1[i] % 3264] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp1[i] % 3264] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp1[i] % 3264] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 23; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp4_cp2[i] % 3264) / dx)) % 2 && (((pp4_cp2[i] % 3264) % dx) == 0)) { - data_carrier_map[pp4_cp2[i] % 3264] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp2[i] % 3264] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp2[i] % 3264] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 1; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp4_cp3[i] % 3264) / dx)) % 2 && (((pp4_cp3[i] % 3264) % dx) == 0)) { - data_carrier_map[pp4_cp3[i] % 3264] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp3[i] % 3264] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp3[i] % 3264] = CONTINUAL_CARRIER; - } - } - break; + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp4_cp1[i] % 3264) / dx)) % 2 && + (((pp4_cp1[i] % 3264) % dx) == 0)) { + data_carrier_map[pp4_cp1[i] % 3264] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp1[i] % 3264] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp1[i] % 3264] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 23; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp4_cp2[i] % 3264) / dx)) % 2 && + (((pp4_cp2[i] % 3264) % dx) == 0)) { + data_carrier_map[pp4_cp2[i] % 3264] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp2[i] % 3264] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp2[i] % 3264] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 1; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp4_cp3[i] % 3264) / dx)) % 2 && + (((pp4_cp3[i] % 3264) % dx) == 0)) { + data_carrier_map[pp4_cp3[i] % 3264] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp3[i] % 3264] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp3[i] % 3264] = CONTINUAL_CARRIER; + } + } + break; case PILOT_PP5: - for (int i = 0; i < 19; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp5_cp1[i] % 3264) / dx)) % 2 && (((pp5_cp1[i] % 3264) % dx) == 0)) { - data_carrier_map[pp5_cp1[i] % 3264] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp5_cp1[i] % 3264] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp5_cp1[i] % 3264] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 23; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp5_cp2[i] % 3264) / dx)) % 2 && (((pp5_cp2[i] % 3264) % dx) == 0)) { - data_carrier_map[pp5_cp2[i] % 3264] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp5_cp2[i] % 3264] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp5_cp2[i] % 3264] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 3; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp5_cp3[i] % 3264) / dx)) % 2 && (((pp5_cp3[i] % 3264) % dx) == 0)) { - data_carrier_map[pp5_cp3[i] % 3264] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp5_cp3[i] % 3264] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp5_cp3[i] % 3264] = CONTINUAL_CARRIER; - } - } - break; + for (int i = 0; i < 19; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp5_cp1[i] % 3264) / dx)) % 2 && + (((pp5_cp1[i] % 3264) % dx) == 0)) { + data_carrier_map[pp5_cp1[i] % 3264] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_cp1[i] % 3264] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_cp1[i] % 3264] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 23; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp5_cp2[i] % 3264) / dx)) % 2 && + (((pp5_cp2[i] % 3264) % dx) == 0)) { + data_carrier_map[pp5_cp2[i] % 3264] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_cp2[i] % 3264] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_cp2[i] % 3264] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 3; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp5_cp3[i] % 3264) / dx)) % 2 && + (((pp5_cp3[i] % 3264) % dx) == 0)) { + data_carrier_map[pp5_cp3[i] % 3264] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_cp3[i] % 3264] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_cp3[i] % 3264] = CONTINUAL_CARRIER; + } + } + break; case PILOT_PP6: - break; + break; case PILOT_PP7: - for (int i = 0; i < 15; i++) { - data_carrier_map[pp7_cp1[i] % 3264] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 30; i++) { - data_carrier_map[pp7_cp2[i] % 3264] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 5; i++) { - data_carrier_map[pp7_cp3[i] % 3264] = CONTINUAL_CARRIER; - } - break; + for (int i = 0; i < 15; i++) { + data_carrier_map[pp7_cp1[i] % 3264] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 30; i++) { + data_carrier_map[pp7_cp2[i] % 3264] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 5; i++) { + data_carrier_map[pp7_cp3[i] % 3264] = CONTINUAL_CARRIER; + } + break; case PILOT_PP8: - break; - } - break; + break; + } + break; case FFTSIZE_8K: case FFTSIZE_8K_T2GI: - switch (pilot_pattern) { + switch (pilot_pattern) { case PILOT_PP1: - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp1_cp1[i] % 6528) / dx)) % 2 && (((pp1_cp1[i] % 6528) % dx) == 0)) { - data_carrier_map[pp1_cp1[i] % 6528] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp1_cp1[i] % 6528] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp1_cp1[i] % 6528] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 25; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp1_cp2[i] % 6528) / dx)) % 2 && (((pp1_cp2[i] % 6528) % dx) == 0)) { - data_carrier_map[pp1_cp2[i] % 6528] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp1_cp2[i] % 6528] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp1_cp2[i] % 6528] = CONTINUAL_CARRIER; - } - } - break; + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp1_cp1[i] % 6528) / dx)) % 2 && + (((pp1_cp1[i] % 6528) % dx) == 0)) { + data_carrier_map[pp1_cp1[i] % 6528] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp1_cp1[i] % 6528] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp1_cp1[i] % 6528] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 25; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp1_cp2[i] % 6528) / dx)) % 2 && + (((pp1_cp2[i] % 6528) % dx) == 0)) { + data_carrier_map[pp1_cp2[i] % 6528] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp1_cp2[i] % 6528] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp1_cp2[i] % 6528] = CONTINUAL_CARRIER; + } + } + break; case PILOT_PP2: - for (int i = 0; i < 20; i++) { - data_carrier_map[pp2_cp1[i] % 6528] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 22; i++) { - data_carrier_map[pp2_cp2[i] % 6528] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 2; i++) { - data_carrier_map[pp2_cp3[i] % 6528] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 2; i++) { - data_carrier_map[pp2_cp4[i] % 6528] = CONTINUAL_CARRIER; - } - if (carrier_mode == CARRIERS_EXTENDED) { - for (int i = 0; i < 4; i++) { - data_carrier_map[pp2_8k[i]] = CONTINUAL_CARRIER; - } - } - break; - case PILOT_PP3: - for (int i = 0; i < 22; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp3_cp1[i] % 6528) / dx)) % 2 && (((pp3_cp1[i] % 6528) % dx) == 0)) { - data_carrier_map[pp3_cp1[i] % 6528] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp3_cp1[i] % 6528] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp3_cp1[i] % 6528] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp3_cp2[i] % 6528) / dx)) % 2 && (((pp3_cp2[i] % 6528) % dx) == 0)) { - data_carrier_map[pp3_cp2[i] % 6528] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp3_cp2[i] % 6528] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp3_cp2[i] % 6528] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 1; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp3_cp3[i] % 6528) / dx)) % 2 && (((pp3_cp3[i] % 6528) % dx) == 0)) { - data_carrier_map[pp3_cp3[i] % 6528] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp3_cp3[i] % 6528] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp3_cp3[i] % 6528] = CONTINUAL_CARRIER; - } - } - if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 20; i++) { + data_carrier_map[pp2_cp1[i] % 6528] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 22; i++) { + data_carrier_map[pp2_cp2[i] % 6528] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 2; i++) { + data_carrier_map[pp2_cp3[i] % 6528] = CONTINUAL_CARRIER; + } for (int i = 0; i < 2; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp3_8k[i] / dx)) % 2 && ((pp3_8k[i] % dx) == 0)) { - data_carrier_map[pp3_8k[i]] = CONTINUAL_CARRIER_INVERTED; + data_carrier_map[pp2_cp4[i] % 6528] = CONTINUAL_CARRIER; + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 4; i++) { + data_carrier_map[pp2_8k[i]] = CONTINUAL_CARRIER; + } + } + break; + case PILOT_PP3: + for (int i = 0; i < 22; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp3_cp1[i] % 6528) / dx)) % 2 && + (((pp3_cp1[i] % 6528) % dx) == 0)) { + data_carrier_map[pp3_cp1[i] % 6528] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_cp1[i] % 6528] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_cp1[i] % 6528] = CONTINUAL_CARRIER; } - else { - data_carrier_map[pp3_8k[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp3_cp2[i] % 6528) / dx)) % 2 && + (((pp3_cp2[i] % 6528) % dx) == 0)) { + data_carrier_map[pp3_cp2[i] % 6528] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_cp2[i] % 6528] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_cp2[i] % 6528] = CONTINUAL_CARRIER; } - } - else { - data_carrier_map[pp3_8k[i]] = CONTINUAL_CARRIER; - } } - } - break; + for (int i = 0; i < 1; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp3_cp3[i] % 6528) / dx)) % 2 && + (((pp3_cp3[i] % 6528) % dx) == 0)) { + data_carrier_map[pp3_cp3[i] % 6528] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_cp3[i] % 6528] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_cp3[i] % 6528] = CONTINUAL_CARRIER; + } + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 2; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp3_8k[i] / dx)) % 2 && ((pp3_8k[i] % dx) == 0)) { + data_carrier_map[pp3_8k[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_8k[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_8k[i]] = CONTINUAL_CARRIER; + } + } + } + break; case PILOT_PP4: - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp4_cp1[i] % 6528) / dx)) % 2 && (((pp4_cp1[i] % 6528) % dx) == 0)) { - data_carrier_map[pp4_cp1[i] % 6528] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp1[i] % 6528] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp1[i] % 6528] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 23; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp4_cp2[i] % 6528) / dx)) % 2 && (((pp4_cp2[i] % 6528) % dx) == 0)) { - data_carrier_map[pp4_cp2[i] % 6528] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp2[i] % 6528] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp2[i] % 6528] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 1; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp4_cp3[i] % 6528) / dx)) % 2 && (((pp4_cp3[i] % 6528) % dx) == 0)) { - data_carrier_map[pp4_cp3[i] % 6528] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp3[i] % 6528] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp3[i] % 6528] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 2; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp4_cp4[i] % 6528) / dx)) % 2 && (((pp4_cp4[i] % 6528) % dx) == 0)) { - data_carrier_map[pp4_cp4[i] % 6528] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp4[i] % 6528] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp4[i] % 6528] = CONTINUAL_CARRIER; - } - } - if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp4_cp1[i] % 6528) / dx)) % 2 && + (((pp4_cp1[i] % 6528) % dx) == 0)) { + data_carrier_map[pp4_cp1[i] % 6528] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp1[i] % 6528] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp1[i] % 6528] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 23; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp4_cp2[i] % 6528) / dx)) % 2 && + (((pp4_cp2[i] % 6528) % dx) == 0)) { + data_carrier_map[pp4_cp2[i] % 6528] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp2[i] % 6528] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp2[i] % 6528] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 1; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp4_cp3[i] % 6528) / dx)) % 2 && + (((pp4_cp3[i] % 6528) % dx) == 0)) { + data_carrier_map[pp4_cp3[i] % 6528] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp3[i] % 6528] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp3[i] % 6528] = CONTINUAL_CARRIER; + } + } for (int i = 0; i < 2; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp4_8k[i] / dx)) % 2 && ((pp4_8k[i] % dx) == 0)) { - data_carrier_map[pp4_8k[i]] = CONTINUAL_CARRIER_INVERTED; + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp4_cp4[i] % 6528) / dx)) % 2 && + (((pp4_cp4[i] % 6528) % dx) == 0)) { + data_carrier_map[pp4_cp4[i] % 6528] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp4[i] % 6528] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp4[i] % 6528] = CONTINUAL_CARRIER; } - else { - data_carrier_map[pp4_8k[i]] = CONTINUAL_CARRIER; + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 2; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp4_8k[i] / dx)) % 2 && ((pp4_8k[i] % dx) == 0)) { + data_carrier_map[pp4_8k[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_8k[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_8k[i]] = CONTINUAL_CARRIER; + } } - } - else { - data_carrier_map[pp4_8k[i]] = CONTINUAL_CARRIER; - } } - } - break; + break; case PILOT_PP5: - for (int i = 0; i < 19; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp5_cp1[i] % 6528) / dx)) % 2 && (((pp5_cp1[i] % 6528) % dx) == 0)) { - data_carrier_map[pp5_cp1[i] % 6528] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp5_cp1[i] % 6528] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp5_cp1[i] % 6528] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 23; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp5_cp2[i] % 6528) / dx)) % 2 && (((pp5_cp2[i] % 6528) % dx) == 0)) { - data_carrier_map[pp5_cp2[i] % 6528] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp5_cp2[i] % 6528] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp5_cp2[i] % 6528] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 3; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp5_cp3[i] % 6528) / dx)) % 2 && (((pp5_cp3[i] % 6528) % dx) == 0)) { - data_carrier_map[pp5_cp3[i] % 6528] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp5_cp3[i] % 6528] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp5_cp3[i] % 6528] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 1; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp5_cp4[i] % 6528) / dx)) % 2 && (((pp5_cp4[i] % 6528) % dx) == 0)) { - data_carrier_map[pp5_cp4[i] % 6528] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp5_cp4[i] % 6528] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp5_cp4[i] % 6528] = CONTINUAL_CARRIER; - } - } - break; + for (int i = 0; i < 19; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp5_cp1[i] % 6528) / dx)) % 2 && + (((pp5_cp1[i] % 6528) % dx) == 0)) { + data_carrier_map[pp5_cp1[i] % 6528] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_cp1[i] % 6528] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_cp1[i] % 6528] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 23; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp5_cp2[i] % 6528) / dx)) % 2 && + (((pp5_cp2[i] % 6528) % dx) == 0)) { + data_carrier_map[pp5_cp2[i] % 6528] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_cp2[i] % 6528] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_cp2[i] % 6528] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 3; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp5_cp3[i] % 6528) / dx)) % 2 && + (((pp5_cp3[i] % 6528) % dx) == 0)) { + data_carrier_map[pp5_cp3[i] % 6528] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_cp3[i] % 6528] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_cp3[i] % 6528] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 1; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp5_cp4[i] % 6528) / dx)) % 2 && + (((pp5_cp4[i] % 6528) % dx) == 0)) { + data_carrier_map[pp5_cp4[i] % 6528] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_cp4[i] % 6528] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_cp4[i] % 6528] = CONTINUAL_CARRIER; + } + } + break; case PILOT_PP6: - break; + break; case PILOT_PP7: - for (int i = 0; i < 15; i++) { - data_carrier_map[pp7_cp1[i] % 6528] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 30; i++) { - data_carrier_map[pp7_cp2[i] % 6528] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 5; i++) { - data_carrier_map[pp7_cp3[i] % 6528] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 3; i++) { - data_carrier_map[pp7_cp4[i] % 6528] = CONTINUAL_CARRIER; - } - if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 15; i++) { + data_carrier_map[pp7_cp1[i] % 6528] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 30; i++) { + data_carrier_map[pp7_cp2[i] % 6528] = CONTINUAL_CARRIER; + } for (int i = 0; i < 5; i++) { - data_carrier_map[pp7_8k[i]] = CONTINUAL_CARRIER; + data_carrier_map[pp7_cp3[i] % 6528] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 3; i++) { + data_carrier_map[pp7_cp4[i] % 6528] = CONTINUAL_CARRIER; } - } - break; + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 5; i++) { + data_carrier_map[pp7_8k[i]] = CONTINUAL_CARRIER; + } + } + break; case PILOT_PP8: - for (int i = 0; i < 47; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp8_cp4[i] % 6528) / dx)) % 2 && (((pp8_cp4[i] % 6528) % dx) == 0)) { - data_carrier_map[pp8_cp4[i] % 6528] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp8_cp4[i] % 6528] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp8_cp4[i] % 6528] = CONTINUAL_CARRIER; - } - } - if (carrier_mode == CARRIERS_EXTENDED) { - for (int i = 0; i < 5; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp8_8k[i] / dx)) % 2 && ((pp8_8k[i] % dx) == 0)) { - data_carrier_map[pp8_8k[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp8_8k[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp8_8k[i]] = CONTINUAL_CARRIER; - } - } - } - break; - } - break; + for (int i = 0; i < 47; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp8_cp4[i] % 6528) / dx)) % 2 && + (((pp8_cp4[i] % 6528) % dx) == 0)) { + data_carrier_map[pp8_cp4[i] % 6528] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp8_cp4[i] % 6528] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp8_cp4[i] % 6528] = CONTINUAL_CARRIER; + } + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 5; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp8_8k[i] / dx)) % 2 && ((pp8_8k[i] % dx) == 0)) { + data_carrier_map[pp8_8k[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp8_8k[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp8_8k[i]] = CONTINUAL_CARRIER; + } + } + } + break; + } + break; case FFTSIZE_16K: case FFTSIZE_16K_T2GI: - switch (pilot_pattern) { + switch (pilot_pattern) { case PILOT_PP1: - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp1_cp1[i] % 13056) / dx)) % 2 && (((pp1_cp1[i] % 13056) % dx) == 0)) { - data_carrier_map[pp1_cp1[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp1_cp1[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp1_cp1[i] % 13056] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 25; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp1_cp2[i] % 13056) / dx)) % 2 && (((pp1_cp2[i] % 13056) % dx) == 0)) { - data_carrier_map[pp1_cp2[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp1_cp2[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp1_cp2[i] % 13056] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 44; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp1_cp5[i] % 13056) / dx)) % 2 && (((pp1_cp5[i] % 13056) % dx) == 0)) { - data_carrier_map[pp1_cp5[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp1_cp5[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp1_cp5[i] % 13056] = CONTINUAL_CARRIER; - } - } - if (carrier_mode == CARRIERS_EXTENDED) { - for (int i = 0; i < 4; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp1_16k[i] / dx)) % 2 && ((pp1_16k[i] % dx) == 0)) { - data_carrier_map[pp1_16k[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp1_16k[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp1_16k[i]] = CONTINUAL_CARRIER; - } - } - } - break; + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp1_cp1[i] % 13056) / dx)) % 2 && + (((pp1_cp1[i] % 13056) % dx) == 0)) { + data_carrier_map[pp1_cp1[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp1_cp1[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp1_cp1[i] % 13056] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 25; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp1_cp2[i] % 13056) / dx)) % 2 && + (((pp1_cp2[i] % 13056) % dx) == 0)) { + data_carrier_map[pp1_cp2[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp1_cp2[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp1_cp2[i] % 13056] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 44; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp1_cp5[i] % 13056) / dx)) % 2 && + (((pp1_cp5[i] % 13056) % dx) == 0)) { + data_carrier_map[pp1_cp5[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp1_cp5[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp1_cp5[i] % 13056] = CONTINUAL_CARRIER; + } + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 4; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp1_16k[i] / dx)) % 2 && ((pp1_16k[i] % dx) == 0)) { + data_carrier_map[pp1_16k[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp1_16k[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp1_16k[i]] = CONTINUAL_CARRIER; + } + } + } + break; case PILOT_PP2: - for (int i = 0; i < 20; i++) { - data_carrier_map[pp2_cp1[i] % 13056] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 22; i++) { - data_carrier_map[pp2_cp2[i] % 13056] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 2; i++) { - data_carrier_map[pp2_cp3[i] % 13056] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 2; i++) { - data_carrier_map[pp2_cp4[i] % 13056] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 41; i++) { - data_carrier_map[pp2_cp5[i] % 13056] = CONTINUAL_CARRIER; - } - if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 20; i++) { + data_carrier_map[pp2_cp1[i] % 13056] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 22; i++) { + data_carrier_map[pp2_cp2[i] % 13056] = CONTINUAL_CARRIER; + } for (int i = 0; i < 2; i++) { - data_carrier_map[pp2_16k[i]] = CONTINUAL_CARRIER; + data_carrier_map[pp2_cp3[i] % 13056] = CONTINUAL_CARRIER; } - } - break; - case PILOT_PP3: - for (int i = 0; i < 22; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp3_cp1[i] % 13056) / dx)) % 2 && (((pp3_cp1[i] % 13056) % dx) == 0)) { - data_carrier_map[pp3_cp1[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp3_cp1[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp3_cp1[i] % 13056] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp3_cp2[i] % 13056) / dx)) % 2 && (((pp3_cp2[i] % 13056) % dx) == 0)) { - data_carrier_map[pp3_cp2[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp3_cp2[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp3_cp2[i] % 13056] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 1; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp3_cp3[i] % 13056) / dx)) % 2 && (((pp3_cp3[i] % 13056) % dx) == 0)) { - data_carrier_map[pp3_cp3[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp3_cp3[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp3_cp3[i] % 13056] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 44; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp3_cp5[i] % 13056) / dx)) % 2 && (((pp3_cp5[i] % 13056) % dx) == 0)) { - data_carrier_map[pp3_cp5[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp3_cp5[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp3_cp5[i] % 13056] = CONTINUAL_CARRIER; - } - } - if (carrier_mode == CARRIERS_EXTENDED) { for (int i = 0; i < 2; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp3_16k[i] / dx)) % 2 && ((pp3_16k[i] % dx) == 0)) { - data_carrier_map[pp3_16k[i]] = CONTINUAL_CARRIER_INVERTED; + data_carrier_map[pp2_cp4[i] % 13056] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 41; i++) { + data_carrier_map[pp2_cp5[i] % 13056] = CONTINUAL_CARRIER; + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 2; i++) { + data_carrier_map[pp2_16k[i]] = CONTINUAL_CARRIER; + } + } + break; + case PILOT_PP3: + for (int i = 0; i < 22; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp3_cp1[i] % 13056) / dx)) % 2 && + (((pp3_cp1[i] % 13056) % dx) == 0)) { + data_carrier_map[pp3_cp1[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_cp1[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_cp1[i] % 13056] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp3_cp2[i] % 13056) / dx)) % 2 && + (((pp3_cp2[i] % 13056) % dx) == 0)) { + data_carrier_map[pp3_cp2[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_cp2[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_cp2[i] % 13056] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 1; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp3_cp3[i] % 13056) / dx)) % 2 && + (((pp3_cp3[i] % 13056) % dx) == 0)) { + data_carrier_map[pp3_cp3[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_cp3[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_cp3[i] % 13056] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 44; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp3_cp5[i] % 13056) / dx)) % 2 && + (((pp3_cp5[i] % 13056) % dx) == 0)) { + data_carrier_map[pp3_cp5[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_cp5[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_cp5[i] % 13056] = CONTINUAL_CARRIER; } - else { - data_carrier_map[pp3_16k[i]] = CONTINUAL_CARRIER; + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 2; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp3_16k[i] / dx)) % 2 && ((pp3_16k[i] % dx) == 0)) { + data_carrier_map[pp3_16k[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp3_16k[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp3_16k[i]] = CONTINUAL_CARRIER; + } } - } - else { - data_carrier_map[pp3_16k[i]] = CONTINUAL_CARRIER; - } } - } - break; + break; case PILOT_PP4: - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp4_cp1[i] % 13056) / dx)) % 2 && (((pp4_cp1[i] % 13056) % dx) == 0)) { - data_carrier_map[pp4_cp1[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp1[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp1[i] % 13056] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 23; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp4_cp2[i] % 13056) / dx)) % 2 && (((pp4_cp2[i] % 13056) % dx) == 0)) { - data_carrier_map[pp4_cp2[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp2[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp2[i] % 13056] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 1; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp4_cp3[i] % 13056) / dx)) % 2 && (((pp4_cp3[i] % 13056) % dx) == 0)) { - data_carrier_map[pp4_cp3[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp3[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp3[i] % 13056] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 2; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp4_cp4[i] % 13056) / dx)) % 2 && (((pp4_cp4[i] % 13056) % dx) == 0)) { - data_carrier_map[pp4_cp4[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp4[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp4[i] % 13056] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 44; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp4_cp5[i] % 13056) / dx)) % 2 && (((pp4_cp5[i] % 13056) % dx) == 0)) { - data_carrier_map[pp4_cp5[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp5[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp5[i] % 13056] = CONTINUAL_CARRIER; - } - } - if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp4_cp1[i] % 13056) / dx)) % 2 && + (((pp4_cp1[i] % 13056) % dx) == 0)) { + data_carrier_map[pp4_cp1[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp1[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp1[i] % 13056] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 23; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp4_cp2[i] % 13056) / dx)) % 2 && + (((pp4_cp2[i] % 13056) % dx) == 0)) { + data_carrier_map[pp4_cp2[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp2[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp2[i] % 13056] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 1; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp4_cp3[i] % 13056) / dx)) % 2 && + (((pp4_cp3[i] % 13056) % dx) == 0)) { + data_carrier_map[pp4_cp3[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp3[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp3[i] % 13056] = CONTINUAL_CARRIER; + } + } for (int i = 0; i < 2; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp4_16k[i] / dx)) % 2 && ((pp4_16k[i] % dx) == 0)) { - data_carrier_map[pp4_16k[i]] = CONTINUAL_CARRIER_INVERTED; + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp4_cp4[i] % 13056) / dx)) % 2 && + (((pp4_cp4[i] % 13056) % dx) == 0)) { + data_carrier_map[pp4_cp4[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp4[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp4[i] % 13056] = CONTINUAL_CARRIER; } - else { - data_carrier_map[pp4_16k[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 44; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp4_cp5[i] % 13056) / dx)) % 2 && + (((pp4_cp5[i] % 13056) % dx) == 0)) { + data_carrier_map[pp4_cp5[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp5[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp5[i] % 13056] = CONTINUAL_CARRIER; + } + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 2; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp4_16k[i] / dx)) % 2 && ((pp4_16k[i] % dx) == 0)) { + data_carrier_map[pp4_16k[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_16k[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_16k[i]] = CONTINUAL_CARRIER; + } } - } - else { - data_carrier_map[pp4_16k[i]] = CONTINUAL_CARRIER; - } } - } - break; + break; case PILOT_PP5: - for (int i = 0; i < 19; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp5_cp1[i] % 13056) / dx)) % 2 && (((pp5_cp1[i] % 13056) % dx) == 0)) { - data_carrier_map[pp5_cp1[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp5_cp1[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp5_cp1[i] % 13056] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 23; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp5_cp2[i] % 13056) / dx)) % 2 && (((pp5_cp2[i] % 13056) % dx) == 0)) { - data_carrier_map[pp5_cp2[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp5_cp2[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp5_cp2[i] % 13056] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 3; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp5_cp3[i] % 13056) / dx)) % 2 && (((pp5_cp3[i] % 13056) % dx) == 0)) { - data_carrier_map[pp5_cp3[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp5_cp3[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp5_cp3[i] % 13056] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 1; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp5_cp4[i] % 13056) / dx)) % 2 && (((pp5_cp4[i] % 13056) % dx) == 0)) { - data_carrier_map[pp5_cp4[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp5_cp4[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp5_cp4[i] % 13056] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 44; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp5_cp5[i] % 13056) / dx)) % 2 && (((pp5_cp5[i] % 13056) % dx) == 0)) { - data_carrier_map[pp5_cp5[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp5_cp5[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp5_cp5[i] % 13056] = CONTINUAL_CARRIER; - } - } - if (carrier_mode == CARRIERS_EXTENDED) { - for (int i = 0; i < 2; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp5_16k[i] / dx)) % 2 && ((pp5_16k[i] % dx) == 0)) { - data_carrier_map[pp5_16k[i]] = CONTINUAL_CARRIER_INVERTED; + for (int i = 0; i < 19; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp5_cp1[i] % 13056) / dx)) % 2 && + (((pp5_cp1[i] % 13056) % dx) == 0)) { + data_carrier_map[pp5_cp1[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_cp1[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_cp1[i] % 13056] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 23; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp5_cp2[i] % 13056) / dx)) % 2 && + (((pp5_cp2[i] % 13056) % dx) == 0)) { + data_carrier_map[pp5_cp2[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_cp2[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_cp2[i] % 13056] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 3; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp5_cp3[i] % 13056) / dx)) % 2 && + (((pp5_cp3[i] % 13056) % dx) == 0)) { + data_carrier_map[pp5_cp3[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_cp3[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_cp3[i] % 13056] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 1; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp5_cp4[i] % 13056) / dx)) % 2 && + (((pp5_cp4[i] % 13056) % dx) == 0)) { + data_carrier_map[pp5_cp4[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_cp4[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_cp4[i] % 13056] = CONTINUAL_CARRIER; } - else { - data_carrier_map[pp5_16k[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 44; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp5_cp5[i] % 13056) / dx)) % 2 && + (((pp5_cp5[i] % 13056) % dx) == 0)) { + data_carrier_map[pp5_cp5[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_cp5[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_cp5[i] % 13056] = CONTINUAL_CARRIER; + } + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 2; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp5_16k[i] / dx)) % 2 && ((pp5_16k[i] % dx) == 0)) { + data_carrier_map[pp5_16k[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp5_16k[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp5_16k[i]] = CONTINUAL_CARRIER; + } } - } - else { - data_carrier_map[pp5_16k[i]] = CONTINUAL_CARRIER; - } } - } - break; + break; case PILOT_PP6: - for (int i = 0; i < 88; i++) { - data_carrier_map[pp6_cp5[i] % 13056] = CONTINUAL_CARRIER; - } - if (carrier_mode == CARRIERS_EXTENDED) { - for (int i = 0; i < 2; i++) { - data_carrier_map[pp6_16k[i]] = CONTINUAL_CARRIER; + for (int i = 0; i < 88; i++) { + data_carrier_map[pp6_cp5[i] % 13056] = CONTINUAL_CARRIER; } - } - break; + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 2; i++) { + data_carrier_map[pp6_16k[i]] = CONTINUAL_CARRIER; + } + } + break; case PILOT_PP7: - for (int i = 0; i < 15; i++) { - data_carrier_map[pp7_cp1[i] % 13056] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 30; i++) { - data_carrier_map[pp7_cp2[i] % 13056] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 5; i++) { - data_carrier_map[pp7_cp3[i] % 13056] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 3; i++) { - data_carrier_map[pp7_cp4[i] % 13056] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 35; i++) { - data_carrier_map[pp7_cp5[i] % 13056] = CONTINUAL_CARRIER; - } - if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 15; i++) { + data_carrier_map[pp7_cp1[i] % 13056] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 30; i++) { + data_carrier_map[pp7_cp2[i] % 13056] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 5; i++) { + data_carrier_map[pp7_cp3[i] % 13056] = CONTINUAL_CARRIER; + } for (int i = 0; i < 3; i++) { - data_carrier_map[pp7_16k[i]] = CONTINUAL_CARRIER; + data_carrier_map[pp7_cp4[i] % 13056] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 35; i++) { + data_carrier_map[pp7_cp5[i] % 13056] = CONTINUAL_CARRIER; + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 3; i++) { + data_carrier_map[pp7_16k[i]] = CONTINUAL_CARRIER; + } } - } - break; + break; case PILOT_PP8: - for (int i = 0; i < 47; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp8_cp4[i] % 13056) / dx)) % 2 && (((pp8_cp4[i] % 13056) % dx) == 0)) { - data_carrier_map[pp8_cp4[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp8_cp4[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp8_cp4[i] % 13056] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 39; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((((pp8_cp5[i] % 13056) / dx)) % 2 && (((pp8_cp5[i] % 13056) % dx) == 0)) { - data_carrier_map[pp8_cp5[i] % 13056] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp8_cp5[i] % 13056] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp8_cp5[i] % 13056] = CONTINUAL_CARRIER; - } - } - if (carrier_mode == CARRIERS_EXTENDED) { - for (int i = 0; i < 3; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp8_16k[i] / dx)) % 2 && ((pp8_16k[i] % dx) == 0)) { - data_carrier_map[pp8_16k[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp8_16k[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp8_16k[i]] = CONTINUAL_CARRIER; - } - } - } - break; - } - break; + for (int i = 0; i < 47; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp8_cp4[i] % 13056) / dx)) % 2 && + (((pp8_cp4[i] % 13056) % dx) == 0)) { + data_carrier_map[pp8_cp4[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp8_cp4[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp8_cp4[i] % 13056] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 39; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((((pp8_cp5[i] % 13056) / dx)) % 2 && + (((pp8_cp5[i] % 13056) % dx) == 0)) { + data_carrier_map[pp8_cp5[i] % 13056] = + CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp8_cp5[i] % 13056] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp8_cp5[i] % 13056] = CONTINUAL_CARRIER; + } + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 3; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp8_16k[i] / dx)) % 2 && ((pp8_16k[i] % dx) == 0)) { + data_carrier_map[pp8_16k[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp8_16k[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp8_16k[i]] = CONTINUAL_CARRIER; + } + } + } + break; + } + break; case FFTSIZE_32K: case FFTSIZE_32K_T2GI: - switch (pilot_pattern) { + switch (pilot_pattern) { case PILOT_PP1: - for (int i = 0; i < 20; i++) { - data_carrier_map[pp1_cp1[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 25; i++) { - data_carrier_map[pp1_cp2[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 44; i++) { - data_carrier_map[pp1_cp5[i]] = CONTINUAL_CARRIER; - } - break; + for (int i = 0; i < 20; i++) { + data_carrier_map[pp1_cp1[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 25; i++) { + data_carrier_map[pp1_cp2[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 44; i++) { + data_carrier_map[pp1_cp5[i]] = CONTINUAL_CARRIER; + } + break; case PILOT_PP2: - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp2_cp1[i] / dx)) % 2 && ((pp2_cp1[i] % dx) == 0)) { - data_carrier_map[pp2_cp1[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp2_cp1[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp2_cp1[i]] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 22; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp2_cp2[i] / dx)) % 2 && ((pp2_cp2[i] % dx) == 0)) { - data_carrier_map[pp2_cp2[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp2_cp2[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp2_cp2[i]] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 2; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp2_cp3[i] / dx)) % 2 && ((pp2_cp3[i] % dx) == 0)) { - data_carrier_map[pp2_cp3[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp2_cp3[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp2_cp3[i]] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 2; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp2_cp4[i] / dx)) % 2 && ((pp2_cp4[i] % dx) == 0)) { - data_carrier_map[pp2_cp4[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp2_cp4[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp2_cp4[i]] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 41; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp2_cp5[i] / dx)) % 2 && ((pp2_cp5[i] % dx) == 0)) { - data_carrier_map[pp2_cp5[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp2_cp5[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp2_cp5[i]] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 88; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp2_cp6[i] / dx)) % 2 && ((pp2_cp6[i] % dx) == 0)) { - data_carrier_map[pp2_cp6[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp2_cp6[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp2_cp6[i]] = CONTINUAL_CARRIER; - } - } - if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp2_cp1[i] / dx)) % 2 && ((pp2_cp1[i] % dx) == 0)) { + data_carrier_map[pp2_cp1[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp2_cp1[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp2_cp1[i]] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 22; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp2_cp2[i] / dx)) % 2 && ((pp2_cp2[i] % dx) == 0)) { + data_carrier_map[pp2_cp2[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp2_cp2[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp2_cp2[i]] = CONTINUAL_CARRIER; + } + } for (int i = 0; i < 2; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp2_32k[i] / dx)) % 2 && ((pp2_32k[i] % dx) == 0)) { - data_carrier_map[pp2_32k[i]] = CONTINUAL_CARRIER_INVERTED; + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp2_cp3[i] / dx)) % 2 && ((pp2_cp3[i] % dx) == 0)) { + data_carrier_map[pp2_cp3[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp2_cp3[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp2_cp3[i]] = CONTINUAL_CARRIER; } - else { - data_carrier_map[pp2_32k[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 2; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp2_cp4[i] / dx)) % 2 && ((pp2_cp4[i] % dx) == 0)) { + data_carrier_map[pp2_cp4[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp2_cp4[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp2_cp4[i]] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 41; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp2_cp5[i] / dx)) % 2 && ((pp2_cp5[i] % dx) == 0)) { + data_carrier_map[pp2_cp5[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp2_cp5[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp2_cp5[i]] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 88; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp2_cp6[i] / dx)) % 2 && ((pp2_cp6[i] % dx) == 0)) { + data_carrier_map[pp2_cp6[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp2_cp6[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp2_cp6[i]] = CONTINUAL_CARRIER; } - } - else { - data_carrier_map[pp2_32k[i]] = CONTINUAL_CARRIER; - } } - } - break; + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 2; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp2_32k[i] / dx)) % 2 && ((pp2_32k[i] % dx) == 0)) { + data_carrier_map[pp2_32k[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp2_32k[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp2_32k[i]] = CONTINUAL_CARRIER; + } + } + } + break; case PILOT_PP3: - for (int i = 0; i < 22; i++) { - data_carrier_map[pp3_cp1[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 20; i++) { - data_carrier_map[pp3_cp2[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 1; i++) { - data_carrier_map[pp3_cp3[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 44; i++) { - data_carrier_map[pp3_cp5[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 49; i++) { - data_carrier_map[pp3_cp6[i]] = CONTINUAL_CARRIER; - } - break; + for (int i = 0; i < 22; i++) { + data_carrier_map[pp3_cp1[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 20; i++) { + data_carrier_map[pp3_cp2[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 1; i++) { + data_carrier_map[pp3_cp3[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 44; i++) { + data_carrier_map[pp3_cp5[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 49; i++) { + data_carrier_map[pp3_cp6[i]] = CONTINUAL_CARRIER; + } + break; case PILOT_PP4: - for (int i = 0; i < 20; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp4_cp1[i] / dx)) % 2 && ((pp4_cp1[i] % dx) == 0)) { - data_carrier_map[pp4_cp1[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp1[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp1[i]] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 23; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp4_cp2[i] / dx)) % 2 && ((pp4_cp2[i] % dx) == 0)) { - data_carrier_map[pp4_cp2[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp2[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp2[i]] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 1; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp4_cp3[i] / dx)) % 2 && ((pp4_cp3[i] % dx) == 0)) { - data_carrier_map[pp4_cp3[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp3[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp3[i]] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 2; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp4_cp4[i] / dx)) % 2 && ((pp4_cp4[i] % dx) == 0)) { - data_carrier_map[pp4_cp4[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp4[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp4[i]] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 44; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp4_cp5[i] / dx)) % 2 && ((pp4_cp5[i] % dx) == 0)) { - data_carrier_map[pp4_cp5[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp5[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp5[i]] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 86; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp4_cp6[i] / dx)) % 2 && ((pp4_cp6[i] % dx) == 0)) { - data_carrier_map[pp4_cp6[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp4_cp6[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp4_cp6[i]] = CONTINUAL_CARRIER; - } - } - if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 20; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp4_cp1[i] / dx)) % 2 && ((pp4_cp1[i] % dx) == 0)) { + data_carrier_map[pp4_cp1[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp1[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp1[i]] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 23; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp4_cp2[i] / dx)) % 2 && ((pp4_cp2[i] % dx) == 0)) { + data_carrier_map[pp4_cp2[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp2[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp2[i]] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 1; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp4_cp3[i] / dx)) % 2 && ((pp4_cp3[i] % dx) == 0)) { + data_carrier_map[pp4_cp3[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp3[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp3[i]] = CONTINUAL_CARRIER; + } + } for (int i = 0; i < 2; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp4_32k[i] / dx)) % 2 && ((pp4_32k[i] % dx) == 0)) { - data_carrier_map[pp4_32k[i]] = CONTINUAL_CARRIER_INVERTED; + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp4_cp4[i] / dx)) % 2 && ((pp4_cp4[i] % dx) == 0)) { + data_carrier_map[pp4_cp4[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp4[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp4[i]] = CONTINUAL_CARRIER; } - else { - data_carrier_map[pp4_32k[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 44; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp4_cp5[i] / dx)) % 2 && ((pp4_cp5[i] % dx) == 0)) { + data_carrier_map[pp4_cp5[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp5[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp5[i]] = CONTINUAL_CARRIER; } - } - else { - data_carrier_map[pp4_32k[i]] = CONTINUAL_CARRIER; - } } - } - break; + for (int i = 0; i < 86; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp4_cp6[i] / dx)) % 2 && ((pp4_cp6[i] % dx) == 0)) { + data_carrier_map[pp4_cp6[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_cp6[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_cp6[i]] = CONTINUAL_CARRIER; + } + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 2; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp4_32k[i] / dx)) % 2 && ((pp4_32k[i] % dx) == 0)) { + data_carrier_map[pp4_32k[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp4_32k[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp4_32k[i]] = CONTINUAL_CARRIER; + } + } + } + break; case PILOT_PP5: - for (int i = 0; i < 19; i++) { - data_carrier_map[pp5_cp1[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 23; i++) { - data_carrier_map[pp5_cp2[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 3; i++) { - data_carrier_map[pp5_cp3[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 1; i++) { - data_carrier_map[pp5_cp4[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 44; i++) { - data_carrier_map[pp5_cp5[i]] = CONTINUAL_CARRIER; - } - break; + for (int i = 0; i < 19; i++) { + data_carrier_map[pp5_cp1[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 23; i++) { + data_carrier_map[pp5_cp2[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 3; i++) { + data_carrier_map[pp5_cp3[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 1; i++) { + data_carrier_map[pp5_cp4[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 44; i++) { + data_carrier_map[pp5_cp5[i]] = CONTINUAL_CARRIER; + } + break; case PILOT_PP6: - for (int i = 0; i < 88; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp6_cp5[i] / dx)) % 2 && ((pp6_cp5[i] % dx) == 0)) { - data_carrier_map[pp6_cp5[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp6_cp5[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp6_cp5[i]] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 88; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp6_cp6[i] / dx)) % 2 && ((pp6_cp6[i] % dx) == 0)) { - data_carrier_map[pp6_cp6[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp6_cp6[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp6_cp6[i]] = CONTINUAL_CARRIER; - } - } - if (carrier_mode == CARRIERS_EXTENDED) { - for (int i = 0; i < 4; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp6_32k[i] / dx)) % 2 && ((pp6_32k[i] % dx) == 0)) { - data_carrier_map[pp6_32k[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp6_32k[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp6_32k[i]] = CONTINUAL_CARRIER; - } - } - } - break; + for (int i = 0; i < 88; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp6_cp5[i] / dx)) % 2 && ((pp6_cp5[i] % dx) == 0)) { + data_carrier_map[pp6_cp5[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp6_cp5[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp6_cp5[i]] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 88; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp6_cp6[i] / dx)) % 2 && ((pp6_cp6[i] % dx) == 0)) { + data_carrier_map[pp6_cp6[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp6_cp6[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp6_cp6[i]] = CONTINUAL_CARRIER; + } + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 4; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp6_32k[i] / dx)) % 2 && ((pp6_32k[i] % dx) == 0)) { + data_carrier_map[pp6_32k[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp6_32k[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp6_32k[i]] = CONTINUAL_CARRIER; + } + } + } + break; case PILOT_PP7: - for (int i = 0; i < 15; i++) { - data_carrier_map[pp7_cp1[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 30; i++) { - data_carrier_map[pp7_cp2[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 5; i++) { - data_carrier_map[pp7_cp3[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 3; i++) { - data_carrier_map[pp7_cp4[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 35; i++) { - data_carrier_map[pp7_cp5[i]] = CONTINUAL_CARRIER; - } - for (int i = 0; i < 92; i++) { - data_carrier_map[pp7_cp6[i]] = CONTINUAL_CARRIER; - } - if (carrier_mode == CARRIERS_EXTENDED) { - for (int i = 0; i < 2; i++) { - data_carrier_map[pp7_32k[i]] = CONTINUAL_CARRIER; + for (int i = 0; i < 15; i++) { + data_carrier_map[pp7_cp1[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 30; i++) { + data_carrier_map[pp7_cp2[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 5; i++) { + data_carrier_map[pp7_cp3[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 3; i++) { + data_carrier_map[pp7_cp4[i]] = CONTINUAL_CARRIER; + } + for (int i = 0; i < 35; i++) { + data_carrier_map[pp7_cp5[i]] = CONTINUAL_CARRIER; } - } - break; + for (int i = 0; i < 92; i++) { + data_carrier_map[pp7_cp6[i]] = CONTINUAL_CARRIER; + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 2; i++) { + data_carrier_map[pp7_32k[i]] = CONTINUAL_CARRIER; + } + } + break; case PILOT_PP8: - for (int i = 0; i < 47; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp8_cp4[i] / dx)) % 2 && ((pp8_cp4[i] % dx) == 0)) { - data_carrier_map[pp8_cp4[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp8_cp4[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp8_cp4[i]] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 39; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp8_cp5[i] / dx)) % 2 && ((pp8_cp5[i] % dx) == 0)) { - data_carrier_map[pp8_cp5[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp8_cp5[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp8_cp5[i]] = CONTINUAL_CARRIER; - } - } - for (int i = 0; i < 89; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp8_cp6[i] / dx)) % 2 && ((pp8_cp6[i] % dx) == 0)) { - data_carrier_map[pp8_cp6[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp8_cp6[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp8_cp6[i]] = CONTINUAL_CARRIER; - } - } - if (carrier_mode == CARRIERS_EXTENDED) { - for (int i = 0; i < 6; i++) { - if (miso == TRUE && miso_group == MISO_TX2) { - if (((pp8_32k[i] / dx)) % 2 && ((pp8_32k[i] % dx) == 0)) { - data_carrier_map[pp8_32k[i]] = CONTINUAL_CARRIER_INVERTED; - } - else { - data_carrier_map[pp8_32k[i]] = CONTINUAL_CARRIER; - } - } - else { - data_carrier_map[pp8_32k[i]] = CONTINUAL_CARRIER; - } - } - } - break; - } - break; - } - for (int i = 0; i < C_PS; i++) { - remainder = (i - K_EXT) % (dx * dy); - if (remainder < 0) { - remainder += (dx * dy); - } - if (remainder == (dx * (symbol % dy))) { - if (miso == TRUE && miso_group == MISO_TX2) { - if ((i / dx) % 2) { - data_carrier_map[i] = SCATTERED_CARRIER_INVERTED; - } - else { - data_carrier_map[i] = SCATTERED_CARRIER; - } - } - else { - data_carrier_map[i] = SCATTERED_CARRIER; - } - } - } - if (miso == TRUE && miso_group == MISO_TX2) { - if (symbol % 2) { - data_carrier_map[0] = SCATTERED_CARRIER_INVERTED; - data_carrier_map[C_PS - 1] = SCATTERED_CARRIER_INVERTED; - } - else { - data_carrier_map[0] = SCATTERED_CARRIER; - data_carrier_map[C_PS - 1] = SCATTERED_CARRIER; - } - } - else { - data_carrier_map[0] = SCATTERED_CARRIER; - data_carrier_map[C_PS - 1] = SCATTERED_CARRIER; - } - if (papr_mode == PAPR_TR || papr_mode == PAPR_BOTH) { - if (carrier_mode == CARRIERS_NORMAL) { - shift = dx * (symbol % dy); - } - else { - shift = dx * ((symbol + (K_EXT / dx)) % dy); - } - switch (fft_size) { - case FFTSIZE_1K: - for (int i = 0; i < 10; i++) { - data_carrier_map[tr_papr_map_1k[i] + shift] = TRPAPR_CARRIER; + for (int i = 0; i < 47; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp8_cp4[i] / dx)) % 2 && ((pp8_cp4[i] % dx) == 0)) { + data_carrier_map[pp8_cp4[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp8_cp4[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp8_cp4[i]] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 39; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp8_cp5[i] / dx)) % 2 && ((pp8_cp5[i] % dx) == 0)) { + data_carrier_map[pp8_cp5[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp8_cp5[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp8_cp5[i]] = CONTINUAL_CARRIER; + } + } + for (int i = 0; i < 89; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp8_cp6[i] / dx)) % 2 && ((pp8_cp6[i] % dx) == 0)) { + data_carrier_map[pp8_cp6[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp8_cp6[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp8_cp6[i]] = CONTINUAL_CARRIER; + } + } + if (carrier_mode == CARRIERS_EXTENDED) { + for (int i = 0; i < 6; i++) { + if (miso == TRUE && miso_group == MISO_TX2) { + if (((pp8_32k[i] / dx)) % 2 && ((pp8_32k[i] % dx) == 0)) { + data_carrier_map[pp8_32k[i]] = CONTINUAL_CARRIER_INVERTED; + } else { + data_carrier_map[pp8_32k[i]] = CONTINUAL_CARRIER; + } + } else { + data_carrier_map[pp8_32k[i]] = CONTINUAL_CARRIER; + } + } + } + break; } break; - case FFTSIZE_2K: - for (int i = 0; i < 18; i++) { - data_carrier_map[tr_papr_map_2k[i] + shift] = TRPAPR_CARRIER; + } + for (int i = 0; i < C_PS; i++) { + remainder = (i - K_EXT) % (dx * dy); + if (remainder < 0) { + remainder += (dx * dy); } - break; - case FFTSIZE_4K: - for (int i = 0; i < 36; i++) { - data_carrier_map[tr_papr_map_4k[i] + shift] = TRPAPR_CARRIER; + if (remainder == (dx * (symbol % dy))) { + if (miso == TRUE && miso_group == MISO_TX2) { + if ((i / dx) % 2) { + data_carrier_map[i] = SCATTERED_CARRIER_INVERTED; + } else { + data_carrier_map[i] = SCATTERED_CARRIER; + } + } else { + data_carrier_map[i] = SCATTERED_CARRIER; + } } - break; - case FFTSIZE_8K: - case FFTSIZE_8K_T2GI: - for (int i = 0; i < 72; i++) { - data_carrier_map[tr_papr_map_8k[i] + shift] = TRPAPR_CARRIER; + } + if (miso == TRUE && miso_group == MISO_TX2) { + if (symbol % 2) { + data_carrier_map[0] = SCATTERED_CARRIER_INVERTED; + data_carrier_map[C_PS - 1] = SCATTERED_CARRIER_INVERTED; + } else { + data_carrier_map[0] = SCATTERED_CARRIER; + data_carrier_map[C_PS - 1] = SCATTERED_CARRIER; } - break; - case FFTSIZE_16K: - case FFTSIZE_16K_T2GI: - for (int i = 0; i < 144; i++) { - data_carrier_map[tr_papr_map_16k[i] + shift] = TRPAPR_CARRIER; + } else { + data_carrier_map[0] = SCATTERED_CARRIER; + data_carrier_map[C_PS - 1] = SCATTERED_CARRIER; + } + if (papr_mode == PAPR_TR || papr_mode == PAPR_BOTH) { + if (carrier_mode == CARRIERS_NORMAL) { + shift = dx * (symbol % dy); + } else { + shift = dx * ((symbol + (K_EXT / dx)) % dy); } - break; - case FFTSIZE_32K: - case FFTSIZE_32K_T2GI: - for (int i = 0; i < 288; i++) { - data_carrier_map[tr_papr_map_32k[i] + shift] = TRPAPR_CARRIER; + switch (fft_size) { + case FFTSIZE_1K: + for (int i = 0; i < 10; i++) { + data_carrier_map[tr_papr_map_1k[i] + shift] = TRPAPR_CARRIER; + } + break; + case FFTSIZE_2K: + for (int i = 0; i < 18; i++) { + data_carrier_map[tr_papr_map_2k[i] + shift] = TRPAPR_CARRIER; + } + break; + case FFTSIZE_4K: + for (int i = 0; i < 36; i++) { + data_carrier_map[tr_papr_map_4k[i] + shift] = TRPAPR_CARRIER; + } + break; + case FFTSIZE_8K: + case FFTSIZE_8K_T2GI: + for (int i = 0; i < 72; i++) { + data_carrier_map[tr_papr_map_8k[i] + shift] = TRPAPR_CARRIER; + } + break; + case FFTSIZE_16K: + case FFTSIZE_16K_T2GI: + for (int i = 0; i < 144; i++) { + data_carrier_map[tr_papr_map_16k[i] + shift] = TRPAPR_CARRIER; + } + break; + case FFTSIZE_32K: + case FFTSIZE_32K_T2GI: + for (int i = 0; i < 288; i++) { + data_carrier_map[tr_papr_map_32k[i] + shift] = TRPAPR_CARRIER; + } + break; } - break; } - } - } } +} - const gr_complex zero = gr_complex(0.0, 0.0); +const gr_complex zero = gr_complex(0.0, 0.0); - int - dvbt2_pilotgenerator_cc_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - gr_complex *dst; - int L_FC = 0; +int dvbt2_pilotgenerator_cc_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + gr_complex* out = (gr_complex*)output_items[0]; + gr_complex* dst; + int L_FC = 0; - if (N_FC != 0) { + if (N_FC != 0) { L_FC = 1; - } - for (int i = 0; i < noutput_items; i += num_symbols) { + } + for (int i = 0; i < noutput_items; i += num_symbols) { for (int j = 0; j < num_symbols; j++) { - if (j < N_P2) { - for (int n = 0; n < left_nulls; n++) { - *out++ = zero; - } - for (int n = 0; n < C_PS; n++) { - if (p2_carrier_map[n] == P2PILOT_CARRIER) { - *out++ = p2_bpsk[prbs[n + K_OFFSET] ^ pn_sequence[j]]; - } - else if (p2_carrier_map[n] == P2PILOT_CARRIER_INVERTED) { - *out++ = p2_bpsk_inverted[prbs[n + K_OFFSET] ^ pn_sequence[j]]; - } - else if (p2_carrier_map[n] == P2PAPR_CARRIER) { - *out++ = zero; - } - else { - *out++ = *in++; - } - } - for (int n = 0; n < right_nulls; n++) { - *out++ = zero; - } - } - else if (j == (num_symbols - L_FC)) { - for (int n = 0; n < left_nulls; n++) { - *out++ = zero; - } - for (int n = 0; n < C_PS; n++) { - if (fc_carrier_map[n] == SCATTERED_CARRIER) { - *out++ = sp_bpsk[prbs[n + K_OFFSET] ^ pn_sequence[j]]; - } - else if (fc_carrier_map[n] == SCATTERED_CARRIER_INVERTED) { - *out++ = sp_bpsk_inverted[prbs[n + K_OFFSET] ^ pn_sequence[j]]; - } - else if (fc_carrier_map[n] == TRPAPR_CARRIER) { - *out++ = zero; - } - else { - *out++ = *in++; - } - } - for (int n = 0; n < right_nulls; n++) { - *out++ = zero; - } - } - else { - for (int n = 0; n < left_nulls; n++) { - *out++ = zero; - } - for (int n = 0; n < C_PS; n++) { - if (data_carrier_map[j][n] == SCATTERED_CARRIER) { - *out++ = sp_bpsk[prbs[n + K_OFFSET] ^ pn_sequence[j]]; - } - else if (data_carrier_map[j][n] == SCATTERED_CARRIER_INVERTED) { - *out++ = sp_bpsk_inverted[prbs[n + K_OFFSET] ^ pn_sequence[j]]; - } - else if (data_carrier_map[j][n] == CONTINUAL_CARRIER) { - *out++ = cp_bpsk[prbs[n + K_OFFSET] ^ pn_sequence[j]]; - } - else if (data_carrier_map[j][n] == CONTINUAL_CARRIER_INVERTED) { - *out++ = cp_bpsk_inverted[prbs[n + K_OFFSET] ^ pn_sequence[j]]; - } - else if (data_carrier_map[j][n] == TRPAPR_CARRIER) { - *out++ = zero; - } - else { - *out++ = *in++; - } + if (j < N_P2) { + for (int n = 0; n < left_nulls; n++) { + *out++ = zero; + } + for (int n = 0; n < C_PS; n++) { + if (p2_carrier_map[n] == P2PILOT_CARRIER) { + *out++ = p2_bpsk[prbs[n + K_OFFSET] ^ pn_sequence[j]]; + } else if (p2_carrier_map[n] == P2PILOT_CARRIER_INVERTED) { + *out++ = p2_bpsk_inverted[prbs[n + K_OFFSET] ^ pn_sequence[j]]; + } else if (p2_carrier_map[n] == P2PAPR_CARRIER) { + *out++ = zero; + } else { + *out++ = *in++; + } + } + for (int n = 0; n < right_nulls; n++) { + *out++ = zero; + } + } else if (j == (num_symbols - L_FC)) { + for (int n = 0; n < left_nulls; n++) { + *out++ = zero; + } + for (int n = 0; n < C_PS; n++) { + if (fc_carrier_map[n] == SCATTERED_CARRIER) { + *out++ = sp_bpsk[prbs[n + K_OFFSET] ^ pn_sequence[j]]; + } else if (fc_carrier_map[n] == SCATTERED_CARRIER_INVERTED) { + *out++ = sp_bpsk_inverted[prbs[n + K_OFFSET] ^ pn_sequence[j]]; + } else if (fc_carrier_map[n] == TRPAPR_CARRIER) { + *out++ = zero; + } else { + *out++ = *in++; + } + } + for (int n = 0; n < right_nulls; n++) { + *out++ = zero; + } + } else { + for (int n = 0; n < left_nulls; n++) { + *out++ = zero; + } + for (int n = 0; n < C_PS; n++) { + if (data_carrier_map[j][n] == SCATTERED_CARRIER) { + *out++ = sp_bpsk[prbs[n + K_OFFSET] ^ pn_sequence[j]]; + } else if (data_carrier_map[j][n] == SCATTERED_CARRIER_INVERTED) { + *out++ = sp_bpsk_inverted[prbs[n + K_OFFSET] ^ pn_sequence[j]]; + } else if (data_carrier_map[j][n] == CONTINUAL_CARRIER) { + *out++ = cp_bpsk[prbs[n + K_OFFSET] ^ pn_sequence[j]]; + } else if (data_carrier_map[j][n] == CONTINUAL_CARRIER_INVERTED) { + *out++ = cp_bpsk_inverted[prbs[n + K_OFFSET] ^ pn_sequence[j]]; + } else if (data_carrier_map[j][n] == TRPAPR_CARRIER) { + *out++ = zero; + } else { + *out++ = *in++; + } + } + for (int n = 0; n < right_nulls; n++) { + *out++ = zero; + } } - for (int n = 0; n < right_nulls; n++) { - *out++ = zero; + out -= ofdm_fft_size; + if (equalization_enable == EQUALIZATION_ON) { + volk_32fc_x2_multiply_32fc(out, out, inverse_sinc, ofdm_fft_size); } - } - out -= ofdm_fft_size; - if (equalization_enable == EQUALIZATION_ON) { - volk_32fc_x2_multiply_32fc(out, out, inverse_sinc, ofdm_fft_size); - } - dst = ofdm_fft->get_inbuf(); - memcpy(&dst[ofdm_fft_size / 2], &out[0], sizeof(gr_complex) * ofdm_fft_size / 2); - memcpy(&dst[0], &out[ofdm_fft_size / 2], sizeof(gr_complex) * ofdm_fft_size / 2); - ofdm_fft->execute(); - volk_32fc_s32fc_multiply_32fc(out, ofdm_fft->get_outbuf(), normalization, ofdm_fft_size); - out += ofdm_fft_size; + dst = ofdm_fft->get_inbuf(); + memcpy( + &dst[ofdm_fft_size / 2], &out[0], sizeof(gr_complex) * ofdm_fft_size / 2); + memcpy( + &dst[0], &out[ofdm_fft_size / 2], sizeof(gr_complex) * ofdm_fft_size / 2); + ofdm_fft->execute(); + volk_32fc_s32fc_multiply_32fc( + out, ofdm_fft->get_outbuf(), normalization, ofdm_fft_size); + out += ofdm_fft_size; } - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (active_items); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(active_items); + + // Tell runtime system how many output items we produced. + return noutput_items; +} + +const unsigned char dvbt2_pilotgenerator_cc_impl::pn_sequence_table[CHIPS / 8] = { + 0x4D, 0xC2, 0xAF, 0x7B, 0xD8, 0xC3, 0xC9, 0xA1, 0xE7, 0x6C, 0x9A, 0x09, 0x0A, 0xF1, + 0xC3, 0x11, 0x4F, 0x07, 0xFC, 0xA2, 0x80, 0x8E, 0x94, 0x62, 0xE9, 0xAD, 0x7B, 0x71, + 0x2D, 0x6F, 0x4A, 0xC8, 0xA5, 0x9B, 0xB0, 0x69, 0xCC, 0x50, 0xBF, 0x11, 0x49, 0x92, + 0x7E, 0x6B, 0xB1, 0xC9, 0xFC, 0x8C, 0x18, 0xBB, 0x94, 0x9B, 0x30, 0xCD, 0x09, 0xDD, + 0xD7, 0x49, 0xE7, 0x04, 0xF5, 0x7B, 0x41, 0xDE, 0xC7, 0xE7, 0xB1, 0x76, 0xE1, 0x2C, + 0x56, 0x57, 0x43, 0x2B, 0x51, 0xB0, 0xB8, 0x12, 0xDF, 0x0E, 0x14, 0x88, 0x7E, 0x24, + 0xD8, 0x0C, 0x97, 0xF0, 0x93, 0x74, 0xAD, 0x76, 0x27, 0x0E, 0x58, 0xFE, 0x17, 0x74, + 0xB2, 0x78, 0x1D, 0x8D, 0x38, 0x21, 0xE3, 0x93, 0xF2, 0xEA, 0x0F, 0xFD, 0x4D, 0x24, + 0xDE, 0x20, 0xC0, 0x5D, 0x0B, 0xA1, 0x70, 0x3D, 0x10, 0xE5, 0x2D, 0x61, 0xE0, 0x13, + 0xD8, 0x37, 0xAA, 0x62, 0xD0, 0x07, 0xCC, 0x2F, 0xD7, 0x6D, 0x23, 0xA3, 0xE1, 0x25, + 0xBD, 0xE8, 0xA9, 0xA7, 0xC0, 0x2A, 0x98, 0xB7, 0x02, 0x51, 0xC5, 0x56, 0xF6, 0x34, + 0x1E, 0xBD, 0xEC, 0xB8, 0x01, 0xAA, 0xD5, 0xD9, 0xFB, 0x8C, 0xBE, 0xA8, 0x0B, 0xB6, + 0x19, 0x09, 0x65, 0x27, 0xA8, 0xC4, 0x75, 0xB3, 0xD8, 0xDB, 0x28, 0xAF, 0x85, 0x43, + 0xA0, 0x0E, 0xC3, 0x48, 0x0D, 0xFF, 0x1E, 0x2C, 0xDA, 0x9F, 0x98, 0x5B, 0x52, 0x3B, + 0x87, 0x90, 0x07, 0xAA, 0x5D, 0x0C, 0xE5, 0x8D, 0x21, 0xB1, 0x86, 0x31, 0x00, 0x66, + 0x17, 0xF6, 0xF7, 0x69, 0xEB, 0x94, 0x7F, 0x92, 0x4E, 0xA5, 0x16, 0x1E, 0xC2, 0xC0, + 0x48, 0x8B, 0x63, 0xED, 0x79, 0x93, 0xBA, 0x8E, 0xF4, 0xE5, 0x52, 0xFA, 0x32, 0xFC, + 0x3F, 0x1B, 0xDB, 0x19, 0x92, 0x39, 0x02, 0xBC, 0xBB, 0xE5, 0xDD, 0xAB, 0xB8, 0x24, + 0x12, 0x6E, 0x08, 0x45, 0x9C, 0xA6, 0xCF, 0xA0, 0x26, 0x7E, 0x52, 0x94, 0xA9, 0x8C, + 0x63, 0x25, 0x69, 0x79, 0x1E, 0x60, 0xEF, 0x65, 0x9A, 0xEE, 0x95, 0x18, 0xCD, 0xF0, + 0x8D, 0x87, 0x83, 0x36, 0x90, 0xC1, 0xB7, 0x91, 0x83, 0xED, 0x12, 0x7E, 0x53, 0x36, + 0x0C, 0xD8, 0x65, 0x14, 0x85, 0x9A, 0x28, 0xB5, 0x49, 0x4F, 0x51, 0xAA, 0x48, 0x82, + 0x41, 0x9A, 0x25, 0xA2, 0xD0, 0x1A, 0x5F, 0x47, 0xAA, 0x27, 0x30, 0x1E, 0x79, 0xA5, + 0x37, 0x0C, 0xCB, 0x3E, 0x19, 0x7F +}; + +const int dvbt2_pilotgenerator_cc_impl::p2_papr_map_1k[10] = { 116, 130, 134, 157, 182, + 256, 346, 478, 479, 532 }; + +const int dvbt2_pilotgenerator_cc_impl::p2_papr_map_2k[18] = { + 113, 124, 262, 467, 479, 727, 803, 862, 910, + 946, 980, 1201, 1322, 1342, 1396, 1397, 1562, 1565 +}; + +const int dvbt2_pilotgenerator_cc_impl::p2_papr_map_4k[36] = { + 104, 116, 119, 163, 170, 173, 664, 886, 1064, 1151, 1196, 1264, + 1531, 1736, 1951, 1960, 2069, 2098, 2311, 2366, 2473, 2552, 2584, 2585, + 2645, 2774, 2846, 2882, 3004, 3034, 3107, 3127, 3148, 3191, 3283, 3289 +}; + +const int dvbt2_pilotgenerator_cc_impl::p2_papr_map_8k[72] = { + 106, 109, 110, 112, 115, 118, 133, 142, 163, 184, 206, 247, + 445, 461, 503, 565, 602, 656, 766, 800, 922, 1094, 1108, 1199, + 1258, 1726, 1793, 1939, 2128, 2714, 3185, 3365, 3541, 3655, 3770, 3863, + 4066, 4190, 4282, 4565, 4628, 4727, 4882, 4885, 5143, 5192, 5210, 5257, + 5261, 5459, 5651, 5809, 5830, 5986, 6020, 6076, 6253, 6269, 6410, 6436, + 6467, 6475, 6509, 6556, 6611, 6674, 6685, 6689, 6691, 6695, 6698, 6701 +}; + +const int dvbt2_pilotgenerator_cc_impl::p2_papr_map_16k[144] = { + 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119, 121, + 122, 125, 128, 131, 134, 137, 140, 143, 161, 223, 230, 398, + 482, 497, 733, 809, 850, 922, 962, 1196, 1256, 1262, 1559, 1691, + 1801, 1819, 1937, 2005, 2095, 2308, 2383, 2408, 2425, 2428, 2479, 2579, + 2893, 2902, 3086, 3554, 4085, 4127, 4139, 4151, 4163, 4373, 4400, 4576, + 4609, 4952, 4961, 5444, 5756, 5800, 6094, 6208, 6658, 6673, 6799, 7208, + 7682, 8101, 8135, 8230, 8692, 8788, 8933, 9323, 9449, 9478, 9868, 10192, + 10261, 10430, 10630, 10685, 10828, 10915, 10930, 10942, 11053, 11185, 11324, 11369, + 11468, 11507, 11542, 11561, 11794, 11912, 11974, 11978, 12085, 12179, 12193, 12269, + 12311, 12758, 12767, 12866, 12938, 12962, 12971, 13099, 13102, 13105, 13120, 13150, + 13280, 13282, 13309, 13312, 13321, 13381, 13402, 13448, 13456, 13462, 13463, 13466, + 13478, 13492, 13495, 13498, 13501, 13502, 13504, 13507, 13510, 13513, 13514, 13516 +}; + +const int dvbt2_pilotgenerator_cc_impl::p2_papr_map_32k[288] = { + 104, 106, 107, 109, 110, 112, 113, 115, 118, 121, 124, 127, + 130, 133, 136, 139, 142, 145, 148, 151, 154, 157, 160, 163, + 166, 169, 172, 175, 178, 181, 184, 187, 190, 193, 196, 199, + 202, 205, 208, 211, 404, 452, 455, 467, 509, 539, 568, 650, + 749, 1001, 1087, 1286, 1637, 1823, 1835, 1841, 1889, 1898, 1901, 2111, + 2225, 2252, 2279, 2309, 2315, 2428, 2452, 2497, 2519, 3109, 3154, 3160, + 3170, 3193, 3214, 3298, 3331, 3346, 3388, 3397, 3404, 3416, 3466, 3491, + 3500, 3572, 4181, 4411, 4594, 4970, 5042, 5069, 5081, 5086, 5095, 5104, + 5320, 5465, 5491, 6193, 6541, 6778, 6853, 6928, 6934, 7030, 7198, 7351, + 7712, 7826, 7922, 8194, 8347, 8350, 8435, 8518, 8671, 8861, 8887, 9199, + 9980, 10031, 10240, 10519, 10537, 10573, 10589, 11078, 11278, 11324, 11489, 11642, + 12034, 12107, 12184, 12295, 12635, 12643, 12941, 12995, 13001, 13133, 13172, 13246, + 13514, 13522, 13939, 14362, 14720, 14926, 15338, 15524, 15565, 15662, 15775, 16358, + 16613, 16688, 16760, 17003, 17267, 17596, 17705, 18157, 18272, 18715, 18994, 19249, + 19348, 20221, 20855, 21400, 21412, 21418, 21430, 21478, 21559, 21983, 21986, 22331, + 22367, 22370, 22402, 22447, 22535, 22567, 22571, 22660, 22780, 22802, 22844, 22888, + 22907, 23021, 23057, 23086, 23213, 23240, 23263, 23333, 23369, 23453, 23594, 24143, + 24176, 24319, 24325, 24565, 24587, 24641, 24965, 25067, 25094, 25142, 25331, 25379, + 25465, 25553, 25589, 25594, 25655, 25664, 25807, 25823, 25873, 25925, 25948, 26002, + 26008, 26102, 26138, 26141, 26377, 26468, 26498, 26510, 26512, 26578, 26579, 26588, + 26594, 26597, 26608, 26627, 26642, 26767, 26776, 26800, 26876, 26882, 26900, 26917, + 26927, 26951, 26957, 26960, 26974, 26986, 27010, 27013, 27038, 27044, 27053, 27059, + 27061, 27074, 27076, 27083, 27086, 27092, 27094, 27098, 27103, 27110, 27115, 27118, + 27119, 27125, 27128, 27130, 27133, 27134, 27140, 27143, 27145, 27146, 27148, 27149 +}; + +const int dvbt2_pilotgenerator_cc_impl::tr_papr_map_1k[10] = { 109, 117, 122, 129, 139, + 321, 350, 403, 459, 465 }; + +const int dvbt2_pilotgenerator_cc_impl::tr_papr_map_2k[18] = { + 250, 404, 638, 677, 700, 712, 755, 952, 1125, + 1145, 1190, 1276, 1325, 1335, 1406, 1431, 1472, 1481 +}; + +const int dvbt2_pilotgenerator_cc_impl::tr_papr_map_4k[36] = { + 170, 219, 405, 501, 597, 654, 661, 745, 995, 1025, 1319, 1361, + 1394, 1623, 1658, 1913, 1961, 1971, 2106, 2117, 2222, 2228, 2246, 2254, + 2361, 2468, 2469, 2482, 2637, 2679, 2708, 2825, 2915, 2996, 3033, 3119 +}; + +const int dvbt2_pilotgenerator_cc_impl::tr_papr_map_8k[72] = { + 111, 115, 123, 215, 229, 392, 613, 658, 831, 842, 997, 1503, + 1626, 1916, 1924, 1961, 2233, 2246, 2302, 2331, 2778, 2822, 2913, 2927, + 2963, 2994, 3087, 3162, 3226, 3270, 3503, 3585, 3711, 3738, 3874, 3902, + 4013, 4017, 4186, 4253, 4292, 4339, 4412, 4453, 4669, 4910, 5015, 5030, + 5061, 5170, 5263, 5313, 5360, 5384, 5394, 5493, 5550, 5847, 5901, 5999, + 6020, 6165, 6174, 6227, 6245, 6314, 6316, 6327, 6503, 6507, 6545, 6565 +}; + +const int dvbt2_pilotgenerator_cc_impl::tr_papr_map_16k[144] = { + 109, 122, 139, 171, 213, 214, 251, 585, 763, 1012, 1021, 1077, + 1148, 1472, 1792, 1883, 1889, 1895, 1900, 2013, 2311, 2582, 2860, 2980, + 3011, 3099, 3143, 3171, 3197, 3243, 3257, 3270, 3315, 3436, 3470, 3582, + 3681, 3712, 3767, 3802, 3979, 4045, 4112, 4197, 4409, 4462, 4756, 5003, + 5007, 5036, 5246, 5483, 5535, 5584, 5787, 5789, 6047, 6349, 6392, 6498, + 6526, 6542, 6591, 6680, 6688, 6785, 6860, 7134, 7286, 7387, 7415, 7417, + 7505, 7526, 7541, 7551, 7556, 7747, 7814, 7861, 7880, 8045, 8179, 8374, + 8451, 8514, 8684, 8698, 8804, 8924, 9027, 9113, 9211, 9330, 9479, 9482, + 9487, 9619, 9829, 10326, 10394, 10407, 10450, 10528, 10671, 10746, 10774, 10799, + 10801, 10912, 11113, 11128, 11205, 11379, 11459, 11468, 11658, 11776, 11791, 11953, + 11959, 12021, 12028, 12135, 12233, 12407, 12441, 12448, 12470, 12501, 12548, 12642, + 12679, 12770, 12788, 12899, 12923, 12939, 13050, 13103, 13147, 13256, 13339, 13409 +}; + +const int dvbt2_pilotgenerator_cc_impl::tr_papr_map_32k[288] = { + 164, 320, 350, 521, 527, 578, 590, 619, 635, 651, 662, 664, + 676, 691, 723, 940, 1280, 1326, 1509, 1520, 1638, 1682, 1805, 1833, + 1861, 1891, 1900, 1902, 1949, 1967, 1978, 1998, 2006, 2087, 2134, 2165, + 2212, 2427, 2475, 2555, 2874, 3067, 3091, 3101, 3146, 3188, 3322, 3353, + 3383, 3503, 3523, 3654, 3856, 4150, 4158, 4159, 4174, 4206, 4318, 4417, + 4629, 4631, 4875, 5104, 5106, 5111, 5131, 5145, 5146, 5177, 5181, 5246, + 5269, 5458, 5474, 5500, 5509, 5579, 5810, 5823, 6058, 6066, 6098, 6411, + 6741, 6775, 6932, 7103, 7258, 7303, 7413, 7586, 7591, 7634, 7636, 7655, + 7671, 7675, 7756, 7760, 7826, 7931, 7937, 7951, 8017, 8061, 8071, 8117, + 8317, 8321, 8353, 8806, 9010, 9237, 9427, 9453, 9469, 9525, 9558, 9574, + 9584, 9820, 9973, 10011, 10043, 10064, 10066, 10081, 10136, 10193, 10249, 10511, + 10537, 11083, 11350, 11369, 11428, 11622, 11720, 11924, 11974, 11979, 12944, 12945, + 13009, 13070, 13110, 13257, 13364, 13370, 13449, 13503, 13514, 13520, 13583, 13593, + 13708, 13925, 14192, 14228, 14235, 14279, 14284, 14370, 14393, 14407, 14422, 14471, + 14494, 14536, 14617, 14829, 14915, 15094, 15138, 15155, 15170, 15260, 15283, 15435, + 15594, 15634, 15810, 16178, 16192, 16196, 16297, 16366, 16498, 16501, 16861, 16966, + 17039, 17057, 17240, 17523, 17767, 18094, 18130, 18218, 18344, 18374, 18657, 18679, + 18746, 18772, 18779, 18786, 18874, 18884, 18955, 19143, 19497, 19534, 19679, 19729, + 19738, 19751, 19910, 19913, 20144, 20188, 20194, 20359, 20490, 20500, 20555, 20594, + 20633, 20656, 21099, 21115, 21597, 22139, 22208, 22244, 22530, 22547, 22562, 22567, + 22696, 22757, 22798, 22854, 22877, 23068, 23102, 23141, 23154, 23170, 23202, 23368, + 23864, 24057, 24215, 24219, 24257, 24271, 24325, 24447, 25137, 25590, 25702, 25706, + 25744, 25763, 25811, 25842, 25853, 25954, 26079, 26158, 26285, 26346, 26488, 26598, + 26812, 26845, 26852, 26869, 26898, 26909, 26927, 26931, 26946, 26975, 26991, 27039 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp1_cp1[20] = { 116, 255, 285, 430, 518, + 546, 601, 646, 744, 1662, + 1893, 1995, 2322, 3309, 3351, + 3567, 3813, 4032, 5568, 5706 }; + +const int dvbt2_pilotgenerator_cc_impl::pp1_cp2[25] = { + 1022, 1224, 1302, 1371, 1495, 2261, 2551, 2583, 2649, 2833, 2925, 3192, 4266, + 5395, 5710, 5881, 8164, 10568, 11069, 11560, 12631, 12946, 13954, 16745, 21494 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp1_cp5[44] = { + 1369, 7013, 7215, 7284, 7649, 7818, 8025, 8382, 8733, 8880, 9249, + 9432, 9771, 10107, 10110, 10398, 10659, 10709, 10785, 10872, 11115, 11373, + 11515, 11649, 11652, 12594, 12627, 12822, 12984, 15760, 16612, 17500, 18358, + 19078, 19930, 20261, 20422, 22124, 22867, 23239, 24934, 25879, 26308, 26674 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp2_cp1[20] = { 116, 318, 390, 430, 474, + 518, 601, 646, 708, 726, + 1752, 1758, 1944, 2100, 2208, + 2466, 3792, 5322, 5454, 5640 }; + +const int dvbt2_pilotgenerator_cc_impl::pp2_cp2[22] = { + 1022, 1092, 1369, 1416, 1446, 1495, 2598, 2833, 2928, 3144, 4410, + 4800, 5710, 5881, 6018, 6126, 10568, 11515, 12946, 13954, 15559, 16681 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp2_cp3[2] = { 2261, 8164 }; + +const int dvbt2_pilotgenerator_cc_impl::pp2_cp4[2] = { 10709, 19930 }; + +const int dvbt2_pilotgenerator_cc_impl::pp2_cp5[41] = { + 6744, 7013, 7020, 7122, 7308, 7649, 7674, 7752, 7764, 8154, 8190, + 8856, 8922, 9504, 9702, 9882, 9924, 10032, 10092, 10266, 10302, 10494, + 10530, 10716, 11016, 11076, 11160, 11286, 11436, 11586, 12582, 13002, 17500, + 18358, 19078, 22124, 23239, 24073, 24934, 25879, 26308 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp2_cp6[88] = { + 13164, 13206, 13476, 13530, 13536, 13764, 13848, 13938, 13968, 14028, 14190, + 14316, 14526, 14556, 14562, 14658, 14910, 14946, 15048, 15186, 15252, 15468, + 15540, 15576, 15630, 15738, 15840, 16350, 16572, 16806, 17028, 17064, 17250, + 17472, 17784, 17838, 18180, 18246, 18480, 18900, 18960, 19254, 19482, 19638, + 19680, 20082, 20310, 20422, 20454, 20682, 20874, 21240, 21284, 21444, 21450, + 21522, 21594, 21648, 21696, 21738, 22416, 22824, 23016, 23124, 23196, 23238, + 23316, 23418, 23922, 23940, 24090, 24168, 24222, 24324, 24342, 24378, 24384, + 24540, 24744, 24894, 24990, 25002, 25194, 25218, 25260, 25566, 26674, 26944 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp3_cp1[22] = { + 116, 318, 342, 426, 430, 518, 582, 601, 646, 816, 1758, + 1764, 2400, 3450, 3504, 3888, 4020, 4932, 5154, 5250, 5292, 5334 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp3_cp2[20] = { + 1022, 1495, 2261, 2551, 2802, 2820, 2833, 2922, 4422, 4752, + 4884, 5710, 8164, 10568, 11069, 11560, 12631, 12946, 16745, 21494 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp3_cp3[1] = { 13954 }; + +const int dvbt2_pilotgenerator_cc_impl::pp3_cp5[44] = { + 1369, 5395, 5881, 6564, 6684, 7013, 7649, 8376, 8544, 8718, 8856, + 9024, 9132, 9498, 9774, 9840, 10302, 10512, 10566, 10770, 10914, 11340, + 11418, 11730, 11742, 12180, 12276, 12474, 12486, 15760, 16612, 17500, 18358, + 19078, 19930, 20261, 20422, 22124, 22867, 23239, 24934, 25879, 26308, 26674 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp3_cp6[49] = { + 13320, 13350, 13524, 13566, 13980, 14148, 14340, 14964, 14982, 14994, + 15462, 15546, 15984, 16152, 16314, 16344, 16488, 16614, 16650, 16854, + 17028, 17130, 17160, 17178, 17634, 17844, 17892, 17958, 18240, 18270, + 18288, 18744, 18900, 18930, 18990, 19014, 19170, 19344, 19662, 19698, + 20022, 20166, 20268, 20376, 20466, 20550, 20562, 20904, 21468 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp4_cp1[20] = { 108, 116, 144, 264, 288, + 430, 518, 564, 636, 646, + 828, 2184, 3360, 3396, 3912, + 4032, 4932, 5220, 5676, 5688 }; + +const int dvbt2_pilotgenerator_cc_impl::pp4_cp2[23] = { + 601, 1022, 1092, 1164, 1369, 1392, 1452, 1495, 2261, 2580, 2833, 3072, + 4320, 4452, 5710, 5881, 6048, 10568, 11515, 12946, 13954, 15559, 16681 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp4_cp3[1] = { 8164 }; + +const int dvbt2_pilotgenerator_cc_impl::pp4_cp4[2] = { 10709, 19930 }; + +const int dvbt2_pilotgenerator_cc_impl::pp4_cp5[44] = { + 6612, 6708, 7013, 7068, 7164, 7224, 7308, 7464, 7649, 7656, 7716, + 7752, 7812, 7860, 8568, 8808, 8880, 9072, 9228, 9516, 9696, 9996, + 10560, 10608, 10728, 11148, 11232, 11244, 11496, 11520, 11664, 11676, 11724, + 11916, 17500, 18358, 19078, 21284, 22124, 23239, 24073, 24934, 25879, 26308 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp4_cp6[86] = { + 13080, 13152, 13260, 13380, 13428, 13572, 13884, 13956, 14004, 14016, 14088, + 14232, 14304, 14532, 14568, 14760, 14940, 15168, 15288, 15612, 15684, 15888, + 16236, 16320, 16428, 16680, 16812, 16908, 17184, 17472, 17508, 17580, 17892, + 17988, 18000, 18336, 18480, 18516, 19020, 19176, 19188, 19320, 19776, 19848, + 20112, 20124, 20184, 20388, 20532, 20556, 20676, 20772, 21156, 21240, 21276, + 21336, 21384, 21816, 21888, 22068, 22092, 22512, 22680, 22740, 22800, 22836, + 22884, 23304, 23496, 23568, 23640, 24120, 24168, 24420, 24444, 24456, 24492, + 24708, 24864, 25332, 25536, 25764, 25992, 26004, 26674, 26944 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp5_cp1[19] = { 108, 116, 228, 430, 518, + 601, 646, 804, 1644, 1680, + 1752, 1800, 1836, 3288, 3660, + 4080, 4932, 4968, 5472 }; + +const int dvbt2_pilotgenerator_cc_impl::pp5_cp2[23] = { + 852, 1022, 1495, 2508, 2551, 2604, 2664, 2736, 2833, 3120, 4248, 4512, + 4836, 5710, 5940, 6108, 8164, 10568, 11069, 11560, 12946, 13954, 21494 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp5_cp3[3] = { 648, 4644, 16745 }; + +const int dvbt2_pilotgenerator_cc_impl::pp5_cp4[1] = { 12631 }; + +const int dvbt2_pilotgenerator_cc_impl::pp5_cp5[44] = { + 1369, 2261, 5395, 5881, 6552, 6636, 6744, 6900, 7032, 7296, 7344, + 7464, 7644, 7649, 7668, 7956, 8124, 8244, 8904, 8940, 8976, 9216, + 9672, 9780, 10224, 10332, 10709, 10776, 10944, 11100, 11292, 11364, 11496, + 11532, 11904, 12228, 12372, 12816, 15760, 16612, 17500, 19078, 22867, 25879 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp6_cp5[88] = { + 116, 384, 408, 518, 601, 646, 672, 960, 1022, 1272, 1344, + 1369, 1495, 1800, 2040, 2261, 2833, 3192, 3240, 3768, 3864, 3984, + 4104, 4632, 4728, 4752, 4944, 5184, 5232, 5256, 5376, 5592, 5616, + 5710, 5808, 5881, 6360, 6792, 6960, 7013, 7272, 7344, 7392, 7536, + 7649, 7680, 7800, 8064, 8160, 8164, 8184, 8400, 8808, 8832, 9144, + 9648, 9696, 9912, 10008, 10200, 10488, 10568, 10656, 10709, 11088, 11160, + 11515, 11592, 12048, 12264, 12288, 12312, 12552, 12672, 12946, 13954, 15559, + 16681, 17500, 19078, 20422, 21284, 22124, 23239, 24934, 25879, 26308, 26674 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp6_cp6[88] = { + 13080, 13368, 13464, 13536, 13656, 13728, 13824, 14112, 14232, 14448, 14472, + 14712, 14808, 14952, 15000, 15336, 15360, 15408, 15600, 15624, 15648, 16128, + 16296, 16320, 16416, 16536, 16632, 16824, 16848, 17184, 17208, 17280, 17352, + 17520, 17664, 17736, 17784, 18048, 18768, 18816, 18840, 19296, 19392, 19584, + 19728, 19752, 19776, 20136, 20184, 20208, 20256, 21096, 21216, 21360, 21408, + 21744, 21768, 22200, 22224, 22320, 22344, 22416, 22848, 22968, 23016, 23040, + 23496, 23688, 23904, 24048, 24168, 24360, 24408, 24984, 25152, 25176, 25224, + 25272, 25344, 25416, 25488, 25512, 25536, 25656, 25680, 25752, 25992, 26016 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp7_cp1[15] = { 264, 360, 1848, 2088, 2112, + 2160, 2256, 2280, 3936, 3960, + 3984, 5016, 5136, 5208, 5664 }; + +const int dvbt2_pilotgenerator_cc_impl::pp7_cp2[30] = { + 116, 430, 518, 601, 646, 1022, 1296, 1368, 1369, 1495, + 2833, 3024, 4416, 4608, 4776, 5710, 5881, 6168, 7013, 8164, + 10568, 10709, 11515, 12946, 15559, 23239, 24934, 25879, 26308, 26674 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp7_cp3[5] = { 456, 480, 2261, 6072, 17500 }; + +const int dvbt2_pilotgenerator_cc_impl::pp7_cp4[3] = { 1008, 6120, 13954 }; + +const int dvbt2_pilotgenerator_cc_impl::pp7_cp5[35] = { + 6984, 7032, 7056, 7080, 7152, 7320, 7392, 7536, 7649, 7704, 7728, 7752, + 8088, 8952, 9240, 9288, 9312, 9480, 9504, 9840, 9960, 10320, 10368, 10728, + 10752, 11448, 11640, 11688, 11808, 12192, 12240, 12480, 12816, 16681, 22124 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp7_cp6[92] = { + 13416, 13440, 13536, 13608, 13704, 13752, 14016, 14040, 14112, 14208, 14304, 14376, + 14448, 14616, 14712, 14760, 14832, 14976, 15096, 15312, 15336, 15552, 15816, 15984, + 16224, 16464, 16560, 17088, 17136, 17256, 17352, 17400, 17448, 17544, 17928, 18048, + 18336, 18456, 18576, 18864, 19032, 19078, 19104, 19320, 19344, 19416, 19488, 19920, + 19930, 19992, 20424, 20664, 20808, 21168, 21284, 21360, 21456, 21816, 22128, 22200, + 22584, 22608, 22824, 22848, 22944, 22992, 23016, 23064, 23424, 23448, 23472, 23592, + 24192, 24312, 24360, 24504, 24552, 24624, 24648, 24672, 24768, 24792, 25080, 25176, + 25224, 25320, 25344, 25584, 25680, 25824, 26064, 26944 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp8_cp4[47] = { + 116, 132, 180, 430, 518, 601, 646, 1022, 1266, 1369, 1495, 2261, + 2490, 2551, 2712, 2833, 3372, 3438, 4086, 4098, 4368, 4572, 4614, 4746, + 4830, 4968, 5395, 5710, 5881, 7649, 8164, 10568, 11069, 11560, 12631, 12946, + 13954, 15760, 16612, 16745, 17500, 19078, 19930, 21494, 22867, 25879, 26308 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp8_cp5[39] = { + 6720, 6954, 7013, 7026, 7092, 7512, 7536, 7596, 7746, 7758, + 7818, 7986, 8160, 8628, 9054, 9096, 9852, 9924, 10146, 10254, + 10428, 10704, 11418, 11436, 11496, 11550, 11766, 11862, 12006, 12132, + 12216, 12486, 12762, 18358, 20261, 20422, 22124, 23239, 24934 +}; + +const int dvbt2_pilotgenerator_cc_impl::pp8_cp6[89] = { + 10709, 11515, 13254, 13440, 13614, 13818, 14166, 14274, 14304, 14364, 14586, 14664, + 15030, 15300, 15468, 15474, 15559, 15732, 15774, 16272, 16302, 16428, 16500, 16662, + 16681, 16872, 17112, 17208, 17862, 18036, 18282, 18342, 18396, 18420, 18426, 18732, + 19050, 19296, 19434, 19602, 19668, 19686, 19728, 19938, 20034, 21042, 21120, 21168, + 21258, 21284, 21528, 21594, 21678, 21930, 21936, 21990, 22290, 22632, 22788, 23052, + 23358, 23448, 23454, 23706, 23772, 24048, 24072, 24073, 24222, 24384, 24402, 24444, + 24462, 24600, 24738, 24804, 24840, 24918, 24996, 25038, 25164, 25314, 25380, 25470, + 25974, 26076, 26674, 26753, 26944 +}; - // Tell runtime system how many output items we produced. - return noutput_items; - } +const int dvbt2_pilotgenerator_cc_impl::pp2_8k[4] = { 6820, 6847, 6869, 6898 }; + +const int dvbt2_pilotgenerator_cc_impl::pp3_8k[2] = { 6820, 6869 }; + +const int dvbt2_pilotgenerator_cc_impl::pp4_8k[2] = { 6820, 6869 }; + +const int dvbt2_pilotgenerator_cc_impl::pp7_8k[5] = { 6820, 6833, 6869, 6887, 6898 }; + +const int dvbt2_pilotgenerator_cc_impl::pp8_8k[5] = { 6820, 6833, 6869, 6887, 6898 }; + +const int dvbt2_pilotgenerator_cc_impl::pp1_16k[4] = { 3636, 13724, 13790, 13879 }; + +const int dvbt2_pilotgenerator_cc_impl::pp2_16k[2] = { 13636, 13790 }; + +const int dvbt2_pilotgenerator_cc_impl::pp3_16k[2] = { 13636, 13790 }; + +const int dvbt2_pilotgenerator_cc_impl::pp4_16k[2] = { 13636, 13790 }; + +const int dvbt2_pilotgenerator_cc_impl::pp5_16k[2] = { 13636, 13790 }; + +const int dvbt2_pilotgenerator_cc_impl::pp6_16k[2] = { 13636, 13790 }; + +const int dvbt2_pilotgenerator_cc_impl::pp7_16k[3] = { 13636, 13724, 13879 }; + +const int dvbt2_pilotgenerator_cc_impl::pp8_16k[3] = { 13636, 13724, 13879 }; + +const int dvbt2_pilotgenerator_cc_impl::pp2_32k[2] = { 27268, 27688 }; + +const int dvbt2_pilotgenerator_cc_impl::pp4_32k[2] = { 27268, 27688 }; + +const int dvbt2_pilotgenerator_cc_impl::pp6_32k[4] = { 27268, 27448, 27688, 27758 }; + +const int dvbt2_pilotgenerator_cc_impl::pp7_32k[2] = { 27268, 27688 }; + +const int dvbt2_pilotgenerator_cc_impl::pp8_32k[6] = { 27268, 27368, 27448, + 27580, 27688, 27758 }; - const unsigned char dvbt2_pilotgenerator_cc_impl::pn_sequence_table[CHIPS / 8] = - { - 0x4D, 0xC2, 0xAF, 0x7B, 0xD8, 0xC3, 0xC9, 0xA1, 0xE7, 0x6C, 0x9A, 0x09, 0x0A, 0xF1, 0xC3, 0x11, - 0x4F, 0x07, 0xFC, 0xA2, 0x80, 0x8E, 0x94, 0x62, 0xE9, 0xAD, 0x7B, 0x71, 0x2D, 0x6F, 0x4A, 0xC8, - 0xA5, 0x9B, 0xB0, 0x69, 0xCC, 0x50, 0xBF, 0x11, 0x49, 0x92, 0x7E, 0x6B, 0xB1, 0xC9, 0xFC, 0x8C, - 0x18, 0xBB, 0x94, 0x9B, 0x30, 0xCD, 0x09, 0xDD, 0xD7, 0x49, 0xE7, 0x04, 0xF5, 0x7B, 0x41, 0xDE, - 0xC7, 0xE7, 0xB1, 0x76, 0xE1, 0x2C, 0x56, 0x57, 0x43, 0x2B, 0x51, 0xB0, 0xB8, 0x12, 0xDF, 0x0E, - 0x14, 0x88, 0x7E, 0x24, 0xD8, 0x0C, 0x97, 0xF0, 0x93, 0x74, 0xAD, 0x76, 0x27, 0x0E, 0x58, 0xFE, - 0x17, 0x74, 0xB2, 0x78, 0x1D, 0x8D, 0x38, 0x21, 0xE3, 0x93, 0xF2, 0xEA, 0x0F, 0xFD, 0x4D, 0x24, - 0xDE, 0x20, 0xC0, 0x5D, 0x0B, 0xA1, 0x70, 0x3D, 0x10, 0xE5, 0x2D, 0x61, 0xE0, 0x13, 0xD8, 0x37, - 0xAA, 0x62, 0xD0, 0x07, 0xCC, 0x2F, 0xD7, 0x6D, 0x23, 0xA3, 0xE1, 0x25, 0xBD, 0xE8, 0xA9, 0xA7, - 0xC0, 0x2A, 0x98, 0xB7, 0x02, 0x51, 0xC5, 0x56, 0xF6, 0x34, 0x1E, 0xBD, 0xEC, 0xB8, 0x01, 0xAA, - 0xD5, 0xD9, 0xFB, 0x8C, 0xBE, 0xA8, 0x0B, 0xB6, 0x19, 0x09, 0x65, 0x27, 0xA8, 0xC4, 0x75, 0xB3, - 0xD8, 0xDB, 0x28, 0xAF, 0x85, 0x43, 0xA0, 0x0E, 0xC3, 0x48, 0x0D, 0xFF, 0x1E, 0x2C, 0xDA, 0x9F, - 0x98, 0x5B, 0x52, 0x3B, 0x87, 0x90, 0x07, 0xAA, 0x5D, 0x0C, 0xE5, 0x8D, 0x21, 0xB1, 0x86, 0x31, - 0x00, 0x66, 0x17, 0xF6, 0xF7, 0x69, 0xEB, 0x94, 0x7F, 0x92, 0x4E, 0xA5, 0x16, 0x1E, 0xC2, 0xC0, - 0x48, 0x8B, 0x63, 0xED, 0x79, 0x93, 0xBA, 0x8E, 0xF4, 0xE5, 0x52, 0xFA, 0x32, 0xFC, 0x3F, 0x1B, - 0xDB, 0x19, 0x92, 0x39, 0x02, 0xBC, 0xBB, 0xE5, 0xDD, 0xAB, 0xB8, 0x24, 0x12, 0x6E, 0x08, 0x45, - 0x9C, 0xA6, 0xCF, 0xA0, 0x26, 0x7E, 0x52, 0x94, 0xA9, 0x8C, 0x63, 0x25, 0x69, 0x79, 0x1E, 0x60, - 0xEF, 0x65, 0x9A, 0xEE, 0x95, 0x18, 0xCD, 0xF0, 0x8D, 0x87, 0x83, 0x36, 0x90, 0xC1, 0xB7, 0x91, - 0x83, 0xED, 0x12, 0x7E, 0x53, 0x36, 0x0C, 0xD8, 0x65, 0x14, 0x85, 0x9A, 0x28, 0xB5, 0x49, 0x4F, - 0x51, 0xAA, 0x48, 0x82, 0x41, 0x9A, 0x25, 0xA2, 0xD0, 0x1A, 0x5F, 0x47, 0xAA, 0x27, 0x30, 0x1E, - 0x79, 0xA5, 0x37, 0x0C, 0xCB, 0x3E, 0x19, 0x7F - }; - - const int dvbt2_pilotgenerator_cc_impl::p2_papr_map_1k[10] = - { - 116, 130, 134, 157, 182, 256, 346, 478, 479, 532 - }; - - const int dvbt2_pilotgenerator_cc_impl::p2_papr_map_2k[18] = - { - 113, 124, 262, 467, 479, 727, 803, 862, 910, 946, - 980, 1201, 1322, 1342, 1396, 1397, 1562, 1565 - }; - - const int dvbt2_pilotgenerator_cc_impl::p2_papr_map_4k[36] = - { - 104, 116, 119, 163, 170, 173, 664, 886, 1064, 1151, 1196, 1264, 1531, - 1736, 1951, 1960, 2069, 2098, 2311, 2366, 2473, 2552, 2584, 2585, 2645, - 2774, 2846, 2882, 3004, 3034, 3107, 3127, 3148, 3191, 3283, 3289 - }; - - const int dvbt2_pilotgenerator_cc_impl::p2_papr_map_8k[72] = - { - 106, 109, 110, 112, 115, 118, 133, 142, 163, 184, 206, 247, 445, 461, - 503, 565, 602, 656, 766, 800, 922, 1094, 1108, 1199, 1258, 1726, 1793, - 1939, 2128, 2714, 3185, 3365, 3541, 3655, 3770, 3863, 4066, 4190, 4282, - 4565, 4628, 4727, 4882, 4885, 5143, 5192, 5210, 5257, 5261, 5459, 5651, - 5809, 5830, 5986, 6020, 6076, 6253, 6269, 6410, 6436, 6467, 6475, 6509, - 6556, 6611, 6674, 6685, 6689, 6691, 6695, 6698, 6701 - }; - - const int dvbt2_pilotgenerator_cc_impl::p2_papr_map_16k[144] = - { - 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119, 121, 122, 125, 128, - 131, 134, 137, 140, 143, 161, 223, 230, 398, 482, 497, 733, 809, 850, 922, - 962, 1196, 1256, 1262, 1559, 1691, 1801, 1819, 1937, 2005, 2095, 2308, 2383, - 2408, 2425, 2428, 2479, 2579, 2893, 2902, 3086, 3554, 4085, 4127, 4139, 4151, - 4163, 4373, 4400, 4576, 4609, 4952, 4961, 5444, 5756, 5800, 6094, 6208, 6658, - 6673, 6799, 7208, 7682, 8101, 8135, 8230, 8692, 8788, 8933, 9323, 9449, 9478, - 9868, 10192, 10261, 10430, 10630, 10685, 10828, 10915, 10930, 10942, 11053, - 11185, 11324, 11369, 11468, 11507, 11542, 11561, 11794, 11912, 11974, 11978, - 12085, 12179, 12193, 12269, 12311, 12758, 12767, 12866, 12938, 12962, 12971, - 13099, 13102, 13105, 13120, 13150, 13280, 13282, 13309, 13312, 13321, 13381, - 13402, 13448, 13456, 13462, 13463, 13466, 13478, 13492, 13495, 13498, 13501, - 13502, 13504, 13507, 13510, 13513, 13514, 13516 - }; - - const int dvbt2_pilotgenerator_cc_impl::p2_papr_map_32k[288] = - { - 104, 106, 107, 109, 110, 112, 113, 115, 118, 121, 124, 127, 130, 133, 136, - 139, 142, 145, 148, 151, 154, 157, 160, 163, 166, 169, 172, 175, 178, 181, - 184, 187, 190, 193, 196, 199, 202, 205, 208, 211, 404, 452, 455, 467, 509, - 539, 568, 650, 749, 1001, 1087, 1286, 1637, 1823, 1835, 1841, 1889, 1898, - 1901, 2111, 2225, 2252, 2279, 2309, 2315, 2428, 2452, 2497, 2519, 3109, 3154, - 3160, 3170, 3193, 3214, 3298, 3331, 3346, 3388, 3397, 3404, 3416, 3466, 3491, - 3500, 3572, 4181, 4411, 4594, 4970, 5042, 5069, 5081, 5086, 5095, 5104, 5320, - 5465, 5491, 6193, 6541, 6778, 6853, 6928, 6934, 7030, 7198, 7351, 7712, 7826, - 7922, 8194, 8347, 8350, 8435, 8518, 8671, 8861, 8887, 9199, 9980, 10031, 10240, - 10519, 10537, 10573, 10589, 11078, 11278, 11324, 11489, 11642, 12034, 12107, 12184, - 12295, 12635, 12643, 12941, 12995, 13001, 13133, 13172, 13246, 13514, 13522, 13939, - 14362, 14720, 14926, 15338, 15524, 15565, 15662, 15775, 16358, 16613, 16688, 16760, - 17003, 17267, 17596, 17705, 18157, 18272, 18715, 18994, 19249, 19348, 20221, 20855, - 21400, 21412, 21418, 21430, 21478, 21559, 21983, 21986, 22331, 22367, 22370, 22402, - 22447, 22535, 22567, 22571, 22660, 22780, 22802, 22844, 22888, 22907, 23021, 23057, - 23086, 23213, 23240, 23263, 23333, 23369, 23453, 23594, 24143, 24176, 24319, 24325, - 24565, 24587, 24641, 24965, 25067, 25094, 25142, 25331, 25379, 25465, 25553, 25589, - 25594, 25655, 25664, 25807, 25823, 25873, 25925, 25948, 26002, 26008, 26102, 26138, - 26141, 26377, 26468, 26498, 26510, 26512, 26578, 26579, 26588, 26594, 26597, 26608, - 26627, 26642, 26767, 26776, 26800, 26876, 26882, 26900, 26917, 26927, 26951, 26957, - 26960, 26974, 26986, 27010, 27013, 27038, 27044, 27053, 27059, 27061, 27074, 27076, - 27083, 27086, 27092, 27094, 27098, 27103, 27110, 27115, 27118, 27119, 27125, 27128, - 27130, 27133, 27134, 27140, 27143, 27145, 27146, 27148, 27149 - }; - - const int dvbt2_pilotgenerator_cc_impl::tr_papr_map_1k[10] = - { - 109, 117, 122, 129, 139, 321, 350, 403, 459, 465 - }; - - const int dvbt2_pilotgenerator_cc_impl::tr_papr_map_2k[18] = - { - 250, 404, 638, 677, 700, 712, 755, 952, 1125, 1145, - 1190, 1276, 1325, 1335, 1406, 1431, 1472, 1481 - }; - - const int dvbt2_pilotgenerator_cc_impl::tr_papr_map_4k[36] = - { - 170, 219, 405, 501, 597, 654, 661, 745, 995, 1025, 1319, 1361, 1394, - 1623, 1658, 1913, 1961, 1971, 2106, 2117, 2222, 2228, 2246, 2254, 2361, - 2468, 2469, 2482, 2637, 2679, 2708, 2825, 2915, 2996, 3033, 3119 - }; - - const int dvbt2_pilotgenerator_cc_impl::tr_papr_map_8k[72] = - { - 111, 115, 123, 215, 229, 392, 613, 658, 831, 842, 997, 1503, 1626, 1916, - 1924, 1961, 2233, 2246, 2302, 2331, 2778, 2822, 2913, 2927, 2963, 2994, - 3087, 3162, 3226, 3270, 3503, 3585, 3711, 3738, 3874, 3902, 4013, 4017, - 4186, 4253, 4292, 4339, 4412, 4453, 4669, 4910, 5015, 5030, 5061, 5170, - 5263, 5313, 5360, 5384, 5394, 5493, 5550, 5847, 5901, 5999, 6020, 6165, - 6174, 6227, 6245, 6314, 6316, 6327, 6503, 6507, 6545, 6565 - }; - - const int dvbt2_pilotgenerator_cc_impl::tr_papr_map_16k[144] = - { - 109, 122, 139, 171, 213, 214, 251, 585, 763, 1012, 1021, 1077, 1148, 1472, - 1792, 1883, 1889, 1895, 1900, 2013, 2311, 2582, 2860, 2980, 3011, 3099, 3143, - 3171, 3197, 3243, 3257, 3270, 3315, 3436, 3470, 3582, 3681, 3712, 3767, 3802, - 3979, 4045, 4112, 4197, 4409, 4462, 4756, 5003, 5007, 5036, 5246, 5483, 5535, - 5584, 5787, 5789, 6047, 6349, 6392, 6498, 6526, 6542, 6591, 6680, 6688, 6785, - 6860, 7134, 7286, 7387, 7415, 7417, 7505, 7526, 7541, 7551, 7556, 7747, 7814, - 7861, 7880, 8045, 8179, 8374, 8451, 8514, 8684, 8698, 8804, 8924, 9027, 9113, - 9211, 9330, 9479, 9482, 9487, 9619, 9829, 10326, 10394, 10407, 10450, 10528, - 10671, 10746, 10774, 10799, 10801, 10912, 11113, 11128, 11205, 11379, 11459, - 11468, 11658, 11776, 11791, 11953, 11959, 12021, 12028, 12135, 12233, 12407, - 12441, 12448, 12470, 12501, 12548, 12642, 12679, 12770, 12788, 12899, 12923, - 12939, 13050, 13103, 13147, 13256, 13339, 13409 - }; - - const int dvbt2_pilotgenerator_cc_impl::tr_papr_map_32k[288] = - { - 164, 320, 350, 521, 527, 578, 590, 619, 635, 651, 662, 664, 676, 691, 723, - 940, 1280, 1326, 1509, 1520, 1638, 1682, 1805, 1833, 1861, 1891, 1900, 1902, - 1949, 1967, 1978, 1998, 2006, 2087, 2134, 2165, 2212, 2427, 2475, 2555, 2874, - 3067, 3091, 3101, 3146, 3188, 3322, 3353, 3383, 3503, 3523, 3654, 3856, 4150, - 4158, 4159, 4174, 4206, 4318, 4417, 4629, 4631, 4875, 5104, 5106, 5111, 5131, - 5145, 5146, 5177, 5181, 5246, 5269, 5458, 5474, 5500, 5509, 5579, 5810, 5823, - 6058, 6066, 6098, 6411, 6741, 6775, 6932, 7103, 7258, 7303, 7413, 7586, 7591, - 7634, 7636, 7655, 7671, 7675, 7756, 7760, 7826, 7931, 7937, 7951, 8017, 8061, - 8071, 8117, 8317, 8321, 8353, 8806, 9010, 9237, 9427, 9453, 9469, 9525, 9558, - 9574, 9584, 9820, 9973, 10011, 10043, 10064, 10066, 10081, 10136, 10193, 10249, - 10511, 10537, 11083, 11350, 11369, 11428, 11622, 11720, 11924, 11974, 11979, 12944, - 12945, 13009, 13070, 13110, 13257, 13364, 13370, 13449, 13503, 13514, 13520, 13583, - 13593, 13708, 13925, 14192, 14228, 14235, 14279, 14284, 14370, 14393, 14407, 14422, - 14471, 14494, 14536, 14617, 14829, 14915, 15094, 15138, 15155, 15170, 15260, 15283, - 15435, 15594, 15634, 15810, 16178, 16192, 16196, 16297, 16366, 16498, 16501, 16861, - 16966, 17039, 17057, 17240, 17523, 17767, 18094, 18130, 18218, 18344, 18374, 18657, - 18679, 18746, 18772, 18779, 18786, 18874, 18884, 18955, 19143, 19497, 19534, 19679, - 19729, 19738, 19751, 19910, 19913, 20144, 20188, 20194, 20359, 20490, 20500, 20555, - 20594, 20633, 20656, 21099, 21115, 21597, 22139, 22208, 22244, 22530, 22547, 22562, - 22567, 22696, 22757, 22798, 22854, 22877, 23068, 23102, 23141, 23154, 23170, 23202, - 23368, 23864, 24057, 24215, 24219, 24257, 24271, 24325, 24447, 25137, 25590, 25702, - 25706, 25744, 25763, 25811, 25842, 25853, 25954, 26079, 26158, 26285, 26346, 26488, - 26598, 26812, 26845, 26852, 26869, 26898, 26909, 26927, 26931, 26946, 26975, 26991, - 27039 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp1_cp1[20] = - { - 116, 255, 285, 430, 518, 546, 601, 646, 744, 1662, 1893, 1995, 2322, 3309, 3351, - 3567, 3813, 4032, 5568, 5706 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp1_cp2[25] = - { - 1022, 1224, 1302, 1371, 1495, 2261, 2551, 2583, 2649, 2833, 2925, 3192, 4266, 5395, - 5710, 5881, 8164, 10568, 11069, 11560, 12631, 12946, 13954, 16745, 21494 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp1_cp5[44] = - { - 1369, 7013, 7215, 7284, 7649, 7818, 8025, 8382, 8733, 8880, 9249, 9432, 9771, 10107, - 10110, 10398, 10659, 10709, 10785, 10872, 11115, 11373, 11515, 11649, 11652, 12594, - 12627, 12822, 12984, 15760, 16612, 17500, 18358, 19078, 19930, 20261, 20422, 22124, - 22867, 23239, 24934, 25879, 26308, 26674 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp2_cp1[20] = - { - 116, 318, 390, 430, 474, 518, 601, 646, 708, 726, 1752, 1758, 1944, 2100, 2208, 2466, - 3792, 5322, 5454, 5640 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp2_cp2[22] = - { - 1022, 1092, 1369, 1416, 1446, 1495, 2598, 2833, 2928, 3144, 4410, 4800, 5710, 5881, - 6018, 6126, 10568, 11515, 12946, 13954, 15559, 16681 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp2_cp3[2] = - { - 2261, 8164 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp2_cp4[2] = - { - 10709, 19930 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp2_cp5[41] = - { - 6744, 7013, 7020, 7122, 7308, 7649, 7674, 7752, 7764, 8154, 8190, 8856, 8922, 9504, - 9702, 9882, 9924, 10032, 10092, 10266, 10302, 10494, 10530, 10716, 11016, 11076, - 11160, 11286, 11436, 11586, 12582, 13002, 17500, 18358, 19078, 22124, 23239, 24073, - 24934, 25879, 26308 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp2_cp6[88] = - { - 13164, 13206, 13476, 13530, 13536, 13764, 13848, 13938, 13968, 14028, 14190, 14316, - 14526, 14556, 14562, 14658, 14910, 14946, 15048, 15186, 15252, 15468, 15540, 15576, - 15630, 15738, 15840, 16350, 16572, 16806, 17028, 17064, 17250, 17472, 17784, 17838, - 18180, 18246, 18480, 18900, 18960, 19254, 19482, 19638, 19680, 20082, 20310, 20422, - 20454, 20682, 20874, 21240, 21284, 21444, 21450, 21522, 21594, 21648, 21696, 21738, - 22416, 22824, 23016, 23124, 23196, 23238, 23316, 23418, 23922, 23940, 24090, 24168, - 24222, 24324, 24342, 24378, 24384, 24540, 24744, 24894, 24990, 25002, 25194, 25218, - 25260, 25566, 26674, 26944 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp3_cp1[22] = - { - 116, 318, 342, 426, 430, 518, 582, 601, 646, 816, 1758, 1764, 2400, 3450, 3504, - 3888, 4020, 4932, 5154, 5250, 5292, 5334 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp3_cp2[20] = - { - 1022, 1495, 2261, 2551, 2802, 2820, 2833, 2922, 4422, 4752, 4884, 5710, 8164, - 10568, 11069, 11560, 12631, 12946, 16745, 21494 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp3_cp3[1] = - { - 13954 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp3_cp5[44] = - { - 1369, 5395, 5881, 6564, 6684, 7013, 7649, 8376, 8544, 8718, 8856, 9024, 9132, 9498, - 9774, 9840, 10302, 10512, 10566, 10770, 10914, 11340, 11418, 11730, 11742, 12180, - 12276, 12474, 12486, 15760, 16612, 17500, 18358, 19078, 19930, 20261, 20422, 22124, - 22867, 23239, 24934, 25879, 26308, 26674 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp3_cp6[49] = - { - 13320, 13350, 13524, 13566, 13980, 14148, 14340, 14964, 14982, 14994, 15462, 15546, - 15984, 16152, 16314, 16344, 16488, 16614, 16650, 16854, 17028, 17130, 17160, 17178, - 17634, 17844, 17892, 17958, 18240, 18270, 18288, 18744, 18900, 18930, 18990, 19014, - 19170, 19344, 19662, 19698, 20022, 20166, 20268, 20376, 20466, 20550, 20562, 20904, - 21468 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp4_cp1[20] = - { - 108, 116, 144, 264, 288, 430, 518, 564, 636, 646, 828, 2184, 3360, 3396, 3912, 4032, - 4932, 5220, 5676, 5688 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp4_cp2[23] = - { - 601, 1022, 1092, 1164, 1369, 1392, 1452, 1495, 2261, 2580, 2833, 3072, 4320, 4452, - 5710, 5881, 6048, 10568, 11515, 12946, 13954, 15559, 16681 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp4_cp3[1] = - { - 8164 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp4_cp4[2] = - { - 10709, 19930 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp4_cp5[44] = - { - 6612, 6708, 7013, 7068, 7164, 7224, 7308, 7464, 7649, 7656, 7716, 7752, 7812, 7860, - 8568, 8808, 8880, 9072, 9228, 9516, 9696, 9996, 10560, 10608, 10728, 11148, 11232, - 11244, 11496, 11520, 11664, 11676, 11724, 11916, 17500, 18358, 19078, 21284, 22124, - 23239, 24073, 24934, 25879, 26308 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp4_cp6[86] = - { - 13080, 13152, 13260, 13380, 13428, 13572, 13884, 13956, 14004, 14016, 14088, 14232, - 14304, 14532, 14568, 14760, 14940, 15168, 15288, 15612, 15684, 15888, 16236, 16320, - 16428, 16680, 16812, 16908, 17184, 17472, 17508, 17580, 17892, 17988, 18000, 18336, - 18480, 18516, 19020, 19176, 19188, 19320, 19776, 19848, 20112, 20124, 20184, 20388, - 20532, 20556, 20676, 20772, 21156, 21240, 21276, 21336, 21384, 21816, 21888, 22068, - 22092, 22512, 22680, 22740, 22800, 22836, 22884, 23304, 23496, 23568, 23640, 24120, - 24168, 24420, 24444, 24456, 24492, 24708, 24864, 25332, 25536, 25764, 25992, 26004, - 26674, 26944 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp5_cp1[19] = - { - 108, 116, 228, 430, 518, 601, 646, 804, 1644, 1680, 1752, 1800, 1836, 3288, 3660, - 4080, 4932, 4968, 5472 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp5_cp2[23] = - { - 852, 1022, 1495, 2508, 2551, 2604, 2664, 2736, 2833, 3120, 4248, 4512, 4836, 5710, - 5940, 6108, 8164, 10568, 11069, 11560, 12946, 13954, 21494 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp5_cp3[3] = - { - 648, 4644, 16745 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp5_cp4[1] = - { - 12631 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp5_cp5[44] = - { - 1369, 2261, 5395, 5881, 6552, 6636, 6744, 6900, 7032, 7296, 7344, 7464, 7644, 7649, - 7668, 7956, 8124, 8244, 8904, 8940, 8976, 9216, 9672, 9780, 10224, 10332, 10709, - 10776, 10944, 11100, 11292, 11364, 11496, 11532, 11904, 12228, 12372, 12816, 15760, - 16612, 17500, 19078, 22867, 25879 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp6_cp5[88] = - { - 116, 384, 408, 518, 601, 646, 672, 960, 1022, 1272, 1344, 1369, 1495, 1800, 2040, - 2261, 2833, 3192, 3240, 3768, 3864, 3984, 4104, 4632, 4728, 4752, 4944, 5184, 5232, - 5256, 5376, 5592, 5616, 5710, 5808, 5881, 6360, 6792, 6960, 7013, 7272, 7344, 7392, - 7536, 7649, 7680, 7800, 8064, 8160, 8164, 8184, 8400, 8808, 8832, 9144, 9648, 9696, - 9912, 10008, 10200, 10488, 10568, 10656, 10709, 11088, 11160, 11515, 11592, 12048, - 12264, 12288, 12312, 12552, 12672, 12946, 13954, 15559, 16681, 17500, 19078, 20422, - 21284, 22124, 23239, 24934, 25879, 26308, 26674 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp6_cp6[88] = - { - 13080, 13368, 13464, 13536, 13656, 13728, 13824, 14112, 14232, 14448, 14472, 14712, - 14808, 14952, 15000, 15336, 15360, 15408, 15600, 15624, 15648, 16128, 16296, 16320, - 16416, 16536, 16632, 16824, 16848, 17184, 17208, 17280, 17352, 17520, 17664, 17736, - 17784, 18048, 18768, 18816, 18840, 19296, 19392, 19584, 19728, 19752, 19776, 20136, - 20184, 20208, 20256, 21096, 21216, 21360, 21408, 21744, 21768, 22200, 22224, 22320, - 22344, 22416, 22848, 22968, 23016, 23040, 23496, 23688, 23904, 24048, 24168, 24360, - 24408, 24984, 25152, 25176, 25224, 25272, 25344, 25416, 25488, 25512, 25536, 25656, - 25680, 25752, 25992, 26016 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp7_cp1[15] = - { - 264, 360, 1848, 2088, 2112, 2160, 2256, 2280, 3936, 3960, 3984, 5016, 5136, 5208, - 5664 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp7_cp2[30] = - { - 116, 430, 518, 601, 646, 1022, 1296, 1368, 1369, 1495, 2833, 3024, 4416, 4608, - 4776, 5710, 5881, 6168, 7013, 8164, 10568, 10709, 11515, 12946, 15559, 23239, - 24934, 25879, 26308, 26674 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp7_cp3[5] = - { - 456, 480, 2261, 6072, 17500 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp7_cp4[3] = - { - 1008, 6120, 13954 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp7_cp5[35] = - { - 6984, 7032, 7056, 7080, 7152, 7320, 7392, 7536, 7649, 7704, 7728, 7752, 8088, 8952, - 9240, 9288, 9312, 9480, 9504, 9840, 9960, 10320, 10368, 10728, 10752, 11448, 11640, - 11688, 11808, 12192, 12240, 12480, 12816, 16681, 22124 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp7_cp6[92] = - { - 13416, 13440, 13536, 13608, 13704, 13752, 14016, 14040, 14112, 14208, 14304, 14376, - 14448, 14616, 14712, 14760, 14832, 14976, 15096, 15312, 15336, 15552, 15816, 15984, - 16224, 16464, 16560, 17088, 17136, 17256, 17352, 17400, 17448, 17544, 17928, 18048, - 18336, 18456, 18576, 18864, 19032, 19078, 19104, 19320, 19344, 19416, 19488, 19920, - 19930, 19992, 20424, 20664, 20808, 21168, 21284, 21360, 21456, 21816, 22128, 22200, - 22584, 22608, 22824, 22848, 22944, 22992, 23016, 23064, 23424, 23448, 23472, 23592, - 24192, 24312, 24360, 24504, 24552, 24624, 24648, 24672, 24768, 24792, 25080, 25176, - 25224, 25320, 25344, 25584, 25680, 25824, 26064, 26944 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp8_cp4[47] = - { - 116, 132, 180, 430, 518, 601, 646, 1022, 1266, 1369, 1495, 2261, 2490, 2551, 2712, - 2833, 3372, 3438, 4086, 4098, 4368, 4572, 4614, 4746, 4830, 4968, 5395, 5710, 5881, - 7649, 8164, 10568, 11069, 11560, 12631, 12946, 13954, 15760, 16612, 16745, 17500, - 19078, 19930, 21494, 22867, 25879, 26308 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp8_cp5[39] = - { - 6720, 6954, 7013, 7026, 7092, 7512, 7536, 7596, 7746, 7758, 7818, 7986, 8160, 8628, - 9054, 9096, 9852, 9924, 10146, 10254, 10428, 10704, 11418, 11436, 11496, 11550, - 11766, 11862, 12006, 12132, 12216, 12486, 12762, 18358, 20261, 20422, 22124, - 23239, 24934 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp8_cp6[89] = - { - 10709, 11515, 13254, 13440, 13614, 13818, 14166, 14274, 14304, 14364, 14586, 14664, - 15030, 15300, 15468, 15474, 15559, 15732, 15774, 16272, 16302, 16428, 16500, 16662, - 16681, 16872, 17112, 17208, 17862, 18036, 18282, 18342, 18396, 18420, 18426, 18732, - 19050, 19296, 19434, 19602, 19668, 19686, 19728, 19938, 20034, 21042, 21120, 21168, - 21258, 21284, 21528, 21594, 21678, 21930, 21936, 21990, 22290, 22632, 22788, 23052, - 23358, 23448, 23454, 23706, 23772, 24048, 24072, 24073, 24222, 24384, 24402, 24444, - 24462, 24600, 24738, 24804, 24840, 24918, 24996, 25038, 25164, 25314, 25380, 25470, - 25974, 26076, 26674, 26753, 26944 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp2_8k[4] = - { - 6820, 6847, 6869, 6898 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp3_8k[2] = - { - 6820, 6869 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp4_8k[2] = - { - 6820, 6869 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp7_8k[5] = - { - 6820, 6833, 6869, 6887, 6898 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp8_8k[5] = - { - 6820, 6833, 6869, 6887, 6898 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp1_16k[4] = - { - 3636, 13724, 13790, 13879 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp2_16k[2] = - { - 13636, 13790 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp3_16k[2] = - { - 13636, 13790 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp4_16k[2] = - { - 13636, 13790 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp5_16k[2] = - { - 13636, 13790 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp6_16k[2] = - { - 13636, 13790 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp7_16k[3] = - { - 13636, 13724, 13879 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp8_16k[3] = - { - 13636, 13724, 13879 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp2_32k[2] = - { - 27268, 27688 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp4_32k[2] = - { - 27268, 27688 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp6_32k[4] = - { - 27268, 27448, 27688, 27758 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp7_32k[2] = - { - 27268, 27688 - }; - - const int dvbt2_pilotgenerator_cc_impl::pp8_32k[6] = - { - 27268, 27368, 27448, 27580, 27688, 27758 - }; - - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/dvbt2/dvbt2_pilotgenerator_cc_impl.h b/gr-dtv/lib/dvbt2/dvbt2_pilotgenerator_cc_impl.h index b6809dbc06..eb4a0b52d2 100644 --- a/gr-dtv/lib/dvbt2/dvbt2_pilotgenerator_cc_impl.h +++ b/gr-dtv/lib/dvbt2/dvbt2_pilotgenerator_cc_impl.h @@ -31,144 +31,155 @@ #define MAX_CARRIERS 27841 enum dvbt2_carrier_type_t { - DATA_CARRIER = 1, - P2PILOT_CARRIER, - P2PAPR_CARRIER, - TRPAPR_CARRIER, - SCATTERED_CARRIER, - CONTINUAL_CARRIER, - P2PILOT_CARRIER_INVERTED, - SCATTERED_CARRIER_INVERTED, - CONTINUAL_CARRIER_INVERTED + DATA_CARRIER = 1, + P2PILOT_CARRIER, + P2PAPR_CARRIER, + TRPAPR_CARRIER, + SCATTERED_CARRIER, + CONTINUAL_CARRIER, + P2PILOT_CARRIER_INVERTED, + SCATTERED_CARRIER_INVERTED, + CONTINUAL_CARRIER_INVERTED }; namespace gr { - namespace dtv { +namespace dtv { - class dvbt2_pilotgenerator_cc_impl : public dvbt2_pilotgenerator_cc - { - private: - int active_items; - int num_symbols; - int fft_size; - int left_nulls; - int right_nulls; - int pilot_pattern; - int carrier_mode; - int papr_mode; - int equalization_enable; - float normalization; - gr_complex p2_bpsk[2]; - gr_complex sp_bpsk[2]; - gr_complex cp_bpsk[2]; - gr_complex p2_bpsk_inverted[2]; - gr_complex sp_bpsk_inverted[2]; - gr_complex cp_bpsk_inverted[2]; - gr_complex inverse_sinc[32768]; - int prbs[MAX_CARRIERS]; - int pn_sequence[CHIPS]; - int p2_carrier_map[MAX_CARRIERS]; - std::vector< std::vector<int> > data_carrier_map; - int fc_carrier_map[MAX_CARRIERS]; - int N_P2; - int C_P2; - int N_FC; - int C_FC; - int C_DATA; - int K_EXT; - int C_PS; - int K_OFFSET; - int dx; - int dy; - int miso; - int miso_group; - void init_prbs(void); - void init_pilots(void); +class dvbt2_pilotgenerator_cc_impl : public dvbt2_pilotgenerator_cc +{ +private: + int active_items; + int num_symbols; + int fft_size; + int left_nulls; + int right_nulls; + int pilot_pattern; + int carrier_mode; + int papr_mode; + int equalization_enable; + float normalization; + gr_complex p2_bpsk[2]; + gr_complex sp_bpsk[2]; + gr_complex cp_bpsk[2]; + gr_complex p2_bpsk_inverted[2]; + gr_complex sp_bpsk_inverted[2]; + gr_complex cp_bpsk_inverted[2]; + gr_complex inverse_sinc[32768]; + int prbs[MAX_CARRIERS]; + int pn_sequence[CHIPS]; + int p2_carrier_map[MAX_CARRIERS]; + std::vector<std::vector<int>> data_carrier_map; + int fc_carrier_map[MAX_CARRIERS]; + int N_P2; + int C_P2; + int N_FC; + int C_FC; + int C_DATA; + int K_EXT; + int C_PS; + int K_OFFSET; + int dx; + int dy; + int miso; + int miso_group; + void init_prbs(void); + void init_pilots(void); - fft::fft_complex *ofdm_fft; - int ofdm_fft_size; + fft::fft_complex* ofdm_fft; + int ofdm_fft_size; - const static unsigned char pn_sequence_table[CHIPS / 8]; - const static int p2_papr_map_1k[10]; - const static int p2_papr_map_2k[18]; - const static int p2_papr_map_4k[36]; - const static int p2_papr_map_8k[72]; - const static int p2_papr_map_16k[144]; - const static int p2_papr_map_32k[288]; - const static int tr_papr_map_1k[10]; - const static int tr_papr_map_2k[18]; - const static int tr_papr_map_4k[36]; - const static int tr_papr_map_8k[72]; - const static int tr_papr_map_16k[144]; - const static int tr_papr_map_32k[288]; - const static int pp1_cp1[20]; - const static int pp1_cp2[25]; - const static int pp1_cp5[44]; - const static int pp2_cp1[20]; - const static int pp2_cp2[22]; - const static int pp2_cp3[2]; - const static int pp2_cp4[2]; - const static int pp2_cp5[41]; - const static int pp2_cp6[88]; - const static int pp3_cp1[22]; - const static int pp3_cp2[20]; - const static int pp3_cp3[1]; - const static int pp3_cp5[44]; - const static int pp3_cp6[49]; - const static int pp4_cp1[20]; - const static int pp4_cp2[23]; - const static int pp4_cp3[1]; - const static int pp4_cp4[2]; - const static int pp4_cp5[44]; - const static int pp4_cp6[86]; - const static int pp5_cp1[19]; - const static int pp5_cp2[23]; - const static int pp5_cp3[3]; - const static int pp5_cp4[1]; - const static int pp5_cp5[44]; - const static int pp6_cp5[88]; - const static int pp6_cp6[88]; - const static int pp7_cp1[15]; - const static int pp7_cp2[30]; - const static int pp7_cp3[5]; - const static int pp7_cp4[3]; - const static int pp7_cp5[35]; - const static int pp7_cp6[92]; - const static int pp8_cp4[47]; - const static int pp8_cp5[39]; - const static int pp8_cp6[89]; - const static int pp2_8k[4]; - const static int pp3_8k[2]; - const static int pp4_8k[2]; - const static int pp7_8k[5]; - const static int pp8_8k[5]; - const static int pp1_16k[4]; - const static int pp2_16k[2]; - const static int pp3_16k[2]; - const static int pp4_16k[2]; - const static int pp5_16k[2]; - const static int pp6_16k[2]; - const static int pp7_16k[3]; - const static int pp8_16k[3]; - const static int pp2_32k[2]; - const static int pp4_32k[2]; - const static int pp6_32k[4]; - const static int pp7_32k[2]; - const static int pp8_32k[6]; + const static unsigned char pn_sequence_table[CHIPS / 8]; + const static int p2_papr_map_1k[10]; + const static int p2_papr_map_2k[18]; + const static int p2_papr_map_4k[36]; + const static int p2_papr_map_8k[72]; + const static int p2_papr_map_16k[144]; + const static int p2_papr_map_32k[288]; + const static int tr_papr_map_1k[10]; + const static int tr_papr_map_2k[18]; + const static int tr_papr_map_4k[36]; + const static int tr_papr_map_8k[72]; + const static int tr_papr_map_16k[144]; + const static int tr_papr_map_32k[288]; + const static int pp1_cp1[20]; + const static int pp1_cp2[25]; + const static int pp1_cp5[44]; + const static int pp2_cp1[20]; + const static int pp2_cp2[22]; + const static int pp2_cp3[2]; + const static int pp2_cp4[2]; + const static int pp2_cp5[41]; + const static int pp2_cp6[88]; + const static int pp3_cp1[22]; + const static int pp3_cp2[20]; + const static int pp3_cp3[1]; + const static int pp3_cp5[44]; + const static int pp3_cp6[49]; + const static int pp4_cp1[20]; + const static int pp4_cp2[23]; + const static int pp4_cp3[1]; + const static int pp4_cp4[2]; + const static int pp4_cp5[44]; + const static int pp4_cp6[86]; + const static int pp5_cp1[19]; + const static int pp5_cp2[23]; + const static int pp5_cp3[3]; + const static int pp5_cp4[1]; + const static int pp5_cp5[44]; + const static int pp6_cp5[88]; + const static int pp6_cp6[88]; + const static int pp7_cp1[15]; + const static int pp7_cp2[30]; + const static int pp7_cp3[5]; + const static int pp7_cp4[3]; + const static int pp7_cp5[35]; + const static int pp7_cp6[92]; + const static int pp8_cp4[47]; + const static int pp8_cp5[39]; + const static int pp8_cp6[89]; + const static int pp2_8k[4]; + const static int pp3_8k[2]; + const static int pp4_8k[2]; + const static int pp7_8k[5]; + const static int pp8_8k[5]; + const static int pp1_16k[4]; + const static int pp2_16k[2]; + const static int pp3_16k[2]; + const static int pp4_16k[2]; + const static int pp5_16k[2]; + const static int pp6_16k[2]; + const static int pp7_16k[3]; + const static int pp8_16k[3]; + const static int pp2_32k[2]; + const static int pp4_32k[2]; + const static int pp6_32k[4]; + const static int pp7_32k[2]; + const static int pp8_32k[6]; - public: - dvbt2_pilotgenerator_cc_impl(dvbt2_extended_carrier_t carriermode, dvbt2_fftsize_t fftsize, dvbt2_pilotpattern_t pilotpattern, dvb_guardinterval_t guardinterval, int numdatasyms, dvbt2_papr_t paprmode, dvbt2_version_t version, dvbt2_preamble_t preamble, dvbt2_misogroup_t misogroup, dvbt2_equalization_t equalization, dvbt2_bandwidth_t bandwidth, unsigned int vlength); - ~dvbt2_pilotgenerator_cc_impl(); +public: + dvbt2_pilotgenerator_cc_impl(dvbt2_extended_carrier_t carriermode, + dvbt2_fftsize_t fftsize, + dvbt2_pilotpattern_t pilotpattern, + dvb_guardinterval_t guardinterval, + int numdatasyms, + dvbt2_papr_t paprmode, + dvbt2_version_t version, + dvbt2_preamble_t preamble, + dvbt2_misogroup_t misogroup, + dvbt2_equalization_t equalization, + dvbt2_bandwidth_t bandwidth, + unsigned int vlength); + ~dvbt2_pilotgenerator_cc_impl(); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT2_PILOTGENERATOR_CC_IMPL_H */ |