3 * Copyright 2002 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
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 2, or (at your option)
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.
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., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #ifndef _ATSC_TRELLIS_ENCODER_H_
24 #define _ATSC_TRELLIS_ENCODER_H_
26 #include <atsci_basic_trellis_encoder.h>
27 #include <atsc_types.h>
30 * \brief fancy, schmancy 12-way interleaved trellis encoder for ATSC
33 class atsci_trellis_encoder {
35 static const int NCODERS = 12;
37 atsci_trellis_encoder ();
38 ~atsci_trellis_encoder ();
40 //! reset all encoder states
44 * Take 12 RS encoded, convolutionally interleaved segments and
45 * produce 12 trellis coded data segments. We work in groups of 12
46 * because that's the smallest number of segments that composes a
47 * single full cycle of the encoder mux.
49 void encode (atsc_data_segment out[NCODERS],
50 const atsc_mpeg_packet_rs_encoded in[NCODERS]);
54 static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; // 207
55 static const int INPUT_SIZE = (SEGMENT_SIZE * 12);
56 static const int OUTPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12);
58 void encode_helper (unsigned char out[OUTPUT_SIZE],
59 const unsigned char in[INPUT_SIZE]);
61 atsci_basic_trellis_encoder enc[NCODERS];
66 #endif /* _ATSC_TRELLIS_ENCODER_H_ */