-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathZSTDLib.pas
1128 lines (1115 loc) · 65.1 KB
/
ZSTDLib.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//Remove Next Line to Use SSE2 Library
{$DEFINE AVX2}
unit ZSTDLib;
interface
const
ZSTD_VERSION_MAJOR = 1;
ZSTD_VERSION_MINOR = 5;
ZSTD_VERSION_RELEASE = 2;
ZSTD_VERSION_NUMBER = ZSTD_VERSION_MAJOR*100*100+ZSTD_VERSION_MINOR*100+
ZSTD_VERSION_RELEASE;
ZSTD_VERSION_STRING = '1.5.2';
ZSTD_CLEVEL_DEFAULT = 3;
ZSTD_REP_NUM = 3;
type
ZSTD_ErrorCode=(
ZSTD_error_no_error = 0,
ZSTD_error_GENERIC = 1,
ZSTD_error_prefix_unknown = 10,
ZSTD_error_version_unsupported = 12,
ZSTD_error_frameParameter_unsupported = 14,
ZSTD_error_frameParameter_windowTooLarge = 16,
ZSTD_error_corruption_detected = 20,
ZSTD_error_checksum_wrong = 22,
ZSTD_error_dictionary_corrupted = 30,
ZSTD_error_dictionary_wrong = 32,
ZSTD_error_dictionaryCreation_failed = 34,
ZSTD_error_parameter_unsupported = 40,
ZSTD_error_parameter_outOfBound = 42,
ZSTD_error_tableLog_tooLarge = 44,
ZSTD_error_maxSymbolValue_tooLarge = 46,
ZSTD_error_maxSymbolValue_tooSmall = 48,
ZSTD_error_stage_wrong = 60,
ZSTD_error_init_missing = 62,
ZSTD_error_memory_allocation = 64,
ZSTD_error_workSpace_tooSmall= 66,
ZSTD_error_dstSize_tooSmall = 70,
ZSTD_error_srcSize_wrong = 72,
ZSTD_error_dstBuffer_null = 74,
// following error codes are __NOT STABLE__, they can be removed or changed in future versions */
ZSTD_error_frameIndex_tooLarge = 100,
ZSTD_error_seekableIO = 102,
ZSTD_error_dstBuffer_wrong = 104,
ZSTD_error_srcBuffer_wrong = 105,
ZSTD_error_maxCode = 120 // never EVER use this value directly, it can change in future versions! Use ZSTD_isError() instead */
);
ZSTD_strategy = (
ZSTD_fast=1,
ZSTD_dfast=2,
ZSTD_greedy=3,
ZSTD_lazy=4,
ZSTD_lazy2=5,
ZSTD_btlazy2=6,
ZSTD_btopt=7,
ZSTD_btultra=8,
ZSTD_btultra2=9
);
ZSTD_OptPrice_e=(
zop_dynamic=0, zop_predef
);
ZSTD_literalCompressionMode_e =(
ZSTD_lcm_auto = 0, {**< Automatically determine the compression mode based on the compression level.
* Negative compression levels will be uncompressed, and positive compression
* levels will be compressed. */}
ZSTD_lcm_huffman = 1, {**< Always attempt Huffman compression. Uncompressed literals will still be
* emitted if Huffman compression is not profitable. */}
ZSTD_lcm_uncompressed = 2 {**< Always emit uncompressed literals. */}
);
optState_t = record
//* All tables are allocated inside cctx->workspace by ZSTD_resetCCtx_internal() */
litFreq : Pointer; //* table of literals statistics, of size 256 */
litLengthFreq : Pointer; //* table of litLength statistics, of size (MaxLL+1) */
matchLengthFreq : Pointer; //* table of matchLength statistics, of size (MaxML+1) */
offCodeFreq : Pointer; //* table of offCode statistics, of size (MaxOff+1) */
matchTable : Pointer; //* list of found matches, of size ZSTD_OPT_NUM+1 */
priceTable : Pointer; //* All positions tracked by optimal parser, of size ZSTD_OPT_NUM+1 */
litSum : Cardinal; //* nb of literals */
litLengthSum : Cardinal; //* nb of litLength codes */
matchLengthSum : Cardinal; //* nb of matchLength codes */
offCodeSum : Cardinal; //* nb of offset codes */
litSumBasePrice : Cardinal; //* to compare to log2(litfreq) */
litLengthSumBasePrice : Cardinal; //* to compare to log2(llfreq) */
matchLengthSumBasePrice : Cardinal;//* to compare to log2(mlfreq) */
offCodeSumBasePrice : Cardinal; //* to compare to log2(offreq) */
priceType : ZSTD_OptPrice_e; //* prices can be determined dynamically, or follow a pre-defined cost structure */
symbolCosts : Pointer; //* pre-calculated dictionary statistics */
literalCompressionMode : ZSTD_literalCompressionMode_e
end;
ZSTD_window_t = record
nextSrc : Pointer; //* next block here to continue on current prefix */
base : Pointer; //* All regular indexes relative to this position */
dictBase : Pointer; //* extDict indexes relative to this position */
dictLimit : Cardinal; //* below that point, need extDict */
lowLimit : Cardinal; //* below that point, no more valid data */
end;
ZSTD_dictMode_e = (
ZSTD_noDict = 0,
ZSTD_extDict = 1,
ZSTD_dictMatchState = 2,
ZSTD_dedicatedDictSearch = 3
);
ZSTD_allocFunction = function(opaque : Pointer; size : NativeInt):Pointer{$IFDEF WIN32};cdecl{$ENDIF};
ZSTD_freeFunction = procedure(opaque,address : Pointer){$IFDEF WIN32};cdecl{$ENDIF};
ZSTD_customMem = record
customAlloc : ZSTD_allocFunction;
customFree : ZSTD_freeFunction;
opaque : Pointer;
end;
BlockCompressorRepArr = array[0..ZSTD_REP_NUM-1] of Cardinal;
{//ZSTD_blockCompressor ZSTD_selectBlockCompressor(ZSTD_strategy strat, ZSTD_dictMode_e dictMode);
typedef size_t (*ZSTD_blockCompressor) (
ZSTD_matchState_t* bs, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
void const* src, size_t srcSize);
}
ZSTD_blockCompressor = function(bs,seqStore:Pointer; rep:BlockCompressorRepArr;
src : Pointer; srcSize : NativeInt):NativeInt{$IFDEF WIN32};cdecl{$ENDIF};
ZSTD_CCtx=Pointer;
ZSTD_DCtx=Pointer;
ZSTD_cParameter=(
{* compression parameters
* Note: When compressing with a ZSTD_CDict these parameters are superseded
* by the parameters used to construct the ZSTD_CDict.
* See ZSTD_CCtx_refCDict() for more info (superseded-by-cdict). *}
ZSTD_c_compressionLevel=100, {* Set compression parameters according to pre-defined cLevel table.
* Note that exact compression parameters are dynamically determined,
* depending on both compression level and srcSize (when known).
* Default level is ZSTD_CLEVEL_DEFAULT==3.
* Special: value 0 means default, which is controlled by ZSTD_CLEVEL_DEFAULT.
* Note 1 : it's possible to pass a negative compression level.
* Note 2 : setting a level does not automatically set all other compression parameters
* to default. Setting this will however eventually dynamically impact the compression
* parameters which have not been manually set. The manually set
* ones will 'stick'. *}
{* Advanced compression parameters :
* It's possible to pin down compression parameters to some specific values.
* In which case, these values are no longer dynamically selected by the compressor *}
ZSTD_c_windowLog=101, {* Maximum allowed back-reference distance, expressed as power of 2.
* This will set a memory budget for streaming decompression,
* with larger values requiring more memory
* and typically compressing more.
* Must be clamped between ZSTD_WINDOWLOG_MIN and ZSTD_WINDOWLOG_MAX.
* Special: value 0 means "use default windowLog".
* Note: Using a windowLog greater than ZSTD_WINDOWLOG_LIMIT_DEFAULT
* requires explicitly allowing such size at streaming decompression stage. *}
ZSTD_c_hashLog=102, {* Size of the initial probe table, as a power of 2.
* Resulting memory usage is (1 << (hashLog+2)).
* Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX.
* Larger tables improve compression ratio of strategies <= dFast,
* and improve speed of strategies > dFast.
* Special: value 0 means "use default hashLog". *}
ZSTD_c_chainLog=103, {* Size of the multi-probe search table, as a power of 2.
* Resulting memory usage is (1 << (chainLog+2)).
* Must be clamped between ZSTD_CHAINLOG_MIN and ZSTD_CHAINLOG_MAX.
* Larger tables result in better and slower compression.
* This parameter is useless for "fast" strategy.
* It's still useful when using "dfast" strategy,
* in which case it defines a secondary probe table.
* Special: value 0 means "use default chainLog". *}
ZSTD_c_searchLog=104, {* Number of search attempts, as a power of 2.
* More attempts result in better and slower compression.
* This parameter is useless for "fast" and "dFast" strategies.
* Special: value 0 means "use default searchLog". *}
ZSTD_c_minMatch=105, {* Minimum size of searched matches.
* Note that Zstandard can still find matches of smaller size,
* it just tweaks its search algorithm to look for this size and larger.
* Larger values increase compression and decompression speed, but decrease ratio.
* Must be clamped between ZSTD_MINMATCH_MIN and ZSTD_MINMATCH_MAX.
* Note that currently, for all strategies < btopt, effective minimum is 4.
* , for all strategies > fast, effective maximum is 6.
* Special: value 0 means "use default minMatchLength". *}
ZSTD_c_targetLength=106, {* Impact of this field depends on strategy.
* For strategies btopt, btultra & btultra2:
* Length of Match considered "good enough" to stop search.
* Larger values make compression stronger, and slower.
* For strategy fast:
* Distance between match sampling.
* Larger values make compression faster, and weaker.
* Special: value 0 means "use default targetLength". *}
ZSTD_c_strategy=107, {* See ZSTD_strategy enum definition.
* The higher the value of selected strategy, the more complex it is,
* resulting in stronger and slower compression.
* Special: value 0 means "use default strategy". *}
{* LDM mode parameters *}
ZSTD_c_enableLongDistanceMatching=160, {* Enable long distance matching.
* This parameter is designed to improve compression ratio
* for large inputs, by finding large matches at long distance.
* It increases memory usage and window size.
* Note: enabling this parameter increases default ZSTD_c_windowLog to 128 MB
* except when expressly set to a different value. *}
ZSTD_c_ldmHashLog=161, {* Size of the table for long distance matching, as a power of 2.
* Larger values increase memory usage and compression ratio,
* but decrease compression speed.
* Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX
* default: windowlog - 7.
* Special: value 0 means "automatically determine hashlog". *}
ZSTD_c_ldmMinMatch=162, {* Minimum match size for long distance matcher.
* Larger/too small values usually decrease compression ratio.
* Must be clamped between ZSTD_LDM_MINMATCH_MIN and ZSTD_LDM_MINMATCH_MAX.
* Special: value 0 means "use default value" (default: 64). *}
ZSTD_c_ldmBucketSizeLog=163, {* Log size of each bucket in the LDM hash table for collision resolution.
* Larger values improve collision resolution but decrease compression speed.
* The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX.
* Special: value 0 means "use default value" (default: 3). *}
ZSTD_c_ldmHashRateLog=164, {* Frequency of inserting/looking up entries into the LDM hash table.
* Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN).
* Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage.
* Larger values improve compression speed.
* Deviating far from default value will likely result in a compression ratio decrease.
* Special: value 0 means "automatically determine hashRateLog". *}
{* frame parameters *}
ZSTD_c_contentSizeFlag=200, {* Content size will be written into frame header _whenever known_ (default:1)
* Content size must be known at the beginning of compression.
* This is automatically the case when using ZSTD_compress2(),
* For streaming scenarios, content size must be provided with ZSTD_CCtx_setPledgedSrcSize() *}
ZSTD_c_checksumFlag=201, {* A 32-bits checksum of content is written at end of frame (default:0) *}
ZSTD_c_dictIDFlag=202, {* When applicable, dictionary's ID is written into frame header (default:1) *}
{* multi-threading parameters *}
{* These parameters are only useful if multi-threading is enabled (compiled with build macro ZSTD_MULTITHREAD).
* They return an error otherwise. *}
ZSTD_c_nbWorkers=400, {* Select how many threads will be spawned to compress in parallel.
* When nbWorkers >= 1, triggers asynchronous mode when used with ZSTD_compressStream*() :
* ZSTD_compressStream*() consumes input and flush output if possible, but immediately gives back control to caller,
* while compression work is performed in parallel, within worker threads.
* (note : a strong exception to this rule is when first invocation of ZSTD_compressStream2() sets ZSTD_e_end :
* in which case, ZSTD_compressStream2() delegates to ZSTD_compress2(), which is always a blocking call).
* More workers improve speed, but also increase memory usage.
* Default value is `0`, aka "single-threaded mode" : no worker is spawned, compression is performed inside Caller's thread, all invocations are blocking *}
ZSTD_c_jobSize=401, {* Size of a compression job. This value is enforced only when nbWorkers >= 1.
* Each compression job is completed in parallel, so this value can indirectly impact the nb of active threads.
* 0 means default, which is dynamically determined based on compression parameters.
* Job size must be a minimum of overlap size, or 1 MB, whichever is largest.
* The minimum size is automatically and transparently enforced. *}
ZSTD_c_overlapLog=402, {* Control the overlap size, as a fraction of window size.
* The overlap size is an amount of data reloaded from previous job at the beginning of a new job.
* It helps preserve compression ratio, while each job is compressed in parallel.
* This value is enforced only when nbWorkers >= 1.
* Larger values increase compression ratio, but decrease speed.
* Possible values range from 0 to 9 :
* - 0 means "default" : value will be determined by the library, depending on strategy
* - 1 means "no overlap"
* - 9 means "full overlap", using a full window size.
* Each intermediate rank increases/decreases load size by a factor 2 :
* 9: full window; 8: w/2; 7: w/4; 6: w/8; 5:w/16; 4: w/32; 3:w/64; 2:w/128; 1:no overlap; 0:default
* default value varies between 6 and 9, depending on strategy *}
{* note : additional experimental parameters are also available
* within the experimental section of the API.
* At the time of this writing, they include :
* ZSTD_c_rsyncable
* ZSTD_c_format
* ZSTD_c_forceMaxWindow
* ZSTD_c_forceAttachDict
* ZSTD_c_literalCompressionMode
* ZSTD_c_targetCBlockSize
* ZSTD_c_srcSizeHint
* Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them.
* note : never ever use experimentalParam? names directly;
* also, the enums values themselves are unstable and can still change.
*}
ZSTD_c_experimentalParam1=500,
ZSTD_c_experimentalParam2=10,
ZSTD_c_experimentalParam3=1000,
ZSTD_c_experimentalParam4=1001,
ZSTD_c_experimentalParam5=1002,
ZSTD_c_experimentalParam6=1003,
ZSTD_c_experimentalParam7=1004,
ZSTD_c_experimentalParam8=1005,
ZSTD_c_experimentalParam9=1006,
ZSTD_c_experimentalParam10=1007,
ZSTD_c_experimentalParam11=1008,
ZSTD_c_experimentalParam12=1009
);
ZSTD_bounds = record
error : NativeInt;
lowerBound,upperBound:integer;
end;
ZSTD_ResetDirective=(
ZSTD_reset_session_only = 1,
ZSTD_reset_parameters = 2,
ZSTD_reset_session_and_parameters = 3
);
ZSTD_dParameter=(
ZSTD_d_windowLogMax=100, {* Select a size limit (in power of 2) beyond which
* the streaming API will refuse to allocate memory buffer
* in order to protect the host from unreasonable memory requirements.
* This parameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode.
* By default, a decompression context accepts window sizes <= (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT).
* Special: value 0 means "use default maximum windowLog". *}
{* note : additional experimental parameters are also available
* within the experimental section of the API.
* At the time of this writing, they include :
* ZSTD_d_format
* ZSTD_d_stableOutBuffer
* Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them.
* note : never ever use experimentalParam? names directly
*}
ZSTD_d_experimentalParam1=1000,
ZSTD_d_experimentalParam2=1001,
ZSTD_d_experimentalParam3=1002
);
ZSTD_inBuffer = record
src : Pointer;
size, pos : NativeInt;
end;
ZSTD_outBuffer = record
dst : Pointer;
size, pos : NativeInt;
end;
ZSTD_CStream = ZSTD_CCtx;
ZSTD_DStream = ZSTD_DCtx;
ZSTD_EndDirective=(
ZSTD_e_continue=0, {* collect more data, encoder decides when to output compressed result, for optimal compression ratio *}
ZSTD_e_flush=1, {* flush any data provided so far,
* it creates (at least) one new block, that can be decoded immediately on reception;
* frame will continue: any future data can still reference previously compressed data, improving compression.
* note : multithreaded compression will block to flush as much output as possible. *}
ZSTD_e_end=2 {* flush any remaining data _and_ close current frame.
* note that frame is only closed after compressed data is fully flushed (return value == 0).
* After that point, any additional data starts a new frame.
* note : each frame is independent (does not reference any content from previous frame).
: note : multithreaded compression will block to flush as much output as possible. *}
);
ZSTD_CDict = Pointer;
ZSTD_DDict = Pointer;
{$IFDEF WIN32}
function ERR_getErrorString(code : ZSTD_ErrorCode):PAnsiChar; inline;
procedure ZSTD_customFree(ptr : Pointer; customMem : ZSTD_customMem); inline;
function ZSTD_customMalloc(size : NativeInt; customMem : ZSTD_customMem): Pointer;
inline;
function ZSTD_customCalloc(size : NativeInt; customMem : ZSTD_customMem): Pointer;
inline;
function ZSTD_selectBlockCompressor(strat:ZSTD_strategy; dictMode: ZSTD_dictMode_e)
: ZSTD_blockCompressor; inline;
procedure ZSTD_resetSeqStore(ssPtr : Pointer);inline;
function ZSTD_fseBitCost(const ctable,count : Pointer; const max : Cardinal):NativeInt;
inline;
function ZSTD_crossEntropyCost(const norm :Pointer; accuracyLog :Cardinal; const
count : Pointer; const max : Cardinal):NativeInt; inline;
procedure ZSTD_seqToCodes(const seqStorePtr : Pointer);inline;
function HIST_count_wksp(count,maxSymbolValuePtr,src: Pointer; srcsize:NativeInt;
workSpace : Pointer; workSpaceSize:NativeInt):NativeInt; inline;
function ZSTD_noCompressLiterals(dst:Pointer; dstCapacity:NativeInt; const src :
Pointer; srcsize : NativeInt):NativeInt; inline;
function ZSTD_compressRleLiteralsBlock(dst:Pointer; dstCapacity:NativeInt; const src :
Pointer; srcsize : NativeInt):NativeInt; inline;
function FSE_readNCount_bmi2(normalizedCounter,maxSymbolValuePtr,tableLogPtr :
Pointer; const rBuffer:Pointer; rBuffSize:NativeInt; bmi2:integer):NativeInt;
inline;
function ZSTD_getErrorCode(functionResult : NativeInt):ZSTD_ErrorCode; inline;
function ZSTD_loadDEntropy(entropy : Pointer; const dict : Pointer; const
dictSize : NativeInt):NativeInt; inline;
function HUF_readStats_wksp(huffWeight:Pointer; hwSize:NativeInt; rankStats,
nbSymbolsPtr, tableLogPtr:Pointer; const src:Pointer; srcSize:NativeInt;
workspace:Pointer; wkspSize:NativeInt; bmi2:integer):NativeInt; inline;
function ZSTD_versionNumber:Cardinal; inline;
function ZSTD_versionString:PAnsiChar; inline;
function ZSTD_compress(dst:Pointer; dstCapacity : NativeInt; src:Pointer;
srcSize : NativeInt; compressionLevel : integer):NativeInt; inline;
function ZSTD_decompress(dst:Pointer; dstCapacity:NativeInt; src:Pointer;
compressedSize:NativeInt):NativeInt; inline;
function ZSTD_getFrameContentSize(const src:Pointer; srcsize:NativeInt):UInt64;
inline;
function ZSTD_getDecompressedSize(const src:Pointer; srcSize:NativeInt):UInt64;
inline;
function ZSTD_findFrameCompressedSize(const src:Pointer; srcSize:NativeInt):
NativeInt; inline;
function ZSTD_COMPRESSBOUND(srcSize:NativeInt):NativeInt; inline;
function ZSTD_isError(code : NativeInt):Cardinal; inline;
function ZSTD_getErrorName(code : NativeInt):PAnsiChar; inline;
function ZSTD_minCLevel:integer; inline;
function ZSTD_maxCLevel:integer; inline;
function ZSTD_createCCtx:ZSTD_CCtx; inline;
function ZSTD_freeCCtx(cctx: ZSTD_CCtx):NativeInt; inline;
function ZSTD_compressCCtx(cctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt; compressionLevel:integer):NativeInt; inline;
function ZSTD_createDCtx:ZSTD_DCtx; inline;
function ZSTD_freeDCtx(dctx: ZSTD_DCtx):NativeInt; inline;
function ZSTD_decompressDCtx(dctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt):NativeInt; inline;
function ZSTD_cParam_getBounds(cParam : ZSTD_cParameter): ZSTD_bounds; inline;
function ZSTD_CCtx_setParameter(cctx : ZSTD_CCtx; param:ZSTD_cParameter;
value : integer):NativeInt; inline;
function ZSTD_CCtx_setPledgedSrcSize(cctx : ZSTD_CCtx; pledgedScrSize:Uint64)
:NativeInt; inline;
function ZSTD_CCtx_reset(cctx:ZSTD_CCtx; reset: ZSTD_ResetDirective):NativeInt;
inline;
function ZSTD_compress2(cctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt):NativeInt; inline;
function ZSTD_dParam_getBounds(dParam : ZSTD_dParameter):ZSTD_bounds; inline;
function ZSTD_DCtx_setParameter(dctx:ZSTD_DCTx; param: ZSTD_dParameter;
value : integer):NativeInt; inline;
function ZSTD_DCtx_reset(dctx:ZSTD_DCtx; reset:ZSTD_ResetDirective):NativeInt;
inline;
function ZSTD_createCStream: ZSTD_CStream; inline;
function ZSTD_freeCStream(zsc : ZSTD_CStream):NativeInt; inline;
function ZSTD_compressStream2(cctx:ZSTD_CCtx; var output:ZSTD_outBuffer;
var input:ZSTD_inBuffer; endOp:ZSTD_EndDirective):NativeInt; inline;
function ZSTD_CStreamInSize:NativeInt; inline;
function ZSTD_CStreamOutSize:NativeInt; inline;
function ZSTD_initCStream(zcs:ZSTD_CStream; compressionLevel:integer):NativeInt;
inline;
function ZSTD_compressStream(zcs:ZSTD_CStream; var output:ZSTD_outBuffer;
var input:ZSTD_inBuffer):NativeInt; inline;
function ZSTD_flushStream(zcs:ZSTD_CStream; var output:ZSTD_outBuffer):NativeInt;
inline;
function ZSTD_endStream(zcs:ZSTD_CStream; var output:ZSTD_outBuffer):NativeInt;
inline;
function ZSTD_createDStream: ZSTD_DStream; inline;
function ZSTD_freeDStream(zds : ZSTD_DStream):NativeInt; inline;
function ZSTD_initDStream(zds : ZSTD_DStream):NativeInt; inline;
function ZSTD_decompressStream(zds:ZSTD_DStream; var output:ZSTD_outBuffer;
var input:ZSTD_inBuffer):NativeInt; inline;
function ZSTD_DStreamInSize:NativeInt; inline;
function ZSTD_DStreamOutSize:NativeInt; inline;
function ZSTD_compress_usingDict(ctx:ZSTD_CCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; dict:Pointer;
dictSize:NativeInt; compressionLevel:integer):NativeInt; inline;
function ZSTD_decompress_usingDict(dctx:ZSTD_DCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; dict:Pointer;
dictSize:NativeInt):NativeInt; inline;
function ZSTD_createCDict(const dictBuffer:Pointer; dictSize:NativeInt;
compressionLevel:integer):ZSTD_CDict; inline;
function ZSTD_freeCDict(CDict:ZSTD_CDict):NativeInt; inline;
function ZSTD_compress_usingCDict(cctx:ZSTD_CCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; cdict:ZSTD_CDict):
NativeInt; inline;
function ZSTD_createDDict(const dictBuffer:Pointer; dictSize:NativeInt):
ZSTD_DDict; inline;
function ZSTD_freeDDict(CDict:ZSTD_DDict):NativeInt; inline;
function ZSTD_decompress_usingDDict(dctx:ZSTD_DCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; ddict:ZSTD_DDict):
NativeInt; inline;
function ZSTD_getDictID_fromDict(const dict:Pointer; dictSize:NativeInt):
Cardinal; inline;
function ZSTD_getDictID_fromDDict(const dict:ZSTD_DDict; dictSize:NativeInt):
Cardinal; inline;
function ZSTD_getDictID_fromFrame(const src:Pointer; srcSize:NativeInt):Cardinal;
inline;
function ZSTD_CCtx_loadDictionary(cctx:ZSTD_CCtx; const dict:Pointer;
dictSize:NativeInt):NativeInt; inline;
function ZSTD_CCtx_refCDict(cctx:ZSTD_CCtx; const cdict:ZSTD_CDict):NativeInt;
inline;
function ZSTD_CCtx_refPrefix(cctx:ZSTD_CCtx; const prefix:Pointer;
prefixSize:NativeInt):NativeInt; inline;
function ZSTD_DCtx_loadDictionary(dctx:ZSTD_DCtx; const dict:Pointer;
dictSize:NativeInt):NativeInt; inline;
function ZSTD_DCtx_refDDict(dctx:ZSTD_DCtx; const ddict:ZSTD_DDict):NativeInt;
inline;
function ZSTD_DCtx_refPrefix(dctx:ZSTD_DCtx; const prefix:Pointer;
prefixSize:NativeInt):NativeInt; inline;
function ZSTD_sizeof_CCtx(const cctx:ZSTD_CCtx):NativeInt; inline;
function ZSTD_sizeof_DCtx(const dctx:ZSTD_DCtx):NativeInt; inline;
function ZSTD_sizeof_CStream(const zcs:ZSTD_CStream):NativeInt; inline;
function ZSTD_sizeof_DStream(const zds:ZSTD_DStream):NativeInt; inline;
function ZSTD_sizeof_CDict(const cdict:ZSTD_CDict):NativeInt; inline;
function ZSTD_sizeof_DDict(const ddict:ZSTD_DDict):NativeInt; inline;
function ZSTD_buildBlockEntropyStats(seqStorePtr:Pointer;const prevEntropy:
Pointer; nextEntropy:Pointer;const cctxParams:Pointer;entropyMetadata,
workspace:Pointer;wkspSize:NativeInt):NativeInt; inline;
function _ERR_getErrorString(code : ZSTD_ErrorCode):PAnsiChar; cdecl; external;
procedure _ZSTD_customFree(ptr : Pointer; customMem : ZSTD_customMem); cdecl;
external;
function _ZSTD_customMalloc(size : NativeInt; customMem : ZSTD_customMem): Pointer;
cdecl; external;
function _ZSTD_customCalloc(size : NativeInt; customMem : ZSTD_customMem): Pointer;
cdecl; external;
function _ZSTD_selectBlockCompressor(strat:ZSTD_strategy; dictMode: ZSTD_dictMode_e)
: ZSTD_blockCompressor; cdecl; external;
procedure _ZSTD_resetSeqStore(ssPtr : Pointer); cdecl; external;
function _ZSTD_fseBitCost(const ctable,count : Pointer; const max : Cardinal):NativeInt;
cdecl; external;
function _ZSTD_crossEntropyCost(const norm :Pointer; accuracyLog :Cardinal; const
count : Pointer; const max : Cardinal):NativeInt; cdecl; external;
procedure _ZSTD_seqToCodes(const seqStorePtr : Pointer); cdecl; external;
function _HIST_count_wksp(count,maxSymbolValuePtr,src: Pointer; srcsize:NativeInt;
workSpace : Pointer; workSpaceSize:NativeInt):NativeInt; cdecl; external;
function _ZSTD_noCompressLiterals(dst:Pointer; dstCapacity:NativeInt; const src :
Pointer; srcsize : NativeInt):NativeInt; cdecl; external;
function _ZSTD_compressRleLiteralsBlock(dst:Pointer; dstCapacity:NativeInt; const src :
Pointer; srcsize : NativeInt):NativeInt; cdecl; external;
function _FSE_readNCount_bmi2(normalizedCounter,maxSymbolValuePtr,tableLogPtr :
Pointer; const rBuffer:Pointer; rBuffSize:NativeInt; bmi2:integer):NativeInt;
cdecl; external;
function _ZSTD_getErrorCode(functionResult : NativeInt):ZSTD_ErrorCode; cdecl;
external;
function _ZSTD_loadDEntropy(entropy : Pointer; const dict : Pointer; const
dictSize : NativeInt):NativeInt; external;
function _HUF_readStats_wksp(huffWeight:Pointer; hwSize:NativeInt; rankStats,
nbSymbolsPtr, tableLogPtr:Pointer; const src:Pointer; srcSize:NativeInt;
workspace:Pointer; wkspSize:NativeInt; bmi2:integer):NativeInt; external;
function _ZSTD_versionNumber:Cardinal; cdecl; external;
function _ZSTD_versionString:PAnsiChar; cdecl; external;
function _ZSTD_compress(dst:Pointer; dstCapacity : NativeInt; src:Pointer;
srcSize : NativeInt; compressionLevel : integer):NativeInt; cdecl; external;
function _ZSTD_decompress(dst:Pointer; dstCapacity:NativeInt; src:Pointer;
compressedSize:NativeInt):NativeInt; cdecl; external;
function _ZSTD_getFrameContentSize(const src:Pointer; srcsize:NativeInt):UInt64;
cdecl; external;
function _ZSTD_getDecompressedSize(const src:Pointer; srcSize:NativeInt):UInt64;
cdecl; external;
function _ZSTD_findFrameCompressedSize(const src:Pointer; srcSize:NativeInt):
NativeInt; cdecl; external;
function _ZSTD_COMPRESSBOUND(srcSize:NativeInt):NativeInt; cdecl; external;
function _ZSTD_isError(code : NativeInt):Cardinal; cdecl; external;
function _ZSTD_getErrorName(code : NativeInt):PAnsiChar; cdecl; external;
function _ZSTD_minCLevel:integer; cdecl; external;
function _ZSTD_maxCLevel:integer; cdecl; external;
function _ZSTD_createCCtx:ZSTD_CCtx; cdecl; external;
function _ZSTD_freeCCtx(cctx: ZSTD_CCtx):NativeInt; cdecl; external;
function _ZSTD_compressCCtx(cctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt; compressionLevel:integer):NativeInt; cdecl;
external;
function _ZSTD_createDCtx:ZSTD_DCtx; cdecl; external;
function _ZSTD_freeDCtx(dctx: ZSTD_DCtx):NativeInt; cdecl; external;
function _ZSTD_decompressDCtx(dctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt):NativeInt; cdecl; external;
function _ZSTD_cParam_getBounds(cParam : ZSTD_cParameter): ZSTD_bounds; cdecl; external;
function _ZSTD_CCtx_setParameter(cctx : ZSTD_CCtx; param:ZSTD_cParameter;
value : integer):NativeInt; cdecl; external;
function _ZSTD_CCtx_setPledgedSrcSize(cctx : ZSTD_CCtx; pledgedScrSize:Uint64)
:NativeInt; cdecl; external;
function _ZSTD_CCtx_reset(cctx:ZSTD_CCtx; reset: ZSTD_ResetDirective):NativeInt;
cdecl; external;
function _ZSTD_compress2(cctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt):NativeInt; cdecl; external;
function _ZSTD_dParam_getBounds(dParam : ZSTD_dParameter):ZSTD_bounds; cdecl; external;
function _ZSTD_DCtx_setParameter(dctx:ZSTD_DCTx; param: ZSTD_dParameter;
value : integer):NativeInt; cdecl; external;
function _ZSTD_DCtx_reset(dctx:ZSTD_DCtx; reset:ZSTD_ResetDirective):NativeInt;
cdecl; external;
function _ZSTD_createCStream: ZSTD_CStream; cdecl; external;
function _ZSTD_freeCStream(zsc : ZSTD_CStream):NativeInt; cdecl; external;
function _ZSTD_compressStream2(cctx:ZSTD_CCtx; var output:ZSTD_outBuffer;
var input:ZSTD_inBuffer; endOp:ZSTD_EndDirective):NativeInt; cdecl; external;
function _ZSTD_CStreamInSize:NativeInt; cdecl; external;
function _ZSTD_CStreamOutSize:NativeInt; cdecl; external;
function _ZSTD_initCStream(zcs:ZSTD_CStream; compressionLevel:integer):NativeInt;
cdecl; external;
function _ZSTD_compressStream(zcs:ZSTD_CStream; var output:ZSTD_outBuffer;
var input:ZSTD_inBuffer):NativeInt; cdecl; external;
function _ZSTD_flushStream(zcs:ZSTD_CStream; var output:ZSTD_outBuffer):NativeInt;
cdecl; external;
function _ZSTD_endStream(zcs:ZSTD_CStream; var output:ZSTD_outBuffer):NativeInt;
cdecl; external;
function _ZSTD_createDStream: ZSTD_DStream; cdecl; external;
function _ZSTD_freeDStream(zds : ZSTD_DStream):NativeInt; cdecl; external;
function _ZSTD_initDStream(zds : ZSTD_DStream):NativeInt; cdecl; external;
function _ZSTD_decompressStream(zds:ZSTD_DStream; var output:ZSTD_outBuffer;
var input:ZSTD_inBuffer):NativeInt; cdecl; external;
function _ZSTD_DStreamInSize:NativeInt; cdecl; external;
function _ZSTD_DStreamOutSize:NativeInt; cdecl; external;
function _ZSTD_compress_usingDict(ctx:ZSTD_CCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; dict:Pointer;
dictSize:NativeInt; compressionLevel:integer):NativeInt; cdecl; external;
function _ZSTD_decompress_usingDict(dctx:ZSTD_DCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; dict:Pointer;
dictSize:NativeInt):NativeInt; cdecl; external;
function _ZSTD_createCDict(const dictBuffer:Pointer; dictSize:NativeInt;
compressionLevel:integer):ZSTD_CDict; cdecl; external;
function _ZSTD_freeCDict(CDict:ZSTD_CDict):NativeInt; cdecl; external;
function _ZSTD_compress_usingCDict(cctx:ZSTD_CCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; cdict:ZSTD_CDict):
NativeInt; cdecl; external;
function _ZSTD_createDDict(const dictBuffer:Pointer; dictSize:NativeInt):
ZSTD_DDict; cdecl; external;
function _ZSTD_freeDDict(CDict:ZSTD_DDict):NativeInt; cdecl; external;
function _ZSTD_decompress_usingDDict(dctx:ZSTD_DCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; ddict:ZSTD_DDict):
NativeInt; cdecl; external;
function _ZSTD_getDictID_fromDict(const dict:Pointer; dictSize:NativeInt):
Cardinal; cdecl; external;
function _ZSTD_getDictID_fromDDict(const dict:ZSTD_DDict; dictSize:NativeInt):
Cardinal; cdecl; external;
function _ZSTD_getDictID_fromFrame(const src:Pointer; srcSize:NativeInt):Cardinal;
cdecl; external;
function _ZSTD_CCtx_loadDictionary(cctx:ZSTD_CCtx; const dict:Pointer;
dictSize:NativeInt):NativeInt; cdecl; external;
function _ZSTD_CCtx_refCDict(cctx:ZSTD_CCtx; const cdict:ZSTD_CDict):NativeInt;
cdecl; external;
function _ZSTD_CCtx_refPrefix(cctx:ZSTD_CCtx; const prefix:Pointer;
prefixSize:NativeInt):NativeInt; cdecl; external;
function _ZSTD_DCtx_loadDictionary(dctx:ZSTD_DCtx; const dict:Pointer;
dictSize:NativeInt):NativeInt; cdecl; external;
function _ZSTD_DCtx_refDDict(dctx:ZSTD_DCtx; const ddict:ZSTD_DDict):NativeInt;
cdecl; external;
function _ZSTD_DCtx_refPrefix(dctx:ZSTD_DCtx; const prefix:Pointer;
prefixSize:NativeInt):NativeInt; cdecl; external;
function _ZSTD_sizeof_CCtx(const cctx:ZSTD_CCtx):NativeInt; cdecl; external;
function _ZSTD_sizeof_DCtx(const dctx:ZSTD_DCtx):NativeInt; cdecl; external;
function _ZSTD_sizeof_CStream(const zcs:ZSTD_CStream):NativeInt; cdecl; external;
function _ZSTD_sizeof_DStream(const zds:ZSTD_DStream):NativeInt; cdecl; external;
function _ZSTD_sizeof_CDict(const cdict:ZSTD_CDict):NativeInt; cdecl; external;
function _ZSTD_sizeof_DDict(const ddict:ZSTD_DDict):NativeInt; cdecl; external;
function _ZSTD_buildBlockEntropyStats(seqStorePtr:Pointer;const prevEntropy:
Pointer; nextEntropy:Pointer;const cctxParams:Pointer;entropyMetadata,
workspace:Pointer;wkspSize:NativeInt):NativeInt; cdecl; external;
{$ELSEIF DEFINED(WIN64)}
//ZSTDLIB_API unsigned ZSTD_versionNumber(void);
function ERR_getErrorString(code : ZSTD_ErrorCode):PAnsiChar; external;
procedure ZSTD_customFree(ptr : Pointer; customMem : ZSTD_customMem); external;
function ZSTD_customMalloc(size : NativeInt; customMem : ZSTD_customMem): Pointer;
external;
function ZSTD_customCalloc(size : NativeInt; customMem : ZSTD_customMem): Pointer;
external;
function ZSTD_selectBlockCompressor(strat:ZSTD_strategy; dictMode: ZSTD_dictMode_e)
: ZSTD_blockCompressor; external;
procedure ZSTD_resetSeqStore(ssPtr : Pointer); external;
function ZSTD_fseBitCost(const ctable,count : Pointer; const max : Cardinal):NativeInt;
external;
function ZSTD_crossEntropyCost(const norm :Pointer; accuracyLog :Cardinal; const
count : Pointer; const max : Cardinal):NativeInt; external;
procedure ZSTD_seqToCodes(const seqStorePtr : Pointer);external;
function HIST_count_wksp(count,maxSymbolValuePtr,src: Pointer; srcsize:NativeInt;
workSpace : Pointer; workSpaceSize:NativeInt):NativeInt; external;
function ZSTD_noCompressLiterals(dst:Pointer; dstCapacity:NativeInt; const src :
Pointer; srcsize : NativeInt):NativeInt; external;
function ZSTD_compressRleLiteralsBlock(dst:Pointer; dstCapacity:NativeInt; const src :
Pointer; srcsize : NativeInt):NativeInt; external;
function FSE_readNCount_bmi2(normalizedCounter,maxSymbolValuePtr,tableLogPtr :
Pointer; const rBuffer:Pointer; rBuffSize:NativeInt; bmi2:integer):NativeInt;
external;
function ZSTD_getErrorCode(functionResult : NativeInt):ZSTD_ErrorCode; external;
function ZSTD_loadDEntropy(entropy : Pointer; const dict : Pointer; const
dictSize : NativeInt):NativeInt; external;
function HUF_readStats_wksp(huffWeight:Pointer; hwSize:NativeInt; rankStats,
nbSymbolsPtr, tableLogPtr:Pointer; const src:Pointer; srcSize:NativeInt;
workspace:Pointer; wkspSize:NativeInt; bmi2:integer):NativeInt; external;
function ZSTD_versionNumber:Cardinal; external;
function ZSTD_versionString:PAnsiChar; external;
function ZSTD_compress(dst:Pointer; dstCapacity : NativeInt; src:Pointer;
srcSize : NativeInt; compressionLevel : integer):NativeInt; external;
function ZSTD_decompress(dst:Pointer; dstCapacity:NativeInt; src:Pointer;
compressedSize:NativeInt):NativeInt; external;
function ZSTD_getFrameContentSize(const src:Pointer; srcsize:NativeInt):UInt64;
external;
function ZSTD_getDecompressedSize(const src:Pointer; srcSize:NativeInt):UInt64;
external;
function ZSTD_findFrameCompressedSize(const src:Pointer; srcSize:NativeInt):
NativeInt; external;
function ZSTD_COMPRESSBOUND(srcSize:NativeInt):NativeInt; external;
function ZSTD_isError(code : NativeInt):Cardinal; external;
function ZSTD_getErrorName(code : NativeInt):PAnsiChar; external;
function ZSTD_minCLevel:integer; external;
function ZSTD_maxCLevel:integer; external;
function ZSTD_createCCtx:ZSTD_CCtx; external;
function ZSTD_freeCCtx(cctx: ZSTD_CCtx):NativeInt; external;
function ZSTD_compressCCtx(cctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt; compressionLevel:integer):NativeInt; external;
function ZSTD_createDCtx:ZSTD_DCtx; external;
function ZSTD_freeDCtx(dctx: ZSTD_DCtx):NativeInt; external;
function ZSTD_decompressDCtx(dctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt):NativeInt; external;
function ZSTD_cParam_getBounds(cParam : ZSTD_cParameter): ZSTD_bounds; external;
function ZSTD_CCtx_setParameter(cctx : ZSTD_CCtx; param:ZSTD_cParameter;
value : integer):NativeInt; external;
function ZSTD_CCtx_setPledgedSrcSize(cctx : ZSTD_CCtx; pledgedScrSize:Uint64)
:NativeInt; external;
function ZSTD_CCtx_reset(cctx:ZSTD_CCtx; reset: ZSTD_ResetDirective):NativeInt;
external;
function ZSTD_compress2(cctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt):NativeInt; external;
function ZSTD_dParam_getBounds(dParam : ZSTD_dParameter):ZSTD_bounds; external;
function ZSTD_DCtx_setParameter(dctx:ZSTD_DCTx; param: ZSTD_dParameter;
value : integer):NativeInt; external;
function ZSTD_DCtx_reset(dctx:ZSTD_DCtx; reset:ZSTD_ResetDirective):NativeInt;
external;
function ZSTD_createCStream: ZSTD_CStream; external;
function ZSTD_freeCStream(zsc : ZSTD_CStream):NativeInt; external;
function ZSTD_compressStream2(cctx:ZSTD_CCtx; var output:ZSTD_outBuffer;
var input:ZSTD_inBuffer; endOp:ZSTD_EndDirective):NativeInt; external;
function ZSTD_CStreamInSize:NativeInt; external;
function ZSTD_CStreamOutSize:NativeInt; external;
function ZSTD_initCStream(zcs:ZSTD_CStream; compressionLevel:integer):NativeInt;
external;
function ZSTD_compressStream(zcs:ZSTD_CStream; var output:ZSTD_outBuffer;
var input:ZSTD_inBuffer):NativeInt; external;
function ZSTD_flushStream(zcs:ZSTD_CStream; var output:ZSTD_outBuffer):NativeInt;
external;
function ZSTD_endStream(zcs:ZSTD_CStream; var output:ZSTD_outBuffer):NativeInt;
external;
function ZSTD_createDStream: ZSTD_DStream; external;
function ZSTD_freeDStream(zds : ZSTD_DStream):NativeInt; external;
function ZSTD_initDStream(zds : ZSTD_DStream):NativeInt; external;
function ZSTD_decompressStream(zds:ZSTD_DStream; var output:ZSTD_outBuffer;
var input:ZSTD_inBuffer):NativeInt; external;
function ZSTD_DStreamInSize:NativeInt; external;
function ZSTD_DStreamOutSize:NativeInt; external;
function ZSTD_compress_usingDict(ctx:ZSTD_CCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; dict:Pointer;
dictSize:NativeInt; compressionLevel:integer):NativeInt; external;
function ZSTD_decompress_usingDict(dctx:ZSTD_DCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; dict:Pointer;
dictSize:NativeInt):NativeInt; external;
function ZSTD_createCDict(const dictBuffer:Pointer; dictSize:NativeInt;
compressionLevel:integer):ZSTD_CDict; external;
function ZSTD_freeCDict(CDict:ZSTD_CDict):NativeInt; external;
function ZSTD_compress_usingCDict(cctx:ZSTD_CCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; cdict:ZSTD_CDict):
NativeInt; external;
function ZSTD_createDDict(const dictBuffer:Pointer; dictSize:NativeInt):
ZSTD_DDict; external;
function ZSTD_freeDDict(CDict:ZSTD_DDict):NativeInt; external;
function ZSTD_decompress_usingDDict(dctx:ZSTD_DCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; ddict:ZSTD_DDict):
NativeInt; external;
function ZSTD_getDictID_fromDict(const dict:Pointer; dictSize:NativeInt):
Cardinal; external;
function ZSTD_getDictID_fromDDict(const dict:ZSTD_DDict; dictSize:NativeInt):
Cardinal; external;
function ZSTD_getDictID_fromFrame(const src:Pointer; srcSize:NativeInt):Cardinal;
external;
function ZSTD_CCtx_loadDictionary(cctx:ZSTD_CCtx; const dict:Pointer;
dictSize:NativeInt):NativeInt; external;
function ZSTD_CCtx_refCDict(cctx:ZSTD_CCtx; const cdict:ZSTD_CDict):NativeInt;
external;
function ZSTD_CCtx_refPrefix(cctx:ZSTD_CCtx; const prefix:Pointer;
prefixSize:NativeInt):NativeInt; external;
function ZSTD_DCtx_loadDictionary(dctx:ZSTD_DCtx; const dict:Pointer;
dictSize:NativeInt):NativeInt; external;
function ZSTD_DCtx_refDDict(dctx:ZSTD_DCtx; const ddict:ZSTD_DDict):NativeInt;
external;
function ZSTD_DCtx_refPrefix(dctx:ZSTD_DCtx; const prefix:Pointer;
prefixSize:NativeInt):NativeInt; external;
function ZSTD_sizeof_CCtx(const cctx:ZSTD_CCtx):NativeInt; external;
function ZSTD_sizeof_DCtx(const dctx:ZSTD_DCtx):NativeInt; external;
function ZSTD_sizeof_CStream(const zcs:ZSTD_CStream):NativeInt; external;
function ZSTD_sizeof_DStream(const zds:ZSTD_DStream):NativeInt; external;
function ZSTD_sizeof_CDict(const cdict:ZSTD_CDict):NativeInt; external;
function ZSTD_sizeof_DDict(const ddict:ZSTD_DDict):NativeInt; external;
function ZSTD_buildBlockEntropyStats(seqStorePtr:Pointer; const prevEntropy:
Pointer; nextEntropy:Pointer;const cctxParams:Pointer; entropyMetadata,
workspace:Pointer;wkspSize:NativeInt):NativeInt; external;
{$ELSE}
function ERR_getErrorString(code : ZSTD_ErrorCode):PAnsiChar; external 'libzstd.a';
procedure ZSTD_customFree(ptr : Pointer; customMem : ZSTD_customMem); external
'libzstd.a';
function ZSTD_customMalloc(size : NativeInt; customMem : ZSTD_customMem): Pointer;
external 'libzstd.a';
function ZSTD_customCalloc(size : NativeInt; customMem : ZSTD_customMem): Pointer;
external 'libzstd.a';
function ZSTD_selectBlockCompressor(strat:ZSTD_strategy; dictMode: ZSTD_dictMode_e)
: ZSTD_blockCompressor; external 'libzstd.a';
procedure ZSTD_resetSeqStore(ssPtr : Pointer); external 'libzstd.a';
function ZSTD_fseBitCost(const ctable,count : Pointer; const max : Cardinal):NativeInt;
external 'libzstd.a';
function ZSTD_crossEntropyCost(const norm :Pointer; accuracyLog :Cardinal; const
count : Pointer; const max : Cardinal):NativeInt; external 'libzstd.a';
procedure ZSTD_seqToCodes(const seqStorePtr : Pointer); external 'libzstd.a';
function HIST_count_wksp(count,maxSymbolValuePtr,src: Pointer; srcsize:NativeInt;
workSpace : Pointer; workSpaceSize:NativeInt):NativeInt; external 'libzstd.a';
function ZSTD_noCompressLiterals(dst:Pointer; dstCapacity:NativeInt; const src :
Pointer; srcsize : NativeInt):NativeInt; external 'libzstd.a';
function ZSTD_compressRleLiteralsBlock(dst:Pointer; dstCapacity:NativeInt; const src :
Pointer; srcsize : NativeInt):NativeInt; external 'libzstd.a';
function FSE_readNCount_bmi2(normalizedCounter,maxSymbolValuePtr,tableLogPtr :
Pointer; const rBuffer:Pointer; rBuffSize:NativeInt; bmi2:integer):NativeInt;
external 'libzstd.a';
function ZSTD_getErrorCode(functionResult : NativeInt):ZSTD_ErrorCode; external
'libzstd.a';
function ZSTD_loadDEntropy(entropy : Pointer; const dict : Pointer; const
dictSize : NativeInt):NativeInt; external 'libzstd.a';
function HUF_readStats_wksp(huffWeight:Pointer; hwSize:NativeInt; rankStats,
nbSymbolsPtr, tableLogPtr:Pointer; const src:Pointer; srcSize:NativeInt;
workspace:Pointer; wkspSize:NativeInt; bmi2:integer):NativeInt; external
'libzstd.a';
function ZSTD_versionNumber:Cardinal; external 'libzstd.a';
function ZSTD_versionString:PAnsiChar; external 'libzstd.a';
function ZSTD_compress(dst:Pointer; dstCapacity : NativeInt; src:Pointer;
srcSize : NativeInt; compressionLevel : integer):NativeInt; external 'libzstd.a';
function ZSTD_decompress(dst:Pointer; dstCapacity:NativeInt; src:Pointer;
compressedSize:NativeInt):NativeInt; external 'libzstd.a';
function ZSTD_getFrameContentSize(const src:Pointer; srcsize:NativeInt):UInt64;
external 'libzstd.a';
function ZSTD_getDecompressedSize(const src:Pointer; srcSize:NativeInt):UInt64;
external 'libzstd.a';
function ZSTD_findFrameCompressedSize(const src:Pointer; srcSize:NativeInt):
NativeInt; external 'libzstd.a';
function ZSTD_compressBound(srcSize:NativeInt):NativeInt; external 'libzstd.a';
function ZSTD_isError(code : NativeInt):Cardinal; external 'libzstd.a';
function ZSTD_getErrorName(code : NativeInt):PAnsiChar; external 'libzstd.a';
function ZSTD_minCLevel:integer; external 'libzstd.a';
function ZSTD_maxCLevel:integer; external 'libzstd.a';
function ZSTD_createCCtx:ZSTD_CCtx; external 'libzstd.a';
function ZSTD_freeCCtx(cctx: ZSTD_CCtx):NativeInt; external 'libzstd.a';
function ZSTD_compressCCtx(cctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt; compressionLevel:integer):NativeInt; external 'libzstd.a';
function ZSTD_createDCtx:ZSTD_DCtx; external 'libzstd.a';
function ZSTD_freeDCtx(dctx: ZSTD_DCtx):NativeInt; external 'libzstd.a';
function ZSTD_decompressDCtx(dctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt):NativeInt; external 'libzstd.a';
function ZSTD_cParam_getBounds(cParam : ZSTD_cParameter): ZSTD_bounds; external 'libzstd.a';
function ZSTD_CCtx_setParameter(cctx : ZSTD_CCtx; param:ZSTD_cParameter;
value : integer):NativeInt; external 'libzstd.a';
function ZSTD_CCtx_setPledgedSrcSize(cctx : ZSTD_CCtx; pledgedScrSize:Uint64)
:NativeInt; external 'libzstd.a';
function ZSTD_CCtx_reset(cctx:ZSTD_CCtx; reset: ZSTD_ResetDirective):NativeInt;
external 'libzstd.a';
function ZSTD_compress2(cctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt):NativeInt; external 'libzstd.a';
function ZSTD_dParam_getBounds(dParam : ZSTD_dParameter):ZSTD_bounds; external 'libzstd.a';
function ZSTD_DCtx_setParameter(dctx:ZSTD_DCTx; param: ZSTD_dParameter;
value : integer):NativeInt; external 'libzstd.a';
function ZSTD_DCtx_reset(dctx:ZSTD_DCtx; reset:ZSTD_ResetDirective):NativeInt;
external 'libzstd.a';
function ZSTD_createCStream: ZSTD_CStream; external 'libzstd.a';
function ZSTD_freeCStream(zsc : ZSTD_CStream):NativeInt; external 'libzstd.a';
function ZSTD_compressStream2(cctx:ZSTD_CCtx; var output:ZSTD_outBuffer;
var input:ZSTD_inBuffer; endOp:ZSTD_EndDirective):NativeInt; external 'libzstd.a';
function ZSTD_CStreamInSize:NativeInt; external 'libzstd.a';
function ZSTD_CStreamOutSize:NativeInt; external 'libzstd.a';
function ZSTD_initCStream(zcs:ZSTD_CStream; compressionLevel:integer):NativeInt;
external 'libzstd.a';
function ZSTD_compressStream(zcs:ZSTD_CStream; var output:ZSTD_outBuffer;
var input:ZSTD_inBuffer):NativeInt; external 'libzstd.a';
function ZSTD_flushStream(zcs:ZSTD_CStream; var output:ZSTD_outBuffer):NativeInt;
external 'libzstd.a';
function ZSTD_endStream(zcs:ZSTD_CStream; var output:ZSTD_outBuffer):NativeInt;
external 'libzstd.a';
function ZSTD_createDStream: ZSTD_DStream; external 'libzstd.a';
function ZSTD_freeDStream(zds : ZSTD_DStream):NativeInt; external 'libzstd.a';
function ZSTD_initDStream(zds : ZSTD_DStream):NativeInt; external 'libzstd.a';
function ZSTD_decompressStream(zds:ZSTD_DStream; var output:ZSTD_outBuffer;
var input:ZSTD_inBuffer):NativeInt; external 'libzstd.a';
function ZSTD_DStreamInSize:NativeInt; external 'libzstd.a';
function ZSTD_DStreamOutSize:NativeInt; external 'libzstd.a';
function ZSTD_compress_usingDict(ctx:ZSTD_CCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; dict:Pointer;
dictSize:NativeInt; compressionLevel:integer):NativeInt; external 'libzstd.a';
function ZSTD_decompress_usingDict(dctx:ZSTD_DCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; dict:Pointer;
dictSize:NativeInt):NativeInt; external 'libzstd.a';
function ZSTD_createCDict(const dictBuffer:Pointer; dictSize:NativeInt;
compressionLevel:integer):ZSTD_CDict; external 'libzstd.a';
function ZSTD_freeCDict(CDict:ZSTD_CDict):NativeInt; external 'libzstd.a';
function ZSTD_compress_usingCDict(cctx:ZSTD_CCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; cdict:ZSTD_CDict):
NativeInt; external 'libzstd.a';
function ZSTD_createDDict(const dictBuffer:Pointer; dictSize:NativeInt):
ZSTD_DDict; external 'libzstd.a';
function ZSTD_freeDDict(CDict:ZSTD_DDict):NativeInt; external 'libzstd.a';
function ZSTD_decompress_usingDDict(dctx:ZSTD_DCtx; dst:Pointer;
dstCapacity:NativeInt; src:Pointer; srcSize:NativeInt; ddict:ZSTD_DDict):
NativeInt; external 'libzstd.a';
function ZSTD_getDictID_fromDict(const dict:Pointer; dictSize:NativeInt):
Cardinal; external 'libzstd.a';
function ZSTD_getDictID_fromDDict(const dict:ZSTD_DDict; dictSize:NativeInt):
Cardinal; external 'libzstd.a';
function ZSTD_getDictID_fromFrame(const src:Pointer; srcSize:NativeInt):Cardinal;
external 'libzstd.a';
function ZSTD_CCtx_loadDictionary(cctx:ZSTD_CCtx; const dict:Pointer;
dictSize:NativeInt):NativeInt; external 'libzstd.a';
function ZSTD_CCtx_refCDict(cctx:ZSTD_CCtx; const cdict:ZSTD_CDict):NativeInt;
external 'libzstd.a';
function ZSTD_CCtx_refPrefix(cctx:ZSTD_CCtx; const prefix:Pointer;
prefixSize:NativeInt):NativeInt; external 'libzstd.a';
function ZSTD_DCtx_loadDictionary(dctx:ZSTD_DCtx; const dict:Pointer;
dictSize:NativeInt):NativeInt; external 'libzstd.a';
function ZSTD_DCtx_refDDict(dctx:ZSTD_DCtx; const ddict:ZSTD_DDict):NativeInt;
external 'libzstd.a';
function ZSTD_DCtx_refPrefix(dctx:ZSTD_DCtx; const prefix:Pointer;
prefixSize:NativeInt):NativeInt; external 'libzstd.a';
function ZSTD_sizeof_CCtx(const cctx:ZSTD_CCtx):NativeInt; external 'libzstd.a';
function ZSTD_sizeof_DCtx(const dctx:ZSTD_DCtx):NativeInt; external 'libzstd.a';
function ZSTD_sizeof_CStream(const zcs:ZSTD_CStream):NativeInt; external 'libzstd.a';
function ZSTD_sizeof_DStream(const zds:ZSTD_DStream):NativeInt; external 'libzstd.a';
function ZSTD_sizeof_CDict(const cdict:ZSTD_CDict):NativeInt; external 'libzstd.a';
function ZSTD_sizeof_DDict(const ddict:ZSTD_DDict):NativeInt; external 'libzstd.a';
function ZSTD_buildBlockEntropyStats(seqStorePtr:Pointer;const prevEntropy:
Pointer; nextEntropy:Pointer;const cctxParams:Pointer;entropyMetadata,
workspace:Pointer;wkspSize:NativeInt):NativeInt; external 'libzstd.a';
{$ENDIF}
implementation
uses xxhashlib
{$IFDEF MSWINDOWS}
,libc
{$ENDIF}
;
{$IFDEF WIN32}
function ERR_getErrorString(code : ZSTD_ErrorCode):PAnsiChar; inline;
begin Result := _ERR_getErrorString(code); end;
procedure ZSTD_customFree(ptr : Pointer; customMem : ZSTD_customMem); inline;
begin _ZSTD_customFree(ptr,customMem); end;
function ZSTD_customMalloc(size : NativeInt; customMem : ZSTD_customMem): Pointer;
inline;
begin Result := _ZSTD_customMalloc(size,customMem); end;
function ZSTD_customCalloc(size : NativeInt; customMem : ZSTD_customMem): Pointer;
inline;
begin Result := _ZSTD_customCalloc(size,customMem); end;
function ZSTD_selectBlockCompressor(strat:ZSTD_strategy; dictMode: ZSTD_dictMode_e)
: ZSTD_blockCompressor; inline;
begin Result := _ZSTD_selectBlockCompressor(strat,dictMode);end;
procedure ZSTD_resetSeqStore(ssPtr : Pointer);inline;
begin _ZSTD_resetSeqStore(ssPtr) end;
function ZSTD_fseBitCost(const ctable,count : Pointer; const max : Cardinal):NativeInt;
inline;
begin Result := _ZSTD_fseBitCost(ctable,count,max) end;
function ZSTD_crossEntropyCost(const norm :Pointer; accuracyLog :Cardinal; const
count : Pointer; const max : Cardinal):NativeInt; inline;
begin Result := _ZSTD_crossEntropyCost(norm,accuracyLog,count,max) end;
procedure ZSTD_seqToCodes(const seqStorePtr : Pointer);inline;
begin _ZSTD_seqToCodes(seqStorePtr) end;
function HIST_count_wksp(count,maxSymbolValuePtr,src: Pointer; srcsize:NativeInt;
workSpace : Pointer; workSpaceSize:NativeInt):NativeInt; inline;
begin
Result := _HIST_count_wksp(count,maxSymbolValuePtr,src,srcsize,workSpace,
workSpaceSize)
end;
function ZSTD_noCompressLiterals(dst:Pointer; dstCapacity:NativeInt; const src :
Pointer; srcsize : NativeInt):NativeInt; inline;
begin Result := _ZSTD_noCompressLiterals(dst,dstCapacity,src,srcsize) end;
function ZSTD_compressRleLiteralsBlock(dst:Pointer; dstCapacity:NativeInt; const src :
Pointer; srcsize : NativeInt):NativeInt; inline;
begin Result := _ZSTD_compressRleLiteralsBlock(dst,dstCapacity,src,srcsize) end;
function FSE_readNCount_bmi2(normalizedCounter,maxSymbolValuePtr,tableLogPtr :
Pointer; const rBuffer:Pointer; rBuffSize:NativeInt; bmi2:integer):NativeInt;
inline;
begin
Result := _FSE_readNCount_bmi2(normalizedCounter,maxSymbolValuePtr,tableLogPtr,
rBuffer, rBuffSize, bmi2)
end;
function ZSTD_getErrorCode(functionResult : NativeInt):ZSTD_ErrorCode; inline;
begin Result := _ZSTD_getErrorCode(functionResult) end;
function ZSTD_loadDEntropy(entropy : Pointer; const dict : Pointer; const
dictSize : NativeInt):NativeInt; inline;
begin Result := _ZSTD_loadDEntropy(entropy,dict,dictSize) end;
function HUF_readStats_wksp(huffWeight:Pointer; hwSize:NativeInt; rankStats,
nbSymbolsPtr, tableLogPtr:Pointer; const src:Pointer; srcSize:NativeInt;
workspace:Pointer; wkspSize:NativeInt; bmi2:integer):NativeInt; inline;
begin
Result := _HUF_readStats_wksp(huffWeight,hwSize,rankStats,nbSymbolsPtr,tableLogPtr,
src,srcSize,workspace,wkspSize,bmi2);
end;
function ZSTD_versionNumber:Cardinal; inline;
begin Result := _ZSTD_versionNumber; end;
function ZSTD_versionString:PAnsiChar; inline;
begin Result := _ZSTD_versionString; end;
function ZSTD_compress(dst:Pointer; dstCapacity : NativeInt; src:Pointer;
srcSize : NativeInt; compressionLevel : integer):NativeInt; inline;
begin Result := _ZSTD_compress(dst,dstCapacity,src,srcSize,compressionLevel); end;
function ZSTD_decompress(dst:Pointer; dstCapacity:NativeInt; src:Pointer;
compressedSize:NativeInt):NativeInt; inline;
begin Result:=_ZSTD_decompress(dst,dstCapacity,src,compressedSize);end;
function ZSTD_getFrameContentSize(const src:Pointer; srcsize:NativeInt):UInt64;
inline;
begin Result:=_ZSTD_getFrameContentSize(src,srcSize);end;
function ZSTD_getDecompressedSize(const src:Pointer; srcSize:NativeInt):UInt64;
inline;
begin Result:=_ZSTD_getDecompressedSize(src,srcSize);end;
function ZSTD_findFrameCompressedSize(const src:Pointer; srcSize:NativeInt):
NativeInt; inline;
begin Result:=_ZSTD_findFrameCompressedSize(src,srcSize);end;
function ZSTD_COMPRESSBOUND(srcSize:NativeInt):NativeInt; inline;
begin Result:=_ZSTD_COMPRESSBOUND(srcSize);end;
function ZSTD_isError(code : NativeInt):Cardinal; inline;
begin Result := _ZSTD_isError(code);end;
function ZSTD_getErrorName(code : NativeInt):PAnsiChar; inline;
begin Result:=_ZSTD_getErrorName(code);end;
function ZSTD_minCLevel:integer; inline;
begin Result := _ZSTD_minCLevel; end;
function ZSTD_maxCLevel:integer; inline;
begin Result := _ZSTD_maxCLevel; end;
function ZSTD_createCCtx:ZSTD_CCtx; inline;
begin Result := _ZSTD_createCCtx; end;
function ZSTD_freeCCtx(cctx: ZSTD_CCtx):NativeInt; inline;
begin Result :=_ZSTD_freeCCtx(cctx); end;
function ZSTD_compressCCtx(cctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt; compressionLevel:integer):NativeInt; inline;
begin Result:=_ZSTD_compressCCtx(cctx,dst,dstCapacity,src,srcSize,compressionLevel);end;
function ZSTD_createDCtx:ZSTD_DCtx; inline;
begin Result:=_ZSTD_createDCTX;end;
function ZSTD_freeDCtx(dctx: ZSTD_DCtx):NativeInt; inline;
begin Result := _ZSTD_freeDCtx(dctx);end;
function ZSTD_decompressDCtx(dctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt):NativeInt; inline;
begin Result:=_ZSTD_decompressDCtx(dctx,dst,dstCapacity,src,srcSize);end;
function ZSTD_cParam_getBounds(cParam : ZSTD_cParameter): ZSTD_bounds; inline;
begin Result:=_ZSTD_cParam_getBounds(cParam);end;
function ZSTD_CCtx_setParameter(cctx : ZSTD_CCtx; param:ZSTD_cParameter;
value : integer):NativeInt; inline;
begin Result:=_ZSTD_CCtx_setParameter(cctx,param,value);end;
function ZSTD_CCtx_setPledgedSrcSize(cctx : ZSTD_CCtx; pledgedScrSize:Uint64)
:NativeInt; inline;
begin Result:=_ZSTD_CCtx_setPledgedSrcSize(cctx,pledgedScrSize);end;
function ZSTD_CCtx_reset(cctx:ZSTD_CCtx; reset: ZSTD_ResetDirective):NativeInt;
inline;
begin Result:=_ZSTD_CCtx_reset(cctx,reset);end;
function ZSTD_compress2(cctx:ZSTD_CCtx; dst:Pointer; dstCapacity:NativeInt;
src:Pointer; srcSize:NativeInt):NativeInt; inline;
begin Result:=_ZSTD_compress2(cctx,dst,dstCapacity,src,srcSize);end;
function ZSTD_dParam_getBounds(dParam : ZSTD_dParameter):ZSTD_bounds; inline;
begin Result:=_ZSTD_dParam_getBounds(dParam)end;
function ZSTD_DCtx_setParameter(dctx:ZSTD_DCTx; param: ZSTD_dParameter;
value : integer):NativeInt; inline;