]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Remove unused FSE/HUF functions
authorNick Terrell <terrelln@fb.com>
Tue, 4 Apr 2017 23:22:58 +0000 (16:22 -0700)
committerNick Terrell <terrelln@fb.com>
Tue, 4 Apr 2017 23:22:58 +0000 (16:22 -0700)
contrib/linux-kernel/lib/fse.h
contrib/linux-kernel/lib/fse_compress.c
contrib/linux-kernel/lib/huf.h
contrib/linux-kernel/lib/huf_compress.c

index fbd97fae3ff4b11587f894ae22022b9fa593ada8..14fa439ee3041969fa07c0315d1e8674c80a6efd 100644 (file)
@@ -272,7 +272,7 @@ unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsi
  * Same as FSE_compress2(), but using an externally allocated scratch buffer (`workSpace`).
  * FSE_WKSP_SIZE_U32() provides the minimum size required for `workSpace` as a table of FSE_CTable.
  */
-#define FSE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue)   ( FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) + (1<<((maxTableLog>2)?(maxTableLog-2):0)) )
+#define FSE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue)   ( FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) + ((maxTableLog > 12) ? (1 << (maxTableLog - 2)) : 1024) )
 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);
 
 size_t FSE_buildCTable_raw (FSE_CTable* ct, unsigned nbBits);
index 7c13a4099adcd5e6eeb059099e79982bf9d92182..e969fd2ca65c897b3e273d7bbce8bcc1067d275e 100644 (file)
@@ -404,14 +404,6 @@ size_t FSE_count_wksp(unsigned* count, unsigned* maxSymbolValuePtr,
        return FSE_countFast_wksp(count, maxSymbolValuePtr, source, sourceSize, workSpace);
 }
 
-size_t FSE_count(unsigned* count, unsigned* maxSymbolValuePtr,
-                                const void* src, size_t srcSize)
-{
-       unsigned tmpCounters[1024];
-       return FSE_count_wksp(count, maxSymbolValuePtr, src, srcSize, tmpCounters);
-}
-
-
 
 /*-**************************************************************
 *  FSE Compression Code
@@ -765,7 +757,7 @@ size_t FSE_compress_wksp (void* dst, size_t dstSize, const void* src, size_t src
        if (!tableLog) tableLog = FSE_DEFAULT_TABLELOG;
 
        /* Scan input and build symbol stats */
-       {   CHECK_V_F(maxCount, FSE_count(count, &maxSymbolValue, src, srcSize) );
+       {   CHECK_V_F(maxCount, FSE_count_wksp(count, &maxSymbolValue, src, srcSize, scratchBuffer) );
                if (maxCount == srcSize) return 1;   /* only a single symbol in src : rle */
                if (maxCount == 1) return 0;         /* each symbol present maximum once => not compressible */
                if (maxCount < (srcSize >> 7)) return 0;   /* Heuristic : not compressible enough */
index f135226dc42d11b444fec7a6c80843458a760680..f36aded00bb51eb019d94b46d7f25e71aadc7f8c 100644 (file)
@@ -124,7 +124,6 @@ or to save and regenerate 'CTable' using external methods.
 /* FSE_count() : find it within "fse.h" */
 unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);
 typedef struct HUF_CElt_s HUF_CElt;   /* incomplete type */
-size_t HUF_buildCTable (HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue, unsigned maxNbBits);
 size_t HUF_writeCTable (void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog);
 size_t HUF_compress4X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable);
 
index b2e71405cd1deccaf159e4bc7c8390dabb86365b..a1a1d454a062e3e2a6ec84e78c85166ad3289c54 100644 (file)
@@ -390,15 +390,6 @@ size_t HUF_buildCTable_wksp (HUF_CElt* tree, const U32* count, U32 maxSymbolValu
        return maxNbBits;
 }
 
-/** HUF_buildCTable() :
- *  Note : count is used before tree is written, so they can safely overlap
- */
-size_t HUF_buildCTable (HUF_CElt* tree, const U32* count, U32 maxSymbolValue, U32 maxNbBits)
-{
-       huffNodeTable nodeTable;
-       return HUF_buildCTable_wksp(tree, count, maxSymbolValue, maxNbBits, nodeTable, sizeof(nodeTable));
-}
-
 static size_t HUF_estimateCompressedSize(HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue)
 {
        size_t nbBits = 0;