File: fec.h

package info (click to toggle)
poc-streamer 0.4.2-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,000 kB
  • sloc: ansic: 8,782; makefile: 307; ruby: 152; perl: 135; yacc: 115; lex: 36; sh: 30
file content (40 lines) | stat: -rw-r--r-- 689 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*C
  (c) 2005 bl0rg.net
**/

#ifndef FEC_H__
#define FEC_H__

#include "galois.h"

/*M
  \emph{FEC parameter structure.}

  Contains the $n, k$ parameters for FEC, as well as the generator
  matrix.
**/
typedef struct fec_s {
  /*M
    FEC parameters.
  **/  
  unsigned int k, n;
  /*M
    Linear block code generator matrix.
  **/
  gf *gen_matrix; 
} fec_t;

void fec_free(fec_t *fec);
fec_t *fec_new(unsigned int k, unsigned int n);

void fec_encode(fec_t *fec,
                gf *src[], gf *dst,
                unsigned int idx, unsigned int len);
int fec_decode(fec_t *fec,
               gf *buf,
               unsigned int idxs[], unsigned len);

/*C
**/

#endif /* FEC_H__ */