summaryrefslogtreecommitdiff
path: root/cesar/ce/src/tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/ce/src/tx.c')
-rwxr-xr-xcesar/ce/src/tx.c50
1 files changed, 27 insertions, 23 deletions
diff --git a/cesar/ce/src/tx.c b/cesar/ce/src/tx.c
index 6d16cff6ca..f8dd2e65a5 100755
--- a/cesar/ce/src/tx.c
+++ b/cesar/ce/src/tx.c
@@ -14,14 +14,17 @@
*/
#include "common/std.h"
#include <stdio.h>
+#include "cp/cp.h"
+#include "cp/inc/context.h"
+#include "ce/tx.h"
#include "ce/inc/tx.h"
#define TXCE
#include "ce/inc/cei.h"
static txce_t txce_global;
-txce_t *
-txce_init (mac_store_t *mac_store_ctx, mac_config_t *mac_config_ctx)
+void
+txce_init (cp_t *cp_ctx, mac_store_t *mac_store_ctx, mac_config_t *mac_config_ctx)
{
dbg_assert (mac_store_ctx);
dbg_assert (mac_config_ctx);
@@ -31,8 +34,27 @@ txce_init (mac_store_t *mac_store_ctx, mac_config_t *mac_config_ctx)
cyg_handle_t sys_clk = cyg_real_time_clock();
cyg_handle_t counter_hdl;
cyg_clock_to_counter (sys_clk, &counter_hdl);
- cyg_alarm_create (counter_hdl, alarm_cb, (cyg_addrword_t) ctx, &ctx->alarm_hdl, &ctx->alarm_obj);
- return (ctx);
+ cyg_alarm_create (counter_hdl, alarm_cb, (cyg_addrword_t) cp_ctx, &ctx->alarm_hdl, &ctx->alarm_obj);
+ cp_ctx->txce = ctx;
+}
+
+void
+txce (cp_t *cp_ctx, uint stei, u32 mmtype, bitstream_t *stream_reader)
+{
+ dbg_assert (cp_ctx);
+ txce_t *ctx = cp_ctx->txce;
+ if (stream_reader)
+ {
+ dbg_assert (mmtype == CM_CHAN_EST_IND || mmtype == CM_TM_UPDATE_IND);
+ dbg_assert (stei>=MAC_TEI_STA_MIN && stei<=MAC_TEI_STA_MAX);
+ // Get concerned tonemaps from stei.
+ sta_t *source_sta = mac_store_sta_get (ctx->mac_store_ctx, stei);
+ tonemaps_t *source_tms = source_sta->tx_tonemaps;
+ cei_decode (source_tms, mmtype, stream_reader, ctx->tonemask);
+ blk_release (source_sta);
+ }
+ cyg_tick_count_t next_expiration = txce_expiration_tonemaps_management (ctx);
+ cyg_alarm_initialize (ctx->alarm_hdl, next_expiration, 0);
}
cyg_tick_count_t
@@ -76,27 +98,9 @@ txce_expiration_tonemaps_management (txce_t *ctx)
}
void
-txce (txce_t *ctx, uint stei, u32 mmtype, u8 *mm_entry)
-{
- dbg_assert (ctx);
- if (mm_entry)
- {
- dbg_assert (mmtype == CM_CHAN_EST_IND || mmtype == CM_TM_UPDATE_IND);
- dbg_assert (stei>=MAC_TEI_STA_MIN && stei<=MAC_TEI_STA_MAX);
- // Get concerned tonemaps from stei.
- sta_t *source_sta = mac_store_sta_get (ctx->mac_store_ctx, stei);
- tonemaps_t *source_tms = source_sta->tx_tonemaps;
- cei_decode (source_tms, mmtype, mm_entry, ctx->tonemask);
- blk_release (source_sta);
- }
- cyg_tick_count_t next_expiration = txce_expiration_tonemaps_management (ctx);
- cyg_alarm_initialize (ctx->alarm_hdl, next_expiration, 0);
-}
-
-void
alarm_cb (cyg_handle_t alarm_hdl, cyg_addrword_t data)
{
dbg_assert (data);
- txce_t *ctx = (txce_t *) data;
+ cp_t *ctx = (cp_t *) data;
txce (ctx, 0, 0, NULL);
}