<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/17470">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gsm690: Fix amr speech bit length table<br><br>The table amr_len_by_ft represents the length of the raw AMR speech bits<br>in bytes. The table is based on the Table found in RFC 4867 §3.6, Table 1,<br>Column "Total speech bits". The number of bits is divided by 8 and then<br>rounded up to get the number of consumed octets.<br><br>An AMR SID frame (including STI and MI) takes up 39 bits, this will<br>result in 5 octets, not in 7. Lets correct this.<br><br>Related: OS#2978<br>Change-Id: Icf330450981b32be5d1cee5b10aa92bac4cb72f5<br>---<br>M src/codec/gsm690.c<br>M tests/codec/codec_test.ok<br>2 files changed, 4 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/codec/gsm690.c b/src/codec/gsm690.c</span><br><span>index 1955716..8ab1df1 100644</span><br><span>--- a/src/codec/gsm690.c</span><br><span>+++ b/src/codec/gsm690.c</span><br><span>@@ -216,8 +216,9 @@</span><br><span>        92,  31,  52,  65,  86,</span><br><span> };</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* See also RFC 4867 §3.6, Table 1, Column "Total speech bits" */</span><br><span> static const uint8_t amr_len_by_ft[16] = {</span><br><span style="color: hsl(0, 100%, 40%);">-  12, 13, 15, 17, 19, 20, 26, 31, 7,  0,  0,  0,  0,  0,  0,  0</span><br><span style="color: hsl(120, 100%, 40%);">+ 12, 13, 15, 17, 19, 20, 26, 31, 5,  0,  0,  0,  0,  0,  0,  0</span><br><span> };</span><br><span> </span><br><span> const struct value_string osmo_amr_type_names[] = {</span><br><span>diff --git a/tests/codec/codec_test.ok b/tests/codec/codec_test.ok</span><br><span>index 5307023..b8cba19 100644</span><br><span>--- a/tests/codec/codec_test.ok</span><br><span>+++ b/tests/codec/codec_test.ok</span><br><span>@@ -1,6 +1,6 @@</span><br><span> AMR RTP payload decoder test:</span><br><span style="color: hsl(0, 100%, 40%);">-[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]</span><br><span style="color: hsl(0, 100%, 40%);">-[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]</span><br><span style="color: hsl(120, 100%, 40%);">+[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]</span><br><span style="color: hsl(120, 100%, 40%);">+[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]</span><br><span> [2/2] No Data/NA, CMR: OK, FT: OK, BFI: OK, CMI: -1, STI: -1</span><br><span> [2/2] No Data/NA, CMR: OK, FT: OK, BFI: OK, CMI: -1, STI: -1</span><br><span> [33/33] AMR 12,2 kbit/s (GSM-EFR), CMR: OK, FT: OK, BFI: OK, CMI: -1, STI: -1</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/17470">change 17470</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/17470"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Icf330450981b32be5d1cee5b10aa92bac4cb72f5 </div>
<div style="display:none"> Gerrit-Change-Number: 17470 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jean-Francois Dionne <jf.dionne@nutaq.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: jfdionne <jf.dionne@nutaq.com> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>