Attention is currently required from: fixeria.
2 comments:
File src/trau/trau_rtp_conv.c:
if (xc_bits[i])
sum++;
Can we do `sum += xc_bits[i]` here? Theoretically, this should be better in terms of performance. […]
Given that the input bits come from other Osmocom library layers (osmo_i460 demux followed by trau_sync module), I would say that requiring each ubit_t to be strictly either 0 or 1 (for performance benefit) is fine. I'll change the code to do direct summation like you suggested.
Patch Set #2, Line 669: tf->xc_bits[0] = 0;
cosmetic: maybe use designated initializers to make it shorter / more readable? […]
Shorter != more readable in this case, I would argue. The way I have each bit explicitly broken out, with a comment on xc_bits[5] saying that it is odd parity, makes it much easier IMO to visually verify correctness against the official word of the spec.
However, I just thought of another way to make the code shorter, yet retain direct correspondence (perhaps even more direct) to how the table appears in the TS 48.061 spec - see the next patchset iteration.
To view, visit change 37287. To unsubscribe, or for help writing mail filters, visit settings.