50 unsigned int w, h, depth, type, maptype, maplength,
stride, x, y,
len, alen;
120 if (buf_end - buf < maplength)
123 if (depth != 8 && maplength) {
124 av_log(avctx,
AV_LOG_WARNING,
"useless colormap found or file is corrupted, trying to recover\n");
126 }
else if (maplength) {
127 unsigned int len = maplength / 3;
129 if (maplength % 3 || maplength > 768) {
135 for (x = 0; x <
len; x++, ptr += 4)
136 *(uint32_t *)ptr = (buf[x] << 16) + (buf[len + x] << 8) + buf[len + len + x];
145 len = (depth * w + 7) >> 3;
146 alen = len + (len & 1);
153 while (ptr != end && buf < buf_end) {
155 if (buf_end - buf < 1)
175 for (y = 0; y < h; y++) {
176 if (buf_end - buf < len)
178 memcpy(ptr, buf, len);
187 return buf - bufstart;
This structure describes decoded (raw) audio or video data.
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
packed RGB 8:8:8, 24bpp, RGBRGB...
AVFrame * coded_frame
the picture in the bitstream
#define RMT_RAW
the data layout of this map type is unknown
void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
8 bit with PIX_FMT_RGB32 palette
struct SUNRASTContext SUNRASTContext
static int init(AVCodecParserContext *s)
void av_log_ask_for_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message asking for a sample.
#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.
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
int width
picture width / height.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame)
Get a buffer for a frame.
AVCodec ff_sunrast_decoder
packed RGB 8:8:8, 24bpp, BGRBGR...
static av_cold int sunrast_end(AVCodecContext *avctx)
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
static av_cold int sunrast_init(AVCodecContext *avctx)
main external API structure.
static void close(AVCodecParserContext *s)
static int sunrast_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
void avcodec_get_frame_defaults(AVFrame *frame)
Set the fields of the given AVFrame to default values.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
common internal and external API header
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
#define AVERROR_INVALIDDATA
#define AVERROR_PATCHWELCOME
This structure stores compressed data.