diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2023-05-22 21:19:05 +0700 |
---|---|---|
committer | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2023-05-29 18:51:04 +0700 |
commit | f81a1711f2f1f1f0b1c419a21033cbb9104fc9d4 (patch) | |
tree | b4d5680d5c90301dad6de95362e87da3d8199744 | |
parent | 66c7ec1bf35b4a2f21c91231f36bd8296a294d6e (diff) |
trxcon/l1sched: cosmetic: get rid of amr_is_cmr/fn_is_cmi
Change-Id: Ic8df73326befa387daead0a0dcbb8c9a1461021e
Related: OS#4396
-rw-r--r-- | src/host/trxcon/src/sched_lchan_tchf.c | 16 | ||||
-rw-r--r-- | src/host/trxcon/src/sched_lchan_tchh.c | 17 |
2 files changed, 15 insertions, 18 deletions
diff --git a/src/host/trxcon/src/sched_lchan_tchf.c b/src/host/trxcon/src/sched_lchan_tchf.c index 1a00a936..3674bb7e 100644 --- a/src/host/trxcon/src/sched_lchan_tchf.c +++ b/src/host/trxcon/src/sched_lchan_tchf.c @@ -66,7 +66,6 @@ int rx_tchf_fn(struct l1sched_lchan_state *lchan, size_t l2_len; int amr = 0; uint8_t ft; - bool amr_is_cmr; /* Set up pointers */ mask = &lchan->rx_burst_mask; @@ -122,20 +121,19 @@ int rx_tchf_fn(struct l1sched_lchan_state *lchan, 1, 1, &n_errors, &n_bits_total); break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ - /* the first FN 4,13,21 defines that CMI is included in frame, - * the first FN 0,8,17 defines that CMR/CMC is included in frame. - * NOTE: A frame ends 7 FN after start. - */ - amr_is_cmr = !sched_tchf_dl_amr_cmi_map[bi->fn % 26]; - /* we store tch_data + 2 header bytes, the amr variable set to * 2 will allow us to skip the first 2 bytes in case we did * receive an FACCH frame instead of a voice frame (we do not * know this before we actually decode the frame) */ amr = 2; rc = gsm0503_tch_afs_decode_dtx(l2 + amr, buffer, - amr_is_cmr, lchan->amr.codec, lchan->amr.codecs, &lchan->amr.dl_ft, - &lchan->amr.dl_cmr, &n_errors, &n_bits_total, &lchan->amr.last_dtx); + !sched_tchf_dl_amr_cmi_map[bi->fn % 26], + lchan->amr.codec, + lchan->amr.codecs, + &lchan->amr.dl_ft, + &lchan->amr.dl_cmr, + &n_errors, &n_bits_total, + &lchan->amr.last_dtx); /* only good speech frames get rtp header */ if (rc != GSM_MACBLOCK_LEN && rc >= 4) { diff --git a/src/host/trxcon/src/sched_lchan_tchh.c b/src/host/trxcon/src/sched_lchan_tchh.c index 303d59ee..04a8bff0 100644 --- a/src/host/trxcon/src/sched_lchan_tchh.c +++ b/src/host/trxcon/src/sched_lchan_tchh.c @@ -243,7 +243,6 @@ int rx_tchh_fn(struct l1sched_lchan_state *lchan, size_t l2_len; int amr = 0; uint8_t ft; - bool fn_is_cmi; /* Set up pointers */ mask = &lchan->rx_burst_mask; @@ -307,17 +306,17 @@ int rx_tchh_fn(struct l1sched_lchan_state *lchan, &n_errors, &n_bits_total); break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ - /* the first FN FN 4,13,21 or 5,14,22 defines that CMI is - * included in frame, the first FN FN 0,8,17 or 1,9,18 defines - * that CMR/CMC is included in frame. */ - fn_is_cmi = sched_tchh_dl_amr_cmi_map[bi->fn % 26]; - /* See comment in function rx_tchf_fn() */ amr = 2; rc = gsm0503_tch_ahs_decode_dtx(l2 + amr, buffer, - !sched_tchh_dl_facch_map[bi->fn % 26], - !fn_is_cmi, lchan->amr.codec, lchan->amr.codecs, &lchan->amr.dl_ft, - &lchan->amr.dl_cmr, &n_errors, &n_bits_total, &lchan->amr.last_dtx); + !sched_tchh_dl_facch_map[bi->fn % 26], + !sched_tchh_dl_amr_cmi_map[bi->fn % 26], + lchan->amr.codec, + lchan->amr.codecs, + &lchan->amr.dl_ft, + &lchan->amr.dl_cmr, + &n_errors, &n_bits_total, + &lchan->amr.last_dtx); /* only good speech frames get rtp header */ if (rc != GSM_MACBLOCK_LEN && rc >= 4) { |