ReactOS 0.4.15-dev-8614-gbc76250
|
#include <string.h>
#include <stdio.h>
#include "compiler.h"
#include "bitstream.h"
#include "hist.h"
#include "fse.h"
#include "huf.h"
#include "error_private.h"
Go to the source code of this file.
Classes | |
struct | HUF_CElt_s |
struct | nodeElt_s |
struct | rankPos |
struct | HUF_buildCTable_wksp_tables |
struct | HUF_compress_tables_t |
Macros | |
#define | FSE_STATIC_LINKING_ONLY /* FSE_optimalTableLog_internal */ |
#define | HUF_STATIC_LINKING_ONLY |
#define | HUF_isError ERR_isError |
#define | HUF_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c) /* use only *after* variable declarations */ |
#define | MAX_FSE_TABLELOG_FOR_HUFF_HEADER 6 |
#define | RANK_POSITION_TABLE_SIZE 32 |
#define | STARTNODE (HUF_SYMBOLVALUE_MAX+1) |
#define | HUF_FLUSHBITS(s) BIT_flushBits(s) |
#define | HUF_FLUSHBITS_1(stream) if (sizeof((stream)->bitContainer)*8 < HUF_TABLELOG_MAX*2+7) HUF_FLUSHBITS(stream) |
#define | HUF_FLUSHBITS_2(stream) if (sizeof((stream)->bitContainer)*8 < HUF_TABLELOG_MAX*4+7) HUF_FLUSHBITS(stream) |
Typedefs | |
typedef struct nodeElt_s | nodeElt |
typedef nodeElt | huffNodeTable[HUF_CTABLE_WORKSPACE_SIZE_U32] |
Enumerations | |
enum | HUF_nbStreams_e { HUF_singleStream , HUF_fourStreams } |
#define FSE_STATIC_LINKING_ONLY /* FSE_optimalTableLog_internal */ |
Definition at line 31 of file huf_compress.c.
#define HUF_FLUSHBITS | ( | s | ) | BIT_flushBits(s) |
Definition at line 449 of file huf_compress.c.
#define HUF_FLUSHBITS_1 | ( | stream | ) | if (sizeof((stream)->bitContainer)*8 < HUF_TABLELOG_MAX*2+7) HUF_FLUSHBITS(stream) |
Definition at line 451 of file huf_compress.c.
#define HUF_FLUSHBITS_2 | ( | stream | ) | if (sizeof((stream)->bitContainer)*8 < HUF_TABLELOG_MAX*4+7) HUF_FLUSHBITS(stream) |
Definition at line 454 of file huf_compress.c.
#define HUF_isError ERR_isError |
Definition at line 41 of file huf_compress.c.
Definition at line 42 of file huf_compress.c.
#define HUF_STATIC_LINKING_ONLY |
Definition at line 33 of file huf_compress.c.
#define MAX_FSE_TABLELOG_FOR_HUFF_HEADER 6 |
Definition at line 62 of file huf_compress.c.
#define RANK_POSITION_TABLE_SIZE 32 |
Definition at line 300 of file huf_compress.c.
#define STARTNODE (HUF_SYMBOLVALUE_MAX+1) |
HUF_buildCTable_wksp() : Same as HUF_buildCTable(), but using externally allocated scratch buffer. workSpace
must be aligned on 4-bytes boundaries, and be at least as large as sizeof(HUF_buildCTable_wksp_tables).
Definition at line 336 of file huf_compress.c.
typedef nodeElt huffNodeTable[HUF_CTABLE_WORKSPACE_SIZE_U32] |
Definition at line 298 of file huf_compress.c.
size_t HUF_buildCTable | ( | HUF_CElt * | tree, |
const unsigned * | count, | ||
unsigned | maxSymbolValue, | ||
unsigned | maxNbBits | ||
) |
Definition at line 416 of file huf_compress.c.
size_t HUF_buildCTable_wksp | ( | HUF_CElt * | tree, |
const unsigned * | count, | ||
U32 | maxSymbolValue, | ||
U32 | maxNbBits, | ||
void * | workSpace, | ||
size_t | wkspSize | ||
) |
Definition at line 338 of file huf_compress.c.
Referenced by HUF_buildCTable(), HUF_compress_internal(), and ZSTD_buildSuperBlockEntropy_literal().
HUF_compress() : Compress content from buffer 'src', of size 'srcSize', into buffer 'dst'. 'dst' buffer must be already allocated. Compression runs faster if dstCapacity
>= HUF_compressBound(srcSize). srcSize
must be <= HUF_BLOCKSIZE_MAX
== 128 KB.
dstCapacity
). Special values : if return == 0, srcData is not compressible => Nothing is stored within dst !!! if HUF_isError(return), compression failed (more details using HUF_getErrorName()) Definition at line 795 of file huf_compress.c.
size_t HUF_compress1X | ( | void * | dst, |
size_t | dstSize, | ||
const void * | src, | ||
size_t | srcSize, | ||
unsigned | maxSymbolValue, | ||
unsigned | huffLog | ||
) |
Definition at line 750 of file huf_compress.c.
size_t HUF_compress1X_repeat | ( | void * | dst, |
size_t | dstSize, | ||
const void * | src, | ||
size_t | srcSize, | ||
unsigned | maxSymbolValue, | ||
unsigned | huffLog, | ||
void * | workSpace, | ||
size_t | wkspSize, | ||
HUF_CElt * | hufTable, | ||
HUF_repeat * | repeat, | ||
int | preferRepeat, | ||
int | bmi2 | ||
) |
Definition at line 738 of file huf_compress.c.
Referenced by ZSTD_compressLiterals().
size_t HUF_compress1X_usingCTable | ( | void * | dst, |
size_t | dstSize, | ||
const void * | src, | ||
size_t | srcSize, | ||
const HUF_CElt * | CTable | ||
) |
Definition at line 546 of file huf_compress.c.
Referenced by ZSTD_compressSubBlock_literal().
|
static |
Definition at line 536 of file huf_compress.c.
Referenced by HUF_compress1X_usingCTable(), HUF_compress4X_usingCTable_internal(), and HUF_compressCTable_internal().
FORCE_INLINE_TEMPLATE size_t HUF_compress1X_usingCTable_internal_body | ( | void * | dst, |
size_t | dstSize, | ||
const void * | src, | ||
size_t | srcSize, | ||
const HUF_CElt * | CTable | ||
) |
Definition at line 458 of file huf_compress.c.
Referenced by HUF_compress1X_usingCTable_internal().
size_t HUF_compress1X_wksp | ( | void * | dst, |
size_t | dstSize, | ||
const void * | src, | ||
size_t | srcSize, | ||
unsigned | maxSymbolValue, | ||
unsigned | huffLog, | ||
void * | workSpace, | ||
size_t | wkspSize | ||
) |
Definition at line 727 of file huf_compress.c.
Referenced by HUF_compress1X().
size_t HUF_compress2 | ( | void * | dst, |
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize, | ||
unsigned | maxSymbolValue, | ||
unsigned | tableLog | ||
) |
HUF_compress2() : Same as HUF_compress(), but offers control over maxSymbolValue
and tableLog
. maxSymbolValue
must be <= HUF_SYMBOLVALUE_MAX . tableLog
must be <= HUF_TABLELOG_MAX
.
Definition at line 787 of file huf_compress.c.
Referenced by HUF_compress().
size_t HUF_compress4X_repeat | ( | void * | dst, |
size_t | dstSize, | ||
const void * | src, | ||
size_t | srcSize, | ||
unsigned | maxSymbolValue, | ||
unsigned | huffLog, | ||
void * | workSpace, | ||
size_t | wkspSize, | ||
HUF_CElt * | hufTable, | ||
HUF_repeat * | repeat, | ||
int | preferRepeat, | ||
int | bmi2 | ||
) |
Definition at line 775 of file huf_compress.c.
Referenced by ZSTD_compressLiterals().
size_t HUF_compress4X_usingCTable | ( | void * | dst, |
size_t | dstSize, | ||
const void * | src, | ||
size_t | srcSize, | ||
const HUF_CElt * | CTable | ||
) |
Definition at line 605 of file huf_compress.c.
Referenced by ZSTD_compressSubBlock_literal().
|
static |
Definition at line 553 of file huf_compress.c.
Referenced by HUF_compress4X_usingCTable(), and HUF_compressCTable_internal().
size_t HUF_compress4X_wksp | ( | void * | dst, |
size_t | dstSize, | ||
const void * | src, | ||
size_t | srcSize, | ||
unsigned | maxSymbolValue, | ||
unsigned | huffLog, | ||
void * | workSpace, | ||
size_t | wkspSize | ||
) |
Definition at line 761 of file huf_compress.c.
Referenced by HUF_compress2().
|
static |
Definition at line 638 of file huf_compress.c.
Referenced by HUF_compress1X_repeat(), HUF_compress1X_wksp(), HUF_compress4X_repeat(), and HUF_compress4X_wksp().
|
static |
Definition at line 612 of file huf_compress.c.
Referenced by HUF_compress_internal().
|
static |
Definition at line 63 of file huf_compress.c.
Referenced by HUF_writeCTable().
FORCE_INLINE_TEMPLATE void HUF_encodeSymbol | ( | BIT_CStream_t * | bitCPtr, |
U32 | symbol, | ||
const HUF_CElt * | CTable | ||
) |
Definition at line 444 of file huf_compress.c.
Referenced by HUF_compress1X_usingCTable_internal_body().
size_t HUF_estimateCompressedSize | ( | const HUF_CElt * | CTable, |
const unsigned * | count, | ||
unsigned | maxSymbolValue | ||
) |
Definition at line 422 of file huf_compress.c.
Referenced by HUF_compress_internal(), ZSTD_buildSuperBlockEntropy_literal(), and ZSTD_estimateSubBlockSize_literal().
Definition at line 200 of file huf_compress.c.
Referenced by ZSTD_rescaleFreqs().
Definition at line 48 of file huf_compress.c.
Referenced by HUF_compress_internal(), and ZSTD_buildSuperBlockEntropy_literal().
size_t HUF_readCTable | ( | HUF_CElt * | CTable, |
unsigned * | maxSymbolValuePtr, | ||
const void * | src, | ||
size_t | srcSize, | ||
unsigned * | hasZeroWeights | ||
) |
Definition at line 150 of file huf_compress.c.
Referenced by ZSTD_loadCEntropy().
Definition at line 215 of file huf_compress.c.
Referenced by HUF_buildCTable_wksp().
|
static |
Definition at line 307 of file huf_compress.c.
Referenced by HUF_buildCTable_wksp().
Definition at line 432 of file huf_compress.c.
Referenced by HUF_compress_internal(), and ZSTD_buildSuperBlockEntropy_literal().
size_t HUF_writeCTable | ( | void * | dst, |
size_t | maxDstSize, | ||
const HUF_CElt * | CTable, | ||
unsigned | maxSymbolValue, | ||
unsigned | huffLog | ||
) |
HUF_writeCTable() : CTable
: Huffman tree to save, using huf representation.
Definition at line 114 of file huf_compress.c.
Referenced by HUF_compress_internal(), and ZSTD_buildSuperBlockEntropy_literal().