49 uint32_t fill = bytestream2_get_le24(gb);
50 unsigned run = bytestream2_get_byte(gb);
53 run = bytestream2_get_le32(gb);
58 for (
int j = 0; j <
run; j++,
w++) {
63 bytestream2_put_le24(pb, fill);
65 }
else if (
run == 255) {
76 for (
int j = 0; j < fill; j++,
w++) {
82 bytestream2_put_le24(pb, bytestream2_get_le24(gbp));
90 for (
int j = 0; j <
run; j++,
w++) {
95 bytestream2_put_le24(pb, fill);
107 z_stream *
const zstream = &
s->zstream.zstream;
108 const uint8_t *buf = avpkt->
data;
109 int buf_size = avpkt->
size;
115 ret = inflateReset(zstream);
120 zstream->next_in = buf;
121 zstream->avail_in = buf_size;
122 zstream->next_out =
s->decomp_buf;
123 zstream->avail_out =
s->decomp_size;
124 ret =
inflate(zstream, Z_FINISH);
125 if (ret != Z_STREAM_END) {
134 if (
s->prev_frame->data[0])
140 frame->linesize[0],
s->prev_frame->linesize[0]);
166 if (
size >= INT32_MAX)
168 s->decomp_size =
size;
const FFCodec ff_mwsc_decoder
static av_cold void close(AVCodecParserContext *s)
Libavcodec external API header.
static av_always_inline int bytestream2_tell_p(const PutByteContext *p)
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 void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline int bytestream2_seek(GetByteContext *g, int offset, int whence)
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.
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
#define AVERROR_EXTERNAL
Generic error in an external library.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
int av_frame_replace(AVFrame *dst, const AVFrame *src)
Ensure the destination frame refers to the same data described by the source frame,...
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_P
Predicted.
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 decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
static av_cold int decode_close(AVCodecContext *avctx)
static int rle_uncompress(GetByteContext *gb, PutByteContext *pb, GetByteContext *gbp, int width, int height, int stride, int pb_linesize, int gbp_linesize)
static av_cold int decode_init(AVCodecContext *avctx)
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
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)
void ff_inflate_end(FFZStream *zstream)
Wrapper around inflateEnd().
int ff_inflate_init(FFZStream *zstream, void *logctx)
Wrapper around inflateInit().