51 dst = dst + height *
stride;
54 code = bytestream2_get_byte(&qctx->
buffer);
59 c0 = bytestream2_get_byte(&qctx->
buffer);
60 c1 = bytestream2_get_byte(&qctx->
buffer);
61 run = ((code & 0x7) << 16) + (c0 << 8) + c1 + 2;
62 }
else if (code >= 0xF0) {
63 c0 = bytestream2_get_byte(&qctx->
buffer);
64 run = ((code & 0xF) << 8) + c0 + 2;
65 }
else if (code >= 0xE0) {
66 run = (code & 0x1F) + 2;
67 }
else if (code >= 0xC0) {
68 c0 = bytestream2_get_byte(&qctx->
buffer);
69 c1 = bytestream2_get_byte(&qctx->
buffer);
70 copy = ((code & 0x3F) << 16) + (c0 << 8) + c1 + 1;
71 }
else if (code >= 0x80) {
72 c0 = bytestream2_get_byte(&qctx->
buffer);
73 copy = ((code & 0x7F) << 8) + c0 + 1;
82 p = bytestream2_get_byte(&qctx->
buffer);
83 for(i = 0; i <
run; i++) {
85 if (filled >= width) {
94 for(i = 0; i <
copy; i++) {
95 dst[filled++] = bytestream2_get_byte(&qctx->
buffer);
96 if (filled >= width) {
109 { 0x00, 0x20, 0x20, 0x20, 0x18, 0x10, 0x10, 0x20, 0x10, 0x08, 0x18, 0x08, 0x08, 0x18, 0x10, 0x04};
111 { 0x00, 0x20, 0x18, 0x08, 0x18, 0x10, 0x20, 0x10, 0x08, 0x10, 0x20, 0x20, 0x08, 0x10, 0x18, 0x04};
125 for(i = 0; i <
height; i++)
126 memcpy(refdata + (i * width), dst + (i * stride), width);
130 dst = dst + height *
stride;
133 code = bytestream2_get_byte(&qctx->
buffer);
137 while((code & 0xF0) == 0xF0) {
140 int me_w, me_h, me_x, me_y;
150 corr = bytestream2_get_byte(&qctx->
buffer);
163 if ((me_x + filled < 0) || (me_x + me_w + filled > width) ||
164 (height - me_y - me_h < 0) || (height - me_y > orig_height) ||
165 (filled + me_w > width) || (height - me_h < 0))
167 me_x, me_y, me_w, me_h, filled, height);
170 me_plane = refdata + (filled + me_x) + (height - me_y) *
width;
171 for(j = 0; j < me_h; j++) {
172 for(i = 0; i < me_w; i++)
173 dst[filled + i - (j * stride)] = me_plane[i - (j *
width)];
177 code = bytestream2_get_byte(&qctx->
buffer);
187 p = bytestream2_get_byte(&qctx->
buffer);
188 for(i = 0; i <= code; i++) {
190 if(filled >= width) {
198 }
else if(code >= 0xC0) {
201 for(i = 0; i <= code; i++) {
202 dst[filled++] = bytestream2_get_byte(&qctx->
buffer);
203 if(filled >= width) {
211 }
else if(code >= 0x80) {
218 skip = bytestream2_get_byte(&qctx->
buffer) + 64;
220 skip = bytestream2_get_byte(&qctx->
buffer) + 320;
224 while( filled >= width) {
234 dst[filled++] = ctable[code & 0x7F];
238 if(filled >= width) {
248 void *
data,
int *got_frame,
258 if (avpkt->
size < 0x86) {
268 outdata = p->
data[0];
273 delta = bytestream2_get_byte(&a->
buffer);
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
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 int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
8 bit with PIX_FMT_RGB32 palette
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static void copy(LZOContext *c, int cnt)
Copies bytes from input to output buffer with checking.
static void qpeg_decode_intra(QpegContext *qctx, uint8_t *dst, int stride, int width, int height)
static void qpeg_decode_inter(QpegContext *qctx, uint8_t *dst, int stride, int width, int height, int delta, const uint8_t *ctable, uint8_t *refdata)
static av_cold int decode_init(AVCodecContext *avctx)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
Identical in function to av_frame_make_writable(), except it uses ff_get_buffer() to allocate the buf...
int width
picture width / height.
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static const int qpeg_table_w[16]
static const int qpeg_table_h[16]
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
static void close(AVCodecParserContext *s)
int palette_has_changed
Tell user application that palette has changed from previous frame.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
static av_cold int decode_end(AVCodecContext *avctx)
static av_cold int init(AVCodecParserContext *s)
uint8_t * av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
This structure stores compressed data.