FEC.hpp
Go to the documentation of this file.
1 #if !defined(FEC_C_H_INCLUDED)
2 #define FEC_C_H_INCLUDED 1
3 
4 /*
5  Copyright (C) 2010, Michael P. Thompson
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License Version 2 as
9  specified in the README.txt file or as published by the Free Software
10  Foundation.
11 
12  This program 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 along
18  with this program; if not, write to the Free Software Foundation, Inc.,
19  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 
21  $Id: rvFec.h 28 2010-03-09 23:49:39Z mike $
22 */
23 
24 // Basic 8, 16, and 32 bit integer types.
25 typedef char rvInt8;
26 typedef short rvInt16;
27 typedef unsigned char rvUint8;
28 typedef unsigned short rvUint16;
29 
30 // A boolean type to match the C++ definition of "bool".
31 
32 
33 // This defines the type used to store an element in the various
34 // Galois Field tables. Make sure this is something larger than
35 // a rvUint8 if anything larger than GF(256) is used.
36 typedef rvUint8 uintGF;
37 
38 // Forward error correcting types.
39 typedef struct _rvFec rvFec;
40 
41 typedef struct _rvFec *FEC;
42 
43 // Forward error correcting structures.
44 struct _rvFec
45 {
46  // Buffer properties.
47  rvInt16 zeroSize; // Zero padding portion of buffer.
48  rvInt16 dataSize; // Data portion of buffer.
49  rvInt16 paritySize; // Parity portion of buffer.
50  rvInt16 blockSize; // Data and parity portion of buffer.
51 
52  // Reed Solomon properties.
53  rvInt16 mm; // The code symbol size in bits.
54  rvInt16 nn; // The block size in symbols, which is always (2**mm - 1).
55  rvInt16 kk; // The number of data symbols per block, kk < nn.
56 
57  // Reed Solomon tables.
58  uintGF *gg; // Generator polynomial g(x)
59  uintGF *alphaTo; // Index to polynomial form conversion table.
60  uintGF *indexOf; // Polynomial to index form conversion table.
61 };
62 
63 // Forward error correcting methods.
65 rvInt16 rvFec_Parity(rvFec* self, rvUint8* dataBuffer, rvUint8* parityBuffer);
66 rvInt16 rvFec_Correct(rvFec* self, rvUint8* blockBuffer);
67 
68 
69 // External declarations:
70 
71 bool FEC__correct(FEC fec, unsigned int *data, unsigned int size);
72 void FEC__parity(FEC fec, unsigned int *data, unsigned int size);
73 FEC FEC__create(unsigned int symbol_size, unsigned int data_size, unsigned int parity_size);
74 
75 #endif // !defined(FEC_C_H_INCLUDED)
rvUint8 uintGF
Definition: FEC.hpp:36
rvInt16 rvFec_Parity(rvFec *self, rvUint8 *dataBuffer, rvUint8 *parityBuffer)
Definition: FEC.cpp:276
rvInt16 blockSize
Definition: FEC.hpp:50
rvInt16 dataSize
Definition: FEC.hpp:48
char rvInt8
Definition: FEC.hpp:25
rvInt16 zeroSize
Definition: FEC.hpp:47
Definition: FEC.hpp:44
rvInt16 rvFec_Correct(rvFec *self, rvUint8 *blockBuffer)
Definition: FEC.cpp:325
void FEC__parity(FEC fec, unsigned int *data, unsigned int size)
Definition: FEC.cpp:630
bool FEC__correct(FEC fec, unsigned int *data, unsigned int size)
Definition: FEC.cpp:604
uintGF * indexOf
Definition: FEC.hpp:60
rvInt16 mm
Definition: FEC.hpp:53
rvInt16 paritySize
Definition: FEC.hpp:49
rvInt16 nn
Definition: FEC.hpp:54
FEC FEC__create(unsigned int symbol_size, unsigned int data_size, unsigned int parity_size)
Definition: FEC.cpp:653
unsigned char rvUint8
Definition: FEC.hpp:27
uintGF * alphaTo
Definition: FEC.hpp:59
struct _rvFec * FEC
Definition: FEC.hpp:41
short rvInt16
Definition: FEC.hpp:26
uintGF * gg
Definition: FEC.hpp:58
rvFec * rvFec_New(rvInt16 symbolSize, rvInt16 dataSize, rvInt16 paritySize)
Definition: FEC.cpp:196
unsigned short rvUint16
Definition: FEC.hpp:28
rvInt16 kk
Definition: FEC.hpp:55


fiducial_lib
Author(s): Wayne Gramlich
autogenerated on Thu Dec 28 2017 04:06:53