summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-digital/lib/additive_scrambler_bb_impl.cc38
1 files changed, 11 insertions, 27 deletions
diff --git a/gr-digital/lib/additive_scrambler_bb_impl.cc b/gr-digital/lib/additive_scrambler_bb_impl.cc
index af87ebc6bb..ae7bf5172e 100644
--- a/gr-digital/lib/additive_scrambler_bb_impl.cc
+++ b/gr-digital/lib/additive_scrambler_bb_impl.cc
@@ -109,35 +109,19 @@ int additive_scrambler_bb_impl::work(int noutput_items,
unsigned char* out = (unsigned char*)output_items[0];
int reset_index = _get_next_reset_index(noutput_items);
- if (d_count >= 0) {
- for (int i = 0; i < noutput_items; i++) {
- unsigned char scramble_byte = 0x00;
- for (int k = 0; k < d_bits_per_byte; k++) {
- scramble_byte ^= (d_lfsr.next_bit() << k);
- }
- out[i] = in[i] ^ scramble_byte;
- d_bytes++;
- if (i == reset_index) {
- d_lfsr.reset();
- d_bytes = 0;
- reset_index = _get_next_reset_index(noutput_items, reset_index);
- }
+ for (int i = 0; i < noutput_items; i++) {
+ // Reset should occur at/before the item associated with the tag.
+ if (i == reset_index) {
+ d_lfsr.reset();
+ d_bytes = 0;
+ reset_index = _get_next_reset_index(noutput_items, reset_index);
}
- } else {
- for (int i = 0; i < noutput_items; i++) {
- // Reset should occur at/before the item associated with the tag.
- if (i == reset_index) {
- d_lfsr.reset();
- d_bytes = 0;
- reset_index = _get_next_reset_index(noutput_items, reset_index);
- }
- unsigned char scramble_byte = 0x00;
- for (int k = 0; k < d_bits_per_byte; k++) {
- scramble_byte ^= (d_lfsr.next_bit() << k);
- }
- out[i] = in[i] ^ scramble_byte;
- d_bytes++;
+ unsigned char scramble_byte = 0x00;
+ for (int k = 0; k < d_bits_per_byte; k++) {
+ scramble_byte ^= (d_lfsr.next_bit() << k);
}
+ out[i] = in[i] ^ scramble_byte;
+ d_bytes++;
}
return noutput_items;