38 const AVFrame *p,
int *got_packet)
40 int i, j, ret,
size, linesize;
43 linesize = (avctx->
width + 7) / 8;
44 size = avctx->
height * (linesize * 7 + 2) + 110;
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, 40,
"static unsigned char image_bits[] = {\n");
56 for (i = 0; i < avctx->
height; i++) {
57 for (j = 0; j < linesize; j++)
58 buf += snprintf(buf, 7,
" 0x%02X,",
ff_reverse[*ptr++]);
60 buf += snprintf(buf, 2,
"\n");
62 buf += snprintf(buf, 5,
" };\n");
static av_cold int xbm_encode_close(AVCodecContext *avctx)
This structure describes decoded (raw) audio or video data.
static int xbm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet)
AVFrame * coded_frame
the picture in the bitstream
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
#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.
AVFrame * avcodec_alloc_frame(void)
Allocate an AVFrame and set its fields to default 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.
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
static av_cold int xbm_encode_init(AVCodecContext *avctx)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
const uint8_t ff_reverse[256]
AVPixelFormat
Pixel format.
This structure stores compressed data.