diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2017-08-14 16:37:51 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2017-08-14 16:37:51 -0700 |
commit | 4afd8d5094e1932e98dc36c52ef8e6a5e637afb6 (patch) | |
tree | c33b7514bd56e06953da1593dd94a58ee78d2724 /gr-fec/lib/cc_encoder_impl.cc | |
parent | 7f3bc9cf41bae6c5ddccf4e0f1ce225458fa5fe8 (diff) | |
parent | 1db4890b85375a0b9cff035c4bff3580282f7ad1 (diff) |
Merge branch 'next' into python3
Diffstat (limited to 'gr-fec/lib/cc_encoder_impl.cc')
-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; } } } |