29 const AVFrame *pict,
int *got_packet)
31 uint8_t *bytestream_start, *bytestream, *bytestream_end;
33 int i, h, w, n, linesize, depth, maxval, ret;
34 const char *tuple_type;
45 bytestream = pkt->
data;
46 bytestream_end = pkt->
data + pkt->
size;
55 tuple_type =
"BLACKANDWHITE";
61 tuple_type =
"GRAYSCALE";
73 tuple_type =
"RGB_ALPHA";
78 snprintf(bytestream, bytestream_end - bytestream,
79 "P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\nMAXVAL %d\nTUPLTYPE %s\nENDHDR\n",
80 w, h, depth, maxval, tuple_type);
81 bytestream += strlen(bytestream);
90 for (i = 0; i < h; i++) {
91 for (j = 0; j < w; j++) {
92 v = ((uint32_t *)ptr)[j];
93 bytestream_put_be24(&bytestream, v);
94 *bytestream++ = v >> 24;
99 for (i = 0; i < h; i++) {
100 memcpy(bytestream, ptr, n);
106 pkt->
size = bytestream - bytestream_start;
114 #if FF_API_CODED_FRAME
This structure describes decoded (raw) audio or video data.
packed RGB 8:8:8, 24bpp, RGBRGB...
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_cold int pam_encode_init(AVCodecContext *avctx)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align)
Return the size in bytes of the amount of data required to store an image with the given parameters...
#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. ...
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.
int width
picture width / height.
int ff_alloc_packet(AVPacket *avpkt, int size)
Check AVPacket size and/or allocate data.
static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
#define FF_DISABLE_DEPRECATION_WARNINGS
common internal api header.
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
attribute_deprecated AVFrame * coded_frame
the picture in the bitstream
#define FF_ENABLE_DEPRECATION_WARNINGS
int key_frame
1 -> keyframe, 0-> not
AVPixelFormat
Pixel format.
This structure stores compressed data.