ReactOS 0.4.16-dev-125-g798ea90
|
#include <stdlib.h>
#include <string.h>
#include "compiler.h"
#include "mem.h"
#include "debug.h"
#include "hist.h"
#include "bitstream.h"
#include "fse.h"
#include "error_private.h"
#include <ntifs.h>
#include <ntddk.h>
Go to the source code of this file.
Classes | |
struct | fseWkspMax_t |
Macros | |
#define | FSE_STATIC_LINKING_ONLY |
#define | FSE_isError ERR_isError |
#define | FSE_CAT(X, Y) X##Y |
#define | FSE_FUNCTION_NAME(X, Y) FSE_CAT(X,Y) |
#define | FSE_TYPE_NAME(X, Y) FSE_CAT(X,Y) |
#define | FSEC_ALLOC_TAG 0x64455346 |
#define | FSE_FLUSHBITS(s) (fast ? BIT_flushBitsFast(s) : BIT_flushBits(s)) |
#define FSE_FLUSHBITS | ( | s | ) | (fast ? BIT_flushBitsFast(s) : BIT_flushBits(s)) |
#define FSE_isError ERR_isError |
Definition at line 35 of file fse_compress.c.
#define FSE_STATIC_LINKING_ONLY |
Definition at line 25 of file fse_compress.c.
#define FSEC_ALLOC_TAG 0x64455346 |
Definition at line 60 of file fse_compress.c.
size_t FSE_buildCTable | ( | FSE_CTable * | ct, |
const short * | normalizedCounter, | ||
unsigned | maxSymbolValue, | ||
unsigned | tableLog | ||
) |
FSE_buildCTable(): Builds ct
, which must be already allocated, using FSE_createCTable().
Definition at line 175 of file fse_compress.c.
size_t FSE_buildCTable_raw | ( | FSE_CTable * | ct, |
unsigned | nbBits | ||
) |
Definition at line 501 of file fse_compress.c.
size_t FSE_buildCTable_rle | ( | FSE_CTable * | ct, |
BYTE | symbolValue | ||
) |
Definition at line 534 of file fse_compress.c.
Referenced by ZSTD_buildCTable().
size_t FSE_buildCTable_wksp | ( | FSE_CTable * | ct, |
const short * | normalizedCounter, | ||
unsigned | maxSymbolValue, | ||
unsigned | tableLog, | ||
void * | workSpace, | ||
size_t | wkspSize | ||
) |
Definition at line 69 of file fse_compress.c.
Referenced by FSE_buildCTable(), FSE_compress_wksp(), HUF_compressWeights(), ZSTD_buildCTable(), and ZSTD_loadCEntropy().
FSE_compress() : Compress content of buffer 'src', of size 'srcSize', into destination buffer 'dst'. 'dst' buffer must be already allocated. Compression runs faster is dstCapacity >= FSE_compressBound(srcSize).
Definition at line 695 of file fse_compress.c.
size_t FSE_compress2 | ( | void * | dst, |
size_t | dstSize, | ||
const void * | src, | ||
size_t | srcSize, | ||
unsigned | maxSymbolValue, | ||
unsigned | tableLog | ||
) |
FSE_compress2() : Same as FSE_compress(), but allows the selection of 'maxSymbolValue' and 'tableLog' Both parameters can be defined as '0' to mean : use default value
Definition at line 687 of file fse_compress.c.
Referenced by FSE_compress().
size_t FSE_compress_usingCTable | ( | void * | dst, |
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize, | ||
const FSE_CTable * | ct | ||
) |
FSE_compress_usingCTable(): Compress src
using ct
into dst
which must be already allocated.
dstCapacity
), or 0 if compressed data could not fit into dst
, or an errorCode, which can be tested using FSE_isError() Definition at line 616 of file fse_compress.c.
Referenced by FSE_compress_wksp(), and HUF_compressWeights().
|
static |
Definition at line 557 of file fse_compress.c.
Referenced by FSE_compress_usingCTable().
size_t FSE_compress_wksp | ( | void * | dst, |
size_t | dstSize, | ||
const void * | src, | ||
size_t | srcSize, | ||
unsigned | maxSymbolValue, | ||
unsigned | tableLog, | ||
void * | workSpace, | ||
size_t | wkspSize | ||
) |
Definition at line 635 of file fse_compress.c.
Referenced by FSE_compress2().
Definition at line 629 of file fse_compress.c.
FSE_CTable * FSE_createCTable | ( | unsigned | maxSymbolValue, |
unsigned | tableLog | ||
) |
Definition at line 308 of file fse_compress.c.
void FSE_freeCTable | ( | FSE_CTable * | ct | ) |
Definition at line 316 of file fse_compress.c.
Definition at line 319 of file fse_compress.c.
Referenced by FSE_normalizeCount(), and FSE_optimalTableLog_internal().
FSE_NCountWriteBound(): Provides the maximum possible size of an FSE normalized table, given 'maxSymbolValue' and 'tableLog'. Typically useful for allocation purpose.
Definition at line 189 of file fse_compress.c.
Referenced by FSE_writeNCount().
size_t FSE_normalizeCount | ( | short * | normalizedCounter, |
unsigned | tableLog, | ||
const unsigned * | count, | ||
size_t | srcSize, | ||
unsigned | maxSymbolValue | ||
) |
FSE_normalizeCount(): normalize counts so that sum(count[]) == Power_of_2 (2^tableLog) 'normalizedCounter' is a table of short, of minimum size (maxSymbolValue+1).
Definition at line 438 of file fse_compress.c.
Referenced by FSE_compress_wksp(), HUF_compressWeights(), ZSTD_buildCTable(), and ZSTD_NCountCost().
|
static |
Definition at line 351 of file fse_compress.c.
Referenced by FSE_normalizeCount().
FSE_compress() does the following:
FSE_decompress() does the following:
The following API allows targeting specific sub-functions for advanced tasks. For example, it's possible to compress several blocks using the same 'CTable', or to save and provide normalized distribution using external method.
FSE_optimalTableLog(): dynamically downsize 'tableLog' when conditions are met. It saves CPU time, by using smaller tables, while preserving or even improving compression ratio.
Definition at line 342 of file fse_compress.c.
Referenced by FSE_compress_wksp(), HUF_compressWeights(), ZSTD_buildCTable(), and ZSTD_NCountCost().
unsigned FSE_optimalTableLog_internal | ( | unsigned | maxTableLog, |
size_t | srcSize, | ||
unsigned | maxSymbolValue, | ||
unsigned | minus | ||
) |
Definition at line 328 of file fse_compress.c.
Referenced by FSE_optimalTableLog(), and HUF_optimalTableLog().
size_t FSE_writeNCount | ( | void * | buffer, |
size_t | bufferSize, | ||
const short * | normalizedCounter, | ||
unsigned | maxSymbolValue, | ||
unsigned | tableLog | ||
) |
FSE_writeNCount(): Compactly save 'normalizedCounter' into 'buffer'.
Definition at line 291 of file fse_compress.c.
Referenced by FSE_compress_wksp(), HUF_compressWeights(), ZSTD_buildCTable(), and ZSTD_NCountCost().
|
static |
Definition at line 196 of file fse_compress.c.
Referenced by FSE_writeNCount().