Go to the documentation of this file.
36 digit = bytestream2_get_byte(
g);
37 if (digit ==
' ' || digit == 0xA || digit == 0xD)
39 else if (digit < '0' || digit >
'9')
42 temp = (uint64_t)10 * (*number) + (digit -
'0');
65 byte = bytestream2_peek_byte(
g);
69 }
else if (
byte ==
'-') {
75 byte = bytestream2_peek_byte(
g);
88 if (bytestream2_peek_byte(
g) == 0xA)
97 #define WRITE_FRAME(D, PIXEL, suffix) \
98 static inline void write_frame_ ##D(AVFrame *frame, GetByteContext *g, \
99 int width, int height, int sign, int depth) \
102 for (i = 0; i < height; i++) { \
103 PIXEL *line = (PIXEL*)frame->data[0] + i*frame->linesize[0]/sizeof(PIXEL); \
104 for (j = 0; j < width; j++) { \
107 val = (PIXEL)bytestream2_get_ ##suffix(g) + (1 << (depth - 1)); \
109 val = bytestream2_get_ ##suffix(g); \
110 val <<= (D - depth); \
136 if (depth > 0 && depth <= 8) {
139 }
else if (depth > 0 && depth <= 16) {
152 avctx->bits_per_raw_sample = depth;
static void error(const char *err)
This structure describes decoded (raw) audio or video data.
static int pgx_get_number(AVCodecContext *avctx, GetByteContext *g, int *number)
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
int key_frame
1 -> keyframe, 0-> not
#define AV_PIX_FMT_GRAY16
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int pgx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define WRITE_FRAME(D, PIXEL, suffix)
const AVCodec ff_pgx_decoder
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
static int pgx_decode_header(AVCodecContext *avctx, GetByteContext *g, int *depth, int *width, int *height, int *sign)
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
enum AVPictureType pict_type
Picture type of the frame.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_WB16 unsigned int_TMPL byte
const char * name
Name of the codec implementation.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL be16
main external API structure.
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
This structure stores compressed data.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.