From 4c085c30e742d9c2aa000cf66f1d0a810f20de8b Mon Sep 17 00:00:00 2001 From: drowe67 Date: Wed, 14 Sep 2016 07:57:59 +0000 Subject: [PATCH] spent a lot of time working out I need -O2 on this version to match The Ocatve/Mpdecode.mex results git-svn-id: https://svn.code.sf.net/p/freetel/code@2861 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2-dev/src/ldpc_dec.c | 77 ++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 42 deletions(-) diff --git a/codec2-dev/src/ldpc_dec.c b/codec2-dev/src/ldpc_dec.c index 912e5e7f..70af95a9 100644 --- a/codec2-dev/src/ldpc_dec.c +++ b/codec2-dev/src/ldpc_dec.c @@ -14,7 +14,12 @@ Build: - $ gcc -o ldpc_dec ldpc_dec.c mpdecode_core.c -Wall -lm -g + $ gcc -O2 -o ldpc_dec ldpc_dec.c mpdecode_core.c -Wall -lm -g + + Note: -O2 option was required to get identical results to MpDecode, + which is also compiled with -O2. Without it the number of bit errors + between C and Octave was different, especially when the code did + not converge and hit max_iters. TODO: [ ] C cmd line encoder @@ -76,28 +81,20 @@ int main(int argc, char *argv[]) fprintf(stderr, "Codeword length: %d\n", CodeLength); fprintf(stderr, "Parity Bits....: %d\n", NumberParityBits); - num_runs = 100; num_ok = 0; + num_runs = 1; num_ok = 0; for(r=0; r