22 #include "libavutil/pixdesc.h"
29 const AVFrame *p,
int *got_packet)
32 int i, h, h1,
c,
n, linesize,
ret;
37 avctx->
height) + 200)) < 0)
49 n = (avctx->
width + 7) >> 3;
85 "P%c\n%d %d\n", c, avctx->
width, h1);
96 for (i = 0; i < h; i++) {
107 for (i = 0; i < h; i++) {
124 #if CONFIG_PGM_ENCODER
138 #if CONFIG_PGMYUV_ENCODER
152 #if CONFIG_PPM_ENCODER
166 #if CONFIG_PBM_ENCODER
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
Check AVPacket size and/or allocate data.
This structure describes decoded (raw) audio or video data.
packed RGB 8:8:8, 24bpp, RGBRGB...
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
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.
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
const char * name
Name of the codec implementation.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
uint16_t depth_minus1
number of bits in the component minus 1
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#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.
int width
picture width / height.
static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
main external API structure.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
common internal api header.
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
uint8_t * bytestream_start
int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
Calculate the size in bytes that a picture of the given width and height would occupy if stored in th...
This structure stores compressed data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.