Updated FSF address in all files. Fixes ticket:51
[debian/gnuradio] / gr-atsc / src / lib / atsci_data_interleaver.h
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 2, 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_DATA_INTERLEAVER_H_
24 #define _ATSC_DATA_INTERLEAVER_H_
25
26 #include <atsc_types.h>
27 #include <convolutional_interleaver.h>
28
29 /*!
30  * \brief atsc convolutional data interleaver
31  */
32 class atsci_data_interleaver : public convolutional_interleaver<unsigned char> {
33  public:
34   atsci_data_interleaver () : convolutional_interleaver<unsigned char>(true, 52, 4) {}
35
36   void interleave (atsc_mpeg_packet_rs_encoded &out,
37                    const atsc_mpeg_packet_rs_encoded &in);
38 };
39
40 /*!
41  * \brief atsc convolutional data deinterleaver
42  */
43 class atsci_data_deinterleaver : public convolutional_interleaver<unsigned char> {
44  public:
45   atsci_data_deinterleaver () :
46     convolutional_interleaver<unsigned char>(false, 52, 4), alignment_fifo (156) {}
47
48   void deinterleave (atsc_mpeg_packet_rs_encoded &out,
49                      const atsc_mpeg_packet_rs_encoded &in);
50
51 private:
52   /*!
53    * Note: The use of the alignment_fifo keeps the encoder and decoder
54    * aligned if both are synced to a field boundary.  There may be other
55    * ways to implement this function.  This is a best guess as to how
56    * this should behave, as we have no test vectors for either the
57    * interleaver or deinterleaver.
58    */
59   interleaver_fifo<unsigned char> alignment_fifo;
60
61   static void remap_pli (plinfo &out, const plinfo &in);
62 };
63
64 #endif /* _ATSC_DATA_INTERLEAVER_H_ */