65 const uint8_t *buf = avpkt->
data;
66 int buf_size = avpkt->
size;
68 const unsigned char *encoded = buf;
69 unsigned char *pixptr, *pixptr_end;
71 unsigned int dlen, p, row;
72 const unsigned char *lp, *dp, *ep;
75 unsigned int planes = c->
planes;
76 unsigned char *planemap = c->
planemap;
88 ep = encoded + buf_size;
91 dp = encoded + planes * (height << 1);
99 for (p = 0; p < planes; p++) {
101 lp = encoded + p * (height << 1);
104 for(row = 0; row <
height; row++) {
107 if (ep - lp < row * 2 + 2)
109 dlen =
av_be2ne16(*(
const unsigned short *)(lp+row*2));
112 if(ep - dp <= 1)
return -1;
113 if ((count = *dp++) <= 127) {
116 if (pixptr + count * px_inc > pixptr_end)
118 if(ep - dp < count)
return -1;
125 if (pixptr + count * px_inc > pixptr_end)
int(* get_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of each frame to get a buffer for it.
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define FF_BUFFER_HINTS_VALID
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
static enum PixelFormat pixfmt_rgb24[]
int buffer_hints
codec suggestion on buffer type if != 0
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
enum PixelFormat(* get_format)(struct AVCodecContext *s, const enum PixelFormat *fmt)
callback to negotiate the pixelFormat
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
AVCodec ff_eightbps_decoder
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
static int init(AVCodecParserContext *s)
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
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.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
struct AVFrame AVFrame
Audio Video Frame.
struct EightBpsContext EightBpsContext
uint8_t * av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
static void close(AVCodecParserContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold int decode_init(AVCodecContext *avctx)
int palette_has_changed
Tell user application that palette has changed from previous frame.
packed RGB 8:8:8, 24bpp, BGRBGR...
unsigned char planemap[4]
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
8 bit with PIX_FMT_RGB32 palette
static av_cold int decode_end(AVCodecContext *avctx)