From: drowe67 Date: Thu, 7 Mar 2013 07:37:11 +0000 (+0000) Subject: FEC on 2000 mode implemented but not tested with errors (yet) X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=305de3228db0ffe812c262e910b0cadcd9c6ba9e;p=freetel-svn-tracking.git FEC on 2000 mode implemented but not tested with errors (yet) git-svn-id: https://svn.code.sf.net/p/freetel/code@1197 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/fdmdv2/src/fdmdv2_main.cpp b/fdmdv2/src/fdmdv2_main.cpp index b4aff0e9..ee08fca8 100644 --- a/fdmdv2/src/fdmdv2_main.cpp +++ b/fdmdv2/src/fdmdv2_main.cpp @@ -2470,22 +2470,24 @@ void per_frame_rx_processing( // FEC Decoding -------------------------------------------------------------- if (g_mode == MODE_2000) { + int recd_codeword, codeword1, codeword2; + /* decode first codeword */ recd_codeword = 0; for(i=0; i<12; i++) { recd_codeword <<= 1; - recd_codeword |= unpacked_input_bits[i]; + recd_codeword |= codec_bits[i]; } - for(i=bits_per_output_frame; i> (22-i); + codec_bits[i] = codeword1 >> (22-i); } /* decode second codeword */ @@ -2493,21 +2495,21 @@ void per_frame_rx_processing( recd_codeword = 0; for(i=12; i<24; i++) { recd_codeword <<= 1; - recd_codeword |= unpacked_input_bits[i]; + recd_codeword |= codec_bits[i]; } - for(i=bits_per_output_frame+11; i> (22-i); + codec_bits[12+i] = codeword2 >> (22-i); } - } + } - // extract data bit ------------------------------------------------------------ + // extract data bit ------------------------------------------------------------ data_flag_index = codec2_get_spare_bit_index(c2); printf("data_flag_index: %d\n", data_flag_index);