29 const AVFrame *pict,
int *got_packet)
33 int i, h, h1, c, n, linesize, ret;
38 avctx->
height) + 200)) < 0) {
56 n = (avctx->
width + 7) >> 3;
83 "P%c\n%d %d\n", c, avctx->
width, h1);
93 for (i = 0; i < h; i++) {
104 for (i = 0; i < h; i++) {
121 #if CONFIG_PGM_ENCODER
136 #if CONFIG_PGMYUV_ENCODER
149 #if CONFIG_PPM_ENCODER
164 #if CONFIG_PBM_ENCODER
struct PNMContext PNMContext
This structure describes decoded (raw) audio or video data.
packed RGB 8:8:8, 24bpp, RGBRGB...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static int init(AVCodecParserContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
int flags
A combination of AV_PKT_FLAG values.
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
int width
picture width / height.
int ff_alloc_packet(AVPacket *avpkt, int size)
Check AVPacket size and/or allocate data.
static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
common internal api header.
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
uint8_t * bytestream_start
av_cold int ff_pnm_init(AVCodecContext *avctx)
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...
int key_frame
1 -> keyframe, 0-> not
AVPixelFormat
Pixel format.
This structure stores compressed data.