[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/09: Add a lookup table to the encoder in
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/09: Add a lookup table to the encoder inner loop for byte mode only (used by the ATSC transmitter). |
Date: |
Fri, 7 Mar 2014 17:52:58 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit 533d392ef938089e24318a771dcf0b7fa5cadbbf
Author: Ron Economos <address@hidden>
Date: Fri Feb 7 12:58:05 2014 -0800
Add a lookup table to the encoder inner loop for byte mode only
(used by the ATSC transmitter).
---
gr-fec/lib/reed-solomon/char.h | 1 +
gr-fec/lib/reed-solomon/encode_rs.c | 12 ++++++++++++
gr-fec/lib/reed-solomon/init_rs.c | 23 +++++++++++++++++++++++
3 files changed, 36 insertions(+)
diff --git a/gr-fec/lib/reed-solomon/char.h b/gr-fec/lib/reed-solomon/char.h
index f76ad95..4d3f22e 100644
--- a/gr-fec/lib/reed-solomon/char.h
+++ b/gr-fec/lib/reed-solomon/char.h
@@ -19,6 +19,7 @@ struct rs {
unsigned char fcr; /* First consecutive root, index form */
unsigned char prim; /* Primitive element, index form */
unsigned char iprim; /* prim-th root of 1, index form */
+ int *modnn_table; /* modnn lookup table, 512 entries */
};
static inline unsigned int modnn(struct rs *rs, unsigned int x){
diff --git a/gr-fec/lib/reed-solomon/encode_rs.c
b/gr-fec/lib/reed-solomon/encode_rs.c
index cd31f32..6a92255 100644
--- a/gr-fec/lib/reed-solomon/encode_rs.c
+++ b/gr-fec/lib/reed-solomon/encode_rs.c
@@ -35,12 +35,24 @@ DTYPE *data, DTYPE *bb){
feedback = MODNN(NN - GENPOLY[NROOTS] + feedback);
#endif
for(j=1;j<NROOTS;j++)
+#ifdef FIXED
+ bb[j] ^= ALPHA_TO[MODNN(feedback + GENPOLY[NROOTS-j])];
+#elif defined(BIGSYM)
bb[j] ^= ALPHA_TO[MODNN(feedback + GENPOLY[NROOTS-j])];
+#else
+ bb[j] ^= ALPHA_TO[rs->modnn_table[feedback + GENPOLY[NROOTS-j]]];
+#endif
}
/* Shift */
memmove(&bb[0],&bb[1],sizeof(DTYPE)*(NROOTS-1));
if(feedback != A0)
+#ifdef FIXED
+ bb[NROOTS-1] = ALPHA_TO[MODNN(feedback + GENPOLY[0])];
+#elif defined(BIGSYM)
bb[NROOTS-1] = ALPHA_TO[MODNN(feedback + GENPOLY[0])];
+#else
+ bb[NROOTS-1] = ALPHA_TO[rs->modnn_table[feedback + GENPOLY[0]]];
+#endif
else
bb[NROOTS-1] = 0;
}
diff --git a/gr-fec/lib/reed-solomon/init_rs.c
b/gr-fec/lib/reed-solomon/init_rs.c
index f50592b..c3d8921 100644
--- a/gr-fec/lib/reed-solomon/init_rs.c
+++ b/gr-fec/lib/reed-solomon/init_rs.c
@@ -23,6 +23,11 @@ void FREE_RS(void *p){
free(rs->alpha_to);
free(rs->index_of);
free(rs->genpoly);
+#ifdef FIXED
+#elif defined(BIGSYM)
+#else
+ free(rs->modnn_table);
+#endif
free(rs);
}
@@ -120,6 +125,24 @@ void *INIT_RS(unsigned int symsize,unsigned int
gfpoly,unsigned fcr,unsigned pri
for (i = 0; i <= nroots; i++)
rs->genpoly[i] = rs->index_of[rs->genpoly[i]];
+#ifdef FIXED
+#elif defined(BIGSYM)
+#else
+ /* Form modnn lookup table */
+ rs->modnn_table = (int *)malloc(sizeof(int)*(2<<((sizeof(unsigned
char))*8)));
+ if(rs->modnn_table == NULL){
+ free(rs->genpoly);
+ free(rs->alpha_to);
+ free(rs->index_of);
+ free(rs);
+ return NULL;
+ }
+ for(i = 0; i < (2<<((sizeof(unsigned char))*8)); i++){
+ j = i;
+ rs->modnn_table[i] = modnn(rs,j);
+ }
+#endif
+
#if 0
printf ("genpoly:\n");
for (i = nroots; i >= 0; i--){
- [Commit-gnuradio] [gnuradio] branch master updated (ca69ec5 -> f08f0f2), git, 2014/03/07
- [Commit-gnuradio] [gnuradio] 02/09: Merge branch 'maint', git, 2014/03/07
- [Commit-gnuradio] [gnuradio] 07/09: runtime: adds ability to output flowgraph in dot format (resolves issue 245)., git, 2014/03/07
- [Commit-gnuradio] [gnuradio] 08/09: Merge remote-tracking branch 'mbant/vocoder-fixes', git, 2014/03/07
- [Commit-gnuradio] [gnuradio] 05/09: vocoder: Fixed packing problem with Codec2, + GRC bindings, added example, git, 2014/03/07
- [Commit-gnuradio] [gnuradio] 09/09: vocoder: cleaned up documentation (removed warning on trademark symbol), git, 2014/03/07
- [Commit-gnuradio] [gnuradio] 03/09: Merge remote-tracking branch 'drmpeg/rs-optimize', git, 2014/03/07
- [Commit-gnuradio] [gnuradio] 04/09: fec: adding small comments in rs encoder about duplicated lines., git, 2014/03/07
- [Commit-gnuradio] [gnuradio] 01/09: Add a lookup table to the encoder inner loop for byte mode only (used by the ATSC transmitter).,
git <=
- [Commit-gnuradio] [gnuradio] 06/09: vocoder: Fixed GSM GRC bindings and improved docs, provided example, git, 2014/03/07