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};
127 for(i = 0; i <
height; i++)
128 memcpy(dst + (i * stride), refdata + (i * stride), width);
132 dst = dst + height *
stride;
135 code = bytestream2_get_byte(&qctx->
buffer);
142 int me_w, me_h, me_x, me_y;
152 corr = bytestream2_get_byte(&qctx->
buffer);
165 if ((me_x + filled < 0) || (me_x + me_w + filled > width) ||
166 (height - me_y - me_h < 0) || (height - me_y > orig_height) ||
167 (filled + me_w > width) || (height - me_h < 0))
168 av_log(NULL,
AV_LOG_ERROR,
"Bogus motion vector (%i,%i), block size %ix%i at %i,%i\n",
169 me_x, me_y, me_w, me_h, filled, height);
172 me_plane = refdata + (filled + me_x) + (height - me_y) *
stride;
173 for(j = 0; j < me_h; j++) {
174 for(i = 0; i < me_w; i++)
175 dst[filled + i - (j * stride)] = me_plane[i - (j *
stride)];
179 code = bytestream2_get_byte(&qctx->
buffer);
189 p = bytestream2_get_byte(&qctx->
buffer);
190 for(i = 0; i <= code; i++) {
192 if(filled >= width) {
200 }
else if(code >= 0xC0) {
206 for(i = 0; i <= code; i++) {
207 dst[filled++] = bytestream2_get_byte(&qctx->
buffer);
208 if(filled >= width) {
216 }
else if(code >= 0x80) {
223 skip = bytestream2_get_byte(&qctx->
buffer) + 64;
225 skip = bytestream2_get_byte(&qctx->
buffer) + 320;
229 while( filled >= width) {
239 dst[filled++] = ctable[code & 0x7F];
243 if(filled >= width) {
253 void *
data,
int *got_frame,
264 if (avpkt->
size < 0x86) {
281 delta = bytestream2_get_byte(&a->
buffer);
311 for (i=0; i<pal_size/4; i++)
const char const char void * val
This structure describes decoded (raw) audio or video data.
static av_cold int init(AVCodecContext *avctx)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
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)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
const char * name
Name of the codec implementation.
int av_frame_ref(AVFrame *dst, AVFrame *src)
Setup a new reference to the data described by a given 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.
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)
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
Libavcodec external API header.
static void decode_flush(AVCodecContext *avctx)
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
uint8_t * av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
int width
picture width / height.
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static void flush(AVCodecContext *avctx)
static const int qpeg_table_w[16]
static const int qpeg_table_h[16]
main external API structure.
static void close(AVCodecParserContext *s)
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everythnig contained in src to dst and reset src.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
BYTE int const BYTE int int int height
void avcodec_get_frame_defaults(AVFrame *frame)
Set the fields of the given AVFrame to default values.
int palette_has_changed
Tell user application that palette has changed from previous frame.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
common internal api header.
static av_cold int decode_end(AVCodecContext *avctx)
#define AVERROR_INVALIDDATA
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
8 bit with PIX_FMT_RGB32 palette
This structure stores compressed data.
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.