aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-04-13 18:16:05 +0300
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-04-20 15:18:32 +0300
commit64192c26e66d3c9d797e09bd56f9b77ec5d55d28 (patch)
tree7b581dcbf233a0a6a5f841b864d487ef66f9dd41
parentosmo-bts-trx: amr_loop: improve logging in trx_loop_amr_input() (diff)
downloadOsmoBTS-64192c26e66d3c9d797e09bd56f9b77ec5d55d28.tar.xz
OsmoBTS-64192c26e66d3c9d797e09bd56f9b77ec5d55d28.zip
osmo-bts-trx: amr_loop: allow upgrading codec mode > 0
With the current implementation the AMR loop is unable to upgrade the current codec mode unless it reaches the worst possible value. The problem is in the 'else' statement connection both 'if's. Change-Id: I4c0fb28813373c3d4addd28c66f5136d2c4f9ed8 Related: SYS#5917, OS#4984
-rw-r--r--src/osmo-bts-trx/amr_loop.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/osmo-bts-trx/amr_loop.c b/src/osmo-bts-trx/amr_loop.c
index 90b156cb..6afb5f3e 100644
--- a/src/osmo-bts-trx/amr_loop.c
+++ b/src/osmo-bts-trx/amr_loop.c
@@ -71,6 +71,7 @@ void trx_loop_amr_input(struct l1sched_chan_state *chan_state,
chan_state->lqual_cb_num = 0;
chan_state->lqual_cb_sum = 0;
+ /* If the current codec mode can be degraded */
if (mi > 0) {
/* The threshold/hysteresis is in 0.5 dB steps, convert to cB:
* 1dB is 10cB, so 0.5dB is 5cB - this is why we multiply by 5. */
@@ -83,8 +84,12 @@ void trx_loop_amr_input(struct l1sched_chan_state *chan_state,
mi, cfg->mode[mi].mode, mi - 1, cfg->mode[mi - 1].mode,
lqual_cb, thresh_lower_cb);
chan_state->dl_cmr--;
+ return;
}
- } else if (mi < chan_state->codecs - 1) {
+ }
+
+ /* If the current codec mode can be upgraded */
+ if (mi < chan_state->codecs - 1) {
/* The threshold/hysteresis is in 0.5 dB steps, convert to cB:
* 1dB is 10cB, so 0.5dB is 5cB - this is why we multiply by 5. */
const int thresh_upper_cb = cfg->mode[mi].threshold * 5 \
@@ -97,6 +102,7 @@ void trx_loop_amr_input(struct l1sched_chan_state *chan_state,
mi, cfg->mode[mi].mode, mi + 1, cfg->mode[mi + 1].mode,
lqual_cb, thresh_upper_cb);
chan_state->dl_cmr++;
+ return;
}
}
}