1
/* bitplex - Parallel bit stream module.
2
Copyright (c) 2007, 2008, Robert D. Cameron.
3
Licensed to the public under the Open Software License 3.0.
4
Licensed to International Characters, Inc., under the Academic
7
Given a character stream of 8-bit code units, this module
8
produces a parallel bit stream representation.
16
A BitBlockBasis is a set of 8 parallel bit blocks that represent
17
a block of 8-bit code units in bit-parallel form.
19
An array of BitBlockBasis blocks is used to represent parallel
20
bit stream data. This means that the individual bit streams are
21
are interleaved on a block-by-block basis. The advantage of this
22
representation is that the transposition process can write out the
23
bit stream data in a single linear stream.
27
struct BitBlockBasis {
31
static inline BitBlock BitStreamBlock(BitBlockBasis * x8basis, int bit_no, int block_no) {
32
return x8basis[block_no].bit[bit_no];
35
/* A BitPlex object holds the parallel bit stream representation of
36
a buffer of 8-bit character data. */
43
BitBlockBasis * x8basis;
45
void TransposeToBitStreams(BytePack * pseudo_ASCII_stream, int blocks);