51 int buf_size = avpkt->
size;
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;
121 if (buf_end - buf < 256 * vect_w * vect_h)
123 table = buf + (256 * vect_w * vect_h);
125 int map_size = ((318 / vect_w + 7) / 8) * (198 / vect_h);
126 if (buf_end - table < map_size)
132 for (y=0; y<198; y+=vect_h) {
133 for (x=0; x<318; x+=vect_w) {
135 if (buf_end - table < 1)
137 vect = &buf[*table++ * (vect_w * vect_h)];
138 for (j=0; j<vect_w; j++) {
139 out[(y + 0) * stride + x + j] = vect[(0 * vect_w) + j];
140 out[(y + 1) * stride + x + j] = vect[(1 * vect_w) + j];
142 out[(y + 2) * stride + x + j] =
143 vect[(2 * vect_w) + j];
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
static av_cold int init(AVCodecContext *avctx)
static int avs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
Identical in function to av_frame_make_writable(), except it uses ff_get_buffer() to allocate the buf...
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
8 bits with AV_PIX_FMT_RGB32 palette
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
bitstream reader API header.
static const uint16_t table[]
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const char * name
Name of the codec implementation.
enum AVPictureType pict_type
Picture type of the frame.
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
static unsigned int get_bits1(GetBitContext *s)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static av_cold int avs_decode_init(AVCodecContext *avctx)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
int key_frame
1 -> keyframe, 0-> not
static const uint8_t * align_get_bits(GetBitContext *s)
static av_cold int avs_decode_end(AVCodecContext *avctx)
This structure stores compressed data.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.