| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#ifndef __LZMA_ENC_H |
| 5 |
#define __LZMA_ENC_H |
| 6 |
|
| 7 |
#include "Types.h" |
| 8 |
|
| 9 |
#define LZMA_PROPS_SIZE 5 |
| 10 |
|
| 11 |
struct CLzmaEncProps |
| 12 |
{ |
| 13 |
int level; |
| 14 |
uint32_t dictSize; |
| 15 |
|
| 16 |
|
| 17 |
int lc; |
| 18 |
int lp; |
| 19 |
int pb; |
| 20 |
int algo; |
| 21 |
int fb; |
| 22 |
int btMode; |
| 23 |
int numHashBytes; |
| 24 |
uint32_t mc; |
| 25 |
unsigned writeEndMark; |
| 26 |
int numThreads; |
| 27 |
}; |
| 28 |
|
| 29 |
void LzmaEncProps_Init(struct CLzmaEncProps *p); |
| 30 |
void LzmaEncProps_Normalize(struct CLzmaEncProps *p); |
| 31 |
uint32_t LzmaEncProps_GetDictSize(const struct CLzmaEncProps *props2); |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
typedef void * CLzmaEncHandle; |
| 47 |
|
| 48 |
CLzmaEncHandle LzmaEnc_Create(struct ISzAlloc *alloc); |
| 49 |
void LzmaEnc_Destroy(CLzmaEncHandle p, struct ISzAlloc *alloc, struct ISzAlloc *allocBig); |
| 50 |
SRes LzmaEnc_SetProps(CLzmaEncHandle p, const struct CLzmaEncProps *props); |
| 51 |
SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, uint8_t *properties, size_t *size); |
| 52 |
SRes LzmaEnc_Encode(CLzmaEncHandle p, struct ISeqOutStream *outStream, struct ISeqInStream *inStream, |
| 53 |
struct ICompressProgress *progress, struct ISzAlloc *alloc, struct ISzAlloc *allocBig); |
| 54 |
SRes LzmaEnc_MemEncode(CLzmaEncHandle p, uint8_t *dest, size_t *destLen, const uint8_t *src, size_t srcLen, |
| 55 |
int writeEndMark, struct ICompressProgress *progress, struct ISzAlloc *alloc, struct ISzAlloc *allocBig); |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
SRes LzmaEncode(uint8_t *dest, size_t *destLen, const uint8_t *src, size_t srcLen, |
| 69 |
const struct CLzmaEncProps *props, uint8_t *propsEncoded, size_t *propsSize, int writeEndMark, |
| 70 |
struct ICompressProgress *progress, struct ISzAlloc *alloc, struct ISzAlloc *allocBig); |
| 71 |
|
| 72 |
#endif |