fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/27775 )

Change subject: osmo-bts-trx: amr_loop: allow upgrading codec mode > 0
......................................................................

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
---
M src/osmo-bts-trx/amr_loop.c
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/src/osmo-bts-trx/amr_loop.c b/src/osmo-bts-trx/amr_loop.c
index 90b156c..6afb5f3 100644
--- a/src/osmo-bts-trx/amr_loop.c
+++ b/src/osmo-bts-trx/amr_loop.c
@@ -71,6 +71,7 @@
        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 @@
                                  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 @@
                                  mi, cfg->mode[mi].mode, mi + 1, cfg->mode[mi 
+ 1].mode,
                                  lqual_cb, thresh_upper_cb);
                        chan_state->dl_cmr++;
+                       return;
                }
        }
 }



2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27775
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I4c0fb28813373c3d4addd28c66f5136d2c4f9ed8
Gerrit-Change-Number: 27775
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to