#include "libavutil/opt.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "encode.h"
#include "lzw.h"
#include "gif.h"
Go to the source code of this file.
|
static void | shrink_palette (const uint32_t *src, uint8_t *map, uint32_t *dst, size_t *palette_count) |
|
static void | remap_frame_to_palette (const uint8_t *src, int src_linesize, uint8_t *dst, int dst_linesize, int w, int h, uint8_t *map) |
|
static int | is_image_translucent (AVCodecContext *avctx, const uint8_t *buf, const int linesize) |
|
static int | get_palette_transparency_index (const uint32_t *palette) |
|
static int | pick_palette_entry (const uint8_t *buf, int linesize, int w, int h) |
|
static void | gif_crop_translucent (AVCodecContext *avctx, const uint8_t *buf, const int linesize, int *width, int *height, int *x_start, int *y_start) |
|
static void | gif_crop_opaque (AVCodecContext *avctx, const uint32_t *palette, const uint8_t *buf, const int linesize, int *width, int *height, int *x_start, int *y_start) |
|
static int | gif_image_write_image (AVCodecContext *avctx, uint8_t **bytestream, uint8_t *end, const uint32_t *palette, const uint8_t *buf, const int linesize, AVPacket *pkt) |
|
static av_cold int | gif_encode_init (AVCodecContext *avctx) |
|
static int | gif_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet) |
|
static int | gif_encode_close (AVCodecContext *avctx) |
|
◆ DEFAULT_TRANSPARENCY_INDEX
#define DEFAULT_TRANSPARENCY_INDEX 0x1f |
Definition at line 41 of file gif.c.
◆ OFFSET
◆ FLAGS
◆ anonymous enum
Enumerator |
---|
GF_OFFSETTING | |
GF_TRANSDIFF | |
Definition at line 59 of file gif.c.
◆ shrink_palette()
static void shrink_palette |
( |
const uint32_t * |
src, |
|
|
uint8_t * |
map, |
|
|
uint32_t * |
dst, |
|
|
size_t * |
palette_count |
|
) |
| |
|
static |
Definition at line 64 of file gif.c.
◆ remap_frame_to_palette()
static void remap_frame_to_palette |
( |
const uint8_t * |
src, |
|
|
int |
src_linesize, |
|
|
uint8_t * |
dst, |
|
|
int |
dst_linesize, |
|
|
int |
w, |
|
|
int |
h, |
|
|
uint8_t * |
map |
|
) |
| |
|
static |
Definition at line 87 of file gif.c.
◆ is_image_translucent()
Definition at line 96 of file gif.c.
◆ get_palette_transparency_index()
static int get_palette_transparency_index |
( |
const uint32_t * |
palette | ) |
|
|
static |
◆ pick_palette_entry()
static int pick_palette_entry |
( |
const uint8_t * |
buf, |
|
|
int |
linesize, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
|
static |
◆ gif_crop_translucent()
static void gif_crop_translucent |
( |
AVCodecContext * |
avctx, |
|
|
const uint8_t * |
buf, |
|
|
const int |
linesize, |
|
|
int * |
width, |
|
|
int * |
height, |
|
|
int * |
x_start, |
|
|
int * |
y_start |
|
) |
| |
|
static |
◆ gif_crop_opaque()
static void gif_crop_opaque |
( |
AVCodecContext * |
avctx, |
|
|
const uint32_t * |
palette, |
|
|
const uint8_t * |
buf, |
|
|
const int |
linesize, |
|
|
int * |
width, |
|
|
int * |
height, |
|
|
int * |
x_start, |
|
|
int * |
y_start |
|
) |
| |
|
static |
◆ gif_image_write_image()
static int gif_image_write_image |
( |
AVCodecContext * |
avctx, |
|
|
uint8_t ** |
bytestream, |
|
|
uint8_t * |
end, |
|
|
const uint32_t * |
palette, |
|
|
const uint8_t * |
buf, |
|
|
const int |
linesize, |
|
|
AVPacket * |
pkt |
|
) |
| |
|
static |
◆ gif_encode_init()
◆ gif_encode_frame()
◆ gif_encode_close()
◆ gif_options
Initial value:= {
{
"global_palette",
"write a palette to the global gif header where feasible",
OFFSET(use_global_palette),
AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1,
FLAGS },
}
Definition at line 534 of file gif.c.
◆ gif_class
Initial value:= {
.class_name = "GIF encoder",
}
Definition at line 543 of file gif.c.
◆ ff_gif_encoder
Initial value:= {
.p.name = "gif",
},
}
Definition at line 550 of file gif.c.
AVPixelFormat
Pixel format.
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
static int gif_encode_close(AVCodecContext *avctx)
#define FF_CODEC_ENCODE_CB(func)
@ AV_PIX_FMT_BGR8
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
#define CODEC_LONG_NAME(str)
#define LIBAVUTIL_VERSION_INT
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_PIX_FMT_RGB8
packed RGB 3:3:2, 8bpp, (msb)3R 3G 2B(lsb)
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_BGR4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
static av_cold int gif_encode_init(AVCodecContext *avctx)
static const AVClass gif_class
@ AV_PIX_FMT_RGB4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
static const AVOption gif_options[]
#define flags(name, subs,...)
static int gif_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)