Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

blockdecoder.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           blockdecoder.h  -  description
00003                              -------------------
00004     begin                : Sun Sep 14 2003
00005     copyright            : (C) 2003 by Peter Haase
00006     email                : mail@p-haase.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00037 #ifndef BLOCKDECODER_H
00038 #define BLOCKDECODER_H
00039 
00040 #include "decoder.h"
00041 
00042 
00043 namespace simthlib{
00044 
00045 
00051 class BlockDecoder : public Decoder
00052 {
00053 
00054   public :
00055     BlockDecoder(int deviceID, simth::DeviceSystemIntf* system,
00056          const simth::PropertyList& pl, 
00057          simth::SequenceType inType);
00058 };
00059 
00067 class RSHardDecoder
00068 {
00069   public:
00070     RSHardDecoder();
00071     virtual ~RSHardDecoder();
00072     int initialise(int*,int,int,int,int);
00073     int compute_out(int, int*, int*);
00074     int decoder(int* v,int n,int r,int q,int m0,int erasures,int* zp,int* err);
00075 
00076     static const int Q=256;
00077     static const int R=60;
00078 
00079   protected:
00080 
00081     int *gp,(*mlga)[RSHardDecoder::Q];
00082     int *g,*lgt,*lga,*qua,*inv;
00083     int* v;
00084     int n;//io_length;
00085     int r,q,m0;
00086     int syndromes(int* v, int* s, int n, int r, int q, int m0);
00087     void erasure_pol(int* ze, int erasures, int r, int* gam);
00088     void syn_pol(int* s, int* gam, int r, int erasures, int* xi);
00089     int bma(int* s, int* xi, int erasures, int r, int* lam, int* errnum);
00090     void err_pol(int* lam, int* gam, int r, int* psi);
00091     int chien(int* lam, int errnum, int* x, int q, int n, int* zeta);
00092     void forney(int* xi, int* lam, int* psi, int* x, int* ze, int erasures, int errnum, int m0, int q, int r, int* zv, int* y);
00093 
00094 
00095 };
00096 
00097 
00100 class ReedSolomonDecoder : public BlockDecoder
00101 {
00102   public :
00103     ReedSolomonDecoder(int deviceID, simth::DeviceSystemIntf* system,
00104                const simth::PropertyList& pl, 
00105                int bitsPerSymbol, int numCheckSymbol ,
00106                int m0_, int output_Length,int numChase2bits );
00107     virtual ~ReedSolomonDecoder();
00108 
00109     virtual void decode(const simth::BitSeq &llr, simth::BitSeq& bsout);
00110     virtual void decode(const simth::LlrSeq &llr, simth::BitSeq& bsout);
00111     virtual void decode(const simth::LlvSeq &llr, simth::BitSeq& bsout);
00112 
00113     virtual void updateOutputLengths( );
00114     virtual void updateInputLengths();
00115 
00116     virtual int getDataLength(int codedLength) const;
00117     virtual int getCodeLength(int rawLength) const;
00118 
00119   private:
00120 
00121     static const int Q=RSHardDecoder::Q;
00122     static const int R=RSHardDecoder::R;
00123 
00124     inline void compare_results();
00125     inline void generate_pattern();
00126     RSHardDecoder rsd;
00127     int inp_length;
00128     int out_length;
00129     int q;
00130     int inf_code_length;
00131     int code_length;
00132     int ns;
00133     int bits_p_sym, r, m0;
00134     int num_chase2_bits;
00135     mutable int temp[ReedSolomonDecoder::Q];
00136     int * hard_inp;
00137     // simt::checkedVector<int> best_res;
00138     int* best_res;
00139     int * less_prob_pos;
00140     float * inp;
00141     int err;
00142     int zp[RSHardDecoder::R];
00143     int chase2;
00144     mutable int errstat;
00145     mutable float best_metric;
00146 
00147 
00148 };
00149 
00150 
00151 }
00152 
00153 #endif

Generated on Tue Aug 9 14:35:10 2005 for simtheticlib by  doxygen 1.4.1