Commit b99dd6f1 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Update block code sources.

parent 56c923be
......@@ -291,26 +291,6 @@ static void matmul(PrrtCoder *cod, gf *a, gf *b, gf *c, int n, int k, int m) {
}
}
#ifdef FECDEBUG
/*
* returns 1 if the square matrix is identiy
* (only for test)
*/
static int
is_identity(gf *m, int k)
{
int row, col ;
for (row=0; row<k; row++)
for (col=0; col<k; col++)
if ( (row==col && *m != 1) ||
(row!=col && *m != 0) )
return 0 ;
else
m++ ;
return 1 ;
}
#endif /* debug */
/*
* invert_mat() takes a matrix and produces its inverse
* k is the size of the matrix.
......@@ -530,7 +510,7 @@ static void init_fec(PrrtCoder *cod) {
* and then transforming it into a systematic matrix.
*/
int PrrtCoder_create(PrrtCoder **cod, int k, int n);
int prrt_coder_create(PrrtCoder **cod, int k, int n);
int PrrtCoder_get_coder(PrrtCoder **cod, int n, int k) {
int err = 0;
......@@ -539,7 +519,7 @@ int PrrtCoder_get_coder(PrrtCoder **cod, int n, int k) {
(*cod)->params.n != n ||
(*cod)->params.k != k) {
PrrtCoder_destroy(*cod);
err = PrrtCoder_create(cod, k, n);
err = prrt_coder_create(cod, k, n);
}
return err;
......@@ -565,7 +545,7 @@ void PrrtCoder_destroy(PrrtCoder *cod) {
free(cod);
}
int PrrtCoder_create(PrrtCoder **cod, int k, int n) {
int prrt_coder_create(PrrtCoder **cod, int k, int n) {
int row, col;
gf *p, *tmp_m;
int err = 0;
......@@ -683,7 +663,7 @@ void PrrtCoder_encode(PrrtCoder *cod, gf **src, gf *fec, int index, int sz) {
* indexes. The matrix must be already allocated as
* a vector of k*k elements, in row-major order
*/
static gf *PrrtCoder_build_matrix(PrrtCoder *cod, int *index) {
static gf *prrt_coder_build_matrix(PrrtCoder *cod, int *index) {
int i, k = cod->params.k;
gf *p, *matrix = NEW_GF_MATRIX(k, k);
if (!matrix)
......@@ -733,7 +713,7 @@ int PrrtCoder_decode(PrrtCoder *cod, gf **pkt, int *index, int sz) {
sz /= 2;
}
m_dec = PrrtCoder_build_matrix(cod, index);
m_dec = prrt_coder_build_matrix(cod, index);
if (!m_dec) {
PERROR("Could not build decode matrix\n");
......
......@@ -108,10 +108,10 @@ void PrrtCoder_destroy(PrrtCoder *cod) ;
* We are using a (k,n) systematic block code. This function takes k packets as source (the first
* k) and creates one of the n-k remaining packets. Index is the number of the packet and therefore
* lies between k and n (k <= index < n).
* \param src an array of pointers to the source packets
* \param dst the pointer to a preallocatet space for the new packet.
* \param index this is the position of the new packet in the resulting set of encoded packets
* \param sz the size of the packets that should be encoded
* \param src: an array of pointers to the source packets.
* \param dst: the pointer to a previously allocated space for the new packet.
* \param index: this is the position of the new packet in the resulting set of encoded packets.
* \param sz: the size of the packets that should be encoded.
*/
void PrrtCoder_encode(PrrtCoder *cod, gf **src, gf *dst, int index, int sz) ;
......@@ -122,9 +122,9 @@ void PrrtCoder_encode(PrrtCoder *cod, gf **src, gf *dst, int index, int sz) ;
* present it should be at position i-1 (e.g. packet 1 at 0, 2 at 1) and index[i-1] should be set
* to i-1. If data packet i is not present, but replacement packet (k < )j(<= n) is present, its
* data can be pointed to at pkt[i-1]. Index[i-1] should then be set to j-1.
* \param pkt these are the pointers to the data of the different packets.
* \param index this is the position of the packets in the block code.
* \param sz the size of the data of the packets
* \param pkt: these are the pointers to the data of the different packets.
* \param index: this is the position of the packets in the block code.
* \param sz: the size of the data of the packets.
*/
int PrrtCoder_decode(PrrtCoder *cod, gf **pkt, int *index, int sz) ;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment