56 int outcnt = 0, maxcnt;
89 for (i = 0; i < 8; i++)
92 while (outcnt < maxcnt && buf_end - 2 > buf) {
96 if (!(code & 0x8000)) {
103 if ((code & 0x6000) == 0x6000) {
105 int oidx = (code >> 10) & 7;
108 count = (code & 0x3FF) + 3;
110 if (offsets[oidx] < 0) {
111 if (buf_end - 3 < buf)
117 start = (outcnt + offsets[oidx]) % maxcnt;
119 if (maxcnt - start < count)
124 "Frame reference does not exist\n");
132 int offset = (code & 0x1FFF) + 1;
134 if (!(code & 0x6000)) {
136 }
else if ((code & 0x6000) == 0x2000) {
139 if (buf_end - 1 < buf)
148 inp_off = outcnt - offset;
151 if (maxcnt - outcnt < count)
154 for (i = inp_off; i < count + inp_off; i++) {
155 out[outcnt++] = inp[i];
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video 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.
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_cold int decode_end(AVCodecContext *avctx)
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
const char * name
Name of the codec implementation.
int width
picture width / height.
static int decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt)
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static void decode_flush(AVCodecContext *avctx)
static av_cold int decode_init(AVCodecContext *avctx)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
uint16_t * last_frame_buffer
common internal api header.
common internal and external API header
static av_cold void flush(AVCodecContext *avctx)
Flush (reset) the frame ID after seeking.
#define AV_PIX_FMT_RGB555
static av_cold int init(AVCodecParserContext *s)
#define FFSWAP(type, a, b)
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
This structure stores compressed data.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.