50 const uint8_t *buf = avpkt->
data;
51 const uint8_t *buf_end = avpkt->
data + avpkt->
size;
52 int buf_size = avpkt->
size;
55 const uint8_t *
table, *vect;
57 int i, j, x, y,
stride, ret, vect_w = 3, vect_h = 3;
70 if (buf_end - buf < 4)
78 uint32_t *pal = (uint32_t *) p->data[1];
81 last = first +
AV_RL16(buf + 2);
82 if (first >= 256 || last > 256 || buf_end - buf < 4 + 4 + 3 * (last - first))
85 for (
i=first;
i<last;
i++, buf+=3) {
86 pal[
i] = (buf[0] << 18) | (buf[1] << 10) | (buf[2] << 2);
87 pal[
i] |= 0xFFU << 24 | (pal[
i] >> 6) & 0x30303;
122 if (buf_end - buf < 256 * vect_w * vect_h)
124 table = buf + (256 * vect_w * vect_h);
126 int map_size = ((318 / vect_w + 7) / 8) * (198 / vect_h);
127 if (buf_end -
table < map_size)
133 for (y=0; y<198; y+=vect_h) {
134 for (x=0; x<318; x+=vect_w) {
136 if (buf_end -
table < 1)
138 vect = &buf[*
table++ * (vect_w * vect_h)];
139 for (j=0; j<vect_w; j++) {
140 out[(y + 0) *
stride + x + j] = vect[(0 * vect_w) + j];
141 out[(y + 1) *
stride + x + j] = vect[(1 * vect_w) + j];
144 vect[(2 * vect_w) + j];
const FFCodec ff_avs_decoder
Libavcodec external API header.
#define i(width, name, range_min, range_max)
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
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 ff_set_dimensions(AVCodecContext *s, int width, int height)
int(* init)(AVBSFContext *ctx)
bitstream reader API header.
static unsigned int get_bits1(GetBitContext *s)
static const uint8_t * align_get_bits(GetBitContext *s)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
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.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_P
Predicted.
static av_cold int avs_decode_init(AVCodecContext *avctx)
static int avs_decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
static av_cold int avs_decode_end(AVCodecContext *avctx)
Macro definitions for various function/variable attributes.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
static const uint16_t table[]
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.