#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "../common/mem.h"
#include "../common/pool.h"
#include "../common/threading.h"
#include "../common/zstd_internal.h"
#include "../compress/zstd_compress_internal.h"
#include "../zdict.h"
#include "cover.h"
Go to the source code of this file.
|
#define | ZDICT_STATIC_LINKING_ONLY |
|
#define | FASTCOVER_MAX_SAMPLES_SIZE (sizeof(size_t) == 8 ? ((unsigned)-1) : ((unsigned)1 GB)) |
|
#define | FASTCOVER_MAX_F 31 |
|
#define | FASTCOVER_MAX_ACCEL 10 |
|
#define | FASTCOVER_DEFAULT_SPLITPOINT 0.75 |
|
#define | DEFAULT_F 20 |
|
#define | DEFAULT_ACCEL 1 |
|
#define | DISPLAY(...) |
|
#define | LOCALDISPLAYLEVEL(displayLevel, l, ...) |
|
#define | DISPLAYLEVEL(l, ...) LOCALDISPLAYLEVEL(g_displayLevel, l, __VA_ARGS__) |
|
#define | LOCALDISPLAYUPDATE(displayLevel, l, ...) |
|
#define | DISPLAYUPDATE(l, ...) LOCALDISPLAYUPDATE(g_displayLevel, l, __VA_ARGS__) |
|
|
ZDICTLIB_STATIC_API size_t | ZDICT_trainFromBuffer_fastCover (void *dictBuffer, size_t dictBufferCapacity, const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples, ZDICT_fastCover_params_t parameters) |
|
ZDICTLIB_STATIC_API size_t | ZDICT_optimizeTrainFromBuffer_fastCover (void *dictBuffer, size_t dictBufferCapacity, const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples, ZDICT_fastCover_params_t *parameters) |
|
◆ DEFAULT_ACCEL
◆ DEFAULT_F
◆ DISPLAY
Value: { \
fprintf(stderr, __VA_ARGS__); \
fflush(stderr); \
}
Definition at line 57 of file fastcover.c.
◆ DISPLAYLEVEL
◆ DISPLAYUPDATE
◆ FASTCOVER_DEFAULT_SPLITPOINT
#define FASTCOVER_DEFAULT_SPLITPOINT 0.75 |
◆ FASTCOVER_MAX_ACCEL
#define FASTCOVER_MAX_ACCEL 10 |
◆ FASTCOVER_MAX_F
#define FASTCOVER_MAX_F 31 |
◆ FASTCOVER_MAX_SAMPLES_SIZE
#define FASTCOVER_MAX_SAMPLES_SIZE (sizeof(size_t) == 8 ? ((unsigned)-1) : ((unsigned)1 GB)) |
There are 32bit indexes used to ref samples, so limit samples size to 4GB on 64bit builds. For 32bit builds we choose 1 GB. Most 32bit platforms have 2GB user-mode addressable space and we allocate a large contiguous buffer, so 1GB is already a high limit.
Definition at line 42 of file fastcover.c.
◆ LOCALDISPLAYLEVEL
#define LOCALDISPLAYLEVEL |
( |
|
displayLevel, |
|
|
|
l, |
|
|
|
... |
|
) |
| |
Value: if (displayLevel >= l) { \
DISPLAY(__VA_ARGS__); \
}
Definition at line 63 of file fastcover.c.
◆ LOCALDISPLAYUPDATE
#define LOCALDISPLAYUPDATE |
( |
|
displayLevel, |
|
|
|
l, |
|
|
|
... |
|
) |
| |
Value: if (displayLevel >= l) { \
if ((clock() - g_time > g_refreshRate) || (displayLevel >= 4)) { \
g_time = clock(); \
DISPLAY(__VA_ARGS__); \
} \
}
Definition at line 75 of file fastcover.c.
◆ ZDICT_STATIC_LINKING_ONLY
#define ZDICT_STATIC_LINKING_ONLY |
◆ FASTCOVER_tryParameters_data_t
Parameters for FASTCOVER_tryParameters().
◆ ZDICT_optimizeTrainFromBuffer_fastCover()
ZDICTLIB_STATIC_API size_t ZDICT_optimizeTrainFromBuffer_fastCover |
( |
void * |
dictBuffer, |
|
|
size_t |
dictBufferCapacity, |
|
|
const void * |
samplesBuffer, |
|
|
const size_t * |
samplesSizes, |
|
|
unsigned |
nbSamples, |
|
|
ZDICT_fastCover_params_t * |
parameters |
|
) |
| |
◆ ZDICT_trainFromBuffer_fastCover()
ZDICTLIB_STATIC_API size_t ZDICT_trainFromBuffer_fastCover |
( |
void * |
dictBuffer, |
|
|
size_t |
dictBufferCapacity, |
|
|
const void * |
samplesBuffer, |
|
|
const size_t * |
samplesSizes, |
|
|
unsigned |
nbSamples, |
|
|
ZDICT_fastCover_params_t |
parameters |
|
) |
| |