FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
lzw.c File Reference

LZW decoding routines. More...

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

Go to the source code of this file.

Data Structures

struct  LZWState
 

Macros

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

Functions

static int lzw_get_code (struct LZWState *s)
 
void 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.
 
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.
 

Variables

static const uint16_t mask [17]
 

Detailed Description

LZW decoding routines.

Author
Fabrice Bellard
modified for use in TIFF by Konstantin Shishkov

Definition in file lzw.c.

Macro Definition Documentation

#define LZW_MAXBITS   12

Definition at line 35 of file lzw.c.

Referenced by ff_lzw_decode(), and ff_lzw_decode_init().

#define LZW_SIZTABLE   (1<<LZW_MAXBITS)

Definition at line 36 of file lzw.c.

Function Documentation

static int lzw_get_code ( struct LZWState s)
static

Definition at line 70 of file lzw.c.

Referenced by ff_lzw_decode().

void ff_lzw_decode_tail ( LZWState p)

Definition at line 96 of file lzw.c.

Referenced by gif_read_image().

av_cold void ff_lzw_decode_open ( LZWState **  p)

Definition at line 109 of file lzw.c.

Referenced by gif_decode_init(), and tiff_init().

av_cold void ff_lzw_decode_close ( LZWState **  p)

Definition at line 114 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
pLZW context
csizeinitial code size in bits
bufinput data
buf_sizeinput data size
modedecoder working mode - either GIF or TIFF

Definition at line 127 of file lzw.c.

Referenced by gif_read_image(), and tiff_unpack_strip().

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

Definition at line 165 of file lzw.c.

Referenced by gif_read_image(), and tiff_unpack_strip().

Variable Documentation

const uint16_t mask[17]
static
Initial value:
=
{
0x0000, 0x0001, 0x0003, 0x0007,
0x000F, 0x001F, 0x003F, 0x007F,
0x00FF, 0x01FF, 0x03FF, 0x07FF,
0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF
}

Definition at line 38 of file lzw.c.

Referenced by ac3_lshift_int16_c(), add_hfyu_left_pred_int16_c(), add_int16_c(), av_read_image_line(), av_set_cpu_flags_mask(), binkb_read_bundle(), build_xlaw_table(), cinepak_decode_codebook(), cinepak_decode_vectors(), cmp_direct_inline(), data_queue_dequeue(), data_queue_enqueue(), dca_decode_frame(), dca_parse_audio_coding_header(), dca_xxch2index(), decode_0(), decode_13(), decode_bmv_frame(), decode_channel_code_tab(), decode_clnpass(), decode_dds1(), decode_dsw1(), decode_init(), decode_mvc1(), decode_mvc2(), decode_qu_spectra(), decode_residual(), decode_residual_block(), decode_sigpass(), decode_tsw1(), decodeplane32(), diff_int16_c(), diff_pixels_mvi(), draw_rectangle(), drawtext(), encode_alpha_plane(), encode_clnpass(), encode_codeword(), encode_plane_bitstream(), encode_refpass(), encode_sigpass(), escape124_decode_frame(), est_alpha_diff(), estimate_alpha_plane(), ff_acelp_fc_pulse_per_track(), ff_blend_mask(), ff_decode_10_pulses_35bits(), ff_draw_pc_font(), ff_er_add_slice(), ff_h264_check_intra4x4_pred_mode(), ff_lsb2full(), ff_lzw_decode(), ff_lzw_decode_init(), filter_channel(), flac_read_header(), get_cabac_bypass_sign(), get_len(), get_mb_score(), init(), init_cavlc_level_tab(), init_luts(), ljpeg_decode_rgb_scan(), ljpeg_decode_yuv_scan(), matroska_parse_flac(), mp3_write_xing(), mpc8_decode_frame(), mpc8_get_mask(), mszh_decomp(), pack_int32(), picmemset(), plot_cqt(), png_get_interlaced_row(), png_put_interlaced_row(), pp_get_mode_by_name_and_quality(), pred_mv(), pred_spatial_direct_motion(), process_float(), put_alpha_diff(), put_subframe_samples(), put_swf_line_edge(), put_swf_rect(), read_residue(), run_opencl_bench(), rv34_decode_cbp(), rv34_pred_mv_b(), setup_window(), subsampling_bounds(), twiddle(), ulti_pattern(), unpack_alpha(), vertClassify_altivec(), vp56_mc(), vp6_filter(), write_element(), x8_get_ac_rlf(), and xan_unpack_luma().