summaryrefslogtreecommitdiff
path: root/cesar/lib/bitstream.h
diff options
context:
space:
mode:
authorschodet2008-09-04 13:38:15 +0000
committerschodet2008-09-04 13:38:15 +0000
commit64ad1ac026fc949e501c986df6f78b37f0f4d60a (patch)
tree3b217bfbac9cc018f5a7fc2c111e68ffd2f27a21 /cesar/lib/bitstream.h
parentb32bd09028f1129e3b81cbcafeadcab37fd944c2 (diff)
* lib/bitstream:
- added direct access. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@2856 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/lib/bitstream.h')
-rw-r--r--cesar/lib/bitstream.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/cesar/lib/bitstream.h b/cesar/lib/bitstream.h
index 38a1a50438..0635f02f82 100644
--- a/cesar/lib/bitstream.h
+++ b/cesar/lib/bitstream.h
@@ -311,6 +311,48 @@ uint
bitstream_access_str (bitstream_t *ctx, char *str, uint size);
/**
+ * Read up to 32 bits from a bit stream.
+ * \param data stream data pointer
+ * \param bit_offset bit offset inside stream
+ * \param nb_bits number of bits to read (1-32)
+ * \return unsigned read value
+ */
+uint
+bitstream_direct_read (const void *data, uint bit_offset, uint nb_bits);
+
+/**
+ * Read from 33 up to 64 bits from a bit stream.
+ * \param data stream data pointer
+ * \param bit_offset bit offset inside stream
+ * \param nb_bits number of bits to read (33-64)
+ * \return unsigned read value
+ */
+u64
+bitstream_direct_read_large (const void *data, uint bit_offset, uint nb_bits);
+
+/**
+ * Write up to 32 bits to a bit stream.
+ * \param data stream data pointer
+ * \param bit_offset bit offset inside stream
+ * \param value value to write
+ * \param nb_bits number of bits to write (1-32)
+ */
+void
+bitstream_direct_write (void *data, uint bit_offset, uint value,
+ uint nb_bits);
+
+/**
+ * Write from 33 up to 64 bits to a bit stream.
+ * \param data stream data pointer
+ * \param bit_offset bit offset inside stream
+ * \param value value to write
+ * \param nb_bits number of bits to write (33-64)
+ */
+void
+bitstream_direct_write_large (void *data, uint bit_offset, u64 value,
+ uint nb_bits);
+
+/**
* Provide a API similar to libc memcpy to copy data between two bit streams.
* \param dest destination address
* \param src source address