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)
 
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...
 

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().

int 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 110 of file lzw.c.

Referenced by gif_decode_init(), and tiff_init().

av_cold void ff_lzw_decode_close ( LZWState **  p)

Definition at line 115 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 128 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 166 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(), avc_chroma_hv_2x2_msa(), avc_chroma_hv_2x4_msa(), avc_chroma_hv_2x8_msa(), avc_chroma_hv_4x2_msa(), avc_chroma_hv_4x4multiple_msa(), avc_chroma_hv_8w_msa(), avc_chroma_hv_and_aver_dst_2x2_msa(), avc_chroma_hv_and_aver_dst_2x4_msa(), avc_chroma_hv_and_aver_dst_2x8_msa(), avc_chroma_hv_and_aver_dst_4x2_msa(), avc_chroma_hv_and_aver_dst_4x4mul_msa(), avc_chroma_hv_and_aver_dst_8w_msa(), avc_chroma_hz_2x2_msa(), avc_chroma_hz_2x4_msa(), avc_chroma_hz_2x8_msa(), avc_chroma_hz_4x2_msa(), avc_chroma_hz_4x4multiple_msa(), avc_chroma_hz_8w_msa(), avc_chroma_hz_and_aver_dst_2x2_msa(), avc_chroma_hz_and_aver_dst_2x4_msa(), avc_chroma_hz_and_aver_dst_2x8_msa(), avc_chroma_hz_and_aver_dst_4x2_msa(), avc_chroma_hz_and_aver_dst_4x4multiple_msa(), avc_chroma_hz_and_aver_dst_8w_msa(), binkb_read_bundle(), build_xlaw_table(), cinepak_decode_codebook(), cinepak_decode_vectors(), cmp_direct_inline(), common_hv_2ht_2vt_4x4_msa(), common_hv_2ht_2vt_4x8_msa(), common_hv_2ht_2vt_8x4_msa(), common_hv_2ht_2vt_8x8mult_msa(), common_hv_2ht_2vt_and_aver_dst_4x4_msa(), common_hv_2ht_2vt_and_aver_dst_4x8_msa(), common_hv_2ht_2vt_and_aver_dst_8x4_msa(), common_hv_2ht_2vt_and_aver_dst_8x8mult_msa(), common_hz_2t_4x4_msa(), common_hz_2t_4x8_msa(), common_hz_2t_8x4_msa(), common_hz_2t_8x8mult_msa(), common_hz_2t_and_aver_dst_4x4_msa(), common_hz_2t_and_aver_dst_4x8_msa(), common_hz_2t_and_aver_dst_8x4_msa(), common_hz_2t_and_aver_dst_8x8mult_msa(), common_vt_4t_12w_msa(), common_vt_8t_12w_msa(), compress_alpha(), compress_color(), compute_network0new(), config_output(), data_queue_dequeue(), data_queue_enqueue(), decode_0(), decode_13(), decode_bmv_frame(), decode_channel_code_tab(), decode_clnpass(), decode_dds1(), decode_dsw1(), decode_init(), decode_mvc1(), decode_mvc2(), 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_plane_bitstream(), encode_refpass(), encode_sigpass(), epic_jb_decode_tile(), escape124_decode_frame(), estimate_alpha_plane(), ff_acelp_fc_pulse_per_track(), ff_avg_bilin_16h_msa(), ff_avg_bilin_16hv_msa(), ff_avg_bilin_32h_msa(), ff_avg_bilin_64h_msa(), ff_blend_mask(), ff_decode_10_pulses_35bits(), ff_draw_pc_font(), ff_er_add_slice(), ff_h264_check_intra4x4_pred_mode(), ff_loop_filter_h_44_16_msa(), ff_loop_filter_h_48_16_msa(), ff_loop_filter_h_4_8_msa(), ff_loop_filter_h_84_16_msa(), ff_loop_filter_h_88_16_msa(), ff_loop_filter_h_8_8_msa(), ff_loop_filter_v_16_8_msa(), ff_loop_filter_v_44_16_msa(), ff_loop_filter_v_48_16_msa(), ff_loop_filter_v_4_8_msa(), ff_loop_filter_v_84_16_msa(), ff_loop_filter_v_88_16_msa(), ff_loop_filter_v_8_8_msa(), ff_lsb2full(), ff_lzw_decode(), ff_lzw_decode_init(), ff_put_bilin_16h_msa(), ff_put_bilin_16hv_msa(), ff_put_bilin_32h_msa(), ff_put_bilin_64h_msa(), ff_put_vp8_bilinear16_h_msa(), ff_put_vp8_bilinear16_hv_msa(), ff_vp8_h_loop_filter16_inner_msa(), ff_vp8_h_loop_filter16_msa(), ff_vp8_h_loop_filter8uv_inner_msa(), ff_vp8_h_loop_filter8uv_msa(), ff_vp8_h_loop_filter_simple_msa(), ff_vp8_idct_add_msa(), ff_vp8_idct_dc_add_msa(), ff_vp8_v_loop_filter16_inner_msa(), ff_vp8_v_loop_filter16_msa(), ff_vp8_v_loop_filter8uv_inner_msa(), ff_vp8_v_loop_filter8uv_msa(), ff_vp8_v_loop_filter_simple_msa(), filter_channel(), filter_plane_cols(), filter_plane_rows(), flac_read_header(), get_cabac_bypass_sign(), get_len(), get_mb_score(), get_speaker_pos(), h263_dct_unquantize_msa(), hevc_sao_band_filter_4width_msa(), horiz_mc_qpel_16width_msa(), horiz_mc_qpel_aver_src0_16width_msa(), horiz_mc_qpel_aver_src1_16width_msa(), horiz_mc_qpel_avg_dst_16width_msa(), horiz_mc_qpel_avg_dst_aver_src0_16width_msa(), horiz_mc_qpel_avg_dst_aver_src1_16width_msa(), horiz_mc_qpel_no_rnd_16width_msa(), horiz_mc_qpel_no_rnd_aver_src0_16width_msa(), horiz_mc_qpel_no_rnd_aver_src1_16width_msa(), hv_mc_qpel_aver_horiz_16x16_msa(), hv_mc_qpel_aver_horiz_src0_16x16_msa(), hv_mc_qpel_aver_horiz_src1_16x16_msa(), hv_mc_qpel_no_rnd_horiz_16x16_msa(), hv_mc_qpel_no_rnd_horiz_src0_16x16_msa(), hv_mc_qpel_no_rnd_horiz_src1_16x16_msa(), init(), init_cavlc_level_tab(), init_luts(), ljpeg_decode_rgb_scan(), ljpeg_decode_yuv_scan(), mask_edges(), match_colors(), matroska_parse_flac(), mp3_write_xing(), mpc8_decode_frame(), mpc8_get_mask(), mpeg2_dct_unquantize_inter_msa(), mszh_decomp(), parse_coding_header(), parse_xxch_frame(), picmemset(), png_get_interlaced_row(), png_put_interlaced_row(), pp_get_mode_by_name_and_quality(), pred_mv(), pred_spatial_direct_motion(), print_stats(), process_float(), process_frame(), put_swf_line_edge(), put_swf_rect(), randomize_loopfilter_buffers(), read_residue(), refine_colors(), render_default_font(), run_opencl_bench(), rv34_decode_cbp(), rv34_pred_mv_b(), sad_hv_bilinear_filter_8width_msa(), set_metadata(), setup_window(), store_slice16_c(), subsampling_bounds(), twiddle(), ulti_pattern(), unpack_alpha(), vertClassify_altivec(), vp56_mc(), vp6_filter(), vp9_hz_lpf_t4_and_t8_16w(), vp9_vt_lpf_t4_and_t8_16w(), vp9_vt_lpf_t4_and_t8_8w(), write_element(), x8_get_ac_rlf(), and xan_unpack_luma().