Project Alice
Loading...
Searching...
No Matches
cover.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 * All rights reserved.
4 *
5 * This source code is licensed under both the BSD-style license (found in the
6 * LICENSE file in the root directory of this source tree) and the GPLv2 (found
7 * in the COPYING file in the root directory of this source tree).
8 * You may select, at your option, one of the above-listed licenses.
9 */
10
11#ifndef ZDICT_STATIC_LINKING_ONLY
12# define ZDICT_STATIC_LINKING_ONLY
13#endif
14
15#include "../common/threading.h" /* ZSTD_pthread_mutex_t */
16#include "../common/mem.h" /* U32, BYTE */
17#include "../zdict.h"
18
27typedef struct COVER_best_s {
30 size_t liveJobs;
31 void *dict;
32 size_t dictSize;
33 ZDICT_cover_params_t parameters;
36
40typedef struct {
45
49typedef struct {
53
57typedef struct COVER_dictSelection {
59 size_t dictSize;
62
77 U32 k, U32 passes);
78
82void COVER_warnOnSmallCorpus(size_t maxDictSize, size_t nbDmers, int displayLevel);
83
87size_t COVER_checkTotalCompressedSize(const ZDICT_cover_params_t parameters,
88 const size_t *samplesSizes, const BYTE *samples,
89 size_t *offsets,
90 size_t nbTrainSamples, size_t nbSamples,
91 BYTE *const dict, size_t dictBufferCapacity);
92
96size_t COVER_sum(const size_t *samplesSizes, unsigned nbSamples) ;
97
101void COVER_best_init(COVER_best_t *best);
102
106void COVER_best_wait(COVER_best_t *best);
107
112
118
124void COVER_best_finish(COVER_best_t *best, ZDICT_cover_params_t parameters,
125 COVER_dictSelection_t selection);
131
137
143
150 COVER_dictSelection_t COVER_selectDict(BYTE* customDictContent, size_t dictBufferCapacity,
151 size_t dictContentSize, const BYTE* samplesBuffer, const size_t* samplesSizes, unsigned nbFinalizeSamples,
152 size_t nbCheckSamples, size_t nbSamples, ZDICT_cover_params_t params, size_t* offsets, size_t totalCompressedSize);
COVER_dictSelection_t COVER_dictSelectionError(size_t error)
Definition: cover.c:967
COVER_epoch_info_t COVER_computeEpochs(U32 maxDictSize, U32 nbDmers, U32 k, U32 passes)
Definition: cover.c:666
struct COVER_dictSelection COVER_dictSelection_t
void COVER_warnOnSmallCorpus(size_t maxDictSize, size_t nbDmers, int displayLevel)
Definition: cover.c:650
void COVER_best_finish(COVER_best_t *best, ZDICT_cover_params_t parameters, COVER_dictSelection_t selection)
Definition: cover.c:912
COVER_dictSelection_t COVER_selectDict(BYTE *customDictContent, size_t dictBufferCapacity, size_t dictContentSize, const BYTE *samplesBuffer, const size_t *samplesSizes, unsigned nbFinalizeSamples, size_t nbCheckSamples, size_t nbSamples, ZDICT_cover_params_t params, size_t *offsets, size_t totalCompressedSize)
Definition: cover.c:979
size_t COVER_checkTotalCompressedSize(const ZDICT_cover_params_t parameters, const size_t *samplesSizes, const BYTE *samples, size_t *offsets, size_t nbTrainSamples, size_t nbSamples, BYTE *const dict, size_t dictBufferCapacity)
Definition: cover.c:798
void COVER_dictSelectionFree(COVER_dictSelection_t selection)
Definition: cover.c:975
void COVER_best_wait(COVER_best_t *best)
Definition: cover.c:868
unsigned COVER_dictSelectionIsError(COVER_dictSelection_t selection)
Definition: cover.c:971
size_t COVER_sum(const size_t *samplesSizes, unsigned nbSamples)
Definition: cover.c:245
void COVER_best_start(COVER_best_t *best)
Definition: cover.c:898
struct COVER_best_s COVER_best_t
void COVER_best_init(COVER_best_t *best)
Definition: cover.c:854
void COVER_best_destroy(COVER_best_t *best)
Definition: cover.c:882
unsigned char BYTE
Definition: mem.h:58
unsigned int U32
Definition: mem.h:69
ZSTD_pthread_mutex_t mutex
Definition: cover.h:28
ZSTD_pthread_cond_t cond
Definition: cover.h:29
size_t compressedSize
Definition: cover.h:34
void * dict
Definition: cover.h:31
size_t liveJobs
Definition: cover.h:30
size_t dictSize
Definition: cover.h:32
ZDICT_cover_params_t parameters
Definition: cover.h:33
BYTE * dictContent
Definition: cover.h:58
size_t dictSize
Definition: cover.h:59
size_t totalCompressedSize
Definition: cover.h:60
int ZSTD_pthread_mutex_t
Definition: threading.h:129
int ZSTD_pthread_cond_t
Definition: threading.h:135