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

michael subversion at mplayerhq.hu
Tue Jul 13 10:46:32 CEST 2010


Author: michael
Date: Tue Jul 13 10:46:32 2010
New Revision: 191

Log:
Optimize LDPC syndrom computation from O(n*nzc) to O(n+k*nzc)
10% faster

Modified:
   trunk/noe/ldpc.c

Modified: trunk/noe/ldpc.c
==============================================================================
--- trunk/noe/ldpc.c	Tue Jul 13 10:46:31 2010	(r190)
+++ trunk/noe/ldpc.c	Tue Jul 13 10:46:32 2010	(r191)
@@ -291,6 +291,7 @@ int EXT(decodeLDPC)(LDPCContext *c, LDPC
 #if SIZE == 2
     for(i=0; i<code_len; i++){
         unsigned int v= code[i];
+        if(v)
         for(j=0; j<c->nzc; j++){
             int y= c->parity_matrix[i][0][j];
             if(y>=0){
@@ -328,7 +329,9 @@ int EXT(decodeLDPC)(LDPCContext *c, LDPC
     }
 #else
     for(i=0; i<code_len; i++){
-        unsigned int v= EXT(log)[ code[i] ];
+        unsigned int v= code[i];
+        if(v){
+            v= EXT(log)[v];
         for(j=0; j<c->nzc; j++){
             int y= c->parity_matrix[i][0][j];
             if(y>=0){
@@ -336,6 +339,7 @@ int EXT(decodeLDPC)(LDPCContext *c, LDPC
                 sp[y]= sum(sp[y], EXT(exp)[p + v]);
             }
         }
+        }
     }
 
     j=0;


More information about the Mndiff-dev mailing list