Nebula
Loading...
Searching...
No Matches
Util::RunLengthCodec Class Reference

#include <runlengthcodec.h>

Detailed Description

A simple byte-based runlength encoder/decoder.

Note that the encoded size may actually be bigger then the original size for random data!

Static Public Member Functions

static SizeT GetSafeRLEBufferSize (SizeT srcBufferSize)
 get a safe size for the destination buffer
 
static SizeT ComputeDecodedSize (const uchar *srcPtr, SizeT srcNumBytes)
 compute the decoded byte size from an RLE encoded stream
 
static SizeT Encode (const uchar *srcPtr, SizeT srcNumBytes, uchar *dstPtr, SizeT dstNumBytes)
 encode byte buffer to RLE stream, returns size of RLE stream
 
static SizeT Decode (const uchar *srcPtr, SizeT srcNumBytes, uchar *dstPtr, SizeT dstNumBytes)
 decode RLE stream to byte buffer
 

Member Function Documentation

◆ ComputeDecodedSize()

SizeT Util::RunLengthCodec::ComputeDecodedSize ( const uchar * srcPtr,
SizeT srcNumBytes )
static

compute the decoded byte size from an RLE encoded stream

◆ Decode()

SizeT Util::RunLengthCodec::Decode ( const uchar * srcPtr,
SizeT srcNumBytes,
uchar * dstPtr,
SizeT dstNumBytes )
static

decode RLE stream to byte buffer

◆ Encode()

SizeT Util::RunLengthCodec::Encode ( const uchar * srcPtr,
SizeT srcNumBytes,
uchar * dstPtr,
SizeT dstNumBytes )
static

encode byte buffer to RLE stream, returns size of RLE stream

◆ GetSafeRLEBufferSize()

SizeT Util::RunLengthCodec::GetSafeRLEBufferSize ( SizeT srcBufferSize)
static

get a safe size for the destination buffer

Get some safe destination buffer size for runlength-encoding.

This actually can be up to twice as big as the source buffer for completely random data!


The documentation for this class was generated from the following files: