unsigned int in_offset, out_offset;
int *probelist, out_bit;
unsigned int i;
- uint64_t sample_in, sample_out;
+ uint8_t *sample_in, *sample_out;
if (!probe_array) {
sr_err("%s: probe_array was NULL", __func__);
/* If we reached this point, not all probes are used, so "compress". */
in_offset = out_offset = 0;
while (in_offset <= length_in - in_unitsize) {
- memcpy(&sample_in, data_in + in_offset, in_unitsize);
- sample_out = out_bit = 0;
+ sample_in = data_in + in_offset;
+ sample_out = (*data_out) + out_offset;
+ memset(sample_out, 0, out_unitsize);
+ out_bit = 0;
for (i = 0; i < probe_array->len; i++) {
- if (sample_in & (1 << (probelist[i])))
- sample_out |= (1 << out_bit);
+ if (sample_in[probelist[i]>>3] & (1 << (probelist[i]&7)))
+ sample_out[out_bit>>3] |= (1 << (out_bit&7));
out_bit++;
}
- memcpy((*data_out) + out_offset, &sample_out, out_unitsize);
in_offset += in_unitsize;
out_offset += out_unitsize;
}