GNU Radio 3.5.1 C++ API
atsci_data_interleaver.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2002 Free Software Foundation, Inc.
00004  * 
00005  * This file is part of GNU Radio
00006  * 
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  * 
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 
00023 #ifndef _ATSC_DATA_INTERLEAVER_H_
00024 #define _ATSC_DATA_INTERLEAVER_H_
00025 
00026 #include <atsc_api.h>
00027 #include <atsc_types.h>
00028 #include <convolutional_interleaver.h>
00029 
00030 /*!
00031  * \brief atsc convolutional data interleaver
00032  */
00033 class ATSC_API atsci_data_interleaver : public convolutional_interleaver<unsigned char> {
00034  public:
00035   atsci_data_interleaver () : convolutional_interleaver<unsigned char>(true, 52, 4) {}
00036 
00037   void interleave (atsc_mpeg_packet_rs_encoded &out,
00038                    const atsc_mpeg_packet_rs_encoded &in);
00039 };
00040 
00041 /*!
00042  * \brief atsc convolutional data deinterleaver
00043  */
00044 class ATSC_API atsci_data_deinterleaver : public convolutional_interleaver<unsigned char> {
00045  public:
00046   atsci_data_deinterleaver () :
00047     convolutional_interleaver<unsigned char>(false, 52, 4), alignment_fifo (156) {}
00048 
00049   void deinterleave (atsc_mpeg_packet_rs_encoded &out,
00050                      const atsc_mpeg_packet_rs_encoded &in);
00051 
00052 private:
00053   /*!
00054    * Note: The use of the alignment_fifo keeps the encoder and decoder
00055    * aligned if both are synced to a field boundary.  There may be other
00056    * ways to implement this function.  This is a best guess as to how
00057    * this should behave, as we have no test vectors for either the
00058    * interleaver or deinterleaver.
00059    */
00060   interleaver_fifo<unsigned char> alignment_fifo;
00061 
00062   static void remap_pli (plinfo &out, const plinfo &in);
00063 };
00064 
00065 #endif /* _ATSC_DATA_INTERLEAVER_H_ */