26 #include "libavutil/avstring.h"
52 int ret, linesize, i, j;
59 ptr += strcspn(ptr,
"#");
60 if (sscanf(ptr,
"#define %255s %u", name, &number) != 2) {
66 if ((len > 6) && !avctx->
height && !memcmp(name + len - 7,
"_height", 7)) {
68 }
else if ((len > 5) && !avctx->
width && !memcmp(name + len - 6,
"_width", 6)) {
69 avctx->
width = number;
74 ptr += strcspn(ptr,
"\n\r") + 1;
81 ptr += strcspn(ptr,
"{") + 1;
83 linesize = (avctx->
width + 7) / 8;
84 for (i = 0; i < avctx->
height; i++) {
86 for (j = 0; j < linesize; j++) {
89 ptr += strcspn(ptr,
"x") + 1;
94 val = (val << 4) +
convert(*ptr);
const char const char void * val
This structure describes decoded (raw) audio or video data.
int av_isxdigit(int c)
Locale-independent conversion of ASCII isxdigit.
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.
static av_cold int end(AVCodecContext *avctx)
const char * name
Name of the codec implementation.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static int xbm_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static av_cold int xbm_decode_init(AVCodecContext *avctx)
#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.
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
static int convert(uint8_t x)
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
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.
#define AVERROR_INVALIDDATA
int key_frame
1 -> keyframe, 0-> not
const uint8_t ff_reverse[256]
This structure stores compressed data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.