source: branches/parabix-svgopen-2008/src/bitplex.h @ 214

Last change on this file since 214 was 69, checked in by cameron, 11 years ago

Parallel Bit Stream Module

File size: 1.3 KB
Line 
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
5    Free License 3.0.
6
7    Given a character stream of 8-bit code units, this module
8    produces a parallel bit stream representation.
9
10
11*/
12#ifndef BITPLEX_H
13#define BITPLEX_H
14
15/*
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.
18
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.
24   
25*/
26
27struct BitBlockBasis {
28        BitBlock bit[8];
29};
30
31static inline BitBlock BitStreamBlock(BitBlockBasis * x8basis, int bit_no, int block_no) {
32        return x8basis[block_no].bit[bit_no];
33}
34
35/* A BitPlex object holds the parallel bit stream representation of
36   a buffer of 8-bit character data. */ 
37
38class Bitplex {
39public:
40        Bitplex ();
41        ~Bitplex ();
42
43        BitBlockBasis * x8basis;
44
45        void TransposeToBitStreams(BytePack * pseudo_ASCII_stream, int blocks);
46};
47
48
49#endif
Note: See TracBrowser for help on using the repository browser.