~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to src/lib/lib7z/LzmaEnc.h

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  LzmaEnc.h -- LZMA Encoder
 
2
2011-01-27 : Igor Pavlov : Public domain */
 
3
 
 
4
#ifndef __LZMA_ENC_H
 
5
#define __LZMA_ENC_H
 
6
 
 
7
#include "Types.h"
 
8
 
 
9
EXTERN_C_BEGIN
 
10
 
 
11
#define LZMA_PROPS_SIZE 5
 
12
 
 
13
typedef struct _CLzmaEncProps
 
14
{
 
15
  int level;       /*  0 <= level <= 9 */
 
16
  UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
 
17
                      (1 << 12) <= dictSize <= (1 << 30) for 64-bit version
 
18
                       default = (1 << 24) */
 
19
  UInt32 reduceSize; /* estimated size of data that will be compressed. default = 0xFFFFFFFF.
 
20
                        Encoder uses this value to reduce dictionary size */
 
21
  int lc;          /* 0 <= lc <= 8, default = 3 */
 
22
  int lp;          /* 0 <= lp <= 4, default = 0 */
 
23
  int pb;          /* 0 <= pb <= 4, default = 2 */
 
24
  int algo;        /* 0 - fast, 1 - normal, default = 1 */
 
25
  int fb;          /* 5 <= fb <= 273, default = 32 */
 
26
  int btMode;      /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
 
27
  int numHashBytes; /* 2, 3 or 4, default = 4 */
 
28
  UInt32 mc;        /* 1 <= mc <= (1 << 30), default = 32 */
 
29
  unsigned writeEndMark;  /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
 
30
  int numThreads;  /* 1 or 2, default = 2 */
 
31
} CLzmaEncProps;
 
32
 
 
33
void LzmaEncProps_Init(CLzmaEncProps *p);
 
34
void LzmaEncProps_Normalize(CLzmaEncProps *p);
 
35
UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
 
36
 
 
37
 
 
38
/* ---------- CLzmaEncHandle Interface ---------- */
 
39
 
 
40
/* LzmaEnc_* functions can return the following exit codes:
 
41
Returns:
 
42
  SZ_OK           - OK
 
43
  SZ_ERROR_MEM    - Memory allocation error
 
44
  SZ_ERROR_PARAM  - Incorrect paramater in props
 
45
  SZ_ERROR_WRITE  - Write callback error.
 
46
  SZ_ERROR_PROGRESS - some break from progress callback
 
47
  SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
 
48
*/
 
49
 
 
50
typedef void * CLzmaEncHandle;
 
51
 
 
52
CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc);
 
53
void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig);
 
54
SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
 
55
SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
 
56
SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream,
 
57
    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
 
58
SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
 
59
    int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
 
60
 
 
61
/* ---------- One Call Interface ---------- */
 
62
 
 
63
/* LzmaEncode
 
64
Return code:
 
65
  SZ_OK               - OK
 
66
  SZ_ERROR_MEM        - Memory allocation error
 
67
  SZ_ERROR_PARAM      - Incorrect paramater
 
68
  SZ_ERROR_OUTPUT_EOF - output buffer overflow
 
69
  SZ_ERROR_THREAD     - errors in multithreading functions (only for Mt version)
 
70
*/
 
71
 
 
72
SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
 
73
    const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
 
74
    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
 
75
 
 
76
EXTERN_C_END
 
77
 
 
78
#endif