summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYacine Belkadi2012-07-04 07:57:00 +0200
committerYacine Belkadi2012-07-19 08:44:36 +0200
commit189025333076be23861c36106f2e7bce319c0f9a (patch)
treef7e6f53599c16fc95eb25046d2760a7376898169
parent8c19dcab885de65362299ae4d029e14401f64f25 (diff)
cesar/ce/rx: add missing update of carrier_nb, closes #3226
Disabling the first two carriers changes the number of used carriers. So carrier_nb needs to be updated. Without that, in ce_rx_bl_compute_tone_map_iterative(), ce_rx_bl_update_tone_map_under_ber_consign() will put r_nb elements in opti[][], but ce_rx_bl_sort_optimization() will sort i_nb elements of opti[][], where r_nb is the real number of used carriers, and i_nb is the initial (non updated) number of used carriers. So if, for example, i_nb is 1355 and r_nb is 1353, this will lead to the use of whatever random values are present at the end of opti[][]. Depending on the values, this may result in: - "../../mac/common/src/tonemap.c:233: assertion failure in tonemap_get_tone: index < PHY_CARRIER_NB" - incorrect CE computation results
-rw-r--r--cesar/ce/rx/bitloading/test/src/test_bl.c1
-rw-r--r--cesar/ce/rx/src/tonemask.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/cesar/ce/rx/bitloading/test/src/test_bl.c b/cesar/ce/rx/bitloading/test/src/test_bl.c
index e09b6d5bcc..ffec2d9782 100644
--- a/cesar/ce/rx/bitloading/test/src/test_bl.c
+++ b/cesar/ce/rx/bitloading/test/src/test_bl.c
@@ -711,6 +711,7 @@ test_suite_ce_rx_bl_initial (test_t t)
modified_ti.tonemask[i] = i % 2 ? BITS_ONES (32) : 0;
}
modified_ti.tonemask[i] = BITS_ONES (32);
+ modified_ti.carrier_nb = tonemask_carrier_nb (modified_ti.tonemask);
tonemap_t *tm = ce_rx_bl_initial (&ti, &modified_ti, &bl);
uint tone;
diff --git a/cesar/ce/rx/src/tonemask.c b/cesar/ce/rx/src/tonemask.c
index 902909afcc..b827c9e9a1 100644
--- a/cesar/ce/rx/src/tonemask.c
+++ b/cesar/ce/rx/src/tonemask.c
@@ -23,4 +23,5 @@ ce_rx_tonemask_init (tonemask_info_t *ti)
/* Disable first two carriers (see maria:#601) */
ti->tonemask[0] = ti->tonemask[0] | 0x3;
+ ti->carrier_nb = tonemask_carrier_nb (ti->tonemask);
}