summaryrefslogtreecommitdiff
path: root/cesar/mac/pbproc/inc/sacki_enc.h
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/mac/pbproc/inc/sacki_enc.h')
-rw-r--r--cesar/mac/pbproc/inc/sacki_enc.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/cesar/mac/pbproc/inc/sacki_enc.h b/cesar/mac/pbproc/inc/sacki_enc.h
new file mode 100644
index 0000000000..6597a72c29
--- /dev/null
+++ b/cesar/mac/pbproc/inc/sacki_enc.h
@@ -0,0 +1,57 @@
+#ifndef mac_pbproc_inc_sacki_enc_h
+#define mac_pbproc_inc_sacki_enc_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file mac/pbproc/inc/sacki_enc.h
+ * \brief SACKI compression.
+ * \ingroup mac_pbproc
+ */
+
+/** SACKI compression context. */
+struct pbproc_sacki_enc_t
+{
+ /** SACKI buffer. */
+ u32 si[3];
+ /** SACKI buffer start offset. */
+ uint sis;
+ /** SACKI buffer available length. */
+ uint sil;
+ /** CRC bitmap start offset. */
+ u32 bmps;
+};
+typedef struct pbproc_sacki_enc_t pbproc_sacki_enc_t;
+
+BEGIN_DECLS
+
+/**
+ * Initialise context.
+ * \param ctx SACKI compression context
+ * \param sil SACKI buffer size
+ */
+void
+pbproc_sacki_enc_init (pbproc_sacki_enc_t *ctx, uint sil);
+
+/**
+ * Process bitmap CRC bits.
+ * \param ctx SACKI compression context
+ * \param bmp CRC bitmap address
+ * \param bmpl CRC bitmap total number of available bits (including those
+ * precessed yet)
+ * \param final true if no more bits is following
+ *
+ * The compression can be done in several steps. In this case, this function
+ * should be called again.
+ */
+void
+pbproc_sacki_enc_process (pbproc_sacki_enc_t *ctx, const volatile u32 *bmp,
+ uint bmpl, bool final);
+
+END_DECLS
+
+#endif /* mac_pbproc_inc_sacki_enc_h */