36 const uint8_t **poutbuf,
int *poutbuf_size,
37 const uint8_t *buf,
int buf_size)
84 }
else if (pnmctx.
type < 4) {
87 const uint8_t *sync = bs;
99 const uint8_t *match = memchr(bs,
'\n', end-bs);
104 }
else if (
c ==
'P') {
115 if (ret > 0 && pnmctx.
half)
117 if (ret >= 0 && next + (uint64_t)ret <= INT_MAX)
122 if (next > buf_size) {
133 *poutbuf_size = buf_size;
static int parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
static av_cold void close(AVCodecParserContext *s)
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static void BS_FUNC skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.
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.
av_cold void ff_parse_close(AVCodecParserContext *s)
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
#define PARSER_CODEC_LIST(...)
const FFCodecParser ff_pnm_parser
static int inc(int num, int period)
int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext *const s)
static int pnm_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
const uint8_t * bytestream
const uint8_t * bytestream_end
const uint8_t * bytestream_start
int overread_index
the index into ParseContext.buffer of the overread bytes
int overread
the number of bytes which where irreversibly read from the next frame