xref: /src/sys/contrib/zstd/lib/compress/zstd_preSplit.h (revision c0d9a07101a1e72769ee0619a583f63a078fb391)
17e509d50SXin LI /*
27e509d50SXin LI  * Copyright (c) Meta Platforms, Inc. and affiliates.
37e509d50SXin LI  * All rights reserved.
47e509d50SXin LI  *
57e509d50SXin LI  * This source code is licensed under both the BSD-style license (found in the
67e509d50SXin LI  * LICENSE file in the root directory of this source tree) and the GPLv2 (found
77e509d50SXin LI  * in the COPYING file in the root directory of this source tree).
87e509d50SXin LI  * You may select, at your option, one of the above-listed licenses.
97e509d50SXin LI  */
107e509d50SXin LI 
117e509d50SXin LI #ifndef ZSTD_PRESPLIT_H
127e509d50SXin LI #define ZSTD_PRESPLIT_H
137e509d50SXin LI 
147e509d50SXin LI #include <stddef.h>  /* size_t */
157e509d50SXin LI 
167e509d50SXin LI #define ZSTD_SLIPBLOCK_WORKSPACESIZE 8208
177e509d50SXin LI 
187e509d50SXin LI /* ZSTD_splitBlock():
197e509d50SXin LI  * @level must be a value between 0 and 4.
207e509d50SXin LI  *        higher levels spend more energy to detect block boundaries.
217e509d50SXin LI  * @workspace must be aligned for size_t.
227e509d50SXin LI  * @wkspSize must be at least >= ZSTD_SLIPBLOCK_WORKSPACESIZE
237e509d50SXin LI  * note:
247e509d50SXin LI  * For the time being, this function only accepts full 128 KB blocks.
257e509d50SXin LI  * Therefore, @blockSize must be == 128 KB.
267e509d50SXin LI  * While this could be extended to smaller sizes in the future,
277e509d50SXin LI  * it is not yet clear if this would be useful. TBD.
287e509d50SXin LI  */
297e509d50SXin LI size_t ZSTD_splitBlock(const void* blockStart, size_t blockSize,
307e509d50SXin LI                     int level,
317e509d50SXin LI                     void* workspace, size_t wkspSize);
327e509d50SXin LI 
337e509d50SXin LI #endif /* ZSTD_PRESPLIT_H */
34