47 #include "libavutil/mem.h"
73 const AVFrame *pict,
int *got_packet)
92 zret = deflateReset(&c->
zstream);
100 for(i = avctx->
height - 1; i >= 0; i--) {
103 zret = deflate(&c->
zstream, Z_NO_FLUSH);
109 zret = deflate(&c->
zstream, Z_FINISH);
110 if (zret != Z_STREAM_END) {
This structure describes decoded (raw) audio or video data.
static av_cold int encode_end(AVCodecContext *avctx)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_cold int encode_init(AVCodecContext *avctx)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
const char * name
Name of the codec implementation.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Libavcodec external API header.
AVPixelFormat
Pixel format.
int flags
A combination of AV_PKT_FLAG values.
common internal API header
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
main external API structure.
static void close(AVCodecParserContext *s)
packed RGB 8:8:8, 24bpp, BGRBGR...
AVFrame * coded_frame
the picture in the bitstream
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
static av_cold int init(AVCodecParserContext *s)
int key_frame
1 -> keyframe, 0-> not
This structure stores compressed data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...