50 #define BITSTREAM_WRITER_LE
62 uint8_t **bytestream, uint32_t *
palette)
69 bytestream_put_le16(bytestream, avctx->
width);
70 bytestream_put_le16(bytestream, avctx->
height);
72 bytestream_put_byte(bytestream, 0xf7);
73 bytestream_put_byte(bytestream, 0x1f);
74 bytestream_put_byte(bytestream, 0);
79 bytestream_put_be24(bytestream, v);
86 uint8_t **bytestream, uint8_t *end,
87 const uint8_t *buf,
int linesize)
94 bytestream_put_byte(bytestream, 0x2c);
95 bytestream_put_le16(bytestream, 0);
96 bytestream_put_le16(bytestream, 0);
97 bytestream_put_le16(bytestream, avctx->
width);
98 bytestream_put_le16(bytestream, avctx->
height);
99 bytestream_put_byte(bytestream, 0x00);
102 bytestream_put_byte(bytestream, 0x08);
117 bytestream_put_byte(bytestream, size);
118 if (end - *bytestream < size)
124 bytestream_put_byte(bytestream, 0x00);
125 bytestream_put_byte(bytestream, 0x3b);
149 uint8_t *outbuf_ptr = outbuf;
150 uint8_t *end = outbuf + buf_size;
157 return outbuf_ptr - outbuf;
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static int gif_image_write_image(AVCodecContext *avctx, uint8_t **bytestream, uint8_t *end, const uint8_t *buf, int linesize)
AVFrame * coded_frame
the picture in the bitstream
static int gif_encode_close(AVCodecContext *avctx)
int ff_lzw_encode(struct LZWEncodeState *s, const uint8_t *inbuf, int insize)
LZW main compress function.
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
static int init(AVCodecParserContext *s)
int ff_lzw_encode_flush(struct LZWEncodeState *s, void(*lzw_flush_put_bits)(struct PutBitContext *))
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const char * name
Name of the codec implementation.
static void put_bits(PutBitContext *s, int n, unsigned int value)
Write up to 31 bits into a bitstream.
static int gif_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int buf_size, void *data)
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
int width
picture width / height.
static int gif_image_write_header(AVCodecContext *avctx, uint8_t **bytestream, uint32_t *palette)
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
static void close(AVCodecParserContext *s)
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
void ff_lzw_encode_init(struct LZWEncodeState *s, uint8_t *outbuf, int outsize, int maxbits, enum FF_LZW_MODES mode, void(*lzw_put_bits)(struct PutBitContext *, int, unsigned int))
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
8 bit with PIX_FMT_RGB32 palette
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
static av_cold int gif_encode_init(AVCodecContext *avctx)
int key_frame
1 -> keyframe, 0-> not
const int ff_lzw_encode_state_size