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., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
23 #ifndef _ATSC_DATA_INTERLEAVER_H_
24 #define _ATSC_DATA_INTERLEAVER_H_
26 #include <atsc_types.h>
27 #include <convolutional_interleaver.h>
30 * \brief atsc convolutional data interleaver
32 class atsci_data_interleaver : public convolutional_interleaver<unsigned char> {
34 atsci_data_interleaver () : convolutional_interleaver<unsigned char>(true, 52, 4) {}
36 void interleave (atsc_mpeg_packet_rs_encoded &out,
37 const atsc_mpeg_packet_rs_encoded &in);
41 * \brief atsc convolutional data deinterleaver
43 class atsci_data_deinterleaver : public convolutional_interleaver<unsigned char> {
45 atsci_data_deinterleaver () :
46 convolutional_interleaver<unsigned char>(false, 52, 4), alignment_fifo (156) {}
48 void deinterleave (atsc_mpeg_packet_rs_encoded &out,
49 const atsc_mpeg_packet_rs_encoded &in);
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.
59 interleaver_fifo<unsigned char> alignment_fifo;
61 static void remap_pli (plinfo &out, const plinfo &in);
64 #endif /* _ATSC_DATA_INTERLEAVER_H_ */