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

michael subversion at mplayerhq.hu
Tue Jul 13 23:27:41 CEST 2010


Author: michael
Date: Tue Jul 13 23:27:40 2010
New Revision: 202

Log:
Remove redundant variable solvew in factor().

Modified:
   trunk/noe/ldpc.c

Modified: trunk/noe/ldpc.c
==============================================================================
--- trunk/noe/ldpc.c	Tue Jul 13 19:17:28 2010	(r201)
+++ trunk/noe/ldpc.c	Tue Jul 13 23:27:40 2010	(r202)
@@ -46,15 +46,15 @@ typedef struct LDPCContext{
 
 typedef uint8_t ELEM;
 
-static int factor(ELEM *matrix, int width, int height, int solvew, unsigned int row_weight[], unsigned int col_weight[], int erasure_pos[], int (*op_table)[2]){
+static int factor(ELEM *matrix, int width, int height, unsigned int row_weight[], unsigned int col_weight[], int erasure_pos[], int (*op_table)[2]){
     int i, j, k, m, p;
     int (*logline)[2]= malloc((width+1)*sizeof(*logline));
     int ops=0;
 
-    for(p=i=0; i<solvew; i++){
+    for(p=i=0; i<width; i++){
         int bestweight= height+1;
 
-        for(k=i; k<solvew; k++){
+        for(k=i; k<width; k++){
             if(col_weight[k] < bestweight){
                 bestweight=col_weight[k];
                 j= k;
@@ -244,7 +244,7 @@ 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= calloc(parity_len*parity_len, sizeof(ELEM));
+    ELEM *inv_matrix= calloc(parity_len*erasure_count, sizeof(ELEM));
     unsigned int *row_weight= c->temp;
     unsigned int *col_weight= c->temp + parity_len;
 
@@ -255,23 +255,23 @@ int EXT(init_matrixLDPC)(LDPCContext *c,
         for(j=0; j<nzc; j++){
             y= c->parity_matrix[x][0][j];
             if(y>=0){
-                inv_matrix[i + y*parity_len]= EXT(exp)[c->parity_matrix[x][1][j]];
+                inv_matrix[i + y*erasure_count]= EXT(exp)[c->parity_matrix[x][1][j]];
                 row_weight[y]++;
             }
         }
         col_weight[i]= nzc;
     }
 
-    rank= factor(inv_matrix, parity_len, parity_len, erasure_count, row_weight, col_weight, erasure_pos, c->op_table);
+    rank= factor(inv_matrix, erasure_count, parity_len, row_weight, col_weight, erasure_pos, c->op_table);
     x=0;
     for(j=erasure_count-1; j>=0; j--){
-        for(i=0; i<parity_len; i++){
-            if(i != j && inv_matrix[i + j*parity_len]){
+        for(i=0; i<erasure_count; i++){
+            if(i != j && inv_matrix[i + j*erasure_count]){
                 c->inv_matrix[x  ][0]= i;
 #if SIZE == 2
-                c->inv_matrix[x++][1]= -inv_matrix[i + j*parity_len];
+                c->inv_matrix[x++][1]= -inv_matrix[i + j*erasure_count];
 #else
-                c->inv_matrix[x++][1]= EXT(log)[inv_matrix[i + j*parity_len]];
+                c->inv_matrix[x++][1]= EXT(log)[inv_matrix[i + j*erasure_count]];
 #endif
             }
         }


More information about the Mndiff-dev mailing list