summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiro Mahasinghe <niroshan@cellXica.net>2017-11-03 12:24:30 +0100
committerHarald Welte <laforge@gnumonks.org>2017-11-03 13:03:57 +0100
commitc526dbc24f3ec95771085967b9e300c9f9d4fc1f (patch)
treef26c686ea5aee8bf4212115ebc88599d3295c1e0
parent834e2ac0ead4544c207ed365151c8c898b5a949c (diff)
gsm0503_coding.c: Use majority vote in tch_efr_unreorder()
The EFR coding contains some repeated bits. In case there are transmission errors, some bits may of course get corrupted. It looks like there's an improvement can be made by taking a majority vote on those "repetition bits", i.e. if 2 out of 3 bits are the same, then use that instead of expecting to match all 3 bits. See 3GPP TS 45.003 Section 3.1.1.3 for reference. Change-Id: I2a28a4d7fb82aed4d39fe8efeea702effdba3858
-rw-r--r--src/coding/gsm0503_coding.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c
index c4bdb816..639d2df4 100644
--- a/src/coding/gsm0503_coding.c
+++ b/src/coding/gsm0503_coding.c
@@ -1743,16 +1743,16 @@ static void tch_efr_unreorder(ubit_t *s, ubit_t *p, const ubit_t *w)
memcpy(s, w, 71);
sum = s[69] + w[71] + w[72];
- s[69] = (sum > 2);
+ s[69] = (sum >= 2);
memcpy(s + 71, w + 73, 50);
sum = s[119] + w[123] + w[124];
- s[119] = (sum > 2);
+ s[119] = (sum >= 2);
memcpy(s + 121, w + 125, 53);
sum = s[172] + w[178] + w[179];
s[172] = (sum > 2);
memcpy(s + 174, w + 180, 50);
sum = s[222] + w[230] + w[231];
- s[222] = (sum > 2);
+ s[222] = (sum >= 2);
memcpy(s + 224, w + 232, 20);
memcpy(p, w + 252, 8);
}