static unsigned char *alloc_matrix(int rows, int cols)
{
- return para_malloc(rows * cols);
+ return alloc(rows * cols);
}
/*
static int invert_mat(unsigned char *src, int k)
{
int irow, icol, row, col, ix, error;
- int *indxc = para_malloc(k * sizeof(int));
- int *indxr = para_malloc(k * sizeof(int));
- int *ipiv = para_malloc(k * sizeof(int)); /* elements used as pivots */
+ int *indxc = alloc(k * sizeof(int));
+ int *indxr = alloc(k * sizeof(int));
+ int *ipiv = alloc(k * sizeof(int)); /* elements used as pivots */
unsigned char c, *p, *id_row = alloc_matrix(1, k),
*temp_row = alloc_matrix(1, k);
* c holds the coefficient of P(x) = Prod (x - p_i), i=0..k-1
* b holds the coefficient for the matrix inversion
*/
- c = para_malloc(k);
- b = para_malloc(k);
- p = para_malloc(k);
+ c = alloc(k);
+ b = alloc(k);
+ p = alloc(k);
for (j = 1, i = 0; i < k; i++, j += k) {
c[i] = 0;
if (k < 1 || k > GF_SIZE + 1 || n > GF_SIZE + 1 || k > n)
return -E_FEC_PARMS;
- parms = para_malloc(sizeof(struct fec_parms));
+ parms = alloc(sizeof(struct fec_parms));
parms->k = k;
parms->n = n;
parms->enc_matrix = alloc_matrix(n, k);
if (ret < 0)
return ret;
/* do the actual decoding */
- slice = para_malloc(k * sizeof(unsigned char *));
+ slice = alloc(k * sizeof(unsigned char *));
for (row = 0; row < k; row++) {
if (idx[row] >= k) {
slice[row] = para_calloc(sz);