diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2017-08-14 16:03:10 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2017-08-14 16:03:10 -0700 |
commit | 3496ef34c6b3826d0f7139274dc19986da2ab282 (patch) | |
tree | e6d009aecfbc5bdcd95ee1142957b6996030f8cc | |
parent | 65ff82f8b53e25d3f2e5d65dbfaf4bc820e81673 (diff) | |
parent | 81a7988f38b291b75e81b32b9a882e16965b1020 (diff) |
Merge remote-tracking branch 'github/pr/1405'
-rw-r--r-- | gr-fec/lib/cc_encoder_impl.cc | 4 |
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; } } } |