Attention is currently required from: falconia.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/37227?usp=email
to look at the new patch set (#3).
Change subject: codec: make osmo_hr_check_sid() more efficient
......................................................................
codec: make osmo_hr_check_sid() more efficient
The operation of checking an HRv1 codec frame for the possibility
of a perfect, error-free SID entails checking the last 79 bits
out of 112, to see if they are all 1s. This operation can be done
much more efficiently without using bitvec.
This change also affects the logic of what osmo_hr_check_sid() does
when the payload length argument is 0, or otherwise less than the
expected 14. The old code had a surely-unintended effect of
returning true on a 0-length payload; the new version returns false
(the input is not a perfect SID frame) if the payload length is 0
or otherwise shorter than GSM_HR_BYTES.
Change-Id: Ib14204102c03c14d6c5aab42b0ffbef2c3dda3fd
---
M src/codec/gsm620.c
1 file changed, 42 insertions(+), 12 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/37227/3
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37227?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib14204102c03c14d6c5aab42b0ffbef2c3dda3fd
Gerrit-Change-Number: 37227
Gerrit-PatchSet: 3
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/simtrace2/+/36980?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Code-Review+1 by laforge, Verified+1 by Jenkins Builder
Change subject: dissector: add support for sim polarity
......................................................................
dissector: add support for sim polarity
Needs testing.
Related: SYS#6946
Change-Id: If3ae350d0f4d737bc9e80c4f5d73cc1a39d076af
---
M contrib/simtrace.lua
1 file changed, 27 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/80/36980/4
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/36980?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: If3ae350d0f4d737bc9e80c4f5d73cc1a39d076af
Gerrit-Change-Number: 36980
Gerrit-PatchSet: 4
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: falconia.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/37227?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: codec: make osmo_hr_check_sid() more efficient
......................................................................
codec: make osmo_hr_check_sid() more efficient
The operation of checking an HRv1 codec frame for the possibility
of a perfect, error-free SID entails checking the last 79 bits
out of 112, to see if they are all 1s. This operation can be done
much more efficiently without using bitvec.
Change-Id: Ib14204102c03c14d6c5aab42b0ffbef2c3dda3fd
---
M src/codec/gsm620.c
1 file changed, 35 insertions(+), 12 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/37227/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37227?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib14204102c03c14d6c5aab42b0ffbef2c3dda3fd
Gerrit-Change-Number: 37227
Gerrit-PatchSet: 2
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newpatchset
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/37227?usp=email )
Change subject: codec: make osmo_hr_check_sid() more efficient
......................................................................
Patch Set 1:
(1 comment)
File src/codec/gsm620.c:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-16735):
https://gerrit.osmocom.org/c/libosmocore/+/37227/comment/e40ff9b5_06c9dddd
PS1, Line 281: {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
that open brace { should be on the previous line
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37227?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib14204102c03c14d6c5aab42b0ffbef2c3dda3fd
Gerrit-Change-Number: 37227
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Thu, 13 Jun 2024 20:59:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/37227?usp=email )
Change subject: codec: make osmo_hr_check_sid() more efficient
......................................................................
codec: make osmo_hr_check_sid() more efficient
The operation of checking an HRv1 codec frame for the possibility
of a perfect, error-free SID entails checking the last 79 bits
out of 112, to see if they are all 1s. This operation can be done
much more efficiently without using bitvec.
Change-Id: Ib14204102c03c14d6c5aab42b0ffbef2c3dda3fd
---
M src/codec/gsm620.c
1 file changed, 35 insertions(+), 12 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/37227/1
diff --git a/src/codec/gsm620.c b/src/codec/gsm620.c
index ef1d3b9..0489748 100644
--- a/src/codec/gsm620.c
+++ b/src/codec/gsm620.c
@@ -23,8 +23,6 @@
#include <stdbool.h>
#include <string.h>
-#include <osmocom/core/bitvec.h>
-#include <osmocom/core/utils.h>
#include <osmocom/codec/codec.h>
/* GSM HR unvoiced (mode=0) frames - subjective importance bit ordering */
@@ -270,21 +268,32 @@
* \param[in] rtp_payload Buffer with RTP payload
* \param[in] payload_len Length of payload
* \returns true if code word is found, false otherwise
+ *
+ * Note that this function checks only for a perfect, error-free SID.
+ * Unlike GSM 06.31 for FR or GSM 06.81 for EFR, GSM 06.41 spec for HR
+ * does not prescribe exact bit counting rules, hence detection of
+ * partially corrupted SID frames in downstream network elements
+ * without out-of-band indication is not possible.
*/
bool osmo_hr_check_sid(const uint8_t *rtp_payload, size_t payload_len)
{
- struct bitvec bv = {
- .data = (uint8_t *)rtp_payload,
- .data_len = payload_len,
- };
+ static const uint8_t all_ff_bytes[9] =
+ {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
- /* A SID frame is identified by a SID codeword consisting of 79 bits which are all 1,
- * so we basically check if all bits in range r34..r112 (inclusive) are 1. */
- for (bv.cur_bit = 33; bv.cur_bit < bv.data_len * 8; bv.cur_bit++)
- if (bitvec_get_bit_pos(&bv, bv.cur_bit) != ONE)
- return false;
+ if (payload_len < GSM_HR_BYTES)
+ return false;
- return true;
+ /* A SID frame is identified by a SID codeword consisting of 79 bits
+ * which are all 1, so we basically check if all bits in range
+ * r34..r112 (inclusive) are 1. However, given the position of
+ * these bits in the frame, the most efficient way to perform
+ * this check does not use any bit-level operations. */
+ if ((rtp_payload[4] & 0x7F) != 0x7F)
+ return false;
+ if (memcmp(rtp_payload + 5, all_ff_bytes, 9) == 0)
+ return true;
+ else
+ return false;
}
/*! Reset the SID field of a potentially corrupted, but still valid GSM-HR
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37227?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib14204102c03c14d6c5aab42b0ffbef2c3dda3fd
Gerrit-Change-Number: 37227
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newchange