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 3, 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., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
22 #ifndef _ATSC_BASIC_TRELLIS_ENCODER_H_
23 #define _ATSC_BASIC_TRELLIS_ENCODER_H_
28 * \brief ATSC trellis encoder building block.
30 * Note this is NOT the 12x interleaved interface.
32 * This implements a single instance of the ATSC trellis encoder.
33 * This is a rate 2/3 encoder (really a constraint length 3, rate 1/2
34 * encoder with the top bit passed through unencoded. This does not
35 * implement the "precoding" of the top bit, because the NTSC rejection
36 * filter is not supported.
39 class atsci_basic_trellis_encoder {
42 int state; // two bit state;
45 atsci_basic_trellis_encoder () : state (0) {}
48 * Encode two bit INPUT into 3 bit return value. Domain is [0,3],
49 * Range is [0,7]. The mapping to bipolar levels is not done.
51 int encode (unsigned int input);
53 //! reset encoder state
54 void reset () { state = 0; }
56 static const unsigned char next_state[32];
57 static const unsigned char out_symbol[32];
60 #endif /* _ATSC_BASIC_TRELLIS_ENCODER_H_ */