GNU Radio 3.7.3 C++ API
trellis_encoder_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2002 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef _ATSC_TRELLIS_ENCODER_H_
24 #define _ATSC_TRELLIS_ENCODER_H_
25 
26 #include <gnuradio/atsc/api.h>
28 #include <gnuradio/atsc/types.h>
29 
30 /*!
31  * \brief fancy, schmancy 12-way interleaved trellis encoder for ATSC
32  */
33 
35  public:
36  static const int NCODERS = 12;
37 
40 
41  //! reset all encoder states
42  void reset ();
43 
44  /*!
45  * Take 12 RS encoded, convolutionally interleaved segments and
46  * produce 12 trellis coded data segments. We work in groups of 12
47  * because that's the smallest number of segments that composes a
48  * single full cycle of the encoder mux.
49  */
50  void encode (atsc_data_segment out[NCODERS],
51  const atsc_mpeg_packet_rs_encoded in[NCODERS]);
52 
53 
54  protected:
55  static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; // 207
56  static const int INPUT_SIZE = (SEGMENT_SIZE * 12);
57  static const int OUTPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12);
58 
59  void encode_helper (unsigned char out[OUTPUT_SIZE],
60  const unsigned char in[INPUT_SIZE]);
61 
63  bool debug;
64 };
65 
66 
67 #endif /* _ATSC_TRELLIS_ENCODER_H_ */
static const int ATSC_DATA_SEGMENT_LENGTH
Definition: consts.h:33
#define ATSC_API
Definition: gr-atsc/include/gnuradio/atsc/api.h:30
ATSC trellis encoder building block.
Definition: basic_trellis_encoder_impl.h:41
bool debug
Definition: trellis_encoder_impl.h:63
Definition: gr-atsc/include/gnuradio/atsc/types.h:177
fancy, schmancy 12-way interleaved trellis encoder for ATSC
Definition: trellis_encoder_impl.h:34
static const int ATSC_MPEG_RS_ENCODED_LENGTH
Definition: consts.h:32
FEC_API unsigned char encode(unsigned char *symbols, unsigned char *data, unsigned int nbytes, unsigned char encstate)
contains 832 3 bit symbols. The low 3 bits in the byte hold the symbol.
Definition: gr-atsc/include/gnuradio/atsc/types.h:197