50 dst = dst + height *
stride;
53 code = bytestream2_get_byte(&qctx->
buffer);
58 c0 = bytestream2_get_byte(&qctx->
buffer);
59 c1 = bytestream2_get_byte(&qctx->
buffer);
60 run = ((code & 0x7) << 16) + (c0 << 8) + c1 + 2;
61 }
else if (code >= 0xF0) {
62 c0 = bytestream2_get_byte(&qctx->
buffer);
63 run = ((code & 0xF) << 8) + c0 + 2;
64 }
else if (code >= 0xE0) {
65 run = (code & 0x1F) + 2;
66 }
else if (code >= 0xC0) {
67 c0 = bytestream2_get_byte(&qctx->
buffer);
68 c1 = bytestream2_get_byte(&qctx->
buffer);
69 copy = ((code & 0x3F) << 16) + (c0 << 8) + c1 + 1;
70 }
else if (code >= 0x80) {
71 c0 = bytestream2_get_byte(&qctx->
buffer);
72 copy = ((code & 0x7F) << 8) + c0 + 1;
81 p = bytestream2_get_byte(&qctx->
buffer);
82 for(i = 0; i <
run; i++) {
84 if (filled >= width) {
93 for(i = 0; i <
copy; i++) {
94 dst[filled++] = bytestream2_get_byte(&qctx->
buffer);
95 if (filled >= width) {
108 { 0x00, 0x20, 0x20, 0x20, 0x18, 0x10, 0x10, 0x20, 0x10, 0x08, 0x18, 0x08, 0x08, 0x18, 0x10, 0x04};
110 { 0x00, 0x20, 0x18, 0x08, 0x18, 0x10, 0x20, 0x10, 0x08, 0x10, 0x20, 0x20, 0x08, 0x10, 0x18, 0x04};
124 for(i = 0; i <
height; i++)
125 memcpy(refdata + (i * width), dst + (i * stride), width);
129 dst = dst + height *
stride;
132 code = bytestream2_get_byte(&qctx->
buffer);
136 while((code & 0xF0) == 0xF0) {
139 int me_w, me_h, me_x, me_y;
149 corr = bytestream2_get_byte(&qctx->
buffer);
162 if ((me_x + filled < 0) || (me_x + me_w + filled > width) ||
163 (height - me_y - me_h < 0) || (height - me_y > orig_height) ||
164 (filled + me_w > width) || (height - me_h < 0))
166 me_x, me_y, me_w, me_h, filled, height);
169 me_plane = refdata + (filled + me_x) + (height - me_y) *
width;
170 for(j = 0; j < me_h; j++) {
171 for(i = 0; i < me_w; i++)
172 dst[filled + i - (j * stride)] = me_plane[i - (j *
width)];
176 code = bytestream2_get_byte(&qctx->
buffer);
186 p = bytestream2_get_byte(&qctx->
buffer);
187 for(i = 0; i <= code; i++) {
189 if(filled >= width) {
197 }
else if(code >= 0xC0) {
200 for(i = 0; i <= code; i++) {
201 dst[filled++] = bytestream2_get_byte(&qctx->
buffer);
202 if(filled >= width) {
210 }
else if(code >= 0x80) {
217 skip = bytestream2_get_byte(&qctx->
buffer) + 64;
219 skip = bytestream2_get_byte(&qctx->
buffer) + 320;
223 while( filled >= width) {
233 dst[filled++] = ctable[code & 0x7F];
237 if(filled >= width) {
247 void *
data,
int *got_frame,
257 if (avpkt->
size < 0x86) {
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 ...
This structure describes decoded (raw) audio or video data.
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
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)
int(* reget_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of a frame to get cr buffer for it.
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
8 bit with PIX_FMT_RGB32 palette
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 int init(AVCodecParserContext *s)
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)
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int reference
is this picture used as reference The values for this are the same as the MpegEncContext.picture_structure variable, that is 1->top field, 2->bottom field, 3->frame/both fields.
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
#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)
struct QpegContext QpegContext
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 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]
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
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.
#define AVERROR_INVALIDDATA
static av_cold int decode_end(AVCodecContext *avctx)
uint8_t * av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
This structure stores compressed data.