53 switch( _rle->
state ) {
58 printf(
"RLE_CS_READY:");
65 printf(
"RLE_CS_COUNTING:");
71 printf(
"RLE_CS_EMIT:");
78 printf(
"RLE_CS_EMIT_CONTINUE:");
84 printf(
"current = 0x%2.2x, count = %d\n", (
unsigned char) _current, (
unsigned char) _count );
91 MemoryBlock * pointer = _input, * endPointer = pointer + _size;
95 memset( output, 0, _size );
105 switch( _rle->
state ) {
113 if ( pointer == endPointer ) {
135 if ( pointer == endPointer ) {
142 if ( *pointer != current ) {
154 if ( count == 254 ) {
175 if ( (
unsigned char) current == 0xff ) {
216 *_output_size = (wpointer - output);
234 *_output_size = 200 * _size;
265 else if (token == 0xff) {
272 if ( token == 0xff ) {
306 *_output_size = (wpointer - output);
unsigned char MemoryBlock
MemoryBlock * rle_compress(RLECompressor *_rle, MemoryBlock *_input, int _size, int *_output_size)
void rle_echo_state(RLECompressor *_rle, char _current, int _count)
RLECompressor * rle_create()
MemoryBlock * rle_uncompress(RLECompressor *_rle, MemoryBlock *_input, int _size, int *_output_size)
void rle_free(RLECompressor *_rle)
struct _RLECompressor RLECompressor