osmo-bts-trx: rx_tchh_fn(): fix indexes in the AMR CMI lookup table

In change [1] I didn't take into account that the TCH/H burst buffer
is 6 bursts wide, and that we're decoding 2 bursts late:

  +---+---+---+---+---+---+
  | a | b | c | d | e | f |  Burst 'a' received first, 'f' last
  +---+---+---+---+---+---+
   ^^^^^^^^^^^^^^^           Speech frame (bursts 'a' .. 'd')
   ^^^^^^^^^^^^^^^^^^^^^^^   FACCH frame  (bursts 'a' .. 'f')

The lookup table for TCH/H was calculated with the assumption that
in rx_tchh_fn() the 'bi->fn' indicates TDMA frame number for burst
'd', but in reality it holds the frame number of burst 'f'.

Change-Id: I4f22cf49fd52ed26f8017f76461059a701c181e1
Fixes: [1] I46def864729c8f9063af201750456771ea5558d5
Related: SYS#5916
This commit is contained in:
Vadim Yanitskiy 2022-04-08 18:54:09 +03:00
parent c4368ce3ab
commit 94806cee7b
1 changed files with 15 additions and 7 deletions

View File

@ -45,15 +45,23 @@
#include <sched_utils.h>
#include <loops.h>
/* 3GPP TS 45.009, table 3.2.1.3-{2,4}: AMR on Uplink TCH/H */
/* 3GPP TS 45.009, table 3.2.1.3-{2,4}: AMR on Uplink TCH/H.
*
* +---+---+---+---+---+---+
* | a | b | c | d | e | f | Burst 'a' received first
* +---+---+---+---+---+---+
* ^^^^^^^^^^^^^^^^^^^^^^^ FACCH frame (bursts 'a' .. 'f')
* ^^^^^^^^^^^^^^^ Speech frame (bursts 'a' .. 'd')
*
* TDMA frame number of burst 'f' is always used as the table index. */
static const uint8_t sched_tchh_ul_amr_cmi_map[26] = {
[6] = 1, /* TCH/H(0): first=0 / last=6 */
[15] = 1, /* TCH/H(0): first=8 / last=15 */
[23] = 1, /* TCH/H(0): first=17 / last=23 */
[10] = 1, /* TCH/H(0): a=0 / d=6 / f=10 */
[19] = 1, /* TCH/H(0): a=8 / d=15 / f=19 */
[2] = 1, /* TCH/H(0): a=17 / d=23 / f=2 */
[7] = 1, /* TCH/H(1): first=1 / last=7 */
[16] = 1, /* TCH/H(1): first=9 / last=16 */
[24] = 1, /* TCH/H(1): first=18 / last=24 */
[11] = 1, /* TCH/H(1): a=1 / d=7 / f=11 */
[20] = 1, /* TCH/H(1): a=9 / d=16 / f=20 */
[3] = 1, /* TCH/H(1): a=18 / d=24 / f=3 */
};
/*! \brief a single TCH/H burst was received by the PHY, process it */