summaryrefslogtreecommitdiff
path: root/gr-fec/lib/cc_encoder_impl.cc
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2017-08-14 16:37:30 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2017-08-14 16:37:30 -0700
commit1db4890b85375a0b9cff035c4bff3580282f7ad1 (patch)
tree703afdc22e4b4cfbf7c9ff330712ef6625dbe468 /gr-fec/lib/cc_encoder_impl.cc
parentb2a280a9ad4ad13f958fc2e09e29f8afe48b0473 (diff)
parentefcfde0e92e8fae886754436e6ad82d58831d194 (diff)
Merge branch 'master' into next
Diffstat (limited to 'gr-fec/lib/cc_encoder_impl.cc')
-rw-r--r--gr-fec/lib/cc_encoder_impl.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gr-fec/lib/cc_encoder_impl.cc b/gr-fec/lib/cc_encoder_impl.cc
index 75d7dcd66b..9585d5fcd5 100644
--- a/gr-fec/lib/cc_encoder_impl.cc
+++ b/gr-fec/lib/cc_encoder_impl.cc
@@ -179,7 +179,7 @@ namespace gr {
for(unsigned int i = 0; i < d_frame_size; ++i) {
my_state = (my_state << 1) | (in[i] & 1);
for(unsigned int j = 0; j < d_rate; ++j) {
- out[i * d_rate + j] = parity(my_state & d_polys[j]) == 0 ? 0 : 1;
+ out[i * d_rate + j] = (d_polys[j] < 0) ^ parity(my_state & abs(d_polys[j])) ? 1 : 0;
}
}
@@ -187,7 +187,7 @@ namespace gr {
for(unsigned int i = 0; i < d_k - 1; ++i) {
my_state = (my_state << 1) | ((d_start_state >> (d_k - 2 - i)) & 1);
for(unsigned int j = 0; j < d_rate; ++j) {
- out[(i + d_frame_size) * d_rate + j] = parity(my_state & d_polys[j]) == 0 ? 0 : 1;
+ out[(i + d_frame_size) * d_rate + j] = (d_polys[j] < 0) ^ parity(my_state & abs(d_polys[j])) ? 1 : 0;
}
}
}