diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2017-06-22 13:39:31 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2017-06-28 10:27:24 +0200 |
commit | 9eae3063e62df1ca47213027ad42fff6d0a9b7f4 (patch) | |
tree | 32707ad5324ec46fdea25aca6cee3fc110fc2501 /include | |
parent | 022ce62b9f6706749feed3939335e46bb0146978 (diff) |
Move libfec declarations to public header in global include directory
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r-- | include/libfec.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/libfec.h b/include/libfec.h new file mode 100644 index 0000000..356ac28 --- /dev/null +++ b/include/libfec.h @@ -0,0 +1,37 @@ +#ifndef LIBFEC_H +#define LIBFEC_H + +struct fec_parms; + +/* k - number of actual data packets + * n - total number of packets including data and redundant packets + * (actual packet size isn't relevant here) */ +struct fec_parms *fec_new(int k, int n); +void fec_free(struct fec_parms *p); + +/* src - array of (n) pointers to data packets + * fec - buffer for packet to be generated + * index - index of packet to be generated (0 <= index < n) + * sz - data packet size + * + * _linear version just takes a pointer to the raw data; no + * mucking about with packet pointers. + */ +void fec_encode(struct fec_parms *code, unsigned char *src[], + unsigned char *fec, int index, int sz); +void fec_encode_linear(struct fec_parms *code, unsigned char *src, + unsigned char *fec, int index, int sz); + +/* data - array of (k) pointers to data packets, in arbitrary order (see i) + * i - indices of (data) packets + * sz - data packet size + * + * Will never fail as long as you give it (k) individual data packets. + * Will re-order the (data) pointers but not the indices -- data packets + * are ordered on return. + */ +int fec_decode(struct fec_parms *code, unsigned char *data[], + int i[], int sz); + +#endif /* LIBFEC_H */ + |