51 int buf_size = avpkt->
size;
53 uint8_t *dst = bfi->
dst;
54 uint8_t *src, *dst_offset, colour1, colour2;
84 for (j = 0; j < 3; j++, shift -= 8)
87 (avctx->
extradata[i * 3 + j] >> 4)) << shift;
98 while (dst != frame_end) {
99 static const uint8_t lentab[4] = { 0, 2, 0, 1 };
100 unsigned int byte = bytestream2_get_byte(&g),
av_uninit(offset);
101 unsigned int code = byte >> 6;
102 unsigned int length = byte & ~0xC0;
106 "Input resolution larger than actual frame.\n");
113 length = bytestream2_get_byte(&g);
114 offset = bytestream2_get_le16(&g);
116 length = bytestream2_get_le16(&g);
117 if (code == 2 && length == 0)
122 offset = bytestream2_get_byte(&g);
126 if (dst + (length << lentab[code]) > frame_end)
141 dst_offset = dst - offset;
143 if (dst_offset < bfi->dst)
146 *dst++ = *dst_offset++;
154 colour1 = bytestream2_get_byte(&g);
155 colour2 = bytestream2_get_byte(&g);
168 memcpy(dst, src, avctx->
width);
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
int(* get_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of each frame to get a buffer for it.
struct BFIContext BFIContext
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
static int bfi_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static int init(AVCodecParserContext *s)
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int reference
is this picture used as reference The values for this are the same as the MpegEncContext.picture_structure variable, that is 1->top field, 2->bottom field, 3->frame/both fields.
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
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_bytes_left(GetByteContext *g)
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
static av_cold int bfi_decode_close(AVCodecContext *avctx)
int width
picture width / height.
struct AVFrame AVFrame
Audio Video Frame.
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
static av_cold int bfi_decode_init(AVCodecContext *avctx)
main external API structure.
static void close(AVCodecParserContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int palette_has_changed
Tell user application that palette has changed from previous frame.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal and external API header
8 bit with PIX_FMT_RGB32 palette
int key_frame
1 -> keyframe, 0-> not
int frame_number
audio or video frame number