libavcodec/lzw.h File Reference

LZW decoding routines. More...

#include "bitstream.h"

Go to the source code of this file.

Typedefs

typedef void LZWState

Enumerations

enum  FF_LZW_MODES { FF_LZW_GIF, FF_LZW_TIFF }

Functions

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.
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.
const uint8_t * ff_lzw_cur_ptr (LZWState *lzw)
void ff_lzw_decode_tail (LZWState *lzw)
void ff_lzw_encode_init (struct LZWEncodeState *s, uint8_t *outbuf, int outsize, int maxbits)
 Initialize LZW encoder.
int ff_lzw_encode (struct LZWEncodeState *s, const uint8_t *inbuf, int insize)
 LZW main compress function.
int ff_lzw_encode_flush (struct LZWEncodeState *s)
 Write end code and flush bitstream.

Variables

const int ff_lzw_encode_state_size


Detailed Description

LZW decoding routines.

Author:
Fabrice Bellard Modified for use in TIFF by Konstantin Shishkov

Definition in file lzw.h.


Typedef Documentation

typedef void LZWState

Definition at line 41 of file lzw.h.


Enumeration Type Documentation

Enumerator:
FF_LZW_GIF 
FF_LZW_TIFF 

Definition at line 35 of file lzw.h.


Function Documentation

const uint8_t* ff_lzw_cur_ptr ( LZWState lzw  ) 

Definition at line 94 of file lzw.c.

Referenced by gif_read_image().

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:
s LZW context
buf output buffer
len number of bytes to decode
Returns:
number of bytes decoded

Definition at line 169 of file lzw.c.

Referenced by gif_read_image(), and tiff_unpack_strip().

void ff_lzw_decode_close ( LZWState **  p  ) 

Definition at line 117 of file lzw.c.

Referenced by gif_decode_close(), and tiff_end().

int ff_lzw_decode_init ( LZWState p,
int  csize,
const uint8_t *  buf,
int  buf_size,
int  mode 
)

Initialize LZW decoder.

Parameters:
s LZW context
csize initial code size in bits
buf input data
buf_size input data size
mode decoder working mode - either GIF or TIFF

Definition at line 130 of file lzw.c.

Referenced by gif_read_image(), and tiff_unpack_strip().

void ff_lzw_decode_open ( LZWState **  p  ) 

Definition at line 112 of file lzw.c.

Referenced by gif_decode_init(), and tiff_init().

void ff_lzw_decode_tail ( LZWState lzw  ) 

Definition at line 99 of file lzw.c.

Referenced by gif_read_image().

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

Definition at line 220 of file lzwenc.c.

Referenced by encode_strip().

int ff_lzw_encode_flush ( LZWEncodeState s  ) 

Write end code and flush bitstream.

Parameters:
s LZW state
Returns:
Number of bytes written or -1 on error

Definition at line 253 of file lzwenc.c.

void ff_lzw_encode_init ( LZWEncodeState s,
uint8_t *  outbuf,
int  outsize,
int  maxbits 
)

Initialize LZW encoder.

Please set s->clear_code, s->end_code and s->maxbits before run.

Parameters:
s LZW state
outbuf Output buffer
outsize Size of output buffer
maxbits Maximum length of code

Definition at line 199 of file lzwenc.c.


Variable Documentation

Definition at line 64 of file lzwenc.c.


Generated on Fri Oct 26 02:35:43 2012 for FFmpeg by  doxygen 1.5.8