47 unsigned run = bytestream2_get_byte(gb);
52 fill = bytestream2_get_byte(gb);
55 fill = bytestream2_get_le16(gb);
58 fill = bytestream2_get_le24(gb);
61 fill = bytestream2_get_le32(gb);
65 for (j = 0; j <
run; j++) {
68 bytestream2_put_byte(pb, fill);
71 bytestream2_put_le16(pb, fill);
74 bytestream2_put_le24(pb, fill);
77 bytestream2_put_le32(pb, fill);
82 unsigned copy = bytestream2_get_byte(gb);
86 }
else if (copy == 2) {
89 x = bytestream2_get_byte(gb);
90 y = bytestream2_get_byte(gb);
95 for (j = 0; j <
copy; j++) {
98 bytestream2_put_byte(pb, bytestream2_get_byte(gb));
101 bytestream2_put_le16(pb, bytestream2_get_le16(gb));
104 bytestream2_put_le24(pb, bytestream2_get_le24(gb));
107 bytestream2_put_le32(pb, bytestream2_get_le32(gb));
119 void *
data,
int *got_frame,
125 int buf_size = avpkt->
size;
141 ret = inflateReset(&s->
zstream);
147 s->
zstream.avail_in = buf_size;
151 if (ret != Z_STREAM_END) {
163 for (j = 0; j < avctx->
height; j++) {
192 memset(&s->
zstream, 0,
sizeof(z_stream));
205 zret = inflateInit(&s->
zstream);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static void copy(const float *p1, float *p2, const int length)
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static av_cold int init(AVCodecContext *avctx)
static av_always_inline void bytestream2_init_writer(PutByteContext *p, uint8_t *buf, int buf_size)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static void inflate(uint8_t *dst, const uint8_t *p1, int width, int threshold, const uint8_t *coordinates[], int coord)
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
#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. ...
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
static av_cold int decode_init(AVCodecContext *avctx)
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
const char * name
Name of the codec implementation.
static av_always_inline void bytestream2_skip_p(PutByteContext *p, unsigned int size)
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
packed RGB 8:8:8, 24bpp, BGRBGR...
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int rle_uncompress(AVCodecContext *avctx, GetByteContext *gb, PutByteContext *pb, int bpp)
common internal api header.
#define AV_PIX_FMT_RGB555
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
int key_frame
1 -> keyframe, 0-> not
This structure stores compressed data.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static av_cold int decode_close(AVCodecContext *avctx)