libavcodec/gifdec.c File Reference
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#include "lzw.h"
#include "gif.h"
Include dependency graph for libavcodec/gifdec.c:

Go to the source code of this file.

Data Structures

struct  GifState
 

Macros

#define GIF_TRANSPARENT_COLOR   0x00ffffff
 

Typedefs

typedef struct GifState GifState
 

Functions

static void gif_read_palette (GifState *s, uint32_t *pal, int nb)
 
static void gif_fill (AVFrame *picture, uint32_t color)
 
static void gif_fill_rect (AVFrame *picture, uint32_t color, int l, int t, int w, int h)
 
static void gif_copy_img_rect (const uint32_t *src, uint32_t *dst, int linesize, int l, int t, int w, int h)
 
static int gif_read_image (GifState *s, AVFrame *frame)
 
static int gif_read_extension (GifState *s)
 
static int gif_read_header1 (GifState *s)
 
static int gif_parse_next_image (GifState *s, AVFrame *frame)
 
static av_cold int gif_decode_init (AVCodecContext *avctx)
 
static int gif_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int gif_decode_close (AVCodecContext *avctx)
 

Variables

static const AVOption options []
 
static const AVClass decoder_class
 
AVCodec ff_gif_decoder
 

Macro Definition Documentation

#define GIF_TRANSPARENT_COLOR   0x00ffffff

Definition at line 38 of file libavcodec/gifdec.c.

Typedef Documentation

typedef struct GifState GifState

Function Documentation

static void gif_copy_img_rect ( const uint32_t *  src,
uint32_t *  dst,
int  linesize,
int  l,
int  t,
int  w,
int  h 
)
static

Definition at line 115 of file libavcodec/gifdec.c.

Referenced by gif_read_image().

static av_cold int gif_decode_close ( AVCodecContext avctx)
static

Definition at line 506 of file libavcodec/gifdec.c.

static int gif_decode_frame ( AVCodecContext avctx,
void data,
int *  got_frame,
AVPacket avpkt 
)
static

Definition at line 443 of file libavcodec/gifdec.c.

static av_cold int gif_decode_init ( AVCodecContext avctx)
static

Definition at line 429 of file libavcodec/gifdec.c.

static void gif_fill ( AVFrame picture,
uint32_t  color 
)
static

Definition at line 90 of file libavcodec/gifdec.c.

Referenced by gif_read_image().

static void gif_fill_rect ( AVFrame picture,
uint32_t  color,
int  l,
int  t,
int  w,
int  h 
)
static

Definition at line 99 of file libavcodec/gifdec.c.

Referenced by gif_read_image().

static int gif_parse_next_image ( GifState s,
AVFrame frame 
)
static

Definition at line 403 of file libavcodec/gifdec.c.

Referenced by gif_decode_frame().

static int gif_read_extension ( GifState s)
static

Definition at line 293 of file libavcodec/gifdec.c.

Referenced by gif_parse_next_image().

static int gif_read_header1 ( GifState s)
static

Definition at line 354 of file libavcodec/gifdec.c.

Referenced by gif_decode_frame().

static int gif_read_image ( GifState s,
AVFrame frame 
)
static

Definition at line 133 of file libavcodec/gifdec.c.

Referenced by gif_parse_next_image().

static void gif_read_palette ( GifState s,
uint32_t *  pal,
int  nb 
)
static

Definition at line 82 of file libavcodec/gifdec.c.

Referenced by gif_read_header1(), and gif_read_image().

Variable Documentation

const AVClass decoder_class
static
Initial value:
= {
.class_name = "gif decoder",
.item_name = av_default_item_name,
.option = options,
}
av_default_item_name
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
static const AVOption options[]

Definition at line 526 of file libavcodec/gifdec.c.

AVCodec ff_gif_decoder
Initial value:
= {
.name = "gif",
.priv_data_size = sizeof(GifState),
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
.priv_class = &decoder_class,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static av_cold int gif_decode_close(AVCodecContext *avctx)
struct GifState GifState
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:375
static av_cold int gif_decode_init(AVCodecContext *avctx)
static const AVClass decoder_class
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: crystalhd.c:868

Definition at line 534 of file libavcodec/gifdec.c.

const AVOption options[]
static
Initial value:
= {
{ "trans_color", "color value (ARGB) that is used instead of transparent color",
offsetof(GifState, trans_color), AV_OPT_TYPE_INT,
{.i64 = GIF_TRANSPARENT_COLOR}, 0, 0xffffffff,
{ NULL },
}
#define GIF_TRANSPARENT_COLOR
NULL
Definition: eval.c:55
#define AV_OPT_FLAG_VIDEO_PARAM
Definition: opt.h:285
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
Definition: opt.h:282

Definition at line 518 of file libavcodec/gifdec.c.