Make fano.c decode 31 tail zeros instead of just 30. This decreases the probability of bad decodes somewhat.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5746 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Steven Franke 2015-08-02 23:18:51 +00:00
parent 29146ca41e
commit a9ed7a04d9

View File

@ -105,7 +105,7 @@ int fano(
unsigned int lsym; unsigned int lsym;
unsigned int i; unsigned int i;
if((nodes = (struct node *)malloc(nbits*sizeof(struct node))) == NULL) { if((nodes = (struct node *)malloc((nbits+1)*sizeof(struct node))) == NULL) {
printf("malloc failed\n"); printf("malloc failed\n");
return 0; return 0;
} }
@ -172,7 +172,7 @@ int fano(
} }
np[1].gamma = ngamma; // Move forward np[1].gamma = ngamma; // Move forward
np[1].encstate = np->encstate << 1; np[1].encstate = np->encstate << 1;
if(++np == lastnode) { if( ++np == (lastnode+1) ) {
break; // Done! break; // Done!
} }