From: drowe67 Date: Tue, 13 Sep 2016 02:51:13 +0000 (+0000) Subject: added soft dec support X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=38278b74fbf68089af416d98a554840ef142306e;p=freetel-svn-tracking.git added soft dec support git-svn-id: https://svn.code.sf.net/p/freetel/code@2859 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/src/ldpc_enc.c b/codec2-dev/src/ldpc_enc.c index a371c59c..f6488603 100644 --- a/codec2-dev/src/ldpc_enc.c +++ b/codec2-dev/src/ldpc_enc.c @@ -41,9 +41,11 @@ int main(int argc, char *argv[]) unsigned char ibits[NUMBERROWSHCOLS]; unsigned char pbits[NUMBERPARITYBITS]; FILE *fin, *fout; + int sd, i; + double sdout[NUMBERROWSHCOLS+NUMBERPARITYBITS]; - if (argc < 2) { - fprintf(stderr, "usage: %s InputOneBytePerBit OuputOneBytePerBit\n", argv[0]); + if (argc < 3) { + fprintf(stderr, "usage: %s InputOneBytePerBit OuputFile [--sd]\n", argv[0]); exit(0); } @@ -60,13 +62,27 @@ int main(int argc, char *argv[]) argv[2], strerror(errno)); exit(1); } + + sd = 0; + if (argc == 4) + if (strcmp(argv[3], "--sd") == 0) + sd = 1; while (fread(ibits, sizeof(char), NUMBERROWSHCOLS, fin) == NUMBERROWSHCOLS) { encode(ibits, pbits); - fwrite(ibits, sizeof(char), NUMBERROWSHCOLS, fout); - fwrite(pbits, sizeof(char), NUMBERPARITYBITS, fout); + if (sd) { + for (i=0; i