libosmocore/src/coding
Vadim Yanitskiy 7790459c8e coding: fix decoding of AHS_SID_UPDATE frames (BER ~50%)
As was demonstrated in [1], there is a TCH/AHS specific problem in
libosmocoding causing unexpected BER ~50% in decoded AHS_SID_UPDATE
frames.  The reason is that A[H]S_SID_UPDATE employs quite tricky
interleaving algorithm, which is different from the algorithm used
by normal TCH/AHS speech frames or A[F]S_SID_UPDATE frames.

An AHS_SID_UPDATE frame consists of two halves (228 bits each):

  +---------+--------------------|---------+--------------------+
  | in-band |     SID marker     | in-band |     coded data     |
  +---------+--------------------|---------+--------------------+
  | 16 bits |      212 bits      | 16 bits |      212 bits      |

The first half contains coded in-band signalling data (16 bits) and
the identification marker (212 bits), which allows to detect that
it's an AHS_SID_UPDATE.  This half is carried by even bits of the
first two bursts and odd bits of the last two bursts.

The other half also contains the in-band data (16 bits), while the
remaining 212 bits contain encoded SID_UPDATE (212 bits).  This
half is carried by even bits of the last two bursts and odd bits
of the first two bursts.

Current implementation does not use odd bits of the first two
bursts at all, so buffer cB[] in gsm0503_tch_ahs_decode_dtx()
contains only 114 out of 228 bits.

This patch changes the logic, so that gsm0503_tch_ahs_decode_dtx()
would not split AHS_SID_UPDATE onto two frames anymore like its
TCH/AFS equivalent does, but attempt to deinterleave the second
half and attempt to decode the payload immediately.

Change-Id: I8686d895e96fa0e606c1898b6574cc80a8f46983
Related: [1] I434157e2091a306c039123cea08d84bd8533c937
Related: SYS#5853
2022-05-25 13:34:31 +00:00
..
Makefile.am Bump version: 1.5.1.282-ab5e-dirty → 1.6.0 2021-11-16 13:08:23 +01:00
gsm0503_amr_dtx.c coding: fix comments for detect_afs_sid_{first,update,onset} 2022-04-28 13:03:00 +00:00
gsm0503_coding.c coding: fix decoding of AHS_SID_UPDATE frames (BER ~50%) 2022-05-25 13:34:31 +00:00
gsm0503_interleaving.c treewide: remove FSF address 2021-12-14 12:44:03 +01:00
gsm0503_mapping.c treewide: remove FSF address 2021-12-14 12:44:03 +01:00
gsm0503_parity.c treewide: remove FSF address 2021-12-14 12:44:03 +01:00
gsm0503_tables.c treewide: remove FSF address 2021-12-14 12:44:03 +01:00
libosmocoding.map dtx: add decoding for AMR-DTX frames 2020-04-14 13:22:44 +00:00