36 unsigned int w,
h, depth,
type, maptype, maplength,
stride, x, y,
len, alen;
79 if (maplength > 768) {
115 len = (depth *
w + 7) >> 3;
122 if (buf_end - buf < (uint64_t)maplength + (
len *
h) * 3 / 256)
130 if (depth > 8 && maplength) {
131 av_log(avctx,
AV_LOG_WARNING,
"useless colormap found or file is corrupted, trying to recover\n");
133 }
else if (maplength) {
134 unsigned int len = maplength / 3;
142 for (x = 0; x <
len; x++, ptr += 4)
143 *(uint32_t *)ptr = (0xFFU<<24) + (buf[x]<<16) + (buf[
len+x]<<8) + buf[
len+
len+x];
148 if (maplength && depth < 8) {
152 stride = (
w + 15 >> 3) * depth;
163 while (ptr != end && buf < buf_end) {
165 if (buf_end - buf < 1)
185 for (y = 0; y <
h; y++) {
186 if (buf_end - buf < alen)
188 memcpy(ptr, buf,
len);
196 for (y=0; y<
h; y++) {
197 for (x = 0; x < (
w + 7 >> 3) * depth; x++) {
199 ptr[8*x] = ptr2[x] >> 7;
200 ptr[8*x+1] = ptr2[x] >> 6 & 1;
201 ptr[8*x+2] = ptr2[x] >> 5 & 1;
202 ptr[8*x+3] = ptr2[x] >> 4 & 1;
203 ptr[8*x+4] = ptr2[x] >> 3 & 1;
204 ptr[8*x+5] = ptr2[x] >> 2 & 1;
205 ptr[8*x+6] = ptr2[x] >> 1 & 1;
206 ptr[8*x+7] = ptr2[x] & 1;
208 ptr[2*x] = ptr2[x] >> 4;
209 ptr[2*x+1] = ptr2[x] & 0xF;
213 ptr2 += (
w + 15 >> 3) * depth;
220 return buf - bufstart;
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Libavcodec external API header.
common internal and external API header
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_PICTURE_TYPE_I
Intra.
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.
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_0BGR
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_0RGB
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
const char * name
Name of the codec implementation.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
enum AVPictureType pict_type
Picture type of the frame.
This structure stores compressed data.
AVCodec ff_sunrast_decoder
static int sunrast_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define RMT_RAW
the data layout of this map type is unknown
#define av_malloc_array(a, b)
#define avpriv_request_sample(...)