[mndiff]: r152 - trunk/noe/ldpc.c
Author: michael Date: Fri Apr 24 21:28:48 2009 New Revision: 152 Log: Only reset the (nzc) elements of tab to 0 that have been set to 1 instead of all. Idea by Yutaka Sawada. Modified: trunk/noe/ldpc.c Modified: trunk/noe/ldpc.c ============================================================================== --- trunk/noe/ldpc.c Sun Apr 19 17:02:27 2009 (r151) +++ trunk/noe/ldpc.c Fri Apr 24 21:28:48 2009 (r152) @@ -123,6 +123,7 @@ LDPCContext *EXT(initLDPC)(int data_len, KISSState kiss; int i, j, y; int code_len= data_len + parity_len; + uint8_t tab[parity_len]; if(nzc==0){ #if SIZE==2 @@ -147,9 +148,8 @@ LDPCContext *EXT(initLDPC)(int data_len, //FIXME could we in theory need more space? memset(row, 0, sizeof(row)); + memset(tab, 0, parity_len); for(i=0; i<code_len; i++){ - uint8_t tab[parity_len]; - memset(tab, 0, parity_len); for(j=0; j<nzc; j++){ int minrow=999999; @@ -173,6 +173,8 @@ LDPCContext *EXT(initLDPC)(int data_len, c->parity_matrix[i][1][j] = EXT(log)[get_random(&kiss)%(SIZE-1)+1]; row[y]++; } + for(j=0; j<nzc; j++) + tab[ c->parity_matrix[i][0][j] ]= 0; } #if 0 for(;;){
participants (1)
-
michael