summaryrefslogtreecommitdiff
path: root/lib/zstd/common/fse.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/zstd/common/fse.h')
-rw-r--r--lib/zstd/common/fse.h24
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/zstd/common/fse.h b/lib/zstd/common/fse.h
index 4507043b228..78b3ff14b93 100644
--- a/lib/zstd/common/fse.h
+++ b/lib/zstd/common/fse.h
@@ -12,17 +12,14 @@
* You may select, at your option, one of the above-listed licenses.
****************************************************************** */
-
#ifndef FSE_H
#define FSE_H
-
/*-*****************************************
* Dependencies
******************************************/
#include "zstd_deps.h" /* size_t, ptrdiff_t */
-
/*-*****************************************
* FSE_PUBLIC_API : control library symbols visibility
******************************************/
@@ -49,7 +46,6 @@
#define FSE_VERSION_NUMBER (FSE_VERSION_MAJOR *100*100 + FSE_VERSION_MINOR *100 + FSE_VERSION_RELEASE)
FSE_PUBLIC_API unsigned FSE_versionNumber(void); /*< library version number; to be used when checking dll version */
-
/*-****************************************
* FSE simple functions
******************************************/
@@ -77,7 +73,6 @@ FSE_PUBLIC_API size_t FSE_compress(void* dst, size_t dstCapacity,
FSE_PUBLIC_API size_t FSE_decompress(void* dst, size_t dstCapacity,
const void* cSrc, size_t cSrcSize);
-
/*-*****************************************
* Tool functions
******************************************/
@@ -87,7 +82,6 @@ FSE_PUBLIC_API size_t FSE_compressBound(size_t size); /* maximum compresse
FSE_PUBLIC_API unsigned FSE_isError(size_t code); /* tells if a return value is an error code */
FSE_PUBLIC_API const char* FSE_getErrorName(size_t code); /* provides error code string (useful for debugging) */
-
/*-*****************************************
* FSE advanced functions
******************************************/
@@ -101,7 +95,6 @@ FSE_PUBLIC_API const char* FSE_getErrorName(size_t code); /* provides error co
*/
FSE_PUBLIC_API size_t FSE_compress2 (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
-
/*-*****************************************
* FSE detailed API
******************************************/
@@ -219,7 +212,6 @@ If it returns '0', compressed data could not fit into 'dst'.
If there is an error, the function will return an ErrorCode (which can be tested using FSE_isError()).
*/
-
/* *** DECOMPRESSION *** */
/*! FSE_readNCount():
@@ -292,7 +284,6 @@ If there is an error, the function will return an error code, which can be teste
/* *** Dependency *** */
#include "bitstream.h"
-
/* *****************************************
* Static allocation
*******************************************/
@@ -309,7 +300,6 @@ If there is an error, the function will return an error code, which can be teste
#define FSE_CTABLE_SIZE(maxTableLog, maxSymbolValue) (FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(FSE_CTable))
#define FSE_DTABLE_SIZE(maxTableLog) (FSE_DTABLE_SIZE_U32(maxTableLog) * sizeof(FSE_DTable))
-
/* *****************************************
* FSE advanced API
***************************************** */
@@ -397,7 +387,6 @@ FSE_CTable ct; // Provided by FSE_buildCTable()
BIT_CStream_t bitStream; // bitStream tracking structure
FSE_CState_t state; // State tracking structure (can have several)
-
The first thing to do is to init bitStream and state.
size_t errorCode = BIT_initCStream(&bitStream, dstBuffer, maxDstSize);
FSE_initCState(&state, ct);
@@ -427,7 +416,6 @@ If there is an error, it returns an errorCode (which can be tested using FSE_isE
size_t size = BIT_closeCStream(&bitStream);
*/
-
/* *****************************************
* FSE symbol decompression API
*******************************************/
@@ -436,7 +424,6 @@ typedef struct {
const void* table; /* precise table may vary, depending on U16 */
} FSE_DState_t;
-
static void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt);
static unsigned char FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);
@@ -492,14 +479,12 @@ Check also the states. There might be some symbols left there, if some high prob
FSE_endOfDState(&DState);
*/
-
/* *****************************************
* FSE unsafe API
*******************************************/
static unsigned char FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);
/* faster, but works only if nbBits is always >= 1 (otherwise, result will be corrupted) */
-
/* *****************************************
* Implementation of inlined functions
*******************************************/
@@ -519,7 +504,6 @@ MEM_STATIC void FSE_initCState(FSE_CState_t* statePtr, const FSE_CTable* ct)
statePtr->stateLog = tableLog;
}
-
/*! FSE_initCState2() :
* Same as FSE_initCState(), but the first symbol to include (which will be the last to be read)
* uses the smallest state value possible, saving the cost of this symbol */
@@ -549,7 +533,6 @@ MEM_STATIC void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* statePt
BIT_flushBits(bitC);
}
-
/* FSE_getMaxNbBits() :
* Approximate maximum cost of a symbol, in bits.
* Fractional get rounded up (i.e : a symbol with a normalized frequency of 3 gives the same result as a frequency of 2)
@@ -582,7 +565,6 @@ MEM_STATIC U32 FSE_bitCost(const void* symbolTTPtr, U32 tableLog, U32 symbolValu
}
}
-
/* ====== Decompression ====== */
typedef struct {
@@ -649,8 +631,6 @@ MEM_STATIC unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr)
return DStatePtr->state == 0;
}
-
-
#ifndef FSE_COMMONDEFS_ONLY
/* **************************************************************
@@ -685,10 +665,8 @@ MEM_STATIC unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr)
#define FSE_FUNCTION_EXTENSION
#define FSE_DECODE_TYPE FSE_decode_t
-
#endif /* !FSE_COMMONDEFS_ONLY */
-
/* ***************************************************************
* Constants
*****************************************************************/
@@ -705,7 +683,5 @@ MEM_STATIC unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr)
#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
-
#endif /* FSE_STATIC_LINKING_ONLY */
-