49 unsigned x = 0, y = 0;
54 unsigned run = bytestream2_get_byte(gb);
62 fill = bytestream2_get_byte(gb);
65 fill = bytestream2_get_le16(gb);
68 fill = bytestream2_get_le24(gb);
71 fill = bytestream2_get_le32(gb);
75 for (j = 0; j <
run; j++) {
78 bytestream2_put_byte(pb, fill);
81 bytestream2_put_le16(pb, fill);
84 bytestream2_put_le24(pb, fill);
87 bytestream2_put_le32(pb, fill);
93 unsigned copy = bytestream2_get_byte(gb);
99 }
else if (
copy == 1) {
101 }
else if (
copy == 2) {
103 x += bytestream2_get_byte(gb);
104 y += bytestream2_get_byte(gb);
111 for (j = 0; j <
copy; j++) {
114 bytestream2_put_byte(pb, bytestream2_get_byte(gb));
117 bytestream2_put_le16(pb, bytestream2_get_le16(gb));
120 bytestream2_put_le24(pb, bytestream2_get_le24(gb));
123 bytestream2_put_le32(pb, bytestream2_get_le32(gb));
128 if (
s->bpp == 1 && (
copy & 1))
142 z_stream *
const zstream = &
s->zstream.zstream;
143 const uint8_t *buf = avpkt->
data;
144 int buf_size = avpkt->
size;
152 ret = inflateReset(zstream);
157 zstream->next_out =
s->decomp_buf;
158 zstream->avail_out =
s->decomp_size;
160 const uint8_t start = avpkt->
data[2] ^ avpkt->
data[0];
162 zstream->next_in = &start;
163 zstream->avail_in = 1;
164 ret =
inflate(zstream, Z_NO_FLUSH);
165 if (ret != Z_OK || zstream->avail_in != 0)
171 zstream->next_in = buf;
172 zstream->avail_in = buf_size;
173 ret =
inflate(zstream, Z_FINISH);
174 if (ret != Z_STREAM_END) {
187 for (j = 0; j < 256; j++)
188 s->pal[j] = 0xFF000000 |
AV_RL32(pal + j * 4);
191 "Palette size %zu is wrong\n",
size);
203 for (j = 0; j < avctx->
height; j++) {
205 s->uncomp_buf +
s->bpp * j * avctx->
width,
s->bpp * avctx->
width);
const FFCodec ff_mscc_decoder
const FFCodec ff_srgc_decoder
static av_cold void close(AVCodecParserContext *s)
Libavcodec external API header.
static av_always_inline void bytestream2_init_writer(PutByteContext *p, uint8_t *buf, int buf_size)
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
static av_always_inline int bytestream2_get_bytes_left_p(const PutByteContext *p)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
static av_always_inline int bytestream2_seek_p(PutByteContext *p, int offset, int whence)
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, size_t *size)
Get side information from packet.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold int decode_init(AVCodecContext *avctx)
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
static av_cold int decode_close(AVCodecContext *avctx)
Memory handling functions.
static int rle_uncompress(AVCodecContext *avctx, GetByteContext *gb, PutByteContext *pb)
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
static av_cold int decode_close(AVCodecContext *avctx)
static av_cold int decode_init(AVCodecContext *avctx)
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
#define AV_PIX_FMT_RGB555
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
static void inflate(uint8_t *dst, const uint8_t *p1, int width, int threshold, const uint8_t *coordinates[], int coord, int maxc)
static void copy(const float *p1, float *p2, const int length)
void ff_inflate_end(FFZStream *zstream)
Wrapper around inflateEnd().
int ff_inflate_init(FFZStream *zstream, void *logctx)
Wrapper around inflateInit().