61 c0 = bytestream2_get_byte(&qctx->
buffer);
62 c1 = bytestream2_get_byte(&qctx->
buffer);
63 run = ((
code & 0x7) << 16) + (c0 << 8) +
c1 + 2;
64 }
else if (
code >= 0xF0) {
65 c0 = bytestream2_get_byte(&qctx->
buffer);
66 run = ((
code & 0xF) << 8) + c0 + 2;
67 }
else if (
code >= 0xE0) {
69 }
else if (
code >= 0xC0) {
70 c0 = bytestream2_get_byte(&qctx->
buffer);
71 c1 = bytestream2_get_byte(&qctx->
buffer);
72 copy = ((
code & 0x3F) << 16) + (c0 << 8) +
c1 + 1;
73 }
else if (
code >= 0x80) {
74 c0 = bytestream2_get_byte(&qctx->
buffer);
75 copy = ((
code & 0x7F) << 8) + c0 + 1;
84 p = bytestream2_get_byte(&qctx->
buffer);
87 memset(
dst+filled, p, step);
90 if (filled >=
width) {
94 while (
run -
i >
width && rows_to_go > 0) {
112 if (filled >=
width) {
125 { 0x00, 0x20, 0x20, 0x20, 0x18, 0x10, 0x10, 0x20, 0x10, 0x08, 0x18, 0x08, 0x08, 0x18, 0x10, 0x04};
127 { 0x00, 0x20, 0x18, 0x08, 0x18, 0x10, 0x20, 0x10, 0x08, 0x10, 0x20, 0x20, 0x08, 0x10, 0x18, 0x04};
132 int delta,
const uint8_t *ctable,
160 int me_w, me_h, me_x, me_y;
170 corr = bytestream2_get_byte(&qctx->
buffer);
183 if ((me_x + filled < 0) || (me_x + me_w + filled >
width) ||
184 (
height - me_y - me_h < 0) || (
height - me_y >= orig_height) ||
187 me_x, me_y, me_w, me_h, filled,
height);
190 me_plane = refdata + (filled + me_x) + (
height - me_y) *
stride;
191 for(j = 0; j < me_h; j++) {
192 for(
i = 0;
i < me_w;
i++)
207 p = bytestream2_get_byte(&qctx->
buffer);
210 if(filled >=
width) {
218 }
else if(
code >= 0xC0) {
225 dst[filled++] = bytestream2_get_byte(&qctx->
buffer);
226 if(filled >=
width) {
234 }
else if(
code >= 0x80) {
241 skip = bytestream2_get_byte(&qctx->
buffer) + 64;
243 skip = bytestream2_get_byte(&qctx->
buffer) + 320;
247 while( filled >=
width) {
257 dst[filled++] = ctable[
code & 0x7F];
261 if(filled >=
width) {
277 int delta, intra, ret;
279 if (avpkt->
size < 0x86) {
288 outdata = p->data[0];
293 delta = bytestream2_get_byte(&
a->buffer);
294 intra =
delta == 0x10;
323 const uint8_t *pal_src;
330 for (
i=0;
i<pal_size/4;
i++)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static double val(void *priv, double ch)
static av_cold void decode_flush(AVCodecContext *avctx)
const FFCodec ff_qpeg_decoder
static av_cold void close(AVCodecParserContext *s)
Libavcodec external API header.
static void BS_FUNC skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.
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_bufferu(GetByteContext *g, uint8_t *dst, unsigned int 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 void bytestream2_skip(GetByteContext *g, unsigned int size)
#define i(width, name, range_min, range_max)
#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 ff_copy_palette(void *dst, const AVPacket *src, void *logctx)
Check whether the side-data of src contains a palette of size AVPALETTE_SIZE; if so,...
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_INVALIDDATA
Invalid data found when processing input.
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
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 av_cold int decode_end(AVCodecContext *avctx)
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
Macro definitions for various function/variable attributes.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
static av_cold void decode_flush(AVCodecContext *avctx)
static void qpeg_decode_intra(QpegContext *qctx, uint8_t *dst, int stride, int width, int height)
static av_cold int decode_init(AVCodecContext *avctx)
static const uint8_t qpeg_table_h[16]
static av_cold int decode_end(AVCodecContext *avctx)
static void av_noinline qpeg_decode_inter(QpegContext *qctx, uint8_t *dst, int stride, int width, int height, int delta, const uint8_t *ctable, uint8_t *refdata)
static int decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
static const uint8_t qpeg_table_w[16]
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
uint8_t * extradata
Out-of-band global headers that may be used by some codecs.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
static int ref[MAX_W *MAX_W]
static void copy(const float *p1, float *p2, const int length)