aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx/gsm0503_mapping.c
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-03-14 07:56:05 +0100
committerHarald Welte <laforge@gnumonks.org>2015-09-22 16:41:27 +0200
commit84b9a445351937703334629f3fec02689153f986 (patch)
treef66ca064ed111eed011491332213be3bb3d20293 /src/osmo-bts-trx/gsm0503_mapping.c
parent7ff22823ca8e2dd1e990578a2dbf6942b1911eed (diff)
TRX: Code cleanup, prepare for other codecs than GSM full rate
Diffstat (limited to 'src/osmo-bts-trx/gsm0503_mapping.c')
-rw-r--r--src/osmo-bts-trx/gsm0503_mapping.c49
1 files changed, 28 insertions, 21 deletions
diff --git a/src/osmo-bts-trx/gsm0503_mapping.c b/src/osmo-bts-trx/gsm0503_mapping.c
index e5ee9206..bdaddcef 100644
--- a/src/osmo-bts-trx/gsm0503_mapping.c
+++ b/src/osmo-bts-trx/gsm0503_mapping.c
@@ -30,36 +30,43 @@ void gsm0503_xcch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *hl,
eB[58] = *hn;
}
-void gsm0503_tch_fr_burst_unmap(sbit_t *iB, sbit_t *eB, sbit_t *h, int odd)
+void gsm0503_tch_burst_unmap(sbit_t *iB, sbit_t *eB, sbit_t *h, int odd)
{
int i;
/* brainfuck: only copy even or odd bits */
- for (i=odd; i<57; i+=2)
- iB[i] = eB[i];
- for (i=58-odd; i<114; i+=2)
- iB[i] = eB[i+2];
-
- if (h && !odd)
- *h = eB[58];
-
- if (h && odd)
- *h = eB[57];
+ if (iB) {
+ for (i=odd; i<57; i+=2)
+ iB[i] = eB[i];
+ for (i=58-odd; i<114; i+=2)
+ iB[i] = eB[i+2];
+ }
+
+ if (h) {
+ if (!odd)
+ *h = eB[58];
+ else
+ *h = eB[57];
+ }
}
-void gsm0503_tch_fr_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd)
+void gsm0503_tch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd)
{
int i;
/* brainfuck: only copy even or odd bits */
- for (i=odd; i<57; i+=2)
- eB[i] = iB[i];
- for (i=58-odd; i<114; i+=2)
- eB[i+2] = iB[i];
-
- if (h && !odd)
- eB[58] = *h;
- if (h && odd)
- eB[57] = *h;
+ if (eB) {
+ for (i=odd; i<57; i+=2)
+ eB[i] = iB[i];
+ for (i=58-odd; i<114; i+=2)
+ eB[i+2] = iB[i];
+ }
+
+ if (h) {
+ if (!odd)
+ eB[58] = *h;
+ else
+ eB[57] = *h;
+ }
}