FFmpeg
Classes | Macros | Functions
lzw.c File Reference

LZW decoding routines. More...

#include "avcodec.h"
#include "bytestream.h"
#include "lzw.h"
#include "libavutil/mem.h"

Classes

struct  LZWState
 

Macros

#define LZW_MAXBITS   12
 
#define LZW_SIZTABLE   (1<<LZW_MAXBITS)
 

Functions

int ff_lzw_decode_tail (LZWState *p)
 
av_cold void ff_lzw_decode_open (LZWState **p)
 
av_cold void ff_lzw_decode_close (LZWState **p)
 
int ff_lzw_decode_init (LZWState *p, int csize, const uint8_t *buf, int buf_size, int mode)
 Initialize LZW decoder. More...
 
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. More...
 

Detailed Description

LZW decoding routines.

Author
Fabrice Bellard
modified for use in TIFF by Konstantin Shishkov

Function Documentation

§ 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
pLZW context
bufoutput buffer
lennumber 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
pLZW context
csizeinitial code size in bits
bufinput data
buf_sizeinput data size
modedecoder working mode - either GIF or TIFF