Change in libosmocore[master]: gsm690: Fix amr speech bit length table

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sat Mar 14 17:36:23 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/17470 )

Change subject: gsm690: Fix amr speech bit length table
......................................................................

gsm690: Fix amr speech bit length table

The table amr_len_by_ft represents the length of the raw AMR speech bits
in bytes. The table is based on the Table found in RFC 4867 §3.6, Table 1,
Column "Total speech bits". The number of bits is divided by 8 and then
rounded up to get the number of consumed octets.

An AMR SID frame (including STI and MI) takes up 39 bits, this will
result in 5 octets, not in 7. Lets correct this.

Related: OS#2978
Change-Id: Icf330450981b32be5d1cee5b10aa92bac4cb72f5
---
M src/codec/gsm690.c
M tests/codec/codec_test.ok
2 files changed, 4 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/codec/gsm690.c b/src/codec/gsm690.c
index 1955716..8ab1df1 100644
--- a/src/codec/gsm690.c
+++ b/src/codec/gsm690.c
@@ -216,8 +216,9 @@
 	 92,  31,  52,  65,  86,
 };
 
+/* See also RFC 4867 §3.6, Table 1, Column "Total speech bits" */
 static const uint8_t amr_len_by_ft[16] = {
-	12, 13, 15, 17, 19, 20, 26, 31, 7,  0,  0,  0,  0,  0,  0,  0
+	12, 13, 15, 17, 19, 20, 26, 31, 5,  0,  0,  0,  0,  0,  0,  0
 };
 
 const struct value_string osmo_amr_type_names[] = {
diff --git a/tests/codec/codec_test.ok b/tests/codec/codec_test.ok
index 5307023..b8cba19 100644
--- a/tests/codec/codec_test.ok
+++ b/tests/codec/codec_test.ok
@@ -1,6 +1,6 @@
 AMR RTP payload decoder test:
-[9] decode RTP 20 44 00 00 00 00 04 OK: FT AMR SID, CMR AMR 5,90 kbit/s, CMI is 2, SID type FIRST	[9] encode [0]
-[9] decode RTP 20 44 29 c2 92 91 f4 OK: FT AMR SID, CMR AMR 5,90 kbit/s, CMI is 2, SID type UPDATE	[9] encode [0]
+[7] decode RTP 20 44 00 00 00 00 04 OK: FT AMR SID, CMR AMR 5,90 kbit/s, CMI is 2, SID type FIRST	[7] encode [0]
+[7] decode RTP 20 44 29 c2 92 91 f4 OK: FT AMR SID, CMR AMR 5,90 kbit/s, CMI is 2, SID type UPDATE	[7] encode [0]
 [2/2] No Data/NA, CMR: OK, FT: OK, BFI: OK, CMI: -1, STI: -1
 [2/2] No Data/NA, CMR: OK, FT: OK, BFI: OK, CMI: -1, STI: -1
 [33/33] AMR 12,2 kbit/s (GSM-EFR), CMR: OK, FT: OK, BFI: OK, CMI: -1, STI: -1

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/17470
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Icf330450981b32be5d1cee5b10aa92bac4cb72f5
Gerrit-Change-Number: 17470
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jean-Francois Dionne <jf.dionne at nutaq.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: jfdionne <jf.dionne at nutaq.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200314/39b40243/attachment.htm>


More information about the gerrit-log mailing list