Attention is currently required from: falconia.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/37558?usp=email )
Change subject: codec: add osmo_hr_sid_classify() ......................................................................
Patch Set 2:
(2 comments)
File src/codec/hr_sid_class.c:
https://gerrit.osmocom.org/c/libosmocore/+/37558/comment/9781f8e8_314e66a0 PS2, Line 35: for (; byte; byte >>= 1) { This is absolutely fine for not so hot code paths, but if this is to be done for each byte of each RTP frame, I would recommend using a look-up table here. It can contain bit count for all 4-bit values, so then you could do:
``` return table[byte >> 4] + table[byte & 0x0f]. ```
https://gerrit.osmocom.org/c/libosmocore/+/37558/comment/91be866d_6ca1e1ec PS2, Line 144: class1_ones = sid_field_ones - class2_ones; I am wondering if, in theory, `class2_ones` can be greater than `sid_field_ones`? We'll end up with a huge number in this case.