goat3d

diff libs/openctm/liblzma/LzmaEnc.h @ 14:188c697b3b49

- added a document describing the goat3d file format chunk hierarchy - started an alternative XML-based file format - added the openctm library
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 26 Sep 2013 04:47:05 +0300
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libs/openctm/liblzma/LzmaEnc.h	Thu Sep 26 04:47:05 2013 +0300
     1.3 @@ -0,0 +1,72 @@
     1.4 +/*  LzmaEnc.h -- LZMA Encoder
     1.5 +2008-10-04 : Igor Pavlov : Public domain */
     1.6 +
     1.7 +#ifndef __LZMAENC_H
     1.8 +#define __LZMAENC_H
     1.9 +
    1.10 +#include "Types.h"
    1.11 +
    1.12 +#define LZMA_PROPS_SIZE 5
    1.13 +
    1.14 +typedef struct _CLzmaEncProps
    1.15 +{
    1.16 +  int level;       /*  0 <= level <= 9 */
    1.17 +  UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
    1.18 +                      (1 << 12) <= dictSize <= (1 << 30) for 64-bit version
    1.19 +                       default = (1 << 24) */
    1.20 +  int lc;          /* 0 <= lc <= 8, default = 3 */
    1.21 +  int lp;          /* 0 <= lp <= 4, default = 0 */
    1.22 +  int pb;          /* 0 <= pb <= 4, default = 2 */
    1.23 +  int algo;        /* 0 - fast, 1 - normal, default = 1 */
    1.24 +  int fb;          /* 5 <= fb <= 273, default = 32 */
    1.25 +  int btMode;      /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
    1.26 +  int numHashBytes; /* 2, 3 or 4, default = 4 */
    1.27 +  UInt32 mc;        /* 1 <= mc <= (1 << 30), default = 32 */
    1.28 +  unsigned writeEndMark;  /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
    1.29 +  int numThreads;  /* 1 or 2, default = 2 */
    1.30 +} CLzmaEncProps;
    1.31 +
    1.32 +void LzmaEncProps_Init(CLzmaEncProps *p);
    1.33 +void LzmaEncProps_Normalize(CLzmaEncProps *p);
    1.34 +UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
    1.35 +
    1.36 +
    1.37 +/* ---------- CLzmaEncHandle Interface ---------- */
    1.38 +
    1.39 +/* LzmaEnc_* functions can return the following exit codes:
    1.40 +Returns:
    1.41 +  SZ_OK           - OK
    1.42 +  SZ_ERROR_MEM    - Memory allocation error
    1.43 +  SZ_ERROR_PARAM  - Incorrect paramater in props
    1.44 +  SZ_ERROR_WRITE  - Write callback error.
    1.45 +  SZ_ERROR_PROGRESS - some break from progress callback
    1.46 +  SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
    1.47 +*/
    1.48 +
    1.49 +typedef void * CLzmaEncHandle;
    1.50 +
    1.51 +CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc);
    1.52 +void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig);
    1.53 +SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
    1.54 +SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
    1.55 +SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream,
    1.56 +    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
    1.57 +SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
    1.58 +    int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
    1.59 +
    1.60 +/* ---------- One Call Interface ---------- */
    1.61 +
    1.62 +/* LzmaEncode
    1.63 +Return code:
    1.64 +  SZ_OK               - OK
    1.65 +  SZ_ERROR_MEM        - Memory allocation error
    1.66 +  SZ_ERROR_PARAM      - Incorrect paramater
    1.67 +  SZ_ERROR_OUTPUT_EOF - output buffer overflow
    1.68 +  SZ_ERROR_THREAD     - errors in multithreading functions (only for Mt version)
    1.69 +*/
    1.70 +
    1.71 +SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
    1.72 +    const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
    1.73 +    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
    1.74 +
    1.75 +#endif