GNU Radio 3.4.0 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_types.h>
00027 #include <convolutional_interleaver.h>
00028 
00029 /*!
00030  * \brief atsc convolutional data interleaver
00031  */
00032 class atsci_data_interleaver : public convolutional_interleaver<unsigned char> {
00033  public:
00034   atsci_data_interleaver () : convolutional_interleaver<unsigned char>(true, 52, 4) {}
00035 
00036   void interleave (atsc_mpeg_packet_rs_encoded &out,
00037                    const atsc_mpeg_packet_rs_encoded &in);
00038 };
00039 
00040 /*!
00041  * \brief atsc convolutional data deinterleaver
00042  */
00043 class atsci_data_deinterleaver : public convolutional_interleaver<unsigned char> {
00044  public:
00045   atsci_data_deinterleaver () :
00046     convolutional_interleaver<unsigned char>(false, 52, 4), alignment_fifo (156) {}
00047 
00048   void deinterleave (atsc_mpeg_packet_rs_encoded &out,
00049                      const atsc_mpeg_packet_rs_encoded &in);
00050 
00051 private:
00052   /*!
00053    * Note: The use of the alignment_fifo keeps the encoder and decoder
00054    * aligned if both are synced to a field boundary.  There may be other
00055    * ways to implement this function.  This is a best guess as to how
00056    * this should behave, as we have no test vectors for either the
00057    * interleaver or deinterleaver.
00058    */
00059   interleaver_fifo<unsigned char> alignment_fifo;
00060 
00061   static void remap_pli (plinfo &out, const plinfo &in);
00062 };
00063 
00064 #endif /* _ATSC_DATA_INTERLEAVER_H_ */