[MN-dev] [mndiff]: r125 - trunk/noe/ldpc.c

michael subversion at mplayerhq.hu
Tue Nov 25 13:08:25 CET 2008


Author: michael
Date: Tue Nov 25 13:08:25 2008
New Revision: 125

Log:
Use heap instead of stack for large matrixes.


Modified:
   trunk/noe/ldpc.c

Modified: trunk/noe/ldpc.c
==============================================================================
--- trunk/noe/ldpc.c	(original)
+++ trunk/noe/ldpc.c	Tue Nov 25 13:08:25 2008
@@ -149,9 +149,8 @@ int EXT(init_matrixLDPC)(LDPCContext *c,
     int i, j, rank, x, y;
     int nzc= c->nzc;
     int parity_len= c->parity_len;
-    ELEM inv_matrix[2*parity_len*parity_len];
+    ELEM *inv_matrix= calloc(parity_len*parity_len*2, sizeof(ELEM));
 
-    memset(inv_matrix, 0, sizeof(inv_matrix));
     for(i=0; i<erasure_count; i++){
         x= erasure_pos[i];
         for(j=0; j<nzc; j++){
@@ -168,6 +167,7 @@ int EXT(init_matrixLDPC)(LDPCContext *c,
         for(i=0; i<parity_len; i++)
             c->inv_matrix[i + j*parity_len]= EXT(log)[inv_matrix[i + j*2*parity_len + parity_len]];
 
+    free(inv_matrix);
     return rank - erasure_count;
 }
 



More information about the Mndiff-dev mailing list