Go to the documentation of this file.
27 #define ANSI_MIN_READLINE 509
30 const AVFrame *p,
int *got_packet)
32 int i, j, l, commas,
ret,
size, linesize, lineout, rowsout;
36 linesize = lineout = (avctx->
width + 7) / 8;
37 commas = avctx->
height * linesize;
43 rowsout = (commas + lineout - 1) / lineout;
46 size = rowsout * (lineout * 6 + 1) + 106;
53 buf +=
snprintf(buf, 32,
"#define image_width %u\n", avctx->
width);
54 buf +=
snprintf(buf, 33,
"#define image_height %u\n", avctx->
height);
55 buf +=
snprintf(buf, 39,
"static unsigned char image_bits[] = {\n");
56 for (
i = 0, l = lineout;
i < avctx->
height;
i++) {
57 for (j = 0; j < linesize; j++) {
59 static const char lut[] = {
60 '0',
'8',
'4',
'C',
'2',
'A',
'6',
'E',
61 '1',
'9',
'5',
'D',
'3',
'B',
'7',
'F'
66 buf[3] = lut[*ptr & 0xF];
67 buf[4] = lut[*ptr >> 4];
AVPixelFormat
Pixel format.
This structure describes decoded (raw) audio or video data.
#define ANSI_MIN_READLINE
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVCodec p
The public AVCodec.
#define FF_CODEC_ENCODE_CB(func)
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
#define CODEC_LONG_NAME(str)
static int xbm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
const FFCodec ff_xbm_encoder
#define i(width, name, range_min, range_max)
const char * name
Name of the codec implementation.
main external API structure.
This structure stores compressed data.
int width
picture width / height.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
int ff_alloc_packet(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
Check AVPacket size and allocate data.