LZW decoding routines.
More...
#include <stdint.h>
Go to the source code of this file.
|
| enum | FF_LZW_MODES { FF_LZW_GIF,
FF_LZW_TIFF
} |
| |
|
|
void | ff_lzw_decode_open (LZWState **p) |
| |
|
void | ff_lzw_decode_close (LZWState **p) |
| |
| int | ff_lzw_decode_init (LZWState *s, int csize, const uint8_t *buf, int buf_size, int mode) |
| | Initialize LZW decoder. More...
|
| |
| int | ff_lzw_decode (LZWState *s, uint8_t *buf, int len) |
| | Decode given number of bytes NOTE: the algorithm here is inspired from the LZW GIF decoder written by Steven A. More...
|
| |
|
int | ff_lzw_decode_tail (LZWState *lzw) |
| |
|
void | ff_lzw_encode_init (struct LZWEncodeState *s, uint8_t *outbuf, int outsize, int maxbits, enum FF_LZW_MODES mode, void(*lzw_put_bits)(struct PutBitContext *, int, unsigned int)) |
| |
| int | ff_lzw_encode (struct LZWEncodeState *s, const uint8_t *inbuf, int insize) |
| | LZW main compress function. More...
|
| |
|
int | ff_lzw_encode_flush (struct LZWEncodeState *s, void(*lzw_flush_put_bits)(struct PutBitContext *)) |
| |
|
|
const int | ff_lzw_encode_state_size |
| |
LZW decoding routines.
- Author
- Fabrice Bellard
-
modified for use in TIFF by Konstantin Shishkov
§ ff_lzw_decode()
| int ff_lzw_decode |
( |
LZWState * |
p, |
|
|
uint8_t * |
buf, |
|
|
int |
len |
|
) |
| |
Decode given number of bytes NOTE: the algorithm here is inspired from the LZW GIF decoder written by Steven A.
Bennett in 1987.
- Parameters
-
| p | LZW context |
| buf | output buffer |
| len | number of bytes to decode |
- Returns
- number of bytes decoded
§ ff_lzw_decode_init()
| int ff_lzw_decode_init |
( |
LZWState * |
p, |
|
|
int |
csize, |
|
|
const uint8_t * |
buf, |
|
|
int |
buf_size, |
|
|
int |
mode |
|
) |
| |
Initialize LZW decoder.
- Parameters
-
| p | LZW context |
| csize | initial code size in bits |
| buf | input data |
| buf_size | input data size |
| mode | decoder working mode - either GIF or TIFF |
§ ff_lzw_encode()
| int ff_lzw_encode |
( |
LZWEncodeState * |
s, |
|
|
const uint8_t * |
inbuf, |
|
|
int |
insize |
|
) |
| |
LZW main compress function.
- Parameters
-
| s | LZW state |
| inbuf | Input buffer |
| insize | Size of input buffer |
- Returns
- Number of bytes written or -1 on error