summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/bitloading/src/bitloading.c
diff options
context:
space:
mode:
authordufour2010-03-23 10:46:23 +0000
committerdufour2010-03-23 10:46:23 +0000
commit27dc31a1fbb11d290c62820ab9416a6ff954899b (patch)
tree3105afc0e729d29bd063ce6b9ce2bc74795c4991 /cesar/ce/rx/bitloading/src/bitloading.c
parent33af2962b7f1201b250495618db379af1ee2c2a8 (diff)
cesar/ce/rx/bl: extract loop to make tone map reach BER in unique function
This commit does not make any changes in the way bit loading algorithm works. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@6831 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/ce/rx/bitloading/src/bitloading.c')
-rw-r--r--cesar/ce/rx/bitloading/src/bitloading.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/cesar/ce/rx/bitloading/src/bitloading.c b/cesar/ce/rx/bitloading/src/bitloading.c
index db532489ce..3b41ccd5fa 100644
--- a/cesar/ce/rx/bitloading/src/bitloading.c
+++ b/cesar/ce/rx/bitloading/src/bitloading.c
@@ -132,10 +132,11 @@ ce_rx_bl_update_tone_map_under_ber_consign (u64 ber_pt,
uint
ce_rx_bl_update_tone_map_at_ber_consign (u64 ber_pt,
tonemask_info_t *tonemask,
- phy_fecrate_t fec_rate,
ce_rx_bitloading_t *bl,
tonemap_t *tm,
- ce_rx_bl_ber_impact_t *opti)
+ ce_rx_bl_ber_impact_t *opti,
+ u64 ber_weighted_sum,
+ uint tone_en)
{
/* Check parameters. */
dbg_assert (ber_pt < CE_RX_BL_BER_DEFAULT_OVER);
@@ -144,17 +145,6 @@ ce_rx_bl_update_tone_map_at_ber_consign (u64 ber_pt,
dbg_assert (bl);
dbg_assert (opti);
- uint tone_en;
-
- /* Make the tone map reach the BER consign without optimization. */
- u64 ber_weighted_sum =
- ce_rx_bl_update_tone_map_under_ber_consign (ber_pt, tonemask,
- fec_rate, bl, tm, opti,
- &tone_en);
-
- /* Sort optimization table. */
- ce_rx_bl_sort_optimization (opti, tonemask->carrier_nb);
-
uint pos = 0;
u32 *tone_word;
s8 mod = -1;
@@ -234,9 +224,20 @@ ce_rx_bl_compute_tone_map_iterative (const u64 bpt_initial[PHY_FEC_RATE_NB],
ber_cur = 0;
do
{
+ /* Make the tone map reach the BER consign, no optimization. */
+ u64 ber_weighted_sum =
+ ce_rx_bl_update_tone_map_under_ber_consign (ber_cur, tonemask,
+ fec_rate, bl,
+ tm[fec_rate],
+ opti, &tone_en);
+
+ /* Sort optimization table. */
+ ce_rx_bl_sort_optimization (opti, tonemask->carrier_nb);
+
/* Optimize tone map to reach BER consign. */
tone_en = ce_rx_bl_update_tone_map_at_ber_consign
- (ber_cur, tonemask, fec_rate, bl, tm[fec_rate], opti);
+ (ber_cur, tonemask, bl, tm[fec_rate], opti, ber_weighted_sum,
+ tone_en);
/* Store previous BER consign. */
ber_prev = ber_cur;
/* Get new BER consign. */