From c526dbc24f3ec95771085967b9e300c9f9d4fc1f Mon Sep 17 00:00:00 2001 From: Niro Mahasinghe Date: Fri, 3 Nov 2017 12:24:30 +0100 Subject: 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 --- src/coding/gsm0503_coding.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/coding/gsm0503_coding.c') 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); } -- cgit v1.2.3