An adaptive order-2 PPM range coder. More...
Macros | |
#define | ENET_BUILDING_LIB 1 |
#define | ENET_CONTEXT_CREATE(context, escapes_, minimum) |
#define | ENET_CONTEXT_DECODE(context, symbol_, code, value_, under_, count_, update, minimum, createRoot, visitNode, createRight, createLeft) |
#define | ENET_CONTEXT_ENCODE(context, symbol_, value_, under_, count_, update, minimum) |
#define | ENET_CONTEXT_NOT_EXCLUDED(value_, after, before) |
#define | ENET_CONTEXT_RESCALE(context, minimum) |
#define | ENET_CONTEXT_ROOT_DECODE(context, symbol_, code, value_, under_, count_, update, minimum, exclude) |
#define | ENET_CONTEXT_TRY_DECODE(context, symbol_, code, value_, under_, count_, update, minimum, exclude) ENET_CONTEXT_DECODE (context, symbol_, code, value_, under_, count_, update, minimum, return 0, exclude (node -> value, after, before), return 0, return 0) |
#define | ENET_RANGE_CODER_DECODE(under, count, total) |
#define | ENET_RANGE_CODER_ENCODE(under, count, total) |
#define | ENET_RANGE_CODER_FLUSH |
#define | ENET_RANGE_CODER_FREE_SYMBOLS |
#define | ENET_RANGE_CODER_OUTPUT(value) |
#define | ENET_RANGE_CODER_READ(total) ((decodeCode - decodeLow) / (decodeRange /= (total))) |
#define | ENET_RANGE_CODER_SEED |
#define | ENET_SYMBOL_CREATE(symbol, value_, count_) |
Typedefs | |
typedef struct _ENetRangeCoder | ENetRangeCoder |
typedef struct _ENetSymbol | ENetSymbol |
Enumerations | |
enum | { ENET_RANGE_CODER_TOP = 1<<24, ENET_RANGE_CODER_BOTTOM = 1<<16, ENET_CONTEXT_SYMBOL_DELTA = 3, ENET_CONTEXT_SYMBOL_MINIMUM = 1, ENET_CONTEXT_ESCAPE_MINIMUM = 1, ENET_SUBCONTEXT_ORDER = 2, ENET_SUBCONTEXT_SYMBOL_DELTA = 2, ENET_SUBCONTEXT_ESCAPE_DELTA = 5 } |
Functions | |
int | enet_host_compress_with_range_coder (ENetHost *host) |
Sets the packet compressor the host should use to the default range coder. More... | |
size_t | enet_range_coder_compress (void *context, const ENetBuffer *inBuffers, size_t inBufferCount, size_t inLimit, enet_uint8 *outData, size_t outLimit) |
void * | enet_range_coder_create (void) |
size_t | enet_range_coder_decompress (void *context, const enet_uint8 *inData, size_t inLimit, enet_uint8 *outData, size_t outLimit) |
void | enet_range_coder_destroy (void *context) |
An adaptive order-2 PPM range coder.
#define ENET_BUILDING_LIB 1 |
#define ENET_CONTEXT_CREATE | ( | context, | |
escapes_, | |||
minimum | |||
) |
Referenced by enet_range_coder_compress(), and enet_range_coder_decompress().
#define ENET_CONTEXT_DECODE | ( | context, | |
symbol_, | |||
code, | |||
value_, | |||
under_, | |||
count_, | |||
update, | |||
minimum, | |||
createRoot, | |||
visitNode, | |||
createRight, | |||
createLeft | |||
) |
#define ENET_CONTEXT_ENCODE | ( | context, | |
symbol_, | |||
value_, | |||
under_, | |||
count_, | |||
update, | |||
minimum | |||
) |
Referenced by enet_range_coder_compress(), and enet_range_coder_decompress().
#define ENET_CONTEXT_NOT_EXCLUDED | ( | value_, | |
after, | |||
before | |||
) |
Referenced by enet_range_coder_decompress().
#define ENET_CONTEXT_RESCALE | ( | context, | |
minimum | |||
) |
Referenced by enet_range_coder_compress(), and enet_range_coder_decompress().
#define ENET_CONTEXT_ROOT_DECODE | ( | context, | |
symbol_, | |||
code, | |||
value_, | |||
under_, | |||
count_, | |||
update, | |||
minimum, | |||
exclude | |||
) |
Referenced by enet_range_coder_decompress().
#define ENET_CONTEXT_TRY_DECODE | ( | context, | |
symbol_, | |||
code, | |||
value_, | |||
under_, | |||
count_, | |||
update, | |||
minimum, | |||
exclude | |||
) | ENET_CONTEXT_DECODE (context, symbol_, code, value_, under_, count_, update, minimum, return 0, exclude (node -> value, after, before), return 0, return 0) |
Referenced by enet_range_coder_decompress().
#define ENET_RANGE_CODER_DECODE | ( | under, | |
count, | |||
total | |||
) |
Referenced by enet_range_coder_decompress().
#define ENET_RANGE_CODER_ENCODE | ( | under, | |
count, | |||
total | |||
) |
Referenced by enet_range_coder_compress().
#define ENET_RANGE_CODER_FLUSH |
Referenced by enet_range_coder_compress().
#define ENET_RANGE_CODER_FREE_SYMBOLS |
Referenced by enet_range_coder_compress(), and enet_range_coder_decompress().
#define ENET_RANGE_CODER_OUTPUT | ( | value | ) |
Referenced by enet_range_coder_decompress().
#define ENET_RANGE_CODER_READ | ( | total | ) | ((decodeCode - decodeLow) / (decodeRange /= (total))) |
Referenced by enet_range_coder_decompress().
#define ENET_RANGE_CODER_SEED |
Referenced by enet_range_coder_decompress().
#define ENET_SYMBOL_CREATE | ( | symbol, | |
value_, | |||
count_ | |||
) |
typedef struct _ENetRangeCoder ENetRangeCoder |
typedef struct _ENetSymbol ENetSymbol |
anonymous enum |
size_t enet_range_coder_compress | ( | void * | context, |
const ENetBuffer * | inBuffers, | ||
size_t | inBufferCount, | ||
size_t | inLimit, | ||
enet_uint8 * | outData, | ||
size_t | outLimit | ||
) |
References ENET_CONTEXT_CREATE, ENET_CONTEXT_ENCODE, ENET_CONTEXT_ESCAPE_MINIMUM, ENET_CONTEXT_RESCALE, ENET_CONTEXT_SYMBOL_DELTA, ENET_CONTEXT_SYMBOL_MINIMUM, ENET_RANGE_CODER_BOTTOM, ENET_RANGE_CODER_ENCODE, ENET_RANGE_CODER_FLUSH, ENET_RANGE_CODER_FREE_SYMBOLS, ENET_SUBCONTEXT_ESCAPE_DELTA, ENET_SUBCONTEXT_ORDER, and ENET_SUBCONTEXT_SYMBOL_DELTA.
Referenced by enet_host_compress_with_range_coder().
References enet_malloc().
Referenced by enet_host_compress_with_range_coder().
size_t enet_range_coder_decompress | ( | void * | context, |
const enet_uint8 * | inData, | ||
size_t | inLimit, | ||
enet_uint8 * | outData, | ||
size_t | outLimit | ||
) |
References ENET_CONTEXT_CREATE, ENET_CONTEXT_ENCODE, ENET_CONTEXT_ESCAPE_MINIMUM, ENET_CONTEXT_NOT_EXCLUDED, ENET_CONTEXT_RESCALE, ENET_CONTEXT_ROOT_DECODE, ENET_CONTEXT_SYMBOL_DELTA, ENET_CONTEXT_SYMBOL_MINIMUM, ENET_CONTEXT_TRY_DECODE, ENET_RANGE_CODER_BOTTOM, ENET_RANGE_CODER_DECODE, ENET_RANGE_CODER_FREE_SYMBOLS, ENET_RANGE_CODER_OUTPUT, ENET_RANGE_CODER_READ, ENET_RANGE_CODER_SEED, ENET_SUBCONTEXT_ESCAPE_DELTA, ENET_SUBCONTEXT_ORDER, and ENET_SUBCONTEXT_SYMBOL_DELTA.
Referenced by enet_host_compress_with_range_coder().
References enet_free().
Referenced by enet_host_compress_with_range_coder().