50 start = bytestream2_get_le16(gb);
51 count = bytestream2_get_le16(gb);
53 if (start + count > 256)
59 for (
int i = 0;
i < count;
i++)
60 pal[start +
i] = (0xFFU << 24) | bytestream2_get_be24u(gb);
69 const int l =
frame->linesize[0];
77 for (
int y = 0; y <
frame->height; y += 2) {
78 for (
int x = 0; x <
frame->width; x += 2) {
79 int index = bytestream2_get_byteu(gb);
99 const int l =
frame->linesize[0];
112 for (
int y = 0; y <
frame->height; y += 2) {
113 for (
int x = 0; x <
frame->width; x += 2) {
114 const uint8_t *
block;
118 codes = bytestream2_get_byteu(&sb);
123 index = bytestream2_get_byte(gb);
146 const int w =
frame->width;
147 const int h =
frame->height;
148 const int l =
frame->linesize[0];
154 type = bytestream2_get_byte(gb);
161 for (
int y = 0; y <
h; y += 8) {
162 for (
int x = 0; x <
w; x += 8) {
163 int fill = bytestream2_get_byte(gb);
164 uint8_t *ddst =
dst + x;
166 for (
int by = 0; by < 8; by++) {
167 memset(ddst, fill, 8);
177 int bsize = bytestream2_get_byte(gb);
184 count = bytestream2_get_be16(gb);
187 int bsize_w, bsize_h;
189 bsize_w = bsize_h = bsize;
192 mvx = bytestream2_get_byte(gb) * bsize;
193 mvy = bytestream2_get_byte(gb) * bsize;
194 a = bytestream2_get_byte(gb);
195 b = bytestream2_get_byte(gb);
196 c = ((
a & 0x3F) << 8) +
b;
197 mx = mvx + (
c & 0x7F) - 64;
198 my = mvy + (
c >> 7) - 64;
200 if (mvy < 0 || mvy >=
h)
203 if (mvx < 0 || mvx >=
w)
212 dst =
frame->data[0] + mvx + l * mvy;
218 if (mvy >=
my && (mvy !=
my || mvx >=
mx)) {
219 src += (bsize_h - 1) * l;
220 dst += (bsize_h - 1) * l;
221 for (
int by = 0; by < bsize_h; by++) {
222 memmove(
dst,
src, bsize_w);
227 for (
int by = 0; by < bsize_h; by++) {
228 memmove(
dst,
src, bsize_w);
242 for (
int y = 0; y <
h; y++) {
249 for (
int y = 0; y <
h; y += 2) {
250 for (
int x = 0; x <
w; x += 2) {
251 int fill = bytestream2_get_byte(gb);
252 uint8_t *ddst =
dst + x;
254 fill = (fill << 8) | fill;
255 for (
int by = 0; by < 2; by++) {
266 size = bytestream2_get_le16(gb);
268 int x = bytestream2_get_byte(gb) * 4;
269 int y = bytestream2_get_byte(gb) * 4;
270 int count = bytestream2_get_byte(gb);
271 int fill = bytestream2_get_byte(gb);
274 for (
int i = 0;
i < count;
i++)
284 int count = bytestream2_get_byteu(gb);
285 int skip = count & 0x3F;
307 int bits = bytestream2_get_byte(gb);
309 for (
int i = 0;
i < 4;
i++) {
325 dst[
pos] = bytestream2_get_byte(gb);
356 const int w =
frame->width;
357 const int h =
frame->height;
358 const int l =
frame->linesize[0] / 4;
365 type = bytestream2_get_byte(gb);
372 for (
int y = 0; y + 12 <=
h; y += 12) {
373 for (
int x = 0; x + 12 <=
w; x += 12) {
374 int fill = bytestream2_get_be24(gb);
375 uint32_t *dstp =
dst + x;
377 for (
int by = 0; by < 12; by++) {
378 for (
int bx = 0; bx < 12; bx++)
390 int bsize = bytestream2_get_byte(gb);
397 count = bytestream2_get_be16(gb);
400 int bsize_w, bsize_h;
402 bsize_w = bsize_h = bsize;
405 mvx = bytestream2_get_byte(gb) * bsize;
406 mvy = bytestream2_get_byte(gb) * bsize;
407 a = bytestream2_get_byte(gb);
408 b = bytestream2_get_byte(gb);
409 c = ((
a & 0x3F) << 8) +
b;
410 mx = mvx + (
c & 0x7F) - 64;
411 my = mvy + (
c >> 7) - 64;
413 if (mvy < 0 || mvy >=
h)
416 if (mvx < 0 || mvx >=
w)
425 dst = (uint32_t *)
frame->data[0] + mvx + l * mvy;
431 if (mvy >=
my && (mvy !=
my || mvx >=
mx)) {
432 src += (bsize_h - 1) * l;
433 dst += (bsize_h - 1) * l;
434 for (
int by = 0; by < bsize_h; by++) {
435 memmove(
dst,
src, bsize_w * 4);
440 for (
int by = 0; by < bsize_h; by++) {
441 memmove(
dst,
src, bsize_w * 4);
452 osize = ((
h + 3) / 4) * ((
w + 3) / 4) + 7;
459 for (
int x = 0; x <
w; x += 4) {
460 for (
int y = 0; y <
h; y += 4) {
463 if (
bits[di >> 3] & (1 << (di & 7))) {
464 int codes = bytestream2_get_byte(gb);
466 for (
int count = 0; count < 4; count++) {
467 uint32_t *
src = (uint32_t *)
frame->data[0];
468 size_t src_size = l * (
h - 1) + (
w - 1);
469 int nv, v,
code = codes & 3;
475 bcode = bytestream2_get_byte(gb);
477 for (
int j = 0; j < 4; j++) {
495 value = bytestream2_get_byte(gb);
500 s->mv1[nv][0], 0, src_size)];
513 for (
int j = 0; j < 4; j++) {
528 v = bytestream2_get_byte(gb);
531 s->mv0[v][0], 0, src_size)];
533 dst[0] = ((v & 0x7F) << 17) | bytestream2_get_be16(gb);
564 const int w =
frame->width;
565 const int h =
frame->height;
566 const int l =
frame->linesize[0];
571 int count = bytestream2_get_byte(gb);
572 int pixel = bytestream2_get_byte(gb);
617 chunk = bytestream2_get_be32(gb);
619 case MKBETAG(
'P',
'A',
'L',
'8'):
620 for (
int y = 0; y <
frame->height; y++)
625 case MKBETAG(
'M',
'A',
'D',
'1'):
631 case MKBETAG(
'A',
'V',
'C',
'F'):
638 case MKBETAG(
'A',
'L',
'C',
'D'):
645 case MKBETAG(
'R',
'L',
'E',
'F'):
652 case MKBETAG(
'R',
'L',
'E',
'D'):
705 for (
int n = 0,
i = -4;
i < 4;
i++) {
706 for (
int j = -14; j < 2; j++) {
712 for (
int n = 0,
i = -5;
i <= 1;
i += 2) {
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t my
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t mx
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static av_cold void decode_flush(AVCodecContext *avctx)
const FFCodec ff_argo_decoder
static av_cold void decode_flush(AVCodecContext *avctx)
static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
static int decode_rle(AVCodecContext *avctx, AVFrame *frame)
static av_cold int decode_close(AVCodecContext *avctx)
static int decode_mad1_24(AVCodecContext *avctx, AVFrame *frame)
static av_cold int decode_init(AVCodecContext *avctx)
static int decode_avcf(AVCodecContext *avctx, AVFrame *frame)
static int decode_pal8(AVCodecContext *avctx, uint32_t *pal)
static int decode_alcd(AVCodecContext *avctx, AVFrame *frame)
static int decode_mad1(AVCodecContext *avctx, AVFrame *frame)
Libavcodec external API header.
static void BS_FUNC skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.
static av_always_inline void bytestream2_skipu(GetByteContext *g, 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_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Identical in function to ff_get_buffer(), except it reuses the existing buffer if available.
int(* init)(AVBSFContext *ctx)
static const uint8_t bits[8]
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#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_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the 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_DEBUG
Stuff which is only useful for libav* developers.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_P
Predicted.
const VDPAUPixFmtMap * map
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)
Macro definitions for various function/variable attributes.
common internal API header
#define MKBETAG(a, b, c, d)
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
#define avpriv_request_sample(...)