35 unsigned int w, h, depth, type, maptype, maplength,
stride, x, y,
len, alen;
100 if (buf_end - buf < maplength)
103 if (depth != 8 && maplength) {
104 av_log(avctx,
AV_LOG_WARNING,
"useless colormap found or file is corrupted, trying to recover\n");
106 }
else if (maplength) {
107 unsigned int len = maplength / 3;
109 if (maplength % 3 || maplength > 768) {
115 for (x = 0; x <
len; x++, ptr += 4)
116 *(uint32_t *)ptr = (buf[x] << 16) + (buf[len + x] << 8) + buf[len + len + x];
125 len = (depth * w + 7) >> 3;
126 alen = len + (len & 1);
133 while (ptr != end && buf < buf_end) {
135 if (buf_end - buf < 1)
155 for (y = 0; y < h; y++) {
156 if (buf_end - buf < len)
158 memcpy(ptr, buf, len);
166 return buf - bufstart;
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
#define AV_LOG_WARNING
Something somehow does not look correct.
packed RGB 8:8:8, 24bpp, RGBRGB...
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.
#define RMT_RAW
the data layout of this map type is unknown
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
8 bit with PIX_FMT_RGB32 palette
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#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. ...
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.
AVCodec ff_sunrast_decoder
packed RGB 8:8:8, 24bpp, BGRBGR...
#define AVERROR_PATCHWELCOME
Not yet implemented in Libav, patches welcome.
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 int sunrast_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
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...
This structure stores compressed data.