summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authordufour2010-04-20 12:03:08 +0000
committerdufour2010-04-20 12:03:08 +0000
commit1cd5f517c427654907ec860bc547e4f739b715be (patch)
tree724e6fefd454bbd855fc09cf8f6ed0a045c703e9 /cesar
parente6392926f526fff62c3020f750d6cb8b6e24ed15 (diff)
cesar/{ce/rx/bl,mac/common}: store BER target the tone map respects
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@6936 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar')
-rw-r--r--cesar/ce/rx/bitloading/src/bitloading.c9
-rw-r--r--cesar/mac/common/tonemap.h4
2 files changed, 10 insertions, 3 deletions
diff --git a/cesar/ce/rx/bitloading/src/bitloading.c b/cesar/ce/rx/bitloading/src/bitloading.c
index f07b2d009a..3dd94ac995 100644
--- a/cesar/ce/rx/bitloading/src/bitloading.c
+++ b/cesar/ce/rx/bitloading/src/bitloading.c
@@ -206,8 +206,9 @@ ce_rx_bl_compute_tone_map_iterative (const u64 bpt_initial[PHY_FEC_RATE_NB],
/* Check parameters. */
dbg_assert (bpt_initial);
dbg_assert (iteration_max);
+ dbg_assert (bl);
- u64 ber_prev, ber_cur;
+ u64 ber_prev[PHY_FEC_RATE_NB], ber_cur;
uint it_count;
/* Dynamic table size is not possible (because of compiler bug on stack).
* For the moment being we use a define (even if table is too big). */
@@ -249,7 +250,7 @@ ce_rx_bl_compute_tone_map_iterative (const u64 bpt_initial[PHY_FEC_RATE_NB],
(ber_cur, tonemask, bl, tm[fec_rate], opti, ber_weighted_sum,
tone_en);
/* Store previous BER consign. */
- ber_prev = ber_cur;
+ ber_prev[fec_rate] = ber_cur;
/* Get new BER consign. */
ber_cur = ce_rx_bl_ber_pt_bpt
(fec_rate, (tm[fec_rate]->bits_per_symbol *
@@ -262,7 +263,7 @@ ce_rx_bl_compute_tone_map_iterative (const u64 bpt_initial[PHY_FEC_RATE_NB],
}
/* Repeat until no modification of the BER consign or until maximum
* number of iterations is reached. */
- while (++it_count < iteration_max && ber_prev != ber_cur);
+ while (++it_count < iteration_max && ber_prev[fec_rate] != ber_cur);
/* Store generated tone map. */
sort[fec_rate] = tm[fec_rate]->bits_per_symbol;
}
@@ -288,6 +289,8 @@ ce_rx_bl_compute_tone_map_iterative (const u64 bpt_initial[PHY_FEC_RATE_NB],
tm[good]->fecrate = good;
/* Update pre-computed parameters. */
tonemap_update (tm[good], TONEMAP_P_PBERROR_DEFAULT_UF32);
+ /* Store BER consign of this tone map. */
+ tm[good]->ber = ber_prev[good];
/* Return best tone map. */
return tm[good];
}
diff --git a/cesar/mac/common/tonemap.h b/cesar/mac/common/tonemap.h
index 043acd166b..983a2ae842 100644
--- a/cesar/mac/common/tonemap.h
+++ b/cesar/mac/common/tonemap.h
@@ -182,6 +182,10 @@ struct tonemap_t
* deletion. When this value reaches 0, the tone map should be deleted.
*/
s8 released;
+ /**
+ * BER consign this tone map is respecting.
+ */
+ u64 ber;
};
typedef struct tonemap_t tonemap_t;